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