1#ifndef NVIM_HARDCOPY_H
2#define NVIM_HARDCOPY_H
3
4#include <stdint.h>
5#include <stdlib.h> // for size_t
6
7#include "nvim/globals.h" // for TriState
8#include "nvim/types.h" // for char_u
9#include "nvim/ex_cmds_defs.h" // for exarg_T
10
11/*
12 * Structure to hold printing color and font attributes.
13 */
14typedef struct {
15 uint32_t fg_color;
16 uint32_t bg_color;
17 TriState bold;
18 TriState italic;
19 TriState underline;
20 int undercurl;
21} prt_text_attr_T;
22
23/*
24 * Structure passed back to the generic printer code.
25 */
26typedef struct {
27 int n_collated_copies;
28 int n_uncollated_copies;
29 int duplex;
30 int chars_per_line;
31 int lines_per_page;
32 int has_color;
33 prt_text_attr_T number;
34 int modec;
35 int do_syntax;
36 int user_abort;
37 char_u *jobname;
38 char_u *outfile;
39 char_u *arguments;
40} prt_settings_T;
41
42/*
43 * Generic option table item, only used for printer at the moment.
44 */
45typedef struct {
46 const char *name;
47 int hasnum;
48 int number;
49 char_u *string; /* points into option string */
50 int strlen;
51 int present;
52} option_table_T;
53
54#define OPT_PRINT_TOP 0
55#define OPT_PRINT_BOT 1
56#define OPT_PRINT_LEFT 2
57#define OPT_PRINT_RIGHT 3
58#define OPT_PRINT_HEADERHEIGHT 4
59#define OPT_PRINT_SYNTAX 5
60#define OPT_PRINT_NUMBER 6
61#define OPT_PRINT_WRAP 7
62#define OPT_PRINT_DUPLEX 8
63#define OPT_PRINT_PORTRAIT 9
64#define OPT_PRINT_PAPER 10
65#define OPT_PRINT_COLLATE 11
66#define OPT_PRINT_JOBSPLIT 12
67#define OPT_PRINT_FORMFEED 13
68#define OPT_PRINT_NUM_OPTIONS 14
69
70/* For prt_get_unit(). */
71#define PRT_UNIT_NONE -1
72#define PRT_UNIT_PERC 0
73#define PRT_UNIT_INCH 1
74#define PRT_UNIT_MM 2
75#define PRT_UNIT_POINT 3
76#define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"}
77
78#define PRINT_NUMBER_WIDTH 8
79
80
81#ifdef INCLUDE_GENERATED_DECLARATIONS
82# include "hardcopy.h.generated.h"
83#endif
84#endif // NVIM_HARDCOPY_H
85