Inkscape
Vector Graphics Editor
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
x
y
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
w
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Related Symbols
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
l
n
p
q
r
s
t
u
Enumerations
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Concepts
Loading...
Searching...
No Matches
simple-pref-pusher.cpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
3
#include "
simple-pref-pusher.h
"
4
5
#include <gtkmm/togglebutton.h>
6
7
namespace
Inkscape
{
8
namespace
UI {
9
SimplePrefPusher::SimplePrefPusher
(Gtk::ToggleButton *btn, Glib::ustring
const
&path)
10
: Observer(path)
11
, _btn(btn)
12
, freeze(false)
13
{
14
freeze
=
true
;
15
_btn
->set_active(
Inkscape::Preferences::get
()->getBool(
observed_path
) );
16
freeze
=
false
;
17
18
Inkscape::Preferences::get
()->
addObserver
(*
this
);
19
}
9
SimplePrefPusher::SimplePrefPusher
(Gtk::ToggleButton *btn, Glib::ustring
const
&path) {
…
}
20
21
SimplePrefPusher::~SimplePrefPusher
()
22
{
23
Inkscape::Preferences::get
()->
removeObserver
(*
this
);
24
}
21
SimplePrefPusher::~SimplePrefPusher
() {
…
}
25
26
void
27
SimplePrefPusher::notify
(
Inkscape::Preferences::Entry
const
&newVal)
28
{
29
bool
newBool = newVal.
getBool
();
30
bool
oldBool =
_btn
->get_active();
31
32
if
(!
freeze
&& (newBool != oldBool)) {
33
_btn
->set_active(newBool);
34
}
35
}
27
SimplePrefPusher::notify
(
Inkscape::Preferences::Entry
const
&newVal) {
…
}
36
37
}
38
}
39
40
/*
41
Local Variables:
42
mode:c++
43
c-file-style:"stroustrup"
44
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
45
indent-tabs-mode:nil
46
fill-column:99
47
End:
48
*/
49
// 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:157
Inkscape::Preferences::Entry::getBool
bool getBool(bool def=false) const
Interpret the preference as a Boolean value.
Definition
preferences.cpp:778
Inkscape::Preferences::Observer::observed_path
Glib::ustring const observed_path
Path which the observer watches.
Definition
preferences.h:121
Inkscape::Preferences::get
static Preferences * get()
Access the singleton Preferences object.
Definition
preferences.h:641
Inkscape::Preferences::removeObserver
void removeObserver(Observer &)
Remove an observer an prevent further notifications to it.
Definition
preferences.cpp:647
Inkscape::Preferences::addObserver
void addObserver(Observer &)
Register a preference observer.
Definition
preferences.cpp:621
Inkscape::UI::SimplePrefPusher::~SimplePrefPusher
~SimplePrefPusher() override
Destructor that unregisters the preference callback.
Definition
simple-pref-pusher.cpp:21
Inkscape::UI::SimplePrefPusher::notify
void notify(Inkscape::Preferences::Entry const &new_val) override
Callback method invoked when the preference setting changes.
Definition
simple-pref-pusher.cpp:27
Inkscape::UI::SimplePrefPusher::freeze
bool freeze
Definition
simple-pref-pusher.h:48
Inkscape::UI::SimplePrefPusher::_btn
Gtk::ToggleButton * _btn
Definition
simple-pref-pusher.h:47
Inkscape::UI::SimplePrefPusher::SimplePrefPusher
SimplePrefPusher(Gtk::ToggleButton *btn, Glib::ustring const &path)
Constructor for a boolean value that syncs to the supplied path.
Definition
simple-pref-pusher.cpp:9
Inkscape
Helper class to stream background task notifications as a series of messages.
Definition
actions-canvas-snapping.h:27
simple-pref-pusher.h
src
ui
simple-pref-pusher.cpp
Generated on Sun Mar 9 2025 04:02:02 for Inkscape by
1.9.8