katze.h \
katze-throbber.c katze-throbber.h \
katze-utils.c katze-utils.h \
+ katze-webitem.c katze-webitem.h \
+ katze-weblist.c katze-weblist.h \
katze-xbel.c katze-xbel.h
#include "katze-throbber.h"
+#include "katze-utils.h"
+
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#include "katze-utils.h"
-
G_BEGIN_DECLS
#define KATZE_TYPE_THROBBER \
--- /dev/null
+/*
+ Copyright (C) 2008 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-webitem.h"
+
+#include "katze-utils.h"
+
+#include <glib/gi18n.h>
+
+struct _MidoriWebItem
+{
+ GObject parent_instance;
+
+ gchar* name;
+ gchar* description;
+ gchar* uri;
+ gchar* icon;
+ gchar* token;
+};
+
+G_DEFINE_TYPE (MidoriWebItem, midori_web_item, G_TYPE_OBJECT)
+
+enum
+{
+ PROP_0,
+
+ PROP_NAME,
+ PROP_DESCRIPTION,
+ PROP_URI,
+ PROP_ICON,
+ PROP_TOKEN
+};
+
+static void
+midori_web_item_finalize (GObject* object);
+
+static void
+midori_web_item_set_property (GObject* object,
+ guint prop_id,
+ const GValue* value,
+ GParamSpec* pspec);
+
+static void
+midori_web_item_get_property (GObject* object,
+ guint prop_id,
+ GValue* value,
+ GParamSpec* pspec);
+
+static void
+midori_web_item_class_init (MidoriWebItemClass* class)
+{
+ GObjectClass* gobject_class = G_OBJECT_CLASS (class);
+ gobject_class->finalize = midori_web_item_finalize;
+ gobject_class->set_property = midori_web_item_set_property;
+ gobject_class->get_property = midori_web_item_get_property;
+
+ GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
+
+ g_object_class_install_property (gobject_class,
+ PROP_NAME,
+ g_param_spec_string (
+ "name",
+ _("Name"),
+ _("The name of the web item"),
+ NULL,
+ flags));
+
+ g_object_class_install_property (gobject_class,
+ PROP_DESCRIPTION,
+ g_param_spec_string (
+ "description",
+ _("Description"),
+ _("The description of the web item"),
+ NULL,
+ flags));
+
+ g_object_class_install_property (gobject_class,
+ PROP_URI,
+ g_param_spec_string (
+ "uri",
+ _("URI"),
+ _("The URI of the web item"),
+ NULL,
+ flags));
+
+ g_object_class_install_property (gobject_class,
+ PROP_ICON,
+ g_param_spec_string (
+ "icon",
+ _("Icon"),
+ _("The icon of the web item"),
+ NULL,
+ flags));
+
+ g_object_class_install_property (gobject_class,
+ PROP_TOKEN,
+ g_param_spec_string (
+ "token",
+ _("Token"),
+ _("The token of the web item"),
+ NULL,
+ flags));
+}
+
+
+
+static void
+midori_web_item_init (MidoriWebItem* web_item)
+{
+ /* Nothing to do here */
+}
+
+static void
+midori_web_item_finalize (GObject* object)
+{
+ MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
+
+ g_free (web_item->name);
+ g_free (web_item->description);
+ g_free (web_item->uri);
+ g_free (web_item->icon);
+ g_free (web_item->token);
+
+ G_OBJECT_CLASS (midori_web_item_parent_class)->finalize (object);
+}
+
+static void
+midori_web_item_set_property (GObject* object,
+ guint prop_id,
+ const GValue* value,
+ GParamSpec* pspec)
+{
+ MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
+
+ switch (prop_id)
+ {
+ case PROP_NAME:
+ web_item->name = g_value_dup_string (value);
+ break;
+ case PROP_DESCRIPTION:
+ web_item->description = g_value_dup_string (value);
+ break;
+ case PROP_URI:
+ web_item->uri = g_value_dup_string (value);
+ break;
+ case PROP_ICON:
+ web_item->icon = g_value_dup_string (value);
+ break;
+ case PROP_TOKEN:
+ web_item->token = g_value_dup_string (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+midori_web_item_get_property (GObject* object,
+ guint prop_id,
+ GValue* value,
+ GParamSpec* pspec)
+{
+ MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
+
+ switch (prop_id)
+ {
+ case PROP_NAME:
+ g_value_set_string (value, web_item->name);
+ break;
+ case PROP_DESCRIPTION:
+ g_value_set_string (value, web_item->description);
+ break;
+ case PROP_URI:
+ g_value_set_string (value, web_item->uri);
+ break;
+ case PROP_ICON:
+ g_value_set_string (value, web_item->icon);
+ break;
+ case PROP_TOKEN:
+ g_value_set_string (value, web_item->token);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/**
+ * midori_web_item_new:
+ *
+ * Creates a new #MidoriWebItem.
+ *
+ * Return value: a new #MidoriWebItem
+ **/
+MidoriWebItem*
+midori_web_item_new (void)
+{
+ MidoriWebItem* web_item = g_object_new (MIDORI_TYPE_WEB_ITEM,
+ NULL);
+
+ return web_item;
+}
+
+/**
+ * midori_web_item_get_name:
+ * @web_item: a #MidoriWebItem
+ *
+ * Retrieves the name of @web_item.
+ *
+ * Return value: the name of the web item
+ **/
+const gchar*
+midori_web_item_get_name (MidoriWebItem* web_item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
+
+ return web_item->name;
+}
+
+/**
+ * midori_web_item_set_name:
+ * @web_item: a #MidoriWebItem
+ * @name: a string
+ *
+ * Sets the name of @web_item.
+ **/
+void
+midori_web_item_set_name (MidoriWebItem* web_item,
+ const gchar* name)
+{
+ g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
+
+ katze_assign (web_item->name, g_strdup (name));
+ g_object_notify (G_OBJECT (web_item), "name");
+}
+
+/**
+ * midori_web_item_get_description:
+ * @web_item: a #MidoriWebItem
+ *
+ * Retrieves the description of @web_item.
+ *
+ * Return value: the description of the web item
+ **/
+const gchar*
+midori_web_item_get_description (MidoriWebItem* web_item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
+
+ return web_item->description;
+}
+
+/**
+ * midori_web_item_set_description:
+ * @web_item: a #MidoriWebItem
+ * @description: a string
+ *
+ * Sets the description of @web_item.
+ **/
+void
+midori_web_item_set_description (MidoriWebItem* web_item,
+ const gchar* description)
+{
+ g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
+
+ katze_assign (web_item->description, g_strdup (description));
+ g_object_notify (G_OBJECT (web_item), "description");
+}
+
+/**
+ * midori_web_item_get_uri:
+ * @web_item: a #MidoriWebItem
+ *
+ * Retrieves the URI of @web_item.
+ *
+ * Return value: the URI of the web item
+ **/
+const gchar*
+midori_web_item_get_uri (MidoriWebItem* web_item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
+
+ return web_item->uri;
+}
+
+/**
+ * midori_web_item_set_uri:
+ * @web_item: a #MidoriWebItem
+ * @uri: a string
+ *
+ * Sets the URI of @web_item.
+ **/
+void
+midori_web_item_set_uri (MidoriWebItem* web_item,
+ const gchar* uri)
+{
+ g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
+
+ katze_assign (web_item->uri, g_strdup (uri));
+ g_object_notify (G_OBJECT (web_item), "uri");
+}
+
+/**
+ * midori_web_item_get_icon:
+ * @web_item: a #MidoriWebItem
+ *
+ * Retrieves the icon of @web_item.
+ *
+ * Return value: the icon of the web item
+ **/
+const gchar*
+midori_web_item_get_icon (MidoriWebItem* web_item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
+
+ return web_item->icon;
+}
+
+/**
+ * midori_web_item_set_icon:
+ * @web_item: a #MidoriWebItem
+ * @icon: a string
+ *
+ * Sets the icon of @web_item.
+ **/
+void
+midori_web_item_set_icon (MidoriWebItem* web_item,
+ const gchar* icon)
+{
+ g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
+
+ katze_assign (web_item->icon, g_strdup (icon));
+ g_object_notify (G_OBJECT (web_item), "icon");
+}
+
+/**
+ * midori_web_item_get_token:
+ * @web_item: a #MidoriWebItem
+ *
+ * Retrieves the token of @web_item.
+ *
+ * Return value: the token of the web item
+ **/
+const gchar*
+midori_web_item_get_token (MidoriWebItem* web_item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
+
+ return web_item->token;
+}
+
+/**
+ * midori_web_item_set_token:
+ * @web_item: a #MidoriWebItem
+ * @token: a string
+ *
+ * Sets the token of @web_item.
+ **/
+void
+midori_web_item_set_token (MidoriWebItem* web_item,
+ const gchar* token)
+{
+ g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
+
+ katze_assign (web_item->token, g_strdup (token));
+ g_object_notify (G_OBJECT (web_item), "token");
+}
--- /dev/null
+/*
+ Copyright (C) 2008 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 __MIDORI_WEB_ITEM_H__
+#define __MIDORI_WEB_ITEM_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define MIDORI_TYPE_WEB_ITEM \
+ (midori_web_item_get_type ())
+#define MIDORI_WEB_ITEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_WEB_ITEM, MidoriWebItem))
+#define MIDORI_WEB_ITEM_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_WEB_ITEM, MidoriWebItemClass))
+#define MIDORI_IS_WEB_ITEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_WEB_ITEM))
+#define MIDORI_IS_WEB_ITEM_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_WEB_ITEM))
+#define MIDORI_WEB_ITEM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_WEB_ITEM, MidoriWebItemClass))
+
+typedef struct _MidoriWebItem MidoriWebItem;
+typedef struct _MidoriWebItemClass MidoriWebItemClass;
+
+struct _MidoriWebItemClass
+{
+ GObjectClass parent_class;
+};
+
+GType
+midori_web_item_get_type (void);
+
+MidoriWebItem*
+midori_web_item_new (void);
+
+const gchar*
+midori_web_item_get_name (MidoriWebItem* web_item);
+
+void
+midori_web_item_set_name (MidoriWebItem* web_item,
+ const gchar* name);
+
+const gchar*
+midori_web_item_get_description (MidoriWebItem* web_item);
+
+void
+midori_web_item_set_description (MidoriWebItem* web_item,
+ const gchar* description);
+
+const gchar*
+midori_web_item_get_uri (MidoriWebItem* web_item);
+
+void
+midori_web_item_set_uri (MidoriWebItem* web_item,
+ const gchar* uri);
+
+const gchar*
+midori_web_item_get_icon (MidoriWebItem* web_item);
+
+void
+midori_web_item_set_icon (MidoriWebItem* web_item,
+ const gchar* icon);
+
+const gchar*
+midori_web_item_get_token (MidoriWebItem* web_item);
+
+void
+midori_web_item_set_token (MidoriWebItem* web_item,
+ const gchar* token);
+
+G_END_DECLS
+
+#endif /* __MIDORI_WEB_ITEM_H__ */
--- /dev/null
+/*
+ Copyright (C) 2008 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-weblist.h"
+
+#include "katze-utils.h"
+
+#include <glib/gi18n.h>
+#include <string.h>
+
+/**
+ * SECTION:midori-weblist
+ * @short_description: A versatile object container
+ * @see_also: #MidoriWebItem
+ *
+ * #MidoriWebList is a versatile container for objects with
+ * explicit support for #MidoriWebList and #MidoriWebItem children.
+ */
+
+struct _MidoriWebList
+{
+ GObject parent_instance;
+
+ GList* items;
+};
+
+G_DEFINE_TYPE (MidoriWebList, midori_web_list, G_TYPE_OBJECT)
+
+enum {
+ ADD_ITEM,
+ REMOVE_ITEM,
+
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
+static void
+midori_web_list_finalize (GObject* object);
+
+static void
+_midori_web_list_add_item (MidoriWebList* web_list,
+ GObject* item)
+{
+ g_object_ref (item);
+ web_list->items = g_list_append (web_list->items, item);
+}
+
+static void
+_midori_web_list_remove_item (MidoriWebList* web_list,
+ GObject* item)
+{
+ web_list->items = g_list_remove (web_list->items, item);
+ g_object_unref (item);
+}
+
+static void
+midori_web_list_class_init (MidoriWebListClass* class)
+{
+ signals[ADD_ITEM] = g_signal_new (
+ "add-item",
+ G_TYPE_FROM_CLASS (class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MidoriWebListClass, add_item),
+ 0,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ G_TYPE_OBJECT);
+
+ signals[REMOVE_ITEM] = g_signal_new (
+ "remove-item",
+ G_TYPE_FROM_CLASS (class),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ G_STRUCT_OFFSET (MidoriWebListClass, remove_item),
+ 0,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ G_TYPE_OBJECT);
+
+ class->add_item = _midori_web_list_add_item;
+ class->remove_item = _midori_web_list_remove_item;
+
+ GObjectClass* gobject_class = G_OBJECT_CLASS (class);
+ gobject_class->finalize = midori_web_list_finalize;
+}
+
+static void
+midori_web_list_init (MidoriWebList* web_list)
+{
+ web_list->items = NULL;
+}
+
+static void
+midori_web_list_finalize (GObject* object)
+{
+ MidoriWebList* web_list = MIDORI_WEB_LIST (object);
+ guint n, i;
+
+ /* Scruffily remove all items, no need for signals */
+ n = g_list_length (web_list->items);
+ for (i = 0; i < n; i++)
+ g_object_unref (g_list_nth_data (web_list->items, i));
+ g_list_free (web_list->items);
+
+ G_OBJECT_CLASS (midori_web_list_parent_class)->finalize (object);
+}
+
+/**
+ * midori_web_list_new:
+ *
+ * Creates a new #MidoriWebList.
+ *
+ * Return value: a new #MidoriWebList
+ **/
+MidoriWebList*
+midori_web_list_new (void)
+{
+ MidoriWebList* web_list = g_object_new (MIDORI_TYPE_WEB_LIST,
+ NULL);
+
+ return web_list;
+}
+
+/**
+ * midori_web_list_add_item:
+ * @web_list: a #MidoriWebList
+ * @item: a #GObject
+ *
+ * Adds an item to the list.
+ **/
+void
+midori_web_list_add_item (MidoriWebList* web_list,
+ gpointer item)
+{
+ g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
+ g_return_if_fail (G_IS_OBJECT (item));
+
+ g_signal_emit (web_list, signals[ADD_ITEM], 0, item);
+}
+
+/**
+ * midori_web_list_add_item:
+ * @web_list: a #MidoriWebList
+ * @item: a #GObject
+ *
+ * Removes an item from the list.
+ **/
+void
+midori_web_list_remove_item (MidoriWebList* web_list,
+ gpointer item)
+{
+ g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
+ g_return_if_fail (G_IS_OBJECT (item));
+
+ g_signal_emit (web_list, signals[REMOVE_ITEM], 0, item);
+}
+
+/**
+ * midori_web_list_get_nth_item:
+ * @web_list: a #MidoriWebList
+ * @n: an index in the list
+ *
+ * Retrieves the item in @web_list at the position @n.
+ *
+ * Return value: an item, or %NULL
+ **/
+gpointer
+midori_web_list_get_nth_item (MidoriWebList* web_list,
+ guint n)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), NULL);
+
+ return g_list_nth_data (web_list->items, n);
+}
+
+/**
+ * midori_web_list_is_empty:
+ * @web_list: a #MidoriWebList
+ *
+ * Determines if @web_list is empty.
+ *
+ * Return value: an item, or %NULL
+ **/
+gboolean
+midori_web_list_is_empty (MidoriWebList* web_list)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), TRUE);
+
+ return !g_list_nth_data (web_list->items, 0);
+}
+
+/**
+ * midori_web_list_get_item_position:
+ * @web_list: a #MidoriWebList
+ * @item: an item in the list
+ *
+ * Retrieves the index of the item in @web_list.
+ *
+ * Return value: an item, or -1
+ **/
+gint
+midori_web_list_get_item_index (MidoriWebList* web_list,
+ gpointer item)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), -1);
+ g_return_val_if_fail (G_IS_OBJECT (item), -1);
+
+ return g_list_index (web_list->items, item);
+}
+
+/**
+ * midori_web_list_find_token:
+ * @web_list: a #MidoriWebList
+ * @token: a token string
+ *
+ * Looks up an item in the list which has the specified token.
+ *
+ * Supported is #MidoriWebItem.
+ *
+ * Note that @token is by definition unique to one item.
+ *
+ * Return value: an item, or %NULL
+ **/
+gpointer
+midori_web_list_find_token (MidoriWebList* web_list,
+ const gchar* token)
+{
+ guint n, i;
+ GObject* item;
+ MidoriWebItem* web_item;
+
+ g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), NULL);
+
+ n = g_list_length (web_list->items);
+ for (i = 0; i < n; i++)
+ {
+ item = (GObject*)g_list_nth_data (web_list->items, i);
+ if (!MIDORI_IS_WEB_ITEM (item))
+ continue;
+ web_item = (MidoriWebItem*)item;
+ if (!strcmp (midori_web_item_get_token (web_item), token))
+ return item;
+ }
+ return NULL;
+}
+
+/**
+ * midori_web_list_get_length:
+ * @web_list: a #MidoriWebList
+ *
+ * Retrieves the number of items in @web_list.
+ *
+ * Return value: the length of the list
+ **/
+guint
+midori_web_list_get_length (MidoriWebList* web_list)
+{
+ g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), 0);
+
+ return g_list_length (web_list->items);
+}
+
+/**
+ * midori_web_list_clear:
+ * @web_list: a #MidoriWebList
+ *
+ * Deletes all items currently contained in @web_list.
+ **/
+void
+midori_web_list_clear (MidoriWebList* web_list)
+{
+ guint n;
+ guint i;
+ GObject* item;
+
+ g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
+
+ n = g_list_length (web_list->items);
+ for (i = 0; i < n; i++)
+ {
+ if ((item = g_list_nth_data (web_list->items, i)))
+ midori_web_list_remove_item (web_list, item);
+ }
+ g_list_free (web_list->items);
+ web_list->items = NULL;
+}
--- /dev/null
+/*
+ Copyright (C) 2008 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 __MIDORI_WEB_LIST_H__
+#define __MIDORI_WEB_LIST_H__
+
+#include "katze-webitem.h"
+
+G_BEGIN_DECLS
+
+#define MIDORI_TYPE_WEB_LIST \
+ (midori_web_list_get_type ())
+#define MIDORI_WEB_LIST(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_WEB_LIST, MidoriWebList))
+#define MIDORI_WEB_LIST_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_WEB_LIST, MidoriWebListClass))
+#define MIDORI_IS_WEB_LIST(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_WEB_LIST))
+#define MIDORI_IS_WEB_LIST_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_WEB_LIST))
+#define MIDORI_WEB_LIST_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_WEB_LIST, MidoriWebListClass))
+
+typedef struct _MidoriWebList MidoriWebList;
+typedef struct _MidoriWebListClass MidoriWebListClass;
+
+struct _MidoriWebListClass
+{
+ GObjectClass parent_class;
+
+ /* Signals */
+ void
+ (*add_item) (MidoriWebList* web_list,
+ GObject* item);
+ void
+ (*remove_item) (MidoriWebList* web_list,
+ GObject* item);
+};
+
+GType
+midori_web_list_get_type (void);
+
+MidoriWebList*
+midori_web_list_new (void);
+
+void
+midori_web_list_add_item (MidoriWebList* web_list,
+ gpointer item);
+
+void
+midori_web_list_remove_item (MidoriWebList* web_list,
+ gpointer item);
+
+gpointer
+midori_web_list_get_nth_item (MidoriWebList* web_list,
+ guint n);
+
+gboolean
+midori_web_list_is_empty (MidoriWebList* web_list);
+
+gint
+midori_web_list_get_item_index (MidoriWebList* web_list,
+ gpointer item);
+
+gpointer
+midori_web_list_find_token (MidoriWebList* web_list,
+ const gchar* token);
+
+guint
+midori_web_list_get_length (MidoriWebList* web_list);
+
+void
+midori_web_list_clear (MidoriWebList* web_list);
+
+G_END_DECLS
+
+#endif /* __MIDORI_WEB_LIST_H__ */
#include "katze-throbber.h"
#include "katze-utils.h"
+#include "katze-webitem.h"
+#include "katze-weblist.h"
#include "katze-xbel.h"
#endif /* __KATZE_H__ */
midori_SOURCES = \
main.c main.h \
- gtkiconentry.c gtkiconentry.h \
- midori-webitem.c midori-webitem.h \
- midori-weblist.c midori-weblist.h \
+ gtkiconentry.c gtkiconentry.h \
midori-app.c midori-app.h \
midori-browser.c midori-browser.h \
midori-panel.c midori-panel.h \
#include "midori-app.h"
#include "midori-websettings.h"
#include "midori-browser.h"
-#include "midori-weblist.h"
#include "gjs.h"
#include <string.h>
#include "midori-app.h"
-#include "midori-weblist.h"
-
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "midori-browser.h"
#include "midori-websettings.h"
-#include "midori-weblist.h"
G_BEGIN_DECLS
PROP_SHADOW_TYPE,
g_param_spec_enum (
"shadow-type",
- "Shadow Type",
+ _("Shadow Type"),
_("Appearance of the shadow around each panel"),
GTK_TYPE_SHADOW_TYPE,
GTK_SHADOW_NONE,
PROP_MENU,
g_param_spec_object (
"menu",
- "Menu",
+ _("Menu"),
_("Menu to hold panel items"),
GTK_TYPE_MENU,
G_PARAM_READWRITE));
PROP_PAGE,
g_param_spec_int (
"page",
- "Page",
+ _("Page"),
_("The index of the current page"),
-1, G_MAXINT, -1,
flags));
#include "sokoke.h"
-#include <katze/katze.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#ifndef __MIDORI_SEARCH_ENTRY_H__
#define __MIDORI_SEARCH_ENTRY_H__
-#include "midori-weblist.h"
#include "gtkiconentry.h"
+#include <katze/katze.h>
+
#include <gtk/gtk.h>
G_BEGIN_DECLS
+++ /dev/null
-/*
- Copyright (C) 2008 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 "midori-webitem.h"
-
-#include <glib/gi18n.h>
-#include <katze/katze.h>
-
-struct _MidoriWebItem
-{
- GObject parent_instance;
-
- gchar* name;
- gchar* description;
- gchar* uri;
- gchar* icon;
- gchar* token;
-};
-
-G_DEFINE_TYPE (MidoriWebItem, midori_web_item, G_TYPE_OBJECT)
-
-enum
-{
- PROP_0,
-
- PROP_NAME,
- PROP_DESCRIPTION,
- PROP_URI,
- PROP_ICON,
- PROP_TOKEN
-};
-
-static void
-midori_web_item_finalize (GObject* object);
-
-static void
-midori_web_item_set_property (GObject* object,
- guint prop_id,
- const GValue* value,
- GParamSpec* pspec);
-
-static void
-midori_web_item_get_property (GObject* object,
- guint prop_id,
- GValue* value,
- GParamSpec* pspec);
-
-static void
-midori_web_item_class_init (MidoriWebItemClass* class)
-{
- GObjectClass* gobject_class = G_OBJECT_CLASS (class);
- gobject_class->finalize = midori_web_item_finalize;
- gobject_class->set_property = midori_web_item_set_property;
- gobject_class->get_property = midori_web_item_get_property;
-
- GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
-
- g_object_class_install_property (gobject_class,
- PROP_NAME,
- g_param_spec_string (
- "name",
- _("Name"),
- _("The name of the web item"),
- NULL,
- flags));
-
- g_object_class_install_property (gobject_class,
- PROP_DESCRIPTION,
- g_param_spec_string (
- "description",
- _("Description"),
- _("The description of the web item"),
- NULL,
- flags));
-
- g_object_class_install_property (gobject_class,
- PROP_URI,
- g_param_spec_string (
- "uri",
- _("URI"),
- _("The URI of the web item"),
- NULL,
- flags));
-
- g_object_class_install_property (gobject_class,
- PROP_ICON,
- g_param_spec_string (
- "icon",
- _("Icon"),
- _("The icon of the web item"),
- NULL,
- flags));
-
- g_object_class_install_property (gobject_class,
- PROP_TOKEN,
- g_param_spec_string (
- "token",
- _("Token"),
- _("The token of the web item"),
- NULL,
- flags));
-}
-
-
-
-static void
-midori_web_item_init (MidoriWebItem* web_item)
-{
- /* Nothing to do here */
-}
-
-static void
-midori_web_item_finalize (GObject* object)
-{
- MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
-
- g_free (web_item->name);
- g_free (web_item->description);
- g_free (web_item->uri);
- g_free (web_item->icon);
- g_free (web_item->token);
-
- G_OBJECT_CLASS (midori_web_item_parent_class)->finalize (object);
-}
-
-static void
-midori_web_item_set_property (GObject* object,
- guint prop_id,
- const GValue* value,
- GParamSpec* pspec)
-{
- MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
-
- switch (prop_id)
- {
- case PROP_NAME:
- web_item->name = g_value_dup_string (value);
- break;
- case PROP_DESCRIPTION:
- web_item->description = g_value_dup_string (value);
- break;
- case PROP_URI:
- web_item->uri = g_value_dup_string (value);
- break;
- case PROP_ICON:
- web_item->icon = g_value_dup_string (value);
- break;
- case PROP_TOKEN:
- web_item->token = g_value_dup_string (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-midori_web_item_get_property (GObject* object,
- guint prop_id,
- GValue* value,
- GParamSpec* pspec)
-{
- MidoriWebItem* web_item = MIDORI_WEB_ITEM (object);
-
- switch (prop_id)
- {
- case PROP_NAME:
- g_value_set_string (value, web_item->name);
- break;
- case PROP_DESCRIPTION:
- g_value_set_string (value, web_item->description);
- break;
- case PROP_URI:
- g_value_set_string (value, web_item->uri);
- break;
- case PROP_ICON:
- g_value_set_string (value, web_item->icon);
- break;
- case PROP_TOKEN:
- g_value_set_string (value, web_item->token);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/**
- * midori_web_item_new:
- *
- * Creates a new #MidoriWebItem.
- *
- * Return value: a new #MidoriWebItem
- **/
-MidoriWebItem*
-midori_web_item_new (void)
-{
- MidoriWebItem* web_item = g_object_new (MIDORI_TYPE_WEB_ITEM,
- NULL);
-
- return web_item;
-}
-
-/**
- * midori_web_item_get_name:
- * @web_item: a #MidoriWebItem
- *
- * Retrieves the name of @web_item.
- *
- * Return value: the name of the web item
- **/
-const gchar*
-midori_web_item_get_name (MidoriWebItem* web_item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
-
- return web_item->name;
-}
-
-/**
- * midori_web_item_set_name:
- * @web_item: a #MidoriWebItem
- * @name: a string
- *
- * Sets the name of @web_item.
- **/
-void
-midori_web_item_set_name (MidoriWebItem* web_item,
- const gchar* name)
-{
- g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
-
- katze_assign (web_item->name, g_strdup (name));
- g_object_notify (G_OBJECT (web_item), "name");
-}
-
-/**
- * midori_web_item_get_description:
- * @web_item: a #MidoriWebItem
- *
- * Retrieves the description of @web_item.
- *
- * Return value: the description of the web item
- **/
-const gchar*
-midori_web_item_get_description (MidoriWebItem* web_item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
-
- return web_item->description;
-}
-
-/**
- * midori_web_item_set_description:
- * @web_item: a #MidoriWebItem
- * @description: a string
- *
- * Sets the description of @web_item.
- **/
-void
-midori_web_item_set_description (MidoriWebItem* web_item,
- const gchar* description)
-{
- g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
-
- katze_assign (web_item->description, g_strdup (description));
- g_object_notify (G_OBJECT (web_item), "description");
-}
-
-/**
- * midori_web_item_get_uri:
- * @web_item: a #MidoriWebItem
- *
- * Retrieves the URI of @web_item.
- *
- * Return value: the URI of the web item
- **/
-const gchar*
-midori_web_item_get_uri (MidoriWebItem* web_item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
-
- return web_item->uri;
-}
-
-/**
- * midori_web_item_set_uri:
- * @web_item: a #MidoriWebItem
- * @uri: a string
- *
- * Sets the URI of @web_item.
- **/
-void
-midori_web_item_set_uri (MidoriWebItem* web_item,
- const gchar* uri)
-{
- g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
-
- katze_assign (web_item->uri, g_strdup (uri));
- g_object_notify (G_OBJECT (web_item), "uri");
-}
-
-/**
- * midori_web_item_get_icon:
- * @web_item: a #MidoriWebItem
- *
- * Retrieves the icon of @web_item.
- *
- * Return value: the icon of the web item
- **/
-const gchar*
-midori_web_item_get_icon (MidoriWebItem* web_item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
-
- return web_item->icon;
-}
-
-/**
- * midori_web_item_set_icon:
- * @web_item: a #MidoriWebItem
- * @icon: a string
- *
- * Sets the icon of @web_item.
- **/
-void
-midori_web_item_set_icon (MidoriWebItem* web_item,
- const gchar* icon)
-{
- g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
-
- katze_assign (web_item->icon, g_strdup (icon));
- g_object_notify (G_OBJECT (web_item), "icon");
-}
-
-/**
- * midori_web_item_get_token:
- * @web_item: a #MidoriWebItem
- *
- * Retrieves the token of @web_item.
- *
- * Return value: the token of the web item
- **/
-const gchar*
-midori_web_item_get_token (MidoriWebItem* web_item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_ITEM (web_item), NULL);
-
- return web_item->token;
-}
-
-/**
- * midori_web_item_set_token:
- * @web_item: a #MidoriWebItem
- * @token: a string
- *
- * Sets the token of @web_item.
- **/
-void
-midori_web_item_set_token (MidoriWebItem* web_item,
- const gchar* token)
-{
- g_return_if_fail (MIDORI_IS_WEB_ITEM (web_item));
-
- katze_assign (web_item->token, g_strdup (token));
- g_object_notify (G_OBJECT (web_item), "token");
-}
+++ /dev/null
-/*
- Copyright (C) 2008 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 __MIDORI_WEB_ITEM_H__
-#define __MIDORI_WEB_ITEM_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define MIDORI_TYPE_WEB_ITEM \
- (midori_web_item_get_type ())
-#define MIDORI_WEB_ITEM(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_WEB_ITEM, MidoriWebItem))
-#define MIDORI_WEB_ITEM_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_WEB_ITEM, MidoriWebItemClass))
-#define MIDORI_IS_WEB_ITEM(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_WEB_ITEM))
-#define MIDORI_IS_WEB_ITEM_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_WEB_ITEM))
-#define MIDORI_WEB_ITEM_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_WEB_ITEM, MidoriWebItemClass))
-
-typedef struct _MidoriWebItem MidoriWebItem;
-typedef struct _MidoriWebItemClass MidoriWebItemClass;
-
-struct _MidoriWebItemClass
-{
- GObjectClass parent_class;
-};
-
-GType
-midori_web_item_get_type (void);
-
-MidoriWebItem*
-midori_web_item_new (void);
-
-const gchar*
-midori_web_item_get_name (MidoriWebItem* web_item);
-
-void
-midori_web_item_set_name (MidoriWebItem* web_item,
- const gchar* name);
-
-const gchar*
-midori_web_item_get_description (MidoriWebItem* web_item);
-
-void
-midori_web_item_set_description (MidoriWebItem* web_item,
- const gchar* description);
-
-const gchar*
-midori_web_item_get_uri (MidoriWebItem* web_item);
-
-void
-midori_web_item_set_uri (MidoriWebItem* web_item,
- const gchar* uri);
-
-const gchar*
-midori_web_item_get_icon (MidoriWebItem* web_item);
-
-void
-midori_web_item_set_icon (MidoriWebItem* web_item,
- const gchar* icon);
-
-const gchar*
-midori_web_item_get_token (MidoriWebItem* web_item);
-
-void
-midori_web_item_set_token (MidoriWebItem* web_item,
- const gchar* token);
-
-G_END_DECLS
-
-#endif /* __MIDORI_WEB_ITEM_H__ */
+++ /dev/null
-/*
- Copyright (C) 2008 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 "midori-weblist.h"
-
-#include <glib/gi18n.h>
-#include <string.h>
-
-/**
- * SECTION:midori-weblist
- * @short_description: A versatile object container
- * @see_also: #MidoriWebItem
- *
- * #MidoriWebList is a versatile container for objects with
- * explicit support for #MidoriWebList and #MidoriWebItem children.
- */
-
-struct _MidoriWebList
-{
- GObject parent_instance;
-
- GList* items;
-};
-
-G_DEFINE_TYPE (MidoriWebList, midori_web_list, G_TYPE_OBJECT)
-
-enum {
- ADD_ITEM,
- REMOVE_ITEM,
-
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL];
-
-static void
-midori_web_list_finalize (GObject* object);
-
-static void
-_midori_web_list_add_item (MidoriWebList* web_list,
- GObject* item)
-{
- g_object_ref (item);
- web_list->items = g_list_append (web_list->items, item);
-}
-
-static void
-_midori_web_list_remove_item (MidoriWebList* web_list,
- GObject* item)
-{
- web_list->items = g_list_remove (web_list->items, item);
- g_object_unref (item);
-}
-
-static void
-midori_web_list_class_init (MidoriWebListClass* class)
-{
- signals[ADD_ITEM] = g_signal_new (
- "add-item",
- G_TYPE_FROM_CLASS (class),
- (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
- G_STRUCT_OFFSET (MidoriWebListClass, add_item),
- 0,
- NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- signals[REMOVE_ITEM] = g_signal_new (
- "remove-item",
- G_TYPE_FROM_CLASS (class),
- (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
- G_STRUCT_OFFSET (MidoriWebListClass, remove_item),
- 0,
- NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- class->add_item = _midori_web_list_add_item;
- class->remove_item = _midori_web_list_remove_item;
-
- GObjectClass* gobject_class = G_OBJECT_CLASS (class);
- gobject_class->finalize = midori_web_list_finalize;
-}
-
-static void
-midori_web_list_init (MidoriWebList* web_list)
-{
- web_list->items = NULL;
-}
-
-static void
-midori_web_list_finalize (GObject* object)
-{
- MidoriWebList* web_list = MIDORI_WEB_LIST (object);
- guint n, i;
-
- /* Scruffily remove all items, no need for signals */
- n = g_list_length (web_list->items);
- for (i = 0; i < n; i++)
- g_object_unref (g_list_nth_data (web_list->items, i));
- g_list_free (web_list->items);
-
- G_OBJECT_CLASS (midori_web_list_parent_class)->finalize (object);
-}
-
-/**
- * midori_web_list_new:
- *
- * Creates a new #MidoriWebList.
- *
- * Return value: a new #MidoriWebList
- **/
-MidoriWebList*
-midori_web_list_new (void)
-{
- MidoriWebList* web_list = g_object_new (MIDORI_TYPE_WEB_LIST,
- NULL);
-
- return web_list;
-}
-
-/**
- * midori_web_list_add_item:
- * @web_list: a #MidoriWebList
- * @item: a #GObject
- *
- * Adds an item to the list.
- **/
-void
-midori_web_list_add_item (MidoriWebList* web_list,
- gpointer item)
-{
- g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
- g_return_if_fail (G_IS_OBJECT (item));
-
- g_signal_emit (web_list, signals[ADD_ITEM], 0, item);
-}
-
-/**
- * midori_web_list_add_item:
- * @web_list: a #MidoriWebList
- * @item: a #GObject
- *
- * Removes an item from the list.
- **/
-void
-midori_web_list_remove_item (MidoriWebList* web_list,
- gpointer item)
-{
- g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
- g_return_if_fail (G_IS_OBJECT (item));
-
- g_signal_emit (web_list, signals[REMOVE_ITEM], 0, item);
-}
-
-/**
- * midori_web_list_get_nth_item:
- * @web_list: a #MidoriWebList
- * @n: an index in the list
- *
- * Retrieves the item in @web_list at the position @n.
- *
- * Return value: an item, or %NULL
- **/
-gpointer
-midori_web_list_get_nth_item (MidoriWebList* web_list,
- guint n)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), NULL);
-
- return g_list_nth_data (web_list->items, n);
-}
-
-/**
- * midori_web_list_is_empty:
- * @web_list: a #MidoriWebList
- *
- * Determines if @web_list is empty.
- *
- * Return value: an item, or %NULL
- **/
-gboolean
-midori_web_list_is_empty (MidoriWebList* web_list)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), TRUE);
-
- return !g_list_nth_data (web_list->items, 0);
-}
-
-/**
- * midori_web_list_get_item_position:
- * @web_list: a #MidoriWebList
- * @item: an item in the list
- *
- * Retrieves the index of the item in @web_list.
- *
- * Return value: an item, or -1
- **/
-gint
-midori_web_list_get_item_index (MidoriWebList* web_list,
- gpointer item)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), -1);
- g_return_val_if_fail (G_IS_OBJECT (item), -1);
-
- return g_list_index (web_list->items, item);
-}
-
-/**
- * midori_web_list_find_token:
- * @web_list: a #MidoriWebList
- * @token: a token string
- *
- * Looks up an item in the list which has the specified token.
- *
- * Supported is #MidoriWebItem.
- *
- * Note that @token is by definition unique to one item.
- *
- * Return value: an item, or %NULL
- **/
-gpointer
-midori_web_list_find_token (MidoriWebList* web_list,
- const gchar* token)
-{
- guint n, i;
- GObject* item;
- MidoriWebItem* web_item;
-
- g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), NULL);
-
- n = g_list_length (web_list->items);
- for (i = 0; i < n; i++)
- {
- item = (GObject*)g_list_nth_data (web_list->items, i);
- if (!MIDORI_IS_WEB_ITEM (item))
- continue;
- web_item = (MidoriWebItem*)item;
- if (!strcmp (midori_web_item_get_token (web_item), token))
- return item;
- }
- return NULL;
-}
-
-/**
- * midori_web_list_get_length:
- * @web_list: a #MidoriWebList
- *
- * Retrieves the number of items in @web_list.
- *
- * Return value: the length of the list
- **/
-guint
-midori_web_list_get_length (MidoriWebList* web_list)
-{
- g_return_val_if_fail (MIDORI_IS_WEB_LIST (web_list), 0);
-
- return g_list_length (web_list->items);
-}
-
-/**
- * midori_web_list_clear:
- * @web_list: a #MidoriWebList
- *
- * Deletes all items currently contained in @web_list.
- **/
-void
-midori_web_list_clear (MidoriWebList* web_list)
-{
- guint n;
- guint i;
- GObject* item;
-
- g_return_if_fail (MIDORI_IS_WEB_LIST (web_list));
-
- n = g_list_length (web_list->items);
- for (i = 0; i < n; i++)
- {
- if ((item = g_list_nth_data (web_list->items, i)))
- midori_web_list_remove_item (web_list, item);
- }
- g_list_free (web_list->items);
- web_list->items = NULL;
-}
+++ /dev/null
-/*
- Copyright (C) 2008 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 __MIDORI_WEB_LIST_H__
-#define __MIDORI_WEB_LIST_H__
-
-#include "midori-webitem.h"
-
-G_BEGIN_DECLS
-
-#define MIDORI_TYPE_WEB_LIST \
- (midori_web_list_get_type ())
-#define MIDORI_WEB_LIST(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_WEB_LIST, MidoriWebList))
-#define MIDORI_WEB_LIST_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_WEB_LIST, MidoriWebListClass))
-#define MIDORI_IS_WEB_LIST(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_WEB_LIST))
-#define MIDORI_IS_WEB_LIST_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_WEB_LIST))
-#define MIDORI_WEB_LIST_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_WEB_LIST, MidoriWebListClass))
-
-typedef struct _MidoriWebList MidoriWebList;
-typedef struct _MidoriWebListClass MidoriWebListClass;
-
-struct _MidoriWebListClass
-{
- GObjectClass parent_class;
-
- /* Signals */
- void
- (*add_item) (MidoriWebList* web_list,
- GObject* item);
- void
- (*remove_item) (MidoriWebList* web_list,
- GObject* item);
-};
-
-GType
-midori_web_list_get_type (void);
-
-MidoriWebList*
-midori_web_list_new (void);
-
-void
-midori_web_list_add_item (MidoriWebList* web_list,
- gpointer item);
-
-void
-midori_web_list_remove_item (MidoriWebList* web_list,
- gpointer item);
-
-gpointer
-midori_web_list_get_nth_item (MidoriWebList* web_list,
- guint n);
-
-gboolean
-midori_web_list_is_empty (MidoriWebList* web_list);
-
-gint
-midori_web_list_get_item_index (MidoriWebList* web_list,
- gpointer item);
-
-gpointer
-midori_web_list_find_token (MidoriWebList* web_list,
- const gchar* token);
-
-guint
-midori_web_list_get_length (MidoriWebList* web_list);
-
-void
-midori_web_list_clear (MidoriWebList* web_list);
-
-G_END_DECLS
-
-#endif /* __MIDORI_WEB_LIST_H__ */
#define __MIDORI_WEB_VIEW_H__
#include "midori-websettings.h"
-#include "midori-weblist.h"
#include <katze/katze.h>
#include <webkit/webkit.h>
#include "sokoke.h"
-#include "midori-webitem.h"
-
#include "config.h"
#include "main.h"
#ifndef __SOKOKE_H__
#define __SOKOKE_H__ 1
-#include "midori-weblist.h"
+#include <katze/katze.h>
#include <gtk/gtk.h>
midori/midori-websettings.c
midori/midori-webview.c
midori/midori-preferences.c
-midori/midori-webitem.c
-midori/midori-weblist.c
midori/midori-searchentry.c
midori/sokoke.c
midori/gjs.c
katze/katze-throbber.c
katze/katze-utils.c
+katze/katze-webitem.c
+katze/katze-weblist.c
katze/katze-xbel.c