RptCommon

RptCommon — Usefull functions and struct.

Synopsis




                    RptColor;
                    RptPoint;
                    RptSize;
                    RptRotation;
                    RptFont;
                    RptBorder;
enum                eRptHAlign;
enum                eRptVAlign;
                    RptAlign;
                    RptStroke;
RptPoint*           rpt_common_get_position             (xmlNode *xnode);
void                rpt_common_set_position             (xmlNode *xnode,
                                                         const RptPoint *position);
RptSize*            rpt_common_get_size                 (xmlNode *xnode);
void                rpt_common_set_size                 (xmlNode *xnode,
                                                         const RptSize *size);
RptRotation*        rpt_common_get_rotation             (xmlNode *xnode);
void                rpt_common_set_rotation             (xmlNode *xnode,
                                                         const RptRotation *rotation);
RptFont*            rpt_common_get_font                 (xmlNode *xnode);
void                rpt_common_set_font                 (xmlNode *xnode,
                                                         const RptFont *font);
RptBorder*          rpt_common_get_border               (xmlNode *xnode);
void                rpt_common_set_border               (xmlNode *xnode,
                                                         const RptBorder *border);
RptAlign*           rpt_common_get_align                (xmlNode *xnode);
void                rpt_common_set_align                (xmlNode *xnode,
                                                         const RptAlign *align);
RptStroke*          rpt_common_get_stroke               (xmlNode *xnode);
void                rpt_common_set_stroke               (xmlNode *xnode,
                                                         const RptStroke *stroke);
RptColor*           rpt_common_parse_color              (const gchar *str_color);
gchar*              rpt_common_rptcolor_to_string       (const RptColor *color);
gdouble*            rpt_common_style_to_array           (const GArray *style);

Description

Details

RptColor

typedef struct {
	gdouble r;
	gdouble g;
	gdouble b;
	gdouble a;
} RptColor;

gdouble r; the red channel.
gdouble g; the green channel.
gdouble b; the blue channel.
gdouble a; the alpha channel.

RptPoint

typedef struct {
	gdouble x;
	gdouble y;
} RptPoint;


RptSize

typedef struct {
	gdouble width;
	gdouble height;
} RptSize;


RptRotation

typedef struct {
	gdouble angle;
} RptRotation;


RptFont

typedef struct {
	gchar *name;
	gdouble size;
	gboolean bold;
	gboolean italic;
	PangoUnderline underline;
	gboolean strike;
	RptColor *color;
} RptFont;

gchar *name; the font's family name.
gdouble size; the font's size in pixel.
gboolean bold; if the font is bold.
gboolean italic; if the font is italic.
PangoUnderline underline; if the font is underline.
gboolean strike; if the font is striked.
RptColor *color; an RptColor.

RptBorder

typedef struct {
	gdouble top_width;
	gdouble right_width;
	gdouble bottom_width;
	gdouble left_width;
	RptColor *top_color;
	RptColor *right_color;
	RptColor *bottom_color;
	RptColor *left_color;
	GArray *top_style;
	GArray *right_style;
	GArray *bottom_style;
	GArray *left_style;
} RptBorder;

gdouble top_width;
gdouble right_width;
gdouble bottom_width;
gdouble left_width;
RptColor *top_color; an RptColor
RptColor *right_color; an RptColor
RptColor *bottom_color; an RptColor
RptColor *left_color; an RptColor
GArray *top_style; a GArray of gdouble values representing dashes sequence
GArray *right_style; a GArray of gdouble values representing dashes sequence
GArray *bottom_style; a GArray of gdouble values representing dashes sequence
GArray *left_style; a GArray of gdouble values representing dashes sequence

enum eRptHAlign

typedef enum
{
	RPT_HALIGN_LEFT,
	RPT_HALIGN_CENTER,
	RPT_HALIGN_RIGHT,
	RPT_HALIGN_JUSTIFIED
} eRptHAlign;


enum eRptVAlign

typedef enum
{
	RPT_VALIGN_TOP,
	RPT_VALIGN_CENTER,
	RPT_VALIGN_BOTTOM
} eRptVAlign;


RptAlign

typedef struct {
	eRptHAlign h_align;
	eRptVAlign v_align;
} RptAlign;


RptStroke

typedef struct {
	gdouble width;
	RptColor *color;
	GArray *style;
} RptStroke;

gdouble width;
RptColor *color; an RptColor
GArray *style; a GArray of gdouble values representing dashes sequence

rpt_common_get_position ()

RptPoint*           rpt_common_get_position             (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptPoint struct that represent the object's position specified on xnode.

rpt_common_set_position ()

void                rpt_common_set_position             (xmlNode *xnode,
                                                         const RptPoint *position);

xnode : an xmlNode.
position :

rpt_common_get_size ()

RptSize*            rpt_common_get_size                 (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptSize struct that represent the object's size specified on xnode.

rpt_common_set_size ()

void                rpt_common_set_size                 (xmlNode *xnode,
                                                         const RptSize *size);

xnode : an xmlNode.
size :

rpt_common_get_rotation ()

RptRotation*        rpt_common_get_rotation             (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptRotation struct that represent the object's rotation specified on xnode.

rpt_common_set_rotation ()

void                rpt_common_set_rotation             (xmlNode *xnode,
                                                         const RptRotation *rotation);

xnode : an xmlNode.
rotation :

rpt_common_get_font ()

RptFont*            rpt_common_get_font                 (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptFont struct that represent the object's font specified on xnode.

rpt_common_set_font ()

void                rpt_common_set_font                 (xmlNode *xnode,
                                                         const RptFont *font);

xnode : an xmlNode.
font :

rpt_common_get_border ()

RptBorder*          rpt_common_get_border               (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptBorder struct that represent the object's border specified on xnode.

rpt_common_set_border ()

void                rpt_common_set_border               (xmlNode *xnode,
                                                         const RptBorder *border);

xnode : an xmlNode.
border :

rpt_common_get_align ()

RptAlign*           rpt_common_get_align                (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptAlign struct that represent the object's alignment specified on xnode.

rpt_common_set_align ()

void                rpt_common_set_align                (xmlNode *xnode,
                                                         const RptAlign *align);

xnode : an xmlNode.
align :

rpt_common_get_stroke ()

RptStroke*          rpt_common_get_stroke               (xmlNode *xnode);

xnode : an xmlNode.
Returns : an RptStroke struct that represent the object's stroke specified on xnode.

rpt_common_set_stroke ()

void                rpt_common_set_stroke               (xmlNode *xnode,
                                                         const RptStroke *stroke);

xnode : an xmlNode.
stroke :

rpt_common_parse_color ()

RptColor*           rpt_common_parse_color              (const gchar *str_color);

str_color : a color string.
Returns : an RptColor.

rpt_common_rptcolor_to_string ()

gchar*              rpt_common_rptcolor_to_string       (const RptColor *color);

Converts an RptColor value to a string.

color : an RptColor value.
Returns : the color string correspondent to color.

rpt_common_style_to_array ()

gdouble*            rpt_common_style_to_array           (const GArray *style);

style :
Returns :