2 * Copyright (C) 2004 Marco Pesenti Gritti
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "ev-application.h"
25 #include <glib/gi18n.h>
26 #include <gtk/gtkmain.h>
27 #include <libgnome/gnome-program.h>
28 #include <libgnomeui/gnome-ui-init.h>
29 #include <libgnomevfs/gnome-vfs-utils.h>
31 #include "ev-stock-icons.h"
33 #include "ev-job-queue.h"
35 static struct poptOption popt_options[] =
37 { NULL, 0, 0, NULL, 0, NULL, NULL }
41 load_files (const char **files)
47 window = GTK_WIDGET (ev_application_new_window (EV_APP));
48 gtk_widget_show (window);
52 for (i = 0; files[i]; i++) {
55 uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
57 window = GTK_WIDGET (ev_application_new_window (EV_APP));
58 gtk_widget_show (window);
59 ev_window_open (EV_WINDOW (window), uri);
66 main (int argc, char *argv[])
69 GValue context_as_value = { 0 };
70 GnomeProgram *program;
73 /* Initialize the i18n stuff */
74 bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
75 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
76 textdomain(GETTEXT_PACKAGE);
79 program = gnome_program_init (PACKAGE, VERSION,
80 LIBGNOMEUI_MODULE, argc, argv,
81 GNOME_PARAM_POPT_TABLE, popt_options,
82 GNOME_PARAM_HUMAN_READABLE_NAME, _("Evince"),
83 GNOME_PARAM_APP_DATADIR, GNOMEDATADIR,
87 g_set_application_name (_("Evince Document Viewer"));
90 ev_stock_icons_init ();
91 gtk_window_set_default_icon_name ("postscript-viewer");
93 g_object_get_property (G_OBJECT (program),
94 GNOME_PARAM_POPT_CONTEXT,
95 g_value_init (&context_as_value, G_TYPE_POINTER));
96 context = g_value_get_pointer (&context_as_value);
98 load_files (poptGetArgs (context));
102 poptFreeContext (context);