2
Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) any later version.
9
See the file COPYING for the full license text.
12
#include "katze-separatoraction.h"
14
struct _KatzeSeparatorAction
16
GtkAction parent_instance;
19
struct _KatzeSeparatorActionClass
21
GtkActionClass parent_class;
24
G_DEFINE_TYPE (KatzeSeparatorAction, katze_separator_action, GTK_TYPE_ACTION);
27
katze_separator_action_finalize (GObject* object);
30
katze_separator_action_activate (GtkAction* object);
33
katze_separator_action_create_tool_item (GtkAction* action);
36
katze_separator_action_create_menu_item (GtkAction* action);
39
katze_separator_action_connect_proxy (GtkAction* action,
43
katze_separator_action_disconnect_proxy (GtkAction* action,
47
katze_separator_action_class_init (KatzeSeparatorActionClass* class)
49
GObjectClass* gobject_class;
50
GtkActionClass* action_class;
52
gobject_class = G_OBJECT_CLASS (class);
53
gobject_class->finalize = katze_separator_action_finalize;
55
action_class = GTK_ACTION_CLASS (class);
56
action_class->activate = katze_separator_action_activate;
57
action_class->create_menu_item = katze_separator_action_create_menu_item;
58
action_class->create_tool_item = katze_separator_action_create_tool_item;
59
action_class->connect_proxy = katze_separator_action_connect_proxy;
60
action_class->disconnect_proxy = katze_separator_action_disconnect_proxy;
64
katze_separator_action_init (KatzeSeparatorAction* separator_action)
70
katze_separator_action_finalize (GObject* object)
72
G_OBJECT_CLASS (katze_separator_action_parent_class)->finalize (object);
76
katze_separator_action_activate (GtkAction* action)
80
proxies = gtk_action_get_proxies (action);
85
if (GTK_IS_TOOL_ITEM (proxies->data))
89
while ((proxies = g_slist_next (proxies)));
91
if (GTK_ACTION_CLASS (katze_separator_action_parent_class)->activate)
92
GTK_ACTION_CLASS (katze_separator_action_parent_class)->activate (action);
96
katze_separator_action_create_menu_item (GtkAction* action)
100
menuitem = gtk_separator_menu_item_new ();
105
katze_separator_action_create_tool_item (GtkAction* action)
109
toolitem = GTK_WIDGET (gtk_separator_tool_item_new ());
114
katze_separator_action_connect_proxy (GtkAction* action,
117
GTK_ACTION_CLASS (katze_separator_action_parent_class)->connect_proxy (
120
if (GTK_IS_TOOL_ITEM (proxy))
123
else if (GTK_IS_MENU_ITEM (proxy))
129
katze_separator_action_disconnect_proxy (GtkAction* action,
132
GTK_ACTION_CLASS (katze_separator_action_parent_class)->disconnect_proxy