From: Jim Evins Date: Sun, 11 Jul 2004 05:18:36 +0000 (+0000) Subject: 2004-07-11 Jim Evins X-Git-Tag: glabels-2_3_0~466 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1fd401c400027d08f75b0a1105a47ba3b416e193;p=glabels 2004-07-11 Jim Evins * data/glabels-2.0.dtd: * libglabels/template.c: (gl_template_rect_label_type_new), (gl_template_round_label_type_new), (gl_template_cd_label_type_new), (gl_template_label_type_dup), (template_full_page): * libglabels/template.h: * libglabels/xml-template.c: (xml_parse_label_rectangle_node), (xml_create_label_node): * pixmaps/ex-rect-size.png: * src/print.c: (clip_to_outline), (clip_punchouts): * src/template-designer.c: (construct_rect_size_page), (rect_size_page_prepare_cb), (layout_page_prepare_cb), (build_template): * src/template-designer.glade: * src/xml-label-191.c: (xml191_parse_label): Modifications to allow separate horizontal (x_waste) and vertical (y_waste) properties for rectangular labels. Templates remain backwards compatible, but this breaks the libglabels API (I don't know of anyone outside of glabels using libglabels at this time -- what can I say, the program is is still "unstable"). This addresses the suggestion in Feature Request #976313. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@431 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 04e6cc06..70e98169 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,27 @@ +2004-07-11 Jim Evins + + * data/glabels-2.0.dtd: + * libglabels/template.c: (gl_template_rect_label_type_new), + (gl_template_round_label_type_new), + (gl_template_cd_label_type_new), (gl_template_label_type_dup), + (template_full_page): + * libglabels/template.h: + * libglabels/xml-template.c: (xml_parse_label_rectangle_node), + (xml_create_label_node): + * pixmaps/ex-rect-size.png: + * src/print.c: (clip_to_outline), (clip_punchouts): + * src/template-designer.c: (construct_rect_size_page), + (rect_size_page_prepare_cb), (layout_page_prepare_cb), + (build_template): + * src/template-designer.glade: + * src/xml-label-191.c: (xml191_parse_label): + Modifications to allow separate horizontal (x_waste) and vertical (y_waste) + properties for rectangular labels. Templates remain backwards compatible, + but this breaks the libglabels API (I don't know of anyone outside of + glabels using libglabels at this time -- what can I say, the program is + is still "unstable"). This addresses the suggestion in Feature Request + #976313. + 2004-07-05 Jim Evins * src/print.c: (print_crop_marks), (draw_outline): Changed crop marks and label outlines to black, instead of 25% gray. diff --git a/glabels2/data/glabels-2.0.dtd b/glabels2/data/glabels-2.0.dtd index af088b40..dcd0b35d 100644 --- a/glabels2/data/glabels-2.0.dtd +++ b/glabels2/data/glabels-2.0.dtd @@ -107,6 +107,8 @@ height %LENGTH_TYPE; #REQUIRED round %LENGTH_TYPE; "0 pt" waste %LENGTH_TYPE; #IMPLIED + x_waste %LENGTH_TYPE; #IMPLIED + y_waste %LENGTH_TYPE; #IMPLIED > diff --git a/glabels2/libglabels/template.c b/glabels2/libglabels/template.c index 21cbfced..92c59832 100644 --- a/glabels2/libglabels/template.c +++ b/glabels2/libglabels/template.c @@ -406,19 +406,21 @@ gl_template_rect_label_type_new (const gchar *id, gdouble w, gdouble h, gdouble r, - gdouble waste) + gdouble x_waste, + gdouble y_waste) { glTemplateLabelType *label_type; label_type = g_new0 (glTemplateLabelType, 1); label_type->id = g_strdup (id); - label_type->waste = waste; label_type->shape = GL_TEMPLATE_SHAPE_RECT; label_type->size.rect.w = w; label_type->size.rect.h = h; label_type->size.rect.r = r; + label_type->size.rect.x_waste = x_waste; + label_type->size.rect.y_waste = y_waste; return label_type; } @@ -436,10 +438,10 @@ gl_template_round_label_type_new (const gchar *id, label_type = g_new0 (glTemplateLabelType, 1); label_type->id = g_strdup (id); - label_type->waste = waste; label_type->shape = GL_TEMPLATE_SHAPE_ROUND; label_type->size.round.r = r; + label_type->size.round.waste = waste; return label_type; } @@ -460,13 +462,13 @@ gl_template_cd_label_type_new (const gchar *id, label_type = g_new0 (glTemplateLabelType, 1); label_type->id = g_strdup (id); - label_type->waste = waste; label_type->shape = GL_TEMPLATE_SHAPE_CD; label_type->size.cd.r1 = r1; label_type->size.cd.r2 = r2; label_type->size.cd.w = w; label_type->size.cd.h = h; + label_type->size.cd.waste = waste; return label_type; } @@ -686,14 +688,15 @@ gl_template_label_type_dup (const glTemplateLabelType *orig_label_type) orig_label_type->size.rect.w, orig_label_type->size.rect.h, orig_label_type->size.rect.r, - orig_label_type->waste); + orig_label_type->size.rect.x_waste, + orig_label_type->size.rect.y_waste); break; case GL_TEMPLATE_SHAPE_ROUND: label_type = gl_template_round_label_type_new (orig_label_type->id, orig_label_type->size.round.r, - orig_label_type->waste); + orig_label_type->size.round.waste); break; case GL_TEMPLATE_SHAPE_CD: @@ -703,7 +706,7 @@ gl_template_label_type_dup (const glTemplateLabelType *orig_label_type) orig_label_type->size.cd.r2, orig_label_type->size.cd.w, orig_label_type->size.cd.h, - orig_label_type->waste); + orig_label_type->size.cd.waste); break; default: @@ -855,6 +858,7 @@ template_full_page (const gchar *page_size) paper->width, paper->height, 0.0, + 0.0, 0.0); gl_template_add_label_type (template, label_type); diff --git a/glabels2/libglabels/template.h b/glabels2/libglabels/template.h index 38f4c557..ff8f927b 100644 --- a/glabels2/libglabels/template.h +++ b/glabels2/libglabels/template.h @@ -78,27 +78,30 @@ struct _glTemplateLabelType{ GList *layouts; /* List of glTemplateLayouts */ GList *markups; /* List of glTemplateMarkups */ - gdouble waste; /* Amount of overprint allowed. */ - glTemplateLabelShape shape; union { struct { - gdouble w; /* Width */ - gdouble h; /* Height */ - gdouble r; /* Corner radius */ + gdouble w; /* Width */ + gdouble h; /* Height */ + gdouble r; /* Corner radius */ + gdouble x_waste; /* Amount of horiz overprint allowed. */ + gdouble y_waste; /* Amount of vert overprint allowed. */ } rect; struct { - gdouble r; /* Radius */ + gdouble r; /* Radius */ + gdouble waste; /* Amount of overprint allowed. */ + } round; struct { - gdouble r1; /* Outer radius */ - gdouble r2; /* Inner radius (hole) */ - gdouble w; /* Clip width, business card CDs */ - gdouble h; /* Clip height, business card CDs */ + gdouble r1; /* Outer radius */ + gdouble r2; /* Inner radius (hole) */ + gdouble w; /* Clip width, business card CDs */ + gdouble h; /* Clip height, business card CDs */ + gdouble waste; /* Amount of overprint allowed. */ } cd; } size; @@ -229,7 +232,8 @@ glTemplateLabelType *gl_template_rect_label_type_new (const gchar *id, gdouble w, gdouble h, gdouble r, - gdouble waste); + gdouble x_waste, + gdouble y_waste); glTemplateLabelType *gl_template_round_label_type_new (const gchar *id, gdouble r, diff --git a/glabels2/libglabels/xml-template.c b/glabels2/libglabels/xml-template.c index 1532aed0..f3fd21b5 100644 --- a/glabels2/libglabels/xml-template.c +++ b/glabels2/libglabels/xml-template.c @@ -241,18 +241,28 @@ xml_parse_label_rectangle_node (xmlNodePtr label_node, glTemplate *template) { gchar *id; - gdouble waste; + gchar *tmp; + gdouble x_waste, y_waste; gdouble w, h, r; glTemplateLabelType *label_type; xmlNodePtr node; - id = xmlGetProp (label_node, "id"); - waste = gl_xml_get_prop_length (label_node, "waste", 0); - w = gl_xml_get_prop_length (label_node, "width", 0); - h = gl_xml_get_prop_length (label_node, "height", 0); - r = gl_xml_get_prop_length (label_node, "round", 0); + id = xmlGetProp (label_node, "id"); + + if (tmp = xmlGetProp (label_node, "waste")) { + /* Handle single "waste" property. */ + x_waste = y_waste = gl_xml_get_prop_length (label_node, "waste", 0); + g_free (tmp); + } else { + x_waste = gl_xml_get_prop_length (label_node, "x_waste", 0); + y_waste = gl_xml_get_prop_length (label_node, "y_waste", 0); + } + + w = gl_xml_get_prop_length (label_node, "width", 0); + h = gl_xml_get_prop_length (label_node, "height", 0); + r = gl_xml_get_prop_length (label_node, "round", 0); - label_type = gl_template_rect_label_type_new (id, w, h, r, waste); + label_type = gl_template_rect_label_type_new (id, w, h, r, x_waste, y_waste); gl_template_add_label_type (template, label_type); for (node = label_node->xmlChildrenNode; node != NULL; @@ -606,14 +616,15 @@ xml_create_label_node (const glTemplateLabelType *label_type, gl_xml_set_prop_length (node, "width", label_type->size.rect.w); gl_xml_set_prop_length (node, "height", label_type->size.rect.h); gl_xml_set_prop_length (node, "round", label_type->size.rect.r); - gl_xml_set_prop_length (node, "waste", label_type->waste); + gl_xml_set_prop_length (node, "x_waste", label_type->size.rect.x_waste); + gl_xml_set_prop_length (node, "y_waste", label_type->size.rect.y_waste); break; case GL_TEMPLATE_SHAPE_ROUND: node = xmlNewChild(root, ns, "Label-round", NULL); xmlSetProp (node, "id", label_type->id); gl_xml_set_prop_length (node, "radius", label_type->size.round.r); - gl_xml_set_prop_length (node, "waste", label_type->waste); + gl_xml_set_prop_length (node, "waste", label_type->size.round.waste); break; case GL_TEMPLATE_SHAPE_CD: @@ -627,7 +638,7 @@ xml_create_label_node (const glTemplateLabelType *label_type, if (label_type->size.cd.h != 0.0) { gl_xml_set_prop_length (node, "height", label_type->size.cd.h); } - gl_xml_set_prop_length (node, "waste", label_type->waste); + gl_xml_set_prop_length (node, "waste", label_type->size.cd.waste); break; default: diff --git a/glabels2/pixmaps/ex-rect-size.png b/glabels2/pixmaps/ex-rect-size.png index a6d7af92..2710472f 100644 Binary files a/glabels2/pixmaps/ex-rect-size.png and b/glabels2/pixmaps/ex-rect-size.png differ diff --git a/glabels2/src/print.c b/glabels2/src/print.c index a6bcf5ea..73bf4034 100644 --- a/glabels2/src/print.c +++ b/glabels2/src/print.c @@ -1178,7 +1178,7 @@ clip_to_outline (PrintInfo *pi, const glTemplateLabelType *label_type; gdouble w, h, r; gdouble r1; - gdouble waste; + gdouble waste, x_waste, y_waste; gl_debug (DEBUG_PRINT, "START"); @@ -1189,28 +1189,31 @@ clip_to_outline (PrintInfo *pi, case GL_TEMPLATE_SHAPE_RECT: gl_label_get_size (label, &w, &h); r = label_type->size.rect.r; - waste = label_type->waste; + x_waste = label_type->size.rect.x_waste; + y_waste = label_type->size.rect.y_waste; if (r == 0.0) { /* simple rectangle */ create_rectangle_path (pi->pc, - -waste, -waste, w+2*waste, h+2*waste); + -x_waste, -y_waste, + w+2*x_waste, h+2*y_waste); } else { /* rectangle with rounded corners */ - create_rounded_rectangle_path (pi->pc, -waste, -waste, - w+2*waste, h+2*waste, r); + create_rounded_rectangle_path (pi->pc, + -x_waste, -y_waste, + w+2*x_waste, h+2*y_waste, r); } gnome_print_clip (pi->pc); break; case GL_TEMPLATE_SHAPE_ROUND: r1 = label_type->size.round.r; - waste = label_type->waste; + waste = label_type->size.round.waste; create_ellipse_path (pi->pc, r1, r1, r1+waste, r1+waste); gnome_print_clip (pi->pc); break; case GL_TEMPLATE_SHAPE_CD: - waste = label_type->waste; + waste = label_type->size.cd.waste; if ((label_type->size.cd.h == 0) && (label_type->size.cd.w == 0)) { /* CD style, round label w/ concentric round hole */ r1 = label_type->size.cd.r1; @@ -1262,7 +1265,7 @@ clip_punchouts (PrintInfo *pi, case GL_TEMPLATE_SHAPE_CD: gl_label_get_size (label, &w, &h); - waste = label_type->waste; + waste = label_type->size.cd.waste; r2 = label_type->size.cd.r2; create_ellipse_path (pi->pc, w/2, h/2, r2-waste, r2-waste); gnome_print_setrgbcolor (pi->pc, 1.0, 1.0, 1.0); diff --git a/glabels2/src/template-designer.c b/glabels2/src/template-designer.c index 66c28f7e..d24be891 100644 --- a/glabels2/src/template-designer.c +++ b/glabels2/src/template-designer.c @@ -130,12 +130,14 @@ struct _glTemplateDesignerPrivate GtkWidget *rect_w_spin; GtkWidget *rect_h_spin; GtkWidget *rect_r_spin; - GtkWidget *rect_waste_spin; + GtkWidget *rect_x_waste_spin; + GtkWidget *rect_y_waste_spin; GtkWidget *rect_margin_spin; GtkWidget *rect_w_units_label; GtkWidget *rect_h_units_label; GtkWidget *rect_r_units_label; - GtkWidget *rect_waste_units_label; + GtkWidget *rect_x_waste_units_label; + GtkWidget *rect_y_waste_units_label; GtkWidget *rect_margin_units_label; /* Label size (round) page controls */ @@ -595,8 +597,10 @@ construct_rect_size_page (glTemplateDesigner *dlg, glade_xml_get_widget (dlg->priv->gui, "rect_h_spin"); dlg->priv->rect_r_spin = glade_xml_get_widget (dlg->priv->gui, "rect_r_spin"); - dlg->priv->rect_waste_spin = - glade_xml_get_widget (dlg->priv->gui, "rect_waste_spin"); + dlg->priv->rect_x_waste_spin = + glade_xml_get_widget (dlg->priv->gui, "rect_x_waste_spin"); + dlg->priv->rect_y_waste_spin = + glade_xml_get_widget (dlg->priv->gui, "rect_y_waste_spin"); dlg->priv->rect_margin_spin = glade_xml_get_widget (dlg->priv->gui, "rect_margin_spin"); dlg->priv->rect_w_units_label = @@ -605,8 +609,10 @@ construct_rect_size_page (glTemplateDesigner *dlg, glade_xml_get_widget (dlg->priv->gui, "rect_h_units_label"); dlg->priv->rect_r_units_label = glade_xml_get_widget (dlg->priv->gui, "rect_r_units_label"); - dlg->priv->rect_waste_units_label = - glade_xml_get_widget (dlg->priv->gui, "rect_waste_units_label"); + dlg->priv->rect_x_waste_units_label = + glade_xml_get_widget (dlg->priv->gui, "rect_x_waste_units_label"); + dlg->priv->rect_y_waste_units_label = + glade_xml_get_widget (dlg->priv->gui, "rect_y_waste_units_label"); dlg->priv->rect_margin_units_label = glade_xml_get_widget (dlg->priv->gui, "rect_margin_units_label"); @@ -633,11 +639,17 @@ construct_rect_size_page (glTemplateDesigner *dlg, dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate); gtk_label_set_text (GTK_LABEL(dlg->priv->rect_r_units_label), dlg->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin), dlg->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin), dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dlg->priv->rect_waste_units_label), + gtk_label_set_text (GTK_LABEL(dlg->priv->rect_x_waste_units_label), + dlg->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin), + dlg->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin), + dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dlg->priv->rect_y_waste_units_label), dlg->priv->units_string); gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin), dlg->priv->digits); @@ -653,7 +665,9 @@ construct_rect_size_page (glTemplateDesigner *dlg, DEFAULT_RECT_H * dlg->priv->units_per_point); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin), DEFAULT_RECT_R * dlg->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin), + DEFAULT_RECT_WASTE * dlg->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin), DEFAULT_RECT_WASTE * dlg->priv->units_per_point); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin), DEFAULT_MARGIN * dlg->priv->units_per_point); @@ -1151,7 +1165,7 @@ static void rect_size_page_prepare_cb (glTemplateDesigner *dlg) { gdouble max_w, max_h; - gdouble w, h, r, waste, margin; + gdouble w, h, r, x_waste, y_waste, margin; /* Limit label size based on already chosen page size. */ max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin)); @@ -1160,7 +1174,8 @@ rect_size_page_prepare_cb (glTemplateDesigner *dlg) w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin)); h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin)); r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin)); margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin)); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_w_spin), @@ -1169,7 +1184,9 @@ rect_size_page_prepare_cb (glTemplateDesigner *dlg) dlg->priv->climb_rate, max_h); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_r_spin), 0.0, MIN(max_w, max_h)/2.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_waste_spin), + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_x_waste_spin), + 0.0, MIN(max_w, max_h)/4.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_y_waste_spin), 0.0, MIN(max_w, max_h)/4.0); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_margin_spin), 0.0, MIN(max_w, max_h)/4.0); @@ -1177,7 +1194,8 @@ rect_size_page_prepare_cb (glTemplateDesigner *dlg) gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin), w); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin), h); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin), r); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin), x_waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin), y_waste); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin), margin); } @@ -1261,7 +1279,7 @@ static void layout_page_prepare_cb (glTemplateDesigner *dlg) { gdouble page_w, page_h; - gdouble w, h, waste; + gdouble w, h, x_waste, y_waste; gint max_nx, max_ny; gint nlayouts; gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; @@ -1310,20 +1328,23 @@ layout_page_prepare_cb (glTemplateDesigner *dlg) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_rect_radio))) { w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin)); h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin)); } if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_round_radio))) { w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin)); h = w; - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin)); + y_waste = x_waste; } if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_cd_radio))) { w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin)); h = w; - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin)); + y_waste = x_waste; } - max_nx = MAX (floor (page_w/(w + 2*waste) + DELTA), 1.0); - max_ny = MAX (floor (page_h/(h + 2*waste) + DELTA), 1.0); + max_nx = MAX (floor (page_w/(w + 2*x_waste) + DELTA), 1.0); + max_ny = MAX (floor (page_h/(h + 2*y_waste) + DELTA), 1.0); nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin)); ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin)); @@ -1343,25 +1364,25 @@ layout_page_prepare_cb (glTemplateDesigner *dlg) gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_ny_spin), 1, max_ny); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_x0_spin), - waste, page_w - w - waste); + x_waste, page_w - w - x_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_y0_spin), - waste, page_h - h - waste); + y_waste, page_h - h - y_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dx_spin), - w + 2*waste, page_w - w - 2*waste); + w + 2*x_waste, page_w - w - 2*x_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dy_spin), - h + 2*waste, page_h - h - 2*waste); + h + 2*y_waste, page_h - h - 2*y_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_nx_spin), 1, max_nx); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_ny_spin), 1, max_ny); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_x0_spin), - waste, page_w - w - waste); + x_waste, page_w - w - x_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_y0_spin), - waste, page_h - h - waste); + y_waste, page_h - h - y_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dx_spin), - w + 2*waste, page_w - w - 2*waste); + w + 2*x_waste, page_w - w - 2*x_waste); gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dy_spin), - h + 2*waste, page_h - h - 2*waste); + h + 2*y_waste, page_h - h - 2*y_waste); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin), nx_1); gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin), ny_1); @@ -1508,7 +1529,7 @@ build_template (glTemplateDesigner *dlg) glPaper *paper; glTemplateLabelShape shape; glTemplateLabelType *label_type; - gdouble w, h, r, radius, hole, waste, margin; + gdouble w, h, r, radius, hole, waste, x_waste, y_waste, margin; gint nlayouts; gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2; @@ -1538,7 +1559,8 @@ build_template (glTemplateDesigner *dlg) w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin)); h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin)); r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_y_waste_spin)); margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin)); } @@ -1581,7 +1603,7 @@ build_template (glTemplateDesigner *dlg) label_type = gl_template_rect_label_type_new ("0", w/upp, h/upp, r/upp, - waste/upp); + x_waste/upp, y_waste/upp); break; case GL_TEMPLATE_SHAPE_ROUND: label_type = diff --git a/glabels2/src/template-designer.glade b/glabels2/src/template-designer.glade index f5396b2f..2f8a53d6 100644 --- a/glabels2/src/template-designer.glade +++ b/glabels2/src/template-designer.glade @@ -800,7 +800,7 @@ This dialog will assist you in the creation of a custom gLabels template. True - 5 + 6 3 False 12 @@ -881,7 +881,7 @@ This dialog will assist you in the creation of a custom gLabels template. True - 4. Waste (overprint allowed): + 4. Horiz. waste (overprint allowed): False False GTK_JUSTIFY_LEFT @@ -975,7 +975,7 @@ This dialog will assist you in the creation of a custom gLabels template. - + True inches False @@ -1062,7 +1062,7 @@ This dialog will assist you in the creation of a custom gLabels template. - + True True 0.01 @@ -1085,7 +1085,7 @@ This dialog will assist you in the creation of a custom gLabels template. True - 5. Margin + 6. Margin False False GTK_JUSTIFY_LEFT @@ -1099,13 +1099,34 @@ This dialog will assist you in the creation of a custom gLabels template. 0 1 - 4 - 5 + 5 + 6 fill + + + True + True + 0.01 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 10 + + + 1 + 2 + 5 + 6 + + + + True @@ -1123,15 +1144,15 @@ This dialog will assist you in the creation of a custom gLabels template. 2 3 - 4 - 5 + 5 + 6 fill - + True True 0.01 @@ -1150,6 +1171,54 @@ This dialog will assist you in the creation of a custom gLabels template. + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 2 + 3 + 4 + 5 + fill + + + + + + + True + 5. Vert. waste (overprint allowed): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 4 + 5 + fill + + + 0 diff --git a/glabels2/src/xml-label-191.c b/glabels2/src/xml-label-191.c index 24ecab00..bd922ecb 100644 --- a/glabels2/src/xml-label-191.c +++ b/glabels2/src/xml-label-191.c @@ -760,7 +760,7 @@ xml191_parse_label (xmlNodePtr label_node, h = gl_xml_get_prop_length (label_node, "height", 0); r = gl_xml_get_prop_length (label_node, "round", 0); label_type = - gl_template_rect_label_type_new ("0", w, h, r, 0.0); + gl_template_rect_label_type_new ("0", w, h, r, 0.0, 0.0); break; case GL_TEMPLATE_SHAPE_ROUND: