+++ /dev/null
-//========================================================================
-//
-// BonoboFile.cc
-//
-// Copyright 1999 Derek B. Noonburg assigned by Michael Meeks.
-//
-//========================================================================
-
-#ifdef __GNUC__
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <ctype.h>
-
-#include "BaseFile.h"
-
-//define HARD_DEBUG
-
-/* The open/close is done for you by the Bonobo server */
-
-void
-bfclose (BaseFile file)
-{
-}
-
-size_t
-bfread (void *ptr, size_t size, size_t nmemb, BaseFile file)
-{
- CORBA_long len;
- CORBA_Environment ev;
- GNOME_Stream_iobuf *buffer = NULL;
-
- g_return_val_if_fail (ptr != NULL, 0);
-
-#ifdef HARD_DEBUG
- printf ("read %p %d %d to %p\n", file, size, nmemb, ptr);
-#endif
- len = GNOME_Stream_read (file, size*nmemb, &buffer, &ev);
- g_return_val_if_fail (ev._major == CORBA_NO_EXCEPTION, 0);
-
-#ifdef HARD_DEBUG
- printf ("Read %d bytes %p %d\n", len, buffer->_buffer, buffer->_length);
-#endif
- memcpy (ptr, buffer->_buffer, buffer->_length);
-
- return len;
-}
-
-int
-bfseek (BaseFile file, long offset, int whence)
-{
- CORBA_Environment ev;
- GNOME_Stream_SeekType t;
-#ifdef HARD_DEBUG
- printf ("Seek %p %d %d\n", file, offset, whence);
-#endif
- if (whence == SEEK_SET)
- t = GNOME_Stream_SEEK_SET;
- else if (whence == SEEK_CUR)
- t = GNOME_Stream_SEEK_CUR;
- else
- t = GNOME_Stream_SEEK_END;
-
- return GNOME_Stream_seek (file, offset, t, &ev);
-}
-
-void
-brewind (BaseFile file)
-{
- CORBA_Environment ev;
-#ifdef HARD_DEBUG
- printf ("rewind %p\n", file);
-#endif
- GNOME_Stream_seek (file, 0, GNOME_Stream_SEEK_SET, &ev);
-}
-
-long
-bftell (BaseFile file)
-{
- CORBA_Environment ev;
- CORBA_long pos;
-#ifdef HARD_DEBUG
- printf ("tell %p\n", file);
-#endif
- pos = GNOME_Stream_seek (file, 0, GNOME_Stream_SEEK_CUR, &ev);
-#ifdef HARD_DEBUG
- printf ("tell returns %d\n", pos);
-#endif
-
- return pos;
-}
+++ /dev/null
-//========================================================================
-//
-// BonoboFile.h
-//
-// Copyright 1999 Derek B. Noonburg assigned by Michael Meeks.
-//
-//========================================================================
-
-#ifndef BONOBOFILE_H
-#define BONOBOFILE_H
-
-extern "C" {
-#define GString G_String
-#include <gnome.h>
-#include <libgnorba/gnorba.h>
-#include <bonobo/gnome-bonobo.h>
-#undef GString
-}
-
-typedef GNOME_Stream BaseFile;
-
-/* The open/close is done for you by the Bonobo server */
-
-extern void bfclose (BaseFile file);
-extern size_t bfread (void *ptr, size_t size, size_t nmemb, BaseFile file);
-extern int bfseek (BaseFile file, long offset, int whence);
-extern void brewind (BaseFile file);
-extern long bftell (BaseFile file);
-
-#endif /* BONOBOFILE_H */
GnomeEmbeddable *embeddable;
PDFDoc *pdf;
+ XRef *xref; /* Ugly global XRef hack fix */
BonoboStream *pdf_stream;
GNOME_Stream bonobo_stream;
{
setup_pixmap (view_data->bed, view_data,
view_data->win);
+ xref = view_data->bed->xref; /* Ugly global XRef hack fix */
view_data->out->startDoc();
view_data->bed->pdf->displayPage(view_data->out,
view_data->page, view_data->zoom,
0, gTrue);
+ view_data->bed->xref = xref;
+ xref = NULL;
}
static void
}
}
-
/*
* Loads a PDF from a GNOME_Stream
*/
obj.initNull();
bed->pdf_stream = new BonoboStream (stream, 0, -1, &obj);
bed->pdf = new PDFDoc (bed->pdf_stream);
+ bed->xref = xref; /* Ugly global XRef hack fix */
+ xref = NULL;
#if PDF_DEBUG > 0
printf ("Done load\n");
{
CORBA_Environment ev;
+ printf ("Destroying embedded component\n");
+
while (bed->views)
destroy_view (NULL, (view_data_t *)bed->views->data);