X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtkmm2ext%2Fbarcontroller.h;h=f529c5c557554eac7a964120b535532a7915c372;hb=7f5fcd478917311b11b34a5333e8b7ce929bbe09;hp=c65d8abe81872b8fff15d3b28f06129918789757;hpb=d116af22db3c0e0cf6aeff6194a689d8bfad7c8c;p=ardour.git diff --git a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h index c65d8abe81..f529c5c557 100644 --- a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h +++ b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 Paul Davis + Copyright (C) 2004 Paul Davis 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 2 of the License, or @@ -19,48 +19,32 @@ #ifndef __gtkmm2ext_bar_controller_h__ #define __gtkmm2ext_bar_controller_h__ -#include -#include -#include +#include +#include +#include "gtkmm2ext/visibility.h" +#include "gtkmm2ext/binding_proxy.h" +#include "gtkmm2ext/slider_controller.h" namespace Gtkmm2ext { -class BarController : public Gtk::Frame +class LIBGTKMM2EXT_API BarController : public Gtk::Alignment { public: BarController (Gtk::Adjustment& adj, boost::shared_ptr); - virtual ~BarController () {} - - enum barStyle { - LeftToRight, - RightToLeft, - Line, - Blob, - CenterOut, - - TopToBottom, - BottomToTop - }; - - barStyle style() const { return _style; } - void set_style (barStyle); - void set_use_parent (bool yn); + virtual ~BarController (); void set_sensitive (bool yn); - - void set_logarithmic (bool yn) { logarithmic = yn; } + + PixFader::Tweaks tweaks() const { return _slider.tweaks (); } + void set_tweaks (PixFader::Tweaks t) { _slider.set_tweaks (t);} sigc::signal StartGesture; sigc::signal StopGesture; /* export this to allow direct connection to button events */ - - Gtk::Widget& event_widget() { return darea; } - - boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } - void set_controllable(boost::shared_ptr c) { binding_proxy.set_controllable(c); } + Gtk::Widget& event_widget() { return _slider; } /** Emitted when the adjustment spinner is activated or deactivated; * the parameter is true on activation, false on deactivation. @@ -68,47 +52,32 @@ class BarController : public Gtk::Frame sigc::signal SpinnerActive; protected: - Gtk::Adjustment& adjustment; - BindingProxy binding_proxy; - Gtk::DrawingArea darea; - Glib::RefPtr layout; - barStyle _style; - bool grabbed; - bool switching; - bool switch_on_release; - double initial_value; - double grab_x; - GdkWindow* grab_window; - Gtk::SpinButton spinner; - bool use_parent; - bool logarithmic; - sigc::slot _label_slot; - bool _use_slot; - - virtual std::string get_label (int& /*x*/) { + bool on_button_press_event (GdkEventButton*); + bool on_button_release_event (GdkEventButton*); + void on_style_changed (const Glib::RefPtr&); + + virtual std::string get_label (double& /*x*/) { return ""; } - - virtual bool button_press (GdkEventButton *); - virtual bool button_release (GdkEventButton *); - virtual bool motion (GdkEventMotion *); - virtual bool expose (GdkEventExpose *); - virtual bool scroll (GdkEventScroll *); - virtual bool entry_focus_out (GdkEventFocus*); - gint mouse_control (double x, GdkWindow* w, double scaling); + private: + HSliderController _slider; + bool entry_focus_out (GdkEventFocus*); + void entry_activated (); + void before_expose (); gint switch_to_bar (); gint switch_to_spinner (); - void entry_activated (); - void drop_grab (); - - int entry_input (double* new_value); - bool entry_output (); + bool _switching; + bool _switch_on_release; + + + void passtrhu_gesture_start() { StartGesture (); } + void passtrhu_gesture_stop() { StopGesture (); } }; }; /* namespace */ -#endif // __gtkmm2ext_bar_controller_h__ +#endif // __gtkmm2ext_bar_controller_h__