summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-04-05 03:23:38 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-04-05 03:23:52 +0200
commitc0165f8b48852a1aca782d606ba4f1ea48eee6ba (patch)
tree433441689808ca741889b078407bc49fade746de /tracker-pt
parenteb32a2ac02c6d1adcfeb0a1a5522f8aaea442489 (diff)
modules: now use i18n
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/export.hpp15
-rw-r--r--tracker-pt/module/export.hpp11
-rw-r--r--tracker-pt/module/module.cpp11
-rw-r--r--tracker-pt/module/module.hpp18
-rw-r--r--tracker-pt/pt-api.hpp16
-rw-r--r--tracker-pt/pt-settings.hpp1
6 files changed, 40 insertions, 32 deletions
diff --git a/tracker-pt/export.hpp b/tracker-pt/export.hpp
deleted file mode 100644
index cef63f83..00000000
--- a/tracker-pt/export.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// generates export.hpp for each module from compat/linkage.hpp
-
-#pragma once
-
-#if 0
-# include "compat/linkage-macros.hpp"
-# ifdef BUILD_TRACKER_PT
-# define OTR_PT_EXPORT OTR_GENERIC_EXPORT
-# else
-# define OTR_PT_EXPORT OTR_GENERIC_IMPORT
-# endif
-#else
-// static link
-# define OTR_PT_EXPORT
-#endif
diff --git a/tracker-pt/module/export.hpp b/tracker-pt/module/export.hpp
new file mode 100644
index 00000000..a733c9fe
--- /dev/null
+++ b/tracker-pt/module/export.hpp
@@ -0,0 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
+#pragma once
+
+#include "compat/linkage-macros.hpp"
+
+#ifdef BUILD_TRACKER_PT
+# define OTR_PT_EXPORT OTR_GENERIC_EXPORT
+#else
+# define OTR_PT_EXPORT OTR_GENERIC_IMPORT
+#endif
diff --git a/tracker-pt/module/module.cpp b/tracker-pt/module/module.cpp
index 5c298ca5..4731175a 100644
--- a/tracker-pt/module/module.cpp
+++ b/tracker-pt/module/module.cpp
@@ -1,6 +1,6 @@
#include "ftnoir_tracker_pt.h"
-#include "api/plugin-api.hpp"
+#include "module.hpp"
#include "camera.h"
#include "frame.hpp"
#include "point_extractor.h"
@@ -54,16 +54,13 @@ struct dialog_pt : TrackerDialog_PT
dialog_pt();
};
-class metadata_pt : public Metadata
-{
- QString name() { return _("PointTracker 1.1"); }
- QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); }
-};
-
// ns pt_module
using namespace pt_module;
dialog_pt::dialog_pt() : TrackerDialog_PT(module_name) {}
+QString metadata_pt::name() { return tr("PointTracker 1.1"); }
+QIcon metadata_pt::icon() { return QIcon(":/Resources/Logo_IR.png"); }
+
OPENTRACK_DECLARE_TRACKER(tracker_pt, dialog_pt, metadata_pt)
diff --git a/tracker-pt/module/module.hpp b/tracker-pt/module/module.hpp
new file mode 100644
index 00000000..4a2cb919
--- /dev/null
+++ b/tracker-pt/module/module.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "api/plugin-api.hpp"
+#include <QtGlobal>
+#include <QIcon>
+
+namespace pt_module
+{
+
+class Q_DECL_EXPORT metadata_pt : public Metadata
+{
+ Q_OBJECT
+
+ QString name();
+ QIcon icon();
+};
+
+} // ns pt_module
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp
index de097a04..ba200253 100644
--- a/tracker-pt/pt-api.hpp
+++ b/tracker-pt/pt-api.hpp
@@ -1,7 +1,5 @@
#pragma once
-#include "export.hpp"
-
#include "pt-settings.hpp"
#include "cv/numeric.hpp"
@@ -15,7 +13,7 @@
#include <QImage>
-struct OTR_PT_EXPORT pt_camera_info final
+struct pt_camera_info final
{
typedef typename types::f f;
@@ -30,13 +28,13 @@ struct OTR_PT_EXPORT pt_camera_info final
int idx = -1;
};
-struct OTR_PT_EXPORT pt_pixel_pos_mixin
+struct pt_pixel_pos_mixin
{
static std::tuple<double, double> to_pixel_pos(double x, double y, int w, int h);
static std::tuple<double, double> to_screen_pos(double px, double py, int w, int h);
};
-struct OTR_PT_EXPORT pt_frame : pt_pixel_pos_mixin
+struct pt_frame : pt_pixel_pos_mixin
{
pt_frame();
virtual ~pt_frame();
@@ -57,14 +55,14 @@ struct OTR_PT_EXPORT pt_frame : pt_pixel_pos_mixin
}
};
-struct OTR_PT_EXPORT pt_preview : pt_frame
+struct pt_preview : pt_frame
{
virtual pt_preview& operator=(const pt_frame&) = 0;
virtual QImage get_bitmap() = 0;
virtual void draw_head_center(double x, double y) = 0;
};
-struct OTR_PT_EXPORT pt_camera
+struct pt_camera
{
using result = std::tuple<bool, pt_camera_info>;
@@ -85,7 +83,7 @@ struct OTR_PT_EXPORT pt_camera
virtual void show_camera_settings() = 0;
};
-struct OTR_PT_EXPORT pt_point_extractor : pt_pixel_pos_mixin
+struct pt_point_extractor : pt_pixel_pos_mixin
{
using vec2 = types::vec2;
@@ -96,7 +94,7 @@ struct OTR_PT_EXPORT pt_point_extractor : pt_pixel_pos_mixin
static double threshold_radius_value(int w, int h, int threshold);
};
-struct OTR_PT_EXPORT pt_runtime_traits
+struct pt_runtime_traits
{
template<typename t> using pointer = std::shared_ptr<t>;
diff --git a/tracker-pt/pt-settings.hpp b/tracker-pt/pt-settings.hpp
index 471bb941..a1b9d4f6 100644
--- a/tracker-pt/pt-settings.hpp
+++ b/tracker-pt/pt-settings.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include "export.hpp"
#include "options/options.hpp"
#include <QString>