Add option `-t' / `--ttfa-info' to front-ends.
[ttfautohint.git] / frontend / maingui.h
blob87ef1f908b712a7495d2bb3c4e45c3e0f8e79c9c
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, const char*, const char*,
54 bool, bool, bool);
55 ~Main_GUI();
57 protected:
58 void closeEvent(QCloseEvent*);
60 private slots:
61 void about();
62 void browse_input();
63 void browse_output();
64 void browse_deltas();
65 void check_min();
66 void check_max();
67 void check_limit();
68 void check_dehint();
69 void check_no_limit();
70 void check_no_increase();
71 void check_default_stem_width();
72 void absolute_input();
73 void absolute_output();
74 void absolute_deltas();
75 void check_number_set();
76 void clear_status_bar();
77 void check_watch();
78 void watch_files();
79 void check_run();
80 void run();
82 private:
83 int hinting_range_min;
84 int hinting_range_max;
85 int hinting_limit;
86 int gray_strong_stem_width;
87 int gdi_cleartype_strong_stem_width;
88 int dw_cleartype_strong_stem_width;
89 int increase_x_height;
90 QString x_height_snapping_exceptions_string;
91 number_range* x_height_snapping_exceptions;
92 int fallback_stem_width;
93 int ignore_restrictions;
94 int windows_compatibility;
95 int adjust_subglyphs;
96 int hint_composites;
97 int no_info;
98 int default_script_idx;
99 int fallback_script_idx;
100 int symbol;
101 int dehint;
102 int TTFA_info;
104 void create_layout(bool);
105 void create_horizontal_layout();
106 void create_vertical_layout();
108 QTimer* timer;
109 QFileInfo fileinfo_input_file;
110 QFileInfo fileinfo_deltas_file;
111 QDateTime datetime_input_file;
112 QDateTime datetime_deltas_file;
114 void create_connections();
115 void create_actions();
116 void create_menus();
117 void create_status_bar();
118 void set_defaults();
119 void read_settings();
120 void write_settings();
122 int check_filenames(const QString&,
123 const QString&,
124 const QString&);
125 int open_files(const QString&, FILE**,
126 const QString&, FILE**,
127 const QString&, FILE**);
128 int handle_error(TA_Error, const unsigned char*, QString);
130 QMenu* file_menu;
131 QMenu* help_menu;
133 QLabel* input_label;
134 Drag_Drop_Line_Edit* input_line;
135 QPushButton* input_button;
137 QLabel* output_label;
138 Drag_Drop_Line_Edit* output_line;
139 QPushButton* output_button;
141 QLabel* deltas_label;
142 Drag_Drop_Line_Edit* deltas_line;
143 QPushButton* deltas_button;
145 QLabel* min_label;
146 QSpinBox* min_box;
147 QLabel* max_label;
148 QSpinBox* max_box;
150 QLabel* stem_label;
151 QCheckBox* gray_box;
152 QCheckBox* gdi_box;
153 QCheckBox* dw_box;
155 QLabel* default_label;
156 QComboBox* default_box;
157 QLabel* fallback_label;
158 QComboBox* fallback_box;
160 QLabel* limit_label;
161 QString limit_label_text_with_key;
162 QString limit_label_text;
163 QSpinBox* limit_box;
164 QCheckBox* no_limit_box;
165 QString no_limit_box_text_with_key;
166 QString no_limit_box_text;
168 QLabel* increase_label;
169 QString increase_label_text_with_key;
170 QString increase_label_text;
171 QSpinBox* increase_box;
172 QCheckBox* no_increase_box;
173 QString no_increase_box_text_with_key;
174 QString no_increase_box_text;
176 QLabel* snapping_label;
177 Tooltip_Line_Edit* snapping_line;
179 QLabel* stem_width_label;
180 QString stem_width_label_text_with_key;
181 QString stem_width_label_text;
182 QSpinBox* stem_width_box;
183 QCheckBox* default_stem_width_box;
184 QString default_stem_width_box_text_with_key;
185 QString default_stem_width_box_text;
187 QCheckBox* wincomp_box;
188 QCheckBox* adjust_box;
189 QCheckBox* hint_box;
190 QCheckBox* symbol_box;
191 QCheckBox* dehint_box;
192 QCheckBox* info_box;
193 QCheckBox* TTFA_box;
195 QCheckBox* watch_box;
196 QPushButton* run_button;
198 QAction* exit_act;
199 QAction* about_act;
200 QAction* about_Qt_act;
202 QLocale* locale;
205 #endif // __MAINGUI_H__
207 // end of maingui.h