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 "pbd/signals.h"
25
#include <gdkmm/pixbuf.h>
26
#include <gtkmm/box.h>
27
#include <gtkmm/label.h>
28
#include <gtkmm/eventbox.h>
30
#include "gtkmm2ext/binding_proxy.h"
31
#include "gtkmm2ext/prolooks-helpers.h"
40
class MotionFeedback : public Gtk::VBox
49
MotionFeedback (Glib::RefPtr<Gdk::Pixbuf>,
51
boost::shared_ptr<PBD::Controllable>,
53
double step_increment,
54
double page_increment,
55
const char *widget_name = NULL,
56
bool with_numeric_display = true,
57
int sub_image_width = 40,
58
int sub_image_height = 40);
59
virtual ~MotionFeedback ();
61
Gtk::Widget& eventwin () { return pixwin; }
63
boost::shared_ptr<PBD::Controllable> controllable() const;
64
virtual void set_controllable (boost::shared_ptr<PBD::Controllable> c);
66
static void set_lamp_color (const std::string&);
68
static Glib::RefPtr<Gdk::Pixbuf> render_pixbuf (int size);
70
void set_print_func(void (*pf)(char buf[32], const boost::shared_ptr<PBD::Controllable>&, void *),
77
boost::shared_ptr<PBD::Controllable> _controllable;
83
void pixwin_size_request (GtkRequisition *);
85
bool pixwin_button_press_event (GdkEventButton *);
86
bool pixwin_button_release_event (GdkEventButton *);
87
bool pixwin_motion_notify_event (GdkEventMotion *);
88
bool pixwin_key_press_event (GdkEventKey *);
89
bool pixwin_enter_notify_event (GdkEventCrossing *);
90
bool pixwin_leave_notify_event (GdkEventCrossing *);
91
bool pixwin_focus_in_event (GdkEventFocus*);
92
bool pixwin_focus_out_event (GdkEventFocus *);
93
bool pixwin_expose_event (GdkEventExpose*);
94
bool pixwin_scroll_event (GdkEventScroll*);
96
/* map a display value (0.0 .. 1.0) to a control
97
value (controllable->lower() .. controllable()->upper)
99
virtual double to_control_value (double) = 0;
101
/* map a control value (controllable->lower() .. controllable()->upper)
102
to a display value (0.0 .. 1.0)
104
virtual double to_display_value (double) = 0;
106
virtual double adjust (double nominal_delta) = 0;
110
Gtk::EventBox pixwin;
111
Gtk::EventBox* value_packer;
112
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
113
BindingProxy binding_proxy;
114
static Gdk::Color* base_color;
116
void (*print_func) (char buf[32], const boost::shared_ptr<PBD::Controllable>&, void *);
118
static void default_printer (char buf[32], const boost::shared_ptr<PBD::Controllable>&, void *);
125
void controllable_value_changed ();
126
PBD::ScopedConnection controller_connection;
128
static void core_draw (cairo_t*, int, double, double, double, double, const GdkColor* bright, const GdkColor* dark);
133
#endif // __gtkmm2ext_motion_feedback_h__