X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fmain.c;h=6cd14e882b1cdc55d42038177d30ae648871d948;hb=1c0d19bd22598eca159c3febdcdaf4168891cb8f;hp=8ad8f284ceee9267109ec71a8199ff5f3f44e801;hpb=69d92c409d333e5dd9cc82537c0834b201487c60;p=evince.git diff --git a/shell/main.c b/shell/main.c index 8ad8f284..6cd14e88 100644 --- a/shell/main.c +++ b/shell/main.c @@ -20,16 +20,48 @@ #include "config.h" +#include "ev-application.h" + #include #include #include #include +#include + +#include "ev-stock-icons.h" +#include "ev-debug.h" +#include "ev-job-queue.h" static struct poptOption popt_options[] = { { NULL, 0, 0, NULL, 0, NULL, NULL } }; +static void +load_files (const char **files) +{ + GtkWidget *window; + int i; + + if (!files) { + window = GTK_WIDGET (ev_application_new_window (EV_APP)); + gtk_widget_show (window); + return; + } + + for (i = 0; files[i]; i++) { + char *uri; + + uri = gnome_vfs_make_uri_from_shell_arg (files[i]); + + window = GTK_WIDGET (ev_application_new_window (EV_APP)); + gtk_widget_show (window); + ev_window_open (EV_WINDOW (window), uri); + + g_free (uri); + } +} + int main (int argc, char *argv[]) { @@ -51,13 +83,20 @@ main (int argc, char *argv[]) GNOME_PARAM_APP_DATADIR, DATADIR, NULL); - g_set_application_name (_("Epiphany Web Browser")); + ev_job_queue_init (); + g_set_application_name (_("Evince Document Viewer")); + + ev_debug_init (); + ev_stock_icons_init (); + gtk_window_set_default_icon_name ("postscript-viewer"); g_object_get_property (G_OBJECT (program), GNOME_PARAM_POPT_CONTEXT, g_value_init (&context_as_value, G_TYPE_POINTER)); context = g_value_get_pointer (&context_as_value); + load_files (poptGetArgs (context)); + gtk_main (); poptFreeContext (context);