[Buoh-dev] CVS commit to /cvsroot/buoh/buoh/src by carlosgc
- From: noreply at forge.novell.com (noreply forge novell com)
- Subject: [Buoh-dev] CVS commit to /cvsroot/buoh/buoh/src by carlosgc
- Date: Tue Aug 15 09:42:53 2006
CVS commit to /cvsroot/buoh/buoh/src by carlosgc
Modified Files:
buoh-add-comic-dialog.h buoh-comic-cache.c buoh-comic-list.c
buoh-comic-list.h buoh-comic-loader.c buoh-comic-loader.h
buoh-comic-manager-date.c buoh-comic-manager-date.h
buoh-comic-manager.c buoh-comic-manager.h buoh-comic.c
buoh-comic.h buoh-properties-dialog.c buoh-properties-dialog.h
buoh-view-comic.c buoh-view-comic.h buoh-view-message.c
buoh-view-message.h buoh-view.c buoh-view.h buoh-window.c
buoh-window.h buoh.c buoh.h
Log Message:
2005-11-16 Carlos Garcia Campos <carlosgc gnome org>
* src/buoh-add-comic-dialog.[ch]:
* src/buoh-comic-list.[ch]:
* src/buoh-comic-loader.[ch]:
* src/buoh-comic-manager-date.[ch]:
* src/buoh-comic-manager.[ch]:
* src/buoh-comic.[ch]:
* src/buoh-properties-dialog.[ch]:
* src/buoh-view-comic.[ch]:
* src/buoh-view-message.[ch]:
* src/buoh-view.[ch]:
* src/buoh-window.[ch]:
* src/buoh.[ch]:
Code cleanups
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.h 2005/07/25 14:54:36 1.1
+++ /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.h 2005/11/16 20:29:28 1.2
@@ -44,7 +44,7 @@
GtkDialogClass parent_class;
};
-GType buoh_add_comic_dialog_get_type (void);
+GType buoh_add_comic_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_add_comic_dialog_new (void);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-cache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /cvsroot/buoh/buoh/src/buoh-comic-cache.c 2005/11/15 13:02:12 1.1
+++ /cvsroot/buoh/buoh/src/buoh-comic-cache.c 2005/11/16 20:29:28 1.2
@@ -39,9 +39,9 @@
static GObjectClass *parent_class = NULL;
-static void buoh_comic_cache_init (BuohComicCache *buoh_comic_cache);
-static void buoh_comic_cache_class_init (BuohComicCacheClass *klass);
-static void buoh_comic_cache_finalize (GObject *object);
+static void buoh_comic_cache_init (BuohComicCache *buoh_comic_cache);
+static void buoh_comic_cache_class_init (BuohComicCacheClass *klass);
+static void buoh_comic_cache_finalize (GObject *object);
GType
buoh_comic_cache_get_type (void)
@@ -162,6 +162,8 @@
gchar *filename;
gchar *path;
+ g_assert (uri != NULL);
+
filename = g_strdup (uri);
g_strdelimit (filename, "/", '_');
path = g_build_filename (cache->priv->cache_dir,
@@ -179,6 +181,9 @@
gchar *path;
GError *error = NULL;
+ g_assert (uri != NULL);
+ g_assert (GDK_IS_PIXBUF (pixbuf));
+
path = buoh_comic_cache_uri_to_filename (cache, uri);
buoh_debug ("CACHE: caching (disk) %s", path);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-list.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- /cvsroot/buoh/buoh/src/buoh-comic-list.c 2005/11/15 13:02:12 1.12
+++ /cvsroot/buoh/buoh/src/buoh-comic-list.c 2005/11/16 20:29:28 1.13
@@ -124,8 +124,6 @@
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
- g_return_if_fail (BUOH_IS_COMIC_LIST (buoh_comic_list));
-
buoh_comic_list->priv = BUOH_COMIC_LIST_GET_PRIVATE (buoh_comic_list);
buoh_comic_list->priv->comic_manager = NULL;
@@ -191,8 +189,6 @@
{
BuohComicList *comic_list = BUOH_COMIC_LIST (object);
- g_return_if_fail (BUOH_IS_COMIC_LIST (object));
-
buoh_debug ("comic-list finalize");
if (comic_list->priv->model) {
@@ -251,6 +247,7 @@
void
buoh_comic_list_set_view (BuohComicList *comic_list, BuohView *view)
{
+ g_return_if_fail (BUOH_IS_COMIC_LIST (comic_list));
g_return_if_fail (BUOH_IS_VIEW (view));
if (comic_list->priv->view)
@@ -262,12 +259,16 @@
GtkWidget *
buoh_comic_list_get_list (BuohComicList *comic_list)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_LIST (comic_list), NULL);
+
return comic_list->priv->tree_view;
}
void
buoh_comic_list_clear_selection (BuohComicList *comic_list)
{
+ g_return_if_fail (BUOH_IS_COMIC_LIST (comic_list));
+
gtk_tree_selection_unselect_all (
gtk_tree_view_get_selection (GTK_TREE_VIEW (comic_list->priv->tree_view)));
}
@@ -275,7 +276,7 @@
BuohComicManager *
buoh_comic_list_get_selected (BuohComicList *comic_list)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_LIST (comic_list), NULL);
+
return comic_list->priv->comic_manager;
}
-
-
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-list.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /cvsroot/buoh/buoh/src/buoh-comic-list.h 2005/09/30 16:13:46 1.4
+++ /cvsroot/buoh/buoh/src/buoh-comic-list.h 2005/11/16 20:29:28 1.5
@@ -47,14 +47,13 @@
GtkBinClass parent_class;
};
-GType buoh_comic_list_get_type (void);
+GType buoh_comic_list_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_comic_list_new (void);
void buoh_comic_list_set_view (BuohComicList *comic_list,
BuohView *view);
GtkWidget *buoh_comic_list_get_list (BuohComicList *comic_list);
void buoh_comic_list_clear_selection (BuohComicList *comic_list);
-
BuohComicManager *buoh_comic_list_get_selected (BuohComicList *comic_list);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-loader.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- /cvsroot/buoh/buoh/src/buoh-comic-loader.c 2005/11/15 13:02:12 1.10
+++ /cvsroot/buoh/buoh/src/buoh-comic-loader.c 2005/11/16 20:29:28 1.11
@@ -44,27 +44,28 @@
static GObjectClass *parent_class = NULL;
-static void buoh_comic_loader_init (BuohComicLoader *loader);
-static void buoh_comic_loader_class_init (BuohComicLoaderClass *klass);
-static void buoh_comic_loader_finalize (GObject *object);
-
-static SoupUri *buoh_comic_loader_get_proxy_uri (BuohComicLoader *loader);
-static void buoh_comic_loader_update_proxy (GConfClient *gconf_client, guint cnxn_id,
- GConfEntry *entry, gpointer gdata);
-
-static void buoh_comic_loader_update (GdkPixbufLoader *pixbuf_loader,
- gint x,
- gint y,
- gint width,
- gint height,
- gpointer gdata);
-static void buoh_comic_loader_resolved (SoupMessage *msg,
- gpointer gdata);
-static void buoh_comic_loader_read_next (SoupMessage *msg,
- gpointer gdata);
-static void buoh_comic_loader_finished (SoupMessage *msg,
- gpointer gdata);
-static gpointer buoh_comic_loader_run_thread (gpointer gdata);
+static void buoh_comic_loader_init (BuohComicLoader *loader);
+static void buoh_comic_loader_class_init (BuohComicLoaderClass *klass);
+static void buoh_comic_loader_finalize (GObject *object);
+
+static SoupUri *buoh_comic_loader_get_proxy_uri (BuohComicLoader *loader);
+static void buoh_comic_loader_update_proxy (GConfClient *gconf_client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer gdata);
+static void buoh_comic_loader_update (GdkPixbufLoader *pixbuf_loader,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ gpointer gdata);
+static void buoh_comic_loader_resolved (SoupMessage *msg,
+ gpointer gdata);
+static void buoh_comic_loader_read_next (SoupMessage *msg,
+ gpointer gdata);
+static void buoh_comic_loader_finished (SoupMessage *msg,
+ gpointer gdata);
+static gpointer buoh_comic_loader_run_thread (gpointer gdata);
GType
buoh_comic_loader_get_type (void)
@@ -440,7 +441,6 @@
buoh_comic_loader_read_next,
(gpointer) loader);
-
buoh_debug ("resolving . . .");
soup_session_queue_message (loader->priv->session, loader->priv->msg,
@@ -466,6 +466,7 @@
void
buoh_comic_loader_run (BuohComicLoader *loader, const gchar *uri)
{
+ g_return_if_fail (BUOH_IS_COMIC_LOADER (loader));
g_return_if_fail (uri != NULL);
g_mutex_lock (loader->status_mutex);
@@ -493,6 +494,8 @@
void
buoh_comic_loader_stop (BuohComicLoader *loader)
{
+ g_return_if_fail (BUOH_IS_COMIC_LOADER (loader));
+
buoh_debug ("Stopping loader");
g_mutex_lock (loader->status_mutex);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-loader.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /cvsroot/buoh/buoh/src/buoh-comic-loader.h 2005/09/20 14:50:33 1.5
+++ /cvsroot/buoh/buoh/src/buoh-comic-loader.h 2005/11/16 20:29:28 1.6
@@ -68,7 +68,7 @@
GObjectClass parent_class;
};
-GType buoh_comic_loader_get_type (void);
+GType buoh_comic_loader_get_type (void) G_GNUC_CONST;
GQuark buoh_comic_loader_error_quark (void);
BuohComicLoader *buoh_comic_loader_new (void);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c 2005/09/30 16:13:46 1.8
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c 2005/11/16 20:29:28 1.9
@@ -29,20 +29,20 @@
#define URI_BUFFER 256
#define ID_BUFFER 100
-static void buoh_comic_manager_date_init (BuohComicManagerDate *);
-static void buoh_comic_manager_date_class_init (BuohComicManagerDateClass *);
-static void buoh_comic_manager_date_finalize (GObject *);
-
-static gchar *buoh_comic_manager_date_get_id_from_date (BuohComicManagerDate *comic_manager);
-static gchar *buoh_comic_manager_date_get_uri_from_date (BuohComicManagerDate *comic_manager);
-static BuohComic *buoh_comic_manager_date_new_comic (BuohComicManagerDate *comic_manager);
-
-static BuohComic *buoh_comic_manager_date_get_next (BuohComicManager *manager);
-static BuohComic *buoh_comic_manager_date_get_previous (BuohComicManager *manager);
-static BuohComic *buoh_comic_manager_date_get_first (BuohComicManager *manager);
-static BuohComic *buoh_comic_manager_date_get_last (BuohComicManager *manager);
-static gboolean buoh_comic_manager_date_is_the_first (BuohComicManager *manager);
-static gchar *buoh_comic_manager_date_get_dayweek (GDateWeekday d);
+static void buoh_comic_manager_date_init (BuohComicManagerDate *comic_manager);
+static void buoh_comic_manager_date_class_init (BuohComicManagerDateClass *klass);
+static void buoh_comic_manager_date_finalize (GObject *object);
+
+static gchar *buoh_comic_manager_date_get_id_from_date (BuohComicManagerDate *comic_manager);
+static gchar *buoh_comic_manager_date_get_uri_from_date (BuohComicManagerDate *comic_manager);
+static BuohComic *buoh_comic_manager_date_new_comic (BuohComicManagerDate *comic_manager);
+
+static BuohComic *buoh_comic_manager_date_get_next (BuohComicManager *manager);
+static BuohComic *buoh_comic_manager_date_get_previous (BuohComicManager *manager);
+static BuohComic *buoh_comic_manager_date_get_first (BuohComicManager *manager);
+static BuohComic *buoh_comic_manager_date_get_last (BuohComicManager *manager);
+static gboolean buoh_comic_manager_date_is_the_first (BuohComicManager *manager);
+static gchar *buoh_comic_manager_date_get_dayweek (GDateWeekday d);
static BuohComicManagerClass *parent_class = NULL;
@@ -52,7 +52,7 @@
gboolean publications[8]; /* Days of week */
};
-static const gchar *day_names [] = {
+static const gchar *day_names[] = {
NULL,
N_("Monday"),
N_("Tuesday"),
@@ -61,7 +61,7 @@
N_("Friday"),
N_("Saturday"),
N_("Sunday")
- };
+};
GType
buoh_comic_manager_date_get_type (void)
@@ -105,7 +105,7 @@
static void
buoh_comic_manager_date_class_init (BuohComicManagerDateClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
BuohComicManagerClass *manager_class = (BuohComicManagerClass *) klass;
parent_class = g_type_class_peek_parent (klass);
@@ -126,8 +126,6 @@
{
BuohComicManagerDate *comic_manager;
- g_return_if_fail (BUOH_IS_COMIC_MANAGER_DATE (object));
-
comic_manager = BUOH_COMIC_MANAGER_DATE (object);
if (comic_manager->priv->date != NULL) {
@@ -152,6 +150,10 @@
const gchar *generic_uri)
{
BuohComicManagerDate *comic_manager;
+
+ g_return_val_if_fail (id != NULL && title != NULL &&
+ author != NULL && language != NULL &&
+ generic_uri != NULL, NULL);
comic_manager = BUOH_COMIC_MANAGER_DATE (g_object_new (BUOH_COMIC_MANAGER_DATE_TYPE,
"id", id,
@@ -166,7 +168,7 @@
void
buoh_comic_manager_date_set_restriction (BuohComicManagerDate *comic_manager,
- GDateWeekday day)
+ GDateWeekday day)
{
g_return_if_fail (BUOH_IS_COMIC_MANAGER_DATE (comic_manager));
@@ -175,11 +177,14 @@
void
buoh_comic_manager_date_set_first (BuohComicManagerDate *comic_manager,
- gchar *first)
+ const gchar *first)
{
GDate *date;
struct tm time;
+ g_return_if_fail (BUOH_IS_COMIC_MANAGER_DATE (comic_manager));
+ g_return_if_fail (first != NULL);
+
strptime (first, "%Y-%m-%d", &time);
/* Bug? */
time.tm_year += 1900;
@@ -397,11 +402,13 @@
static gboolean
buoh_comic_manager_date_is_the_first_comic (BuohComicManager *comic_manager,
- BuohComic *comic)
+ BuohComic *comic)
{
GDate *date;
BuohComicManagerDatePrivate *priv;
+ g_assert (BUOH_IS_COMIC (comic));
+
priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
date = buoh_comic_get_date (comic);
@@ -414,8 +421,6 @@
{
GList *current;
- g_return_val_if_fail (BUOH_IS_COMIC_MANAGER_DATE (comic_manager), FALSE);
-
g_object_get (G_OBJECT (comic_manager),
"current", ¤t,
NULL);
@@ -431,8 +436,6 @@
BuohComicManagerDatePrivate *priv;
BuohComic *comic;
- g_return_val_if_fail (BUOH_IS_COMIC_MANAGER_DATE (comic_manager), NULL);
-
priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
g_object_get (G_OBJECT (comic_manager),
@@ -480,6 +483,8 @@
gboolean has_restrict = FALSE, prev = FALSE;
gchar *date;
GString *aux;
+
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER_DATE (comic_manager), NULL);
aux = g_string_new ("");
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h 2005/09/30 09:17:33 1.5
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h 2005/11/16 20:29:28 1.6
@@ -47,21 +47,20 @@
BuohComicManagerClass parent_class;
};
-GType buoh_comic_manager_date_get_type (void);
+GType buoh_comic_manager_date_get_type (void) G_GNUC_CONST;
-BuohComicManager *buoh_comic_manager_date_new (const gchar *id,
- const gchar *title,
- const gchar *author,
- const gchar *language,
- const gchar *generic_uri);
+BuohComicManager *buoh_comic_manager_date_new (const gchar *id,
+ const gchar *title,
+ const gchar *author,
+ const gchar *language,
+ const gchar *generic_uri);
void buoh_comic_manager_date_set_restriction (BuohComicManagerDate *comic_manager,
- GDateWeekday day);
+ GDateWeekday day);
void buoh_comic_manager_date_set_first (BuohComicManagerDate *comic_manager,
- gchar *first);
-
+ const gchar *first);
gchar * buoh_comic_manager_date_get_publication_days (BuohComicManagerDate *comic_manager);
G_END_DECLS;
-#endif
+#endif /* BUOH_COMIC_MANAGER_DATE_H */
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /cvsroot/buoh/buoh/src/buoh-comic-manager.c 2005/09/23 11:21:49 1.7
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager.c 2005/11/16 20:29:28 1.8
@@ -51,15 +51,15 @@
static void buoh_comic_manager_init (BuohComicManager *comic_manager);
static void buoh_comic_manager_class_init (BuohComicManagerClass *klass);
-static void buoh_comic_manager_finalize (GObject *object);
-static void buoh_comic_manager_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void buoh_comic_manager_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
+static void buoh_comic_manager_finalize (GObject *object);
+static void buoh_comic_manager_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void buoh_comic_manager_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
GType
buoh_comic_manager_get_type (void)
@@ -171,8 +171,6 @@
{
BuohComicManager *comic_manager = BUOH_COMIC_MANAGER (object);
- g_return_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager));
-
if (comic_manager->priv->author) {
g_free (comic_manager->priv->author);
comic_manager->priv->author = NULL;
@@ -218,6 +216,8 @@
const gchar *language,
const gchar *generic_uri)
{
+ g_return_val_if_fail (type != NULL, NULL);
+
if (g_ascii_strcasecmp (type, "date") == 0) {
return BUOH_COMIC_MANAGER (buoh_comic_manager_date_new (id,
title,
@@ -228,8 +228,8 @@
g_warning ("Invalid type %s for BuohComicManager (id: %s)\n",
type, id);
return NULL;
- }
-}
+ }}
+
static void
buoh_comic_manager_set_property (GObject *object,
@@ -323,6 +323,8 @@
BuohComic *
buoh_comic_manager_get_last (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
+
if (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_last) {
return (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_last) (comic_manager);
} else {
@@ -333,6 +335,8 @@
BuohComic *
buoh_comic_manager_get_first (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
+
if (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_first) {
return (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_first) (comic_manager);
} else {
@@ -343,6 +347,8 @@
BuohComic *
buoh_comic_manager_get_next (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
+
if (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_next) {
return (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_next) (comic_manager);
} else {
@@ -353,6 +359,8 @@
BuohComic *
buoh_comic_manager_get_previous (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
+
if (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_previous) {
return (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->get_previous) (comic_manager);
} else {
@@ -363,6 +371,8 @@
BuohComic *
buoh_comic_manager_get_current (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
+
if (comic_manager->priv->current != NULL) {
buoh_debug ("get_current");
return comic_manager->priv->current->data;
@@ -379,6 +389,8 @@
buoh_comic_manager_is_the_last (BuohComicManager *comic_manager)
{
GList *current;
+
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), FALSE);
current = comic_manager->priv->current;
@@ -388,6 +400,8 @@
gboolean
buoh_comic_manager_is_the_first (BuohComicManager *comic_manager)
{
+ g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), FALSE);
+
if (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->is_the_first)
return (BUOH_COMIC_MANAGER_GET_CLASS (comic_manager)->is_the_first) (comic_manager);
else
@@ -398,7 +412,7 @@
buoh_comic_manager_get_title (BuohComicManager *comic_manager)
{
gchar *title = NULL;
-
+
g_return_val_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager), NULL);
g_object_get (G_OBJECT (comic_manager), "title", &title, NULL);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /cvsroot/buoh/buoh/src/buoh-comic-manager.h 2005/09/23 11:21:49 1.5
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager.h 2005/11/16 20:29:28 1.6
@@ -53,35 +53,33 @@
gboolean (* is_the_first) (BuohComicManager *comic_manager);
};
-/* Public methods */
-GType buoh_comic_manager_get_type (void);
+GType buoh_comic_manager_get_type (void) G_GNUC_CONST;
-BuohComicManager *buoh_comic_manager_new (const gchar *type,
- const gchar *id,
- const gchar *title,
- const gchar *author,
- const gchar *language,
- const gchar *generic_uri);
-
-BuohComic *buoh_comic_manager_get_next (BuohComicManager *comic_manager);
-BuohComic *buoh_comic_manager_get_previous (BuohComicManager *comic_manager);
-
-BuohComic *buoh_comic_manager_get_current (BuohComicManager *comic_manager);
-BuohComic *buoh_comic_manager_get_last (BuohComicManager *comic_manager);
-BuohComic *buoh_comic_manager_get_first (BuohComicManager *comic_manager);
-
-gboolean buoh_comic_manager_is_the_last (BuohComicManager *comic_manager);
-gboolean buoh_comic_manager_is_the_first (BuohComicManager *comic_manager);
-
-gchar *buoh_comic_manager_get_uri (BuohComicManager *comic_manager);
-gchar *buoh_comic_manager_get_title (BuohComicManager *comic_manager);
-gchar *buoh_comic_manager_get_author (BuohComicManager *comic_manager);
-gchar *buoh_comic_manager_get_language (BuohComicManager *comic_manager);
-gchar *buoh_comic_manager_get_id (BuohComicManager *comic_manager);
-gchar *buoh_comic_manager_get_page (BuohComicManager *comic_manager);
+BuohComicManager *buoh_comic_manager_new (const gchar *type,
+ const gchar *id,
+ const gchar *title,
+ const gchar *author,
+ const gchar *language,
+ const gchar *generic_uri);
+
+BuohComic *buoh_comic_manager_get_next (BuohComicManager *comic_manager);
+BuohComic *buoh_comic_manager_get_previous (BuohComicManager *comic_manager);
+BuohComic *buoh_comic_manager_get_current (BuohComicManager *comic_manager);
+BuohComic *buoh_comic_manager_get_last (BuohComicManager *comic_manager);
+BuohComic *buoh_comic_manager_get_first (BuohComicManager *comic_manager);
+
+gboolean buoh_comic_manager_is_the_last (BuohComicManager *comic_manager);
+gboolean buoh_comic_manager_is_the_first (BuohComicManager *comic_manager);
+
+gchar *buoh_comic_manager_get_uri (BuohComicManager *comic_manager);
+gchar *buoh_comic_manager_get_title (BuohComicManager *comic_manager);
+gchar *buoh_comic_manager_get_author (BuohComicManager *comic_manager);
+gchar *buoh_comic_manager_get_language (BuohComicManager *comic_manager);
+gchar *buoh_comic_manager_get_id (BuohComicManager *comic_manager);
+gchar *buoh_comic_manager_get_page (BuohComicManager *comic_manager);
-gint buoh_comic_manager_compare (gconstpointer a,
- gconstpointer b);
+gint buoh_comic_manager_compare (gconstpointer a,
+ gconstpointer b);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /cvsroot/buoh/buoh/src/buoh-comic.c 2005/11/15 13:02:12 1.9
+++ /cvsroot/buoh/buoh/src/buoh-comic.c 2005/11/16 20:29:28 1.10
@@ -17,10 +17,6 @@
* Esteban Sanchez Munoz (steve-o) <esteban steve-o org>
*/
-/*#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif*/
-
#include <glib.h>
#include <glib/gi18n.h>
@@ -89,7 +85,6 @@
static void
buoh_comic_init (BuohComic *buoh_comic)
{
-
buoh_comic->priv = BUOH_COMIC_GET_PRIVATE (buoh_comic);
buoh_comic->priv->id = NULL;
@@ -146,8 +141,6 @@
{
BuohComic *comic = BUOH_COMIC (object);
- g_return_if_fail (BUOH_IS_COMIC (comic));
-
buoh_debug ("buoh-comic-finalize");
if (comic->priv->id) {
@@ -155,6 +148,11 @@
comic->priv->id = NULL;
}
+ if (comic->priv->uri) {
+ g_free (comic->priv->uri);
+ comic->priv->uri = NULL;
+ }
+
if (comic->priv->date) {
g_date_free (comic->priv->date);
comic->priv->date = NULL;
@@ -185,6 +183,9 @@
{
BuohComic *comic;
+ g_return_val_if_fail (id != NULL && uri != NULL, NULL);
+ g_return_val_if_fail (date != NULL, NULL);
+
comic = BUOH_COMIC (g_object_new (BUOH_TYPE_COMIC,
"id", id,
"uri", uri,
@@ -275,6 +276,7 @@
buoh_comic_set_id (BuohComic *comic, const gchar *id)
{
g_return_if_fail (BUOH_IS_COMIC (comic));
+ g_return_if_fail (id != NULL);
g_object_set (G_OBJECT (comic), "id", id, NULL);
}
@@ -283,6 +285,7 @@
buoh_comic_set_pixbuf (BuohComic *comic, GdkPixbuf *pixbuf)
{
g_return_if_fail (BUOH_IS_COMIC (comic));
+ g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_object_set (G_OBJECT (comic), "pixbuf", pixbuf, NULL);
}
@@ -291,6 +294,7 @@
buoh_comic_set_date (BuohComic *comic, GDate *date)
{
g_return_if_fail (BUOH_IS_COMIC (comic));
+ g_return_if_fail (date != NULL);
g_object_set (G_OBJECT (comic), "date", date, NULL);
}
@@ -301,6 +305,7 @@
GdkPixbuf *pixbuf = NULL;
g_return_if_fail (BUOH_IS_COMIC (comic));
+ g_return_if_fail (filename != NULL);
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
@@ -363,6 +368,8 @@
gint c_width, c_height;
gint d_width, d_height;
+ g_return_val_if_fail (BUOH_IS_COMIC (comic), NULL);
+
g_object_get (G_OBJECT (comic), "pixbuf", &pixbuf, NULL);
if (pixbuf) {
@@ -388,6 +395,8 @@
gchar *
buoh_comic_get_filename (BuohComic *comic)
{
+ g_return_val_if_fail (BUOH_IS_COMIC (comic), NULL);
+
gchar *filename;
filename = g_path_get_basename (comic->priv->uri);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /cvsroot/buoh/buoh/src/buoh-comic.h 2005/11/08 00:42:57 1.5
+++ /cvsroot/buoh/buoh/src/buoh-comic.h 2005/11/16 20:29:28 1.6
@@ -47,19 +47,20 @@
GObjectClass parent_class;
};
-/* Public methods */
-GType buoh_comic_get_type (void);
-BuohComic *buoh_comic_new (void);
-BuohComic *buoh_comic_new_with_info (const gchar *id, const gchar *uri,
- const GDate *date);
+GType buoh_comic_get_type (void) G_GNUC_CONST;
+BuohComic *buoh_comic_new (void);
+BuohComic *buoh_comic_new_with_info (const gchar *id,
+ const gchar *uri,
+ const GDate *date);
-void buoh_comic_set_id (BuohComic *comic, const gchar *id);
+void buoh_comic_set_id (BuohComic *comic,
+ const gchar *id);
void buoh_comic_go_next (BuohComic *comic);
void buoh_comic_go_previous (BuohComic *comic);
void buoh_comic_set_pixbuf (BuohComic *comic,
GdkPixbuf *pixbuf);
-void buoh_comic_set_date (BuohComic *comic,
- GDate *date);
+void buoh_comic_set_date (BuohComic *comic,
+ GDate *date);
void buoh_comic_set_pixbuf_from_file (BuohComic *comic,
const gchar *filename);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-properties-dialog.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- /cvsroot/buoh/buoh/src/buoh-properties-dialog.c 2005/11/15 13:02:12 1.15
+++ /cvsroot/buoh/buoh/src/buoh-properties-dialog.c 2005/11/16 20:29:28 1.16
@@ -97,8 +97,8 @@
}
void
-buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog *dialog,
- BuohComicManager *comic_manager)
+buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog *dialog,
+ BuohComicManager *comic_manager)
{
GtkWidget *table;
GtkWidget *label_title, *label_title_val;
@@ -114,7 +114,8 @@
BuohComic *comic;
GdkPixbuf *thumbnail;
gchar *str;
-
+
+ g_return_if_fail (BUOH_IS_PROPERTIES_DIALOG (dialog));
g_return_if_fail (BUOH_IS_COMIC_MANAGER (comic_manager));
dialog->priv->comic_manager = comic_manager;
@@ -272,6 +273,8 @@
BuohComicManager *
buoh_properties_dialog_get_comic_manager (BuohPropertiesDialog *dialog)
{
+ g_return_val_if_fail (BUOH_IS_PROPERTIES_DIALOG (dialog), NULL);
+
return dialog->priv->comic_manager;
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-properties-dialog.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /cvsroot/buoh/buoh/src/buoh-properties-dialog.h 2005/09/16 11:56:20 1.4
+++ /cvsroot/buoh/buoh/src/buoh-properties-dialog.h 2005/11/16 20:29:28 1.5
@@ -47,12 +47,12 @@
GtkDialogClass parent_class;
};
-GType buoh_properties_dialog_get_type (void);
+GType buoh_properties_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_properties_dialog_new (void);
-void buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog *dialog,
- BuohComicManager *comic);
-BuohComicManager *buoh_properties_dialog_get_comic_manager (BuohPropertiesDialog *dialog);
+void buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog *dialog,
+ BuohComicManager *comic_manager);
+BuohComicManager *buoh_properties_dialog_get_comic_manager (BuohPropertiesDialog *dialog);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-comic.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- /cvsroot/buoh/buoh/src/buoh-view-comic.c 2005/11/15 13:02:12 1.12
+++ /cvsroot/buoh/buoh/src/buoh-view-comic.c 2005/11/16 20:29:28 1.13
@@ -345,6 +345,8 @@
{
GtkWidget *c_view;
+ g_return_val_if_fail (BUOH_IS_VIEW (view), NULL);
+
c_view = GTK_WIDGET (g_object_new (BUOH_TYPE_VIEW_COMIC,
"shadow-type", GTK_SHADOW_IN,
NULL));
@@ -439,7 +441,7 @@
{
GdkPixbuf *new_pixbuf;
- g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
+ g_assert (GDK_IS_PIXBUF (pixbuf));
if (c_view->priv->scale != 1.0) {
new_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
@@ -459,9 +461,9 @@
static gboolean
buoh_view_comic_load_monitor (gpointer gdata)
{
- BuohViewComic *c_view = BUOH_VIEW_COMIC (gdata);
+ BuohViewComic *c_view = BUOH_VIEW_COMIC (gdata);
static GdkCursor *cursor = NULL;
- static gint height = 0;
+ static gint height = 0;
switch (c_view->priv->comic_loader->status) {
case LOADER_STATE_READY:
@@ -599,8 +601,8 @@
gdouble scale;
GdkPixbuf *pixbuf = NULL;
- g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
- g_return_if_fail (BUOH_IS_COMIC (c_view->priv->comic));
+ g_assert (BUOH_IS_VIEW_COMIC (c_view));
+ g_assert (BUOH_IS_COMIC (c_view->priv->comic));
if (relative)
scale = c_view->priv->scale * factor;
@@ -620,35 +622,47 @@
gboolean
buoh_view_comic_is_min_zoom (BuohViewComic *c_view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
+
return c_view->priv->scale == MIN_ZOOM_SCALE;
}
gboolean
buoh_view_comic_is_max_zoom (BuohViewComic *c_view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
+
return c_view->priv->scale == MAX_ZOOM_SCALE;
}
gboolean
buoh_view_comic_is_normal_size (BuohViewComic *c_view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW_COMIC (c_view), FALSE);
+
return c_view->priv->scale == 1.0;
}
void
buoh_view_comic_zoom_in (BuohViewComic *c_view)
{
+ g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
+
buoh_view_comic_zoom (c_view, ZOOM_IN_FACTOR, TRUE);
}
void
buoh_view_comic_zoom_out (BuohViewComic *c_view)
{
+ g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
+
buoh_view_comic_zoom (c_view, ZOOM_OUT_FACTOR, TRUE);
}
void
buoh_view_comic_normal_size (BuohViewComic *c_view)
{
+ g_return_if_fail (BUOH_IS_VIEW_COMIC (c_view));
+
buoh_view_comic_zoom (c_view, 1.0, FALSE);
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-comic.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /cvsroot/buoh/buoh/src/buoh-view-comic.h 2005/09/30 16:13:46 1.2
+++ /cvsroot/buoh/buoh/src/buoh-view-comic.h 2005/11/16 20:29:28 1.3
@@ -46,15 +46,15 @@
GtkViewportClass parent_class;
};
-GType buoh_view_comic_get_type (void);
-GtkWidget *buoh_view_comic_new (BuohView *view);
+GType buoh_view_comic_get_type (void) G_GNUC_CONST;
+GtkWidget *buoh_view_comic_new (BuohView *view);
-gboolean buoh_view_comic_is_min_zoom (BuohViewComic *c_view);
-gboolean buoh_view_comic_is_max_zoom (BuohViewComic *c_view);
-gboolean buoh_view_comic_is_normal_size (BuohViewComic *c_view);
-void buoh_view_comic_zoom_in (BuohViewComic *c_view);
-void buoh_view_comic_zoom_out (BuohViewComic *c_view);
-void buoh_view_comic_normal_size (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_min_zoom (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_max_zoom (BuohViewComic *c_view);
+gboolean buoh_view_comic_is_normal_size (BuohViewComic *c_view);
+void buoh_view_comic_zoom_in (BuohViewComic *c_view);
+void buoh_view_comic_zoom_out (BuohViewComic *c_view);
+void buoh_view_comic_normal_size (BuohViewComic *c_view);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-message.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /cvsroot/buoh/buoh/src/buoh-view-message.c 2005/09/30 09:17:33 1.3
+++ /cvsroot/buoh/buoh/src/buoh-view-message.c 2005/11/16 20:29:28 1.4
@@ -141,7 +141,8 @@
{
gint size;
PangoFontDescription *font_desc;
-
+
+ g_return_if_fail (BUOH_IS_VIEW_MESSAGE (m_view));
g_return_if_fail (title != NULL);
gtk_label_set_text (GTK_LABEL (m_view->priv->title), title);
@@ -166,6 +167,7 @@
void
buoh_view_message_set_text (BuohViewMessage *m_view, const gchar *text)
{
+ g_return_if_fail (BUOH_IS_VIEW_MESSAGE (m_view));
g_return_if_fail (text != NULL);
gtk_label_set_markup (GTK_LABEL (m_view->priv->text), text);
@@ -179,7 +181,8 @@
gchar *icon_path;
GdkPixbuf *pixbuf = NULL;
GtkStockItem item;
-
+
+ g_return_if_fail (BUOH_IS_VIEW_MESSAGE (m_view));
g_return_if_fail (icon != NULL);
if (gtk_stock_lookup (icon, &item)) {
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-message.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /cvsroot/buoh/buoh/src/buoh-view-message.h 2005/08/05 09:14:53 1.1
+++ /cvsroot/buoh/buoh/src/buoh-view-message.h 2005/11/16 20:29:28 1.2
@@ -44,12 +44,15 @@
GtkViewportClass parent_class;
};
-GType buoh_view_message_get_type (void);
+GType buoh_view_message_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_view_message_new (void);
-void buoh_view_message_set_title (BuohViewMessage *m_view, const gchar *title);
-void buoh_view_message_set_text (BuohViewMessage *m_view, const gchar *text);
-void buoh_view_message_set_icon (BuohViewMessage *m_view, const gchar *icon);
+void buoh_view_message_set_title (BuohViewMessage *m_view,
+ const gchar *title);
+void buoh_view_message_set_text (BuohViewMessage *m_view,
+ const gchar *text);
+void buoh_view_message_set_icon (BuohViewMessage *m_view,
+ const gchar *icon);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /cvsroot/buoh/buoh/src/buoh-view.c 2005/09/30 09:17:33 1.11
+++ /cvsroot/buoh/buoh/src/buoh-view.c 2005/11/16 20:29:28 1.12
@@ -339,48 +339,63 @@
gboolean
buoh_view_is_min_zoom (BuohView *view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW (view), FALSE);
+
return buoh_view_comic_is_min_zoom (BUOH_VIEW_COMIC (view->priv->comic));
}
gboolean
buoh_view_is_max_zoom (BuohView *view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW (view), FALSE);
+
return buoh_view_comic_is_max_zoom (BUOH_VIEW_COMIC (view->priv->comic));
}
gboolean
buoh_view_is_normal_size (BuohView *view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW (view), FALSE);
+
return buoh_view_comic_is_normal_size (BUOH_VIEW_COMIC (view->priv->comic));
}
void
buoh_view_zoom_in (BuohView *view)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
buoh_view_comic_zoom_in (BUOH_VIEW_COMIC (view->priv->comic));
}
void
buoh_view_zoom_out (BuohView *view)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
buoh_view_comic_zoom_out (BUOH_VIEW_COMIC (view->priv->comic));
}
void
buoh_view_zoom_normal_size (BuohView *view)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
buoh_view_comic_normal_size (BUOH_VIEW_COMIC (view->priv->comic));
}
BuohViewStatus
buoh_view_get_status (BuohView *view)
{
+ g_return_val_if_fail (BUOH_IS_VIEW (view), 0);
+
return view->priv->status;
}
void
-buoh_view_set_comic (BuohView *view, BuohComic *comic)
+buoh_view_set_comic (BuohView *view, const BuohComic *comic)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
g_return_if_fail (BUOH_IS_COMIC (comic));
g_object_set (G_OBJECT (view->priv->comic),
@@ -393,6 +408,8 @@
{
BuohComic *comic = NULL;
+ g_return_val_if_fail (BUOH_IS_VIEW (view), NULL);
+
g_object_get (G_OBJECT (view->priv->comic),
"comic", &comic,
NULL);
@@ -403,6 +420,9 @@
void
buoh_view_set_message_title (BuohView *view, const gchar *title)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+ g_return_if_fail (title != NULL);
+
buoh_view_message_set_title (BUOH_VIEW_MESSAGE (view->priv->message),
title);
}
@@ -410,6 +430,9 @@
void
buoh_view_set_message_text (BuohView *view, const gchar *text)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+ g_return_if_fail (text != NULL);
+
buoh_view_message_set_text (BUOH_VIEW_MESSAGE (view->priv->message),
text);
}
@@ -417,6 +440,9 @@
void
buoh_view_set_message_icon (BuohView *view, const gchar *icon)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+ g_return_if_fail (icon != NULL);
+
buoh_view_message_set_icon (BUOH_VIEW_MESSAGE (view->priv->message),
icon);
}
@@ -424,6 +450,8 @@
void
buoh_view_clear (BuohView *view)
{
+ g_return_if_fail (BUOH_IS_VIEW (view));
+
g_object_set (G_OBJECT (view),
"status", STATE_EMPTY,
NULL);
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /cvsroot/buoh/buoh/src/buoh-view.h 2005/09/30 16:13:46 1.7
+++ /cvsroot/buoh/buoh/src/buoh-view.h 2005/11/16 20:29:28 1.8
@@ -58,31 +58,31 @@
void (* scale_changed) (BuohView *view);
};
-GType buoh_view_get_type (void);
-GType buoh_view_status_get_type (void);
-GtkWidget *buoh_view_new (void);
-
-gboolean buoh_view_is_min_zoom (BuohView *view);
-gboolean buoh_view_is_max_zoom (BuohView *view);
-gboolean buoh_view_is_normal_size (BuohView *view);
-void buoh_view_zoom_in (BuohView *view);
-void buoh_view_zoom_out (BuohView *view);
-void buoh_view_zoom_normal_size (BuohView *view);
-
-BuohViewStatus buoh_view_get_status (BuohView *view);
-
-void buoh_view_set_comic (BuohView *view,
- BuohComic *comic);
-BuohComic *buoh_view_get_comic (BuohView *view);
-
-void buoh_view_set_message_title (BuohView *view,
- const gchar *title);
-void buoh_view_set_message_text (BuohView *view,
- const gchar *text);
-void buoh_view_set_message_icon (BuohView *view,
- const gchar *icon);
+GType buoh_view_get_type (void) G_GNUC_CONST;
+GType buoh_view_status_get_type (void) G_GNUC_CONST;
+GtkWidget *buoh_view_new (void);
+
+gboolean buoh_view_is_min_zoom (BuohView *view);
+gboolean buoh_view_is_max_zoom (BuohView *view);
+gboolean buoh_view_is_normal_size (BuohView *view);
+void buoh_view_zoom_in (BuohView *view);
+void buoh_view_zoom_out (BuohView *view);
+void buoh_view_zoom_normal_size (BuohView *view);
+
+BuohViewStatus buoh_view_get_status (BuohView *view);
+
+void buoh_view_set_comic (BuohView *view,
+ const BuohComic *comic);
+BuohComic *buoh_view_get_comic (BuohView *view);
+
+void buoh_view_set_message_title (BuohView *view,
+ const gchar *title);
+void buoh_view_set_message_text (BuohView *view,
+ const gchar *text);
+void buoh_view_set_message_icon (BuohView *view,
+ const gchar *icon);
-void buoh_view_clear (BuohView *view);
+void buoh_view_clear (BuohView *view);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-window.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- /cvsroot/buoh/buoh/src/buoh-window.c 2005/11/15 13:02:12 1.28
+++ /cvsroot/buoh/buoh/src/buoh-window.c 2005/11/16 20:29:28 1.29
@@ -62,9 +62,9 @@
static GtkWindowClass *parent_class = NULL;
-static void buoh_window_init (BuohWindow *buoh_window);
-static void buoh_window_class_init (BuohWindowClass *klass);
-static void buoh_window_finalize (GObject *object);
+static void buoh_window_init (BuohWindow *buoh_window);
+static void buoh_window_class_init (BuohWindowClass *klass);
+static void buoh_window_finalize (GObject *object);
/* Sensitivity */
static void buoh_window_set_sensitive (BuohWindow *window,
@@ -148,7 +148,7 @@
static void buoh_window_update_title (BuohWindow *window);
-static const GtkActionEntry menu_entries [] = {
+static const GtkActionEntry menu_entries[] = {
/* Top Level */
{ "Comic", NULL, N_("_Comic") },
@@ -261,8 +261,6 @@
gboolean visible_toolbar;
gboolean visible_statusbar;
- g_return_if_fail (BUOH_IS_WINDOW (buoh_window));
-
buoh_window->priv = BUOH_WINDOW_GET_PRIVATE (buoh_window);
gtk_window_set_title (GTK_WINDOW (buoh_window), "Buoh");
@@ -430,8 +428,6 @@
{
BuohWindow *buoh_window = BUOH_WINDOW (object);
- g_return_if_fail (BUOH_IS_WINDOW (object));
-
buoh_debug ("buoh-window finalize");
if (buoh_window->priv->ui_manager) {
@@ -499,12 +495,13 @@
static void
buoh_window_cmd_comic_remove (GtkAction *action, gpointer gdata)
{
- BuohWindow *window = BUOH_WINDOW (gdata);
- GtkTreeModel *model = buoh_get_comics_model (BUOH);
- GtkTreeIter iter;
- BuohComicManager *cm, *current_cm;
- gchar *current_cm_id, *cm_id;
- gboolean valid;
+ BuohWindow *window = BUOH_WINDOW (gdata);
+ GtkTreeModel *model = buoh_get_comics_model (BUOH);
+ GtkTreeIter iter;
+ BuohComicManager *cm;
+ BuohComicManager *current_cm;
+ gchar *current_cm_id, *cm_id;
+ gboolean valid;
current_cm = buoh_comic_list_get_selected (window->priv->comic_list);
@@ -623,7 +620,7 @@
}
} while (!successful);
- g_object_unref (pixbuf);
+// g_object_unref (pixbuf);
g_free (suggested);
gtk_widget_destroy (chooser);
}
@@ -988,7 +985,7 @@
gchar *message = NULL;
action = g_object_get_data (G_OBJECT (proxy), "gtk-action");
- g_return_if_fail (action != NULL);
+ g_assert (action != NULL);
g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
if (message) {
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-window.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /cvsroot/buoh/buoh/src/buoh-window.h 2005/07/25 14:54:36 1.1
+++ /cvsroot/buoh/buoh/src/buoh-window.h 2005/11/16 20:29:28 1.2
@@ -44,7 +44,7 @@
GtkWindowClass parent_class;
};
-GType buoh_window_get_type (void);
+GType buoh_window_get_type (void) G_GNUC_CONST;
GtkWidget *buoh_window_new (void);
G_END_DECLS
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- /cvsroot/buoh/buoh/src/buoh.c 2005/11/15 13:02:12 1.24
+++ /cvsroot/buoh/buoh/src/buoh.c 2005/11/16 20:29:28 1.25
@@ -47,9 +47,9 @@
static GObjectClass *parent_class = NULL;
-static void buoh_init (Buoh *buoh);
-static void buoh_class_init (BuohClass *klass);
-static void buoh_finalize (GObject *object);
+static void buoh_init (Buoh *buoh);
+static void buoh_class_init (BuohClass *klass);
+static void buoh_finalize (GObject *object);
static GList *buoh_parse_selected (Buoh *buoh);
static GtkTreeModel *buoh_create_model_from_file (Buoh *buoh);
@@ -412,8 +412,6 @@
Buoh *buoh = BUOH_BUOH (object);
- g_return_if_fail (BUOH_IS_BUOH (object));
-
buoh_debug ("buoh finalize");
if (buoh->priv->datadir) {
@@ -451,6 +449,8 @@
void
buoh_exit_app (Buoh *buoh)
{
+ g_return_if_fail (BUOH_IS_BUOH (buoh));
+
g_object_unref (buoh);
gtk_main_quit ();
@@ -461,6 +461,8 @@
void
buoh_create_main_window (Buoh *buoh)
{
+ g_return_if_fail (BUOH_IS_BUOH (buoh));
+
if (buoh->priv->window) {
gtk_window_present (GTK_WINDOW (buoh->priv->window));
} else {
@@ -471,11 +473,15 @@
GtkTreeModel *
buoh_get_comics_model (Buoh *buoh)
{
+ g_return_val_if_fail (BUOH_IS_BUOH (buoh), NULL);
+
return buoh->priv->comic_list;
}
const gchar *
buoh_get_datadir (Buoh *buoh)
{
+ g_return_val_if_fail (BUOH_IS_BUOH (buoh), NULL);
+
return buoh->priv->datadir;
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /cvsroot/buoh/buoh/src/buoh.h 2005/11/15 13:02:12 1.7
+++ /cvsroot/buoh/buoh/src/buoh.h 2005/11/16 20:29:28 1.8
@@ -55,7 +55,7 @@
GObjectClass parent_class;
};
-GType buoh_get_type (void);
+GType buoh_get_type (void) G_GNUC_CONST;
Buoh *buoh_get_instance (void);
Buoh *buoh_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]