File: maingui.h

package info (click to toggle)
ttfautohint 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,504 kB
  • ctags: 4,347
  • sloc: ansic: 38,386; sh: 5,749; cpp: 4,131; perl: 340; makefile: 309; sed: 39
file content (266 lines) | stat: -rw-r--r-- 6,042 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
// maingui.h

// Copyright (C) 2012-2016 by Werner Lemberg.
//
// This file is part of the ttfautohint library, and may only be used,
// modified, and distributed under the terms given in `COPYING'.  By
// continuing to use, modify, or distribute this file you indicate that you
// have read `COPYING' and understand and accept it fully.
//
// The file `COPYING' mentioned in the previous paragraph is distributed
// with the ttfautohint library.


#ifndef MAINGUI_H_
#define MAINGUI_H_

#include <config.h>

#include <QAction>
#include <QCheckBox>
#include <QComboBox>
#include <QCompleter>
#include <QDateTime>
#include <QDesktopWidget>
#include <QFileDialog>
#include <QFileSystemModel>
#include <QFileSystemWatcher>
#include <QGridLayout>
#include <QLabel>
#include <QMainWindow>
#include <QMenuBar>
#include <QMessageBox>
#include <QProgressDialog>
#include <QPushButton>
#include <QSpinBox>
#include <QStatusBar>

#include "ddlineedit.h"
#include "ttlineedit.h"

#include <stdio.h>
#include <ttfautohint.h>
#include <numberset.h>

class QAction;
class QButtonGroup;
class QCheckBox;
class QComboBox;
class QFile;
class QLabel;
class QLocale;
class QMenu;
class QPushButton;
class QSpinBox;

class Drag_Drop_Line_Edit;
class Tooltip_Line_Edit;

class Main_GUI
: public QMainWindow
{
  Q_OBJECT

public:
  Main_GUI(bool,
           int, int, int,
           bool, bool,
           bool, int,
           const char*, int,
           bool, bool, bool,
           bool, bool, bool,
           const char*, const char*, bool,
           const char*, bool, bool, bool);
  ~Main_GUI();

protected:
  void closeEvent(QCloseEvent*);

private slots:
  void about();
  void browse_input();
  void browse_output();
  void browse_control();
  void browse_reference();
  void check_min();
  void check_max();
  void check_limit();
  void check_dehint();
  void check_no_limit();
  void check_no_x_increase();
  void check_default_stem_width();
  void absolute_input();
  void absolute_output();
  void absolute_control();
  void absolute_reference();
  void set_ref_idx_box_max();
  void check_number_set();
  void check_family_suffix();
  void clear_status_bar();
  void start_timer();
  void check_watch();
  void watch_files();
  void check_run();
  void run();

private:
  int hinting_range_min;
  int hinting_range_max;
  int hinting_limit;
  int gray_strong_stem_width;
  int gdi_cleartype_strong_stem_width;
  int dw_cleartype_strong_stem_width;
  int increase_x_height;
  QString x_height_snapping_exceptions_string;
  number_range* x_height_snapping_exceptions;
  int fallback_stem_width;
  int ignore_restrictions;
  int windows_compatibility;
  int adjust_subglyphs;
  int hint_composites;
  int no_info;
  int detailed_info;
  int default_script_idx;
  int fallback_script_idx;
  int fallback_scaling;
  QString family_suffix;
  int reference_index;
  int symbol;
  int dehint;
  int TTFA_info;

  const int fallback_do_scale;
  const int fallback_do_hint;

  int latn_script_idx;
  int none_script_idx;

  void create_layout(bool);
  void create_horizontal_layout();
  void create_vertical_layout();

  enum CheckState {
    DoCheck,
    CheckNow,
    CheckLater
  };

  QFileSystemWatcher* file_watcher;
  QTimer* timer;
  QFileInfo fileinfo_input_file;
  QFileInfo fileinfo_control_file;
  QFileInfo fileinfo_reference_file;
  QDateTime datetime_input_file;
  QDateTime datetime_control_file;
  QDateTime datetime_reference_file;
  CheckState check;

  void create_connections();
  void create_actions();
  void create_menus();
  void create_status_bar();
  void set_defaults();
  void read_settings();
  void write_settings();

  int check_filenames(const QString&,
                      const QString&,
                      const QString&,
                      const QString&);
  int open_files(const QString&, FILE**,
                 const QString&, FILE**,
                 const QString&, FILE**,
                 const QString&, FILE**);
  int handle_error(TA_Error, const unsigned char*, QString);

  void stop_watching();

  QMenu* file_menu;
  QMenu* help_menu;

  QLabel* input_label;
  Drag_Drop_Line_Edit* input_line;
  QPushButton* input_button;

  QLabel* output_label;
  Drag_Drop_Line_Edit* output_line;
  QPushButton* output_button;

  QLabel* control_label;
  Drag_Drop_Line_Edit* control_line;
  QPushButton* control_button;

  QLabel* reference_label;
  Drag_Drop_Line_Edit* reference_line;
  QPushButton* reference_button;

  QLabel* ref_idx_label;
  QSpinBox* ref_idx_box;

  QLabel* min_label;
  QSpinBox* min_box;
  QLabel* max_label;
  QSpinBox* max_box;

  QLabel* stem_label;
  QCheckBox* gray_box;
  QCheckBox* gdi_box;
  QCheckBox* dw_box;

  QLabel* default_label;
  QComboBox* default_box;
  QLabel* fallback_label;
  QComboBox* fallback_box;
  QComboBox* fallback_hint_or_scale_box;

  QLabel* limit_label;
  QString limit_label_text_with_key;
  QString limit_label_text;
  QSpinBox* limit_box;
  QCheckBox* no_limit_box;
  QString no_limit_box_text_with_key;
  QString no_limit_box_text;

  QLabel* x_increase_label;
  QString x_increase_label_text_with_key;
  QString x_increase_label_text;
  QSpinBox* x_increase_box;
  QCheckBox* no_x_increase_box;
  QString no_x_increase_box_text_with_key;
  QString no_x_increase_box_text;

  QLabel* snapping_label;
  Tooltip_Line_Edit* snapping_line;
  QLabel* family_suffix_label;
  Tooltip_Line_Edit* family_suffix_line;

  QLabel* stem_width_label;
  QString stem_width_label_text_with_key;
  QString stem_width_label_text;
  QSpinBox* stem_width_box;
  QCheckBox* default_stem_width_box;
  QString default_stem_width_box_text_with_key;
  QString default_stem_width_box_text;

  QCheckBox* wincomp_box;
  QCheckBox* adjust_box;
  QCheckBox* hint_box;
  QCheckBox* symbol_box;
  QCheckBox* dehint_box;
  QLabel* info_label;
  QComboBox* info_box;
  QCheckBox* TTFA_box;

  QCheckBox* watch_box;
  QPushButton* run_button;

  QAction* exit_act;
  QAction* about_act;
  QAction* about_Qt_act;

  QLocale* locale;
};

#endif // MAINGUI_H_

// end of maingui.h