first compiling, mostly working version of group controls changes
[ardour.git] / gtk2_ardour / ui_config.h
index c9f950d94790bfc39bd6181723c33c02ccb51a6e..06338aae39f6ee91f13362c59a18ea3ad2238d3e 100644 (file)
@@ -27,6 +27,8 @@
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
 
+#include "ardour/types.h" // required for opeators used in pbd/configuration_variable.h
+
 #include "pbd/stateful.h"
 #include "pbd/xml++.h"
 #include "pbd/configuration_variable.h"
 
 class UIConfiguration : public PBD::Stateful
 {
-    public:
+private:
        UIConfiguration();
        ~UIConfiguration();
 
-       static UIConfiguration* instance() { return _instance; }
+    public:
+       static UIConfiguration& instance();
 
        void load_rc_file (bool themechange, bool allow_own = true);
 
        int load_state ();
        int save_state ();
        int load_defaults ();
+       int load_color_theme (bool allow_own=true);
 
        int set_state (const XMLNode&, int version);
        XMLNode& get_state (void);
@@ -65,7 +69,7 @@ class UIConfiguration : public PBD::Stateful
        void set_alias (std::string const & name, std::string const & alias);
        void set_color (const std::string& name, ArdourCanvas::Color);
        void set_modifier (std::string const &, ArdourCanvas::SVAModifier svam);
-       
+
        std::string color_as_alias (ArdourCanvas::Color c);
        ArdourCanvas::Color quantized (ArdourCanvas::Color) const;
 
@@ -74,12 +78,31 @@ class UIConfiguration : public PBD::Stateful
        ArdourCanvas::Color color_mod (const ArdourCanvas::Color& color, std::string const & modifier) const;
        ArdourCanvas::HSV  color_hsv (const std::string&) const;
        ArdourCanvas::SVAModifier modifier (const std::string&) const;
-               
-        sigc::signal<void,std::string> ParameterChanged;
+
+       sigc::signal<void>  ColorsChanged;
+
+       void reset_dpi ();
+       void set_pango_fontsize ();
+
+       float get_ui_scale ();
+
+       sigc::signal<void>  DPIReset;
+
+       sigc::signal<void,std::string> ParameterChanged;
        void map_parameters (boost::function<void (std::string)>&);
 
        void parameter_changed (std::string);
-       
+
+       /** called before initializing any part of the GUI. Sets up
+        *  any runtime environment required to make the GUI work
+        *  in specific ways.
+        */
+       int pre_gui_init ();
+
+       /** called after the GUI toolkit has been initialized.
+        */
+       UIConfiguration* post_gui_init ();
+
 #undef UI_CONFIG_VARIABLE
 #define UI_CONFIG_VARIABLE(Type,var,name,value) \
        Type get_##var () const { return var.get(); } \
@@ -109,8 +132,6 @@ class UIConfiguration : public PBD::Stateful
        bool aliases_modified;
        bool colors_modified;
        bool modifiers_modified;
-       
-       static UIConfiguration* _instance;
 
        int store_color_theme ();
        void load_color_aliases (XMLNode const &);
@@ -118,7 +139,6 @@ class UIConfiguration : public PBD::Stateful
        void load_modifiers (XMLNode const &);
        void reset_gtk_theme ();
        void colors_changed ();
-       int load_color_theme (bool allow_own=true);
 
        uint32_t block_save;
 };