Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
page-toolbar.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
6/* Authors:
7 * Martin Owens <doctormo@geek-2.com>
8 * Vaibhav Malik <vaibhavmalik2018@gmail.com>
9 *
10 * Copyright (C) 2021 Martin Owens
11 *
12 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13 */
14
15#ifndef INKSCAPE_UI_TOOLBAR_PAGE_TOOLBAR_H
16#define INKSCAPE_UI_TOOLBAR_PAGE_TOOLBAR_H
17
18#include <string>
19
20#include <sigc++/scoped_connection.h>
21#include "toolbar.h"
23
24namespace Gtk {
25class ComboBoxText;
26class Entry;
27class EntryCompletion;
28class Label;
29class ListStore;
30class Popover;
31class Button;
32class Builder;
33class Separator;
34} // namespace Gtk
35
36class SPDocument;
37class SPPage;
38
39namespace Inkscape {
40
41class PaperSize;
42
43namespace UI {
44
45namespace Tools {
46class ToolBase;
47} // namespace Tools
48
49namespace Toolbar {
50
51class PageToolbar : public Toolbar
52{
53public:
55 ~PageToolbar() override;
56
57 void setDesktop(SPDesktop *desktop) override;
58
59private:
60 PageToolbar(Glib::RefPtr<Gtk::Builder> const &builder);
61
62 void labelEdited();
63 void bleedsEdited();
64 void marginsEdited();
65 void marginTopEdited();
66 void marginRightEdited();
67 void marginBottomEdited();
68 void marginLeftEdited();
69 void marginSideEdited(int side, const Glib::ustring &value);
70 void sizeChoose(const std::string &preset_key);
71 void sizeChanged();
72 void setLabelText(SPPage *page = nullptr);
73 void setSizeText(SPPage *page = nullptr, bool display_only = true);
74 void setMarginText(SPPage *page = nullptr);
75
77
79 void pagesChanged();
82 void populate_sizes();
83
84 sigc::scoped_connection _doc_connection;
85 sigc::scoped_connection _pages_changed;
86 sigc::scoped_connection _page_selected;
87 sigc::scoped_connection _page_modified;
88
89 Gtk::ComboBoxText &_combo_page_sizes;
90 Gtk::Entry *_entry_page_sizes;
91 Gtk::Entry &_text_page_margins;
92 Gtk::Popover &_margin_popover;
93 Gtk::Entry &_text_page_bleeds;
94 Gtk::Entry &_text_page_label;
95 Gtk::Label &_label_page_pos;
96 Gtk::Button &_btn_page_backward;
97 Gtk::Button &_btn_page_foreward;
98 Gtk::Button &_btn_page_delete;
99 Gtk::Button &_btn_move_toggle;
100 Gtk::Separator &_sep1;
101
102 Glib::RefPtr<Gtk::ListStore> _sizes_list;
103 Glib::RefPtr<Gtk::ListStore> _sizes_search;
104
109
110 double _unit_to_size(std::string number, std::string unit_str, std::string const &backup);
111};
112
113} // namespace Toolbar
114} // namespace UI
115} // namespace Inkscape
116
117#endif // INKSCAPE_UI_TOOLBAR_PAGE_TOOLBAR_H
118
119/*
120 Local Variables:
121 mode:c++
122 c-file-style:"stroustrup"
123 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
124 indent-tabs-mode:nil
125 fill-column:99
126 End:
127*/
128// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
uint64_t page
Definition canvas.cpp:171
sigc::scoped_connection _pages_changed
Inkscape::UI::Widget::MathSpinButton & _margin_left
Inkscape::UI::Widget::MathSpinButton & _margin_bottom
void setDesktop(SPDesktop *desktop) override
Glib::RefPtr< Gtk::ListStore > _sizes_list
sigc::scoped_connection _doc_connection
Inkscape::UI::Widget::MathSpinButton & _margin_top
void sizeChoose(const std::string &preset_key)
void setLabelText(SPPage *page=nullptr)
Sets the label of the page to the text box.
Glib::RefPtr< Gtk::ListStore > _sizes_search
void populate_sizes()
Take all selectable page sizes and add to search and dropdowns.
void toolChanged(SPDesktop *desktop, Inkscape::UI::Tools::ToolBase *tool)
void setSizeText(SPPage *page=nullptr, bool display_only=true)
Sets the size of the current page into the entry page size.
sigc::scoped_connection _page_modified
void selectionModified(SPPage *page)
Update all the elements that might have changed within a page.
Gtk::ComboBoxText & _combo_page_sizes
double _unit_to_size(std::string number, std::string unit_str, std::string const &backup)
Convert the parsed sections of a text input into a desktop pixel value.
void marginSideEdited(int side, const Glib::ustring &value)
Inkscape::UI::Widget::MathSpinButton & _margin_right
void setMarginText(SPPage *page=nullptr)
void sizeChanged()
A manually typed input size, parse out what we can understand from the text or ignore it if the text ...
sigc::scoped_connection _page_selected
Base class for all tool toolbars.
Definition toolbar.h:72
Base class for Event processors.
Definition tool-base.h:95
A spin button for use with builders.
Definition spinbutton.h:37
To do: update description of desktop.
Definition desktop.h:149
Typed SVG document implementation.
Definition document.h:101
Definition desktop.h:50
Helper class to stream background task notifications as a series of messages.
SPDesktop * desktop
TODO: insert short description here.
Glib::RefPtr< Gtk::Builder > builder