gnome-print-config

gnome-print-config

Functions

Types and Values

Description

Functions

gnome_print_config_default ()

GnomePrintConfig *
gnome_print_config_default (void);

Creates a GnomePrintConfig object with the default printer and settings.

Returns

A pointer to a GnomePrintConfig object with the default settings


gnome_print_config_ref ()

GnomePrintConfig *
gnome_print_config_ref (GnomePrintConfig *config);

Increase the reference count on the GnomePrintConfig object by one.

Parameters

config

The GnomePrintConfig object to have its reference count increased

 

Returns

A pointer to the GnomePrintConfig object or NULL on failure


gnome_print_config_unref ()

GnomePrintConfig *
gnome_print_config_unref (GnomePrintConfig *config);

Decrease the reference count on the GnomePrintConfig object by one.

Parameters

config

The GnomePrintConfig object to have its reference count decreased

 

Returns

A pointer to the GnomePrintConfig object or NULL on failure.


gnome_print_config_dup ()

GnomePrintConfig *
gnome_print_config_dup (GnomePrintConfig *config);

Does a deep copy of the config config . You should unref the returned GnomePrintConfig using gnome_print_config_unref when you are finished using it.

Parameters

config

The config to be copied

 

Returns

A copy of config


gnome_print_config_get ()

guchar *
gnome_print_config_get (GnomePrintConfig *config,
                        const guchar *key);

Gets the value of string key from the GnomePrintConfig object. The returned string should be freed with g_free when you are finished with it.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be obtained

 

Returns

The value of the key, NULL indicates failure.


gnome_print_config_set ()

gboolean
gnome_print_config_set (GnomePrintConfig *config,
                        const guchar *key,
                        const guchar *value);

Sets the value of string key in the GnomePrintConfig object to value value .

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be set

 

value

String containing the value to set

 

Returns

TRUE on success, FALSE on failure


gnome_print_config_get_boolean ()

gboolean
gnome_print_config_get_boolean (GnomePrintConfig *config,
                                const guchar *key,
                                gboolean *val);

Gets the value of key key from the GnomePrintConfig object. Converts values such as "true", "y", "yes", and their opposites, to their boolean equivalent. The boolean value will be stored in the variable val .

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be obtained

 

val

Pointer to a boolean variable to store the value in. Should initially be NULL

 

Returns

TRUE if a value was retrieved, FALSE on failure


gnome_print_config_get_int ()

gboolean
gnome_print_config_get_int (GnomePrintConfig *config,
                            const guchar *key,
                            gint *val);

Gets the value of key key from the GnomePrintConfig object. Converts values to their integer equivalent. The integer value will be stored in the variable val .

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be obtained

 

val

Pointer to a integer variable to store the value in. Should initially be NULL

 

Returns

TRUE if a value was retrieved, FALSE on failure


gnome_print_config_get_double ()

gboolean
gnome_print_config_get_double (GnomePrintConfig *config,
                               const guchar *key,
                               gdouble *val);

Gets the value of key key from the GnomePrintConfig object. Converts values to their double equivalent. The double value will be stored in the variable val .

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be obtained

 

val

Pointer to a double variable to store the value in. Should initially be NULL

 

Returns

TRUE if a value was retrieved, FALSE on failure


gnome_print_config_get_length ()

gboolean
gnome_print_config_get_length (GnomePrintConfig *config,
                               const guchar *key,
                               gdouble *val,
                               const GnomePrintUnit **unit);

Gets the value of key key from the GnomePrintConfig object. Converts values to their double equivalent. The double value will be stored in the variable val and the units will be stored in unit . You should allocate the storage for unit before calling this function.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be obtained

 

val

Pointer to a double variable to store the value in. Should initially be NULL

 

unit

Pointer to an already allocated GnomePrintUnit struct

 

Returns

TRUE if a value was retrieved, FALSE on failure


gnome_print_config_set_boolean ()

gboolean
gnome_print_config_set_boolean (GnomePrintConfig *config,
                                const guchar *key,
                                gboolean val);

Set a boolean value in the GnomePrintConfig object.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be set

 

val

Boolean containing the value to set

 

Returns

TRUE on success, FALSE on failure


gnome_print_config_set_int ()

gboolean
gnome_print_config_set_int (GnomePrintConfig *config,
                            const guchar *key,
                            gint val);

Set an integer value in the GnomePrintConfig object.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be set

 

val

Integer containing the value to set

 

Returns

TRUE on success, FALSE on failure


gnome_print_config_set_double ()

gboolean
gnome_print_config_set_double (GnomePrintConfig *config,
                               const guchar *key,
                               gdouble val);

Set a double value in the GnomePrintConfig object.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be set

 

val

Double containing the value to set

 

Returns

TRUE on success, FALSE on failure


gnome_print_config_set_length ()

gboolean
gnome_print_config_set_length (GnomePrintConfig *config,
                               const guchar *key,
                               gdouble val,
                               const GnomePrintUnit *unit);

Sets a double value and the units it is using. This should be used in conjunction with gnome_print_config_get_length.

Parameters

config

Pointer to a GnomePrintConfig object

 

key

String containing the path of key whose value is to be set

 

val

Double containing the value to set

 

unit

Units to use when setting value

 

Returns

TRUE on success, FALSE on failure


gnome_print_config_dump ()

void
gnome_print_config_dump (GnomePrintConfig *gpc);

Print out the tree structure representing the GnomePrintConfig. Output is to STDOUT and is limited to a depth of 20.

Parameters

gpc

The GnomePrintConfig to output

 

Types and Values

GnomePrintConfig

typedef struct _GnomePrintConfig GnomePrintConfig;

GNOME_PRINT_KEY_PAPER_SIZE

#define GNOME_PRINT_KEY_PAPER_SIZE               "Settings.Output.Media.PhysicalSize" /* Paper name, such as A4 or Letter */

GNOME_PRINT_KEY_PAPER_WIDTH

#define GNOME_PRINT_KEY_PAPER_WIDTH              "Settings.Output.Media.PhysicalSize.Width" /* Arbitrary units - use conversion */

GNOME_PRINT_KEY_PAPER_HEIGHT

#define GNOME_PRINT_KEY_PAPER_HEIGHT             "Settings.Output.Media.PhysicalSize.Height" /* Arbitrary units - use conversion */

GNOME_PRINT_KEY_PAPER_ORIENTATION

#define GNOME_PRINT_KEY_PAPER_ORIENTATION        "Settings.Output.Media.PhysicalOrientation" /* R0, R90, R180, R270 */

GNOME_PRINT_KEY_PAPER_ORIENTATION_MATRIX

#define GNOME_PRINT_KEY_PAPER_ORIENTATION_MATRIX "Settings.Output.Media.PhysicalOrientation.Paper2PrinterTransform" /* 3x2 abstract matrix */

GNOME_PRINT_KEY_PAGE_ORIENTATION

#define GNOME_PRINT_KEY_PAGE_ORIENTATION        "Settings.Document.Page.LogicalOrientation" /* R0, R90, R180, R270 */

GNOME_PRINT_KEY_PAGE_ORIENTATION_MATRIX

#define GNOME_PRINT_KEY_PAGE_ORIENTATION_MATRIX "Settings.Document.Page.LogicalOrientation.Page2LayoutTransform" /* 3x2 abstract matrix */

GNOME_PRINT_KEY_ORIENTATION

#define GNOME_PRINT_KEY_ORIENTATION GNOME_PRINT_KEY_PAGE_ORIENTATION

GNOME_PRINT_KEY_LAYOUT

#define GNOME_PRINT_KEY_LAYOUT        "Settings.Document.Page.Layout"        /* Id of layout ('Plain' is always no-special-layout) */

GNOME_PRINT_KEY_LAYOUT_WIDTH

#define GNOME_PRINT_KEY_LAYOUT_WIDTH  "Settings.Document.Page.Layout.Width"  /* Double value */

GNOME_PRINT_KEY_LAYOUT_HEIGHT

#define GNOME_PRINT_KEY_LAYOUT_HEIGHT "Settings.Document.Page.Layout.Height" /* Double value */

GNOME_PRINT_KEY_RESOLUTION

#define GNOME_PRINT_KEY_RESOLUTION       "Settings.Output.Resolution"       /* String value, like 300x300 or 300dpi */

GNOME_PRINT_KEY_RESOLUTION_DPI

#define GNOME_PRINT_KEY_RESOLUTION_DPI   "Settings.Output.Resolution.DPI"   /* Numeric value, like 300, if meaningful */

GNOME_PRINT_KEY_RESOLUTION_DPI_X

#define GNOME_PRINT_KEY_RESOLUTION_DPI_X "Settings.Output.Resolution.DPI.X" /* Numeric value */

GNOME_PRINT_KEY_RESOLUTION_DPI_Y

#define GNOME_PRINT_KEY_RESOLUTION_DPI_Y "Settings.Output.Resolution.DPI.Y" /* Numeric value */

GNOME_PRINT_KEY_NUM_COPIES

#define GNOME_PRINT_KEY_NUM_COPIES "Settings.Output.Job.NumCopies" /* Number of copies */

GNOME_PRINT_KEY_COLLATE

#define GNOME_PRINT_KEY_COLLATE    "Settings.Output.Job.Collate"   /* Boolean (true|yes|1 false|no|0) */

GNOME_PRINT_KEY_PAGE_MARGIN_LEFT

#define GNOME_PRINT_KEY_PAGE_MARGIN_LEFT   "Settings.Document.Page.Margins.Left"   /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT

#define GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT  "Settings.Document.Page.Margins.Right"  /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAGE_MARGIN_TOP

#define GNOME_PRINT_KEY_PAGE_MARGIN_TOP    "Settings.Document.Page.Margins.Top"    /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM

#define GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM "Settings.Document.Page.Margins.Bottom" /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAPER_MARGIN_LEFT

#define GNOME_PRINT_KEY_PAPER_MARGIN_LEFT   "Settings.Output.Media.Margins.Left"   /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAPER_MARGIN_RIGHT

#define GNOME_PRINT_KEY_PAPER_MARGIN_RIGHT  "Settings.Output.Media.Margins.Right"  /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAPER_MARGIN_TOP

#define GNOME_PRINT_KEY_PAPER_MARGIN_TOP    "Settings.Output.Media.Margins.Top"    /* Length, i.e. use conversion */

GNOME_PRINT_KEY_PAPER_MARGIN_BOTTOM

#define GNOME_PRINT_KEY_PAPER_MARGIN_BOTTOM "Settings.Output.Media.Margins.Bottom" /* Length, i.e. use conversion */

GNOME_PRINT_KEY_OUTPUT_FILENAME

#define GNOME_PRINT_KEY_OUTPUT_FILENAME "Settings.Output.Job.FileName"          /* Filename used when printing to file. */

GNOME_PRINT_KEY_DOCUMENT_NAME

#define GNOME_PRINT_KEY_DOCUMENT_NAME   "Settings.Document.Name"                /* The name of the document 'Cash flow 2002', `Grandma cookie recipies' */

GNOME_PRINT_KEY_PREFERED_UNIT

#define GNOME_PRINT_KEY_PREFERED_UNIT   "Settings.Document.PreferedUnit"        /* Abbreviation for the preferred unit cm, in,... */