summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_hatire
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-16 11:29:59 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-16 11:29:59 +0200
commitb0b7c2b0e1762a7c0058e7f507a3b7cc9a03daf6 (patch)
tree246864539eba1669fc19a2007038dfb692a04788 /ftnoir_tracker_hatire
parentdfbe00cb1d9ce4cb52448cf4c1d577fe7b1eaad7 (diff)
all: use macros for symbol exposure
Diffstat (limited to 'ftnoir_tracker_hatire')
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp8
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.h17
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp3
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp102
4 files changed, 14 insertions, 116 deletions
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
index 5a4e9c74..72b7d3ed 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
@@ -603,11 +603,13 @@ void FTNoIR_Tracker::Log(QString message)
// _GetTracker@0 - Common name decoration for __stdcall functions in C language.
////////////////////////////////////////////////////////////////////////////////
#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
+#include "ftnoir_tracker_hat_dialog.h"
+OPENTRACK_DECLARE_TRACKER(FTNoIR_Tracker, TrackerControls, TrackerDll)
#else
#pragma comment(linker, "/export:GetTracker=_GetTracker@0")
FTNOIR_TRACKER_BASE_EXPORT ITrackerPtr __stdcall GetTracker()
-#endif
{
- return new FTNoIR_Tracker;
+ return new FTNoIR_Tracker;
}
+#endif
+
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
index 9471ebfb..e3c5a26b 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
@@ -123,36 +123,35 @@ private:
//*******************************************************************************************************
// FaceTrackNoIR Tracker DLL. Functions used to get general info on the Tracker
//*******************************************************************************************************
-class TrackerDll :
#if defined(OPENTRACK_API)
-public Metadata
+class TrackerDll : public Metadata
+{
+ QString name() { return QString("Hatire Arduino"); }
+ QIcon icon() { return QIcon(":/images/hatire.png"); }
+};
#else
+class TrackerDll :
+public Metadata
public ITrackerDll
-#endif
{
public:
TrackerDll();
~TrackerDll();
-#ifndef OPENTRACK_API
void Initialize();
-#endif
-#ifdef OPENTRACK_API
QString name();
QIcon icon();
-#else
void getFullName(QString *strToBeFilled);
void getShortName(QString *strToBeFilled);
void getDescription(QString *strToBeFilled);
void getIcon(QIcon *icon);
-#endif
private:
QString trackerFullName; // Trackers' name and description
QString trackerShortName;
QString trackerDescription;
};
-
+#endif
#endif // FTNOIR_TRACKER_HAT_H
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
index b22e3b15..901f0ec9 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
@@ -418,12 +418,11 @@ void TrackerControls::unRegisterTracker()
// Win32 API function.
// _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language.
#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
#else
#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0")
FTNOIR_TRACKER_BASE_EXPORT ITrackerDialogPtr __stdcall GetTrackerDialog( )
-#endif
{
return new TrackerControls;
}
+#endif
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp
deleted file mode 100644
index 66fead4f..00000000
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* Homepage: http://facetracknoir.sourceforge.net/home/default.htm *
-* *
-* Copyright (C) 2012 FuraX49 (HAT Tracker plugins) *
-* Homepage: http://hatire.sourceforge.net *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-
-#include "ftnoir_tracker_hat.h"
-#include <QIcon>
-#include <QDebug>
-
-TrackerDll::TrackerDll() {
- //populate the description strings
- trackerFullName = "Hatire Arduino";
- trackerShortName = "HAT";
- trackerDescription = "FaceTrackNoIR HAT";
-}
-
-TrackerDll::~TrackerDll()
-{
-
-}
-
-#ifndef OPENTRACK_API
-void TrackerDll::Initialize()
-{
- return;
-}
-#endif
-
-#ifndef OPENTRACK_API
-void TrackerDll::getFullName(QString *strToBeFilled)
-{
- *strToBeFilled = trackerFullName;
-}
-
-void TrackerDll::getShortName(QString *strToBeFilled)
-{
- *strToBeFilled = trackerShortName;
-}
-
-void TrackerDll::getDescription(QString *strToBeFilled)
-{
- *strToBeFilled = trackerDescription;
-}
-
-void TrackerDll::getIcon(QIcon *icon)
-{
- *icon = QIcon(":/images/hat.png");
-}
-#else
-
-QString TrackerDll::name()
-{
- return trackerFullName;
-}
-
-QIcon TrackerDll::icon()
-{
- return QIcon(":/images/hat.png");
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Factory function that creates instances if the Tracker object.
-
-// Export both decorated and undecorated names.
-// GetTrackerDll - Undecorated name, which can be easily used with GetProcAddress
-// Win32 API function.
-// _GetTrackerDll@0 - Common name decoration for __stdcall functions in C language.
-
-#ifdef OPENTRACK_API
-# include "opentrack/plugin-support.hpp"
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-#else
-# pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0")
-FTNOIR_TRACKER_BASE_EXPORT ITrackerDllPtr __stdcall GetTrackerDll()
-#endif
-{
- return new TrackerDll;
-}