Synchronize with FreeType 2/2.
[ttfautohint.git] / frontend / maingui.h
blob351993d7d750d8a54d1255f6e01724688ba14349
1 // maingui.h
3 // Copyright (C) 2012-2016 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 <QGridLayout>
28 #include <QLabel>
29 #include <QMainWindow>
30 #include <QMenuBar>
31 #include <QMessageBox>
32 #include <QProgressDialog>
33 #include <QPushButton>
34 #include <QSpinBox>
35 #include <QStatusBar>
37 #include "ddlineedit.h"
38 #include "ttlineedit.h"
40 #include <stdio.h>
41 #include <ttfautohint.h>
42 #include <numberset.h>
44 class QAction;
45 class QButtonGroup;
46 class QCheckBox;
47 class QComboBox;
48 class QFile;
49 class QLabel;
50 class QLocale;
51 class QMenu;
52 class QPushButton;
53 class QSpinBox;
55 class Drag_Drop_Line_Edit;
56 class Tooltip_Line_Edit;
58 class Main_GUI
59 : public QMainWindow
61 Q_OBJECT
63 public:
64 Main_GUI(bool,
65 int, int, int,
66 bool, bool,
67 bool, int,
68 const char*, int,
69 bool, bool, bool,
70 bool, bool, bool,
71 const char*, const char*, const char*,
72 bool, bool, bool);
73 ~Main_GUI();
75 protected:
76 void closeEvent(QCloseEvent*);
78 private slots:
79 void about();
80 void browse_input();
81 void browse_output();
82 void browse_control();
83 void check_min();
84 void check_max();
85 void check_limit();
86 void check_dehint();
87 void check_no_limit();
88 void check_no_increase();
89 void check_default_stem_width();
90 void absolute_input();
91 void absolute_output();
92 void absolute_control();
93 void check_number_set();
94 void check_family_suffix();
95 void clear_status_bar();
96 void check_watch();
97 void watch_files();
98 void check_run();
99 void run();
101 private:
102 int hinting_range_min;
103 int hinting_range_max;
104 int hinting_limit;
105 int gray_strong_stem_width;
106 int gdi_cleartype_strong_stem_width;
107 int dw_cleartype_strong_stem_width;
108 int increase_x_height;
109 QString x_height_snapping_exceptions_string;
110 number_range* x_height_snapping_exceptions;
111 int fallback_stem_width;
112 int ignore_restrictions;
113 int windows_compatibility;
114 int adjust_subglyphs;
115 int hint_composites;
116 int no_info;
117 int detailed_info;
118 int default_script_idx;
119 int fallback_script_idx;
120 QString family_suffix;
121 int symbol;
122 int dehint;
123 int TTFA_info;
125 void create_layout(bool);
126 void create_horizontal_layout();
127 void create_vertical_layout();
129 QTimer* timer;
130 QFileInfo fileinfo_input_file;
131 QFileInfo fileinfo_control_file;
132 QDateTime datetime_input_file;
133 QDateTime datetime_control_file;
135 void create_connections();
136 void create_actions();
137 void create_menus();
138 void create_status_bar();
139 void set_defaults();
140 void read_settings();
141 void write_settings();
143 int check_filenames(const QString&,
144 const QString&,
145 const QString&);
146 int open_files(const QString&, FILE**,
147 const QString&, FILE**,
148 const QString&, FILE**);
149 int handle_error(TA_Error, const unsigned char*, QString);
151 QMenu* file_menu;
152 QMenu* help_menu;
154 QLabel* input_label;
155 Drag_Drop_Line_Edit* input_line;
156 QPushButton* input_button;
158 QLabel* output_label;
159 Drag_Drop_Line_Edit* output_line;
160 QPushButton* output_button;
162 QLabel* control_label;
163 Drag_Drop_Line_Edit* control_line;
164 QPushButton* control_button;
166 QLabel* min_label;
167 QSpinBox* min_box;
168 QLabel* max_label;
169 QSpinBox* max_box;
171 QLabel* stem_label;
172 QCheckBox* gray_box;
173 QCheckBox* gdi_box;
174 QCheckBox* dw_box;
176 QLabel* default_label;
177 QComboBox* default_box;
178 QLabel* fallback_label;
179 QComboBox* fallback_box;
181 QLabel* limit_label;
182 QString limit_label_text_with_key;
183 QString limit_label_text;
184 QSpinBox* limit_box;
185 QCheckBox* no_limit_box;
186 QString no_limit_box_text_with_key;
187 QString no_limit_box_text;
189 QLabel* increase_label;
190 QString increase_label_text_with_key;
191 QString increase_label_text;
192 QSpinBox* increase_box;
193 QCheckBox* no_increase_box;
194 QString no_increase_box_text_with_key;
195 QString no_increase_box_text;
197 QLabel* snapping_label;
198 Tooltip_Line_Edit* snapping_line;
199 QLabel* family_suffix_label;
200 Tooltip_Line_Edit* family_suffix_line;
202 QLabel* stem_width_label;
203 QString stem_width_label_text_with_key;
204 QString stem_width_label_text;
205 QSpinBox* stem_width_box;
206 QCheckBox* default_stem_width_box;
207 QString default_stem_width_box_text_with_key;
208 QString default_stem_width_box_text;
210 QCheckBox* wincomp_box;
211 QCheckBox* adjust_box;
212 QCheckBox* hint_box;
213 QCheckBox* symbol_box;
214 QCheckBox* dehint_box;
215 QLabel* info_label;
216 QComboBox* info_box;
217 QCheckBox* TTFA_box;
219 QCheckBox* watch_box;
220 QPushButton* run_button;
222 QAction* exit_act;
223 QAction* about_act;
224 QAction* about_Qt_act;
226 QLocale* locale;
229 #endif // MAINGUI_H_
231 // end of maingui.h