From ebca50d1ca64b8ca6778ea011220d606b6006021 Mon Sep 17 00:00:00 2001 From: Martin Kretzschmar Date: Thu, 19 Sep 2002 13:14:27 +0000 Subject: move struct bed_t to gpdf-embeddable.{cc,h} (setup_pixmap) remove doc * bonobo-application-x-pdf.cc: move struct bed_t to gpdf-embeddable.{cc,h} (setup_pixmap) remove doc parameter. (Get it from view_data param) * gpdf-embeddable.cc: New files to contain the embeddable class * gpdf-embeddable.h: * gpdf.cc (main): remove call to setlocale (done in gnome_init...), ignore return value of oaf_init, let bonobo_init figure out which orb to use. * Link.h: declare some methods as const. * Link.cc: --- diff --git a/pdf/xpdf/ChangeLog b/pdf/xpdf/ChangeLog index f0f6fe1..11e81a4 100644 --- a/pdf/xpdf/ChangeLog +++ b/pdf/xpdf/ChangeLog @@ -1,3 +1,20 @@ +2002-08-29 Martin Kretzschmar + + * bonobo-application-x-pdf.cc: move struct bed_t to + gpdf-embeddable.{cc,h} + (setup_pixmap) remove doc parameter. (Get it from view_data param) + + * gpdf-embeddable.cc: New files to contain the embeddable class + + * gpdf-embeddable.h: + + * gpdf.cc (main): remove call to setlocale (done in + gnome_init...), ignore return value of oaf_init, let bonobo_init + figure out which orb to use. + + * Link.h: declare some methods as const. + * Link.cc: + 2002-08-12 Martin Kretzschmar * GOutputDev.cc: make it compile (without Type 3 support for now) diff --git a/pdf/xpdf/Link.cc b/pdf/xpdf/Link.cc index af64c8b..eb9d033 100644 --- a/pdf/xpdf/Link.cc +++ b/pdf/xpdf/Link.cc @@ -575,7 +575,7 @@ Links::~Links() { gfree(links); } -LinkAction *Links::find(double x, double y) { +LinkAction *Links::find(double x, double y) const { int i; for (i = numLinks - 1; i >= 0; --i) { @@ -586,7 +586,7 @@ LinkAction *Links::find(double x, double y) { return NULL; } -GBool Links::onLink(double x, double y) { +GBool Links::onLink(double x, double y) const { int i; for (i = 0; i < numLinks; ++i) { diff --git a/pdf/xpdf/Link.h b/pdf/xpdf/Link.h index 4c644b8..e5b15e3 100644 --- a/pdf/xpdf/Link.h +++ b/pdf/xpdf/Link.h @@ -278,18 +278,18 @@ public: ~Link(); // Was the link created successfully? - GBool isOk() { return ok; } + GBool isOk() const { return ok; } // Check if point is inside the link rectangle. - GBool inRect(double x, double y) + GBool inRect(double x, double y) const { return x1 <= x && x <= x2 && y1 <= y && y <= y2; } // Get action. - LinkAction *getAction() { return action; } + LinkAction *getAction() const { return action; } // Get border corners and width. void getBorder(double *xa1, double *ya1, double *xa2, double *ya2, - double *wa) + double *wa) const { *xa1 = x1; *ya1 = y1; *xa2 = x2; *ya2 = y2; *wa = borderW; } private: @@ -315,15 +315,15 @@ public: ~Links(); // Iterate through list of links. - int getNumLinks() { return numLinks; } - Link *getLink(int i) { return links[i]; } + int getNumLinks() const { return numLinks; } + Link *getLink(int i) const { return links[i]; } // If point , is in a link, return the associated action; // else return NULL. - LinkAction *find(double x, double y); + LinkAction *find(double x, double y) const; // Return true if , is in a link. - GBool onLink(double x, double y); + GBool onLink(double x, double y) const; private: diff --git a/pdf/xpdf/Makefile.am b/pdf/xpdf/Makefile.am index 17de147..a044f21 100644 --- a/pdf/xpdf/Makefile.am +++ b/pdf/xpdf/Makefile.am @@ -119,6 +119,8 @@ bonobo_application_x_pdf_SOURCES = \ GOutputDev.h \ bonobo-application-x-pdf.cc \ bonobo-application-x-pdf.h \ + gpdf-embeddable.h \ + gpdf-embeddable.cc \ gtkgesture.c \ gtkgesture.h diff --git a/pdf/xpdf/gpdf.cc b/pdf/xpdf/gpdf.cc index 5b26d38..0452099 100644 --- a/pdf/xpdf/gpdf.cc +++ b/pdf/xpdf/gpdf.cc @@ -535,28 +535,25 @@ container_new (const char *fname) int main (int argc, char **argv) { - CORBA_Environment ev; - CORBA_ORB orb; const char **view_files = NULL; gboolean loaded; int i; bindtextdomain (PACKAGE, GNOMELOCALEDIR); textdomain (PACKAGE); - setlocale (LC_ALL, ""); - CORBA_exception_init (&ev); - gnomelib_register_popt_table (oaf_popt_options, "OAF"); - gnome_init_with_popt_table("PDFViewer", "0.0.1", + gnome_init_with_popt_table("PDFViewer", "0." VERSION, argc, argv, gpdf_popt_options, 0, &ctx); - orb = oaf_init (argc, argv); - CORBA_exception_free (&ev); + oaf_init (argc, argv); - if (bonobo_init (orb, NULL, NULL) == FALSE) + if (!bonobo_init (CORBA_OBJECT_NIL, + CORBA_OBJECT_NIL, + CORBA_OBJECT_NIL)) g_error (_("Could not initialize Bonobo!\n")); + bonobo_activate (); view_files = poptGetArgs (ctx); @@ -577,6 +574,9 @@ main (int argc, char **argv) poptFreeContext (ctx); + gtk_widget_push_visual (gdk_rgb_get_visual ()); + gtk_widget_push_colormap (gdk_rgb_get_cmap ()); + gtk_main (); return 0; -- cgit v0.9.1