From cc464515acfb37fd620c45ade2581d1fe51fde1d Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 6 Oct 1999 17:34:37 +0000 Subject: [PATCH] Gesture support + various improvements. --- pdf/xpdf/ChangeLog | 18 ++++++++++++++ pdf/xpdf/Makefile.am | 6 +++-- pdf/xpdf/gpdf.cc | 59 ++++++++++++++++++++++---------------------- pdf/xpdf/xpdf.cc | 2 +- 4 files changed, 53 insertions(+), 32 deletions(-) diff --git a/pdf/xpdf/ChangeLog b/pdf/xpdf/ChangeLog index 39ae5fca..8923cc2d 100644 --- a/pdf/xpdf/ChangeLog +++ b/pdf/xpdf/ChangeLog @@ -1,3 +1,21 @@ +1999-10-06 Michael Meeks + + * BonoboStream.cc (bfseek): Add debug case. + (bfread): nail immense leak. + + * gpdf.cc (container_set_view): Activate the component to + allow gestures to work. + +1999-10-05 Michael Meeks + + * bonobo-application-x-pdf.cc (setup_pixmap): Connect gestures + add + event mask. + + * gpdf.cc (container_close): Created. (container_close_cmd): Use it. + Huge header clean. + + * gtkgesture.[ch]: Create. + 1999-09-11 Michael Meeks * bonobo-application-x-pdf.cc (destroy_view): destroy don't unref, diff --git a/pdf/xpdf/Makefile.am b/pdf/xpdf/Makefile.am index 48cb6a94..87e02142 100644 --- a/pdf/xpdf/Makefile.am +++ b/pdf/xpdf/Makefile.am @@ -5,7 +5,7 @@ INCLUDES = \ $(EXTRA_GNOME_CFLAGS) if WITH_GNOME -gui = gpdf +gui = xpdf gpdf else gui = xpdf endif @@ -57,7 +57,9 @@ bonobo_application_x_pdf_SOURCES = \ BonoboStream.h \ BonoboStream.cc \ GOutputDev.cc \ - bonobo-application-x-pdf.cc + bonobo-application-x-pdf.cc \ + gtkgesture.c \ + gtkgesture.h bonobo_application_x_pdf_LDADD = \ ../goo/libgoo.a \ diff --git a/pdf/xpdf/gpdf.cc b/pdf/xpdf/gpdf.cc index a051e445..02c9dc30 100644 --- a/pdf/xpdf/gpdf.cc +++ b/pdf/xpdf/gpdf.cc @@ -18,27 +18,6 @@ extern "C" { #include #undef GString } -#include -#include -#include "gtypes.h" -#include "GString.h" -#include "parseargs.h" -#include "gfile.h" -#include "gmem.h" -#include "Object.h" -#include "Stream.h" -#include "Array.h" -#include "Dict.h" -#include "XRef.h" -#include "Catalog.h" -#include "Page.h" -#include "Link.h" -#include "PDFDoc.h" -#include "GOutputDev.h" -#include "PSOutputDev.h" -#include "TextOutputDev.h" -#include "Params.h" -#include "Error.h" #include "config.h" #include "bonobo-application-x-pdf.h" @@ -59,8 +38,6 @@ struct _Container { GnomeContainer *container; GnomeUIHandler *uih; - GnomeViewFrame *active_view_frame; - GtkWidget *app; GtkScrolledWindow *scroll; GtkWidget *view_widget; @@ -245,16 +222,26 @@ extern "C" { component_destroy (Component *component) { CORBA_Environment ev; + Container *container; g_return_if_fail (component != NULL); CORBA_exception_init (&ev); - + + /* Kill merged menus et al. */ + gnome_view_frame_view_deactivate (component->view_frame); + + container = component->container; + gtk_widget_destroy (container->view_widget); + container->view_widget = NULL; + if (component->server) GNOME_Unknown_unref ( gnome_object_corba_objref (GNOME_OBJECT (component->server)), &ev); component->server = NULL; CORBA_exception_free (&ev); + + g_free (component); } static void @@ -276,11 +263,24 @@ extern "C" { if (!containers) gtk_main_quit (); } + + static void + container_close (Container *cont) + { + g_return_if_fail (g_list_find (containers, cont) != NULL); + + if (cont->component) { + component_destroy (cont->component); + cont->component = NULL; + } else + container_destroy (cont); + } + static void container_close_cmd (GtkWidget *widget, Container *cont) { - container_destroy (cont); + container_close (cont); } static int @@ -297,7 +297,6 @@ extern "C" { container_destroy ((Container *)containers->data); } - static void container_about_cmd (GtkWidget *widget, Container *container) { @@ -363,6 +362,7 @@ container_set_view (Container *container, Component *component) * Activate it ( get it to merge menus etc. ) */ gnome_view_frame_view_activate (view_frame); + gnome_view_frame_set_covered (view_frame, FALSE); gtk_widget_show_all (GTK_WIDGET (container->scroll)); } @@ -618,7 +618,7 @@ container_new (const char *fname) container = g_new0 (Container, 1); - container->app = gnome_app_new ("pdf-viewer", + container->app = gnome_app_new ("pdf-viewer", "GNOME PDF viewer"); gtk_drag_dest_set (container->app, @@ -628,7 +628,8 @@ container_new (const char *fname) gtk_signal_connect (GTK_OBJECT(container->app), "drag_data_received", - GTK_SIGNAL_FUNC(filenames_dropped), (gpointer)container); + GTK_SIGNAL_FUNC(filenames_dropped), + (gpointer)container); gtk_window_set_default_size (GTK_WINDOW (container->app), 600, 600); gtk_window_set_policy (GTK_WINDOW (container->app), TRUE, TRUE, FALSE); @@ -678,7 +679,7 @@ main (int argc, char **argv) { CORBA_Environment ev; CORBA_ORB orb; - char **view_files = NULL; + const char **view_files = NULL; gboolean loaded; int i; diff --git a/pdf/xpdf/xpdf.cc b/pdf/xpdf/xpdf.cc index 60cb629d..4e5a2a8c 100644 --- a/pdf/xpdf/xpdf.cc +++ b/pdf/xpdf/xpdf.cc @@ -679,7 +679,7 @@ static GBool loadFile(GString *fileName) { win->setBusyCursor(gTrue); // open PDF file - newDoc = new PDFDoc(bxpdfopen(fileName), fileName); + newDoc = new PDFDoc(fileName); if (!newDoc->isOk()) { delete newDoc; if (win) -- 2.43.5