]> git.sur5r.net Git - glabels/commitdiff
Created generic "get" methods for text, fill and line properties for all label object...
authorJim Evins <evins@snaught.com>
Thu, 27 Nov 2003 06:27:43 +0000 (06:27 +0000)
committerJim Evins <evins@snaught.com>
Thu, 27 Nov 2003 06:27:43 +0000 (06:27 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@356 f5e0f49d-192f-0410-a22d-a8d8700d0965

21 files changed:
glabels2/src/label-barcode.c
glabels2/src/label-barcode.h
glabels2/src/label-box.c
glabels2/src/label-box.h
glabels2/src/label-ellipse.c
glabels2/src/label-ellipse.h
glabels2/src/label-line.c
glabels2/src/label-line.h
glabels2/src/label-object.c
glabels2/src/label-object.h
glabels2/src/label-text.c
glabels2/src/label-text.h
glabels2/src/print.c
glabels2/src/view-barcode.c
glabels2/src/view-box.c
glabels2/src/view-ellipse.c
glabels2/src/view-line.c
glabels2/src/view-text.c
glabels2/src/xml-label-04.c
glabels2/src/xml-label-191.c
glabels2/src/xml-label.c

index 67cd0761f61c8b480c694b950ed48e5ea028369b..b9c767dae51d705376338321169ae5267637e420 100644 (file)
@@ -57,19 +57,21 @@ 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  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,
-                                           glLabelObject       *src_object);
+static void  copy                           (glLabelObject       *dst_object,
+                                            glLabelObject       *src_object);
 
-static void get_size                       (glLabelObject       *object,
-                                           gdouble             *w,
-                                           gdouble             *h);
+static void  get_size                       (glLabelObject       *object,
+                                            gdouble             *w,
+                                            gdouble             *h);
 
-static void set_line_color                 (glLabelObject    *object,
-                                           guint             line_color);
+static void  set_line_color                 (glLabelObject       *object,
+                                            guint                line_color);
+
+static guint get_line_color                 (glLabelObject       *object);
 
 
 \f
@@ -112,6 +114,7 @@ gl_label_barcode_class_init (glLabelBarcodeClass *klass)
        label_object_class->copy           = copy;
        label_object_class->get_size       = get_size;
        label_object_class->set_line_color = set_line_color;
+       label_object_class->get_line_color = get_line_color;
 
        object_class->finalize = gl_label_barcode_finalize;
 }
@@ -166,7 +169,6 @@ copy (glLabelObject *dst_object,
        gboolean             text_flag;
        gboolean             checksum_flag;
        guint                color;
-       gdouble              scale;
 
        gl_debug (DEBUG_LABEL, "START");
 
@@ -174,10 +176,12 @@ copy (glLabelObject *dst_object,
        g_return_if_fail (new_lbc && GL_IS_LABEL_BARCODE (new_lbc));
 
        text_node = gl_label_barcode_get_data (lbc);
-       gl_label_barcode_get_props (lbc, &style, &text_flag, &checksum_flag, &color);
+       gl_label_barcode_get_props (lbc, &style, &text_flag, &checksum_flag);
+       color = get_line_color (src_object);
 
        gl_label_barcode_set_data (new_lbc, text_node);
-       gl_label_barcode_set_props (new_lbc,style, text_flag, checksum_flag, color);
+       gl_label_barcode_set_props (new_lbc,style, text_flag, checksum_flag);
+       set_line_color (dst_object, color);
 
        gl_text_node_free (&text_node);
 
@@ -208,8 +212,7 @@ void
 gl_label_barcode_set_props (glLabelBarcode *lbc,
                            glBarcodeStyle  style,
                            gboolean        text_flag,
-                           gboolean        checksum_flag,
-                           guint           color)
+                           gboolean        checksum_flag)
 {
        gl_debug (DEBUG_LABEL, "START");
 
@@ -218,7 +221,6 @@ gl_label_barcode_set_props (glLabelBarcode *lbc,
        lbc->private->style            = style;
        lbc->private->text_flag        = text_flag;
        lbc->private->checksum_flag    = checksum_flag;
-       lbc->private->color            = color;
 
        gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
 
@@ -241,15 +243,13 @@ void
 gl_label_barcode_get_props (glLabelBarcode *lbc,
                            glBarcodeStyle *style,
                            gboolean       *text_flag,
-                           gboolean       *checksum_flag,
-                           guint          *color)
+                           gboolean       *checksum_flag)
 {
        g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
 
        *style            = lbc->private->style;
        *text_flag        = lbc->private->text_flag;
        *checksum_flag    = lbc->private->checksum_flag;
-       *color            = lbc->private->color;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -322,3 +322,16 @@ set_line_color (glLabelObject *object,
        }
 }
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line color method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_line_color (glLabelObject *object)
+{
+       glLabelBarcode *lbarcode = (glLabelBarcode *)object;
+
+       g_return_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode));
+
+       return lbarcode->private->color;
+}
+
index 4fbecea0a8fd92bc679116ebd931163a384cb048..b89553458ff47e5363c8200d5064dd38d2942b5e 100644 (file)
@@ -63,15 +63,13 @@ void            gl_label_barcode_set_data  (glLabelBarcode *lbc,
 void            gl_label_barcode_set_props (glLabelBarcode *lbc,
                                            glBarcodeStyle  style,
                                            gboolean        text_flag,
-                                           gboolean        checksum_flag,
-                                           guint           color);
+                                           gboolean        checksum_flag);
 
 glTextNode     *gl_label_barcode_get_data  (glLabelBarcode *lbc);
 void            gl_label_barcode_get_props (glLabelBarcode *lbc,
                                            glBarcodeStyle *style,
                                            gboolean       *text_flag,
-                                           gboolean       *checksum_flag,
-                                           guint          *color);
+                                           gboolean       *checksum_flag);
 
 G_END_DECLS
 
index a3db3009ed9e8177e7ef0858332e02e29d7faa34..d054882638a29bd181f1edea5bfaf943aad84315 100644 (file)
@@ -48,21 +48,27 @@ 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    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,
-                                       glLabelObject   *src_object);
+static void    copy                       (glLabelObject   *dst_object,
+                                          glLabelObject   *src_object);
 
-static void set_fill_color              (glLabelObject    *object,
-                                        guint             fill_color);
+static void    set_fill_color              (glLabelObject    *object,
+                                           guint             fill_color);
 
-static void set_line_color              (glLabelObject    *object,
-                                        guint             line_color);
+static void    set_line_color              (glLabelObject    *object,
+                                           guint             line_color);
 
-static void set_line_width              (glLabelObject    *object,
-                                        gdouble           line_width);
+static void    set_line_width              (glLabelObject    *object,
+                                           gdouble           line_width);
+
+static guint   get_fill_color              (glLabelObject    *object);
+
+static guint   get_line_color              (glLabelObject    *object);
+
+static gdouble get_line_width              (glLabelObject    *object);
 
 
 \f
@@ -106,6 +112,9 @@ gl_label_box_class_init (glLabelBoxClass *klass)
        label_object_class->set_fill_color = set_fill_color;
        label_object_class->set_line_color = set_line_color;
        label_object_class->set_line_width = set_line_width;
+       label_object_class->get_fill_color = get_fill_color;
+       label_object_class->get_line_color = get_line_color;
+       label_object_class->get_line_width = get_line_width;
 
        object_class->finalize = gl_label_box_finalize;
 }
@@ -162,84 +171,18 @@ copy (glLabelObject *dst_object,
        g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
        g_return_if_fail (new_lbox && GL_IS_LABEL_BOX (new_lbox));
 
-       line_width = gl_label_box_get_line_width (lbox);
-       line_color = gl_label_box_get_line_color (lbox);
-       fill_color = gl_label_box_get_fill_color (lbox);
+       line_width = get_line_width (src_object);
+       line_color = get_line_color (src_object);
+       fill_color = get_fill_color (src_object);
 
-       gl_label_box_set_line_width (new_lbox, line_width);
-       gl_label_box_set_line_color (new_lbox, line_color);
-       gl_label_box_set_fill_color (new_lbox, fill_color);
+       set_line_width (dst_object, line_width);
+       set_line_color (dst_object, line_color);
+       set_fill_color (dst_object, fill_color);
 
        gl_debug (DEBUG_LABEL, "END");
 }
 
 
-/*****************************************************************************/
-/* Set object params.                                                        */
-/*****************************************************************************/
-void
-gl_label_box_set_line_width (glLabelBox *lbox,
-                            gdouble     line_width)
-{
-       g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
-
-       if ( lbox->private->line_width != line_width ) {
-               lbox->private->line_width = line_width;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
-       }
-}
-
-void
-gl_label_box_set_line_color (glLabelBox *lbox,
-                            guint       line_color)
-{
-       g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
-
-       if ( lbox->private->line_color != line_color ) {
-               lbox->private->line_color = line_color;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
-       }
-}
-
-void
-gl_label_box_set_fill_color (glLabelBox *lbox,
-                            guint       fill_color)
-{
-       g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox));
-
-       if ( lbox->private->fill_color != fill_color ) {
-               lbox->private->fill_color = fill_color;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox));
-       }
-}
-
-/*****************************************************************************/
-/* Get object params.                                                        */
-/*****************************************************************************/
-gdouble
-gl_label_box_get_line_width (glLabelBox *lbox)
-{
-       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0);
-
-       return lbox->private->line_width;
-}
-
-guint
-gl_label_box_get_line_color (glLabelBox *lbox)
-{
-       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
-
-       return lbox->private->line_color;
-}
-
-guint
-gl_label_box_get_fill_color (glLabelBox *lbox)
-{
-       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
-
-       return lbox->private->fill_color;
-}
-
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  Set fill color method.                                          */
 /*---------------------------------------------------------------------------*/
@@ -292,3 +235,42 @@ set_line_width (glLabelObject *object,
 }
 
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get fill color method.                                          */
+/*---------------------------------------------------------------------------*/
+static gdouble
+get_line_width (glLabelObject *object)
+{
+       glLabelBox *lbox = (glLabelBox *)object;
+
+       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0);
+
+       return lbox->private->line_width;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line color method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_line_color (glLabelObject *object)
+{
+       glLabelBox *lbox = (glLabelBox *)object;
+
+       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
+
+       return lbox->private->line_color;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line width method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_fill_color (glLabelObject *object)
+{
+       glLabelBox *lbox = (glLabelBox *)object;
+
+       g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0);
+
+       return lbox->private->fill_color;
+}
+
index d257ab56e3a0d956dcca880cfbb6fd702d559e70..16b6741912b018c8bccd2bc17c0142af02c8eaf2 100644 (file)
@@ -54,20 +54,6 @@ GType         gl_label_box_get_type       (void);
 
 GObject      *gl_label_box_new            (glLabel    *label);
 
-void          gl_label_box_set_line_width (glLabelBox *lbox,
-                                          gdouble     line_width);
-
-void          gl_label_box_set_line_color (glLabelBox *lbox,
-                                          guint       line_color);
-
-void          gl_label_box_set_fill_color (glLabelBox *lbox,
-                                          guint       fill_color);
-
-gdouble       gl_label_box_get_line_width (glLabelBox *lbox);
-guint         gl_label_box_get_line_color (glLabelBox *lbox);
-guint         gl_label_box_get_fill_color (glLabelBox *lbox);
-
-
 G_END_DECLS
 
 #endif /* __LABEL_BOX_H__ */
index 0b333d765035c9b739ee14e5bbf8ca3f70a41117..c034e730a09c7268f2c456c39a3d2dd119f06181 100644 (file)
@@ -48,21 +48,27 @@ 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    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,
-                                           glLabelObject       *src_object);
+static void    copy                           (glLabelObject       *dst_object,
+                                              glLabelObject       *src_object);
 
-static void set_fill_color                 (glLabelObject    *object,
-                                           guint             fill_color);
+static void    set_fill_color                 (glLabelObject       *object,
+                                              guint                fill_color);
 
-static void set_line_color                 (glLabelObject    *object,
-                                           guint             line_color);
+static void    set_line_color                 (glLabelObject       *object,
+                                              guint                line_color);
 
-static void set_line_width                 (glLabelObject    *object,
-                                           gdouble           line_width);
+static void    set_line_width                 (glLabelObject       *object,
+                                              gdouble              line_width);
+
+static guint   get_fill_color                 (glLabelObject       *object);
+
+static guint   get_line_color                 (glLabelObject       *object);
+
+static gdouble get_line_width                 (glLabelObject       *object);
 
 
 \f
@@ -106,6 +112,9 @@ gl_label_ellipse_class_init (glLabelEllipseClass *klass)
        label_object_class->set_fill_color = set_fill_color;
        label_object_class->set_line_color = set_line_color;
        label_object_class->set_line_width = set_line_width;
+       label_object_class->get_fill_color = get_fill_color;
+       label_object_class->get_line_color = get_line_color;
+       label_object_class->get_line_width = get_line_width;
 
        object_class->finalize = gl_label_ellipse_finalize;
 }
@@ -162,84 +171,18 @@ copy (glLabelObject *dst_object,
        g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
        g_return_if_fail (new_lellipse && GL_IS_LABEL_ELLIPSE (new_lellipse));
 
-       line_width = gl_label_ellipse_get_line_width (lellipse);
-       line_color = gl_label_ellipse_get_line_color (lellipse);
-       fill_color = gl_label_ellipse_get_fill_color (lellipse);
+       line_width = get_line_width (src_object);
+       line_color = get_line_color (src_object);
+       fill_color = get_fill_color (src_object);
 
-       gl_label_ellipse_set_line_width (new_lellipse, line_width);
-       gl_label_ellipse_set_line_color (new_lellipse, line_color);
-       gl_label_ellipse_set_fill_color (new_lellipse, fill_color);
+       set_line_width (dst_object, line_width);
+       set_line_color (dst_object, line_color);
+       set_fill_color (dst_object, fill_color);
 
        gl_debug (DEBUG_LABEL, "END");
 }
 
 
-/*****************************************************************************/
-/* Set object params.                                                        */
-/*****************************************************************************/
-void
-gl_label_ellipse_set_line_width (glLabelEllipse *lellipse,
-                                gdouble         line_width)
-{
-       g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
-
-       if ( lellipse->private->line_width != line_width ) {
-               lellipse->private->line_width = line_width;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
-       }
-}
-
-void
-gl_label_ellipse_set_line_color (glLabelEllipse *lellipse,
-                                guint           line_color)
-{
-       g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
-
-       if ( lellipse->private->line_color != line_color ) {
-               lellipse->private->line_color = line_color;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
-       }
-}
-
-void
-gl_label_ellipse_set_fill_color (glLabelEllipse *lellipse,
-                                guint           fill_color)
-{
-       g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse));
-
-       if ( lellipse->private->fill_color != fill_color ) {
-               lellipse->private->fill_color = fill_color;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse));
-       }
-}
-
-/*****************************************************************************/
-/* Get object params.                                                        */
-/*****************************************************************************/
-gdouble
-gl_label_ellipse_get_line_width (glLabelEllipse *lellipse)
-{
-       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0);
-
-       return lellipse->private->line_width;
-}
-
-guint
-gl_label_ellipse_get_line_color (glLabelEllipse *lellipse)
-{
-       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
-
-       return lellipse->private->line_color;
-}
-
-guint
-gl_label_ellipse_get_fill_color (glLabelEllipse *lellipse)
-{
-       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
-
-       return lellipse->private->fill_color;
-}
-
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  Set fill color method.                                          */
 /*---------------------------------------------------------------------------*/
@@ -292,3 +235,43 @@ set_line_width (glLabelObject *object,
 }
 
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get fill color method.                                          */
+/*---------------------------------------------------------------------------*/
+static gdouble
+get_line_width (glLabelObject *object)
+{
+       glLabelEllipse *lellipse = (glLabelEllipse *)object;
+
+       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0);
+
+       return lellipse->private->line_width;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line color method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_line_color (glLabelObject *object)
+{
+       glLabelEllipse *lellipse = (glLabelEllipse *)object;
+
+       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
+
+       return lellipse->private->line_color;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line width method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_fill_color (glLabelObject *object)
+{
+       glLabelEllipse *lellipse = (glLabelEllipse *)object;
+
+       g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0);
+
+       return lellipse->private->fill_color;
+}
+
+
index faf35f3f580b72041add5a4ec60ddc893cd9c9aa..bc950d9cb4256109fb8b20cb3cfe4c9c661d24c7 100644 (file)
@@ -54,20 +54,6 @@ GType           gl_label_ellipse_get_type       (void);
 
 GObject        *gl_label_ellipse_new            (glLabel        *label);
 
-void            gl_label_ellipse_set_line_width (glLabelEllipse *lellipse,
-                                                gdouble         line_width);
-
-void            gl_label_ellipse_set_line_color (glLabelEllipse *lellipse,
-                                                guint           line_color);
-
-void            gl_label_ellipse_set_fill_color (glLabelEllipse *lellipse,
-                                                guint           fill_color);
-
-gdouble         gl_label_ellipse_get_line_width (glLabelEllipse *lellipse);
-guint           gl_label_ellipse_get_line_color (glLabelEllipse *lellipse);
-guint           gl_label_ellipse_get_fill_color (glLabelEllipse *lellipse);
-
-
 G_END_DECLS
 
 #endif /* __LABEL_ELLIPSE_H__ */
index ec189f29ed0e6788c9df8ee06773cc74c3f1169b..4878423233109d8faa5a0431e6192c5f7c14bff8 100644 (file)
@@ -47,18 +47,22 @@ 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    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,
-                                        glLabelObject    *src_object);
+static void    copy                        (glLabelObject    *dst_object,
+                                           glLabelObject    *src_object);
 
-static void set_line_color              (glLabelObject    *object,
-                                        guint             line_color);
+static void    set_line_color              (glLabelObject    *object,
+                                           guint             line_color);
 
-static void set_line_width              (glLabelObject    *object,
-                                        gdouble           line_width);
+static void    set_line_width              (glLabelObject    *object,
+                                           gdouble           line_width);
+
+static guint   get_line_color              (glLabelObject    *object);
+
+static gdouble get_line_width              (glLabelObject    *object);
 
 
 \f
@@ -101,6 +105,8 @@ gl_label_line_class_init (glLabelLineClass *klass)
        label_object_class->copy           = copy;
        label_object_class->set_line_color = set_line_color;
        label_object_class->set_line_width = set_line_width;
+       label_object_class->get_line_color = get_line_color;
+       label_object_class->get_line_width = get_line_width;
 
        object_class->finalize = gl_label_line_finalize;
 }
@@ -157,63 +163,16 @@ copy (glLabelObject *dst_object,
        g_return_if_fail (lline && GL_IS_LABEL_LINE (lline));
        g_return_if_fail (new_lline && GL_IS_LABEL_LINE (new_lline));
 
-       line_width = gl_label_line_get_line_width (lline);
-       line_color = gl_label_line_get_line_color (lline);
+       line_width = get_line_width (src_object);
+       line_color = get_line_color (src_object);
 
-       gl_label_line_set_line_width (new_lline, line_width);
-       gl_label_line_set_line_color (new_lline, line_color);
+       set_line_width (dst_object, line_width);
+       set_line_color (dst_object, line_color);
 
        gl_debug (DEBUG_LABEL, "END");
 }
 
 
-/*****************************************************************************/
-/* Set object params.                                                        */
-/*****************************************************************************/
-void
-gl_label_line_set_line_width (glLabelLine *lline,
-                             gdouble      line_width)
-{
-       g_return_if_fail (lline && GL_IS_LABEL_LINE (lline));
-
-       if ( lline->private->line_width != line_width ) {
-               lline->private->line_width = line_width;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lline));
-       }
-}
-
-void
-gl_label_line_set_line_color (glLabelLine *lline,
-                             guint        line_color)
-{
-       g_return_if_fail (lline && GL_IS_LABEL_LINE (lline));
-
-       if ( lline->private->line_color != line_color ) {
-               lline->private->line_color = line_color;
-               gl_label_object_emit_changed (GL_LABEL_OBJECT(lline));
-       }
-}
-
-
-/*****************************************************************************/
-/* Get object params.                                                        */
-/*****************************************************************************/
-gdouble
-gl_label_line_get_line_width (glLabelLine *lline)
-{
-       g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0);
-
-       return lline->private->line_width;
-}
-
-guint
-gl_label_line_get_line_color (glLabelLine *lline)
-{
-       g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0);
-
-       return lline->private->line_color;
-}
-
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  Set line color method.                                          */
 /*---------------------------------------------------------------------------*/
@@ -249,3 +208,29 @@ set_line_width (glLabelObject *object,
 }
 
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line color method.                                          */
+/*---------------------------------------------------------------------------*/
+static gdouble
+get_line_width (glLabelObject *object)
+{
+       glLabelLine *lline = (glLabelLine *)object;
+
+       g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0);
+
+       return lline->private->line_width;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Get line width method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_line_color (glLabelObject *object)
+{
+       glLabelLine *lline = (glLabelLine *)object;
+
+       g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0);
+
+       return lline->private->line_color;
+}
+
index 84fda6da74d4a2a686cdbef77d4ce895a7d94717..6caeb68537d1ca87b0baa3792b015444586d43ef 100644 (file)
@@ -54,15 +54,6 @@ GType        gl_label_line_get_type       (void);
 
 GObject     *gl_label_line_new            (glLabel     *label);
 
-void         gl_label_line_set_line_width (glLabelLine *lline,
-                                          gdouble      line_width);
-
-void         gl_label_line_set_line_color (glLabelLine *lline,
-                                          guint        line_color);
-
-gdouble      gl_label_line_get_line_width (glLabelLine *lline);
-guint        gl_label_line_get_line_color (glLabelLine *lline);
-
 
 G_END_DECLS
 
index f26a8cb7b7d3ad8d1b4a2e4fe37af983291ddeab..ebdafab116d726a6c2dee2fb3f91ed719979c415 100644 (file)
@@ -705,6 +705,150 @@ gl_label_object_set_text_color (glLabelObject     *object,
        gl_debug (DEBUG_LABEL, "END");
 }
 
+/*****************************************************************************/
+/* Get font family for all text contained in object.                         */
+/*****************************************************************************/
+gchar *
+gl_label_object_get_font_family (glLabelObject     *object)
+{
+       gchar *ret = NULL;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
+/****************************************************************************/
+/* Get font size for all text contained in object.                          */
+/****************************************************************************/
+gdouble
+gl_label_object_get_font_size (glLabelObject     *object)
+{
+       gdouble ret = 0.0;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
+/****************************************************************************/
+/* Get font weight for all text contained in object.                        */
+/****************************************************************************/
+GnomeFontWeight
+gl_label_object_get_font_weight (glLabelObject     *object)
+{
+       GnomeFontWeight ret = GNOME_FONT_BOOK;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), GNOME_FONT_BOOK);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
+/****************************************************************************/
+/* Get font italic flag for all text contained in object.                   */
+/****************************************************************************/
+gboolean
+gl_label_object_get_font_italic_flag (glLabelObject     *object)
+{
+       gboolean ret = FALSE;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
+/****************************************************************************/
+/* Get text alignment for all text contained in object.                     */
+/****************************************************************************/
+GtkJustification
+gl_label_object_get_text_alignment (glLabelObject     *object)
+{
+       GtkJustification ret = GTK_JUSTIFY_LEFT;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), GTK_JUSTIFY_LEFT);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
+/****************************************************************************/
+/* Get text color for all text contained in object.                         */
+/****************************************************************************/
+guint
+gl_label_object_get_text_color (glLabelObject     *object)
+{
+       guint ret = 0;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
 /*****************************************************************************/
 /* Can fill properties be set for this object?                               */
 /*****************************************************************************/
@@ -748,6 +892,30 @@ gl_label_object_set_fill_color (glLabelObject     *object,
        gl_debug (DEBUG_LABEL, "END");
 }
 
+/****************************************************************************/
+/* Get fill color for object.                                               */
+/****************************************************************************/
+guint
+gl_label_object_get_fill_color (glLabelObject     *object)
+{
+       guint ret = 0;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
 /*****************************************************************************/
 /* Can line color property be set for this object?                           */
 /*****************************************************************************/
@@ -791,6 +959,30 @@ gl_label_object_set_line_color (glLabelObject     *object,
        gl_debug (DEBUG_LABEL, "END");
 }
 
+/****************************************************************************/
+/* Get line color for object.                                               */
+/****************************************************************************/
+guint
+gl_label_object_get_line_color (glLabelObject     *object)
+{
+       guint ret = 0;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
 /*****************************************************************************/
 /* Can line width property be set for this object?                           */
 /*****************************************************************************/
@@ -834,6 +1026,30 @@ gl_label_object_set_line_width (glLabelObject     *object,
        gl_debug (DEBUG_LABEL, "END");
 }
 
+/****************************************************************************/
+/* Get line width for object.                                               */
+/****************************************************************************/
+gdouble
+gl_label_object_get_line_width (glLabelObject     *object)
+{
+       gdouble ret = 0.0;
+
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0);
+
+       if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width != NULL ) {
+
+               /* We have an object specific method, use it */
+               ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width (object);
+
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+
+       return ret;
+}
+
 /****************************************************************************/
 /* Flip object horizontally.                                                */
 /****************************************************************************/
index ebb8707fc41e813918ecb1c124df435904c08a51..d2fe2009eefc20a4f2a1aa1320d31cffc6cc0b23 100644 (file)
@@ -70,43 +70,61 @@ struct _glLabelObjectClass {
         * Methods
         */
 
-       void (*set_size)             (glLabelObject     *object,
-                                     gdouble            w,
-                                     gdouble            h);
+       void              (*set_size)             (glLabelObject     *object,
+                                                  gdouble            w,
+                                                  gdouble            h);
 
-       void (*get_size)             (glLabelObject     *object,
-                                     gdouble           *w,
-                                     gdouble           *h);
+       void              (*get_size)             (glLabelObject     *object,
+                                                  gdouble           *w,
+                                                  gdouble           *h);
 
-       void (*set_font_family)      (glLabelObject     *object,
-                                     const gchar       *font_family);
+       void              (*set_font_family)      (glLabelObject     *object,
+                                                  const gchar       *font_family);
 
-       void (*set_font_size)        (glLabelObject     *object,
-                                     gdouble            font_size);
+       void              (*set_font_size)        (glLabelObject     *object,
+                                                  gdouble            font_size);
 
-       void (*set_font_weight)      (glLabelObject     *object,
-                                     GnomeFontWeight    font_weight);
+       void              (*set_font_weight)      (glLabelObject     *object,
+                                                  GnomeFontWeight    font_weight);
 
-       void (*set_font_italic_flag) (glLabelObject     *object,
-                                     gboolean           font_italic_flag);
+       void              (*set_font_italic_flag) (glLabelObject     *object,
+                                                  gboolean           font_italic_flag);
 
-       void (*set_text_alignment)   (glLabelObject     *object,
-                                     GtkJustification   text_alignment);
+       void              (*set_text_alignment)   (glLabelObject     *object,
+                                                  GtkJustification   text_alignment);
 
-       void (*set_text_color)       (glLabelObject     *object,
-                                     guint              text_color);
+       void              (*set_text_color)       (glLabelObject     *object,
+                                                  guint              text_color);
 
-       void (*set_fill_color)       (glLabelObject     *object,
-                                     guint              fill_color);
+       void              (*set_fill_color)       (glLabelObject     *object,
+                                                  guint              fill_color);
 
-       void (*set_line_color)       (glLabelObject     *object,
-                                     guint              line_color);
+       void              (*set_line_color)       (glLabelObject     *object,
+                                                  guint              line_color);
 
-       void (*set_line_width)       (glLabelObject     *object,
-                                     gdouble            line_width);
+       void              (*set_line_width)       (glLabelObject     *object,
+                                                  gdouble            line_width);
 
-       void (*copy)                 (glLabelObject     *dst_object,
-                                     glLabelObject     *src_object);
+       gchar            *(*get_font_family)      (glLabelObject     *object);
+
+       gdouble           (*get_font_size)        (glLabelObject     *object);
+
+       GnomeFontWeight   (*get_font_weight)      (glLabelObject     *object);
+
+       gboolean          (*get_font_italic_flag) (glLabelObject     *object);
+
+       GtkJustification  (*get_text_alignment)   (glLabelObject     *object);
+
+       guint             (*get_text_color)       (glLabelObject     *object);
+
+       guint             (*get_fill_color)       (glLabelObject     *object);
+
+       guint             (*get_line_color)       (glLabelObject     *object);
+
+       gdouble           (*get_line_width)       (glLabelObject     *object);
+
+       void              (*copy)                 (glLabelObject     *dst_object,
+                                                  glLabelObject     *src_object);
 
        /*
         * Signals
@@ -178,6 +196,7 @@ void           gl_label_object_get_extent            (glLabelObject     *object,
                                                      gdouble           *x2,
                                                      gdouble           *y2);
 
+
 gboolean       gl_label_object_can_text              (glLabelObject     *object);
 
 void           gl_label_object_set_font_family       (glLabelObject     *object,
@@ -199,22 +218,41 @@ void           gl_label_object_set_text_color        (glLabelObject     *object,
                                                      guint              text_color);
 
 
+gchar           *gl_label_object_get_font_family       (glLabelObject     *object);
+
+gdouble          gl_label_object_get_font_size         (glLabelObject     *object);
+
+GnomeFontWeight  gl_label_object_get_font_weight       (glLabelObject     *object);
+
+gboolean         gl_label_object_get_font_italic_flag  (glLabelObject     *object);
+
+GtkJustification gl_label_object_get_text_alignment    (glLabelObject     *object);
+
+guint            gl_label_object_get_text_color        (glLabelObject     *object);
+
+
 gboolean       gl_label_object_can_fill              (glLabelObject     *object);
 
 void           gl_label_object_set_fill_color        (glLabelObject     *object,
                                                      guint              fill_color);
 
+guint          gl_label_object_get_fill_color        (glLabelObject     *object);
+
 
 gboolean       gl_label_object_can_line_color        (glLabelObject     *object);
 
 void           gl_label_object_set_line_color        (glLabelObject     *object,
                                                      guint              line_color);
 
+guint          gl_label_object_get_line_color        (glLabelObject     *object);
+
 gboolean       gl_label_object_can_line_width        (glLabelObject     *object);
 
 void           gl_label_object_set_line_width        (glLabelObject     *object,
                                                      gdouble            line_width);
 
+gdouble        gl_label_object_get_line_width        (glLabelObject     *object);
+
 
 void           gl_label_object_raise_to_top          (glLabelObject     *object);
 
index 46fd6d0092f54dc86aca1c95669c3f94a4a97971..883e54a21361f78689f82942591289ebd20e66c7 100644 (file)
@@ -100,6 +100,18 @@ static void set_text_alignment          (glLabelObject    *object,
 static void set_text_color              (glLabelObject    *object,
                                         guint             text_color);
 
+static gchar          *get_font_family             (glLabelObject    *object);
+
+static gdouble         get_font_size               (glLabelObject    *object);
+
+static GnomeFontWeight get_font_weight             (glLabelObject    *object);
+
+static gboolean         get_font_italic_flag       (glLabelObject    *object);
+
+static GtkJustification get_text_alignment          (glLabelObject    *object);
+
+static guint            get_text_color              (glLabelObject    *object);
+
 \f
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
@@ -147,6 +159,12 @@ gl_label_text_class_init (glLabelTextClass *klass)
        label_object_class->set_font_italic_flag = set_font_italic_flag;
        label_object_class->set_text_alignment   = set_text_alignment;
        label_object_class->set_text_color       = set_text_color;
+       label_object_class->get_font_family      = get_font_family;
+       label_object_class->get_font_size        = get_font_size;
+       label_object_class->get_font_weight      = get_font_weight;
+       label_object_class->get_font_italic_flag = get_font_italic_flag;
+       label_object_class->get_text_alignment   = get_text_alignment;
+       label_object_class->get_text_color       = get_text_color;
 
        object_class->finalize = gl_label_text_finalize;
 }
@@ -224,16 +242,14 @@ copy (glLabelObject *dst_object,
        g_return_if_fail (new_ltext && GL_IS_LABEL_TEXT (new_ltext));
 
        lines = gl_label_text_get_lines (ltext);
-       gl_label_text_get_props (ltext,
-                                &font_family, &font_size, &font_weight,
-                                &font_italic_flag,
-                                &color, &just);
-
        gl_label_text_set_lines (new_ltext, lines);
-       gl_label_text_set_props (new_ltext,
-                                font_family, font_size, font_weight,
-                                font_italic_flag,
-                                color, just);
+
+       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->private->color            = ltext->private->color;
+       new_ltext->private->just             = ltext->private->just;
 
        gl_text_node_lines_free (&lines);
        g_free (font_family);
@@ -262,52 +278,6 @@ gl_label_text_set_lines (glLabelText *ltext,
        gl_debug (DEBUG_LABEL, "END");
 }
 
-void
-gl_label_text_set_props (glLabelText     *ltext,
-                        gchar           *font_family,
-                        gdouble          font_size,
-                        GnomeFontWeight  font_weight,
-                        gboolean         font_italic_flag,
-                        guint            color,
-                        GtkJustification just)
-{
-       GList     *family_names;
-       gchar     *good_font_family;
-
-       gl_debug (DEBUG_LABEL, "START");
-
-       g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
-
-       /* Make sure we have a valid font family.  if not provide a good default. */
-       family_names = gnome_font_family_list ();
-       if (g_list_find_custom (family_names, font_family, (GCompareFunc)g_utf8_collate)) {
-               good_font_family = g_strdup (font_family);
-       } else {
-               if (family_names != NULL) {
-                       good_font_family = g_strdup (family_names->data); /* 1st entry */
-               } else {
-                       good_font_family = NULL;
-               }
-       }
-       gnome_font_family_list_free (family_names);
-
-       g_free (ltext->private->font_family);
-
-       ltext->private->font_family      = good_font_family;
-       ltext->private->font_size        = font_size;
-       ltext->private->font_weight      = font_weight;
-       ltext->private->font_italic_flag = font_italic_flag;
-       ltext->private->color            = color;
-       ltext->private->just             = just;
-
-       gl_debug (DEBUG_LABEL, "just = %d", ltext->private->just);
-
-       gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext));
-
-       gl_debug (DEBUG_LABEL, "END");
-}
-
-
 /*****************************************************************************/
 /* Get object params.                                                        */
 /*****************************************************************************/
@@ -337,35 +307,6 @@ gl_label_text_get_lines (glLabelText *ltext)
        return lines;
 }
 
-void
-gl_label_text_get_props (glLabelText      *ltext,
-                        gchar           **font_family,
-                        gdouble          *font_size,
-                        GnomeFontWeight  *font_weight,
-                        gboolean         *font_italic_flag,
-                        guint            *color,
-                        GtkJustification *just)
-{
-       g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
-
-       *font_family      = g_strdup (ltext->private->font_family);
-       *font_size        = ltext->private->font_size;
-       *font_weight      = ltext->private->font_weight;
-       *font_italic_flag = ltext->private->font_italic_flag;
-       *color            = ltext->private->color;
-       *just             = ltext->private->just;
-
-       gl_debug (DEBUG_LABEL, "just = %d", *just);
-}
-
-GtkJustification
-gl_label_text_get_text_alignment (glLabelText *ltext)
-{
-       g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext));
-
-       return ltext->private->just;
-}
-
 void
 gl_label_text_get_box (glLabelText *ltext,
                       gdouble     *w,
@@ -618,3 +559,93 @@ set_text_color (glLabelObject *object,
        gl_debug (DEBUG_LABEL, "END");
 }
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get font family method.                                         */
+/*---------------------------------------------------------------------------*/
+static gchar *
+get_font_family (glLabelObject *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL);
+
+       return g_strdup (ltext->private->font_family);
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get font size method.                                           */
+/*---------------------------------------------------------------------------*/
+static gdouble
+get_font_size (glLabelObject *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0);
+
+       return ltext->private->font_size;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get font weight method.                                         */
+/*---------------------------------------------------------------------------*/
+static GnomeFontWeight
+get_font_weight (glLabelObject   *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GNOME_FONT_BOOK);
+
+       return ltext->private->font_weight;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get font italic flag method.                                    */
+/*---------------------------------------------------------------------------*/
+static gboolean
+get_font_italic_flag (glLabelObject *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), FALSE);
+
+       return ltext->private->font_italic_flag;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get text alignment method.                                      */
+/*---------------------------------------------------------------------------*/
+static GtkJustification
+get_text_alignment (glLabelObject    *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT);
+
+       return ltext->private->just;
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  get text color method.                                          */
+/*---------------------------------------------------------------------------*/
+static guint
+get_text_color (glLabelObject *object)
+{
+       glLabelText    *ltext = (glLabelText *)object;
+
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0);
+
+       return ltext->private->color;
+}
+
index 92a0684fddd77fc9521cdf165f8729241765804c..40bdb3aa5e82fc8e6a201120c0c37c08c8723e0e 100644 (file)
@@ -60,26 +60,8 @@ GObject       *gl_label_text_new          (glLabel          *label);
 
 void           gl_label_text_set_lines    (glLabelText      *ltext,
                                           GList            *lines);
-void           gl_label_text_set_props    (glLabelText      *ltext,
-                                          gchar            *font_family,
-                                          gdouble           font_size,
-                                          GnomeFontWeight   font_weight,
-                                          gboolean          font_italic_flag,
-                                          guint             color,
-                                          GtkJustification  just);
-
 GtkTextBuffer *gl_label_text_get_buffer   (glLabelText      *ltext);
 GList         *gl_label_text_get_lines    (glLabelText      *ltext);
-void           gl_label_text_get_props    (glLabelText      *ltext,
-                                          gchar           **font_family,
-                                          gdouble          *font_size,
-                                          GnomeFontWeight  *font_weight,
-                                          gboolean         *font_italic_flag,
-                                          guint            *color,
-                                          GtkJustification *just);
-
-GtkJustification gl_label_text_get_text_alignment (glLabelText *ltext);
-
 void           gl_label_text_get_box      (glLabelText      *ltext,
                                           gdouble          *w,
                                           gdouble          *h);
index bebc16d6ca3082a555608e9eb8bd28cfb816dbff..f768eae7416dc281e79a1e9b61b824b81154d3b9 100644 (file)
@@ -732,10 +732,12 @@ draw_text_object (PrintInfo     *pi,
 
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &object_w, &object_h);
        lines = gl_label_text_get_lines (object);
-       gl_label_text_get_props (object,
-                                &font_family, &font_size, &font_weight,
-                                &font_italic_flag,
-                                &color, &just);
+       font_family = gl_label_object_get_font_family (GL_LABEL_OBJECT(object));
+       font_size = gl_label_object_get_font_size (GL_LABEL_OBJECT(object));
+       font_weight = gl_label_object_get_font_weight (GL_LABEL_OBJECT(object));
+       font_italic_flag = gl_label_object_get_font_italic_flag (GL_LABEL_OBJECT(object));
+       color = gl_label_object_get_text_color (GL_LABEL_OBJECT(object));
+       just = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object));
 
        font = gnome_font_find_closest_from_weight_slant (
                                        font_family,
@@ -813,9 +815,9 @@ draw_box_object (PrintInfo  *pi,
        gl_debug (DEBUG_PRINT, "START");
 
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_box_get_line_width (object);
-       line_color = gl_label_box_get_line_color (object);
-       fill_color = gl_label_box_get_fill_color (object);
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
 
        /* Paint fill color */
        create_rectangle_path (pi->pc, 0.0, 0.0, w, h);
@@ -853,8 +855,8 @@ draw_line_object (PrintInfo   *pi,
        gl_debug (DEBUG_PRINT, "START");
 
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_line_get_line_width (object);
-       line_color = gl_label_line_get_line_color (object);
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
 
        gnome_print_moveto (pi->pc, 0.0, 0.0);
        gnome_print_lineto (pi->pc, w, h);
@@ -883,9 +885,9 @@ draw_ellipse_object (PrintInfo      *pi,
        gl_debug (DEBUG_PRINT, "START");
 
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_ellipse_get_line_width (object);
-       line_color = gl_label_ellipse_get_line_color (object);
-       fill_color = gl_label_ellipse_get_fill_color (object);
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
 
        rx = w / 2.0;
        ry = h / 2.0;
@@ -990,7 +992,8 @@ draw_barcode_object (PrintInfo      *pi,
 
        text_node = gl_label_barcode_get_data (object);
        gl_label_barcode_get_props (object,
-                                   &style, &text_flag, &checksum_flag, &color);
+                                   &style, &text_flag, &checksum_flag);
+       color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
 
        text = gl_text_node_expand (text_node, record);
index 901ff9b952b1b10322eb6f0e657e85f81faee864..a7bbfc60133eb3810e315113e48c0f145e979308 100644 (file)
@@ -285,7 +285,8 @@ update_object_from_editor_cb (glObjectEditor *editor,
        gl_object_editor_get_bc_style (editor, &style, &text_flag, &cs_flag);
        color = gl_object_editor_get_bc_color (editor);
        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
-                                   style, text_flag, cs_flag, color);
+                                   style, text_flag, cs_flag);
+       gl_label_object_set_line_color (object, color);
 
        g_signal_handlers_unblock_by_func (G_OBJECT(object),
                                           update_editor_from_object_cb,
@@ -317,7 +318,8 @@ update_editor_from_object_cb (glLabelObject  *object,
        gl_object_editor_set_size (editor, w, h);
 
        gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
-                                   &style, &text_flag, &cs_flag, &color);
+                                   &style, &text_flag, &cs_flag);
+       color = gl_label_object_get_line_color (object);
        gl_object_editor_set_bc_style (editor, style, text_flag, cs_flag);
        gl_object_editor_set_bc_color (editor, color);
 
@@ -447,7 +449,8 @@ gl_view_barcode_create_event_handler (GnomeCanvas *canvas,
                        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
                                                    GL_BARCODE_STYLE_POSTNET,
                                                    FALSE,
-                                                   TRUE,
+                                                   TRUE);
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                    gl_color_set_opacity (
                                                      gl_view_get_default_line_color(view),
                                                       0.5));
@@ -475,8 +478,9 @@ gl_view_barcode_create_event_handler (GnomeCanvas *canvas,
                        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
                                                    GL_BARCODE_STYLE_POSTNET,
                                                    FALSE,
-                                                   TRUE,
-                                                   gl_view_get_default_line_color(view));
+                                                   TRUE);
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
+                                                       gl_view_get_default_line_color(view));
                        gl_view_unselect_all (view);
                        gl_view_object_select (GL_VIEW_OBJECT(view_barcode));
                        gl_view_arrow_mode (view);
@@ -535,7 +539,8 @@ draw_barcode (glViewBarcode *view_barcode)
        /* Query label object and properties */
        object = gl_view_object_get_object (GL_VIEW_OBJECT(view_barcode));
        gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
-                                   &style, &text_flag, &checksum_flag, &color);
+                                   &style, &text_flag, &checksum_flag);
+       color = gl_label_object_get_line_color (object);
        gl_label_object_get_size (object, &w, &h);
        text_node = gl_label_barcode_get_data(GL_LABEL_BARCODE(object));
        if (text_node->field_flag) {
index 158d5353e25e57e5b1d6585210ffe7519a3fad98..a2b855748706d3d216282a3188494fbf0bb5cf3e 100644 (file)
@@ -179,9 +179,9 @@ gl_view_box_new (glLabelBox *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_box_get_line_width(object);
-       line_color = gl_label_box_get_line_color(object);
-       fill_color = gl_label_box_get_fill_color(object);
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color(GL_LABEL_OBJECT(object));
 
        /* Create analogous canvas item. */
        view_box->private->item =
@@ -261,9 +261,9 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_box_get_line_width(GL_LABEL_BOX(object));
-       line_color = gl_label_box_get_line_color(GL_LABEL_BOX(object));
-       fill_color = gl_label_box_get_fill_color(GL_LABEL_BOX(object));
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color(GL_LABEL_OBJECT(object));
 
        /* Adjust appearance of analogous canvas item. */
        gnome_canvas_item_set (view_box->private->item,
@@ -336,13 +336,13 @@ update_editor_from_object_cb (glLabelObject  *object,
        gl_label_object_get_size (object, &w, &h);
        gl_object_editor_set_size (editor, w, h);
 
-       fill_color = gl_label_box_get_fill_color (GL_LABEL_BOX(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
        gl_object_editor_set_fill_color (editor, fill_color);
 
-       line_color = gl_label_box_get_line_color (GL_LABEL_BOX(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_color (editor, line_color);
 
-       line_width = gl_label_box_get_line_width (GL_LABEL_BOX(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_width (editor, line_width);
 
        gl_debug (DEBUG_VIEW, "END");
@@ -458,11 +458,11 @@ gl_view_box_create_event_handler (GnomeCanvas *canvas,
                                                  0.0, 0.0);
                        line_color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5);
                        fill_color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5);
-                       gl_label_box_set_line_width (GL_LABEL_BOX(object),
+                       gl_label_object_set_line_width (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_line_width(view));
-                       gl_label_box_set_line_color (GL_LABEL_BOX(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                     line_color);
-                       gl_label_box_set_fill_color (GL_LABEL_BOX(object),
+                       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object),
                                                     fill_color);
                        view_box = gl_view_box_new (GL_LABEL_BOX(object),
                                                    view);
@@ -492,9 +492,9 @@ gl_view_box_create_event_handler (GnomeCanvas *canvas,
                        h = MAX (y, y0) - MIN (y, y0);
                        gl_label_object_set_size (GL_LABEL_OBJECT(object),
                                                  w, h);
-                       gl_label_box_set_line_color (GL_LABEL_BOX(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_line_color(view));
-                       gl_label_box_set_fill_color (GL_LABEL_BOX(object),
+                       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_fill_color(view));
                        gl_view_unselect_all (view);
                        gl_view_object_select (GL_VIEW_OBJECT(view_box));
index 837b5e033e3a42072dba443e06686d66f3e4e83e..37ee8b0c45ae2cb9b2490cef93910936b100644d 100644 (file)
@@ -179,9 +179,9 @@ gl_view_ellipse_new (glLabelEllipse *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_ellipse_get_line_width(object);
-       line_color = gl_label_ellipse_get_line_color(object);
-       fill_color = gl_label_ellipse_get_fill_color(object);
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color(GL_LABEL_OBJECT(object));
 
        /* Create analogous canvas item. */
        view_ellipse->private->item =
@@ -261,9 +261,9 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_ellipse_get_line_width(GL_LABEL_ELLIPSE(object));
-       line_color = gl_label_ellipse_get_line_color(GL_LABEL_ELLIPSE(object));
-       fill_color = gl_label_ellipse_get_fill_color(GL_LABEL_ELLIPSE(object));
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
+       fill_color = gl_label_object_get_fill_color(GL_LABEL_OBJECT(object));
 
        /* Adjust appearance of analogous canvas item. */
        gnome_canvas_item_set (view_ellipse->private->item,
@@ -340,13 +340,13 @@ update_editor_from_object_cb (glLabelObject  *object,
        gl_label_object_get_size (object, &w, &h);
        gl_object_editor_set_size (editor, w, h);
 
-       fill_color = gl_label_ellipse_get_fill_color (GL_LABEL_ELLIPSE(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
        gl_object_editor_set_fill_color (editor, fill_color);
 
-       line_color = gl_label_ellipse_get_line_color (GL_LABEL_ELLIPSE(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_color (editor, line_color);
 
-       line_width = gl_label_ellipse_get_line_width (GL_LABEL_ELLIPSE(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_width (editor, line_width);
 
        gl_debug (DEBUG_VIEW, "END");
@@ -462,11 +462,11 @@ gl_view_ellipse_create_event_handler (GnomeCanvas *canvas,
                                                  0.0, 0.0);
                        line_color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5);
                        fill_color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5);
-                       gl_label_ellipse_set_line_width (GL_LABEL_ELLIPSE(object),
+                       gl_label_object_set_line_width (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_line_width(view));
-                       gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                         line_color);
-                       gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object),
+                       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object),
                                                         fill_color);
                        view_ellipse = gl_view_ellipse_new (GL_LABEL_ELLIPSE(object),
                                                            view);
@@ -496,9 +496,9 @@ gl_view_ellipse_create_event_handler (GnomeCanvas *canvas,
                        h = MAX (y, y0) - MIN (y, y0);
                        gl_label_object_set_size (GL_LABEL_OBJECT(object),
                                                  w, h);
-                       gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_line_color(view));
-                       gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object),
+                       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_fill_color(view));
                        gl_view_unselect_all (view);
                        gl_view_object_select (GL_VIEW_OBJECT(view_ellipse));
index 3190d96235a5c9ce110ab31dff19f4b8df1b30ac..065a322658c303e0a2056c68344906e582516181 100644 (file)
@@ -178,8 +178,8 @@ gl_view_line_new (glLabelLine *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_line_get_line_width(object);
-       line_color = gl_label_line_get_line_color(object);
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
 
        /* Create analogous canvas item. */
        points = gnome_canvas_points_new (2);
@@ -261,8 +261,8 @@ update_canvas_item_from_object_cb (glLabelObject *object,
 
        /* Query properties of object. */
        gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_line_get_line_width(GL_LABEL_LINE(object));
-       line_color = gl_label_line_get_line_color(GL_LABEL_LINE(object));
+       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
 
        /* Adjust appearance of analogous canvas item. */
        points = gnome_canvas_points_new (2);
@@ -340,10 +340,10 @@ update_editor_from_object_cb (glLabelObject  *object,
        gl_label_object_get_size (object, &w, &h);
        gl_object_editor_set_lsize (editor, w, h);
 
-       line_color = gl_label_line_get_line_color (GL_LABEL_LINE(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_color (editor, line_color);
 
-       line_width = gl_label_line_get_line_width (GL_LABEL_LINE(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_width (editor, line_width);
 
        gl_debug (DEBUG_VIEW, "END");
@@ -382,8 +382,8 @@ update_editor_from_label_cb (glLabel        *label,
        gl_label_get_size (label, &label_width, &label_height);
        gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
                                           label_width, label_height);
-       gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
-                                      label_width, label_height);
+       gl_object_editor_set_max_lsize (GL_OBJECT_EDITOR (editor),
+                                       label_width, label_height);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -456,9 +456,9 @@ gl_view_line_create_event_handler (GnomeCanvas *canvas,
                                                      x, y);
                        gl_label_object_set_size (GL_LABEL_OBJECT(object),
                                                  0.0, 0.0);
-                       gl_label_line_set_line_width (GL_LABEL_LINE(object),
+                       gl_label_object_set_line_width (GL_LABEL_OBJECT(object),
                                                      gl_view_get_default_line_width(view));
-                       gl_label_line_set_line_color (GL_LABEL_LINE(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                     gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5));
                        view_line = gl_view_line_new (GL_LABEL_LINE(object),
                                                      view);
@@ -486,7 +486,7 @@ gl_view_line_create_event_handler (GnomeCanvas *canvas,
                        h = y - y0;
                        gl_label_object_set_size (GL_LABEL_OBJECT(object),
                                                  w, h);
-                       gl_label_line_set_line_color (GL_LABEL_LINE(object),
+                       gl_label_object_set_line_color (GL_LABEL_OBJECT(object),
                                                     gl_view_get_default_line_color(view));
                        gl_view_unselect_all (view);
                        gl_view_object_select (GL_VIEW_OBJECT(view_line));
index 6ff471fa31f9456df7d761b0480fb9c8b860be34..01f268ecb7d9f20f131249f5f92f9f6c271d4977 100644 (file)
@@ -317,30 +317,24 @@ update_object_from_editor_cb (glObjectEditor *editor,
 
 
        gl_object_editor_get_position (editor, &x, &y);
-       gl_label_object_set_position (object, x, y);
-
        gl_object_editor_get_size (editor, &w, &h);
-       gl_label_object_set_size (object, w, h);
-
        font_family = gl_object_editor_get_font_family (editor);
-       gl_label_object_set_font_family (object, font_family);
-       g_free (font_family);
-
        font_size = gl_object_editor_get_font_size (editor);
-       gl_label_object_set_font_size (object, font_size);
-
        font_weight = gl_object_editor_get_font_weight (editor);
-       gl_label_object_set_font_weight (object, font_weight);
-
        font_italic_flag = gl_object_editor_get_font_italic_flag (editor);
-       gl_label_object_set_font_italic_flag (object, font_italic_flag);
-
        color = gl_object_editor_get_text_color (editor);
-       gl_label_object_set_text_color (object, color);
-
        just = gl_object_editor_get_text_alignment (editor);
+
+       gl_label_object_set_position (object, x, y);
+       gl_label_object_set_size (object, w, h);
+       gl_label_object_set_font_family (object, font_family);
+       gl_label_object_set_font_size (object, font_size);
+       gl_label_object_set_font_weight (object, font_weight);
+       gl_label_object_set_font_italic_flag (object, font_italic_flag);
+       gl_label_object_set_text_color (object, color);
        gl_label_object_set_text_alignment (object, just);
 
+       g_free (font_family);
 
        g_signal_handlers_unblock_by_func (G_OBJECT(object),
                                           update_editor_from_object_cb,
@@ -372,24 +366,21 @@ update_editor_from_object_cb (glLabelObject  *object,
        gl_label_object_get_size (object, &w, &h);
        gl_object_editor_set_size (editor, w, h);
 
-       gl_label_text_get_props (GL_LABEL_TEXT(object),
-                                &font_family, &font_size,
-                                &font_weight, &font_italic_flag,
-                                &color, &just);
+       font_family      = gl_label_object_get_font_family (object);
+       font_size        = gl_label_object_get_font_size (object);
+       font_weight      = gl_label_object_get_font_weight (object);
+       font_italic_flag = gl_label_object_get_font_italic_flag (object);
+       color            = gl_label_object_get_text_color (object);
+       just             = gl_label_object_get_text_alignment (object);
 
        gl_object_editor_set_font_family (editor, font_family);
-       g_free (font_family);
-
        gl_object_editor_set_font_size (editor, font_size);
-
        gl_object_editor_set_font_weight (editor, font_weight);
-
        gl_object_editor_set_font_italic_flag (editor, font_italic_flag);
-
        gl_object_editor_set_text_color (editor, color);
-
        gl_object_editor_set_text_alignment (editor, just);
 
+       g_free (font_family);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -475,8 +466,8 @@ gl_view_text_get_create_cursor (void)
 /*****************************************************************************/
 int
 gl_view_text_create_event_handler (GnomeCanvas *canvas,
-                                     GdkEvent    *event,
-                                     glView      *view)
+                                  GdkEvent    *event,
+                                  glView      *view)
 {
        static gdouble      x0, y0;
        static gboolean     dragging = FALSE;
@@ -507,13 +498,17 @@ gl_view_text_create_event_handler (GnomeCanvas *canvas,
                        gl_label_object_set_position (GL_LABEL_OBJECT(object),
                                                     x, y);
                        family = gl_view_get_default_font_family (view);
-                       gl_label_text_set_props (GL_LABEL_TEXT(object),
-                                                family,
-                                                gl_view_get_default_font_size (view),
-                                                gl_view_get_default_font_weight (view),
-                                                gl_view_get_default_font_italic_flag (view),
-                                                gl_color_set_opacity (gl_view_get_default_text_color (view), 0.5),
-                                                gl_view_get_default_text_alignment (view));
+                       gl_label_object_set_font_family (GL_LABEL_OBJECT(object), family);
+                       gl_label_object_set_font_size (GL_LABEL_OBJECT(object),
+                                                      gl_view_get_default_font_size (view));
+                       gl_label_object_set_font_weight (GL_LABEL_OBJECT(object),
+                                                        gl_view_get_default_font_weight (view));
+                       gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object),
+                                                             gl_view_get_default_font_italic_flag (view));
+                       gl_label_object_set_text_color (GL_LABEL_OBJECT(object),
+                                                       gl_color_set_opacity (gl_view_get_default_text_color (view), 0.5));
+                       gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object),
+                                                           gl_view_get_default_text_alignment (view));
                        g_free (family);
                        lines = gl_text_node_lines_new_from_text (_("Text"));
                        gl_label_text_set_lines (GL_LABEL_TEXT(object), lines);
@@ -539,13 +534,17 @@ gl_view_text_create_event_handler (GnomeCanvas *canvas,
                        gl_label_object_set_position (GL_LABEL_OBJECT(object),
                                                      x, y);
                        family = gl_view_get_default_font_family (view);
-                       gl_label_text_set_props (GL_LABEL_TEXT(object),
-                                                family,
-                                                gl_view_get_default_font_size (view),
-                                                gl_view_get_default_font_weight (view),
-                                                gl_view_get_default_font_italic_flag (view),
-                                                gl_view_get_default_text_color (view),
-                                                gl_view_get_default_text_alignment (view));
+                       gl_label_object_set_font_family (GL_LABEL_OBJECT(object), family);
+                       gl_label_object_set_font_size (GL_LABEL_OBJECT(object),
+                                                      gl_view_get_default_font_size (view));
+                       gl_label_object_set_font_weight (GL_LABEL_OBJECT(object),
+                                                        gl_view_get_default_font_weight (view));
+                       gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object),
+                                                             gl_view_get_default_font_italic_flag (view));
+                       gl_label_object_set_text_color (GL_LABEL_OBJECT(object),
+                                                       gl_view_get_default_text_color (view));
+                       gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object),
+                                                           gl_view_get_default_text_alignment (view));
                        g_free (family);
                        gl_view_unselect_all (view);
                        gl_view_object_select (GL_VIEW_OBJECT(view_text));
@@ -606,10 +605,12 @@ draw_hacktext (glViewText *view_text)
        /* Query label object and properties */
        object = gl_view_object_get_object (GL_VIEW_OBJECT(view_text));
        gl_label_object_get_size (object, &object_w, &object_h);
-       gl_label_text_get_props (GL_LABEL_TEXT(object),
-                                &font_family, &font_size,
-                                &font_weight, &font_italic_flag,
-                                &color, &just);
+       font_family = gl_label_object_get_font_family (object);
+       font_size = gl_label_object_get_font_size (object);
+       font_weight = gl_label_object_get_font_weight (object);
+       font_italic_flag = gl_label_object_get_font_italic_flag (object);
+       color = gl_label_object_get_text_color (object);
+       just = gl_label_object_get_text_alignment (object);
        buffer = gl_label_text_get_buffer(GL_LABEL_TEXT(object));
        gtk_text_buffer_get_bounds (buffer, &start, &end);
        text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
@@ -712,10 +713,12 @@ draw_cursor (glViewText *view_text)
        /* Query label object and properties */
        object = gl_view_object_get_object (GL_VIEW_OBJECT(view_text));
        gl_label_object_get_size (object, &object_w, &object_h);
-       gl_label_text_get_props (GL_LABEL_TEXT(object),
-                                &font_family, &font_size,
-                                &font_weight, &font_italic_flag,
-                                &color, &just);
+       font_family = gl_label_object_get_font_family (object);
+       font_size = gl_label_object_get_font_size (object);
+       font_weight = gl_label_object_get_font_weight (object);
+       font_italic_flag = gl_label_object_get_font_italic_flag (object);
+       color = gl_label_object_get_text_color (object);
+       just = gl_label_object_get_text_alignment (object);
        buffer = gl_label_text_get_buffer(GL_LABEL_TEXT(object));
        gtk_text_buffer_get_bounds (buffer, &start, &end);
        text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
index 2d9abd178dfd6fd90ddd480f088cb666a95a9bc4..1d3a206353e9f9cc970ce950593041077da85e99 100644 (file)
@@ -218,13 +218,12 @@ xml04_parse_text_props (xmlNodePtr    object_node,
 
        color = gl_xml_get_prop_uint (object_node, "color", 0);
 
-       gl_label_text_set_props (object,
-                                font_family,
-                                font_size,
-                                font_weight,
-                                font_italic_flag,
-                                color,
-                                just);
+       gl_label_object_set_font_family (GL_LABEL_OBJECT(object), font_family);
+       gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size);
+       gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight);
+       gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag);
+       gl_label_object_set_text_color (GL_LABEL_OBJECT(object), color);
+       gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), just);
 
        lines = NULL;
        for (line_node = object_node->xmlChildrenNode; line_node != NULL;
@@ -320,9 +319,9 @@ xml04_parse_box_props (xmlNodePtr    node,
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_box_set_line_width (object, line_width);
-       gl_label_box_set_line_color (object, line_color);
-       gl_label_box_set_fill_color (object, fill_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -347,8 +346,8 @@ xml04_parse_line_props (xmlNodePtr    node,
        line_color = gl_xml_get_prop_uint (node, "line_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_line_set_line_width (object, line_width);
-       gl_label_line_set_line_color (object, line_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -374,9 +373,9 @@ xml04_parse_ellipse_props (xmlNodePtr     node,
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_ellipse_set_line_width (object, line_width);
-       gl_label_ellipse_set_line_color (object, line_color);
-       gl_label_ellipse_set_fill_color (object, fill_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -434,7 +433,8 @@ xml04_parse_barcode_props (xmlNodePtr    node,
        if (scale == 0.0) {
                scale = 0.5; /* Set to a valid value */
        }
-       gl_label_barcode_set_props (object, style, text_flag, color, scale);
+       gl_label_barcode_set_props (object, style, text_flag, TRUE);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color);
 
        child = node->xmlChildrenNode;
        text_node = g_new0 (glTextNode, 1);
index bbffde84cb4d154138096b5ffca1eef68f7acebf..bbf1dc19651607c662ddd5eaf02fc941008079e3 100644 (file)
@@ -340,10 +340,12 @@ xml191_parse_text_props (xmlNodePtr  object_node,
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
        gl_label_text_set_lines  (GL_LABEL_TEXT(object), lines);
-       gl_label_text_set_props  (GL_LABEL_TEXT(object),
-                                 font_family, font_size, font_weight,
-                                 font_italic_flag,
-                                 color, just);
+       gl_label_object_set_font_family (GL_LABEL_OBJECT(object), font_family);
+       gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size);
+       gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight);
+       gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag);
+       gl_label_object_set_text_color (GL_LABEL_OBJECT(object), color);
+       gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), just);
 
        gl_text_node_lines_free (&lines);
        g_free (font_family);
@@ -378,9 +380,9 @@ xml191_parse_box_props (xmlNodePtr  node,
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_box_set_line_width (GL_LABEL_BOX(object), line_width);
-       gl_label_box_set_line_color (GL_LABEL_BOX(object), line_color);
-       gl_label_box_set_fill_color (GL_LABEL_BOX(object), fill_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        gl_debug (DEBUG_XML, "END");
 
@@ -411,8 +413,8 @@ xml191_parse_line_props (xmlNodePtr  node,
        line_color = gl_xml_get_prop_uint (node, "line_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_line_set_line_width (GL_LABEL_LINE(object), line_width);
-       gl_label_line_set_line_color (GL_LABEL_LINE(object), line_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
 
        gl_debug (DEBUG_XML, "END");
 
@@ -444,9 +446,9 @@ xml191_parse_ellipse_props (xmlNodePtr  node,
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
 
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
-       gl_label_ellipse_set_line_width (GL_LABEL_ELLIPSE(object), line_width);
-       gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object), line_color);
-       gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object), fill_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        gl_debug (DEBUG_XML, "END");
 
@@ -545,7 +547,8 @@ xml191_parse_barcode_props (xmlNodePtr  node,
 
        gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node);
        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
-                                   style, text_flag, checksum_flag, color);
+                                   style, text_flag, checksum_flag);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color);
 
        gl_text_node_free (&text_node);
 
index 21c19d779314b01d75eb1a9814ad1ddda72e068e..849a74b43f9de80be531ddd22267cbb1a10a05ec 100644 (file)
@@ -484,12 +484,12 @@ xml_parse_object_box (xmlNodePtr  node,
        /* line attrs */
        line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
        line_color = gl_xml_get_prop_uint (node, "line_color", 0);
-       gl_label_box_set_line_width (GL_LABEL_BOX(object), line_width);
-       gl_label_box_set_line_color (GL_LABEL_BOX(object), line_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
 
        /* fill attrs */
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
-       gl_label_box_set_fill_color (GL_LABEL_BOX(object), fill_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        /* affine attrs */
        affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
@@ -534,12 +534,12 @@ xml_parse_object_ellipse (xmlNodePtr  node,
        /* line attrs */
        line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
        line_color = gl_xml_get_prop_uint (node, "line_color", 0);
-       gl_label_ellipse_set_line_width (GL_LABEL_ELLIPSE(object), line_width);
-       gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object), line_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
 
        /* fill attrs */
        fill_color = gl_xml_get_prop_uint (node, "fill_color", 0);
-       gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object), fill_color);
+       gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color);
 
        /* affine attrs */
        affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
@@ -584,8 +584,8 @@ xml_parse_object_line (xmlNodePtr  node,
        /* line attrs */
        line_width = gl_xml_get_prop_length (node, "line_width", 1.0);
        line_color = gl_xml_get_prop_uint (node, "line_color", 0);
-       gl_label_line_set_line_width (GL_LABEL_LINE(object), line_width);
-       gl_label_line_set_line_color (GL_LABEL_LINE(object), line_color);
+       gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color);
 
        /* affine attrs */
        affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
@@ -700,7 +700,8 @@ xml_parse_object_barcode (xmlNodePtr  node,
        checksum_flag = gl_xml_get_prop_boolean (node, "checksum", TRUE);
        color = gl_xml_get_prop_uint (node, "color", 0);
        gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
-                                   style, text_flag, checksum_flag, color);
+                                   style, text_flag, checksum_flag);
+       gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color);
 
        /* data or field attr */
        string = xmlGetProp (node, "data");
@@ -1105,7 +1106,7 @@ xml_create_object_text (xmlNodePtr     root,
        gl_xml_set_prop_length (node, "h", h);
 
        /* justify attr */
-       just = gl_label_text_get_text_alignment (GL_LABEL_TEXT(object));
+       just = gl_label_object_get_text_alignment (object);
        xmlSetProp (node, "justify", gl_util_just_to_string (just));
 
        /* affine attrs */
@@ -1153,13 +1154,13 @@ xml_create_object_box (xmlNodePtr     root,
        gl_xml_set_prop_length (node, "h", h);
 
        /* line attrs */
-       line_width = gl_label_box_get_line_width (GL_LABEL_BOX(object));
-       line_color = gl_label_box_get_line_color (GL_LABEL_BOX(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_xml_set_prop_length (node, "line_width", line_width);
        gl_xml_set_prop_uint_hex (node, "line_color", line_color);
 
        /* fill attrs */
-       fill_color = gl_label_box_get_fill_color (GL_LABEL_BOX(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
        gl_xml_set_prop_uint_hex (node, "fill_color", fill_color);
 
        /* affine attrs */
@@ -1204,13 +1205,13 @@ xml_create_object_ellipse (xmlNodePtr     root,
        gl_xml_set_prop_length (node, "h", h);
 
        /* line attrs */
-       line_width = gl_label_ellipse_get_line_width (GL_LABEL_ELLIPSE(object));
-       line_color = gl_label_ellipse_get_line_color (GL_LABEL_ELLIPSE(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_xml_set_prop_length (node, "line_width", line_width);
        gl_xml_set_prop_uint_hex (node, "line_color", line_color);
 
        /* fill attrs */
-       fill_color = gl_label_ellipse_get_fill_color (GL_LABEL_ELLIPSE(object));
+       fill_color = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object));
        gl_xml_set_prop_uint_hex (node, "fill_color", fill_color);
 
        /* affine attrs */
@@ -1255,8 +1256,8 @@ xml_create_object_line (xmlNodePtr     root,
        gl_xml_set_prop_length (node, "dy", dy);
 
        /* line attrs */
-       line_width = gl_label_line_get_line_width (GL_LABEL_LINE(object));
-       line_color = gl_label_line_get_line_color (GL_LABEL_LINE(object));
+       line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
+       line_color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        gl_xml_set_prop_length (node, "line_width", line_width);
        gl_xml_set_prop_uint_hex (node, "line_color", line_color);
 
@@ -1355,7 +1356,8 @@ xml_create_object_barcode (xmlNodePtr     root,
 
        /* Barcode properties attrs */
        gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
-                                   &style, &text_flag, &checksum_flag, &color);
+                                   &style, &text_flag, &checksum_flag);
+       color = gl_label_object_get_line_color (GL_LABEL_OBJECT(object));
        xmlSetProp (node, "style", gl_barcode_style_to_text (style));
        gl_xml_set_prop_boolean (node, "text", text_flag);
        gl_xml_set_prop_boolean (node, "checksum", checksum_flag);
@@ -1509,10 +1511,12 @@ xml_create_toplevel_span (xmlNodePtr        root,
        node = xmlNewChild (root, ns, "Span", NULL);
 
        /* All span attrs at top level. */
-       gl_label_text_get_props (GL_LABEL_TEXT(object_text),
-                                &font_family, &font_size, &font_weight,
-                                &font_italic_flag,
-                                &color, &just);
+       font_family = gl_label_object_get_font_family (GL_LABEL_OBJECT(object_text));
+       font_size = gl_label_object_get_font_size (GL_LABEL_OBJECT(object_text));
+       font_weight = gl_label_object_get_font_weight (GL_LABEL_OBJECT(object_text));
+       font_italic_flag = gl_label_object_get_font_italic_flag (GL_LABEL_OBJECT(object_text));
+       color = gl_label_object_get_text_color (GL_LABEL_OBJECT(object_text));
+       just = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text));
        xmlSetProp (node, "font_family", font_family);
        gl_xml_set_prop_double (node, "font_size", font_size);
        xmlSetProp (node, "font_weight", gl_util_weight_to_string (font_weight));