|
static void | exit_libpaper (void) |
|
void | caps_libppd_init (void) |
|
void | caps_libppd_version_get (unsigned *major, unsigned *minor, unsigned *micro) |
|
static void | init_caps_ppd_option (struct caps_ppd_option *o) |
|
static void | free_caps_ppd_option (struct caps_ppd_option *o) |
|
static struct caps_ppd_option * | create_new_option_entry (struct caps_ppd_options_table *pot) |
|
static void | print_caps_ppd_option (const struct caps_ppd_option *o) |
|
struct caps_ppd_option * | caps_ppd_option_get (const struct caps_ppd_options_table *pot, const char *keyword) |
|
struct caps_ppd_option * | caps_ppd_option_with_name_get (const struct caps_ppd_options_table *pot, const char *keyword, const char *name) |
|
void | caps_ppd_option_add (struct caps_ppd_options_table *pot, const char *keyword, const char *name, const char *description, const char *value) |
|
struct caps_ppd_options_table * | caps_ppd_options_table_create (void) |
|
void | caps_ppd_options_table_clean_up (struct caps_ppd_options_table *pot) |
|
const struct caps_ppd_option * | caps_ppd_options_table_base_get (const struct caps_ppd_options_table *pot) |
|
size_t | caps_ppd_options_table_element_count_get (const struct caps_ppd_options_table *pot) |
|
struct caps_ppd_options_table * | caps_ppd_options_table_duplicate (const struct caps_ppd_options_table *src) |
|
int | caps_ppd_paper_format_validate (const char *paper_name) |
|
struct caps_rect | caps_ppd_paper_format_size_get (const char *paper_name) |
|
static int | check_one_edge (double has, double expected) |
|
static const struct paper * | medium_name_and_size_guess (const struct caps_rect *sz) |
|
const char * | caps_ppd_paper_format_name_get (const struct caps_rect *size) |
|
const char * | caps_ppd_paper_default_format_get (void) |
|
The data extracted from a PPD file will be handled as a simple table of option data. Each element in the table stores the values:
- keyword (aka "main keyword")
- name (aka "option keyword")
- description (aka "translation")
- value
After some experience with this kind of data I found out, there is no need for any special handling of the PPD's data. All the data from the PPD can be stored in the simple table line per line. No magic required.
National Language Support: When creating the PPD all 'descriptive' strings can be translated to the local language by default. This will be done in a server local manner, not locally at client side. In order to do so, mark all your decriptions strings for NLS and provide a .po file in your printing driver using the libcapsppd library. And provide your "domain name" in the struct caps_ppd_base element domain_name.
static const struct paper * medium_name_and_size_guess |
( |
const struct caps_rect * |
sz | ) |
|
|
static |
Goal is to 'guess' the intended medium, not the really given one. In the wild I saw many size variants of DIN A4 for example in PDF files. This function should try to unify them.
libpaper has such a function, but it only matches, if the sizes are exact. What we need is a little bit more tolerance.
This function also checks the rotated coordinates.