#include "config.h"
GBool printCommands = gFalse;
-gint gpdf_debug;
+gint gpdf_debug=1;
poptContext ctx;
#define DOC_ROOT_MAGIC 0xad3f556d
widget->allocation.height,
-1);
+ printf ("Creating pixmap of size %d %d\n",
+ widget->allocation.width, widget->allocation.height);
gdk_color_white (gtk_widget_get_default_colormap(), &doc->paper);
doc->out = new GOutputDev (doc->pixmap, doc->paper);
-/* gdk_draw_rectangle (doc->pixmap,
- widget->style->white_gc,
- TRUE,
- 0, 0,
- widget->allocation.width,
- widget->allocation.height);*/
- printf ("Configured...\n");
+
+ {
+ GdkGCValues gcValues;
+ GdkGC *strokeGC;
+
+ gdk_color_white (gtk_widget_get_default_colormap (), &gcValues.foreground);
+ gdk_color_black (gtk_widget_get_default_colormap (), &gcValues.background);
+ gcValues.line_width = 1;
+ gcValues.line_style = GDK_LINE_SOLID;
+ strokeGC = gdk_gc_new_with_values (
+ doc->pixmap, &gcValues,
+ (enum GdkGCValuesMask)(GDK_GC_FOREGROUND | GDK_GC_BACKGROUND | GDK_GC_LINE_WIDTH | GDK_GC_LINE_STYLE));
+
+ gdk_draw_rectangle (doc->pixmap,
+ strokeGC,
+ TRUE,
+ 0, 0,
+ widget->allocation.width,
+ widget->allocation.height);
+ }
return TRUE;
}
+GdkFont *magic_font;
+GdkGC *magic_black;
+
static gint
-doc_redraw_event (GtkWidget *widget, void *ugly)
+doc_redraw_event (GtkWidget *widget, GdkEventExpose *event)
{
DOC_ROOT *doc = hack_global;
g_return_val_if_fail (doc->magic == DOC_ROOT_MAGIC, FALSE);
if (doc->out && doc->pdf) {
+ GtkStyle *style = gtk_widget_get_default_style();
printf ("There are %d pages\n", doc->pdf->getNumPages());
- doc->pdf->displayPage(doc->out, 1, 72, 0, gTrue);
- gdk_draw_pixmap (widget->window,
- widget->style->white_gc,
- doc->pixmap,
- 0, 0,
- 0, 0,
- widget->allocation.width,
- widget->allocation.height);
-
+ magic_font = widget->style->font;
+ magic_black = widget->style->black_gc;
+ gdk_draw_line (doc->pixmap,
+ widget->style->black_gc,
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
+ doc->pdf->displayPage(doc->out, 1, 86, 0, gTrue); /* 86 zoom */
+ printf ("Draw pixmap %p\n", doc->pixmap);
+ gdk_draw_string (doc->pixmap, magic_font, magic_black,
+ 300, 300, "Hello");
+ gdk_draw_pixmap(widget->window,
+ widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ doc->pixmap,
+ 0, 0,
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
} else
printf ("Null pointer error %p %p\n", doc->out, doc->pdf);
gnome_init_with_popt_table (
"gpdf", "0.1", argc, argv,
gpdf_popt_options, 0, &ctx);
+
+ errorInit();
initParams (xpdfConfigFile); /* Init font path */