Ardour
9.0-pre0-582-g084a23a80d
widgets/widgets/frame.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 Robin Gareus <robin@gareus.org>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#ifndef _WIDGETS_FRAME_H_
20
#define _WIDGETS_FRAME_H_
21
22
#include <optional>
23
#include <
gtkmm/bin.h
>
24
25
#include "
gtkmm2ext/colors.h
"
26
#include "
gtkmm2ext/cairo_theme.h
"
27
#include "
widgets/visibility.h
"
28
29
namespace
ArdourWidgets
{
30
31
class
LIBWIDGETS_API
Frame
:
public
Gtk::Bin
,
public
Gtkmm2ext::CairoTheme
32
{
33
public
:
34
enum
Orientation
{
35
Horizontal
,
36
Vertical
37
};
38
39
Frame
(
Orientation
orientation =
Horizontal
,
bool
force_boxy =
false
);
40
~Frame
();
41
42
void
set_label
(std::string
const
&);
43
void
set_padding
(
int
);
44
void
set_edge_color
(
Gtkmm2ext::Color
);
45
void
reset_edge_color
();
46
47
void
set_draw
(
bool
yn);
48
bool
draw
()
const
{
return
_draw; }
49
50
protected
:
51
void
on_add
(
Gtk::Widget
*);
52
void
on_remove
(
Gtk::Widget
*);
53
void
on_size_request
(
GtkRequisition
*);
54
void
on_size_allocate
(
Gtk::Allocation
&);
55
bool
on_expose_event
(
GdkEventExpose
*);
56
void
on_style_changed
(
const
Glib::RefPtr<Gtk::Style>&);
57
void
on_name_changed
();
58
59
private
:
60
Glib::RefPtr<Gtk::Style>
get_parent_style
();
61
62
Orientation
_orientation
;
63
Gtk::Widget
*
_w
;
64
Gtk::Widget
*
_current_parent
;
65
sigc::connection
_parent_style_change
;
66
Glib::RefPtr<Pango::Layout>
_layout
;
67
std::string
_label_text
;
68
std::optional<Gdk::Color>
_edge_color
;
69
GtkRequisition
_min_size
;
70
71
int
_border
;
72
int
_padding
;
73
int
_label_pad_w
;
74
int
_label_pad_h
;
75
int
_label_left
;
76
int
_text_width
;
77
int
_text_height
;
78
int
_alloc_x0
;
79
int
_alloc_y0
;
80
bool
_boxy
;
81
bool
_draw
;
82
};
83
84
}
// namespace ArdourWidgets
85
86
#endif
bin.h
cairo_theme.h
ArdourWidgets::Frame
Definition:
widgets/widgets/frame.h:32
ArdourWidgets::Frame::on_size_request
void on_size_request(GtkRequisition *)
This is a default handler for the signal signal_size_request().
ArdourWidgets::Frame::_parent_style_change
sigc::connection _parent_style_change
Definition:
widgets/widgets/frame.h:65
ArdourWidgets::Frame::set_label
void set_label(std::string const &)
ArdourWidgets::Frame::on_add
void on_add(Gtk::Widget *)
This is a default handler for the signal signal_add().
ArdourWidgets::Frame::on_size_allocate
void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
ArdourWidgets::Frame::draw
bool draw() const
Definition:
widgets/widgets/frame.h:48
ArdourWidgets::Frame::_label_left
int _label_left
Definition:
widgets/widgets/frame.h:75
ArdourWidgets::Frame::Orientation
Orientation
Definition:
widgets/widgets/frame.h:34
ArdourWidgets::Frame::Horizontal
@ Horizontal
Definition:
widgets/widgets/frame.h:35
ArdourWidgets::Frame::set_padding
void set_padding(int)
ArdourWidgets::Frame::reset_edge_color
void reset_edge_color()
ArdourWidgets::Frame::on_expose_event
bool on_expose_event(GdkEventExpose *)
This is a default handler for the signal signal_expose_event().
ArdourWidgets::Frame::_min_size
GtkRequisition _min_size
Definition:
widgets/widgets/frame.h:69
ArdourWidgets::Frame::_current_parent
Gtk::Widget * _current_parent
Definition:
widgets/widgets/frame.h:64
ArdourWidgets::Frame::_text_width
int _text_width
Definition:
widgets/widgets/frame.h:76
ArdourWidgets::Frame::_w
Gtk::Widget * _w
Definition:
widgets/widgets/frame.h:63
ArdourWidgets::Frame::set_draw
void set_draw(bool yn)
ArdourWidgets::Frame::_alloc_y0
int _alloc_y0
Definition:
widgets/widgets/frame.h:79
ArdourWidgets::Frame::_label_pad_w
int _label_pad_w
Definition:
widgets/widgets/frame.h:73
ArdourWidgets::Frame::_label_text
std::string _label_text
Definition:
widgets/widgets/frame.h:67
ArdourWidgets::Frame::_orientation
Orientation _orientation
Definition:
widgets/widgets/frame.h:62
ArdourWidgets::Frame::_text_height
int _text_height
Definition:
widgets/widgets/frame.h:77
ArdourWidgets::Frame::Frame
Frame(Orientation orientation=Horizontal, bool force_boxy=false)
ArdourWidgets::Frame::~Frame
~Frame()
ArdourWidgets::Frame::_padding
int _padding
Definition:
widgets/widgets/frame.h:72
ArdourWidgets::Frame::_label_pad_h
int _label_pad_h
Definition:
widgets/widgets/frame.h:74
ArdourWidgets::Frame::set_edge_color
void set_edge_color(Gtkmm2ext::Color)
ArdourWidgets::Frame::_alloc_x0
int _alloc_x0
Definition:
widgets/widgets/frame.h:78
ArdourWidgets::Frame::_layout
Glib::RefPtr< Pango::Layout > _layout
Definition:
widgets/widgets/frame.h:66
ArdourWidgets::Frame::on_name_changed
void on_name_changed()
ArdourWidgets::Frame::_border
int _border
Definition:
widgets/widgets/frame.h:71
ArdourWidgets::Frame::get_parent_style
Glib::RefPtr< Gtk::Style > get_parent_style()
ArdourWidgets::Frame::on_remove
void on_remove(Gtk::Widget *)
This is a default handler for the signal signal_remove().
ArdourWidgets::Frame::_draw
bool _draw
Definition:
widgets/widgets/frame.h:81
ArdourWidgets::Frame::_edge_color
std::optional< Gdk::Color > _edge_color
Definition:
widgets/widgets/frame.h:68
ArdourWidgets::Frame::_boxy
bool _boxy
Definition:
widgets/widgets/frame.h:80
ArdourWidgets::Frame::on_style_changed
void on_style_changed(const Glib::RefPtr< Gtk::Style > &)
Gdk::Rectangle
Definition:
tk/ydkmm/ydkmm/gdkmm/rectangle.h:42
Gtk::Bin
Definition:
bin.h:55
Gtk::Widget
Definition:
tk/ytkmm/ytkmm/gtkmm/widget.h:336
Gtkmm2ext::CairoTheme
Definition:
cairo_theme.h:29
colors.h
ArdourWidgets
Definition:
ardour_ui.h:192
Editing::Horizontal
@ Horizontal
Definition:
editing.h:250
Editing::Vertical
@ Vertical
Definition:
editing.h:249
Gtkmm2ext::Color
uint32_t Color
Definition:
colors.h:33
_GdkEventExpose
Definition:
gdkevents.h:281
_GtkRequisition
Definition:
gtkwidget.h:520
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
frame.h
Generated on Wed Dec 25 2024 05:44:15 for Ardour by
1.9.1