Update to new release.
[ttfautohint.git] / frontend / maingui.h
blob9af895728972fc0f4482d0934eadaf76cbc0bfdc
1 // maingui.h
3 // Copyright (C) 2012-2013 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(int, int, int,
48 bool, bool,
49 bool, int,
50 const char*,
51 bool, bool, bool,
52 bool, bool, const char*, bool,
53 bool);
54 ~Main_GUI();
56 void create_alternative_layout();
58 protected:
59 void closeEvent(QCloseEvent*);
61 private slots:
62 void about();
63 void browse_input();
64 void browse_output();
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 absolute_input();
72 void absolute_output();
73 void check_number_set();
74 void clear_status_bar();
75 void check_run();
76 void run();
78 private:
79 int hinting_range_min;
80 int hinting_range_max;
81 int hinting_limit;
82 int gray_strong_stem_width;
83 int gdi_cleartype_strong_stem_width;
84 int dw_cleartype_strong_stem_width;
85 int increase_x_height;
86 QString x_height_snapping_exceptions_string;
87 number_range* x_height_snapping_exceptions;
88 int ignore_restrictions;
89 int windows_compatibility;
90 int pre_hinting;
91 int hint_composites;
92 int no_info;
93 int fallback_script_idx;
94 int symbol;
95 int dehint;
97 void create_layout();
99 void create_connections();
100 void create_actions();
101 void create_menus();
102 void create_status_bar();
103 void set_defaults();
104 void read_settings();
105 void write_settings();
107 int check_filenames(const QString&, const QString&);
108 int open_files(const QString&, FILE**, const QString&, FILE**);
109 int handle_error(TA_Error, const unsigned char*, QString);
111 QMenu* file_menu;
112 QMenu* help_menu;
114 QLabel* input_label;
115 Drag_Drop_Line_Edit* input_line;
116 QPushButton* input_button;
118 QLabel* output_label;
119 Drag_Drop_Line_Edit* output_line;
120 QPushButton* output_button;
122 QLabel* min_label;
123 QSpinBox* min_box;
124 QLabel* max_label;
125 QSpinBox* max_box;
127 QLabel* stem_label;
128 QCheckBox* gray_box;
129 QCheckBox* gdi_box;
130 QCheckBox* dw_box;
132 QLabel* fallback_label;
133 QComboBox* fallback_box;
135 QLabel* limit_label;
136 QSpinBox* limit_box;
137 QCheckBox* no_limit_box;
139 QLabel* increase_label;
140 QSpinBox* increase_box;
141 QCheckBox* no_increase_box;
143 QLabel* snapping_label;
144 Tooltip_Line_Edit* snapping_line;
146 QCheckBox* wincomp_box;
147 QCheckBox* pre_box;
148 QCheckBox* hint_box;
149 QCheckBox* symbol_box;
150 QCheckBox* dehint_box;
151 QCheckBox* info_box;
153 QPushButton* run_button;
155 QAction* exit_act;
156 QAction* about_act;
157 QAction* about_Qt_act;
159 QLocale* locale;
162 #endif // __MAINGUI_H__
164 // end of maingui.h