diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-01-19 19:45:06 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-01-19 19:45:06 +0000 |
| commit | 28dcdf10f9fef7f4c7d7bf7664040aa3c26126fe (patch) | |
| tree | 446c523f5a28f31ce6423086a293cdfff81f2b8f /src | |
| parent | Update and documentation of sp-attribute-widget (diff) | |
| download | inkscape-28dcdf10f9fef7f4c7d7bf7664040aa3c26126fe.tar.gz inkscape-28dcdf10f9fef7f4c7d7bf7664040aa3c26126fe.zip | |
Gtkmmification of object attributes dialog: image and link attributes now editable in dockable dialog (Bug #592323)
(bzr r10910)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dialogs/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/dialogs/Makefile_insert | 2 | ||||
| -rw-r--r-- | src/dialogs/object-attributes.cpp | 153 | ||||
| -rw-r--r-- | src/dialogs/object-attributes.h | 32 | ||||
| -rw-r--r-- | src/ui/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/ui/context-menu.cpp | 29 | ||||
| -rw-r--r-- | src/ui/dialog/dialog-manager.cpp | 7 | ||||
| -rw-r--r-- | src/ui/dialog/object-attributes.cpp | 211 | ||||
| -rw-r--r-- | src/ui/dialog/object-attributes.h | 124 | ||||
| -rw-r--r-- | src/verbs.cpp | 7 | ||||
| -rw-r--r-- | src/verbs.h | 1 |
11 files changed, 366 insertions, 207 deletions
diff --git a/src/dialogs/CMakeLists.txt b/src/dialogs/CMakeLists.txt index 1f2efecc3..a0a0c286b 100644 --- a/src/dialogs/CMakeLists.txt +++ b/src/dialogs/CMakeLists.txt @@ -4,7 +4,6 @@ set(dialogs_SRC dialog-events.cpp export.cpp find.cpp - object-attributes.cpp spellcheck.cpp text-edit.cpp xml-tree.cpp @@ -16,8 +15,6 @@ set(dialogs_SRC dialog-events.h export.h find.h - item-properties.h - object-attributes.h spellcheck.h text-edit.h xml-tree.h diff --git a/src/dialogs/Makefile_insert b/src/dialogs/Makefile_insert index c55b03775..342eba137 100644 --- a/src/dialogs/Makefile_insert +++ b/src/dialogs/Makefile_insert @@ -9,8 +9,6 @@ ink_common_sources += \ dialogs/export.h \ dialogs/find.cpp \ dialogs/find.h \ - dialogs/object-attributes.cpp \ - dialogs/object-attributes.h \ dialogs/spellcheck.cpp \ dialogs/spellcheck.h \ dialogs/text-edit.cpp \ diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp deleted file mode 100644 index 808e9a16a..000000000 --- a/src/dialogs/object-attributes.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file - * Generic properties editor. - */ -/* Authors: - * Lauris Kaplinski <lauris@kaplinski.com> - * bulia byak <buliabyak@users.sf.net> - * Kris De Gussem <Kris.DeGussem@gmail.com> - * - * Copyright (C) 1999-2011 Authors - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include <glibmm/i18n.h> -#include <string> -#include <cstring> -#include <stddef.h> -#include <sigc++/connection.h> -#include <sigc++/functors/ptr_fun.h> -#include <sigc++/adaptors/bind.h> - -#include "helper/window.h" -#include "macros.h" -#include "sp-anchor.h" -#include "widgets/sp-attribute-widget.h" -#include "../xml/repr.h" - -struct SPAttrDesc { - gchar const *label; - gchar const *attribute; -}; - -static const SPAttrDesc anchor_desc[] = { - { N_("Href:"), "xlink:href"}, - { N_("Target:"), "target"}, - { N_("Type:"), "xlink:type"}, - // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkRoleAttribute - // Identifies the type of the related resource with an absolute URI - { N_("Role:"), "xlink:role"}, - // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkArcRoleAttribute - // For situations where the nature/role alone isn't enough, this offers an additional URI defining the purpose of the link. - { N_("Arcrole:"), "xlink:arcrole"}, - // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkTitleAttribute - { N_("Title:"), "xlink:title"}, - { N_("Show:"), "xlink:show"}, - // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkActuateAttribute - { N_("Actuate:"), "xlink:actuate"}, - { NULL, NULL} -}; - -static const SPAttrDesc image_desc[] = { - { N_("URL:"), "xlink:href"}, - { N_("X:"), "x"}, - { N_("Y:"), "y"}, - { N_("Width:"), "width"}, - { N_("Height:"), "height"}, - { NULL, NULL} -}; - -static const SPAttrDesc image_nohref_desc[] = { - { N_("X:"), "x"}, - { N_("Y:"), "y"}, - { N_("Width:"), "width"}, - { N_("Height:"), "height"}, - { NULL, NULL} -}; - -static void object_released( SPObject */*object*/, GtkWidget *widget ) -{ - gtk_widget_destroy (widget); -} - - - -static void window_destroyed( GtkObject *window, GtkObject */*object*/ ) -{ - sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection"); - release_connection->disconnect(); - delete release_connection; -} - -static void sp_object_attr_show_dialog ( SPObject *object, - const SPAttrDesc *desc, - const gchar *tag ) -{ - int len; - Gtk::Window *window; - SPAttributeTable* t; - Glib::ustring title; - std::vector<Glib::ustring> labels; - std::vector<Glib::ustring> attrs; - - if (!strcmp (tag, "Link")) { - title = _("Link Properties"); - } else if (!strcmp (tag, "Image")) { - title = _("Image Properties"); - } else { - title = Glib::ustring::compose(_("%1 Properties"), tag); - } - - len = 0; - while (desc[len].label) - { - labels.push_back(desc[len].label); - attrs.push_back (desc[len].attribute); - len += 1; - } - - window = Inkscape::UI::window_new (title.c_str(), true); - t = new SPAttributeTable (object, labels, attrs, (GtkWidget*)window->gobj()); - - g_signal_connect (window->gobj(), "destroy", - G_CALLBACK (window_destroyed), object ); - - sigc::connection *release_connection = new sigc::connection(); - *release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&object_released), (GtkWidget*)window->gobj())); - g_object_set_data((GObject*)window->gobj(), "release_connection", release_connection); - - t->show(); - window->show(); -} // end of sp_object_attr_show_dialog() - - -void sp_object_attributes_dialog (SPObject *object, const gchar *tag) -{ - g_return_if_fail (object != NULL); - g_return_if_fail (SP_IS_OBJECT (object)); - g_return_if_fail (tag != NULL); - - if (!strcmp (tag, "Link")) { - sp_object_attr_show_dialog (object, anchor_desc, tag); - } else if (!strcmp (tag, "Image")) { - Inkscape::XML::Node *ir = object->getRepr(); - const gchar *href = ir->attribute("xlink:href"); - if ( (!href) || ((strncmp(href, "data:", 5) == 0)) ) { - sp_object_attr_show_dialog (object, image_nohref_desc, tag); - } else { - sp_object_attr_show_dialog (object, image_desc, tag); - } - } -} // end of sp_object_attributes_dialog() - -/* - 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:fileencoding=utf-8:textwidth=99 : diff --git a/src/dialogs/object-attributes.h b/src/dialogs/object-attributes.h deleted file mode 100644 index 53b3ee37f..000000000 --- a/src/dialogs/object-attributes.h +++ /dev/null @@ -1,32 +0,0 @@ -/** @file - * @brief Generic object attribute editor - */ -/* Author: - * Lauris Kaplinski <lauris@ximian.com> - * - * Copyright (C) 2001 Ximian, Inc. - * - * Licensed under GNU GPL - */ - -#ifndef SEEN_DIALOGS_OBJECT_ATTRIBUTES_H -#define SEEN_DIALOGS_OBJECT_ATTRIBUTES_H - -#include <glib.h> - -class SPObject; - -void sp_object_attributes_dialog (SPObject *object, const gchar *tag); - -#endif - -/* - 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:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 3727cc661..f1cccc3fe 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -48,9 +48,10 @@ set(ui_SRC dialog/layer-properties.cpp dialog/layers.cpp dialog/livepatheffect-editor.cpp - dialog/object-properties.cpp dialog/memory.cpp dialog/messages.cpp + dialog/object-attributes.cpp + dialog/object-properties.cpp dialog/ocaldialogs.cpp dialog/print-colors-preview-dialog.cpp dialog/print.cpp @@ -155,6 +156,7 @@ set(ui_SRC dialog/livepatheffect-editor.h dialog/memory.h dialog/messages.h + dialog/object-attributes.h dialog/object-properties.h dialog/ocaldialogs.h dialog/panel-dialog.h diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index f8ec1eed1..e99a19e11 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -42,24 +42,22 @@ void sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) /* Implementation */ #include <gtk/gtk.h> - #include <glibmm/i18n.h> +#include "selection.h" +#include "selection-chemistry.h" #include "sp-anchor.h" +#include "sp-clippath.h" #include "sp-image.h" +#include "sp-mask.h" +#include "sp-path.h" #include "sp-text.h" - #include "desktop-handles.h" -#include "selection.h" -#include "selection-chemistry.h" -#include "dialogs/object-attributes.h" #include "dialogs/text-edit.h" #include "dialogs/spellcheck.h" +#include "ui/dialog/object-attributes.h" #include "ui/dialog/object-properties.h" -#include "sp-path.h" -#include "sp-clippath.h" -#include "sp-mask.h" static void sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); @@ -284,9 +282,8 @@ static void sp_item_create_link(GtkMenuItem *menuitem, SPItem *item) DocumentUndo::done(object->document, SP_VERB_NONE, _("Create link")); - sp_object_attributes_dialog(object, "SPAnchor"); - sp_desktop_selection(desktop)->set(SP_ITEM(object)); + desktop->_dlg_mgr->showDialog("ObjectAttributes"); } /* SPGroup */ @@ -355,9 +352,11 @@ static void sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_menu_shell_append(GTK_MENU_SHELL(m), w); } -static void sp_anchor_link_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor) +static void sp_anchor_link_properties(GtkMenuItem *menuitem, SPAnchor */*anchor*/) { - sp_object_attributes_dialog(anchor, "Link"); + SPDesktop *desktop = (SPDesktop*)g_object_get_data(G_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + desktop->_dlg_mgr->showDialog("ObjectAttributes"); } static void sp_anchor_link_follow(GtkMenuItem */*menuitem*/, SPAnchor *anchor) @@ -410,9 +409,11 @@ static void sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) } } -static void sp_image_image_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor) +static void sp_image_image_properties(GtkMenuItem *menuitem, SPAnchor */*anchor*/) { - sp_object_attributes_dialog(anchor, "Image"); + SPDesktop *desktop = (SPDesktop*)g_object_get_data(G_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + desktop->_dlg_mgr->showDialog("ObjectAttributes"); } static gchar* getImageEditorName() { diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 95486c5e3..4781e55ba 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -45,6 +45,7 @@ //#include "ui/dialog/print-colors-preview-dialog.h" #include "util/ege-appear-time-tracker.h" #include "preferences.h" +#include "ui/dialog/object-attributes.h" #include "ui/dialog/object-properties.h" @@ -108,7 +109,8 @@ DialogManager::DialogManager() { registerFactory("LivePathEffect", &create<LivePathEffectEditor, FloatingBehavior>); registerFactory("Memory", &create<Memory, FloatingBehavior>); registerFactory("Messages", &create<Messages, FloatingBehavior>); - registerFactory("ObjectProperties", &create<ObjectProperties, FloatingBehavior>); + registerFactory("ObjectAttributes", &create<ObjectAttributes, FloatingBehavior>); + registerFactory("ObjectProperties", &create<ObjectProperties, FloatingBehavior>); // registerFactory("PrintColorsPreviewDialog", &create<PrintColorsPreviewDialog, FloatingBehavior>); registerFactory("Script", &create<ScriptDialog, FloatingBehavior>); #ifdef ENABLE_SVG_FONTS @@ -137,7 +139,8 @@ DialogManager::DialogManager() { registerFactory("LivePathEffect", &create<LivePathEffectEditor, DockBehavior>); registerFactory("Memory", &create<Memory, DockBehavior>); registerFactory("Messages", &create<Messages, DockBehavior>); - registerFactory("ObjectProperties", &create<ObjectProperties, DockBehavior>); + registerFactory("ObjectAttributes", &create<ObjectAttributes, DockBehavior>); + registerFactory("ObjectProperties", &create<ObjectProperties, DockBehavior>); // registerFactory("PrintColorsPreviewDialog", &create<PrintColorsPreviewDialog, DockBehavior>); registerFactory("Script", &create<ScriptDialog, DockBehavior>); #ifdef ENABLE_SVG_FONTS diff --git a/src/ui/dialog/object-attributes.cpp b/src/ui/dialog/object-attributes.cpp new file mode 100644 index 000000000..1f55887f4 --- /dev/null +++ b/src/ui/dialog/object-attributes.cpp @@ -0,0 +1,211 @@ +/** @file + * Generic object attribute editor + */ +/* Authors: + * Lauris Kaplinski <lauris@kaplinski.com> + * bulia byak <buliabyak@users.sf.net> + * Kris De Gussem <Kris.DeGussem@gmail.com> + * + * Copyright (C) 1999-2012 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include <glibmm/i18n.h> + +#include "desktop-handles.h" +#include "macros.h" +#include "sp-anchor.h" +#include "sp-image.h" +#include "verbs.h" +#include "xml/repr.h" +#include "ui/dialog/dialog-manager.h" +#include "ui/dialog/object-attributes.h" + +namespace Inkscape { +namespace UI { +namespace Dialog { + +struct SPAttrDesc { + gchar const *label; + gchar const *attribute; +}; + +static const SPAttrDesc anchor_desc[] = { + { N_("Href:"), "xlink:href"}, + { N_("Target:"), "target"}, + { N_("Type:"), "xlink:type"}, + // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkRoleAttribute + // Identifies the type of the related resource with an absolute URI + { N_("Role:"), "xlink:role"}, + // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkArcRoleAttribute + // For situations where the nature/role alone isn't enough, this offers an additional URI defining the purpose of the link. + { N_("Arcrole:"), "xlink:arcrole"}, + // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkTitleAttribute + { N_("Title:"), "xlink:title"}, + { N_("Show:"), "xlink:show"}, + // TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkActuateAttribute + { N_("Actuate:"), "xlink:actuate"}, + { NULL, NULL} +}; + +static const SPAttrDesc image_desc[] = { + { N_("URL:"), "xlink:href"}, + { N_("X:"), "x"}, + { N_("Y:"), "y"}, + { N_("Width:"), "width"}, + { N_("Height:"), "height"}, + { NULL, NULL} +}; + +static const SPAttrDesc image_nohref_desc[] = { + { N_("X:"), "x"}, + { N_("Y:"), "y"}, + { N_("Width:"), "width"}, + { N_("Height:"), "height"}, + { NULL, NULL} +}; + +ObjectAttributes::ObjectAttributes (void) : + UI::Widget::Panel ("", "/dialogs/objectattr/", SP_VERB_DIALOG_ATTR), + blocked (false), + CurrentItem(NULL), + attrTable(), + desktop(NULL), + deskTrack(), + selectChangedConn(), + subselChangedConn(), + selectModifiedConn() +{ + attrTable.show(); + widget_setup(); + + desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectAttributes::setTargetDesktop) ); + deskTrack.connect(GTK_WIDGET(gobj())); +} + +ObjectAttributes::~ObjectAttributes (void) +{ + selectModifiedConn.disconnect(); + subselChangedConn.disconnect(); + selectChangedConn.disconnect(); + desktopChangeConn.disconnect(); + deskTrack.disconnect(); +} + +void ObjectAttributes::widget_setup (void) +{ + if (blocked) + { + return; + } + + Inkscape::Selection *selection = sp_desktop_selection (SP_ACTIVE_DESKTOP); + SPItem *item = selection->singleItem(); + if (!item) + { + set_sensitive (false); + CurrentItem = NULL; + //no selection anymore or multiple objects selected, means that we need + //to close the connections to the previously selected object + return; + } + + blocked = true; + SPObject *obj = (SPObject*)item; //to get the selected item + GObjectClass *klass = G_OBJECT_GET_CLASS(obj); //to deduce the object's type + GType type = G_TYPE_FROM_CLASS(klass); + const SPAttrDesc *desc; + + if (type == SP_TYPE_ANCHOR) + { + desc = anchor_desc; + } + else if (type == SP_TYPE_IMAGE) + { + Inkscape::XML::Node *ir = obj->getRepr(); + const gchar *href = ir->attribute("xlink:href"); + if ( (!href) || ((strncmp(href, "data:", 5) == 0)) ) + { + desc = image_nohref_desc; + } + else + { + desc = image_desc; + } + } + else + { + blocked = false; + set_sensitive (false); + return; + } + + int len = 0; + std::vector<Glib::ustring> labels; + std::vector<Glib::ustring> attrs; + if (CurrentItem != item) + { + while (desc[len].label) + { + labels.push_back(desc[len].label); + attrs.push_back (desc[len].attribute); + len += 1; + } + attrTable.set_object(obj, labels, attrs, (GtkWidget*)gobj()); + CurrentItem = item; + } + else + { + attrTable.change_object(obj); + } + + set_sensitive (true); + show_all(); + blocked = false; +} + +void ObjectAttributes::setTargetDesktop(SPDesktop *desktop) +{ + if (this->desktop != desktop) { + if (this->desktop) { + selectModifiedConn.disconnect(); + subselChangedConn.disconnect(); + selectChangedConn.disconnect(); + } + this->desktop = desktop; + if (desktop && desktop->selection) { + selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &ObjectAttributes::widget_setup))); + subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &ObjectAttributes::widget_setup))); + + // Must check flags, so can't call widget_setup() directly. + selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &ObjectAttributes::selectionModifiedCB))); + } + widget_setup(); + } +} + +void ObjectAttributes::selectionModifiedCB( guint flags ) +{ + if (flags & ( SP_OBJECT_MODIFIED_FLAG | + SP_OBJECT_PARENT_MODIFIED_FLAG | + SP_OBJECT_STYLE_MODIFIED_FLAG) ) { + attrTable.reread_properties(); + } +} + + +} +} +} + +/* + 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:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/dialog/object-attributes.h b/src/ui/dialog/object-attributes.h new file mode 100644 index 000000000..a5a361c25 --- /dev/null +++ b/src/ui/dialog/object-attributes.h @@ -0,0 +1,124 @@ +/** @file + * Generic object attribute editor + */ +/* Author: + * Lauris Kaplinski <lauris@ximian.com> + * + * Copyright (C) 2001 Ximian, Inc. + * + * Licensed under GNU GPL + */ + +#ifndef SEEN_DIALOGS_OBJECT_ATTRIBUTES_H +#define SEEN_DIALOGS_OBJECT_ATTRIBUTES_H + +#include <glib.h> + +#include "desktop.h" +#include "ui/dialog/desktop-tracker.h" +#include "ui/widget/panel.h" +#include "widgets/sp-attribute-widget.h" + +namespace Inkscape { +namespace UI { +namespace Dialog { + +/** + * A dialog widget to show object attributes (currently for images and links). + */ +class ObjectAttributes : public Widget::Panel { +public: + ObjectAttributes (); + ~ObjectAttributes (); + + /** + * Returns a new instance of the object attributes dialog. + * + * Auxiliary function needed by the DialogManager. + */ + static ObjectAttributes &getInstance() { return *new ObjectAttributes(); } + + /** + * Updates entries and other child widgets on selection change, object modification, etc. + */ + void widget_setup(void); + +private: + /** + * Is UI update bloched? + */ + bool blocked; + + /** + * Contains a pointer to the currently selected item (NULL in case nothing is or multiple objects are selected). + */ + SPItem *CurrentItem; + + /** + * Child widget to show the object attributes. + * + * attrTable makes the labels and edit boxes for the attributes defined + * in the SPAttrDesc arrays at the top of the cpp-file. This widgets also + * ensures object attribute modifications by the user are set. + */ + SPAttributeTable attrTable; + + /** + * Stores the current desktop. + */ + SPDesktop *desktop; + + /** + * Auxiliary widget to keep track of desktop changes for the floating dialog. + */ + DesktopTracker deskTrack; + + /** + * Link to callback function for a change in desktop (window). + */ + sigc::connection desktopChangeConn; + + /** + * Link to callback function for a selection change. + */ + sigc::connection selectChangedConn; + sigc::connection subselChangedConn; + + /** + * Link to callback function for a modification of the selected object. + */ + sigc::connection selectModifiedConn; + + /** + * Callback function invoked by the desktop tracker in case of a modification of the selected object. + */ + void selectionModifiedCB( guint flags ); + + /* + * Can be invoked for setting the desktop. Currently not used. + */ + // void setDesktop(SPDesktop *desktop); + + /** + * Is invoked by the desktop tracker when the desktop changes. + */ + void setTargetDesktop(SPDesktop *desktop); + +}; + +} +} +} + +#endif + +/* + 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:fileencoding=utf-8:textwidth=99 : diff --git a/src/verbs.cpp b/src/verbs.cpp index 39ecd957e..2d6d8fca8 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -19,6 +19,7 @@ * Abhishek Sharma * * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl> + * Copyright (C) 2012 Kris De Gussem <Kris.DeGussem@gmail.com> * Copyright (C) (date unspecified) Authors * This code is in public domain. */ @@ -1847,6 +1848,10 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_CLONETILER: clonetiler_dialog(); break; + case SP_VERB_DIALOG_ATTR: + //sp_item_dialog(); + dt->_dlg_mgr->showDialog("ObjectAttributes"); + break; case SP_VERB_DIALOG_ITEM: //sp_item_dialog(); dt->_dlg_mgr->showDialog("ObjectProperties"); @@ -2623,6 +2628,8 @@ Verb *Verb::_base_verbs[] = { N_("Show or hide all open dialogs"), INKSCAPE_ICON("show-dialogs")), new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."), N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), INKSCAPE_ICON("dialog-tile-clones")), + new DialogVerb(SP_VERB_DIALOG_ATTR, "DialogObjectAttributes", N_("_Object attributes..."), + N_("Edit the object attributes..."), INKSCAPE_ICON("dialog-object-attributes")), new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."), N_("Edit the ID, locked and visible status, and other object properties"), INKSCAPE_ICON("dialog-object-properties")), /*#ifdef WITH_INKBOARD diff --git a/src/verbs.h b/src/verbs.h index 79390941d..2c1d761f3 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -256,6 +256,7 @@ enum { SP_VERB_DIALOG_SCRIPT, SP_VERB_DIALOG_TOGGLE, SP_VERB_DIALOG_CLONETILER, + SP_VERB_DIALOG_ATTR, SP_VERB_DIALOG_ITEM, /*#ifdef WITH_INKBOARD SP_VERB_XMPP_CLIENT, |
