diff options
| author | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
|---|---|---|
| committer | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
| commit | 509ca3687330fea576ea67ae6c7f31d16e66b800 (patch) | |
| tree | 9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/ui/interface.cpp | |
| parent | updated to latest trunk (diff) | |
| parent | [Bug #1695016] Xaml export misses some radialGradients. (diff) | |
| download | inkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.tar.gz inkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.zip | |
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/ui/interface.cpp')
| -rw-r--r-- | src/ui/interface.cpp | 77 |
1 files changed, 14 insertions, 63 deletions
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index ab29471ed..5e85065d1 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -20,12 +20,13 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include <config.h> #endif #include "ui/dialog/dialog-manager.h" #include <gtkmm/icontheme.h> #include "file.h" +#include <glibmm/miscutils.h> #include <gtkmm/imagemenuitem.h> #include <gtkmm/separatormenuitem.h> @@ -35,25 +36,20 @@ #include "extension/input.h" #include "widgets/icon.h" #include "preferences.h" -#include "path-prefix.h" #include "shortcuts.h" #include "document.h" #include "ui/interface.h" #include "desktop.h" -#include "selection.h" #include "selection-chemistry.h" #include "svg-view-widget.h" #include "widgets/desktop-widget.h" #include "sp-item-group.h" #include "sp-text.h" -#include "sp-gradient.h" #include "sp-flowtext.h" #include "sp-namedview.h" #include "sp-root.h" -#include "ui/view/view.h" #include "helper/action.h" -#include "helper/action-context.h" #include "helper/gnome-utils.h" #include "helper/window.h" #include "io/sys.h" @@ -63,7 +59,6 @@ #include "ui/clipboard.h" #include "display/sp-canvas.h" -#include "color.h" #include "svg/svg-color.h" #include "desktop-style.h" #include "style.h" @@ -74,18 +69,10 @@ #include "sp-anchor.h" #include "sp-clippath.h" #include "sp-image.h" -#include "sp-item.h" #include "sp-mask.h" #include "message-stack.h" #include "ui/dialog/layer-properties.h" - -#if GTK_CHECK_VERSION(3,0,0) - #include "widgets/image-menu-item.h" -#endif - -#include <gdk/gdkkeysyms.h> - -#include <glibmm/miscutils.h> +#include "extension/find_extension_by_mime.h" using Inkscape::DocumentUndo; @@ -417,11 +404,7 @@ sp_ui_menuitem_add_icon( GtkWidget *item, gchar *icon_name ) icon = sp_icon_new( Inkscape::ICON_SIZE_MENU, icon_name ); gtk_widget_show(icon); -#if GTK_CHECK_VERSION(3,0,0) - image_menu_item_set_image((ImageMenuItem *) item, icon); -#else gtk_image_menu_item_set_image((GtkImageMenuItem *) item, icon); -#endif } // end of sp_ui_menu_add_icon void @@ -475,11 +458,7 @@ static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb if (radio) { item = gtk_radio_menu_item_new_with_mnemonic(group, action->name); } else { -#if GTK_CHECK_VERSION(3,0,0) - item = image_menu_item_new_with_mnemonic(action->name); -#else item = gtk_image_menu_item_new_with_mnemonic(action->name); -#endif } gtk_label_set_markup_with_mnemonic( GTK_LABEL(gtk_bin_get_child(GTK_BIN (item))), action->name); @@ -570,11 +549,7 @@ static bool getViewStateFromPref(Inkscape::UI::View::View *view, gchar const *pr return prefs->getBool(pref_path, true); } -#if GTK_CHECK_VERSION(3,0,0) static gboolean checkitem_update(GtkWidget *widget, cairo_t * /*cr*/, gpointer user_data) -#else -static gboolean checkitem_update(GtkWidget *widget, GdkEventExpose * /*event*/, gpointer user_data) -#endif { GtkCheckMenuItem *menuitem=GTK_CHECK_MENU_ITEM(widget); @@ -631,11 +606,7 @@ static void taskToggled(GtkCheckMenuItem *menuitem, gpointer userData) /** * Callback function to update the status of the radio buttons in the View -> Display mode menu (Normal, No Filters, Outline) and Color display mode. */ -#if GTK_CHECK_VERSION(3,0,0) static gboolean update_view_menu(GtkWidget *widget, cairo_t * /*cr*/, gpointer user_data) -#else -static gboolean update_view_menu(GtkWidget *widget, GdkEventExpose * /*event*/, gpointer user_data) -#endif { SPAction *action = (SPAction *) user_data; g_assert(action->id != NULL); @@ -679,11 +650,7 @@ static gboolean update_view_menu(GtkWidget *widget, GdkEventExpose * /*event*/, static void sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View *view, gchar const *label, gchar const *tip, gchar const *pref, void (*callback_toggle)(GtkCheckMenuItem *, gpointer user_data), -#if GTK_CHECK_VERSION(3,0,0) gboolean (*callback_update)(GtkWidget *widget, cairo_t *cr, gpointer user_data), -#else - gboolean (*callback_update)(GtkWidget *widget, GdkEventExpose *event, gpointer user_data), -#endif Inkscape::Verb *verb) { unsigned int shortcut = (verb) ? sp_shortcut_get_primary(verb) : 0; @@ -707,11 +674,7 @@ sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View * g_signal_connect( G_OBJECT(item), "toggled", (GCallback) callback_toggle, (void *) pref); -#if GTK_CHECK_VERSION(3,0,0) g_signal_connect( G_OBJECT(item), "draw", (GCallback) callback_update, (void *) pref); -#else - g_signal_connect( G_OBJECT(item), "expose_event", (GCallback) callback_update, (void *) pref); -#endif (*callback_update)(item, NULL, (void *)pref); @@ -854,11 +817,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I } if (verb->get_code() != SP_VERB_NONE) { SPAction *action = verb->get_action(Inkscape::ActionContext(view)); -#if GTK_CHECK_VERSION(3,0,0) g_signal_connect( G_OBJECT(item), "draw", (GCallback) update_view_menu, (void *) action); -#else - g_signal_connect( G_OBJECT(item), "expose_event", (GCallback) update_view_menu, (void *) action); -#endif } } else if (menu_pntr->attribute("check") != NULL) { if (verb->get_code() != SP_VERB_NONE) { @@ -1250,7 +1209,7 @@ sp_ui_drag_data_received(GtkWidget *widget, Geom::OptRect sel_bbox = selection->visualBounds(); if (sel_bbox) { Geom::Point m( desktop->point() - sel_bbox->midpoint() ); - sp_selection_move_relative(selection, m, false); + selection->moveRelative(m, false); } } @@ -1276,15 +1235,7 @@ sp_ui_drag_data_received(GtkWidget *widget, case PNG_DATA: case JPEG_DATA: case IMAGE_DATA: { - const char *mime = (info == JPEG_DATA ? "image/jpeg" : "image/png"); - - Inkscape::Extension::DB::InputList o; - Inkscape::Extension::db.get_input_list(o); - Inkscape::Extension::DB::InputList::const_iterator i = o.begin(); - while (i != o.end() && strcmp( (*i)->get_mimetype(), mime ) != 0) { - ++i; - } - Inkscape::Extension::Extension *ext = *i; + Inkscape::Extension::Extension *ext = Inkscape::Extension::find_by_mime((info == JPEG_DATA ? "image/jpeg" : "image/png")); bool save = (strcmp(ext->get_param_optiongroup("link"), "embed") == 0); ext->set_param_optiongroup("link", "embed"); ext->set_gui(false); @@ -1881,28 +1832,28 @@ void ContextMenu::ItemCreateLink(void) void ContextMenu::SetMask(void) { - sp_selection_set_mask(_desktop, false, false); + _desktop->selection->setMask(false, false); } void ContextMenu::ReleaseMask(void) { - sp_selection_unset_mask(_desktop, false); + _desktop->selection->unsetMask(false); } void ContextMenu::CreateGroupClip(void) { - sp_selection_set_clipgroup(_desktop); + _desktop->selection->setClipGroup(); } void ContextMenu::SetClip(void) { - sp_selection_set_mask(_desktop, true, false); + _desktop->selection->setMask(true, false); } void ContextMenu::ReleaseClip(void) { - sp_selection_unset_mask(_desktop, true); + _desktop->selection->unsetMask(true); } void ContextMenu::MakeGroupMenu(void) @@ -1916,7 +1867,7 @@ void ContextMenu::MakeGroupMenu(void) void ContextMenu::ActivateGroup(void) { - sp_selection_group(_desktop->selection, _desktop); + _desktop->selection->group(); } void ContextMenu::ActivateUngroup(void) @@ -1929,7 +1880,7 @@ void ContextMenu::ActivateUngroup(void) void ContextMenu::ActivateUngroupPopSelection(void) { - sp_selection_ungroup_pop_selection(_desktop->selection, _desktop); + _desktop->selection->popFromGroup(); } @@ -2096,8 +2047,8 @@ void ContextMenu::ImageEdit(void) } #endif - std::vector<SPItem*> itemlist=_desktop->selection->itemList(); - for(std::vector<SPItem*>::const_iterator i=itemlist.begin();i!=itemlist.end();++i){ + auto itemlist= _desktop->selection->items(); + for(auto i=itemlist.begin();i!=itemlist.end();++i){ Inkscape::XML::Node *ir = (*i)->getRepr(); const gchar *href = ir->attribute("xlink:href"); |
