Index: dvi/dvi-document.c
===================================================================
RCS file: /cvs/gnome/evince/dvi/dvi-document.c,v
retrieving revision 1.13
diff -u -p -r1.13 dvi-document.c
--- dvi/dvi-document.c	16 Nov 2006 15:58:36 -0000	1.13
+++ dvi/dvi-document.c	28 Nov 2006 07:40:46 -0000
@@ -219,12 +226,25 @@ dvi_document_finalize (GObject *object)
 		g_free (dvi_document->params);
 
         g_free (dvi_document->uri);
-		
+
 	G_OBJECT_CLASS (dvi_document_parent_class)->finalize (object);
 }
 
 
 static void
+src_special_handler (DviContext *dvi,
+		     const char *prefix,
+		     const char *arg)
+{
+	g_print ("special %s '%s'\n", prefix, arg);
+	g_print ("page %d: (%d, %d)\n", 
+		 dvi->currpage,
+		 pixel_round (dvi, dvi->pos.h),
+		 vpixel_round(dvi, dvi->pos.v));
+	mdvi_pixbuf_device_draw_rule (dvi, pixel_round (dvi, dvi->pos.h), vpixel_round(dvi, dvi->pos.v), 5, 5, 0xffffffff);
+}
+
+static void
 dvi_document_class_init (DviDocumentClass *klass)
 {
 	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -233,6 +253,9 @@ dvi_document_class_init (DviDocumentClas
 
 	mdvi_init_kpathsea("evince", MDVI_MFMODE, MDVI_FALLBACK_FONT, MDVI_DPI);
 	mdvi_register_fonts ();
+	mdvi_register_special ("Source special", "src:", NULL,
+			       (DviSpecialHandler) src_special_handler,
+			       TRUE);
 
 	dvi_context_mutex = g_mutex_new ();
 }
Index: dvi/pixbuf-device.c
===================================================================
RCS file: /cvs/gnome/evince/dvi/pixbuf-device.c,v
retrieving revision 1.5
diff -u -p -r1.5 pixbuf-device.c
--- dvi/pixbuf-device.c	28 Dec 2005 13:37:40 -0000	1.5
+++ dvi/pixbuf-device.c	28 Nov 2006 07:40:47 -0000
@@ -17,6 +17,12 @@ typedef struct _DviPixbufDevice
 
 static void dvi_pixbuf_draw_rule(DviContext *dvi, int x, int y, Uint w, Uint h, int fill);
 
+void 
+mdvi_pixbuf_device_draw_rule (DviContext *dvi, int x, int y, Uint w, Uint h, int fill)
+{
+	dvi_pixbuf_draw_rule (dvi, x, y, w, h, fill);
+}
+
 static void dvi_pixbuf_draw_glyph(DviContext *dvi, DviFontChar *ch, int x0, int y0)
 {
 	DviPixbufDevice *c_device = (DviPixbufDevice *) dvi->device.device_data;
Index: dvi/pixbuf-device.h
===================================================================
RCS file: /cvs/gnome/evince/dvi/pixbuf-device.h,v
retrieving revision 1.1
diff -u -p -r1.1 pixbuf-device.h
--- dvi/pixbuf-device.h	7 Apr 2005 15:28:03 -0000	1.1
+++ dvi/pixbuf-device.h	28 Nov 2006 07:40:47 -0000
@@ -19,6 +19,9 @@ mdvi_pixbuf_device_render (DviContext *d
 void 
 mdvi_pixbuf_device_set_margins (DviDevice *device, gint xmargin, gint ymargin);
 
+void 
+mdvi_pixbuf_device_draw_rule (DviContext *dvi, int x, int y, Uint w, Uint h, int fill);
+
 #endif /* MDVI_PIXBUF_DEVICE */
 
 
Index: dvi/mdvi-lib/special.c
===================================================================
RCS file: /cvs/gnome/evince/dvi/mdvi-lib/special.c,v
retrieving revision 1.2
diff -u -p -r1.2 special.c
--- dvi/mdvi-lib/special.c	23 Jun 2005 21:05:32 -0000	1.2
+++ dvi/mdvi-lib/special.c	28 Nov 2006 07:40:48 -0000
@@ -65,6 +65,7 @@ static void register_builtin_specials(vo
 	int	i;
 
 	ASSERT(registered_builtins == 0);	
+	registered_builtins = 1;
 	for(i = 0; i < NSPECIALS; i++)
 		mdvi_register_special(
 			builtins[i].label,
@@ -72,7 +73,6 @@ static void register_builtin_specials(vo
 			builtins[i].regex,
 			builtins[i].handler,
 			1 /* replace if exists */);
-	registered_builtins = 1;
 }
 
 static DviSpecial *find_special_prefix(const char *prefix)
