Changeset 76 for gtkimageview/src
- Timestamp:
- 04/17/07 19:48:42 (6 years ago)
- Files:
-
- gtkimageview/src/gtkimagenav.c (modified) (6 diffs)
- gtkimageview/src/gtkimagescrollwin.c (modified) (5 diffs)
- gtkimageview/src/gtkimageview.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gtkimageview/src/gtkimagenav.c
r73 r76 21 21 #include <math.h> 22 22 23 /*************************************************************/ 24 /***** Private data ******************************************/ 25 /*************************************************************/ 26 static GtkWidgetClass *parent_class = NULL; 27 23 24 G_DEFINE_TYPE (GtkImageNav, gtk_image_nav, GTK_TYPE_WINDOW); 28 25 29 26 /*************************************************************/ … … 251 248 gtk_image_nav_realize (GtkWidget *widget) 252 249 { 253 GTK_WIDGET_CLASS ( parent_class)->realize (widget);250 GTK_WIDGET_CLASS (gtk_image_nav_parent_class)->realize (widget); 254 251 GtkImageNav *nav = GTK_IMAGE_NAV (widget); 255 252 nav->gc = gdk_gc_new (widget->window); … … 266 263 { 267 264 g_object_unref (GTK_IMAGE_NAV (widget)->gc); 268 GTK_WIDGET_CLASS ( parent_class)->unrealize (widget);265 GTK_WIDGET_CLASS (gtk_image_nav_parent_class)->unrealize (widget); 269 266 } 270 267 … … 311 308 312 309 /* Chain up. */ 313 G_OBJECT_CLASS ( parent_class)->finalize (object);310 G_OBJECT_CLASS (gtk_image_nav_parent_class)->finalize (object); 314 311 } 315 312 … … 317 314 gtk_image_nav_class_init (GtkImageNavClass *klass) 318 315 { 319 parent_class = g_type_class_peek_parent (klass);320 321 316 GObjectClass *object_class = G_OBJECT_CLASS (klass); 322 317 object_class->finalize = gtk_image_nav_finalize; … … 361 356 } 362 357 363 /**364 * gtk_image_nav_get_type:365 * @returns: The unique type identifier for this registered type.366 **/367 GType368 gtk_image_nav_get_type (void)369 {370 static GType our_type = 0;371 if (our_type)372 return our_type;373 GTypeInfo our_info = {374 sizeof (GtkImageNavClass),375 NULL,376 NULL,377 (GClassInitFunc) gtk_image_nav_class_init,378 NULL,379 NULL,380 sizeof (GtkImageNav),381 0,382 (GInstanceInitFunc) gtk_image_nav_init383 };384 our_type = g_type_register_static (GTK_TYPE_WINDOW,385 "GtkImageNav",386 &our_info,387 0);388 return our_type;389 }390 391 358 392 359 /*************************************************************/ gtkimageview/src/gtkimagescrollwin.c
r67 r76 24 24 /***** PRIVATE DATA ******************************************/ 25 25 /*************************************************************/ 26 static GtkWidgetClass *parent_class = NULL;27 26 28 27 static char *nav_button_xpm[] = { … … 46 45 }; 47 46 47 G_DEFINE_TYPE(GtkImageScrollWin, gtk_image_scroll_win, GTK_TYPE_HBOX); 48 48 49 49 /*************************************************************/ … … 127 127 128 128 /* Chain up. */ 129 G_OBJECT_CLASS ( parent_class)->finalize (object);129 G_OBJECT_CLASS (gtk_image_scroll_win_parent_class)->finalize (object); 130 130 } 131 131 … … 133 133 gtk_image_scroll_win_class_init (GtkImageScrollWinClass *klass) 134 134 { 135 parent_class = g_type_class_peek_parent (klass);136 137 135 GObjectClass *object_class = G_OBJECT_CLASS (klass); 138 136 object_class->finalize = gtk_image_scroll_win_finalize; … … 216 214 } 217 215 218 /**219 * gtk_image_scroll_win_get_type:220 *221 * Returns the unique type identifier for this registered type.222 **/223 GType224 gtk_image_scroll_win_get_type (void)225 {226 static GType our_type = 0;227 if (our_type)228 return our_type;229 GTypeInfo our_info = {230 sizeof (GtkImageScrollWinClass),231 NULL,232 NULL,233 (GClassInitFunc) gtk_image_scroll_win_class_init,234 NULL,235 NULL,236 sizeof (GtkImageScrollWin),237 0,238 (GInstanceInitFunc) gtk_image_scroll_win_init239 };240 our_type = g_type_register_static (GTK_TYPE_HBOX,241 "GtkImageScrollWin",242 &our_info,243 0);244 return our_type;245 }246 247 216 /*************************************************************/ 248 217 /***** Read-only properties **********************************/ gtkimageview/src/gtkimageview.c
r73 r76 54 54 }; 55 55 56 static GtkWidgetClass *parent_class = NULL;57 56 static guint gtk_image_view_signals[LAST_SIGNAL] = {0}; 58 57 58 G_DEFINE_TYPE(GtkImageView, gtk_image_view, GTK_TYPE_WIDGET); 59 59 60 60 /*************************************************************/ … … 532 532 gdk_cursor_unref (view->void_cursor); 533 533 g_free (view->mouse_handler); 534 GTK_WIDGET_CLASS ( parent_class)->unrealize (widget);534 GTK_WIDGET_CLASS (gtk_image_view_parent_class)->unrealize (widget); 535 535 } 536 536 … … 745 745 } 746 746 /* Chain up. */ 747 G_OBJECT_CLASS ( parent_class)->finalize (object);747 G_OBJECT_CLASS (gtk_image_view_parent_class)->finalize (object); 748 748 } 749 749 … … 874 874 gtk_image_view_init_signals (klass); 875 875 876 parent_class = g_type_class_peek_parent (klass);877 878 876 GObjectClass *object_class = G_OBJECT_CLASS (klass); 879 877 object_class->finalize = gtk_image_view_finalize; … … 1031 1029 } 1032 1030 1033 /**1034 * gtk_image_view_get_type:1035 *1036 * @returns: The unique type identifier for this registered type.1037 **/1038 GType1039 gtk_image_view_get_type (void)1040 {1041 static GType our_type = 0;1042 if (our_type)1043 return our_type;1044 1045 GTypeInfo our_info = {1046 sizeof (GtkImageViewClass),1047 NULL,1048 NULL,1049 (GClassInitFunc) gtk_image_view_class_init,1050 NULL,1051 NULL,1052 sizeof (GtkImageView),1053 0,1054 (GInstanceInitFunc) gtk_image_view_init1055 };1056 our_type = g_type_register_static (GTK_TYPE_WIDGET,1057 "GtkImageView",1058 &our_info,1059 0);1060 return our_type;1061 }1062 1063 1031 /*************************************************************/ 1064 1032 /***** Read-only properties **********************************/
