]> git.sur5r.net Git - glabels/commitdiff
2004-07-11 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sun, 11 Jul 2004 05:18:36 +0000 (05:18 +0000)
committerJim Evins <evins@snaught.com>
Sun, 11 Jul 2004 05:18:36 +0000 (05:18 +0000)
* 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

glabels2/ChangeLog
glabels2/data/glabels-2.0.dtd
glabels2/libglabels/template.c
glabels2/libglabels/template.h
glabels2/libglabels/xml-template.c
glabels2/pixmaps/ex-rect-size.png
glabels2/src/print.c
glabels2/src/template-designer.c
glabels2/src/template-designer.glade
glabels2/src/xml-label-191.c

index 04e6cc0612e767896054628049bef0a0c726f412..70e981692bc8f6d98a4bb6a662cb2deb2e9f529c 100644 (file)
@@ -1,3 +1,27 @@
+2004-07-11  Jim Evins  <evins@snaught.com>
+
+       * 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  <evins@snaught.com>
        * src/print.c: (print_crop_marks), (draw_outline):
                Changed crop marks and label outlines to black, instead of 25% gray.
index af088b402dbf2977ed71058349d79444e0f5ad7e..dcd0b35d2b7f80960505483e2acb87e3c195aa56 100644 (file)
                  height          %LENGTH_TYPE;           #REQUIRED
                  round           %LENGTH_TYPE;           "0 pt"
                  waste           %LENGTH_TYPE;           #IMPLIED
+                 x_waste         %LENGTH_TYPE;           #IMPLIED
+                 y_waste         %LENGTH_TYPE;           #IMPLIED
 >
 
 <!ELEMENT Label-round ((%markup_element;)*, Layout+)>
index 21cbfcede152efacf899f36c0df76fc8fb7ef0a5..92c59832547110fa7127026b17e2fac01cdcf4f1 100644 (file)
@@ -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);
 
index 38f4c5572feaa45436b1279bc3a28d33c4c5f953..ff8f927bd1ba6e79652de26036dca63bd08d724e 100644 (file)
@@ -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,
index 1532aed029c39465fa5ada304d642246dbb41a85..f3fd21b50ca51948396328226a0a5dd1ba4a7c78 100644 (file)
@@ -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:
index a6d7af9270110314bbfa6c6d1bd043203f234826..2710472f1e1776090d6d03e7c62a7572ae3db054 100644 (file)
Binary files a/glabels2/pixmaps/ex-rect-size.png and b/glabels2/pixmaps/ex-rect-size.png differ
index a6bcf5eac2846f6d5f21e4f850bd38080c6613de..73bf40349c98a00dda53cbb06b40e981ae3b8357 100644 (file)
@@ -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);
index 66c28f7ee4b3432b68eb21a33e4f997ba2df7f83..d24be891a2f5f50fa37823a2036cfcc675002520 100644 (file)
@@ -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 =
index f5396b2f0abcf0e985e2b65eed1a0218db8a93e3..2f8a53d64624e5c174986245a0dc4d40664d2881 100644 (file)
@@ -800,7 +800,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                      <child>
                        <widget class="GtkTable" id="table4">
                          <property name="visible">True</property>
-                         <property name="n_rows">5</property>
+                         <property name="n_rows">6</property>
                          <property name="n_columns">3</property>
                          <property name="homogeneous">False</property>
                          <property name="row_spacing">12</property>
@@ -881,7 +881,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label86">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">4. Waste (overprint allowed):</property>
+                             <property name="label" translatable="yes">4. Horiz. waste (overprint allowed):</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -975,7 +975,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          </child>
 
                          <child>
-                           <widget class="GtkLabel" id="rect_waste_units_label">
+                           <widget class="GtkLabel" id="rect_x_waste_units_label">
                              <property name="visible">True</property>
                              <property name="label" translatable="yes">inches</property>
                              <property name="use_underline">False</property>
@@ -1062,7 +1062,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          </child>
 
                          <child>
-                           <widget class="GtkSpinButton" id="rect_waste_spin">
+                           <widget class="GtkSpinButton" id="rect_x_waste_spin">
                              <property name="visible">True</property>
                              <property name="can_focus">True</property>
                              <property name="climb_rate">0.01</property>
@@ -1085,7 +1085,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label101">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">5. Margin</property>
+                             <property name="label" translatable="yes">6. Margin</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1099,13 +1099,34 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                            <packing>
                              <property name="left_attach">0</property>
                              <property name="right_attach">1</property>
-                             <property name="top_attach">4</property>
-                             <property name="bottom_attach">5</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
                              <property name="x_options">fill</property>
                              <property name="y_options"></property>
                            </packing>
                          </child>
 
+                         <child>
+                           <widget class="GtkSpinButton" id="rect_margin_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.01</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">1</property>
+                             <property name="right_attach">2</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
                          <child>
                            <widget class="GtkLabel" id="rect_margin_units_label">
                              <property name="visible">True</property>
@@ -1123,15 +1144,15 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                            <packing>
                              <property name="left_attach">2</property>
                              <property name="right_attach">3</property>
-                             <property name="top_attach">4</property>
-                             <property name="bottom_attach">5</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
                              <property name="x_options">fill</property>
                              <property name="y_options"></property>
                            </packing>
                          </child>
 
                          <child>
-                           <widget class="GtkSpinButton" id="rect_margin_spin">
+                           <widget class="GtkSpinButton" id="rect_y_waste_spin">
                              <property name="visible">True</property>
                              <property name="can_focus">True</property>
                              <property name="climb_rate">0.01</property>
@@ -1150,6 +1171,54 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="y_options"></property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="rect_y_waste_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">2</property>
+                             <property name="right_attach">3</property>
+                             <property name="top_attach">4</property>
+                             <property name="bottom_attach">5</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label107">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">5. Vert. waste (overprint allowed):</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">0</property>
+                             <property name="right_attach">1</property>
+                             <property name="top_attach">4</property>
+                             <property name="bottom_attach">5</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
                        </widget>
                        <packing>
                          <property name="padding">0</property>
index 24ecab008c5a56952910b07368a4e361b6d2825a..bd922ecb1e77140fef7458fd81c7a2d3c3359026 100644 (file)
@@ -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: