summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-10-17 14:36:41 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-10-17 14:36:41 -0400
commit2fab8182cc1e40844652922acf56cc0d71bc2051 (patch)
tree40b0c16c36c5ceb8358633d0999e39f78619a154
parent2eabeebdc5010b7c590c38f0b444f75169b1d63c (diff)
add -fvisibility=hidden to libgtkmm2ext, and make things work
-rw-r--r--libs/ardour/ardour/midi_ui.h1
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc1
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/actions.h54
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/gtk_ui.h13
-rw-r--r--libs/gtkmm2ext/wscript2
-rw-r--r--libs/pbd/pbd/abstract_ui.h19
-rw-r--r--libs/pbd/pbd/libpbd_visibility.h2
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h1
-rw-r--r--libs/surfaces/osc/osc.h1
-rw-r--r--libs/surfaces/wiimote/wiimote.h1
10 files changed, 60 insertions, 35 deletions
diff --git a/libs/ardour/ardour/midi_ui.h b/libs/ardour/ardour/midi_ui.h
index 469f293770..e99d6bf499 100644
--- a/libs/ardour/ardour/midi_ui.h
+++ b/libs/ardour/ardour/midi_ui.h
@@ -22,6 +22,7 @@
#include <list>
+#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
#include "pbd/signals.h"
#include "pbd/stacktrace.h"
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index d9e4c871a6..fc94657f6d 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -43,6 +43,7 @@
#include "gtkmm2ext/actions.h"
#include "gtkmm2ext/activatable.h"
#include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/gui_thread.h"
#include "i18n.h"
diff --git a/libs/gtkmm2ext/gtkmm2ext/actions.h b/libs/gtkmm2ext/gtkmm2ext/actions.h
index 9101f8ea92..d92f85bb6e 100644
--- a/libs/gtkmm2ext/gtkmm2ext/actions.h
+++ b/libs/gtkmm2ext/gtkmm2ext/actions.h
@@ -28,67 +28,69 @@
#include <gtkmm/actiongroup.h>
#include <gtkmm/accelkey.h>
+#include "gtkmm2ext/visibility.h"
+
namespace Gtk {
class UIManager;
}
namespace ActionManager {
- extern std::string unbound_string; /* the key string returned if an action is not bound */
- extern Glib::RefPtr<Gtk::UIManager> ui_manager;
+ LIBGTKMM2EXT_API extern std::string unbound_string; /* the key string returned if an action is not bound */
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::UIManager> ui_manager;
- extern void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
- extern std::string get_key_representation (const std::string& accel_path, Gtk::AccelKey& key);
+ LIBGTKMM2EXT_API extern void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
+ LIBGTKMM2EXT_API extern std::string get_key_representation (const std::string& accel_path, Gtk::AccelKey& key);
- extern Gtk::Widget* get_widget (const char * name);
- extern Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
- extern Glib::RefPtr<Gtk::Action> get_action (const char* path);
- extern Glib::RefPtr<Gtk::Action> get_action_from_name (const char* name);
- extern void do_action (const char* group, const char* name);
- extern void set_toggle_action (const char* group, const char* name, bool);
+ LIBGTKMM2EXT_API extern Gtk::Widget* get_widget (const char * name);
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (const char* path);
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action_from_name (const char* name);
+ LIBGTKMM2EXT_API extern void do_action (const char* group, const char* name);
+ LIBGTKMM2EXT_API extern void set_toggle_action (const char* group, const char* name, bool);
- extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
+ LIBGTKMM2EXT_API extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
- extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label);
- extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label, sigc::slot<void> sl,
guint key, Gdk::ModifierType mods);
- extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label, sigc::slot<void> sl);
- extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
const char * name, const char * label, sigc::slot<void> sl,
guint key, Gdk::ModifierType mods);
- extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
const char * name, const char * label, sigc::slot<void> sl);
- extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
std::string const &, std::string const &, std::string const &, sigc::slot<void> sl);
- extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label, sigc::slot<void> sl,
guint key, Gdk::ModifierType mods);
- extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
std::string const &, std::string const &, std::string const &, sigc::slot<void> sl);
- extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
+ LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label, sigc::slot<void> sl);
- extern bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
+ LIBGTKMM2EXT_API extern bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
- extern void get_all_actions (std::vector<std::string>& names,
+ LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& names,
std::vector<std::string>& paths,
std::vector<std::string>& tooltips,
std::vector<std::string>& keys,
std::vector<Gtk::AccelKey>& bindings);
- extern void get_all_actions (std::vector<std::string>& groups,
+ LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& groups,
std::vector<std::string>& paths,
std::vector<std::string>& tooltips,
std::vector<Gtk::AccelKey>& bindings);
- extern void check_toggleaction (std::string);
- extern void uncheck_toggleaction (std::string);
- extern void set_toggleaction_state (std::string, bool);
+ LIBGTKMM2EXT_API extern void check_toggleaction (std::string);
+ LIBGTKMM2EXT_API extern void uncheck_toggleaction (std::string);
+ LIBGTKMM2EXT_API extern void set_toggleaction_state (std::string, bool);
};
#endif /* __libgtkmm2ext_actions_h__ */
diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
index 2e5cc11d23..b726eb89ac 100644
--- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
+++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
@@ -37,12 +37,13 @@
#include <gtkmm/textbuffer.h>
#include <gtkmm/main.h>
#include <gdkmm/color.h>
-#include <pbd/abstract_ui.h>
-#include <pbd/ringbufferNPT.h>
-
-#include <pbd/pool.h>
-#include <pbd/error.h>
-#include <pbd/receiver.h>
+
+#define ABSTRACT_UI_EXPORTS
+#include "pbd/abstract_ui.h"
+#include "pbd/ringbufferNPT.h"
+#include "pbd/pool.h"
+#include "pbd/error.h"
+#include "pbd/receiver.h"
#include "gtkmm2ext/visibility.h"
diff --git a/libs/gtkmm2ext/wscript b/libs/gtkmm2ext/wscript
index 7600c8a089..955b133d33 100644
--- a/libs/gtkmm2ext/wscript
+++ b/libs/gtkmm2ext/wscript
@@ -90,6 +90,8 @@ def build(bld):
obj.defines = [ 'LIBGTKMM2EXT_DLL=1', 'LIBGTKMM2EXT_DLL_EXPORTS=1' ]
# internal shared libs that we use
obj.defines += [ 'LIBPBD_DLL=1' ]
+ obj.cxxflags = [ '-fvisibility=hidden' ]
+ obj.cflags = [ '-fvisibility=hidden' ]
else:
obj = bld.stlib(features = 'c cxx cstlib cxxstlib', source=gtkmm2ext_sources)
obj.cxxflags = [ '-fPIC' ]
diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h
index e78cf1ce28..f78ba26090 100644
--- a/libs/pbd/pbd/abstract_ui.h
+++ b/libs/pbd/pbd/abstract_ui.h
@@ -32,10 +32,27 @@
#include "pbd/signals.h"
#include "pbd/base_ui.h"
+/* We have a special case in libpbd of a template class that gets instantiated
+ * as the base class of several classes in other libraries. It is not possible
+ * to use LIBFOO_API to mark this visible, because the FOO in each case is
+ * different. So we define this generic visible/export/hidden/import pair
+ * of macros to try to deal with this special case. These should NEVER be
+ * used anywhere except AbstractUI<T> (or similar cases if they arise.
+ *
+ * Note the assumption here that other libs are being built as DLLs if this one is.
+ */
+
+#ifdef ABSTRACT_UI_EXPORTS
+#define ABSTRACT_UI_API LIBPBD_DLL_EXPORT
+#else
+#define ABSTRACT_UI_API LIBPBD_DLL_IMPORT
+#endif
+
+
class Touchable;
template<typename RequestObject>
-class AbstractUI : public BaseUI
+class ABSTRACT_UI_API AbstractUI : public BaseUI /* see notes in visibility.h about why this is not LIBPBD_API */
{
public:
AbstractUI (const std::string& name);
diff --git a/libs/pbd/pbd/libpbd_visibility.h b/libs/pbd/pbd/libpbd_visibility.h
index 0aa309a4a4..e2c6235f0b 100644
--- a/libs/pbd/pbd/libpbd_visibility.h
+++ b/libs/pbd/pbd/libpbd_visibility.h
@@ -38,8 +38,6 @@
#define LIBPBD_DLL_IMPORT
#define LIBPBD_DLL_EXPORT
#define LIBPBD_DLL_LOCAL
- #define LIBPBD_DLL_IMPORT_CLASS
- #define LIBPBD_DLL_EXPORT_CLASS
#endif
#endif
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index 4669247726..81e1436938 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -28,6 +28,7 @@
#include <pthread.h>
#include <boost/smart_ptr.hpp>
+#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
#include "midi++/types.h"
#include "ardour/types.h"
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 84dd0d9c86..2479eceaff 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -31,6 +31,7 @@
#include <glibmm/main.h>
+#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
#include "ardour/types.h"
diff --git a/libs/surfaces/wiimote/wiimote.h b/libs/surfaces/wiimote/wiimote.h
index f6ac8edc41..6edadf6c64 100644
--- a/libs/surfaces/wiimote/wiimote.h
+++ b/libs/surfaces/wiimote/wiimote.h
@@ -23,6 +23,7 @@
#include <cwiid.h>
+#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
#include "ardour/types.h"
#include "control_protocol/control_protocol.h"