14#include <glibmm/i18n.h>
38 document->getPageManager().centerToSelectedPage(
desktop);
55 document->getPageManager().centerToSelectedPage(
desktop);
63 if (
auto page = page_manager.getSelected()) {
64 if (
page->setPageIndex(
page->getPageIndex() - 1, page_manager.move_objects())) {
73 if (
auto page = page_manager.getSelected()) {
74 if (
page->setPageIndex(
page->getPageIndex() + 1, page_manager.move_objects())) {
82 if (
auto action = doc->
getActionGroup()->lookup_action(
"page-move-objects")) {
84 action->get_state(active);
86 action->change_state(active);
89 prefs->setBool(
"/tools/pages/move_objects", active);
91 g_warning(
"Can't find page-move-objects action group!");
95const Glib::ustring
SECTION = NC_(
"Action Section",
"Page");
100 {
"doc.page-new", N_(
"New Page"),
SECTION, N_(
"Create a new page") },
101 {
"doc.page-delete", N_(
"Delete Page"),
SECTION, N_(
"Delete the selected page") },
102 {
"doc.page-move-objects", N_(
"Move Objects with Page"),
SECTION, N_(
"Move overlapping objects as the page is moved") },
103 {
"doc.page-move-backward", N_(
"Move Before Previous"),
SECTION, N_(
"Move page backwards in the page order") },
104 {
"doc.page-move-forward", N_(
"Move After Next"),
SECTION, N_(
"Move page forwards in the page order") },
113 group->add_action(
"page-new", sigc::bind(sigc::ptr_fun(&
page_new), doc));
114 group->add_action(
"page-delete", sigc::bind(sigc::ptr_fun(&
page_delete), doc));
115 group->add_action(
"page-move-backward", sigc::bind(sigc::ptr_fun(&
page_backward), doc));
116 group->add_action(
"page-move-forward", sigc::bind(sigc::ptr_fun(&
page_forward), doc));
117 group->add_action_bool(
"page-move-objects", sigc::bind(sigc::ptr_fun(&
set_move_objects), doc),
118 prefs->
getBool(
"/tools/pages/move_objects",
true));
131 {
"win.page-new", N_(
"New Page"),
SECTION, N_(
"Create a new page and center view on it")},
132 {
"win.page-delete", N_(
"Delete Page"),
SECTION, N_(
"Delete the selected page and center view on next page")},
void page_delete(SPDocument *document)
void set_move_objects(SPDocument *doc)
const Glib::ustring SECTION
void page_new_and_center(InkscapeWindow *window)
void page_backward(SPDocument *document)
void add_actions_page_tools(InkscapeWindow *win)
void add_actions_pages(SPDocument *doc)
void page_forward(SPDocument *document)
std::vector< std::vector< Glib::ustring > > win_page_actions
void page_new(SPDocument *document)
std::vector< std::vector< Glib::ustring > > doc_page_actions
void page_delete_and_center(InkscapeWindow *window)
static InkscapeApplication * instance()
Singleton instance.
SPDesktop * get_desktop()
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
SPPage * newPage()
Add a new page of the default size, this will be either the size of the viewBox if no pages exist,...
bool selectPage(SPPage *page)
Set the given page as the selected page.
void deletePage(SPPage *page, bool contents=false)
Delete the given page.
static bool move_objects()
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
static Preferences * get()
Access the singleton Preferences object.
SPDocument * getDocument() const
Typed SVG document implementation.
Glib::RefPtr< Gio::SimpleActionGroup > getActionGroup()
Inkscape::PageManager & getPageManager()
Editable view implementation.
TODO: insert short description here.
Macro for icon names used in Inkscape.
Inkscape - An SVG editor.
Singleton class to access the preferences file in a convenient way.