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



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

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

	* src/monkey/shooter.c: (shooter_init): use G_DEFINE_TYPE


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

Modified: trunk/src/monkey/shooter.c
==============================================================================
--- trunk/src/monkey/shooter.c	(original)
+++ trunk/src/monkey/shooter.c	Sat Feb  9 14:48:17 2008
@@ -54,7 +54,9 @@
 
 static void shooter_notify_shoot(Shooter * self,Bubble * b);
 
-Shooter * 
+G_DEFINE_TYPE (Shooter, shooter, G_TYPE_OBJECT);
+
+Shooter*
 shooter_new(gdouble x_pos,gdouble y_pos)
 {
 	Shooter *self;
@@ -67,10 +69,10 @@
 }
 
 
-static void 
-shooter_instance_init(Shooter * self) 
+static void
+shooter_init (Shooter* self)
 {
-	self->private =g_new0 (ShooterPrivate, 1);			
+	self->private = g_new0 (ShooterPrivate, 1);
 	PRIVATE(self)->angle = 0;
 	PRIVATE(self)->current_bubble = NULL;
 	PRIVATE(self)->waiting_bubble = NULL;
@@ -295,29 +297,3 @@
 				      G_TYPE_POINTER);
 }
 
-
-GType shooter_get_type(void) {
-	static GType shooter_type = 0;
-  
-	if (!shooter_type) {
-		static const GTypeInfo shooter_info = {
-			sizeof(ShooterClass),
-			NULL,           /* base_init */
-			NULL,           /* base_finalize */
-			(GClassInitFunc) shooter_class_init,
-			NULL,           /* class_finalize */
-			NULL,           /* class_data */
-			sizeof(Shooter),
-			1,              /* n_preallocs */
-			(GInstanceInitFunc) shooter_instance_init,
-		};
-    
-    
-    
-		shooter_type = g_type_register_static(G_TYPE_OBJECT,
-						      "Shooter",
-						      &shooter_info, 0);
-	}
-  
-	return shooter_type;
-}



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