[gnome-panel/wip/gnome-3.10+: 74/75] fish: use G_DEFINE_TYPE
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/gnome-3.10+: 74/75] fish: use G_DEFINE_TYPE
- Date: Tue, 7 Oct 2014 22:32:13 +0000 (UTC)
commit b812cbe3e7d00519dfffcce00921a6fecdcc3fe7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Sep 24 18:59:57 2014 +0300
fish: use G_DEFINE_TYPE
applets/fish/fish.c | 36 +++---------------------------------
1 files changed, 3 insertions(+), 33 deletions(-)
---
diff --git a/applets/fish/fish.c b/applets/fish/fish.c
index da7e277..e267659 100644
--- a/applets/fish/fish.c
+++ b/applets/fish/fish.c
@@ -41,8 +41,6 @@
#define FISH_APPLET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
fish_applet_get_type(), \
FishApplet))
-#define FISH_IS_APPLET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
- FISH_TYPE_APPLET))
#define FISH_ICON "gnome-panel-fish"
#define FISH_RESOURCE_PATH "/org/gnome/panel/applet/fish/"
@@ -104,7 +102,6 @@ typedef struct {
PanelAppletClass klass;
} FishAppletClass;
-
static gboolean load_fish_image (FishApplet *fish);
static void update_surface (FishApplet *fish);
static void something_fishy_going_on (FishApplet *fish,
@@ -114,7 +111,7 @@ static void set_tooltip (FishApplet *fish);
static GType fish_applet_get_type (void);
-static GObjectClass *parent_class;
+G_DEFINE_TYPE (FishApplet, fish_applet, PANEL_TYPE_APPLET)
static int fools_day = 0;
static int fools_month = 0;
@@ -1547,12 +1544,11 @@ fish_applet_dispose (GObject *object)
fish_close_channel (fish);
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (fish_applet_parent_class)->dispose (object);
}
static void
-fish_applet_instance_init (FishApplet *fish,
- FishAppletClass *klass)
+fish_applet_init (FishApplet *fish)
{
fish->settings = NULL;
fish->lockdown_settings = NULL;
@@ -1609,8 +1605,6 @@ fish_applet_class_init (FishAppletClass *klass)
PanelAppletClass *applet_class = (PanelAppletClass *) klass;
GObjectClass *gobject_class = (GObjectClass *) klass;
- parent_class = g_type_class_peek_parent (klass);
-
applet_class->change_orient = fish_applet_change_orient;
gobject_class->dispose = fish_applet_dispose;
@@ -1618,30 +1612,6 @@ fish_applet_class_init (FishAppletClass *klass)
init_fools_day ();
}
-static GType
-fish_applet_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (PanelAppletClass),
- NULL, NULL,
- (GClassInitFunc) fish_applet_class_init,
- NULL, NULL,
- sizeof (FishApplet),
- 0,
- (GInstanceInitFunc) fish_applet_instance_init,
- NULL
- };
-
- type = g_type_register_static (
- PANEL_TYPE_APPLET, "FishApplet", &info, 0);
- }
-
- return type;
-}
-
PANEL_APPLET_IN_PROCESS_FACTORY ("FishAppletFactory",
fish_applet_get_type (),
fishy_factory,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]