+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.
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
#ifndef __GL_CANVAS_HACKTEXT_H__
#define __GL_CANVAS_HACKTEXT_H__
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
-/* -*- 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
-/* -*- 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
#include <libgnomeui/gnome-window-icon.h>
#include "critical-error-handler.h"
-#include "splash.h"
#include "stock.h"
#include "merge-init.h"
#include "recent.h"
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- 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 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,
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;
}
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);
}
/*****************************************************************************/
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));
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));
{
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
{
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;
}
/*---------------------------------------------------------------------------*/
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);
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));
}
}
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glLabelBarcode {
glLabelObject object;
- glLabelBarcodePrivate *private;
+ glLabelBarcodePrivate *priv;
};
struct _glLabelBarcodeClass {
+/* -*- 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 = 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,
/*****************************************************************************/
/* 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;
}
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);
}
/*****************************************************************************/
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));
}
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));
}
}
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));
}
}
g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0);
- return lbox->private->line_width;
+ return lbox->priv->line_width;
}
/*---------------------------------------------------------------------------*/
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);
}
/*---------------------------------------------------------------------------*/
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glLabelBox {
glLabelObject object;
- glLabelBoxPrivate *private;
+ glLabelBoxPrivate *priv;
};
struct _glLabelBoxClass {
+/* -*- 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 = 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,
/*****************************************************************************/
/* 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;
}
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);
}
/*****************************************************************************/
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));
}
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));
}
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));
}
}
g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0);
- return lellipse->private->line_width;
+ return lellipse->priv->line_width;
}
/*---------------------------------------------------------------------------*/
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);
}
/*---------------------------------------------------------------------------*/
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glLabelEllipse {
glLabelObject object;
- glLabelEllipsePrivate *private;
+ glLabelEllipsePrivate *priv;
};
struct _glLabelEllipseClass {
+/* -*- 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 = NULL;
-
static guint instance = 0;
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,
/*****************************************************************************/
/* 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;
}
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)
/* 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);
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 ) ) {
}
/* 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 ) {
{
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 *
{
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;
/* 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);
}
- return limage->private->pixbuf;
+ return limage->priv->pixbuf;
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glLabelImage {
glLabelObject object;
- glLabelImagePrivate *private;
+ glLabelImagePrivate *priv;
};
struct _glLabelImageClass {
+/* -*- 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 = 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,
/*****************************************************************************/
/* 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;
}
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);
}
/*****************************************************************************/
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));
}
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));
}
}
g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0);
- return lline->private->line_width;
+ return lline->priv->line_width;
}
/*---------------------------------------------------------------------------*/
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glLabelLine {
glLabelObject object;
- glLabelLinePrivate *private;
+ glLabelLinePrivate *priv;
};
struct _glLabelLineClass {
/* Private globals. */
/*========================================================*/
-static GObjectClass *parent_class = NULL;
-
static guint signals[LAST_SIGNAL] = {0};
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,
/*****************************************************************************/
/* 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,
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,
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,
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,
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,
}
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");
}
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");
}
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);
gl_debug (DEBUG_LABEL, "END");
- return g_strdup(object->private->name);
+ return g_strdup(object->priv->name);
}
/*****************************************************************************/
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);
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);
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");
}
{
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);
}
/* 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;
}
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;
}
{
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;
}
/*****************************************************************************/
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");
}
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);
}
g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
- return object->private->shadow_state;
+ return object->priv->shadow_state;
}
/****************************************************************************/
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);
}
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");
}
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));
}
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);
}
/****************************************************************************/
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);
}
g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
- return object->private->shadow_opacity;
+ return object->priv->shadow_opacity;
}
/****************************************************************************/
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);
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);
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);
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];
}
/****************************************************************************/
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];
}
/****************************************************************************/
glLabel *parent;
- glLabelObjectPrivate *private;
+ glLabelObjectPrivate *priv;
};
struct _glLabelObjectClass {
/* 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,
/*****************************************************************************/
/* 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;
}
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);
}
/*****************************************************************************/
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);
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");
{
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL);
- return ltext->private->buffer;
+ return ltext->priv->buffer;
}
GList *
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);
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);
}
/*---------------------------------------------------------------------------*/
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;
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);
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);
}
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));
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));
}
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));
}
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));
}
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));
}
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));
}
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));
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);
}
/*---------------------------------------------------------------------------*/
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0);
- return ltext->private->font_size;
+ return ltext->priv->font_size;
}
/*---------------------------------------------------------------------------*/
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), PANGO_WEIGHT_NORMAL);
- return ltext->private->font_weight;
+ return ltext->priv->font_weight;
}
/*---------------------------------------------------------------------------*/
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), FALSE);
- return ltext->private->font_italic_flag;
+ return ltext->priv->font_italic_flag;
}
/*---------------------------------------------------------------------------*/
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT);
- return ltext->private->align;
+ return ltext->priv->align;
}
/*---------------------------------------------------------------------------*/
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0);
- return ltext->private->line_spacing;
+ return ltext->priv->line_spacing;
}
/*---------------------------------------------------------------------------*/
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);
}
/*****************************************************************************/
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));
}
g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0);
- return ltext->private->auto_shrink;
+ return ltext->priv->auto_shrink;
}
struct _glLabelText {
glLabelObject object;
- glLabelTextPrivate *private;
+ glLabelTextPrivate *priv;
};
struct _glLabelTextClass {
+/* -*- 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 = NULL;
-
static guint signals[LAST_SIGNAL] = {0};
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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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");
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);
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);
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);
}
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);
}
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);
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);
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);
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);
gl_debug (DEBUG_LABEL, "END");
- return gl_template_dup (label->private->template);
+ return gl_template_dup (label->priv->template);
}
/****************************************************************************/
gl_debug (DEBUG_LABEL, "END");
- return label->private->rotate_flag;
+ return label->priv->rotate_flag;
}
/****************************************************************************/
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;
}
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);
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);
gl_debug (DEBUG_LABEL, "END");
- return gl_merge_dup (label->private->merge);
+ return gl_merge_dup (label->priv->merge);
}
/****************************************************************************/
{
gl_debug (DEBUG_LABEL, "");
- return g_strdup ( label->private->filename );
+ return g_strdup ( label->priv->filename );
}
/****************************************************************************/
{
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);
GHashTable *
gl_label_get_pixbuf_cache (glLabel *label)
{
- return label->private->pixbuf_cache;
+ return label->priv->pixbuf_cache;
}
/****************************************************************************/
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;
}
/****************************************************************************/
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);
}
/****************************************************************************/
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);
}
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);
}
}
gl_debug (DEBUG_LABEL, "actual set %d", compression);
- label->private->compression = compression;
+ label->priv->compression = compression;
}
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;
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
GList *objects;
- glLabelPrivate *private;
+ glLabelPrivate *priv;
};
struct _glLabelClass {
/* 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,
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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:
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:
/* 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))
{
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;
}
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;
}
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))
{
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;
}
/*--------------------------------------------------------------------------*/
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 */
}
* 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))
{
/* 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;
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))
{
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
/* The following object arguments are available:
*
* name type description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
* query gchar* The query used to select records
*
*/
struct _glMergeEvolution {
- glMerge object;
+ glMerge object;
- glMergeEvolutionPrivate *private;
+ glMergeEvolutionPrivate *priv;
};
struct _glMergeEvolutionClass {
- glMergeClass parent_class;
+ glMergeClass parent_class;
};
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
/* 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,
/*****************************************************************************/
/* 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;
}
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");
}
-/* -*- 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
+/* -*- 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 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,
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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:
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:
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);
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;
}
}
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;
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;
}
/*---------------------------------------------------------------------------*/
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
/* The following object arguments are available:
*
* name type description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
* delim gchar Field delimiter.
*
*/
struct _glMergeText {
glMerge object;
- glMergeTextPrivate *private;
+ glMergeTextPrivate *priv;
};
struct _glMergeTextClass {
/* 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,
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;
}
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");
}
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");
}
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);
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;
}
}
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 */
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
/* The following object arguments are available:
*
* name type description
- * --------------------------------------------------------------------------------
+ * ---------------------------------------------------------------------------
*
*/
struct _glMergeVCard {
glMerge object;
- glMergeVCardPrivate *private;
+ glMergeVCardPrivate *priv;
};
struct _glMergeVCardClass {
+/* -*- 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 = 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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;
}
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 ) {
g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup("None"));
- return g_strdup(merge->private->name);
+ return g_strdup(merge->priv->name);
}
/*****************************************************************************/
g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup(_("None")));
- return g_strdup(merge->private->description);
+ return g_strdup(merge->priv->description);
}
/*****************************************************************************/
g_return_val_if_fail (GL_IS_MERGE (merge), GL_MERGE_SRC_IS_FIXED);
- return merge->private->src_type;
+ return merge->priv->src_type;
}
/*****************************************************************************/
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 )
record_list = g_list_append( record_list, record );
}
merge_close (merge);
- merge->private->record_list = record_list;
+ merge->priv->record_list = record_list;
}
g_return_val_if_fail (GL_IS_MERGE (merge), NULL);
- return g_strdup(merge->private->src);
+ return g_strdup(merge->priv->src);
}
/*****************************************************************************/
gl_debug (DEBUG_MERGE, "");
if ( merge != NULL ) {
- return merge->private->record_list;
+ return merge->priv->record_list;
} else {
return NULL;
}
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 ++;
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glMerge {
GObject object;
- glMergePrivate *private;
+ glMergePrivate *priv;
};
struct _glMergeClass {
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
/* 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,
/*****************************************************************************/
/* 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;
}
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");
-/* -*- 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
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
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,
/*****************************************************************************/
/* 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;
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");
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
-/* -*- 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
/* 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");
}
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");
}
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;
/* 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));
}
/*--------------------------------------------------------------------------*/
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);
}
}
/* 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:
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. */
}
}
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;
}
/* 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;
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;
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. */
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);
-/* -*- 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
+/* -*- 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 = 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,
/*****************************************************************************/
/* 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;
}
static void
-gl_prefs_model_instance_init (glPrefsModel *prefs_model)
+gl_prefs_model_init (glPrefsModel *prefs_model)
{
gl_debug (DEBUG_PREFS, "START");
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");
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- 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 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,
/*****************************************************************************/
/* 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;
}
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) {
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- 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 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;
}
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");
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
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);
}
-/* -*- 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
#include "debug.h"
-/*============================================================================*/
-/* Private macros and constants. */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private macros and constants. */
+/*===========================================================================*/
-/*============================================================================*/
-/* Private data types */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private data types */
+/*===========================================================================*/
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);
/****************************************************************************/
/* 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;
}
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");
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");
}
-/* -*- 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
#include "debug.h"
-/*============================================================================*/
-/* Private macros and constants. */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private macros and constants. */
+/*===========================================================================*/
#define DEFAULT_SIDEBAR_WIDTH 340
-/*============================================================================*/
-/* Private data types */
-/*============================================================================*/
+/*===========================================================================*/
+/* Private data types */
+/*===========================================================================*/
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);
/****************************************************************************/
/* 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;
}
static void
-gl_ui_sidebar_instance_init (glUISidebar *sidebar)
+gl_ui_sidebar_init (glUISidebar *sidebar)
{
gl_debug (DEBUG_UI, "START");
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");
}
-/* -*- 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
-/* -*- 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
-/* -*- 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
-/* -*- 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
-/* -*- 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
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- 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 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
}
/* 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 */
"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')
{
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);
"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);
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
typedef struct _glViewBarcodePrivate glViewBarcodePrivate;
struct _glViewBarcode {
- glViewObject parent_object;
+ glViewObject parent_object;
- glViewBarcodePrivate *private;
+ glViewBarcodePrivate *priv;
};
struct _glViewBarcodeClass {
- glViewObjectClass parent_class;
+ glViewObjectClass parent_class;
};
/* 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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);
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,
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,
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glViewBox {
glViewObject parent_object;
- glViewBoxPrivate *private;
+ glViewBoxPrivate *priv;
};
struct _glViewBoxClass {
/* 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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);
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,
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,
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
typedef struct _glViewEllipsePrivate glViewEllipsePrivate;
struct _glViewEllipse {
- glViewObject parent_object;
+ glViewObject parent_object;
- glViewEllipsePrivate *private;
+ glViewEllipsePrivate *priv;
};
struct _glViewEllipseClass {
- glViewObjectClass parent_class;
+ glViewObjectClass parent_class;
};
+/* -*- 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 = 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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,
}
- 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");
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,
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,
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,
"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,
"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,
"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,
"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,
"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,
"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,
"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,
"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
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));
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,
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,
"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,
"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
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));
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,
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);
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);
}
/****************************************************************************/
void
gl_view_highlight_hide (glViewHighlight *view_highlight)
{
- gnome_canvas_item_hide (view_highlight->private->group);
+ gnome_canvas_item_hide (view_highlight->priv->group);
}
/*---------------------------------------------------------------------------*/
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");
}
/* 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");
}
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:
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:
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,
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");
}
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);
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,
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");
}
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");
}
{
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;
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) {
&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);
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;
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);
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 {
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;
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) {
&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);
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;
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);
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 {
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;
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) {
&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);
/* 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;
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);
/* 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 {
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;
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) {
&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);
/* 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;
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);
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 {
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;
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;
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) {
&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;
/* 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;
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;
/* 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 {
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;
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) {
&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;
/* 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;
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;
/* 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 {
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;
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) {
&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);
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;
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);
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 {
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;
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) {
&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);
/* 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;
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);
/* 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 {
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;
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) {
&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;
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;
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;
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;
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;
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) {
&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 */
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;
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 */
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;
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;
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glViewHighlight {
GObject parent_object;
- glViewHighlightPrivate *private;
+ glViewHighlightPrivate *priv;
};
struct _glViewHighlightClass {
+/* -*- 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 glViewObjectClass *parent_class = NULL;
-
/* Save state of image file entry */
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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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,
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,
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
typedef struct _glViewImagePrivate glViewImagePrivate;
struct _glViewImage {
- glViewObject parent_object;
+ glViewObject parent_object;
- glViewImagePrivate *private;
+ glViewImagePrivate *priv;
};
struct _glViewImageClass {
- glViewObjectClass parent_class;
+ glViewObjectClass parent_class;
};
/* 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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);
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,
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,
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
typedef struct _glViewLinePrivate glViewLinePrivate;
struct _glViewLine {
- glViewObject parent_object;
+ glViewObject parent_object;
- glViewLinePrivate *private;
+ glViewLinePrivate *priv;
};
struct _glViewLineClass {
- glViewObjectClass parent_class;
+ glViewObjectClass parent_class;
};
-/* -*- 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
/* 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,
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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);
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",
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);
gl_debug (DEBUG_VIEW, "END");
- return view_object->private->view;
+ return view_object->priv->view;
}
/*****************************************************************************/
gl_debug (DEBUG_VIEW, "END");
- return view_object->private->object;
+ return view_object->priv->object;
}
/*****************************************************************************/
gl_debug (DEBUG_VIEW, "END");
- return view_object->private->group;
+ return view_object->priv->group;
}
/*****************************************************************************/
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);
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");
}
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");
}
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;
}
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");
}
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");
}
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");
}
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);
{
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");
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
#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
/* 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);
/*****************************************************************************/
/* 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;
}
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");
}
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");
}
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 */
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);
}
}
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);
}
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,
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);
}
}
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);
}
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);
}
/*--------------------------------------------------------------------------*/
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
struct _glViewText {
glViewObject parent_object;
- glViewTextPrivate *private;
+ glViewTextPrivate *priv;
};
struct _glViewTextClass {
/* Private globals */
/*==========================================================================*/
-static GtkContainerClass *parent_class;
-
static guint signals[LAST_SIGNAL] = {0};
/* "CLIPBOARD" selection */
/* 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);
/****************************************************************************/
/* 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;
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");
}
-/* -*- 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
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/* wdgt-chain-button.c
* Modified version of gimpchainbutton.c for gLabels:
*
};
-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,
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);
}
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/* wdgt-chain-button.h
* Modified version of gimpchainbutton.h for gLabels:
*
/* 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);
/****************************************************************************/
/* 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;
}
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");
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");
}
/* 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,
/****************************************************************************/
/* 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)
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;
}
static void
-gl_wdgt_mini_preview_instance_init (glWdgtMiniPreview *preview)
+gl_wdgt_mini_preview_init (glWdgtMiniPreview *preview)
{
gl_debug (DEBUG_MINI_PREVIEW, "START");
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");
}
+/* -*- 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,
/****************************************************************************/
/* 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;
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 *
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- 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,
/****************************************************************************/
/* 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;
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 *
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
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);
/****************************************************************************/
/* 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;
}
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);
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 *
-/* -*- 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
#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);
/****************************************************************************/
/* 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;
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");
}
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");
-/* -*- 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
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*