summaryrefslogtreecommitdiffstats
path: root/src/widgets/ink-tool-menu-action.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-08-05 18:07:48 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2016-08-05 18:07:48 +0000
commita0cacd78d5d987eafa3739bb8f45587d82246780 (patch)
tree69c9a500d9553d0d99f676201a53395ff6c82f74 /src/widgets/ink-tool-menu-action.cpp
parentbuild-x64.xml now uses GTK+ 3 (diff)
downloadinkscape-a0cacd78d5d987eafa3739bb8f45587d82246780.tar.gz
inkscape-a0cacd78d5d987eafa3739bb8f45587d82246780.zip
Split InkAction classes into separate files
(bzr r15043)
Diffstat (limited to 'src/widgets/ink-tool-menu-action.cpp')
-rw-r--r--src/widgets/ink-tool-menu-action.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/widgets/ink-tool-menu-action.cpp b/src/widgets/ink-tool-menu-action.cpp
new file mode 100644
index 000000000..29d8dc92f
--- /dev/null
+++ b/src/widgets/ink-tool-menu-action.cpp
@@ -0,0 +1,49 @@
+#include "ink-tool-menu-action.h"
+
+// ToolMenu Action is happily derived from http://www.gtkforums.com/viewtopic.php?t=4215
+
+G_DEFINE_TYPE(InkToolMenuAction, ink_tool_menu_action, INK_ACTION_TYPE);
+
+static void
+ink_tool_menu_action_class_init (InkToolMenuActionClass *klass)
+{
+ GtkActionClass *action_class = GTK_ACTION_CLASS (klass);
+ action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
+}
+
+static void
+ink_tool_menu_action_init (InkToolMenuAction* /*tma*/)
+{
+}
+
+InkToolMenuAction *
+ink_tool_menu_action_new (const gchar *name,
+ const gchar *label,
+ const gchar *tooltip,
+ const gchar *inkId,
+ Inkscape::IconSize size )
+{
+ g_return_val_if_fail (name != NULL, NULL);
+
+ GObject* obj = (GObject*)g_object_new( INK_TOOL_MENU_ACTION_TYPE,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "iconId", inkId,
+ "iconSize", size,
+ NULL );
+
+ InkToolMenuAction* action = INK_TOOL_MENU_ACTION( obj );
+
+ return action;
+}
+/*
+ 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 :