CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Fields
caps_ppd_base Struct Reference

Basic description of common features a printing device/printing driver can provide. More...

Data Fields

const char * domain_name
 
enum caps_ppd_common_features common_features
 
enum caps_ppd_paper_types paper_type
 
enum caps_ppd_paper_leading_edges default_leading_edges
 
enum caps_ppd_color_formats supported_color_formats
 
enum caps_ppd_color_formats default_color_format
 
size_t resolution_count
 
size_t default_resolution
 
const struct caps_ppd_resolutionresolutions
 
size_t options_count
 
const struct caps_ppd_optionoptions
 
size_t selection_count
 
const struct caps_ppd_selection ** selections
 
const struct caps_ppd_media_sizemedia_coverage
 
const struct caps_ppd_media_marginsmedia_margins
 
size_t custom_media_count
 
const struct caps_ppd_custom_mediumcustom_media
 
const char * default_paper_name
 

Detailed Description

Used by the dynamic PPD file generator and to register at the printing coordinator

If the caller provides translated strings, it can set domain_name to its own domain name. In this case libcapsppd tries to translate the description entry into the local language.

Note
libcapsppd brings its own national language translation for some generic strings. So, the caller don't need to translate all strings, only its own very specific ones.

Field Documentation

◆ domain_name

const char* domain_name

Used to translate PPD description strings in the specified domain, can be NULL

◆ common_features

enum caps_ppd_common_features common_features

Or-ed list of basic common printer device features

LIBCAPS_GA_DUPLEX: indicates the printer can print in duplex in hardware.

LIBCAPS_GA_SINGLE_TRAY: many printing devices have one paper tray only. And thus, can provide exactly one printing medium only. If a printing device uses this bit, there will be no printing media selection in the (dynamically generated) PPD. The libcapsppd library instead adds a single printing media entry in this case. default_paper_name is used as the loaded paper in this single tray.

LIBCAPS_GA_MANUAL_FEED: this definiton is set, if the printing device has a manual printing media feed. In this case the min/max. printing media description in media_coverage this manual feed can handle is used to add all media which fits into this size.

LIBCAPS_GA_CUSTOM_MEDIA: if this definition is set, the PPD generator will not add any kind of standard media format names and sizes to the PPD. It is up to the printing provider doing so. This flag is intended for label printers which use most of the time very specific media formats including dedicated product names for them. custom_media_count and custom_media must be defined in this case.

LIBCAPS_GA_CUTTER: if this definition is set, the PPD generator will add a generic selection to enable the user to make use of a cutter the printer device provides. If the printer device provides more capabilities than enabling/disabling the cutter, the driver must add selections to cover these additional features.

◆ paper_type

enum caps_ppd_paper_types paper_type

Currently available printing medium type

◆ default_leading_edges

enum caps_ppd_paper_leading_edges default_leading_edges

Define this value only to make the PPD generator happy and provide some value to clients via the PPD. The real value is medium specific (think about printers with more than one paper tray).
If undefined, it defaults to LIBCAPS_PLE_SHORT

◆ supported_color_formats

enum caps_ppd_color_formats supported_color_formats

Or-ed list of supported colour formats

◆ default_color_format

enum caps_ppd_color_formats default_color_format

Default colour format from the list in supported_color_formats

◆ resolution_count

size_t resolution_count

The count of entries in resolutions
Refer resolutions for details

◆ default_resolution

size_t default_resolution

The default entry in resolutions
Refer resolutions for details

◆ resolutions

const struct caps_ppd_resolution* resolutions

Supported printing resolutions
List of resolutions, the printer can deal with. Must have at least one entry.

[…]
static const struct caps_ppd_resolution supported_resolutions[] = {
{ .horizontal = 600.0, .vertical = 600.0, },
{ .horizontal = 1200.0, .vertical = 600.0, },
};
[…]
.resolution_count = 2,
.default_resolution = 0,
.resolutions = supported_resolutions,
[…]
static const struct caps_ppd_resolution supported_resolutions[]
Definition: caps-printing-test-provider.c:47
Definition of one supported resolution in Dots Per Inch (DPI).
Definition: libcapsppd.h:233
unsigned horizontal
Definition: libcapsppd.h:234

◆ options_count

size_t options_count

The count of entries in options
Refer options for details

◆ options

const struct caps_ppd_option* options

Optional.
Additional printing device/printing driver specific PPD entries, which are not PPD selections.

[…]
static const struct caps_ppd_option option_list[1] = { … };
[…]
.options_count = 1,
.media_margins = option_list,
[…]
Structure to keep the information read-in from an external PPD files.
Definition: libcapsppd-api.h:151

◆ selection_count

size_t selection_count

The count of entries in selections
Refer selections for details

◆ selections

const struct caps_ppd_selection** selections

Optional.
Additional PPD selections this printing driver provides to the user

[…]
static const struct caps_ppd_selection some_selection_entry = { … };
[…]
static const struct caps_ppd_selection *selection_list[1] = {
&some_selection_entry,
}
[…]
.selection_count = 1,
.selections = selection_list,
[…]
Description of an OpenUI/CloseUI PPD selection.
Definition: libcapsppd.h:303

◆ media_coverage

const struct caps_ppd_media_size* media_coverage

This entry defines the minimal and maximal physical limits of media sizes the printing device can deal with, due to its mechanics and/or print head.
If LIBCAPS_GA_SINGLE_TRAY

  • is set, these limits are used to check if the medium format defined in default_paper_name fits into the printer.
  • isn't set, these limits are used to create a list of supported generic medium formats fitting into it

If LIBCAPS_GA_MANUAL_FEED

  • is set, these limits are used to create a list of supported generic medium formats fitting into it

◆ media_margins

const struct caps_ppd_media_margins* media_margins

This entry defines the margins the printer device cannot print to. Most of the time these margins depends on the selected medium, but only one generic setting can be defined here and is used for all.
It is used to define the imageable area the printer device can print to on each generic medium format.

[…]
static const struct caps_ppd_media_margins margins = {
.left = 5.0, .right = 5.0, .top = 15.0, .bottom = 25.0,
};
[…]
.media_margins = &margins,
[…]
Definition to calculate the printable area on all printing media.
Definition: libcapsppd.h:255
double left
Definition: libcapsppd.h:256

◆ custom_media_count

size_t custom_media_count

Optional.
This member is used in conjunction with custom_media and the flag LIBCAPS_GA_CUSTOM_MEDIA. Read about details in the custom_media description

◆ custom_media

const struct caps_ppd_custom_medium* custom_media

Optional.
If LIBCAPS_GA_CUSTOM_MEDIA

  • is set, custom_media points to a table of caps_ppd_custom_medium elements, each defining one custom medium format. The count of elements in this table must be set in custom_media_count.
  • isn't set, this member is ignored

Example:

[…]
#define MM2PTS(x) (x * 72.0 / 25.4)
static const struct caps_ppd_custom_medium custom_media = {
.name = "SOMEINTERNALNAME",
.description = "Some descriptive name",
.width = MM2PTS(29.0), .length = MM2PTS(90.0),
.left = MM2PTS(0.5), .right = MM2PTS(0.5),
.top = MM2PTS(3.0), .bottom = MM2PTS(3.0),
};
[…]
.common_features = LIBCAPS_GA_CUSTOM_MEDIA,
.custom_media_count = 1,
.custom_media = &custom_media,
[…]
@ LIBCAPS_GA_CUSTOM_MEDIA
Definition: libcapsppd.h:217
#define MM2PTS(mm)
Definition: reference-printing-provider.c:63
const struct caps_ppd_custom_medium * custom_media
Definition: libcapsppd.h:431
Definition of a custom medium.
Definition: libcapsppd.h:270
const char * name
Definition: libcapsppd.h:271

◆ default_paper_name

const char* default_paper_name

If LIBCAPS_GA_SINGLE_TRAY

  • is set, it provides the format name of the loaded paper in this tray.
  • isn't set, it provides the default paper format name of the list of formats a user can select from or can be kept at NULL to use the system's default paper format name retrieved from libpaper in this case (refer the command paperconf -d for details).

If LIBCAPS_GA_CUSTOM_MEDIA

  • is set, it provides the default paper format name from the custom_media list

The documentation for this struct was generated from the following file: