Various code cleanups.
* src/label-barcode.c:
Removed unneeded include of gnome-glyphlist.h.
* src/label-text.c: (get_size):
Fixed memory leak: unref glyphlists when done with them.
* src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page):
* src/object-editor-data-page.c:
(gl_object_editor_prepare_data_page):
* src/object-editor-image-page.c:
(gl_object_editor_prepare_image_page):
* src/object-editor-line-page.c:
(gl_object_editor_prepare_line_page):
* src/object-editor-lsize-page.c:
(gl_object_editor_prepare_lsize_page):
* src/object-editor-position-page.c:
(gl_object_editor_prepare_position_page):
* src/object-editor-size-page.c:
(gl_object_editor_prepare_size_page):
* src/object-editor-text-page.c:
(gl_object_editor_prepare_text_page):
Removed unneeded size groups, originally intended to keep widgets aligned.
Now use tables to lay these out in object-editor.glade.
* src/print.c: (draw_text_object):
Fixed memory leak: unref glyphlists when done with them.
* src/view-barcode.c: (draw_barcode):
Fixed memory leak: unref glyphlists when done with them.
* src/view-text.c: (update_object_from_editor_cb), (draw_hacktext):
- Removed unneeded cast of gl_object_editor_get_text_line_spacing()s
return value.
- Fixed memory leak: unref glyphlists when done with them.
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@433
f5e0f49d-192f-0410-a22d-
a8d8700d0965
+2004-07-12 Jim Evins <evins@snaught.com>
+
+ Various code cleanups.
+
+ * src/label-barcode.c:
+ Removed unneeded include of gnome-glyphlist.h.
+
+ * src/label-text.c: (get_size):
+ Fixed memory leak: unref glyphlists when done with them.
+
+ * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page):
+ * src/object-editor-data-page.c:
+ (gl_object_editor_prepare_data_page):
+ * src/object-editor-image-page.c:
+ (gl_object_editor_prepare_image_page):
+ * src/object-editor-line-page.c:
+ (gl_object_editor_prepare_line_page):
+ * src/object-editor-lsize-page.c:
+ (gl_object_editor_prepare_lsize_page):
+ * src/object-editor-position-page.c:
+ (gl_object_editor_prepare_position_page):
+ * src/object-editor-size-page.c:
+ (gl_object_editor_prepare_size_page):
+ * src/object-editor-text-page.c:
+ (gl_object_editor_prepare_text_page):
+ Removed unneeded size groups, originally intended to keep widgets aligned.
+ Now use tables to lay these out in object-editor.glade.
+
+ * src/print.c: (draw_text_object):
+ Fixed memory leak: unref glyphlists when done with them.
+
+ * src/view-barcode.c: (draw_barcode):
+ Fixed memory leak: unref glyphlists when done with them.
+
+ * src/view-text.c: (update_object_from_editor_cb), (draw_hacktext):
+ - Removed unneeded cast of gl_object_editor_get_text_line_spacing()s
+ return value.
+ - Fixed memory leak: unref glyphlists when done with them.
+
2004-07-11 Jim Evins <evins@snaught.com>
* data/glabels-2.0.dtd:
*/
#include <glib.h>
-#include <libgnomeprint/gnome-glyphlist.h>
#include "label-barcode.h"
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
+ gnome_glyphlist_unref (glyphlist);
+
if ( bbox.x1 > *w ) *w = bbox.x1;
if (i) {
gl_object_editor_prepare_bc_page (glObjectEditor *editor)
{
GList *styles = NULL;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
gtk_combo_set_popdown_strings (GTK_COMBO(editor->priv->bc_style_combo), styles);
gl_barcode_free_styles_list (styles);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "bc_style_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "bc_color_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->bc_page_vbox);
gl_object_editor_prepare_data_page (glObjectEditor *editor)
{
GdkColor *gdk_color;
- GtkSizeGroup *label_size_group;
gl_debug (DEBUG_EDITOR, "START");
editor->priv->data_key_entry = glade_xml_get_widget (editor->priv->gui,
"data_key_entry");
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (label_size_group, editor->priv->data_literal_radio);
- gtk_size_group_add_widget (label_size_group, editor->priv->data_key_radio);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->data_page_vbox);
gl_object_editor_prepare_image_page (glObjectEditor *editor)
{
GdkColor *gdk_color;
- GtkSizeGroup *label_size_group;
GtkWidget *ge;
gl_debug (DEBUG_EDITOR, "START");
editor->priv->img_key_entry = glade_xml_get_widget (editor->priv->gui,
"img_key_entry");
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (label_size_group, editor->priv->img_file_radio);
- gtk_size_group_add_widget (label_size_group, editor->priv->img_key_radio);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->img_page_vbox);
gl_object_editor_prepare_line_page (glObjectEditor *editor)
{
GdkColor *gdk_color;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
color_combo_set_color (COLOR_COMBO(editor->priv->line_color_combo), gdk_color);
g_free (gdk_color);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "line_w_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "line_color_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->line_page_vbox);
const gchar *units_string;
gdouble climb_rate;
gint digits;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
climb_rate, 10.0*climb_rate);
gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label), units_string);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "lsize_r_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "lsize_theta_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->lsize_page_vbox);
const gchar *units_string;
gdouble climb_rate;
gint digits;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
climb_rate, 10.0*climb_rate);
gtk_label_set_text (GTK_LABEL(editor->priv->pos_y_units_label), units_string);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "pos_x_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "pos_y_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->pos_page_vbox);
const gchar *units_string;
gdouble climb_rate;
gint digits;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
climb_rate, 10.0*climb_rate);
gtk_label_set_text (GTK_LABEL(editor->priv->size_h_units_label), units_string);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "size_w_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "size_h_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->size_page_vbox);
if (option != GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE) {
gl_object_editor_prepare_text_page (glObjectEditor *editor)
{
GList *family_names = NULL;
- GtkSizeGroup *label_size_group;
- GtkWidget *label;
gl_debug (DEBUG_EDITOR, "START");
family_names);
gnome_font_family_list_free (family_names);
- /* Align label widths */
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- label = glade_xml_get_widget (editor->priv->gui, "text_family_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "text_size_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "text_style_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "text_color_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "text_align_label");
- gtk_size_group_add_widget (label_size_group, label);
- label = glade_xml_get_widget (editor->priv->gui, "text_line_spacing_label");
- gtk_size_group_add_widget (label_size_group, label);
-
/* Un-hide */
gtk_widget_show_all (editor->priv->text_page_vbox);
line[i]);
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
w = bbox.x1;
+ gnome_glyphlist_unref (glyphlist);
/* If width is too large, iteratively shrink font_size until this
line fits the width, or until the font size is ridiculously
line[i]);
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
w = bbox.x1;
+ gnome_glyphlist_unref (glyphlist);
}
}
gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
w = bbox.x1;
+ gnome_glyphlist_unref (glyphlist);
switch (just) {
case GTK_JUSTIFY_LEFT:
"y", y_offset,
"glyphlist", glyphlist, NULL);
+ gnome_glyphlist_unref (glyphlist);
+
view_barcode->private->item_list =
g_list_prepend (view_barcode->private->item_list, item);
} else {
"glyphlist", glyphlist,
NULL);
+ gnome_glyphlist_unref (glyphlist);
+
view_barcode->private->item_list =
g_list_prepend (view_barcode->private->item_list, item);
font_italic_flag = gl_object_editor_get_font_italic_flag (editor);
color = gl_object_editor_get_text_color (editor);
just = gl_object_editor_get_text_alignment (editor);
- text_line_spacing = (gdouble) gl_object_editor_get_text_line_spacing (editor);
+ text_line_spacing = gl_object_editor_get_text_line_spacing (editor);
auto_shrink = gl_object_editor_get_text_auto_shrink (editor);
gl_label_object_set_position (object, x, y);
"x", x_offset,
"y", y_offset,
"glyphlist", glyphlist, NULL);
+
+ gnome_glyphlist_unref (glyphlist);
+
view_text->private->item_list =
g_list_prepend (view_text->private->item_list, item);