# gnome-print-config

## Name

gnome-print-config --

## Synopsis

    struct      GnomePrintConfig;
    GnomePrintConfig* gnome_print_config_default
                                                (void);
    GnomePrintConfig* gnome_print_config_ref    (GnomePrintConfig *config);
    GnomePrintConfig* gnome_print_config_unref  (GnomePrintConfig *config);
    GnomePrintConfig* gnome_print_config_dup    (GnomePrintConfig *config);
    guchar*     gnome_print_config_get          (GnomePrintConfig *config,
                                                 const guchar *key);
    gboolean    gnome_print_config_set          (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 const guchar *value);
    gboolean    gnome_print_config_get_boolean  (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gboolean *val);
    gboolean    gnome_print_config_get_int      (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gint *val);
    gboolean    gnome_print_config_get_double   (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gdouble *val);
    gboolean    gnome_print_config_get_length   (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gdouble *val,
                                                 const GnomePrintUnit **unit);
    gboolean    gnome_print_config_set_boolean  (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gboolean val);
    gboolean    gnome_print_config_set_int      (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gint val);
    gboolean    gnome_print_config_set_double   (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gdouble val);
    gboolean    gnome_print_config_set_length   (GnomePrintConfig *config,
                                                 const guchar *key,
                                                 gdouble val,
                                                 const GnomePrintUnit *unit);
    void        gnome_print_config_dump         (GnomePrintConfig *gpc);
    #define     GNOME_PRINT_KEY_PAPER_SIZE
    #define     GNOME_PRINT_KEY_PAPER_WIDTH
    #define     GNOME_PRINT_KEY_PAPER_HEIGHT
    #define     GNOME_PRINT_KEY_PAPER_ORIENTATION
    #define     GNOME_PRINT_KEY_PAPER_ORIENTATION_MATRIX
    #define     GNOME_PRINT_KEY_PAGE_ORIENTATION
    #define     GNOME_PRINT_KEY_PAGE_ORIENTATION_MATRIX
    #define     GNOME_PRINT_KEY_ORIENTATION
    #define     GNOME_PRINT_KEY_LAYOUT
    #define     GNOME_PRINT_KEY_LAYOUT_WIDTH
    #define     GNOME_PRINT_KEY_LAYOUT_HEIGHT
    #define     GNOME_PRINT_KEY_RESOLUTION
    #define     GNOME_PRINT_KEY_RESOLUTION_DPI
    #define     GNOME_PRINT_KEY_RESOLUTION_DPI_X
    #define     GNOME_PRINT_KEY_RESOLUTION_DPI_Y
    #define     GNOME_PRINT_KEY_NUM_COPIES
    #define     GNOME_PRINT_KEY_COLLATE
    #define     GNOME_PRINT_KEY_PAGE_MARGIN_LEFT
    #define     GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT
    #define     GNOME_PRINT_KEY_PAGE_MARGIN_TOP
    #define     GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM
    #define     GNOME_PRINT_KEY_PAPER_MARGIN_LEFT
    #define     GNOME_PRINT_KEY_PAPER_MARGIN_RIGHT
    #define     GNOME_PRINT_KEY_PAPER_MARGIN_TOP
    #define     GNOME_PRINT_KEY_PAPER_MARGIN_BOTTOM
    #define     GNOME_PRINT_KEY_OUTPUT_FILENAME
    #define     GNOME_PRINT_KEY_DOCUMENT_NAME
    #define     GNOME_PRINT_KEY_PREFERED_UNIT

## Description

## Details

### >struct GnomePrintConfig

    struct GnomePrintConfig;

### >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.

`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.

`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.

`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.

`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`.

`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`.

`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`.

`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`.

`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.

`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.

`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.

`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.

`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.

`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.

`gpc` : | The GnomePrintConfig to output

### >GNOME_PRINT_KEY_PAPER_SIZE

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

Convenience macro for key that contains the paper size, eg: A4, Letter.

### >GNOME_PRINT_KEY_PAPER_WIDTH

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

Convenience macro for key that contains the width of the paper. Units are arbitrary so use gnome_print_config_get_length and gnome_print_set_length.

### >GNOME_PRINT_KEY_PAPER_HEIGHT

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

Convenience macro for key that contains the height of the paper. Units are arbitrary so use gnome_print_config_get_length and gnome_print_set_length.

### >GNOME_PRINT_KEY_PAPER_ORIENTATION

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

Convenience macro for key that contains the orientation of the paper in terms of degrees of rotation, eg: R0, R90, R180, and 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 */

Convenience macro for the key that contains the orientation of the logical page in terms of degrees of rotation, eg: R0, R90, R180, and 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

See 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) */

Convenience macro for key that contains the name for the logical layout being used, eg: Plain.

### >GNOME_PRINT_KEY_LAYOUT_WIDTH

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

Convenience macro for key that contains the logical width of the page as used by the application.

### >GNOME_PRINT_KEY_LAYOUT_HEIGHT

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

Convenience macro for key that contains the logical height of the page as used by the application.

### >GNOME_PRINT_KEY_RESOLUTION

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

Convenience macro for key that contains a string representing the resolution of the printer, eg: 300x300 or 300dpi.

### >GNOME_PRINT_KEY_RESOLUTION_DPI

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

Convenience macro for key that contains a numeric representation of the resolution, eg: 300.

### >GNOME_PRINT_KEY_RESOLUTION_DPI_X

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

Convenience macro for key that contains a numeric representation of the X resolution, eg: 300.

### >GNOME_PRINT_KEY_RESOLUTION_DPI_Y

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

Convenience macro for key that contains a numeric representation of the Y resolution, eg: 300.

### >GNOME_PRINT_KEY_NUM_COPIES

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

Convenience macro for key that contains the number of copies to output.

### >GNOME_PRINT_KEY_COLLATE

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

Convenience macro for key that contains a boolean value indicating whether to collate the copies as they are output.

### >GNOME_PRINT_KEY_PAGE_MARGIN_LEFT

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAGE_MARGIN_TOP

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAPER_MARGIN_LEFT

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAPER_MARGIN_RIGHT

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAPER_MARGIN_TOP

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_PAPER_MARGIN_BOTTOM

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

Ignored by libgnomeprint, but used by libgnomeprintui when populating margin symbols.

### >GNOME_PRINT_KEY_OUTPUT_FILENAME

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

Convenience macro for the key that contains the name of the file being used when printing to a 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' */

Convenience macro for the key that contains the name of the document being printed.

### >GNOME_PRINT_KEY_PREFERED_UNIT

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

Convenience macro for the key that contains the abbreviation for the units used, eg: cm, in.