Ardour
9.0-pre0-822-g12e3bc5c20
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 <ytkmm/drawingarea.h>
24
#include <ytkmm/adjustment.h>
25
26
#include "
widgets/visibility.h
"
27
28
namespace
ArdourWidgets
{
29
30
class
LIBWIDGETS_API
Scroomer
:
public
Gtk::DrawingArea
31
{
32
public
:
33
enum
Component
{
34
TopBase = 0,
35
Handle1 = 1,
36
Slider = 2,
37
Handle2 = 3,
38
BottomBase = 4,
39
Total = 5,
40
None
= 6
41
};
42
43
Scroomer
(Gtk::Adjustment& adjustment);
44
~Scroomer
();
45
46
bool
on_motion_notify_event
(GdkEventMotion*);
47
bool
on_button_press_event
(GdkEventButton*);
48
bool
on_button_release_event
(GdkEventButton*);
49
bool
on_scroll_event
(GdkEventScroll*);
50
virtual
void
on_size_allocate
(Gtk::Allocation&);
51
52
void
set_comp_rect
(GdkRectangle&,
Component
)
const
;
53
54
Component
point_in
(
double
point)
const
;
55
56
void
set_min_page_size
(
double
page_size);
57
int
get_handle_size
() {
return
handle_size; }
58
59
inline
int
position_of
(
Component
comp) {
return
position
[comp]; }
60
61
sigc::signal0<void>
DragStarting
;
62
sigc::signal0<void>
DragFinishing
;
63
64
sigc::signal0<void>
DoubleClicked
;
65
66
protected
:
67
Gtk::Adjustment&
adj
;
68
69
private
:
70
struct
UpdateRect
{
71
GdkRectangle
rect
;
72
Component
first_comp
;
73
};
74
75
void
update
();
76
void
adjustment_changed
();
77
78
int
position
[6];
79
int
old_pos[6];
80
int
handle_size
;
81
double
min_page_size
;
82
GdkWindow*
grab_window
;
83
Component
grab_comp
;
84
double
grab_y
;
85
double
unzoomed_val
;
86
double
unzoomed_page
;
87
bool
pinch
;
88
};
89
90
}
/* end namespace */
91
92
#endif
None
void None
Definition:
TypeList.h:49
ArdourWidgets::Scroomer
Definition:
scroomer.h:31
ArdourWidgets::Scroomer::DoubleClicked
sigc::signal0< void > DoubleClicked
Definition:
scroomer.h:64
ArdourWidgets::Scroomer::on_button_press_event
bool on_button_press_event(GdkEventButton *)
ArdourWidgets::Scroomer::grab_window
GdkWindow * grab_window
Definition:
scroomer.h:82
ArdourWidgets::Scroomer::adj
Gtk::Adjustment & adj
Definition:
scroomer.h:67
ArdourWidgets::Scroomer::grab_y
double grab_y
Definition:
scroomer.h:84
ArdourWidgets::Scroomer::DragFinishing
sigc::signal0< void > DragFinishing
Definition:
scroomer.h:62
ArdourWidgets::Scroomer::min_page_size
double min_page_size
Definition:
scroomer.h:81
ArdourWidgets::Scroomer::DragStarting
sigc::signal0< void > DragStarting
Definition:
scroomer.h:61
ArdourWidgets::Scroomer::position_of
int position_of(Component comp)
Definition:
scroomer.h:59
ArdourWidgets::Scroomer::adjustment_changed
void adjustment_changed()
ArdourWidgets::Scroomer::Component
Component
Definition:
scroomer.h:33
ArdourWidgets::Scroomer::set_min_page_size
void set_min_page_size(double page_size)
ArdourWidgets::Scroomer::on_button_release_event
bool on_button_release_event(GdkEventButton *)
ArdourWidgets::Scroomer::on_scroll_event
bool on_scroll_event(GdkEventScroll *)
ArdourWidgets::Scroomer::update
void update()
ArdourWidgets::Scroomer::~Scroomer
~Scroomer()
ArdourWidgets::Scroomer::unzoomed_val
double unzoomed_val
Definition:
scroomer.h:85
ArdourWidgets::Scroomer::Scroomer
Scroomer(Gtk::Adjustment &adjustment)
ArdourWidgets::Scroomer::pinch
bool pinch
Definition:
scroomer.h:87
ArdourWidgets::Scroomer::on_motion_notify_event
bool on_motion_notify_event(GdkEventMotion *)
ArdourWidgets::Scroomer::on_size_allocate
virtual void on_size_allocate(Gtk::Allocation &)
ArdourWidgets::Scroomer::unzoomed_page
double unzoomed_page
Definition:
scroomer.h:86
ArdourWidgets::Scroomer::handle_size
int handle_size
Definition:
scroomer.h:80
ArdourWidgets::Scroomer::get_handle_size
int get_handle_size()
Definition:
scroomer.h:57
ArdourWidgets::Scroomer::grab_comp
Component grab_comp
Definition:
scroomer.h:83
ArdourWidgets::Scroomer::point_in
Component point_in(double point) const
ArdourWidgets::Scroomer::set_comp_rect
void set_comp_rect(GdkRectangle &, Component) const
ArdourWidgets
Definition:
ardour_ui.h:193
MIDI::position
@ position
Definition:
midi++2/midi++/types.h:51
ArdourWidgets::Scroomer::UpdateRect
Definition:
scroomer.h:70
ArdourWidgets::Scroomer::UpdateRect::first_comp
Component first_comp
Definition:
scroomer.h:72
ArdourWidgets::Scroomer::UpdateRect::rect
GdkRectangle rect
Definition:
scroomer.h:71
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
scroomer.h
Generated on Wed Feb 5 2025 03:14:25 for Ardour by
1.9.1