[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: Sun Oct 8 12:05:38 2006
CVS commit to /cvsroot/buoh/buoh/src by carlosgc
Modified Files:
buoh-add-comic-dialog.c buoh-comic-cache.c buoh-comic-list.c
buoh-comic-loader.c buoh-comic-manager-date.c
buoh-comic-manager-date.h buoh-comic-manager.c
buoh-comic-manager.h buoh-comic.c buoh-properties-dialog.c
buoh-view-comic.c buoh-view-message.c buoh-view.c
buoh-window.c buoh.c
Log Message:
2006-10-08 Carlos Garcia Campos <carlosgc gnome org>
* src/buoh-add-comic-dialog.c:
* src/buoh-comic-cache.c:
* src/buoh-comic-list.c:
* src/buoh-comic-loader.c:
* src/buoh-comic-manager-date.[ch]:
* src/buoh-comic-manager.[ch]:
* src/buoh-comic.c:
* src/buoh-properties-dialog.c:
* src/buoh-view-comic.c:
* src/buoh-view-message.c:
* src/buoh-view.c:
* src/buoh-window.c:
* src/buoh.c:
Use G_DEFINE_TYPE macro.
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.c 2005/09/30 16:13:46 1.6
+++ /cvsroot/buoh/buoh/src/buoh-add-comic-dialog.c 2006/10/08 18:05:35 1.7
@@ -38,8 +38,6 @@
#define BUOH_ADD_COMIC_DIALOG_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_ADD_COMIC_DIALOG, BuohAddComicDialogPrivate))
-static GtkDialogClass *parent_class = NULL;
-
static void buoh_add_comic_dialog_init (BuohAddComicDialog *dialog);
static void buoh_add_comic_dialog_class_init (BuohAddComicDialogClass *klass);
@@ -49,30 +47,7 @@
gchar *path,
gpointer gdata);
-GType
-buoh_add_comic_dialog_get_type ()
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohAddComicDialogClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_add_comic_dialog_class_init,
- NULL,
- NULL,
- sizeof (BuohAddComicDialog),
- 0,
- (GInstanceInitFunc) buoh_add_comic_dialog_init
- };
-
- type = g_type_register_static (GTK_TYPE_DIALOG, "BuohAddComicDialog",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohAddComicDialog, buoh_add_comic_dialog, GTK_TYPE_DIALOG)
static void
buoh_add_comic_dialog_init (BuohAddComicDialog *dialog)
@@ -194,8 +169,6 @@
static void
buoh_add_comic_dialog_class_init (BuohAddComicDialogClass *klass)
{
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohAddComicDialogPrivate));
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-cache.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /cvsroot/buoh/buoh/src/buoh-comic-cache.c 2005/12/01 21:55:27 1.4
+++ /cvsroot/buoh/buoh/src/buoh-comic-cache.c 2006/10/08 18:05:35 1.5
@@ -43,36 +43,11 @@
#define CACHE_SIZE 1048576 /* 1MB */
-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);
-GType
-buoh_comic_cache_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicCacheClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_cache_class_init,
- NULL,
- NULL,
- sizeof (BuohComicCache),
- 0,
- (GInstanceInitFunc) buoh_comic_cache_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "BuohComicCache",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohComicCache, buoh_comic_cache, G_TYPE_OBJECT)
static void
buoh_comic_cache_init (BuohComicCache *buoh_comic_cache)
@@ -82,18 +57,11 @@
buoh_comic_cache->priv->cache_dir =
g_build_filename (buoh_get_datadir (BUOH), "cache", NULL);
- buoh_comic_cache->priv->image_list = NULL;
buoh_comic_cache->priv->image_hash =
g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
(GDestroyNotify)buoh_comic_image_free);
- buoh_comic_cache->priv->image_disk = NULL;
-
- buoh_comic_cache->priv->current_pixbuf = NULL;
- buoh_comic_cache->priv->current_uri = NULL;
-
- buoh_comic_cache->priv->size = 0;
}
static void
@@ -101,8 +69,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohComicCachePrivate));
object_class->finalize = buoh_comic_cache_finalize;
@@ -156,8 +122,8 @@
comic_cache->priv->current_uri = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_cache_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_cache_parent_class)->finalize) (object);
}
BuohComicCache *
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-list.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /cvsroot/buoh/buoh/src/buoh-comic-list.c 2005/11/16 20:29:28 1.13
+++ /cvsroot/buoh/buoh/src/buoh-comic-list.c 2006/10/08 18:05:35 1.14
@@ -37,8 +37,6 @@
#define BUOH_COMIC_LIST_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_LIST, BuohComicListPrivate))
-static GtkBinClass *parent_class = NULL;
-
static void buoh_comic_list_init (BuohComicList *buoh_comic_list);
static void buoh_comic_list_class_init (BuohComicListClass *klass);
static void buoh_comic_list_finalize (GObject *object);
@@ -54,30 +52,7 @@
GtkTreeIter *iter,
gpointer gdata);
-GType
-buoh_comic_list_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicListClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_list_class_init,
- NULL,
- NULL,
- sizeof (BuohComicList),
- 0,
- (GInstanceInitFunc) buoh_comic_list_init
- };
-
- type = g_type_register_static (GTK_TYPE_BIN, "BuohComicList",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohComicList, buoh_comic_list, GTK_TYPE_BIN)
static void
buoh_comic_list_selection_changed (GtkTreeSelection *selection, gpointer gdata)
@@ -174,8 +149,6 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohComicListPrivate));
widget_class->size_request = buoh_comic_list_size_request;
@@ -196,8 +169,8 @@
comic_list->priv->model = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_list_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_list_parent_class)->finalize) (object);
}
static void
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-loader.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- /cvsroot/buoh/buoh/src/buoh-comic-loader.c 2006/10/08 16:17:11 1.15
+++ /cvsroot/buoh/buoh/src/buoh-comic-loader.c 2006/10/08 18:05:35 1.16
@@ -57,7 +57,6 @@
G_DEFINE_TYPE (BuohComicLoaderJob, buoh_comic_loader_job, G_TYPE_OBJECT)
-
struct _BuohComicLoaderPrivate {
BuohComicLoaderJob *job;
@@ -68,8 +67,6 @@
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_LOADER, BuohComicLoaderPrivate))
-static GObjectClass *parent_class = NULL;
-
enum {
FINISHED,
LAST_SIGNAL
@@ -83,37 +80,14 @@
static void buoh_comic_loader_clear (BuohComicLoader *loader);
-GType
-buoh_comic_loader_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicLoaderClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_loader_class_init,
- NULL,
- NULL,
- sizeof (BuohComicLoader),
- 0,
- (GInstanceInitFunc) buoh_comic_loader_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "BuohComicLoader",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohComicLoader, buoh_comic_loader, G_TYPE_OBJECT)
GQuark
buoh_comic_loader_error_quark (void)
{
static GQuark quark = 0;
- if (quark == 0)
+ if (G_UNLIKELY (quark == 0))
quark = g_quark_from_static_string ("buoh-comic-loader-error-quark");
return quark;
@@ -130,8 +104,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohComicLoaderPrivate));
buoh_comic_loader_signals [FINISHED] =
@@ -160,8 +132,8 @@
loader->priv->error = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_loader_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_loader_parent_class)->finalize) (object);
}
BuohComicLoader *
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c 2005/12/16 14:11:13 1.11
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager-date.c 2006/10/08 18:05:35 1.12
@@ -24,7 +24,8 @@
#include "buoh.h"
#include "buoh-comic-manager-date.h"
-#define BUOH_COMIC_MANAGER_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), BUOH_COMIC_MANAGER_DATE_TYPE, BuohComicManagerDatePrivate))
+#define BUOH_COMIC_MANAGER_DATE_GET_PRIVATE(object) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((object), BUOH_TYPE_COMIC_MANAGER_DATE, BuohComicManagerDatePrivate))
#define URI_BUFFER 256
#define ID_BUFFER 100
@@ -44,8 +45,6 @@
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;
-
struct _BuohComicManagerDatePrivate {
GDate *date;
GDate *first;
@@ -64,31 +63,7 @@
N_("Sunday")
};
-GType
-buoh_comic_manager_date_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicManagerDateClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_manager_date_class_init,
- NULL,
- NULL,
- sizeof (BuohComicManagerDate),
- 0,
- (GInstanceInitFunc) buoh_comic_manager_date_init
- };
-
- type = g_type_register_static (BUOH_COMIC_MANAGER_TYPE,
- "BuohComicManagerDate",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohComicManagerDate, buoh_comic_manager_date, BUOH_TYPE_COMIC_MANAGER)
static void
buoh_comic_manager_date_init (BuohComicManagerDate *comic_manager)
@@ -97,10 +72,6 @@
comic_manager->priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
- comic_manager->priv->date = NULL;
- comic_manager->priv->first = NULL;
- comic_manager->priv->offset = 0;
-
for (i = G_DATE_BAD_WEEKDAY; i <= G_DATE_SUNDAY; i++)
comic_manager->priv->publications[i] = TRUE;
}
@@ -111,8 +82,6 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
BuohComicManagerClass *manager_class = (BuohComicManagerClass *) klass;
- parent_class = g_type_class_peek_parent (klass);
-
manager_class->get_next = buoh_comic_manager_date_get_next;
manager_class->get_previous = buoh_comic_manager_date_get_previous;
manager_class->get_last = buoh_comic_manager_date_get_last;
@@ -141,8 +110,8 @@
comic_manager->priv->first = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_manager_date_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_manager_date_parent_class)->finalize) (object);
}
BuohComicManager *
@@ -158,7 +127,7 @@
author != NULL && language != NULL &&
generic_uri != NULL, NULL);
- comic_manager = BUOH_COMIC_MANAGER_DATE (g_object_new (BUOH_COMIC_MANAGER_DATE_TYPE,
+ comic_manager = BUOH_COMIC_MANAGER_DATE (g_object_new (BUOH_TYPE_COMIC_MANAGER_DATE,
"id", id,
"title", title,
"author", author,
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h 2005/12/16 14:11:13 1.7
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager-date.h 2006/10/08 18:05:35 1.8
@@ -30,12 +30,12 @@
typedef struct _BuohComicManagerDateClass BuohComicManagerDateClass;
typedef struct _BuohComicManagerDatePrivate BuohComicManagerDatePrivate;
-#define BUOH_COMIC_MANAGER_DATE_TYPE (buoh_comic_manager_date_get_type ())
-#define BUOH_COMIC_MANAGER_DATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BUOH_COMIC_MANAGER_DATE_TYPE, BuohComicManagerDate))
-#define BUOH_COMIC_MANAGER_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BUOH_COMIC_MANAGER_DATE_TYPE, BuohComicManagerDateClass))
-#define BUOH_IS_COMIC_MANAGER_DATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BUOH_COMIC_MANAGER_DATE_TYPE))
-#define BUOH_IS_COMIC_MANAGER_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BUOH_COMIC_MANAGER_DATE_TYPE))
-#define BUOH_COMIC_MANAGER_DATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BUOH_COMIC_MANAGER_DATE_TYPE, BuohComicManagerDateClass))
+#define BUOH_TYPE_COMIC_MANAGER_DATE (buoh_comic_manager_date_get_type ())
+#define BUOH_COMIC_MANAGER_DATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BUOH_TYPE_COMIC_MANAGER_DATE, BuohComicManagerDate))
+#define BUOH_COMIC_MANAGER_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BUOH_TYPE_COMIC_MANAGER_DATE, BuohComicManagerDateClass))
+#define BUOH_IS_COMIC_MANAGER_DATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BUOH_TYPE_COMIC_MANAGER_DATE))
+#define BUOH_IS_COMIC_MANAGER_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BUOH_TYPE_COMIC_MANAGER_DATE))
+#define BUOH_COMIC_MANAGER_DATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BUOH_TYPE_COMIC_MANAGER_DATE, BuohComicManagerDateClass))
struct _BuohComicManagerDate {
BuohComicManager parent;
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /cvsroot/buoh/buoh/src/buoh-comic-manager.c 2006/09/24 18:31:42 1.9
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager.c 2006/10/08 18:05:35 1.10
@@ -24,7 +24,7 @@
#include "buoh-comic-manager-date.h"
#define BUOH_COMIC_MANAGER_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_COMIC_MANAGER_TYPE, BuohComicManagerPrivate))
+ (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_MANAGER, BuohComicManagerPrivate))
enum {
PROP_0,
@@ -47,8 +47,6 @@
GList *current;
};
-static GObjectClass *parent_class = NULL;
-
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);
@@ -61,30 +59,7 @@
const GValue *value,
GParamSpec *pspec);
-GType
-buoh_comic_manager_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicManagerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_manager_class_init,
- NULL,
- NULL,
- sizeof (BuohComicManager),
- 0,
- (GInstanceInitFunc) buoh_comic_manager_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "BuohComicManager",
- &info, G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
+G_DEFINE_ABSTRACT_TYPE (BuohComicManager, buoh_comic_manager, G_TYPE_OBJECT)
static void
buoh_comic_manager_init (BuohComicManager *comic_manager)
@@ -105,8 +80,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohComicManagerPrivate));
object_class->set_property = buoh_comic_manager_set_property;
@@ -204,8 +177,8 @@
comic_manager->priv->comic_list = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_manager_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_manager_parent_class)->finalize) (object);
}
BuohComicManager *
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic-manager.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /cvsroot/buoh/buoh/src/buoh-comic-manager.h 2006/09/24 18:31:42 1.7
+++ /cvsroot/buoh/buoh/src/buoh-comic-manager.h 2006/10/08 18:05:35 1.8
@@ -28,12 +28,12 @@
typedef struct _BuohComicManagerClass BuohComicManagerClass;
typedef struct _BuohComicManagerPrivate BuohComicManagerPrivate;
-#define BUOH_COMIC_MANAGER_TYPE (buoh_comic_manager_get_type ())
-#define BUOH_COMIC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BUOH_COMIC_MANAGER_TYPE, BuohComicManager))
-#define BUOH_COMIC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BUOH_COMIC_MANAGER_TYPE, BuohComicManagerClass))
-#define BUOH_IS_COMIC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BUOH_COMIC_MANAGER_TYPE))
-#define BUOH_IS_COMIC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BUOH_COMIC_MANAGER_TYPE))
-#define BUOH_COMIC_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BUOH_COMIC_MANAGER_TYPE, BuohComicManagerClass))
+#define BUOH_TYPE_COMIC_MANAGER (buoh_comic_manager_get_type ())
+#define BUOH_COMIC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BUOH_TYPE_COMIC_MANAGER, BuohComicManager))
+#define BUOH_COMIC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BUOH_TYPE_COMIC_MANAGER, BuohComicManagerClass))
+#define BUOH_IS_COMIC_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BUOH_TYPE_COMIC_MANAGER))
+#define BUOH_IS_COMIC_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BUOH_TYPE_COMIC_MANAGER))
+#define BUOH_COMIC_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BUOH_TYPE_COMIC_MANAGER, BuohComicManagerClass))
struct _BuohComicManager {
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-comic.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /cvsroot/buoh/buoh/src/buoh-comic.c 2006/09/24 18:31:42 1.13
+++ /cvsroot/buoh/buoh/src/buoh-comic.c 2006/10/08 18:05:35 1.14
@@ -49,8 +49,6 @@
#define BUOH_COMIC_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC, BuohComicPrivate))
-static GObjectClass *parent_class = NULL;
-
static void buoh_comic_init (BuohComic *buoh_comic);
static void buoh_comic_class_init (BuohComicClass *klass);
static void buoh_comic_finalize (GObject *object);
@@ -63,30 +61,7 @@
const GValue *value,
GParamSpec *pspec);
-GType
-buoh_comic_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohComicClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_comic_class_init,
- NULL,
- NULL,
- sizeof (BuohComic),
- 0,
- (GInstanceInitFunc) buoh_comic_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "BuohComic",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohComic, buoh_comic, G_TYPE_OBJECT)
static void
buoh_comic_init (BuohComic *buoh_comic)
@@ -105,8 +80,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohComicPrivate));
object_class->set_property = buoh_comic_set_property;
@@ -175,8 +148,8 @@
comic->priv->cache = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_comic_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_comic_parent_class)->finalize) (object);
}
BuohComic *
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-properties-dialog.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- /cvsroot/buoh/buoh/src/buoh-properties-dialog.c 2006/09/24 18:31:42 1.17
+++ /cvsroot/buoh/buoh/src/buoh-properties-dialog.c 2006/10/08 18:05:35 1.18
@@ -35,43 +35,16 @@
#define BUOH_PROPERTIES_DIALOG_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_PROPERTIES_DIALOG, BuohPropertiesDialogPrivate))
-static GtkDialogClass *parent_class = NULL;
-
static void buoh_properties_dialog_init (BuohPropertiesDialog *dialog);
static void buoh_properties_dialog_class_init (BuohPropertiesDialogClass *klass);
-GType
-buoh_properties_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohPropertiesDialogClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_properties_dialog_class_init,
- NULL,
- NULL,
- sizeof (BuohPropertiesDialog),
- 0,
- (GInstanceInitFunc) buoh_properties_dialog_init
- };
-
- type = g_type_register_static (GTK_TYPE_DIALOG, "BuohPropertiesDialog",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohPropertiesDialog, buoh_properties_dialog, GTK_TYPE_DIALOG)
static void
buoh_properties_dialog_init (BuohPropertiesDialog *dialog)
{
dialog->priv = BUOH_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
- dialog->priv->comic_manager = NULL;
-
gtk_window_set_title (GTK_WINDOW (dialog), _("Comic Properties"));
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
@@ -91,8 +64,6 @@
static void
buoh_properties_dialog_class_init (BuohPropertiesDialogClass *klass)
{
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohPropertiesDialogPrivate));
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-comic.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- /cvsroot/buoh/buoh/src/buoh-view-comic.c 2006/10/08 15:38:29 1.17
+++ /cvsroot/buoh/buoh/src/buoh-view-comic.c 2006/10/08 18:05:35 1.18
@@ -66,8 +66,6 @@
#define DATA_SIZE 61440 /* 60K */
-static GtkViewportClass *parent_class = NULL;
-
static void buoh_view_comic_init (BuohViewComic *m_view);
static void buoh_view_comic_class_init (BuohViewComicClass *klass);
static void buoh_view_comic_finalize (GObject *object);
@@ -113,30 +111,7 @@
gdouble factor,
gboolean relative);
-GType
-buoh_view_comic_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohViewComicClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_view_comic_class_init,
- NULL,
- NULL,
- sizeof (BuohViewComic),
- 0,
- (GInstanceInitFunc) buoh_view_comic_init
- };
-
- type = g_type_register_static (GTK_TYPE_VIEWPORT, "BuohViewComic",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohViewComic, buoh_view_comic, GTK_TYPE_VIEWPORT)
static void
buoh_view_comic_init (BuohViewComic *c_view)
@@ -190,8 +165,6 @@
widget_class->scroll_event = buoh_view_comic_scroll_event;
widget_class->size_allocate = buoh_view_comic_size_allocate;
- parent_class = g_type_class_peek_parent (klass);
-
/* Properties */
g_object_class_install_property (object_class,
PROP_COMIC,
@@ -241,8 +214,8 @@
c_view->priv->pixbuf_loader = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_view_comic_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_view_comic_parent_class)->finalize) (object);
}
static void
@@ -258,8 +231,8 @@
c_view->priv->comic_loader = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+ if (G_OBJECT_CLASS (buoh_view_comic_parent_class)->dispose)
+ (* G_OBJECT_CLASS (buoh_view_comic_parent_class)->dispose) (object);
}
static void
@@ -449,7 +422,7 @@
c_view);
}
- GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
+ GTK_WIDGET_CLASS (buoh_view_comic_parent_class)->size_allocate (widget, allocation);
}
GtkWidget *
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view-message.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /cvsroot/buoh/buoh/src/buoh-view-message.c 2006/09/25 18:18:33 1.5
+++ /cvsroot/buoh/buoh/src/buoh-view-message.c 2006/10/08 18:05:35 1.6
@@ -34,35 +34,10 @@
#define BUOH_VIEW_MESSAGE_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_VIEW_MESSAGE, BuohViewMessagePrivate))
-static GtkViewportClass *parent_class = NULL;
-
static void buoh_view_message_init (BuohViewMessage *m_view);
static void buoh_view_message_class_init (BuohViewMessageClass *klass);
-GType
-buoh_view_message_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohViewMessageClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_view_message_class_init,
- NULL,
- NULL,
- sizeof (BuohViewMessage),
- 0,
- (GInstanceInitFunc) buoh_view_message_init
- };
-
- type = g_type_register_static (GTK_TYPE_VIEWPORT, "BuohViewMessage",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohViewMessage, buoh_view_message, GTK_TYPE_VIEWPORT)
static void
buoh_view_message_init (BuohViewMessage *m_view)
@@ -119,8 +94,6 @@
static void
buoh_view_message_class_init (BuohViewMessageClass *klass)
{
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohViewMessagePrivate));
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-view.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- /cvsroot/buoh/buoh/src/buoh-view.c 2006/10/08 15:38:29 1.14
+++ /cvsroot/buoh/buoh/src/buoh-view.c 2006/10/08 18:05:35 1.15
@@ -53,7 +53,6 @@
#define BUOH_VIEW_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_VIEW, BuohViewPrivate))
-static GtkNotebookClass *parent_class = NULL;
static guint buoh_view_signals[N_SIGNALS];
static void buoh_view_init (BuohView *buoh_view);
@@ -76,37 +75,14 @@
GParamSpec *arg,
gpointer gdata);
-GType
-buoh_view_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohViewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_view_class_init,
- NULL,
- NULL,
- sizeof (BuohView),
- 0,
- (GInstanceInitFunc) buoh_view_init
- };
-
- type = g_type_register_static (GTK_TYPE_NOTEBOOK, "BuohView",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohView, buoh_view, GTK_TYPE_NOTEBOOK)
GType
buoh_view_status_get_type (void)
{
static GType etype = 0;
- if (etype == 0) {
+ if (G_UNLIKELY (etype == 0)) {
static const GEnumValue values[] = {
{ STATE_MESSAGE_WELCOME, "STATE_MESSAGE_WELCOME", "welcome" },
{ STATE_MESSAGE_ERROR, "STATE_MESSAGE_ERROR", "error" },
@@ -127,7 +103,7 @@
{
static GType etype = 0;
- if (etype == 0) {
+ if (G_UNLIKELY (etype == 0)) {
static const GEnumValue values[] = {
{ VIEW_ZOOM_FREE, "VIEW_ZOOM_FREE", "free" },
{ VIEW_ZOOM_BEST_FIT, "VIEW_ZOOM_BEST_FIT", "best-fit" },
@@ -225,8 +201,6 @@
widget_class->grab_focus = buoh_view_grab_focus;
widget_class->button_press_event = buoh_view_button_press_event;
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohViewPrivate));
/* Properties */
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh-window.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- /cvsroot/buoh/buoh/src/buoh-window.c 2006/10/08 15:38:29 1.34
+++ /cvsroot/buoh/buoh/src/buoh-window.c 2006/10/08 18:05:35 1.35
@@ -60,8 +60,6 @@
#define GCONF_SHOW_STATUSBAR "/apps/buoh/show_statusbar"
#define GCONF_LOCKDOWN_SAVE "/desktop/gnome/lockdown/disable_save_to_disk"
-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);
@@ -232,30 +230,7 @@
G_CALLBACK (buoh_window_cmd_view_zoom_fit_width) }
};
-GType
-buoh_window_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohWindowClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_window_class_init,
- NULL,
- NULL,
- sizeof (BuohWindow),
- 0,
- (GInstanceInitFunc) buoh_window_init
- };
-
- type = g_type_register_static (GTK_TYPE_WINDOW, "BuohWindow",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (BuohWindow, buoh_window, GTK_TYPE_WINDOW)
static void
buoh_window_init (BuohWindow *buoh_window)
@@ -424,8 +399,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohWindowPrivate));
object_class->finalize = buoh_window_finalize;
@@ -465,8 +438,8 @@
buoh_window->priv->add_dialog = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_window_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_window_parent_class)->finalize) (object);
buoh_exit_app (BUOH);
}
===================================================================
RCS file: /cvsroot/buoh/buoh/src/buoh.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- /cvsroot/buoh/buoh/src/buoh.c 2006/10/08 16:17:11 1.31
+++ /cvsroot/buoh/buoh/src/buoh.c 2006/10/08 18:05:35 1.32
@@ -62,8 +62,6 @@
#define GCONF_HTTP_PROXY_AUTHENTICATION_USER "/system/http_proxy/authentication_user"
#define GCONF_HTTP_PROXY_AUTHENTICATION_PASSWORD "/system/http_proxy/authentication_password"
-static GObjectClass *parent_class = NULL;
-
static void buoh_init (Buoh *buoh);
static void buoh_class_init (BuohClass *klass);
static void buoh_finalize (GObject *object);
@@ -76,30 +74,7 @@
gpointer gdata);
static void buoh_create_user_dir (Buoh *buoh);
-GType
-buoh_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (BuohClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) buoh_class_init,
- NULL,
- NULL,
- sizeof (Buoh),
- 0,
- (GInstanceInitFunc) buoh_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "Buoh",
- &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (Buoh, buoh, G_TYPE_OBJECT)
void
buoh_debug (const gchar *format, ...)
@@ -529,8 +504,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (BuohPrivate));
object_class->finalize = buoh_finalize;
@@ -559,8 +532,8 @@
buoh->priv->proxy_uri = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (G_OBJECT_CLASS (buoh_parent_class)->finalize)
+ (* G_OBJECT_CLASS (buoh_parent_class)->finalize) (object);
}
Buoh *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]