Paper Definitions

Paper Definitions — Paper size definitions

Synopsis


#include <libglabels/paper.h>


            glPaper;
void        gl_paper_init                   (void);
glPaper*    gl_paper_new                    (gchar *id,
                                             gchar *name,
                                             gdouble width,
                                             gdouble height);
glPaper*    gl_paper_dup                    (const glPaper *orig);
void        gl_paper_free                   (glPaper *paper);
GList*      gl_paper_get_id_list            (void);
void        gl_paper_free_id_list           (GList *ids);
GList*      gl_paper_get_name_list          (void);
void        gl_paper_free_name_list         (GList *names);
gboolean    gl_paper_is_id_known            (const gchar *id);
gboolean    gl_paper_is_id_other            (const gchar *id);
glPaper*    gl_paper_from_id                (const gchar *id);
glPaper*    gl_paper_from_name              (const gchar *name);
gchar*      gl_paper_lookup_id_from_name    (const gchar *name);
gchar*      gl_paper_lookup_name_from_id    (const gchar *id);
void        gl_paper_print_known_papers     (void);

Description

This section describes a structure for representing a paper size definition and related functions.

Details

glPaper

typedef struct {
	gchar               *id;     /* Unique ID of paper definition */
	gchar               *name;   /* Localized name of paper */
	gdouble              width;  /* Width (in points) */
	gdouble              height; /* Height (in points) */
} glPaper;


gl_paper_init ()

void        gl_paper_init                   (void);

Initialize libglabels paper module by reading all paper definition files located in system and user template directories.


gl_paper_new ()

glPaper*    gl_paper_new                    (gchar *id,
                                             gchar *name,
                                             gdouble width,
                                             gdouble height);

Allocates and constructs a new glPaper structure.

id : Id of paper definition. (E.g. US-Letter, A4, etc.) Should be unique.
name : Localized name of paper.
width : Width of paper in points.
height : Height of paper in points.
Returns : a pointer to a newly allocated glPaper structure.

gl_paper_dup ()

glPaper*    gl_paper_dup                    (const glPaper *orig);

Duplicates an existing glPaper structure.

orig : glPaper structure to be duplicated.
Returns : a pointer to a newly allocated glPaper structure.

gl_paper_free ()

void        gl_paper_free                   (glPaper *paper);

Free all memory associated with an existing glPaper structure.

paper : pointer to glPaper structure to be freed.

gl_paper_get_id_list ()

GList*      gl_paper_get_id_list            (void);

Get a list of all paper ids known to libglabels.

Returns : a list of paper ids.

gl_paper_free_id_list ()

void        gl_paper_free_id_list           (GList *ids);

Free up all storage associated with an id list obtained with gl_paper_get_id_list().

ids : List of id strings to be freed.

gl_paper_get_name_list ()

GList*      gl_paper_get_name_list          (void);

Get a list of all localized paper names known to libglabels.

Returns : a list of localized paper names.

gl_paper_free_name_list ()

void        gl_paper_free_name_list         (GList *names);

Free up all storage associated with a name list obtained with gl_paper_get_name_list().

names : List of localized paper name strings to be freed.

gl_paper_is_id_known ()

gboolean    gl_paper_is_id_known            (const gchar *id);

Determine if given paper id is known to libglabels.

id : paper id to test
Returns : TRUE if id is known, otherwise FALSE.

gl_paper_is_id_other ()

gboolean    gl_paper_is_id_other            (const gchar *id);

Determine if given paper id is the special id "Other."

id : paper id to test
Returns : TRUE if id is "Other", otherwise FALSE.

gl_paper_from_id ()

glPaper*    gl_paper_from_id                (const gchar *id);

Lookup paper definition from id string.

id : paper id string
Returns : pointer to a newly allocated glPaper structure.

gl_paper_from_name ()

glPaper*    gl_paper_from_name              (const gchar *name);

Lookup paper definition from localized paper name string.

name : localized paper name string
Returns : pointer to a newly allocated glPaper structure.

gl_paper_lookup_id_from_name ()

gchar*      gl_paper_lookup_id_from_name    (const gchar *name);

Lookup paper name string from localized paper name string.

name : localized paper name stringp
Returns : pointer to a newly allocated id string.

gl_paper_lookup_name_from_id ()

gchar*      gl_paper_lookup_name_from_id    (const gchar *id);

Lookup localized paper name string from paper id string.

id : paper id string
Returns : pointer to a newly allocated localized paper name string.

gl_paper_print_known_papers ()

void        gl_paper_print_known_papers     (void);

For debugging purposes: print a list of all paper definitions known to libglabels.