1 /* this file is part of evince, a gnome document viewer
3 * Copyright (C) 2004 Martin Kretzschmar
6 * Martin Kretzschmar <martink@gnome.org>
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.
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.
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.
29 #include <glib/gi18n.h>
33 #include "totem-scrsaver.h"
34 #include "eggsmclient.h"
36 #include "ev-application.h"
37 #include "ev-document-factory.h"
38 #include "ev-file-helpers.h"
42 #include "ev-media-player-keys.h"
43 #endif /* ENABLE_DBUS */
46 #include <dbus/dbus-glib-bindings.h>
47 #include "ev-application-service.h"
50 static void ev_application_add_icon_path_for_screen (GdkScreen *screen);
51 static void ev_application_save_print_settings (EvApplication *application);
53 struct _EvApplication {
54 GObject base_instance;
57 gchar *accel_map_file;
60 EggToolbarsModel *toolbars_model;
62 TotemScrsaver *scr_saver;
64 EggSMClient *smclient;
66 gchar *last_chooser_uri;
69 EvMediaPlayerKeys *keys;
70 #endif /* ENABLE_DBUS */
72 GtkPrintSettings *print_settings;
73 GtkPageSetup *page_setup;
74 GKeyFile *print_settings_file;
77 struct _EvApplicationClass {
78 GObjectClass base_class;
81 G_DEFINE_TYPE (EvApplication, ev_application, G_TYPE_OBJECT);
83 #define APPLICATION_SERVICE_NAME "org.gnome.evince.ApplicationService"
85 #define EV_PRINT_SETTINGS_FILE "print-settings"
86 #define EV_PRINT_SETTINGS_GROUP "Print Settings"
87 #define EV_PAGE_SETUP_GROUP "Page Setup"
91 ev_application_register_service (EvApplication *application)
93 static DBusGConnection *connection = NULL;
94 DBusGProxy *driver_proxy;
96 guint request_name_result;
99 g_warning ("Service already registered.");
103 connection = dbus_g_bus_get (DBUS_BUS_STARTER, &err);
104 if (connection == NULL) {
105 g_warning ("Service registration failed.");
111 driver_proxy = dbus_g_proxy_new_for_name (connection,
114 DBUS_INTERFACE_DBUS);
116 if (!org_freedesktop_DBus_request_name (driver_proxy,
117 APPLICATION_SERVICE_NAME,
118 DBUS_NAME_FLAG_DO_NOT_QUEUE,
119 &request_name_result, &err)) {
120 g_warning ("Service registration failed.");
121 g_clear_error (&err);
124 g_object_unref (driver_proxy);
126 if (request_name_result == DBUS_REQUEST_NAME_REPLY_EXISTS) {
130 dbus_g_object_type_install_info (EV_TYPE_APPLICATION,
131 &dbus_glib_ev_application_object_info);
132 dbus_g_connection_register_g_object (connection,
133 "/org/gnome/evince/Evince",
134 G_OBJECT (application));
136 application->scr_saver = totem_scrsaver_new (connection);
140 #endif /* ENABLE_DBUS */
143 * ev_application_get_instance:
145 * Checks for #EvApplication instance, if it doesn't exist it does create it.
147 * Returns: an instance of the #EvApplication data.
150 ev_application_get_instance (void)
152 static EvApplication *instance;
155 instance = EV_APPLICATION (g_object_new (EV_TYPE_APPLICATION, NULL));
163 ev_application_load_session (EvApplication *application)
165 GKeyFile *state_file;
168 if (!egg_sm_client_is_resumed (application->smclient))
171 state_file = egg_sm_client_get_state_file (application->smclient);
175 uri_list = g_key_file_get_string_list (state_file,
182 for (i = 0; uri_list[i]; i++) {
183 if (g_ascii_strcasecmp (uri_list[i], "empty-window") == 0)
184 ev_application_open_window (application, NULL, GDK_CURRENT_TIME, NULL);
186 ev_application_open_uri (application, uri_list[i], NULL, GDK_CURRENT_TIME, NULL);
188 g_strfreev (uri_list);
190 g_key_file_free (state_file);
196 smclient_save_state_cb (EggSMClient *client,
197 GKeyFile *state_file,
198 EvApplication *application)
202 const gchar **uri_list;
203 const gchar *empty = "empty-window";
205 windows = ev_application_get_windows (application);
209 uri_list = g_new (const gchar *, g_list_length (windows));
210 for (l = windows, i = 0; l != NULL; l = g_list_next (l), i++) {
211 EvWindow *window = EV_WINDOW (l->data);
213 if (ev_window_is_empty (window))
216 uri_list[i] = ev_window_get_uri (window);
218 g_key_file_set_string_list (state_file,
221 (const char **)uri_list,
227 smclient_quit_cb (EggSMClient *client,
228 EvApplication *application)
230 ev_application_shutdown (application);
234 ev_application_init_session (EvApplication *application)
236 application->smclient = egg_sm_client_get ();
237 g_signal_connect (application->smclient, "save_state",
238 G_CALLBACK (smclient_save_state_cb),
240 g_signal_connect (application->smclient, "quit",
241 G_CALLBACK (smclient_quit_cb),
246 * ev_display_open_if_needed:
247 * @name: the name of the display to be open if it's needed.
249 * Search among all the open displays if any of them have the same name as the
250 * passed name. If the display isn't found it tries the open it.
252 * Returns: a #GdkDisplay of the display with the passed name.
255 ev_display_open_if_needed (const gchar *name)
259 GdkDisplay *display = NULL;
261 displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
263 for (l = displays; l != NULL; l = l->next) {
264 const gchar *display_name = gdk_display_get_name ((GdkDisplay *) l->data);
266 if (g_ascii_strcasecmp (display_name, name) == 0) {
272 g_slist_free (displays);
274 return display != NULL ? display : gdk_display_open (name);
278 * get_screen_from_args:
279 * @args: a #GHashTable with data passed to the application.
281 * Looks for the screen in the display available in the hash table passed to the
282 * application. If the display isn't opened, it's opened and the #GdkScreen
283 * assigned to the screen in that display returned.
285 * Returns: the #GdkScreen assigned to the screen on the display indicated by
286 * the data on the #GHashTable.
289 get_screen_from_args (GHashTable *args)
291 GValue *value = NULL;
292 GdkDisplay *display = NULL;
293 GdkScreen *screen = NULL;
295 g_assert (args != NULL);
297 value = g_hash_table_lookup (args, "display");
299 const gchar *display_name;
301 display_name = g_value_get_string (value);
302 display = ev_display_open_if_needed (display_name);
305 value = g_hash_table_lookup (args, "screen");
309 screen_number = g_value_get_int (value);
310 screen = gdk_display_get_screen (display, screen_number);
317 * get_window_run_mode_from_args:
318 * @args: a #GHashTable with data passed to the application.
320 * It does look if the mode option has been passed from command line, using it
321 * as the window run mode, otherwise the run mode will be the normal mode.
323 * Returns: The window run mode passed from command line or
324 * EV_WINDOW_MODE_NORMAL in other case.
326 static EvWindowRunMode
327 get_window_run_mode_from_args (GHashTable *args)
329 EvWindowRunMode mode = EV_WINDOW_MODE_NORMAL;
330 GValue *value = NULL;
332 g_assert (args != NULL);
334 value = g_hash_table_lookup (args, "mode");
336 mode = g_value_get_uint (value);
343 * get_destination_from_args:
344 * @args: a #GHashTable with data passed to the application.
346 * It does look for the page-label argument parsed from the command line and
347 * if it does exist, it returns an #EvLinkDest.
349 * Returns: An #EvLinkDest to page-label if it has been passed from the command
350 * line, NULL in other case.
353 get_destination_from_args (GHashTable *args)
355 EvLinkDest *dest = NULL;
356 GValue *value = NULL;
358 g_assert (args != NULL);
360 value = g_hash_table_lookup (args, "page-label");
362 const gchar *page_label;
364 page_label = g_value_get_string (value);
365 dest = ev_link_dest_new_page_label (page_label);
372 get_find_string_from_args (GHashTable *args)
374 GValue *value = NULL;
376 g_assert (args != NULL);
378 value = g_hash_table_lookup (args, "find-string");
380 return value ? g_value_get_string (value) : NULL;
384 * get_unlink_temp_file_from_args:
385 * @args: a #GHashTable with data passed to the application.
387 * It does look if the unlink-temp-file option has been passed from the command
388 * line returning it's boolean representation, otherwise it does return %FALSE.
390 * Returns: the boolean representation of the unlink-temp-file value or %FALSE
394 get_unlink_temp_file_from_args (GHashTable *args)
396 gboolean unlink_temp_file = FALSE;
397 GValue *value = NULL;
399 g_assert (args != NULL);
401 value = g_hash_table_lookup (args, "unlink-temp-file");
403 unlink_temp_file = g_value_get_boolean (value);
406 return unlink_temp_file;
410 get_print_settings_from_args (GHashTable *args)
412 const gchar *print_settings = NULL;
413 GValue *value = NULL;
415 g_assert (args != NULL);
417 value = g_hash_table_lookup (args, "print-settings");
419 print_settings = g_value_get_string (value);
422 return print_settings;
426 * ev_application_open_window:
427 * @application: The instance of the application.
428 * @args: A #GHashTable with the arguments data.
429 * @timestamp: Current time value.
430 * @error: The #GError facility.
432 * Creates a new window and if the args are available, it's not NULL, it gets
433 * the screen from them and assigns the just created window to it. At last it
439 ev_application_open_window (EvApplication *application,
444 GtkWidget *new_window = ev_window_new ();
445 GdkScreen *screen = NULL;
448 screen = get_screen_from_args (args);
452 gtk_window_set_screen (GTK_WINDOW (new_window), screen);
454 ev_application_add_icon_path_for_screen (screen);
456 if (!GTK_WIDGET_REALIZED (new_window))
457 gtk_widget_realize (new_window);
459 #ifdef GDK_WINDOWING_X11
461 timestamp = gdk_x11_get_server_time (GTK_WIDGET (new_window)->window);
462 gdk_x11_window_set_user_time (GTK_WIDGET (new_window)->window, timestamp);
464 gtk_window_present (GTK_WINDOW (new_window));
466 gtk_window_present_with_time (GTK_WINDOW (new_window), timestamp);
467 #endif /* GDK_WINDOWING_X11 */
473 * ev_application_get_empty_window:
474 * @application: The instance of the application.
475 * @screen: The screen where the empty window will be search.
477 * It does look if there is any empty window in the indicated screen.
479 * Returns: The first empty #EvWindow in the passed #GdkScreen or NULL in other
483 ev_application_get_empty_window (EvApplication *application,
486 EvWindow *empty_window = NULL;
487 GList *windows = ev_application_get_windows (application);
490 for (l = windows; l != NULL; l = l->next) {
491 EvWindow *window = EV_WINDOW (l->data);
493 if (ev_window_is_empty (window) &&
494 gtk_window_get_screen (GTK_WINDOW (window)) == screen) {
495 empty_window = window;
500 g_list_free (windows);
506 * ev_application_get_uri_window:
507 * @application: The instance of the application.
508 * @uri: The uri to be opened.
510 * It looks in the list of the windows for the one with the document represented
511 * by the passed uri on it. If the window is empty or the document isn't present
512 * on any window, it will return NULL.
514 * Returns: The #EvWindow where the document represented by the passed uri is
515 * shown, NULL in other case.
518 ev_application_get_uri_window (EvApplication *application, const char *uri)
520 EvWindow *uri_window = NULL;
521 GList *windows = gtk_window_list_toplevels ();
524 g_return_val_if_fail (uri != NULL, NULL);
526 for (l = windows; l != NULL; l = l->next) {
527 if (EV_IS_WINDOW (l->data)) {
528 EvWindow *window = EV_WINDOW (l->data);
529 const char *window_uri = ev_window_get_uri (window);
531 if (window_uri && strcmp (window_uri, uri) == 0 && !ev_window_is_empty (window)) {
538 g_list_free (windows);
544 ev_application_add_icon_path_for_screen (GdkScreen *screen)
546 GtkIconTheme *icon_theme;
548 icon_theme = screen ? gtk_icon_theme_get_for_screen (screen) : gtk_icon_theme_get_default ();
553 gchar *ev_icons_path;
555 /* GtkIconTheme will then look in Evince custom hicolor dir
556 * for icons as well as the standard search paths
558 ev_icons_path = g_build_filename (DATADIR, "icons", NULL);
559 gtk_icon_theme_get_search_path (icon_theme, &path, &n_paths);
560 for (i = n_paths - 1; i >= 0; i--) {
561 if (g_ascii_strcasecmp (ev_icons_path, path[i]) == 0)
566 gtk_icon_theme_append_search_path (icon_theme,
569 g_free (ev_icons_path);
575 * ev_application_open_uri_at_dest:
576 * @application: The instance of the application.
577 * @uri: The uri to be opened.
578 * @screen: Thee screen where the link will be shown.
579 * @dest: The #EvLinkDest of the document.
580 * @mode: The run mode of the window.
581 * @unlink_temp_file: The unlink_temp_file option value.
582 * @timestamp: Current time value.
585 ev_application_open_uri_at_dest (EvApplication *application,
589 EvWindowRunMode mode,
590 const gchar *search_string,
591 gboolean unlink_temp_file,
592 const gchar *print_settings,
595 EvWindow *new_window;
597 g_return_if_fail (uri != NULL);
599 ev_application_add_icon_path_for_screen (screen);
601 new_window = ev_application_get_uri_window (application, uri);
603 if (new_window == NULL) {
604 new_window = ev_application_get_empty_window (application, screen);
607 if (new_window == NULL) {
608 new_window = EV_WINDOW (ev_window_new ());
612 gtk_window_set_screen (GTK_WINDOW (new_window), screen);
614 /* We need to load uri before showing the window, so
615 we can restore window size without flickering */
616 ev_window_open_uri (new_window, uri, dest, mode, search_string,
617 unlink_temp_file, print_settings);
619 if (!GTK_WIDGET_REALIZED (GTK_WIDGET (new_window)))
620 gtk_widget_realize (GTK_WIDGET (new_window));
622 #ifdef GDK_WINDOWING_X11
624 timestamp = gdk_x11_get_server_time (GTK_WIDGET (new_window)->window);
625 gdk_x11_window_set_user_time (GTK_WIDGET (new_window)->window, timestamp);
627 ev_document_fc_mutex_lock ();
628 gtk_window_present (GTK_WINDOW (new_window));
629 ev_document_fc_mutex_unlock ();
631 ev_document_fc_mutex_lock ();
632 gtk_window_present_with_time (GTK_WINDOW (new_window), timestamp);
633 ev_document_fc_mutex_unlock ();
634 #endif /* GDK_WINDOWING_X11 */
638 * ev_application_open_uri:
639 * @application: The instance of the application.
640 * @uri: The uri to be opened
641 * @args: A #GHashTable with the arguments data.
642 * @timestamp: Current time value.
643 * @error: The #GError facility.
646 ev_application_open_uri (EvApplication *application,
652 EvLinkDest *dest = NULL;
653 EvWindowRunMode mode = EV_WINDOW_MODE_NORMAL;
654 const gchar *search_string = NULL;
655 gboolean unlink_temp_file = FALSE;
656 const gchar *print_settings = NULL;
657 GdkScreen *screen = NULL;
660 screen = get_screen_from_args (args);
661 dest = get_destination_from_args (args);
662 mode = get_window_run_mode_from_args (args);
663 search_string = get_find_string_from_args (args);
664 unlink_temp_file = (mode == EV_WINDOW_MODE_PREVIEW &&
665 get_unlink_temp_file_from_args (args));
666 print_settings = get_print_settings_from_args (args);
669 ev_application_open_uri_at_dest (application, uri, screen,
670 dest, mode, search_string,
672 print_settings, timestamp);
675 g_object_unref (dest);
681 ev_application_open_uri_list (EvApplication *application,
688 for (l = uri_list; l != NULL; l = l->next) {
689 ev_application_open_uri_at_dest (application, (char *)l->data,
690 screen, NULL, 0, NULL,
691 FALSE, NULL, timestamp);
696 ev_application_shutdown (EvApplication *application)
698 if (application->accel_map_file) {
699 gtk_accel_map_save (application->accel_map_file);
700 g_free (application->accel_map_file);
701 application->accel_map_file = NULL;
704 if (application->toolbars_model) {
705 g_object_unref (application->toolbars_model);
706 g_free (application->toolbars_file);
707 application->toolbars_model = NULL;
708 application->toolbars_file = NULL;
711 ev_application_save_print_settings (application);
713 if (application->print_settings_file) {
714 g_key_file_free (application->print_settings_file);
715 application->print_settings_file = NULL;
718 if (application->print_settings) {
719 g_object_unref (application->print_settings);
720 application->print_settings = NULL;
723 if (application->page_setup) {
724 g_object_unref (application->page_setup);
725 application->page_setup = NULL;
729 if (application->keys) {
730 g_object_unref (application->keys);
731 application->keys = NULL;
733 #endif /* ENABLE_DBUS */
735 g_free (application->dot_dir);
736 application->dot_dir = NULL;
737 g_free (application->last_chooser_uri);
738 application->last_chooser_uri = NULL;
740 g_object_unref (application);
746 ev_application_class_init (EvApplicationClass *ev_application_class)
751 ev_application_init (EvApplication *ev_application)
754 const gchar *home_dir;
756 ev_application_init_session (ev_application);
758 ev_application->dot_dir = g_build_filename (g_get_home_dir (),
763 /* FIXME: why make this fatal? */
764 if (!ev_dir_ensure_exists (ev_application->dot_dir, 0700))
767 home_dir = g_get_home_dir ();
769 ev_application->accel_map_file = g_build_filename (home_dir,
774 gtk_accel_map_load (ev_application->accel_map_file);
777 ev_application->toolbars_model = egg_toolbars_model_new ();
779 ev_application->toolbars_file = g_build_filename
780 (ev_application->dot_dir, "evince_toolbar.xml", NULL);
782 egg_toolbars_model_load_names (ev_application->toolbars_model,
783 DATADIR "/evince-toolbar.xml");
785 if (!egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
786 ev_application->toolbars_file)) {
787 egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
788 DATADIR"/evince-toolbar.xml");
791 /* Open item doesn't exist anymore,
792 * convert it to OpenRecent for compatibility
794 for (i = 0; i < egg_toolbars_model_n_items (ev_application->toolbars_model, 0); i++) {
797 item = egg_toolbars_model_item_nth (ev_application->toolbars_model, 0, i);
798 if (g_ascii_strcasecmp (item, "FileOpen") == 0) {
799 egg_toolbars_model_remove_item (ev_application->toolbars_model, 0, i);
800 egg_toolbars_model_add_item (ev_application->toolbars_model, 0, i,
802 ev_application_save_toolbars_model (ev_application);
807 egg_toolbars_model_set_flags (ev_application->toolbars_model, 0,
808 EGG_TB_MODEL_NOT_REMOVABLE);
811 ev_application->keys = ev_media_player_keys_new ();
812 #endif /* ENABLE_DBUS */
816 * ev_application_get_windows:
817 * @application: The instance of the application.
819 * It creates a list of the top level windows.
821 * Returns: A #GList of the top level windows.
824 ev_application_get_windows (EvApplication *application)
826 GList *l, *toplevels;
827 GList *windows = NULL;
829 toplevels = gtk_window_list_toplevels ();
831 for (l = toplevels; l != NULL; l = l->next) {
832 if (EV_IS_WINDOW (l->data)) {
833 windows = g_list_append (windows, l->data);
837 g_list_free (toplevels);
843 * ev_application_get_media_keys:
844 * @application: The instance of the application.
846 * It gives you access to the media player keys handler object.
848 * Returns: A #EvMediaPlayerKeys.
851 ev_application_get_media_keys (EvApplication *application)
854 return G_OBJECT (application->keys);
857 #endif /* ENABLE_DBUS */
861 ev_application_get_toolbars_model (EvApplication *application)
863 return application->toolbars_model;
867 ev_application_save_toolbars_model (EvApplication *application)
869 egg_toolbars_model_save_toolbars (application->toolbars_model,
870 application->toolbars_file, "1.0");
874 ev_application_set_chooser_uri (EvApplication *application, const gchar *uri)
876 g_free (application->last_chooser_uri);
877 application->last_chooser_uri = g_strdup (uri);
881 ev_application_get_chooser_uri (EvApplication *application)
883 return application->last_chooser_uri;
887 ev_application_screensaver_enable (EvApplication *application)
889 if (application->scr_saver)
890 totem_scrsaver_enable (application->scr_saver);
894 ev_application_screensaver_disable (EvApplication *application)
896 if (application->scr_saver)
897 totem_scrsaver_disable (application->scr_saver);
901 ev_application_get_print_settings_file (EvApplication *application)
905 if (application->print_settings_file)
906 return application->print_settings_file;
908 application->print_settings_file = g_key_file_new ();
910 filename = g_build_filename (ev_application_get_dot_dir (application), EV_PRINT_SETTINGS_FILE, NULL);
911 if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
912 GError *error = NULL;
914 g_key_file_load_from_file (application->print_settings_file,
916 G_KEY_FILE_KEEP_COMMENTS |
917 G_KEY_FILE_KEEP_TRANSLATIONS,
920 g_warning ("%s", error->message);
921 g_error_free (error);
926 return application->print_settings_file;
930 ev_application_save_print_settings (EvApplication *application)
936 GError *error = NULL;
938 if (!application->print_settings && !application->page_setup)
941 key_file = ev_application_get_print_settings_file (application);
942 if (application->print_settings)
943 gtk_print_settings_to_key_file (application->print_settings,
945 EV_PRINT_SETTINGS_GROUP);
946 if (application->page_setup)
947 gtk_page_setup_to_key_file (application->page_setup,
949 EV_PAGE_SETUP_GROUP);
951 filename = g_build_filename (ev_application_get_dot_dir (application), EV_PRINT_SETTINGS_FILE, NULL);
952 data = g_key_file_to_data (key_file, (gsize *)&data_length, NULL);
953 g_file_set_contents (filename, data, data_length, &error);
955 g_warning ("%s", error->message);
956 g_error_free (error);
963 ev_application_get_print_settings (EvApplication *application)
966 GtkPrintSettings *print_settings;
968 if (application->print_settings)
969 return application->print_settings;
971 key_file = ev_application_get_print_settings_file (application);
972 print_settings = g_key_file_has_group (key_file, EV_PRINT_SETTINGS_GROUP) ?
973 gtk_print_settings_new_from_key_file (key_file, EV_PRINT_SETTINGS_GROUP, NULL) :
974 gtk_print_settings_new ();
976 application->print_settings = print_settings ? print_settings : gtk_print_settings_new ();
978 return application->print_settings;
982 ev_application_set_print_settings (EvApplication *application,
983 GtkPrintSettings *settings)
987 g_return_if_fail (GTK_IS_PRINT_SETTINGS (settings));
989 if (settings == application->print_settings)
992 key_file = ev_application_get_print_settings_file (application);
994 if (application->print_settings)
995 g_object_unref (application->print_settings);
997 application->print_settings = g_object_ref (settings);
998 gtk_print_settings_to_key_file (settings, key_file, EV_PRINT_SETTINGS_GROUP);
1002 ev_application_get_page_setup (EvApplication *application)
1005 GtkPageSetup *page_setup;
1007 if (application->page_setup)
1008 return application->page_setup;
1010 key_file = ev_application_get_print_settings_file (application);
1011 page_setup = g_key_file_has_group (key_file, EV_PAGE_SETUP_GROUP) ?
1012 gtk_page_setup_new_from_key_file (key_file, EV_PAGE_SETUP_GROUP, NULL) :
1013 gtk_page_setup_new ();
1015 application->page_setup = page_setup ? page_setup : gtk_page_setup_new ();
1017 return application->page_setup;
1021 ev_application_set_page_setup (EvApplication *application,
1022 GtkPageSetup *page_setup)
1026 g_return_if_fail (GTK_IS_PAGE_SETUP (page_setup));
1028 if (page_setup == application->page_setup)
1031 key_file = ev_application_get_print_settings_file (application);
1033 if (application->page_setup)
1034 g_object_unref (application->page_setup);
1036 application->page_setup = g_object_ref (page_setup);
1037 gtk_page_setup_to_key_file (page_setup, key_file, EV_PAGE_SETUP_GROUP);
1041 ev_application_get_dot_dir (EvApplication *application)
1043 return application->dot_dir;