gnome-print-unit

Name

gnome-print-unit -- 

Synopsis



struct      GnomePrintUnit;
enum        GnomePrintUnitBase;
#define     GNOME_PRINT_PS_UNIT
#define     GNOME_PRINT_UNITS_ALL
const GnomePrintUnit* gnome_print_unit_get_identity
                                            (guint base);
const GnomePrintUnit* gnome_print_unit_get_default
                                            (void);
const GnomePrintUnit* gnome_print_unit_get_by_name
                                            (const guchar *name);
const GnomePrintUnit* gnome_print_unit_get_by_abbreviation
                                            (const guchar *abbreviation);
GList*      gnome_print_unit_get_list       (guint bases);
void        gnome_print_unit_free_list      (GList *units);
gboolean    gnome_print_convert_distance    (gdouble *distance,
                                             const GnomePrintUnit *from,
                                             const GnomePrintUnit *to);
gboolean    gnome_print_convert_distance_full
                                            (gdouble *distance,
                                             const GnomePrintUnit *from,
                                             const GnomePrintUnit *to,
                                             gdouble ctmscale,
                                             gdouble devicescale);

Description

Details

struct GnomePrintUnit

struct GnomePrintUnit {

	guint version : 8; /* Has to be 0 at moment */
	guint base : 8; /* Base */
	gdouble unittobase;
	/* I am not absolutely sure, but seems that gettext can do the magic */
	guchar *name;
	guchar *abbr;
	guchar *plural;
	guchar *abbr_plural;
};


enum GnomePrintUnitBase

typedef enum {
	GNOME_PRINT_UNIT_DIMENSIONLESS = (1 << 0), /* For percentages and like */
	GNOME_PRINT_UNIT_ABSOLUTE = (1 << 1),      /* Real world distances - i.e. mm, cm... */
	GNOME_PRINT_UNIT_DEVICE = (1 << 2),        /* Semi-real device-dependent distances i.e. pixels */
	GNOME_PRINT_UNIT_USERSPACE = (1 << 3)      /* Mathematical coordinates */
} GnomePrintUnitBase;


GNOME_PRINT_PS_UNIT

#define GNOME_PRINT_PS_UNIT   (gnome_print_unit_get_identity (GNOME_PRINT_UNIT_ABSOLUTE))


GNOME_PRINT_UNITS_ALL

#define GNOME_PRINT_UNITS_ALL (GNOME_PRINT_UNIT_DIMENSIONLESS | GNOME_PRINT_UNIT_ABSOLUTE | GNOME_PRINT_UNIT_DEVICE | GNOME_PRINT_UNIT_USERSPACE)


gnome_print_unit_get_identity ()

const GnomePrintUnit* gnome_print_unit_get_identity
                                            (guint base);

base :

Returns :


gnome_print_unit_get_default ()

const GnomePrintUnit* gnome_print_unit_get_default
                                            (void);

Returns :


gnome_print_unit_get_by_name ()

const GnomePrintUnit* gnome_print_unit_get_by_name
                                            (const guchar *name);

name :

Returns :


gnome_print_unit_get_by_abbreviation ()

const GnomePrintUnit* gnome_print_unit_get_by_abbreviation
                                            (const guchar *abbreviation);

get a unit based on its abbreviation like "cm" "pts" or "in".

abbreviation :

an ascii string poiting to the abbreviation

Returns :

a constant pointer to a GnomePrintUnit, NULL on error


gnome_print_unit_get_list ()

GList*      gnome_print_unit_get_list       (guint bases);

bases :

Returns :


gnome_print_unit_free_list ()

void        gnome_print_unit_free_list      (GList *units);

units :


gnome_print_convert_distance ()

gboolean    gnome_print_convert_distance    (gdouble *distance,
                                             const GnomePrintUnit *from,
                                             const GnomePrintUnit *to);

Check wether a conversion between from and to can be made

distance :

from :

to :

Returns :

TRUE if the conversion is possible, FALSE if it is not or on error


gnome_print_convert_distance_full ()

gboolean    gnome_print_convert_distance_full
                                            (gdouble *distance,
                                             const GnomePrintUnit *from,
                                             const GnomePrintUnit *to,
                                             gdouble ctmscale,
                                             gdouble devicescale);

ctmscale is userspace->absolute, devicescale is device->absolute

distance :

from :

to :

ctmscale :

devicescale :

Returns :