monkey-bubble r339 - in trunk: . src/monkey



Author: herzi
Date: Sat Feb  9 14:48:12 2008
New Revision: 339
URL: http://svn.gnome.org/viewvc/monkey-bubble?rev=339&view=rev

Log:
2008-02-09  Sven Herzberg  <sven imendio com>

	* src/monkey/monkey.c: (monkey_init): use G_DEFINE_TYPE


Modified:
   trunk/ChangeLog
   trunk/src/monkey/monkey.c

Modified: trunk/src/monkey/monkey.c
==============================================================================
--- trunk/src/monkey/monkey.c	(original)
+++ trunk/src/monkey/monkey.c	Sat Feb  9 14:48:12 2008
@@ -91,10 +91,12 @@
 
 static gboolean monkey_has_waiting_row(Monkey * self);
 
-static void 
-monkey_instance_init(Monkey * self) 
+G_DEFINE_TYPE (Monkey, monkey, G_TYPE_OBJECT);
+
+static void
+monkey_init (Monkey* self)
 {
-	self->private =g_new0 (MonkeyPrivate, 1);			
+	self->private = g_new0 (MonkeyPrivate, 1);
 
 	PRIVATE(self)->shot_count = 0;
 
@@ -111,7 +113,6 @@
 	PRIVATE(self)->waiting_bubbles_count = 0;
 
 	PRIVATE(self)->hurry_up = TRUE;
-
 }
 
 /**
@@ -707,36 +708,6 @@
 							1, G_TYPE_INT);
 }
 
-
-GType monkey_get_type(void) {
-	static GType monkey_type = 0;
-    
-	if (!monkey_type) {
-		static const GTypeInfo monkey_info = {
-			sizeof(MonkeyClass),
-			NULL,           /* base_init */
-			NULL,           /* base_finalize */
-			(GClassInitFunc) monkey_class_init,
-			NULL,           /* class_finalize */
-			NULL,           /* class_data */
-			sizeof(Monkey),
-			1,              /* n_preallocs */
-			(GInstanceInitFunc) monkey_instance_init,
-		};
-
-
-		monkey_type = g_type_register_static(G_TYPE_OBJECT,
-						     "Monkey",
-						     &monkey_info,
-						     0);
-
-
-      
-	}
-    
-	return monkey_type;
-}
-
 #ifdef MAEMO
 void monkey_save(Monkey *monkey, const gchar * filename)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]