CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Structures | Functions | Variables
hl-series.c File Reference

Shared functions by all HL printer drivers. More...

Data Structures

struct  hl_paper_formats
 
struct  resolution_keywords
 

Functions

void hl_feature_selection_add (struct ppd_feature_add *f, struct caps_ppd_selection *s)
 
void hl_options_add (struct ppd_option_add *o, size_t entries, struct caps_ppd_option option[entries])
 
ssize_t hl_selection_entry_get (size_t selection_cnt, const struct caps_ppd_selection_entry selection_list[selection_cnt], const char *entry)
 
static int convert_full_integer (const char *string, int dflt)
 
void hl_global_density_mode (struct hl_drv *t)
 
void hl_global_powersave_mode (struct hl_drv *t)
 
void hl_global_image_adapt_mode (struct hl_drv *t)
 
void hl_global_offsets_adapt (struct hl_drv *t)
 
void hl_global_bandlength_adapt (struct hl_drv *t)
 
void hl_global_encoder_adapt (struct hl_drv *t)
 
void hl_global_duplex_adapt (struct hl_drv *t)
 
const char * hl_print_default_paper_name (struct hl_drv *t)
 
const char * hl_printers_paper_format (const char *paper_format)
 
enum hl_printer hl_driver_printer_id_get (struct hl_drv *t, const struct hl_printer_name_to_id *list)
 
ssize_t hl_available_resolution_list_get (struct hl_drv *t, const struct caps_ppd_resolution **list)
 
ssize_t hl_print_default_resolution_get (struct hl_drv *t, size_t cnt, const struct caps_ppd_resolution list[cnt])
 
void hl_print_paper_type (struct hl_drv *t, unsigned cnt, const struct caps_ppd_selection_entry type_list[cnt], struct ppd_feature_add *fl, struct ppd_option_add *ol)
 

Variables

static const struct hl_paper_formats hl_supported_tray_formats []
 
static struct caps_ppd_resolution hl_supported_resolutions [5]
 Run-time filled list of supported printing resolutions.
 
static const struct resolution_keywords hl_known_resolutions []
 List of printing resolution related keywords and their run-time values.
 
static struct caps_ppd_selection hl_media_type_selection
 
static struct caps_ppd_option hl_media_type []
 

Detailed Description

This is just a collection of functions which are shared by all HLxxxx drivers, mainly the INI file based driver setup.

Function Documentation

◆ hl_feature_selection_add()

void hl_feature_selection_add ( struct ppd_feature_add *  f,
struct caps_ppd_selection s 
)

◆ hl_options_add()

void hl_options_add ( struct ppd_option_add *  o,
size_t  entries,
struct caps_ppd_option  option[entries] 
)

◆ hl_selection_entry_get()

ssize_t hl_selection_entry_get ( size_t  selection_cnt,
const struct caps_ppd_selection_entry  selection_list[selection_cnt],
const char *  entry 
)

◆ convert_full_integer()

static int convert_full_integer ( const char *  string,
int  dflt 
)
static

Convert an integer with its full range and check for errors

Parameters
[in]stringThe number as an ASCII text
[in]dfltThe default value to return in case of an error
Return values
NumberFull range integer value
DefaultThe dflt value in case of an error

It replaces caps_helper_number_convert(), for some special use cases. It can convert signed integer instead of positive integers only.

◆ hl_global_density_mode()

void hl_global_density_mode ( struct hl_drv *  t)

◆ hl_global_powersave_mode()

void hl_global_powersave_mode ( struct hl_drv *  t)

◆ hl_global_image_adapt_mode()

void hl_global_image_adapt_mode ( struct hl_drv *  t)

◆ hl_global_offsets_adapt()

void hl_global_offsets_adapt ( struct hl_drv *  t)

◆ hl_global_bandlength_adapt()

void hl_global_bandlength_adapt ( struct hl_drv *  t)

◆ hl_global_encoder_adapt()

void hl_global_encoder_adapt ( struct hl_drv *  t)

◆ hl_global_duplex_adapt()

void hl_global_duplex_adapt ( struct hl_drv *  t)

◆ hl_print_default_paper_name()

const char * hl_print_default_paper_name ( struct hl_drv *  t)

◆ hl_printers_paper_format()

const char * hl_printers_paper_format ( const char *  paper_format)

◆ hl_driver_printer_id_get()

enum hl_printer hl_driver_printer_id_get ( struct hl_drv *  t,
const struct hl_printer_name_to_id list 
)

◆ hl_available_resolution_list_get()

ssize_t hl_available_resolution_list_get ( struct hl_drv *  t,
const struct caps_ppd_resolution **  list 
)

◆ hl_print_default_resolution_get()

ssize_t hl_print_default_resolution_get ( struct hl_drv *  t,
size_t  cnt,
const struct caps_ppd_resolution  list[cnt] 
)

◆ hl_print_paper_type()

void hl_print_paper_type ( struct hl_drv *  t,
unsigned  cnt,
const struct caps_ppd_selection_entry  type_list[cnt],
struct ppd_feature_add *  fl,
struct ppd_option_add *  ol 
)

Variable Documentation

◆ hl_supported_tray_formats

const struct hl_paper_formats hl_supported_tray_formats[]
static
Initial value:
= {
{ .name = "a4", .hl_name = "A4", },
{ .name = "letter", .hl_name = "LETTER", },
{ .name = "legal", .hl_name = "LEGAL", },
{ .name = "b5", .hl_name = "B5", },
{ .name = "executive", .hl_name = "EXECUTIVE", },
{ .name = "a5", .hl_name = "A5", },
{ .name = "a6", .hl_name = "A6", },
{ .name = "b6", .hl_name = "B6", },
{ .name = "folio", .hl_name = "FOLIO", },
{ .name = "c5", .hl_name = "C5", },
{ .name = "DL", .hl_name = "DL", },
{ .name = "#", .hl_name = "USERDEF", },
}

Most printers list more supported paper formats. But the printer's user manuals lists less of them to be loaded into the input tray.

Note
This list is from the HL-2140 printer manual.
Todo:
Check it against the HL-1xxx printer manuals

◆ hl_supported_resolutions

struct caps_ppd_resolution hl_supported_resolutions[5]
static

This list of supported printing resolutions gets filled by INI file settings at run-time (by hl_available_resolution_list_get())

Precondition
Should have enough space (elements) to support all resolutions listed in #res_keys

◆ hl_known_resolutions

const struct resolution_keywords hl_known_resolutions[]
static
Initial value:
= {
{ .key = "150x150", .res = { .horizontal = 150, .vertical = 150, }, },
{ .key = "300x300", .res = { .horizontal = 300, .vertical = 300, }, },
{ .key = "600x600", .res = { .horizontal = 600, .vertical = 600, }, },
{ .key = "1200x600", .res = { .horizontal = 1200, .vertical = 600, }, },
{ .key = "2400x600", .res = { .horizontal = 2400, .vertical = 600, }, },
}

◆ hl_media_type_selection

struct caps_ppd_selection hl_media_type_selection
static
Initial value:
= {
.option_type = LIBCAPS_OT_PICKONE,
.option = "MediaType",
.description = ( "Paper Type" ),
}
@ LIBCAPS_OT_PICKONE
Definition: libcapsppd.h:282

◆ hl_media_type

struct caps_ppd_option hl_media_type[]
static
Initial value:
= {
{ .keyword = "DefaultMediaType", .value = NULL, },
{ .keyword = "MediaType", .name = NULL, .description = ( "Paper Type" ), .value = NULL, },
}