Ardour  9.0-pre0-582-g084a23a80d
scroomer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _WIDGETS_SCROOMER_H_
21 #define _WIDGETS_SCROOMER_H_
22 
23 #include <gdkmm.h>
24 #include <gtkmm/drawingarea.h>
25 #include <gtkmm/adjustment.h>
26 
27 #include "widgets/visibility.h"
28 
29 namespace ArdourWidgets {
30 
32 {
33 public:
34  enum Component {
35  TopBase = 0,
36  Handle1 = 1,
37  Slider = 2,
38  Handle2 = 3,
39  BottomBase = 4,
40  Total = 5,
41  None = 6
42  };
43 
44  Scroomer(Gtk::Adjustment& adjustment);
46 
52 
54 
55  Component point_in(double point) const;
56 
57  void set_min_page_size(double page_size);
58  int get_handle_size() { return handle_size; }
59 
60  inline int position_of(Component comp) { return position[comp]; }
61 
62  sigc::signal0<void> DragStarting;
63  sigc::signal0<void> DragFinishing;
64 
65  sigc::signal0<void> DoubleClicked;
66 
67 protected:
69 
70 private:
71  struct UpdateRect {
74  };
75 
76  void update();
78 
79  int position[6];
80  int old_pos[6];
82  double min_page_size;
85  double grab_y;
86  double unzoomed_val;
87  double unzoomed_page;
88  bool pinch;
89 };
90 
91 } /* end namespace */
92 
93 #endif
void None
Definition: TypeList.h:49
sigc::signal0< void > DoubleClicked
Definition: scroomer.h:65
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
GdkWindow * grab_window
Definition: scroomer.h:83
Gtk::Adjustment & adj
Definition: scroomer.h:68
sigc::signal0< void > DragFinishing
Definition: scroomer.h:63
sigc::signal0< void > DragStarting
Definition: scroomer.h:62
int position_of(Component comp)
Definition: scroomer.h:60
void set_min_page_size(double page_size)
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
Scroomer(Gtk::Adjustment &adjustment)
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
virtual void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
Component point_in(double point) const
void set_comp_rect(GdkRectangle &, Component) const
#define LIBWIDGETS_API