]> git.sur5r.net Git - glabels/commitdiff
Template origins are now the upper left corner rather than the lower left.
authorJim Evins <evins@snaught.com>
Sat, 5 Oct 2002 03:29:54 +0000 (03:29 +0000)
committerJim Evins <evins@snaught.com>
Sat, 5 Oct 2002 03:29:54 +0000 (03:29 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@144 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/data/predefined-labels.template
glabels2/src/print.c
glabels2/src/print.h
glabels2/src/template.c
glabels2/src/wdgt-mini-preview.c

index 97675d46dc2102b7789db9ad28e1678a54968034..5276bc791357821af8bd175bbba9ef435613ba27 100644 (file)
   <Sheet name="Avery 5196" size="US-Letter" description="Diskette labels">
     <Label id="0" style="rectangle" width="198" height="198" round="5">
       <Markup type="margin" size="5"/>
-      <Layout nx="3" ny="3" x0="9" y0="126" dx="198" dy="216"/>
+      <Layout nx="3" ny="3" x0="9" y0="36" dx="198" dy="216"/>
     </Label>
     <Alias name="Avery 5096"/>
     <Alias name="Avery 5896"/>
          description="VCR Face Labels">
     <Label id="0" style="rectangle" width="220" height="133" round="5">
       <Markup type="margin" size="5"/>
-      <Layout nx="2" ny="5" x0="80" y0="66.5" dx="236" dy="133"/>
+      <Layout nx="2" ny="5" x0="80" y0="60.5" dx="236" dy="133"/>
     </Label>
     <Alias name="Avery 5199 - VCR Face"/>
   </Sheet>
   <Sheet name="Avery 8414" size="A4" description="Business Cards">
     <Label id="0" style="rectangle" width="246.6" height="144" round="0">
       <Markup type="margin" size="5"/>
-      <Layout nx="2" ny="5" x0="42" y0="64" dx="264" dy="144"/>
+      <Layout nx="2" ny="5" x0="42" y0="57.890" dx="264" dy="144"/>
     </Label>
     <Alias name="Avery J8414"/>
   </Sheet>
   <Sheet name="Zweckform 3654" size="A4" description="CD/DVD Labels">
     <Label id="0" style="cd" radius="165.78" hole="58.09">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="2" x0="131.78" y0="63.56" dx="0" dy="387.97"/>
+      <Layout nx="1" ny="2" x0="131.78" y0="58.7998" dx="0" dy="387.97"/>
     </Label>
   </Sheet>
 
   <Sheet name="Zweckform 4780" size="A4" description="Allround Labels">
     <Label id="0" style="rectangle" width="137.48" height="72" round="0">
       <Markup type="margin" size="5"/>
-      <Layout nx="4" ny="10" x0="23" y0="68" dx="137.48" dy="72"/>
+      <Layout nx="4" ny="10" x0="23" y0="53.8898" dx="137.48" dy="72"/>
     </Label>
   </Sheet>
 
         description="CD/DVD Labels (2 Pass)">
     <Label id="0" style="cd" radius="166.5" hole="58.5">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="1" x0="40.5" y0="414" dx="0" dy="0"/>
+      <Layout nx="1" ny="1" x0="40.5" y0="45" dx="0" dy="0"/>
     </Label>
   </Sheet>
 
          description="PRO CD Labels 2-up (face only, 2 Pass)">
     <Label id="0" style="cd" radius="166.5" hole="58.5">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="1" x0="34" y0="416" dx="0" dy="0"/>
+      <Layout nx="1" ny="1" x0="34" y0="43" dx="0" dy="0"/>
     </Label>
   </Sheet>
 
          description="PRO CD Labels 2-up (Face only, 2 Pass)">
     <Label id="0" style="rectangle" width="168" height="142" round="0">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="2" x0="407" y0="440" dx="0" dy="142"/>
+      <Layout nx="1" ny="2" x0="407" y0="68" dx="0" dy="142"/>
     </Label>
   </Sheet>
 
          description="PRO CD Labels 2-up (CD spine only)">
     <Label id="0" style="rectangle" width="288" height="20" round="0">
       <Markup type="margin" size="2"/>
-      <Layout nx="2" ny="1" x0="18" y0="387" dx="288" dy="0"/>
+      <Layout nx="2" ny="1" x0="18" y0="385" dx="288" dy="0"/>
     </Label>
   </Sheet>
 
    description="Mini-CD Labels, outer 4">
     <Label id="0" style="cd" radius="110.5" hole="57.5">
       <Markup type="margin" size="5"/>
-      <Layout nx="2" ny="2" x0="48.4" y0="41.9" dx="299.5" dy="481.5"/>
+      <Layout nx="2" ny="2" x0="48.4" y0="47.6" dx="299.5" dy="481.5"/>
     </Label>
   </Sheet>
   <!-- y0=47 is probably about right, but changing it isn't helping! -->
    description="Mini-CD Labels, center 1">
     <Label id="0" style="cd" radius="110.5" hole="57.5">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="1" x0="197.3" y0="281.5" dx="0" dy="0"/>
+      <Layout nx="1" ny="1" x0="197.3" y0="289.5" dx="0" dy="0"/>
     </Label>
   </Sheet>
 
          description="Slimline CD Case (rightside up)">
     <Label id="0" style="rectangle" width="394.5" height="342.5" round="0">
       <Markup type="margin" size="7.5"/>
-      <Layout nx="1" ny="2" x0="130" y0="44.6" dx="0" dy="363"/>
+      <Layout nx="1" ny="2" x0="130" y0="41.9" dx="0" dy="363"/>
     </Label>
   </Sheet>
   <Sheet name="Neato Slimline CD Case, spine" size="US-Letter"
          description="Slimline CD Case (upside down)">
     <Label id="0" style="rectangle" width="394.5" height="342.5" round="0">
       <Markup type="margin" size="7.5"/>
-      <Layout nx="1" ny="2" x0="96.5" y0="44.6" dx="0" dy="363"/>
+      <Layout nx="1" ny="2" x0="96.5" y0="41.9" dx="0" dy="363"/>
     </Label>
   </Sheet>
 
   <Sheet name="Neato A4 CD" size="A4" description="CD/DVD Labels (face only)">
     <Label id="0" style="cd" radius="166.5" hole="58.5">
       <Markup type="margin" size="5"/>
-      <Layout nx="1" ny="2" x0="125" y0="80" dx="0" dy="360"/>        
+      <Layout nx="1" ny="2" x0="125" y0="68.890" dx="0" dy="360"/>        
     </Label>                                                      
   </Sheet>
 
-  <!-- =================================================================== -->
-  <!-- EPSON Photo Stickers, 17 x 24 mm, 16 per sheet (Actually A6)        -->
-  <!-- =================================================================== -->
-  <Sheet name="Epson S041144" size="A4" description="EPSON Photo Stickers 16">
-    <Label id="0" style="rectangle" width="48" height="68" round="7">
-      <Markup type="margin" size="5"/>
-      <Layout nx="4" ny="4" x0="33" y0="59" dx="59.5" dy="79.5"/>
-    </Label>
-  </Sheet>
-
   <!-- =================================================================== -->
   <!-- DATA BECKER: Business Cards, 50 x 90 mm, 10 per sheet               -->
   <!-- =================================================================== -->
   <Sheet name="DataBecker" size="A4" description="Business Cards">
     <Label id="0" style="rectangle" width="255" height="142" round="0">
       <Markup type="margin" size="5"/>
-      <Layout nx="2" ny="5" x0="36" y0="62" dx="255" dy="142"/>
+      <Layout nx="2" ny="5" x0="36" y0="69.890" dx="255" dy="142"/>
     </Label>
   </Sheet>
 
   <Sheet name="Hema Etiketten" size="A4" description="Rectangular Labels">
     <Label id="0" style="rectangle" width="178" height="108" round="5">
       <Markup type="margin" size="5"/>
-      <Layout nx="3" ny="7" x0="20" y0="42" dx="187" dy="107"/>
+      <Layout nx="3" ny="7" x0="20" y0="49.890" dx="187" dy="107"/>
     </Label>
   </Sheet>
 
   <Sheet name="APLI 1999" size="A4" description="Mailing Labels">
     <Label id="0" style="rectangle" width="281" height="193" round="5">
       <Markup type="margin" size="5"/>
-      <Layout nx="2" ny="4" x0="13" y0="45" dx="289" dy="194"/>
+      <Layout nx="2" ny="4" x0="13" y0="21.890" dx="289" dy="194"/>
     </Label>
   </Sheet>
 
   <Sheet name="Herma 4607" size="A4" description="Allround Labels --64">
     <Label id="0" style="rectangle" width="136.913" height="47.9055" round="0">
       <Markup type="margin" size="5"/>
-      <Layout nx="4" ny="16" x0="24.0945" y0="35.7165" dx="136.913" dy="47.9055"/>
+      <Layout nx="4" ny="16" x0="24.0945" y0="39.6853" dx="136.913" dy="47.9055"/>
     </Label>
     <Alias name="Herma 4271"/>
   </Sheet>
     <Alias name="DataBecker 0368"/>
   </Sheet>
 
+
+  <!-- ******************************************************************** -->
+  <!-- Misc. A6 products.                                                   -->
+  <!-- ******************************************************************** -->
+
+  <!-- =================================================================== -->
+  <!-- EPSON Photo Stickers, 17 x 24 mm, 16 per sheet                      -->
+  <!-- =================================================================== -->
+  <Sheet name="Epson S041144" size="A6" description="EPSON Photo Stickers 16">
+    <Label id="0" style="rectangle" width="48" height="68" round="7">
+      <Markup type="margin" size="5"/>
+      <Layout nx="4" ny="4" x0="33" y0="59" dx="59.5" dy="79.5"/>
+    </Label>
+  </Sheet>
+
 </GLabels-templates>
 
 
index 5b1bee86f6bb83aee8d3f2937f62a3d195e0da7d..e98fdba4f6a35c3d66dce68617d3c5b888219d0a 100644 (file)
 
 #define GL_PRINT_DEFAULT_PAPER "US Letter"
 
-/*===========================================*/
-/* Private types.                            */
-/*===========================================*/
+/*=========================================================================*/
+/* Private types.                                                          */
+/*=========================================================================*/
+
 typedef struct _PrintInfo {
        /* gnome print context */
        GnomePrintContext *pc;
@@ -58,58 +59,103 @@ typedef struct _PrintInfo {
        glTemplate *template;
        gboolean label_rotate_flag;
 
+       /* page size */
+       gdouble page_width;
+       gdouble page_height;
+
+       /* page counter */
+       gint sheet;
 } PrintInfo;
 
-/*===========================================*/
-/* Private function prototypes.              */
-/*===========================================*/
-static PrintInfo *print_info_new (GnomePrintMaster * master, glLabel * label);
-static void print_info_free (PrintInfo ** pi);
-
-static void print_label (PrintInfo * pi, glLabel * label, gdouble x, gdouble y,
-                        glMergeRecord * record, gboolean outline_flag,
-                        gboolean reverse_flag);
-
-static void draw_label (PrintInfo * pi, glLabel * label,
-                       glMergeRecord * record);
-
-static void draw_text_object (PrintInfo * pi, glLabelText * object,
-                             glMergeRecord * record);
-static void draw_box_object (PrintInfo * pi, glLabelBox * object);
-static void draw_line_object (PrintInfo * pi, glLabelLine * object);
-static void draw_ellipse_object (PrintInfo * pi, glLabelEllipse * object);
-static void draw_image_object (PrintInfo * pi, glLabelImage * object);
-static void draw_barcode_object (PrintInfo * pi, glLabelBarcode * object,
-                                glMergeRecord * record);
-
-static void draw_outline (PrintInfo * pi, glLabel * label);
-static void clip_to_outline (PrintInfo * pi, glLabel * label);
-
-static void create_rectangle_path (GnomePrintContext * pc,
-                                  gdouble x0, gdouble y0,
-                                  gdouble w, gdouble h);
-static void create_ellipse_path (GnomePrintContext * pc,
-                                gdouble x0, gdouble y0,
-                                gdouble rx, gdouble ry);
-static void create_rounded_rectangle_path (GnomePrintContext * pc,
-                                          gdouble x0, gdouble y0,
-                                          gdouble w, gdouble h, gdouble r);
+
+/*=========================================================================*/
+/* Private function prototypes.                                            */
+/*=========================================================================*/
+static PrintInfo *print_info_new              (GnomePrintMaster *master,
+                                              glLabel          *label);
+
+static void       print_info_free             (PrintInfo       **pi);
+
+
+static void       print_page_begin            (PrintInfo        *pi);
+
+static void       print_page_end              (PrintInfo        *pi);
+
+static void       print_label                 (PrintInfo        *pi,
+                                              glLabel          *label,
+                                              gdouble           x,
+                                              gdouble           y,
+                                              glMergeRecord    *record,
+                                              gboolean          outline_flag,
+                                              gboolean          reverse_flag);
+
+
+static void       draw_label                  (PrintInfo        *pi,
+                                              glLabel          *label,
+                                              glMergeRecord    *record);
+
+
+static void       draw_text_object            (PrintInfo        *pi,
+                                              glLabelText      *object,
+                                              glMergeRecord    *record);
+
+static void       draw_box_object             (PrintInfo        *pi,
+                                              glLabelBox       *object);
+
+static void       draw_line_object            (PrintInfo        *pi,
+                                              glLabelLine      *object);
+
+static void       draw_ellipse_object         (PrintInfo        *pi,
+                                              glLabelEllipse   *object);
+
+static void       draw_image_object           (PrintInfo        *pi,
+                                              glLabelImage     *object);
+
+static void       draw_barcode_object         (PrintInfo        *pi,
+                                              glLabelBarcode   *object,
+                                              glMergeRecord    *record);
+
+
+static void       draw_outline                (PrintInfo        *pi,
+                                              glLabel          *label);
+
+static void       clip_to_outline             (PrintInfo        *pi,
+                                              glLabel          *label);
+
+
+static void       create_rectangle_path         (GnomePrintContext *pc,
+                                                gdouble            x0,
+                                                gdouble            y0,
+                                                gdouble            w,
+                                                gdouble            h);
+
+static void       create_ellipse_path           (GnomePrintContext *pc,
+                                                gdouble            x0,
+                                                gdouble            y0,
+                                                gdouble            rx,
+                                                gdouble            ry);
+
+static void       create_rounded_rectangle_path (GnomePrintContext *pc,
+                                                gdouble            x0,
+                                                gdouble            y0,
+                                                gdouble            w,
+                                                gdouble            h,
+                                                gdouble            r);
 \f
 /*****************************************************************************/
 /* Simple (no merge data) print command.                                     */
 /*****************************************************************************/
 void
-gl_print_simple (GnomePrintMaster * master,
-                glLabel label,
-                gint n_sheets,
-                gint first,
-                gint last,
-                gboolean outline_flag,
-                gboolean reverse_flag)
+gl_print_simple (GnomePrintMaster *master,
+                glLabel          *label,
+                gint              n_sheets,
+                gint              first,
+                gint              last,
+                gboolean          outline_flag,
+                gboolean          reverse_flag)
 {
        PrintInfo *pi;
        gint i_sheet, i_label;
-       gchar *page_str = NULL;
        glTemplateOrigin *origins;
 
        gl_debug (DEBUG_PRINT, "START");
@@ -120,9 +166,7 @@ gl_print_simple (GnomePrintMaster * master,
 
        for (i_sheet = 0; i_sheet < n_sheets; i_sheet++) {
 
-               page_str = g_strdup_printf ("sheet %d", i_sheet + 1);
-               gnome_print_beginpage (pi->pc, page_str);
-               g_free (page_str);
+               print_page_begin (pi);
 
                for (i_label = first - 1; i_label < last; i_label++) {
 
@@ -132,7 +176,7 @@ gl_print_simple (GnomePrintMaster * master,
 
                }
 
-               gnome_print_showpage (pi->pc);
+               print_page_end (pi);
        }
 
        g_free (origins);
@@ -146,17 +190,16 @@ gl_print_simple (GnomePrintMaster * master,
 /* Merge print command (collated copies)                                     */
 /*****************************************************************************/
 void
-gl_print_merge_collated (GnomePrintMaster * master,
-                        glLabel label,
-                        GList record_list,
-                        gint n_copies,
-                        gint first,
-                        gboolean outline_flag,
-                        gboolean reverse_flag)
+gl_print_merge_collated (GnomePrintMaster *master,
+                        glLabel          *label,
+                        GList            *record_list,
+                        gint              n_copies,
+                        gint              first,
+                        gboolean          outline_flag,
+                        gboolean          reverse_flag)
 {
        PrintInfo *pi;
        gint i_sheet, i_label, n_labels_per_page, i_copy;
-       gchar *str = NULL;
        glMergeRecord *record;
        GList *p;
        glTemplateOrigin *origins;
@@ -178,10 +221,7 @@ gl_print_merge_collated (GnomePrintMaster * master,
                        for (i_copy = 0; i_copy < n_copies; i_copy++) {
 
                                if ((i_label == 0) || (i_sheet == 0)) {
-                                       str = g_strdup_printf ("sheet %d",
-                                                              ++i_sheet);
-                                       gnome_print_beginpage (pi->pc, str);
-                                       g_free (str);
+                                       print_page_begin (pi);
                                }
 
                                print_label (pi, label,
@@ -192,14 +232,14 @@ gl_print_merge_collated (GnomePrintMaster * master,
 
                                i_label = (i_label + 1) % n_labels_per_page;
                                if (i_label == 0) {
-                                       gnome_print_showpage (pi->pc);
+                                       print_page_end (pi);
                                }
                        }
                }
        }
 
        if (i_label != 0) {
-               gnome_print_showpage (pi->pc);
+               print_page_end (pi);
        }
 
        g_free (origins);
@@ -213,17 +253,16 @@ gl_print_merge_collated (GnomePrintMaster * master,
 /* Merge print command (uncollated copies)                                   */
 /*****************************************************************************/
 void
-gl_print_merge_uncollated (GnomePrintMaster * master,
-                          glLabel label,
-                          GList record_list,
-                          gint n_copies,
-                          gint first,
-                          gboolean outline_flag,
-                          gboolean reverse_flag)
+gl_print_merge_uncollated (GnomePrintMaster *master,
+                          glLabel          *label,
+                          GList            *record_list,
+                          gint              n_copies,
+                          gint              first,
+                          gboolean          outline_flag,
+                          gboolean          reverse_flag)
 {
        PrintInfo *pi;
        gint i_sheet, i_label, n_labels_per_page, i_copy;
-       gchar *str = NULL;
        glMergeRecord *record;
        GList *p;
        glTemplateOrigin *origins;
@@ -247,10 +286,7 @@ gl_print_merge_uncollated (GnomePrintMaster * master,
 
 
                                if ((i_label == 0) || (i_sheet == 0)) {
-                                       str = g_strdup_printf ("sheet %d",
-                                                              ++i_sheet);
-                                       gnome_print_beginpage (pi->pc, str);
-                                       g_free (str);
+                                       print_page_begin (pi);
                                }
 
                                print_label (pi, label,
@@ -261,14 +297,14 @@ gl_print_merge_uncollated (GnomePrintMaster * master,
 
                                i_label = (i_label + 1) % n_labels_per_page;
                                if (i_label == 0) {
-                                       gnome_print_showpage (pi->pc);
+                                       print_page_end (pi);
                                }
                        }
                }
 
        }
        if (i_label != 0) {
-               gnome_print_showpage (pi->pc);
+               print_page_end (pi);
        }
 
        g_free (origins);
@@ -282,9 +318,12 @@ gl_print_merge_uncollated (GnomePrintMaster * master,
 /* Batch print.  Call appropriate function above.                            */
 /*****************************************************************************/
 void
-gl_print_batch (GnomePrintMaster * master, glLabel * label,
-               gint n_sheets, gint n_copies,
-               gboolean outline_flag, gboolean reverse_flag)
+gl_print_batch (GnomePrintMaster *master,
+               glLabel          *label,
+               gint              n_sheets,
+               gint              n_copies,
+               gboolean          outline_flag,
+               gboolean          reverse_flag)
 {
        gint n_per_page;
        GList *record_list = NULL;
@@ -320,11 +359,12 @@ gl_print_batch (GnomePrintMaster * master, glLabel * label,
 /* PRIVATE.  new print info structure                                        */
 /*---------------------------------------------------------------------------*/
 static PrintInfo *
-print_info_new (GnomePrintMaster * master,
-               glLabel label)
+print_info_new (GnomePrintMaster *master,
+               glLabel          *label)
 {
        PrintInfo *pi = g_new0 (PrintInfo, 1);
        glTemplate *template;
+       const GnomePrintPaper *paper = NULL;
 
        gl_debug (DEBUG_PRINT, "START");
 
@@ -339,7 +379,6 @@ print_info_new (GnomePrintMaster * master,
        pi->config = gnome_print_master_get_config (master);
 
        if ((template != NULL) && (template->page_size != NULL)) {
-               const GnomePrintPaper *paper = NULL;
 
                gl_debug (DEBUG_PRINT,
                          "setting page size = \"%s\"", template->page_size);
@@ -364,14 +403,20 @@ print_info_new (GnomePrintMaster * master,
                                               paper->height,
                                               GNOME_PRINT_PS_UNIT);
        } else {
+               g_warning ("Cannot determine correct page size.");
+               paper = gnome_print_paper_get_by_name (GL_PRINT_DEFAULT_PAPER);
                gnome_print_config_set (pi->config,
                                        GNOME_PRINT_KEY_PAPER_SIZE,
                                        GL_PRINT_DEFAULT_PAPER);
        }
+       pi->page_width = paper->width;
+       pi->page_height = paper->height;
 
        pi->template = template;
        pi->label_rotate_flag = gl_label_get_rotate_flag (label);
 
+       pi->sheet = 0;
+
        gl_debug (DEBUG_PRINT, "END");
 
        return pi;
@@ -381,7 +426,7 @@ print_info_new (GnomePrintMaster * master,
 /* PRIVATE.  free print info structure                                       */
 /*---------------------------------------------------------------------------*/
 static void
-print_info_free (PrintInfo ** pi)
+print_info_free (PrintInfo **pi)
 {
        gl_debug (DEBUG_PRINT, "START");
 
@@ -395,6 +440,34 @@ print_info_free (PrintInfo ** pi)
        gl_debug (DEBUG_PRINT, "END");
 }
 
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  Begin a new page.                                               */
+/*---------------------------------------------------------------------------*/
+static void
+print_page_begin (PrintInfo *pi)
+{
+       gchar *str;
+
+       pi->sheet++;
+
+       str = g_strdup_printf ("sheet%02d", pi->sheet);
+       gnome_print_beginpage (pi->pc, str);
+       g_free (str);
+
+       /* Translate and scale, so that our origin is at the upper left. */
+       gnome_print_translate (pi->pc, 0.0, pi->page_height);
+       gnome_print_scale (pi->pc, 1.0, -1.0);
+}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE.  End a page.                                                     */
+/*---------------------------------------------------------------------------*/
+static void
+print_page_end (PrintInfo *pi)
+{
+       gnome_print_showpage (pi->pc);
+}
+
 /*---------------------------------------------------------------------------*/
 /* PRIVATE.  Print i'th label.                                               */
 /*---------------------------------------------------------------------------*/
@@ -407,7 +480,6 @@ print_label (PrintInfo     *pi,
             gboolean       outline_flag,
             gboolean       reverse_flag)
 {
-       gdouble a[6];
        gdouble width, height;
        glTemplate *template;
 
@@ -425,17 +497,10 @@ print_label (PrintInfo     *pi,
        if (gl_label_get_rotate_flag (label)) {
                gl_debug (DEBUG_PRINT, "Rotate flag set");
                gnome_print_rotate (pi->pc, 90.0);
-               gnome_print_scale (pi->pc, 1.0, -1.0);
-       } else {
-               gl_debug (DEBUG_PRINT, "Rotate flag NOT set");
-               art_affine_scale (a, 1.0, -1.0);
-               a[5] = height;
-               gnome_print_concat (pi->pc, a);
        }
        if ( reverse_flag ) {
                gnome_print_translate (pi->pc, width, 0.0);
-               art_affine_scale (a, -1.0, 1.0);
-               gnome_print_concat (pi->pc, a);
+               gnome_print_scale (pi->pc, -1.0, 1.0);
        }
        if (outline_flag) {
                draw_outline (pi, label);
@@ -454,9 +519,9 @@ print_label (PrintInfo     *pi,
 /* PRIVATE.  Draw label.                                                     */
 /*---------------------------------------------------------------------------*/
 static void
-draw_label (PrintInfo pi,
-           glLabel label,
-           glMergeRecord * record)
+draw_label (PrintInfo     *pi,
+           glLabel       *label,
+           glMergeRecord *record)
 {
        GList *p_obj;
        glLabelObject *object;
@@ -490,9 +555,9 @@ draw_label (PrintInfo * pi,
 /* PRIVATE.  Draw text object.                                               */
 /*---------------------------------------------------------------------------*/
 static void
-draw_text_object (PrintInfo pi,
-                 glLabelText object,
-                 glMergeRecord * record)
+draw_text_object (PrintInfo     *pi,
+                 glLabelText   *object,
+                 glMergeRecord *record)
 {
        GnomeFont *font;
        gchar **line;
@@ -591,8 +656,8 @@ draw_text_object (PrintInfo * pi,
 /* PRIVATE.  Draw box object.                                                */
 /*---------------------------------------------------------------------------*/
 static void
-draw_box_object (PrintInfo pi,
-                glLabelBox * object)
+draw_box_object (PrintInfo  *pi,
+                glLabelBox *object)
 {
        gdouble x, y, w, h;
        gdouble line_width;
@@ -632,8 +697,8 @@ draw_box_object (PrintInfo * pi,
 /* PRIVATE.  Draw line object.                                               */
 /*---------------------------------------------------------------------------*/
 static void
-draw_line_object (PrintInfo pi,
-                 glLabelLine * object)
+draw_line_object (PrintInfo   *pi,
+                 glLabelLine *object)
 {
        gdouble x, y, w, h;
        gdouble line_width;
@@ -663,8 +728,8 @@ draw_line_object (PrintInfo * pi,
 /* PRIVATE.  Draw ellipse object.                                            */
 /*---------------------------------------------------------------------------*/
 static void
-draw_ellipse_object (PrintInfo pi,
-                    glLabelEllipse * object)
+draw_ellipse_object (PrintInfo      *pi,
+                    glLabelEllipse *object)
 {
        gdouble x, y, x0, y0, rx, ry, w, h;
        gdouble line_width;
@@ -709,8 +774,8 @@ draw_ellipse_object (PrintInfo * pi,
 /* PRIVATE.  Draw image object.                                              */
 /*---------------------------------------------------------------------------*/
 static void
-draw_image_object (PrintInfo pi,
-                  glLabelImage * object)
+draw_image_object (PrintInfo    *pi,
+                  glLabelImage *object)
 {
        gdouble x, y, w, h;
        const GdkPixbuf *pixbuf;
@@ -752,9 +817,9 @@ draw_image_object (PrintInfo * pi,
 /* PRIVATE.  Draw box object.                                                */
 /*---------------------------------------------------------------------------*/
 static void
-draw_barcode_object (PrintInfo pi,
-                    glLabelBarcode * object,
-                    glMergeRecord record)
+draw_barcode_object (PrintInfo      *pi,
+                    glLabelBarcode *object,
+                    glMergeRecord  *record)
 {
        glBarcode *gbc;
        glBarcodeLine *line;
@@ -863,8 +928,8 @@ draw_barcode_object (PrintInfo * pi,
 /* PRIVATE.  Draw outline.                                                   */
 /*---------------------------------------------------------------------------*/
 static void
-draw_outline (PrintInfo * pi,
-             glLabel label)
+draw_outline (PrintInfo *pi,
+             glLabel   *label)
 {
        gdouble w, h, r;
        gdouble r1, r2;
@@ -925,8 +990,8 @@ draw_outline (PrintInfo * pi,
 /* PRIVATE.  Clip to outline.                                                */
 /*---------------------------------------------------------------------------*/
 static void
-clip_to_outline (PrintInfo * pi,
-                glLabel label)
+clip_to_outline (PrintInfo *pi,
+                glLabel   *label)
 {
        gdouble w, h, r;
        gdouble r1;
@@ -978,11 +1043,11 @@ clip_to_outline (PrintInfo * pi,
 /* PRIVATE.  Path creation utilities.                                        */
 /*---------------------------------------------------------------------------*/
 static void
-create_rectangle_path (GnomePrintContext * pc,
-                      gdouble x0,
-                      gdouble y0,
-                      gdouble w,
-                      gdouble h)
+create_rectangle_path (GnomePrintContext *pc,
+                      gdouble            x0,
+                      gdouble            y0,
+                      gdouble            w,
+                      gdouble            h)
 {
        gl_debug (DEBUG_PRINT, "START");
 
@@ -998,11 +1063,11 @@ create_rectangle_path (GnomePrintContext * pc,
 }
 
 static void
-create_ellipse_path (GnomePrintContext * pc,
-                    gdouble x0,
-                    gdouble y0,
-                    gdouble rx,
-                    gdouble ry)
+create_ellipse_path (GnomePrintContext *pc,
+                    gdouble            x0,
+                    gdouble            y0,
+                    gdouble            rx,
+                    gdouble            ry)
 {
        gdouble x, y;
        gint i_theta;
@@ -1022,12 +1087,12 @@ create_ellipse_path (GnomePrintContext * pc,
 }
 
 static void
-create_rounded_rectangle_path (GnomePrintContext * pc,
-                              gdouble x0,
-                              gdouble y0,
-                              gdouble w,
-                              gdouble h,
-                              gdouble r)
+create_rounded_rectangle_path (GnomePrintContext *pc,
+                              gdouble            x0,
+                              gdouble            y0,
+                              gdouble            w,
+                              gdouble            h,
+                              gdouble            r)
 {
        gdouble x, y;
        gint i_theta;
index b79e5c55121dc46da26cedd95a75786a365e7cbb..a6e6d589f325b7a8cb8240609e25cb63ce1857c3 100644 (file)
 #include <libgnomeprintui/gnome-print-master-preview.h>
 #include "label.h"
 
-extern void gl_print_simple (GnomePrintMaster * master, glLabel * label,
-                            gint n_sheets, gint first, gint last,
-                            gboolean outline_flag, gboolean reverse_flag);
-
-extern void gl_print_merge_collated (GnomePrintMaster * master,
-                                    glLabel * label,
-                                    GList *record_list,
-                                    gint n_copies, gint first,
-                                    gboolean outline_flag,
-                                    gboolean reverse_flag);
-
-extern void gl_print_merge_uncollated (GnomePrintMaster * master,
-                                      glLabel * label,
-                                      GList *record_list,
-                                      gint n_copies, gint first,
-                                      gboolean outline_flag,
-                                      gboolean reverse_flag);
-
-extern void gl_print_batch (GnomePrintMaster * master, glLabel * label,
-                           gint n_sheets, gint n_copies,
-                           gboolean outline_flag, gboolean reverse_flag);
+G_BEGIN_DECLS
 
+void gl_print_simple           (GnomePrintMaster *master,
+                               glLabel          *label,
+                               gint              n_sheets,
+                               gint              first,
+                               gint              last,
+                               gboolean          outline_flag,
+                               gboolean          reverse_flag);
+
+void gl_print_merge_collated   (GnomePrintMaster *master,
+                               glLabel          *label,
+                               GList            *record_list,
+                               gint              n_copies,
+                               gint              first,
+                               gboolean          outline_flag,
+                               gboolean          reverse_flag);
+
+void gl_print_merge_uncollated (GnomePrintMaster *master,
+                               glLabel          *label,
+                               GList            *record_list,
+                               gint              n_copies,
+                               gint              first,
+                               gboolean          outline_flag,
+                               gboolean          reverse_flag);
+
+void gl_print_batch            (GnomePrintMaster *master,
+                               glLabel          *label,
+                               gint              n_sheets,
+                               gint              n_bcopies,
+                               gboolean          outline_flag,
+                               gboolean          reverse_flag);
+
+G_END_DECLS
 
 #endif
index f625681f3c2163cea47de6751d2e49b1efd695a1..0402afd6ec097ca19a5779873494ab75b711fda1 100644 (file)
@@ -1051,9 +1051,9 @@ compare_origins (gconstpointer a,
        const glTemplateOrigin *a_origin = a, *b_origin = b;
 
        if ( a_origin->y < b_origin->y ) {
-               return +1;
-       } else if ( a_origin->y > b_origin->y ) {
                return -1;
+       } else if ( a_origin->y > b_origin->y ) {
+               return +1;
        } else {
                if ( a_origin->x < b_origin->x ) {
                        return -1;
index 51a97d3866d08a1ebfa64cf123181624611c6727..b6c99772f5d5db23ab96c6c496742ba79d35d735 100644 (file)
@@ -329,7 +329,7 @@ mini_outline_list_new (GnomeCanvas *canvas,
        GList                 *list = NULL;
        gint                   i, n_labels;
        glTemplateOrigin      *origins;
-       gdouble                x1, y1, x2, y2, y_temp, w, h;
+       gdouble                x1, y1, x2, y2, w, h;
        const GnomePrintPaper *paper = NULL;
        gdouble                paper_height;
 
@@ -352,12 +352,6 @@ mini_outline_list_new (GnomeCanvas *canvas,
                x2 = x1 + w;
                y2 = y1 + h;
 
-               /* transform origin from lower left to upper left */
-               /* and swap y's so that (y1 < y2) */
-               y_temp = y2;
-               y2 = paper_height - y1;
-               y1 = paper_height - y_temp;
-
                switch (template->label.style) {
                case GL_TEMPLATE_STYLE_RECT:
                        item = gnome_canvas_item_new (group,