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
31
class
LIBWIDGETS_API
Scroomer
:
public
Gtk::DrawingArea
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);
45
~Scroomer
();
46
47
bool
on_motion_notify_event
(
GdkEventMotion
*);
48
bool
on_button_press_event
(
GdkEventButton
*);
49
bool
on_button_release_event
(
GdkEventButton
*);
50
bool
on_scroll_event
(
GdkEventScroll
*);
51
virtual
void
on_size_allocate
(
Gtk::Allocation
&);
52
53
void
set_comp_rect
(
GdkRectangle
&,
Component
)
const
;
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
:
68
Gtk::Adjustment
&
adj
;
69
70
private
:
71
struct
UpdateRect
{
72
GdkRectangle
rect
;
73
Component
first_comp
;
74
};
75
76
void
update
();
77
void
adjustment_changed
();
78
79
int
position
[6];
80
int
old_pos[6];
81
int
handle_size
;
82
double
min_page_size
;
83
GdkWindow
*
grab_window
;
84
Component
grab_comp
;
85
double
grab_y
;
86
double
unzoomed_val
;
87
double
unzoomed_page
;
88
bool
pinch
;
89
};
90
91
}
/* end namespace */
92
93
#endif
None
void None
Definition:
TypeList.h:49
adjustment.h
ArdourWidgets::Scroomer
Definition:
scroomer.h:32
ArdourWidgets::Scroomer::DoubleClicked
sigc::signal0< void > DoubleClicked
Definition:
scroomer.h:65
ArdourWidgets::Scroomer::on_button_press_event
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
ArdourWidgets::Scroomer::grab_window
GdkWindow * grab_window
Definition:
scroomer.h:83
ArdourWidgets::Scroomer::adj
Gtk::Adjustment & adj
Definition:
scroomer.h:68
ArdourWidgets::Scroomer::grab_y
double grab_y
Definition:
scroomer.h:85
ArdourWidgets::Scroomer::DragFinishing
sigc::signal0< void > DragFinishing
Definition:
scroomer.h:63
ArdourWidgets::Scroomer::min_page_size
double min_page_size
Definition:
scroomer.h:82
ArdourWidgets::Scroomer::DragStarting
sigc::signal0< void > DragStarting
Definition:
scroomer.h:62
ArdourWidgets::Scroomer::position_of
int position_of(Component comp)
Definition:
scroomer.h:60
ArdourWidgets::Scroomer::adjustment_changed
void adjustment_changed()
ArdourWidgets::Scroomer::Component
Component
Definition:
scroomer.h:34
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 *)
This is a default handler for the signal signal_button_release_event().
ArdourWidgets::Scroomer::on_scroll_event
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
ArdourWidgets::Scroomer::update
void update()
ArdourWidgets::Scroomer::~Scroomer
~Scroomer()
ArdourWidgets::Scroomer::unzoomed_val
double unzoomed_val
Definition:
scroomer.h:86
ArdourWidgets::Scroomer::Scroomer
Scroomer(Gtk::Adjustment &adjustment)
ArdourWidgets::Scroomer::pinch
bool pinch
Definition:
scroomer.h:88
ArdourWidgets::Scroomer::on_motion_notify_event
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
ArdourWidgets::Scroomer::on_size_allocate
virtual void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
ArdourWidgets::Scroomer::unzoomed_page
double unzoomed_page
Definition:
scroomer.h:87
ArdourWidgets::Scroomer::handle_size
int handle_size
Definition:
scroomer.h:81
ArdourWidgets::Scroomer::get_handle_size
int get_handle_size()
Definition:
scroomer.h:58
ArdourWidgets::Scroomer::grab_comp
Component grab_comp
Definition:
scroomer.h:84
ArdourWidgets::Scroomer::point_in
Component point_in(double point) const
ArdourWidgets::Scroomer::set_comp_rect
void set_comp_rect(GdkRectangle &, Component) const
Gdk::Rectangle
Definition:
tk/ydkmm/ydkmm/gdkmm/rectangle.h:42
Gtk::Adjustment
Definition:
adjustment.h:63
Gtk::DrawingArea
Definition:
drawingarea.h:51
drawingarea.h
ArdourWidgets
Definition:
ardour_ui.h:192
MIDI::position
@ position
Definition:
midi++2/midi++/types.h:51
ArdourWidgets::Scroomer::UpdateRect
Definition:
scroomer.h:71
ArdourWidgets::Scroomer::UpdateRect::first_comp
Component first_comp
Definition:
scroomer.h:73
ArdourWidgets::Scroomer::UpdateRect::rect
GdkRectangle rect
Definition:
scroomer.h:72
_GdkDrawable
Definition:
gdkdrawable.h:54
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventMotion
Definition:
gdkevents.h:306
_GdkEventScroll
Definition:
gdkevents.h:351
_GdkRectangle
Definition:
gdktypes.h:201
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
scroomer.h
Generated on Wed Dec 25 2024 05:44:46 for Ardour by
1.9.1