]> www.fi.muni.cz Git - evince.git/blob - shell/ev-application.c
Remember print settings. Fixes bug #349102.
[evince.git] / shell / ev-application.c
1 /* this file is part of evince, a gnome document viewer
2  *
3  *  Copyright (C) 2004 Martin Kretzschmar
4  *
5  *  Author:
6  *    Martin Kretzschmar <martink@gnome.org>
7  *
8  * Evince is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Evince is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21  */
22
23 #include "ev-application.h"
24 #include "ev-utils.h"
25 #include "ev-file-helpers.h"
26 #include "ev-document-factory.h"
27 #include "totem-scrsaver.h"
28
29 #include <glib.h>
30 #include <glib/gi18n.h>
31 #include <glib-object.h>
32 #include <gtk/gtkfilechooserdialog.h>
33 #include <gtk/gtkstock.h>
34 #include <gtk/gtkwidget.h>
35 #include <gtk/gtkmain.h>
36
37 #if WITH_GNOME
38 #include <libgnomeui/gnome-client.h>
39 #endif
40
41 #ifdef ENABLE_DBUS
42 #include "ev-application-service.h"
43 #include <dbus/dbus-glib-bindings.h>
44 #endif
45
46 #include <string.h>
47
48 struct _EvApplication {
49         GObject base_instance;
50
51         gchar *toolbars_file;
52
53         EggToolbarsModel *toolbars_model;
54
55 #ifndef HAVE_GTK_RECENT
56         EggRecentModel  *recent_model;
57 #endif
58
59         TotemScrsaver *scr_saver;
60
61         gchar *last_chooser_uri;
62
63 #ifdef WITH_GTK_PRINT
64         GtkPrintSettings *print_settings;
65 #if GTK_CHECK_VERSION (2, 11, 0)
66         gchar            *print_settings_file;
67 #endif
68 #endif
69 };
70
71 struct _EvApplicationClass {
72         GObjectClass base_class;
73 };
74
75 G_DEFINE_TYPE (EvApplication, ev_application, G_TYPE_OBJECT);
76
77 #define APPLICATION_SERVICE_NAME "org.gnome.evince.ApplicationService"
78
79 #ifdef ENABLE_DBUS
80 gboolean
81 ev_application_register_service (EvApplication *application)
82 {
83         static DBusGConnection *connection = NULL;
84         DBusGProxy *driver_proxy;
85         GError *err = NULL;
86         guint request_name_result;
87
88         if (connection) {
89                 g_warning ("Service already registered.");
90                 return FALSE;
91         }
92         
93         connection = dbus_g_bus_get (DBUS_BUS_STARTER, &err);
94         if (connection == NULL) {
95                 g_warning ("Service registration failed.");
96                 g_error_free (err);
97
98                 return FALSE;
99         }
100
101         driver_proxy = dbus_g_proxy_new_for_name (connection,
102                                                   DBUS_SERVICE_DBUS,
103                                                   DBUS_PATH_DBUS,
104                                                   DBUS_INTERFACE_DBUS);
105
106         if (!org_freedesktop_DBus_request_name (driver_proxy,
107                                                 APPLICATION_SERVICE_NAME,
108                                                 DBUS_NAME_FLAG_DO_NOT_QUEUE,
109                                                 &request_name_result, &err)) {
110                 g_warning ("Service registration failed.");
111                 g_clear_error (&err);
112         }
113
114         g_object_unref (driver_proxy);
115         
116         if (request_name_result == DBUS_REQUEST_NAME_REPLY_EXISTS) {
117                 return FALSE;
118         }
119
120         dbus_g_object_type_install_info (EV_TYPE_APPLICATION,
121                                          &dbus_glib_ev_application_object_info);
122         dbus_g_connection_register_g_object (connection,
123                                              "/org/gnome/evince/Evince",
124                                              G_OBJECT (application));
125         
126         application->scr_saver = totem_scrsaver_new (connection);
127         
128         return TRUE;
129 }
130 #endif /* ENABLE_DBUS */
131
132 /**
133  * ev_application_get_instance:
134  *
135  * Checks for #EvApplication instance, if it doesn't exist it does create it.
136  *
137  * Returns: an instance of the #EvApplication data.
138  */
139 EvApplication *
140 ev_application_get_instance (void)
141 {
142         static EvApplication *instance;
143
144         if (!instance) {
145                 instance = EV_APPLICATION (g_object_new (EV_TYPE_APPLICATION, NULL));
146         }
147
148         return instance;
149 }
150
151 #if WITH_GNOME
152 static void
153 removed_from_session (GnomeClient *client, EvApplication *application)
154 {
155         ev_application_shutdown (application);
156 }
157
158 static gint
159 save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, gint shutdown,
160               GnomeInteractStyle interact_style, gint fast, EvApplication *application)
161 {
162         GList *windows, *l;
163         char **restart_argv;
164         int argc = 0, k;
165
166         windows = ev_application_get_windows (application);
167         restart_argv = g_new (char *, g_list_length (windows) + 1);
168         restart_argv[argc++] = g_strdup ("evince");
169
170         for (l = windows; l != NULL; l = l->next) {
171                 EvWindow *window = EV_WINDOW (l->data);
172                 restart_argv[argc++] = g_strdup (ev_window_get_uri (window));
173         }
174
175         gnome_client_set_restart_command (client, argc, restart_argv);
176
177         for (k = 0; k < argc; k++) {
178                 g_free (restart_argv[k]);
179         }
180
181         g_list_free (windows);
182         g_free (restart_argv);
183         
184         return TRUE;
185 }
186
187 static void
188 init_session (EvApplication *application)
189 {
190         GnomeClient *client;
191
192         client = gnome_master_client ();
193
194         g_signal_connect (client, "save_yourself",
195                           G_CALLBACK (save_session), application);      
196         g_signal_connect (client, "die",
197                           G_CALLBACK (removed_from_session), application);
198 }
199 #endif
200
201 /**
202  * ev_display_open_if_needed:
203  * @name: the name of the display to be open if it's needed.
204  *
205  * Search among all the open displays if any of them have the same name as the
206  * passed name. If the display isn't found it tries the open it.
207  *
208  * Returns: a #GdkDisplay of the display with the passed name.
209  */
210 static GdkDisplay *
211 ev_display_open_if_needed (const gchar *name)
212 {
213         GSList     *displays;
214         GSList     *l;
215         GdkDisplay *display = NULL;
216
217         displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
218
219         for (l = displays; l != NULL; l = l->next) {
220                 const gchar *display_name = gdk_display_get_name ((GdkDisplay *) l->data);
221
222                 if (g_ascii_strcasecmp (display_name, name) == 0) {
223                         display = l->data;
224                         break;
225                 }
226         }
227
228         g_slist_free (displays);
229
230         return display != NULL ? display : gdk_display_open (name);
231 }
232
233 /**
234  * get_screen_from_args:
235  * @args: a #GHashTable with data passed to the application.
236  *
237  * Looks for the screen in the display available in the hash table passed to the
238  * application. If the display isn't opened, it's opened and the #GdkScreen
239  * assigned to the screen in that display returned.
240  *
241  * Returns: the #GdkScreen assigned to the screen on the display indicated by
242  *          the data on the #GHashTable.
243  */
244 static GdkScreen *
245 get_screen_from_args (GHashTable *args)
246 {
247         GValue     *value = NULL;
248         GdkDisplay *display = NULL;
249         GdkScreen  *screen = NULL;
250
251         g_assert (args != NULL);
252         
253         value = g_hash_table_lookup (args, "display");
254         if (value) {
255                 const gchar *display_name;
256                 
257                 display_name = g_value_get_string (value);
258                 display = ev_display_open_if_needed (display_name);
259         }
260         
261         value = g_hash_table_lookup (args, "screen");
262         if (value) {
263                 gint screen_number;
264                 
265                 screen_number = g_value_get_int (value);
266                 screen = gdk_display_get_screen (display, screen_number);
267         }
268
269         return screen;
270 }
271
272 /**
273  * get_window_run_mode_from_args:
274  * @args: a #GHashTable with data passed to the application.
275  *
276  * It does look if the mode option has been passed from command line, using it
277  * as the window run mode, otherwise the run mode will be the normal mode.
278  *
279  * Returns: The window run mode passed from command line or
280  *          EV_WINDOW_MODE_NORMAL in other case.
281  */
282 static EvWindowRunMode
283 get_window_run_mode_from_args (GHashTable *args)
284 {
285         EvWindowRunMode  mode = EV_WINDOW_MODE_NORMAL;
286         GValue          *value = NULL;
287
288         g_assert (args != NULL);
289
290         value = g_hash_table_lookup (args, "mode");
291         if (value) {
292                 mode = g_value_get_uint (value);
293         }
294
295         return mode;
296 }
297
298 /**
299  * get_destination_from_args:
300  * @args: a #GHashTable with data passed to the application.
301  *
302  * It does look for the page-label argument parsed from the command line and
303  * if it does exist, it returns an #EvLinkDest.
304  *
305  * Returns: An #EvLinkDest to page-label if it has been passed from the command
306  *          line, NULL in other case.
307  */
308 static EvLinkDest *
309 get_destination_from_args (GHashTable *args)
310 {
311         EvLinkDest *dest = NULL;
312         GValue     *value = NULL;
313         
314         g_assert (args != NULL);
315         
316         value = g_hash_table_lookup (args, "page-label");
317         if (value) {
318                 const gchar *page_label;
319
320                 page_label = g_value_get_string (value);
321                 dest = ev_link_dest_new_page_label (page_label);
322         }
323
324         return dest;
325 }
326
327 /**
328  * get_unlink_temp_file_from_args:
329  * @args: a #GHashTable with data passed to the application.
330  *
331  * It does look if the unlink-temp-file option has been passed from the command
332  * line returning it's boolean representation, otherwise it does return %FALSE.
333  *
334  * Returns: the boolean representation of the unlink-temp-file value or %FALSE
335  *          in other case.
336  */
337 static gboolean
338 get_unlink_temp_file_from_args (GHashTable *args)
339 {
340         gboolean unlink_temp_file = FALSE;
341         GValue  *value = NULL;
342
343         g_assert (args != NULL);
344
345         value = g_hash_table_lookup (args, "unlink-temp-file");
346         if (value) {
347                 unlink_temp_file = g_value_get_boolean (value);
348         }
349         
350         return unlink_temp_file;
351 }
352
353 /**
354  * ev_application_open_window:
355  * @application: The instance of the application.
356  * @args: A #GHashTable with the arguments data.
357  * @timestamp: Current time value.
358  * @error: The #GError facility.
359  * 
360  * Creates a new window and if the args are available, it's not NULL, it gets
361  * the screen from them and assigns the just created window to it. At last it
362  * does show it.
363  *
364  * Returns: %TRUE.
365  */
366 gboolean
367 ev_application_open_window (EvApplication  *application,
368                             GHashTable     *args,
369                             guint32         timestamp,
370                             GError        **error)
371 {
372         GtkWidget *new_window = ev_window_new ();
373         GdkScreen *screen = NULL;
374
375         if (args) {
376                 screen = get_screen_from_args (args);
377         }
378         
379         if (screen) {
380                 gtk_window_set_screen (GTK_WINDOW (new_window), screen);
381         }
382         
383         gtk_widget_show (new_window);
384         
385         gtk_window_present_with_time (GTK_WINDOW (new_window),
386                                       timestamp);
387         return TRUE;
388 }
389
390 /**
391  * ev_application_get_empty_window:
392  * @application: The instance of the application.
393  * @screen: The screen where the empty window will be search.
394  *
395  * It does look if there is any empty window in the indicated screen.
396  *
397  * Returns: The first empty #EvWindow in the passed #GdkScreen or NULL in other
398  *          case.
399  */
400 static EvWindow *
401 ev_application_get_empty_window (EvApplication *application,
402                                  GdkScreen     *screen)
403 {
404         EvWindow *empty_window = NULL;
405         GList *windows = ev_application_get_windows (application);
406         GList *l;
407
408         for (l = windows; l != NULL; l = l->next) {
409                 EvWindow *window = EV_WINDOW (l->data);
410
411                 if (ev_window_is_empty (window) &&
412                     gtk_window_get_screen (GTK_WINDOW (window)) == screen) {
413                         empty_window = window;
414                         break;
415                 }
416         }
417
418         g_list_free (windows);
419         
420         return empty_window;
421 }
422
423 /**
424  * ev_application_get_uri_window:
425  * @application: The instance of the application.
426  * @uri: The uri to be opened.
427  *
428  * It looks in the list of the windows for the one with the document represented
429  * by the passed uri on it. If the window is empty or the document isn't present
430  * on any window, it will return NULL.
431  *
432  * Returns: The #EvWindow where the document represented by the passed uri is
433  *          shown, NULL in other case.
434  */
435 static EvWindow *
436 ev_application_get_uri_window (EvApplication *application, const char *uri)
437 {
438         EvWindow *uri_window = NULL;
439         GList *windows = gtk_window_list_toplevels ();
440         GList *l;
441
442         g_return_val_if_fail (uri != NULL, NULL);
443
444         for (l = windows; l != NULL; l = l->next) {
445                 if (EV_IS_WINDOW (l->data)) {
446                         EvWindow *window = EV_WINDOW (l->data);
447                         const char *window_uri = ev_window_get_uri (window);
448
449                         if (window_uri && strcmp (window_uri, uri) == 0 && !ev_window_is_empty (window)) {
450                                 uri_window = window;
451                                 break;
452                         }
453                 }
454         }
455
456         g_list_free (windows);
457         
458         return uri_window;
459 }
460
461 /**
462  * ev_application_open_uri_at_dest:
463  * @application: The instance of the application.
464  * @uri: The uri to be opened.
465  * @screen: Thee screen where the link will be shown.
466  * @dest: The #EvLinkDest of the document.
467  * @mode: The run mode of the window.
468  * @unlink_temp_file: The unlink_temp_file option value.
469  * @timestamp: Current time value.
470  */
471 void
472 ev_application_open_uri_at_dest (EvApplication  *application,
473                                  const char     *uri,
474                                  GdkScreen      *screen,
475                                  EvLinkDest     *dest,
476                                  EvWindowRunMode mode,
477                                  gboolean        unlink_temp_file,
478                                  guint           timestamp)
479 {
480         EvWindow     *new_window;
481         GtkIconTheme *icon_theme;
482
483         g_return_if_fail (uri != NULL);
484
485         icon_theme = gtk_icon_theme_get_for_screen (screen);
486         if (icon_theme) {
487                 gchar **path = NULL;
488                 gint    n_paths;
489                 gint    i;
490                 gchar  *ev_icons_path;
491
492                 /* GtkIconTheme will then look in Evince custom hicolor dir
493                  * for icons as well as the standard search paths
494                  */
495                 ev_icons_path = g_build_filename (DATADIR, "icons", NULL);
496                 gtk_icon_theme_get_search_path (icon_theme, &path, &n_paths);
497                 for (i = n_paths - 1; i >= 0; i--) {
498                         if (g_ascii_strcasecmp (ev_icons_path, path[i]) == 0)
499                                 break;
500                 }
501
502                 if (i < 0)
503                         gtk_icon_theme_append_search_path (icon_theme,
504                                                            ev_icons_path);
505
506                 g_free (ev_icons_path);
507                 g_strfreev (path);
508         }       
509
510         new_window = ev_application_get_uri_window (application, uri);
511         
512         if (new_window == NULL) {
513                 new_window = ev_application_get_empty_window (application, screen);
514         }
515
516         if (new_window == NULL) {
517                 new_window = EV_WINDOW (ev_window_new ());
518         }
519
520         if (screen)
521                 gtk_window_set_screen (GTK_WINDOW (new_window), screen);
522
523         /* We need to load uri before showing the window, so
524            we can restore window size without flickering */     
525         ev_window_open_uri (new_window, uri, dest, mode, unlink_temp_file);
526
527         ev_document_fc_mutex_lock ();
528         gtk_widget_show (GTK_WIDGET (new_window));
529         ev_document_fc_mutex_unlock ();
530
531         gtk_window_present_with_time (GTK_WINDOW (new_window),
532                                       timestamp);
533 }
534
535 /**
536  * ev_application_open_uri:
537  * @application: The instance of the application.
538  * @uri: The uri to be opened
539  * @args: A #GHashTable with the arguments data.
540  * @timestamp: Current time value.
541  * @error: The #GError facility.
542  */
543 gboolean
544 ev_application_open_uri (EvApplication  *application,
545                          const char     *uri,
546                          GHashTable     *args,
547                          guint           timestamp,
548                          GError        **error)
549 {
550         EvLinkDest      *dest = NULL;
551         EvWindowRunMode  mode = EV_WINDOW_MODE_NORMAL;
552         gboolean         unlink_temp_file = FALSE;
553         GdkScreen       *screen = NULL;
554
555         if (args) {
556                 screen = get_screen_from_args (args);
557                 dest = get_destination_from_args (args);
558                 mode = get_window_run_mode_from_args (args);
559                 unlink_temp_file = (mode == EV_WINDOW_MODE_PREVIEW &&
560                                     get_unlink_temp_file_from_args (args));
561         }
562         
563         ev_application_open_uri_at_dest (application, uri, screen,
564                                          dest, mode, unlink_temp_file, 
565                                          timestamp);
566
567         if (dest)
568                 g_object_unref (dest);
569
570         return TRUE;
571 }
572
573 void
574 ev_application_open_uri_list (EvApplication *application,
575                               GSList        *uri_list,
576                               GdkScreen     *screen,
577                               guint          timestamp)
578 {
579         GSList *l;
580
581         for (l = uri_list; l != NULL; l = l->next) {
582                 ev_application_open_uri_at_dest (application, (char *)l->data,
583                                                  screen, NULL, 0, FALSE, 
584                                                  timestamp);
585         }
586 }
587
588 void
589 ev_application_shutdown (EvApplication *application)
590 {
591         if (application->toolbars_model) {
592                 g_object_unref (application->toolbars_model);
593                 g_free (application->toolbars_file);
594                 application->toolbars_model = NULL;
595                 application->toolbars_file = NULL;
596         }
597
598 #ifndef HAVE_GTK_RECENT
599         if (application->recent_model) {
600                 g_object_unref (application->recent_model);
601                 application->recent_model = NULL;
602         }
603 #endif
604
605 #ifdef WITH_GTK_PRINT
606 #if GTK_CHECK_VERSION (2, 11, 0)
607         if (application->print_settings_file) {
608                 if (application->print_settings) {
609                         GError *error = NULL;
610                         
611                         gtk_print_settings_to_file (application->print_settings,
612                                                     application->print_settings_file,
613                                                     &error);
614                         if (error) {
615                                 g_warning (error->message);
616                                 g_error_free (error);
617                         }
618
619                         g_object_unref (application->print_settings);
620                         application->print_settings = NULL;
621                 }
622
623                 g_free (application->print_settings_file);
624                 application->print_settings_file = NULL;
625         }
626 #else /* ! GTK 2.11.0 */
627         if (application->print_settings) {
628                 g_object_unref (application->print_settings);
629                 application->print_settings = NULL;
630         }
631 #endif /* GTK 2.11.0 */
632 #endif /* WITH_GTK_PRINT */
633         
634         g_free (application->last_chooser_uri);
635         g_object_unref (application);
636         
637         gtk_main_quit ();
638 }
639
640 static void
641 ev_application_class_init (EvApplicationClass *ev_application_class)
642 {
643 }
644
645 static void
646 ev_application_init (EvApplication *ev_application)
647 {
648 #if WITH_GNOME
649         init_session (ev_application);
650 #endif
651
652         ev_application->toolbars_model = egg_toolbars_model_new ();
653
654         ev_application->toolbars_file = g_build_filename
655                         (ev_dot_dir (), "evince_toolbar.xml", NULL);
656
657         egg_toolbars_model_load_names (ev_application->toolbars_model,
658                                        DATADIR "/evince-toolbar.xml");
659
660         if (!egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
661                                                ev_application->toolbars_file)) {
662                 egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
663                                                   DATADIR"/evince-toolbar.xml");
664         }
665
666         egg_toolbars_model_set_flags (ev_application->toolbars_model, 0,
667                                       EGG_TB_MODEL_NOT_REMOVABLE); 
668
669 #ifndef HAVE_GTK_RECENT
670         ev_application->recent_model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
671         /* FIXME we should add a mime type filter but current eggrecent
672            has only a varargs style api which does not work well when
673            the list of mime types is dynamic */
674         egg_recent_model_set_limit (ev_application->recent_model, 5);   
675         egg_recent_model_set_filter_groups (ev_application->recent_model,
676                                             "Evince", NULL);
677 #endif /* HAVE_GTK_RECENT */
678 }
679
680 /**
681  * ev_application_get_windows:
682  * @application: The instance of the application.
683  *
684  * It creates a list of the top level windows.
685  *
686  * Returns: A #GList of the top level windows.
687  */
688 GList *
689 ev_application_get_windows (EvApplication *application)
690 {
691         GList *l, *toplevels;
692         GList *windows = NULL;
693
694         toplevels = gtk_window_list_toplevels ();
695
696         for (l = toplevels; l != NULL; l = l->next) {
697                 if (EV_IS_WINDOW (l->data)) {
698                         windows = g_list_append (windows, l->data);
699                 }
700         }
701
702         g_list_free (toplevels);
703
704         return windows;
705 }
706
707 EggToolbarsModel *
708 ev_application_get_toolbars_model (EvApplication *application)
709 {
710         return application->toolbars_model;
711 }
712
713 #ifndef HAVE_GTK_RECENT
714 EggRecentModel *
715 ev_application_get_recent_model (EvApplication *application)
716 {
717         return application->recent_model;
718 }
719 #endif
720
721 void
722 ev_application_save_toolbars_model (EvApplication *application)
723 {
724         egg_toolbars_model_save_toolbars (application->toolbars_model,
725                                           application->toolbars_file, "1.0");
726 }
727
728 void
729 ev_application_set_chooser_uri (EvApplication *application, const gchar *uri)
730 {
731         g_free (application->last_chooser_uri);
732         application->last_chooser_uri = g_strdup (uri);
733 }
734
735 const gchar *
736 ev_application_get_chooser_uri (EvApplication *application)
737 {
738         return application->last_chooser_uri;
739 }
740
741 void
742 ev_application_screensaver_enable (EvApplication *application)
743 {
744         if (application->scr_saver)
745                 totem_scrsaver_enable (application->scr_saver); 
746 }
747
748 void
749 ev_application_screensaver_disable (EvApplication *application)
750 {
751         if (application->scr_saver)
752                 totem_scrsaver_disable (application->scr_saver);        
753 }
754
755 #ifdef WITH_GTK_PRINT
756 GtkPrintSettings *
757 ev_application_get_print_settings (EvApplication *application)
758 {
759         if (application->print_settings)
760                 return application->print_settings;
761         
762 #if GTK_CHECK_VERSION (2, 11, 0)
763         if (!application->print_settings_file) {
764                 application->print_settings_file =
765                         g_build_filename (ev_dot_dir (), "print-settings", NULL);
766         }
767
768         if (g_file_test (application->print_settings_file, G_FILE_TEST_IS_REGULAR)) {
769                 GError *error = NULL;
770                 
771                 application->print_settings =
772                         gtk_print_settings_new_from_file (application->print_settings_file, &error);
773                 
774                 if (error) {
775                         g_warning (error->message);
776                         g_error_free (error);
777                 } else {
778                         return application->print_settings;
779                 }
780         }
781 #endif /* GTK 2.11.0 */
782         
783         application->print_settings = gtk_print_settings_new ();
784
785         return application->print_settings;
786 }
787
788 void
789 ev_application_set_print_settings (EvApplication    *application,
790                                    GtkPrintSettings *settings)
791 {
792         g_return_if_fail (GTK_IS_PRINT_SETTINGS (settings));
793         
794         if (settings == application->print_settings)
795                 return;
796
797         if (application->print_settings)
798                 g_object_unref (application->print_settings);
799         
800         application->print_settings = g_object_ref (settings);
801 }
802 #endif /* WITH_GTK_PRINT */