summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gui/keyboard.h2
-rw-r--r--opentrack-dinput/CMakeLists.txt4
-rw-r--r--opentrack-dinput/dinput.cpp (renamed from opentrack-logic/dinput.cpp)0
-rw-r--r--opentrack-dinput/dinput.hpp (renamed from opentrack-logic/dinput.hpp)2
-rw-r--r--opentrack-dinput/export.hpp28
-rw-r--r--opentrack-dinput/keybinding-worker.cpp (renamed from opentrack-logic/keybinding-worker.cpp)0
-rw-r--r--opentrack-dinput/keybinding-worker.hpp (renamed from opentrack-logic/keybinding-worker.hpp)6
-rw-r--r--opentrack-dinput/win32-joystick.cpp (renamed from opentrack-logic/win32-joystick.cpp)0
-rw-r--r--opentrack-dinput/win32-joystick.hpp (renamed from opentrack-logic/win32-joystick.hpp)2
-rw-r--r--opentrack-logic/CMakeLists.txt2
-rw-r--r--opentrack-logic/shortcuts.h2
-rw-r--r--tracker-joystick/CMakeLists.txt2
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.h2
13 files changed, 43 insertions, 9 deletions
diff --git a/gui/keyboard.h b/gui/keyboard.h
index 07f326ea..27300690 100644
--- a/gui/keyboard.h
+++ b/gui/keyboard.h
@@ -2,7 +2,7 @@
#include "ui_keyboard_listener.h"
#ifdef _WIN32
#include "opentrack-logic/win32-shortcuts.h"
-#include "opentrack-logic/keybinding-worker.hpp"
+#include "opentrack-dinput/keybinding-worker.hpp"
#endif
#include <QLabel>
#include <QKeyEvent>
diff --git a/opentrack-dinput/CMakeLists.txt b/opentrack-dinput/CMakeLists.txt
new file mode 100644
index 00000000..ed0b5990
--- /dev/null
+++ b/opentrack-dinput/CMakeLists.txt
@@ -0,0 +1,4 @@
+if(WIN32)
+ opentrack_boilerplate(opentrack-dinput BIN)
+ target_link_libraries(opentrack-dinput dinput)
+endif()
diff --git a/opentrack-logic/dinput.cpp b/opentrack-dinput/dinput.cpp
index ce80fe0e..ce80fe0e 100644
--- a/opentrack-logic/dinput.cpp
+++ b/opentrack-dinput/dinput.cpp
diff --git a/opentrack-logic/dinput.hpp b/opentrack-dinput/dinput.hpp
index 205fc656..db901887 100644
--- a/opentrack-logic/dinput.hpp
+++ b/opentrack-dinput/dinput.hpp
@@ -9,7 +9,7 @@
#include <dinput.h>
#include <windows.h>
-struct OPENTRACK_LOGIC_EXPORT dinput_handle final
+struct OPENTRACK_DINPUT_EXPORT dinput_handle final
{
using di_t = LPDIRECTINPUT8;
private:
diff --git a/opentrack-dinput/export.hpp b/opentrack-dinput/export.hpp
new file mode 100644
index 00000000..51ee4531
--- /dev/null
+++ b/opentrack-dinput/export.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#ifdef BUILD_dinput
+# ifdef _WIN32
+# define OPENTRACK_DINPUT_LINKAGE __declspec(dllexport)
+# else
+# define OPENTRACK_DINPUT_LINKAGE
+# endif
+
+# ifndef _MSC_VER
+# define OPENTRACK_DINPUT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_DINPUT_LINKAGE
+# else
+# define OPENTRACK_DINPUT_EXPORT OPENTRACK_DINPUT_LINKAGE
+# endif
+
+#else
+#ifdef _WIN32
+# define OPENTRACK_DINPUT_LINKAGE __declspec(dllimport)
+#else
+# define OPENTRACK_DINPUT_LINKAGE
+#endif
+
+#ifndef _MSC_VER
+# define OPENTRACK_DINPUT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_DINPUT_LINKAGE
+#else
+# define OPENTRACK_DINPUT_EXPORT OPENTRACK_DINPUT_LINKAGE
+#endif
+#endif
diff --git a/opentrack-logic/keybinding-worker.cpp b/opentrack-dinput/keybinding-worker.cpp
index a009d399..a009d399 100644
--- a/opentrack-logic/keybinding-worker.cpp
+++ b/opentrack-dinput/keybinding-worker.cpp
diff --git a/opentrack-logic/keybinding-worker.hpp b/opentrack-dinput/keybinding-worker.hpp
index e38e5046..439d2066 100644
--- a/opentrack-logic/keybinding-worker.hpp
+++ b/opentrack-dinput/keybinding-worker.hpp
@@ -24,7 +24,9 @@
#define DIRECTINPUT_VERSION 0x0800
#include <windows.h>
#include <dinput.h>
-struct Key {
+
+struct OPENTRACK_DINPUT_EXPORT Key
+{
BYTE keycode;
QString guid;
bool shift;
@@ -39,7 +41,7 @@ public:
bool should_process();
};
-struct OPENTRACK_LOGIC_EXPORT KeybindingWorker : private QThread
+struct OPENTRACK_DINPUT_EXPORT KeybindingWorker : private QThread
{
using fun = std::function<void(const Key&)>;
diff --git a/opentrack-logic/win32-joystick.cpp b/opentrack-dinput/win32-joystick.cpp
index fa1a8060..fa1a8060 100644
--- a/opentrack-logic/win32-joystick.cpp
+++ b/opentrack-dinput/win32-joystick.cpp
diff --git a/opentrack-logic/win32-joystick.hpp b/opentrack-dinput/win32-joystick.hpp
index f8c2e7e4..c4fcdde2 100644
--- a/opentrack-logic/win32-joystick.hpp
+++ b/opentrack-dinput/win32-joystick.hpp
@@ -28,7 +28,7 @@ struct hash<QString>
};
}
-struct OPENTRACK_LOGIC_EXPORT win32_joy_ctx
+struct OPENTRACK_DINPUT_EXPORT win32_joy_ctx
{
using fn = std::function<void(const QString& guid, int btn, bool held)>;
diff --git a/opentrack-logic/CMakeLists.txt b/opentrack-logic/CMakeLists.txt
index 87175454..88b0240f 100644
--- a/opentrack-logic/CMakeLists.txt
+++ b/opentrack-logic/CMakeLists.txt
@@ -3,5 +3,5 @@ target_link_libraries(opentrack-logic opentrack-spline-widget)
if(NOT WIN32)
target_link_libraries(opentrack-logic opentrack-qxt-mini)
else()
- target_link_libraries(opentrack-logic winmm)
+ target_link_libraries(opentrack-logic opentrack-dinput winmm)
endif()
diff --git a/opentrack-logic/shortcuts.h b/opentrack-logic/shortcuts.h
index d6a87672..b44864ba 100644
--- a/opentrack-logic/shortcuts.h
+++ b/opentrack-logic/shortcuts.h
@@ -19,7 +19,7 @@
#include "main-settings.hpp"
#ifdef _WIN32
-# include "keybinding-worker.hpp"
+# include "opentrack-dinput/keybinding-worker.hpp"
#endif
#if defined(__GNUC__) && !defined(_WIN32)
diff --git a/tracker-joystick/CMakeLists.txt b/tracker-joystick/CMakeLists.txt
index e0b6f281..03f14b62 100644
--- a/tracker-joystick/CMakeLists.txt
+++ b/tracker-joystick/CMakeLists.txt
@@ -1,5 +1,5 @@
if(WIN32)
opentrack_boilerplate(opentrack-tracker-joystick)
- target_link_libraries(opentrack-tracker-joystick opentrack-logic)
+ target_link_libraries(opentrack-tracker-joystick opentrack-dinput)
endif()
diff --git a/tracker-joystick/ftnoir_tracker_joystick.h b/tracker-joystick/ftnoir_tracker_joystick.h
index 31f1dee7..2d776ebf 100644
--- a/tracker-joystick/ftnoir_tracker_joystick.h
+++ b/tracker-joystick/ftnoir_tracker_joystick.h
@@ -17,7 +17,7 @@
#include <cmath>
#include "opentrack/plugin-api.hpp"
-#include "opentrack-logic/win32-joystick.hpp"
+#include "opentrack-dinput/win32-joystick.hpp"
#include "opentrack-compat/options.hpp"
using namespace options;