diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-11-25 20:51:17 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-11-25 20:51:17 +0000 |
| commit | 0bd9f7e209d522dbcebe0449a91397fdd9e38977 (patch) | |
| tree | 834c7d02456658b57625ab68cc28f7854a5a85dc /src/ui | |
| parent | Fix handling of x and y attributes of patterns (diff) | |
| parent | Fix ruler redraw issue on GTK 2.22 (diff) | |
| download | inkscape-0bd9f7e209d522dbcebe0449a91397fdd9e38977.tar.gz inkscape-0bd9f7e209d522dbcebe0449a91397fdd9e38977.zip | |
Merge from trunk
(bzr r9508.1.70)
Diffstat (limited to 'src/ui')
165 files changed, 749 insertions, 2422 deletions
diff --git a/src/ui/cache/svg_preview_cache.h b/src/ui/cache/svg_preview_cache.h index 0b4d52774..0fac94782 100644 --- a/src/ui/cache/svg_preview_cache.h +++ b/src/ui/cache/svg_preview_cache.h @@ -47,6 +47,6 @@ class SvgPreview { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 0a64e7fa7..90a9ba0f5 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -875,6 +875,7 @@ void ClipboardManagerImpl::_pasteDocument(SPDesktop *desktop, SPDocument *clipdo // get offset from mouse pointer to bbox center, snap to grid if enabled Geom::Point mouse_offset = desktop->point() - sel_bbox->midpoint(); offset = m.multipleOfGridPitch(mouse_offset - offset, sel_bbox->midpoint() + offset) + offset; + m.unSetup(); } sp_selection_move_relative(selection, offset); @@ -1533,4 +1534,4 @@ ClipboardManager *ClipboardManager::get() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/clipboard.h b/src/ui/clipboard.h index 6020ecdd8..fb28bfc14 100644 --- a/src/ui/clipboard.h +++ b/src/ui/clipboard.h @@ -75,4 +75,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 98ad9dc7b..262fdcf32 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -46,6 +46,7 @@ sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) #include "sp-anchor.h" #include "sp-image.h" +#include "sp-text.h" #include "document.h" #include "desktop-handles.h" @@ -53,6 +54,8 @@ sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) #include "selection-chemistry.h" #include "dialogs/item-properties.h" #include "dialogs/object-attributes.h" +#include "dialogs/text-edit.h" +#include "dialogs/spellcheck.h" #include "sp-path.h" #include "sp-clippath.h" @@ -64,6 +67,7 @@ static void sp_group_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); +static void sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu) @@ -77,6 +81,7 @@ sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *m g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_ANCHOR), (void*)sp_anchor_menu); g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_IMAGE), (void*)sp_image_menu); g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_SHAPE), (void*)sp_shape_menu); + g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_TEXT), (void*)sp_text_menu); } handler = (void (*)(SPObject*, SPDesktop*, GtkMenu*))g_hash_table_lookup(t2m, GUINT_TO_POINTER(type)); if (handler) handler(object, desktop, menu); @@ -102,7 +107,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Item dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Object _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("_Object Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_properties), item); gtk_widget_show(w); @@ -151,7 +156,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); /* Set Clip */ - w = gtk_menu_item_new_with_mnemonic(_("Set Clip")); + w = gtk_menu_item_new_with_mnemonic(_("Set _Clip")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_set_clip), item); if ((item && item->mask_ref && item->mask_ref->getObject()) || (item->clip_ref && item->clip_ref->getObject())) { @@ -162,7 +167,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); /* Release Clip */ - w = gtk_menu_item_new_with_mnemonic(_("Release Clip")); + w = gtk_menu_item_new_with_mnemonic(_("Release C_lip")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_release_clip), item); if (item && item->clip_ref && item->clip_ref->getObject()) { @@ -343,7 +348,7 @@ sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Link dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Link _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("Link _Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_anchor_link_properties), item); gtk_widget_show(w); @@ -402,7 +407,7 @@ sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) GtkWidget *w; /* Link dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Image _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("Image _Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_image_image_properties), item); gtk_widget_show(w); @@ -473,10 +478,10 @@ static void sp_image_image_edit(GtkMenuItem *menuitem, SPAnchor *anchor) g_free(editorBin); } -/* SPShape */ +/* Fill and Stroke entry */ static void -sp_shape_fill_settings(GtkMenuItem *menuitem, SPItem *item) +sp_fill_settings(GtkMenuItem *menuitem, SPItem *item) { SPDesktop *desktop; @@ -492,6 +497,8 @@ sp_shape_fill_settings(GtkMenuItem *menuitem, SPItem *item) desktop->_dlg_mgr->showDialog("FillAndStroke"); } +/* SPShape */ + static void sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) { @@ -501,14 +508,82 @@ sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Item dialog */ - w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke")); + w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); - gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_shape_fill_settings), item); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_fill_settings), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); } +/* Edit Text entry */ + +static void +sp_text_settings(GtkMenuItem *menuitem, SPItem *item) +{ + SPDesktop *desktop; + + g_assert(SP_IS_ITEM(item)); + desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + + if (sp_desktop_selection(desktop)->isEmpty()) { + sp_desktop_selection(desktop)->set(item); + } + + sp_text_edit_dialog(); +} + +/* Spellcheck entry */ + +static void +sp_spellcheck_settings(GtkMenuItem *menuitem, SPItem *item) +{ + SPDesktop *desktop; + + g_assert(SP_IS_ITEM(item)); + + desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + + if (sp_desktop_selection(desktop)->isEmpty()) { + sp_desktop_selection(desktop)->set(item); + } + + sp_spellcheck_dialog(); +} + +/* SPText */ + +static void +sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) +{ + SPItem *item; + GtkWidget *w; + + item = (SPItem *) object; + + /* Fill and Stroke dialog */ + w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_fill_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); + + /* Edit Text dialog */ + w = gtk_menu_item_new_with_mnemonic(_("_Text and Font...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_text_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); + + /* Spellcheck dialog */ + w = gtk_menu_item_new_with_mnemonic(_("Check Spellin_g...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_spellcheck_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); +} /* Local Variables: mode:c++ @@ -518,4 +593,4 @@ sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/context-menu.h b/src/ui/context-menu.h index 571698fd2..c66cd4e96 100644 --- a/src/ui/context-menu.h +++ b/src/ui/context-menu.h @@ -29,4 +29,4 @@ void sp_object_menu (SPObject *object, SPDesktop *desktop, GtkMenu *menu); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 048c46a20..ba8cc939b 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -465,10 +465,8 @@ public: removeOverlapXGap.set_value(0); dialog.tooltips().set_tip(removeOverlapXGap, _("Minimum horizontal gap (in px units) between bounding boxes")); - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "H:" stands for horizontal gap - removeOverlapXGapLabel.set_label(Q_("gap|H:")); + //TRANSLATORS: "H:" stands for horizontal gap + removeOverlapXGapLabel.set_label(C_("Gap", "H:")); removeOverlapYGap.set_digits(1); removeOverlapYGap.set_size_request(60, -1); @@ -478,7 +476,7 @@ public: dialog.tooltips().set_tip(removeOverlapYGap, _("Minimum vertical gap (in px units) between bounding boxes")); /* TRANSLATORS: Vertical gap */ - removeOverlapYGapLabel.set_label(_("V:")); + removeOverlapYGapLabel.set_label(C_("Gap", "V:")); dialog.removeOverlap_table().attach(removeOverlapXGapLabel, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL); dialog.removeOverlap_table().attach(removeOverlapXGap, column+1, column+2, row, row+1, Gtk::FILL, Gtk::FILL); @@ -1298,4 +1296,4 @@ AlignAndDistribute::AlignTarget AlignAndDistribute::getAlignTarget()const { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h index f55998385..7c99d67c7 100644 --- a/src/ui/dialog/align-and-distribute.h +++ b/src/ui/dialog/align-and-distribute.h @@ -141,4 +141,4 @@ bool operator< (const BBoxSort &a, const BBoxSort &b); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/behavior.h b/src/ui/dialog/behavior.h index fbe42c2fb..385cd05f5 100644 --- a/src/ui/dialog/behavior.h +++ b/src/ui/dialog/behavior.h @@ -100,4 +100,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/calligraphic-profile-rename.cpp b/src/ui/dialog/calligraphic-profile-rename.cpp index 888b327f4..fd7299ba2 100644 --- a/src/ui/dialog/calligraphic-profile-rename.cpp +++ b/src/ui/dialog/calligraphic-profile-rename.cpp @@ -105,4 +105,4 @@ void CalligraphicProfileRename::show(SPDesktop *desktop) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h index 53ce907ed..e9f6a8b95 100644 --- a/src/ui/dialog/calligraphic-profile-rename.h +++ b/src/ui/dialog/calligraphic-profile-rename.h @@ -72,4 +72,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index a71f0789f..c7dfa0dc4 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -837,4 +837,4 @@ void ColorItem::_linkTone( ColorItem& other, int percent, int grayLevel ) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/color-item.h b/src/ui/dialog/color-item.h index de4618bc0..9080498eb 100644 --- a/src/ui/dialog/color-item.h +++ b/src/ui/dialog/color-item.h @@ -122,4 +122,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp index b40796627..1f7539fc7 100644 --- a/src/ui/dialog/debug.cpp +++ b/src/ui/dialog/debug.cpp @@ -249,4 +249,4 @@ void DebugDialogImpl::releaseLogMessages() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/debug.h b/src/ui/dialog/debug.h index f2ad61dd4..34785a617 100644 --- a/src/ui/dialog/debug.h +++ b/src/ui/dialog/debug.h @@ -97,4 +97,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/desktop-tracker.cpp b/src/ui/dialog/desktop-tracker.cpp index f527f1c05..4eeac74b9 100644 --- a/src/ui/dialog/desktop-tracker.cpp +++ b/src/ui/dialog/desktop-tracker.cpp @@ -156,4 +156,4 @@ void DesktopTracker::setDesktop(SPDesktop *desktop) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/desktop-tracker.h b/src/ui/dialog/desktop-tracker.h index 7a5bc39c2..edde110af 100644 --- a/src/ui/dialog/desktop-tracker.h +++ b/src/ui/dialog/desktop-tracker.h @@ -70,4 +70,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index aab9d89d7..ff31c91c4 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -251,4 +251,4 @@ void DialogManager::showDialog(GQuark name) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dialog-manager.h b/src/ui/dialog/dialog-manager.h index a97b58ce3..90e1862f1 100644 --- a/src/ui/dialog/dialog-manager.h +++ b/src/ui/dialog/dialog-manager.h @@ -71,4 +71,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 2483dc50e..43863625f 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -20,8 +20,6 @@ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> -#include "application/application.h" -#include "application/editor.h" #include "inkscape.h" #include "event-context.h" #include "desktop.h" @@ -109,17 +107,10 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat _behavior = behavior_factory(*this); - if (Inkscape::NSApplication::Application::getNewGui()) { - _desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*this, &Dialog::onDesktopActivated)); - _dialogs_hidden_connection = Inkscape::NSApplication::Editor::connectDialogsHidden (sigc::mem_fun (*this, &Dialog::onHideF12)); - _dialogs_unhidden_connection = Inkscape::NSApplication::Editor::connectDialogsUnhidden (sigc::mem_fun (*this, &Dialog::onShowF12)); - _shutdown_connection = Inkscape::NSApplication::Editor::connectShutdown (sigc::mem_fun (*this, &Dialog::onShutdown)); - } else { - g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this); - g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this); - g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this); - g_signal_connect(G_OBJECT(INKSCAPE), "shut_down", G_CALLBACK(sp_dialog_shutdown), (void *)this); - } + g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this); + g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this); + g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this); + g_signal_connect(G_OBJECT(INKSCAPE), "shut_down", G_CALLBACK(sp_dialog_shutdown), (void *)this); Glib::wrap(gobj())->signal_event().connect(sigc::mem_fun(*this, &Dialog::_onEvent)); Glib::wrap(gobj())->signal_key_press_event().connect(sigc::mem_fun(*this, &Dialog::_onKeyPress)); @@ -129,14 +120,6 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat Dialog::~Dialog() { - if (Inkscape::NSApplication::Application::getNewGui()) - { - _desktop_activated_connection.disconnect(); - _dialogs_hidden_connection.disconnect(); - _dialogs_unhidden_connection.disconnect(); - _shutdown_connection.disconnect(); - } - save_geometry(); delete _behavior; _behavior = 0; @@ -389,4 +372,4 @@ Dialog::_getSelection() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h index f07c1bc86..307257b52 100644 --- a/src/ui/dialog/dialog.h +++ b/src/ui/dialog/dialog.h @@ -141,4 +141,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dock-behavior.cpp b/src/ui/dialog/dock-behavior.cpp index 6b7a9b697..39d671cd8 100644 --- a/src/ui/dialog/dock-behavior.cpp +++ b/src/ui/dialog/dock-behavior.cpp @@ -300,4 +300,4 @@ DockBehavior::signal_drag_end() { return _dock_item.signal_drag_end(); } fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/dock-behavior.h b/src/ui/dialog/dock-behavior.h index 7f0d0ece0..b865af545 100644 --- a/src/ui/dialog/dock-behavior.h +++ b/src/ui/dialog/dock-behavior.h @@ -104,4 +104,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp index 55eb94f92..a8a0fa191 100644 --- a/src/ui/dialog/document-metadata.cpp +++ b/src/ui/dialog/document-metadata.cpp @@ -256,4 +256,4 @@ on_repr_attr_changed (Inkscape::XML::Node *, gchar const *, gchar const *, gchar fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/document-metadata.h b/src/ui/dialog/document-metadata.h index f21bb0d83..21915c00f 100644 --- a/src/ui/dialog/document-metadata.h +++ b/src/ui/dialog/document-metadata.h @@ -83,4 +83,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 33fdf8327..f22509496 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -103,11 +103,8 @@ DocumentProperties::DocumentProperties() _rcp_hgui(_("_Highlight color:"), _("Highlighted guideline color"), _("Color of a guideline when it is under mouse"), "guidehicolor", "guidehiopacity", _wr), //--------------------------------------------------------------- _grids_label_crea("", Gtk::ALIGN_LEFT), - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "New" refers to grid - _grids_button_new(Q_("Grid|_New"), _("Create new grid.")), - _grids_button_remove(_("_Remove"), _("Remove selected grid.")), + _grids_button_new(C_("Grid", "_New"), _("Create new grid.")), + _grids_button_remove(C_("Grid", "_Remove"), _("Remove selected grid.")), _grids_label_def("", Gtk::ALIGN_LEFT) //--------------------------------------------------------------- { @@ -336,49 +333,28 @@ DocumentProperties::populate_available_profiles(){ delete(*it2); } - std::list<Glib::ustring> sources = ColorProfile::getProfileDirs(); - - // Use this loop to iterate through a list of possible document locations. - for ( std::list<Glib::ustring>::const_iterator it = sources.begin(); it != sources.end(); ++it ) { - if ( Inkscape::IO::file_test( it->c_str(), G_FILE_TEST_EXISTS ) - && Inkscape::IO::file_test( it->c_str(), G_FILE_TEST_IS_DIR )) { - GError *err = 0; - GDir *directory = g_dir_open(it->c_str(), 0, &err); - if (!directory) { - gchar *safeDir = Inkscape::IO::sanitizeString(it->c_str()); - g_warning(_("Color profiles directory (%s) is unavailable."), safeDir); - g_free(safeDir); - } else { - gchar *filename = 0; - while ((filename = (gchar *)g_dir_read_name(directory)) != NULL) { - gchar* full = g_build_filename(it->c_str(), filename, NULL); - if ( !Inkscape::IO::file_test( full, G_FILE_TEST_IS_DIR ) ) { - cmsErrorAction( LCMS_ERROR_SHOW ); - cmsHPROFILE hProfile = cmsOpenProfileFromFile(full, "r"); - if (hProfile != NULL){ - const gchar* name; - lcms_profile_get_name(hProfile, &name); - Gtk::MenuItem* mi = manage(new Gtk::MenuItem()); - mi->set_data("filepath", g_strdup(full)); - mi->set_data("name", g_strdup(name)); - Gtk::HBox *hbox = manage(new Gtk::HBox()); - hbox->show(); - Gtk::Label* lbl = manage(new Gtk::Label(name)); - lbl->show(); - hbox->pack_start(*lbl, true, true, 0); - mi->add(*hbox); - mi->show_all(); - _menu.append(*mi); - // g_free((void*)name); - cmsCloseProfile(hProfile); - } - } - g_free(full); - } - g_dir_close(directory); - } + std::list<Glib::ustring> files = ColorProfile::getProfileFiles(); + for ( std::list<Glib::ustring>::const_iterator it = files.begin(); it != files.end(); ++it ) { + cmsHPROFILE hProfile = cmsOpenProfileFromFile(it->c_str(), "r"); + if ( hProfile ){ + const gchar* name = 0; + lcms_profile_get_name(hProfile, &name); + Gtk::MenuItem* mi = manage(new Gtk::MenuItem()); + mi->set_data("filepath", g_strdup(it->c_str())); + mi->set_data("name", g_strdup(name)); + Gtk::HBox *hbox = manage(new Gtk::HBox()); + hbox->show(); + Gtk::Label* lbl = manage(new Gtk::Label(name)); + lbl->show(); + hbox->pack_start(*lbl, true, true, 0); + mi->add(*hbox); + mi->show_all(); + _menu.append(*mi); +// g_free((void*)name); + cmsCloseProfile(hProfile); } } + _menu.show_all(); } @@ -1003,4 +979,4 @@ DocumentProperties::onRemoveGrid() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index c67dc9706..dbefca235 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -172,4 +172,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/extension-editor.cpp b/src/ui/dialog/extension-editor.cpp index c2f3426fd..527dfe23c 100644 --- a/src/ui/dialog/extension-editor.cpp +++ b/src/ui/dialog/extension-editor.cpp @@ -232,4 +232,4 @@ ExtensionEditor::add_extension (Inkscape::Extension::Extension * ext) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/extension-editor.h b/src/ui/dialog/extension-editor.h index fe171f60c..c209eb883 100644 --- a/src/ui/dialog/extension-editor.h +++ b/src/ui/dialog/extension-editor.h @@ -97,4 +97,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/extensions.cpp b/src/ui/dialog/extensions.cpp index f168da33a..3c778affe 100644 --- a/src/ui/dialog/extensions.cpp +++ b/src/ui/dialog/extensions.cpp @@ -126,4 +126,4 @@ void ExtensionsPanel::rescan() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index 68c0926aa..8db390cd2 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -199,4 +199,4 @@ FileExportDialog *FileExportDialog::create(Gtk::Window& parentWindow, fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialog.h b/src/ui/dialog/filedialog.h index 472c4ac0b..9f13308fb 100644 --- a/src/ui/dialog/filedialog.h +++ b/src/ui/dialog/filedialog.h @@ -386,4 +386,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 6f83a706f..fbfdc4a9b 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -1625,4 +1625,4 @@ FileExportDialogImpl::getFilename() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index 65bb38971..af607c124 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -592,4 +592,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index cd9db2fac..b4379e071 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -57,7 +57,11 @@ namespace UI namespace Dialog { -const int PreviewWidening = 150; +const int PREVIEW_WIDENING = 150; +const int WINDOW_WIDTH_MINIMUM = 32; +const int WINDOW_WIDTH_FALLBACK = 450; +const int WINDOW_HEIGHT_MINIMUM = 32; +const int WINDOW_HEIGHT_FALLBACK = 360; const char PreviewWindowClassName[] = "PreviewWnd"; const unsigned long MaxPreviewFileSize = 10240; // kB @@ -89,6 +93,21 @@ ustring utf16_to_ustring(const wchar_t *utf16string, int utf16length = -1) return result; } +namespace { + +int sanitizeWindowSizeParam( int size, int delta, int minimum, int fallback ) +{ + int result = size; + if ( size < minimum ) { + g_warning( "Window size %d is less than cutoff.", size ); + result = fallback - delta; + } + result += delta; + return result; +} + +} // namespace + /*######################################################################### ### F I L E D I A L O G B A S E C L A S S #########################################################################*/ @@ -441,9 +460,9 @@ UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc( RECT rcRect; GetWindowRect(hParentWnd, &rcRect); MoveWindow(hParentWnd, rcRect.left, rcRect.top, - rcRect.right - rcRect.left + PreviewWidening, - rcRect.bottom - rcRect.top, - FALSE); + rcRect.right - rcRect.left + PREVIEW_WIDENING, + rcRect.bottom - rcRect.top, + FALSE); // Set the pointer to the object OPENFILENAMEW *ofn = (OPENFILENAMEW*)lParam; @@ -1689,12 +1708,19 @@ UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc( GetWindowRect(GetDlgItem(hParentWnd, stc2), &rST); GetWindowRect(hdlg, &rROOT); int ydelta = rCB1.top - rEDT1.top; + if ( ydelta < 0 ) { + g_warning("Negative dialog ydelta"); + ydelta = 0; + } // Make the window a bit longer + // Note: we have a width delta of 1 because there is a suspicion that MoveWindow() to the same size causes zero-width results. RECT rcRect; GetWindowRect(hParentWnd, &rcRect); - MoveWindow(hParentWnd, rcRect.left, rcRect.top, rcRect.right - rcRect.left, - rcRect.bottom - rcRect.top + ydelta, FALSE); + MoveWindow(hParentWnd, rcRect.left, rcRect.top, + sanitizeWindowSizeParam( rcRect.right - rcRect.left, 1, WINDOW_WIDTH_MINIMUM, WINDOW_WIDTH_FALLBACK ), + sanitizeWindowSizeParam( rcRect.bottom - rcRect.top, ydelta, WINDOW_HEIGHT_MINIMUM, WINDOW_HEIGHT_FALLBACK ), + FALSE); // It is not necessary to delete stock objects by calling DeleteObject HGDIOBJ dlgFont = GetStockObject(DEFAULT_GUI_FONT); @@ -1763,4 +1789,4 @@ UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc( fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h index 4234c1782..00d9cf37f 100644 --- a/src/ui/dialog/filedialogimpl-win32.h +++ b/src/ui/dialog/filedialogimpl-win32.h @@ -368,4 +368,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index 8c86e1ca4..0c234003e 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -171,4 +171,4 @@ FillAndStroke::_createPageTabLabel(const Glib::ustring& label, const char *label fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/fill-and-stroke.h b/src/ui/dialog/fill-and-stroke.h index 2d4e90d73..fe72aa31c 100644 --- a/src/ui/dialog/fill-and-stroke.h +++ b/src/ui/dialog/fill-and-stroke.h @@ -94,4 +94,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index dab42d897..b6a2c4fbf 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -27,8 +27,6 @@ #include <gtkmm/tooltips.h> #include <glibmm/i18n.h> -#include "application/application.h" -#include "application/editor.h" #include "desktop.h" #include "desktop-handles.h" #include "dialog-manager.h" @@ -2532,4 +2530,4 @@ void FilterEffectsDialog::update_color_matrix() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index a14c85a91..61bb93415 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -287,4 +287,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 837b82291..7fad00f56 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -57,10 +57,10 @@ namespace Dialog { Find::Find() : UI::Widget::Panel("", "/dialogs/find", SP_VERB_DIALOG_FIND), - _entry_text(_("_Text: "), _("Find objects by their text content (exact or partial match)")), - _entry_id(_("_ID: "), _("Find objects by the value of the id attribute (exact or partial match)")), - _entry_style(_("_Style: "), _("Find objects by the value of the style attribute (exact or partial match)")), - _entry_attribute(_("_Attribute: "), _("Find objects by the name of an attribute (exact or partial match)")), + _entry_text(_("_Text:"), _("Find objects by their text content (exact or partial match)")), + _entry_id(_("_ID:"), _("Find objects by the value of the id attribute (exact or partial match)")), + _entry_style(_("_Style:"), _("Find objects by the value of the style attribute (exact or partial match)")), + _entry_attribute(_("_Attribute:"), _("Find objects by the name of an attribute (exact or partial match)")), _check_search_selection(_("Search in s_election"), _("Limit search to the current selection")), _check_search_layer(_("Search in current _layer"), _("Limit search to the current layer")), _check_include_hidden(_("Include _hidden"), _("Include hidden objects in search")), @@ -76,10 +76,8 @@ Find::Find() _check_texts(_("Texts"), _("Search text objects")), _check_groups(_("Groups"), _("Search groups")), _check_clones( - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "Clones" is a noun indicating type of object to find - Q_("find|Clones"), _("Search clones")), + //TRANSLATORS: "Clones" is a noun indicating type of object to find + C_("Find dialog", "Clones"), _("Search clones")), _check_images(_("Images"), _("Search images")), _check_offsets(_("Offsets"), _("Search offset objects")), diff --git a/src/ui/dialog/find.h b/src/ui/dialog/find.h index 891df221f..d672bc658 100644 --- a/src/ui/dialog/find.h +++ b/src/ui/dialog/find.h @@ -106,4 +106,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index 85f078439..35cc88090 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -15,8 +15,6 @@ #include "floating-behavior.h" #include "dialog.h" -#include "application/application.h" -#include "application/editor.h" #include "inkscape.h" #include "desktop.h" #include "dialogs/dialog-events.h" @@ -240,4 +238,4 @@ FloatingBehavior::onDesktopActivated (SPDesktop *desktop) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/floating-behavior.h b/src/ui/dialog/floating-behavior.h index 30ecaa053..6ad316457 100644 --- a/src/ui/dialog/floating-behavior.h +++ b/src/ui/dialog/floating-behavior.h @@ -92,4 +92,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index 8ed502aae..5e66ca9b8 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -746,4 +746,4 @@ void GlyphsPanel::rebuild() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/glyphs.h b/src/ui/dialog/glyphs.h index 1a01aebca..d6c731dda 100644 --- a/src/ui/dialog/glyphs.h +++ b/src/ui/dialog/glyphs.h @@ -104,4 +104,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 3a7964ba2..aac6024b9 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -282,4 +282,4 @@ void GuidelinePropertiesDialog::_setup() { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/guides.h b/src/ui/dialog/guides.h index 49f94deea..2817e2644 100644 --- a/src/ui/dialog/guides.h +++ b/src/ui/dialog/guides.h @@ -90,4 +90,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 02e8cda9c..f35bd964b 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -228,7 +228,7 @@ IconPreviewPanel::IconPreviewPanel() : splitter.pack2( *actuals, false, false ); - selectionButton = new Gtk::CheckButton(_("Selection")); // , GTK_RESPONSE_APPLY + selectionButton = new Gtk::CheckButton(C_("Icon preview window", "Sele_ction"), true);//selectionButton = (Gtk::ToggleButton*) gtk_check_button_new_with_mnemonic(_("_Selection")); // , GTK_RESPONSE_APPLY magBox->pack_start( *selectionButton, Gtk::PACK_SHRINK ); tips.set_tip((*selectionButton), _("Selection only or whole document")); selectionButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::modeToggled) ); @@ -496,4 +496,4 @@ void IconPreviewPanel::updateMagnify() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/icon-preview.h b/src/ui/dialog/icon-preview.h index f8957086a..9c10eb89b 100644 --- a/src/ui/dialog/icon-preview.h +++ b/src/ui/dialog/icon-preview.h @@ -115,4 +115,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 8f5194eda..13491312a 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -356,7 +356,7 @@ void InkscapePreferences::AddNewObjectsStyle(DialogPage &p, Glib::ustring const if (banner) p.add_group_header(banner); else - p.add_group_header( _("Create new objects with:")); + p.add_group_header( _("Style of new objects")); PrefRadioButton* current = Gtk::manage( new PrefRadioButton); current->init ( _("Last used style"), prefs_path + "/usecurrent", 1, true, 0); p.add_line( true, "", *current, "", @@ -456,7 +456,7 @@ void InkscapePreferences::initPageTools() _t_node_pathflash_selected.init ( _("Show temporary outline for selected paths"), "/tools/nodes/pathflash_selected", false); _page_node.add_line( true, "", _t_node_pathflash_selected, "", _("Show temporary outline even when a path is selected for editing")); _t_node_pathflash_timeout.init("/tools/nodes/pathflash_timeout", 0, 10000.0, 100.0, 100.0, 1000.0, true, false); - _page_node.add_line( false, _("Flash time"), _t_node_pathflash_timeout, "ms", _("Specifies how long the path outline will be visible after a mouse-over (in milliseconds); specify 0 to have the outline shown until mouse leaves the path"), false); + _page_node.add_line( false, _("Flash time:"), _t_node_pathflash_timeout, "ms", _("Specifies how long the path outline will be visible after a mouse-over (in milliseconds); specify 0 to have the outline shown until mouse leaves the path"), false); _page_node.add_group_header(_("Editing preferences")); _t_node_single_node_transform_handles.init(_("Show transform handles for single nodes"), "/tools/nodes/single_node_transform_handles", false); _page_node.add_line( true, "", _t_node_single_node_transform_handles, "", _("Show transform handles even when only a single node is selected")); @@ -465,7 +465,7 @@ void InkscapePreferences::initPageTools() //Tweak this->AddPage(_page_tweak, _("Tweak"), iter_tools, PREFS_PAGE_TOOLS_TWEAK); - this->AddNewObjectsStyle(_page_tweak, "/tools/tweak", _("Paint objects with:")); + this->AddNewObjectsStyle(_page_tweak, "/tools/tweak", _("Object paint style")); AddSelcueCheckbox(_page_tweak, "/tools/tweak", true); AddGradientCheckbox(_page_tweak, "/tools/tweak", false); @@ -586,7 +586,7 @@ void InkscapePreferences::initPageWindows() _win_ontop_normal.init ( _("Normal"), "/options/transientpolicy/value", 1, true, &_win_ontop_none); _win_ontop_agressive.init ( _("Aggressive"), "/options/transientpolicy/value", 2, false, &_win_ontop_none); - _page_windows.add_group_header( _("Saving window geometry (size and position):")); + _page_windows.add_group_header( _("Saving window geometry (size and position)")); _page_windows.add_line( true, "", _win_save_geom_off, "", _("Let the window manager determine placement of all windows")); _page_windows.add_line( true, "", _win_save_geom_prefs, "", @@ -594,7 +594,7 @@ void InkscapePreferences::initPageWindows() _page_windows.add_line( true, "", _win_save_geom, "", _("Save and restore window geometry for each document (saves geometry in the document)")); - _page_windows.add_group_header( _("Dialog behavior (requires restart):")); + _page_windows.add_group_header( _("Dialog behavior (requires restart)")); _page_windows.add_line( true, "", _win_dockable, "", _("Dockable")); _page_windows.add_line( true, "", _win_floating, "", @@ -612,7 +612,7 @@ void InkscapePreferences::initPageWindows() #endif #if GTK_VERSION_GE(2, 12) - _page_windows.add_group_header( _("Dialog Transparency:")); + _page_windows.add_group_header( _("Dialog Transparency")); _win_trans_focus.init("/dialogs/transparency/on-focus", 0.5, 1.0, 0.01, 0.1, 1.0, false, false); _page_windows.add_line( true, _("Opacity when focused:"), _win_trans_focus, "", ""); _win_trans_blur.init("/dialogs/transparency/on-blur", 0.0, 1.0, 0.01, 0.1, 0.5, false, false); @@ -621,7 +621,7 @@ void InkscapePreferences::initPageWindows() _page_windows.add_line( true, _("Time of opacity change animation:"), _win_trans_time, "ms", ""); #endif - _page_windows.add_group_header( _("Miscellaneous:")); + _page_windows.add_group_header( _("Miscellaneous")); #ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs _page_windows.add_line( false, "", _win_hide_task, "", _("Whether dialog windows are to be hidden in the window manager taskbar")); @@ -678,7 +678,7 @@ void InkscapePreferences::initPageMasks() _page_mask.add_line(true, "", _mask_mask_remove, "", _("After applying, remove the object used as the clipping path or mask from the drawing")); - _page_mask.add_group_header( _("Before applying clippath/mask:")); + _page_mask.add_group_header( _("Before applying")); _mask_grouping_none.init( _("Do not group clipped/masked objects"), "/options/maskobject/grouping", PREFS_MASKOBJECT_GROUPING_NONE, true, 0); _mask_grouping_separate.init( _("Enclose every clipped/masked object in its own group"), "/options/maskobject/grouping", PREFS_MASKOBJECT_GROUPING_SEPARATE, false, &_mask_grouping_none); @@ -693,7 +693,7 @@ void InkscapePreferences::initPageMasks() _page_mask.add_line(true, "", _mask_grouping_all, "", _("Apply clippath/mask to group containing all objects")); - _page_mask.add_group_header( _("After releasing clippath/mask:")); + _page_mask.add_group_header( _("After releasing")); _mask_ungrouping.init ( _("Ungroup automatically created groups"), "/options/maskobject/ungrouping", true); _page_mask.add_line(true, "", _mask_ungrouping, "", @@ -719,7 +719,7 @@ void InkscapePreferences::initPageTransforms() _("Move gradients (in fill or stroke) along with the objects")); _page_transforms.add_line( false, "", _trans_pattern, "", _("Move patterns (in fill or stroke) along with the objects")); - _page_transforms.add_group_header( _("Store transformation:")); + _page_transforms.add_group_header( _("Store transformation")); _page_transforms.add_line( true, "", _trans_optimized, "", _("If possible, apply transformation to objects without adding a transform= attribute")); _page_transforms.add_line( true, "", _trans_preserved, "", @@ -742,7 +742,7 @@ void InkscapePreferences::initPageFilters() _blur_quality_worst.init ( _("Lowest quality (fastest)"), "/options/blurquality/value", BLUR_QUALITY_WORST, false, &_blur_quality_best); - _page_filters.add_group_header( _("Gaussian blur quality for display:")); + _page_filters.add_group_header( _("Gaussian blur quality for display")); _page_filters.add_line( true, "", _blur_quality_best, "", _("Best quality, but display may be very slow at high zooms (bitmap export always uses best quality)")); _page_filters.add_line( true, "", _blur_quality_better, "", @@ -766,7 +766,7 @@ void InkscapePreferences::initPageFilters() _filter_quality_worst.init ( _("Lowest quality (fastest)"), "/options/filterquality/value", Inkscape::Filters::FILTER_QUALITY_WORST, false, &_filter_quality_best); - _page_filters.add_group_header( _("Filter effects quality for display:")); + _page_filters.add_group_header( _("Filter effects quality for display")); _page_filters.add_line( true, "", _filter_quality_best, "", _("Best quality, but display may be very slow at high zooms (bitmap export always uses best quality)")); _page_filters.add_line( true, "", _filter_quality_better, "", @@ -801,7 +801,7 @@ void InkscapePreferences::initPageSelecting() _sel_locked.init ( _("Ignore locked objects and layers"), "/options/kbselection/onlysensitive", true); _sel_layer_deselects.init ( _("Deselect upon layer change"), "/options/selection/layerdeselect", true); - _page_select.add_group_header( _("Ctrl+A, Tab, Shift+Tab:")); + _page_select.add_group_header( _("Ctrl+A, Tab, Shift+Tab")); _page_select.add_line( true, "", _sel_all, "", _("Make keyboard selection commands work on objects in all layers")); _page_select.add_line( true, "", _sel_current, "", @@ -896,7 +896,7 @@ void InkscapePreferences::initPageCMS() _page_cms.add_group_header( _("Display adjustment")); Glib::ustring tmpStr; - std::list<Glib::ustring> sources = ColorProfile::getProfileDirs(); + std::list<Glib::ustring> sources = ColorProfile::getBaseProfileDirs(); for ( std::list<Glib::ustring>::const_iterator it = sources.begin(); it != sources.end(); ++it ) { gchar* part = g_strdup_printf( "\n%s", it->c_str() ); tmpStr += part; @@ -1186,9 +1186,7 @@ void InkscapePreferences::initPageSave() _save_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false); _page_save.add_line(true, _("Interval (in minutes):"), _save_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false); _save_autosave_path.init("/options/autosave/path", true); - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - _page_save.add_line(true, Q_("filesystem|Path:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false); + _page_save.add_line(true, C_("Filesystem", "Path:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false); _save_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false); _page_save.add_line(true, _("Maximum number of autosaves:"), _save_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false); @@ -1505,4 +1503,4 @@ void InkscapePreferences::_presentPages() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 92a54affb..8f19c90c4 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -10,6 +10,7 @@ #include <map> #include <set> +#include <list> #include <glib/gprintf.h> #include <glibmm/i18n.h> #include <gtkmm/alignment.h> @@ -331,12 +332,14 @@ namespace Dialog { class DeviceModelColumns : public Gtk::TreeModel::ColumnRecord { public: + Gtk::TreeModelColumn<bool> toggler; + Gtk::TreeModelColumn<Glib::ustring> expander; Gtk::TreeModelColumn<Glib::ustring> description; - Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > thumbnail; + Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > thumbnail; Gtk::TreeModelColumn<Glib::RefPtr<InputDevice const> > device; Gtk::TreeModelColumn<Gdk::InputMode> mode; - DeviceModelColumns() { add(description); add(thumbnail); add(device); add(mode); } + DeviceModelColumns() { add(toggler), add(expander), add(description); add(thumbnail); add(device); add(mode); } }; static std::map<Gdk::InputMode, Glib::ustring> &getModeToString() @@ -390,6 +393,9 @@ private: static void commitCellModeChange(Glib::ustring const &path, Glib::ustring const &newText, Glib::RefPtr<Gtk::TreeStore> store); static void setModeCellString(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter); + static void commitCellStateChange(Glib::ustring const &path, Glib::RefPtr<Gtk::TreeStore> store); + static void setCellStateToggle(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter); + void saveSettings(); void useExtToggled(); @@ -720,6 +726,44 @@ InputDialogImpl::InputDialogImpl() : show_all_children(); } +class TabletTmp { +public: + TabletTmp() {} + + Glib::ustring name; + std::list<Glib::RefPtr<InputDevice const> > devices; +}; + +static Glib::ustring getCommon( std::list<Glib::ustring> const &names ) +{ + Glib::ustring result; + + if ( !names.empty() ) { + size_t pos = 0; + bool match = true; + while ( match ) { + if ( names.begin()->length() > pos ) { + gunichar ch = (*names.begin())[pos]; + for ( std::list<Glib::ustring>::const_iterator it = names.begin(); it != names.end(); ++it ) { + if ( (pos >= it->length()) + || ((*it)[pos] != ch) ) { + match = false; + break; + } + } + if (match) { + result += ch; + pos++; + } + } else { + match = false; + } + } + } + + return result; +} + void InputDialogImpl::setupTree( Glib::RefPtr<Gtk::TreeStore> store, Gtk::TreeIter &tablet ) { std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices(); @@ -727,48 +771,99 @@ void InputDialogImpl::setupTree( Glib::RefPtr<Gtk::TreeStore> store, Gtk::TreeIt Gtk::TreeModel::Row row = *(store->append()); row[getCols().description] = _("Hardware"); - tablet = store->append(row.children()); - Gtk::TreeModel::Row childrow = *tablet; - childrow[getCols().description] = _("Tablet"); - childrow[getCols().thumbnail] = getPix(PIX_TABLET); + // Let's make some tablets!!! + std::list<TabletTmp> tablets; + std::set<Glib::ustring> consumed; + // Phase 1 - figure out which tablets are present for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it = devList.begin(); it != devList.end(); ++it ) { Glib::RefPtr<InputDevice const> dev = *it; if ( dev ) { -// g_message("device: name[%s] source[0x%x] mode[0x%x] cursor[%s] axis count[%d] key count[%d]", dev->getName().c_str(), dev->getSource(), dev->getMode(), -// dev->hasCursor() ? "Yes":"no", dev->getNumAxes(), dev->getNumKeys()); - -// if ( dev->getSource() != Gdk::SOURCE_MOUSE ) { - if ( dev ) { - Gtk::TreeModel::Row deviceRow = *(store->append(childrow.children())); - deviceRow[getCols().description] = dev->getName(); - deviceRow[getCols().device] = dev; - deviceRow[getCols().mode] = dev->getMode(); - switch ( dev->getSource() ) { - case GDK_SOURCE_MOUSE: - deviceRow[getCols().thumbnail] = getPix(PIX_CORE); - break; - case GDK_SOURCE_PEN: - if (deviceRow[getCols().description] == _("pad")) { - deviceRow[getCols().thumbnail] = getPix(PIX_SIDEBUTTONS); - } else { - deviceRow[getCols().thumbnail] = getPix(PIX_TIP); - } - break; - case GDK_SOURCE_CURSOR: - deviceRow[getCols().thumbnail] = getPix(PIX_MOUSE); - break; - case GDK_SOURCE_ERASER: - deviceRow[getCols().thumbnail] = getPix(PIX_ERASER); - break; - default: - ; // nothing + if ( dev->getSource() != Gdk::SOURCE_MOUSE ) { + consumed.insert( dev->getId() ); + if ( tablets.empty() ) { + TabletTmp tmp; + tablets.push_back(tmp); } + tablets.back().devices.push_back(dev); } } else { g_warning("Null device in list"); } } + + // Phase 2 - build a UI for the present devices + for ( std::list<TabletTmp>::iterator it = tablets.begin(); it != tablets.end(); ++it ) { + tablet = store->append(row.children()); + Gtk::TreeModel::Row childrow = *tablet; + if ( it->name.empty() ) { + // Check to see if we can derive one + std::list<Glib::ustring> names; + for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) { + names.push_back( (*it2)->getName() ); + } + Glib::ustring common = getCommon(names); + if ( !common.empty() ) { + it->name = common; + } + } + childrow[getCols().description] = it->name.empty() ? _("Tablet") : it->name ; + childrow[getCols().thumbnail] = getPix(PIX_TABLET); + + // Check if there is an eraser we can link to a pen + for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) { + Glib::RefPtr<InputDevice const> dev = *it2; + if ( dev->getSource() == Gdk::SOURCE_PEN ) { + for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it3 = it->devices.begin(); it3 != it->devices.end(); ++it3 ) { + Glib::RefPtr<InputDevice const> dev2 = *it3; + if ( dev2->getSource() == Gdk::SOURCE_ERASER ) { + DeviceManager::getManager().setLinkedTo(dev->getId(), dev2->getId()); + break; // only check the first eraser... for now + } + break; // only check the first pen... for now + } + } + } + + for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) { + Glib::RefPtr<InputDevice const> dev = *it2; + Gtk::TreeModel::Row deviceRow = *(store->append(childrow.children())); + deviceRow[getCols().description] = dev->getName(); + deviceRow[getCols().device] = dev; + deviceRow[getCols().mode] = dev->getMode(); + switch ( dev->getSource() ) { + case GDK_SOURCE_MOUSE: + deviceRow[getCols().thumbnail] = getPix(PIX_CORE); + break; + case GDK_SOURCE_PEN: + if (deviceRow[getCols().description] == _("pad")) { + deviceRow[getCols().thumbnail] = getPix(PIX_SIDEBUTTONS); + } else { + deviceRow[getCols().thumbnail] = getPix(PIX_TIP); + } + break; + case GDK_SOURCE_CURSOR: + deviceRow[getCols().thumbnail] = getPix(PIX_MOUSE); + break; + case GDK_SOURCE_ERASER: + deviceRow[getCols().thumbnail] = getPix(PIX_ERASER); + break; + default: + ; // nothing + } + } + } + + for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it = devList.begin(); it != devList.end(); ++it ) { + Glib::RefPtr<InputDevice const> dev = *it; + if ( dev && (consumed.find( dev->getId() ) == consumed.end()) ) { + Gtk::TreeModel::Row deviceRow = *(store->append(row.children())); + deviceRow[getCols().description] = dev->getName(); + deviceRow[getCols().device] = dev; + deviceRow[getCols().mode] = dev->getMode(); + deviceRow[getCols().thumbnail] = getPix(PIX_CORE); + } + } } else { g_warning("No devices found"); } @@ -806,24 +901,39 @@ InputDialogImpl::ConfPanel::ConfPanel() : row = *(poppers->append()); row[foo.one] = getModeToString()[Gdk::MODE_WINDOW]; - Gtk::CellRendererCombo *rendr = new Gtk::CellRendererCombo(); - rendr->property_model().set_value(poppers); - rendr->property_text_column().set_value(0); - rendr->property_has_entry() = false; - //Add the TreeView's view columns: + { + Gtk::CellRendererToggle *rendr = new Gtk::CellRendererToggle(); + Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("xx", *rendr); + if (col) { + tree.append_column(*col); + col->set_cell_data_func(*rendr, sigc::ptr_fun(setCellStateToggle)); + rendr->signal_toggled().connect(sigc::bind(sigc::ptr_fun(commitCellStateChange), store)); + } + } + + int expPos = tree.append_column("", getCols().expander); + tree.append_column("I", getCols().thumbnail); tree.append_column("Bar", getCols().description); - Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("X", *rendr); - if (col) { - tree.append_column(*col); - col->set_cell_data_func(*rendr, sigc::ptr_fun(setModeCellString)); - rendr->signal_edited().connect(sigc::bind(sigc::ptr_fun(commitCellModeChange), store)); - rendr->property_editable() = true; + + { + Gtk::CellRendererCombo *rendr = new Gtk::CellRendererCombo(); + rendr->property_model().set_value(poppers); + rendr->property_text_column().set_value(0); + rendr->property_has_entry() = false; + Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("X", *rendr); + if (col) { + tree.append_column(*col); + col->set_cell_data_func(*rendr, sigc::ptr_fun(setModeCellString)); + rendr->signal_edited().connect(sigc::bind(sigc::ptr_fun(commitCellModeChange), store)); + rendr->property_editable() = true; + } } tree.set_enable_tree_lines(); tree.set_headers_visible(false); + tree.set_expander_column( *tree.get_column(expPos - 1) ); setupTree( store, tabletIter ); @@ -874,6 +984,38 @@ void InputDialogImpl::ConfPanel::commitCellModeChange(Glib::ustring const &path, } } +void InputDialogImpl::ConfPanel::setCellStateToggle(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter) +{ + if (iter) { + Gtk::CellRendererToggle *toggle = dynamic_cast<Gtk::CellRendererToggle *>(rndr); + if (toggle) { + Glib::RefPtr<InputDevice const> dev = (*iter)[getCols().device]; + if (dev) { + Gdk::InputMode mode = (*iter)[getCols().mode]; + toggle->set_active(mode != Gdk::MODE_DISABLED); + } else { + toggle->set_active(false); + } + } + } +} + +void InputDialogImpl::ConfPanel::commitCellStateChange(Glib::ustring const &path, Glib::RefPtr<Gtk::TreeStore> store) +{ + Gtk::TreeIter iter = store->get_iter(path); + if (iter) { + Glib::RefPtr<InputDevice const> dev = (*iter)[getCols().device]; + if (dev) { + Gdk::InputMode mode = (*iter)[getCols().mode]; + if (mode == Gdk::MODE_DISABLED) { + Inkscape::DeviceManager::getManager().setMode( dev->getId(), Gdk::MODE_SCREEN ); + } else { + Inkscape::DeviceManager::getManager().setMode( dev->getId(), Gdk::MODE_DISABLED ); + } + } + } +} + void InputDialogImpl::ConfPanel::saveSettings() { Inkscape::DeviceManager::getManager().saveConfig(); @@ -1468,4 +1610,4 @@ bool InputDialogImpl::eventSnoop(GdkEvent* event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/input.h b/src/ui/dialog/input.h index 186612af0..40bbbeebf 100644 --- a/src/ui/dialog/input.h +++ b/src/ui/dialog/input.h @@ -44,4 +44,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index ffa4642e7..1728ff3a6 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -259,4 +259,4 @@ void LayerPropertiesDialog::_setLayer(SPObject *layer) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/layer-properties.h b/src/ui/dialog/layer-properties.h index 807967e8d..4172c284d 100644 --- a/src/ui/dialog/layer-properties.h +++ b/src/ui/dialog/layer-properties.h @@ -129,4 +129,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index ff3a13ab2..c3c0ae3c5 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -631,32 +631,30 @@ LayersPanel::LayersPanel() : _buttonsRow.set_child_min_width( 16 ); Gtk::Button* btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, _("New") ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, C_("Layers", "New") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_NEW) ); _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, Q_("layers|Top") ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, C_("Layers", "Top") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_TOP) ); _watchingNonTop.push_back( btn ); _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, _("Up") ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, C_("Layers", "Up") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_UP) ); _watchingNonTop.push_back( btn ); _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, _("Dn") ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, C_("Layers", "Dn") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DOWN) ); _watchingNonBottom.push_back( btn ); _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, _("Bot") ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, C_("Layers", "Bot") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_BOTTOM) ); _watchingNonBottom.push_back( btn ); _buttonsRow.add( *btn ); @@ -794,4 +792,4 @@ void LayersPanel::setDesktop( SPDesktop* desktop ) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index 4f2a65435..b7e81480c 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -144,4 +144,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index fb24d8e72..706a84733 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -483,4 +483,4 @@ void LivePathEffectEditor::on_visibility_toggled( Glib::ustring const& str ) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/livepatheffect-editor.h b/src/ui/dialog/livepatheffect-editor.h index 50e948644..7880d726b 100644 --- a/src/ui/dialog/livepatheffect-editor.h +++ b/src/ui/dialog/livepatheffect-editor.h @@ -144,4 +144,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/memory.cpp b/src/ui/dialog/memory.cpp index a80c7b449..7f5c5cefa 100644 --- a/src/ui/dialog/memory.cpp +++ b/src/ui/dialog/memory.cpp @@ -241,4 +241,4 @@ void Memory::_apply() { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/memory.h b/src/ui/dialog/memory.h index 48dcc8f09..792391b89 100644 --- a/src/ui/dialog/memory.h +++ b/src/ui/dialog/memory.h @@ -50,4 +50,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/messages.cpp b/src/ui/dialog/messages.cpp index 31f9cc51e..654117704 100644 --- a/src/ui/dialog/messages.cpp +++ b/src/ui/dialog/messages.cpp @@ -190,4 +190,4 @@ void Messages::releaseLogMessages() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h index b0a9d812b..1232914c8 100644 --- a/src/ui/dialog/messages.h +++ b/src/ui/dialog/messages.h @@ -93,4 +93,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index ce26f2148..85aefade8 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -375,4 +375,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/panel-dialog.h b/src/ui/dialog/panel-dialog.h index dc01c6a29..1103eccad 100644 --- a/src/ui/dialog/panel-dialog.h +++ b/src/ui/dialog/panel-dialog.h @@ -252,4 +252,4 @@ PanelDialog<Behavior::FloatingBehavior>::create() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 60cab06a2..2456e10da 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -240,4 +240,4 @@ Gtk::PrintOperationResult Print::run(Gtk::PrintOperationAction, Gtk::Window &par fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/print.h b/src/ui/dialog/print.h index ea89ebdf2..cc27955cb 100644 --- a/src/ui/dialog/print.h +++ b/src/ui/dialog/print.h @@ -70,4 +70,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp index 0e8a23baf..c7f828067 100644 --- a/src/ui/dialog/scriptdialog.cpp +++ b/src/ui/dialog/scriptdialog.cpp @@ -279,4 +279,4 @@ ScriptDialog &ScriptDialog::getInstance() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/scriptdialog.h b/src/ui/dialog/scriptdialog.h index d0021ce68..0b26f169a 100644 --- a/src/ui/dialog/scriptdialog.h +++ b/src/ui/dialog/scriptdialog.h @@ -75,4 +75,4 @@ class ScriptDialog : public UI::Widget::Panel fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/session-player.cpp b/src/ui/dialog/session-player.cpp index 0e484c3f2..51b206a85 100644 --- a/src/ui/dialog/session-player.cpp +++ b/src/ui/dialog/session-player.cpp @@ -227,4 +227,4 @@ SessionPlaybackDialogImpl::_respCallback(int resp) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/session-player.h b/src/ui/dialog/session-player.h index 52377a73f..9c10f264f 100644 --- a/src/ui/dialog/session-player.h +++ b/src/ui/dialog/session-player.h @@ -131,4 +131,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 998f4e1e1..1f11a412e 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -602,6 +602,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin void SvgFontsDialog::remove_selected_font(){ SPFont* font = get_selected_spfont(); + if (!font) return; sp_repr_unparent(font->repr); SPDocument* doc = sp_desktop_document(this->getDesktop()); @@ -731,7 +732,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){ create_kerning_pairs_popup_menu(_KerningPairsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_kerning_pair)); //Kerning Setup: - kerning_vbox.add(*Gtk::manage(new Gtk::Label(_("Kerning Setup:")))); + kerning_vbox.add(*Gtk::manage(new Gtk::Label(_("Kerning Setup")))); Gtk::HBox* kerning_selector = Gtk::manage(new Gtk::HBox()); kerning_selector->add(*Gtk::manage(new Gtk::Label(_("1st Glyph:")))); kerning_selector->add(first_glyph); @@ -910,4 +911,4 @@ SvgFontsDialog::~SvgFontsDialog(){} fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 96910821e..f6cd5b775 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -436,7 +436,7 @@ void _loadPaletteFile( gchar const *filename ) if ( !hasErr && *ptr ) { char* n = trim(ptr); if (n != NULL) { - name = n; + name = g_dpgettext2(NULL, "Palette", n); } } if ( !hasErr ) { @@ -1081,4 +1081,4 @@ void SwatchesPanel::_rebuild() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/swatches.h b/src/ui/dialog/swatches.h index 93bbe81d8..f9f3daf91 100644 --- a/src/ui/dialog/swatches.h +++ b/src/ui/dialog/swatches.h @@ -87,4 +87,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp index 6be346582..b50610938 100644 --- a/src/ui/dialog/tile.cpp +++ b/src/ui/dialog/tile.cpp @@ -885,4 +885,4 @@ TileDialog::TileDialog() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :: +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/tile.h b/src/ui/dialog/tile.h index 9ade64935..16ae3e4f8 100644 --- a/src/ui/dialog/tile.h +++ b/src/ui/dialog/tile.h @@ -177,4 +177,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/tracedialog.h b/src/ui/dialog/tracedialog.h index 9dc084cd6..b52162aba 100644 --- a/src/ui/dialog/tracedialog.h +++ b/src/ui/dialog/tracedialog.h @@ -65,4 +65,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index c11801fcf..bb7ea1a69 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -25,6 +25,7 @@ #include "selection-chemistry.h" #include "verbs.h" #include "preferences.h" +#include "sp-namedview.h" #include "sp-item-transform.h" #include "macros.h" #include "sp-item.h" @@ -78,27 +79,27 @@ Transformation::Transformation() _page_rotate (4, 2), _page_skew (4, 2), _page_transform (3, 3), - _scalar_move_horizontal (_("_Horizontal"), _("Horizontal displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR, + _scalar_move_horizontal (_("_Horizontal:"), _("Horizontal displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR, "", "transform-move-horizontal", &_units_move), - _scalar_move_vertical (_("_Vertical"), _("Vertical displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR, + _scalar_move_vertical (_("_Vertical:"), _("Vertical displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR, "", "transform-move-vertical", &_units_move), - _scalar_scale_horizontal(_("_Width"), _("Horizontal size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS, + _scalar_scale_horizontal(_("_Width:"), _("Horizontal size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS, "", "transform-scale-horizontal", &_units_scale), - _scalar_scale_vertical (_("_Height"), _("Vertical size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS, + _scalar_scale_vertical (_("_Height:"), _("Vertical size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS, "", "transform-scale-vertical", &_units_scale), - _scalar_rotate (_("A_ngle"), _("Rotation angle (positive = counterclockwise)"), UNIT_TYPE_RADIAL, + _scalar_rotate (_("A_ngle:"), _("Rotation angle (positive = counterclockwise)"), UNIT_TYPE_RADIAL, "", "transform-rotate", &_units_rotate), - _scalar_skew_horizontal (_("_Horizontal"), _("Horizontal skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR, + _scalar_skew_horizontal (_("_Horizontal:"), _("Horizontal skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR, "", "transform-skew-horizontal", &_units_skew), - _scalar_skew_vertical (_("_Vertical"), _("Vertical skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR, + _scalar_skew_vertical (_("_Vertical:"), _("Vertical skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR, "", "transform-skew-vertical", &_units_skew), - _scalar_transform_a ("_A", _("Transformation matrix element A")), - _scalar_transform_b ("_B", _("Transformation matrix element B")), - _scalar_transform_c ("_C", _("Transformation matrix element C")), - _scalar_transform_d ("_D", _("Transformation matrix element D")), - _scalar_transform_e ("_E", _("Transformation matrix element E")), - _scalar_transform_f ("_F", _("Transformation matrix element F")), + _scalar_transform_a ("_A:", _("Transformation matrix element A")), + _scalar_transform_b ("_B:", _("Transformation matrix element B")), + _scalar_transform_c ("_C:", _("Transformation matrix element C")), + _scalar_transform_d ("_D:", _("Transformation matrix element D")), + _scalar_transform_e ("_E:", _("Transformation matrix element E")), + _scalar_transform_f ("_F:", _("Transformation matrix element F")), _check_move_relative (_("Rela_tive move"), _("Add the specified relative displacement to the current position; otherwise, edit the current absolute position directly")), _check_scale_proportional (_("Scale proportionally"), _("Preserve the width/height ratio of the scaled objects")), @@ -197,6 +198,14 @@ void Transformation::layoutPageMove() { _units_move.setUnitType(UNIT_TYPE_LINEAR); + + // Setting default unit to document unit + SPDesktop *dt = getDesktop(); + SPNamedView *nv = sp_desktop_namedview(dt); + if (nv->doc_units) { + _units_move.setUnit(nv->doc_units->abbr); + } + _scalar_move_horizontal.initScalar(-1e6, 1e6); _scalar_move_horizontal.setDigits(3); _scalar_move_horizontal.setIncrements(0.1, 1.0); @@ -461,8 +470,9 @@ Transformation::updatePageMove(Inkscape::Selection *selection) double x = bbox->min()[Geom::X]; double y = bbox->min()[Geom::Y]; - _scalar_move_horizontal.setValue(x, "px"); - _scalar_move_vertical.setValue(y, "px"); + double conversion = _units_move.getConversion("px"); + _scalar_move_horizontal.setValue(x / conversion); + _scalar_move_vertical.setValue(y / conversion); } } else { // do nothing, so you can apply the same relative move to many objects in turn @@ -870,6 +880,8 @@ Transformation::onMoveRelativeToggled() double x = _scalar_move_horizontal.getValue("px"); double y = _scalar_move_vertical.getValue("px"); + double conversion = _units_move.getConversion("px"); + //g_message("onMoveRelativeToggled: %f, %f px\n", x, y); Geom::OptRect bbox = selection->bounds(); @@ -877,12 +889,12 @@ Transformation::onMoveRelativeToggled() if (bbox) { if (_check_move_relative.get_active()) { // From absolute to relative - _scalar_move_horizontal.setValue(x - bbox->min()[Geom::X], "px"); - _scalar_move_vertical.setValue( y - bbox->min()[Geom::Y], "px"); + _scalar_move_horizontal.setValue((x - bbox->min()[Geom::X]) / conversion); + _scalar_move_vertical.setValue(( y - bbox->min()[Geom::Y]) / conversion); } else { // From relative to absolute - _scalar_move_horizontal.setValue(bbox->min()[Geom::X] + x, "px"); - _scalar_move_vertical.setValue( bbox->min()[Geom::Y] + y, "px"); + _scalar_move_horizontal.setValue((bbox->min()[Geom::X] + x) / conversion); + _scalar_move_vertical.setValue(( bbox->min()[Geom::Y] + y) / conversion); } } @@ -1067,4 +1079,4 @@ Transformation::onApplySeparatelyToggled() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/transformation.h b/src/ui/dialog/transformation.h index 0607871fd..cf6d72447 100644 --- a/src/ui/dialog/transformation.h +++ b/src/ui/dialog/transformation.h @@ -19,7 +19,6 @@ #include "ui/widget/panel.h" -#include "application/application.h" #include "ui/widget/notebook-page.h" #include "ui/widget/scalar-unit.h" #include "ui/widget/imageicon.h" @@ -145,12 +144,6 @@ protected: virtual void _apply(); void presentPage(PageType page); - - void onSelectionChanged(Inkscape::NSApplication::Application *inkscape, - Inkscape::Selection *selection); - void onSelectionModified(Inkscape::NSApplication::Application *inkscape, - Inkscape::Selection *selection, - int unsigned flags); void onSwitchPage(GtkNotebookPage *page, guint pagenum); @@ -232,4 +225,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp index 8017af803..111dc014d 100644 --- a/src/ui/dialog/undo-history.cpp +++ b/src/ui/dialog/undo-history.cpp @@ -345,4 +345,4 @@ const CellRendererInt::Filter& UndoHistory::greater_than_1 = UndoHistory::Greate fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/undo-history.h b/src/ui/dialog/undo-history.h index 82e04f3c9..1a4d2e486 100644 --- a/src/ui/dialog/undo-history.h +++ b/src/ui/dialog/undo-history.h @@ -170,4 +170,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/whiteboard-connect.cpp b/src/ui/dialog/whiteboard-connect.cpp index b18ed99d4..0555281d4 100644 --- a/src/ui/dialog/whiteboard-connect.cpp +++ b/src/ui/dialog/whiteboard-connect.cpp @@ -318,4 +318,4 @@ WhiteboardConnectDialogImpl::_useSSLClickedCallback() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/whiteboard-sharewithuser.cpp b/src/ui/dialog/whiteboard-sharewithuser.cpp index bb3761f31..6d905b684 100644 --- a/src/ui/dialog/whiteboard-sharewithuser.cpp +++ b/src/ui/dialog/whiteboard-sharewithuser.cpp @@ -224,4 +224,4 @@ WhiteboardShareWithUserDialogImpl::_listCallback() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/icon-names.h b/src/ui/icon-names.h index 92fd86a48..2ec03c5cc 100644 --- a/src/ui/icon-names.h +++ b/src/ui/icon-names.h @@ -590,4 +590,4 @@ fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/previewable.h b/src/ui/previewable.h index ef1ca3ce2..9a086a9a2 100644 --- a/src/ui/previewable.h +++ b/src/ui/previewable.h @@ -59,4 +59,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/previewfillable.h b/src/ui/previewfillable.h index f863af121..07fbc4fc5 100644 --- a/src/ui/previewfillable.h +++ b/src/ui/previewfillable.h @@ -52,4 +52,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp index ba0b6a7ef..7a018d91a 100644 --- a/src/ui/previewholder.cpp +++ b/src/ui/previewholder.cpp @@ -338,4 +338,4 @@ void PreviewHolder::rebuildUI() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h index 3c1a16195..c396cef19 100644 --- a/src/ui/previewholder.h +++ b/src/ui/previewholder.h @@ -77,4 +77,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/commit-events.h b/src/ui/tool/commit-events.h index d99872766..110564ba3 100644 --- a/src/ui/tool/commit-events.h +++ b/src/ui/tool/commit-events.h @@ -48,4 +48,4 @@ enum CommitEvent { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 615587eeb..91e0bc2c2 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -654,4 +654,4 @@ bool ControlPointSelection::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index 8023c3e28..3aed6ae93 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -159,4 +159,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index b74e3bc9c..d5e5b7dfe 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -329,7 +329,7 @@ bool ControlPoint::_eventHandler(GdkEvent *event) _setState(STATE_CLICKED); return true; } - return false; + return _event_grab; case GDK_2BUTTON_PRESS: // store the button number for next release @@ -452,8 +452,9 @@ bool ControlPoint::_eventHandler(GdkEvent *event) default: break; } - - return false; + + // do not propagate events during grab - it might cause problems + return _event_grab; } void ControlPoint::_setMouseover(ControlPoint *p, unsigned state) @@ -578,4 +579,4 @@ bool ControlPoint::doubleclicked(GdkEventButton *) { return false; } fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h index 48c70748b..4de5e5847 100644 --- a/src/ui/tool/control-point.h +++ b/src/ui/tool/control-point.h @@ -199,4 +199,4 @@ extern ControlPoint::ColorSet invisible_cset; fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index 0e5805dda..a3fb5aa6e 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -193,4 +193,4 @@ Glib::ustring CurveDragPoint::_getTip(unsigned state) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/curve-drag-point.h b/src/ui/tool/curve-drag-point.h index 288ae6a8e..42a4930c8 100644 --- a/src/ui/tool/curve-drag-point.h +++ b/src/ui/tool/curve-drag-point.h @@ -59,4 +59,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/event-utils.cpp b/src/ui/tool/event-utils.cpp index 91b2cdb04..ef2d27653 100644 --- a/src/ui/tool/event-utils.cpp +++ b/src/ui/tool/event-utils.cpp @@ -153,4 +153,4 @@ unsigned state_after_event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/event-utils.h b/src/ui/tool/event-utils.h index 784855f56..de29c3dda 100644 --- a/src/ui/tool/event-utils.h +++ b/src/ui/tool/event-utils.h @@ -129,4 +129,4 @@ unsigned state_after_event(GdkEvent *event); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/manipulator.cpp b/src/ui/tool/manipulator.cpp index b532fcab4..49e601797 100644 --- a/src/ui/tool/manipulator.cpp +++ b/src/ui/tool/manipulator.cpp @@ -86,4 +86,4 @@ bool ManipulatorGroup::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/manipulator.h b/src/ui/tool/manipulator.h index 799dad0d3..fd24e7b61 100644 --- a/src/ui/tool/manipulator.h +++ b/src/ui/tool/manipulator.h @@ -162,4 +162,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/modifier-tracker.cpp b/src/ui/tool/modifier-tracker.cpp index 8c6033bc7..bbef0d469 100644 --- a/src/ui/tool/modifier-tracker.cpp +++ b/src/ui/tool/modifier-tracker.cpp @@ -90,4 +90,4 @@ bool ModifierTracker::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/modifier-tracker.h b/src/ui/tool/modifier-tracker.h index 55538ead6..8c8787e87 100644 --- a/src/ui/tool/modifier-tracker.h +++ b/src/ui/tool/modifier-tracker.h @@ -51,4 +51,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 2025a12d7..82446b7b4 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -220,11 +220,29 @@ void MultiPathManipulator::invertSelectionInSubpaths() void MultiPathManipulator::setNodeType(NodeType type) { if (_selection.empty()) return; + + // When all selected nodes are already cusp, retract their handles + bool retract_handles = (type == NODE_CUSP); + for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) { Node *node = dynamic_cast<Node*>(*i); - if (node) node->setType(type); + if (node) { + retract_handles &= (node->type() == NODE_CUSP); + node->setType(type); + } + } + + if (retract_handles) { + for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) { + Node *node = dynamic_cast<Node*>(*i); + if (node) { + node->front()->retract(); + node->back()->retract(); + } + } } - _done(_("Change node type")); + + _done(retract_handles ? _("Retract handles") : _("Change node type")); } void MultiPathManipulator::setSegmentType(SegmentType type) @@ -244,6 +262,12 @@ void MultiPathManipulator::insertNodes() _done(_("Add nodes")); } +void MultiPathManipulator::duplicateNodes() +{ + invokeForAll(&PathManipulator::duplicateNodes); + _done(_("Duplicate nodes")); +} + void MultiPathManipulator::joinNodes() { invokeForAll(&PathManipulator::hideDragPoint); @@ -513,6 +537,12 @@ bool MultiPathManipulator::event(GdkEvent *event) return true; } break; + case GDK_d: + case GDK_D: + if (held_only_shift(event->key)) { + duplicateNodes(); + return true; + } case GDK_j: case GDK_J: if (held_only_shift(event->key)) { @@ -591,6 +621,20 @@ bool MultiPathManipulator::event(GdkEvent *event) return true; } break; + case GDK_l: + case GDK_L: + if (held_only_shift(event->key)) { + // Shift+L - make segments linear + setSegmentType(SEGMENT_STRAIGHT); + return true; + } + case GDK_u: + case GDK_U: + if (held_only_shift(event->key)) { + // Shift+L - make segments curves + setSegmentType(SEGMENT_CUBIC_BEZIER); + return true; + } default: break; } @@ -714,4 +758,4 @@ guint32 MultiPathManipulator::_getOutlineColor(ShapeRole role) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index 181ae6d1d..ddb74c1bc 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -53,6 +53,7 @@ public: void setSegmentType(SegmentType t); void insertNodes(); + void duplicateNodes(); void joinNodes(); void breakNodes(); void deleteNodes(bool keep_shape = true); @@ -135,4 +136,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index 450ca96f0..8008d79eb 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -25,6 +25,7 @@ #include "sp-mask.h" #include "sp-object-group.h" #include "sp-path.h" +#include "sp-text.h" #include "ui/tool/node-tool.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/curve-drag-point.h" @@ -164,6 +165,7 @@ void ink_node_tool_init(InkNodeTool *nt) new (&nt->_multipath) MultiPathPtr(); new (&nt->_selector) SelectorPtr(); new (&nt->_path_data) PathSharedDataPtr(); + new (&nt->_shape_editors) ShapeEditors(); } void ink_node_tool_dispose(GObject *object) @@ -178,6 +180,7 @@ void ink_node_tool_dispose(GObject *object) nt->_multipath.~MultiPathPtr(); nt->_selected_nodes.~CSelPtr(); nt->_selector.~SelectorPtr(); + nt->_shape_editors.~ShapeEditors(); Inkscape::UI::PathSharedData &data = *nt->_path_data; destroy_group(data.node_data.node_group); @@ -195,10 +198,6 @@ void ink_node_tool_dispose(GObject *object) if (nt->_node_message_context) { delete nt->_node_message_context; } - if (nt->shape_editor) { - nt->shape_editor->unset_item(SH_KNOTHOLDER); - delete nt->shape_editor; - } G_OBJECT_CLASS(g_type_class_peek(g_type_parent(INK_TYPE_NODE_TOOL)))->dispose(object); } @@ -281,9 +280,6 @@ void ink_node_tool_setup(SPEventContext *ec) nt->flash_tempitem = NULL; nt->flashed_item = NULL; nt->_last_over = NULL; - // TODO long term, fold ShapeEditor into MultiPathManipulator and rename MPM - // to something better - nt->shape_editor = new ShapeEditor(nt->desktop); // read prefs before adding items to selection to prevent momentarily showing the outline sp_event_context_read(nt, "show_handles"); @@ -403,22 +399,30 @@ void ink_node_tool_selection_changed(InkNodeTool *nt, Inkscape::Selection *sel) } } - // ugly hack: set the first editable non-path item for knotholder - // maybe use multiple ShapeEditors for now, to allow editing many shapes at once? - bool something_set = false; + // use multiple ShapeEditors for now, to allow editing many shapes at once + // needs to be rethought + for (ShapeEditors::iterator i = nt->_shape_editors.begin(); + i != nt->_shape_editors.end(); ) + { + ShapeRecord s; + s.item = i->first; + if (shapes.find(s) == shapes.end()) { + nt->_shape_editors.erase(i++); + } else { + ++i; + } + } + for (std::set<ShapeRecord>::iterator i = shapes.begin(); i != shapes.end(); ++i) { ShapeRecord const &r = *i; - if (SP_IS_SHAPE(r.item) || - (SP_IS_PATH(r.item) && r.item->repr->attribute("inkscape:original-d") != NULL)) + if ((SP_IS_SHAPE(r.item) || SP_IS_TEXT(r.item)) && + nt->_shape_editors.find(r.item) == nt->_shape_editors.end()) { - nt->shape_editor->set_item(r.item, SH_KNOTHOLDER); - something_set = true; - break; + ShapeEditor *si = new ShapeEditor(nt->desktop); + si->set_item(r.item, SH_KNOTHOLDER); + nt->_shape_editors.insert(const_cast<SPItem*&>(r.item), si); } } - if (!something_set) { - nt->shape_editor->unset_item(SH_KNOTHOLDER); - } nt->_multipath->setItems(shapes); ink_node_tool_update_tip(nt, NULL); @@ -615,8 +619,14 @@ void ink_node_tool_select_point(InkNodeTool *nt, Geom::Point const &/*sel*/, Gdk if (item_clicked == NULL) { // nothing under cursor // if no Shift, deselect - if (!(event->state & GDK_SHIFT_MASK)) { - selection->clear(); + // if there are nodes selected, the first click should deselect the nodes + // and the second should deselect the items + if (!state_held_shift(event->state)) { + if (nt->_selected_nodes->empty()) { + selection->clear(); + } else { + nt->_selected_nodes->clear(); + } } } else { if (held_shift(*event)) { @@ -658,4 +668,4 @@ void ink_node_tool_mouseover_changed(InkNodeTool *nt, Inkscape::UI::ControlPoint fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 641d064c1..4d38e69e2 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -12,6 +12,7 @@ #define SEEN_UI_TOOL_NODE_TOOL_H #include <memory> +#include <boost/ptr_container/ptr_map.hpp> #include <glib.h> #include <sigc++/sigc++.h> #include "event-context.h" @@ -41,6 +42,7 @@ typedef std::auto_ptr<Inkscape::UI::MultiPathManipulator> MultiPathPtr; typedef std::auto_ptr<Inkscape::UI::ControlPointSelection> CSelPtr; typedef std::auto_ptr<Inkscape::UI::Selector> SelectorPtr; typedef std::auto_ptr<Inkscape::UI::PathSharedData> PathSharedDataPtr; +typedef boost::ptr_map<SPItem*, ShapeEditor> ShapeEditors; struct InkNodeTool : public SPEventContext { @@ -56,6 +58,7 @@ struct InkNodeTool : public SPEventContext PathSharedDataPtr _path_data; SPCanvasGroup *_transform_handle_group; SPItem *_last_over; + ShapeEditors _shape_editors; unsigned cursor_drag : 1; unsigned show_handles : 1; @@ -86,4 +89,4 @@ GType ink_node_tool_get_type (void); fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node-types.h b/src/ui/tool/node-types.h index 80eaf4fa7..e4921fa8d 100644 --- a/src/ui/tool/node-types.h +++ b/src/ui/tool/node-types.h @@ -45,4 +45,4 @@ enum SegmentType { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index a8582ccc5..12d04dd2b 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -274,8 +274,10 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) } else { sm.freeSnapReturnByRef(new_pos, SNAPSOURCE_NODE_HANDLE); } + sm.unSetup(); } + // with Shift, if the node is cusp, rotate the other handle as well if (_parent->type() == NODE_CUSP && !_drag_out) { if (held_shift(*event)) { @@ -566,11 +568,7 @@ void Node::setType(NodeType type, bool update_handles) if (update_handles) { switch (type) { case NODE_CUSP: - // if the existing type is also NODE_CUSP, retract handles - if (_type == NODE_CUSP) { - _front.retract(); - _back.retract(); - } + // nothing to do break; case NODE_AUTO: // auto handles make no sense for endnodes @@ -578,13 +576,15 @@ void Node::setType(NodeType type, bool update_handles) _updateAutoHandles(); break; case NODE_SMOOTH: { + // ignore attempts to make smooth endnodes. + if (isEndNode()) return; // rotate handles to be colinear // for degenerate nodes set positions like auto handles bool prev_line = _is_line_segment(_prev(), this); bool next_line = _is_line_segment(this, _next()); if (_type == NODE_SMOOTH) { - // for a node that is already smooth and has a degenerate handle, - // drag out the second handle to 1/3 the length of the linear segment + // For a node that is already smooth and has a degenerate handle, + // drag out the second handle without changing the direction of the first one. if (_front.isDegenerate()) { double dist = Geom::distance(_next()->position(), position()); _front.setRelativePos(Geom::unit_vector(-_back.relativePos()) * dist / 3); @@ -728,8 +728,7 @@ NodeType Node::parse_nodetype(char x) /** Customized event handler to catch scroll events needed for selection grow/shrink. */ bool Node::_eventHandler(GdkEvent *event) { - static NodeList::iterator origin; - static int dir; + int dir = 0; switch (event->type) { @@ -740,14 +739,34 @@ bool Node::_eventHandler(GdkEvent *event) dir = -1; } else break; if (held_control(event->scroll)) { - _selection.spatialGrow(this, dir); + _linearGrow(dir); } else { + _selection.spatialGrow(this, dir); + } + return true; + case GDK_KEY_PRESS: + switch (shortcut_key(event->key)) + { + case GDK_Page_Up: + dir = 1; + break; + case GDK_Page_Down: + dir = -1; + break; + default: goto bail_out; + } + + if (held_control(event->key)) { _linearGrow(dir); + } else { + _selection.spatialGrow(this, dir); } return true; default: break; } + + bail_out: return ControlPoint::_eventHandler(event); } @@ -942,8 +961,16 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) { // For a note on how snapping is implemented in Inkscape, see snap.h. SnapManager &sm = _desktop->namedview->snap_manager; - bool snap = sm.someSnapperMightSnap(); + // even if we won't really snap, we might still call the one of the + // constrainedSnap() methods to enforce the constraints, so we need + // to setup the snapmanager anyway; this is also required for someSnapperMightSnap() + sm.setup(_desktop); + + // do not snap when Shift is pressed + bool snap = !held_shift(*event) && sm.someSnapperMightSnap(); + Inkscape::SnappedPoint sp; + std::vector<Inkscape::SnapCandidatePoint> unselected; if (snap) { /* setup * TODO We are doing this every time a snap happens. It should once be done only once @@ -953,7 +980,6 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) * TODO Snapping to unselected segments of selected paths doesn't work yet. */ // Build the list of unselected nodes. - std::vector<Inkscape::SnapCandidatePoint> unselected; typedef ControlPointSelection::Set Set; Set &nodes = _selection.allPoints(); for (Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { @@ -963,6 +989,7 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) unselected.push_back(p); } } + sm.unSetup(); sm.setupIgnoreSelection(_desktop, true, &unselected); } @@ -1014,12 +1041,12 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, *bperp_point)); } - sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints); + sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints, held_shift(*event)); } else { // with Ctrl, constrain to axes constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, Geom::Point(1, 0))); constraints.push_back(Inkscape::Snapper::SnapConstraint(origin, Geom::Point(0, 1))); - sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints); + sp = sm.multipleConstrainedSnaps(Inkscape::SnapCandidatePoint(new_pos, _snapSourceType()), constraints, held_shift(*event)); } new_pos = sp.getPoint(); } else if (snap) { @@ -1027,6 +1054,8 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) new_pos = sp.getPoint(); } + sm.unSetup(); + SelectableControlPoint::dragged(new_pos, event); } @@ -1374,4 +1403,4 @@ NodeList &NodeList::get(iterator const &i) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index af4cd7e3a..0194f5053 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -408,4 +408,4 @@ NodeIterator<N> &NodeIterator<N>::retreat() { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 66f72f379..956f48a7d 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -319,6 +319,39 @@ void PathManipulator::insertNodes() } } +/** Insert new nodes exactly at the positions of selected nodes while preserving shape. + * This is equivalent to breaking, except that it doesn't split into subpaths. */ +void PathManipulator::duplicateNodes() +{ + if (_num_selected == 0) return; + + for (SubpathList::iterator i = _subpaths.begin(); i != _subpaths.end(); ++i) { + for (NodeList::iterator j = (*i)->begin(); j != (*i)->end(); ++j) { + if (j->selected()) { + NodeList::iterator k = j.next(); + Node *n = new Node(_multi_path_manipulator._path_data.node_data, *j); + + // Move the new node to the bottom of the Z-order. This way you can drag all + // nodes that were selected before this operation without deselecting + // everything because there is a new node above. + n->sink(); + + n->front()->setPosition(*j->front()); + j->front()->retract(); + j->setType(NODE_CUSP, false); + (*i)->insert(k, n); + + // We need to manually call the selection change callback to refresh + // the handle display correctly. + // This call changes num_selected, but we call this once for a selected node + // and once for an unselected node, so in the end the number stays correct. + _selectionChanged(j.ptr(), true); + _selectionChanged(n, false); + } + } + } +} + /** Replace contiguous selections of nodes in each subpath with one node. */ void PathManipulator::weldNodes(NodeList::iterator preserve_pos) { @@ -1292,17 +1325,11 @@ bool PathManipulator::_nodeClicked(Node *n, GdkEventButton *event) return true; } else if (held_control(*event)) { // Ctrl+click: cycle between node types - if (n->isEndNode()) { - if (n->type() == NODE_CUSP) { - n->setType(NODE_SMOOTH); - } else { - n->setType(NODE_CUSP); - } - } else { + if (!n->isEndNode()) { n->setType(static_cast<NodeType>((n->type() + 1) % NODE_LAST_REAL_TYPE)); + update(); + _commit(_("Cycle node type")); } - update(); - _commit(_("Cycle node type")); return true; } return false; @@ -1414,7 +1441,10 @@ void PathManipulator::_updateDragPoint(Geom::Point const &evp) NodeList::iterator first = (*spi)->before(pvp->t, &fracpart); double stroke_tolerance = _getStrokeTolerance(); - if (Geom::distance(evp, nearest_point) < stroke_tolerance) { + if (first && first.next() && + fracpart != 0.0 && + Geom::distance(evp, nearest_point) < stroke_tolerance) + { _dragpoint->setVisible(true); _dragpoint->setPosition(_desktop->w2d(nearest_point)); _dragpoint->setSize(2 * stroke_tolerance); @@ -1459,4 +1489,4 @@ double PathManipulator::_getStrokeTolerance() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index a8f1c957e..87b88fc77 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -69,6 +69,7 @@ public: void invertSelectionInSubpaths(); void insertNodes(); + void duplicateNodes(); void weldNodes(NodeList::iterator preserve_pos = NodeList::iterator()); void weldSegments(); void breakNodes(); @@ -162,4 +163,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selectable-control-point.cpp b/src/ui/tool/selectable-control-point.cpp index 76028dd82..e9a8bcbd6 100644 --- a/src/ui/tool/selectable-control-point.cpp +++ b/src/ui/tool/selectable-control-point.cpp @@ -136,4 +136,4 @@ void SelectableControlPoint::_setState(State state) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h index 2fde16ea9..1b8bd46cc 100644 --- a/src/ui/tool/selectable-control-point.h +++ b/src/ui/tool/selectable-control-point.h @@ -69,4 +69,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index d766d5be3..fdd0fc51f 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -130,4 +130,4 @@ bool Selector::event(GdkEvent *event) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/selector.h b/src/ui/tool/selector.h index f7c00ea71..e61668d9e 100644 --- a/src/ui/tool/selector.h +++ b/src/ui/tool/selector.h @@ -56,4 +56,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/shape-record.h b/src/ui/tool/shape-record.h index edfad1401..893231404 100644 --- a/src/ui/tool/shape-record.h +++ b/src/ui/tool/shape-record.h @@ -58,4 +58,4 @@ struct ShapeRecord : fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 6b8fb4c11..ef93a3767 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -654,4 +654,4 @@ void TransformHandleSet::_updateVisibility(bool v) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tool/transform-handle-set.h b/src/ui/tool/transform-handle-set.h index 48ad3af51..2a4df8751 100644 --- a/src/ui/tool/transform-handle-set.h +++ b/src/ui/tool/transform-handle-set.h @@ -93,4 +93,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/view/Makefile_insert b/src/ui/view/Makefile_insert index 812ce21ca..b3ab598d4 100644 --- a/src/ui/view/Makefile_insert +++ b/src/ui/view/Makefile_insert @@ -1,10 +1,6 @@ ## Makefile.am fragment sourced by src/Makefile.am. ink_common_sources += \ - ui/view/edit.h \ - ui/view/edit.cpp \ - ui/view/edit-widget.h \ - ui/view/edit-widget.cpp \ ui/view/edit-widget-interface.h \ ui/view/view.h \ ui/view/view.cpp \ diff --git a/src/ui/view/edit-widget-interface.h b/src/ui/view/edit-widget-interface.h index 7456f4adf..919b570dd 100644 --- a/src/ui/view/edit-widget-interface.h +++ b/src/ui/view/edit-widget-interface.h @@ -158,4 +158,4 @@ struct EditWidgetInterface fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp deleted file mode 100644 index 770a9bf87..000000000 --- a/src/ui/view/edit-widget.cpp +++ /dev/null @@ -1,1698 +0,0 @@ -/** - * \brief This class implements the functionality of the window layout, menus, - * and signals. - * - * This is a reimplementation into C++/Gtkmm of Sodipodi's SPDesktopWidget class. - * Both SPDesktopWidget and EditWidget adhere to the EditWidgetInterface, so - * they both can serve as widget for the same SPDesktop/Edit class. - * - * Ideally, this class should only contain the handling of the Window (i.e., - * content construction and window signals) and implement its - * EditWidgetInterface. - * - * Authors: - * Ralf Stephan <ralf@ark.in-berlin.de> - * Bryce W. Harrington <bryce@bryceharrington.org> - * Derek P. Moore <derekm@hackunix.org> - * Lauris Kaplinski <lauris@kaplinski.com> - * Frank Felfe <innerspace@iname.com> - * John Bintz <jcoswell@coswellproductions.org> - * Johan Engelen <j.b.c.engelen@ewi.utwente.nl> - * - * Copyright (C) 2007 Johan Engelen - * Copyright (C) 2006 John Bintz - * Copyright (C) 1999-2005 Authors - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Released under GNU GPL. Read the file 'COPYING' for more information. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <gtk/gtkwindow.h> -#include <gtk/gtkversion.h> -#include <gtk/gtklabel.h> -#include <gtkmm/radioaction.h> -#include <gtkmm/menubar.h> -#include <gtkmm/messagedialog.h> -#include <gtkmm/stock.h> -#include <gtkmm/accelmap.h> -#include <gtkmm/separator.h> -#include <gtkmm/base.h> - -#include <sigc++/functors/mem_fun.h> - -#include "macros.h" -#include "path-prefix.h" -#include "preferences.h" -#include "file.h" -#include "application/editor.h" -#include "edit-widget.h" - -#include "display/sodipodi-ctrlrect.h" -#include "helper/units.h" -#include "shortcuts.h" -#include "widgets/spw-utilities.h" -#include "event-context.h" -#include "document.h" -#include "sp-namedview.h" -#include "sp-item.h" -#include "interface.h" -#include "extension/db.h" - -#include "ui/dialog/dialog-manager.h" - -using namespace Inkscape::UI; -using namespace Inkscape::UI::Widget; - -namespace Inkscape { -namespace UI { -namespace View { - -EditWidget::EditWidget (SPDocument *doc) - : _main_window_table(4), - _viewport_table(3,3), - _act_grp(Gtk::ActionGroup::create()), - _ui_mgr(Gtk::UIManager::create()), - _update_s_f(false), - _update_a_f(false), - _interaction_disabled_counter(0) -{ - g_warning("Creating new EditWidget"); - - _desktop = 0; - initActions(); - initAccelMap(); - initUIManager(); - initLayout(); - initEdit (doc); - g_warning("Done creating new EditWidget"); -} - -EditWidget::~EditWidget() -{ - destroyEdit(); -} - -void -EditWidget::initActions() -{ - initMenuActions(); - initToolbarActions(); -} - -void -EditWidget::initUIManager() -{ - _ui_mgr->insert_action_group(_act_grp); - add_accel_group(_ui_mgr->get_accel_group()); - - gchar *filename_utf8 = g_build_filename(INKSCAPE_UIDIR, "menus-bars.xml", NULL); - if (_ui_mgr->add_ui_from_file(filename_utf8) == 0) { - g_warning("Error merging ui from file '%s'", filename_utf8); - // fixme-charset: What charset should we pass to g_warning? - } - g_free(filename_utf8); -} - -void -EditWidget::initLayout() -{ - set_title("New document 1 - Inkscape"); - set_resizable(); - set_default_size(640, 480); - - // top level window into which all other portions of the UI get inserted - add(_main_window_table); - // attach box for horizontal toolbars - _main_window_table.attach(_toolbars_vbox, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); - // attach sub-window for viewport and vertical toolbars - _main_window_table.attach(_sub_window_hbox, 0, 1, 2, 3); - // viewport table with 3 rows by 3 columns - _sub_window_hbox.pack_end(_viewport_table); - - // Menus and Bars - initMenuBar(); - initCommandsBar(); - initToolControlsBar(); - initUriBar(); - initToolsBar(); - - // Canvas Viewport - initLeftRuler(); - initTopRuler(); - initStickyZoom(); - initBottomScrollbar(); - initRightScrollbar(); - _viewport_table.attach(_svg_canvas.widget(), 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND); - _svg_canvas.widget().show_all(); - - // The statusbar comes last and appears at the bottom of _main_window_table - initStatusbar(); - - signal_size_allocate().connect (sigc::mem_fun (*this, &EditWidget::onWindowSizeAllocate), false); - signal_realize().connect (sigc::mem_fun (*this, &EditWidget::onWindowRealize)); - show_all_children(); -} - -void -EditWidget::onMenuItem() -{ - g_warning("onMenuItem called"); -} - -void -EditWidget::onActionFileNew() -{ -// g_warning("onActionFileNew called"); - sp_file_new_default(); -} - -void -EditWidget::onActionFileOpen() -{ -// g_warning("onActionFileOpen called"); - sp_file_open_dialog (*this, NULL, NULL); -} - -void -EditWidget::onActionFileQuit() -{ - g_warning("onActionFileQuit"); - sp_ui_close_all(); -} - -void -EditWidget::onActionFilePrint() -{ - g_warning("onActionFilePrint"); -} - -void -EditWidget::onToolbarItem() -{ - g_warning("onToolbarItem called"); -} - -void -EditWidget::onSelectTool() -{ - _tool_ctrl->remove(); - _tool_ctrl->add(*_select_ctrl); -} - -void -EditWidget::onNodeTool() -{ - _tool_ctrl->remove(); - _tool_ctrl->add(*_node_ctrl); -} - -void -EditWidget::onDialogInkscapePreferences() -{ - _dlg_mgr.showDialog("InkscapePreferences"); -} - -void -EditWidget::onDialogAbout() -{ -} - -void -EditWidget::onDialogAlignAndDistribute() -{ - _dlg_mgr.showDialog("AlignAndDistribute"); -} - -void -EditWidget::onDialogDocumentProperties() -{ -// manage (Inkscape::UI::Dialog::DocumentPreferences::create()); - _dlg_mgr.showDialog("DocumentPreferences"); -} - -void -EditWidget::onDialogExport() -{ - _dlg_mgr.showDialog("Export"); -} - -void -EditWidget::onDialogExtensionEditor() -{ - _dlg_mgr.showDialog("ExtensionEditor"); -} - -void -EditWidget::onDialogFillAndStroke() -{ - _dlg_mgr.showDialog("FillAndStroke"); -} - -void -EditWidget::onDialogFind() -{ - _dlg_mgr.showDialog("Find"); -} - -void -EditWidget::onDialogLayerEditor() -{ - _dlg_mgr.showDialog("LayerEditor"); -} - -void -EditWidget::onDialogMessages() -{ - _dlg_mgr.showDialog("Messages"); -} - -void -EditWidget::onDialogObjectProperties() -{ - _dlg_mgr.showDialog("ObjectProperties"); -} - -void -EditWidget::onDialogTextProperties() -{ - _dlg_mgr.showDialog("TextProperties"); -} - -void -EditWidget::onDialogTrace() -{ -} - -void -EditWidget::onDialogTransformation() -{ - _dlg_mgr.showDialog("Transformation"); -} - -void -EditWidget::onDialogXmlEditor() -{ - _dlg_mgr.showDialog("XmlEditor"); -} - -void -EditWidget::onUriChanged() -{ - g_message("onUriChanged called"); - -} - -// FIXME: strings are replaced by placeholders, NOT to be translated until the code is enabled -// See http://sourceforge.net/mailarchive/message.php?msg_id=11746016 for details - -void -EditWidget::initMenuActions() -{ -// This has no chance of working right now. -// Has to be converted to Gtk::Action::create_with_icon_name. - - _act_grp->add(Gtk::Action::create("MenuFile", "File")); - _act_grp->add(Gtk::Action::create("MenuEdit", "Edit")); - _act_grp->add(Gtk::Action::create("MenuView", "View")); - _act_grp->add(Gtk::Action::create("MenuLayer", "Layer")); - _act_grp->add(Gtk::Action::create("MenuObject", "Object")); - _act_grp->add(Gtk::Action::create("MenuPath", "Path")); - _act_grp->add(Gtk::Action::create("MenuText", "Text")); - _act_grp->add(Gtk::Action::create("MenuHelp", "Help")); - - // File menu - _act_grp->add(Gtk::Action::create("New", - Gtk::Stock::NEW, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileNew)); - - _act_grp->add(Gtk::Action::create("Open", - Gtk::Stock::OPEN, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); -/* - _act_grp->add(Gtk::Action::create("OpenRecent", - Stock::OPEN_RECENT));*/ - - _act_grp->add(Gtk::Action::create("Revert", - Gtk::Stock::REVERT_TO_SAVED, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); - - _act_grp->add(Gtk::Action::create("Save", - Gtk::Stock::SAVE, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); - - _act_grp->add(Gtk::Action::create("SaveAs", - Gtk::Stock::SAVE_AS, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); -/* - _act_grp->add(Gtk::Action::create("Import", - Stock::IMPORT, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); - - _act_grp->add(Gtk::Action::create("Export", - Stock::EXPORT, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogExport));*/ - - _act_grp->add(Gtk::Action::create("Print", - Gtk::Stock::PRINT, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onActionFilePrint)); - - _act_grp->add(Gtk::Action::create("PrintPreview", - Gtk::Stock::PRINT_PREVIEW), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); -/* - _act_grp->add(Gtk::Action::create("VacuumDefs", - Stock::VACUUM_DEFS), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen));*/ - - _act_grp->add(Gtk::Action::create("DocumentProperties", - Gtk::Stock::PROPERTIES, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogDocumentProperties)); - - _act_grp->add(Gtk::Action::create("InkscapePreferences", - Gtk::Stock::PREFERENCES, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogInkscapePreferences)); - - _act_grp->add(Gtk::Action::create("Close", - Gtk::Stock::CLOSE), - sigc::mem_fun(*this, &EditWidget::onActionFileOpen)); - - _act_grp->add(Gtk::Action::create("Quit", - Gtk::Stock::QUIT), - sigc::mem_fun(*this, &EditWidget::onActionFileQuit)); - - // EditWidget menu - _act_grp->add(Gtk::Action::create("Undo", - Gtk::Stock::UNDO, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Redo", - Gtk::Stock::REDO, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); -/* - _act_grp->add(Gtk::Action::create("UndoHistory", - Stock::UNDO_HISTORY, Glib::ustring(), - _("PLACEHOLDER, do not translate")));*/ - - _act_grp->add(Gtk::Action::create("Cut", - Gtk::Stock::CUT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Copy", - Gtk::Stock::COPY, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Paste", - Gtk::Stock::PASTE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); -/* - _act_grp->add(Gtk::Action::create("PasteInPlace", - Stock::PASTE_IN_PLACE)); - - _act_grp->add(Gtk::Action::create("PasteStyle", - Stock::PASTE_STYLE));*/ - - _act_grp->add(Gtk::Action::create("Find", - Gtk::Stock::FIND), - sigc::mem_fun(*this, &EditWidget::onDialogFind)); -/* - _act_grp->add(Gtk::Action::create("Duplicate", - Stock::DUPLICATE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Clone", - Stock::CLONE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("CloneUnlink", - Stock::CLONE_UNLINK, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("CloneSelectOrig", - Stock::CLONE_SELECT_ORIG)); - - _act_grp->add(Gtk::Action::create("MakeBitmap", - Stock::MAKE_BITMAP)); - - _act_grp->add(Gtk::Action::create("Tile", - Stock::TILE)); - - _act_grp->add(Gtk::Action::create("Untile", - Stock::UNTILE)); - - _act_grp->add(Gtk::Action::create("Delete", - Gtk::Stock::DELETE)); - - _act_grp->add(Gtk::Action::create("SelectAll", - Stock::SELECT_ALL)); - - _act_grp->add(Gtk::Action::create("SelectAllInAllLayers", - Stock::SELECT_ALL_IN_ALL_LAYERS)); - - _act_grp->add(Gtk::Action::create("SelectInvert", - Stock::SELECT_INVERT)); - - _act_grp->add(Gtk::Action::create("SelectNone", - Stock::SELECT_NONE)); - - _act_grp->add(Gtk::Action::create("XmlEditor", - Stock::XML_EDITOR, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogXmlEditor)); - - // View menu - _act_grp->add(Gtk::Action::create("Zoom", - Stock::ZOOM)); - - _act_grp->add(Gtk::Action::create("ZoomIn", - Stock::ZOOM_IN, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomOut", - Stock::ZOOM_OUT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Zoom100", - Stock::ZOOM_100, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Zoom50", - Stock::ZOOM_50, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Zoom200", - Stock::ZOOM_200, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomSelection", - Stock::ZOOM_SELECTION, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomDrawing", - Stock::ZOOM_DRAWING, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomPage", - Stock::ZOOM_PAGE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomWidth", - Stock::ZOOM_WIDTH, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomPrev", - Stock::ZOOM_PREV, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ZoomNext", - Stock::ZOOM_NEXT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("ShowHide", - Stock::SHOW_HIDE)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideCommandsBar", - Stock::SHOW_HIDE_COMMANDS_BAR)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideToolControlsBar", - Stock::SHOW_HIDE_TOOL_CONTROLS_BAR)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideToolsBar", - Stock::SHOW_HIDE_TOOLS_BAR)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideRulers", - Stock::SHOW_HIDE_RULERS)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideScrollbars", - Stock::SHOW_HIDE_SCROLLBARS)); - - _act_grp->add(Gtk::ToggleAction::create("ShowHideStatusbar", - Stock::SHOW_HIDE_STATUSBAR)); - - _act_grp->add(Gtk::Action::create("ShowHideDialogs", - Stock::SHOW_HIDE_DIALOGS)); - - _act_grp->add(Gtk::Action::create("Grid", - Stock::GRID)); - - _act_grp->add(Gtk::Action::create("Guides", - Stock::GUIDES)); - - _act_grp->add(Gtk::Action::create("Fullscreen", - Stock::FULLSCREEN)); - - _act_grp->add(Gtk::Action::create("Messages", - Stock::MESSAGES), - sigc::mem_fun(*this, &EditWidget::onDialogMessages)); - - _act_grp->add(Gtk::Action::create("Scripts", - Stock::SCRIPTS)); - - _act_grp->add(Gtk::Action::create("WindowPrev", - Stock::WINDOW_PREV)); - - _act_grp->add(Gtk::Action::create("WindowNext", - Stock::WINDOW_NEXT)); - - _act_grp->add(Gtk::Action::create("WindowDuplicate", - Stock::WINDOW_DUPLICATE)); - - // Layer menu - _act_grp->add(Gtk::Action::create("LayerNew", - Stock::LAYER_NEW)); - - _act_grp->add(Gtk::Action::create("LayerRename", - Stock::LAYER_RENAME)); - - _act_grp->add(Gtk::Action::create("LayerDuplicate", - Stock::LAYER_DUPLICATE)); - - _act_grp->add(Gtk::Action::create("LayerAnchor", - Stock::LAYER_ANCHOR)); - - _act_grp->add(Gtk::Action::create("LayerMergeDown", - Stock::LAYER_MERGE_DOWN)); - - _act_grp->add(Gtk::Action::create("LayerDelete", - Stock::LAYER_DELETE)); - - _act_grp->add(Gtk::Action::create("LayerSelectNext", - Stock::LAYER_SELECT_NEXT)); - - _act_grp->add(Gtk::Action::create("LayerSelectPrev", - Stock::LAYER_SELECT_PREV)); - - _act_grp->add(Gtk::Action::create("LayerSelectTop", - Stock::LAYER_SELECT_TOP)); - - _act_grp->add(Gtk::Action::create("LayerSelectBottom", - Stock::LAYER_SELECT_BOTTOM)); - - _act_grp->add(Gtk::Action::create("LayerRaise", - Stock::LAYER_RAISE)); - - _act_grp->add(Gtk::Action::create("LayerLower", - Stock::LAYER_LOWER)); - - _act_grp->add(Gtk::Action::create("LayerToTop", - Stock::LAYER_TO_TOP)); - - _act_grp->add(Gtk::Action::create("LayerToBottom", - Stock::LAYER_TO_BOTTOM)); - - // Object menu - _act_grp->add(Gtk::Action::create("FillAndStroke", - Stock::FILL_STROKE, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogFillAndStroke)); - - _act_grp->add(Gtk::Action::create("ObjectProperties", - Stock::OBJECT_PROPERTIES), - sigc::mem_fun(*this, &EditWidget::onDialogObjectProperties)); - - _act_grp->add(Gtk::Action::create("FilterEffects", - Stock::FILTER_EFFECTS)); - - _act_grp->add(Gtk::Action::create("Group", - Stock::GROUP, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Ungroup", - Stock::UNGROUP, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Raise", - Stock::RAISE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Lower", - Stock::LOWER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("RaiseToTop", - Stock::RAISE_TO_TOP, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("LowerToBottom", - Stock::LOWER_TO_BOTTOM, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("MoveToNewLayer", - Stock::MOVE_TO_NEW_LAYER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("MoveToNextLayer", - Stock::MOVE_TO_NEXT_LAYER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("MoveToPrevLayer", - Stock::MOVE_TO_PREV_LAYER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("MoveToTopLayer", - Stock::MOVE_TO_TOP_LAYER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("MoveToBottomLayer", - Stock::MOVE_TO_BOTTOM_LAYER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Rotate90CW", - Stock::ROTATE_90_CW, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Rotate90CCW", - Stock::ROTATE_90_CCW, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("FlipHoriz", - Stock::FLIP_HORIZ, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("FlipVert", - Stock::FLIP_VERT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Transformation", - Stock::TRANSFORMATION, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogTransformation)); - - _act_grp->add(Gtk::Action::create("AlignAndDistribute", - Stock::ALIGN_DISTRIBUTE, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogAlignAndDistribute)); - - // Path menu - _act_grp->add(Gtk::Action::create("ObjectToPath", - Stock::OBJECT_TO_PATH, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("StrokeToPath", - Stock::STROKE_TO_PATH, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("Trace", - Stock::TRACE), - sigc::mem_fun(*this, &EditWidget::onDialogTrace)); - - _act_grp->add(Gtk::Action::create("Union", - Stock::UNION)); - - _act_grp->add(Gtk::Action::create("Difference", - Stock::DIFFERENCE)); - - _act_grp->add(Gtk::Action::create("Intersection", - Stock::INTERSECTION)); - - _act_grp->add(Gtk::Action::create("Exclusion", - Stock::EXCLUSION)); - - _act_grp->add(Gtk::Action::create("Division", - Stock::DIVISION)); - - _act_grp->add(Gtk::Action::create("CutPath", - Stock::CUT_PATH)); - - _act_grp->add(Gtk::Action::create("Combine", - Stock::COMBINE)); - - _act_grp->add(Gtk::Action::create("BreakApart", - Stock::BREAK_APART)); - - _act_grp->add(Gtk::Action::create("Inset", - Stock::INSET)); - - _act_grp->add(Gtk::Action::create("Outset", - Stock::OUTSET)); - - _act_grp->add(Gtk::Action::create("OffsetDynamic", - Stock::OFFSET_DYNAMIC)); - - _act_grp->add(Gtk::Action::create("OffsetLinked", - Stock::OFFSET_LINKED)); - - _act_grp->add(Gtk::Action::create("Simplify", - Stock::SIMPLIFY)); - - _act_grp->add(Gtk::Action::create("Reverse", - Stock::REVERSE));*/ - - _act_grp->add(Gtk::Action::create("Cleanup", - Gtk::Stock::CLEAR, - _("PLACEHOLDER, do not translate"))); - - // Text menu - _act_grp->add(Gtk::Action::create("TextProperties", - Gtk::Stock::SELECT_FONT, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onDialogTextProperties)); -/* - _act_grp->add(Gtk::Action::create("PutOnPath", - Stock::PUT_ON_PATH)); - - _act_grp->add(Gtk::Action::create("RemoveFromPath", - Stock::REMOVE_FROM_PATH)); - - _act_grp->add(Gtk::Action::create("RemoveManualKerns", - Stock::REMOVE_MANUAL_KERNS));*/ - - // Whiteboard menu -#ifdef WITH_INKBOARD -#endif - - // About menu -/* - _act_grp->add(Gtk::Action::create("KeysAndMouse", - Stock::KEYS_MOUSE)); - - _act_grp->add(Gtk::Action::create("Tutorials", - Stock::TUTORIALS)); - - _act_grp->add(Gtk::Action::create("About", - Stock::ABOUT), - sigc::mem_fun(*this, &EditWidget::onDialogAbout));*/ -} - -void -EditWidget::initToolbarActions() -{ - // Tools bar - // This has zero chance to work, and has to be converted to create_with_icon_name - Gtk::RadioAction::Group tools; -/* - _act_grp->add(Gtk::RadioAction::create(tools, "ToolSelect", - Stock::TOOL_SELECT, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onSelectTool)); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolNode", - Stock::TOOL_NODE, Glib::ustring(), - _("PLACEHOLDER, do not translate")), - sigc::mem_fun(*this, &EditWidget::onNodeTool)); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolZoom", - Stock::TOOL_ZOOM, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolRect", - Stock::TOOL_RECT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolArc", - Stock::TOOL_ARC, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolStar", - Stock::TOOL_STAR, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolSpiral", - Stock::TOOL_SPIRAL, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolFreehand", - Stock::TOOL_FREEHAND, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolPen", - Stock::TOOL_PEN, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolDynaDraw", - Stock::TOOL_DYNADRAW, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolText", - Stock::TOOL_TEXT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::RadioAction::create(tools, "ToolDropper", - Stock::TOOL_DROPPER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - // Select Controls bar - _act_grp->add(Gtk::ToggleAction::create("TransformStroke", - Stock::TRANSFORM_STROKE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::ToggleAction::create("TransformCorners", - Stock::TRANSFORM_CORNERS, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::ToggleAction::create("TransformGradient", - Stock::TRANSFORM_GRADIENT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::ToggleAction::create("TransformPattern", - Stock::TRANSFORM_PATTERN, Glib::ustring(), - _("PLACEHOLDER, do not translate")));*/ - - // Node Controls bar - _act_grp->add(Gtk::Action::create("NodeInsert", - Gtk::Stock::ADD, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeDelete", - Gtk::Stock::REMOVE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); -/* - _act_grp->add(Gtk::Action::create("NodeJoin", - Stock::NODE_JOIN, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeJoinSegment", - Stock::NODE_JOIN_SEGMENT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeDeleteSegment", - Stock::NODE_DELETE_SEGMENT, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeBreak", - Stock::NODE_BREAK, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeCorner", - Stock::NODE_CORNER, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeSmooth", - Stock::NODE_SMOOTH, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeSymmetric", - Stock::NODE_SYMMETRIC, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeLine", - Stock::NODE_LINE, Glib::ustring(), - _("PLACEHOLDER, do not translate"))); - - _act_grp->add(Gtk::Action::create("NodeCurve", - Stock::NODE_CURVE, Glib::ustring(), - _("PLACEHOLDER, do not translate")));*/ -} - -void -EditWidget::initAccelMap() -{ - gchar *filename = g_build_filename(INKSCAPE_UIDIR, "keybindings.rc", NULL); - Gtk::AccelMap::load(filename); - g_free(filename); - - // One problem is that the keys 1-6 are zoom accelerators which get - // caught as accelerator _before_ any Entry input handler receives them, - // for example the zoom status. At the moment, the best way seems to - // disable them as accelerators when the Entry gets focus, and enable - // them when focus goes elsewhere. The code for this belongs here, - // and not in zoom-status.cpp . - - _zoom_status.signal_focus_in_event().connect (sigc::mem_fun (*this, &EditWidget::onEntryFocusIn)); - _zoom_status.signal_focus_out_event().connect (sigc::mem_fun (*this, &EditWidget::onEntryFocusOut)); -} - -bool -EditWidget::onEntryFocusIn (GdkEventFocus* /*ev*/) -{ - Gdk::ModifierType m = static_cast<Gdk::ModifierType>(0); - Gtk::AccelMap::change_entry ("<Actions>//Zoom100", 0, m, false); - Gtk::AccelMap::change_entry ("<Actions>//Zoom50", 0, m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomSelection", 0, m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomDrawing", 0, m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomPage", 0, m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomWidth", 0, m, false); - return false; -} - -bool -EditWidget::onEntryFocusOut (GdkEventFocus* /*ev*/) -{ - Gdk::ModifierType m = static_cast<Gdk::ModifierType>(0); - Gtk::AccelMap::change_entry ("<Actions>//Zoom100", '1', m, false); - Gtk::AccelMap::change_entry ("<Actions>//Zoom50", '2', m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomSelection", '3', m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomDrawing", '4', m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomPage", '5', m, false); - Gtk::AccelMap::change_entry ("<Actions>//ZoomWidth", '6', m, false); - return false; -} - -void -EditWidget::initMenuBar() -{ - g_assert(_ui_mgr); - Gtk::MenuBar *menu = static_cast<Gtk::MenuBar*>(_ui_mgr->get_widget("/MenuBar")); - g_assert(menu != NULL); - _main_window_table.attach(*Gtk::manage(menu), 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); -} - -void -EditWidget::initCommandsBar() -{ - g_assert(_ui_mgr); - Toolbox *bar = new Toolbox(static_cast<Gtk::Toolbar*>(_ui_mgr->get_widget("/CommandsBar")), - Gtk::TOOLBAR_ICONS); - g_assert(bar != NULL); - _toolbars_vbox.pack_start(*Gtk::manage(bar), Gtk::PACK_SHRINK); -} - -void -EditWidget::initToolControlsBar() -{ - // TODO: Do UIManager controlled widgets need to be deleted? - _select_ctrl = static_cast<Gtk::Toolbar*>(_ui_mgr->get_widget("/SelectControlsBar")); - _node_ctrl = static_cast<Gtk::Toolbar*>(_ui_mgr->get_widget("/NodeControlsBar")); - - _tool_ctrl = new Toolbox(_select_ctrl, Gtk::TOOLBAR_ICONS); - - _toolbars_vbox.pack_start(*Gtk::manage(_tool_ctrl), Gtk::PACK_SHRINK); -} - -void -EditWidget::initUriBar() -{ - /// \todo Create an Inkscape::UI::Widget::UriBar class (?) - - _uri_ctrl = new Gtk::Toolbar(); - - _uri_label.set_label(_("PLACEHOLDER, do not translate")); - _uri_ctrl->add(_uri_label); - _uri_ctrl->add(_uri_entry); - - _uri_entry.signal_activate() - .connect_notify(sigc::mem_fun(*this, &EditWidget::onUriChanged)); - - _toolbars_vbox.pack_start(*Gtk::manage(_uri_ctrl), Gtk::PACK_SHRINK); -} - -void -EditWidget::initToolsBar() -{ - Toolbox *bar = new Toolbox(static_cast<Gtk::Toolbar*>(_ui_mgr->get_widget("/ToolsBar")), - Gtk::TOOLBAR_ICONS, - Gtk::ORIENTATION_VERTICAL); - g_assert(bar != NULL); - _sub_window_hbox.pack_start(*Gtk::manage(bar), Gtk::PACK_SHRINK); -} - -void -EditWidget::initTopRuler() -{ - _viewport_table.attach(_top_ruler, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); - - _tooltips.set_tip (_top_ruler, _top_ruler.get_tip()); -} - -void -EditWidget::initLeftRuler() -{ - _viewport_table.attach(_left_ruler, 0, 1, 1, 2, Gtk::SHRINK, Gtk::FILL|Gtk::EXPAND); - - _tooltips.set_tip (_left_ruler, _left_ruler.get_tip()); -} - -void -EditWidget::initBottomScrollbar() -{ - _viewport_table.attach(_bottom_scrollbar, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); - _bottom_scrollbar.signal_value_changed().connect (sigc::mem_fun (*this, &EditWidget::onAdjValueChanged)); - _bottom_scrollbar.property_adjustment() = new Gtk::Adjustment (0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0); -} - -void -EditWidget::initRightScrollbar() -{ - _viewport_table.attach(_right_scrollbar, 2, 3, 1, 2, Gtk::SHRINK, Gtk::FILL|Gtk::EXPAND); - - _right_scrollbar.signal_value_changed().connect (sigc::mem_fun (*this, &EditWidget::onAdjValueChanged)); - _right_scrollbar.property_adjustment() = new Gtk::Adjustment (0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0); -} - -void -EditWidget::initStickyZoom() -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - _viewport_table.attach(_sticky_zoom, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); - _sticky_zoom.set_active (prefs->getBool("/options/stickyzoom/value")); - _tooltips.set_tip (_sticky_zoom, _("Zoom drawing if window size changes")); - - /// \todo icon not implemented -} - -void -EditWidget::initStatusbar() -{ - _statusbar.pack_start (_selected_style_status, false, false, 1); - _statusbar.pack_start (*new Gtk::VSeparator(), false, false, 0); - - _tooltips.set_tip (_zoom_status, _("Zoom")); - - _layer_selector.reference(); - _statusbar.pack_start (_layer_selector, false, false, 1); - - _coord_status.property_n_rows() = 2; - _coord_status.property_n_columns() = 5; - _coord_status.property_row_spacing() = 0; - _coord_status.property_column_spacing() = 2; - _coord_eventbox.add (_coord_status); - _tooltips.set_tip (_coord_eventbox, _("Cursor coordinates")); - _coord_status.attach (*new Gtk::VSeparator(), 0,1, 0,2, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status.attach (*new Gtk::Label(_("X:"), 0.0, 0.5), 1,2, 0,1, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status.attach (*new Gtk::Label(_("Y:"), 0.0, 0.5), 1,2, 1,2, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status_x.set_text ("0.0"); - _coord_status_x.set_alignment (0.0, 0.5); - _coord_status_y.set_text ("0.0"); - _coord_status_y.set_alignment (0.0, 0.5); - _coord_status.attach (_coord_status_x, 2,3, 0,1, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status.attach (_coord_status_y, 2,3, 1,2, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status.attach (*new Gtk::Label(_("Z:"), 0.0, 0.5), 3,4, 0,2, Gtk::FILL,Gtk::FILL, 0,0); - _coord_status.attach (_zoom_status, 4,5, 0,2, Gtk::FILL,Gtk::FILL, 0,0); - sp_set_font_size_smaller (static_cast<GtkWidget*>((void*)_coord_status.gobj())); - _statusbar.pack_end (_coord_eventbox, false, false, 1); - - _select_status.property_xalign() = 0.0; - _select_status.property_yalign() = 0.5; - _select_status.set_markup (_("<b>Welcome to Inkscape!</b> Use shape or drawing tools to create objects; use selector (arrow) to move or transform them.")); - // include this again with Gtk+-2.6 -#if GTK_VERSION_GE(2,6) - gtk_label_set_ellipsize (GTK_LABEL(_select_status.gobj()), PANGO_ELLIPSIZE_END); -#endif - _select_status.set_size_request (1, -1); - _statusbar.pack_start (_select_status, true, true, 0); - - _main_window_table.attach(_statusbar, 0, 1, 3, 4, Gtk::FILL, Gtk::SHRINK); -} - -//======================================== -//----------implements EditWidgetInterface - -Gtk::Window * -EditWidget::getWindow() -{ - return this; -} - -void -EditWidget::setTitle (gchar const* new_title) -{ - set_title (new_title); -} - -void -EditWidget::layout() -{ - show_all_children(); -} - -void -EditWidget::present() -{ - this->Gtk::Window::present(); -} - -void -EditWidget::getGeometry (gint &x, gint &y, gint &w, gint &h) -{ - get_position (x, y); - get_size (w, h); -} - -void -EditWidget::setSize (gint w, gint h) -{ - resize (w, h); -} - -void -EditWidget::setPosition (Geom::Point p) -{ - move (int(p[Geom::X]), int(p[Geom::Y])); -} - -/// \param p is already gobj()! -void -EditWidget::setTransient (void* p, int i) -{ - gtk_window_set_transient_for (static_cast<GtkWindow*>(p), this->gobj()); - if (i==2) - this->Gtk::Window::present(); -} - -Geom::Point -EditWidget::getPointer() -{ - int x, y; - get_pointer (x, y); - return Geom::Point (x, y); -} - -void -EditWidget::setIconified() -{ - iconify(); -} - -void -EditWidget::setMaximized() -{ - maximize(); -} - -void -EditWidget::setFullscreen() -{ - fullscreen(); -} - -/** - * Shuts down the desktop object for the view being closed. It checks - * to see if the document has been edited, and if so prompts the user - * to save, discard, or cancel. Returns TRUE if the shutdown operation - * is cancelled or if the save is cancelled or fails, FALSE otherwise. - */ -bool -EditWidget::shutdown() -{ - g_assert (_desktop != NULL); - if (Inkscape::NSApplication::Editor::isDuplicatedView (_desktop)) - return false; - - SPDocument *doc = _desktop->doc(); - if (doc->isModifiedSinceSave()) { - gchar *markup; - /// \todo FIXME !!! obviously this will have problems if the document - /// name contains markup characters - markup = g_strdup_printf( - _("<span weight=\"bold\" size=\"larger\">Save changes to document \"%s\" before closing?</span>\n\n" - "If you close without saving, your changes will be discarded."), - SP_DOCUMENT_NAME(doc)); - - Gtk::MessageDialog dlg (*this, - markup, - true, - Gtk::MESSAGE_WARNING, - Gtk::BUTTONS_NONE, - true); - g_free(markup); - Gtk::Button close_button (_("Close _without saving"), true); - dlg.add_action_widget (close_button, Gtk::RESPONSE_NO); - close_button.show(); - dlg.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dlg.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_YES); - dlg.set_default_response (Gtk::RESPONSE_YES); - - int response = dlg.run(); - switch (response) - { - case Gtk::RESPONSE_YES: - sp_document_ref(doc); - sp_namedview_document_from_window(_desktop); - if (sp_file_save_document(*this, doc)) { - sp_document_unref(doc); - } else { // save dialog cancelled or save failed - sp_document_unref(doc); - return TRUE; - } - break; - case Gtk::RESPONSE_NO: - break; - default: // cancel pressed, or dialog was closed - return TRUE; - break; - } - } - - /* Code to check data loss */ - bool allow_data_loss = FALSE; - while (sp_document_repr_root(doc)->attribute("inkscape:dataloss") != NULL && allow_data_loss == FALSE) - { - gchar *markup; - /// \todo FIXME !!! obviously this will have problems if the document - /// name contains markup characters - markup = g_strdup_printf( - _("<span weight=\"bold\" size=\"larger\">The file \"%s\" was saved with a format (%s) that may cause data loss!</span>\n\n" - "Do you want to save this file as an Inkscape SVG?"), - SP_DOCUMENT_NAME(doc), - SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE); - - Gtk::MessageDialog dlg (*this, - markup, - true, - Gtk::MESSAGE_WARNING, - Gtk::BUTTONS_NONE, - true); - g_free(markup); - Gtk::Button close_button (_("Close _without saving"), true); - dlg.add_action_widget (close_button, Gtk::RESPONSE_NO); - close_button.show(); - Gtk::Button save_button (_("_Save as SVG"), true); - dlg.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dlg.add_action_widget (save_button, Gtk::RESPONSE_YES); - save_button.show(); - dlg.set_default_response (Gtk::RESPONSE_YES); - - int response = dlg.run(); - - switch (response) - { - case Gtk::RESPONSE_YES: - sp_document_ref(doc); - if (sp_file_save_document(*this, doc)) { - sp_document_unref(doc); - } else { // save dialog cancelled or save failed - sp_document_unref(doc); - return TRUE; - } - break; - case Gtk::RESPONSE_NO: - allow_data_loss = TRUE; - break; - default: // cancel pressed, or dialog was closed - return TRUE; - break; - } - } - - return false; -} - - -void -EditWidget::destroy() -{ - delete this; -} - -void -EditWidget::requestCanvasUpdate() -{ - _svg_canvas.widget().queue_draw(); -} - -void -EditWidget::requestCanvasUpdateAndWait() -{ - requestCanvasUpdate(); - - while (gtk_events_pending()) - gtk_main_iteration_do(FALSE); -} - -void -EditWidget::enableInteraction() -{ - g_return_if_fail(_interaction_disabled_counter > 0); - - _interaction_disabled_counter--; - - if (_interaction_disabled_counter == 0) { - this->set_sensitive(true); - } -} - -void -EditWidget::disableInteraction() -{ - if (_interaction_disabled_counter == 0) { - this->set_sensitive(false); - } - - _interaction_disabled_counter++; -} - -void -EditWidget::activateDesktop() -{ - /// \todo active_desktop_indicator not implemented -} - -void -EditWidget::deactivateDesktop() -{ - /// \todo active_desktop_indicator not implemented -} - -void -EditWidget::viewSetPosition (Geom::Point p) -{ - // p -= _namedview->gridorigin; - /// \todo Why was the origin corrected for the grid origin? (johan) - - double lo, up, pos, max; - _top_ruler.get_range (lo, up, pos, max); - _top_ruler.set_range (lo, up, p[Geom::X], max); - _left_ruler.get_range (lo, up, pos, max); - _left_ruler.set_range (lo, up, p[Geom::Y], max); -} - -void -EditWidget::updateRulers() -{ - //Geom::Point gridorigin = _namedview->gridorigin; - /// \todo Why was the origin corrected for the grid origin? (johan) - - Geom::Rect const viewbox = _svg_canvas.spobj()->getViewbox(); - double lo, up, pos, max; - double const scale = _desktop->current_zoom(); - double s = viewbox.min()[Geom::X] / scale; //- gridorigin[Geom::X]; - double e = viewbox.max()[Geom::X] / scale; //- gridorigin[Geom::X]; - _top_ruler.get_range(lo, up, pos, max); - _top_ruler.set_range(s, e, pos, e); - s = viewbox.min()[Geom::Y] / -scale; //- gridorigin[Geom::Y]; - e = viewbox.max()[Geom::Y] / -scale; //- gridorigin[Geom::Y]; - _left_ruler.set_range(s, e, 0 /*gridorigin[Geom::Y]*/, e); - /// \todo is that correct? -} - -void -EditWidget::updateScrollbars (double scale) -{ - // do not call this function before canvas has its size allocated - if (!is_realized() || _update_s_f) { - return; - } - - _update_s_f = true; - - /* The desktop region we always show unconditionally */ - SPDocument *doc = _desktop->doc(); - Geom::Rect darea ( Geom::Point(-sp_document_width(doc), -sp_document_height(doc)), - Geom::Point(2 * sp_document_width(doc), 2 * sp_document_height(doc)) ); - SPObject* root = doc->root; - SPItem* item = SP_ITEM(root); - Geom::OptRect deskarea = Geom::unify(darea, sp_item_bbox_desktop(item)); - - /* Canvas region we always show unconditionally */ - Geom::Rect carea( Geom::Point(deskarea->min()[Geom::X] * scale - 64, deskarea->max()[Geom::Y] * -scale - 64), - Geom::Point(deskarea->max()[Geom::X] * scale + 64, deskarea->min()[Geom::Y] * -scale + 64) ); - - Geom::Rect const viewbox = _svg_canvas.spobj()->getViewbox(); - - /* Viewbox is always included into scrollable region */ - carea = Geom::unify(carea, viewbox); - - Gtk::Adjustment *adj = _bottom_scrollbar.get_adjustment(); - adj->set_value(viewbox.min()[Geom::X]); - adj->set_lower(carea.min()[Geom::X]); - adj->set_upper(carea.max()[Geom::X]); - adj->set_page_increment(viewbox.dimensions()[Geom::X]); - adj->set_step_increment(0.1 * (viewbox.dimensions()[Geom::X])); - adj->set_page_size(viewbox.dimensions()[Geom::X]); - - adj = _right_scrollbar.get_adjustment(); - adj->set_value(viewbox.min()[Geom::Y]); - adj->set_lower(carea.min()[Geom::Y]); - adj->set_upper(carea.max()[Geom::Y]); - adj->set_page_increment(viewbox.dimensions()[Geom::Y]); - adj->set_step_increment(0.1 * viewbox.dimensions()[Geom::Y]); - adj->set_page_size(viewbox.dimensions()[Geom::Y]); - - _update_s_f = false; -} - -void -EditWidget::toggleRulers() -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (_top_ruler.is_visible()) - { - _top_ruler.hide_all(); - _left_ruler.hide_all(); - prefs->setBool(_desktop->is_fullscreen() ? "/fullscreen/rulers/state" : "/window/rulers/state", false); - } else { - _top_ruler.show_all(); - _left_ruler.show_all(); - prefs->setBool(_desktop->is_fullscreen() ? "/fullscreen/rulers/state" : "/window/rulers/state", true); - } -} - -void -EditWidget::toggleScrollbars() -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (_bottom_scrollbar.is_visible()) - { - _bottom_scrollbar.hide_all(); - _right_scrollbar.hide_all(); - prefs->setBool(_desktop->is_fullscreen() ? "/fullscreen/scrollbars/state" : "/window/scrollbars/state", false); - } else { - _bottom_scrollbar.show_all(); - _right_scrollbar.show_all(); - prefs->setBool(_desktop->is_fullscreen() ? "/fullscreen/scrollbars/state" : "/window/scrollbars/state", true); - } -} - -void EditWidget::toggleColorProfAdjust() -{ - // TODO implement -} - -void -EditWidget::updateZoom() -{ - _zoom_status.update(); -} - -void -EditWidget::letZoomGrabFocus() -{ - _zoom_status.grab_focus(); -} - -void -EditWidget::setToolboxFocusTo (const gchar *) -{ - /// \todo not implemented -} - -void -EditWidget::setToolboxAdjustmentValue (const gchar *, double) -{ - /// \todo not implemented -} - -void -EditWidget::setToolboxSelectOneValue (const gchar *, gint) -{ - /// \todo not implemented -} - -bool -EditWidget::isToolboxButtonActive (gchar const*) -{ - /// \todo not implemented - return true; -} - -void -EditWidget::setCoordinateStatus (Geom::Point p) -{ - gchar *cstr = g_strdup_printf ("%6.2f", _dt2r * p[Geom::X]); - _coord_status_x.property_label() = cstr; - g_free (cstr); - cstr = g_strdup_printf ("%6.2f", _dt2r * p[Geom::Y]); - _coord_status_y.property_label() = cstr; - g_free (cstr); -} - -void -EditWidget::setMessage (Inkscape::MessageType /*type*/, gchar const* msg) -{ - _select_status.set_markup (msg? msg : ""); -} - -bool -EditWidget::warnDialog (gchar* msg) -{ - Gtk::MessageDialog dlg (*this, - msg, - true, - Gtk::MESSAGE_WARNING, - Gtk::BUTTONS_YES_NO, - true); - int r = dlg.run(); - return r == Gtk::RESPONSE_YES; -} - - -Inkscape::UI::Widget::Dock* -EditWidget::getDock () -{ - return &_dock; -} - -void EditWidget::_namedview_modified (SPObject *obj, guint flags) { - SPNamedView *nv = static_cast<SPNamedView *>(obj); - if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->_dt2r = 1.0 / nv->doc_units->unittobase; - this->_top_ruler.update_metric(); - this->_left_ruler.update_metric(); - this->_tooltips.set_tip(this->_top_ruler, this->_top_ruler.get_tip()); - this->_tooltips.set_tip(this->_left_ruler, this->_left_ruler.get_tip()); - this->updateRulers(); - } -} - -void -EditWidget::initEdit (SPDocument *doc) -{ - _desktop = new SPDesktop(); - - _namedview = sp_document_namedview (doc, 0); - _svg_canvas.init (_desktop); - _desktop->init (_namedview, _svg_canvas.spobj(), this); - sp_namedview_window_from_document (_desktop); - sp_namedview_update_layers_from_document (_desktop); - _dt2r = 1.0 / _namedview->doc_units->unittobase; - - /// \todo convert to sigc++ when SPObject hierarchy gets converted - /* Listen on namedview modification */ - _namedview_modified_connection = _desktop->namedview->connectModified(sigc::mem_fun(*this, &EditWidget::_namedview_modified)); - _layer_selector.setDesktop (_desktop); - _selected_style_status.setDesktop (_desktop); - - Inkscape::NSApplication::Editor::addDesktop (_desktop); - - _zoom_status.init (_desktop); - _top_ruler.init (_desktop, _svg_canvas.widget()); - _left_ruler.init (_desktop, _svg_canvas.widget()); - updateRulers(); -} - -void -EditWidget::destroyEdit() -{ - if (_desktop) { - _layer_selector.unreference(); - Inkscape::NSApplication::Editor::removeDesktop (_desktop); // clears selection too - _namedview_modified_connection.disconnect(); - _desktop->destroy(); - Inkscape::GC::release (_desktop); - _desktop = 0; - } -} - -//----------end of EditWidgetInterface implementation - -//----------start of other callbacks - -bool -EditWidget::on_key_press_event (GdkEventKey* event) -{ - // this is the original code from helper/window.cpp - - unsigned int shortcut; - shortcut = get_group0_keyval (event) | - ( event->state & GDK_SHIFT_MASK ? - SP_SHORTCUT_SHIFT_MASK : 0 ) | - ( event->state & GDK_CONTROL_MASK ? - SP_SHORTCUT_CONTROL_MASK : 0 ) | - ( event->state & GDK_MOD1_MASK ? - SP_SHORTCUT_ALT_MASK : 0 ); - return sp_shortcut_invoke (shortcut, - Inkscape::NSApplication::Editor::getActiveDesktop()); -} - -bool -EditWidget::on_delete_event (GdkEventAny*) -{ - return shutdown(); -} - -bool -EditWidget::on_focus_in_event (GdkEventFocus*) -{ - Inkscape::NSApplication::Editor::activateDesktop (_desktop); - _svg_canvas.widget().grab_focus(); - - return false; -} - -void -EditWidget::onWindowSizeAllocate (Gtk::Allocation &newall) -{ - if (!is_realized()) return; - - const Gtk::Allocation& all = get_allocation(); - if ((newall.get_x() == all.get_x()) && - (newall.get_y() == all.get_y()) && - (newall.get_width() == all.get_width()) && - (newall.get_height() == all.get_height())) { - return; - } - - Geom::Rect const area = _desktop->get_display_area(); - double zoom = _desktop->current_zoom(); - - if (_sticky_zoom.get_active()) { - /* Calculate zoom per pixel */ - double const zpsp = zoom / hypot(area.dimensions()[Geom::X], area.dimensions()[Geom::Y]); - /* Find new visible area */ - Geom::Rect const newarea = _desktop->get_display_area(); - /* Calculate adjusted zoom */ - zoom = zpsp * hypot(newarea.dimensions()[Geom::X], newarea.dimensions()[Geom::Y]); - } - - _desktop->zoom_absolute(area.midpoint()[Geom::X], area.midpoint()[Geom::Y], zoom); -} - -void -EditWidget::onWindowRealize() -{ - - if ( (sp_document_width(_desktop->doc()) < 1.0) || (sp_document_height(_desktop->doc()) < 1.0) ) { - return; - } - - Geom::Rect d( Geom::Point(0, 0), - Geom::Point(sp_document_width(_desktop->doc()), sp_document_height(_desktop->doc())) ); - - _desktop->set_display_area(d.min()[Geom::X], d.min()[Geom::Y], d.max()[Geom::X], d.max()[Geom::Y], 10); - _namedview_modified(_desktop->namedview, SP_OBJECT_MODIFIED_FLAG); - setTitle (SP_DOCUMENT_NAME(_desktop->doc())); -} - -void -EditWidget::onAdjValueChanged() -{ - if (_update_a_f) return; - _update_a_f = true; - - sp_canvas_scroll_to (_svg_canvas.spobj(), - _bottom_scrollbar.get_value(), - _right_scrollbar.get_value(), - false); - updateRulers(); - - _update_a_f = false; -} - - -} // namespace View -} // namespace UI -} // namespace Inkscape - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h deleted file mode 100644 index 2bb708305..000000000 --- a/src/ui/view/edit-widget.h +++ /dev/null @@ -1,227 +0,0 @@ -/** - * \brief This class implements the functionality of the window layout, menus, - * and signals. - * - * Authors: - * Bryce W. Harrington <bryce@bryceharrington.org> - * Derek P. Moore <derekm@hackunix.org> - * Ralf Stephan <ralf@ark.in-berlin.de> - * John Bintz <jcoswell@coswellproductions.org> - * - * Copyright (C) 2006 John Bintz - * Copyright (C) 2004 Bryce Harrington - * - * Released under GNU GPL. Read the file 'COPYING' for more information. - */ - -#ifndef INKSCAPE_UI_VIEW_EDIT_WIDGET_H -#define INKSCAPE_UI_VIEW_EDIT_WIDGET_H - -#include <gtkmm/box.h> -#include <gtkmm/table.h> -#include <gtkmm/entry.h> -#include <gtkmm/scrollbar.h> -#include <gtkmm/actiongroup.h> -#include <gtkmm/uimanager.h> -#include <gtkmm/togglebutton.h> - -#include "ui/dialog/dialog-manager.h" -#include "ui/view/edit-widget-interface.h" -#include "ui/widget/dock.h" -#include "ui/widget/layer-selector.h" -#include "ui/widget/ruler.h" -#include "ui/widget/selected-style.h" -#include "ui/widget/svg-canvas.h" -#include "ui/widget/toolbox.h" -#include "ui/widget/zoom-status.h" - -struct SPDesktop; -struct SPDocument; -struct SPNamedView; - -namespace Inkscape { -namespace UI { -namespace View { - -class EditWidget : public Gtk::Window, - public EditWidgetInterface { -public: - EditWidget (SPDocument*); - ~EditWidget(); - - // Initialization - void initActions(); - void initUIManager(); - void initLayout(); - void initEdit (SPDocument*); - void destroyEdit(); - - // Actions - void onActionFileNew(); - void onActionFileOpen(); - void onActionFilePrint(); - void onActionFileQuit(); - void onToolbarItem(); - void onSelectTool(); - void onNodeTool(); - - // Menus - void onMenuItem(); - - void onDialogAbout(); - void onDialogAlignAndDistribute(); - void onDialogInkscapePreferences(); - void onDialogDialog(); - void onDialogDocumentProperties(); - void onDialogExport(); - void onDialogExtensionEditor(); - void onDialogFillAndStroke(); - void onDialogFind(); - void onDialogLayerEditor(); - void onDialogMessages(); - void onDialogObjectProperties(); - void onDialogTextProperties(); - void onDialogTransform(); - void onDialogTransformation(); - void onDialogTrace(); - void onDialogXmlEditor(); - - // Whiteboard (Inkboard) -#ifdef WITH_INKBOARD - void onDialogWhiteboardConnect(); - void onDialogWhiteboardShareWithUser(); - void onDialogWhiteboardShareWithChat(); - void onDialogOpenSessionFile(); - void onDumpXMLTracker(); -#endif - - void onUriChanged(); - - // from EditWidgetInterface - virtual Gtk::Window* getWindow(); - virtual void setTitle (gchar const*); - virtual void layout(); - virtual void present(); - virtual void getGeometry (gint &x, gint &y, gint &w, gint &h); - virtual void setSize (gint w, gint h); - virtual void setPosition (Geom::Point p); - virtual void setTransient (void*, int); - virtual Geom::Point getPointer(); - virtual void setIconified(); - virtual void setMaximized(); - virtual void setFullscreen(); - virtual bool shutdown(); - virtual void destroy(); - virtual void requestCanvasUpdate(); - virtual void requestCanvasUpdateAndWait(); - virtual void enableInteraction(); - virtual void disableInteraction(); - virtual void activateDesktop(); - virtual void deactivateDesktop(); - virtual void viewSetPosition (Geom::Point p); - virtual void updateRulers(); - virtual void updateScrollbars (double scale); - virtual void toggleRulers(); - virtual void toggleScrollbars(); - virtual void toggleColorProfAdjust(); - virtual void updateZoom(); - virtual void letZoomGrabFocus(); - virtual void setToolboxFocusTo (const gchar *); - virtual void setToolboxAdjustmentValue (const gchar *, double); - virtual void setToolboxSelectOneValue (const gchar *, gint); - virtual bool isToolboxButtonActive (gchar const*); - virtual void setCoordinateStatus (Geom::Point p); - virtual void setMessage (Inkscape::MessageType type, gchar const* msg); - virtual bool warnDialog (gchar*); - - virtual Inkscape::UI::Widget::Dock* getDock (); - -protected: - void _namedview_modified(SPObject *namedview, guint); - - Gtk::Tooltips _tooltips; - - // Child widgets: - Gtk::Table _main_window_table; - Gtk::VBox _toolbars_vbox; - Gtk::HBox _sub_window_hbox; - Gtk::Table _viewport_table; - - UI::Widget::Toolbox *_tool_ctrl; - Gtk::Toolbar *_select_ctrl; - Gtk::Toolbar *_uri_ctrl; - Gtk::Label _uri_label; - Gtk::Entry _uri_entry; - Gtk::Toolbar *_node_ctrl; - - UI::Widget::HRuler _top_ruler; - UI::Widget::VRuler _left_ruler; - Gtk::HScrollbar _bottom_scrollbar; - Gtk::VScrollbar _right_scrollbar; - Gtk::ToggleButton _sticky_zoom; - UI::Widget::SVGCanvas _svg_canvas; - Gtk::HBox _statusbar; - UI::Widget::Dock _dock; - UI::Widget::SelectedStyle _selected_style_status; - UI::Widget::ZoomStatus _zoom_status; - Inkscape::Widgets::LayerSelector _layer_selector; - Gtk::EventBox _coord_eventbox; - Gtk::Table _coord_status; - Gtk::Label _coord_status_x, _coord_status_y; - Gtk::Label _select_status; - - SPDesktop* _desktop; - SPNamedView* _namedview; - double _dt2r; - - Glib::RefPtr<Gtk::ActionGroup> _act_grp; - Glib::RefPtr<Gtk::UIManager> _ui_mgr; - UI::Dialog::DialogManager _dlg_mgr; - - void initMenuActions(); - void initToolbarActions(); - void initAccelMap(); - void initMenuBar(); - void initCommandsBar(); - void initToolControlsBar(); - void initUriBar(); - void initToolsBar(); - void initBottomScrollbar(); - void initRightScrollbar(); - void initLeftRuler(); - void initTopRuler(); - void initStickyZoom(); - void initStatusbar(); - - virtual bool on_key_press_event (GdkEventKey*); - virtual bool on_delete_event (GdkEventAny*); - virtual bool on_focus_in_event (GdkEventFocus*); - -private: - bool onEntryFocusIn (GdkEventFocus*); - bool onEntryFocusOut (GdkEventFocus*); - void onWindowSizeAllocate (Gtk::Allocation&); - void onWindowRealize(); - void onAdjValueChanged(); - - bool _update_s_f, _update_a_f; - unsigned int _interaction_disabled_counter; - - sigc::connection _namedview_modified_connection; -}; -} // namespace View -} // namespace UI -} // namespace Inkscape - -#endif // INKSCAPE_UI_VIEW_EDIT_WIDGET_H - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/ui/view/edit.cpp b/src/ui/view/edit.cpp deleted file mode 100644 index 87bbc241c..000000000 --- a/src/ui/view/edit.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/** - * \brief Empty file left in repo for current desktop.cpp - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - - -namespace Inkscape { -namespace UI { -namespace View { - - -} // namespace View -} // namespace UI -} // namespace Inkscape - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/ui/view/edit.h b/src/ui/view/edit.h deleted file mode 100644 index 76c2b5942..000000000 --- a/src/ui/view/edit.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * \brief empty file left in repo for current desktop.h - */ - -#ifndef INKSCAPE_UI_VIEW_EDIT_H -#define INKSCAPE_UI_VIEW_EDIT_H - -namespace Inkscape { -namespace UI { -namespace View { - -} // namespace View -} // namespace UI -} // namespace Inkscape - -#endif // INKSCAPE_UI_VIEW_EDIT_H - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/attr-widget.h b/src/ui/widget/attr-widget.h index 8abe6b1ba..b9924a2ef 100644 --- a/src/ui/widget/attr-widget.h +++ b/src/ui/widget/attr-widget.h @@ -179,4 +179,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index 34cf1d5e3..b7a67b744 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -156,4 +156,4 @@ sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h index 477aa1c19..2c246aaa3 100644 --- a/src/ui/widget/color-picker.h +++ b/src/ui/widget/color-picker.h @@ -86,4 +86,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/combo-enums.h b/src/ui/widget/combo-enums.h index 4f70c9d28..d9044daa6 100644 --- a/src/ui/widget/combo-enums.h +++ b/src/ui/widget/combo-enums.h @@ -208,4 +208,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index b48d43076..026eac8e0 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -508,4 +508,4 @@ DockItem::_signal_drag_end_callback(GtkWidget *self, gboolean cancelled, void *d fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h index c0f52a77a..79d69d862 100644 --- a/src/ui/widget/dock-item.h +++ b/src/ui/widget/dock-item.h @@ -160,4 +160,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp index 3608c3551..02e1f2b41 100644 --- a/src/ui/widget/dock.cpp +++ b/src/ui/widget/dock.cpp @@ -294,4 +294,4 @@ Dock::_signal_layout_changed_proxy = fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h index c49d71268..5836cf83f 100644 --- a/src/ui/widget/dock.h +++ b/src/ui/widget/dock.h @@ -99,5 +99,5 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index e9f09f574..968e35b6c 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -56,7 +56,7 @@ EntityEntry::create (rdf_work_entity_t* ent, Gtk::Tooltips& tt, Registry& wr) } EntityEntry::EntityEntry (rdf_work_entity_t* ent, Gtk::Tooltips& tt, Registry& wr) -: _label(Glib::ustring(_(ent->title))+":", 1.0, 0.5), _packable(0), +: _label(Glib::ustring(_(ent->title)), 1.0, 0.5), _packable(0), _entity(ent), _tt(&tt), _wr(&wr) { } diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 9aaa64220..309730600 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -23,7 +23,7 @@ namespace Widget { SimpleFilterModifier::SimpleFilterModifier(int flags) : _lb_blend(_("_Blend mode:")), - _lb_blur(_("B_lur:"), Gtk::ALIGN_LEFT), + _lb_blur(_("Blur:"), Gtk::ALIGN_LEFT), _blend(BlendModeConverter, SP_ATTR_INVALID, false), _blur(0, 0, 100, 1, 0.01, 1) { @@ -106,4 +106,4 @@ void SimpleFilterModifier::set_blur_sensitive(const bool s) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index 7f2a980c3..e91d786cd 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -76,4 +76,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp index 961cce5b5..073e071af 100644 --- a/src/ui/widget/imagetoggler.cpp +++ b/src/ui/widget/imagetoggler.cpp @@ -103,6 +103,6 @@ ImageToggler::activate_vfunc(GdkEvent* event, fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/imagetoggler.h b/src/ui/widget/imagetoggler.h index 229d153a8..54446230e 100644 --- a/src/ui/widget/imagetoggler.h +++ b/src/ui/widget/imagetoggler.h @@ -83,4 +83,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp index 72c4f6785..c55b57616 100644 --- a/src/ui/widget/labelled.cpp +++ b/src/ui/widget/labelled.cpp @@ -99,4 +99,4 @@ Labelled::getLabel() const fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h index 5670af0b6..a8b00ebb6 100644 --- a/src/ui/widget/labelled.h +++ b/src/ui/widget/labelled.h @@ -64,4 +64,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp index f25192b2a..5fb8089b4 100644 --- a/src/ui/widget/layer-selector.cpp +++ b/src/ui/widget/layer-selector.cpp @@ -608,4 +608,4 @@ void LayerSelector::_hideLayer(bool hide) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/layer-selector.h b/src/ui/widget/layer-selector.h index 0b5300272..8bfa52ad7 100644 --- a/src/ui/widget/layer-selector.h +++ b/src/ui/widget/layer-selector.h @@ -107,4 +107,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index bfc291bc0..a9b4fe83e 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -59,7 +59,7 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co _opacity_tag(Glib::ustring(history_prefix) + ":opacity"), _opacity_vbox(false, 0), _opacity_label_box(false, 0), - _opacity_label(_("Opacity, %"), 0.0, 1.0, true), + _opacity_label(_("Opacity (%):"), 0.0, 1.0, true), _opacity_adjustment(100.0, 0.0, 100.0, 1.0, 1.0, 0.0), _opacity_hscale(_opacity_adjustment), _opacity_spin_button(_opacity_adjustment, 0.01, 1), @@ -305,4 +305,4 @@ ObjectCompositeSettings::_subjectChanged() { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index f778c3ac0..76538d6a7 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -83,4 +83,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 26763cc77..724848ca5 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -297,6 +297,15 @@ PageSizer::PageSizer(Registry & _wr) _portraitButton.set_group (group); _portraitButton.set_active (true); + // Setting default custom unit to document unit + SPDesktop *dt = SP_ACTIVE_DESKTOP; + SPNamedView *nv = sp_desktop_namedview(dt); + if (nv->units) { + _dimensionUnits.setUnit(nv->units); + } else if (nv->doc_units) { + _dimensionUnits.setUnit(nv->doc_units); + } + //## Set up custom size frame _customFrame.set_label(_("Custom size")); pack_start (_customFrame, false, false, 0); diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 4b806afb5..b3c8ce376 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -131,20 +131,15 @@ void Panel::_init() } { - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - Glib::ustring heightItemLabel(Q_("swatches|Size")); + Glib::ustring heightItemLabel(C_("Swatches", "Size")); //TRANSLATORS: Indicates size of colour swatches const gchar *heightLabels[] = { - N_("tiny"), - N_("small"), - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "medium" indicates size of colour swatches - N_("swatchesHeight|medium"), - N_("large"), - N_("huge") + NC_("Swatches height", "Tiny"), + NC_("Swatches height", "Small"), + NC_("Swatches height", "Medium"), + NC_("Swatches height", "Large"), + NC_("Swatches height", "Huge") }; Gtk::MenuItem *sizeItem = manage(new Gtk::MenuItem(heightItemLabel)); @@ -153,7 +148,7 @@ void Panel::_init() Gtk::RadioMenuItem::Group heightGroup; for (unsigned int i = 0; i < G_N_ELEMENTS(heightLabels); i++) { - Glib::ustring _label(Q_(heightLabels[i])); + Glib::ustring _label(g_dpgettext2(NULL, "Swatches height", heightLabels[i])); Gtk::RadioMenuItem* _item = manage(new Gtk::RadioMenuItem(heightGroup, _label)); sizeMenu->append(*_item); if (i == panel_size) { @@ -166,20 +161,15 @@ void Panel::_init() } { - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - Glib::ustring widthItemLabel(Q_("swatches|Width")); + Glib::ustring widthItemLabel(C_("Swatches", "Width")); //TRANSLATORS: Indicates width of colour swatches const gchar *widthLabels[] = { - N_("narrower"), - N_("narrow"), - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "medium" indicates width of colour swatches - N_("swatchesWidth|medium"), - N_("wide"), - N_("wider") + NC_("Swatches width", "Narrower"), + NC_("Swatches width", "Narrow"), + NC_("Swatches width", "Medium"), + NC_("Swatches width", "Wide"), + NC_("Swatches width", "Wider") }; Gtk::MenuItem *item = manage( new Gtk::MenuItem(widthItemLabel)); @@ -198,7 +188,7 @@ void Panel::_init() } } for ( guint i = 0; i < G_N_ELEMENTS(widthLabels); ++i ) { - Glib::ustring _label(Q_(widthLabels[i])); + Glib::ustring _label(g_dpgettext2(NULL, "Swatches width", widthLabels[i])); Gtk::RadioMenuItem *_item = manage(new Gtk::RadioMenuItem(widthGroup, _label)); type_menu->append(*_item); if ( i <= hot_index ) { @@ -209,10 +199,8 @@ void Panel::_init() } { - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "Wrap" indicates how colour swatches are displayed - Glib::ustring wrap_label(Q_("swatches|Wrap")); + //TRANSLATORS: "Wrap" indicates how colour swatches are displayed + Glib::ustring wrap_label(C_("Swatches","Wrap")); Gtk::CheckMenuItem *check = manage(new Gtk::CheckMenuItem(wrap_label)); check->set_active(panel_wrap); _menu->append(*check); @@ -613,4 +601,4 @@ Inkscape::Selection *Panel::_getSelection() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index d42548f16..fe3e226b4 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -150,4 +150,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/point.cpp b/src/ui/widget/point.cpp index f27cfe8c6..ca7f7a501 100644 --- a/src/ui/widget/point.cpp +++ b/src/ui/widget/point.cpp @@ -246,4 +246,4 @@ Point::signal_y_value_changed() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/point.h b/src/ui/widget/point.h index 94477d877..68d2f4c9d 100644 --- a/src/ui/widget/point.h +++ b/src/ui/widget/point.h @@ -95,4 +95,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 70aed505e..4816304db 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -700,4 +700,4 @@ void PrefUnit::on_changed() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/random.cpp b/src/ui/widget/random.cpp index c06051098..02201be12 100644 --- a/src/ui/widget/random.cpp +++ b/src/ui/widget/random.cpp @@ -145,4 +145,4 @@ Random::onReseedButtonClick() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/random.h b/src/ui/widget/random.h index 93c6c2ff4..71cc8d1e5 100644 --- a/src/ui/widget/random.h +++ b/src/ui/widget/random.h @@ -69,4 +69,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/registered-enums.h b/src/ui/widget/registered-enums.h index 739745817..056a09fed 100644 --- a/src/ui/widget/registered-enums.h +++ b/src/ui/widget/registered-enums.h @@ -94,4 +94,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp index d17c11d0f..48e257af7 100644 --- a/src/ui/widget/rendering-options.cpp +++ b/src/ui/widget/rendering-options.cpp @@ -121,4 +121,4 @@ RenderingOptions::bitmap_dpi () fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/rendering-options.h b/src/ui/widget/rendering-options.h index 964ffca57..8e047e682 100644 --- a/src/ui/widget/rendering-options.h +++ b/src/ui/widget/rendering-options.h @@ -60,4 +60,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index 0afc0da3e..7f260680b 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -197,4 +197,4 @@ VRuler::~VRuler() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/scalar-unit.cpp b/src/ui/widget/scalar-unit.cpp index 8727ed052..6209d40e0 100644 --- a/src/ui/widget/scalar-unit.cpp +++ b/src/ui/widget/scalar-unit.cpp @@ -249,4 +249,4 @@ ScalarUnit::on_unit_changed() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/scalar-unit.h b/src/ui/widget/scalar-unit.h index c99161dad..d8b2edbd5 100644 --- a/src/ui/widget/scalar-unit.h +++ b/src/ui/widget/scalar-unit.h @@ -82,4 +82,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/scalar.cpp b/src/ui/widget/scalar.cpp index 17fb4964d..26a1f6541 100644 --- a/src/ui/widget/scalar.cpp +++ b/src/ui/widget/scalar.cpp @@ -219,4 +219,4 @@ Scalar::signal_value_changed() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/scalar.h b/src/ui/widget/scalar.h index 8ce72d949..6de128edb 100644 --- a/src/ui/widget/scalar.h +++ b/src/ui/widget/scalar.h @@ -83,4 +83,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a8f9f9c60..8e11c8308 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1030,8 +1030,8 @@ SelectedStyle::update() case QUERY_STYLE_SINGLE: case QUERY_STYLE_MULTIPLE_AVERAGED: case QUERY_STYLE_MULTIPLE_SAME: - _tooltips.set_tip(_opacity_place, _("Opacity, %")); - _tooltips.set_tip(_opacity_sb, _("Opacity, %")); + _tooltips.set_tip(_opacity_place, _("Opacity (%)")); + _tooltips.set_tip(_opacity_sb, _("Opacity (%)")); if (_opacity_blocked) break; _opacity_blocked = true; _opacity_sb.set_sensitive(true); diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp index e3e73a51f..faafc63b4 100644 --- a/src/ui/widget/spin-slider.cpp +++ b/src/ui/widget/spin-slider.cpp @@ -114,10 +114,8 @@ DualSpinSlider::DualSpinSlider(double value, double lower, double upper, double : AttrWidget(a), _s1(value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text1), _s2(value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text2), - //TRANSLATORS: only translate "string" in "context|string". - // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - // "Link" means to _link_ two sliders together - _link(Q_("sliders|Link")) + //TRANSLATORS: "Link" means to _link_ two sliders together + _link(C_("Sliders", "Link")) { signal_value_changed().connect(signal_attr_changed().make_slot()); diff --git a/src/ui/widget/style-subject.cpp b/src/ui/widget/style-subject.cpp index a7359242d..09001a993 100644 --- a/src/ui/widget/style-subject.cpp +++ b/src/ui/widget/style-subject.cpp @@ -191,4 +191,4 @@ void StyleSubject::CurrentLayer::_afterDesktopSwitch(SPDesktop *desktop) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/style-subject.h b/src/ui/widget/style-subject.h index 6f46efff5..77e4c4846 100644 --- a/src/ui/widget/style-subject.h +++ b/src/ui/widget/style-subject.h @@ -121,4 +121,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/svg-canvas.cpp b/src/ui/widget/svg-canvas.cpp index 1ba49b7ec..64657296d 100644 --- a/src/ui/widget/svg-canvas.cpp +++ b/src/ui/widget/svg-canvas.cpp @@ -89,4 +89,4 @@ SVGCanvas::onEvent (GdkEvent * ev) const fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/text.cpp b/src/ui/widget/text.cpp index 3284af54a..581491f0e 100644 --- a/src/ui/widget/text.cpp +++ b/src/ui/widget/text.cpp @@ -79,4 +79,4 @@ Text::signal_activate() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/text.h b/src/ui/widget/text.h index d1ef35be5..0dcfc5cc6 100644 --- a/src/ui/widget/text.h +++ b/src/ui/widget/text.h @@ -59,4 +59,4 @@ public: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/widget/zoom-status.cpp b/src/ui/widget/zoom-status.cpp index 7c1cf72d7..9322aa803 100644 --- a/src/ui/widget/zoom-status.cpp +++ b/src/ui/widget/zoom-status.cpp @@ -125,4 +125,4 @@ ZoomStatus::on_value_changed() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
