From: Christian Dywan Date: Tue, 5 Aug 2008 03:03:05 +0000 (+0200) Subject: Move MidoriWebList and MidoriWebItem to Katze X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a41a0e008e74de71922f379180dea9355c8acf64;p=midori Move MidoriWebList and MidoriWebItem to Katze --- diff --git a/katze/Makefile.am b/katze/Makefile.am index ba058a4f..ed4128d6 100644 --- a/katze/Makefile.am +++ b/katze/Makefile.am @@ -14,4 +14,6 @@ libkatze_la_SOURCES = \ 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 diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 34f3510b..b8ea1847 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -11,6 +11,8 @@ #include "katze-throbber.h" +#include "katze-utils.h" + #include #include diff --git a/katze/katze-throbber.h b/katze/katze-throbber.h index 7a459129..b4ef681c 100644 --- a/katze/katze-throbber.h +++ b/katze/katze-throbber.h @@ -15,8 +15,6 @@ #include #include -#include "katze-utils.h" - G_BEGIN_DECLS #define KATZE_TYPE_THROBBER \ diff --git a/katze/katze-webitem.c b/katze/katze-webitem.c new file mode 100644 index 00000000..cd2927f5 --- /dev/null +++ b/katze/katze-webitem.c @@ -0,0 +1,376 @@ +/* + Copyright (C) 2008 Christian Dywan + + 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 + +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"); +} diff --git a/katze/katze-webitem.h b/katze/katze-webitem.h new file mode 100644 index 00000000..c1276ab3 --- /dev/null +++ b/katze/katze-webitem.h @@ -0,0 +1,83 @@ +/* + Copyright (C) 2008 Christian Dywan + + 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 + +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__ */ diff --git a/katze/katze-weblist.c b/katze/katze-weblist.c new file mode 100644 index 00000000..e4abd211 --- /dev/null +++ b/katze/katze-weblist.c @@ -0,0 +1,296 @@ +/* + Copyright (C) 2008 Christian Dywan + + 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 +#include + +/** + * 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; +} diff --git a/katze/katze-weblist.h b/katze/katze-weblist.h new file mode 100644 index 00000000..4f74cf4b --- /dev/null +++ b/katze/katze-weblist.h @@ -0,0 +1,85 @@ +/* + Copyright (C) 2008 Christian Dywan + + 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__ */ diff --git a/katze/katze.h b/katze/katze.h index e0e72c9a..5523a131 100644 --- a/katze/katze.h +++ b/katze/katze.h @@ -14,6 +14,8 @@ #include "katze-throbber.h" #include "katze-utils.h" +#include "katze-webitem.h" +#include "katze-weblist.h" #include "katze-xbel.h" #endif /* __KATZE_H__ */ diff --git a/midori/Makefile.am b/midori/Makefile.am index 71629568..b3a009b7 100644 --- a/midori/Makefile.am +++ b/midori/Makefile.am @@ -20,9 +20,7 @@ bin_PROGRAMS = \ 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 \ diff --git a/midori/main.c b/midori/main.c index 4f89a358..0b064ae1 100644 --- a/midori/main.c +++ b/midori/main.c @@ -16,7 +16,6 @@ #include "midori-app.h" #include "midori-websettings.h" #include "midori-browser.h" -#include "midori-weblist.h" #include "gjs.h" #include diff --git a/midori/midori-app.c b/midori/midori-app.c index fab0b780..58335a2f 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -11,8 +11,6 @@ #include "midori-app.h" -#include "midori-weblist.h" - #include #include diff --git a/midori/midori-app.h b/midori/midori-app.h index 9372d7e5..6735a98c 100644 --- a/midori/midori-app.h +++ b/midori/midori-app.h @@ -16,7 +16,6 @@ #include "midori-browser.h" #include "midori-websettings.h" -#include "midori-weblist.h" G_BEGIN_DECLS diff --git a/midori/midori-panel.c b/midori/midori-panel.c index 22e153c4..794d37e1 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -143,7 +143,7 @@ midori_panel_class_init (MidoriPanelClass* class) 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, @@ -153,7 +153,7 @@ midori_panel_class_init (MidoriPanelClass* class) PROP_MENU, g_param_spec_object ( "menu", - "Menu", + _("Menu"), _("Menu to hold panel items"), GTK_TYPE_MENU, G_PARAM_READWRITE)); @@ -162,7 +162,7 @@ midori_panel_class_init (MidoriPanelClass* class) PROP_PAGE, g_param_spec_int ( "page", - "Page", + _("Page"), _("The index of the current page"), -1, G_MAXINT, -1, flags)); diff --git a/midori/midori-searchentry.c b/midori/midori-searchentry.c index bc2ceff4..7f5a5a65 100644 --- a/midori/midori-searchentry.c +++ b/midori/midori-searchentry.c @@ -13,7 +13,6 @@ #include "sokoke.h" -#include #include #include diff --git a/midori/midori-searchentry.h b/midori/midori-searchentry.h index ec379dd9..ac7b794e 100644 --- a/midori/midori-searchentry.h +++ b/midori/midori-searchentry.h @@ -12,9 +12,10 @@ #ifndef __MIDORI_SEARCH_ENTRY_H__ #define __MIDORI_SEARCH_ENTRY_H__ -#include "midori-weblist.h" #include "gtkiconentry.h" +#include + #include G_BEGIN_DECLS diff --git a/midori/midori-webitem.c b/midori/midori-webitem.c deleted file mode 100644 index b74bbff1..00000000 --- a/midori/midori-webitem.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - Copyright (C) 2008 Christian Dywan - - 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 -#include - -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"); -} diff --git a/midori/midori-webitem.h b/midori/midori-webitem.h deleted file mode 100644 index c1276ab3..00000000 --- a/midori/midori-webitem.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright (C) 2008 Christian Dywan - - 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 - -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__ */ diff --git a/midori/midori-weblist.c b/midori/midori-weblist.c deleted file mode 100644 index 8eb50a6c..00000000 --- a/midori/midori-weblist.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - Copyright (C) 2008 Christian Dywan - - 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 -#include - -/** - * 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; -} diff --git a/midori/midori-weblist.h b/midori/midori-weblist.h deleted file mode 100644 index e051cbc5..00000000 --- a/midori/midori-weblist.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2008 Christian Dywan - - 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__ */ diff --git a/midori/midori-webview.h b/midori/midori-webview.h index c8662114..ed7f965b 100644 --- a/midori/midori-webview.h +++ b/midori/midori-webview.h @@ -13,7 +13,6 @@ #define __MIDORI_WEB_VIEW_H__ #include "midori-websettings.h" -#include "midori-weblist.h" #include #include diff --git a/midori/sokoke.c b/midori/sokoke.c index 49eeaa3d..a9d1f6eb 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -11,8 +11,6 @@ #include "sokoke.h" -#include "midori-webitem.h" - #include "config.h" #include "main.h" diff --git a/midori/sokoke.h b/midori/sokoke.h index 172b19b4..6d870b27 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -12,7 +12,7 @@ #ifndef __SOKOKE_H__ #define __SOKOKE_H__ 1 -#include "midori-weblist.h" +#include #include diff --git a/po/POTFILES.in b/po/POTFILES.in index df1c867e..16a7e207 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -10,11 +10,11 @@ midori/midori-panel.c 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