[doc] Update `ucharclasses.sty`.
[ttfautohint.git] / frontend / maingui.h
blob543c2480b85a31da128f80a2d75cb8de93f5d61c
1 // maingui.h
3 // Copyright (C) 2012-2022 by Werner Lemberg.
4 //
5 // This file is part of the ttfautohint library, and may only be used,
6 // modified, and distributed under the terms given in `COPYING'. By
7 // continuing to use, modify, or distribute this file you indicate that you
8 // have read `COPYING' and understand and accept it fully.
9 //
10 // The file `COPYING' mentioned in the previous paragraph is distributed
11 // with the ttfautohint library.
14 #ifndef MAINGUI_H_
15 #define MAINGUI_H_
17 #include <config.h>
19 #include <QAction>
20 #include <QCheckBox>
21 #include <QComboBox>
22 #include <QCompleter>
23 #include <QDateTime>
24 #include <QDesktopWidget>
25 #include <QFileDialog>
26 #include <QFileSystemModel>
27 #include <QFileSystemWatcher>
28 #include <QGridLayout>
29 #include <QLabel>
30 #include <QMainWindow>
31 #include <QMenuBar>
32 #include <QMessageBox>
33 #include <QProgressDialog>
34 #include <QPushButton>
35 #include <QSpinBox>
36 #include <QStatusBar>
38 #include "ddlineedit.h"
39 #include "ttlineedit.h"
41 #include <stdio.h>
42 #include <ttfautohint.h>
43 #include <numberset.h>
45 class QAction;
46 class QButtonGroup;
47 class QCheckBox;
48 class QComboBox;
49 class QFile;
50 class QLabel;
51 class QLocale;
52 class QMenu;
53 class QPushButton;
54 class QSpinBox;
56 class Drag_Drop_Line_Edit;
57 class Tooltip_Line_Edit;
59 class Main_GUI
60 : public QMainWindow
62 Q_OBJECT
64 public:
65 Main_GUI(bool,
66 int, int, int,
67 int, int,
68 int, int,
69 const char*, int,
70 bool, bool, bool,
71 bool, bool, bool,
72 const char*, const char*, bool,
73 const char*, bool, bool, bool);
74 ~Main_GUI();
76 protected:
77 void closeEvent(QCloseEvent*);
79 private slots:
80 void about();
81 void browse_input();
82 void browse_output();
83 void browse_control();
84 void browse_reference();
85 void check_min();
86 void check_max();
87 void check_limit();
88 void check_dehint();
89 void check_no_limit();
90 void check_no_x_increase();
91 void check_default_stem_width();
92 void absolute_input();
93 void absolute_output();
94 void absolute_control();
95 void absolute_reference();
96 void set_ref_idx_box_max();
97 void check_number_set();
98 void check_family_suffix();
99 void clear_status_bar();
100 void start_timer();
101 void check_watch();
102 void watch_files();
103 void check_run();
104 void run();
106 private:
107 int hinting_range_min;
108 int hinting_range_max;
109 int hinting_limit;
110 int gray_stem_width_mode;
111 int gdi_cleartype_stem_width_mode;
112 int dw_cleartype_stem_width_mode;
113 int increase_x_height;
114 QString x_height_snapping_exceptions_string;
115 number_range* x_height_snapping_exceptions;
116 int fallback_stem_width;
117 int ignore_restrictions;
118 int windows_compatibility;
119 int adjust_subglyphs;
120 int hint_composites;
121 int no_info;
122 int detailed_info;
123 int default_script_idx;
124 int fallback_script_idx;
125 int fallback_scaling;
126 QString family_suffix;
127 int reference_index;
128 int symbol;
129 int dehint;
130 int TTFA_info;
132 const int fallback_do_scale;
133 const int fallback_do_hint;
135 int latn_script_idx;
136 int none_script_idx;
138 void create_layout(bool);
139 void create_horizontal_layout();
140 void create_vertical_layout();
142 enum CheckState {
143 DoCheck,
144 CheckNow,
145 CheckLater
148 QFileSystemWatcher* file_watcher;
149 QTimer* timer;
150 QFileInfo fileinfo_input_file;
151 QFileInfo fileinfo_control_file;
152 QFileInfo fileinfo_reference_file;
153 QDateTime datetime_input_file;
154 QDateTime datetime_control_file;
155 QDateTime datetime_reference_file;
156 CheckState check;
158 void create_connections();
159 void create_actions();
160 void create_menus();
161 void create_status_bar();
162 void set_defaults();
163 void read_settings();
164 void write_settings();
166 int check_filenames(const QString&,
167 const QString&,
168 const QString&,
169 const QString&);
170 int open_files(const QString&, FILE**,
171 const QString&, FILE**,
172 const QString&, FILE**,
173 const QString&, FILE**);
174 int handle_error(TA_Error, const unsigned char*, QString);
176 void stop_watching();
178 QMenu* file_menu;
179 QMenu* help_menu;
181 QLabel* input_label;
182 Drag_Drop_Line_Edit* input_line;
183 QPushButton* input_button;
185 QLabel* output_label;
186 Drag_Drop_Line_Edit* output_line;
187 QPushButton* output_button;
189 QLabel* control_label;
190 Drag_Drop_Line_Edit* control_line;
191 QPushButton* control_button;
193 QLabel* reference_label;
194 Drag_Drop_Line_Edit* reference_line;
195 QPushButton* reference_button;
197 QLabel* ref_idx_label;
198 QSpinBox* ref_idx_box;
200 QLabel* min_label;
201 QSpinBox* min_box;
202 QLabel* max_label;
203 QSpinBox* max_box;
205 QLabel* stem_label;
207 QLabel* gray_label;
208 QComboBox* gray_box;
209 QLabel* gdi_label;
210 QComboBox* gdi_box;
211 QLabel* dw_label;
212 QComboBox* dw_box;
214 QLabel* default_label;
215 QComboBox* default_box;
216 QLabel* fallback_label;
217 QComboBox* fallback_box;
218 QComboBox* fallback_hint_or_scale_box;
220 QLabel* limit_label;
221 QString limit_label_text_with_key;
222 QString limit_label_text;
223 QSpinBox* limit_box;
224 QCheckBox* no_limit_box;
225 QString no_limit_box_text_with_key;
226 QString no_limit_box_text;
228 QLabel* x_increase_label;
229 QString x_increase_label_text_with_key;
230 QString x_increase_label_text;
231 QSpinBox* x_increase_box;
232 QCheckBox* no_x_increase_box;
233 QString no_x_increase_box_text_with_key;
234 QString no_x_increase_box_text;
236 QLabel* snapping_label;
237 Tooltip_Line_Edit* snapping_line;
238 QLabel* family_suffix_label;
239 Tooltip_Line_Edit* family_suffix_line;
241 QLabel* stem_width_label;
242 QString stem_width_label_text_with_key;
243 QString stem_width_label_text;
244 QSpinBox* stem_width_box;
245 QCheckBox* default_stem_width_box;
246 QString default_stem_width_box_text_with_key;
247 QString default_stem_width_box_text;
249 QCheckBox* wincomp_box;
250 QCheckBox* adjust_box;
251 QCheckBox* hint_box;
252 QCheckBox* symbol_box;
253 QCheckBox* dehint_box;
254 QLabel* info_label;
255 QComboBox* info_box;
256 QCheckBox* TTFA_box;
258 QCheckBox* watch_box;
259 QPushButton* run_button;
261 QAction* exit_act;
262 QAction* about_act;
263 QAction* about_Qt_act;
265 QLocale* locale;
268 #endif // MAINGUI_H_
270 // end of maingui.h