![]() | ![]() | ![]() | LibGlabels Reference Manual | ![]() |
---|
Paper DefinitionsPaper Definitions — Paper size definitions |
#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);
This section describes a structure for representing a paper size definition and related functions.
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;
void gl_paper_init (void);
Initialize libglabels paper module by reading all paper definition files located in system and user template directories.
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. |
glPaper* gl_paper_dup (const glPaper *orig);
Duplicates an existing glPaper structure.
void gl_paper_free (glPaper *paper);
Free all memory associated with an existing glPaper structure.
paper : | pointer to glPaper structure to be freed. |
GList* gl_paper_get_id_list (void);
Get a list of all paper ids known to libglabels.
Returns : | a list of paper ids. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
<< Basic Enumerations | template >> |