From 501ff563423f874072522d40aca5b2c927f9e475 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sun, 22 Aug 1999 21:51:55 +0000 Subject: [PATCH] Add error checking for factory registration. 1999-08-22 Miguel de Icaza * bonobo-image-x-pdf.cc (main): Add error checking for factory registration. --- pdf/xpdf/ChangeLog | 5 +++++ pdf/xpdf/bonobo-image-x-pdf.cc | 16 +++++++++++++--- pdf/xpdf/gpdf.cc | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pdf/xpdf/ChangeLog b/pdf/xpdf/ChangeLog index a3b727d4..9f4772c7 100644 --- a/pdf/xpdf/ChangeLog +++ b/pdf/xpdf/ChangeLog @@ -1,3 +1,8 @@ +1999-08-22 Miguel de Icaza + + * bonobo-image-x-pdf.cc (main): Add error checking for factory + registration. + 1999-08-22 Michael Meeks * bonobo-image-x-pdf.cc: Add zoom. diff --git a/pdf/xpdf/bonobo-image-x-pdf.cc b/pdf/xpdf/bonobo-image-x-pdf.cc index 678a7242..2881532e 100644 --- a/pdf/xpdf/bonobo-image-x-pdf.cc +++ b/pdf/xpdf/bonobo-image-x-pdf.cc @@ -726,14 +726,19 @@ embeddable_factory (GnomeEmbeddableFactory *This, void *data) return (GnomeObject *) embeddable; } -static void -init_bonobo_image_x_png_factory (void) +static gboolean +init_bonobo_image_x_pdf_factory (void) { GnomeEmbeddableFactory *factory; factory = gnome_embeddable_factory_new ( "bonobo-object-factory:image-x-pdf", embeddable_factory, NULL); + + if (factory == NULL) + return FALSE; + else + return TRUE; } static void @@ -753,7 +758,11 @@ main (int argc, char *argv []) CORBA_exception_init (&ev); init_server_factory (argc, argv); - init_bonobo_image_x_png_factory (); + if (!init_bonobo_image_x_pdf_factory ()){ + fprintf (stderr, "Could not initialize the Bonobo PDF factory\n" + "probably a server is already running?"); + exit (1); + } errorInit(); @@ -761,6 +770,7 @@ main (int argc, char *argv []) gtk_widget_set_default_colormap (gdk_rgb_get_cmap ()); gtk_widget_set_default_visual (gdk_rgb_get_visual ()); + bonobo_activate (); gtk_main (); CORBA_exception_free (&ev); diff --git a/pdf/xpdf/gpdf.cc b/pdf/xpdf/gpdf.cc index 8dcdd6a5..d7e91347 100644 --- a/pdf/xpdf/gpdf.cc +++ b/pdf/xpdf/gpdf.cc @@ -703,7 +703,8 @@ main (int argc, char **argv) container_new (NULL); poptFreeContext (ctx); - + + bonobo_activate (); gtk_main (); return 0; -- 2.43.5