]> saetta.ns0.it Git - reptool/libreptool/commitdiff
Added and managaed output type RPTP_OUTPUT_GTK_DEFAULT_PRINTER that
authorAndrea Zagli <azagli@libero.it>
Sat, 25 Sep 2010 06:45:10 +0000 (08:45 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 25 Sep 2010 06:45:10 +0000 (08:45 +0200)
automatically print to the default printer.

Makefile.am
src/rptprint.c
src/rptprint.h

index 7fd5ac4b824930a10024f6f6d9bd5e2cdf04cf6b..50b201661f73886e1d522168724b45e96118714c 100644 (file)
@@ -7,3 +7,23 @@ EXTRA_DIST = libreptool.pc.in
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libreptool.pc
 
+distclean-local:
+       if test "$(srcdir)" = "."; then :; else \
+               rm -f ChangeLog; \
+       fi
+
+ChangeLog:
+       @echo Creating $@
+       @if test -d "$(srcdir)/.git"; then \
+         (GIT_DIR=$(top_srcdir)/.git ./missing --run git log --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \
+         && mv -f $@.tmp $@ \
+         || ($(RM) $@.tmp; \
+             echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
+             (test -f $@ || echo git-log is required to generate this file >> $@)); \
+       else \
+         test -f $@ || \
+         (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
+         echo A git checkout and git-log is required to generate this file >> $@); \
+       fi
+
+.PHONY: ChangeLog
index 282bfa2a19fb092073dd5d41a1f0eab5e3f09294..37837e239f37035fe096435d3da959f92c2acabd 100644 (file)
@@ -73,7 +73,7 @@ static void rpt_print_line (RptPrint *rpt_print,
                             const RptPoint *from_p,
                             const RptPoint *to_p,
                             const RptStroke *stroke,
-                                                       const RptRotation *rotation);
+                            const RptRotation *rotation);
 static void rpt_print_border (RptPrint *rpt_print,
                               const RptPoint *position,
                               const RptSize *size,
@@ -231,7 +231,7 @@ RptPrint
                        else
                                {
                                        /* TO DO */
-                                       g_warning ("Not a valid RepTool print report format");
+                                       g_warning ("Not a valid RepTool print report format.");
                                }
                }
 
@@ -365,7 +365,8 @@ rpt_print_print (RptPrint *rpt_print)
                        return;
                }
 
-       if (priv->output_type == RPTP_OUTPUT_GTK)
+       if (priv->output_type == RPTP_OUTPUT_GTK
+           || priv->output_type == RPTP_OUTPUT_GTK_DEFAULT_PRINTER)
                {
                        gchar *locale_old;
                        gchar *locale_num;
@@ -383,7 +384,9 @@ rpt_print_print (RptPrint *rpt_print)
                                          G_CALLBACK (rpt_print_gtk_draw_page), (gpointer)rpt_print);
 
                        locale_num = setlocale (LC_NUMERIC, "C");
-                       gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
+                       gtk_print_operation_run (operation,
+                                                (priv->output_type == RPTP_OUTPUT_GTK ? GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG : GTK_PRINT_OPERATION_ACTION_PRINT),
+                                                NULL, NULL);
                        setlocale (LC_NUMERIC, locale_num);
                        setlocale (LC_ALL, locale_old);
                }
@@ -505,13 +508,13 @@ rpt_print_print (RptPrint *rpt_print)
                                                                        else
                                                                                {
                                                                                        /* TO DO */
-                                                                                       g_warning ("Cairo surface status not sucess");
+                                                                                       g_warning ("Cairo surface status not sucess.");
                                                                                }
                                                                }
                                                        else
                                                                {
                                                                        /* TO DO */
-                                                                       g_warning ("Page width or height cannot be zero");
+                                                                       g_warning ("Page width or height cannot be zero.");
                                                                }
                                                }
                                        else
index 53ac36172b30503f9c2d0f9cebeb204fccf7572d..01a8b88d62b513938c70ab122d190c21132f78d7 100644 (file)
@@ -57,7 +57,8 @@ typedef enum
        RPTP_OUTPUT_PDF,
        RPTP_OUTPUT_PS,
        RPTP_OUTPUT_SVG,
-       RPTP_OUTPUT_GTK
+       RPTP_OUTPUT_GTK,
+       RPTP_OUTPUT_GTK_DEFAULT_PRINTER
 } RptPrintOutputType;
 
 RptPrint *rpt_print_new_from_xml (xmlDoc *xdoc);