/* 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
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;
}
gboolean text_flag;
gboolean checksum_flag;
guint color;
- gdouble scale;
gl_debug (DEBUG_LABEL, "START");
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);
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");
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));
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;
}
/*---------------------------------------------------------------------------*/
}
}
+/*---------------------------------------------------------------------------*/
+/* 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;
+}
+