]> www.fi.muni.cz Git - evince.git/commitdiff
Gesture support + various improvements.
authorMichael Meeks <mmeeks@src.gnome.org>
Wed, 6 Oct 1999 17:34:37 +0000 (17:34 +0000)
committerMichael Meeks <mmeeks@src.gnome.org>
Wed, 6 Oct 1999 17:34:37 +0000 (17:34 +0000)
pdf/xpdf/ChangeLog
pdf/xpdf/Makefile.am
pdf/xpdf/gpdf.cc
pdf/xpdf/xpdf.cc

index 39ae5fca6183c2ef8301f174a28ac7569e874701..8923cc2d5f9e12991ce54dc343adfacb2047684c 100644 (file)
@@ -1,3 +1,21 @@
+1999-10-06  Michael Meeks  <mmeeks@gnu.org>
+
+       * 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  <mmeeks@gnu.org>
+
+       * 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  <michael@nuclecu.unam.mx>
 
        * bonobo-application-x-pdf.cc (destroy_view): destroy don't unref,
index 48cb6a945bdf01b78d5309aca8620209c6fab78d..87e021421c8cb3cda28a12f271c8a2b556120e69 100644 (file)
@@ -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                 \
index a051e4453c1ed92529f912bcbde50b5afd590a8c..02c9dc3077f646e0f5dc490fb1317e4c85dd6472 100644 (file)
@@ -18,27 +18,6 @@ extern "C" {
 #include <bonobo/gnome-bonobo.h>
 #undef  GString 
 }
-#include <sys/stat.h>
-#include <unistd.h>
-#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;
   
index 60cb629d986f878f6bd63286c1aef78bd8d7d39c..4e5a2a8cc807d920a9f7a15adb09c10e5833e512 100644 (file)
@@ -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)