![]() |
![]() |
![]() |
GXPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <libgxps/gxps.h> struct GXPSPage; #define GXPS_PAGE_ERROR enum GXPSPageError; void gxps_page_get_size (GXPSPage *page
,gdouble *width
,gdouble *height
); gboolean gxps_page_render (GXPSPage *page
,cairo_t *cr
,GError **error
); GList * gxps_page_get_links (GXPSPage *page
,GError **error
); gboolean gxps_page_get_anchor_destination (GXPSPage *page
,const gchar *anchor
,cairo_rectangle_t *area
,GError **error
);
GXPSPage represents a page in a XPS document. GXPSPages
can be rendered into a cairo context with gxps_page_render()
.
GXPSPage objects can not be created directly, they are retrieved
from a GXPSDocument with gxps_document_get_page()
.
struct GXPSPage;
The GXPSPage struct contains only private fields and should not be directly accessed.
#define GXPS_PAGE_ERROR (gxps_page_error_quark ())
Error domain for GXPSPage. Errors in this domain will be from GXPSPageError enumeration. See GError for more information on error domains.
typedef enum { GXPS_PAGE_ERROR_INVALID, GXPS_PAGE_ERROR_RENDER, GXPS_PAGE_ERROR_INVALID_ANCHOR } GXPSPageError;
Error codes returned by GXPSPage functions
void gxps_page_get_size (GXPSPage *page
,gdouble *width
,gdouble *height
);
Gets the size of the page.
|
a GXPSPage |
|
return location for the page width. [out][allow-none] |
|
return location for the page height. [out][allow-none] |
gboolean gxps_page_render (GXPSPage *page
,cairo_t *cr
,GError **error
);
Render the page to the given cairo context. In case of
error, FALSE
is returned and error
is filled with
information about error.
|
a GXPSPage |
|
a cairo context to render to |
|
GError for error reporting, or NULL to ignore |
Returns : |
TRUE if page was successfully rendered,
FALSE otherwise. |
GList * gxps_page_get_links (GXPSPage *page
,GError **error
);
Gets a list of GXPSLink items that map from a location
in page
to a GXPSLinkTarget. Items in the list should
be freed with gxps_link_free()
and the list itself with
g_list_free()
when done.
gboolean gxps_page_get_anchor_destination (GXPSPage *page
,const gchar *anchor
,cairo_rectangle_t *area
,GError **error
);
Gets the rectangle of page
corresponding to the destination
of the given anchor. If anchor
is not found in page
, FALSE
will be returned and error
will contain GXPS_PAGE_ERROR_INVALID_ANCHOR
|
a GXPSPage |
|
the name of an anchor in page
|
|
return location for page area of anchor . [out]
|
|
GError for error reporting, or NULL to ignore |
Returns : |
TRUE if the destination for the anchor was found in page
and area contains the rectangle, FALSE otherwise. |