Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI Namespace Reference

User interface code. More...

Namespaces

namespace  Cache
 
namespace  Controller
 Utilities to more easily use Gtk::EventController & subclasses like Gesture.
 
namespace  Detail
 
namespace  Dialog
 Dialog code.
 
namespace  Preview
 
namespace  Syntax
 
namespace  Toolbar
 
namespace  Tools
 
namespace  View
 
namespace  Widget
 Custom widgets.
 

Classes

class  ClipboardManager
 System-wide clipboard manager. More...
 
class  ColumnMenuBuilder
 
class  ControlPoint
 Draggable point, the workhorse of on-canvas editing. More...
 
class  ControlPointSelection
 Group of selected control points. More...
 
class  CurveDragPoint
 An invisible point used to drag curves. More...
 
class  DefocusTarget
 Interface for objects that would like to be informed when another widget loses focus. More...
 
struct  GetShapeIconResult
 A pair containing an icon name & a CSS class to set an RGBA color. More...
 
class  Handle
 
class  IconViewItemFactory
 
struct  ListNode
 
class  Manipulator
 Tool component that processes events and does something in response to them. More...
 
class  ModifierTracker
 
class  MultiPathManipulator
 Manipulator that manages multiple path manipulators active at the same time. More...
 
class  NewFromTemplate
 
class  Node
 
class  NodeIterator
 Iterator for editable nodes. More...
 
class  NodeList
 
struct  NodeSharedData
 
class  PathManipulator
 Manipulator that edits a single path using nodes with handles. More...
 
struct  PathSharedData
 
class  PointManipulator
 Tool component that edits something on the canvas using selectable control points. More...
 
struct  PopupMenuClick
 Information from a GestureClick if a popup menu was opened by click. More...
 
class  QueryFileInfo
 
class  SelectableControlPoint
 Desktop-bound selectable control object. More...
 
class  ShapeEditor
 
struct  ShapeRecord
 
class  SimplePrefPusher
 A simple mediator class that sets the state of a Gtk::ToggleButton when a preference is changed. More...
 
class  SubpathList
 List of node lists. More...
 
class  TextMatchingFilter
 
class  ThemeContext
 
class  TransformHandle
 Base class for node transform handles to simplify implementation. More...
 
class  TransformHandleSet
 

Typedefs

using BoxChildren = std::unordered_map< Gtk::Widget *, sigc::scoped_connection >
 
using PopupMenuOptionalClick = std::optional< PopupMenuClick >
 Optional: not present if popup wasnʼt triggered by click.
 
using PopupMenuSlot = sigc::slot< bool(PopupMenuOptionalClick)>
 Return whether a popup was activated.
 

Enumerations

enum class  PackType { start , end }
 
enum class  PackOptions { shrink , expand_padding , expand_widget }
 Equivalent to GTK3ʼs Gtk::PackOptions. More...
 
enum  CommitEvent {
  COMMIT_MOUSE_MOVE , COMMIT_KEYBOARD_MOVE_X , COMMIT_KEYBOARD_MOVE_Y , COMMIT_MOUSE_SCALE ,
  COMMIT_MOUSE_SCALE_UNIFORM , COMMIT_KEYBOARD_SCALE_UNIFORM , COMMIT_KEYBOARD_SCALE_X , COMMIT_KEYBOARD_SCALE_Y ,
  COMMIT_MOUSE_ROTATE , COMMIT_KEYBOARD_ROTATE , COMMIT_MOUSE_SKEW_X , COMMIT_MOUSE_SKEW_Y ,
  COMMIT_KEYBOARD_SKEW_X , COMMIT_KEYBOARD_SKEW_Y , COMMIT_FLIP_X , COMMIT_FLIP_Y
}
 This is used to provide sensible messages on the undo stack. More...
 
enum  NodeType {
  NODE_CUSP , NODE_SMOOTH , NODE_AUTO , NODE_SYMMETRIC ,
  NODE_LAST_REAL_TYPE , NODE_PICK_BEST = 100
}
 Types of nodes supported in the node tool. More...
 
enum  SegmentType { SEGMENT_STRAIGHT , SEGMENT_CUBIC_BEZIER }
 Types of segments supported in the node tool. More...
 
enum class  AlignTargetNode {
  LAST_NODE , FIRST_NODE , MID_NODE , MIN_NODE ,
  MAX_NODE
}
 
enum class  NodeDeleteMode {
  automatic , inverse_auto , curve_fit , line_segment ,
  gap_nodes , gap_lines
}
 
enum  ShapeRole { SHAPE_ROLE_NORMAL , SHAPE_ROLE_CLIPPING_PATH , SHAPE_ROLE_MASK , SHAPE_ROLE_LPE_PARAM }
 Role of the shape in the drawing - affects outline display and color. More...
 
enum class  ForEachResult { _continue , _break , _skip }
 Whether for_each_*() will continue or stop after calling Func per child. More...
 

Functions

Glib::RefPtr< Gtk::Builder > create_builder (const char *filename)
 
bool hide_widget (const Glib::RefPtr< Gtk::Builder > &builder, std::string const &id)
 
template<class W >
W & get_widget (const Glib::RefPtr< Gtk::Builder > &builder, const char *id)
 
template<class W , typename... Args>
W & get_derived_widget (const Glib::RefPtr< Gtk::Builder > &builder, const char *id, Args &&... args)
 
template<class Ob >
Glib::RefPtr< Ob > get_object (Glib::RefPtr< Gtk::Builder > const &builder, char const *id)
 
template<class Ob >
Ob & get_object_raw (Glib::RefPtr< Gtk::Builder > &builder, const char *id)
 This version of get_object is needed for Gtk::CellRenderer objects which can not be put into Glib::RefPtr by the compiler, but are somehow passed to us as RefPtrs anyway.
 
void containerize (Gtk::Widget &widget)
 Make a custom widget implement sensible memory management for its children.
 
int dialog_run (Gtk::Dialog &dialog)
 This is a GTK4 porting aid meant to replace the removal of the Gtk::Dialog synchronous API.
 
void dialog_show_modal_and_selfdestruct (std::unique_ptr< Gtk::Dialog > dialog, Gtk::Root *root=nullptr)
 Show a dialog modally, destroying it when the user dismisses it.
 
static Glib::ustring const & get_color_class (std::uint32_t const rgba_color, Glib::RefPtr< Gdk::Display > const &display)
 
GetShapeIconResult get_shape_icon (Glib::ustring const &shape_type, std::uint32_t const rgba_color)
 Get the shape icon for this named shape type.
 
Gtk::Image * get_shape_image (Glib::ustring const &shape_type, std::uint32_t const rgba_color, Gtk::IconSize const icon_size)
 As get_shape_icon(), but returns a ready-made, managed Image having that icon name & CSS class.
 
template<typename T , typename F >
void foreach (GPtrArray *arr, F &&f)
 
template<typename F >
void foreach (char **strs, F &&f)
 
template<typename F >
void list_language_names_and_codes (SpellingProvider *provider, F &&cb)
 
auto list_corrections_c (SpellingChecker *checker, char const *word)
 
auto list_corrections (SpellingChecker *checker, char const *word)
 
auto spelling_text_buffer_adapter_create (GtkSourceBuffer *buffer, SpellingChecker *checker)
 
auto get_menu_model (SpellingTextBufferAdapter &adapter)
 
auto as_action_group (SpellingTextBufferAdapter &adapter)
 
void set_enabled (SpellingTextBufferAdapter &adapter, bool enabled)
 
Gdk::Rectangle get_monitor_geometry_primary ()
 get monitor geometry of primary monitor
 
Gdk::Rectangle get_monitor_geometry_at_surface (Glib::RefPtr< Gdk::Surface > const &surface)
 get monitor geometry of monitor containing largest part of surface
 
Gdk::Rectangle get_monitor_geometry_at_point (int x, int y)
 get monitor geometry of monitor at (or closest to) point on combined screen area
 
static void set_expand (Gtk::Widget &widget, Gtk::Orientation const orientation, bool const expand)
 
static void set_align (Gtk::Widget &widget, Gtk::Orientation const orientation, Gtk::Align const align)
 
static auto to_align (PackType const pack_type)
 
static void set_fill (Gtk::Widget &widget, Gtk::Orientation const orientation, bool const fill, PackType const pack_type)
 
static void set_padding (Gtk::Widget &widget, Gtk::Orientation const orientation, int const margin_start, int const margin_end)
 
static void add (Gtk::Box &box, PackType const pack_type, Gtk::Widget &child)
 
static void pack (PackType const pack_type, Gtk::Box &box, Gtk::Widget &child, bool const expand, bool const fill, unsigned const padding)
 
static void pack (PackType const pack_type, Gtk::Box &box, Gtk::Widget &child, PackOptions const options, unsigned const padding)
 
void pack_start (Gtk::Box &box, Gtk::Widget &child, bool expand, bool fill, unsigned padding=0)
 Adds child to box, packed with reference to the start of box.
 
void pack_start (Gtk::Box &box, Gtk::Widget &child, PackOptions options=PackOptions::expand_widget, unsigned padding=0)
 Adds child to box, packed with reference to the start of box.
 
void pack_end (Gtk::Box &box, Gtk::Widget &child, bool expand, bool fill, unsigned padding=0)
 Adds child to box, packed with reference to the end of box.
 
void pack_end (Gtk::Box &box, Gtk::Widget &child, PackOptions options=PackOptions::expand_widget, unsigned padding=0)
 Adds child to box, packed with reference to the end of box.
 
static bool on_key_pressed (unsigned const keyval, unsigned, Gdk::ModifierType state, PopupMenuSlot const &slot)
 
static void on_click_pressed (int n_press, double x, double y, Gtk::GestureClick &click, PopupMenuSlot const &slot)
 
void on_popup_menu (Gtk::Widget &widget, PopupMenuSlot slot)
 Connect slot to a widgetʼs key and button events that traditionally trigger a popup menu, i.e.:
 
static void popup_at (Gtk::Popover &popover, Gtk::Widget &widget, double const x_offset, double const y_offset, int width, int height)
 
void popup_at (Gtk::Popover &popover, Gtk::Widget &widget, double x_offset=0.0, double y_offset=0.0)
 Replace Gtk::Menu::popup_at_pointer.
 
void popup_at (Gtk::Popover &popover, Gtk::Widget &widget, std::optional< Geom::Point > const &offset)
 
void popup_at_center (Gtk::Popover &popover, Gtk::Widget &widget)
 As popup_at() but point to center of widget.
 
void popup_at (Gtk::Popover &popover, Gtk::Widget &widget, Gdk::Rectangle const &rect)
 As popup_at() but point to center of rect rect must be valid within the coords of @widget, & @awidget must be a descendant of @parent.
 
std::unique_ptr< KnotHoldercreate_knot_holder (SPItem *item, SPDesktop *desktop, double edit_rotation, int edit_marker_mode)
 
std::unique_ptr< KnotHoldercreate_LPE_knot_holder (SPItem *item, SPDesktop *desktop)
 
std::string sp_tweak_background_colors (std::string cssstring, double crossfade, double contrast, bool dark)
 
static void show_parsing_error (const Glib::RefPtr< const Gtk::CssSection > &section, const Glib::Error &error)
 
std::ostream & operator<< (std::ostream &out, NodeType type)
 
static Geom::Point direction (Geom::Point const &first, Geom::Point const &second)
 Computes an unit vector of the direction from first to second control point.
 
static double snap_increment_degrees ()
 
void build_segment (Geom::PathBuilder &, Node *, Node *)
 
static void add_or_replace_if_extremum (std::vector< std::pair< NodeList::iterator, double > > &vec, double &extrvalue, double testvalue, NodeList::iterator const &node, double t)
 
double get_angle (const Geom::Point &p0, const Geom::Point &p1, const Geom::Point &p2)
 
void set_icon_sizes (Gtk::Widget *parent, int pixel_size)
 Recursively set all the icon sizes inside this parent widget.
 
void set_icon_sizes (GtkWidget *parent, int pixel_size)
 
void gui_warning (const std::string &msg, Gtk::Window *parent_window)
 
void system_open (const Glib::ustring &path)
 Opens the given path with platform-specific tools.
 
std::vector< Gtk::Widget * > get_children (Gtk::Widget &widget)
 Get a vector of the widgetʼs children, from get_first_child() through each get_next_sibling().
 
Gtk::Widget & get_nth_child (Gtk::Widget &widget, std::size_t index)
 Get the widgetʼs child at the given position. Throws std::out_of_range if the index is invalid.
 
Gtk::Widget * find_widget_by_name (Gtk::Widget &parent, Glib::ustring const &name, bool visible_only)
 Returns a named descendent of parent, which has the given name, or nullptr if there's none.
 
Gtk::Widget * find_focusable_widget (Gtk::Widget &parent)
 This function traverses a tree of widgets searching for first focusable widget.
 
bool is_descendant_of (Gtk::Widget const &descendant, Gtk::Widget const &ancestor)
 Returns if widget is a descendant of given ancestor, i.e.: itself, a child, or a childʼs child.
 
bool contains_focus (Gtk::Widget &widget)
 Returns if widget or one of its descendants has focus.
 
int get_font_size (Gtk::Widget &widget)
 Get the relative font size as determined by a widgetʼs style/Pango contexts.
 
void ellipsize (Gtk::Label &label, int const max_width_chars, Pango::EllipsizeMode const mode)
 
template<typename Widget >
void remove_all_children (Widget &widget)
 For each child in get_children(widget), call widget.remove(*child). May not cause delete child!
 
template<typename Func >
Gtk::Widget * for_each_child (Gtk::Widget &widget, Func &&func, bool const plus_self=false, bool const recurse=false, int const level=0)
 Call Func with a reference to each child of parent, until it returns _break.
 
template<typename Func >
Gtk::Widget * for_each_descendant (Gtk::Widget &widget, Func &&func)
 Like for_each_child() but also tests the initial widget & recurses through childrenʼs children.
 
template<typename Func >
Gtk::Widget * for_each_parent (Gtk::Widget &widget, Func &&func)
 Call Func with a reference to successive parents, until Func returns _break.
 
template<typename Func >
Gtk::Widget * for_each_page (Gtk::Notebook &notebook, Func &&func)
 Similar to for_each_child, but only iterates over pages in a notebook.
 

Variables

static std::unordered_set< QueryFileInfo * > pending_operations
 
static auto s_box_children = std::unordered_map<Gtk::Box *, BoxChildren>{}
 
static constexpr auto grab_event_mask
 Events which should be captured when a handle is being dragged.
 
const double BSPLINE_TOL = 0.001
 
const double NO_POWER = 0.0
 
const double DEFAULT_START_POWER = 1.0 / 3.0
 

Detailed Description

User interface code.

This namespace contains everything related to the user interface of Inkscape.

Typedef Documentation

◆ BoxChildren

using Inkscape::UI::BoxChildren = typedef std::unordered_map<Gtk::Widget *, sigc::scoped_connection>

Definition at line 39 of file pack.cpp.

◆ PopupMenuOptionalClick

using Inkscape::UI::PopupMenuOptionalClick = typedef std::optional<PopupMenuClick>

Optional: not present if popup wasnʼt triggered by click.

Definition at line 41 of file popup-menu.h.

◆ PopupMenuSlot

using Inkscape::UI::PopupMenuSlot = typedef sigc::slot<bool (PopupMenuOptionalClick)>

Return whether a popup was activated.

Click param is nullopt if popup wasnʼt triggered by a click.

Definition at line 45 of file popup-menu.h.

Enumeration Type Documentation

◆ AlignTargetNode

enum class Inkscape::UI::AlignTargetNode
strong
Enumerator
LAST_NODE 
FIRST_NODE 
MID_NODE 
MIN_NODE 
MAX_NODE 

Definition at line 35 of file node-types.h.

◆ CommitEvent

This is used to provide sensible messages on the undo stack.

Enumerator
COMMIT_MOUSE_MOVE 
COMMIT_KEYBOARD_MOVE_X 
COMMIT_KEYBOARD_MOVE_Y 
COMMIT_MOUSE_SCALE 
COMMIT_MOUSE_SCALE_UNIFORM 
COMMIT_KEYBOARD_SCALE_UNIFORM 
COMMIT_KEYBOARD_SCALE_X 
COMMIT_KEYBOARD_SCALE_Y 
COMMIT_MOUSE_ROTATE 
COMMIT_KEYBOARD_ROTATE 
COMMIT_MOUSE_SKEW_X 
COMMIT_MOUSE_SKEW_Y 
COMMIT_KEYBOARD_SKEW_X 
COMMIT_KEYBOARD_SKEW_Y 
COMMIT_FLIP_X 
COMMIT_FLIP_Y 

Definition at line 19 of file commit-events.h.

◆ ForEachResult

enum class Inkscape::UI::ForEachResult
strong

Whether for_each_*() will continue or stop after calling Func per child.

Enumerator
_continue 
_break 
_skip 

Definition at line 75 of file util.h.

◆ NodeDeleteMode

enum class Inkscape::UI::NodeDeleteMode
strong
Enumerator
automatic 
inverse_auto 
curve_fit 
line_segment 
gap_nodes 
gap_lines 

Definition at line 51 of file path-manipulator.h.

◆ NodeType

Types of nodes supported in the node tool.

Enumerator
NODE_CUSP 

Cusp node - no handle constraints.

NODE_SMOOTH 

Smooth node - handles must be colinear.

NODE_AUTO 

Auto node - handles adjusted automatically based on neighboring nodes.

NODE_SYMMETRIC 

Symmetric node - handles must be colinear and of equal length.

NODE_LAST_REAL_TYPE 

Last real type of node - used for ctrl+click on a node.

NODE_PICK_BEST 

Select type based on handle positions.

Definition at line 20 of file node-types.h.

◆ PackOptions

enum class Inkscape::UI::PackOptions
strong

Equivalent to GTK3ʼs Gtk::PackOptions.

Enumerator
shrink 
expand_padding 
expand_widget 

Definition at line 24 of file pack.h.

◆ PackType

enum class Inkscape::UI::PackType
strong
Enumerator
start 
end 

Definition at line 37 of file pack.cpp.

◆ SegmentType

Types of segments supported in the node tool.

Enumerator
SEGMENT_STRAIGHT 

Straight linear segment.

SEGMENT_CUBIC_BEZIER 

Bezier curve with two control points.

Definition at line 30 of file node-types.h.

◆ ShapeRole

Role of the shape in the drawing - affects outline display and color.

Enumerator
SHAPE_ROLE_NORMAL 
SHAPE_ROLE_CLIPPING_PATH 
SHAPE_ROLE_MASK 
SHAPE_ROLE_LPE_PARAM 

Definition at line 26 of file shape-record.h.

Function Documentation

◆ add()

static void Inkscape::UI::add ( Gtk::Box &  box,
PackType const  pack_type,
Gtk::Widget &  child 
)
static

Definition at line 94 of file pack.cpp.

References add(), child, get_nth_child(), s_box_children, and start.

Referenced by add(), and pack().

◆ add_or_replace_if_extremum()

static void Inkscape::UI::add_or_replace_if_extremum ( std::vector< std::pair< NodeList::iterator, double > > &  vec,
double &  extrvalue,
double  testvalue,
NodeList::iterator const &  node,
double  t 
)
static

Definition at line 297 of file path-manipulator.cpp.

References Geom::are_near(), and node.

Referenced by Inkscape::UI::PathManipulator::insertNodeAtExtremum().

◆ as_action_group()

auto Inkscape::UI::as_action_group ( SpellingTextBufferAdapter &  adapter)
inline

Definition at line 92 of file libspelling-wrapper.h.

Referenced by Inkscape::UI::Dialog::TextEdit::TextEdit().

◆ build_segment()

void Inkscape::UI::build_segment ( Geom::PathBuilder ,
Node ,
Node  
)
related

◆ containerize()

void Inkscape::UI::containerize ( Gtk::Widget &  widget)
inline

Make a custom widget implement sensible memory management for its children.

This frees the implementer of a custom widget from having to manually unparent() children added with set_parent() both in the destructor and on signal_destroy(), a memory management detail from C that has no business leaking into C++.

Upon destruction, or for managed widgets just before, all children are unparented. Managed children are also deleted if they have no other references.

This function is typically called in the constructor of a custom widget that derives from an intrinsically childless Gtk widget, e.g. Gtk::Widget, Gtk::DrawingArea.

It must not be used with any intrinsically child-containing Gtk widget, e.g. Gtk::Box, Gtk::SpinButton.

Definition at line 25 of file containerize.h.

References c.

Referenced by Inkscape::UI::Widget::Bin::_construct(), Inkscape::UI::Dialog::ColorItem::common_setup(), Inkscape::UI::Widget::InkSpinButton::construct(), Inkscape::UI::Widget::PopoverBin::PopoverBin(), Inkscape::UI::Widget::Ruler::Ruler(), Inkscape::UI::Widget::Stack::Stack(), Inkscape::UI::Widget::TabStrip::TabStrip(), and Inkscape::UI::Widget::TabsWidget::TabsWidget().

◆ contains_focus()

bool Inkscape::UI::contains_focus ( Gtk::Widget &  widget)

Returns if widget or one of its descendants has focus.

Parameters
widgetThe widget of interest.
Returns
If the widget of interest or a descendant has focus.

Definition at line 219 of file util.cpp.

References root.

Referenced by Inkscape::UI::Widget::StrokeStyle::update_dash_entry().

◆ create_builder()

Glib::RefPtr< Gtk::Builder > Inkscape::UI::create_builder ( const char *  filename)

Definition at line 36 of file builder-utils.cpp.

References builder, create_builder(), Inkscape::IO::Resource::get_filename(), and Inkscape::IO::Resource::UIS.

Referenced by Inkscape::UI::Dialog::AlignAndDistribute::AlignAndDistribute(), Inkscape::UI::Dialog::CommandPalette::append_recent_file_operation(), Inkscape::UI::Toolbar::ArcToolbar::ArcToolbar(), Inkscape::UI::Dialog::AttrDialog::AttrDialog(), Inkscape::UI::Toolbar::BooleansToolbar::BooleansToolbar(), Inkscape::UI::Toolbar::Box3DToolbar::Box3DToolbar(), Inkscape::UI::Toolbar::CalligraphyToolbar::CalligraphyToolbar(), Inkscape::UI::Widget::CanvasGrid::CanvasGrid(), Inkscape::UI::Widget::ColorPage::ColorPage(), Inkscape::UI::Widget::ColorPalette::ColorPalette(), Inkscape::UI::Dialog::CommandPalette::CommandPalette(), Inkscape::UI::Toolbar::CommandToolbar::CommandToolbar(), Inkscape::UI::Widget::CompletionPopup::CompletionPopup(), Inkscape::UI::Toolbar::ConnectorToolbar::ConnectorToolbar(), Inkscape::Application::crash_handler(), Inkscape::UI::Widget::CanvasNotice::create(), create_builder(), Inkscape::UI::Dialog::DocumentResources::DocumentResources(), Inkscape::UI::Toolbar::DropperToolbar::DropperToolbar(), Inkscape::UI::Dialog::LivePathEffectEditor::effect_list_reload(), Inkscape::UI::Toolbar::EraserToolbar::EraserToolbar(), Inkscape::UI::Dialog::Export::Export(), Inkscape::UI::Dialog::ExtensionsGallery::ExtensionsGallery(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterEffectsDialog(), Inkscape::UI::Dialog::FontCollectionsManager::FontCollectionsManager(), Inkscape::UI::Widget::FontList::FontList(), Inkscape::UI::Dialog::CommandPalette::generate_action_operation(), Inkscape::UI::Widget::TemplateList::generate_category(), Inkscape::UI::Widget::GradientEditor::GradientEditor(), Inkscape::UI::Toolbar::GradientToolbar::GradientToolbar(), Inkscape::UI::Widget::ImageProperties::ImageProperties(), Inkscape::UI::Dialog::ExtensionList::init(), Inkscape::UI::Dialog::LivePathEffectEditor::LivePathEffectEditor(), Inkscape::UI::Toolbar::LPEToolbar::LPEToolbar(), Inkscape::UI::Widget::MarkerComboBox::MarkerComboBox(), Inkscape::UI::Toolbar::MarkerToolbar::MarkerToolbar(), Inkscape::UI::Toolbar::MeasureToolbar::MeasureToolbar(), Inkscape::UI::Dialog::MeasureToolSettingsDialog::MeasureToolSettingsDialog(), Inkscape::UI::Toolbar::MeshToolbar::MeshToolbar(), Inkscape::UI::Toolbar::NodeToolbar::NodeToolbar(), Inkscape::UI::Dialog::ObjectAttributes::ObjectAttributes(), Inkscape::UI::Toolbar::ObjectPickerToolbar::ObjectPickerToolbar(), Inkscape::UI::Dialog::ObjectsPanel::ObjectsPanel(), Inkscape::UI::Toolbar::PageToolbar::PageToolbar(), Inkscape::UI::Toolbar::PaintbucketToolbar::PaintbucketToolbar(), Inkscape::UI::Widget::PatternEditor::PatternEditor(), Inkscape::Extension::Internal::PdfImportDialog::PdfImportDialog(), Inkscape::UI::Toolbar::PencilToolbar::PencilToolbar(), Inkscape::UI::Dialog::StyleDialog::readStyleElement(), Inkscape::UI::Toolbar::RectToolbar::RectToolbar(), Inkscape::UI::Toolbar::SelectToolbar::SelectToolbar(), Inkscape::UI::Dialog::show_about(), InkviewWindow::show_control(), Inkscape::UI::Dialog::StartScreen::show_welcome(), Inkscape::UI::Toolbar::SnapToolbar::SnapToolbar(), Inkscape::UI::Dialog::SpellCheck::SpellCheck(), Inkscape::UI::Toolbar::SpiralToolbar::SpiralToolbar(), Inkscape::UI::Toolbar::SprayToolbar::SprayToolbar(), Inkscape::UI::Toolbar::StarToolbar::StarToolbar(), Inkscape::UI::Dialog::StartScreen::StartScreen(), Inkscape::UI::Widget::StatusBar::StatusBar(), Inkscape::UI::Dialog::SwatchesPanel::SwatchesPanel(), Inkscape::UI::Dialog::TextEdit::TextEdit(), Inkscape::UI::Toolbar::TextToolbar::TextToolbar(), Inkscape::UI::Toolbar::ToolToolbar::ToolToolbar(), Inkscape::UI::Toolbar::TweakToolbar::TweakToolbar(), Inkscape::UI::Dialog::XmlTree::XmlTree(), and Inkscape::UI::Toolbar::ZoomToolbar::ZoomToolbar().

◆ create_knot_holder()

std::unique_ptr< KnotHolder > Inkscape::UI::create_knot_holder ( SPItem item,
SPDesktop desktop,
double  edit_rotation,
int  edit_marker_mode 
)

◆ create_LPE_knot_holder()

std::unique_ptr< KnotHolder > Inkscape::UI::create_LPE_knot_holder ( SPItem item,
SPDesktop desktop 
)

Definition at line 163 of file shape-editor-knotholders.cpp.

References desktop, and item.

Referenced by Inkscape::UI::ShapeEditor::set_item().

◆ dialog_run()

◆ dialog_show_modal_and_selfdestruct()

void Inkscape::UI::dialog_show_modal_and_selfdestruct ( std::unique_ptr< Gtk::Dialog >  dialog,
Gtk::Root *  root = nullptr 
)

Show a dialog modally, destroying it when the user dismisses it.

If toplevel is not null, the dialog is shown as a transient for toplevel.

Definition at line 41 of file dialog-run.cpp.

References root.

Referenced by Inkscape::UI::Widget::FontCollectionSelector::deletion_warning_message_dialog(), image_edit(), Inkscape::UI::Dialog::InkscapePreferences::initPageUI(), and Inkscape::UI::Toolbar::MeshToolbar::warning_popup().

◆ direction()

◆ ellipsize()

void Inkscape::UI::ellipsize ( Gtk::Label &  label,
int const  max_width_chars,
Pango::EllipsizeMode const  mode 
)

Definition at line 251 of file util.cpp.

References label, and mode.

Referenced by Inkscape::UI::Dialog::make_selector_item().

◆ find_focusable_widget()

Gtk::Widget * Inkscape::UI::find_focusable_widget ( Gtk::Widget &  parent)

This function traverses a tree of widgets searching for first focusable widget.

Parameters
[in]parentThe widget to start traversal from - top of the tree
Returns
The first focusable widget or nullptr if none are focusable.

Definition at line 200 of file util.cpp.

References _break, _continue, for_each_descendant(), and parent.

Referenced by Inkscape::UI::Dialog::DialogBase::focus_dialog().

◆ find_widget_by_name()

Gtk::Widget * Inkscape::UI::find_widget_by_name ( Gtk::Widget &  parent,
Glib::ustring const &  name,
bool  visible_only 
)

Returns a named descendent of parent, which has the given name, or nullptr if there's none.

Parameters
[in]parentThe widget to search
[in]nameThe name of the desired child widget
Returns
The specified child widget, or nullptr if it cannot be found

Definition at line 184 of file util.cpp.

References _break, _continue, _skip, for_each_descendant(), name, and parent.

Referenced by SPDesktopWidget::get_toolbar_by_name(), SPDesktopWidget::isToolboxButtonActive(), SPDesktopWidget::setToolboxAdjustmentValue(), and SPDesktopWidget::setToolboxFocusTo().

◆ for_each_child()

template<typename Func >
Gtk::Widget * Inkscape::UI::for_each_child ( Gtk::Widget &  widget,
Func &&  func,
bool const  plus_self = false,
bool const  recurse = false,
int const  level = 0 
)

Call Func with a reference to each child of parent, until it returns _break.

Accessing children changes between GTK3 & GTK4, so best consolidate it here.

Parameters
widgetThe initial widget at the top of the hierarchy, to start at
funcThe widget-testing predicate, returning whether to continue
plus_selfWhether to call the predicate func on the initial widget
recurseWhether to recurse also calling func for nested children
Returns
The first widget for which func returns _break or nullptr if none

Definition at line 103 of file util.h.

References _break, _skip, child, for_each_child(), and get_children().

Referenced by Inkscape::UI::Dialog::DialogNotebook::add_page(), Inkscape::UI::Toolbar::TextToolbar::configure_mode_buttons(), Inkscape::UI::Toolbar::EraserToolbar::EraserToolbar(), find_label(), for_each_child(), for_each_descendant(), Inkscape::UI::Toolbar::GradientToolbar::GradientToolbar(), SPDesktopWidget::layoutWidgets(), Inkscape::UI::Toolbar::LPEToolbar::LPEToolbar(), Inkscape::UI::Toolbar::MeshToolbar::MeshToolbar(), Inkscape::UI::Toolbar::PencilToolbar::PencilToolbar(), Inkscape::UI::Dialog::SingleExport::selectPage(), Inkscape::UI::Widget::MarkerComboBox::set_active(), Inkscape::UI::Widget::PatternEditor::set_active(), Inkscape::UI::Widget::ColorPalette::set_colors(), set_tooltips_and_shift_icons(), Inkscape::UI::Dialog::SingleExport::setPagesMode(), Inkscape::UI::Toolbar::SprayToolbar::SprayToolbar(), and Inkscape::UI::Toolbar::TweakToolbar::TweakToolbar().

◆ for_each_descendant()

template<typename Func >
Gtk::Widget * Inkscape::UI::for_each_descendant ( Gtk::Widget &  widget,
Func &&  func 
)

Like for_each_child() but also tests the initial widget & recurses through childrenʼs children.

Parameters
widgetThe initial widget at the top of the hierarchy, to start at
funcThe widget-testing predicate, returning whether to continue
Returns
The first widget for which func returns _break or nullptr if none

Definition at line 132 of file util.h.

References for_each_child().

Referenced by find_focusable_widget(), find_widget_by_name(), set_icon_sizes(), Inkscape::UI::Toolbar::ToolToolbar::set_visible_buttons(), and show_all_images().

◆ for_each_page()

template<typename Func >
Gtk::Widget * Inkscape::UI::for_each_page ( Gtk::Notebook &  notebook,
Func &&  func 
)

Similar to for_each_child, but only iterates over pages in a notebook.

Definition at line 152 of file util.h.

References _break, and page.

Referenced by Inkscape::UI::Dialog::get_notebook_dialogs(), and Inkscape::UI::Dialog::DialogNotebook::on_size_allocate_scroll().

◆ for_each_parent()

template<typename Func >
Gtk::Widget * Inkscape::UI::for_each_parent ( Gtk::Widget &  widget,
Func &&  func 
)

Call Func with a reference to successive parents, until Func returns _break.

Definition at line 139 of file util.h.

References _break, and parent.

Referenced by Inkscape::UI::Widget::PopoverMenuItem::get_menu(), Inkscape::UI::Widget::get_scrollable_ancestor(), and is_descendant_of().

◆ foreach() [1/2]

template<typename F >
void Inkscape::UI::foreach ( char **  strs,
F &&  f 
)

Definition at line 31 of file libspelling-wrapper.h.

◆ foreach() [2/2]

template<typename T , typename F >
void Inkscape::UI::foreach ( GPtrArray *  arr,
F &&  f 
)

Definition at line 21 of file libspelling-wrapper.h.

References data.

◆ get_angle()

double Inkscape::UI::get_angle ( const Geom::Point p0,
const Geom::Point p1,
const Geom::Point p2 
)

Definition at line 687 of file path-manipulator.cpp.

Referenced by Inkscape::UI::PathManipulator::_deleteStretch().

◆ get_children()

std::vector< Gtk::Widget * > Inkscape::UI::get_children ( Gtk::Widget &  widget)

Get a vector of the widgetʼs children, from get_first_child() through each get_next_sibling().

Definition at line 156 of file util.cpp.

References child.

Referenced by Inkscape::UI::Widget::ColorNotebook::_addPageForSpace(), Inkscape::Shortcuts::_dump_all_recursive(), Inkscape::UI::Toolbar::ToolbarWidget::_initMenuBtns(), Inkscape::UI::Widget::ColorNotebook::_setCurrentPage(), Inkscape::UI::Widget::PopoverMenu::activate(), Inkscape::UI::Dialog::align(), Inkscape::LivePathEffect::align_widgets(), Inkscape::UI::Dialog::StartScreen::banner_switch(), Inkscape::UI::Widget::FontVariations::build_ui(), Inkscape::UI::Dialog::can_collapse(), Inkscape::UI::Dialog::LivePathEffectEditor::effect_list_reload(), for_each_child(), Inkscape::UI::Dialog::get_children_or_mnemonic_labels(), Inkscape::UI::Dialog::CommandPalette::get_full_action_name(), Inkscape::UI::Widget::TemplateList::get_iconview(), Inkscape::UI::Dialog::CommandPalette::get_name_desc(), Inkscape::UI::Dialog::DialogNotebook::get_scrolledwindow(), Inkscape::UI::Widget::ColorNotebook::getPageIndex(), InkscapeWindow::InkscapeWindow(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::newWidget(), Inkscape::UI::Dialog::CommandPalette::operate_recent_file(), Inkscape::Extension::PrefDialog::PrefDialog(), Inkscape::UI::Dialog::StyleDialog::readStyleElement(), Inkscape::LivePathEffect::ToggleButtonParam::refresh_button(), Inkscape::UI::Dialog::SingleExport::refreshPreview(), remove_all_children(), SPDesktopWidget::repack_snaptoolbar(), Inkscape::UI::Dialog::CloneTiler::reset_recursive(), Inkscape::UI::Widget::TemplateList::reset_selection(), run_dialog(), Inkscape::UI::Dialog::LivePathEffectEditor::selection_info(), Inkscape::UI::Toolbar::SelectToolbar::SelectToolbar(), Inkscape::UI::Toolbar::EraserToolbar::set_eraser_mode_visibility(), Inkscape::UI::Widget::ColorPalette::set_filter(), Inkscape::UI::Dialog::CommandPalette::set_mode(), Inkscape::UI::Widget::ColorPalette::set_up_scrolling(), Inkscape::UI::Dialog::LivePathEffectEditor::showParams(), Inkscape::UI::Dialog::FilterEffectsDialog::update_filter_general_settings_view(), Inkscape::Shortcuts::update_gui_text_recursive(), and Inkscape::UI::Dialog::FilterEffectsDialog::update_settings_view().

◆ get_color_class()

static Glib::ustring const & Inkscape::UI::get_color_class ( std::uint32_t const  rgba_color,
Glib::RefPtr< Gdk::Display > const &  display 
)
static

Definition at line 54 of file icon-loader.cpp.

References data.

Referenced by get_shape_icon().

◆ get_derived_widget()

template<class W , typename... Args>
W & Inkscape::UI::get_derived_widget ( const Glib::RefPtr< Gtk::Builder > &  builder,
const char *  id,
Args &&...  args 
)

Definition at line 42 of file builder-utils.h.

References builder, and Inkscape::UI::Detail::throw_missing().

◆ get_font_size()

int Inkscape::UI::get_font_size ( Gtk::Widget &  widget)

Get the relative font size as determined by a widgetʼs style/Pango contexts.

Definition at line 239 of file util.cpp.

Referenced by Inkscape::UI::Widget::Ruler::css_changed().

◆ get_menu_model()

auto Inkscape::UI::get_menu_model ( SpellingTextBufferAdapter &  adapter)
inline

Definition at line 87 of file libspelling-wrapper.h.

Referenced by Inkscape::UI::Dialog::TextEdit::TextEdit().

◆ get_monitor_geometry_at_point()

Gdk::Rectangle Inkscape::UI::get_monitor_geometry_at_point ( int  x,
int  y 
)

get monitor geometry of monitor at (or closest to) point on combined screen area

Definition at line 82 of file monitor.cpp.

References Geom::distance(), and monitor.

Referenced by sp_namedview_window_from_document().

◆ get_monitor_geometry_at_surface()

Gdk::Rectangle Inkscape::UI::get_monitor_geometry_at_surface ( Glib::RefPtr< Gdk::Surface > const &  surface)

get monitor geometry of monitor containing largest part of surface

Definition at line 71 of file monitor.cpp.

References monitor, and surface.

Referenced by sp_namedview_window_from_document().

◆ get_monitor_geometry_primary()

Gdk::Rectangle Inkscape::UI::get_monitor_geometry_primary ( )

get monitor geometry of primary monitor

Definition at line 61 of file monitor.cpp.

References monitor.

Referenced by add_actions_view_mode(), SPDesktopWidget::layoutWidgets(), and InkviewWindow::show_document().

◆ get_nth_child()

Gtk::Widget & Inkscape::UI::get_nth_child ( Gtk::Widget &  widget,
std::size_t const  index 
)

Get the widgetʼs child at the given position. Throws std::out_of_range if the index is invalid.

Definition at line 165 of file util.cpp.

References child, and index.

Referenced by add().

◆ get_object()

template<class Ob >
Glib::RefPtr< Ob > Inkscape::UI::get_object ( Glib::RefPtr< Gtk::Builder > const &  builder,
char const *  id 
)

Definition at line 50 of file builder-utils.h.

References builder, and Inkscape::UI::Detail::throw_missing().

◆ get_object_raw()

template<class Ob >
Ob & Inkscape::UI::get_object_raw ( Glib::RefPtr< Gtk::Builder > &  builder,
const char *  id 
)

This version of get_object is needed for Gtk::CellRenderer objects which can not be put into Glib::RefPtr by the compiler, but are somehow passed to us as RefPtrs anyway.

Definition at line 65 of file builder-utils.h.

References builder, and Inkscape::UI::Detail::throw_missing().

◆ get_shape_icon()

GetShapeIconResult Inkscape::UI::get_shape_icon ( Glib::ustring const &  shape_type,
std::uint32_t const  rgba_color 
)

Get the shape icon for this named shape type.

For example 'rect'. These icons are always symbolic icons no matter the theme in order to be coloured by the highlight color.

This function returns a struct containing the icon name you should use in a GtkImage/GtkCellRenderer, & a CSS class that will apply the requested color.

Parameters
shape_type- A string id for the shape from SPItem->typeName()
rgba_color- The fg color of the shape icon, in 32-bit unsigned int RGBA format.

Definition at line 92 of file icon-loader.cpp.

References get_color_class().

Referenced by get_shape_image(), and Inkscape::UI::Widget::CellRendererItemIcon::set_icon_name().

◆ get_shape_image()

Gtk::Image * Inkscape::UI::get_shape_image ( Glib::ustring const &  shape_type,
std::uint32_t const  rgba_color,
Gtk::IconSize const  icon_size 
)

As get_shape_icon(), but returns a ready-made, managed Image having that icon name & CSS class.

Definition at line 109 of file icon-loader.cpp.

References get_shape_icon(), and image.

Referenced by Inkscape::UI::Dialog::LivePathEffectEditor::selection_info().

◆ get_widget()

template<class W >
W & Inkscape::UI::get_widget ( const Glib::RefPtr< Gtk::Builder > &  builder,
const char *  id 
)

Definition at line 33 of file builder-utils.h.

References builder, get_widget(), and Inkscape::UI::Detail::throw_missing().

Referenced by Inkscape::UI::Dialog::AlignAndDistribute::AlignAndDistribute(), Inkscape::UI::Toolbar::ArcToolbar::ArcToolbar(), Inkscape::UI::Dialog::AttrDialog::AttrDialog(), Inkscape::UI::Dialog::BatchExport::BatchExport(), Inkscape::UI::Toolbar::BooleansToolbar::BooleansToolbar(), Inkscape::UI::Toolbar::Box3DToolbar::Box3DToolbar(), Inkscape::UI::Toolbar::CalligraphyToolbar::CalligraphyToolbar(), Inkscape::UI::Widget::CanvasNotice::CanvasNotice(), Inkscape::UI::Widget::ColorPage::ColorPage(), Inkscape::UI::Widget::ColorPalette::ColorPalette(), Inkscape::UI::Dialog::CommandPalette::CommandPalette(), Inkscape::UI::Toolbar::CommandToolbar::CommandToolbar(), Inkscape::UI::Widget::CompletionPopup::CompletionPopup(), Inkscape::UI::Toolbar::ConnectorToolbar::ConnectorToolbar(), Inkscape::UI::Dialog::DocumentResources::DocumentResources(), Inkscape::UI::Toolbar::DropperToolbar::DropperToolbar(), Inkscape::UI::Toolbar::EraserToolbar::EraserToolbar(), Inkscape::UI::Dialog::Export::Export(), Inkscape::UI::Dialog::ExtensionsGallery::ExtensionsGallery(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterEffectsDialog(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::FilterModifier(), Inkscape::UI::Dialog::FontCollectionsManager::FontCollectionsManager(), Inkscape::UI::Widget::FontList::FontList(), get_widget(), Inkscape::UI::Widget::GradientEditor::GradientEditor(), Inkscape::UI::Toolbar::GradientToolbar::GradientToolbar(), Inkscape::UI::Widget::ImageProperties::ImageProperties(), Inkscape::UI::Dialog::LivePathEffectEditor::LivePathEffectEditor(), Inkscape::UI::Toolbar::LPEToolbar::LPEToolbar(), Inkscape::UI::Widget::MarkerComboBox::MarkerComboBox(), Inkscape::UI::Toolbar::MarkerToolbar::MarkerToolbar(), Inkscape::UI::Toolbar::MeasureToolbar::MeasureToolbar(), Inkscape::UI::Dialog::MeasureToolSettingsDialog::MeasureToolSettingsDialog(), Inkscape::UI::Toolbar::MeshToolbar::MeshToolbar(), Inkscape::UI::Toolbar::NodeToolbar::NodeToolbar(), Inkscape::UI::Dialog::ObjectAttributes::ObjectAttributes(), Inkscape::UI::Toolbar::ObjectPickerToolbar::ObjectPickerToolbar(), Inkscape::UI::Dialog::ObjectsPanel::ObjectsPanel(), Inkscape::UI::Toolbar::PageToolbar::PageToolbar(), Inkscape::UI::Toolbar::PaintbucketToolbar::PaintbucketToolbar(), Inkscape::UI::Widget::PatternEditor::PatternEditor(), Inkscape::Extension::Internal::PdfImportDialog::PdfImportDialog(), Inkscape::UI::Toolbar::PencilToolbar::PencilToolbar(), Inkscape::UI::Toolbar::RectToolbar::RectToolbar(), Inkscape::UI::Toolbar::SelectToolbar::SelectToolbar(), Inkscape::UI::Dialog::SingleExport::SingleExport(), Inkscape::UI::Toolbar::SnapToolbar::SnapToolbar(), Inkscape::UI::Toolbar::SpiralToolbar::SpiralToolbar(), Inkscape::UI::Toolbar::SprayToolbar::SprayToolbar(), Inkscape::UI::Toolbar::StarToolbar::StarToolbar(), Inkscape::UI::Dialog::StartScreen::StartScreen(), Inkscape::UI::Dialog::SwatchesPanel::SwatchesPanel(), Inkscape::UI::Dialog::TextEdit::TextEdit(), Inkscape::UI::Toolbar::TextToolbar::TextToolbar(), Inkscape::UI::Toolbar::TweakToolbar::TweakToolbar(), Inkscape::UI::Dialog::XmlTree::XmlTree(), and Inkscape::UI::Toolbar::ZoomToolbar::ZoomToolbar().

◆ gui_warning()

void Inkscape::UI::gui_warning ( const std::string &  msg,
Gtk::Window *  parent_window 
)

Definition at line 134 of file util.cpp.

References dialog_run(), and msg.

Referenced by Inkscape::Extension::Implementation::Script::_change_extension().

◆ hide_widget()

bool Inkscape::UI::hide_widget ( const Glib::RefPtr< Gtk::Builder > &  builder,
std::string const &  id 
)

Definition at line 48 of file builder-utils.cpp.

References builder.

Referenced by Inkscape::UI::Widget::ColorPage::ColorPage().

◆ is_descendant_of()

bool Inkscape::UI::is_descendant_of ( Gtk::Widget const &  descendant,
Gtk::Widget const &  ancestor 
)

Returns if widget is a descendant of given ancestor, i.e.: itself, a child, or a childʼs child.

Parameters
descendantThe widget of interest
ancestorThe potential ancestor
Returns
Whether the widget of interest is a descendant of the given ancestor.

Definition at line 210 of file util.cpp.

References _break, _continue, for_each_parent(), and parent.

Referenced by Inkscape::UI::Widget::PopoverMenu::check_child_invariants(), and popup_at().

◆ list_corrections()

auto Inkscape::UI::list_corrections ( SpellingChecker *  checker,
char const *  word 
)
inline

Definition at line 71 of file libspelling-wrapper.h.

References list_corrections_c(), and result.

Referenced by Inkscape::UI::Dialog::SpellCheck::nextWord().

◆ list_corrections_c()

auto Inkscape::UI::list_corrections_c ( SpellingChecker *  checker,
char const *  word 
)
inline

Definition at line 66 of file libspelling-wrapper.h.

Referenced by list_corrections().

◆ list_language_names_and_codes()

template<typename F >
void Inkscape::UI::list_language_names_and_codes ( SpellingProvider *  provider,
F &&  cb 
)
inline

Definition at line 42 of file libspelling-wrapper.h.

References name.

Referenced by Inkscape::UI::Dialog::SpellCheck::SpellCheck().

◆ on_click_pressed()

static void Inkscape::UI::on_click_pressed ( int  n_press,
double  x,
double  y,
Gtk::GestureClick &  click,
PopupMenuSlot const &  slot 
)
static

◆ on_key_pressed()

static bool Inkscape::UI::on_key_pressed ( unsigned const  keyval,
unsigned  ,
Gdk::ModifierType  state,
PopupMenuSlot const &  slot 
)
static

Definition at line 31 of file popup-menu.cpp.

References Inkscape::UI::Controller::has_flag().

Referenced by on_popup_menu().

◆ on_popup_menu()

void Inkscape::UI::on_popup_menu ( Gtk::Widget &  widget,
PopupMenuSlot  slot 
)

Connect slot to a widgetʼs key and button events that traditionally trigger a popup menu, i.e.:

  • The keys used by GTK3ʼs signal Widget::popup-menu: the Menu key, or the Shift+F10 combination
  • The right mouse button or other platform convention, as per gtk_event_triggers_context_menu()

Definition at line 57 of file popup-menu.cpp.

References key, on_click_pressed(), and on_key_pressed().

Referenced by Inkscape::UI::Widget::SpinButton::_construct(), Inkscape::UI::Dialog::connect_remove_popup_menu(), Inkscape::UI::Widget::SelectedStyle::SelectedStyle(), and Inkscape::UI::Widget::StatusBar::StatusBar().

◆ operator<<()

std::ostream & Inkscape::UI::operator<< ( std::ostream &  out,
NodeType  type 
)
private

Definition at line 141 of file node.cpp.

References NODE_AUTO, NODE_CUSP, NODE_SMOOTH, and NODE_SYMMETRIC.

◆ pack() [1/2]

static void Inkscape::UI::pack ( PackType const  pack_type,
Gtk::Box &  box,
Gtk::Widget &  child,
bool const  expand,
bool const  fill,
unsigned const  padding 
)
static

◆ pack() [2/2]

static void Inkscape::UI::pack ( PackType const  pack_type,
Gtk::Box &  box,
Gtk::Widget &  child,
PackOptions const  options,
unsigned const  padding 
)
static

Definition at line 132 of file pack.cpp.

References child, expand_widget, pack(), and shrink.

◆ pack_end() [1/2]

void Inkscape::UI::pack_end ( Gtk::Box &  box,
Gtk::Widget &  child,
bool  expand,
bool  fill,
unsigned  padding = 0 
)

Adds child to box, packed with reference to the end of box.

The child is packed after (away from end of) any other child packed with reference to the end of box. See the documentation of pack_start() for details of the parameters.

Definition at line 153 of file pack.cpp.

References child, end, and pack().

Referenced by Inkscape::UI::Widget::ColorNotebook::_initUI(), Inkscape::UI::Dialog::SelectorsDialog::_showWidgets(), Inkscape::UI::Dialog::ArrangeDialog::ArrangeDialog(), Inkscape::UI::Widget::PatternEditor::bind_store(), Inkscape::UI::Dialog::DocumentProperties::build_metadata(), Inkscape::UI::Dialog::CloneTiler::CloneTiler(), Inkscape::UI::Dialog::DialogWindow::DialogWindow(), Inkscape::UI::Dialog::FillAndStroke::FillAndStroke(), Inkscape::UI::Dialog::Find::Find(), Inkscape::Extension::ParamColor::get_widget(), Inkscape::Extension::ParamOptionGroup::get_widget(), Inkscape::Extension::ParamPath::get_widget(), Inkscape::UI::Dialog::SvgFontsDialog::glyphs_tab(), Inkscape::UI::Dialog::GlyphsPanel::GlyphsPanel(), Inkscape::UI::Widget::Scalar::hide_label(), Inkscape::UI::Widget::PrefEditFolder::init(), Inkscape::UI::Widget::PrefOpenFolder::init(), Inkscape::UI::Widget::PrefEntryFileButtonHBox::init(), Inkscape::UI::Dialog::InkscapePreferences::initKeyboardShortcuts(), InkSpinScale::InkSpinScale(), Inkscape::UI::Widget::Memory::Memory(), Inkscape::UI::Widget::Messages::Messages(), Inkscape::LivePathEffect::LPETiling::newWidget(), Inkscape::UI::Widget::PaintSelector::PaintSelector(), Inkscape::LivePathEffect::PathArrayParam::param_newWidget(), Inkscape::LivePathEffect::SatelliteArrayParam::param_newWidget(), and Inkscape::Extension::Internal::RvngImportDialog::RvngImportDialog().

◆ pack_end() [2/2]

void Inkscape::UI::pack_end ( Gtk::Box &  box,
Gtk::Widget &  child,
PackOptions  options = PackOptions::expand_widget,
unsigned  padding = 0 
)

Adds child to box, packed with reference to the end of box.

The child is packed after (away from end of) any other child packed with reference to the end of box.

Parameters
optionsThe PackOptions to use, which are decomposed into booleans of whether to expand or fill and passed to the other overload; see its doc.

Definition at line 159 of file pack.cpp.

References child, end, and pack().

◆ pack_start() [1/2]

void Inkscape::UI::pack_start ( Gtk::Box &  box,
Gtk::Widget &  child,
bool  expand,
bool  fill,
unsigned  padding = 0 
)

Adds child to box, packed with reference to the start of box.

The child is packed after any other child packed with reference to the start of box.

Our pack_*() functions aim to replace GTKʼs Box.pack_start() in a GTK4-ready way, so code built against GTK3 can swap to our functions and afterward will not have need rewritten in migrating to GTK4. If writing new code you should probably avoid using these if you can, as they cannot be converted from C++ to .ui for instance. Instead, set properties on child widgets (not using the GTK3-only child properties!) and use Box.add() in GTK3 or .append() in GTK4.

Internally, the list of children in the Box is maintained in the order of:

  • widgets added by our pack_start(), in the same order of the calls thereto;
  • …widgets added by our pack_end() in the opposite order of calls thereto.

The expand, fill and padding are implemented by setting relevant [hv]expand, [hv]align and margin-* properties on the child, instead of GTK3 child props.

Parameters
childThe Gtk::Widget to be added to the box.
expandTRUE if the new child is to be given extra space allocated to box. The extra space will be divided evenly between all children that use this option. This is implemented by setting the childʼs relevant [hv]expand property. Note that there’s a subtle but important difference between GtkBox‘s expand and fill child properties and the ones in GtkWidget: setting GtkWidget:hexpand or GtkWidget:vexpand to TRUE will propagate up the widget hierarchy, so a pixel-perfect port might require you to reset the expansion flags to FALSE in a parent widget higher up the hierarchy, or to set the child to not expand (shrink). Our pack_*() functions do not attempt to do workaround this for you, as that might cause NEW problems.
fillTRUE if space given to child by the expand option is actually allocated to child, rather than just padding it. This parameter has no effect if expand is set to FALSE. A child is always allocated the full height of a horizontal GtkBox and the full width of a vertical GtkBox. This option affects the other dimension. This is implemented by setting the childʼs relevant [hv]align prop to ALIGN_FILL if fill is TRUE, else to START or END to match the pack type.
paddingExtra space in pixels to put between this child and its neighbors, over and above the global amount specified by GtkBox:spacing property. If child is a widget at one of the reference ends of box, then padding pixels are also put between child and the reference edge of box. This is implemented by adding to the childʼs relevant margin-* props.

Definition at line 141 of file pack.cpp.

References child, pack(), and start.

Referenced by Inkscape::UI::Dialog::SelectorsDialog::_addSelector(), Inkscape::UI::Dialog::ObjectProperties::_init(), Inkscape::UI::Widget::ColorNotebook::_initUI(), Inkscape::UI::Dialog::SelectorsDialog::_showWidgets(), Inkscape::UI::Widget::DialogPage::add_line(), Inkscape::UI::Widget::Random::addReseedButton(), Inkscape::UI::Widget::Scalar::addSlider(), Inkscape::UI::Dialog::ArrangeDialog::ArrangeDialog(), Inkscape::UI::Dialog::AttrDialog::AttrDialog(), Inkscape::UI::Widget::PatternEditor::bind_store(), Inkscape::UI::Dialog::DocumentProperties::build_gridspage(), Inkscape::UI::Dialog::CloneTiler::checkbox(), Inkscape::UI::Dialog::CloneTiler::CloneTiler(), Inkscape::UI::Widget::ComboToolItem::ComboToolItem(), Inkscape::UI::Dialog::create_tab_label(), Inkscape::UI::Widget::DualSpinScale::DualSpinScale(), Inkscape::UI::Dialog::FillAndStroke::FillAndStroke(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterEffectsDialog(), Inkscape::UI::Dialog::Find::Find(), Inkscape::UI::Widget::FontVariants::FontVariants(), Inkscape::LivePathEffect::LPETiling::generate_buttons(), Inkscape::Extension::Extension::get_info_widget(), Inkscape::Extension::Extension::get_params_widget(), Inkscape::Extension::ParamBool::get_widget(), Inkscape::Extension::ParamColor::get_widget(), Inkscape::Extension::ParamFloat::get_widget(), Inkscape::Extension::ParamInt::get_widget(), Inkscape::Extension::ParamNotebook::ParamNotebookPage::get_widget(), Inkscape::Extension::ParamOptionGroup::get_widget(), Inkscape::Extension::ParamPath::get_widget(), Inkscape::Extension::ParamString::get_widget(), Inkscape::Extension::WidgetBox::get_widget(), Inkscape::Extension::WidgetLabel::get_widget(), Inkscape::UI::Dialog::SvgFontsDialog::global_settings_tab(), Inkscape::UI::Dialog::SvgFontsDialog::glyphs_tab(), Inkscape::UI::Dialog::GlyphsPanel::GlyphsPanel(), Inkscape::UI::Widget::GradientSelector::GradientSelector(), Inkscape::UI::Dialog::GridArrangeTab::GridArrangeTab(), gui_request_dpi_fix_method(), Inkscape::UI::Widget::ImageProperties::ImageProperties(), Inkscape::UI::Widget::PrefEditFolder::init(), Inkscape::UI::Widget::PrefOpenFolder::init(), Inkscape::UI::Widget::PrefEntryFileButtonHBox::init(), Inkscape::UI::Widget::PrefEntryButtonHBox::init(), Inkscape::UI::Widget::PrefSlider::init(), Inkscape::UI::Widget::ZoomCorrRulerSlider::init(), Inkscape::UI::Widget::Licensor::init(), Inkscape::UI::Dialog::FilterEffectsDialog::init_settings_widgets(), Inkscape::UI::Dialog::InkscapePreferences::initKeyboardShortcuts(), Inkscape::UI::Dialog::InkscapePreferences::initPageRendering(), Inkscape::UI::Dialog::InkscapePreferences::initPageSystem(), Inkscape::UI::Dialog::InkscapePreferences::initPageUI(), Inkscape::UI::Dialog::InkscapePreferences::InkscapePreferences(), Inkscape::UI::Dialog::SvgFontsDialog::kerning_tab(), Inkscape::UI::Widget::Labelled::Labelled(), Inkscape::UI::Widget::LayerSelector::LayerSelector(), Inkscape::UI::Dialog::Transformation::layoutPageRotate(), Inkscape::UI::Dialog::LivePathEffectEditor::LivePathEffectEditor(), Inkscape::UI::Widget::StrokeStyle::makeRadioButton(), Inkscape::UI::Widget::Memory::Memory(), Inkscape::UI::Widget::Messages::Messages(), Inkscape::LivePathEffect::Effect::newWidget(), Inkscape::LivePathEffect::LPETiling::newWidget(), Inkscape::LivePathEffect::LPEBSpline::newWidget(), Inkscape::LivePathEffect::LPECloneOriginal::newWidget(), Inkscape::LivePathEffect::LPECopyRotate::newWidget(), Inkscape::LivePathEffect::LPEFilletChamfer::newWidget(), Inkscape::LivePathEffect::LPELattice2::newWidget(), Inkscape::LivePathEffect::LPEMeasureSegments::newWidget(), Inkscape::LivePathEffect::LPEMirrorSymmetry::newWidget(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::newWidget(), Inkscape::LivePathEffect::LPERoughen::newWidget(), Inkscape::LivePathEffect::LPESimplify::newWidget(), Inkscape::LivePathEffect::LPESlice::newWidget(), Inkscape::LivePathEffect::LPETransform2Pts::newWidget(), Inkscape::UI::Widget::NotebookPage::NotebookPage(), Inkscape::UI::Widget::ObjectCompositeSettings::ObjectCompositeSettings(), Inkscape::UI::Widget::PageSelector::PageSelector(), Inkscape::UI::Widget::PaintSelector::PaintSelector(), Inkscape::LivePathEffect::PointParam::param_newWidget(), Inkscape::LivePathEffect::ColorPickerParam::param_newWidget(), Inkscape::LivePathEffect::OriginalPathParam::param_newWidget(), Inkscape::LivePathEffect::OriginalSatelliteParam::param_newWidget(), Inkscape::LivePathEffect::PathParam::param_newWidget(), Inkscape::LivePathEffect::PathArrayParam::param_newWidget(), Inkscape::LivePathEffect::SatelliteParam::param_newWidget(), Inkscape::LivePathEffect::SatelliteArrayParam::param_newWidget(), Inkscape::LivePathEffect::TextParam::param_newWidget(), Inkscape::LivePathEffect::ToggleButtonParam::param_newWidget(), Inkscape::LivePathEffect::TransformedPointParam::param_newWidget(), Inkscape::LivePathEffect::VectorParam::param_newWidget(), Inkscape::UI::Widget::PatternEditor::PatternEditor(), Inkscape::Extension::Internal::PdfImportDialog::PdfImportDialog(), Inkscape::UI::Dialog::PolarArrangeTab::PolarArrangeTab(), Inkscape::Extension::PrefDialog::PrefDialog(), Inkscape::UI::Dialog::StyleDialog::readStyleElement(), Inkscape::Extension::Internal::RvngImportDialog::RvngImportDialog(), Inkscape::UI::Widget::ScalarUnit::ScalarUnit(), Inkscape::UI::Dialog::LivePathEffectEditor::selection_info(), Inkscape::UI::Widget::PaintSelector::set_mode_color(), Inkscape::UI::Widget::PaintSelector::set_mode_mesh(), Inkscape::Extension::Implementation::Script::showPopupError(), Inkscape::UI::Widget::SimpleFilterModifier::SimpleFilterModifier(), Inkscape::UI::Toolbar::SnapToolbar::SnapToolbar(), sp_query_custom_tooltip(), Inkscape::UI::Dialog::CloneTiler::spinbox(), Inkscape::UI::Widget::SpinScale::SpinScale(), Inkscape::UI::Widget::SpinScale::SpinScale(), Inkscape::UI::Widget::StrokeStyle::StrokeStyle(), Inkscape::UI::Widget::PaintSelector::style_button_add(), Inkscape::UI::Dialog::StyleDialog::StyleDialog(), Inkscape::UI::Widget::StyleSwatch::StyleSwatch(), Inkscape::UI::Dialog::SvgFontsDialog::SvgFontsDialog(), Inkscape::UI::Widget::SwatchSelector::SwatchSelector(), Inkscape::UI::Dialog::CloneTiler::table_x_y_rand(), Inkscape::UI::Dialog::TextEdit::TextEdit(), Inkscape::UI::Dialog::UndoHistory::UndoHistory(), Inkscape::UI::Widget::ComboToolItem::use_group_label(), and Inkscape::UI::Dialog::ObjectAttributes::widget_setup().

◆ pack_start() [2/2]

void Inkscape::UI::pack_start ( Gtk::Box &  box,
Gtk::Widget &  child,
PackOptions  options = PackOptions::expand_widget,
unsigned  padding = 0 
)

Adds child to box, packed with reference to the start of box.

Parameters
optionsThe PackOptions to use, which are decomposed into booleans of whether to expand or fill and passed to the other overload; see its doc.

Definition at line 147 of file pack.cpp.

References child, pack(), and start.

◆ popup_at() [1/4]

◆ popup_at() [2/4]

void Inkscape::UI::popup_at ( Gtk::Popover &  popover,
Gtk::Widget &  widget,
double  x_offset = 0.0,
double  y_offset = 0.0 
)

Replace Gtk::Menu::popup_at_pointer.

If x or y offsets != 0, :pointing-to is set to {x,y,1,1} else it is set to the full allocation of widget, translated into the coordinate space of the popoverʼs parent (:relative-to) widget. Hence, the widget must be the popoverʼs parent (:relative-to) widget or a descendant thereof.

Definition at line 93 of file popup-menu.cpp.

References popup_at().

◆ popup_at() [3/4]

void Inkscape::UI::popup_at ( Gtk::Popover &  popover,
Gtk::Widget &  widget,
Gdk::Rectangle const &  rect 
)

As popup_at() but point to center of rect rect must be valid within the coords of @widget, & @awidget must be a descendant of @parent.

Definition at line 114 of file popup-menu.cpp.

References popup_at().

◆ popup_at() [4/4]

void Inkscape::UI::popup_at ( Gtk::Popover &  popover,
Gtk::Widget &  widget,
std::optional< Geom::Point > const &  offset 
)

Definition at line 99 of file popup-menu.cpp.

References offset, and popup_at().

◆ popup_at_center()

void Inkscape::UI::popup_at_center ( Gtk::Popover &  popover,
Gtk::Widget &  widget 
)

◆ remove_all_children()

◆ set_align()

static void Inkscape::UI::set_align ( Gtk::Widget &  widget,
Gtk::Orientation const  orientation,
Gtk::Align const  align 
)
static

Definition at line 52 of file pack.cpp.

Referenced by set_fill().

◆ set_enabled()

void Inkscape::UI::set_enabled ( SpellingTextBufferAdapter &  adapter,
bool  enabled 
)
inline

Definition at line 97 of file libspelling-wrapper.h.

Referenced by Inkscape::UI::Dialog::TextEdit::TextEdit().

◆ set_expand()

static void Inkscape::UI::set_expand ( Gtk::Widget &  widget,
Gtk::Orientation const  orientation,
bool const  expand 
)
static

◆ set_fill()

static void Inkscape::UI::set_fill ( Gtk::Widget &  widget,
Gtk::Orientation const  orientation,
bool const  fill,
PackType const  pack_type 
)
static

Definition at line 71 of file pack.cpp.

References set_align(), and to_align().

Referenced by pack().

◆ set_icon_sizes() [1/2]

void Inkscape::UI::set_icon_sizes ( Gtk::Widget *  parent,
int  pixel_size 
)

Recursively set all the icon sizes inside this parent widget.

Any GtkImage will be changed so only call this on widget stacks where all children have the same expected sizes.

Parameters
parent- The parent widget to traverse
pixel_size- The new pixel size of the images it contains

Definition at line 113 of file util.cpp.

References _continue, _skip, for_each_descendant(), and parent.

Referenced by Inkscape::UI::Dialog::AlignAndDistribute::AlignAndDistribute(), SPDesktopWidget::apply_ctrlbar_settings(), set_icon_sizes(), and SPDesktopWidget::SPDesktopWidget().

◆ set_icon_sizes() [2/2]

void Inkscape::UI::set_icon_sizes ( GtkWidget *  parent,
int  pixel_size 
)

Definition at line 129 of file util.cpp.

References parent, and set_icon_sizes().

◆ set_padding()

static void Inkscape::UI::set_padding ( Gtk::Widget &  widget,
Gtk::Orientation const  orientation,
int const  margin_start,
int const  margin_end 
)
static

Definition at line 78 of file pack.cpp.

Referenced by Inkscape::UI::Widget::ImageToggler::ImageToggler(), and pack().

◆ show_parsing_error()

static void Inkscape::UI::show_parsing_error ( const Glib::RefPtr< const Gtk::CssSection > &  section,
const Glib::Error &  error 
)
static

Definition at line 235 of file themes.cpp.

Referenced by Inkscape::UI::ThemeContext::add_gtk_css().

◆ snap_increment_degrees()

static double Inkscape::UI::snap_increment_degrees ( )
staticprivate

◆ sp_tweak_background_colors()

std::string Inkscape::UI::sp_tweak_background_colors ( std::string  cssstring,
double  crossfade,
double  contrast,
bool  dark 
)

Definition at line 206 of file themes.cpp.

References Inkscape::ustring::format_classic().

Referenced by Inkscape::UI::ThemeContext::add_gtk_css().

◆ spelling_text_buffer_adapter_create()

auto Inkscape::UI::spelling_text_buffer_adapter_create ( GtkSourceBuffer *  buffer,
SpellingChecker *  checker 
)
inline

Definition at line 82 of file libspelling-wrapper.h.

Referenced by Inkscape::UI::Dialog::TextEdit::TextEdit().

◆ system_open()

void Inkscape::UI::system_open ( const Glib::ustring &  path)

Opens the given path with platform-specific tools.

Definition at line 143 of file util.cpp.

Referenced by Inkscape::UI::Widget::PrefEditFolder::onOpenButtonClickedCallback(), and Inkscape::UI::Widget::PrefOpenFolder::onRelatedButtonClickedCallback().

◆ to_align()

static auto Inkscape::UI::to_align ( PackType const  pack_type)
static

Definition at line 62 of file pack.cpp.

References end, and start.

Referenced by set_fill().

Variable Documentation

◆ BSPLINE_TOL

static constexpr double Inkscape::UI::BSPLINE_TOL = 0.001
constexprprivate

◆ DEFAULT_START_POWER

static constexpr double Inkscape::UI::DEFAULT_START_POWER = 1.0 / 3.0
constexprprivate

◆ grab_event_mask

constexpr auto Inkscape::UI::grab_event_mask
staticconstexpr
Initial value:
= EventType::BUTTON_PRESS |
EventType::BUTTON_RELEASE |
EventType::MOTION |
EventType::KEY_PRESS |
EventType::KEY_RELEASE |
EventType::SCROLL

Events which should be captured when a handle is being dragged.

Definition at line 36 of file control-point.cpp.

Referenced by Inkscape::UI::ControlPoint::transferGrab().

◆ NO_POWER

◆ pending_operations

std::unordered_set<QueryFileInfo*> Inkscape::UI::pending_operations
static

◆ s_box_children

auto Inkscape::UI::s_box_children = std::unordered_map<Gtk::Box *, BoxChildren>{}
static

Definition at line 40 of file pack.cpp.

Referenced by add().