diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:33:34 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:33:34 +0000 |
| commit | 577a95c2028790cbb856feda6ac6880ddd1aaad2 (patch) | |
| tree | 4ff78f6fa8f0c1b740fd43b0ade2b91dbf9226d0 /src/widgets/ink-tool-menu-action.cpp | |
| parent | Merged trunk (diff) | |
| parent | Remove deprecated Autotools and btool files. Please use CMake instead (diff) | |
| download | inkscape-577a95c2028790cbb856feda6ac6880ddd1aaad2.tar.gz inkscape-577a95c2028790cbb856feda6ac6880ddd1aaad2.zip | |
Merged trunk
(bzr r14954.1.30)
Diffstat (limited to 'src/widgets/ink-tool-menu-action.cpp')
| -rw-r--r-- | src/widgets/ink-tool-menu-action.cpp | 49 |
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 : |
