diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-04-05 20:14:44 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-04-05 20:14:44 +0000 |
| commit | bcd804c6c383e2964b072257da282d9a91db7d16 (patch) | |
| tree | aa9617b1045a4dda778ac86c7fc5c4ef22eef535 /src/interface.h | |
| parent | add test code for bug #967416 (diff) | |
| download | inkscape-bcd804c6c383e2964b072257da282d9a91db7d16.tar.gz inkscape-bcd804c6c383e2964b072257da282d9a91db7d16.zip | |
C++ify context menu:
- c++ified context-menu.cpp (and included in interface.cpp)
- removed dozens of pointer conversions (of which some were erroneous)
- fixed a memory leak
- added some null pointer checks to prevent crashes
(bzr r11160)
Diffstat (limited to 'src/interface.h')
| -rw-r--r-- | src/interface.h | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/src/interface.h b/src/interface.h index 2b01a20d7..db98c3ae3 100644 --- a/src/interface.h +++ b/src/interface.h @@ -8,7 +8,9 @@ * Lauris Kaplinski <lauris@kaplinski.com> * Frank Felfe <innerspace@iname.com> * Abhishek Sharma + * Kris De Gussem <Kris.DeGussem@gmail.com> * + * Copyright (C) 2012 Kris De Gussem * Copyright (C) 1999-2002 authors * Copyright (C) 2001-2002 Ximian, Inc. * @@ -16,6 +18,7 @@ */ #include <gtk/gtk.h> +#include <gtkmm/menu.h> #include "sp-item.h" @@ -58,10 +61,7 @@ unsigned int sp_ui_close_all (void); */ GtkWidget *sp_ui_main_menubar (Inkscape::UI::View::View *view); -/** - * - */ -GtkWidget *sp_ui_context_menu (Inkscape::UI::View::View *v, SPItem *item); +static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb *verb, Inkscape::UI::View::View *view, bool radio = false, GSList *group = NULL); /** @@ -82,6 +82,59 @@ void sp_ui_dialog_title_string (Inkscape::Verb * verb, gchar* c); void sp_ui_error_dialog (const gchar * message); bool sp_ui_overwrite_file (const gchar * filename); +class ContextMenu : public Gtk::Menu +{ + public: + ContextMenu(Inkscape::UI::View::View *view, SPItem *item); + ~ContextMenu(void); + private: + SPItem *_item; + SPObject *_object; + SPDesktop *_desktop; + + std::vector<Gtk::SeparatorMenuItem*> separators; + Gtk::MenuItem MIGroup; + Gtk::MenuItem MIParent; + + Gtk::SeparatorMenuItem* AddSeparator(void); + void AppendItemFromVerb(Inkscape::Verb *verb, Inkscape::UI::View::View *view); + void MakeObjectMenu (void); + void MakeItemMenu (void); + void MakeGroupMenu (void); + void MakeAnchorMenu (void); + void MakeImageMenu (void); + void MakeShapeMenu (void); + void MakeTextMenu (void); + + void EnterGroup(Gtk::MenuItem* mi); + void LeaveGroup(void); + void ItemProperties(void); + void ItemSelectThis(void); + void SelectSameFillStroke(void); + void ItemCreateLink(void); + void SetMask(void); + void ReleaseMask(void); + void SetClip(void); + void ReleaseClip(void); + + void ActivateUngroup(void); + + void AnchorLinkProperties(void); + void AnchorLinkFollow(void); + void AnchorLinkRemove(void); + + void ImageProperties(void); + void ImageEdit(void); + Glib::ustring getImageEditorName(); + void ImageEmbed(void); + void ImageExtract(void); + + void FillSettings(void); + + void TextSettings(void); + void SpellcheckSettings(void); +}; + #endif // SEEN_SP_INTERFACE_H /* |
