+2004-02-15 Jim Evins <evins@snaught.com>
+
+ * src/label-barcode.c: (gl_label_barcode_set_data),
+ (gl_label_barcode_set_props):
+ Don't emit "changed" signal, if no change actually made for these
+ methods. Reduces number of unnecessary redraws of barcodes.
+
+ * src/label-object.h:
+ * src/label-object.c: (gl_label_object_set_position),
+ (gl_label_object_set_position_relative), (set_size),
+ (gl_label_object_set_size),
+ (gl_label_object_set_size_honor_aspect):
+ Don't emit "changed" signal, if no change actually made for these
+ methods.
+
2004-02-15 Jim Evins <evins@snaught.com>
* data/glabels-2.0.dtd:
g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
- gl_text_node_free (&lbc->private->text_node);
- lbc->private->text_node = gl_text_node_dup (text_node);
+ if (!gl_text_node_equal (lbc->private->text_node, text_node)) {
+
+ gl_text_node_free (&lbc->private->text_node);
+ lbc->private->text_node = gl_text_node_dup (text_node);
- gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
+ gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
+
+ }
gl_debug (DEBUG_LABEL, "END");
}
g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc));
- lbc->private->id = g_strdup (id);
- lbc->private->text_flag = text_flag;
- lbc->private->checksum_flag = checksum_flag;
+ if ( ((lbc->private->id == NULL) && (id != NULL))
+ || (g_strcasecmp (lbc->private->id, id) != 0)
+ || (lbc->private->text_flag != text_flag)
+ || (lbc->private->checksum_flag != checksum_flag) ) {
- gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
+ lbc->private->id = g_strdup (id);
+ lbc->private->text_flag = text_flag;
+ lbc->private->checksum_flag = checksum_flag;
+
+ gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc));
+
+ }
gl_debug (DEBUG_LABEL, "END");
}
g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
- dx = x - object->private->x;
- dy = y - object->private->y;
+ if ( (x != object->private->x) || (y != object->private->y) ) {
- object->private->x = x;
- object->private->y = y;
+ dx = x - object->private->x;
+ dy = y - object->private->y;
- g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
+ object->private->x = x;
+ object->private->y = y;
+
+ g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
+
+ }
gl_debug (DEBUG_LABEL, "END");
}
g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
- object->private->x += dx;
- object->private->y += dy;
+ if ( (dx != 0.0) || (dy != 0.0) ) {
- gl_debug (DEBUG_LABEL, " x = %f, y= %f",
- object->private->x,
- object->private->y);
+ object->private->x += dx;
+ object->private->y += dy;
- g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
+ gl_debug (DEBUG_LABEL, " x = %f, y= %f",
+ object->private->x,
+ object->private->y);
+
+ g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy);
+
+ }
gl_debug (DEBUG_LABEL, "END");
}
{
g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
- object->private->w = w;
- object->private->h = h;
+ if ( (object->private->w != w) || (object->private->h != h) ) {
+
+ object->private->w = w;
+ object->private->h = h;
+
+ g_signal_emit (G_OBJECT(object), signals[CHANGED], 0);
+ }
}
/*****************************************************************************/
/* We have an object specific method, use it */
GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h);
- } else {
-
- set_size (object, w, h);
+ object->private->aspect_ratio = h / w;
}
- object->private->aspect_ratio = h / w;
-
- g_signal_emit (G_OBJECT(object), signals[CHANGED], 0);
gl_debug (DEBUG_LABEL, "END");
}
/* We have an object specific method, use it */
GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h);
- } else {
-
- set_size (object, w, h);
-
}
- g_signal_emit (G_OBJECT(object), signals[CHANGED], 0);
-
gl_debug (DEBUG_LABEL, "END");
}
void (*set_text_alignment) (glLabelObject *object,
GtkJustification text_alignment);
- void (*set_text_line_spacing) (glLabelObject *object,
- gdouble text_line_spacing);
+ void (*set_text_line_spacing) (glLabelObject *object,
+ gdouble text_line_spacing);
void (*set_text_color) (glLabelObject *object,
guint text_color);
GtkJustification (*get_text_alignment) (glLabelObject *object);
- gdouble (*get_text_line_spacing) (glLabelObject *object);
+ gdouble (*get_text_line_spacing) (glLabelObject *object);
guint (*get_text_color) (glLabelObject *object);