]> spindle.queued.net Git - midori/commitdiff
Implement KatzeSeparatorAction
authorChristian Dywan <christian@twotoasts.de>
Wed, 28 Jan 2009 23:52:27 +0000 (00:52 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 28 Jan 2009 23:52:27 +0000 (00:52 +0100)
katze/katze-arrayaction.c
katze/katze-separatoraction.c [new file with mode: 0644]
katze/katze-separatoraction.h [new file with mode: 0644]
katze/katze.h

index fe3657d272535f9f1f27abb79c5074670ce79926..0ff5f1c4783cfaf7a2fbb2458c8116bbc3a12e12 100644 (file)
@@ -31,7 +31,7 @@ struct _KatzeArrayActionClass
     GtkActionClass parent_class;
 };
 
-G_DEFINE_TYPE (KatzeArrayAction, katze_array_action, GTK_TYPE_ACTION)
+G_DEFINE_TYPE (KatzeArrayAction, katze_array_action, GTK_TYPE_ACTION);
 
 enum
 {
diff --git a/katze/katze-separatoraction.c b/katze/katze-separatoraction.c
new file mode 100644 (file)
index 0000000..1b86a8c
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ See the file COPYING for the full license text.
+*/
+
+#include "katze-separatoraction.h"
+
+struct _KatzeSeparatorAction
+{
+    GtkAction parent_instance;
+};
+
+struct _KatzeSeparatorActionClass
+{
+    GtkActionClass parent_class;
+};
+
+G_DEFINE_TYPE (KatzeSeparatorAction, katze_separator_action, GTK_TYPE_ACTION);
+
+static void
+katze_separator_action_finalize (GObject* object);
+
+static void
+katze_separator_action_activate (GtkAction* object);
+
+static GtkWidget*
+katze_separator_action_create_tool_item (GtkAction* action);
+
+static GtkWidget*
+katze_separator_action_create_menu_item (GtkAction* action);
+
+static void
+katze_separator_action_connect_proxy (GtkAction* action,
+                                      GtkWidget* proxy);
+
+static void
+katze_separator_action_disconnect_proxy (GtkAction* action,
+                                         GtkWidget* proxy);
+
+static void
+katze_separator_action_class_init (KatzeSeparatorActionClass* class)
+{
+    GObjectClass* gobject_class;
+    GtkActionClass* action_class;
+
+    gobject_class = G_OBJECT_CLASS (class);
+    gobject_class->finalize = katze_separator_action_finalize;
+
+    action_class = GTK_ACTION_CLASS (class);
+    action_class->activate = katze_separator_action_activate;
+    action_class->create_menu_item = katze_separator_action_create_menu_item;
+    action_class->create_tool_item = katze_separator_action_create_tool_item;
+    action_class->connect_proxy = katze_separator_action_connect_proxy;
+    action_class->disconnect_proxy = katze_separator_action_disconnect_proxy;
+}
+
+static void
+katze_separator_action_init (KatzeSeparatorAction* separator_action)
+{
+    /* Nothing to do. */
+}
+
+static void
+katze_separator_action_finalize (GObject* object)
+{
+    G_OBJECT_CLASS (katze_separator_action_parent_class)->finalize (object);
+}
+
+static void
+katze_separator_action_activate (GtkAction* action)
+{
+    GSList* proxies;
+
+    proxies = gtk_action_get_proxies (action);
+    if (!proxies)
+        return;
+
+    do
+    if (GTK_IS_TOOL_ITEM (proxies->data))
+    {
+
+    }
+    while ((proxies = g_slist_next (proxies)));
+
+    if (GTK_ACTION_CLASS (katze_separator_action_parent_class)->activate)
+        GTK_ACTION_CLASS (katze_separator_action_parent_class)->activate (action);
+}
+
+static GtkWidget*
+katze_separator_action_create_menu_item (GtkAction* action)
+{
+    GtkWidget* menuitem;
+
+    menuitem = gtk_separator_menu_item_new ();
+    return menuitem;
+}
+
+static GtkWidget*
+katze_separator_action_create_tool_item (GtkAction* action)
+{
+    GtkWidget* toolitem;
+
+    toolitem = GTK_WIDGET (gtk_separator_tool_item_new ());
+    return toolitem;
+}
+
+static void
+katze_separator_action_connect_proxy (GtkAction* action,
+                                      GtkWidget* proxy)
+{
+    GTK_ACTION_CLASS (katze_separator_action_parent_class)->connect_proxy (
+        action, proxy);
+
+    if (GTK_IS_TOOL_ITEM (proxy))
+    {
+    }
+    else if (GTK_IS_MENU_ITEM (proxy))
+    {
+    }
+}
+
+static void
+katze_separator_action_disconnect_proxy (GtkAction* action,
+                                         GtkWidget* proxy)
+{
+    GTK_ACTION_CLASS (katze_separator_action_parent_class)->disconnect_proxy
+        (action, proxy);
+}
diff --git a/katze/katze-separatoraction.h b/katze/katze-separatoraction.h
new file mode 100644 (file)
index 0000000..396b83d
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ See the file COPYING for the full license text.
+*/
+
+#ifndef __KATZE_SEPARATOR_ACTION_H__
+#define __KATZE_SEPARATOR_ACTION_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define KATZE_TYPE_SEPARATOR_ACTION \
+    (katze_separator_action_get_type ())
+#define KATZE_SEPARATOR_ACTION(obj) \
+    (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_SEPARATOR_ACTION, \
+    KatzeSeparatorAction))
+#define KATZE_SEPARATOR_ACTION_CLASS(klass) \
+    (G_TYPE_CHECK_CLASS_CAST ((klass),  KATZE_TYPE_SEPARATOR_ACTION, \
+    KatzeSeparatorActionClass))
+#define KATZE_IS_SEPARATOR_ACTION(obj) \
+    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_SEPARATOR_ACTION))
+#define KATZE_IS_SEPARATOR_ACTION_CLASS(klass) \
+    (G_TYPE_CHECK_CLASS_TYPE ((klass),  KATZE_TYPE_SEPARATOR_ACTION))
+#define KATZE_SEPARATOR_ACTION_GET_CLASS(obj) \
+    (G_TYPE_INSTANCE_GET_CLASS ((obj),  KATZE_TYPE_SEPARATOR_ACTION, \
+    KatzeSeparatorActionClass))
+
+typedef struct _KatzeSeparatorAction         KatzeSeparatorAction;
+typedef struct _KatzeSeparatorActionClass    KatzeSeparatorActionClass;
+
+GType
+katze_separator_action_get_type              (void);
+
+G_END_DECLS
+
+#endif /* __KATZE_SEPARATOR_ACTION_H__ */
index a4cf626a71554b41bf3d7559392d8f30b0d70694..474a8b4abb58fb7fb525789f1fdf86632069383b 100644 (file)
@@ -18,6 +18,7 @@
 #include "katze-list.h"
 #include "katze-array.h"
 #include "katze-arrayaction.h"
+#include "katze-separatoraction.h"
 #include "katze-net.h"
 
 #endif /* __KATZE_H__ */