While assigning styles, handle glyph components of composites also.
[ttfautohint.git] / frontend / maingui.h
blob03d09560e26d72b54c07d05ce9aafbd2113f654e
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*,
52 bool, bool, bool,
53 bool, bool, const char*, const char*,
54 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 check_min();
65 void check_max();
66 void check_limit();
67 void check_dehint();
68 void check_no_limit();
69 void check_no_increase();
70 void absolute_input();
71 void absolute_output();
72 void check_number_set();
73 void clear_status_bar();
74 void check_run();
75 void run();
77 private:
78 int hinting_range_min;
79 int hinting_range_max;
80 int hinting_limit;
81 int gray_strong_stem_width;
82 int gdi_cleartype_strong_stem_width;
83 int dw_cleartype_strong_stem_width;
84 int increase_x_height;
85 QString x_height_snapping_exceptions_string;
86 number_range* x_height_snapping_exceptions;
87 int ignore_restrictions;
88 int windows_compatibility;
89 int pre_hinting;
90 int hint_composites;
91 int no_info;
92 int default_script_idx;
93 int fallback_script_idx;
94 int symbol;
95 int dehint;
97 void create_layout(bool);
98 void create_horizontal_layout();
99 void create_vertical_layout();
102 void create_connections();
103 void create_actions();
104 void create_menus();
105 void create_status_bar();
106 void set_defaults();
107 void read_settings();
108 void write_settings();
110 int check_filenames(const QString&, const QString&);
111 int open_files(const QString&, FILE**, const QString&, FILE**);
112 int handle_error(TA_Error, const unsigned char*, QString);
114 QMenu* file_menu;
115 QMenu* help_menu;
117 QLabel* input_label;
118 Drag_Drop_Line_Edit* input_line;
119 QPushButton* input_button;
121 QLabel* output_label;
122 Drag_Drop_Line_Edit* output_line;
123 QPushButton* output_button;
125 QLabel* min_label;
126 QSpinBox* min_box;
127 QLabel* max_label;
128 QSpinBox* max_box;
130 QLabel* stem_label;
131 QCheckBox* gray_box;
132 QCheckBox* gdi_box;
133 QCheckBox* dw_box;
135 QLabel* default_label;
136 QComboBox* default_box;
137 QLabel* fallback_label;
138 QComboBox* fallback_box;
140 QLabel* limit_label;
141 QSpinBox* limit_box;
142 QCheckBox* no_limit_box;
144 QLabel* increase_label;
145 QSpinBox* increase_box;
146 QCheckBox* no_increase_box;
148 QLabel* snapping_label;
149 Tooltip_Line_Edit* snapping_line;
151 QCheckBox* wincomp_box;
152 QCheckBox* pre_box;
153 QCheckBox* hint_box;
154 QCheckBox* symbol_box;
155 QCheckBox* dehint_box;
156 QCheckBox* info_box;
158 QPushButton* run_button;
160 QAction* exit_act;
161 QAction* about_act;
162 QAction* about_Qt_act;
164 QLocale* locale;
167 #endif // __MAINGUI_H__
169 // end of maingui.h