19#include <glibmm/i18n.h>
20#include <gtkmm/image.h>
21#include <gtkmm/label.h>
22#include <giomm/themedicon.h>
37 char const *
const active_str,
char const *
const inactive_str)
39 , _active_str(active_str)
40 , _inactive_str(inactive_str)
46 set_tooltip_text(tip);
48 auto const l = Gtk::make_managed<Gtk::Label>();
50 l->set_use_underline(
true);
53 set_halign(right ? Gtk::Align::END : Gtk::Align::START);
54 set_valign(Gtk::Align::CENTER);
66 subordinate->set_sensitive(b);
85 auto const active = get_active();
91 subordinate->set_sensitive(active);
102 Glib::ustring
const &
label,
103 Glib::ustring
const &tip, Glib::ustring
const &
key,
Registry &wr,
bool right,
105 char const *
const icon_active,
char const *
const icon_inactive)
107 _on_icon(icon_active), _off_icon(icon_inactive)
113 set_tooltip_text(tip);
115 set_halign(right ? Gtk::Align::END : Gtk::Align::START);
116 set_valign(Gtk::Align::CENTER);
119 set_child(*Gtk::make_managed<Gtk::Image>(Gio::ThemedIcon::create(
_on_icon)));
123 property_active().signal_changed().connect([
this](){
124 set_child(*Gtk::make_managed<Gtk::Image>(Gio::ThemedIcon::create(get_active() ?
_on_icon :
_off_icon)));
138 subordinate->set_sensitive(b);
157 auto const active = get_active();
162 subordinate->set_sensitive(active);
169 Glib::ustring
const &
key,
Registry &wr,
bool right,
175 set_tooltip_text(tip);
176 add_css_class(
"small");
177 set_halign(right ? Gtk::Align::END : Gtk::Align::START);
178 set_valign(Gtk::Align::CENTER);
180 property_state().signal_changed().connect([
this](){
191 auto const active = get_active();
196 subordinate->set_sensitive(active);
212 init_parent(
key, wr, repr_in, doc_in);
214 getUnitMenu()->setUnitType(UNIT_TYPE_LINEAR);
218 if (
auto units = doc_in->getDisplayUnit()) {
219 getUnitMenu()->setUnit(units->abbr);
252 Glib::ustring
const &
key,
290 if (
root->viewBox_set) {
293 scale = (
root->viewBox.width() /
root->width.computed +
root->viewBox.height() /
root->height.computed)/2.0;
399 Glib::ustring
const &title,
400 Glib::ustring
const &tip,
401 Glib::ustring
const &ckey,
402 Glib::ustring
const &akey,
408 init_parent(
"", wr, repr_in, doc_in);
457 DocumentUndo::done(local_doc,
"registered-widget.cpp: RegisteredColorPicker::on_changed",
"");
470 setProgrammatically(
false)
472 init_parent(
key, wr, repr_in, doc_in);
476 setIncrements(1, 10);
510 to_svg(
Geom::identity())
525 Point::setValue(new_p);
590 polar[
Geom::X] = atan2(p) *180/M_PI;
592 Point::setValue(polar);
631 vector = Geom::Point::polar(vector[
Geom::X]*M_PI/180, vector[
Geom::Y]);
635 os <<
origin <<
" , " << vector;
3x3 matrix representing an affine transformation.
bool isSingular(Coord eps=EPSILON) const
Check whether this matrix is singular.
Affine inverse() const
Compute the inverse matrix.
Two-dimensional point that doubles as a vector.
Coord length() const
Compute the distance from origin.
std::string toString(bool opacity=true) const
Format the color as a css string and return it.
double getOpacity() const
Get the opacity in this color, if it's stored.
RAII-style mechanism for creating a temporary undo-insensitive context.
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
RegisteredText(Glib::ustring const &label, Glib::ustring const &tip, Glib::ustring const &key, Registry &wr, Inkscape::XML::Node *repr_in=nullptr, SPDocument *doc_in=nullptr)
sigc::scoped_connection _activate_connection
A labelled text box, with optional icon, for entering arbitrary number values.
Glib::SignalProxy< void()> signal_activate()
Signal raised when the spin button's value changes.
Glib::ustring const getText() const
Get the text in the entry.
Interface for refcounted XML nodes.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
bool setAttributeCssDouble(Util::const_char_ptr key, double val)
Set a property attribute to val [slightly rounded], in the format required for CSS properties: in par...
To do: update description of desktop.
SPDocument * getDocument() const
SPNamedView * getNamedView() const
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
void setModifiedSinceSave(bool const modified=true)
Indicate to the user if the document has been modified since the last save by displaying a "*" in fro...
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
constexpr Coord EPSILON
Default "acceptably small" value.
Various utility functions.
Affine identity()
Create an identity matrix.
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
static cairo_user_data_key_t key
SPRoot: SVG <svg> implementation.
TODO: insert short description here.