glib/poppler-page.cc | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++ glib/poppler-page.h | 79 +++++++++++++++++++++++++++ glib/poppler.h | 55 +++++++++++++++++++ 3 files changed, 281 insertions(+)
New commits: commit 465dd4897ff603a6fd96503cf4746fc808b0f827 Author: Carlos Garcia Campos <[email protected]> Date: Thu Jul 1 12:59:39 2010 +0200 [glib] docs: document some enums diff --git a/glib/poppler.h b/glib/poppler.h index 01bcafa..b9b4fd3 100644 --- a/glib/poppler.h +++ b/glib/poppler.h @@ -27,6 +27,16 @@ GQuark poppler_error_quark (void); #define POPPLER_ERROR poppler_error_quark () +/** + * PopplerError: + * @POPPLER_ERROR_INVALID: Generic error when a document opration fails + * @POPPLER_ERROR_ENCRYPTED: Document is encrypted + * @POPPLER_ERROR_OPEN_FILE: File could not be opened for writing when saving document + * @POPPLER_ERROR_BAD_CATALOG: Failed to read the document catalog + * @POPPLER_ERROR_DAMAGED: Document is damaged + * + * Error codes returned by #PopplerDocument + */ typedef enum { POPPLER_ERROR_INVALID, @@ -44,6 +54,27 @@ typedef enum POPPLER_ORIENTATION_SEASCAPE } PopplerOrientation; +/** + * PopplerPageTransitionType: + * @POPPLER_PAGE_TRANSITION_REPLACE: the new page replace the old one + * @POPPLER_PAGE_TRANSITION_SPLIT: two lines sweep across the screen, revealing the new page + * @POPPLER_PAGE_TRANSITION_BLINDS: multiple lines, evenly spaced across the screen, synchronously + * sweep in the same direction to reveal the new page + * @POPPLER_PAGE_TRANSITION_BOX: a rectangular box sweeps inward from the edges of the page or + * outward from the center revealing the new page + * @POPPLER_PAGE_TRANSITION_WIPE: a single line sweeps across the screen from one edge to the other + * revealing the new page + * @POPPLER_PAGE_TRANSITION_DISSOLVE: the old page dissolves gradually to reveal the new one + * @POPPLER_PAGE_TRANSITION_GLITTER: similar to #POPPLER_PAGE_TRANSITION_DISSOLVE, except that the effect + * sweeps across the page in a wide band moving from one side of the screen to the other + * @POPPLER_PAGE_TRANSITION_FLY: changes are flown out or in to or from a location that is offscreen + * @POPPLER_PAGE_TRANSITION_PUSH: the old page slides off the screen while the new page slides in + * @POPPLER_PAGE_TRANSITION_COVER: the new page slides on to the screen covering the old page + * @POPPLER_PAGE_TRANSITION_UNCOVER: the old page slides off the screen uncovering the new page + * @POPPLER_PAGE_TRANSITION_FADE: the new page gradually becomes visible through the old one + * + * Page transition types + */ typedef enum { POPPLER_PAGE_TRANSITION_REPLACE, @@ -60,18 +91,42 @@ typedef enum POPPLER_PAGE_TRANSITION_FADE } PopplerPageTransitionType; +/** + * PopplerPageTransitionAlignment: + * @POPPLER_PAGE_TRANSITION_HORIZONTAL: horizontal dimension + * @POPPLER_PAGE_TRANSITION_VERTICAL: vertical dimension + * + * Page transition alignment types for #POPPLER_PAGE_TRANSITION_SPLIT + * and #POPPLER_PAGE_TRANSITION_BLINDS transition types + */ typedef enum { POPPLER_PAGE_TRANSITION_HORIZONTAL, POPPLER_PAGE_TRANSITION_VERTICAL } PopplerPageTransitionAlignment; +/** + * PopplerPageTransitionDirection: + * @POPPLER_PAGE_TRANSITION_INWARD: inward from the edges of the page + * @POPPLER_PAGE_TRANSITION_OUTWARD: outward from the center of the page + * + * Page transition direction types for #POPPLER_PAGE_TRANSITION_SPLIT, + * #POPPLER_PAGE_TRANSITION_BOX and #POPPLER_PAGE_TRANSITION_FLY transition types + */ typedef enum { POPPLER_PAGE_TRANSITION_INWARD, POPPLER_PAGE_TRANSITION_OUTWARD } PopplerPageTransitionDirection; +/** + * PopplerSelectionStyle: + * @POPPLER_SELECTION_GLYPH: glyph is the minimum unit for selection + * @POPPLER_SELECTION_WORD: word is the minimum unit for selection + * @POPPLER_SELECTION_LINE: line is the minimum unit for selection + * + * Selection styles + */ typedef enum { POPPLER_SELECTION_GLYPH, commit de3d599ea9e948867cfe395f42ed659670110c4c Author: Carlos Garcia Campos <[email protected]> Date: Thu Jul 1 12:31:10 2010 +0200 [glib] docs: document boxed types defined in poppler-page diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc index d2408f2..b7c7df7 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -1520,12 +1520,27 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerRectangle, poppler_rectangle, poppler_rectangle_copy, poppler_rectangle_free) +/** + * poppler_rectangle_new: + * + * Creates a new #PopplerRectangle + * + * Returns: a new #PopplerRectangle, use poppler_rectangle_free() to free it + */ PopplerRectangle * poppler_rectangle_new (void) { return g_slice_new0 (PopplerRectangle); } +/** + * poppler_rectangle_copy: + * @rectangle: a #PopplerRectangle to copy + * + * Creates a copy of @rectangle + * + * Returns: a new allocated copy of @rectangle + */ PopplerRectangle * poppler_rectangle_copy (PopplerRectangle *rectangle) { @@ -1534,6 +1549,12 @@ poppler_rectangle_copy (PopplerRectangle *rectangle) return g_slice_dup (PopplerRectangle, rectangle); } +/** + * poppler_rectangle_free: + * @rectangle: a #PopplerRectangle + * + * Frees the given #PopplerRectangle + */ void poppler_rectangle_free (PopplerRectangle *rectangle) { @@ -1543,12 +1564,27 @@ poppler_rectangle_free (PopplerRectangle *rectangle) /* PopplerColor type */ POPPLER_DEFINE_BOXED_TYPE (PopplerColor, poppler_color, poppler_color_copy, poppler_color_free) +/** + * poppler_color_new: + * + * Creates a new #PopplerColor + * + * Returns: a new #PopplerColor, use poppler_color_free() to free it + */ PopplerColor * poppler_color_new (void) { return (PopplerColor *) g_new0 (PopplerColor, 1); } +/** + * poppler_color_copy: + * @color: a #PopplerColor to copy + * + * Creates a copy of @color + * + * Returns: a new allocated copy of @color + */ PopplerColor * poppler_color_copy (PopplerColor *color) { @@ -1560,6 +1596,12 @@ poppler_color_copy (PopplerColor *color) return new_color; } +/** + * poppler_color_free: + * @color: a #PopplerColor + * + * Frees the given #PopplerColor + */ void poppler_color_free (PopplerColor *color) { @@ -1571,12 +1613,27 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerLinkMapping, poppler_link_mapping, poppler_link_mapping_copy, poppler_link_mapping_free) +/** + * poppler_link_mapping_new: + * + * Creates a new #PopplerLinkMapping + * + * Returns: a new #PopplerLinkMapping, use poppler_link_mapping_free() to free it + */ PopplerLinkMapping * poppler_link_mapping_new (void) { return g_slice_new0 (PopplerLinkMapping); } +/** + * poppler_link_mapping_copy: + * @mapping: a #PopplerLinkMapping to copy + * + * Creates a copy of @mapping + * + * Returns: a new allocated copy of @mapping + */ PopplerLinkMapping * poppler_link_mapping_copy (PopplerLinkMapping *mapping) { @@ -1590,6 +1647,12 @@ poppler_link_mapping_copy (PopplerLinkMapping *mapping) return new_mapping; } +/** + * poppler_link_mapping_free: + * @mapping: a #PopplerLinkMapping + * + * Frees the given #PopplerLinkMapping + */ void poppler_link_mapping_free (PopplerLinkMapping *mapping) { @@ -1607,18 +1670,39 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerImageMapping, poppler_image_mapping, poppler_image_mapping_copy, poppler_image_mapping_free) +/** + * poppler_image_mapping_new: + * + * Creates a new #PopplerImageMapping + * + * Returns: a new #PopplerImageMapping, use poppler_image_mapping_free() to free it + */ PopplerImageMapping * poppler_image_mapping_new (void) { return g_slice_new0 (PopplerImageMapping); } +/** + * poppler_image_mapping_copy: + * @mapping: a #PopplerImageMapping to copy + * + * Creates a copy of @mapping + * + * Returns: a new allocated copy of @mapping + */ PopplerImageMapping * poppler_image_mapping_copy (PopplerImageMapping *mapping) { return g_slice_dup (PopplerImageMapping, mapping); } +/** + * poppler_image_mapping_free: + * @mapping: a #PopplerImageMapping + * + * Frees the given #PopplerImageMapping + */ void poppler_image_mapping_free (PopplerImageMapping *mapping) { @@ -1630,12 +1714,27 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerPageTransition, poppler_page_transition, poppler_page_transition_copy, poppler_page_transition_free) +/** + * poppler_page_transition_new: + * + * Creates a new #PopplerPageTransition + * + * Returns: a new #PopplerPageTransition, use poppler_page_transition_free() to free it + */ PopplerPageTransition * poppler_page_transition_new (void) { return (PopplerPageTransition *) g_new0 (PopplerPageTransition, 1); } +/** + * poppler_page_transition_copy: + * @transition: a #PopplerPageTransition to copy + * + * Creates a copy of @transition + * + * Returns: a new allocated copy of @transition + */ PopplerPageTransition * poppler_page_transition_copy (PopplerPageTransition *transition) { @@ -1647,6 +1746,12 @@ poppler_page_transition_copy (PopplerPageTransition *transition) return new_transition; } +/** + * poppler_page_transition_free: + * @transition: a #PopplerPageTransition + * + * Frees the given #PopplerPageTransition + */ void poppler_page_transition_free (PopplerPageTransition *transition) { @@ -1658,12 +1763,27 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerFormFieldMapping, poppler_form_field_mapping, poppler_form_field_mapping_copy, poppler_form_field_mapping_free) +/** + * poppler_form_field_mapping_new: + * + * Creates a new #PopplerFormFieldMapping + * + * Returns: a new #PopplerFormFieldMapping, use poppler_form_field_mapping_free() to free it + */ PopplerFormFieldMapping * poppler_form_field_mapping_new (void) { return g_slice_new0 (PopplerFormFieldMapping); } +/** + * poppler_form_field_mapping_copy: + * @mapping: a #PopplerFormFieldMapping to copy + * + * Creates a copy of @mapping + * + * Returns: a new allocated copy of @mapping + */ PopplerFormFieldMapping * poppler_form_field_mapping_copy (PopplerFormFieldMapping *mapping) { @@ -1677,6 +1797,12 @@ poppler_form_field_mapping_copy (PopplerFormFieldMapping *mapping) return new_mapping; } +/** + * poppler_form_field_mapping_free: + * @mapping: a #PopplerFormFieldMapping + * + * Frees the given #PopplerFormFieldMapping + */ void poppler_form_field_mapping_free (PopplerFormFieldMapping *mapping) { @@ -1694,12 +1820,27 @@ POPPLER_DEFINE_BOXED_TYPE (PopplerAnnotMapping, poppler_annot_mapping, poppler_annot_mapping_copy, poppler_annot_mapping_free) +/** + * poppler_annot_mapping_new: + * + * Creates a new #PopplerAnnotMapping + * + * Returns: a new #PopplerAnnotMapping, use poppler_annot_mapping_free() to free it + */ PopplerAnnotMapping * poppler_annot_mapping_new (void) { return g_slice_new0 (PopplerAnnotMapping); } +/** + * poppler_annot_mapping_copy: + * @mapping: a #PopplerAnnotMapping to copy + * + * Creates a copy of @mapping + * + * Returns: a new allocated copy of @mapping + */ PopplerAnnotMapping * poppler_annot_mapping_copy (PopplerAnnotMapping *mapping) { @@ -1713,6 +1854,12 @@ poppler_annot_mapping_copy (PopplerAnnotMapping *mapping) return new_mapping; } +/** + * poppler_annot_mapping_free: + * @mapping: a #PopplerAnnotMapping + * + * Frees the given #PopplerAnnotMapping + */ void poppler_annot_mapping_free (PopplerAnnotMapping *mapping) { diff --git a/glib/poppler-page.h b/glib/poppler-page.h index f49f876..785c48f 100644 --- a/glib/poppler-page.h +++ b/glib/poppler-page.h @@ -120,6 +120,16 @@ gboolean poppler_page_get_text_layout (PopplerPage *pa /* A rectangle on a page, with coordinates in PDF points. */ #define POPPLER_TYPE_RECTANGLE (poppler_rectangle_get_type ()) +/** + * PopplerRectangle: + * @x1: x coordinate of lower left corner + * @y1: y coordinate of lower left corner + * @x2: x coordinate of upper right corner + * @y2: y coordinate of upper right corner + * + * A #PopplerRectangle is used to describe + * locations on a page and bounding boxes + */ struct _PopplerRectangle { gdouble x1; @@ -135,6 +145,16 @@ void poppler_rectangle_free (PopplerRectangle *rectangle); /* A color in RGB */ #define POPPLER_TYPE_COLOR (poppler_color_get_type ()) + +/** + * PopplerColor: + * @red: the red componment of color + * @green: the green component of color + * @blue: the blue component of color + * + * A #PopplerColor describes a RGB color. Color components + * are values between 0 and 65535 + */ struct _PopplerColor { guint16 red; @@ -149,6 +169,15 @@ void poppler_color_free (PopplerColor *color); /* Mapping between areas on the current page and PopplerActions */ #define POPPLER_TYPE_LINK_MAPPING (poppler_link_mapping_get_type ()) + +/** + * PopplerLinkMapping: + * @area: a #PopplerRectangle representing an area of the page + * @action: a #PopplerAction + * + * A #PopplerLinkMapping structure represents the location + * of @action on the page + */ struct _PopplerLinkMapping { PopplerRectangle area; @@ -162,6 +191,29 @@ void poppler_link_mapping_free (PopplerLinkMapping *mapping); /* Page Transition */ #define POPPLER_TYPE_PAGE_TRANSITION (poppler_page_transition_get_type ()) + +/** + * PopplerPageTransition: + * @type: the type of transtition + * @alignment: the dimension in which the transition effect shall occur. + * Only for #POPPLER_PAGE_TRANSITION_SPLIT and #POPPLER_PAGE_TRANSITION_BLINDS transition types + * @direction: the direccion of motion for the transition effect. + * Only for #POPPLER_PAGE_TRANSITION_SPLIT, #POPPLER_PAGE_TRANSITION_BOX and #POPPLER_PAGE_TRANSITION_FLY + * transition types + * @duration: the duration of the transition effect + * @angle: the direction in which the specified transition effect shall moves, + * expressed in degrees counterclockwise starting from a left-to-right direction. + * Only for #POPPLER_PAGE_TRANSITION_WIPE, #POPPLER_PAGE_TRANSITION_GLITTER, #POPPLER_PAGE_TRANSITION_FLY, + * #POPPLER_PAGE_TRANSITION_COVER, #POPPLER_PAGE_TRANSITION_UNCOVER and #POPPLER_PAGE_TRANSITION_PUSH + * transition types + * @scale: the starting or ending scale at which the changes shall be drawn. + * Only for #POPPLER_PAGE_TRANSITION_FLY transition type + * @rectangular: whether the area that will be flown is rectangular and opaque. + * Only for #POPPLER_PAGE_TRANSITION_FLY transition type + * + * A #PopplerPageTransition structures describes a visual transition + * to use when moving between pages during a presentation + */ struct _PopplerPageTransition { PopplerPageTransitionType type; @@ -180,6 +232,15 @@ void poppler_page_transition_free (PopplerPageTransition * /* Mapping between areas on the current page and images */ #define POPPLER_TYPE_IMAGE_MAPPING (poppler_image_mapping_get_type ()) + +/** + * PopplerImageMapping: + * @area: a #PopplerRectangle representing an area of the page + * @image_id: an image identifier + * + * A #PopplerImageMapping structure represents the location + * of an image on the page + */ struct _PopplerImageMapping { PopplerRectangle area; @@ -193,6 +254,15 @@ void poppler_image_mapping_free (PopplerImageMapping *mapp /* Mapping between areas on the current page and form fields */ #define POPPLER_TYPE_FORM_FIELD_MAPPING (poppler_form_field_mapping_get_type ()) + +/** + * PopplerFormFieldMapping: + * @area: a #PopplerRectangle representing an area of the page + * @field: a #PopplerFormField + * + * A #PopplerFormFieldMapping structure represents the location + * of @field on the page + */ struct _PopplerFormFieldMapping { PopplerRectangle area; @@ -206,6 +276,15 @@ void poppler_form_field_mapping_free (PopplerFormFieldMa /* Mapping between areas on the current page and annots */ #define POPPLER_TYPE_ANNOT_MAPPING (poppler_annot_mapping_get_type ()) + +/** + * PopplerAnnotMapping: + * @area: a #PopplerRectangle representing an area of the page + * @annot: a #PopplerAannot + * + * A #PopplerAnnotMapping structure represents the location + * of @annot on the page + */ struct _PopplerAnnotMapping { PopplerRectangle area; _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
