diff options
author | Robin Gareus <robin@gareus.org> | 2014-09-02 04:46:34 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-09-02 05:14:14 +0200 |
commit | 41ccf6a806febdb1d9ce9f8f5bd64cdfb56a0301 (patch) | |
tree | 95d721aa4e6227f5e6b22bbebf705be5a7c658e9 /libs/gtkmm2ext/gtkmm2ext/pixfader.h | |
parent | 3bfe91c01096641a4235a58ce94292ae24b63617 (diff) |
clean up pixfader API, prepare for merge w/BarController
Diffstat (limited to 'libs/gtkmm2ext/gtkmm2ext/pixfader.h')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/pixfader.h | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/pixfader.h b/libs/gtkmm2ext/gtkmm2ext/pixfader.h index bc08f9bca9..272c7a7b20 100644 --- a/libs/gtkmm2ext/gtkmm2ext/pixfader.h +++ b/libs/gtkmm2ext/gtkmm2ext/pixfader.h @@ -33,18 +33,22 @@ namespace Gtkmm2ext { class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea { - public: - PixFader (Gtk::Adjustment& adjustment, int orientation, int span, int girth); + public: + PixFader (Gtk::Adjustment& adjustment, int orientation, int span, int girth); virtual ~PixFader (); + sigc::signal<void> StartGesture; + sigc::signal<void> StopGesture; + sigc::signal<void> OnExpose; + void set_default_value (float); - void set_text (const std::string&); + void set_text (const std::string&, bool); - protected: + protected: Glib::RefPtr<Pango::Layout> _layout; std::string _text; - int _text_width; - int _text_height; + int _text_width; + int _text_height; Gtk::Adjustment& adjustment; @@ -61,17 +65,36 @@ class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea void on_state_changed (Gtk::StateType); void on_style_changed (const Glib::RefPtr<Gtk::Style>&); - Gdk::Color get_parent_bg (); enum Orientation { VERT, HORIZ, }; - private: - int span, girth; + private: + int _span; + int _girth; int _orien; - cairo_pattern_t* pattern; + cairo_pattern_t* _pattern; + bool _hovering; + GdkWindow* _grab_window; + double _grab_loc; + double _grab_start; + int _last_drawn; + bool _dragging; + float _default_value; + int _unity_loc; + bool _centered_text; + + sigc::connection _parent_style_change; + Widget * _current_parent; + Gdk::Color get_parent_bg (); + + void create_patterns(); + void adjustment_changed (); + void set_adjustment_from_event (GdkEventButton *); + void update_unity_position (); + int display_span (); struct FaderImage { cairo_pattern_t* pattern; @@ -118,27 +141,9 @@ class LIBGTKMM2EXT_API PixFader : public Gtk::DrawingArea double abr, double abg, double abb, int w, int h); - bool _hovering; - - GdkWindow* grab_window; - double grab_loc; - double grab_start; - int last_drawn; - bool dragging; - float default_value; - int unity_loc; - - void adjustment_changed (); - int display_span (); - void set_adjustment_from_event (GdkEventButton *); - void update_unity_position (); - - sigc::connection _parent_style_change; - Widget * _current_parent; - void create_patterns(); }; } /* namespace */ - #endif /* __gtkmm2ext_pixfader_h__ */ +#endif /* __gtkmm2ext_pixfader_h__ */ |