X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=ps%2Fps-document.c;h=fb1dd3d68e6a0a6befe41e38f57c549102c52dbb;hb=5bde54f8810020217366ec3e9a64b44b4f6ee3c6;hp=f0b3956b77811796c58100d29704e515c5b56381;hpb=88ec7e43a81072ea4d48ce91e6bf018a14c311a6;p=evince.git diff --git a/ps/ps-document.c b/ps/ps-document.c index f0b3956b..fb1dd3d6 100644 --- a/ps/ps-document.c +++ b/ps/ps-document.c @@ -272,6 +272,9 @@ ps_document_init(PSDocument * gs) gs->right_margin = 0; gs->bottom_margin = 0; + gs->page_x_offset = 0; + gs->page_y_offset = 0; + /* Set user defined defaults */ gs->override_orientation = gtk_gs_defaults_get_override_orientation(); gs->fallback_orientation = gtk_gs_defaults_get_orientation(); @@ -1694,6 +1697,15 @@ ps_document_load (EvDocument *document, return result; } +static gboolean +ps_document_save (EvDocument *document, + const char *uri, + GError **error) +{ + g_warning ("ps_document_save not implemented"); /* FIXME */ + return TRUE; +} + static int ps_document_get_n_pages (EvDocument *document) { @@ -1764,6 +1776,10 @@ ps_document_set_page_offset (EvDocument *document, int x, int y) { + PSDocument *gs = PS_DOCUMENT (document); + + gs->page_x_offset = x; + gs->page_y_offset = y; } static void @@ -1790,6 +1806,8 @@ ps_document_render (EvDocument *document, int clip_height) { PSDocument *gs = PS_DOCUMENT (document); + GdkRectangle page; + GdkRectangle draw; GdkGC *gc; if (gs->pstarget == NULL || @@ -1797,17 +1815,34 @@ ps_document_render (EvDocument *document, return; } + page.x = gs->page_x_offset; + page.y = gs->page_y_offset; + page.width = gs->width; + page.height = gs->height; + + draw.x = clip_x; + draw.y = clip_y; + draw.width = clip_width; + draw.height = clip_height; + gc = gdk_gc_new (gs->pstarget); gdk_draw_drawable (gs->pstarget, gc, gs->bpixmap, - clip_x, clip_y, - clip_x, clip_y, - clip_width, clip_height); + draw.x - page.x, draw.y - page.y, + draw.x, draw.y, + draw.width, draw.height); g_object_unref (gc); } +static char * +ps_document_get_text (EvDocument *document, GdkRectangle *rect) +{ + g_warning ("ps_document_get_text not implemented"); /* FIXME ? */ + return NULL; +} + static EvLink * ps_document_get_link (EvDocument *document, int x, @@ -1820,6 +1855,8 @@ static void ps_document_document_iface_init (EvDocumentIface *iface) { iface->load = ps_document_load; + iface->save = ps_document_save; + iface->get_text = ps_document_get_text; iface->get_link = ps_document_get_link; iface->get_n_pages = ps_document_get_n_pages; iface->set_page = ps_document_set_page;