]> git.sur5r.net Git - glabels/commitdiff
2007-02-14 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Wed, 14 Feb 2007 18:16:46 +0000 (18:16 +0000)
committerJim Evins <evins@snaught.com>
Wed, 14 Feb 2007 18:16:46 +0000 (18:16 +0000)
* src/base64.c:
* src/base64.h:
* src/bc-gnubarcode.c:
* src/bc-gnubarcode.h:
* src/bc-postnet.c:
* src/bc-postnet.h:
* src/bc.c:
* src/bc.h:
* src/canvas-hacktext.c:
* src/canvas-hacktext.h:
* src/debug.c:
* src/debug.h:
* src/file.c:
* src/file.h:
* src/glabels.c:
* src/hig.h:
* src/label-barcode.c:
* src/label-barcode.h:
* src/label-box.c:
* src/label-box.h:
* src/label-ellipse.c:
* src/label-ellipse.h:
* src/label-image.c:
* src/label-image.h:
* src/label-line.c:
* src/label-line.h:
* src/label-object.c:
* src/label-object.h:
* src/label-text.c:
* src/label-text.h:
* src/label.c:
* src/label.h:
* src/merge-evolution.c:
* src/merge-evolution.h:
* src/merge-init.c:
* src/merge-init.h:
* src/merge-properties-dialog.c:
* src/merge-properties-dialog.h:
* src/merge-text.c:
* src/merge-text.h:
* src/merge-vcard.c:
* src/merge-vcard.h:
* src/merge.c:
* src/merge.h:
* src/mini-preview-pixbuf.h:
* src/new-label-dialog.c:
* src/new-label-dialog.h:
* src/object-editor-bc-page.c:
* src/object-editor-data-page.c:
* src/object-editor-edit-page.c:
* src/object-editor-fill-page.c:
* src/object-editor-image-page.c:
* src/object-editor-line-page.c:
* src/object-editor-lsize-page.c:
* src/object-editor-position-page.c:
* src/object-editor-private.h:
* src/object-editor-size-page.c:
* src/object-editor-text-page.c:
* src/object-editor.c:
* src/object-editor.h:
* src/pixbuf-cache.c:
* src/pixbuf-cache.h:
* src/prefs-dialog.c:
* src/prefs-dialog.h:
* src/prefs-model.c:
* src/prefs-model.h:
* src/prefs.c:
* src/prefs.h:
* src/print-op.c:
* src/stock.c:
* src/stock.h:
* src/template-designer.c:
* src/text-node.c:
* src/text-node.h:
* src/ui-commands.c:
* src/ui-commands.h:
* src/ui-property-bar.c:
* src/ui-property-bar.h:
* src/ui-sidebar.c:
* src/ui-sidebar.h:
* src/ui-util.c:
* src/ui-util.h:
* src/ui.c:
* src/ui.h:
* src/util.c:
* src/util.h:
* src/view-barcode.c:
* src/view-barcode.h:
* src/view-box.c:
* src/view-box.h:
* src/view-ellipse.c:
* src/view-ellipse.h:
* src/view-highlight.c:
* src/view-highlight.h:
* src/view-image.c:
* src/view-image.h:
* src/view-line.c:
* src/view-line.h:
* src/view-object.c:
* src/view-object.h:
* src/view-text.c:
* src/view-text.h:
* src/view.c:
* src/view.h:
* src/wdgt-chain-button.c:
* src/wdgt-chain-button.h:
* src/wdgt-media-select.c:
* src/wdgt-mini-preview.c:
* src/wdgt-print-copies.c:
* src/wdgt-print-copies.h:
* src/wdgt-print-merge.c:
* src/wdgt-print-merge.h:
* src/wdgt-rotate-label.c:
* src/window.h:
* src/xml-label-04.c:
* src/xml-label-04.h:
* src/xml-label-191.c:
* src/xml-label-191.h:
* src/xml-label.c:
* src/xml-label.h:

Assorted superficial cleanup.  Including:
- Use G_DEFINE_TYPE for all objects.
- Reconcile style of all class initializer functions
- Reconcile style of all finalize functions
- Add emacs mode line to all source files

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@614 f5e0f49d-192f-0410-a22d-a8d8700d0965

122 files changed:
glabels2/ChangeLog
glabels2/src/base64.c
glabels2/src/base64.h
glabels2/src/bc-gnubarcode.c
glabels2/src/bc-gnubarcode.h
glabels2/src/bc-postnet.c
glabels2/src/bc-postnet.h
glabels2/src/bc.c
glabels2/src/bc.h
glabels2/src/canvas-hacktext.c
glabels2/src/canvas-hacktext.h
glabels2/src/debug.c
glabels2/src/debug.h
glabels2/src/file.c
glabels2/src/file.h
glabels2/src/glabels.c
glabels2/src/hig.h
glabels2/src/label-barcode.c
glabels2/src/label-barcode.h
glabels2/src/label-box.c
glabels2/src/label-box.h
glabels2/src/label-ellipse.c
glabels2/src/label-ellipse.h
glabels2/src/label-image.c
glabels2/src/label-image.h
glabels2/src/label-line.c
glabels2/src/label-line.h
glabels2/src/label-object.c
glabels2/src/label-object.h
glabels2/src/label-text.c
glabels2/src/label-text.h
glabels2/src/label.c
glabels2/src/label.h
glabels2/src/merge-evolution.c
glabels2/src/merge-evolution.h
glabels2/src/merge-init.c
glabels2/src/merge-init.h
glabels2/src/merge-properties-dialog.c
glabels2/src/merge-properties-dialog.h
glabels2/src/merge-text.c
glabels2/src/merge-text.h
glabels2/src/merge-vcard.c
glabels2/src/merge-vcard.h
glabels2/src/merge.c
glabels2/src/merge.h
glabels2/src/mini-preview-pixbuf.h
glabels2/src/new-label-dialog.c
glabels2/src/new-label-dialog.h
glabels2/src/object-editor-bc-page.c
glabels2/src/object-editor-data-page.c
glabels2/src/object-editor-edit-page.c
glabels2/src/object-editor-fill-page.c
glabels2/src/object-editor-image-page.c
glabels2/src/object-editor-line-page.c
glabels2/src/object-editor-lsize-page.c
glabels2/src/object-editor-position-page.c
glabels2/src/object-editor-private.h
glabels2/src/object-editor-size-page.c
glabels2/src/object-editor-text-page.c
glabels2/src/object-editor.c
glabels2/src/object-editor.h
glabels2/src/pixbuf-cache.c
glabels2/src/pixbuf-cache.h
glabels2/src/prefs-dialog.c
glabels2/src/prefs-dialog.h
glabels2/src/prefs-model.c
glabels2/src/prefs-model.h
glabels2/src/prefs.c
glabels2/src/prefs.h
glabels2/src/print-op.c
glabels2/src/stock.c
glabels2/src/stock.h
glabels2/src/template-designer.c
glabels2/src/text-node.c
glabels2/src/text-node.h
glabels2/src/ui-commands.c
glabels2/src/ui-commands.h
glabels2/src/ui-property-bar.c
glabels2/src/ui-property-bar.h
glabels2/src/ui-sidebar.c
glabels2/src/ui-sidebar.h
glabels2/src/ui-util.c
glabels2/src/ui-util.h
glabels2/src/ui.c
glabels2/src/ui.h
glabels2/src/util.c
glabels2/src/util.h
glabels2/src/view-barcode.c
glabels2/src/view-barcode.h
glabels2/src/view-box.c
glabels2/src/view-box.h
glabels2/src/view-ellipse.c
glabels2/src/view-ellipse.h
glabels2/src/view-highlight.c
glabels2/src/view-highlight.h
glabels2/src/view-image.c
glabels2/src/view-image.h
glabels2/src/view-line.c
glabels2/src/view-line.h
glabels2/src/view-object.c
glabels2/src/view-object.h
glabels2/src/view-text.c
glabels2/src/view-text.h
glabels2/src/view.c
glabels2/src/view.h
glabels2/src/wdgt-chain-button.c
glabels2/src/wdgt-chain-button.h
glabels2/src/wdgt-media-select.c
glabels2/src/wdgt-mini-preview.c
glabels2/src/wdgt-print-copies.c
glabels2/src/wdgt-print-copies.h
glabels2/src/wdgt-print-merge.c
glabels2/src/wdgt-print-merge.h
glabels2/src/wdgt-rotate-label.c
glabels2/src/window.c
glabels2/src/window.h
glabels2/src/xml-label-04.c
glabels2/src/xml-label-04.h
glabels2/src/xml-label-191.c
glabels2/src/xml-label-191.h
glabels2/src/xml-label.c
glabels2/src/xml-label.h

index 4c438fed33c2eb6e659ac3bf7a6169f1705f2957..ac414b63e928de2aade3aa5213608a5979357dab 100644 (file)
@@ -1,3 +1,132 @@
+2007-02-14  Jim Evins  <evins@snaught.com>
+
+       * src/base64.c:
+       * src/base64.h:
+       * src/bc-gnubarcode.c:
+       * src/bc-gnubarcode.h:
+       * src/bc-postnet.c:
+       * src/bc-postnet.h:
+       * src/bc.c:
+       * src/bc.h:
+       * src/canvas-hacktext.c:
+       * src/canvas-hacktext.h:
+       * src/debug.c:
+       * src/debug.h:
+       * src/file.c:
+       * src/file.h:
+       * src/glabels.c:
+       * src/hig.h:
+       * src/label-barcode.c:
+       * src/label-barcode.h:
+       * src/label-box.c:
+       * src/label-box.h:
+       * src/label-ellipse.c:
+       * src/label-ellipse.h:
+       * src/label-image.c:
+       * src/label-image.h:
+       * src/label-line.c:
+       * src/label-line.h:
+       * src/label-object.c:
+       * src/label-object.h:
+       * src/label-text.c:
+       * src/label-text.h:
+       * src/label.c:
+       * src/label.h:
+       * src/merge-evolution.c:
+       * src/merge-evolution.h:
+       * src/merge-init.c:
+       * src/merge-init.h:
+       * src/merge-properties-dialog.c:
+       * src/merge-properties-dialog.h:
+       * src/merge-text.c:
+       * src/merge-text.h:
+       * src/merge-vcard.c:
+       * src/merge-vcard.h:
+       * src/merge.c:
+       * src/merge.h:
+       * src/mini-preview-pixbuf.h:
+       * src/new-label-dialog.c:
+       * src/new-label-dialog.h:
+       * src/object-editor-bc-page.c:
+       * src/object-editor-data-page.c:
+       * src/object-editor-edit-page.c:
+       * src/object-editor-fill-page.c:
+       * src/object-editor-image-page.c:
+       * src/object-editor-line-page.c:
+       * src/object-editor-lsize-page.c:
+       * src/object-editor-position-page.c:
+       * src/object-editor-private.h:
+       * src/object-editor-size-page.c:
+       * src/object-editor-text-page.c:
+       * src/object-editor.c:
+       * src/object-editor.h:
+       * src/pixbuf-cache.c:
+       * src/pixbuf-cache.h:
+       * src/prefs-dialog.c:
+       * src/prefs-dialog.h:
+       * src/prefs-model.c:
+       * src/prefs-model.h:
+       * src/prefs.c:
+       * src/prefs.h:
+       * src/print-op.c:
+       * src/stock.c:
+       * src/stock.h:
+       * src/template-designer.c:
+       * src/text-node.c:
+       * src/text-node.h:
+       * src/ui-commands.c:
+       * src/ui-commands.h:
+       * src/ui-property-bar.c:
+       * src/ui-property-bar.h:
+       * src/ui-sidebar.c:
+       * src/ui-sidebar.h:
+       * src/ui-util.c:
+       * src/ui-util.h:
+       * src/ui.c:
+       * src/ui.h:
+       * src/util.c:
+       * src/util.h:
+       * src/view-barcode.c:
+       * src/view-barcode.h:
+       * src/view-box.c:
+       * src/view-box.h:
+       * src/view-ellipse.c:
+       * src/view-ellipse.h:
+       * src/view-highlight.c:
+       * src/view-highlight.h:
+       * src/view-image.c:
+       * src/view-image.h:
+       * src/view-line.c:
+       * src/view-line.h:
+       * src/view-object.c:
+       * src/view-object.h:
+       * src/view-text.c:
+       * src/view-text.h:
+       * src/view.c:
+       * src/view.h:
+       * src/wdgt-chain-button.c:
+       * src/wdgt-chain-button.h:
+       * src/wdgt-media-select.c:
+       * src/wdgt-mini-preview.c:
+       * src/wdgt-print-copies.c:
+       * src/wdgt-print-copies.h:
+       * src/wdgt-print-merge.c:
+       * src/wdgt-print-merge.h:
+       * src/wdgt-rotate-label.c:
+       * src/window.h:
+       * src/xml-label-04.c:
+       * src/xml-label-04.h:
+       * src/xml-label-191.c:
+       * src/xml-label-191.h:
+       * src/xml-label.c:
+       * src/xml-label.h:
+
+       Assorted superficial cleanup.  Including:
+       - Use G_DEFINE_TYPE for all objects.
+       - Reconcile style of all class initializer functions
+       - Reconcile style of all finalize functions
+       - Add emacs mode line to all source files
+               
 2007-02-06  Jim Evins  <evins@snaught.com>
 
 Assorted cleanup and removal of deprecated items.
index f2927908989caccb6bf7f1ee6d300ff31b9bf16e..da8ef3486ca8162139cd412cb23aaecb02d0ba7d 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index acddd1782bf8775d4fd0626ad5965659805a651c..420d2a4cca078fddab4f7664c76a9febbf5fa9a8 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index c24b587a384c1a4a0490341dd870da1fdf8cbb82..2c84114b384925634e644f3e69d9b565f5d7a00d 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 136d097896b534a739c48745fa1bebbb7ab78bb7..1e91d998b3b96b0fe024f8e3bf1147fb0dbac29c 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 9979cde86dec9ed5de513324411b41f75dca6ac5..1db1df18f1e765b022fac10382df2e0fb8c8f21e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 0753290aeb8950d50d739cd7fe0a20dc33365662..6e642ab26d00420d3e77c0605423ca419442fe2b 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index c4c5a0db0b73787b5d7497d622cd10fe08929ad8..9b78b023f9ca0b1e242d59a2a3fa8b6b5a196db0 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 70b70324fce62df782ddfd4c8ed45a98ecd05665..8d57b469ba2089ccbcdc2796c208bfac6887881a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 2e5ec01b495e268041920f047e4e80162067f6f2..9b8c3f7e09752b6f8787c76872049b407e146a1d 100644 (file)
@@ -1,4 +1,5 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  gnome-canvas-hacktext.c: Hacktext item type for GnomeCanvas widget
  *                           This is mainly used for gnome-print preview context
index 7fe30134155be654125264b5a735b074f3416758..051acda898ae9873bcb4811c7ed589259a0a9540 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 #ifndef __GL_CANVAS_HACKTEXT_H__
 #define __GL_CANVAS_HACKTEXT_H__
 
index 462eb897845b90de5000b6ab88fd82fa19e0cc78..089deee86de1b61c00aa946f2d1fa810ab8a0ad2 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 15d51bd6a8c1e740df12dae4fa6f87facb655738..7498a6fd3c38f375e778000d95b69d498216013a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 4f934c55d4893e0cc516c7d5fb224f7abc95785f..a6d97d8d494dac54954ea37575fd016ed9f05fd3 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 7d5fb7a08ef6de9c0d53d82c16bb3e481411dc4b..ba826075d7b3f0dd3a5d8c656556543451fd7211 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 40a69739e922adfaa76468216a96bcd4436bf65f..ab8b16ddb51efb850a34defad3d50cf3f2c597cb 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /**
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -30,7 +30,6 @@
 #include <libgnomeui/gnome-window-icon.h>
 
 #include "critical-error-handler.h"
-#include "splash.h"
 #include "stock.h"
 #include "merge-init.h"
 #include "recent.h"
index cb2bb4e8888d0901622c0f53aad2e436ccb0e448..6b4c2494055ddd4afc2ec68ccec823f91781cdff 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 805d6b578a0bf247c48dc83d965325cb5396a986..ba80a9cf24ec3240042240bc194006c0b55c6e18 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -51,16 +53,12 @@ struct _glLabelBarcodePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glLabelObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void  gl_label_barcode_class_init    (glLabelBarcodeClass *klass);
-static void  gl_label_barcode_instance_init (glLabelBarcode      *lbc);
 static void  gl_label_barcode_finalize      (GObject             *object);
 
 static void  copy                           (glLabelObject       *dst_object,
@@ -73,46 +71,22 @@ static void  get_size                       (glLabelObject       *object,
 static void  set_line_color                 (glLabelObject       *object,
                                             glColorNode         *line_color);
 
-static glColorNode *get_line_color           (glLabelObject       *object);
+static glColorNode *get_line_color          (glLabelObject       *object);
 
 
 \f
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_barcode_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelBarcodeClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_barcode_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelBarcode),
-                       0,
-                       (GInstanceInitFunc) gl_label_barcode_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelBarcode", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelBarcode, gl_label_barcode, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_barcode_class_init (glLabelBarcodeClass *klass)
+gl_label_barcode_class_init (glLabelBarcodeClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_barcode_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy           = copy;
        label_object_class->get_size       = get_size;
@@ -123,27 +97,25 @@ gl_label_barcode_class_init (glLabelBarcodeClass *klass)
 }
 
 static void
-gl_label_barcode_instance_init (glLabelBarcode *lbc)
+gl_label_barcode_init (glLabelBarcode *lbc)
 {
-       lbc->private = g_new0 (glLabelBarcodePrivate, 1);
-       lbc->private->color_node = gl_color_node_new_default ();
+       lbc->priv = g_new0 (glLabelBarcodePrivate, 1);
+       lbc->priv->color_node = gl_color_node_new_default ();
 }
 
 static void
 gl_label_barcode_finalize (GObject *object)
 {
-       glLabelBarcode *lbc;
+       glLabelBarcode *lbc = GL_LABEL_BARCODE (object);
 
        g_return_if_fail (object && GL_IS_LABEL_BARCODE (object));
 
-       lbc = GL_LABEL_BARCODE (object);
-
-       gl_text_node_free (&lbc->private->text_node);
-       g_free (lbc->private->id);
-       gl_color_node_free (&(lbc->private->color_node));
-       g_free (lbc->private);
+       gl_text_node_free (&lbc->priv->text_node);
+       g_free (lbc->priv->id);
+       gl_color_node_free (&(lbc->priv->color_node));
+       g_free (lbc->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_barcode_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
@@ -209,10 +181,10 @@ gl_label_barcode_set_data (glLabelBarcode *lbc,
 
        g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
 
-       if (!gl_text_node_equal (lbc->private->text_node, text_node)) {
+       if (!gl_text_node_equal (lbc->priv->text_node, text_node)) {
 
-               gl_text_node_free (&lbc->private->text_node);
-               lbc->private->text_node = gl_text_node_dup (text_node);
+               gl_text_node_free (&lbc->priv->text_node);
+               lbc->priv->text_node = gl_text_node_dup (text_node);
 
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
 
@@ -232,16 +204,16 @@ gl_label_barcode_set_props (glLabelBarcode *lbc,
 
        g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
 
-       if ( ((lbc->private->id == NULL) && (id != NULL))
-            || (g_strcasecmp (lbc->private->id, id) != 0)
-            || (lbc->private->text_flag != text_flag)
-            || (lbc->private->checksum_flag != checksum_flag)
-            || (lbc->private->format_digits != format_digits)) {
+       if ( ((lbc->priv->id == NULL) && (id != NULL))
+            || (g_strcasecmp (lbc->priv->id, id) != 0)
+            || (lbc->priv->text_flag != text_flag)
+            || (lbc->priv->checksum_flag != checksum_flag)
+            || (lbc->priv->format_digits != format_digits)) {
 
-               lbc->private->id               = g_strdup (id);
-               lbc->private->text_flag        = text_flag;
-               lbc->private->checksum_flag    = checksum_flag;
-               lbc->private->format_digits    = format_digits;
+               lbc->priv->id               = g_strdup (id);
+               lbc->priv->text_flag        = text_flag;
+               lbc->priv->checksum_flag    = checksum_flag;
+               lbc->priv->format_digits    = format_digits;
 
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
 
@@ -259,7 +231,7 @@ gl_label_barcode_get_data (glLabelBarcode *lbc)
 {
        g_return_val_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc), NULL);
 
-       return gl_text_node_dup (lbc->private->text_node);
+       return gl_text_node_dup (lbc->priv->text_node);
 }
 
 void
@@ -271,10 +243,10 @@ gl_label_barcode_get_props (glLabelBarcode *lbc,
 {
        g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
 
-       *id               = g_strdup (lbc->private->id);
-       *text_flag        = lbc->private->text_flag;
-       *checksum_flag    = lbc->private->checksum_flag;
-       *format_digits    = lbc->private->format_digits;
+       *id               = g_strdup (lbc->priv->id);
+       *text_flag        = lbc->priv->text_flag;
+       *checksum_flag    = lbc->priv->checksum_flag;
+       *format_digits    = lbc->priv->format_digits;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -294,30 +266,30 @@ get_size (glLabelObject *object,
 
        g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
 
-       (* parent_class->get_size) (object, &w_parent, &h_parent);
+       (* GL_LABEL_OBJECT_CLASS (gl_label_barcode_parent_class)->get_size) (object, &w_parent, &h_parent);
 
 
-       if (lbc->private->text_node->field_flag) {
-               data = gl_barcode_default_digits (lbc->private->id,
-                                                 lbc->private->format_digits);
+       if (lbc->priv->text_node->field_flag) {
+               data = gl_barcode_default_digits (lbc->priv->id,
+                                                 lbc->priv->format_digits);
        } else {
-               data = gl_text_node_expand (lbc->private->text_node, NULL);
+               data = gl_text_node_expand (lbc->priv->text_node, NULL);
        }
 
-       gbc = gl_barcode_new (lbc->private->id,
-                             lbc->private->text_flag,
-                             lbc->private->checksum_flag,
+       gbc = gl_barcode_new (lbc->priv->id,
+                             lbc->priv->text_flag,
+                             lbc->priv->checksum_flag,
                              w_parent,
                              h_parent,
                              data);
 
        if ( gbc == NULL ) {
                /* Try again with default digits. */
-               data = gl_barcode_default_digits (lbc->private->id,
-                                                 lbc->private->format_digits);
-               gbc = gl_barcode_new (lbc->private->id,
-                                     lbc->private->text_flag,
-                                     lbc->private->checksum_flag,
+               data = gl_barcode_default_digits (lbc->priv->id,
+                                                 lbc->priv->format_digits);
+               gbc = gl_barcode_new (lbc->priv->id,
+                                     lbc->priv->text_flag,
+                                     lbc->priv->checksum_flag,
                                      w_parent,
                                      h_parent,
                                      data);
@@ -343,10 +315,10 @@ set_line_color (glLabelObject *object,
 
        g_return_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode));
 
-       if ( !gl_color_node_equal(lbarcode->private->color_node, line_color_node) ) {
+       if ( !gl_color_node_equal(lbarcode->priv->color_node, line_color_node) ) {
                
-               gl_color_node_free (&(lbarcode->private->color_node));
-               lbarcode->private->color_node = gl_color_node_dup (line_color_node);
+               gl_color_node_free (&(lbarcode->priv->color_node));
+               lbarcode->priv->color_node = gl_color_node_dup (line_color_node);
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbarcode));
        }
 }
@@ -361,5 +333,5 @@ get_line_color (glLabelObject *object)
 
        g_return_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode));
 
-       return gl_color_node_dup (lbarcode->private->color_node);
+       return gl_color_node_dup (lbarcode->priv->color_node);
 }
index 507cdcd41fde7317afc44a2d04d0ecf393c6639e..4eda31dad7bb302b2c822cb44799152d7907b521 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -44,7 +46,7 @@ typedef struct _glLabelBarcodePrivate   glLabelBarcodePrivate;
 struct _glLabelBarcode {
        glLabelObject            object;
 
-       glLabelBarcodePrivate   *private;
+       glLabelBarcodePrivate   *priv;
 };
 
 struct _glLabelBarcodeClass {
index f909a7233339ee49d3205d24151e8db6ebb6af85..e824c9baf337e7054487ae3abbc572eeef9f3d00 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -42,16 +44,12 @@ struct _glLabelBoxPrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void    gl_label_box_class_init    (glLabelBoxClass *klass);
-static void    gl_label_box_instance_init (glLabelBox      *lbox);
 static void    gl_label_box_finalize      (GObject         *object);
 
 static void    copy                       (glLabelObject   *dst_object,
@@ -77,39 +75,15 @@ static gdouble get_line_width             (glLabelObject   *object);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_box_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelBoxClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_box_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelBox),
-                       0,
-                       (GInstanceInitFunc) gl_label_box_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelBox", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelBox, gl_label_box, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_box_class_init (glLabelBoxClass *klass)
+gl_label_box_class_init (glLabelBoxClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_box_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy           = copy;
        label_object_class->set_fill_color = set_fill_color;
@@ -123,27 +97,25 @@ gl_label_box_class_init (glLabelBoxClass *klass)
 }
 
 static void
-gl_label_box_instance_init (glLabelBox *lbox)
+gl_label_box_init (glLabelBox *lbox)
 {
-       lbox->private = g_new0 (glLabelBoxPrivate, 1);
-       lbox->private->line_color_node = gl_color_node_new_default ();
-       lbox->private->fill_color_node = gl_color_node_new_default ();
+       lbox->priv = g_new0 (glLabelBoxPrivate, 1);
+       lbox->priv->line_color_node = gl_color_node_new_default ();
+       lbox->priv->fill_color_node = gl_color_node_new_default ();
 }
 
 static void
 gl_label_box_finalize (GObject *object)
 {
-       glLabelBox *lbox;
+       glLabelBox *lbox = GL_LABEL_BOX (object);
 
        g_return_if_fail (object && GL_IS_LABEL_BOX (object));
 
-       lbox = GL_LABEL_BOX (object);
-
-       gl_color_node_free (&(lbox->private->fill_color_node));
-       gl_color_node_free (&(lbox->private->line_color_node));
-       g_free (lbox->private);
+       gl_color_node_free (&(lbox->priv->fill_color_node));
+       gl_color_node_free (&(lbox->priv->line_color_node));
+       g_free (lbox->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_box_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
@@ -207,10 +179,10 @@ set_fill_color (glLabelObject *object,
 
        g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
 
-       if (!gl_color_node_equal (lbox->private->fill_color_node, fill_color_node)) {
+       if (!gl_color_node_equal (lbox->priv->fill_color_node, fill_color_node)) {
 
-               gl_color_node_free (&(lbox->private->fill_color_node));
-               lbox->private->fill_color_node = gl_color_node_dup (fill_color_node);
+               gl_color_node_free (&(lbox->priv->fill_color_node));
+               lbox->priv->fill_color_node = gl_color_node_dup (fill_color_node);
 
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
        }
@@ -228,9 +200,9 @@ set_line_color (glLabelObject *object,
 
        g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
 
-       if ( !gl_color_node_equal (lbox->private->line_color_node, line_color_node )) {
-               gl_color_node_free (&(lbox->private->line_color_node));
-               lbox->private->line_color_node = gl_color_node_dup (line_color_node);
+       if ( !gl_color_node_equal (lbox->priv->line_color_node, line_color_node )) {
+               gl_color_node_free (&(lbox->priv->line_color_node));
+               lbox->priv->line_color_node = gl_color_node_dup (line_color_node);
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
        }
 }
@@ -246,8 +218,8 @@ set_line_width (glLabelObject *object,
 
        g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
 
-       if ( lbox->private->line_width != line_width ) {
-               lbox->private->line_width = line_width;
+       if ( lbox->priv->line_width != line_width ) {
+               lbox->priv->line_width = line_width;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
        }
 }
@@ -263,7 +235,7 @@ get_line_width (glLabelObject *object)
 
        g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0);
 
-       return lbox->private->line_width;
+       return lbox->priv->line_width;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -276,7 +248,7 @@ get_line_color (glLabelObject *object)
 
        g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
 
-       return gl_color_node_dup (lbox->private->line_color_node);
+       return gl_color_node_dup (lbox->priv->line_color_node);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -289,5 +261,5 @@ get_fill_color (glLabelObject *object)
 
        g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
 
-       return gl_color_node_dup (lbox->private->fill_color_node);
+       return gl_color_node_dup (lbox->priv->fill_color_node);
 }
index 479e2b640f0c677519b09d7a1313a39873d9388b..93b05a64e25e27d666997bfacdb3e10eca3336db 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,7 +45,7 @@ typedef struct _glLabelBoxPrivate   glLabelBoxPrivate;
 struct _glLabelBox {
        glLabelObject         object;
 
-       glLabelBoxPrivate    *private;
+       glLabelBoxPrivate    *priv;
 };
 
 struct _glLabelBoxClass {
index 0fc35828c5a9f175be715e6a3d1045f1e7aad057..390c6da2d2d4298b76064c4d654d935222302572 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -42,16 +44,12 @@ struct _glLabelEllipsePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void    gl_label_ellipse_class_init    (glLabelEllipseClass *klass);
-static void    gl_label_ellipse_instance_init (glLabelEllipse      *lellipse);
 static void    gl_label_ellipse_finalize      (GObject             *object);
 
 static void    copy                           (glLabelObject       *dst_object,
@@ -77,39 +75,15 @@ static gdouble get_line_width                 (glLabelObject       *object);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_ellipse_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelEllipseClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_ellipse_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelEllipse),
-                       0,
-                       (GInstanceInitFunc) gl_label_ellipse_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelEllipse", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelEllipse, gl_label_ellipse, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_ellipse_class_init (glLabelEllipseClass *klass)
+gl_label_ellipse_class_init (glLabelEllipseClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_ellipse_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy           = copy;
        label_object_class->set_fill_color = set_fill_color;
@@ -123,27 +97,25 @@ gl_label_ellipse_class_init (glLabelEllipseClass *klass)
 }
 
 static void
-gl_label_ellipse_instance_init (glLabelEllipse *lellipse)
+gl_label_ellipse_init (glLabelEllipse *lellipse)
 {
-       lellipse->private = g_new0 (glLabelEllipsePrivate, 1);
-       lellipse->private->fill_color_node = gl_color_node_new_default ();
-       lellipse->private->fill_color_node = gl_color_node_new_default ();
+       lellipse->priv = g_new0 (glLabelEllipsePrivate, 1);
+       lellipse->priv->fill_color_node = gl_color_node_new_default ();
+       lellipse->priv->fill_color_node = gl_color_node_new_default ();
 }
 
 static void
 gl_label_ellipse_finalize (GObject *object)
 {
-       glLabelEllipse *lellipse;
+       glLabelEllipse *lellipse = GL_LABEL_ELLIPSE (object);
 
        g_return_if_fail (object && GL_IS_LABEL_ELLIPSE (object));
 
-       lellipse = GL_LABEL_ELLIPSE (object);
-
-       gl_color_node_free (&(lellipse->private->line_color_node));
-       gl_color_node_free (&(lellipse->private->fill_color_node));
-       g_free (lellipse->private);
+       gl_color_node_free (&(lellipse->priv->line_color_node));
+       gl_color_node_free (&(lellipse->priv->fill_color_node));
+       g_free (lellipse->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_ellipse_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
@@ -205,10 +177,10 @@ set_fill_color (glLabelObject *object,
 
        g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
 
-       if (!gl_color_node_equal (lellipse->private->fill_color_node, fill_color_node)) {
+       if (!gl_color_node_equal (lellipse->priv->fill_color_node, fill_color_node)) {
 
-               gl_color_node_free (&(lellipse->private->fill_color_node));
-               lellipse->private->fill_color_node = gl_color_node_dup (fill_color_node);
+               gl_color_node_free (&(lellipse->priv->fill_color_node));
+               lellipse->priv->fill_color_node = gl_color_node_dup (fill_color_node);
 
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
        }       
@@ -225,10 +197,10 @@ set_line_color (glLabelObject *object,
 
        g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
 
-       if ( !gl_color_node_equal (lellipse->private->line_color_node, line_color_node) ) {
+       if ( !gl_color_node_equal (lellipse->priv->line_color_node, line_color_node) ) {
                
-               gl_color_node_free (&(lellipse->private->line_color_node));
-               lellipse->private->line_color_node = gl_color_node_dup (line_color_node);
+               gl_color_node_free (&(lellipse->priv->line_color_node));
+               lellipse->priv->line_color_node = gl_color_node_dup (line_color_node);
                
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
        }
@@ -245,8 +217,8 @@ set_line_width (glLabelObject *object,
 
        g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
 
-       if ( lellipse->private->line_width != line_width ) {
-               lellipse->private->line_width = line_width;
+       if ( lellipse->priv->line_width != line_width ) {
+               lellipse->priv->line_width = line_width;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
        }
 }
@@ -262,7 +234,7 @@ get_line_width (glLabelObject *object)
 
        g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0);
 
-       return lellipse->private->line_width;
+       return lellipse->priv->line_width;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -275,7 +247,7 @@ get_line_color (glLabelObject *object)
 
        g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
 
-       return gl_color_node_dup (lellipse->private->line_color_node);
+       return gl_color_node_dup (lellipse->priv->line_color_node);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -288,5 +260,5 @@ get_fill_color (glLabelObject *object)
 
        g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
 
-       return gl_color_node_dup (lellipse->private->fill_color_node);
+       return gl_color_node_dup (lellipse->priv->fill_color_node);
 }
index 57527deaabb09a2a785672e63e15294d35a8b189..439ad5f9c3e492e664e0c5c31fcd98dbb12637ca 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,7 +45,7 @@ typedef struct _glLabelEllipsePrivate   glLabelEllipsePrivate;
 struct _glLabelEllipse {
        glLabelObject          object;
 
-       glLabelEllipsePrivate *private;
+       glLabelEllipsePrivate *priv;
 };
 
 struct _glLabelEllipseClass {
index c7c368d2ab18e2d87bd1925b239dce0e6b1143d3..25028d1f9832a7ccdd3128c40f0d2f0493f3df5e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,8 +45,6 @@ struct _glLabelImagePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 static GdkPixbuf *default_pixbuf = NULL;
@@ -53,8 +53,6 @@ static GdkPixbuf *default_pixbuf = NULL;
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_label_image_class_init    (glLabelImageClass *klass);
-static void gl_label_image_instance_init (glLabelImage      *limage);
 static void gl_label_image_finalize      (GObject           *object);
 
 static void copy                         (glLabelObject     *dst_object,
@@ -64,39 +62,15 @@ static void copy                         (glLabelObject     *dst_object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_image_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelImageClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_image_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelImage),
-                       0,
-                       (GInstanceInitFunc) gl_label_image_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelImage", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelImage, gl_label_image, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_image_class_init (glLabelImageClass *klass)
+gl_label_image_class_init (glLabelImageClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_image_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy = copy;
 
@@ -104,45 +78,42 @@ gl_label_image_class_init (glLabelImageClass *klass)
 }
 
 static void
-gl_label_image_instance_init (glLabelImage *limage)
+gl_label_image_init (glLabelImage *limage)
 {
        if ( default_pixbuf == NULL ) {
                default_pixbuf =
                        gdk_pixbuf_new_from_xpm_data ((const char **)checkerboard_xpm);
        }
 
-       limage->private = g_new0 (glLabelImagePrivate, 1);
+       limage->priv = g_new0 (glLabelImagePrivate, 1);
 
-       limage->private->filename = g_new0 (glTextNode, 1);
+       limage->priv->filename = g_new0 (glTextNode, 1);
 
-       limage->private->pixbuf = default_pixbuf;
+       limage->priv->pixbuf = default_pixbuf;
 }
 
 static void
 gl_label_image_finalize (GObject *object)
 {
-       glLabelObject *lobject;
-       glLabelImage  *limage;
+       glLabelObject *lobject = GL_LABEL_OBJECT (object);
+       glLabelImage  *limage  = GL_LABEL_IMAGE (object);;
        GHashTable    *pixbuf_cache;
 
        g_return_if_fail (object && GL_IS_LABEL_IMAGE (object));
 
-       lobject = GL_LABEL_OBJECT (object);
-       limage  = GL_LABEL_IMAGE (object);
-
-       if (!limage->private->filename->field_flag) {
+       if (!limage->priv->filename->field_flag) {
                pixbuf_cache = gl_label_get_pixbuf_cache (lobject->parent);
                gl_pixbuf_cache_remove_pixbuf (pixbuf_cache,
-                                              limage->private->filename->data);
+                                              limage->priv->filename->data);
        }
-       gl_text_node_free (&limage->private->filename);
-       g_free (limage->private);
+       gl_text_node_free (&limage->priv->filename);
+       g_free (limage->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_image_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
-/* NEW label "image" object.                                               */
+/* NEW label "image" object.                                                 */
 /*****************************************************************************/
 GObject *
 gl_label_image_new (glLabel *label)
@@ -178,7 +149,7 @@ copy (glLabelObject *dst_object,
 
        /* Make sure destination label has data suitably cached. */
        if ( !filename->field_flag && (filename->data != NULL) ) {
-               pixbuf = limage->private->pixbuf;
+               pixbuf = limage->priv->pixbuf;
                if ( pixbuf != default_pixbuf ) {
                        pixbuf_cache = gl_label_get_pixbuf_cache (dst_object->parent);
                        gl_pixbuf_cache_add_pixbuf (pixbuf_cache, filename->data, pixbuf);
@@ -209,7 +180,7 @@ gl_label_image_set_filename (glLabelImage *limage,
        g_return_if_fail (limage && GL_IS_LABEL_IMAGE (limage));
        g_return_if_fail (filename != NULL);
 
-       old_filename = limage->private->filename;
+       old_filename = limage->priv->filename;
 
        /* If Unchanged don't do anything */
        if ( gl_text_node_equal (filename, old_filename ) ) {
@@ -224,29 +195,29 @@ gl_label_image_set_filename (glLabelImage *limage,
        }
 
        /* Set new filename. */
-       limage->private->filename = gl_text_node_dup(filename);
+       limage->priv->filename = gl_text_node_dup(filename);
        gl_text_node_free (&old_filename);
 
        /* Now set the pixbuf. */
        if ( filename->field_flag || (filename->data == NULL) ) {
 
-               limage->private->pixbuf = default_pixbuf;
+               limage->priv->pixbuf = default_pixbuf;
 
        } else {
 
                pixbuf = gl_pixbuf_cache_get_pixbuf (pixbuf_cache, filename->data);
 
                if (pixbuf != NULL) {
-                       limage->private->pixbuf = pixbuf;
+                       limage->priv->pixbuf = pixbuf;
                } else {
-                       limage->private->pixbuf = default_pixbuf;
+                       limage->priv->pixbuf = default_pixbuf;
                }
        }
 
        /* Treat current size as a bounding box, scale image to maintain aspect
         * ratio while fitting it in this bounding box. */
-       image_w = gdk_pixbuf_get_width (limage->private->pixbuf);
-       image_h = gdk_pixbuf_get_height (limage->private->pixbuf);
+       image_w = gdk_pixbuf_get_width (limage->priv->pixbuf);
+       image_h = gdk_pixbuf_get_height (limage->priv->pixbuf);
        aspect_ratio = image_h / image_w;
        gl_label_object_get_size (GL_LABEL_OBJECT(limage), &w, &h);
        if ( h > w*aspect_ratio ) {
@@ -270,7 +241,7 @@ gl_label_image_get_filename (glLabelImage *limage)
 {
        g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL);
 
-       return gl_text_node_dup (limage->private->filename);
+       return gl_text_node_dup (limage->priv->filename);
 }
 
 const GdkPixbuf *
@@ -279,7 +250,7 @@ gl_label_image_get_pixbuf (glLabelImage  *limage,
 {
        g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL);
 
-       if ((record != NULL) && limage->private->filename->field_flag) {
+       if ((record != NULL) && limage->priv->filename->field_flag) {
 
                GdkPixbuf   *pixbuf = NULL;
                gchar       *real_filename;
@@ -287,7 +258,7 @@ gl_label_image_get_pixbuf (glLabelImage  *limage,
                /* Indirect filename, re-evaluate for given record. */
 
                real_filename = gl_merge_eval_key (record,
-                                                  limage->private->filename->data);
+                                                  limage->priv->filename->data);
 
                if (real_filename != NULL) {
                        pixbuf = gdk_pixbuf_new_from_file (real_filename, NULL);
@@ -300,7 +271,7 @@ gl_label_image_get_pixbuf (glLabelImage  *limage,
 
        }
 
-       return limage->private->pixbuf;
+       return limage->priv->pixbuf;
 
 }
 
index 7c611a69c17532026382860231e9414490fc6ce1..a45f0c79ac70876e45123369dae6708da11fa8c8 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -45,7 +47,7 @@ typedef struct _glLabelImagePrivate   glLabelImagePrivate;
 struct _glLabelImage {
        glLabelObject         object;
 
-       glLabelImagePrivate  *private;
+       glLabelImagePrivate  *priv;
 };
 
 struct _glLabelImageClass {
index 25c120d69b4e048bf6552d2df507048bb5224833..a82722802b970ecad548cbe11e88ba346b79492a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -41,16 +43,12 @@ struct _glLabelLinePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void    gl_label_line_class_init    (glLabelLineClass *klass);
-static void    gl_label_line_instance_init (glLabelLine      *lline);
 static void    gl_label_line_finalize      (GObject          *object);
 
 static void    copy                        (glLabelObject    *dst_object,
@@ -71,39 +69,15 @@ static gdouble get_line_width              (glLabelObject    *object);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_line_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelLineClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_line_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelLine),
-                       0,
-                       (GInstanceInitFunc) gl_label_line_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelLine", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelLine, gl_label_line, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_line_class_init (glLabelLineClass *klass)
+gl_label_line_class_init (glLabelLineClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_line_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy           = copy;
        label_object_class->set_line_color = set_line_color;
@@ -115,25 +89,23 @@ gl_label_line_class_init (glLabelLineClass *klass)
 }
 
 static void
-gl_label_line_instance_init (glLabelLine *lline)
+gl_label_line_init (glLabelLine *lline)
 {
-       lline->private = g_new0 (glLabelLinePrivate, 1);
-       lline->private->line_color_node = gl_color_node_new_default ();
+       lline->priv = g_new0 (glLabelLinePrivate, 1);
+       lline->priv->line_color_node = gl_color_node_new_default ();
 }
 
 static void
 gl_label_line_finalize (GObject *object)
 {
-       glLabelLine *lline;
+       glLabelLine *lline = GL_LABEL_LINE (object);
 
        g_return_if_fail (object && GL_IS_LABEL_LINE (object));
 
-       lline = GL_LABEL_LINE (object);
-
-       gl_color_node_free (&(lline->private->line_color_node));
-       g_free (lline->private);
+       gl_color_node_free (&(lline->priv->line_color_node));
+       g_free (lline->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_line_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
@@ -191,10 +163,10 @@ set_line_color (glLabelObject *object,
 
        g_return_if_fail (lline && GL_IS_LABEL_LINE (lline));
 
-       if ( !gl_color_node_equal (lline->private->line_color_node, line_color_node)) {
+       if ( !gl_color_node_equal (lline->priv->line_color_node, line_color_node)) {
                
-               gl_color_node_free (&(lline->private->line_color_node ));
-               lline->private->line_color_node = gl_color_node_dup (line_color_node);
+               gl_color_node_free (&(lline->priv->line_color_node ));
+               lline->priv->line_color_node = gl_color_node_dup (line_color_node);
                
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lline));
        }
@@ -211,8 +183,8 @@ set_line_width (glLabelObject *object,
 
        g_return_if_fail (lline && GL_IS_LABEL_LINE (lline));
 
-       if ( lline->private->line_width != line_width ) {
-               lline->private->line_width = line_width;
+       if ( lline->priv->line_width != line_width ) {
+               lline->priv->line_width = line_width;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(lline));
        }
 }
@@ -228,7 +200,7 @@ get_line_width (glLabelObject *object)
 
        g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0);
 
-       return lline->private->line_width;
+       return lline->priv->line_width;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -241,5 +213,5 @@ get_line_color (glLabelObject *object)
 
        g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0);
 
-       return gl_color_node_dup (lline->private->line_color_node);
+       return gl_color_node_dup (lline->priv->line_color_node);
 }
index 4c2c2d15ff237ef260fbaecb8029f293697c8ade..3b73e42ed56ad215906fc3518fe760f0c94bad5b 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,7 +45,7 @@ typedef struct _glLabelLinePrivate   glLabelLinePrivate;
 struct _glLabelLine {
        glLabelObject         object;
 
-       glLabelLinePrivate   *private;
+       glLabelLinePrivate   *priv;
 };
 
 struct _glLabelLineClass {
index 7d31868bac1bb653b9154fed801dfdb75c88b649..f98c02721b40cdf8fcfd72b5d444bd25969c4d39 100644 (file)
@@ -75,8 +75,6 @@ enum {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint signals[LAST_SIGNAL] = {0};
 
 static guint instance = 0;
@@ -85,8 +83,6 @@ static guint instance = 0;
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_label_object_class_init    (glLabelObjectClass *klass);
-static void gl_label_object_instance_init (glLabelObject      *object);
 static void gl_label_object_finalize      (GObject            *object);
 
 static void merge_changed_cb              (glLabel            *label,
@@ -104,50 +100,25 @@ static void get_size                      (glLabelObject      *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_object_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelObjectClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_object_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelObject),
-                       0,
-                       (GInstanceInitFunc) gl_label_object_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glLabelObject", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelObject, gl_label_object, G_TYPE_OBJECT);
 
 static void
-gl_label_object_class_init (glLabelObjectClass *klass)
+gl_label_object_class_init (glLabelObjectClass *class)
 {
-       GObjectClass       *gobject_class = (GObjectClass *) klass;
-       glLabelObjectClass *object_class  = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_LABEL, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_object_parent_class = g_type_class_peek_parent (class);
 
-       gobject_class->finalize = gl_label_object_finalize;
+       object_class->finalize = gl_label_object_finalize;
 
-       object_class->set_size = set_size;
-       object_class->get_size = get_size;
+       class->set_size = set_size;
+       class->get_size = get_size;
 
        signals[CHANGED] =
                g_signal_new ("changed",
-                             G_OBJECT_CLASS_TYPE (gobject_class),
+                             G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
                              G_STRUCT_OFFSET (glLabelObjectClass, changed),
                              NULL, NULL,
@@ -157,7 +128,7 @@ gl_label_object_class_init (glLabelObjectClass *klass)
 
        signals[MOVED] =
                g_signal_new ("moved",
-                             G_OBJECT_CLASS_TYPE (gobject_class),
+                             G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
                              G_STRUCT_OFFSET (glLabelObjectClass, moved),
                              NULL, NULL,
@@ -166,7 +137,7 @@ gl_label_object_class_init (glLabelObjectClass *klass)
                              2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
        signals[FLIP_ROTATE] =
                g_signal_new ("flip_rotate",
-                             G_OBJECT_CLASS_TYPE (gobject_class),
+                             G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
                              G_STRUCT_OFFSET (glLabelObjectClass, flip_rotate),
                              NULL, NULL,
@@ -175,7 +146,7 @@ gl_label_object_class_init (glLabelObjectClass *klass)
                              0);
        signals[TOP] =
                g_signal_new ("top",
-                             G_OBJECT_CLASS_TYPE (gobject_class),
+                             G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
                              G_STRUCT_OFFSET (glLabelObjectClass, top),
                              NULL, NULL,
@@ -185,7 +156,7 @@ gl_label_object_class_init (glLabelObjectClass *klass)
 
        signals[BOTTOM] =
                g_signal_new ("bottom",
-                             G_OBJECT_CLASS_TYPE (gobject_class),
+                             G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
                              G_STRUCT_OFFSET (glLabelObjectClass, bottom),
                              NULL, NULL,
@@ -197,21 +168,21 @@ gl_label_object_class_init (glLabelObjectClass *klass)
 }
 
 static void
-gl_label_object_instance_init (glLabelObject *object)
+gl_label_object_init (glLabelObject *object)
 {
        gl_debug (DEBUG_LABEL, "START");
 
-       object->private = g_new0 (glLabelObjectPrivate, 1);
+       object->priv = g_new0 (glLabelObjectPrivate, 1);
 
-       object->private->name = g_strdup_printf ("object%d", instance++);
+       object->priv->name = g_strdup_printf ("object%d", instance++);
 
-       art_affine_identity (object->private->affine);
+       art_affine_identity (object->priv->affine);
 
-       object->private->shadow_state = FALSE;
-       object->private->shadow_x = DEFAULT_SHADOW_X_OFFSET;
-       object->private->shadow_y = DEFAULT_SHADOW_Y_OFFSET;
-       object->private->shadow_color_node = gl_color_node_new_default ();
-       object->private->shadow_opacity = DEFAULT_SHADOW_OPACITY;
+       object->priv->shadow_state = FALSE;
+       object->priv->shadow_x = DEFAULT_SHADOW_X_OFFSET;
+       object->priv->shadow_y = DEFAULT_SHADOW_Y_OFFSET;
+       object->priv->shadow_color_node = gl_color_node_new_default ();
+       object->priv->shadow_opacity = DEFAULT_SHADOW_OPACITY;
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -219,19 +190,20 @@ gl_label_object_instance_init (glLabelObject *object)
 static void
 gl_label_object_finalize (GObject *object)
 {
+        glLabelObject *label_object = GL_LABEL_OBJECT (object);
        glLabel       *parent;
 
        gl_debug (DEBUG_LABEL, "START");
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       parent = GL_LABEL_OBJECT(object)->parent;
-       gl_label_remove_object (parent, GL_LABEL_OBJECT(object));
+       parent = label_object->parent;
+       gl_label_remove_object (parent, label_object);
 
-       g_free (GL_LABEL_OBJECT(object)->private->name);
-       g_free (GL_LABEL_OBJECT(object)->private);
+       g_free (label_object->priv->name);
+       g_free (label_object->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_object_parent_class)->finalize (object);
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -380,8 +352,8 @@ gl_label_object_set_name (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       g_free(object->private->name);
-       object->private->name = name;
+       g_free(object->priv->name);
+       object->priv->name = name;
 
        g_signal_emit (G_OBJECT(object), signals[CHANGED], 0);
 
@@ -400,7 +372,7 @@ gl_label_object_get_name (glLabelObject *object)
 
        gl_debug (DEBUG_LABEL, "END");
 
-       return g_strdup(object->private->name);
+       return g_strdup(object->priv->name);
 }
 
 /*****************************************************************************/
@@ -417,13 +389,13 @@ gl_label_object_set_position (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if ( (x != object->private->x) || (y != object->private->y) ) {
+       if ( (x != object->priv->x) || (y != object->priv->y) ) {
 
-               dx = x - object->private->x;
-               dy = y - object->private->y;
+               dx = x - object->priv->x;
+               dy = y - object->priv->y;
 
-               object->private->x = x;
-               object->private->y = y;
+               object->priv->x = x;
+               object->priv->y = y;
 
                g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
 
@@ -446,12 +418,12 @@ gl_label_object_set_position_relative (glLabelObject *object,
 
        if ( (dx != 0.0) || (dy != 0.0) ) {
 
-               object->private->x += dx;
-               object->private->y += dy;
+               object->priv->x += dx;
+               object->priv->y += dy;
 
                gl_debug (DEBUG_LABEL, "       x = %f, y= %f",
-                         object->private->x,
-                         object->private->y);
+                         object->priv->x,
+                         object->priv->y);
 
                g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
 
@@ -472,8 +444,8 @@ gl_label_object_get_position (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       *x = object->private->x;
-       *y = object->private->y;
+       *x = object->priv->x;
+       *y = object->priv->y;
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -488,10 +460,10 @@ set_size (glLabelObject *object,
 {
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if ( (object->private->w != w) || (object->private->h != h) ) {
+       if ( (object->priv->w != w) || (object->priv->h != h) ) {
 
-               object->private->w = w;
-               object->private->h = h;
+               object->priv->w = w;
+               object->priv->h = h;
 
                g_signal_emit (G_OBJECT(object), signals[CHANGED], 0);
        }
@@ -514,7 +486,7 @@ gl_label_object_set_size (glLabelObject *object,
                /* We have an object specific method, use it */
                GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h);
 
-               object->private->aspect_ratio = h / w;
+               object->priv->aspect_ratio = h / w;
 
        }
 
@@ -534,13 +506,13 @@ gl_label_object_set_size_honor_aspect (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if ( h > w*object->private->aspect_ratio ) {
+       if ( h > w*object->priv->aspect_ratio ) {
 
-               h = w * object->private->aspect_ratio;
+               h = w * object->priv->aspect_ratio;
 
        } else {
 
-               w = h / object->private->aspect_ratio;
+               w = h / object->priv->aspect_ratio;
 
        }
 
@@ -564,8 +536,8 @@ get_size (glLabelObject *object,
 {
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       *w = object->private->w;
-       *h = object->private->h;
+       *w = object->priv->w;
+       *h = object->priv->h;
 }
 
 /*****************************************************************************/
@@ -632,10 +604,10 @@ gl_label_object_get_extent (glLabelObject *object,
        art_affine_point (&b4, &a4, affine);
 
        /* now find the maximum extent of these points in x and y */
-       *x1 = MIN (b1.x, MIN (b2.x, MIN (b3.x, b4.x))) + object->private->x;
-       *y1 = MIN (b1.y, MIN (b2.y, MIN (b3.y, b4.y))) + object->private->y;
-       *x2 = MAX (b1.x, MAX (b2.x, MAX (b3.x, b4.x))) + object->private->x;
-       *y2 = MAX (b1.y, MAX (b2.y, MAX (b3.y, b4.y))) + object->private->y;
+       *x1 = MIN (b1.x, MIN (b2.x, MIN (b3.x, b4.x))) + object->priv->x;
+       *y1 = MIN (b1.y, MIN (b2.y, MIN (b3.y, b4.y))) + object->priv->y;
+       *x2 = MAX (b1.x, MAX (b2.x, MAX (b3.x, b4.x))) + object->priv->x;
+       *y2 = MAX (b1.y, MAX (b2.y, MAX (b3.y, b4.y))) + object->priv->y;
        
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -1191,9 +1163,9 @@ gl_label_object_set_shadow_state (glLabelObject     *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if (object->private->shadow_state != state)
+       if (object->priv->shadow_state != state)
        {
-               object->private->shadow_state = state;
+               object->priv->shadow_state = state;
                gl_label_object_emit_changed (object);
        }
 
@@ -1210,7 +1182,7 @@ gl_label_object_get_shadow_state (glLabelObject     *object)
 
        g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
 
-       return object->private->shadow_state;
+       return object->priv->shadow_state;
 }
 
 /****************************************************************************/
@@ -1225,10 +1197,10 @@ gl_label_object_set_shadow_offset (glLabelObject     *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if ( (x != object->private->shadow_x) || (y != object->private->shadow_y) )
+       if ( (x != object->priv->shadow_x) || (y != object->priv->shadow_y) )
        {
-               object->private->shadow_x = x;
-               object->private->shadow_y = y;
+               object->priv->shadow_x = x;
+               object->priv->shadow_y = y;
 
                gl_label_object_emit_changed (object);
        }
@@ -1248,8 +1220,8 @@ gl_label_object_get_shadow_offset (glLabelObject     *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       *x = object->private->shadow_x;
-       *y = object->private->shadow_y;
+       *x = object->priv->shadow_x;
+       *y = object->priv->shadow_y;
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -1265,10 +1237,10 @@ gl_label_object_set_shadow_color (glLabelObject     *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if ( !gl_color_node_equal (object->private->shadow_color_node, color_node ))
+       if ( !gl_color_node_equal (object->priv->shadow_color_node, color_node ))
        {
-               gl_color_node_free (&(object->private->shadow_color_node));
-               object->private->shadow_color_node = gl_color_node_dup (color_node);
+               gl_color_node_free (&(object->priv->shadow_color_node));
+               object->priv->shadow_color_node = gl_color_node_dup (color_node);
                gl_label_object_emit_changed (GL_LABEL_OBJECT(object));
        }
 
@@ -1285,7 +1257,7 @@ gl_label_object_get_shadow_color (glLabelObject     *object)
 
        g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL);
 
-       return gl_color_node_dup (object->private->shadow_color_node);
+       return gl_color_node_dup (object->priv->shadow_color_node);
 }
 
 /****************************************************************************/
@@ -1299,9 +1271,9 @@ gl_label_object_set_shadow_opacity (glLabelObject     *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       if (object->private->shadow_opacity != alpha)
+       if (object->priv->shadow_opacity != alpha)
        {
-               object->private->shadow_opacity = alpha;
+               object->priv->shadow_opacity = alpha;
                gl_label_object_emit_changed (object);
        }
 
@@ -1318,7 +1290,7 @@ gl_label_object_get_shadow_opacity (glLabelObject     *object)
 
        g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
 
-       return object->private->shadow_opacity;
+       return object->priv->shadow_opacity;
 }
 
 /****************************************************************************/
@@ -1334,7 +1306,7 @@ gl_label_object_flip_horiz (glLabelObject *object)
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
        art_affine_scale (flip_affine, -1.0, 1.0);
-       art_affine_multiply (object->private->affine, object->private->affine, flip_affine);
+       art_affine_multiply (object->priv->affine, object->priv->affine, flip_affine);
 
        g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0);
 
@@ -1354,7 +1326,7 @@ gl_label_object_flip_vert (glLabelObject *object)
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
        art_affine_scale (flip_affine, 1.0, -1.0);
-       art_affine_multiply (object->private->affine, object->private->affine, flip_affine);
+       art_affine_multiply (object->priv->affine, object->priv->affine, flip_affine);
 
        g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0);
 
@@ -1375,7 +1347,7 @@ gl_label_object_rotate (glLabelObject *object,
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
        art_affine_rotate (rotate_affine, theta_degs);
-       art_affine_multiply (object->private->affine, object->private->affine, rotate_affine);
+       art_affine_multiply (object->priv->affine, object->priv->affine, rotate_affine);
 
        g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0);
 
@@ -1393,12 +1365,12 @@ gl_label_object_set_affine (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       object->private->affine[0] = affine[0];
-       object->private->affine[1] = affine[1];
-       object->private->affine[2] = affine[2];
-       object->private->affine[3] = affine[3];
-       object->private->affine[4] = affine[4];
-       object->private->affine[5] = affine[5];
+       object->priv->affine[0] = affine[0];
+       object->priv->affine[1] = affine[1];
+       object->priv->affine[2] = affine[2];
+       object->priv->affine[3] = affine[3];
+       object->priv->affine[4] = affine[4];
+       object->priv->affine[5] = affine[5];
 }
 
 /****************************************************************************/
@@ -1412,12 +1384,12 @@ gl_label_object_get_affine (glLabelObject *object,
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       affine[0] = object->private->affine[0];
-       affine[1] = object->private->affine[1];
-       affine[2] = object->private->affine[2];
-       affine[3] = object->private->affine[3];
-       affine[4] = object->private->affine[4];
-       affine[5] = object->private->affine[5];
+       affine[0] = object->priv->affine[0];
+       affine[1] = object->priv->affine[1];
+       affine[2] = object->priv->affine[2];
+       affine[3] = object->priv->affine[3];
+       affine[4] = object->priv->affine[4];
+       affine[5] = object->priv->affine[5];
 }
 
 /****************************************************************************/
index a7b6bb8973718deb0172181ecbe2585e3ed9ed6d..9179e02b7d25786890bf1c1ca827b78589dac95f 100644 (file)
@@ -62,7 +62,7 @@ struct _glLabelObject {
 
         glLabel              *parent;
 
-        glLabelObjectPrivate *private;
+        glLabelObjectPrivate *priv;
 };
 
 struct _glLabelObjectClass {
index bb61ff05134e1d785e7e92ca3704e1ff746ad411..5c4221c6b4a372cc462ad94ae7add8593256d583 100644 (file)
@@ -70,16 +70,12 @@ struct _glLabelTextPrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glLabelObjectClass *parent_class = NULL;
-
 static guint instance = 0;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_label_text_class_init    (glLabelTextClass *klass);
-static void gl_label_text_instance_init (glLabelText      *ltext);
 static void gl_label_text_finalize      (GObject          *object);
 
 static void copy                        (glLabelObject    *dst_object,
@@ -131,39 +127,15 @@ static glColorNode*    get_text_color              (glLabelObject    *object);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_text_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelTextClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_text_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabelText),
-                       0,
-                       (GInstanceInitFunc) gl_label_text_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_LABEL_OBJECT,
-                                              "glLabelText", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT);
 
 static void
-gl_label_text_class_init (glLabelTextClass *klass)
+gl_label_text_class_init (glLabelTextClass *class)
 {
-       GObjectClass       *object_class       = (GObjectClass *) klass;
-       glLabelObjectClass *label_object_class = (glLabelObjectClass *) klass;
+       GObjectClass       *object_class       = G_OBJECT_CLASS (class);
+       glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_text_parent_class = g_type_class_peek_parent (class);
 
        label_object_class->copy                 = copy;
 
@@ -188,43 +160,41 @@ gl_label_text_class_init (glLabelTextClass *klass)
 }
 
 static void
-gl_label_text_instance_init (glLabelText *ltext)
+gl_label_text_init (glLabelText *ltext)
 {
-       ltext->private = g_new0 (glLabelTextPrivate, 1);
-
-       ltext->private->tag_table         = gtk_text_tag_table_new ();
-       ltext->private->buffer            = gtk_text_buffer_new (ltext->private->tag_table);
-
-       ltext->private->font_family       = g_strdup(DEFAULT_FONT_FAMILY);
-       ltext->private->font_size         = DEFAULT_FONT_SIZE;
-       ltext->private->font_weight       = DEFAULT_FONT_WEIGHT;
-       ltext->private->font_italic_flag  = DEFAULT_FONT_ITALIC_FLAG;
-       ltext->private->align              = DEFAULT_ALIGN;
-       ltext->private->color_node        = gl_color_node_new_default ();
-       ltext->private->color_node->color = DEFAULT_COLOR;
-       ltext->private->line_spacing      = DEFAULT_TEXT_LINE_SPACING;
-       ltext->private->auto_shrink       = DEFAULT_AUTO_SHRINK;
-
-       g_signal_connect (G_OBJECT(ltext->private->buffer), "changed",
+       ltext->priv = g_new0 (glLabelTextPrivate, 1);
+
+       ltext->priv->tag_table         = gtk_text_tag_table_new ();
+       ltext->priv->buffer            = gtk_text_buffer_new (ltext->priv->tag_table);
+
+       ltext->priv->font_family       = g_strdup(DEFAULT_FONT_FAMILY);
+       ltext->priv->font_size         = DEFAULT_FONT_SIZE;
+       ltext->priv->font_weight       = DEFAULT_FONT_WEIGHT;
+       ltext->priv->font_italic_flag  = DEFAULT_FONT_ITALIC_FLAG;
+       ltext->priv->align              = DEFAULT_ALIGN;
+       ltext->priv->color_node        = gl_color_node_new_default ();
+       ltext->priv->color_node->color = DEFAULT_COLOR;
+       ltext->priv->line_spacing      = DEFAULT_TEXT_LINE_SPACING;
+       ltext->priv->auto_shrink       = DEFAULT_AUTO_SHRINK;
+
+       g_signal_connect (G_OBJECT(ltext->priv->buffer), "changed",
                          G_CALLBACK(buffer_changed_cb), ltext);
 }
 
 static void
 gl_label_text_finalize (GObject *object)
 {
-       glLabelText *ltext;
+       glLabelText *ltext = GL_LABEL_TEXT (object);
 
        g_return_if_fail (object && GL_IS_LABEL_TEXT (object));
 
-       ltext = GL_LABEL_TEXT (object);
-
-       g_object_unref (ltext->private->tag_table);
-       g_object_unref (ltext->private->buffer);
-       g_free (ltext->private->font_family);
-       gl_color_node_free (&(ltext->private->color_node));
-       g_free (ltext->private);
+       g_object_unref (ltext->priv->tag_table);
+       g_object_unref (ltext->priv->buffer);
+       g_free (ltext->priv->font_family);
+       gl_color_node_free (&(ltext->priv->color_node));
+       g_free (ltext->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_text_parent_class)->finalize (object);
 }
 
 /*****************************************************************************/
@@ -263,14 +233,14 @@ copy (glLabelObject *dst_object,
        text_color_node = get_text_color (src_object);
        gl_label_text_set_lines (new_ltext, lines);
 
-       new_ltext->private->font_family      = g_strdup (ltext->private->font_family);
-       new_ltext->private->font_size        = ltext->private->font_size;
-       new_ltext->private->font_weight      = ltext->private->font_weight;
-       new_ltext->private->font_italic_flag = ltext->private->font_italic_flag;
+       new_ltext->priv->font_family      = g_strdup (ltext->priv->font_family);
+       new_ltext->priv->font_size        = ltext->priv->font_size;
+       new_ltext->priv->font_weight      = ltext->priv->font_weight;
+       new_ltext->priv->font_italic_flag = ltext->priv->font_italic_flag;
        set_text_color (dst_object, text_color_node);
-       new_ltext->private->align             = ltext->private->align;
-       new_ltext->private->line_spacing     = ltext->private->line_spacing;
-       new_ltext->private->auto_shrink      = ltext->private->auto_shrink;
+       new_ltext->priv->align             = ltext->priv->align;
+       new_ltext->priv->line_spacing     = ltext->priv->line_spacing;
+       new_ltext->priv->auto_shrink      = ltext->priv->auto_shrink;
 
        gl_color_node_free (&text_color_node);
        gl_text_node_lines_free (&lines);
@@ -293,7 +263,7 @@ gl_label_text_set_lines (glLabelText *ltext,
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
        text = gl_text_node_lines_expand (lines, NULL);
-       gtk_text_buffer_set_text (ltext->private->buffer, text, -1);
+       gtk_text_buffer_set_text (ltext->priv->buffer, text, -1);
        g_free (text);
 
        gl_debug (DEBUG_LABEL, "END");
@@ -307,7 +277,7 @@ gl_label_text_get_buffer (glLabelText *ltext)
 {
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL);
 
-       return ltext->private->buffer;
+       return ltext->priv->buffer;
 }
 
 GList *
@@ -319,8 +289,8 @@ gl_label_text_get_lines (glLabelText *ltext)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL);
 
-       gtk_text_buffer_get_bounds (ltext->private->buffer, &start, &end);
-       text = gtk_text_buffer_get_text (ltext->private->buffer,
+       gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end);
+       text = gtk_text_buffer_get_text (ltext->priv->buffer,
                                         &start, &end, FALSE);
        lines = gl_text_node_lines_new_from_text (text);
        g_free (text);
@@ -336,7 +306,7 @@ gl_label_text_get_box (glLabelText *ltext,
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
        /* peek at the parent size. */
-       (* parent_class->get_size) (GL_LABEL_OBJECT(ltext), w, h);
+       (* GL_LABEL_OBJECT_CLASS (gl_label_text_parent_class)->get_size) (GL_LABEL_OBJECT(ltext), w, h);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -372,7 +342,7 @@ get_size (glLabelObject *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       (* parent_class->get_size) (object, &w_parent, &h_parent);
+       (* GL_LABEL_OBJECT_CLASS (gl_label_text_parent_class)->get_size) (object, &w_parent, &h_parent);
 
        if ( (w_parent != 0.0) || (h_parent != 0.0) ) {
                *w = w_parent;
@@ -380,8 +350,8 @@ get_size (glLabelObject *object,
                return;
        }
 
-       gtk_text_buffer_get_bounds (ltext->private->buffer, &start, &end);
-       text = gtk_text_buffer_get_text (ltext->private->buffer,
+       gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end);
+       text = gtk_text_buffer_get_text (ltext->priv->buffer,
                                         &start, &end, FALSE);
 
        
@@ -394,13 +364,13 @@ get_size (glLabelObject *object,
 
        layout = pango_layout_new (context);
 
-        style = GL_LABEL_TEXT (object)->private->font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
+        style = GL_LABEL_TEXT (object)->priv->font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
 
        desc = pango_font_description_new ();
-       pango_font_description_set_family (desc, GL_LABEL_TEXT (object)->private->font_family);
-       pango_font_description_set_weight (desc, GL_LABEL_TEXT (object)->private->font_weight);
+       pango_font_description_set_family (desc, GL_LABEL_TEXT (object)->priv->font_family);
+       pango_font_description_set_weight (desc, GL_LABEL_TEXT (object)->priv->font_weight);
        pango_font_description_set_style  (desc, style);
-       pango_font_description_set_size   (desc, GL_LABEL_TEXT (object)->private->font_size * PANGO_SCALE * FONT_SCALE);
+       pango_font_description_set_size   (desc, GL_LABEL_TEXT (object)->priv->font_size * PANGO_SCALE * FONT_SCALE);
        pango_layout_set_font_description (layout, desc);
        pango_font_description_free       (desc);
 
@@ -445,18 +415,18 @@ set_font_family (glLabelObject *object,
        }
        gl_util_font_family_list_free (family_names);
 
-       if (ltext->private->font_family) {
-               if (g_strcasecmp (ltext->private->font_family, good_font_family) == 0) {
+       if (ltext->priv->font_family) {
+               if (g_strcasecmp (ltext->priv->font_family, good_font_family) == 0) {
                        g_free (good_font_family);
                        gl_debug (DEBUG_LABEL, "END (no change)");
                        return;
                }
-               g_free (ltext->private->font_family);
+               g_free (ltext->priv->font_family);
        }
-       ltext->private->font_family = g_strdup (good_font_family);
+       ltext->priv->font_family = g_strdup (good_font_family);
        g_free (good_font_family);
 
-       gl_debug (DEBUG_LABEL, "new font family = %s", ltext->private->font_family);
+       gl_debug (DEBUG_LABEL, "new font family = %s", ltext->priv->font_family);
 
        gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
@@ -476,9 +446,9 @@ set_font_size (glLabelObject *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->font_size != font_size) {
+       if (ltext->priv->font_size != font_size) {
 
-               ltext->private->font_size = font_size;
+               ltext->priv->font_size = font_size;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -499,9 +469,9 @@ set_font_weight (glLabelObject   *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->font_weight != font_weight) {
+       if (ltext->priv->font_weight != font_weight) {
 
-               ltext->private->font_weight = font_weight;
+               ltext->priv->font_weight = font_weight;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -522,9 +492,9 @@ set_font_italic_flag (glLabelObject *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->font_italic_flag != font_italic_flag) {
+       if (ltext->priv->font_italic_flag != font_italic_flag) {
 
-               ltext->private->font_italic_flag = font_italic_flag;
+               ltext->priv->font_italic_flag = font_italic_flag;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -545,9 +515,9 @@ set_text_alignment (glLabelObject    *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->align != text_alignment) {
+       if (ltext->priv->align != text_alignment) {
 
-               ltext->private->align = text_alignment;
+               ltext->priv->align = text_alignment;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -568,9 +538,9 @@ set_text_line_spacing (glLabelObject *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->line_spacing != line_spacing) {
+       if (ltext->priv->line_spacing != line_spacing) {
 
-               ltext->private->line_spacing = line_spacing;
+               ltext->priv->line_spacing = line_spacing;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -591,10 +561,10 @@ set_text_color (glLabelObject *object,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (!gl_color_node_equal (ltext->private->color_node, text_color_node)) {
+       if (!gl_color_node_equal (ltext->priv->color_node, text_color_node)) {
 
-               gl_color_node_free (&(ltext->private->color_node));
-               ltext->private->color_node = gl_color_node_dup (text_color_node);
+               gl_color_node_free (&(ltext->priv->color_node));
+               ltext->priv->color_node = gl_color_node_dup (text_color_node);
                
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
@@ -615,7 +585,7 @@ get_font_family (glLabelObject *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL);
 
-       return g_strdup (ltext->private->font_family);
+       return g_strdup (ltext->priv->font_family);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -630,7 +600,7 @@ get_font_size (glLabelObject *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0);
 
-       return ltext->private->font_size;
+       return ltext->priv->font_size;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -645,7 +615,7 @@ get_font_weight (glLabelObject   *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), PANGO_WEIGHT_NORMAL);
 
-       return ltext->private->font_weight;
+       return ltext->priv->font_weight;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -660,7 +630,7 @@ get_font_italic_flag (glLabelObject *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), FALSE);
 
-       return ltext->private->font_italic_flag;
+       return ltext->priv->font_italic_flag;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -675,7 +645,7 @@ get_text_alignment (glLabelObject    *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT);
 
-       return ltext->private->align;
+       return ltext->priv->align;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -690,7 +660,7 @@ get_text_line_spacing (glLabelObject *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0);
 
-       return ltext->private->line_spacing;
+       return ltext->priv->line_spacing;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -705,7 +675,7 @@ get_text_color (glLabelObject *object)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0);
 
-       return gl_color_node_dup (ltext->private->color_node);
+       return gl_color_node_dup (ltext->priv->color_node);
 }
 
 /*****************************************************************************/
@@ -719,9 +689,9 @@ gl_label_text_set_auto_shrink (glLabelText      *ltext,
 
        g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
 
-       if (ltext->private->auto_shrink != auto_shrink) {
+       if (ltext->priv->auto_shrink != auto_shrink) {
 
-               ltext->private->auto_shrink = auto_shrink;
+               ltext->priv->auto_shrink = auto_shrink;
                gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
 
        }
@@ -739,5 +709,5 @@ gl_label_text_get_auto_shrink (glLabelText      *ltext)
 
        g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0);
 
-       return ltext->private->auto_shrink;
+       return ltext->priv->auto_shrink;
 }
index 50a359a0d54c23e244d911b6532ed5c8fef723e5..e0997fefb3107b15d7b76a26c644027ce0b6cfba 100644 (file)
@@ -48,7 +48,7 @@ typedef struct _glLabelTextPrivate   glLabelTextPrivate;
 struct _glLabelText {
        glLabelObject         object;
 
-       glLabelTextPrivate   *private;
+       glLabelTextPrivate   *priv;
 };
 
 struct _glLabelTextClass {
index e80c0a1756564a31b2e3b9b293a6c7a8e83932be..8ed9016e33501f7fabfb5d783aa18594ddd33b0a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -67,8 +69,6 @@ enum {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint signals[LAST_SIGNAL] = {0};
 
 static guint untitled = 0;
@@ -77,9 +77,7 @@ static guint untitled = 0;
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_label_class_init    (glLabelClass *klass);
-static void gl_label_instance_init (glLabel      *label);
-static void gl_label_finalize      (GObject      *object);
+static void gl_label_finalize      (GObject *object);
 
 static void object_changed_cb      (glLabelObject *object,
                                    glLabel       *label);
@@ -93,40 +91,16 @@ static void object_moved_cb        (glLabelObject *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_label_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glLabelClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_label_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glLabel),
-                       0,
-                       (GInstanceInitFunc) gl_label_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glLabel", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glLabel, gl_label, G_TYPE_OBJECT);
 
 static void
-gl_label_class_init (glLabelClass *klass)
+gl_label_class_init (glLabelClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_LABEL, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_label_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_label_finalize;
 
@@ -180,15 +154,16 @@ gl_label_class_init (glLabelClass *klass)
 }
 
 static void
-gl_label_instance_init (glLabel *label)
+gl_label_init (glLabel *label)
 {
        gl_debug (DEBUG_LABEL, "START");
 
-       label->private = g_new0 (glLabelPrivate, 1);
-       label->private->template     = NULL;
-       label->private->filename     = NULL;
-       label->private->merge        = NULL;
-       label->private->pixbuf_cache = gl_pixbuf_cache_new ();
+       label->priv = g_new0 (glLabelPrivate, 1);
+
+       label->priv->template     = NULL;
+       label->priv->filename     = NULL;
+       label->priv->merge        = NULL;
+       label->priv->pixbuf_cache = gl_pixbuf_cache_new ();
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -196,30 +171,28 @@ gl_label_instance_init (glLabel *label)
 static void
 gl_label_finalize (GObject *object)
 {
-       glLabel *label;
+       glLabel *label = GL_LABEL (object);
        GList   *p, *p_next;
 
        gl_debug (DEBUG_LABEL, "START");
 
        g_return_if_fail (object && GL_IS_LABEL (object));
 
-       label = GL_LABEL (object);
-
        for (p = label->objects; p != NULL; p = p_next) {
                p_next = p->next;       /* NOTE: p will be left dangling */
                g_object_unref (G_OBJECT(p->data));
        }
 
-       gl_template_free (label->private->template);
-       g_free (label->private->filename);
-       if (label->private->merge != NULL) {
-               g_object_unref (G_OBJECT(label->private->merge));
+       gl_template_free (label->priv->template);
+       g_free (label->priv->filename);
+       if (label->priv->merge != NULL) {
+               g_object_unref (G_OBJECT(label->priv->merge));
        }
-       gl_pixbuf_cache_free (label->private->pixbuf_cache);
+       gl_pixbuf_cache_free (label->priv->pixbuf_cache);
 
-       g_free (label->private);
+       g_free (label->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_label_parent_class)->finalize (object);
 
        gl_debug (DEBUG_LABEL, "END");
 }
@@ -233,9 +206,9 @@ gl_label_new (void)
 
        label = g_object_new (gl_label_get_type(), NULL);
 
-       label->private->compression = 9;
+       label->priv->compression = 9;
 
-       label->private->modified_flag = FALSE;
+       label->priv->modified_flag = FALSE;
 
        gl_debug (DEBUG_LABEL, "END");
 
@@ -258,7 +231,7 @@ gl_label_add_object (glLabel       *label,
        object->parent = label;
        label->objects = g_list_append (label->objects, object);
 
-       label->private->modified_flag = TRUE;
+       label->priv->modified_flag = TRUE;
 
        g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        g_signal_emit (G_OBJECT(label), signals[CHANGED], 0);
@@ -296,7 +269,7 @@ gl_label_remove_object (glLabel       *label,
                                                      G_CALLBACK(object_moved_cb),
                                                      label);
 
-               label->private->modified_flag = TRUE;
+               label->priv->modified_flag = TRUE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
                g_signal_emit (G_OBJECT(label), signals[CHANGED], 0);
@@ -314,9 +287,9 @@ object_changed_cb (glLabelObject *object,
                   glLabel       *label)
 {
 
-       if ( !label->private->modified_flag ) {
+       if ( !label->priv->modified_flag ) {
 
-               label->private->modified_flag = TRUE;
+               label->priv->modified_flag = TRUE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        }
@@ -334,9 +307,9 @@ object_moved_cb (glLabelObject *object,
                 glLabel       *label)
 {
 
-       if ( !label->private->modified_flag ) {
+       if ( !label->priv->modified_flag ) {
 
-               label->private->modified_flag = TRUE;
+               label->priv->modified_flag = TRUE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        }
@@ -357,7 +330,7 @@ gl_label_raise_object_to_top (glLabel       *label,
        label->objects = g_list_remove (label->objects, object);
        label->objects = g_list_append (label->objects, object);
 
-       label->private->modified_flag = TRUE;
+       label->priv->modified_flag = TRUE;
 
        g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        g_signal_emit (G_OBJECT(label), signals[CHANGED], 0);
@@ -378,7 +351,7 @@ gl_label_lower_object_to_bottom (glLabel       *label,
        label->objects = g_list_remove (label->objects, object);
        label->objects = g_list_prepend (label->objects, object);
 
-       label->private->modified_flag = TRUE;
+       label->priv->modified_flag = TRUE;
 
        g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        g_signal_emit (G_OBJECT(label), signals[CHANGED], 0);
@@ -397,13 +370,13 @@ gl_label_set_template (glLabel    *label,
 
        g_return_if_fail (label && GL_IS_LABEL (label));
 
-       if ((label->private->template == NULL) ||
-           (g_strcasecmp (template->name, label->private->template->name) != 0)) {
+       if ((label->priv->template == NULL) ||
+           (g_strcasecmp (template->name, label->priv->template->name) != 0)) {
 
-               gl_template_free (label->private->template);
-               label->private->template = gl_template_dup (template);
+               gl_template_free (label->priv->template);
+               label->priv->template = gl_template_dup (template);
 
-               label->private->modified_flag = TRUE;
+               label->priv->modified_flag = TRUE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
                g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0);
@@ -425,11 +398,11 @@ gl_label_set_rotate_flag (glLabel *label,
 
        g_return_if_fail (label && GL_IS_LABEL (label));
 
-       if (rotate_flag != label->private->rotate_flag) {
+       if (rotate_flag != label->priv->rotate_flag) {
 
-               label->private->rotate_flag = rotate_flag;
+               label->priv->rotate_flag = rotate_flag;
 
-               label->private->modified_flag = TRUE;
+               label->priv->modified_flag = TRUE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
                g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0);
@@ -452,7 +425,7 @@ gl_label_get_template (glLabel *label)
 
        gl_debug (DEBUG_LABEL, "END");
 
-       return gl_template_dup (label->private->template);
+       return gl_template_dup (label->priv->template);
 }
 
 /****************************************************************************/
@@ -467,7 +440,7 @@ gl_label_get_rotate_flag (glLabel *label)
 
        gl_debug (DEBUG_LABEL, "END");
 
-       return label->private->rotate_flag;
+       return label->priv->rotate_flag;
 }
 
 /****************************************************************************/
@@ -485,7 +458,7 @@ gl_label_get_size (glLabel *label,
 
        g_return_if_fail (label && GL_IS_LABEL (label));
 
-       template = label->private->template;
+       template = label->priv->template;
        if ( !template ) {
                gl_debug (DEBUG_LABEL, "END -- template NULL");
                *w = *h = 0;
@@ -493,7 +466,7 @@ gl_label_get_size (glLabel *label,
        }
        label_type = gl_template_get_first_label_type (template);
 
-       if (!label->private->rotate_flag) {
+       if (!label->priv->rotate_flag) {
                gl_template_get_label_size (label_type, w, h);
        } else {
                gl_template_get_label_size (label_type, h, w);
@@ -513,12 +486,12 @@ gl_label_set_merge (glLabel *label,
 
        g_return_if_fail (label && GL_IS_LABEL (label));
 
-       if ( label->private->merge != NULL ) {
-               g_object_unref (G_OBJECT(label->private->merge));
+       if ( label->priv->merge != NULL ) {
+               g_object_unref (G_OBJECT(label->priv->merge));
        }
-       label->private->merge = gl_merge_dup (merge);
+       label->priv->merge = gl_merge_dup (merge);
 
-       label->private->modified_flag = TRUE;
+       label->priv->modified_flag = TRUE;
 
        g_signal_emit (G_OBJECT(label), signals[MERGE_CHANGED], 0);
        g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
@@ -539,7 +512,7 @@ gl_label_get_merge (glLabel *label)
 
        gl_debug (DEBUG_LABEL, "END");
 
-       return gl_merge_dup (label->private->merge);
+       return gl_merge_dup (label->priv->merge);
 }
 
 /****************************************************************************/
@@ -550,7 +523,7 @@ gl_label_get_filename (glLabel *label)
 {
        gl_debug (DEBUG_LABEL, "");
 
-       return g_strdup ( label->private->filename );
+       return g_strdup ( label->priv->filename );
 }
 
 /****************************************************************************/
@@ -561,19 +534,19 @@ gl_label_get_short_name (glLabel *label)
 {
        gl_debug (DEBUG_LABEL, "");
 
-       if ( label->private->filename == NULL ) {
+       if ( label->priv->filename == NULL ) {
 
-               if ( label->private->untitled_instance == 0 ) {
-                       label->private->untitled_instance = ++untitled;
+               if ( label->priv->untitled_instance == 0 ) {
+                       label->priv->untitled_instance = ++untitled;
                }
 
                return g_strdup_printf ( "%s %d", _("Untitled"),
-                                        label->private->untitled_instance );
+                                        label->priv->untitled_instance );
 
        } else {
                gchar *temp_name, *short_name;
 
-               temp_name = g_path_get_basename ( label->private->filename );
+               temp_name = g_path_get_basename ( label->priv->filename );
                short_name = gl_util_remove_extension (temp_name);
                g_free (temp_name);
 
@@ -587,7 +560,7 @@ gl_label_get_short_name (glLabel *label)
 GHashTable *
 gl_label_get_pixbuf_cache (glLabel       *label)
 {
-       return label->private->pixbuf_cache;
+       return label->priv->pixbuf_cache;
 }
 
 /****************************************************************************/
@@ -596,8 +569,8 @@ gl_label_get_pixbuf_cache (glLabel       *label)
 gboolean
 gl_label_is_modified (glLabel *label)
 {
-       gl_debug (DEBUG_LABEL, "return %d", label->private->modified_flag);
-       return label->private->modified_flag;
+       gl_debug (DEBUG_LABEL, "return %d", label->priv->modified_flag);
+       return label->priv->modified_flag;
 }
 
 /****************************************************************************/
@@ -606,8 +579,8 @@ gl_label_is_modified (glLabel *label)
 gboolean
 gl_label_is_untitled (glLabel *label)
 {
-       gl_debug (DEBUG_LABEL, "return %d",(label->private->filename == NULL));
-       return (label->private->filename == NULL);
+       gl_debug (DEBUG_LABEL, "return %d",(label->priv->filename == NULL));
+       return (label->priv->filename == NULL);
 }
 
 /****************************************************************************/
@@ -637,7 +610,7 @@ void
 gl_label_set_filename (glLabel     *label,
                       const gchar *filename)
 {
-       label->private->filename = g_strdup (filename);
+       label->priv->filename = g_strdup (filename);
 
        g_signal_emit (G_OBJECT(label), signals[NAME_CHANGED], 0);
 }
@@ -649,9 +622,9 @@ void
 gl_label_clear_modified (glLabel *label)
 {
 
-       if ( label->private->modified_flag ) {
+       if ( label->priv->modified_flag ) {
 
-               label->private->modified_flag = FALSE;
+               label->priv->modified_flag = FALSE;
 
                g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0);
        }
@@ -675,7 +648,7 @@ gl_label_set_compression (glLabel  *label,
        }
 
        gl_debug (DEBUG_LABEL, "actual set %d", compression);
-       label->private->compression = compression;
+       label->priv->compression = compression;
 }
 
 
@@ -685,7 +658,7 @@ gl_label_set_compression (glLabel  *label,
 gint
 gl_label_get_compression (glLabel *label)
 {
-       gl_debug (DEBUG_LABEL, "return %d", label->private->compression);
-       return label->private->compression;
+       gl_debug (DEBUG_LABEL, "return %d", label->priv->compression);
+       return label->priv->compression;
 }
 
index 8d2873c9f5f01ae12edb30682361dd21f517f7f3..4a908120c7536aa371d69c1f934e4a56d3d2c2b8 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -47,7 +49,7 @@ struct _glLabel {
 
        GList          *objects;
 
-       glLabelPrivate *private;
+       glLabelPrivate *priv;
 };
 
 struct _glLabelClass {
index 30efb8975679326de7b501a308981d7007773878..78c66fc532b26b5f1802575292fec9e0d381d783 100644 (file)
@@ -64,15 +64,10 @@ enum {
 /* Private globals                           */
 /*===========================================*/
 
-static glMergeClass *parent_class = NULL;
-
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void           gl_merge_evolution_class_init      (glMergeEvolutionClass *klass);
-static void           gl_merge_evolution_instance_init   (glMergeEvolution      *object);
 static void           gl_merge_evolution_finalize        (GObject          *object);
 
 static void           gl_merge_evolution_set_property    (GObject          *object,
@@ -100,41 +95,17 @@ static void           free_field_list                    (GList *fields);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_merge_evolution_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo info = {
-                        sizeof (glMergeEvolutionClass),
-                        NULL,
-                        NULL,
-                        (GClassInitFunc) gl_merge_evolution_class_init,
-                        NULL,
-                        NULL,
-                        sizeof (glMergeEvolution),
-                        0,
-                        (GInstanceInitFunc) gl_merge_evolution_instance_init,
-                        NULL
-                };
-
-                type = g_type_register_static (GL_TYPE_MERGE,
-                                               "glMergeEvolution", &info, 0);
-        }
-
-        return type;
-}
+G_DEFINE_TYPE (glMergeEvolution, gl_merge_evolution, GL_TYPE_MERGE);
 
 static void
-gl_merge_evolution_class_init (glMergeEvolutionClass *klass)
+gl_merge_evolution_class_init (glMergeEvolutionClass *class)
 {
-        GObjectClass *object_class = (GObjectClass *) klass;
-        glMergeClass *merge_class  = (glMergeClass *) klass;
+        GObjectClass *object_class = G_OBJECT_CLASS (class);
+        glMergeClass *merge_class  = GL_MERGE_CLASS (class);
 
         gl_debug (DEBUG_MERGE, "START");
 
-        parent_class = g_type_class_peek_parent (klass);
+        gl_merge_evolution_parent_class = g_type_class_peek_parent (class);
 
         object_class->set_property = gl_merge_evolution_set_property;
         object_class->get_property = gl_merge_evolution_get_property;
@@ -160,12 +131,12 @@ gl_merge_evolution_class_init (glMergeEvolutionClass *klass)
 }
 
 static void
-gl_merge_evolution_instance_init (glMergeEvolution *merge_evolution)
+gl_merge_evolution_init (glMergeEvolution *merge_evolution)
 {
         gl_debug (DEBUG_MERGE, "START");
 
-        merge_evolution->private = g_new0 (glMergeEvolutionPrivate, 1);
-        merge_evolution->private->query = g_strdup(DEFAULT_QUERY);
+        merge_evolution->priv = g_new0 (glMergeEvolutionPrivate, 1);
+        merge_evolution->priv->query = g_strdup(DEFAULT_QUERY);
 
         gl_debug (DEBUG_MERGE, "END");
 }
@@ -173,18 +144,17 @@ gl_merge_evolution_instance_init (glMergeEvolution *merge_evolution)
 static void
 gl_merge_evolution_finalize (GObject *object)
 {
-        glMergeEvolution *merge_evolution;
+        glMergeEvolution *merge_evolution = GL_MERGE_EVOLUTION (object);
 
         gl_debug (DEBUG_MERGE, "START");
 
         g_return_if_fail (object && GL_IS_MERGE_EVOLUTION (object));
 
-        G_OBJECT_CLASS (parent_class)->finalize (object);
+        free_field_list(merge_evolution->priv->fields);
+        g_free (merge_evolution->priv->query);
+        g_free (merge_evolution->priv);
 
-        merge_evolution = GL_MERGE_EVOLUTION (object);
-        free_field_list(merge_evolution->private->fields);
-        g_free (merge_evolution->private->query);
-        g_free (merge_evolution->private);
+        G_OBJECT_CLASS (gl_merge_evolution_parent_class)->finalize (object);
 
         gl_debug (DEBUG_MERGE, "END");
 }
@@ -205,10 +175,10 @@ gl_merge_evolution_set_property (GObject      *object,
         switch (param_id) {
 
         case ARG_QUERY:
-                g_free (merge_evolution->private->query);
-                merge_evolution->private->query = g_value_dup_string (value);
+                g_free (merge_evolution->priv->query);
+                merge_evolution->priv->query = g_value_dup_string (value);
                 gl_debug (DEBUG_MERGE, "ARG \"query\" = \"%s\"",
-                          merge_evolution->private->query);
+                          merge_evolution->priv->query);
                 break;
 
         default:
@@ -235,7 +205,7 @@ gl_merge_evolution_get_property (GObject     *object,
         switch (param_id) {
 
         case ARG_QUERY:
-                g_value_set_string (value, merge_evolution->private->query);
+                g_value_set_string (value, merge_evolution->priv->query);
                 break;
 
         default:
@@ -262,7 +232,7 @@ gl_merge_evolution_get_key_list (glMerge *merge)
 
         /* for the previously retrieved supported fileds, go through them and find
          * their pretty names */
-        for (iter = merge_evolution->private->fields; 
+        for (iter = merge_evolution->priv->fields; 
                  iter != NULL; 
                  iter = g_list_next(iter)) 
         {
@@ -303,38 +273,38 @@ gl_merge_evolution_open (glMerge *merge)
 
         merge_evolution = GL_MERGE_EVOLUTION (merge);
 
-        query = e_book_query_from_string(merge_evolution->private->query);
+        query = e_book_query_from_string(merge_evolution->priv->query);
         if (!query) {
                 g_warning (_("Couldn't construct query"));
                 return;
         }
 
-        merge_evolution->private->book = e_book_new_system_addressbook(&error);
-        if (!merge_evolution->private->book) {
+        merge_evolution->priv->book = e_book_new_system_addressbook(&error);
+        if (!merge_evolution->priv->book) {
                 g_warning (_("Couldn't open addressbook: %s"), error->message);
                 e_book_query_unref(query);
                 g_error_free (error);
                 return;
         }
 
-        if (!e_book_open(merge_evolution->private->book, TRUE, &error)) {
+        if (!e_book_open(merge_evolution->priv->book, TRUE, &error)) {
                 g_warning (_("Couldn't open addressbook: %s"), error->message);
                 g_error_free (error);
                 e_book_query_unref(query);
-                g_object_unref(merge_evolution->private->book);
-                merge_evolution->private->book = NULL;
+                g_object_unref(merge_evolution->priv->book);
+                merge_evolution->priv->book = NULL;
                 return;
         }
 
         /* fetch the list of fields supported by this address book */
-        status = e_book_get_supported_fields(merge_evolution->private->book,
+        status = e_book_get_supported_fields(merge_evolution->priv->book,
                                                                                  &fields, &error);
         if (status == FALSE) {
                 g_warning (_("Couldn't list available fields: %s"), error->message);
                 g_error_free (error);
                 e_book_query_unref(query);
-                g_object_unref(merge_evolution->private->book);
-                merge_evolution->private->book = NULL;
+                g_object_unref(merge_evolution->priv->book);
+                merge_evolution->priv->book = NULL;
                 return;
         }
 
@@ -349,25 +319,25 @@ gl_merge_evolution_open (glMerge *merge)
                         continue;
                 }
 
-                merge_evolution->private->fields = 
-                        g_list_prepend(merge_evolution->private->fields, field_id);
+                merge_evolution->priv->fields = 
+                        g_list_prepend(merge_evolution->priv->fields, field_id);
         }
         free_field_list(fields); /* don't need the list of names anymore */
 
-        gl_debug(DEBUG_MERGE, "Field list length: %d", g_list_length(merge_evolution->private->fields));
+        gl_debug(DEBUG_MERGE, "Field list length: %d", g_list_length(merge_evolution->priv->fields));
 
         /* finally retrieve the contacts */
-        status = e_book_get_contacts (merge_evolution->private->book,
+        status = e_book_get_contacts (merge_evolution->priv->book,
                                       query,
-                                      &merge_evolution->private->contacts,
+                                      &merge_evolution->priv->contacts,
                                       &error);
         if (status == FALSE) {
                 g_warning (_("Couldn't get contacts: %s"), error->message);
                 g_error_free (error);
                 e_book_query_unref(query);
-                free_field_list(merge_evolution->private->fields);
-                g_object_unref(merge_evolution->private->book);
-                merge_evolution->private->book = NULL;
+                free_field_list(merge_evolution->priv->fields);
+                g_object_unref(merge_evolution->priv->book);
+                merge_evolution->priv->book = NULL;
 
                 return;
         }
@@ -392,10 +362,10 @@ gl_merge_evolution_close (glMerge *merge)
         merge_evolution = GL_MERGE_EVOLUTION (merge);
 
         /* unref all of the objects created in _open */
-        g_object_unref(merge_evolution->private->book);
-        merge_evolution->private->book = NULL;
+        g_object_unref(merge_evolution->priv->book);
+        merge_evolution->priv->book = NULL;
 
-        for (iter = merge_evolution->private->contacts; 
+        for (iter = merge_evolution->priv->contacts; 
              iter != NULL; 
              iter = g_list_next(iter))
         {
@@ -403,8 +373,8 @@ gl_merge_evolution_close (glMerge *merge)
 
                 g_object_unref(contact);
         }
-        g_list_free(merge_evolution->private->contacts);
-        merge_evolution->private->contacts = NULL;
+        g_list_free(merge_evolution->priv->contacts);
+        merge_evolution->priv->contacts = NULL;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -423,7 +393,7 @@ gl_merge_evolution_get_record (glMerge *merge)
 
         merge_evolution = GL_MERGE_EVOLUTION (merge);
 
-        head = merge_evolution->private->contacts;
+        head = merge_evolution->priv->contacts;
         if (head == NULL) {
                 return NULL; /* past the last record */
         }
@@ -437,7 +407,7 @@ gl_merge_evolution_get_record (glMerge *merge)
          * that contact */
 
         /* iterate through the supported fields, and add them to the list */
-        for (iter = merge_evolution->private->fields;
+        for (iter = merge_evolution->priv->fields;
              iter != NULL;
              iter = g_list_next(iter))
         {
@@ -457,8 +427,8 @@ gl_merge_evolution_get_record (glMerge *merge)
 
         /* do a destructive read */
         g_object_unref (contact);
-        merge_evolution->private->contacts = 
-                g_list_remove_link (merge_evolution->private->contacts, head);
+        merge_evolution->priv->contacts = 
+                g_list_remove_link (merge_evolution->priv->contacts, head);
         g_list_free_1 (head);
 
         return record;
@@ -481,11 +451,11 @@ gl_merge_evolution_copy (glMerge *dst_merge,
         dst_merge_evolution = GL_MERGE_EVOLUTION (dst_merge);
         src_merge_evolution = GL_MERGE_EVOLUTION (src_merge);
 
-        dst_merge_evolution->private->query = g_strdup(src_merge_evolution->private->query);
+        dst_merge_evolution->priv->query = g_strdup(src_merge_evolution->priv->query);
 
-        dst_merge_evolution->private->fields = g_list_copy(src_merge_evolution->private->fields);
-        for (src_iter = src_merge_evolution->private->fields,
-                     dst_iter = dst_merge_evolution->private->fields; 
+        dst_merge_evolution->priv->fields = g_list_copy(src_merge_evolution->priv->fields);
+        for (src_iter = src_merge_evolution->priv->fields,
+                     dst_iter = dst_merge_evolution->priv->fields; 
              src_iter != NULL && dst_iter != NULL; 
              src_iter = g_list_next(src_iter), dst_iter = g_list_next(dst_iter))
         {
index 32c8a9c0a96cf6386ada6b5fdf0a48fb7532d83c..26468abc1baea3c12d88c9018fe1fb08fc5eb23e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -31,7 +33,7 @@ G_BEGIN_DECLS
 /* The following object arguments are available:
  *
  * name               type             description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
  * query              gchar*           The query used to select records
  *
  */
@@ -51,13 +53,13 @@ typedef struct _glMergeEvolutionPrivate   glMergeEvolutionPrivate;
 
 
 struct _glMergeEvolution {
-       glMerge              object;
+       glMerge                   object;
 
-       glMergeEvolutionPrivate  *private;
+       glMergeEvolutionPrivate  *priv;
 };
 
 struct _glMergeEvolutionClass {
-       glMergeClass         parent_class;
+       glMergeClass              parent_class;
 };
 
 
index d44d3c074a2084f0197561a2e0063918b37d59b8..b62551bede5bb91bf5f7c5adc4da36f001294218 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 33d48ec905ccde51877942b7981ffad03aa25e84..7bd57eefb730d5d0eeb87f17aca9697e359d2b85 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index c21f521a15f395df81368e950292febaf9b1f386..d0b526101ebe9e7a7dc4cb489afb4233b8eb0d56 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -84,14 +84,11 @@ enum {
 /* Private globals                           */
 /*===========================================*/
 
-static GtkDialogClass* parent_class = NULL;
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *klass);
-static void gl_merge_properties_dialog_init       (glMergePropertiesDialog      *dlg);
 static void gl_merge_properties_dialog_finalize   (GObject                      *object);
 static void gl_merge_properties_dialog_construct  (glMergePropertiesDialog      *dialog,
                                                   glLabel                      *label,
@@ -124,42 +121,16 @@ static void unselect_all_button_clicked_cb        (GtkWidget
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_merge_properties_dialog_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glMergePropertiesDialogClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_merge_properties_dialog_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glMergePropertiesDialog),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_merge_properties_dialog_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_DIALOG,
-                                              "glMergePropertiesDialog", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG);
 
 static void
-gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *klass)
+gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_MERGE, "");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_merge_properties_dialog_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_merge_properties_dialog_finalize;   
 }
@@ -200,25 +171,20 @@ gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog)
 static void 
 gl_merge_properties_dialog_finalize (GObject *object)
 {
-       glMergePropertiesDialog* dialog;
+       glMergePropertiesDialog* dialog = GL_MERGE_PROPERTIES_DIALOG (object);
        
        gl_debug (DEBUG_MERGE, "START");
 
        g_return_if_fail (object != NULL);
-       
-       dialog = GL_MERGE_PROPERTIES_DIALOG (object);
-
        g_return_if_fail (GL_IS_MERGE_PROPERTIES_DIALOG (dialog));
        g_return_if_fail (dialog->priv != NULL);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
-
        if (dialog->priv->merge != NULL) {
                g_object_unref (G_OBJECT (dialog->priv->merge));
        }
-
        g_free (dialog->priv);
 
+       G_OBJECT_CLASS (gl_merge_properties_dialog_parent_class)->finalize (object);
        gl_debug (DEBUG_MERGE, "END");
 }
 
index 3fcc28a5e50b34bdec64d4f10eb96568de11dd75..f98ea7bfb68b79d33caa18f7b2cca3f625aa48ba 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 8802235a3534578644cd256eb9071f9965c14abb..77afcfedc0b93b6006561596d3956dcecb7c6d83 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -52,15 +54,11 @@ enum {
 /* Private globals                           */
 /*===========================================*/
 
-static glMergeClass *parent_class = NULL;
-
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void           gl_merge_text_class_init      (glMergeTextClass *klass);
-static void           gl_merge_text_instance_init   (glMergeText      *object);
 static void           gl_merge_text_finalize        (GObject          *object);
 
 static void           gl_merge_text_set_property    (GObject          *object,
@@ -89,41 +87,17 @@ static void           free_fields                   (GList           **fields);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_merge_text_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glMergeTextClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_merge_text_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glMergeText),
-                       0,
-                       (GInstanceInitFunc) gl_merge_text_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_MERGE,
-                                              "glMergeText", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glMergeText, gl_merge_text, GL_TYPE_MERGE);
 
 static void
-gl_merge_text_class_init (glMergeTextClass *klass)
+gl_merge_text_class_init (glMergeTextClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
-       glMergeClass *merge_class  = (glMergeClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
+       glMergeClass *merge_class  = GL_MERGE_CLASS (class);
 
        gl_debug (DEBUG_MERGE, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_merge_text_parent_class = g_type_class_peek_parent (class);
 
        object_class->set_property = gl_merge_text_set_property;
        object_class->get_property = gl_merge_text_get_property;
@@ -148,11 +122,11 @@ gl_merge_text_class_init (glMergeTextClass *klass)
 }
 
 static void
-gl_merge_text_instance_init (glMergeText *merge_text)
+gl_merge_text_init (glMergeText *merge_text)
 {
        gl_debug (DEBUG_MERGE, "START");
 
-       merge_text->private = g_new0 (glMergeTextPrivate, 1);
+       merge_text->priv = g_new0 (glMergeTextPrivate, 1);
 
        gl_debug (DEBUG_MERGE, "END");
 }
@@ -160,11 +134,15 @@ gl_merge_text_instance_init (glMergeText *merge_text)
 static void
 gl_merge_text_finalize (GObject *object)
 {
+       glMergeText *merge_text = GL_MERGE_TEXT (object);
+
        gl_debug (DEBUG_MERGE, "START");
 
        g_return_if_fail (object && GL_IS_MERGE_TEXT (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       g_free (merge_text->priv);
+
+       G_OBJECT_CLASS (gl_merge_text_parent_class)->finalize (object);
 
        gl_debug (DEBUG_MERGE, "END");
 }
@@ -185,9 +163,9 @@ gl_merge_text_set_property (GObject      *object,
        switch (param_id) {
 
        case ARG_DELIM:
-               merge_text->private->delim = g_value_get_char (value);
+               merge_text->priv->delim = g_value_get_char (value);
                gl_debug (DEBUG_MERGE, "ARG \"delim\" = \"%c\"",
-                         merge_text->private->delim);
+                         merge_text->priv->delim);
                break;
 
         default:
@@ -214,7 +192,7 @@ gl_merge_text_get_property (GObject     *object,
        switch (param_id) {
 
        case ARG_DELIM:
-               g_value_set_char (value, merge_text->private->delim);
+               g_value_set_char (value, merge_text->priv->delim);
                break;
 
         default:
@@ -291,7 +269,7 @@ gl_merge_text_open (glMerge *merge)
        src = gl_merge_get_src (merge);
 
        if (src != NULL) {
-               merge_text->private->fp = fopen (src, "r");
+               merge_text->priv->fp = fopen (src, "r");
        }
 
        g_free (src);
@@ -307,10 +285,10 @@ gl_merge_text_close (glMerge *merge)
 
        merge_text = GL_MERGE_TEXT (merge);
 
-       if (merge_text->private->fp != NULL) {
+       if (merge_text->priv->fp != NULL) {
 
-               fclose (merge_text->private->fp);
-               merge_text->private->fp = NULL;
+               fclose (merge_text->priv->fp);
+               merge_text->priv->fp = NULL;
 
        }
 }
@@ -331,8 +309,8 @@ gl_merge_text_get_record (glMerge *merge)
 
        merge_text = GL_MERGE_TEXT (merge);
 
-       delim = merge_text->private->delim;
-       fp    = merge_text->private->fp;
+       delim = merge_text->priv->delim;
+       fp    = merge_text->priv->fp;
 
        if (fp == NULL) {
                return NULL;
@@ -376,7 +354,7 @@ gl_merge_text_copy (glMerge *dst_merge,
        dst_merge_text = GL_MERGE_TEXT (dst_merge);
        src_merge_text = GL_MERGE_TEXT (src_merge);
 
-       dst_merge_text->private->delim = src_merge_text->private->delim;
+       dst_merge_text->priv->delim = src_merge_text->priv->delim;
 }
 
 /*---------------------------------------------------------------------------*/
index 7bf037006ac971901074ab68bbbeb09f5e6b17df..65bad54d673ba7361b62269655a1f1c293280229 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -29,7 +31,7 @@ G_BEGIN_DECLS
 /* The following object arguments are available:
  *
  * name               type             description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
  * delim              gchar            Field delimiter.
  *
  */
@@ -51,7 +53,7 @@ typedef struct _glMergeTextPrivate   glMergeTextPrivate;
 struct _glMergeText {
        glMerge              object;
 
-       glMergeTextPrivate  *private;
+       glMergeTextPrivate  *priv;
 };
 
 struct _glMergeTextClass {
index 3ab663d62217a28cf28b47241704c8f06711eb2c..c0eb1449667bc9184f1c2c01f52c2d8ff207f3ca 100644 (file)
@@ -58,15 +58,11 @@ enum {
 /* Private globals                           */
 /*===========================================*/
 
-static glMergeClass *parent_class = NULL;
-
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void           gl_merge_vcard_class_init      (glMergeVCardClass *klass);
-static void           gl_merge_vcard_instance_init   (glMergeVCard      *object);
 static void           gl_merge_vcard_finalize        (GObject          *object);
 
 static void           gl_merge_vcard_set_property    (GObject          *object,
@@ -88,46 +84,22 @@ static void           gl_merge_vcard_copy            (glMerge          *dst_merg
                                                       glMerge          *src_merge);
 static char *         parse_next_vcard               (FILE             *fp);
 
-/* utility function prototypes go here */
+
 \f
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_merge_vcard_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo info = {
-                        sizeof (glMergeVCardClass),
-                        NULL,
-                        NULL,
-                        (GClassInitFunc) gl_merge_vcard_class_init,
-                        NULL,
-                        NULL,
-                        sizeof (glMergeVCard),
-                        0,
-                        (GInstanceInitFunc) gl_merge_vcard_instance_init,
-                        NULL
-                };
-
-                type = g_type_register_static (GL_TYPE_MERGE,
-                                               "glMergeVCard", &info, 0);
-        }
-
-        return type;
-}
+G_DEFINE_TYPE (glMergeVCard, gl_merge_vcard, GL_TYPE_MERGE);
 
 static void
-gl_merge_vcard_class_init (glMergeVCardClass *klass)
+gl_merge_vcard_class_init (glMergeVCardClass *class)
 {
-        GObjectClass *object_class = (GObjectClass *) klass;
-        glMergeClass *merge_class  = (glMergeClass *) klass;
+        GObjectClass *object_class = G_OBJECT_CLASS (class);
+        glMergeClass *merge_class  = GL_MERGE_CLASS (class);
 
         gl_debug (DEBUG_MERGE, "START");
 
-        parent_class = g_type_class_peek_parent (klass);
+        gl_merge_vcard_parent_class = g_type_class_peek_parent (class);
 
         object_class->set_property = gl_merge_vcard_set_property;
         object_class->get_property = gl_merge_vcard_get_property;
@@ -145,11 +117,11 @@ gl_merge_vcard_class_init (glMergeVCardClass *klass)
 }
 
 static void
-gl_merge_vcard_instance_init (glMergeVCard *merge_vcard)
+gl_merge_vcard_init (glMergeVCard *merge_vcard)
 {
         gl_debug (DEBUG_MERGE, "START");
 
-        merge_vcard->private = g_new0 (glMergeVCardPrivate, 1);
+        merge_vcard->priv = g_new0 (glMergeVCardPrivate, 1);
 
         gl_debug (DEBUG_MERGE, "END");
 }
@@ -157,16 +129,15 @@ gl_merge_vcard_instance_init (glMergeVCard *merge_vcard)
 static void
 gl_merge_vcard_finalize (GObject *object)
 {
-        glMergeVCard *merge_vcard;
+        glMergeVCard *merge_vcard = GL_MERGE_VCARD (object);
 
         gl_debug (DEBUG_MERGE, "START");
 
         g_return_if_fail (object && GL_IS_MERGE_VCARD (object));
 
-        G_OBJECT_CLASS (parent_class)->finalize (object);
+        g_free (merge_vcard->priv);
 
-        merge_vcard = GL_MERGE_VCARD (object);
-        g_free (merge_vcard->private);
+        G_OBJECT_CLASS (gl_merge_vcard_parent_class)->finalize (object);
 
         gl_debug (DEBUG_MERGE, "END");
 }
@@ -263,7 +234,7 @@ gl_merge_vcard_open (glMerge *merge)
         src = gl_merge_get_src (merge);
 
         if (src != NULL) {
-                merge_vcard->private->fp = fopen (src, "r");
+                merge_vcard->priv->fp = fopen (src, "r");
         }
 
         g_free (src);
@@ -281,9 +252,9 @@ gl_merge_vcard_close (glMerge *merge)
 
         merge_vcard = GL_MERGE_VCARD (merge);
 
-        if (merge_vcard->private->fp != NULL) {
-                fclose (merge_vcard->private->fp);
-                merge_vcard->private->fp = NULL;
+        if (merge_vcard->priv->fp != NULL) {
+                fclose (merge_vcard->priv->fp);
+                merge_vcard->priv->fp = NULL;
         }
 }
 
@@ -302,7 +273,7 @@ gl_merge_vcard_get_record (glMerge *merge)
 
         merge_vcard = GL_MERGE_VCARD (merge);
 
-        vcard = parse_next_vcard(merge_vcard->private->fp);
+        vcard = parse_next_vcard(merge_vcard->priv->fp);
         if (vcard == NULL || vcard[0] == '\0') {
                 return NULL; /* EOF */
         }
index b6712e3cf1b46f3dcb834909be983c561e3c5273..7ede444fd6c245d68d56641c03d5da188bf8ac07 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -31,7 +33,7 @@ G_BEGIN_DECLS
 /* The following object arguments are available:
  *
  * name               type             description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
  *
  */
 
@@ -52,7 +54,7 @@ typedef struct _glMergeVCardPrivate   glMergeVCardPrivate;
 struct _glMergeVCard {
        glMerge              object;
 
-       glMergeVCardPrivate  *private;
+       glMergeVCardPrivate *priv;
 };
 
 struct _glMergeVCardClass {
index 2bba656c94b33f9e4f9ef7bd7e8afff609cb450c..b5429baf6e2264f8720039cee952a64c97bbec2e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -62,16 +64,12 @@ typedef struct {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static GList *backends = NULL;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void           gl_merge_class_init    (glMergeClass   *klass);
-static void           gl_merge_instance_init (glMerge        *object);
 static void           gl_merge_finalize      (GObject        *object);
 
 static void           merge_open             (glMerge        *merge);
@@ -227,40 +225,16 @@ gl_merge_description_to_name (gchar *description)
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_merge_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glMergeClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_merge_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glMerge),
-                       0,
-                       (GInstanceInitFunc) gl_merge_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glMerge", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glMerge, gl_merge, G_TYPE_OBJECT);
 
 static void
-gl_merge_class_init (glMergeClass *klass)
+gl_merge_class_init (glMergeClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_MERGE, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_merge_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_merge_finalize;
 
@@ -268,11 +242,11 @@ gl_merge_class_init (glMergeClass *klass)
 }
 
 static void
-gl_merge_instance_init (glMerge *merge)
+gl_merge_init (glMerge *merge)
 {
        gl_debug (DEBUG_MERGE, "START");
 
-       merge->private = g_new0 (glMergePrivate, 1);
+       merge->priv = g_new0 (glMergePrivate, 1);
 
        gl_debug (DEBUG_MERGE, "END");
 }
@@ -280,17 +254,19 @@ gl_merge_instance_init (glMerge *merge)
 static void
 gl_merge_finalize (GObject *object)
 {
+       glMerge *merge = GL_MERGE (object);
+
        gl_debug (DEBUG_MERGE, "START");
 
        g_return_if_fail (object && GL_IS_MERGE (object));
 
-       merge_free_record_list (&GL_MERGE(object)->private->record_list);
-       g_free (GL_MERGE(object)->private->name);
-       g_free (GL_MERGE(object)->private->description);
-       g_free (GL_MERGE(object)->private->src);
-       g_free (GL_MERGE(object)->private);
+       merge_free_record_list (&merge->priv->record_list);
+       g_free (merge->priv->name);
+       g_free (merge->priv->description);
+       g_free (merge->priv->src);
+       g_free (merge->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_merge_parent_class)->finalize (object);
 
        gl_debug (DEBUG_MERGE, "END");
 }
@@ -316,9 +292,9 @@ gl_merge_new (gchar *name)
                                                         backend->n_params,
                                                         backend->params));
 
-                       merge->private->name        = g_strdup (name);
-                       merge->private->description = g_strdup (backend->description);
-                       merge->private->src_type    = backend->src_type;
+                       merge->priv->name        = g_strdup (name);
+                       merge->priv->description = g_strdup (backend->description);
+                       merge->priv->src_type    = backend->src_type;
 
                        break;
                }
@@ -351,12 +327,12 @@ gl_merge_dup (glMerge *src_merge)
        g_return_val_if_fail (GL_IS_MERGE (src_merge), NULL);
 
        dst_merge = g_object_new (G_OBJECT_TYPE(src_merge), NULL);
-       dst_merge->private->name        = g_strdup (src_merge->private->name);
-       dst_merge->private->description = g_strdup (src_merge->private->description);
-       dst_merge->private->src         = g_strdup (src_merge->private->src);
-       dst_merge->private->src_type    = src_merge->private->src_type;
-       dst_merge->private->record_list 
-               = merge_dup_record_list (src_merge->private->record_list);
+       dst_merge->priv->name        = g_strdup (src_merge->priv->name);
+       dst_merge->priv->description = g_strdup (src_merge->priv->description);
+       dst_merge->priv->src         = g_strdup (src_merge->priv->src);
+       dst_merge->priv->src_type    = src_merge->priv->src_type;
+       dst_merge->priv->record_list 
+               = merge_dup_record_list (src_merge->priv->record_list);
 
        if ( GL_MERGE_GET_CLASS(src_merge)->copy != NULL ) {
 
@@ -384,7 +360,7 @@ gl_merge_get_name (glMerge *merge)
 
        g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup("None"));
 
-       return g_strdup(merge->private->name);
+       return g_strdup(merge->priv->name);
 }
 
 /*****************************************************************************/
@@ -401,7 +377,7 @@ gl_merge_get_description (glMerge *merge)
 
        g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup(_("None")));
 
-       return g_strdup(merge->private->description);
+       return g_strdup(merge->priv->description);
 }
 
 /*****************************************************************************/
@@ -418,7 +394,7 @@ gl_merge_get_src_type (glMerge *merge)
 
        g_return_val_if_fail (GL_IS_MERGE (merge), GL_MERGE_SRC_IS_FIXED);
 
-       return merge->private->src_type;
+       return merge->priv->src_type;
 }
 
 /*****************************************************************************/
@@ -444,24 +420,24 @@ gl_merge_set_src (glMerge *merge,
        if ( src == NULL)
        {
 
-               if ( merge->private->src != NULL )
+               if ( merge->priv->src != NULL )
                {
-                       g_free (merge->private->src);
+                       g_free (merge->priv->src);
                }
-               merge->private->src = NULL;
-               merge_free_record_list (&merge->private->record_list);
+               merge->priv->src = NULL;
+               merge_free_record_list (&merge->priv->record_list);
 
        }
        else
        {
 
-               if ( merge->private->src != NULL )
+               if ( merge->priv->src != NULL )
                {
-                       g_free(merge->private->src);
+                       g_free(merge->priv->src);
                }
-               merge->private->src = g_strdup (src);
+               merge->priv->src = g_strdup (src);
 
-               merge_free_record_list (&merge->private->record_list);
+               merge_free_record_list (&merge->priv->record_list);
                        
                merge_open (merge);
                while ( (record = merge_get_record (merge)) != NULL )
@@ -469,7 +445,7 @@ gl_merge_set_src (glMerge *merge,
                        record_list = g_list_append( record_list, record );
                }
                merge_close (merge);
-               merge->private->record_list = record_list;
+               merge->priv->record_list = record_list;
 
        }
                     
@@ -491,7 +467,7 @@ gl_merge_get_src (glMerge *merge)
 
        g_return_val_if_fail (GL_IS_MERGE (merge), NULL);
 
-       return g_strdup(merge->private->src);
+       return g_strdup(merge->priv->src);
 }
 
 /*****************************************************************************/
@@ -734,7 +710,7 @@ gl_merge_get_record_list (glMerge *merge)
        gl_debug (DEBUG_MERGE, "");
              
        if ( merge != NULL ) {
-               return merge->private->record_list;
+               return merge->priv->record_list;
        } else {
                return NULL;
        }
@@ -801,7 +777,7 @@ gl_merge_get_record_count (glMerge *merge)
        gl_debug (DEBUG_MERGE, "START");
 
        count = 0;
-       for ( p=merge->private->record_list; p!=NULL; p=p->next ) {
+       for ( p=merge->priv->record_list; p!=NULL; p=p->next ) {
                record = (glMergeRecord *)p->data;
 
                if ( record->select_flag ) count ++;
index f69922dca528105e3af0cb0f03086dee78b51a42..819ca25b9ee8055bf9c09d47439ef56a374e7669 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -59,7 +61,7 @@ typedef struct _glMergePrivate   glMergePrivate;
 struct _glMerge {
        GObject          object;
 
-       glMergePrivate  *private;
+       glMergePrivate  *priv;
 };
 
 struct _glMergeClass {
index 84ecd24b5d8ca7ba9291d01a8aca6ceb7a1e7c40..05bd3235fbd284738bb493e5eaec2c9a0db63092 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 0864c8aab7dead3c454d59566a53347ef2215e2b..990cf2f463fb43043c77cc442dfab22e5c2ddab7 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -54,14 +54,10 @@ struct _glNewLabelDialogPrivate {
 /* Private globals                           */
 /*===========================================*/
 
-static GtkDialogClass* parent_class = NULL;
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void       gl_new_label_dialog_class_init      (glNewLabelDialogClass *klass);
-static void       gl_new_label_dialog_init            (glNewLabelDialog      *dlg);
 static void       gl_new_label_dialog_finalize        (GObject               *object);
 
 static void       gl_new_label_dialog_construct       (glNewLabelDialog      *dialog,
@@ -75,42 +71,16 @@ static void       template_changed_cb                 (glWdgtMediaSelect     *se
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_new_label_dialog_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glNewLabelDialogClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_new_label_dialog_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glNewLabelDialog),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_new_label_dialog_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_DIALOG,
-                                              "glNewLabelDialog", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_DIALOG);
 
 static void
-gl_new_label_dialog_class_init (glNewLabelDialogClass *klass)
+gl_new_label_dialog_class_init (glNewLabelDialogClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_FILE, "");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_new_label_dialog_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_new_label_dialog_finalize;          
 }
@@ -151,20 +121,17 @@ gl_new_label_dialog_init (glNewLabelDialog *dialog)
 static void 
 gl_new_label_dialog_finalize (GObject *object)
 {
-       glNewLabelDialog* dialog;
+       glNewLabelDialog* dialog = GL_NEW_LABEL_DIALOG (object);;
        
        gl_debug (DEBUG_FILE, "START");
 
        g_return_if_fail (object != NULL);
-       
-       dialog = GL_NEW_LABEL_DIALOG (object);
-
        g_return_if_fail (GL_IS_NEW_LABEL_DIALOG (dialog));
        g_return_if_fail (dialog->priv != NULL);
 
        g_free (dialog->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_new_label_dialog_parent_class)->finalize (object);
 
        gl_debug (DEBUG_FILE, "END");
 
index 291c39712523d692eeeb3b20614fab619d0fa8f1..a38a48d9533a2fb5f29ff8482722c16b9c3d7ff1 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index b5b57fc7275c1569412de6ccac7a4626841e4459..f2863c87edce48c452f0c61c6e6607fea448352a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 0cc629164f73c14c81857e5c0b81882d565db681..77380c36592bc912b3642deb4f9f5268a1498eb9 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index ba9c584bc0c3021a14f7500efa3ac71c5fbf4412..9ff2bc867e03a57b3f6afaeb5a845fef87d2da5e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 52a38b647ec334d9c5b86ced7a49ef8cc995608f..b8fd91efeabbbaeff4ea85b1ce368ddace2c3423 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index b8d13ed0767ca055381624eade0a9ef621c6f933..989fa24da109c1db78ee44c4fde6c485a99caf26 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index e1aa2831f3cd7cb66598ed02b4e7729f3baf67aa..fd4c17d15026388c49a0c21562488a47f59ca3e0 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index fb3861fd915e1ae36b5795f8cf366625fd2accc2..4a3dd0d39cabffe0232e4582138f820537ad7be6 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 96b061dfe91f856d2f3dfe0a767db5376f2f8435..3f8a2da4a5bd693c8780f8def345d186a8d341ac 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index a927bc2c68ddbd9bf65424b57b9222b49711daaf..212440450c1295fb2a5425f065cb85ea76362e5f 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index c250e73e3562dc1894be8fe6a6ed421e7cab6aaf..cdf83e3995ebbd2c50572ae56598f090ba59c8cd 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index be4e231e3dfd925113e149d03c939af00f956fbf..58cf4c570bffadfb9f547a7796158550a2cdd6d1 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 9507ccbb35bd26991cded580583b4d876c98bccc..48c2356640f60c81c55693e2ac35210ddb6dc657 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /**
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -60,14 +60,10 @@ typedef void (*ChangedSignal) (GObject * object, gpointer data);
 
 gint gl_object_editor_signals[LAST_SIGNAL] = { 0 };
 
-static GtkVBoxClass *parent_class = NULL;
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_object_editor_class_init         (glObjectEditorClass  *klass);
-static void gl_object_editor_init               (glObjectEditor       *editor);
 static void gl_object_editor_finalize           (GObject              *object);
 
 static void gl_object_notebook_construct_valist (glObjectEditor       *editor,
@@ -80,42 +76,16 @@ static void prefs_changed_cb                    (glObjectEditor       *editor);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_object_editor_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glObjectEditorClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_object_editor_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glObjectEditor),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_object_editor_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_VBOX,
-                                              "glObjectEditor", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glObjectEditor, gl_object_editor, GTK_TYPE_VBOX);
 
 static void
-gl_object_editor_class_init (glObjectEditorClass *klass)
+gl_object_editor_class_init (glObjectEditorClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_EDITOR, "START");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_object_editor_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_object_editor_finalize;     
 
@@ -181,27 +151,23 @@ gl_object_editor_init (glObjectEditor *editor)
 static void 
 gl_object_editor_finalize (GObject *object)
 {
-       glObjectEditor* editor;
+       glObjectEditor* editor = GL_OBJECT_EDITOR (object);;
        
        gl_debug (DEBUG_EDITOR, "START");
        
        g_return_if_fail (object != NULL);
-       
-       editor = GL_OBJECT_EDITOR (object);
-
        g_return_if_fail (GL_IS_OBJECT_EDITOR (editor));
        g_return_if_fail (editor->priv != NULL);
 
        if (editor->priv->gui) {
                g_object_unref (G_OBJECT (editor->priv->gui));
        }
-
        g_free (editor->priv);
 
        g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs),
                                              prefs_changed_cb, editor);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_object_editor_parent_class)->finalize (object);
 
        gl_debug (DEBUG_EDITOR, "END");
 }
index 41424a7b10f0e6218b15505dce0ed2451c52edc3..2f229bb76956b9cd6c7043b166a7949741e6aa8a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 4fc01ad187c758aeef428d0d45a2188879662a39..1641111dec51895335bbe19618c49dae43c4b53c 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 51d0550e695c0e535d513d73c43b1258186e6c9c..5fe8a80c7febec8a3dd4b4ffd1c78f77ccb063d2 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index d97516bc0a15942af98b708fae3a687e97b8cd74..8c19a47677666926bf9ef831431279810edbc636 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -87,105 +87,76 @@ struct _glPrefsDialogPrivate
 /* Private globals.                                       */
 /*========================================================*/
 
-static GtkDialogClass* parent_class = NULL;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_prefs_dialog_class_init           (glPrefsDialogClass *klass);
-static void gl_prefs_dialog_init                 (glPrefsDialog      *dlg);
 static void gl_prefs_dialog_finalize             (GObject            *object);
-static void gl_prefs_dialog_construct     (glPrefsDialog      *dlg);
+static void gl_prefs_dialog_construct     (glPrefsDialog      *dialog);
 
 static void response_cb                   (glPrefsDialog      *dialog,
                                           gint                response,
                                           gpointer            user_data);
 
-static void construct_locale_page         (glPrefsDialog      *dlg);
-static void construct_object_page         (glPrefsDialog      *dlg);
+static void construct_locale_page         (glPrefsDialog      *dialog);
+static void construct_object_page         (glPrefsDialog      *dialog);
 
 static void align_toggle_cb               (GtkToggleButton    *toggle,
-                                          glPrefsDialog      *dlg);
+                                          glPrefsDialog      *dialog);
                                                                                 
-static void update_locale_page_from_prefs (glPrefsDialog      *dlg);
-static void update_object_page_from_prefs (glPrefsDialog      *dlg);
+static void update_locale_page_from_prefs (glPrefsDialog      *dialog);
+static void update_object_page_from_prefs (glPrefsDialog      *dialog);
 
-static void update_prefs_from_locale_page (glPrefsDialog      *dlg);
-static void update_prefs_from_object_page (glPrefsDialog      *dlg);
+static void update_prefs_from_locale_page (glPrefsDialog      *dialog);
+static void update_prefs_from_object_page (glPrefsDialog      *dialog);
 
 \f
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_prefs_dialog_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glPrefsDialogClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_prefs_dialog_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glPrefsDialog),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_prefs_dialog_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_DIALOG,
-                                              "glPrefsDialog", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glPrefsDialog, gl_prefs_dialog, GTK_TYPE_DIALOG);
 
 static void
-gl_prefs_dialog_class_init (glPrefsDialogClass *klass)
+gl_prefs_dialog_class_init (glPrefsDialogClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_PREFS, "");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_prefs_dialog_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_prefs_dialog_finalize;      
 }
 
 static void
-gl_prefs_dialog_init (glPrefsDialog *dlg)
+gl_prefs_dialog_init (glPrefsDialog *dialog)
 {
        gl_debug (DEBUG_PREFS, "START");
 
-       dlg->priv = g_new0 (glPrefsDialogPrivate, 1);
+       dialog->priv = g_new0 (glPrefsDialogPrivate, 1);
 
-       dlg->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "prefs-dialog.glade",
+       dialog->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "prefs-dialog.glade",
                                        "prefs_notebook",
                                        NULL);
 
-       if (!dlg->priv->gui) {
+       if (!dialog->priv->gui) {
                g_critical ("Could not open prefs-dialog.glade. gLabels may not be installed correctly!");
                return;
        }
 
-       gtk_container_set_border_width (GTK_CONTAINER(dlg), GL_HIG_PAD2);
+       gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2);
 
-       gtk_dialog_set_has_separator (GTK_DIALOG(dlg), FALSE);
-       gtk_dialog_add_button (GTK_DIALOG(dlg), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
-       gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CLOSE);
+       gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+       gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+       gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
 
-       g_signal_connect(G_OBJECT (dlg), "response",
+       g_signal_connect(G_OBJECT (dialog), "response",
                         G_CALLBACK (response_cb), NULL);
 
-        gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
-        gtk_window_set_title (GTK_WINDOW (dlg), _("gLabels Preferences"));
-        gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
+        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+        gtk_window_set_title (GTK_WINDOW (dialog), _("gLabels Preferences"));
+        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 
        gl_debug (DEBUG_PREFS, "END");
 }
@@ -193,20 +164,17 @@ gl_prefs_dialog_init (glPrefsDialog *dlg)
 static void 
 gl_prefs_dialog_finalize (GObject *object)
 {
-       glPrefsDialog* dlg;
+       glPrefsDialog* dialog = GL_PREFS_DIALOG (object);
        
        gl_debug (DEBUG_PREFS, "START");
 
        g_return_if_fail (object != NULL);
-       
-       dlg = GL_PREFS_DIALOG (object);
-
-       g_return_if_fail (GL_IS_PREFS_DIALOG (dlg));
-       g_return_if_fail (dlg->priv != NULL);
+       g_return_if_fail (GL_IS_PREFS_DIALOG (dialog));
+       g_return_if_fail (dialog->priv != NULL);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       g_free (dialog->priv);
 
-       g_free (dlg->priv);
+       G_OBJECT_CLASS (gl_prefs_dialog_parent_class)->finalize (object);
 
        gl_debug (DEBUG_PREFS, "END");
 }
@@ -217,63 +185,63 @@ gl_prefs_dialog_finalize (GObject *object)
 GtkWidget*
 gl_prefs_dialog_new (GtkWindow *parent)
 {
-       GtkWidget *dlg;
+       GtkWidget *dialog;
 
        gl_debug (DEBUG_PREFS, "START");
        gl_debug (DEBUG_PREFS, "page size = \"%s\"", gl_prefs->default_page_size);
 
-       dlg = GTK_WIDGET (g_object_new (GL_TYPE_PREFS_DIALOG, NULL));
+       dialog = GTK_WIDGET (g_object_new (GL_TYPE_PREFS_DIALOG, NULL));
 
        if (parent)
-               gtk_window_set_transient_for (GTK_WINDOW (dlg), parent);
+               gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
        
-       gl_prefs_dialog_construct (GL_PREFS_DIALOG(dlg));
+       gl_prefs_dialog_construct (GL_PREFS_DIALOG(dialog));
 
 
        gl_debug (DEBUG_PREFS, "END");
 
-       return dlg;
+       return dialog;
 }
 
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  Construct composite widget.                                     */
 /*---------------------------------------------------------------------------*/
 static void
-gl_prefs_dialog_construct (glPrefsDialog *dlg)
+gl_prefs_dialog_construct (glPrefsDialog *dialog)
 {
        GtkWidget *notebook;
 
-       g_return_if_fail (GL_IS_PREFS_DIALOG (dlg));
-       g_return_if_fail (dlg->priv != NULL);
+       g_return_if_fail (GL_IS_PREFS_DIALOG (dialog));
+       g_return_if_fail (dialog->priv != NULL);
 
-       notebook = glade_xml_get_widget (dlg->priv->gui, "prefs_notebook");
-       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), notebook, FALSE, FALSE, 0);
+       notebook = glade_xml_get_widget (dialog->priv->gui, "prefs_notebook");
+       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, FALSE, FALSE, 0);
 
-       construct_locale_page (dlg);
-       construct_object_page (dlg);
+       construct_locale_page (dialog);
+       construct_object_page (dialog);
 
-       update_locale_page_from_prefs (dlg);
-       update_object_page_from_prefs (dlg);
+       update_locale_page_from_prefs (dialog);
+       update_object_page_from_prefs (dialog);
 
-        gtk_widget_show_all (GTK_DIALOG (dlg)->vbox);   
+        gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);   
 }
 
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  "Response" callback.                                            */
 /*---------------------------------------------------------------------------*/
 static void
-response_cb (glPrefsDialog *dlg,
+response_cb (glPrefsDialog *dialog,
             gint          response,
             gpointer      user_data)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       g_return_if_fail(dlg != NULL);
-       g_return_if_fail(GTK_IS_DIALOG(dlg));
+       g_return_if_fail(dialog != NULL);
+       g_return_if_fail(GTK_IS_DIALOG(dialog));
 
        switch(response) {
        case GTK_RESPONSE_CLOSE:
-               gtk_widget_hide (GTK_WIDGET(dlg));
+               gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
                break;
@@ -289,137 +257,137 @@ response_cb (glPrefsDialog *dlg,
 /* PRIVATE.  Build Locale Properties Notebook Tab                           */
 /*--------------------------------------------------------------------------*/
 static void
-construct_locale_page (glPrefsDialog *dlg)
+construct_locale_page (glPrefsDialog *dialog)
 {
 
-       dlg->priv->units_points_radio =
-               glade_xml_get_widget (dlg->priv->gui, "units_points_radio");
+       dialog->priv->units_points_radio =
+               glade_xml_get_widget (dialog->priv->gui, "units_points_radio");
 
-       dlg->priv->units_inches_radio =
-               glade_xml_get_widget (dlg->priv->gui, "units_inches_radio");
+       dialog->priv->units_inches_radio =
+               glade_xml_get_widget (dialog->priv->gui, "units_inches_radio");
 
-       dlg->priv->units_mm_radio =
-               glade_xml_get_widget (dlg->priv->gui, "units_mm_radio");
+       dialog->priv->units_mm_radio =
+               glade_xml_get_widget (dialog->priv->gui, "units_mm_radio");
 
-       dlg->priv->page_size_us_letter_radio =
-               glade_xml_get_widget (dlg->priv->gui, "page_size_us_letter_radio");
+       dialog->priv->page_size_us_letter_radio =
+               glade_xml_get_widget (dialog->priv->gui, "page_size_us_letter_radio");
 
-       dlg->priv->page_size_a4_radio =
-               glade_xml_get_widget (dlg->priv->gui, "page_size_a4_radio");
+       dialog->priv->page_size_a4_radio =
+               glade_xml_get_widget (dialog->priv->gui, "page_size_a4_radio");
 
        g_signal_connect_swapped (
-               G_OBJECT(dlg->priv->units_points_radio),
-               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_points_radio),
+               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_connect_swapped (
-               G_OBJECT(dlg->priv->units_inches_radio),
-               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_inches_radio),
+               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_connect_swapped (
-               G_OBJECT(dlg->priv->units_mm_radio),
-               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_mm_radio),
+               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_connect_swapped (
-               G_OBJECT(dlg->priv->page_size_us_letter_radio),
-               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_us_letter_radio),
+               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_connect_swapped (
-               G_OBJECT(dlg->priv->page_size_a4_radio),
-               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_a4_radio),
+               "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
 }
 
 /*--------------------------------------------------------------------------*/
 /* PRIVATE.  Build Default Object Properties Notebook Tab                   */
 /*--------------------------------------------------------------------------*/
 static void
-construct_object_page (glPrefsDialog *dlg)
+construct_object_page (glPrefsDialog *dialog)
 {
         GList    *family_names;
 
-       dlg->priv->text_family_combo =
-               glade_xml_get_widget (dlg->priv->gui, "text_family_combo");
-       dlg->priv->text_size_spin =
-               glade_xml_get_widget (dlg->priv->gui, "text_size_spin");
-       dlg->priv->text_bold_toggle =
-               glade_xml_get_widget (dlg->priv->gui, "text_bold_toggle");
-       dlg->priv->text_italic_toggle =
-               glade_xml_get_widget (dlg->priv->gui, "text_italic_toggle");
-       dlg->priv->text_color_combo =
-               glade_xml_get_widget (dlg->priv->gui, "text_color_combo");
-       dlg->priv->text_left_toggle =
-               glade_xml_get_widget (dlg->priv->gui, "text_left_toggle");
-       dlg->priv->text_center_toggle =
-               glade_xml_get_widget (dlg->priv->gui, "text_center_toggle");
-       dlg->priv->text_right_toggle =
-               glade_xml_get_widget (dlg->priv->gui, "text_right_toggle");
-       dlg->priv->text_line_spacing_spin =
-               glade_xml_get_widget (dlg->priv->gui, "text_line_spacing_spin");
-
-       dlg->priv->line_width_spin =
-               glade_xml_get_widget (dlg->priv->gui, "line_width_spin");
-       dlg->priv->line_color_combo =
-               glade_xml_get_widget (dlg->priv->gui, "line_color_combo");
-
-       dlg->priv->fill_color_combo =
-               glade_xml_get_widget (dlg->priv->gui, "fill_color_combo");
-
-       gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dlg->priv->text_family_combo));
+       dialog->priv->text_family_combo =
+               glade_xml_get_widget (dialog->priv->gui, "text_family_combo");
+       dialog->priv->text_size_spin =
+               glade_xml_get_widget (dialog->priv->gui, "text_size_spin");
+       dialog->priv->text_bold_toggle =
+               glade_xml_get_widget (dialog->priv->gui, "text_bold_toggle");
+       dialog->priv->text_italic_toggle =
+               glade_xml_get_widget (dialog->priv->gui, "text_italic_toggle");
+       dialog->priv->text_color_combo =
+               glade_xml_get_widget (dialog->priv->gui, "text_color_combo");
+       dialog->priv->text_left_toggle =
+               glade_xml_get_widget (dialog->priv->gui, "text_left_toggle");
+       dialog->priv->text_center_toggle =
+               glade_xml_get_widget (dialog->priv->gui, "text_center_toggle");
+       dialog->priv->text_right_toggle =
+               glade_xml_get_widget (dialog->priv->gui, "text_right_toggle");
+       dialog->priv->text_line_spacing_spin =
+               glade_xml_get_widget (dialog->priv->gui, "text_line_spacing_spin");
+
+       dialog->priv->line_width_spin =
+               glade_xml_get_widget (dialog->priv->gui, "line_width_spin");
+       dialog->priv->line_color_combo =
+               glade_xml_get_widget (dialog->priv->gui, "line_color_combo");
+
+       dialog->priv->fill_color_combo =
+               glade_xml_get_widget (dialog->priv->gui, "fill_color_combo");
+
+       gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->text_family_combo));
 
         /* Load family names */
         family_names = gl_util_get_font_family_list ();
-       gl_util_combo_box_set_strings (GTK_COMBO_BOX (dlg->priv->text_family_combo),
+       gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->text_family_combo),
                                       family_names);
         gl_util_font_family_list_free (family_names);
                                                                                 
 
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_family_combo),
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_family_combo),
                                  "changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_size_spin),
+                                 G_OBJECT(dialog));
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_size_spin),
                                  "changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_bold_toggle),
+                                 G_OBJECT(dialog));
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_bold_toggle),
                                  "toggled",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_italic_toggle),
+                                 G_OBJECT(dialog));
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_italic_toggle),
                                  "toggled",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_color_combo),
+                                 G_OBJECT(dialog));
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_color_combo),
                                  "color_changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
+                                 G_OBJECT(dialog));
 
-       g_signal_connect (G_OBJECT(dlg->priv->text_left_toggle),
+       g_signal_connect (G_OBJECT(dialog->priv->text_left_toggle),
                          "toggled",
                          G_CALLBACK(align_toggle_cb),
-                         G_OBJECT(dlg));
-       g_signal_connect (G_OBJECT(dlg->priv->text_center_toggle),
+                         G_OBJECT(dialog));
+       g_signal_connect (G_OBJECT(dialog->priv->text_center_toggle),
                          "toggled",
                          G_CALLBACK(align_toggle_cb),
-                         G_OBJECT(dlg));
-       g_signal_connect (G_OBJECT(dlg->priv->text_right_toggle),
+                         G_OBJECT(dialog));
+       g_signal_connect (G_OBJECT(dialog->priv->text_right_toggle),
                          "toggled",
                          G_CALLBACK(align_toggle_cb),
-                         G_OBJECT(dlg));
+                         G_OBJECT(dialog));
 
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->text_line_spacing_spin),
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->text_line_spacing_spin),
                                  "changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
+                                 G_OBJECT(dialog));
 
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->line_width_spin),
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->line_width_spin),
                                  "changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->line_color_combo),
+                                 G_OBJECT(dialog));
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->line_color_combo),
                                  "color_changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
+                                 G_OBJECT(dialog));
 
-       g_signal_connect_swapped (G_OBJECT(dlg->priv->fill_color_combo),
+       g_signal_connect_swapped (G_OBJECT(dialog->priv->fill_color_combo),
                                  "color_changed",
                                  G_CALLBACK(update_prefs_from_object_page),
-                                 G_OBJECT(dlg));
+                                 G_OBJECT(dialog));
 }
 
 
@@ -428,36 +396,36 @@ construct_object_page (glPrefsDialog *dlg)
 /*--------------------------------------------------------------------------*/
 static void
 align_toggle_cb (GtkToggleButton *toggle,
-                 glPrefsDialog   *dlg)
+                 glPrefsDialog   *dialog)
 {
         if (gtk_toggle_button_get_active (toggle)) {
   
-                if (GTK_WIDGET (toggle) == GTK_WIDGET (dlg->priv->text_left_toggle)) {
+                if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_left_toggle)) {
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_center_toggle),
+                                                      (dialog->priv->text_center_toggle),
                                                       FALSE);
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_right_toggle),
+                                                      (dialog->priv->text_right_toggle),
                                                       FALSE);
                 } else if (GTK_WIDGET (toggle) ==
-                           GTK_WIDGET (dlg->priv->text_center_toggle)) {
+                           GTK_WIDGET (dialog->priv->text_center_toggle)) {
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_left_toggle),
+                                                      (dialog->priv->text_left_toggle),
                                                       FALSE);
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_right_toggle),
+                                                      (dialog->priv->text_right_toggle),
                                                       FALSE);
                 } else if (GTK_WIDGET (toggle) ==
-                           GTK_WIDGET (dlg->priv->text_right_toggle)) {
+                           GTK_WIDGET (dialog->priv->text_right_toggle)) {
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_left_toggle),
+                                                      (dialog->priv->text_left_toggle),
                                                       FALSE);
                         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                      (dlg->priv->text_center_toggle),
+                                                      (dialog->priv->text_center_toggle),
                                                       FALSE);
                 }
                                                                                 
-               update_prefs_from_object_page (dlg);
+               update_prefs_from_object_page (dialog);
         }
                                                                                 
 }
@@ -467,38 +435,38 @@ align_toggle_cb (GtkToggleButton *toggle,
 /* PRIVATE.  Update locale page widgets from current prefs.                 */
 /*--------------------------------------------------------------------------*/
 static void
-update_locale_page_from_prefs (glPrefsDialog *dlg)
+update_locale_page_from_prefs (glPrefsDialog *dialog)
 {
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->units_points_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_points_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->units_inches_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_inches_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->units_mm_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_mm_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->page_size_us_letter_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_us_letter_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->page_size_a4_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_a4_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
 
        switch (gl_prefs->units) {
        case GL_UNITS_POINT:
                gtk_toggle_button_set_active (
-                       GTK_TOGGLE_BUTTON(dlg->priv->units_points_radio),
+                       GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio),
                        TRUE);
                break;
        case GL_UNITS_INCH:
                gtk_toggle_button_set_active (
-                       GTK_TOGGLE_BUTTON(dlg->priv->units_inches_radio),
+                       GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio),
                        TRUE);
                break;
        case GL_UNITS_MM:
                gtk_toggle_button_set_active (
-                       GTK_TOGGLE_BUTTON(dlg->priv->units_mm_radio),
+                       GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio),
                        TRUE);
                break;
        default:
@@ -508,79 +476,79 @@ update_locale_page_from_prefs (glPrefsDialog *dlg)
 
        if ( g_strcasecmp(gl_prefs->default_page_size, US_LETTER_ID) == 0) {
                gtk_toggle_button_set_active (
-                       GTK_TOGGLE_BUTTON(dlg->priv->page_size_us_letter_radio),
+                       GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio),
                        TRUE);
        } else if ( g_strcasecmp(gl_prefs->default_page_size, A4_ID) == 0) {
                gtk_toggle_button_set_active (
-                       GTK_TOGGLE_BUTTON(dlg->priv->page_size_a4_radio),
+                       GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio),
                        TRUE);
        } else {
                g_message ("Unknown default page size"); /* Shouldn't happen */
        }
 
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->units_points_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_points_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->units_inches_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_inches_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->units_mm_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->units_mm_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->page_size_us_letter_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_us_letter_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->page_size_a4_radio),
-               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->page_size_a4_radio),
+               G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog));
 }
 
 /*--------------------------------------------------------------------------*/
 /* PRIVATE.  Update object page widgets from current prefs.                 */
 /*--------------------------------------------------------------------------*/
 static void
-update_object_page_from_prefs (glPrefsDialog *dlg)
+update_object_page_from_prefs (glPrefsDialog *dialog)
 {
         GList    *family_names;
         gchar    *good_font_family;
        GdkColor *gdk_color;
  
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_family_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_family_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_size_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_size_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_bold_toggle),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_bold_toggle),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_italic_toggle),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_italic_toggle),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_left_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_left_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_center_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_center_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_right_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_right_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->text_line_spacing_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_line_spacing_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->line_width_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->line_width_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->line_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->line_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_block_by_func (
-               G_OBJECT(dlg->priv->fill_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->fill_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
 
 
         /* Make sure we have a valid font family.  if not provide a good default. */
@@ -597,109 +565,109 @@ update_object_page_from_prefs (glPrefsDialog *dlg)
                 }
         }
         gl_util_font_family_list_free (family_names);
-       gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dlg->priv->text_family_combo),
+       gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo),
                                           good_font_family);
         g_free (good_font_family);
 
-        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->text_size_spin),
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_size_spin),
                                    gl_prefs->default_font_size);
  
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->text_bold_toggle),
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle),
                                       (gl_prefs->default_font_weight == PANGO_WEIGHT_BOLD));
  
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->text_italic_toggle),
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_italic_toggle),
                                       gl_prefs->default_font_italic_flag);
  
         gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color);
-        color_combo_set_color (COLOR_COMBO(dlg->priv->text_color_combo), gdk_color);
+        color_combo_set_color (COLOR_COMBO(dialog->priv->text_color_combo), gdk_color);
         g_free (gdk_color);
 
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->text_left_toggle),
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle),
                                  (gl_prefs->default_text_alignment == GTK_JUSTIFY_LEFT));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->text_center_toggle),
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle),
                                  (gl_prefs->default_text_alignment == GTK_JUSTIFY_CENTER));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->text_right_toggle),
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle),
                                  (gl_prefs->default_text_alignment == GTK_JUSTIFY_RIGHT));
 
-        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->text_line_spacing_spin),
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_line_spacing_spin),
                                    gl_prefs->default_text_line_spacing);
 
-        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->line_width_spin),
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->line_width_spin),
                                    gl_prefs->default_line_width);
  
        gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color);
-        color_combo_set_color (COLOR_COMBO(dlg->priv->line_color_combo), gdk_color);
+        color_combo_set_color (COLOR_COMBO(dialog->priv->line_color_combo), gdk_color);
         g_free (gdk_color);
 
 
        gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color);
-        color_combo_set_color (COLOR_COMBO(dlg->priv->fill_color_combo), gdk_color);
+        color_combo_set_color (COLOR_COMBO(dialog->priv->fill_color_combo), gdk_color);
         g_free (gdk_color);
 
 
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_family_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_family_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_size_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_size_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_bold_toggle),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_bold_toggle),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_italic_toggle),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_italic_toggle),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_left_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_left_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_center_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_center_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_right_toggle),
-               G_CALLBACK(align_toggle_cb), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_right_toggle),
+               G_CALLBACK(align_toggle_cb), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->text_line_spacing_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->text_line_spacing_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->line_width_spin),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->line_width_spin),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->line_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->line_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
        g_signal_handlers_unblock_by_func (
-               G_OBJECT(dlg->priv->fill_color_combo),
-               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dlg));
+               G_OBJECT(dialog->priv->fill_color_combo),
+               G_CALLBACK(update_prefs_from_object_page), G_OBJECT(dialog));
 }
 
 /*--------------------------------------------------------------------------*/
 /* PRIVATE.  Update prefs from current state of locale page widgets.        */
 /*--------------------------------------------------------------------------*/
 static void
-update_prefs_from_locale_page (glPrefsDialog *dlg)
+update_prefs_from_locale_page (glPrefsDialog *dialog)
 {
        if (gtk_toggle_button_get_active (
-                   GTK_TOGGLE_BUTTON(dlg->priv->units_points_radio))) {
+                   GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio))) {
                gl_prefs->units = GL_UNITS_POINT;
        }
        if (gtk_toggle_button_get_active (
-                   GTK_TOGGLE_BUTTON(dlg->priv->units_inches_radio))) {
+                   GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio))) {
                gl_prefs->units = GL_UNITS_INCH;
        }
        if (gtk_toggle_button_get_active (
-                   GTK_TOGGLE_BUTTON(dlg->priv->units_mm_radio))) {
+                   GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio))) {
                gl_prefs->units = GL_UNITS_MM;
        }
 
        if (gtk_toggle_button_get_active (
-                   GTK_TOGGLE_BUTTON(dlg->priv->page_size_us_letter_radio))) {
+                   GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio))) {
                gl_prefs->default_page_size = US_LETTER_ID;
        }
        if (gtk_toggle_button_get_active (
-                   GTK_TOGGLE_BUTTON(dlg->priv->page_size_a4_radio))) {
+                   GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio))) {
                gl_prefs->default_page_size = A4_ID;
        }
 
@@ -710,7 +678,7 @@ update_prefs_from_locale_page (glPrefsDialog *dlg)
 /* PRIVATE.  Update prefs from current state of object page widgets.        */
 /*--------------------------------------------------------------------------*/
 static void
-update_prefs_from_object_page (glPrefsDialog *dlg)
+update_prefs_from_object_page (glPrefsDialog *dialog)
 {
        GdkColor *gdk_color;
        gboolean  is_default;
@@ -718,12 +686,12 @@ update_prefs_from_object_page (glPrefsDialog *dlg)
 
         g_free (gl_prefs->default_font_family);
         gl_prefs->default_font_family =
-               gtk_combo_box_get_active_text (GTK_COMBO_BOX (dlg->priv->text_family_combo));
+               gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo));
         gl_prefs->default_font_size =
-                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->text_size_spin));
+                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_size_spin));
 
         if (gtk_toggle_button_get_active
-            (GTK_TOGGLE_BUTTON (dlg->priv->text_bold_toggle))) {
+            (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle))) {
                 gl_prefs->default_font_weight = PANGO_WEIGHT_BOLD;
         } else {
                 gl_prefs->default_font_weight = PANGO_WEIGHT_NORMAL;
@@ -731,24 +699,24 @@ update_prefs_from_object_page (glPrefsDialog *dlg)
 
         gl_prefs->default_font_italic_flag =
                 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON
-                                              (dlg->priv->text_italic_toggle));
+                                              (dialog->priv->text_italic_toggle));
 
-        gdk_color = color_combo_get_color (COLOR_COMBO(dlg->priv->text_color_combo),
+        gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->text_color_combo),
                                            &is_default);
         if (!is_default) {
                 gl_prefs->default_text_color = gl_color_from_gdk_color (gdk_color);
         }
 
         if (gtk_toggle_button_get_active
-            (GTK_TOGGLE_BUTTON (dlg->priv->text_left_toggle))) {
+            (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle))) {
                 gl_prefs->default_text_alignment = GTK_JUSTIFY_LEFT;
         } else
             if (gtk_toggle_button_get_active
-                (GTK_TOGGLE_BUTTON (dlg->priv->text_right_toggle))) {
+                (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle))) {
                 gl_prefs->default_text_alignment = GTK_JUSTIFY_RIGHT;
         } else
             if (gtk_toggle_button_get_active
-                (GTK_TOGGLE_BUTTON (dlg->priv->text_center_toggle))) {
+                (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle))) {
                 gl_prefs->default_text_alignment = GTK_JUSTIFY_CENTER;
         } else {
                /* Should not happen. */
@@ -757,19 +725,19 @@ update_prefs_from_object_page (glPrefsDialog *dlg)
                                                                                 
 
         gl_prefs->default_text_line_spacing =
-                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->text_line_spacing_spin));
+                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_line_spacing_spin));
 
         gl_prefs->default_line_width =
-                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->line_width_spin));
+                gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->line_width_spin));
 
-        gdk_color = color_combo_get_color (COLOR_COMBO(dlg->priv->line_color_combo),
+        gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->line_color_combo),
                                            &is_default);
         if (!is_default) {
                 gl_prefs->default_line_color = gl_color_from_gdk_color (gdk_color);
         }
 
 
-        gdk_color = color_combo_get_color (COLOR_COMBO(dlg->priv->fill_color_combo),
+        gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->fill_color_combo),
                                            &is_default);
         if (!is_default) {
                 gl_prefs->default_fill_color = gl_color_from_gdk_color (gdk_color);
index 45fcc761e6ad3138aed7fad0c96e53179761147c..8ec8e9291a0605756f1addf3ceddf35a8cdb934e 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index abe34b2bd4afa4d1d70ae03605ea9bfc71d7c63f..ee435004c72ec57ec24b483c45ac11778871c403 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -101,16 +103,12 @@ enum {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 static guint signals[LAST_SIGNAL] = {0};
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void           gl_prefs_model_class_init    (glPrefsModelClass   *klass);
-static void           gl_prefs_model_instance_init (glPrefsModel        *object);
 static void           gl_prefs_model_finalize      (GObject             *object);
 
 static void           notify_cb                    (GConfClient         *client,
@@ -142,40 +140,16 @@ static const gchar   *units_to_string              (glUnitsType          units);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_prefs_model_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glPrefsModelClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_prefs_model_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glPrefsModel),
-                       0,
-                       (GInstanceInitFunc) gl_prefs_model_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glPrefsModel", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT);
 
 static void
-gl_prefs_model_class_init (glPrefsModelClass *klass)
+gl_prefs_model_class_init (glPrefsModelClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_PREFS, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_prefs_model_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_prefs_model_finalize;
 
@@ -193,7 +167,7 @@ gl_prefs_model_class_init (glPrefsModelClass *klass)
 }
 
 static void
-gl_prefs_model_instance_init (glPrefsModel *prefs_model)
+gl_prefs_model_init (glPrefsModel *prefs_model)
 {
        gl_debug (DEBUG_PREFS, "START");
 
@@ -217,16 +191,17 @@ gl_prefs_model_instance_init (glPrefsModel *prefs_model)
 static void
 gl_prefs_model_finalize (GObject *object)
 {
+       glPrefsModel *prefs_model = GL_PREFS_MODEL (object);
+
        gl_debug (DEBUG_PREFS, "START");
 
        g_return_if_fail (object && GL_IS_PREFS_MODEL (object));
 
-       g_object_unref (G_OBJECT(GL_PREFS_MODEL(object)->gconf_client));
-
-       g_free (GL_PREFS_MODEL(object)->default_page_size);
-       g_free (GL_PREFS_MODEL(object)->default_font_family);
+       g_object_unref (G_OBJECT(prefs_model->gconf_client));
+       g_free (prefs_model->default_page_size);
+       g_free (prefs_model->default_font_family);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_prefs_model_parent_class)->finalize (object);
 
        gl_debug (DEBUG_PREFS, "END");
 }
index e85b058fa727a0b7244bb411db9fb8e73ea6d4d8..5d6f5654b02f7d1cec4232618acf112c53a8ec7a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index d8141843c5a8277482cec24d268403fc6f42f9eb..23636c89516d758fa1d90a523db9303018d71d57 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index b406f29d6094c2d7e6033ebbfe2b047bcc37d7bb..ce08f137b62cb193b0ae9c30923006ba495b68da 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index fbbade5efd82aa52d389ea884ff0fad64d9225de..d6a30831928ef96052a5cc5210b19d40ab8bb55b 100644 (file)
@@ -85,14 +85,10 @@ struct _glPrintOpPrivate {
 /* Private globals                           */
 /*===========================================*/
 
-static GtkPrintOperationClass* parent_class = NULL;
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void     gl_print_op_class_init    (glPrintOpClass     *klass);
-static void     gl_print_op_init          (glPrintOp          *op);
 static void     gl_print_op_finalize      (GObject            *object);
 
 static void     gl_print_op_construct       (glPrintOp          *op,
@@ -131,43 +127,17 @@ static void     draw_page_cb                  (GtkPrintOperation *operation,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_print_op_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glPrintOpClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_print_op_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glPrintOp),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_print_op_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_PRINT_OPERATION,
-                                              "glPrintOp", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION);
 
 static void
-gl_print_op_class_init (glPrintOpClass *klass)
+gl_print_op_class_init (glPrintOpClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
-       GtkPrintOperationClass *print_class = GTK_PRINT_OPERATION_CLASS (klass);
+       GObjectClass           *object_class = G_OBJECT_CLASS (class);
+       GtkPrintOperationClass *print_class  = GTK_PRINT_OPERATION_CLASS (class);
 
        gl_debug (DEBUG_PRINT, "");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_print_op_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_print_op_finalize;
 }
@@ -190,15 +160,12 @@ gl_print_op_init (glPrintOp *op)
 static void 
 gl_print_op_finalize (GObject *object)
 {
-       glPrintOp* op;
+       glPrintOp* op = GL_PRINT_OP (object);
        
        gl_debug (DEBUG_PRINT, "");
 
        g_return_if_fail (object != NULL);
-       
-       op = GL_PRINT_OP (object);
-
-       g_return_if_fail (GL_IS_PRINT_OP (op));
+        g_return_if_fail (GL_IS_PRINT_OP (op));
        g_return_if_fail (op->priv != NULL);
 
        if (op->priv->label) {
@@ -207,7 +174,7 @@ gl_print_op_finalize (GObject *object)
         g_free (op->priv->filename);
        g_free (op->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_print_op_parent_class)->finalize (object);
 
        g_free (op->priv);
 }
index 13f0440330a9bede15dedbb2aedd27768eb182a7..fe2af71fa483950e1d7c35bf8f32d66aad7eabda 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 70e2bd0a462ab9c56087092ad8ca516f07cd8fb6..14fb907a615704ec61b539595bbcf6c4ca6f7c1c 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 74f60f44e648df0a8b309de575ec07250517e527..e2b3c26269e8f2186ba7fa715b6c0a7bd5666880 100644 (file)
@@ -197,114 +197,85 @@ enum {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GtkAssistantClass* parent_class = NULL;
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void gl_template_designer_class_init      (glTemplateDesignerClass *klass);
-static void gl_template_designer_init            (glTemplateDesigner      *dlg);
 static void gl_template_designer_finalize        (GObject                 *object);
-static void gl_template_designer_construct        (glTemplateDesigner      *dlg);
+static void gl_template_designer_construct        (glTemplateDesigner      *dialog);
 
-static void     construct_start_page              (glTemplateDesigner      *dlg,
+static void     construct_start_page              (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_name_page               (glTemplateDesigner      *dlg,
+static void     construct_name_page               (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_pg_size_page            (glTemplateDesigner      *dlg,
+static void     construct_pg_size_page            (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_shape_page              (glTemplateDesigner      *dlg,
+static void     construct_shape_page              (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_rect_size_page          (glTemplateDesigner      *dlg,
+static void     construct_rect_size_page          (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_round_size_page         (glTemplateDesigner      *dlg,
+static void     construct_round_size_page         (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_cd_size_page            (glTemplateDesigner      *dlg,
+static void     construct_cd_size_page            (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_nlayouts_page           (glTemplateDesigner      *dlg,
+static void     construct_nlayouts_page           (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_layout_page             (glTemplateDesigner      *dlg,
+static void     construct_layout_page             (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     construct_finish_page             (glTemplateDesigner      *dlg,
+static void     construct_finish_page             (glTemplateDesigner      *dialog,
                                                   GdkPixbuf               *logo);
 
-static void     cancel_cb                         (glTemplateDesigner      *dlg);
-static void     apply_cb                          (glTemplateDesigner      *dlg);
-static void     close_cb                          (glTemplateDesigner      *dlg);
-static void     prepare_cb                        (glTemplateDesigner      *dlg,
+static void     cancel_cb                         (glTemplateDesigner      *dialog);
+static void     apply_cb                          (glTemplateDesigner      *dialog);
+static void     close_cb                          (glTemplateDesigner      *dialog);
+static void     prepare_cb                        (glTemplateDesigner      *dialog,
                                                    GtkWidget               *page);
 
 static gint     forward_page_function             (gint                     current_page,
                                                    gpointer                 data);
 
-static void     name_page_changed_cb              (glTemplateDesigner      *dlg);
+static void     name_page_changed_cb              (glTemplateDesigner      *dialog);
 
-static void     pg_size_page_changed_cb           (glTemplateDesigner      *dlg);
+static void     pg_size_page_changed_cb           (glTemplateDesigner      *dialog);
 
-static void     rect_size_page_prepare_cb         (glTemplateDesigner      *dlg);
+static void     rect_size_page_prepare_cb         (glTemplateDesigner      *dialog);
 
-static void     round_size_page_prepare_cb        (glTemplateDesigner      *dlg);
+static void     round_size_page_prepare_cb        (glTemplateDesigner      *dialog);
 
-static void     cd_size_page_prepare_cb           (glTemplateDesigner      *dlg);
+static void     cd_size_page_prepare_cb           (glTemplateDesigner      *dialog);
 
-static void     layout_page_prepare_cb            (glTemplateDesigner      *dlg);
+static void     layout_page_prepare_cb            (glTemplateDesigner      *dialog);
 
-static void     layout_page_changed_cb            (glTemplateDesigner      *dlg);
+static void     layout_page_changed_cb            (glTemplateDesigner      *dialog);
 
-static void     print_test_cb                     (glTemplateDesigner      *dlg);
+static void     print_test_cb                     (glTemplateDesigner      *dialog);
 
-static glTemplate *build_template                 (glTemplateDesigner      *dlg);
+static glTemplate *build_template                 (glTemplateDesigner      *dialog);
 
 \f
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_template_designer_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type)
-       {
-               static const GTypeInfo info =
-               {
-                       sizeof (glTemplateDesignerClass),
-                       NULL,           /* base_init */
-                       NULL,           /* base_finalize */
-                       (GClassInitFunc) gl_template_designer_class_init,
-                       NULL,           /* class_finalize */
-                       NULL,           /* class_data */
-                       sizeof (glTemplateDesigner),
-                       0,              /* n_preallocs */
-                       (GInstanceInitFunc) gl_template_designer_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_ASSISTANT,
-                                              "glTemplateDesigner", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glTemplateDesigner, gl_template_designer, GTK_TYPE_ASSISTANT);
 
 static void
-gl_template_designer_class_init (glTemplateDesignerClass *klass)
+gl_template_designer_class_init (glTemplateDesignerClass *class)
 {
-       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_TEMPLATE, "");
        
-       parent_class = g_type_class_peek_parent (klass);
+       gl_template_designer_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_template_designer_finalize;         
 }
@@ -324,21 +295,18 @@ gl_template_designer_init (glTemplateDesigner *dialog)
 static void 
 gl_template_designer_finalize (GObject *object)
 {
-       glTemplateDesigner* dialog;
+       glTemplateDesigner* dialog = GL_TEMPLATE_DESIGNER (object);
        
        gl_debug (DEBUG_TEMPLATE, "START");
 
        g_return_if_fail (object != NULL);
-       
-       dialog = GL_TEMPLATE_DESIGNER (object);
-
        g_return_if_fail (GL_IS_TEMPLATE_DESIGNER (dialog));
        g_return_if_fail (dialog->priv != NULL);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
-
        g_free (dialog->priv);
 
+       G_OBJECT_CLASS (gl_template_designer_parent_class)->finalize (object);
+
        gl_debug (DEBUG_TEMPLATE, "END");
 }
 
index 1ab4c6b4247b82c2b38d59f5e7650553f0008632..21500ca727d03b08be061fd44cecd53cdd41187a 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 47a6293d950e8ecc098bc7198b09f4eb35e4f634..4a9bd2281f133e17ae3b15828ab6a8b486d43392 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index d3884ec17ca12b76213690e17256b4094590edb7..696cdcbb7ed65c2c725048cb8d47b107af548a79 100644 (file)
@@ -349,27 +349,27 @@ void
 gl_ui_cmd_edit_preferences (GtkAction *action,
                             glWindow  *window)
 {
-        static GtkWidget *dlg = NULL;
+        static GtkWidget *dialog = NULL;
 
         gl_debug (DEBUG_COMMANDS, "START");
 
         g_return_if_fail (action && GTK_IS_ACTION(action));
         g_return_if_fail (window && GL_IS_WINDOW(window));
 
-        if (dlg != NULL)
+        if (dialog != NULL)
         {
-                gtk_window_present (GTK_WINDOW (dlg));
-                gtk_window_set_transient_for (GTK_WINDOW (dlg),        
+                gtk_window_present (GTK_WINDOW (dialog));
+                gtk_window_set_transient_for (GTK_WINDOW (dialog),        
                                               GTK_WINDOW(window));
 
         } else {
                 
-                dlg = gl_prefs_dialog_new (GTK_WINDOW(window));
+                dialog = gl_prefs_dialog_new (GTK_WINDOW(window));
 
-                g_signal_connect (G_OBJECT (dlg), "destroy",
-                                  G_CALLBACK (gtk_widget_destroyed), &dlg);
+                g_signal_connect (G_OBJECT (dialog), "destroy",
+                                  G_CALLBACK (gtk_widget_destroyed), &dialog);
         
-                gtk_widget_show (dlg);
+                gtk_widget_show (dialog);
 
         }
 
index 0d5b05dbf4f7d0649cc59d87dee51da26382ab60..fc8a3db9179b4d386b3a6dc268ab93fdfed64fda 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 604f7d0e601f1695ce84780e93fe81d4d4cbfec0..c2a6e7aea6de85dc94230c4ab16691d41c4cfe66 100644 (file)
 
 #include "debug.h"
 
-/*============================================================================*/
-/* Private macros and constants.                                              */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private macros and constants.                                             */
+/*===========================================================================*/
 
-/*============================================================================*/
-/* Private data types                                                         */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private data types                                                        */
+/*===========================================================================*/
 
 struct _glUIPropertyBarPrivate {
 
@@ -83,18 +83,14 @@ struct _glUIPropertyBarPrivate {
 };
 
 
-/*============================================================================*/
-/* Private globals                                                            */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private globals                                                           */
+/*===========================================================================*/
 
-static GtkHBoxClass *parent_class;
+/*===========================================================================*/
+/* Local function prototypes                                                 */
+/*===========================================================================*/
 
-/*============================================================================*/
-/* Local function prototypes                                                  */
-/*============================================================================*/
-
-static void     gl_ui_property_bar_class_init    (glUIPropertyBarClass *class);
-static void     gl_ui_property_bar_instance_init (glUIPropertyBar      *property_bar);
 static void     gl_ui_property_bar_finalize      (GObject              *object);
 
 static void     gl_ui_property_bar_construct     (glUIPropertyBar      *property_bar);
@@ -159,40 +155,16 @@ static void     set_line_width_items_sensitive   (glUIPropertyBar      *property
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_ui_property_bar_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glUIPropertyBarClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_ui_property_bar_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glUIPropertyBar),
-                       0,
-                       (GInstanceInitFunc) gl_ui_property_bar_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_HBOX,
-                                              "glUIPropertyBar", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glUIPropertyBar, gl_ui_property_bar, GTK_TYPE_HBOX);
 
 static void
 gl_ui_property_bar_class_init (glUIPropertyBarClass *class)
 {
-       GObjectClass   *object_class     = (GObjectClass *) class;
+       GObjectClass   *object_class     = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_PROPERTY_BAR, "START");
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_ui_property_bar_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_ui_property_bar_finalize;
 
@@ -200,7 +172,7 @@ gl_ui_property_bar_class_init (glUIPropertyBarClass *class)
 }
 
 static void
-gl_ui_property_bar_instance_init (glUIPropertyBar *property_bar)
+gl_ui_property_bar_init (glUIPropertyBar *property_bar)
 {
        gl_debug (DEBUG_PROPERTY_BAR, "START");
 
@@ -221,23 +193,20 @@ gl_ui_property_bar_instance_init (glUIPropertyBar *property_bar)
 static void
 gl_ui_property_bar_finalize (GObject *object)
 {
-       glUIPropertyBar *property_bar;
+       glUIPropertyBar *property_bar = GL_UI_PROPERTY_BAR (object);
 
        gl_debug (DEBUG_PROPERTY_BAR, "START");
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_UI_PROPERTY_BAR (object));
 
-       property_bar = GL_UI_PROPERTY_BAR (object);
-
        if (property_bar->priv->view) {
                g_object_unref (G_OBJECT(property_bar->priv->view));
        }
-
-       G_OBJECT_CLASS (parent_class)->finalize (object);
-
        g_free (property_bar->priv);
 
+       G_OBJECT_CLASS (gl_ui_property_bar_parent_class)->finalize (object);
+
        gl_debug (DEBUG_PROPERTY_BAR, "END");
 }
 
index 6d3287fbb342ec1bad365408ffb5ceec8889d302..e2af1912b686cf3c1debfd02cd147311b0724a62 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /**
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 2c13e557c2485c9b574cf6e0d77c91570c9d0e34..924b0fa24455d707241d3da41cc9a02359820e07 100644 (file)
 
 #include "debug.h"
 
-/*============================================================================*/
-/* Private macros and constants.                                              */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private macros and constants.                                             */
+/*===========================================================================*/
 
 #define DEFAULT_SIDEBAR_WIDTH 340
 
-/*============================================================================*/
-/* Private data types                                                         */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private data types                                                        */
+/*===========================================================================*/
 
 struct _glUISidebarPrivate {
 
@@ -52,18 +52,15 @@ struct _glUISidebarPrivate {
        GtkWidget           *empty_child;
 };
 
-/*============================================================================*/
-/* Private globals                                                            */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private globals                                                           */
+/*===========================================================================*/
 
-static GtkVBoxClass *parent_class;
 
-/*============================================================================*/
-/* Local function prototypes                                                  */
-/*============================================================================*/
+/*===========================================================================*/
+/* Local function prototypes                                                 */
+/*===========================================================================*/
 
-static void     gl_ui_sidebar_class_init    (glUISidebarClass     *class);
-static void     gl_ui_sidebar_instance_init (glUISidebar          *sidebar);
 static void     gl_ui_sidebar_finalize      (GObject              *object);
 
 static void     gl_ui_sidebar_construct     (glUISidebar          *sidebar);
@@ -76,40 +73,16 @@ static void     selection_changed_cb        (glView               *view,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_ui_sidebar_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glUISidebarClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_ui_sidebar_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glUISidebar),
-                       0,
-                       (GInstanceInitFunc) gl_ui_sidebar_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_VBOX,
-                                              "glUISidebar", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glUISidebar, gl_ui_sidebar, GTK_TYPE_VBOX);
 
 static void
 gl_ui_sidebar_class_init (glUISidebarClass *class)
 {
-       GObjectClass   *object_class     = (GObjectClass *) class;
+       GObjectClass   *object_class     = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_UI, "START");
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_ui_sidebar_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_ui_sidebar_finalize;
 
@@ -117,7 +90,7 @@ gl_ui_sidebar_class_init (glUISidebarClass *class)
 }
 
 static void
-gl_ui_sidebar_instance_init (glUISidebar *sidebar)
+gl_ui_sidebar_init (glUISidebar *sidebar)
 {
        gl_debug (DEBUG_UI, "START");
 
@@ -129,23 +102,20 @@ gl_ui_sidebar_instance_init (glUISidebar *sidebar)
 static void
 gl_ui_sidebar_finalize (GObject *object)
 {
-       glUISidebar *sidebar;
+       glUISidebar *sidebar = GL_UI_SIDEBAR (object);
 
        gl_debug (DEBUG_UI, "START");
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_UI_SIDEBAR (object));
 
-       sidebar = GL_UI_SIDEBAR (object);
-
        if (sidebar->priv->view) {
                g_object_unref (G_OBJECT(sidebar->priv->view));
        }
-
-       G_OBJECT_CLASS (parent_class)->finalize (object);
-
        g_free (sidebar->priv);
 
+       G_OBJECT_CLASS (gl_ui_sidebar_parent_class)->finalize (object);
+
        gl_debug (DEBUG_UI, "END");
 }
 
index 74eb599fa71809c51a223cff0ea818aecf7b2df9..9ec1264d25d98ba1d3c1150f253307acedfac81f 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /**
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 509e90591d39de6eed54b9dee827162d00f1632a..3a0539df7c04e7c72648d936676a82d2d2be4732 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 262b6552d3dce3c5bbb46a5e83ee1a25ba462ab6..ffa2653ec079c0c8b666c3d0a1ecba235ea3e232 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index b7ce5852bc6e2933d513e4d4df1b1284ed7bf791..b18726422e98e8f96d551f829e71b06b5ac22f1e 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 72563bc894402e28e4a6ce8b761c76ccfd3e69c7..19135d53e4c3afcec849bb053ad5efd3c07d3b8e 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 0273abfca37c1fbae6cc3660a3bb6fb79b646a01..6d9331b354780b51845c7cabd80a6f56ac9ec664 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 89fb800d3711dae074438d18f4cdca6b221aef08..aa0ff25e57b0c47b3633b5a245aceaf1b3c04b2d 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 894f471f207b241d380f686b341a420757f696a3..b1c6e31e64ce9e51ece3dcd3bac60f2b07fde99f 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -60,15 +62,11 @@ struct _glViewBarcodePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_barcode_class_init            (glViewBarcodeClass  *klass);
-static void       gl_view_barcode_instance_init         (glViewBarcode       *view_bc);
 static void       gl_view_barcode_finalize              (GObject             *object);
 
 static GtkWidget *construct_properties_editor           (glViewObject        *view_object);
@@ -97,41 +95,17 @@ static void       draw_barcode                          (glViewBarcode       *vi
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_barcode_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewBarcodeClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_barcode_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewBarcode),
-                       0,
-                       (GInstanceInitFunc) gl_view_barcode_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewBarcode", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewBarcode, gl_view_barcode, GL_TYPE_VIEW_OBJECT);
 
 static void
-gl_view_barcode_class_init (glViewBarcodeClass *klass)
+gl_view_barcode_class_init (glViewBarcodeClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_barcode_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_barcode_finalize;
 
@@ -141,11 +115,11 @@ gl_view_barcode_class_init (glViewBarcodeClass *klass)
 }
 
 static void
-gl_view_barcode_instance_init (glViewBarcode *view_bc)
+gl_view_barcode_init (glViewBarcode *view_bc)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_bc->private = g_new0 (glViewBarcodePrivate, 1);
+       view_bc->priv = g_new0 (glViewBarcodePrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -153,13 +127,15 @@ gl_view_barcode_instance_init (glViewBarcode *view_bc)
 static void
 gl_view_barcode_finalize (GObject *object)
 {
-       glLabel       *parent;
+       glViewBarcode *view_bc = GL_VIEW_BARCODE (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_BARCODE (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       g_free (view_bc->priv);
+
+       G_OBJECT_CLASS (gl_view_barcode_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -579,13 +555,13 @@ draw_barcode (glViewBarcode *view_barcode)
        }
 
        /* remove previous items from group. */
-       for (li = view_barcode->private->item_list; li!=NULL; li = li->next) {
+       for (li = view_barcode->priv->item_list; li!=NULL; li = li->next) {
                gl_debug (DEBUG_VIEW, "in loop");
                gtk_object_destroy (GTK_OBJECT (li->data));
        }
        gl_debug (DEBUG_VIEW, "1");
-       g_list_free (view_barcode->private->item_list);
-       view_barcode->private->item_list = NULL;
+       g_list_free (view_barcode->priv->item_list);
+       view_barcode->priv->item_list = NULL;
        gl_debug (DEBUG_VIEW, "2");
 
        /* get Gnome Font */
@@ -606,8 +582,8 @@ draw_barcode (glViewBarcode *view_barcode)
                                                "outline_color_rgba", color_node->color,
                                                "width_pixels", 1,
                                                NULL);
-               view_barcode->private->item_list =
-                       g_list_prepend (view_barcode->private->item_list, item);
+               view_barcode->priv->item_list =
+                       g_list_prepend (view_barcode->priv->item_list, item);
 
                if (digits == NULL || *digits == '\0')
                {
@@ -635,8 +611,8 @@ draw_barcode (glViewBarcode *view_barcode)
 
                gnome_glyphlist_unref (glyphlist);
 
-               view_barcode->private->item_list =
-                       g_list_prepend (view_barcode->private->item_list, item);
+               view_barcode->priv->item_list =
+                       g_list_prepend (view_barcode->priv->item_list, item);
        } else {
 
                points = gnome_canvas_points_new (2);
@@ -654,8 +630,8 @@ draw_barcode (glViewBarcode *view_barcode)
                                                        "width_units", line->width,
                                                        "fill_color_rgba", color_node->color,
                                                        NULL);
-                       view_barcode->private->item_list =
-                               g_list_prepend (view_barcode->private->item_list, item);
+                       view_barcode->priv->item_list =
+                               g_list_prepend (view_barcode->priv->item_list, item);
                }
                gnome_canvas_points_free (points);
 
@@ -683,8 +659,8 @@ draw_barcode (glViewBarcode *view_barcode)
 
                        gnome_glyphlist_unref (glyphlist);
 
-                       view_barcode->private->item_list =
-                               g_list_prepend (view_barcode->private->item_list, item);
+                       view_barcode->priv->item_list =
+                               g_list_prepend (view_barcode->priv->item_list, item);
 
                }
 
index 7edbeff0385368a86627a819c4e214fecd1a14fe..38478a22b997926ea2fc0ad2b1cd52e858d9e1d8 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -41,13 +43,13 @@ typedef struct _glViewBarcodeClass     glViewBarcodeClass;
 typedef struct _glViewBarcodePrivate   glViewBarcodePrivate;
 
 struct _glViewBarcode {
-       glViewObject        parent_object;
+       glViewObject           parent_object;
 
-       glViewBarcodePrivate  *private;
+       glViewBarcodePrivate  *priv;
 };
 
 struct _glViewBarcodeClass {
-       glViewObjectClass   parent_class;
+       glViewObjectClass      parent_class;
 };
 
 
index e8b50b5749f128accf374576bf8735c79238a01b..e0a265d29d158a9eded7a5e3198c6073ca64708c 100644 (file)
@@ -57,15 +57,11 @@ struct _glViewBoxPrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_box_class_init            (glViewBoxClass   *klass);
-static void       gl_view_box_instance_init         (glViewBox        *view_box);
 static void       gl_view_box_finalize              (GObject          *object);
 
 static GtkWidget *construct_properties_editor       (glViewObject     *view_object);
@@ -92,41 +88,18 @@ static void       update_editor_from_label_cb       (glLabel          *label,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_box_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewBoxClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_box_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewBox),
-                       0,
-                       (GInstanceInitFunc) gl_view_box_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewBox", &info, 0);
-       }
+G_DEFINE_TYPE (glViewBox, gl_view_box, GL_TYPE_VIEW_OBJECT);
 
-       return type;
-}
 
 static void
-gl_view_box_class_init (glViewBoxClass *klass)
+gl_view_box_class_init (glViewBoxClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_box_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_box_finalize;
 
@@ -136,11 +109,11 @@ gl_view_box_class_init (glViewBoxClass *klass)
 }
 
 static void
-gl_view_box_instance_init (glViewBox *view_box)
+gl_view_box_init (glViewBox *view_box)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_box->private = g_new0 (glViewBoxPrivate, 1);
+       view_box->priv = g_new0 (glViewBoxPrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -148,13 +121,15 @@ gl_view_box_instance_init (glViewBox *view_box)
 static void
 gl_view_box_finalize (GObject *object)
 {
-       glLabel       *parent;
+        glViewBox *view_box = GL_VIEW_BOX (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_BOX (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+        g_free (view_box->priv);
+
+       G_OBJECT_CLASS (gl_view_box_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -181,11 +156,11 @@ gl_view_box_new (glLabelBox *object,
                                   GL_VIEW_HIGHLIGHT_BOX_RESIZABLE);
 
        /* Create analogous canvas items. */
-       view_box->private->shadow_item =
+       view_box->priv->shadow_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
                                         gnome_canvas_rect_get_type (),
                                         NULL);
-       view_box->private->object_item =
+       view_box->priv->object_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
                                         gnome_canvas_rect_get_type (),
                                         NULL);
@@ -293,7 +268,7 @@ update_canvas_item_from_object_cb (glLabelObject *object,
                                             fill_color_node->color);
 
        /* Adjust appearance of analogous canvas items. */
-       gnome_canvas_item_set (view_box->private->shadow_item,
+       gnome_canvas_item_set (view_box->priv->shadow_item,
                               "x1", shadow_x,
                               "y1", shadow_y,
                               "x2", shadow_x + w + DELTA,
@@ -305,14 +280,14 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        if (shadow_state)
        {
-               gnome_canvas_item_show (view_box->private->shadow_item);
+               gnome_canvas_item_show (view_box->priv->shadow_item);
        }
        else
        {
-               gnome_canvas_item_hide (view_box->private->shadow_item);
+               gnome_canvas_item_hide (view_box->priv->shadow_item);
        }
 
-       gnome_canvas_item_set (view_box->private->object_item,
+       gnome_canvas_item_set (view_box->priv->object_item,
                               "x2", w + DELTA,
                               "y2", h + DELTA,
                               "width_units", line_width,
index af63d5e55d55f5ce87ccc3fce6490efdbfa4a077..2e5f04fbd7b0896a6d565f3f15964ce497ae513f 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,7 +45,7 @@ typedef struct _glViewBoxPrivate   glViewBoxPrivate;
 struct _glViewBox {
        glViewObject          parent_object;
 
-       glViewBoxPrivate      *private;
+       glViewBoxPrivate     *priv;
 };
 
 struct _glViewBoxClass {
index 0c3fe94215da686096f9dcb87cf79578f3b32f21..1d7a1675c8d9fbae3505e436dd227b27da740ee9 100644 (file)
@@ -57,15 +57,11 @@ struct _glViewEllipsePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_ellipse_class_init        (glViewEllipseClass   *klass);
-static void       gl_view_ellipse_instance_init     (glViewEllipse        *view_ellipse);
 static void       gl_view_ellipse_finalize          (GObject              *object);
 
 static GtkWidget *construct_properties_editor       (glViewObject         *view_object);
@@ -92,41 +88,17 @@ static void       update_editor_from_label_cb       (glLabel          *label,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_ellipse_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewEllipseClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_ellipse_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewEllipse),
-                       0,
-                       (GInstanceInitFunc) gl_view_ellipse_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewEllipse", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewEllipse, gl_view_ellipse, GL_TYPE_VIEW_OBJECT);
 
 static void
-gl_view_ellipse_class_init (glViewEllipseClass *klass)
+gl_view_ellipse_class_init (glViewEllipseClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_ellipse_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_ellipse_finalize;
 
@@ -136,11 +108,11 @@ gl_view_ellipse_class_init (glViewEllipseClass *klass)
 }
 
 static void
-gl_view_ellipse_instance_init (glViewEllipse *view_ellipse)
+gl_view_ellipse_init (glViewEllipse *view_ellipse)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_ellipse->private = g_new0 (glViewEllipsePrivate, 1);
+       view_ellipse->priv = g_new0 (glViewEllipsePrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -148,13 +120,15 @@ gl_view_ellipse_instance_init (glViewEllipse *view_ellipse)
 static void
 gl_view_ellipse_finalize (GObject *object)
 {
-       glLabel       *parent;
+        glViewEllipse *view_ellipse = GL_VIEW_ELLIPSE (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_ELLIPSE (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+        g_free (view_ellipse->priv);
+
+       G_OBJECT_CLASS (gl_view_ellipse_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -181,11 +155,11 @@ gl_view_ellipse_new (glLabelEllipse *object,
                                   GL_VIEW_HIGHLIGHT_ELLIPSE_RESIZABLE);
 
        /* Create analogous canvas items. */
-       view_ellipse->private->shadow_item =
+       view_ellipse->priv->shadow_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_ellipse),
                                         gnome_canvas_ellipse_get_type (),
                                         NULL);
-       view_ellipse->private->object_item =
+       view_ellipse->priv->object_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_ellipse),
                                         gnome_canvas_ellipse_get_type (),
                                         NULL);
@@ -293,7 +267,7 @@ update_canvas_item_from_object_cb (glLabelObject *object,
                                             fill_color_node->color);
 
        /* Adjust appearance of analogous canvas items. */
-       gnome_canvas_item_set (view_ellipse->private->shadow_item,
+       gnome_canvas_item_set (view_ellipse->priv->shadow_item,
                               "x1", shadow_x,
                               "y1", shadow_y,
                               "x2", shadow_x + w + DELTA,
@@ -305,14 +279,14 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        if (shadow_state)
        {
-               gnome_canvas_item_show (view_ellipse->private->shadow_item);
+               gnome_canvas_item_show (view_ellipse->priv->shadow_item);
        }
        else
        {
-               gnome_canvas_item_hide (view_ellipse->private->shadow_item);
+               gnome_canvas_item_hide (view_ellipse->priv->shadow_item);
        }
 
-       gnome_canvas_item_set (view_ellipse->private->object_item,
+       gnome_canvas_item_set (view_ellipse->priv->object_item,
                               "x2", w + DELTA,
                               "y2", h + DELTA,
                               "width_units", line_width,
index d7f13b6f196318b06372509f97741fada2f51f49..e3ec57bfb110936094415bfff4e59e230f763efb 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -41,13 +43,13 @@ typedef struct _glViewEllipseClass     glViewEllipseClass;
 typedef struct _glViewEllipsePrivate   glViewEllipsePrivate;
 
 struct _glViewEllipse {
-       glViewObject          parent_object;
+       glViewObject           parent_object;
 
-       glViewEllipsePrivate  *private;
+       glViewEllipsePrivate  *priv;
 };
 
 struct _glViewEllipseClass {
-       glViewObjectClass     parent_class;
+       glViewObjectClass      parent_class;
 };
 
 
index 64e859aa8b0e587d7ba83ce9ea1e4a11082d1cca..4b744f52fb2028d731d45e4041ff417a7cc5a6c3 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -58,14 +60,11 @@ struct _glViewHighlightPrivate {
 /* Private globals                           */
 /*===========================================*/
 
-static GObjectClass *parent_class = NULL;
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void   gl_view_highlight_class_init       (glViewHighlightClass   *klass);
-static void   gl_view_highlight_instance_init    (glViewHighlight        *view_highlight);
 static void   gl_view_highlight_finalize         (GObject                *object);
 
 
@@ -150,40 +149,16 @@ static int passthrough_event_handler (GnomeCanvasItem *handle_item,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_highlight_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewHighlightClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_highlight_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewHighlight),
-                       0,
-                       (GInstanceInitFunc) gl_view_highlight_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glViewHighlight", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewHighlight, gl_view_highlight, G_TYPE_OBJECT);
 
 static void
-gl_view_highlight_class_init (glViewHighlightClass *klass)
+gl_view_highlight_class_init (glViewHighlightClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_highlight_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_highlight_finalize;
 
@@ -191,11 +166,11 @@ gl_view_highlight_class_init (glViewHighlightClass *klass)
 }
 
 static void
-gl_view_highlight_instance_init (glViewHighlight *view_highlight)
+gl_view_highlight_init (glViewHighlight *view_highlight)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_highlight->private = g_new0 (glViewHighlightPrivate, 1);
+       view_highlight->priv = g_new0 (glViewHighlightPrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -203,27 +178,24 @@ gl_view_highlight_instance_init (glViewHighlight *view_highlight)
 static void
 gl_view_highlight_finalize (GObject *object)
 {
-       glLabel         *parent;
-       glViewHighlight *view_highlight;
+       glViewHighlight *view_highlight = GL_VIEW_HIGHLIGHT (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_HIGHLIGHT (object));
 
-       view_highlight = GL_VIEW_HIGHLIGHT (object);
-
        /* Free up handler owned by view. */
-       g_signal_handlers_disconnect_by_func (G_OBJECT (view_highlight->private->view),
+       g_signal_handlers_disconnect_by_func (G_OBJECT (view_highlight->priv->view),
                                              G_CALLBACK (view_scale_changed_cb),
                                              object);
 
-       gtk_object_destroy (GTK_OBJECT(view_highlight->private->position_group));
+       gtk_object_destroy (GTK_OBJECT(view_highlight->priv->position_group));
 
-       if (view_highlight->private) {
-               g_free (view_highlight->private);
+       if (view_highlight->priv) {
+               g_free (view_highlight->priv);
        }
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_view_highlight_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -251,10 +223,10 @@ gl_view_highlight_new (glViewObject         *view_object,
 
        view_highlight = g_object_new (gl_view_highlight_get_type (), NULL);
 
-       view_highlight->private->style          = style;
-       view_highlight->private->view           = view;
-       view_highlight->private->object         = object;
-       view_highlight->private->position_group =
+       view_highlight->priv->style          = style;
+       view_highlight->priv->view           = view;
+       view_highlight->priv->object         = object;
+       view_highlight->priv->position_group =
                gnome_canvas_item_new (view->highlight_group,
                                       gnome_canvas_group_get_type (),
                                       "x", x,
@@ -282,19 +254,19 @@ gl_view_highlight_new (glViewObject         *view_object,
        }
 
 
-       gl_label_object_get_affine (view_highlight->private->object, affine);
-       gnome_canvas_item_affine_absolute (view_highlight->private->group, affine);
+       gl_label_object_get_affine (view_highlight->priv->object, affine);
+       gnome_canvas_item_affine_absolute (view_highlight->priv->group, affine);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->object), "moved",
+       g_signal_connect (G_OBJECT (view_highlight->priv->object), "moved",
                          G_CALLBACK (object_moved_cb), view_highlight);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->object), "changed",
+       g_signal_connect (G_OBJECT (view_highlight->priv->object), "changed",
                          G_CALLBACK (object_changed_cb), view_highlight);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->object), "flip_rotate",
+       g_signal_connect (G_OBJECT (view_highlight->priv->object), "flip_rotate",
                          G_CALLBACK (flip_rotate_object_cb), view_highlight);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->view), "zoom_changed",
+       g_signal_connect (G_OBJECT (view_highlight->priv->view), "zoom_changed",
                          G_CALLBACK (view_scale_changed_cb), view_highlight);
 
        gl_debug (DEBUG_VIEW, "END");
@@ -322,29 +294,29 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
 
-       view   = view_highlight->private->view;
+       view   = view_highlight->priv->view;
        scale = view->zoom * view->home_scale;
 
-       object = view_highlight->private->object;
+       object = view_highlight->priv->object;
 
-       position_group = GNOME_CANVAS_GROUP(view_highlight->private->position_group);
+       position_group = GNOME_CANVAS_GROUP(view_highlight->priv->position_group);
 
        g_return_if_fail (view && GL_IS_VIEW (view));
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
        gl_label_object_get_size (object, &w, &h);
 
-       view_highlight->private->group =
+       view_highlight->priv->group =
                gnome_canvas_item_new (position_group,
                                       gnome_canvas_group_get_type (),
                                       "x", 0.0, "y", 0.0, NULL);
-       gnome_canvas_item_hide (view_highlight->private->group);
-       group = view_highlight->private->group;
+       gnome_canvas_item_hide (view_highlight->priv->group);
+       group = view_highlight->priv->group;
 
 #ifdef SHOW_OUTLINE
        switch (style) {
        case GL_VIEW_HIGHLIGHT_BOX_RESIZABLE:
-               view_highlight->private->outline =
+               view_highlight->priv->outline =
                        gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                               gnome_canvas_rect_get_type (),
                                               "x1", -0.5,
@@ -356,7 +328,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                               NULL);
                break;
        case GL_VIEW_HIGHLIGHT_ELLIPSE_RESIZABLE:
-               view_highlight->private->outline =
+               view_highlight->priv->outline =
                        gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                               gnome_canvas_ellipse_get_type (),
                                               "x1", -0.5,
@@ -368,12 +340,12 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                               NULL);
                break;
        default:
-               view_highlight->private->outline = NULL;
+               view_highlight->priv->outline = NULL;
                g_message ("Invalid resizable highlight style");
        }
 #endif
 
-       view_highlight->private->tl =
+       view_highlight->priv->tl =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", -HANDLE_PIXELS/scale,
@@ -385,7 +357,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->tr =
+       view_highlight->priv->tr =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", w - HANDLE_PIXELS/scale,
@@ -397,7 +369,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->bl =
+       view_highlight->priv->bl =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", -HANDLE_PIXELS/scale,
@@ -409,7 +381,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->br =
+       view_highlight->priv->br =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", w - HANDLE_PIXELS/scale,
@@ -421,7 +393,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->sl =
+       view_highlight->priv->sl =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", -HANDLE_PIXELS/scale,
@@ -433,7 +405,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->sr =
+       view_highlight->priv->sr =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", w - HANDLE_PIXELS/scale,
@@ -445,7 +417,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->st =
+       view_highlight->priv->st =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", w / 2.0 - HANDLE_PIXELS/scale,
@@ -457,7 +429,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->sb =
+       view_highlight->priv->sb =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", w / 2.0 - HANDLE_PIXELS/scale,
@@ -469,25 +441,25 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->tl), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->tl), "event",
                          G_CALLBACK (tl_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->tr), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->tr), "event",
                          G_CALLBACK (tr_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->bl), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->bl), "event",
                          G_CALLBACK (bl_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->br), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->br), "event",
                          G_CALLBACK (br_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->sl), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->sl), "event",
                          G_CALLBACK (sl_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->sr), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->sr), "event",
                          G_CALLBACK (sr_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->st), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->st), "event",
                          G_CALLBACK (st_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->sb), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->sb), "event",
                          G_CALLBACK (sb_resize_event_handler), view_highlight);
 
 #ifdef SHOW_OUTLINE
-       g_signal_connect (G_OBJECT (view_highlight->private->outline), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->outline), "event",
                          G_CALLBACK (passthrough_event_handler), view_object);
 #endif
 
@@ -518,12 +490,12 @@ highlight_resizable_line_construct (glViewHighlight *view_highlight,
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
 
-       view   = view_highlight->private->view;
+       view   = view_highlight->priv->view;
        scale = view->zoom * view->home_scale;
 
-       object = view_highlight->private->object;
+       object = view_highlight->priv->object;
 
-       position_group = GNOME_CANVAS_GROUP(view_highlight->private->position_group);
+       position_group = GNOME_CANVAS_GROUP(view_highlight->priv->position_group);
 
        g_return_if_fail (view && GL_IS_VIEW (view));
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
@@ -534,19 +506,19 @@ highlight_resizable_line_construct (glViewHighlight *view_highlight,
        points = gnome_canvas_points_new (2);
 #endif
 
-       view_highlight->private->group =
+       view_highlight->priv->group =
                gnome_canvas_item_new (position_group,
                                       gnome_canvas_group_get_type (),
                                       "x", 0.0, "y", 0.0, NULL);
-       gnome_canvas_item_hide (view_highlight->private->group);
-       group = view_highlight->private->group;
+       gnome_canvas_item_hide (view_highlight->priv->group);
+       group = view_highlight->priv->group;
 
 #ifdef SHOW_OUTLINE
        points->coords[0] = 0.0;
        points->coords[1] = 0.0;
        points->coords[2] = dx;
        points->coords[3] = dy;
-       view_highlight->private->outline =
+       view_highlight->priv->outline =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_line_get_type (),
                                       "points", points,
@@ -555,7 +527,7 @@ highlight_resizable_line_construct (glViewHighlight *view_highlight,
                                       NULL);
 #endif
 
-       view_highlight->private->p1 =
+       view_highlight->priv->p1 =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", -HANDLE_PIXELS/scale,
@@ -567,7 +539,7 @@ highlight_resizable_line_construct (glViewHighlight *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       view_highlight->private->p2 =
+       view_highlight->priv->p2 =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", dx - HANDLE_PIXELS/scale,
@@ -579,13 +551,13 @@ highlight_resizable_line_construct (glViewHighlight *view_highlight,
                                       "outline_color_rgba", BG_COLOR,
                                       NULL);
 
-       g_signal_connect (G_OBJECT (view_highlight->private->p1), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->p1), "event",
                          G_CALLBACK (p1_resize_event_handler), view_highlight);
-       g_signal_connect (G_OBJECT (view_highlight->private->p2), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->p2), "event",
                          G_CALLBACK (p2_resize_event_handler), view_highlight);
 
 #ifdef SHOW_OUTLINE
-       g_signal_connect (G_OBJECT (view_highlight->private->outline), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->outline), "event",
                          G_CALLBACK (passthrough_event_handler), view_object);
 #endif
 
@@ -616,11 +588,11 @@ highlight_simple_construct (glViewHighlight *view_highlight,
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
 
-       view   = view_highlight->private->view;
+       view   = view_highlight->priv->view;
 
-       object = view_highlight->private->object;
+       object = view_highlight->priv->object;
 
-       position_group = GNOME_CANVAS_GROUP(view_highlight->private->position_group);
+       position_group = GNOME_CANVAS_GROUP(view_highlight->priv->position_group);
 
        g_return_if_fail (view && GL_IS_VIEW (view));
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
@@ -628,14 +600,14 @@ highlight_simple_construct (glViewHighlight *view_highlight,
        gl_label_object_get_size (object, &w, &h);
 
 
-       view_highlight->private->group =
+       view_highlight->priv->group =
                gnome_canvas_item_new (position_group,
                                       gnome_canvas_group_get_type (),
                                       "x", 0.0, "y", 0.0, NULL);
-       gnome_canvas_item_hide (view_highlight->private->group);
-       group = view_highlight->private->group;
+       gnome_canvas_item_hide (view_highlight->priv->group);
+       group = view_highlight->priv->group;
 
-       view_highlight->private->outline =
+       view_highlight->priv->outline =
                gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
                                       gnome_canvas_rect_get_type (),
                                       "x1", -0.5,
@@ -647,7 +619,7 @@ highlight_simple_construct (glViewHighlight *view_highlight,
                                       NULL);
 
 
-       g_signal_connect (G_OBJECT (view_highlight->private->outline), "event",
+       g_signal_connect (G_OBJECT (view_highlight->priv->outline), "event",
                          G_CALLBACK (passthrough_event_handler), view_object);
 
        gnome_canvas_item_raise_to_top (group);
@@ -661,9 +633,9 @@ highlight_simple_construct (glViewHighlight *view_highlight,
 void
 gl_view_highlight_show (glViewHighlight *view_highlight)
 {
-       gnome_canvas_item_show (view_highlight->private->group);
+       gnome_canvas_item_show (view_highlight->priv->group);
 
-       gnome_canvas_item_raise_to_top (view_highlight->private->group);
+       gnome_canvas_item_raise_to_top (view_highlight->priv->group);
 }
 
 /****************************************************************************/
@@ -672,7 +644,7 @@ gl_view_highlight_show (glViewHighlight *view_highlight)
 void
 gl_view_highlight_hide (glViewHighlight *view_highlight)
 {
-       gnome_canvas_item_hide (view_highlight->private->group);
+       gnome_canvas_item_hide (view_highlight->priv->group);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -687,7 +659,7 @@ object_moved_cb (glLabelObject   *object,
        gl_debug (DEBUG_VIEW, "START");
 
        /* Adjust location of outer canvas group. */
-       gnome_canvas_item_move (view_highlight->private->position_group, dx, dy);
+       gnome_canvas_item_move (view_highlight->priv->position_group, dx, dy);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -705,7 +677,7 @@ flip_rotate_object_cb (glLabelObject    *object,
 
        /* Adjust affine of inner canvas group. */
        gl_label_object_get_affine (object, affine);
-       gnome_canvas_item_affine_absolute (view_highlight->private->group, affine);
+       gnome_canvas_item_affine_absolute (view_highlight->priv->group, affine);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -724,7 +696,7 @@ object_changed_cb (glLabelObject   *object,
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
 
-       switch (view_highlight->private->style) {
+       switch (view_highlight->priv->style) {
 
        case GL_VIEW_HIGHLIGHT_BOX_RESIZABLE:
        case GL_VIEW_HIGHLIGHT_ELLIPSE_RESIZABLE:
@@ -760,7 +732,7 @@ view_scale_changed_cb (glView          *view,
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
        g_return_if_fail (view && GL_IS_VIEW (view));
 
-       switch (view_highlight->private->style) {
+       switch (view_highlight->priv->style) {
 
        case GL_VIEW_HIGHLIGHT_BOX_RESIZABLE:
        case GL_VIEW_HIGHLIGHT_ELLIPSE_RESIZABLE:
@@ -796,14 +768,14 @@ update_resizable_box  (glViewHighlight *view_highlight)
 
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
 
-       scale = view_highlight->private->view->zoom *
-               view_highlight->private->view->home_scale;
+       scale = view_highlight->priv->view->zoom *
+               view_highlight->priv->view->home_scale;
 
-       gl_label_object_get_size (view_highlight->private->object, &w, &h);
+       gl_label_object_get_size (view_highlight->priv->object, &w, &h);
 
 
 #ifdef SHOW_OUTLINE
-       gnome_canvas_item_set (view_highlight->private->outline,
+       gnome_canvas_item_set (view_highlight->priv->outline,
                               "x1", -0.5,
                               "y1", -0.5,
                               "x2", w + 0.5,
@@ -811,63 +783,63 @@ update_resizable_box  (glViewHighlight *view_highlight)
                               NULL);
 #endif
 
-       gnome_canvas_item_set (view_highlight->private->tl,
+       gnome_canvas_item_set (view_highlight->priv->tl,
                               "x1", -HANDLE_PIXELS/scale,
                               "y1", -HANDLE_PIXELS/scale,
                               "x2", +HANDLE_PIXELS/scale,
                               "y2", +HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->tr,
+       gnome_canvas_item_set (view_highlight->priv->tr,
                               "x1", w - HANDLE_PIXELS/scale,
                               "y1", -HANDLE_PIXELS/scale,
                               "x2", w + HANDLE_PIXELS/scale,
                               "y2", +HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->bl,
+       gnome_canvas_item_set (view_highlight->priv->bl,
                               "x1", -HANDLE_PIXELS/scale,
                               "y1", h - HANDLE_PIXELS/scale,
                               "x2", +HANDLE_PIXELS/scale,
                               "y2", h + HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->br,
+       gnome_canvas_item_set (view_highlight->priv->br,
                               "x1", w - HANDLE_PIXELS/scale,
                               "y1", h - HANDLE_PIXELS/scale,
                               "x2", w + HANDLE_PIXELS/scale,
                               "y2", h + HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->sl,
+       gnome_canvas_item_set (view_highlight->priv->sl,
                               "x1", -HANDLE_PIXELS/scale,
                               "y1", h / 2.0 - HANDLE_PIXELS/scale,
                               "x2", +HANDLE_PIXELS/scale,
                               "y2", h / 2.0 + HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->sr,
+       gnome_canvas_item_set (view_highlight->priv->sr,
                               "x1", w - HANDLE_PIXELS/scale,
                               "y1", h / 2.0 - HANDLE_PIXELS/scale,
                               "x2", w + HANDLE_PIXELS/scale,
                               "y2", h / 2.0 + HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->st,
+       gnome_canvas_item_set (view_highlight->priv->st,
                               "x1", w / 2.0 - HANDLE_PIXELS/scale,
                               "y1", -HANDLE_PIXELS/scale,
                               "x2", w / 2.0 + HANDLE_PIXELS/scale,
                               "y2", +HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->sb,
+       gnome_canvas_item_set (view_highlight->priv->sb,
                               "x1", w / 2.0 - HANDLE_PIXELS/scale,
                               "y1", h - HANDLE_PIXELS/scale,
                               "x2", w / 2.0 + HANDLE_PIXELS/scale,
                               "y2", h + HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_raise_to_top (view_highlight->private->group);
+       gnome_canvas_item_raise_to_top (view_highlight->priv->group);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -888,10 +860,10 @@ update_resizable_line (glViewHighlight *view_highlight)
 
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
 
-       scale = view_highlight->private->view->zoom *
-               view_highlight->private->view->home_scale;
+       scale = view_highlight->priv->view->zoom *
+               view_highlight->priv->view->home_scale;
 
-       gl_label_object_get_size (view_highlight->private->object, &dx, &dy);
+       gl_label_object_get_size (view_highlight->priv->object, &dx, &dy);
 
 #ifdef SHOW_OUTLINE
        points = gnome_canvas_points_new (2);
@@ -900,17 +872,17 @@ update_resizable_line (glViewHighlight *view_highlight)
        points->coords[1] = 0.0;
        points->coords[2] = dx;
        points->coords[3] = dy;
-       gnome_canvas_item_set (view_highlight->private->outline, "points", points, NULL);
+       gnome_canvas_item_set (view_highlight->priv->outline, "points", points, NULL);
 #endif
 
-       gnome_canvas_item_set (view_highlight->private->p1,
+       gnome_canvas_item_set (view_highlight->priv->p1,
                               "x1", -HANDLE_PIXELS/scale,
                               "y1", -HANDLE_PIXELS/scale,
                               "x2", +HANDLE_PIXELS/scale,
                               "y2", +HANDLE_PIXELS/scale,
                               NULL);
 
-       gnome_canvas_item_set (view_highlight->private->p2,
+       gnome_canvas_item_set (view_highlight->priv->p2,
                               "x1", dx - HANDLE_PIXELS/scale,
                               "y1", dy - HANDLE_PIXELS/scale,
                               "x2", dx + HANDLE_PIXELS/scale,
@@ -921,7 +893,7 @@ update_resizable_line (glViewHighlight *view_highlight)
        gnome_canvas_points_free (points);
 #endif
 
-       gnome_canvas_item_raise_to_top (view_highlight->private->group);
+       gnome_canvas_item_raise_to_top (view_highlight->priv->group);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -938,14 +910,14 @@ update_simple (glViewHighlight *view_highlight)
 
        g_return_if_fail (view_highlight && GL_IS_VIEW_HIGHLIGHT (view_highlight));
 
-       gl_label_object_get_size (view_highlight->private->object, &w, &h);
+       gl_label_object_get_size (view_highlight->priv->object, &w, &h);
 
-       gnome_canvas_item_set (view_highlight->private->outline,
+       gnome_canvas_item_set (view_highlight->priv->outline,
                               "x2", w + 0.5,
                               "y2", h + 0.5,
                               NULL);
 
-       gnome_canvas_item_raise_to_top (view_highlight->private->group);
+       gnome_canvas_item_raise_to_top (view_highlight->priv->group);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -964,11 +936,11 @@ get_origin_and_corners (glViewHighlight *view_highlight,
 {
        glLabelObject *object;
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        /* origin, relative to item */
        gl_label_object_get_position (object, x0, y0);
-       gnome_canvas_item_w2i (view_highlight->private->group, x0, y0);
+       gnome_canvas_item_w2i (view_highlight->priv->group, x0, y0);
 
        /* Top left corner, relative to item */
        *x1 = 0.0;
@@ -994,12 +966,12 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject   *object;
        GdkCursor       *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1027,7 +999,7 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
@@ -1041,7 +1013,7 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1053,7 +1025,7 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->motion.x, MIN_ITEM_SIZE);
                        h = MAX (y2 - event->motion.y, MIN_ITEM_SIZE);
@@ -1067,7 +1039,7 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1076,14 +1048,14 @@ tl_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1109,12 +1081,12 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject   *object;
        GdkCursor       *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1142,7 +1114,7 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
@@ -1156,7 +1128,7 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1168,7 +1140,7 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
@@ -1182,7 +1154,7 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1191,14 +1163,14 @@ tr_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1224,12 +1196,12 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject   *object;
        GdkCursor       *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1257,7 +1229,7 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1271,7 +1243,7 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1283,7 +1255,7 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1297,7 +1269,7 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1306,14 +1278,14 @@ bl_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1339,12 +1311,12 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject   *object;
        GdkCursor       *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1374,7 +1346,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1387,7 +1359,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1400,7 +1372,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1413,7 +1385,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
                        y0 = y0 + y1;
                        /* x1 unchanged */
                        /* y1 unchanged */
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1423,7 +1395,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
        case GDK_ENTER_NOTIFY:
                gl_debug (DEBUG_VIEW, "ENTER_NOTIFY");
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1431,7 +1403,7 @@ br_resize_event_handler (GnomeCanvasItem *handle_item,
        case GDK_LEAVE_NOTIFY:
                gl_debug (DEBUG_VIEW, "LEAVE_NOTIFY");
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1457,12 +1429,12 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1489,7 +1461,7 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = y2 - y1;
@@ -1499,7 +1471,7 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1511,7 +1483,7 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = y2 - y1;
@@ -1521,7 +1493,7 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1530,14 +1502,14 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1562,12 +1534,12 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1594,7 +1566,7 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = y2 - y1;
@@ -1604,7 +1576,7 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1616,7 +1588,7 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = y2 - y1;
@@ -1626,7 +1598,7 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1635,14 +1607,14 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1667,12 +1639,12 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1699,7 +1671,7 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = x2 - x1;
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
@@ -1709,7 +1681,7 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1721,7 +1693,7 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = x2 - x1;
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
@@ -1731,7 +1703,7 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                        y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1740,14 +1712,14 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1772,12 +1744,12 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1804,7 +1776,7 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = x2 - x1;
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1814,7 +1786,7 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
 
@@ -1826,7 +1798,7 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        w = x2 - x1;
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
@@ -1836,7 +1808,7 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                        /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        return TRUE;
                } else {
@@ -1845,14 +1817,14 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1877,12 +1849,12 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -1909,7 +1881,7 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        x1 = event->button.x;
                        y1 = event->button.y;
@@ -1917,7 +1889,7 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
                        dy = (y2 - event->button.y);
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        gl_label_object_set_size (object, dx, dy);
                        return TRUE;
@@ -1930,7 +1902,7 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        x1 = event->button.x;
                        y1 = event->button.y;
@@ -1938,7 +1910,7 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
                        dy = (y2 - event->button.y);
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        gl_label_object_set_size (object, dx, dy);
                        return TRUE;
@@ -1948,14 +1920,14 @@ p1_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
@@ -1980,12 +1952,12 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
        glLabelObject *object;
        GdkCursor *cursor;
 
-       if ( view_highlight->private->view->state != GL_VIEW_STATE_ARROW ) {
+       if ( view_highlight->priv->view->state != GL_VIEW_STATE_ARROW ) {
                /* don't interfere with object creation modes */
                return FALSE;
        }
 
-       object = view_highlight->private->object;;
+       object = view_highlight->priv->object;;
 
        switch (event->type) {
 
@@ -2012,7 +1984,7 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_ungrab (handle_item,
                                                  event->button.time);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        /* x1 unchanged */
                        /* y1 unchanged */
@@ -2020,7 +1992,7 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
                        dy = (event->button.y - x1);
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        gl_label_object_set_size (object, dx, dy);
                        return TRUE;
@@ -2033,7 +2005,7 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
                if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) {
                        get_origin_and_corners (view_highlight,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
-                       gnome_canvas_item_w2i (view_highlight->private->group,
+                       gnome_canvas_item_w2i (view_highlight->priv->group,
                                               &event->button.x, &event->button.y);
                        /* x1 unchanged */
                        /* y1 unchanged */
@@ -2041,7 +2013,7 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
                        dy = (event->button.y - x1);
                        x0 = x0 + x1;
                        y0 = y0 + y1;
-                       gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
+                       gnome_canvas_item_i2w (view_highlight->priv->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
                        gl_label_object_set_size (object, dx, dy);
                        return TRUE;
@@ -2051,14 +2023,14 @@ p2_resize_event_handler (GnomeCanvasItem *handle_item,
 
        case GDK_ENTER_NOTIFY:
                cursor = gdk_cursor_new (GDK_CROSSHAIR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
 
        case GDK_LEAVE_NOTIFY:
                cursor = gdk_cursor_new (GDK_LEFT_PTR);
-               gdk_window_set_cursor (view_highlight->private->view->canvas->window,
+               gdk_window_set_cursor (view_highlight->priv->view->canvas->window,
                                       cursor);
                gdk_cursor_unref (cursor);
                return TRUE;
index d49987d1dd5763bf7133db892725053e8b6b944c..d597ff392148f1f5ca149b2ff238965ed95209b0 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -49,7 +51,7 @@ typedef struct _glViewHighlightPrivate   glViewHighlightPrivate;
 struct _glViewHighlight {
        GObject                  parent_object;
 
-       glViewHighlightPrivate  *private;
+       glViewHighlightPrivate  *priv;
 };
 
 struct _glViewHighlightClass {
index 96ce6e9d120047bba675ffc50bb97200d0987ff2..4c797300cd4fc49086d967ba0ab79e3d92bef8e7 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -54,8 +56,6 @@ struct _glViewImagePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
 /* Save state of image file entry */
 static gchar *image_path = NULL;
 
@@ -63,8 +63,6 @@ static gchar *image_path = NULL;
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_image_class_init          (glViewImageClass *klass);
-static void       gl_view_image_instance_init       (glViewImage      *view_image);
 static void       gl_view_image_finalize            (GObject          *object);
 
 static GtkWidget *construct_properties_editor       (glViewObject     *view_object);
@@ -91,41 +89,17 @@ static void       update_editor_from_label_cb       (glLabel          *label,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_image_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewImageClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_image_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewImage),
-                       0,
-                       (GInstanceInitFunc) gl_view_image_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewImage", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewImage, gl_view_image, GL_TYPE_VIEW_OBJECT);
 
 static void
-gl_view_image_class_init (glViewImageClass *klass)
+gl_view_image_class_init (glViewImageClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_image_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_image_finalize;
 
@@ -135,11 +109,11 @@ gl_view_image_class_init (glViewImageClass *klass)
 }
 
 static void
-gl_view_image_instance_init (glViewImage *view_image)
+gl_view_image_init (glViewImage *view_image)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_image->private = g_new0 (glViewImagePrivate, 1);
+       view_image->priv = g_new0 (glViewImagePrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -147,13 +121,15 @@ gl_view_image_instance_init (glViewImage *view_image)
 static void
 gl_view_image_finalize (GObject *object)
 {
-       glLabel       *parent;
+       glViewImage *view_image = GL_VIEW_IMAGE (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_IMAGE (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       g_free (view_image->priv);
+
+       G_OBJECT_CLASS (gl_view_image_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -185,7 +161,7 @@ gl_view_image_new (glLabelImage *object,
        pixbuf = gl_label_image_get_pixbuf(object, NULL);
 
        /* Create analogous canvas item. */
-       view_image->private->item =
+       view_image->priv->item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_image),
                                         gnome_canvas_pixbuf_get_type (),
                                         "x", 0.0,
@@ -267,7 +243,7 @@ update_canvas_item_from_object_cb (glLabelObject *object,
        pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL);
 
        /* Adjust appearance of analogous canvas item. */
-       gnome_canvas_item_set (view_image->private->item,
+       gnome_canvas_item_set (view_image->priv->item,
                               "width_set", TRUE,
                               "height_set", TRUE,
                               "width", w,
index d19c9810ffdaa20735730b7c5d23d96479bac362..693371e9ed7e96409066a7a69368a7e9de0450cc 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -41,13 +43,13 @@ typedef struct _glViewImageClass     glViewImageClass;
 typedef struct _glViewImagePrivate   glViewImagePrivate;
 
 struct _glViewImage {
-       glViewObject        parent_object;
+       glViewObject         parent_object;
 
-       glViewImagePrivate  *private;
+       glViewImagePrivate  *priv;
 };
 
 struct _glViewImageClass {
-       glViewObjectClass   parent_class;
+       glViewObjectClass    parent_class;
 };
 
 
index a025c8c83810a1443e18d96db686ca179e762474..7c2954ba93122d937f760eaf6420ea7b3eb456ae 100644 (file)
@@ -55,15 +55,10 @@ struct _glViewLinePrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
-
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_line_class_init           (glViewLineClass  *klass);
-static void       gl_view_line_instance_init        (glViewLine       *view_line);
 static void       gl_view_line_finalize             (GObject          *object);
 
 static GtkWidget *construct_properties_editor       (glViewObject     *view_object);
@@ -90,41 +85,17 @@ static void       update_editor_from_label_cb       (glLabel          *label,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_line_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewLineClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_line_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewLine),
-                       0,
-                       (GInstanceInitFunc) gl_view_line_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewLine", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewLine, gl_view_line, GL_TYPE_VIEW_OBJECT);
 
 static void
-gl_view_line_class_init (glViewLineClass *klass)
+gl_view_line_class_init (glViewLineClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_line_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_line_finalize;
 
@@ -134,11 +105,11 @@ gl_view_line_class_init (glViewLineClass *klass)
 }
 
 static void
-gl_view_line_instance_init (glViewLine *view_line)
+gl_view_line_init (glViewLine *view_line)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_line->private = g_new0 (glViewLinePrivate, 1);
+       view_line->priv = g_new0 (glViewLinePrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -146,13 +117,15 @@ gl_view_line_instance_init (glViewLine *view_line)
 static void
 gl_view_line_finalize (GObject *object)
 {
-       glLabel       *parent;
+        glViewLine *view_line = GL_VIEW_LINE (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_LINE (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+        g_free (view_line->priv);
+
+       G_OBJECT_CLASS (gl_view_line_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -179,11 +152,11 @@ gl_view_line_new (glLabelLine *object,
                                   GL_VIEW_HIGHLIGHT_LINE_RESIZABLE);
 
        /* Create analogous canvas item. */
-       view_line->private->shadow_item =
+       view_line->priv->shadow_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_line),
                                         gnome_canvas_line_get_type (),
                                         NULL);
-       view_line->private->object_item =
+       view_line->priv->object_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_line),
                                         gnome_canvas_line_get_type (),
                                         NULL);
@@ -286,7 +259,7 @@ update_canvas_item_from_object_cb (glLabelObject *object,
        points->coords[1] = shadow_y;
        points->coords[2] = shadow_x + w;
        points->coords[3] = shadow_y + h;
-       gnome_canvas_item_set (view_line->private->shadow_item,
+       gnome_canvas_item_set (view_line->priv->shadow_item,
                               "points", points,
                               "width_units", line_width,
                               "fill_color_rgba", shadow_line_color,
@@ -294,18 +267,18 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        if (shadow_state)
        {
-               gnome_canvas_item_show (view_line->private->shadow_item);
+               gnome_canvas_item_show (view_line->priv->shadow_item);
        }
        else
        {
-               gnome_canvas_item_hide (view_line->private->shadow_item);
+               gnome_canvas_item_hide (view_line->priv->shadow_item);
        }
 
        points->coords[0] = 0.0;
        points->coords[1] = 0.0;
        points->coords[2] = w;
        points->coords[3] = h;
-       gnome_canvas_item_set (view_line->private->object_item,
+       gnome_canvas_item_set (view_line->priv->object_item,
                               "points", points,
                               "width_units", line_width,
                               "fill_color_rgba", line_color_node->color,
index 5d532d1aa86662ce2049b9d4755ff39de653ff9c..2740433cd2d406489bd4572d8c46d89a2366d5af 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -41,13 +43,13 @@ typedef struct _glViewLineClass     glViewLineClass;
 typedef struct _glViewLinePrivate   glViewLinePrivate;
 
 struct _glViewLine {
-       glViewObject          parent_object;
+       glViewObject        parent_object;
 
-       glViewLinePrivate  *private;
+       glViewLinePrivate  *priv;
 };
 
 struct _glViewLineClass {
-       glViewObjectClass     parent_class;
+       glViewObjectClass   parent_class;
 };
 
 
index a8efeb04da30cdd22cb0c0dfb41dcab74a89e4b6..7ffc765f95824950bd8ee266792fba683d0a0e73 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -56,15 +56,11 @@ struct _glViewObjectPrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static GObjectClass *parent_class = NULL;
-
 
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void     gl_view_object_class_init    (glViewObjectClass   *klass);
-static void     gl_view_object_instance_init (glViewObject        *view_object);
 static void     gl_view_object_finalize      (GObject             *object);
 
 static void     object_moved_cb              (glLabelObject       *object,
@@ -92,40 +88,16 @@ static gint     item_event_arrow_mode        (GnomeCanvasItem     *item,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_object_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewObjectClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_object_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewObject),
-                       0,
-                       (GInstanceInitFunc) gl_view_object_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (G_TYPE_OBJECT,
-                                              "glViewObject", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewObject, gl_view_object, G_TYPE_OBJECT);
 
 static void
-gl_view_object_class_init (glViewObjectClass *klass)
+gl_view_object_class_init (glViewObjectClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) klass;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_object_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_object_finalize;
 
@@ -133,11 +105,11 @@ gl_view_object_class_init (glViewObjectClass *klass)
 }
 
 static void
-gl_view_object_instance_init (glViewObject *view_object)
+gl_view_object_init (glViewObject *view_object)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_object->private = g_new0 (glViewObjectPrivate, 1);
+       view_object->priv = g_new0 (glViewObjectPrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -145,26 +117,27 @@ gl_view_object_instance_init (glViewObject *view_object)
 static void
 gl_view_object_finalize (GObject *object)
 {
-       glLabel       *parent;
+       glViewObject  *view_object = GL_VIEW_OBJECT (object);
        glView        *view;
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_OBJECT (object));
 
-       view = GL_VIEW_OBJECT(object)->private->view;
+       view = view_object->priv->view;
        view->object_list = g_list_remove (view->object_list, object);
        view->selected_object_list =
                g_list_remove (view->selected_object_list, object);
 
-       g_object_unref (GL_VIEW_OBJECT(object)->private->object);
-       g_object_unref (G_OBJECT(GL_VIEW_OBJECT(object)->private->highlight));
-       gtk_object_destroy (GTK_OBJECT(GL_VIEW_OBJECT(object)->private->group));
-       if (GL_VIEW_OBJECT(object)->private->property_editor) {
-               gtk_object_destroy (GTK_OBJECT(GL_VIEW_OBJECT(object)->private->property_editor));
+       g_object_unref (view_object->priv->object);
+       g_object_unref (G_OBJECT(view_object->priv->highlight));
+       gtk_object_destroy (GTK_OBJECT(view_object->priv->group));
+       if (view_object->priv->property_editor) {
+               gtk_object_destroy (GTK_OBJECT(view_object->priv->property_editor));
        }
+       g_free (view_object->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_view_object_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -198,7 +171,7 @@ gl_view_object_set_view       (glViewObject *view_object,
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
        g_return_if_fail (view && GL_IS_VIEW (view));
        
-       view_object->private->view = view;
+       view_object->priv->view = view;
 
        view->object_list = g_list_prepend (view->object_list, view_object);
 
@@ -222,21 +195,21 @@ gl_view_object_set_object     (glViewObject         *view_object,
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
        
-       view_object->private->object = object;
+       view_object->priv->object = object;
 
        gl_label_object_get_position (GL_LABEL_OBJECT(object), &x, &y);
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
 
        /* create canvas group to contain items representing object */
-       view_object->private->group =
-               gnome_canvas_item_new (view_object->private->view->label_group,
+       view_object->priv->group =
+               gnome_canvas_item_new (view_object->priv->view->label_group,
                                       gnome_canvas_group_get_type (),
                                       "x", x,
                                       "y", y,
                                       NULL);
 
        /* Create appropriate selection highlight canvas item. */
-       view_object->private->highlight =
+       view_object->priv->highlight =
                GL_VIEW_HIGHLIGHT (gl_view_highlight_new (view_object, style));
 
        g_signal_connect (G_OBJECT (object), "moved",
@@ -255,7 +228,7 @@ gl_view_object_set_object     (glViewObject         *view_object,
                          G_CALLBACK (flip_rotate_object_cb),
                          view_object);
 
-       g_signal_connect (G_OBJECT (view_object->private->group), "event",
+       g_signal_connect (G_OBJECT (view_object->priv->group), "event",
                          G_CALLBACK (gl_view_object_item_event_cb),
                          view_object);
 
@@ -274,7 +247,7 @@ gl_view_object_get_view   (glViewObject *view_object)
 
        gl_debug (DEBUG_VIEW, "END");
 
-       return view_object->private->view;
+       return view_object->priv->view;
 }
 
 /*****************************************************************************/
@@ -289,7 +262,7 @@ gl_view_object_get_object (glViewObject *view_object)
        
        gl_debug (DEBUG_VIEW, "END");
 
-       return view_object->private->object;
+       return view_object->priv->object;
 }
 
 /*****************************************************************************/
@@ -304,7 +277,7 @@ gl_view_object_get_group   (glViewObject *view_object)
        
        gl_debug (DEBUG_VIEW, "END");
 
-       return view_object->private->group;
+       return view_object->priv->group;
 }
 
 /*****************************************************************************/
@@ -324,14 +297,14 @@ gl_view_object_item_new (glViewObject *view_object,
 
        g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL);
 
-       item = gnome_canvas_item_new (GNOME_CANVAS_GROUP(view_object->private->group),
+       item = gnome_canvas_item_new (GNOME_CANVAS_GROUP(view_object->priv->group),
                                      type, NULL);
        
         va_start (args, first_arg_name);
         gnome_canvas_item_set_valist (item, first_arg_name, args);
         va_end (args);
 
-       gl_label_object_get_affine (view_object->private->object, affine);
+       gl_label_object_get_affine (view_object->priv->object, affine);
 
        /* Apply a very small rotation, fixes problems with flipped or rotated images */
        art_affine_rotate (delta_affine, DELTA_DEG);
@@ -353,9 +326,9 @@ gl_view_object_show_highlight     (glViewObject *view_object)
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
-       g_return_if_fail (view_object->private->highlight);
+       g_return_if_fail (view_object->priv->highlight);
        
-       gl_view_highlight_show (view_object->private->highlight);
+       gl_view_highlight_show (view_object->priv->highlight);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -369,9 +342,9 @@ gl_view_object_hide_highlight   (glViewObject *view_object)
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
-       g_return_if_fail (view_object->private->highlight);
+       g_return_if_fail (view_object->priv->highlight);
        
-       gl_view_highlight_hide (view_object->private->highlight);
+       gl_view_highlight_hide (view_object->priv->highlight);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -389,23 +362,23 @@ gl_view_object_get_editor (glViewObject *view_object)
 
        if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor != NULL ) {
 
-               if (view_object->private->property_editor == NULL) {
-                       view_object->private->property_editor =
+               if (view_object->priv->property_editor == NULL) {
+                       view_object->priv->property_editor =
                                GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor (view_object);
                }
-               g_signal_connect (G_OBJECT (view_object->private->property_editor),
+               g_signal_connect (G_OBJECT (view_object->priv->property_editor),
                                  "destroy",
                                  G_CALLBACK (gtk_widget_destroyed),
-                                 &view_object->private->property_editor);
+                                 &view_object->priv->property_editor);
        
-               gtk_widget_show (view_object->private->property_editor);
+               gtk_widget_show (view_object->priv->property_editor);
 
        }
 
 
        gl_debug (DEBUG_VIEW, "END");
 
-       return view_object->private->property_editor;
+       return view_object->priv->property_editor;
 }
 
 
@@ -421,7 +394,7 @@ object_moved_cb (glLabelObject *object,
        gl_debug (DEBUG_VIEW, "START");
 
        /* Adjust location of analogous canvas group. */
-       gnome_canvas_item_move (view_object->private->group, dx, dy);
+       gnome_canvas_item_move (view_object->priv->group, dx, dy);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -436,7 +409,7 @@ raise_object_cb (glLabelObject *object,
        gl_debug (DEBUG_VIEW, "START");
 
        /* send to top */
-       gnome_canvas_item_raise_to_top (view_object->private->group);
+       gnome_canvas_item_raise_to_top (view_object->priv->group);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -451,7 +424,7 @@ lower_object_cb (glLabelObject *object,
        gl_debug (DEBUG_VIEW, "START");
 
        /* Send to bottom */
-       gnome_canvas_item_lower_to_bottom (view_object->private->group);
+       gnome_canvas_item_lower_to_bottom (view_object->priv->group);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -475,7 +448,7 @@ flip_rotate_object_cb (glLabelObject *object,
        art_affine_rotate (delta_affine, DELTA_DEG);
        art_affine_multiply (affine, affine, delta_affine);
        
-       item_list = GNOME_CANVAS_GROUP(view_object->private->group)->item_list;
+       item_list = GNOME_CANVAS_GROUP(view_object->priv->group)->item_list;
        for ( p=item_list; p != NULL; p=p->next ) {
                item = GNOME_CANVAS_ITEM(p->data);
                gnome_canvas_item_affine_absolute (item, affine);
@@ -492,7 +465,7 @@ gl_view_object_select (glViewObject *view_object)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       gl_view_select_object(view_object->private->view, view_object);
+       gl_view_select_object(view_object->priv->view, view_object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
index c2451ba854e11991058ab50fb1b813156519b1d7..fae724e1b082795dc48d11c5b56eca63101d4b15 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,13 +45,13 @@ typedef struct _glViewObjectPrivate   glViewObjectPrivate;
 #include "view-highlight.h"
 
 struct _glViewObject {
-       GObject              parent_object;
+       GObject               parent_object;
 
-       glViewObjectPrivate  *private;
+       glViewObjectPrivate  *priv;
 };
 
 struct _glViewObjectClass {
-       GObjectClass         parent_class;
+       GObjectClass          parent_class;
 
        /*
         * Methods
index 516d0c7f5cb4c8ff1403b1ec053daf66ffcea802..93913369b7ca1592b7addce5ee1cb6540f12318c 100644 (file)
@@ -72,15 +72,10 @@ struct _glViewTextPrivate {
 /* Private globals.                                       */
 /*========================================================*/
 
-static glViewObjectClass *parent_class = NULL;
-
-
 /*========================================================*/
 /* Private function prototypes.                           */
 /*========================================================*/
 
-static void       gl_view_text_class_init            (glViewTextClass  *klass);
-static void       gl_view_text_instance_init         (glViewText       *view_text);
 static void       gl_view_text_finalize              (GObject          *object);
 
 static GtkWidget *construct_properties_editor        (glViewObject     *view_object);
@@ -127,41 +122,17 @@ static gint       item_event_cb                      (GnomeCanvasItem  *item,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-GType
-gl_view_text_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewTextClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_text_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glViewText),
-                       0,
-                       (GInstanceInitFunc) gl_view_text_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GL_TYPE_VIEW_OBJECT,
-                                              "glViewText", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glViewText, gl_view_text, GL_TYPE_VIEW_OBJECT);
 
 static void
-gl_view_text_class_init (glViewTextClass *klass)
+gl_view_text_class_init (glViewTextClass *class)
 {
-       GObjectClass      *object_class      = (GObjectClass *) klass;
-       glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
+       GObjectClass      *object_class      = G_OBJECT_CLASS (class);
+       glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (klass);
+       gl_view_text_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_text_finalize;
 
@@ -171,11 +142,11 @@ gl_view_text_class_init (glViewTextClass *klass)
 }
 
 static void
-gl_view_text_instance_init (glViewText *view_text)
+gl_view_text_init (glViewText *view_text)
 {
        gl_debug (DEBUG_VIEW, "START");
 
-       view_text->private = g_new0 (glViewTextPrivate, 1);
+       view_text->priv = g_new0 (glViewTextPrivate, 1);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -183,13 +154,15 @@ gl_view_text_instance_init (glViewText *view_text)
 static void
 gl_view_text_finalize (GObject *object)
 {
-       glLabel       *parent;
+        glViewText *view_text = GL_VIEW_TEXT (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object && GL_IS_VIEW_TEXT (object));
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+        g_free (view_text->priv);
+
+       G_OBJECT_CLASS (gl_view_text_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -755,19 +728,19 @@ draw_hacktext (glViewText *view_text)
                                        color_node->color);
 
        /* remove previous items from group. */
-       for (li = view_text->private->object_item_list; li != NULL; li = li->next) {
+       for (li = view_text->priv->object_item_list; li != NULL; li = li->next) {
                gl_debug (DEBUG_VIEW, "in loop");
                gtk_object_destroy (GTK_OBJECT (li->data));
        }
-       for (li = view_text->private->shadow_item_list; li != NULL; li = li->next) {
+       for (li = view_text->priv->shadow_item_list; li != NULL; li = li->next) {
                gl_debug (DEBUG_VIEW, "in loop");
                gtk_object_destroy (GTK_OBJECT (li->data));
        }
        gl_debug (DEBUG_VIEW, "1");
-       g_list_free (view_text->private->object_item_list);
-       g_list_free (view_text->private->shadow_item_list);
-       view_text->private->object_item_list = NULL;
-       view_text->private->shadow_item_list = NULL;
+       g_list_free (view_text->priv->object_item_list);
+       g_list_free (view_text->priv->shadow_item_list);
+       view_text->priv->object_item_list = NULL;
+       view_text->priv->shadow_item_list = NULL;
        gl_debug (DEBUG_VIEW, "2");
 
        /* get Gnome Font */
@@ -821,8 +794,8 @@ draw_hacktext (glViewText *view_text)
 
                        gnome_glyphlist_unref (glyphlist);
 
-                       view_text->private->shadow_item_list =
-                               g_list_prepend (view_text->private->shadow_item_list, item);
+                       view_text->priv->shadow_item_list =
+                               g_list_prepend (view_text->priv->shadow_item_list, item);
 
                }
        }
@@ -868,8 +841,8 @@ draw_hacktext (glViewText *view_text)
 
                gnome_glyphlist_unref (glyphlist);
 
-               view_text->private->object_item_list =
-                       g_list_prepend (view_text->private->object_item_list, item);
+               view_text->priv->object_item_list =
+                       g_list_prepend (view_text->priv->object_item_list, item);
 
        }
 
@@ -989,10 +962,10 @@ draw_cursor (glViewText *view_text)
                        points->coords[2] = x_offset;
                        points->coords[3] = GL_LABEL_TEXT_MARGIN + (i+1)*font_size;
                        
-                       if (view_text->private->cursor) {
-                               gtk_object_destroy (GTK_OBJECT (view_text->private->cursor));
+                       if (view_text->priv->cursor) {
+                               gtk_object_destroy (GTK_OBJECT (view_text->priv->cursor));
                        }
-                       view_text->private->cursor =
+                       view_text->priv->cursor =
                                gl_view_object_item_new (GL_VIEW_OBJECT(view_text),
                                                         gnome_canvas_line_get_type (),
                                                         "points", points,
@@ -1001,8 +974,8 @@ draw_cursor (glViewText *view_text)
                                                         NULL);
                        gnome_canvas_points_free (points);
 
-                       if ( !view_text->private->cursor_visible ) {
-                               gnome_canvas_item_hide (view_text->private->cursor);
+                       if ( !view_text->priv->cursor_visible ) {
+                               gnome_canvas_item_hide (view_text->priv->cursor);
                        }
 
                }
@@ -1043,11 +1016,11 @@ mark_set_cb (GtkTextBuffer   *textbuffer,
 static void
 blink_start (glViewText *view_text)
 {
-       if ( !view_text->private->cursor_visible ) return;
+       if ( !view_text->priv->cursor_visible ) return;
 
-       view_text->private->cursor_state = TRUE;
-       gnome_canvas_item_show (view_text->private->cursor);
-       view_text->private->cursor_timeout =
+       view_text->priv->cursor_state = TRUE;
+       gnome_canvas_item_show (view_text->priv->cursor);
+       view_text->priv->cursor_timeout =
                gtk_timeout_add (CURSOR_ON_TIME, (GtkFunction)blink_cb, view_text);
 }
 
@@ -1057,12 +1030,12 @@ blink_start (glViewText *view_text)
 static void
 blink_stop (glViewText *view_text)
 {
-       if ( view_text->private->cursor_timeout ) {
-               gtk_timeout_remove (view_text->private->cursor_timeout);
-               view_text->private->cursor_timeout = 0;
+       if ( view_text->priv->cursor_timeout ) {
+               gtk_timeout_remove (view_text->priv->cursor_timeout);
+               view_text->priv->cursor_timeout = 0;
        }
 
-       gnome_canvas_item_hide (view_text->private->cursor);
+       gnome_canvas_item_hide (view_text->priv->cursor);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1071,20 +1044,20 @@ blink_stop (glViewText *view_text)
 static gboolean
 blink_cb (glViewText *view_text)
 {
-       if ( view_text->private->cursor_visible ) {
+       if ( view_text->priv->cursor_visible ) {
 
-               view_text->private->cursor_state =
-                       !view_text->private->cursor_state;
+               view_text->priv->cursor_state =
+                       !view_text->priv->cursor_state;
 
 
-               if ( view_text->private->cursor_state ) {
-                       gnome_canvas_item_show (view_text->private->cursor);
-                       view_text->private->cursor_timeout =
+               if ( view_text->priv->cursor_state ) {
+                       gnome_canvas_item_show (view_text->priv->cursor);
+                       view_text->priv->cursor_timeout =
                                gtk_timeout_add (CURSOR_ON_TIME,
                                                 (GtkFunction)blink_cb, view_text);
                } else {
-                       gnome_canvas_item_hide (view_text->private->cursor);
-                       view_text->private->cursor_timeout =
+                       gnome_canvas_item_hide (view_text->priv->cursor);
+                       view_text->priv->cursor_timeout =
                                gtk_timeout_add (CURSOR_OFF_TIME,
                                                 (GtkFunction)blink_cb, view_text);
                }
index 679e69a8b414ff35afb1d8e3b771cb5c436e40b3..c17b0fc81e9b88d61b8fc91fa4959c3d9a7d7bfb 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -43,7 +45,7 @@ typedef struct _glViewTextPrivate   glViewTextPrivate;
 struct _glViewText {
        glViewObject        parent_object;
 
-       glViewTextPrivate  *private;
+       glViewTextPrivate  *priv;
 };
 
 struct _glViewTextClass {
index 3ec7d13ce14dce51939268a2fa29cc3fb30e5f5e..f04664746efb9fc4fad786be2a9e093406a8bbff 100644 (file)
@@ -89,8 +89,6 @@ enum {
 /* Private globals                                                          */
 /*==========================================================================*/
 
-static GtkContainerClass *parent_class;
-
 static guint signals[LAST_SIGNAL] = {0};
 
 /* "CLIPBOARD" selection */
@@ -120,8 +118,6 @@ static gdouble zooms[] = {
 /* Local function prototypes                                                */
 /*==========================================================================*/
 
-static void       gl_view_class_init              (glViewClass *class);
-static void       gl_view_init                    (glView *view);
 static void       gl_view_finalize                (GObject *object);
 
 static void       gl_view_construct               (glView *view);
@@ -215,40 +211,16 @@ static void       selection_received_cb          (GtkWidget         *widget,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_view_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glViewClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_view_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glView),
-                       0,
-                       (GInstanceInitFunc) gl_view_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_VBOX,
-                                              "glView", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glView, gl_view, GTK_TYPE_VBOX);
 
 static void
 gl_view_class_init (glViewClass *class)
 {
-       GObjectClass *object_class = (GObjectClass *) class;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_VIEW, "START");
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_view_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_view_finalize;
 
@@ -332,20 +304,18 @@ gl_view_init (glView *view)
 static void
 gl_view_finalize (GObject *object)
 {
-       glView *view;
+       glView *view = GL_VIEW (object);
 
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_VIEW (object));
 
-       view = GL_VIEW (object);
-
        if (view->default_font_family) {
                g_free (view->default_font_family);
        }
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_view_parent_class)->finalize (object);
 
        gl_debug (DEBUG_VIEW, "END");
 }
index 9006ec880ebdc72ef4c3ac3b6971c4b436ea2357..427aef72f39655b8a28ef5c4279e86cbef38f81c 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index 8616e0b3641bfe2df34d7be23a8572f6ef55670e..7491311f4befdd6c2efaba5e993eb6a8421a83f8 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /* wdgt-chain-button.c
  * Modified version of gimpchainbutton.c for gLabels:
  *
@@ -41,9 +43,6 @@ enum
 };
 
 
-static void  gl_wdgt_chain_button_class_init       (glWdgtChainButtonClass *klass);
-static void  gl_wdgt_chain_button_init             (glWdgtChainButton      *button);
-
 static void      gl_wdgt_chain_button_clicked_callback (GtkWidget          *widget,
                                                        glWdgtChainButton  *button);
 static gboolean  gl_wdgt_chain_button_draw_lines       (GtkWidget          *widget,
@@ -62,79 +61,53 @@ static const gchar *gl_wdgt_chain_stock_items[] =
 
 static guint gl_wdgt_chain_button_signals[LAST_SIGNAL] = { 0 };
 
-static GtkTableClass *parent_class = NULL;
 
 
-GType
-gl_wdgt_chain_button_get_type (void)
-{
-  static GType type = 0;
-
-  if (! type)
-    {
-      static const GTypeInfo info =
-      {
-        sizeof (glWdgtChainButtonClass),
-        NULL,           /* base_init      */
-        NULL,           /* base_finalize  */
-        (GClassInitFunc) gl_wdgt_chain_button_class_init,
-        NULL,           /* class_finalize */
-        NULL,           /* class_data     */
-        sizeof (glWdgtChainButton),
-        0,              /* n_preallocs    */
-        (GInstanceInitFunc) gl_wdgt_chain_button_init,
-       NULL
-      };
-
-      type = g_type_register_static (GTK_TYPE_TABLE,
-                                    "glWdgtChainButton", &info, 0);
-    }
+G_DEFINE_TYPE (glWdgtChainButton, gl_wdgt_chain_button, GTK_TYPE_TABLE);
 
-  return type;
-}
 
 static void
-gl_wdgt_chain_button_class_init (glWdgtChainButtonClass *klass)
+gl_wdgt_chain_button_class_init (glWdgtChainButtonClass *class)
 {
-  parent_class = g_type_class_peek_parent (klass);
-
-  gl_wdgt_chain_button_signals[TOGGLED] =
-    g_signal_new ("toggled",
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET (glWdgtChainButtonClass, toggled),
-                 NULL, NULL,
-                 g_cclosure_marshal_VOID__VOID,
-                 G_TYPE_NONE, 0);
-
-  klass->toggled = NULL;
+       gl_wdgt_chain_button_parent_class = g_type_class_peek_parent (class);
+
+       gl_wdgt_chain_button_signals[TOGGLED] =
+               g_signal_new ("toggled",
+                             G_TYPE_FROM_CLASS (class),
+                             G_SIGNAL_RUN_FIRST,
+                             G_STRUCT_OFFSET (glWdgtChainButtonClass, toggled),
+                             NULL, NULL,
+                             g_cclosure_marshal_VOID__VOID,
+                             G_TYPE_NONE, 0);
+
+       class->toggled = NULL;
 }
 
 static void
 gl_wdgt_chain_button_init (glWdgtChainButton *button)
 {
-  button->position = GL_WDGT_CHAIN_TOP;
-  button->active   = FALSE;
-
-  button->line1    = gtk_drawing_area_new ();
-  button->line2    = gtk_drawing_area_new ();
-  button->image    = gtk_image_new ();
-
-  button->button   = gtk_button_new ();
-
-  gtk_button_set_relief (GTK_BUTTON (button->button), GTK_RELIEF_NONE);
-  gtk_container_add (GTK_CONTAINER (button->button), button->image);
-  gtk_widget_show (button->image);
-
-  g_signal_connect (button->button, "clicked",
-                    G_CALLBACK (gl_wdgt_chain_button_clicked_callback),
-                    button);
-  g_signal_connect (button->line1, "expose_event",
-                    G_CALLBACK (gl_wdgt_chain_button_draw_lines),
-                    button);
-  g_signal_connect (button->line2, "expose_event",
-                    G_CALLBACK (gl_wdgt_chain_button_draw_lines),
-                    button);
+       button->position = GL_WDGT_CHAIN_TOP;
+       button->active   = FALSE;
+
+       button->line1    = gtk_drawing_area_new ();
+       button->line2    = gtk_drawing_area_new ();
+       button->image    = gtk_image_new ();
+
+       button->button   = gtk_button_new ();
+
+       gtk_button_set_relief (GTK_BUTTON (button->button), GTK_RELIEF_NONE);
+       gtk_container_add (GTK_CONTAINER (button->button), button->image);
+       gtk_widget_show (button->image);
+
+       g_signal_connect (button->button, "clicked",
+                         G_CALLBACK (gl_wdgt_chain_button_clicked_callback),
+                         button);
+       g_signal_connect (button->line1, "expose_event",
+                         G_CALLBACK (gl_wdgt_chain_button_draw_lines),
+                         button);
+       g_signal_connect (button->line2, "expose_event",
+                         G_CALLBACK (gl_wdgt_chain_button_draw_lines),
+                         button);
 }
 
 
index e6a9f0db38d5086cc38038f3e282ff1340c0803a..382af2a44aa40bdd842ff21d41dcc472b5e356fd 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /* wdgt-chain-button.h
  * Modified version of gimpchainbutton.h for gLabels:
  *
index 1419767d3a529a41f77ca36e0f38d1ec1aadbf02..22c5f040e68c21f29f1444b88c7de415cae498c9 100644 (file)
@@ -83,16 +83,12 @@ typedef void (*glWdgtMediaSelectSignal) (GObject * object, gpointer data);
 /* Private globals                           */
 /*===========================================*/
 
-static GObjectClass *parent_class;
-
 static gint wdgt_media_select_signals[LAST_SIGNAL] = { 0 };
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_wdgt_media_select_class_init    (glWdgtMediaSelectClass *class);
-static void gl_wdgt_media_select_instance_init (glWdgtMediaSelect      *media_select);
 static void gl_wdgt_media_select_finalize      (GObject                *object);
 
 static void gl_wdgt_media_select_construct     (glWdgtMediaSelect      *media_select);
@@ -114,42 +110,17 @@ static void   load_list                        (GtkListStore           *store,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_wdgt_media_select_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo info = {
-                        sizeof (glWdgtMediaSelectClass),
-                        NULL,
-                        NULL,
-                        (GClassInitFunc) gl_wdgt_media_select_class_init,
-                        NULL,
-                        NULL,
-                        sizeof (glWdgtMediaSelect),
-                        0,
-                        (GInstanceInitFunc) gl_wdgt_media_select_instance_init,
-                        NULL
-                };
-
-                type = g_type_register_static (GTK_TYPE_VBOX,
-                                               "glWdgtMediaSelect", &info, 0);
-        }
+G_DEFINE_TYPE (glWdgtMediaSelect, gl_wdgt_media_select, GTK_TYPE_VBOX);
 
-        return type;
-}
 
 static void
 gl_wdgt_media_select_class_init (glWdgtMediaSelectClass *class)
 {
-        GObjectClass *object_class;
+        GObjectClass *object_class = G_OBJECT_CLASS (class);
 
         gl_debug (DEBUG_MEDIA_SELECT, "START");
 
-        object_class = (GObjectClass *) class;
-
-        parent_class = g_type_class_peek_parent (class);
+        gl_wdgt_media_select_parent_class = g_type_class_peek_parent (class);
 
         object_class->finalize = gl_wdgt_media_select_finalize;
 
@@ -166,7 +137,7 @@ gl_wdgt_media_select_class_init (glWdgtMediaSelectClass *class)
 }
 
 static void
-gl_wdgt_media_select_instance_init (glWdgtMediaSelect *media_select)
+gl_wdgt_media_select_init (glWdgtMediaSelect *media_select)
 {
         gl_debug (DEBUG_MEDIA_SELECT, "START");
 
@@ -187,20 +158,17 @@ gl_wdgt_media_select_instance_init (glWdgtMediaSelect *media_select)
 static void
 gl_wdgt_media_select_finalize (GObject *object)
 {
-        glWdgtMediaSelect *media_select;
-        glWdgtMediaSelectClass *class;
+        glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (object);
 
         gl_debug (DEBUG_MEDIA_SELECT, "START");
 
         g_return_if_fail (object != NULL);
         g_return_if_fail (GL_IS_WDGT_MEDIA_SELECT (object));
 
-        media_select = GL_WDGT_MEDIA_SELECT (object);
-
-        G_OBJECT_CLASS (parent_class)->finalize (object);
-
         g_free (media_select->priv);
 
+        G_OBJECT_CLASS (gl_wdgt_media_select_parent_class)->finalize (object);
+
         gl_debug (DEBUG_MEDIA_SELECT, "END");
 }
 
index 9ef51d80c376eba319dbf5027451cc48d20562a8..01501399a7db9cce4111ee51704a9edfe02ccd41 100644 (file)
@@ -76,16 +76,12 @@ struct _glWdgtMiniPreviewPrivate {
 /* Private globals                           */
 /*===========================================*/
 
-static GtkDrawingAreaClass *parent_class;
-
 static gint wdgt_mini_preview_signals[LAST_SIGNAL] = { 0 };
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_wdgt_mini_preview_class_init    (glWdgtMiniPreviewClass *class);
-static void gl_wdgt_mini_preview_instance_init (glWdgtMiniPreview      *preview);
 static void gl_wdgt_mini_preview_finalize      (GObject                *object);
 
 static void gl_wdgt_mini_preview_construct     (glWdgtMiniPreview      *preview,
@@ -149,31 +145,8 @@ static gint find_closest_label                 (glWdgtMiniPreview      *preview,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_wdgt_mini_preview_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glWdgtMiniPreviewClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_wdgt_mini_preview_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glWdgtMiniPreview),
-                       0,
-                       (GInstanceInitFunc) gl_wdgt_mini_preview_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_DRAWING_AREA,
-                                              "glWdgtMiniPreview", &info, 0);
-       }
+G_DEFINE_TYPE (glWdgtMiniPreview, gl_wdgt_mini_preview, GTK_TYPE_DRAWING_AREA);
 
-       return type;
-}
 
 static void
 gl_wdgt_mini_preview_class_init (glWdgtMiniPreviewClass *class)
@@ -183,7 +156,7 @@ gl_wdgt_mini_preview_class_init (glWdgtMiniPreviewClass *class)
 
        gl_debug (DEBUG_MINI_PREVIEW, "START");
 
-       parent_class = gtk_type_class (gtk_hbox_get_type ());
+       gl_wdgt_mini_preview_parent_class = gtk_type_class (gtk_hbox_get_type ());
 
        object_class->finalize = gl_wdgt_mini_preview_finalize;
 
@@ -215,7 +188,7 @@ gl_wdgt_mini_preview_class_init (glWdgtMiniPreviewClass *class)
 }
 
 static void
-gl_wdgt_mini_preview_instance_init (glWdgtMiniPreview *preview)
+gl_wdgt_mini_preview_init (glWdgtMiniPreview *preview)
 {
        gl_debug (DEBUG_MINI_PREVIEW, "START");
 
@@ -231,21 +204,18 @@ gl_wdgt_mini_preview_instance_init (glWdgtMiniPreview *preview)
 static void
 gl_wdgt_mini_preview_finalize (GObject *object)
 {
-       glWdgtMiniPreview *preview;
-       glWdgtMiniPreviewClass *class;
+       glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (object);
 
        gl_debug (DEBUG_MINI_PREVIEW, "START");
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_WDGT_MINI_PREVIEW (object));
 
-       preview = GL_WDGT_MINI_PREVIEW (object);
-
        gl_template_free (preview->priv->template);
        g_free (preview->priv->centers);
        g_free (preview->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_wdgt_mini_preview_parent_class)->finalize (object);
 
        gl_debug (DEBUG_MINI_PREVIEW, "END");
 }
index 7d3b633dc1c0f6bc96a54963990c1fcedfcbc31f..5b2f1090e15065013983c6c7090c4e3113c0abaf 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
 /* Private globals                           */
 /*===========================================*/
 
-static GObjectClass *parent_class;
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_wdgt_print_copies_class_init    (glWdgtPrintCopiesClass * class);
-static void gl_wdgt_print_copies_instance_init (glWdgtPrintCopies * copies);
 static void gl_wdgt_print_copies_finalize      (GObject * object);
 
 static void gl_wdgt_print_copies_construct     (glWdgtPrintCopies * copies,
@@ -72,46 +70,20 @@ preview_pressed (glWdgtMiniPreview *mini_preview,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_wdgt_print_copies_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glWdgtPrintCopiesClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_wdgt_print_copies_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glWdgtPrintCopies),
-                       0,
-                       (GInstanceInitFunc) gl_wdgt_print_copies_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_HBOX,
-                                              "glWdgtPrintCopies", &info, 0);
-       }
-
-       return type;
-}
+G_DEFINE_TYPE (glWdgtPrintCopies, gl_wdgt_print_copies, GTK_TYPE_HBOX);
 
 static void
 gl_wdgt_print_copies_class_init (glWdgtPrintCopiesClass * class)
 {
-       GObjectClass *object_class;
-
-       object_class = (GObjectClass *) class;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_wdgt_print_copies_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_wdgt_print_copies_finalize;
 }
 
 static void
-gl_wdgt_print_copies_instance_init (glWdgtPrintCopies * copies)
+gl_wdgt_print_copies_init (glWdgtPrintCopies * copies)
 {
        copies->labels_per_sheet = 0;
 
@@ -128,15 +100,12 @@ gl_wdgt_print_copies_instance_init (glWdgtPrintCopies * copies)
 static void
 gl_wdgt_print_copies_finalize (GObject * object)
 {
-       glWdgtPrintCopies *copies;
-       glWdgtPrintCopiesClass *class;
+       glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (object);
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_WDGT_PRINT_COPIES (object));
 
-       copies = GL_WDGT_PRINT_COPIES (object);
-
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_wdgt_print_copies_parent_class)->finalize (object);
 }
 
 GtkWidget *
index 5180b185381192a64eac13ed103a0d680bb7e382..7e24dee3c98b6729c64aa8d9d3d9c3a12f625735 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 1d0295aa6f27aa155978da73373abf8feae607cb..dc02de9201c1d718f30fe087db93698a0fb15e99 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
 /* Private globals                           */
 /*===========================================*/
 
-static GObjectClass *parent_class;
-
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_wdgt_print_merge_class_init    (glWdgtPrintMergeClass * class);
-static void gl_wdgt_print_merge_instance_init (glWdgtPrintMerge * merge);
 static void gl_wdgt_print_merge_finalize      (GObject * object);
 
 static void gl_wdgt_print_merge_construct     (glWdgtPrintMerge * merge,
@@ -74,46 +72,21 @@ static void spin_cb                           (GtkSpinButton * spinbutton,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_wdgt_print_merge_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glWdgtPrintMergeClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_wdgt_print_merge_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glWdgtPrintMerge),
-                       0,
-                       (GInstanceInitFunc) gl_wdgt_print_merge_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_HBOX,
-                                              "glWdgtPrintMerge", &info, 0);
-       }
+G_DEFINE_TYPE (glWdgtPrintMerge, gl_wdgt_print_merge, GTK_TYPE_HBOX);
 
-       return type;
-}
 
 static void
 gl_wdgt_print_merge_class_init (glWdgtPrintMergeClass * class)
 {
-       GObjectClass *object_class;
-
-       object_class = (GObjectClass *) class;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_wdgt_print_merge_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_wdgt_print_merge_finalize;
 }
 
 static void
-gl_wdgt_print_merge_instance_init (glWdgtPrintMerge * merge)
+gl_wdgt_print_merge_init (glWdgtPrintMerge * merge)
 {
        merge->mini_preview = NULL;
 
@@ -126,15 +99,12 @@ gl_wdgt_print_merge_instance_init (glWdgtPrintMerge * merge)
 static void
 gl_wdgt_print_merge_finalize (GObject * object)
 {
-       glWdgtPrintMerge *merge;
-       glWdgtPrintMergeClass *class;
+       glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (object);
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_WDGT_PRINT_MERGE (object));
 
-       merge = GL_WDGT_PRINT_MERGE (object);
-
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_wdgt_print_merge_parent_class)->finalize (object);
 }
 
 GtkWidget *
index a2a2d387134986487bdc312a0ff1b7201db1ed6c..9e3a24da743b17cde4fe7d277e36c02abb3a6c49 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index afd0027b4a33d7b4b90b2c4662bc606f80c23f75..b4f99ef7e62816699aff8bbf3bb0d65cd5611743 100644 (file)
@@ -67,22 +67,16 @@ enum {
        LAST_SIGNAL
 };
 
-typedef void (*glWdgtRotateLabelSignal) (GObject * object, gpointer data);
-
 /*===========================================*/
 /* Private globals                           */
 /*===========================================*/
 
-static GObjectClass *parent_class;
-
 static gint wdgt_rotate_label_signals[LAST_SIGNAL] = { 0 };
 
 /*===========================================*/
 /* Local function prototypes                 */
 /*===========================================*/
 
-static void gl_wdgt_rotate_label_class_init    (glWdgtRotateLabelClass *class);
-static void gl_wdgt_rotate_label_instance_init (glWdgtRotateLabel      *rotate_label);
 static void gl_wdgt_rotate_label_finalize      (GObject                *object);
 
 static void gl_wdgt_rotate_label_construct     (glWdgtRotateLabel      *rotate_label);
@@ -118,40 +112,15 @@ static gboolean expose_cb                      (GtkWidget              *drawinga
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_wdgt_rotate_label_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glWdgtRotateLabelClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_wdgt_rotate_label_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glWdgtRotateLabel),
-                       0,
-                       (GInstanceInitFunc) gl_wdgt_rotate_label_instance_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_VBOX,
-                                              "glWdgtRotateLabel", &info, 0);
-       }
+G_DEFINE_TYPE (glWdgtRotateLabel, gl_wdgt_rotate_label, GTK_TYPE_VBOX);
 
-       return type;
-}
 
 static void
 gl_wdgt_rotate_label_class_init (glWdgtRotateLabelClass *class)
 {
-       GObjectClass *object_class;
-
-       object_class = (GObjectClass *) class;
+       GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_wdgt_rotate_label_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_wdgt_rotate_label_finalize;
 
@@ -167,7 +136,7 @@ gl_wdgt_rotate_label_class_init (glWdgtRotateLabelClass *class)
 }
 
 static void
-gl_wdgt_rotate_label_instance_init (glWdgtRotateLabel *rotate_label)
+gl_wdgt_rotate_label_init (glWdgtRotateLabel *rotate_label)
 {
         rotate_label->priv = g_new0 (glWdgtRotateLabelPrivate, 1);
 
@@ -184,22 +153,18 @@ gl_wdgt_rotate_label_instance_init (glWdgtRotateLabel *rotate_label)
 static void
 gl_wdgt_rotate_label_finalize (GObject *object)
 {
-       glWdgtRotateLabel      *rotate_label;
-       glWdgtRotateLabelClass *class;
+       glWdgtRotateLabel      *rotate_label = GL_WDGT_ROTATE_LABEL (object);
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (object));
 
-       rotate_label = GL_WDGT_ROTATE_LABEL (object);
-
        if (rotate_label->priv->template) {
                gl_template_free (rotate_label->priv->template);
                rotate_label->priv->template = NULL;
        }
-
        g_free (rotate_label->priv);
 
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_wdgt_rotate_label_parent_class)->finalize (object);
 }
 
 GtkWidget *
index a72a77d10fe8922aa281a710fa9a4c540d3a6bad..9d66e851f5a056a908ab93b8fcda60b4cd96d3ba 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
@@ -42,9 +42,9 @@
 
 #include "debug.h"
 
-/*============================================================================*/
-/* Private macros and constants.                                              */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private macros and constants.                                             */
+/*===========================================================================*/
 
 #define DEFAULT_WINDOW_WIDTH  788
 #define DEFAULT_WINDOW_HEIGHT 600
 #define CURSOR_INFO_WIDTH     150
 #define ZOOM_INFO_WIDTH        50
 
-/*============================================================================*/
-/* Private globals                                                            */
-/*============================================================================*/
-static GtkWindowClass *parent_class;
+/*===========================================================================*/
+/* Private globals                                                           */
+/*===========================================================================*/
 
 static GList *window_list = NULL;
 
 
-/*============================================================================*/
-/* Local function prototypes                                                  */
-/*============================================================================*/
+/*===========================================================================*/
+/* Local function prototypes                                                 */
+/*===========================================================================*/
 
-static void     gl_window_class_init   (glWindowClass *class);
-static void     gl_window_init         (glWindow      *window);
 static void     gl_window_finalize     (GObject       *object);
 static void     gl_window_destroy      (GtkObject     *gtk_object);
 
@@ -106,41 +103,18 @@ static void     modified_changed_cb    (glLabel       *label,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-GType
-gl_window_get_type (void)
-{
-       static GType type = 0;
-
-       if (!type) {
-               static const GTypeInfo info = {
-                       sizeof (glWindowClass),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc) gl_window_class_init,
-                       NULL,
-                       NULL,
-                       sizeof (glWindow),
-                       0,
-                       (GInstanceInitFunc) gl_window_init,
-                       NULL
-               };
-
-               type = g_type_register_static (GTK_TYPE_WINDOW,
-                                              "glWindow", &info, 0);
-       }
+G_DEFINE_TYPE (glWindow, gl_window, GTK_TYPE_WINDOW);
 
-       return type;
-}
 
 static void
 gl_window_class_init (glWindowClass *class)
 {
-       GObjectClass   *object_class     = (GObjectClass *) class;
-       GtkObjectClass *gtk_object_class = (GtkObjectClass *) class;
+       GObjectClass   *object_class     = G_OBJECT_CLASS (class);
+       GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (class);
 
        gl_debug (DEBUG_WINDOW, "START");
 
-       parent_class = g_type_class_peek_parent (class);
+       gl_window_parent_class = g_type_class_peek_parent (class);
 
        object_class->finalize = gl_window_finalize;
 
@@ -234,16 +208,14 @@ gl_window_init (glWindow *window)
 static void
 gl_window_finalize (GObject *object)
 {
-       glWindow *window;
+       glWindow *window = GL_WINDOW (object);
 
        gl_debug (DEBUG_WINDOW, "START");
 
        g_return_if_fail (object != NULL);
        g_return_if_fail (GL_IS_WINDOW (object));
 
-       window = GL_WINDOW (object);
-
-       G_OBJECT_CLASS (parent_class)->finalize (object);
+       G_OBJECT_CLASS (gl_window_parent_class)->finalize (object);
 
        gl_debug (DEBUG_WINDOW, "END");
 }
@@ -266,8 +238,8 @@ gl_window_destroy (GtkObject *gtk_object)
                window->ui = NULL;
         }
 
-       if (GTK_OBJECT_CLASS (parent_class)->destroy) {
-               GTK_OBJECT_CLASS (parent_class)->destroy (gtk_object);
+       if (GTK_OBJECT_CLASS (gl_window_parent_class)->destroy) {
+               GTK_OBJECT_CLASS (gl_window_parent_class)->destroy (gtk_object);
        }
 
        gl_debug (DEBUG_WINDOW, "END");
index 44ccd19535b125d22d1e4ef49fbe9ec44e35dfff..ff0ded3f7e0947cd82619323b85fcc9f1523b088 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
index a0c5515bc43a9b9a3212a92c15918597f4be87d0..fd775b935e45b16b426a0d42a5f698281d934861 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 65dfc44dbe2ce366e28de0eb0320aa99a95dd9af..be11bafddfd257a8d7e0277a2cd10bb53c04db86 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 21479da099c72ecc92e2fad6680bb1d4e34789db..94448d8a93f66af34356be56f98ec1755d697c65 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 033df2f5c76f5d9a58836db36410a6fdc8aa3814..eb98d6d0a5f22ff3de0a90d73859ac8aea173b62 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 2234bf3b3ae8889a2201f6da0fe57d310e5c77c4..d4fa00aa6925d43bac72e53be2f1be494667f907 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
index 738b27bf853d841f60c398ce03a0ffef0420e3c4..5c5f0c37f16ff3234bded2d9dc6f38cde6e4b90d 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *