+2004-12-22 Marco Pesenti Gritti <marco@gnome.org>
+
+ * ps/gtkgs.c: (gtk_gs_init), (set_up_page),
+ (ps_document_set_target), (ps_document_get_page_size),
+ (ps_document_render):
+ * ps/gtkgs.h:
+
+ Fix a few bugs
+
2004-12-22 Christian Rose <menthos@menthos.com>
* configure.ac: Added "sv" to ALL_LINGUAS.
gtk_gs_init(GtkGS * gs)
{
gs->bpixmap = NULL;
- gs->use_bpixmap = TRUE;
gs->current_page = -2;
gs->disable_start = FALSE;
char *savelocale;
#endif
+ if (gs->pstarget == NULL)
+ return;
+
/* Do we have to check if the actual geometry changed? */
stop_interpreter(gs);
/* clear new pixmap (set to white) */
fill = gdk_gc_new(gs->pstarget);
if(fill) {
- //colormap = gtk_widget_get_colormap(GTK_WIDGET(gs));
- //gdk_color_alloc(colormap, &white);
gdk_gc_set_foreground(fill, &white);
- if(gs->use_bpixmap && gs->width > 0 && gs->height > 0) {
+ if(gs->width > 0 && gs->height > 0) {
if(gs->bpixmap) {
gdk_drawable_unref(gs->bpixmap);
gs->bpixmap = NULL;
ps_document_set_target (EvDocument *document,
GdkDrawable *target)
{
- GTK_GS (document)->pstarget = target;
+ GtkGS *gs = GTK_GS (document);
+
+ gs->pstarget = target;
+ gtk_gs_goto_page (gs, gs->current_page);
}
static void
int *width,
int *height)
{
+ GtkGS *gs = GTK_GS (document);
+
+ if (width) {
+ *width = gs->width;
+ }
+
+ if (height) {
+ *height = gs->height;
+ }
}
static void
GtkGS *gs = GTK_GS (document);
GdkGC *gc;
+ if (gs->pstarget == NULL ||
+ gs->bpixmap == NULL) {
+ return;
+ }
+
gc = gdk_gc_new (gs->pstarget);
gdk_draw_drawable (gs->pstarget, gc,
GtkGSZoomMode zoom_mode;
GdkPixmap *bpixmap; /* Backing pixmap */
- int use_bpixmap;
long message_window; /* Used by ghostview to receive messages from app */
void gtk_gs_reload(GtkGS * gs);
/* control functions */
-void gtk_gs_center_page(GtkGS * gs);
gboolean gtk_gs_next_page(GtkGS * gs);
gboolean gtk_gs_prev_page(GtkGS * gs);
gboolean gtk_gs_goto_page(GtkGS * gs, gint);