ardour
barcontroller.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004 Paul Davis
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 
17 */
18 
19 #ifndef __gtkmm2ext_bar_controller_h__
20 #define __gtkmm2ext_bar_controller_h__
21 
22 #include <gtkmm/alignment.h>
23 #include <cairo.h>
24 
25 #include "gtkmm2ext/visibility.h"
28 
29 namespace Gtkmm2ext {
30 
31 class LIBGTKMM2EXT_API BarController : public Gtk::Alignment
32 {
33  public:
35 
36  virtual ~BarController ();
37 
38  void set_sensitive (bool yn);
39 
40  PixFader::Tweaks tweaks() const { return _slider.tweaks (); }
41  void set_tweaks (PixFader::Tweaks t) { _slider.set_tweaks (t);}
42 
43  sigc::signal<void> StartGesture;
44  sigc::signal<void> StopGesture;
45 
46  /* export this to allow direct connection to button events */
47  Gtk::Widget& event_widget() { return _slider; }
48 
52  sigc::signal<void, bool> SpinnerActive;
53 
54  protected:
55  bool on_button_press_event (GdkEventButton*);
56  bool on_button_release_event (GdkEventButton*);
57  void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
58 
59  virtual std::string get_label (double& /*x*/) {
60  return "";
61  }
62 
63  private:
65  bool entry_focus_out (GdkEventFocus*);
66  void entry_activated ();
67  void before_expose ();
68 
69  gint switch_to_bar ();
70  gint switch_to_spinner ();
71 
72  bool _switching;
74 
75 
76  void passtrhu_gesture_start() { StartGesture (); }
77  void passtrhu_gesture_stop() { StopGesture (); }
78 };
79 
80 
81 }; /* namespace */
82 
83 #endif // __gtkmm2ext_bar_controller_h__
void set_tweaks(PixFader::Tweaks t)
Definition: barcontroller.h:41
LIBGTKMM2EXT_API
sigc::signal< void > StartGesture
Definition: barcontroller.h:43
LIBGTKMM2EXT_API void set_sensitive(std::vector< Glib::RefPtr< Gtk::Action > > &actions, bool)
sigc::signal< void, bool > SpinnerActive
Definition: barcontroller.h:52
HSliderController _slider
Definition: barcontroller.h:64
Gtk::Widget & event_widget()
Definition: barcontroller.h:47
virtual std::string get_label(double &)
Definition: barcontroller.h:59
PixFader::Tweaks tweaks() const
Definition: barcontroller.h:40
sigc::signal< void > StopGesture
Definition: barcontroller.h:44