CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Shared functions by all QL label printer drivers. More...
Variables | |
static const struct caps_ppd_selection * | ql_drv_spare_features_list [10] |
static const struct caps_ppd_selection_entry | ql_drv_feature_power_off_selections [] |
static const struct caps_ppd_selection | ql_drv_feature_power_off_selection |
static const struct caps_ppd_selection_entry | ql_drv_feature_power_on_selections [] |
static const struct caps_ppd_selection | ql_drv_feature_power_on_selection |
static const struct caps_ppd_selection_entry | ql_drv_feature_halftone_selections [] |
static struct caps_ppd_selection | ql_drv_feature_halftone_off_selection |
static const struct caps_ppd_selection_entry | ql_driver_feature_bi_colour_medium_selections [] |
static struct caps_ppd_selection | ql_driver_feature_bi_colour_medium_selection |
static const struct dk_roll_types | rolls [] |
This is a collection of functions and features shared by all QLxxxx drivers.
int ql_numerical_setting_read | ( | struct ql_drv * | t, |
const char * | section, | ||
const char * | keyword | ||
) |
Helper to read in a positive integer INI setting
[in,out] | t | Full job description |
[in] | section | Name of the section, the setting should be read from |
[in] | keyword | The keyword/setting to read in |
Positive | The setting read from the INI |
-ENODATA | No setting found |
-EINVAL | Setting found, but doesn't look like an ASCII number |
-ERANGE | Setting contains an invalid number for an 'int' |
|
static |
Internal helper to read in a floating point numerical type INI setting
[in] | drvi | Handle to access the INI settings |
[in] | section | Name of the section, the setting should be read from |
[in] | keyword | The keyword/setting to read in |
[in] | fallback | Value to return, if not set in the INI |
fallback
if not defined
|
static |
Read in and set up the byte count per line from the INI settings
[in] | t | Full job description |
|
static |
Read in and set up the dot count per line from the INI settings
[in] | t | Full job description |
|
static |
Read in and set up the cutter capabilities from the INI settings
[in] | t | Full job description |
|
static |
Read in and set up the bi-colour capabilities from the INI settings
[in] | t | Full job description |
|
static |
Read in and set up the margin settings from the INI settings for all kind of labels
[in] | t | Full job description |
The printers have some margin requirements at all four edges of a label, we need to consider when printing. This routine sets up two margin assumptions, based on the following experiences:
These experiences are used as the default. But the user can overwrite them.
The horizontal margins depend on the width of the label:
The vertical margins seem always constant and 3 mm both.
|
static |
Read in and set up the printer's high resolution capabilities from the INI settings
[in] | t | Full job description |
Some printers are capable of printing in 600 DPI in vertical direction.
|
static |
Read in and set up the minimum and maximum supported label sizes from the INI settings
[in] | t | Full job description |
Various printer variants are restricted in the size when printing on continuous length labels.
|
static |
Read in and set up from the INI file the amount of leading zero bytes to begin a print job
[in] | t | Full job description |
Various printer variants define a different amount of zero bytes leading a printing job. QL500 defines 200 bytes, QL650 defines 350 bytes and a QL800 defines 400 bytes.
void ql_driver_base_setup | ( | struct ql_drv * | t | ) |
Read in the main INI file settings for the driver
[in] | t | Full job description |
|
static |
void ql_driver_power_selection_setup | ( | struct ql_drv * | t, |
struct caps_ppd_base * | base | ||
) |
Add the power feature control selections to the printer description based on INI settings
[in] | t | Full job description |
[in,out] | base | Add selections to this printer description on demand |
Uses the INI boolean key powerctl
in section [features] to setup a possible power setting of the printer. In this case, selections defining these features will be added to the printer description PPD.
void ql_driver_halftone_selection_setup | ( | struct ql_drv * | t, |
struct caps_ppd_base * | base | ||
) |
Add the power feature control selections to the printer description based on INI settings
[in] | t | Full job description |
[in,out] | base | Add selections to this printer description on demand |
enum ql_half_tone ql_driver_job_halftone_get | ( | struct ql_drv * | t | ) |
FIXME
void ql_driver_bi_colour_medium_selection_setup | ( | struct ql_drv * | t, |
struct caps_ppd_base * | base | ||
) |
Add bi-colour medium selection to the printer description based on INI settings
[in] | t | Full job description |
[in,out] | base | Add selections to this printer description on demand |
The bi-colour capability of the loaded cassette cannot be detected. It must be selected by the user. This function adds a corresponding selection to the printer description, if the printer has bi-colour capabilities.
void ql_driver_job_bi_colour_medium_get | ( | struct ql_drv * | t | ) |
Get the current job related selection for the bi-colour medium capabilities
[in] | t | Full job description |
The bi-colour capability cannot be detected at runtime. So the user mus select it on a per job base to enable bi-colour print. This function checks the current selection and modifies ql_drv::bi_colour_medium_present accordingly.
|
static |
Loop through the list of rolls for a specific one
[in] | name | The name to search for |
Pointer | The corresponding roll element |
NULL | name not found |
int ql_dk_information_get | ( | struct dk_roll_types * | medium, |
const char * | name | ||
) |
Retrieve settings/information about a specific DK roll/cassette
[out] | medium | The settings for the DK roll named by name |
[in] | name | The DK roll name the settings should be retrieved for |
0 | On success, *medium is valid |
-EINVAL | Roll with the given name not found |
DK rolls can inherit settings from other rolls. This routine walks through the table and uses the dk_roll_types::like member to re-use their settings.
void ql_driver_raster_crop | ( | struct ql_drv * | t | ) |
Crop the input raster to meet the printer's expectations/requirements
[in] | t | Full job description |
The printer device has some - hmm, lets it call - interesting requirements about the print data it accepts. Continuous labels are easy, but pre-cut labels aren't. In order to ensure the printer always cuts inbetween two pre-cut labels, we need to tweak the amount of lines to be print.
Read how_the_driver_deals_with_margins about details.
int ql_driver_send | ( | struct ql_drv * | t, |
size_t | count, | ||
const void * | data, | ||
int | flush | ||
) |
Send some data to the printer's stream
[in,out] | t | Full job description |
[in] | count | Count of bytes data points to |
[in] | data | Pointer to the to be sent data |
[in] | flush | '1' if the stream should be flushed |
0 | Data buffered (and send, if flush is nonzero) |
-EINVAL | Printer device is unsuitable for writing |
-EBADF | Really bad internal failure |
-EFAULT | Really bad internal failure made by the caller |
-EIO | Low-level I/O error |
int ql_driver_data_send | ( | struct ql_drv * | t, |
size_t | count, | ||
const void * | data, | ||
int | flush | ||
) |
Send some data to the printer's stream or the development/debugging file
[in,out] | t | Full job description |
[in] | count | Count of bytes data points to |
[in] | data | Pointer to the to be sent data |
[in] | flush | '1' if the stream should be flushed |
0 | Data buffered (and send, if flush is nonzero) |
-EINVAL | Printer device is unsuitable for writing |
-EBADF | Really bad internal failure |
-EFAULT | Really bad internal failure made by the caller |
-EIO | Low-level I/O error |
This sends the real printer data to the printer's stream like ql_driver_send() does, but of the debug option –writeto is in use, it writes it to the file instead.
This is for debugging/development purposes, to extract the generated wire data and check its content and format. It is required this way, since the driver depends on interactive data exchange with the printer and if something went wrong, there is no other easy to use chance to see the data in this case.
|
static |
A spare array to add selections to a printer description on demand
|
static |
Some printers have an auto power off feature.
|
static |
|
static |
Some printers have an auto power on feature.
|
static |
|
static |
How to dither the content
|
static |
|
static |
We need an indicator if the medium is capable of bi-colour printing.
|
static |
|
static |