hardcopy.h
Go to the documentation of this file.
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/ex_cmds_defs.h" // for exarg_T
8 #include "nvim/globals.h" // for TriState
9 #include "nvim/types.h" // for char_u
10 
11 /*
12  * Structure to hold printing color and font attributes.
13  */
14 typedef struct {
15  uint32_t fg_color;
16  uint32_t bg_color;
20  int undercurl;
22 
23 /*
24  * Structure passed back to the generic printer code.
25  */
26 typedef struct {
29  int duplex;
32  int has_color;
34  int modec;
35  int do_syntax;
41 
42 /*
43  * Generic option table item, only used for printer at the moment.
44  */
45 typedef 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;
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
TriState
TriState
Definition: types.h:29
prt_settings_T::number
prt_text_attr_T number
Definition: hardcopy.h:33
prt_settings_T::chars_per_line
int chars_per_line
Definition: hardcopy.h:30
prt_text_attr_T::fg_color
uint32_t fg_color
Definition: hardcopy.h:15
prt_settings_T::duplex
int duplex
Definition: hardcopy.h:29
prt_settings_T::outfile
char_u * outfile
Definition: hardcopy.h:38
types.h
option_table_T
Definition: hardcopy.h:45
option_table_T::number
int number
Definition: hardcopy.h:48
prt_text_attr_T::bg_color
uint32_t bg_color
Definition: hardcopy.h:16
prt_text_attr_T
Definition: hardcopy.h:14
option_table_T::string
char_u * string
Definition: hardcopy.h:49
prt_text_attr_T::bold
TriState bold
Definition: hardcopy.h:17
prt_settings_T::do_syntax
int do_syntax
Definition: hardcopy.h:35
prt_text_attr_T::italic
TriState italic
Definition: hardcopy.h:18
option_table_T::name
const char * name
Definition: hardcopy.h:46
globals.h
prt_settings_T::n_collated_copies
int n_collated_copies
Definition: hardcopy.h:27
prt_text_attr_T::underline
TriState underline
Definition: hardcopy.h:19
prt_settings_T
Definition: hardcopy.h:26
prt_settings_T::lines_per_page
int lines_per_page
Definition: hardcopy.h:31
prt_text_attr_T::undercurl
int undercurl
Definition: hardcopy.h:20
option_table_T::present
int present
Definition: hardcopy.h:51
prt_settings_T::jobname
char_u * jobname
Definition: hardcopy.h:37
prt_settings_T::modec
int modec
Definition: hardcopy.h:34
option_table_T::hasnum
int hasnum
Definition: hardcopy.h:47
char_u
unsigned char char_u
Definition: types.h:12
ex_cmds_defs.h
option_table_T::strlen
int strlen
Definition: hardcopy.h:50
prt_settings_T::user_abort
int user_abort
Definition: hardcopy.h:36
stdlib.h
prt_settings_T::arguments
char_u * arguments
Definition: hardcopy.h:39
prt_settings_T::n_uncollated_copies
int n_uncollated_copies
Definition: hardcopy.h:28
prt_settings_T::has_color
int has_color
Definition: hardcopy.h:32