2 Copyright (C) 1998-99 Paul Barton-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.
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.
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.
17 $Id: motionfeedback.h,v 1.1.1.1 2001/11/24 00:44:46 pbd Exp $
20 #ifndef __gtkmm2ext_motion_feedback_h__
21 #define __gtkmm2ext_motion_feedback_h__
23 #include <gdkmm/pixbuf.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/eventbox.h>
27 #include "gtkmm2ext/binding_proxy.h"
28 #include "gtkmm2ext/prolooks-helpers.h"
37 class MotionFeedback : public Gtk::VBox
46 MotionFeedback (Glib::RefPtr<Gdk::Pixbuf>,
48 const char *widget_name = NULL,
49 Gtk::Adjustment *adj = NULL,
50 bool with_numeric_display = true,
51 int sub_image_width = 40,
52 int sub_image_height = 40);
53 virtual ~MotionFeedback ();
55 void set_adjustment (Gtk::Adjustment *adj);
56 Gtk::Adjustment *get_adjustment () { return adjustment; }
58 Gtk::Widget& eventwin () { return pixwin; }
59 Gtk::SpinButton& spinner() const { return *value; }
61 gfloat lower () { return _lower; }
62 gfloat upper () { return _upper; }
63 gfloat range () { return _range; }
65 void set_controllable (boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable (c); }
66 void set_lamp_color (const Gdk::Color&);
73 void pixwin_size_request (GtkRequisition *);
75 bool pixwin_button_press_event (GdkEventButton *);
76 bool pixwin_button_release_event (GdkEventButton *);
77 bool pixwin_motion_notify_event (GdkEventMotion *);
78 bool pixwin_key_press_event (GdkEventKey *);
79 bool pixwin_enter_notify_event (GdkEventCrossing *);
80 bool pixwin_leave_notify_event (GdkEventCrossing *);
81 bool pixwin_focus_in_event (GdkEventFocus*);
82 bool pixwin_focus_out_event (GdkEventFocus *);
83 bool pixwin_expose_event (GdkEventExpose*);
84 bool pixwin_scroll_event (GdkEventScroll*);
85 void pixwin_realized ();
90 Gtk::HBox* value_packer;
91 Gtk::SpinButton* value;
92 Gtk::Adjustment* adjustment;
93 Glib::RefPtr<Gdk::Pixbuf> pixbuf;
94 BindingProxy binding_proxy;
102 bool i_own_my_adjustment;
105 void adjustment_changed ();
107 ProlooksHSV* lamp_hsv;
108 Gdk::Color _lamp_color;
109 GdkColor lamp_bright;
112 void core_draw (cairo_t*, int, double, double, double);
117 #endif // __gtkmm2ext_motion_feedback_h__