Inkscape
Vector Graphics Editor
style-swatch.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
5
/* Authors:
6
* buliabyak@gmail.com
7
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
8
*
9
* Copyright (C) 2005-2008 Authors
10
*
11
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
12
*/
13
14
#ifndef SEEN_INKSCAPE_UI_STYLE_SWATCH_H
15
#define SEEN_INKSCAPE_UI_STYLE_SWATCH_H
16
17
#include <memory>
18
#include <gtkmm/box.h>
19
#include <gtkmm/gesture.h>
// Gtk::EventSequenceState
20
#include <gtkmm/label.h>
21
22
#include "
desktop.h
"
23
#include "
preferences.h
"
24
25
class
SPStyle
;
26
class
SPCSSAttr
;
27
28
namespace
Gtk
{
29
class
GestureClick;
30
class
Grid;
31
}
// namespace Gtk
32
33
namespace
Inkscape
{
34
35
namespace
Util
{
36
class
Unit;
37
}
// namespace Util
38
39
namespace
UI::Widget {
40
41
class
ColorPreview;
42
43
class
StyleSwatch
:
public
Gtk::Box
44
{
45
public
:
46
StyleSwatch
(
SPCSSAttr
*attr, gchar
const
*main_tip, Gtk::Orientation orient =
Gtk::Orientation::VERTICAL
);
47
~StyleSwatch
()
override
;
48
49
void
setStyle
(
SPStyle
*style);
50
void
setStyle
(
SPCSSAttr
*attr);
51
SPCSSAttr
*
getStyle
();
52
53
void
setWatchedTool
(
const
char
*path,
bool
synthesize);
54
void
setToolName
(
const
Glib::ustring&
tool_name
);
55
void
setDesktop
(
SPDesktop
*desktop);
56
57
private
:
58
Gtk::EventSequenceState
on_click
(Gtk::GestureClick
const
&click,
59
int
n_press,
double
x,
double
y);
60
61
using
PrefObs
=
Preferences::PreferencesObserver
;
62
63
SPDesktop
*
_desktop
;
64
Glib::ustring
_tool_name
;
65
SPCSSAttr
*
_css
;
66
std::unique_ptr<PrefObs>
_tool_obs
;
67
std::unique_ptr<PrefObs>
_style_obs
;
68
Glib::ustring
_tool_path
;
69
Gtk::Grid *
_table
;
70
Gtk::Label
_label
[2];
71
Gtk::Box
_empty_space
;
72
Gtk::Label
_value
[2];
73
Gtk::Box
_place
[2];
74
Gtk::Label
_opacity_value
;
75
std::unique_ptr<ColorPreview>
_color_preview
[2];
76
Glib::ustring
_color
[2];
77
Gtk::Box
_stroke
;
78
Gtk::Label
_stroke_width
;
79
Util::Unit
*
_sw_unit
;
80
81
friend
void
tool_obs_callback
(
StyleSwatch
&,
Preferences::Entry
const
&);
82
};
83
84
}
// namespace UI::Widget
85
86
}
// namespace Inkscape
87
88
#endif
// SEEN_INKSCAPE_UI_STYLE_SWATCH_H
89
90
/*
91
Local Variables:
92
mode:c++
93
c-file-style:"stroustrup"
94
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
95
indent-tabs-mode:nil
96
fill-column:99
97
End:
98
*/
99
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Inkscape::Preferences::Entry
Data type representing a typeless value of a preference.
Definition:
preferences.h:150
Inkscape::Preferences::PreferencesObserver
Callback-based preferences observer.
Definition:
preferences.h:126
Inkscape::UI::Widget::StyleSwatch
Definition:
style-swatch.h:44
Inkscape::UI::Widget::StyleSwatch::_tool_path
Glib::ustring _tool_path
Definition:
style-swatch.h:68
Inkscape::UI::Widget::StyleSwatch::_label
Gtk::Label _label[2]
Definition:
style-swatch.h:70
Inkscape::UI::Widget::StyleSwatch::on_click
Gtk::EventSequenceState on_click(Gtk::GestureClick const &click, int n_press, double x, double y)
Definition:
style-swatch.cpp:175
Inkscape::UI::Widget::StyleSwatch::~StyleSwatch
~StyleSwatch() override
Definition:
style-swatch.cpp:186
Inkscape::UI::Widget::StyleSwatch::setWatchedTool
void setWatchedTool(const char *path, bool synthesize)
Definition:
style-swatch.cpp:193
Inkscape::UI::Widget::StyleSwatch::_tool_name
Glib::ustring _tool_name
Definition:
style-swatch.h:64
Inkscape::UI::Widget::StyleSwatch::setStyle
void setStyle(SPStyle *style)
Definition:
style-swatch.cpp:232
Inkscape::UI::Widget::StyleSwatch::tool_obs_callback
friend void tool_obs_callback(StyleSwatch &, Preferences::Entry const &)
Watches whether the tool uses the current style.
Definition:
style-swatch.cpp:60
Inkscape::UI::Widget::StyleSwatch::_opacity_value
Gtk::Label _opacity_value
Definition:
style-swatch.h:74
Inkscape::UI::Widget::StyleSwatch::_stroke
Gtk::Box _stroke
Definition:
style-swatch.h:77
Inkscape::UI::Widget::StyleSwatch::_stroke_width
Gtk::Label _stroke_width
Definition:
style-swatch.h:78
Inkscape::UI::Widget::StyleSwatch::_color_preview
std::unique_ptr< ColorPreview > _color_preview[2]
Definition:
style-swatch.h:75
Inkscape::UI::Widget::StyleSwatch::setDesktop
void setDesktop(SPDesktop *desktop)
Definition:
style-swatch.cpp:171
Inkscape::UI::Widget::StyleSwatch::_color
Glib::ustring _color[2]
Definition:
style-swatch.h:76
Inkscape::UI::Widget::StyleSwatch::_place
Gtk::Box _place[2]
Definition:
style-swatch.h:73
Inkscape::UI::Widget::StyleSwatch::setToolName
void setToolName(const Glib::ustring &tool_name)
Definition:
style-swatch.cpp:167
Inkscape::UI::Widget::StyleSwatch::_value
Gtk::Label _value[2]
Definition:
style-swatch.h:72
Inkscape::UI::Widget::StyleSwatch::_table
Gtk::Grid * _table
Definition:
style-swatch.h:69
Inkscape::UI::Widget::StyleSwatch::_css
SPCSSAttr * _css
Definition:
style-swatch.h:65
Inkscape::UI::Widget::StyleSwatch::getStyle
SPCSSAttr * getStyle()
Inkscape::UI::Widget::StyleSwatch::_sw_unit
Util::Unit * _sw_unit
Definition:
style-swatch.h:79
Inkscape::UI::Widget::StyleSwatch::_empty_space
Gtk::Box _empty_space
Definition:
style-swatch.h:71
Inkscape::UI::Widget::StyleSwatch::_style_obs
std::unique_ptr< PrefObs > _style_obs
Definition:
style-swatch.h:67
Inkscape::UI::Widget::StyleSwatch::_desktop
SPDesktop * _desktop
Definition:
style-swatch.h:63
Inkscape::UI::Widget::StyleSwatch::_tool_obs
std::unique_ptr< PrefObs > _tool_obs
Definition:
style-swatch.h:66
Inkscape::UI::Widget::StyleSwatch::StyleSwatch
StyleSwatch(SPCSSAttr *attr, gchar const *main_tip, Gtk::Orientation orient=Gtk::Orientation::VERTICAL)
Definition:
style-swatch.cpp:91
Inkscape::Util::Unit
Definition:
units.h:47
SPCSSAttr
Definition:
sp-css-attr.h:18
SPDesktop
To do: update description of desktop.
Definition:
desktop.h:150
SPStyle
An SVG style object.
Definition:
style.h:45
desktop.h
Editable view implementation.
Gtk
Definition:
desktop.h:51
Inkscape::Util
Miscellaneous supporting code.
Definition:
color-conv.cpp:9
Inkscape
CMYK to sRGB conversion routines.
Definition:
actions-canvas-snapping.h:27
vpsc::VERTICAL
@ VERTICAL
The y-dimension (1).
Definition:
rectangle.h:47
preferences.h
Singleton class to access the preferences file in a convenient way.
tool_name
Glib::ustring const tool_name
Definition:
toolbars.cpp:62
src
ui
widget
style-swatch.h
Generated on Sun Apr 7 2024 04:01:34 for Inkscape by
1.9.4