fo-doc

fo-doc —

Synopsis




struct      FoDoc;
struct      FoDocClass;
#define     FO_DOC_ERROR
GQuark      fo_doc_error_quark              (void);
enum        FoDocError;
enum        FoDocLineCap;
enum        FoDocLineJoin;
FoDoc*      fo_doc_new                      (void);
FoDoc*      fo_doc_new_from_type            (const gchar *type);
void        fo_doc_open_file                (FoDoc *fo_doc,
                                             const gchar *filename,
                                             GError **error);
FoLayout*   fo_doc_get_new_layout           (FoDoc *fo_doc);
const gchar* fo_doc_get_language            (FoDoc *fo_doc);
void        fo_doc_set_language             (FoDoc *fo_doc,
                                             const gchar *language);
FoEnumAreaDirection fo_doc_get_base_dir     (FoDoc *fo_doc);
void        fo_doc_set_base_dir             (FoDoc *fo_doc,
                                             FoEnumAreaDirection base_dir);
void        fo_doc_begin_page               (FoDoc *fo_doc,
                                             gfloat width,
                                             gfloat height);
void        fo_doc_end_page                 (FoDoc *fo_doc);
FoDatatype* fo_doc_get_fill_color           (FoDoc *fo_doc);
void        fo_doc_set_fill_color           (FoDoc *fo_doc,
                                             FoDatatype *color);
FoDatatype* fo_doc_get_stroke_color         (FoDoc *fo_doc);
void        fo_doc_set_stroke_color         (FoDoc *fo_doc,
                                             FoDatatype *color);
FoDocLineCap fo_doc_get_line_cap            (FoDoc *fo_doc);
void        fo_doc_set_line_cap             (FoDoc *fo_doc,
                                             FoDocLineCap line_cap);
FoDocLineJoin fo_doc_get_line_join          (FoDoc *fo_doc);
void        fo_doc_set_line_join            (FoDoc *fo_doc,
                                             FoDocLineJoin line_join);
gfloat      fo_doc_get_line_width           (FoDoc *fo_doc);
void        fo_doc_set_line_width           (FoDoc *fo_doc,
                                             gfloat line_width);
void        fo_doc_set_dash                 (FoDoc *fo_doc,
                                             gfloat b,
                                             gfloat w);
void        fo_doc_translate                (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);
void        fo_doc_clip                     (FoDoc *fo_doc);
void        fo_doc_save                     (FoDoc *fo_doc);
void        fo_doc_restore                  (FoDoc *fo_doc);
void        fo_doc_line_to                  (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);
void        fo_doc_move_to                  (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);
void        fo_doc_line_stroked             (FoDoc *fo_doc,
                                             gfloat x0,
                                             gfloat y0,
                                             gfloat x1,
                                             gfloat y1);
void        fo_doc_rect_stroked             (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y,
                                             gfloat width,
                                             gfloat height);
void        fo_doc_rect_filled              (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y,
                                             gfloat width,
                                             gfloat height);
void        fo_doc_fill                     (FoDoc *fo_doc);
void        fo_doc_stroke                   (FoDoc *fo_doc);
void        fo_doc_fill_stroke              (FoDoc *fo_doc);
void        fo_doc_place_image              (FoDoc *fo_doc,
                                             gint image,
                                             gfloat x,
                                             gfloat y,
                                             gfloat scale);
gint        fo_doc_open_image_file          (FoDoc *fo_doc,
                                             const char *imagetype,
                                             const char *filename,
                                             const char *stringparam,
                                             gint intparam);
void        fo_doc_close_image              (FoDoc *fo_doc,
                                             gint image);
FoFontDesc* fo_doc_get_font_desc            (FoDoc *fo_doc);
void        fo_doc_render_layout_lines      (FoDoc *fo_doc,
                                             FoArea *area_layout,
                                             gfloat x,
                                             gfloat y);
void        fo_doc_render_layout            (FoDoc *fo_doc,
                                             FoArea *area_layout,
                                             gfloat x,
                                             gfloat y);

Description

Details

struct FoDoc

struct FoDoc;


struct FoDocClass

struct FoDocClass;


FO_DOC_ERROR

#define FO_DOC_ERROR fo_doc_error_quark ()


fo_doc_error_quark ()

GQuark      fo_doc_error_quark              (void);

Get the error quark for FoDoc.

If the quark does not yet exist, create it.

Returns : Quark associated with FoDoc errors.

enum FoDocError

typedef enum
{
  FO_DOC_ERROR_FAILED,
  FO_DOC_ERROR_OPEN_FAILED,   /* Cannot open output document */
  FO_DOC_ERROR_LAST
} FoDocError;


enum FoDocLineCap

typedef enum
{
  FO_DOC_LINE_CAP_INVALID,
  FO_DOC_LINE_CAP_BUTT,
  FO_DOC_LINE_CAP_ROUND,
  FO_DOC_LINE_CAP_SQUARE,
  FO_DOC_LINE_CAP_LIMIT
} FoDocLineCap;


enum FoDocLineJoin

typedef enum
{
  FO_DOC_LINE_JOIN_INVALID,
  FO_DOC_LINE_JOIN_MITER,
  FO_DOC_LINE_JOIN_ROUND,
  FO_DOC_LINE_JOIN_BEVEL,
  FO_DOC_LINE_JOIN_LIMIT
} FoDocLineJoin;


fo_doc_new ()

FoDoc*      fo_doc_new                      (void);

Creates a new FoDoc.

Returns : the newly created FoDoc.

fo_doc_new_from_type ()

FoDoc*      fo_doc_new_from_type            (const gchar *type);

Creates a new FoDoc.

type : Type of the new FoDoc.
Returns : the newly created FoDoc.

fo_doc_open_file ()

void        fo_doc_open_file                (FoDoc *fo_doc,
                                             const gchar *filename,
                                             GError **error);

fo_doc :
filename :
error :

fo_doc_get_new_layout ()

FoLayout*   fo_doc_get_new_layout           (FoDoc *fo_doc);

Get a new FoLayout for use with fo_doc.

fo_doc : FoDoc.
Returns : New FoLayout.

fo_doc_get_language ()

const gchar* fo_doc_get_language            (FoDoc *fo_doc);

Get the language in fo_doc.

fo_doc : FoDoc
Returns : Language of file parsed to make fo_doc.

fo_doc_set_language ()

void        fo_doc_set_language             (FoDoc *fo_doc,
                                             const gchar *language);

Set the language in fo_doc.

fo_doc : FoDoc.
language : Language.

fo_doc_get_base_dir ()

FoEnumAreaDirection fo_doc_get_base_dir     (FoDoc *fo_doc);

Get the FoEnumAreaDirection used as input to fo_doc.

fo_doc : FoDoc.
Returns : FoEnumAreaDirection used as input to fo_doc.

fo_doc_set_base_dir ()

void        fo_doc_set_base_dir             (FoDoc *fo_doc,
                                             FoEnumAreaDirection base_dir);

Set the FoEnumAreaDirection in fo_doc.

fo_doc : FoDoc.
base_dir : FoEnumAreaDirection value for new base direction.

fo_doc_begin_page ()

void        fo_doc_begin_page               (FoDoc *fo_doc,
                                             gfloat width,
                                             gfloat height);

Add a new page to fo_doc.

This must always be paired with a matching fo_doc_end_page call.

fo_doc : FoDoc.
width : Width of the new page.
height : Height of the new page.

fo_doc_end_page ()

void        fo_doc_end_page                 (FoDoc *fo_doc);

Finish the current page of fo_doc.

fo_doc : FoDoc.

fo_doc_get_fill_color ()

FoDatatype* fo_doc_get_fill_color           (FoDoc *fo_doc);

Get the current fill color of fo_doc.

fo_doc : FoDoc.
Returns : FoDatatype for the current fill color.

fo_doc_set_fill_color ()

void        fo_doc_set_fill_color           (FoDoc *fo_doc,
                                             FoDatatype *color);

Set the fill color of fo_doc to color.

fo_doc : FoDoc.
color : FoDatatype for new fill color.

fo_doc_get_stroke_color ()

FoDatatype* fo_doc_get_stroke_color         (FoDoc *fo_doc);

Get the current stroke color of fo_doc.

fo_doc : FoDoc.
Returns : FoDatatype for the current stroke color.

fo_doc_set_stroke_color ()

void        fo_doc_set_stroke_color         (FoDoc *fo_doc,
                                             FoDatatype *color);

Set the stroke color of fo_doc to color.

fo_doc : FoDoc.
color : FoDatatype for new stroke color.

fo_doc_get_line_cap ()

FoDocLineCap fo_doc_get_line_cap            (FoDoc *fo_doc);

Get the current "linecap" parameter value of fo_doc.

fo_doc : FoDoc.
Returns : Current "linecap" parameter value.

fo_doc_set_line_cap ()

void        fo_doc_set_line_cap             (FoDoc *fo_doc,
                                             FoDocLineCap line_cap);

Set the "linecap" parameter value of fo_doc.

fo_doc : FoDoc.
line_cap : New "linecap" parameter value.

fo_doc_get_line_join ()

FoDocLineJoin fo_doc_get_line_join          (FoDoc *fo_doc);

Get the current "linejoin" parameter value of fo_doc.

fo_doc : FoDoc.
Returns : Current "linejoin" parameter value.

fo_doc_set_line_join ()

void        fo_doc_set_line_join            (FoDoc *fo_doc,
                                             FoDocLineJoin line_join);

Set the "linejoin" parameter value of fo_doc.

fo_doc : FoDoc.
line_join : New "linejoin" parameter value.

fo_doc_get_line_width ()

gfloat      fo_doc_get_line_width           (FoDoc *fo_doc);

Get the current line width of fo_doc.

fo_doc : FoDoc.
Returns : Current line width.

fo_doc_set_line_width ()

void        fo_doc_set_line_width           (FoDoc *fo_doc,
                                             gfloat line_width);

Set the line width of fo_doc.

fo_doc : FoDoc.
line_width : New line width value.

fo_doc_set_dash ()

void        fo_doc_set_dash                 (FoDoc *fo_doc,
                                             gfloat b,
                                             gfloat w);

Set the current dash pattern of fo_doc.

The dash pattern is the ratio of b to w.

Set b and w to 0 to produce a solid line.

The dash pattern is set to solid (b = w = 0) at the beginning of each page.

fo_doc : FoDoc.
b : Number of black units.
w : Number of white units.

fo_doc_translate ()

void        fo_doc_translate                (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);

Translate the origin of the coordinate system of fo_doc.

x and y are measured in the old coordinate system.

fo_doc : FoDoc.
x : X-coordinate of the new origin of the coordinate system.
y : Y-coordinate of the new origin of the coordinate system.

fo_doc_clip ()

void        fo_doc_clip                     (FoDoc *fo_doc);

Use the current path of fo_doc as its clipping path.

fo_doc : FoDoc.

fo_doc_save ()

void        fo_doc_save                     (FoDoc *fo_doc);

Save the current graphics state of fo_doc.

fo_doc : FoDoc.

fo_doc_restore ()

void        fo_doc_restore                  (FoDoc *fo_doc);

Restore the most recently saved graphics state of fo_doc.

fo_doc : FoDoc.

fo_doc_line_to ()

void        fo_doc_line_to                  (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);

Draw a line from the current point to another point.

fo_doc : FoDoc.
x : X-coordinate of the new current point.
y : Y-coordinate of the new current point.

fo_doc_move_to ()

void        fo_doc_move_to                  (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y);

Set the current point of fo_doc to (x, y).

fo_doc : FoDoc.
x : X-coordinate of the new current point.
y : Y-coordinate of the new current point.

fo_doc_line_stroked ()

void        fo_doc_line_stroked             (FoDoc *fo_doc,
                                             gfloat x0,
                                             gfloat y0,
                                             gfloat x1,
                                             gfloat y1);

Draw a line from (x0,y0) to (x1,y1).

fo_doc : FoDoc.
x0 : X-coordinate of the start of the line.
y0 : Y-coordinate of the start of the line.
x1 : X-coordinate of the end of the line.
y1 : Y-coordinate of the end of the line.

fo_doc_rect_stroked ()

void        fo_doc_rect_stroked             (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y,
                                             gfloat width,
                                             gfloat height);

Draw an outline rectangle.

fo_doc : FoDoc.
x : X-coordinate of the lower-left corner of the rectangle.
y : Y-coordinate of the lower-left corner of the rectangle.
width : Width of the rectangle.
height : Height of the rectangle.

fo_doc_rect_filled ()

void        fo_doc_rect_filled              (FoDoc *fo_doc,
                                             gfloat x,
                                             gfloat y,
                                             gfloat width,
                                             gfloat height);

Draw a filled rectangle.

fo_doc : FoDoc.
x : X-coordinate of the lower-left corner of the rectangle.
y : Y-coordinate of the lower-left corner of the rectangle.
width : Width of the rectangle.
height : Height of the rectangle.

fo_doc_fill ()

void        fo_doc_fill                     (FoDoc *fo_doc);

Fill the interior of the path of fo_doc with the current fill color.

fo_doc : FoDoc.

fo_doc_stroke ()

void        fo_doc_stroke                   (FoDoc *fo_doc);

Stroke the path of fo_doc and clear the path.

fo_doc : FoDoc.

fo_doc_fill_stroke ()

void        fo_doc_fill_stroke              (FoDoc *fo_doc);

Fill and stroke the path of fo_doc with the current fill and stroke colors.

fo_doc : FoDoc.

fo_doc_place_image ()

void        fo_doc_place_image              (FoDoc *fo_doc,
                                             gint image,
                                             gfloat x,
                                             gfloat y,
                                             gfloat scale);

fo_doc :
image :
x :
y :
scale :

fo_doc_open_image_file ()

gint        fo_doc_open_image_file          (FoDoc *fo_doc,
                                             const char *imagetype,
                                             const char *filename,
                                             const char *stringparam,
                                             gint intparam);

fo_doc :
imagetype :
filename :
stringparam :
intparam :
Returns :

fo_doc_close_image ()

void        fo_doc_close_image              (FoDoc *fo_doc,
                                             gint image);

fo_doc :
image :

fo_doc_get_font_desc ()

FoFontDesc* fo_doc_get_font_desc            (FoDoc *fo_doc);

Get the PangoFontDescription in fo_doc.

fo_doc : FoDoc.
Returns : PangoFontDescription in fo_doc.

fo_doc_render_layout_lines ()

void        fo_doc_render_layout_lines      (FoDoc *fo_doc,
                                             FoArea *area_layout,
                                             gfloat x,
                                             gfloat y);

fo_doc :
area_layout :
x :
y :

fo_doc_render_layout ()

void        fo_doc_render_layout            (FoDoc *fo_doc,
                                             FoArea *area_layout,
                                             gfloat x,
                                             gfloat y);

fo_doc :
area_layout :
x :
y :