pixbufs instead of pixmaps; function-scope local fd's for reading from a FileSource
[ardour.git] / libs / gtkmm2ext / gtkmm2ext / pixscroller.h
1 #ifndef __gtkmm2ext_pixscroller_h__ 
2 #define __gtkmm2ext_pixscroller_h__
3
4 #include <gtkmm/drawingarea.h>
5 #include <gtkmm/adjustment.h>
6 #include <gdkmm.h>
7
8 namespace Gtkmm2ext {
9
10 class PixScroller : public Gtk::DrawingArea
11 {
12   public:
13         PixScroller(Gtk::Adjustment& adjustment, 
14                     Glib::RefPtr<Gdk::Pixbuf> slider,
15                     Glib::RefPtr<Gdk::Pixbuf> rail);
16
17         bool on_expose_event (GdkEventExpose*);
18         bool on_motion_notify_event (GdkEventMotion*);
19         bool on_button_press_event (GdkEventButton*);
20         bool on_button_release_event (GdkEventButton*);
21         void on_size_request (GtkRequisition*);
22
23   protected:
24         Gtk::Adjustment& adj;
25
26   private:
27         Glib::RefPtr<Gdk::Pixbuf> rail;
28         Glib::RefPtr<Gdk::Pixbuf> slider;
29         Gdk::Rectangle sliderrect;
30         Gdk::Rectangle railrect;
31         GdkWindow* grab_window;
32         double grab_y;
33         double grab_start;
34         int overall_height;
35         bool dragging;
36         
37         float default_value;
38
39         void adjustment_changed ();
40 };
41
42 } // namespace
43
44 #endif /* __gtkmm2ext_pixscroller_h__ */