Ansel
0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
cups_print.h
Go to the documentation of this file.
1
/*
2
This file is part of darktable,
3
Copyright (C) 2014-2015, 2017, 2020-2021 Pascal Obry.
4
Copyright (C) 2015 Jérémy Rosen.
5
Copyright (C) 2016 Roman Lebedev.
6
Copyright (C) 2016 Tobias Ellinghaus.
7
Copyright (C) 2018 Dan Torop.
8
Copyright (C) 2022 Martin Bařinka.
9
10
darktable is free software: you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation, either version 3 of the License, or
13
(at your option) any later version.
14
15
darktable is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with darktable. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
#pragma once
25
26
#include <
common/colorspaces.h
>
27
28
#define MAX_NAME 128
29
30
typedef
enum
dt_alignment_t
{
31
ALIGNMENT_TOP_LEFT
,
32
ALIGNMENT_TOP
,
33
ALIGNMENT_TOP_RIGHT
,
34
ALIGNMENT_LEFT
,
35
ALIGNMENT_CENTER
,
36
ALIGNMENT_RIGHT
,
37
ALIGNMENT_BOTTOM_LEFT
,
38
ALIGNMENT_BOTTOM
,
39
ALIGNMENT_BOTTOM_RIGHT
40
}
dt_alignment_t
;
41
42
typedef
struct
dt_paper_info_t
43
{
44
char
name
[
MAX_NAME
],
common_name
[
MAX_NAME
];
45
double
width
,
height
;
46
}
dt_paper_info_t
;
47
48
typedef
struct
dt_medium_info_t
49
{
50
char
name
[
MAX_NAME
],
common_name
[
MAX_NAME
];
51
}
dt_medium_info_t
;
52
53
typedef
struct
dt_page_setup_t
54
{
55
gboolean
landscape
;
56
double
margin_top
,
margin_bottom
,
margin_left
,
margin_right
;
57
}
dt_page_setup_t
;
58
59
typedef
struct
dt_printer_info_t
60
{
61
char
name
[
MAX_NAME
];
62
int
resolution
;
63
double
hw_margin_top
,
hw_margin_bottom
,
hw_margin_left
,
hw_margin_right
;
64
dt_iop_color_intent_t
intent
;
65
char
profile
[256];
66
gboolean
is_turboprint
;
67
}
dt_printer_info_t
;
68
69
typedef
struct
dt_print_info_t
70
{
71
dt_printer_info_t
printer
;
72
dt_page_setup_t
page
;
73
dt_paper_info_t
paper
;
74
dt_medium_info_t
medium
;
75
}
dt_print_info_t
;
76
77
// Asynchronous printer discovery, cb will be called for each printer found
78
void
dt_printers_discovery
(
void
(*cb)(
dt_printer_info_t
*pr,
void
*user_data),
void
*user_data);
79
void
dt_printers_abort_discovery
(
void
);
80
81
// initialize the pinfo structure
82
void
dt_init_print_info
(
dt_print_info_t
*pinfo);
83
84
// get printer information for the given printer name
85
void
dt_get_printer_info
(
const
char
*printer_name,
dt_printer_info_t
*pinfo);
86
87
// get all available papers for the given printer
88
GList *
dt_get_papers
(
const
dt_printer_info_t
*printer);
89
90
// get paper information for the given paper name
91
dt_paper_info_t
*
dt_get_paper
(GList *papers,
const
char
*
name
);
92
93
// get all available media type for the given printer
94
GList *
dt_get_media_type
(
const
dt_printer_info_t
*printer);
95
96
// get paper information for the given paper name
97
dt_medium_info_t
*
dt_get_medium
(GList *media,
const
char
*
name
);
98
99
// print filename using the printer and the page size and setup
100
void
dt_print_file
(
const
int32_t imgid,
const
char
*filename,
const
char
*job_title,
const
dt_print_info_t
*pinfo);
101
102
// given the page settings (media size and border) and the printer (hardware margins) returns the
103
// page and printable area layout in the area_width and area_height (the area that dt allocate
104
// for the central display).
105
// - the page area (px, py, pwidth, pheight)
106
// - the printable area (ax, ay, awidth and aheight), the area without the borders
107
// there is no unit, every returned values are based on the area size.
108
void
dt_get_print_layout
(
const
dt_print_info_t
*prt,
109
const
int32_t area_width,
const
int32_t area_height,
110
float
*px,
float
*py,
float
*pwidth,
float
*pheight,
111
float
*ax,
float
*ay,
float
*awidth,
float
*aheight,
112
gboolean *borderless);
113
114
// clang-format off
115
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
116
// vim: shiftwidth=2 expandtab tabstop=2 cindent
117
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
118
// clang-format on
119
colorspaces.h
dt_iop_color_intent_t
dt_iop_color_intent_t
Definition
colorspaces.h:63
name
char * name
Definition
common/metadata.c:61
dt_get_printer_info
void dt_get_printer_info(const char *printer_name, dt_printer_info_t *pinfo)
Definition
cups_print.c:87
dt_print_file
void dt_print_file(const int32_t imgid, const char *filename, const char *job_title, const dt_print_info_t *pinfo)
Definition
cups_print.c:426
dt_get_medium
dt_medium_info_t * dt_get_medium(GList *media, const char *name)
Definition
cups_print.c:410
dt_get_media_type
GList * dt_get_media_type(const dt_printer_info_t *printer)
Definition
cups_print.c:373
dt_printers_discovery
void dt_printers_discovery(void(*cb)(dt_printer_info_t *pr, void *user_data), void *user_data)
Definition
cups_print.c:215
dt_printers_abort_discovery
void dt_printers_abort_discovery(void)
Definition
cups_print.c:210
dt_get_print_layout
void dt_get_print_layout(const dt_print_info_t *prt, const int32_t area_width, const int32_t area_height, float *px, float *py, float *pwidth, float *pheight, float *ax, float *ay, float *awidth, float *aheight, gboolean *borderless)
Definition
cups_print.c:591
MAX_NAME
#define MAX_NAME
Definition
cups_print.h:28
dt_get_paper
dt_paper_info_t * dt_get_paper(GList *papers, const char *name)
Definition
cups_print.c:245
dt_get_papers
GList * dt_get_papers(const dt_printer_info_t *printer)
Definition
cups_print.c:271
dt_init_print_info
void dt_init_print_info(dt_print_info_t *pinfo)
Definition
cups_print.c:77
dt_alignment_t
dt_alignment_t
Definition
cups_print.h:30
ALIGNMENT_TOP_RIGHT
@ ALIGNMENT_TOP_RIGHT
Definition
cups_print.h:33
ALIGNMENT_LEFT
@ ALIGNMENT_LEFT
Definition
cups_print.h:34
ALIGNMENT_CENTER
@ ALIGNMENT_CENTER
Definition
cups_print.h:35
ALIGNMENT_BOTTOM_RIGHT
@ ALIGNMENT_BOTTOM_RIGHT
Definition
cups_print.h:39
ALIGNMENT_TOP_LEFT
@ ALIGNMENT_TOP_LEFT
Definition
cups_print.h:31
ALIGNMENT_BOTTOM
@ ALIGNMENT_BOTTOM
Definition
cups_print.h:38
ALIGNMENT_TOP
@ ALIGNMENT_TOP
Definition
cups_print.h:32
ALIGNMENT_RIGHT
@ ALIGNMENT_RIGHT
Definition
cups_print.h:36
ALIGNMENT_BOTTOM_LEFT
@ ALIGNMENT_BOTTOM_LEFT
Definition
cups_print.h:37
dt_medium_info_t
Definition
cups_print.h:49
dt_medium_info_t::common_name
char common_name[128]
Definition
cups_print.h:50
dt_medium_info_t::name
char name[128]
Definition
cups_print.h:50
dt_page_setup_t
Definition
cups_print.h:54
dt_page_setup_t::margin_bottom
double margin_bottom
Definition
cups_print.h:56
dt_page_setup_t::margin_right
double margin_right
Definition
cups_print.h:56
dt_page_setup_t::margin_left
double margin_left
Definition
cups_print.h:56
dt_page_setup_t::margin_top
double margin_top
Definition
cups_print.h:56
dt_page_setup_t::landscape
gboolean landscape
Definition
cups_print.h:55
dt_paper_info_t
Definition
cups_print.h:43
dt_paper_info_t::height
double height
Definition
cups_print.h:45
dt_paper_info_t::width
double width
Definition
cups_print.h:45
dt_paper_info_t::name
char name[128]
Definition
cups_print.h:44
dt_paper_info_t::common_name
char common_name[128]
Definition
cups_print.h:44
dt_print_info_t
Definition
cups_print.h:70
dt_print_info_t::medium
dt_medium_info_t medium
Definition
cups_print.h:74
dt_print_info_t::paper
dt_paper_info_t paper
Definition
cups_print.h:73
dt_print_info_t::printer
dt_printer_info_t printer
Definition
cups_print.h:71
dt_print_info_t::page
dt_page_setup_t page
Definition
cups_print.h:72
dt_printer_info_t
Definition
cups_print.h:60
dt_printer_info_t::name
char name[128]
Definition
cups_print.h:61
dt_printer_info_t::intent
dt_iop_color_intent_t intent
Definition
cups_print.h:64
dt_printer_info_t::hw_margin_top
double hw_margin_top
Definition
cups_print.h:63
dt_printer_info_t::hw_margin_right
double hw_margin_right
Definition
cups_print.h:63
dt_printer_info_t::profile
char profile[256]
Definition
cups_print.h:65
dt_printer_info_t::is_turboprint
gboolean is_turboprint
Definition
cups_print.h:66
dt_printer_info_t::hw_margin_left
double hw_margin_left
Definition
cups_print.h:63
dt_printer_info_t::resolution
int resolution
Definition
cups_print.h:62
dt_printer_info_t::hw_margin_bottom
double hw_margin_bottom
Definition
cups_print.h:63
src
common
cups_print.h
Generated by
1.9.8