libgimpprint API Reference: printer

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

# printer

The printer type represents a printer model. More...

## Data Structures
struct | stp_printfuncs_t
struct | stp_family
## Typedefs
typedef stp_printer | stp_printer_t
| The printer opaque data type (representation of printer model).
typedef stp_family | stp_family_t
## Functions
int | stp_printer_model_count (void)
| Get the number of available printer models.
const stp_printer_t * | stp_get_printer_by_index (int idx)
| Get a printer model by its index number.
const stp_printer_t * | stp_get_printer_by_long_name (const char *long_name)
| Get a printer model by its long (translated) name.
const stp_printer_t * | stp_get_printer_by_driver (const char *driver)
| Get a printer model by its short name.
const stp_printer_t * | stp_get_printer (const stp_vars_t *v)
| Get the printer model from a vars object.
int | stp_get_printer_index_by_driver (const char *driver)
| Get the printer index number from the printer model short (driver) name.
const char * | stp_printer_get_long_name (const stp_printer_t *p)
| Get a printer model's long (translated) name.
const char * | stp_printer_get_driver (const stp_printer_t *p)
| Get a printer model's short (driver) name.
const char * | stp_printer_get_family (const stp_printer_t *p)
| Get a printer model's family name.
const char * | stp_printer_get_manufacturer (const stp_printer_t *p)
| Get a printer model's manufacturer's name.
int | stp_printer_get_model (const stp_printer_t *p)
| Get a printer model's model number.
const stp_vars_t * | stp_printer_get_defaults (const stp_printer_t *p)
| Get the default vars for a particular printer model.
void | stp_set_printer_defaults (stp_vars_t *v, const stp_printer_t *p)
| Set a vars object to use a particular driver, and set the parameter to its defaults.
int | stp_print (const stp_vars_t *v, stp_image_t *image)
| Print the image.
int | stp_start_job (const stp_vars_t *v, stp_image_t *image)
| Start a print job.
int | stp_end_job (const stp_vars_t *v, stp_image_t *image)
| End a print job.
int | stp_get_model_id (const stp_vars_t *v)
int | stp_verify_printer_params (stp_vars_t *v)
int | stp_family_register (stp_list_t *family)
int | stp_family_unregister (stp_list_t *family)
void | stp_initialize_printer_defaults (void)
stp_parameter_list_t | stp_printer_list_parameters (const stp_vars_t *v)
void | stp_printer_describe_parameter (const stp_vars_t *v, const char *name, stp_parameter_t *description)
const char * | stp_describe_output (const stp_vars_t *v)

## Detailed Description

The printer type represents a printer model.

A particular printer model must selected in order to be able to print. Each printer model provides default print options through a default vars object.

## Typedef Documentation

typedef struct stp_family stp_family_t

| Referenced by stpi_xml_process_family().

typedef struct stp_printer stp_printer_t

| The printer opaque data type (representation of printer model). Definition at line 51 of file printers.h. Referenced by check_printer(), stp_family_register(), stp_family_unregister(), stp_get_model_id(), stp_get_printer_by_driver(), stp_get_printer_by_index(), stp_get_printer_by_long_name(), stp_get_printer_index_by_driver(), stp_initialize_printer_defaults(), stp_printer_create_from_xmltree(), stp_printer_get_defaults(), stp_printer_get_driver(), stp_printer_get_family(), stp_printer_get_long_name(), stp_printer_get_manufacturer(), stp_printer_get_model(), stp_set_printer_defaults(), stpi_get_printfuncs(), stpi_printer_freefunc(), stpi_printer_long_namefunc(), stpi_printer_namefunc(), and stpi_xml_process_family().

## Function Documentation

const char* stp_describe_output | ( | const stp_vars_t * | v | ) |

| Definition at line 377 of file printers.c. References stp_printfuncs_t::describe_output, stp_get_printer(), stp_vars_t, and stpi_get_printfuncs(). Referenced by stpi_color_traditional_describe_parameter().

int stp_end_job | ( | const stp_vars_t * | v,
|  | stp_image_t * | image
| ) |

  | End a print job. Parameters:
  v | the vars to use.
  image | the image to print.
Returns: 1 on success, 0 on failure. Definition at line 421 of file printers.c. References stp_printfuncs_t::end_job, stp_get_printer(), stp_get_string_parameter(), stp_image_t, stp_vars_t, and stpi_get_printfuncs().

int stp_family_register | ( | stp_list_t * | family | ) |

| Definition at line 793 of file printers.c. References stp_printer::printvars, STP_DBG_PRINTERS, stp_deprintf(), stp_get_driver(), stp_list_get_item_by_name(), stp_list_get_start(), stp_list_item_create(), stp_list_item_get_data(), stp_list_item_next(), stp_list_item_t, stp_list_t, stp_printer_t, and stpi_init_printer_list(). Referenced by pcl_mode2(), print_escp2_module_init(), print_olympus_module_init(), print_ps_module_init(), and print_raw_module_init().

int stp_family_unregister | ( | stp_list_t * | family | ) |

| Definition at line 824 of file printers.c. References stp_printer::printvars, STP_DBG_PRINTERS, stp_deprintf(), stp_get_driver(), stp_list_get_item_by_name(), stp_list_get_start(), stp_list_item_destroy(), stp_list_item_get_data(), stp_list_item_next(), stp_list_item_t, stp_list_t, stp_printer_t, and stpi_init_printer_list(). Referenced by print_escp2_module_exit(), print_lexmark_module_init(), print_olympus_module_exit(), print_ps_module_exit(), and print_raw_module_exit().

int stp_get_model_id | ( | const stp_vars_t * | v | ) |

| Definition at line 237 of file printers.c. References stp_printer::model, stp_get_driver(), stp_get_printer_by_driver(), stp_printer_t, and stp_vars_t. Referenced by canon_limit(), escp2_base_res(), escp2_bits(), escp2_density(), escp2_dropsizes(), escp2_get_cap(), escp2_has_cap(), escp2_ink_type(), escp2_inklist(), internal_imageable_area(), lexmark_sat_adjustment(), olympus_do_print(), olympus_get_laminate_pattern(), olympus_imageable_area(), olympus_parameters(), olympus_printsize(), print_debug_params(), ps_media_size_internal(), ps_print_internal(), and raw_print().

const stp_printer_t* stp_get_printer | ( | const stp_vars_t * | v | ) |

  | Get the printer model from a vars object. Parameters:
  v | the vars to use.
Returns: a pointer to the printer model, or NULL on failure. The pointer should not be freed. Definition at line 231 of file printers.c. References stp_get_driver(), stp_get_printer_by_driver(), and stp_vars_t. Referenced by stp_describe_output(), stp_describe_resolution(), stp_end_job(), stp_get_imageable_area(), stp_get_media_size(), stp_get_size_limit(), stp_print(), stp_printer_describe_parameter(), stp_printer_list_parameters(), stp_start_job(), and stp_verify().

const stp_printer_t* stp_get_printer_by_driver | ( | const char * | driver | ) |

  | Get a printer model by its short name. Parameters:
  driver | the printer model's short (driver) name.
Returns: a pointer to the printer model, or NULL on failure. The pointer should not be freed. Definition at line 201 of file printers.c. References stp_erprintf(), stp_list_get_item_by_name(), stp_list_item_get_data(), stp_list_item_t, stp_printer_t, and stpi_init_printer_list(). Referenced by stp_get_model_id(), and stp_get_printer().

const stp_printer_t* stp_get_printer_by_index | ( | int | idx | ) |

  | Get a printer model by its index number. Parameters:
  idx | the index number. This must not be greater than (total number of printers - 1).
Returns: a pointer to the printer model, or NULL on failure. The pointer should not be freed. Definition at line 103 of file printers.c. References stp_erprintf(), stp_list_get_item_by_index(), stp_list_item_get_data(), stp_list_item_t, stp_printer_t, and stpi_init_printer_list(). Referenced by stp_get_printer_index_by_driver().

const stp_printer_t* stp_get_printer_by_long_name | ( | const char * | long_name | ) |

  | Get a printer model by its long (translated) name. Parameters:
  long_name | the printer model's long (translated) name.
Returns: a pointer to the printer model, or NULL on failure. The pointer should not be freed. Definition at line 185 of file printers.c. References stp_erprintf(), stp_list_get_item_by_long_name(), stp_list_item_get_data(), stp_list_item_t, stp_printer_t, and stpi_init_printer_list().

int stp_get_printer_index_by_driver | ( | const char * | driver | ) |

  | Get the printer index number from the printer model short (driver) name. Deprecated: there should never be any need to use this function. Parameters:
  driver | the printer model's short (driver) name.
Returns: the index number, or -1 on failure. Definition at line 217 of file printers.c. References stp_get_printer_by_index(), stp_printer_get_driver(), stp_printer_model_count(), and stp_printer_t.

void stp_initialize_printer_defaults | ( | void |  | ) |

| Definition at line 323 of file printers.c. References set_printer_defaults(), STP_DBG_PRINTERS, stp_deprintf(), stp_list_get_start(), stp_list_item_get_data(), stp_list_item_next(), stp_list_item_t, stp_printer_t, and stpi_init_printer_list(). Referenced by stp_init().

int stp_print | ( | const stp_vars_t * | v,
|  | stp_image_t * | image
| ) |

  | Print the image. Warning: stp_job_start() must be called prior to the first call to this function. Parameters:
  v | the vars to use.
  image | the image to print.
Returns: 0 on failure, 1 on success, 2 on abort requested by the driver. Definition at line 399 of file printers.c. References stp_printfuncs_t::print, stp_get_printer(), stp_image_t, stp_vars_t, and stpi_get_printfuncs().

void stp_printer_describe_parameter | ( | const stp_vars_t * | v,
|  | const char * | name,
|  | stp_parameter_t * | description
| ) |

| Definition at line 252 of file printers.c. References stp_printfuncs_t::parameters, stp_get_printer(), stp_vars_t, and stpi_get_printfuncs(). Referenced by stp_describe_parameter().

const stp_vars_t* stp_printer_get_defaults | ( | const stp_printer_t * | p | ) |

  | Get the default vars for a particular printer model. The default vars should be copied to a new vars object and customised prior to printing. Parameters:
  p | the printer model to use.
Returns: the printer model's default vars. Definition at line 178 of file printers.c. References stp_printer::printvars, and stp_printer_t.

const char* stp_printer_get_driver | ( | const stp_printer_t * | p | ) |

  | Get a printer model's short (driver) name. Parameters:
  p | the printer model to use.
Returns: the short name (should never be freed). Definition at line 128 of file printers.c. References stp_printer::driver, and stp_printer_t. Referenced by stp_get_printer_index_by_driver(), and stp_set_printer_defaults().

const char* stp_printer_get_family | ( | const stp_printer_t * | p | ) |

  | Get a printer model's family name. The family name is the name of the modular "family" driver this model uses. Parameters:
  p | the printer model to use.
Returns: the family name (should never be freed). Definition at line 154 of file printers.c. References stp_printer::family, and stp_printer_t.

const char* stp_printer_get_long_name | ( | const stp_printer_t * | p | ) |

  | Get a printer model's long (translated) name. Parameters:
  p | the printer model to use.
Returns: the long name (should never be freed). Definition at line 141 of file printers.c. References stp_printer::long_name, and stp_printer_t.

const char* stp_printer_get_manufacturer | ( | const stp_printer_t * | p | ) |

  | Get a printer model's manufacturer's name. Parameters:
  p | the printer model to use.
Returns: the manufacturer's name (should never be freed). Definition at line 160 of file printers.c. References stp_printer::manufacturer, and stp_printer_t.

int stp_printer_get_model | ( | const stp_printer_t * | p | ) |

  | Get a printer model's model number. The model number is used internally by the "family" driver module, and has no meaning out of that context. It bears no relation to the model name/number actually found on the printer itself. Parameters:
  p | the printer model to use.
Returns: the model number. Definition at line 166 of file printers.c. References stp_printer::model, and stp_printer_t.

stp_parameter_list_t stp_printer_list_parameters | ( | const stp_vars_t * | v | ) |

| Definition at line 244 of file printers.c. References stp_printfuncs_t::list_parameters, stp_get_printer(), stp_vars_t, and stpi_get_printfuncs(). Referenced by stp_get_parameter_list().

int stp_printer_model_count | ( | void |  | ) |

| Get the number of available printer models. Returns: the number of printer models. Definition at line 77 of file printers.c. References stp_erprintf(), stp_list_get_length(), and stpi_init_printer_list(). Referenced by stp_get_printer_index_by_driver().

void stp_set_printer_defaults | ( | stp_vars_t * | v,
|  | const stp_printer_t * | p
| ) |

  | Set a vars object to use a particular driver, and set the parameter to its defaults. Parameters:
  v | the vars to use.
  p | the printer model to use.
Definition at line 316 of file printers.c. References set_printer_defaults(), stp_printer_get_driver(), stp_printer_t, stp_set_driver(), and stp_vars_t.

int stp_start_job | ( | const stp_vars_t * | v,
|  | stp_image_t * | image
| ) |

  | Start a print job. Warning: This function must be called prior to the first call to stp_print(). Parameters:
  v | the vars to use.
  image | the image to print.
Returns: 1 on success, 0 on failure. Definition at line 407 of file printers.c. References stp_printfuncs_t::start_job, stp_get_printer(), stp_get_string_parameter(), stp_image_t, stp_vars_t, and stpi_get_printfuncs().

int stp_verify_printer_params | ( | stp_vars_t * | v | ) |

| Definition at line 678 of file printers.c. References _, errbuf_t::bytes, errbuf_t::data, fill_buffer_writefunc(), stp_parameter_t::is_active, stp_parameter_t::name, STP_DBG_PAPER, STP_DBG_VARS, stp_dprintf(), stp_eprintf(), stp_free(), stp_get_errdata(), stp_get_errfunc(), stp_get_height(), stp_get_imageable_area(), stp_get_left(), stp_get_page_height(), stp_get_page_width(), stp_get_parameter_list(), stp_get_size_limit(), stp_get_string_parameter(), stp_get_top(), stp_get_width(), stp_outfunc_t, stp_parameter_list_count(), stp_parameter_list_destroy(), stp_parameter_list_param(), stp_parameter_list_t, stp_set_errdata(), stp_set_errfunc(), stp_set_verified(), stp_vars_t, stp_verify_parameter(), and stp_parameter_t::verify_this_parameter.