From fb62736c8d9761183cc64ded63a9b5ff9fc5ae3d Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 22 Aug 2004 20:43:36 +0000 Subject: [PATCH] 2004-08-22 Jim Evins MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * AUTHORS: * src/glabels-batch.c: (main): Applied patch with minor mods to allow selecting merge source and crop-marks on glabels-batch's command line. Original patch provided by José Dapena Paz . git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@461 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/AUTHORS | 1 + glabels2/ChangeLog | 8 ++++++++ glabels2/src/glabels-batch.c | 24 ++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/glabels2/AUTHORS b/glabels2/AUTHORS index 687d3067..a837a3af 100644 --- a/glabels2/AUTHORS +++ b/glabels2/AUTHORS @@ -47,6 +47,7 @@ Glabels includes contributions from: 0.4.3: Javier Donaire Segarra Alessandro Zummo + José Dapena Paz Akkana Dag Wieers diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 8e1c5b1d..f16997e1 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2004-08-22 Jim Evins + + * AUTHORS: + * src/glabels-batch.c: (main): + Applied patch with minor mods to allow selecting merge source and + crop-marks on glabels-batch's command line. Original patch provided by + José Dapena Paz . + 2004-08-15 Jim Evins * data/desktop/glabels.desktop.in: diff --git a/glabels2/src/glabels-batch.c b/glabels2/src/glabels-batch.c index 381ca9b5..dc32147e 100644 --- a/glabels2/src/glabels-batch.c +++ b/glabels2/src/glabels-batch.c @@ -42,6 +42,8 @@ static gint n_copies = 1; static gint n_sheets = 1; static gboolean outline_flag = FALSE; static gboolean reverse_flag = FALSE; +static gboolean crop_marks_flag = FALSE; +static gchar *input = NULL; static struct poptOption options[] = { {"help", '?', POPT_ARG_NONE, &help_flag, 1, @@ -58,6 +60,10 @@ static struct poptOption options[] = { N_("print outlines (to test printer alignment)"), NULL}, {"reverse", 'r', POPT_ARG_NONE, &reverse_flag, 0, N_("print in reverse (i.e. a mirror image)"), NULL}, + {"cropmarks", 'C', POPT_ARG_NONE, &crop_marks_flag, 0, + N_("print crop marks"), NULL}, + {"input", 'i', POPT_ARG_STRING, &input, 0, + N_("input file for merging"), N_("filename")}, {NULL, '\0', 0, NULL, 0, NULL, NULL} }; @@ -79,6 +85,7 @@ main (int argc, char **argv) gchar *abs_fn; GnomePrintConfig *config = NULL; glLabel *label = NULL; + glMerge *merge = NULL; glXMLLabelStatus status; glPrintFlags flags; @@ -121,7 +128,7 @@ main (int argc, char **argv) flags.outline = outline_flag; flags.reverse = reverse_flag; - flags.crop_marks = FALSE; + flags.crop_marks = crop_marks_flag; /* initialize components */ gl_merge_init (); @@ -130,10 +137,23 @@ main (int argc, char **argv) /* now print the files */ for (p = file_list; p; p = p->next) { - g_print ("LABEL FILE = %s\n", p->data); + g_print ("LABEL FILE = %s\n", (gchar *) p->data); label = gl_xml_label_open (p->data, &status); + + if ( status == XML_LABEL_OK ) { + if (input != NULL) { + merge = gl_label_get_merge (label); + if (merge != NULL) { + gl_merge_set_src(merge, input); + gl_label_set_merge(label, merge); + } else { + fprintf ( stderr, + _("cannot perform document merge with glabels file %s\n"), + (char *)p->data ); + } + } if ( job == NULL ) { job = gnome_print_job_new (NULL); abs_fn = gl_util_make_absolute ( output ); -- 2.39.5