libgimpprint API Reference: print-vars.c File Reference

Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

# src/main/print-vars.c File Reference

`#include <math.h>`
`#include <string.h>`
`#include <gimp-print/gimp-print.h>`
`#include "gimp-print-internal.h"`
`#include <gimp-print/gimp-print-intl-internal.h>`
`#include "generic-options.h"`

Go to the source code of this file.

## Data Structures
struct | value_t
struct | stp_compdata
struct | stp_vars
## Defines
#define | DEF_STRING_FUNCS(s, pre)
#define | DEF_FUNCS(s, t, pre)
#define | CHECK_FUNCTION(type, index)
#define | GET_PARAMETER_ACTIVE_FUNCTION(type, index)
#define | SET_PARAMETER_ACTIVE_FUNCTION(type, index)
## Functions
void | null_vars (void)
void | check_vars (const stp_vars_t *v)
const char * | value_namefunc (const void *item)
void | value_freefunc (void *item)
stp_list_t * | create_vars_list (void)
void | copy_to_raw (stp_raw_t *raw, const void *data, size_t bytes)
value_t * | value_copy (const void *item)
stp_list_t * | copy_value_list (const stp_list_t *src)
const char * | compdata_namefunc (const void *item)
void | compdata_freefunc (void *item)
void * | compdata_copyfunc (const void *item)
void | stp_allocate_component_data (stp_vars_t *v, const char *name, stp_copy_data_func_t copyfunc, stp_free_data_func_t freefunc, void *data)
void | stp_destroy_component_data (stp_vars_t *v, const char *name)
void * | stp_get_component_data (const stp_vars_t *v, const char *name)
stp_list_t * | create_compdata_list (void)
stp_list_t * | copy_compdata_list (const stp_list_t *src)
void | initialize_standard_vars (void)
const stp_vars_t * | stp_default_settings (void)
| Get default global settings.
stp_vars_t * | stp_vars_create (void)
| Create a new vars object.
void | stp_vars_destroy (stp_vars_t *v)
| Destroy a vars object.
void | stp_set_verified (stp_vars_t *v, int val)
int | stp_get_verified (const stp_vars_t *v)
void | set_default_raw_parameter (stp_list_t *list, const char *parameter, const char *value, size_t bytes, int typ)
void | set_raw_parameter (stp_list_t *list, const char *parameter, const char *value, size_t bytes, int typ)
void | stp_set_string_parameter_n (stp_vars_t *v, const char *parameter, const char *value, size_t bytes)
| Set a string parameter.
void | stp_set_string_parameter (stp_vars_t *v, const char *parameter, const char *value)
| Set a string parameter.
void | stp_set_default_string_parameter_n (stp_vars_t *v, const char *parameter, const char *value, size_t bytes)
| Set a default string parameter.
void | stp_set_default_string_parameter (stp_vars_t *v, const char *parameter, const char *value)
| Set a default string parameter.
void | stp_clear_string_parameter (stp_vars_t *v, const char *parameter)
| Clear a string parameter.
const char * | stp_get_string_parameter (const stp_vars_t *v, const char *parameter)
| Get a string parameter.
void | stp_set_raw_parameter (stp_vars_t *v, const char *parameter, const void *value, size_t bytes)
| Set a raw parameter.
void | stp_set_default_raw_parameter (stp_vars_t *v, const char *parameter, const void *value, size_t bytes)
| Set a default raw parameter.
void | stp_clear_raw_parameter (stp_vars_t *v, const char *parameter)
| Clear a raw parameter.
const stp_raw_t * | stp_get_raw_parameter (const stp_vars_t *v, const char *parameter)
| Get a raw parameter.
void | stp_set_file_parameter (stp_vars_t *v, const char *parameter, const char *value)
| Set a file parameter.
void | stp_set_file_parameter_n (stp_vars_t *v, const char *parameter, const char *value, size_t byte_count)
| Set a file parameter.
void | stp_set_default_file_parameter (stp_vars_t *v, const char *parameter, const char *value)
| Set a default file parameter.
void | stp_set_default_file_parameter_n (stp_vars_t *v, const char *parameter, const char *value, size_t byte_count)
| Set a default file parameter.
void | stp_clear_file_parameter (stp_vars_t *v, const char *parameter)
| Clear a file parameter.
const char * | stp_get_file_parameter (const stp_vars_t *v, const char *parameter)
| Get a file parameter.
void | stp_set_curve_parameter (stp_vars_t *v, const char *parameter, const stp_curve_t *curve)
| Set a curve parameter.
void | stp_set_default_curve_parameter (stp_vars_t *v, const char *parameter, const stp_curve_t *curve)
| Set a default curve parameter.
void | stp_clear_curve_parameter (stp_vars_t *v, const char *parameter)
| Clear a curve parameter.
const stp_curve_t * | stp_get_curve_parameter (const stp_vars_t *v, const char *parameter)
| Get a curve parameter.
void | stp_set_array_parameter (stp_vars_t *v, const char *parameter, const stp_array_t *array)
| Set an array parameter.
void | stp_set_default_array_parameter (stp_vars_t *v, const char *parameter, const stp_array_t *array)
| Set a default array parameter.
void | stp_clear_array_parameter (stp_vars_t *v, const char *parameter)
| Clear an array parameter.
const stp_array_t * | stp_get_array_parameter (const stp_vars_t *v, const char *parameter)
| Get an array parameter.
void | stp_set_int_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set an integer parameter.
void | stp_set_default_int_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set a default integer parameter.
void | stp_clear_int_parameter (stp_vars_t *v, const char *parameter)
| Clear (remove) an integer parameter.
int | stp_get_int_parameter (const stp_vars_t *v, const char *parameter)
| Get an integer parameter.
void | stp_set_boolean_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set a boolean parameter.
void | stp_set_default_boolean_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set a default boolean parameter.
void | stp_clear_boolean_parameter (stp_vars_t *v, const char *parameter)
| Clear (remove) a boolean parameter.
int | stp_get_boolean_parameter (const stp_vars_t *v, const char *parameter)
| Get a boolean parameter.
void | stp_set_dimension_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set a dimension parameter.
void | stp_set_default_dimension_parameter (stp_vars_t *v, const char *parameter, int ival)
| Set a default dimension parameter.
void | stp_clear_dimension_parameter (stp_vars_t *v, const char *parameter)
| Clear (remove) a dimension parameter.
int | stp_get_dimension_parameter (const stp_vars_t *v, const char *parameter)
| Get a dimension parameter.
void | stp_set_float_parameter (stp_vars_t *v, const char *parameter, double dval)
| Set a float parameter.
void | stp_set_default_float_parameter (stp_vars_t *v, const char *parameter, double dval)
| Set a default float parameter.
void | stp_clear_float_parameter (stp_vars_t *v, const char *parameter)
| Clear (remove) a float parameter.
double | stp_get_float_parameter (const stp_vars_t *v, const char *parameter)
| Get a float parameter.
void | stp_scale_float_parameter (stp_vars_t *v, const char *parameter, double scale)
| Multiply the value of a float parameter by a scaling factor.
int | check_parameter_generic (const stp_vars_t *v, stp_parameter_type_t p_type, const char *parameter, stp_parameter_activity_t active)
stp_parameter_activity_t | get_parameter_active_generic (const stp_vars_t *v, stp_parameter_type_t p_type, const char *parameter)
void | set_parameter_active_generic (const stp_vars_t *v, stp_parameter_type_t p_type, const char *parameter, stp_parameter_activity_t active)
void | stp_fill_parameter_settings (stp_parameter_t *desc, const stp_parameter_t *param)
void | stp_vars_copy (stp_vars_t *vd, const stp_vars_t *vs)
| Copy a vars object.
void | stp_prune_inactive_options (stp_vars_t *v)
stp_vars_t * | stp_vars_create_copy (const stp_vars_t *vs)
| Copy and allocate a vars object.
const char * | param_namefunc (const void *item)
const char * | param_longnamefunc (const void *item)
stp_parameter_list_t | stp_parameter_list_create (void)
| Create a parameter_list.
void | stp_parameter_list_add_param (stp_parameter_list_t list, const stp_parameter_t *item)
| Add a parameter to a parameter_list.
void | stp_describe_parameter (const stp_vars_t *v, const char *name, stp_parameter_t *description)
| Describe a parameter in detail.
void | stp_parameter_description_destroy (stp_parameter_t *desc)
| Destroy a parameter description.
const stp_parameter_t * | stp_parameter_find_in_settings (const stp_vars_t *v, const char *name)
| Find a parameter by its name from a vars object.
size_t | stp_parameter_list_count (stp_const_parameter_list_t list)
| List the number of available parameters for the currently chosen settings.
const stp_parameter_t * | stp_parameter_find (stp_const_parameter_list_t list, const char *name)
| Find a parameter by its name.
const stp_parameter_t * | stp_parameter_list_param (stp_const_parameter_list_t list, size_t item)
| Find a parameter by its index number.
void | stp_parameter_list_destroy (stp_parameter_list_t list)
| Destroy a parameter_list.
stp_parameter_list_t | stp_parameter_list_copy (stp_const_parameter_list_t list)
| Copy and allocate a parameter_list.
void | stp_parameter_list_append (stp_parameter_list_t list, stp_const_parameter_list_t append)
| Append one parameter_list to another.
## Variables
int | standard_vars_initialized = 0
stp_vars_t | default_vars

## Define Documentation

#define CHECK_FUNCTION | ( | type,
|  | index |  | ) |

| Value:
    int                                                                     \
    stp_check_##type##_parameter(const stp_vars_t *v, const char *parameter,        \
                                 stp_parameter_activity_t active)           \
    {                                                                       \
      return check_parameter_generic(v, index, parameter, active);          \
    }
Definition at line 1179 of file print-vars.c.

#define DEF_FUNCS | ( | s,
|  | t,
|  | pre |  | ) |

| Value:
    void                                                    \
    pre##_set_##s(stp_vars_t *v, t val)                     \
    {                                                       \
      check_vars(v);                                        \
      v->verified = 0;                                      \
      v->s = val;                                           \
    }                                                       \
                                                            \
    t                                                       \
    pre##_get_##s(const stp_vars_t *v)                      \
    {                                                       \
      check_vars(v);                                        \
      return v->s;                                          \
    }
Definition at line 376 of file print-vars.c.

#define DEF_STRING_FUNCS | ( | s,
|  | pre |  | ) |

| Definition at line 342 of file print-vars.c.

#define GET_PARAMETER_ACTIVE_FUNCTION | ( | type,
|  | index |  | ) |

| Value:
    stp_parameter_activity_t                                                     \
    stp_get_##type##_parameter_active(const stp_vars_t *v, const char *parameter) \
    {                                                                            \
      return get_parameter_active_generic(v, index, parameter);                  \
    }
Definition at line 1209 of file print-vars.c.

#define SET_PARAMETER_ACTIVE_FUNCTION | ( | type,
|  | index |  | ) |

| Value:
    void                                                                         \
    stp_set_##type##_parameter_active(const stp_vars_t *v, const char *parameter, \
                                      stp_parameter_activity_t active)           \
    {                                                                            \
      set_parameter_active_generic(v, index, parameter, active);                 \
    }
Definition at line 1238 of file print-vars.c.

## Function Documentation

int check_parameter_generic | ( | const stp_vars_t * | v,
|  | stp_parameter_type_t | p_type,
|  | const char * | parameter,
|  | stp_parameter_activity_t | active
| ) | `[static]`

| Definition at line 1167 of file print-vars.c. References stp_vars::params, stp_list_get_item_by_name(), stp_list_item_get_data(), stp_list_item_t, stp_list_t, and stp_vars_t.

void check_vars | ( | const stp_vars_t * | v | ) | `[inline, static]`

| Definition at line 97 of file print-vars.c. References null_vars(), and stp_vars_t. Referenced by stp_allocate_component_data(), stp_destroy_component_data(), stp_get_component_data(), stp_get_verified(), stp_set_verified(), and stp_vars_destroy().

void* compdata_copyfunc | ( | const void * | item | ) | `[static]`

| Definition at line 220 of file print-vars.c. References compdata_t, stp_compdata::copyfunc, and stp_compdata::data. Referenced by copy_compdata_list().

void compdata_freefunc | ( | void * | item | ) | `[static]`

| Definition at line 210 of file print-vars.c. References compdata_t, stp_compdata::data, stp_compdata::freefunc, stp_compdata::name, and stp_free(). Referenced by create_compdata_list().

const char* compdata_namefunc | ( | const void * | item | ) | `[static]`

| Definition at line 203 of file print-vars.c. References compdata_t, and stp_compdata::name. Referenced by create_compdata_list().

stp_list_t* copy_compdata_list | ( | const stp_list_t * | src | ) | `[static]`

| Definition at line 282 of file print-vars.c. References compdata_copyfunc(), create_compdata_list(), stp_list_get_start(), stp_list_item_create(), stp_list_item_next(), stp_list_item_t, and stp_list_t. Referenced by stp_vars_copy().

void copy_to_raw | ( | stp_raw_t * | raw,
|  | const void * | data,
|  | size_t | bytes
| ) | `[static]`

| Definition at line 145 of file print-vars.c. References stp_raw_t::bytes, stp_raw_t::data, and stp_malloc(). Referenced by set_default_raw_parameter(), set_raw_parameter(), and value_copy().

stp_list_t* copy_value_list | ( | const stp_list_t * | src | ) | `[static]`

| Definition at line 190 of file print-vars.c. References create_vars_list(), stp_list_get_start(), stp_list_item_create(), stp_list_item_get_data(), stp_list_item_next(), stp_list_item_t, stp_list_t, and value_copy(). Referenced by stp_vars_copy().

stp_list_t* create_compdata_list | ( | void |  | ) | `[static]`

| Definition at line 273 of file print-vars.c. References compdata_freefunc(), compdata_namefunc(), stp_list_create(), stp_list_set_freefunc(), stp_list_set_namefunc(), and stp_list_t. Referenced by copy_compdata_list(), initialize_standard_vars(), and stp_vars_create().

stp_list_t* create_vars_list | ( | void |  | ) | `[static]`

| Definition at line 136 of file print-vars.c. References stp_list_create(), stp_list_set_freefunc(), stp_list_set_namefunc(), stp_list_t, value_freefunc(), and value_namefunc(). Referenced by copy_value_list(), initialize_standard_vars(), and stp_vars_create().

stp_parameter_activity_t get_parameter_active_generic | ( | const stp_vars_t * | v,
|  | stp_parameter_type_t | p_type,
|  | const char * | parameter
| ) | `[static]`

| Definition at line 1198 of file print-vars.c. References stp_vars::params, stp_list_get_item_by_name(), stp_list_item_get_data(), stp_list_item_t, stp_list_t, and stp_vars_t.

void initialize_standard_vars | ( | void |  | ) | `[static]`

| Definition at line 295 of file print-vars.c. References stp_vars::color_conversion, create_compdata_list(), create_vars_list(), default_vars, stp_vars::driver, stp_vars::internal_data, stp_vars::params, standard_vars_initialized, STP_PARAMETER_TYPE_INVALID, and stp_strdup(). Referenced by stp_default_settings(), and stp_vars_create().

void null_vars | ( | void |  | ) | `[static]`

| Definition at line 90 of file print-vars.c. References stp_abort(), and stp_erprintf(). Referenced by check_vars().

const char* param_longnamefunc | ( | const void * | item | ) | `[static]`

| Definition at line 1345 of file print-vars.c. References stp_parameter_t::text. Referenced by stp_parameter_list_create().

const char* param_namefunc | ( | const void * | item | ) | `[static]`

| Definition at line 1338 of file print-vars.c. References stp_parameter_t::name. Referenced by stp_parameter_list_create().

void set_default_raw_parameter | ( | stp_list_t * | list,
|  | const char * | parameter,
|  | const char * | value,
|  | size_t | bytes,
|  | int | typ
| ) | `[static]`

| Definition at line 420 of file print-vars.c. References value_t::active, copy_to_raw(), value_t::name, stp_list_get_item_by_name(), stp_list_item_create(), stp_list_item_t, stp_list_t, stp_malloc(), STP_PARAMETER_DEFAULTED, stp_strdup(), value_t::typ, and value_t::value. Referenced by stp_set_default_file_parameter(), stp_set_default_file_parameter_n(), stp_set_default_raw_parameter(), and stp_set_default_string_parameter_n().

void set_parameter_active_generic | ( | const stp_vars_t * | v,
|  | stp_parameter_type_t | p_type,
|  | const char * | parameter,
|  | stp_parameter_activity_t | active
| ) | `[static]`

| Definition at line 1227 of file print-vars.c. References stp_vars::params, stp_list_get_item_by_name(), stp_list_item_get_data(), stp_list_item_t, stp_list_t, STP_PARAMETER_ACTIVE, STP_PARAMETER_INACTIVE, and stp_vars_t.

void set_raw_parameter | ( | stp_list_t * | list,
|  | const char * | parameter,
|  | const char * | value,
|  | size_t | bytes,
|  | int | typ
| ) | `[static]`

| Definition at line 436 of file print-vars.c. References value_t::active, copy_to_raw(), value_t::name, stp_free(), stp_list_get_item_by_name(), stp_list_item_create(), stp_list_item_destroy(), stp_list_item_get_data(), stp_list_item_t, stp_list_t, stp_malloc(), STP_PARAMETER_ACTIVE, STP_PARAMETER_DEFAULTED, stp_strdup(), value_t::typ, and value_t::value. Referenced by stp_set_file_parameter(), stp_set_file_parameter_n(), stp_set_raw_parameter(), and stp_set_string_parameter_n().

value_t* value_copy | ( | const void * | item | ) | `[static]`

| Definition at line 155 of file print-vars.c. References value_t::active, copy_to_raw(), value_t::name, stp_array_create_copy(), stp_curve_create_copy(), stp_malloc(), STP_PARAMETER_TYPE_ARRAY, STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_TYPE_CURVE, STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_TYPE_FILE, STP_PARAMETER_TYPE_INT, STP_PARAMETER_TYPE_RAW, STP_PARAMETER_TYPE_STRING_LIST, stp_strdup(), value_t::typ, and value_t::value. Referenced by copy_value_list().

void value_freefunc | ( | void * | item | ) | `[static]`

| Definition at line 111 of file print-vars.c. References value_t::name, stp_array_destroy(), stp_curve_destroy(), stp_free(), STP_PARAMETER_TYPE_ARRAY, STP_PARAMETER_TYPE_CURVE, STP_PARAMETER_TYPE_FILE, STP_PARAMETER_TYPE_RAW, STP_PARAMETER_TYPE_STRING_LIST, value_t::typ, and value_t::value. Referenced by create_vars_list().

const char* value_namefunc | ( | const void * | item | ) | `[static]`

| Definition at line 104 of file print-vars.c. References value_t::name. Referenced by create_vars_list().

## Variable Documentation

stp_vars_t default_vars`[static]`

| Definition at line 87 of file print-vars.c. Referenced by initialize_standard_vars(), stp_default_settings(), and stp_vars_create().

int standard_vars_initialized = 0`[static]`

| Definition at line 85 of file print-vars.c. Referenced by initialize_standard_vars().