chalk

kis_dlg_preferences.h
1/*
2 * preferencesdlg.h - part of KImageShop^WChalk
3 *
4 * Copyright (c) 1999 Michael Koch <koch@kde.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef __preferencesdlg_h__
22#define __preferencesdlg_h__
23
24#include <tqwidget.h>
25
26#include <kdialogbase.h>
27
28#include <kopalettemanager.h>
29
30#include "kis_canvas.h"
31
32#include "wdggeneralsettings.h"
33#include "wdgtabletsettings.h"
34#include "wdgtabletdevicesettings.h"
35#include "wdgperformancesettings.h"
36#include "wdgdisplaysettings.h"
37#include "wdggridsettings.h"
38
39class TQLineEdit;
40class TQCheckBox;
41class KURLRequester;
42class WdgColorSettings;
43class KisCmbIDList;
44class KisID;
45
49class GeneralTab : public WdgGeneralSettings
50{
51 TQ_OBJECT
52
53
54public:
55
56 GeneralTab( TQWidget *parent = 0, const char *name = 0 );
57
58 enumCursorStyle cursorStyle();
59 enumKoDockability dockability();
60 float dockerFontSize();
61
62 void setDefault();
63
64};
65
66//=======================
67
68class ColorSettingsTab : public TQWidget
69{
70 TQ_OBJECT
71
72
73public:
74
75 ColorSettingsTab( TQWidget *parent = 0, const char * name = 0 );
76
77private slots:
78
79 void refillMonitorProfiles(const KisID & s);
80 void refillPrintProfiles(const KisID & s);
81
82public:
83 void setDefault();
84 WdgColorSettings * m_page;
85};
86
87
91class PerformanceTab : public WdgPerformanceSettings
92{
93TQ_OBJECT
94
95
96public:
97 PerformanceTab( TQWidget *parent = 0, const char *name = 0 );
98
99public:
100 void setDefault();
101};
102
103//=======================
104
105
109class TabletSettingsTab : public WdgTabletSettings
110{
111TQ_OBJECT
112
113
114public:
115 TabletSettingsTab( TQWidget *parent = 0, const char *name = 0 );
116
117public:
118 void setDefault();
119 void applySettings();
120
121private slots:
122 void slotActivateDevice(int deviceIndex);
123 void slotSetDeviceEnabled(bool enabled);
124 void slotConfigureDevice();
125 void applyTabletDeviceSettings();
126
127#ifdef EXTENDED_X11_TABLET_SUPPORT
128
129private:
130 class DeviceSettings {
131 public:
132 DeviceSettings(KisCanvasWidget::X11TabletDevice *tabletDevice, bool enabled,
133 TQ_INT32 xAxis, TQ_INT32 yAxis, TQ_INT32 pressureAxis,
134 TQ_INT32 xTiltAxis, TQ_INT32 yTiltAxis, TQ_INT32 wheelAxis,
135 TQ_INT32 toolIDAxis, TQ_INT32 serialNumberAxis);
136 DeviceSettings();
137
138 void applySettings();
139
140 void setEnabled(bool enabled);
141 bool enabled() const;
142
143 TQ_INT32 numAxes() const;
144
145 void setXAxis(TQ_INT32 axis);
146 void setYAxis(TQ_INT32 axis);
147 void setPressureAxis(TQ_INT32 axis);
148 void setXTiltAxis(TQ_INT32 axis);
149 void setYTiltAxis(TQ_INT32 axis);
150 void setWheelAxis(TQ_INT32 axis);
151 void setToolIDAxis(TQ_INT32 axis);
152 void setSerialNumberAxis(TQ_INT32 axis);
153
154 TQ_INT32 xAxis() const;
155 TQ_INT32 yAxis() const;
156 TQ_INT32 pressureAxis() const;
157 TQ_INT32 xTiltAxis() const;
158 TQ_INT32 yTiltAxis() const;
159 TQ_INT32 wheelAxis() const;
160 TQ_INT32 toolIDAxis() const;
161 TQ_INT32 serialNumberAxis() const;
162
163 private:
164 KisCanvasWidget::X11TabletDevice *m_tabletDevice;
165
166 bool m_enabled;
167 TQ_INT32 m_xAxis;
168 TQ_INT32 m_yAxis;
169 TQ_INT32 m_pressureAxis;
170 TQ_INT32 m_xTiltAxis;
171 TQ_INT32 m_yTiltAxis;
172 TQ_INT32 m_wheelAxis;
173 TQ_INT32 m_toolIDAxis;
174 TQ_INT32 m_serialNumberAxis;
175 };
176
177 class TabletDeviceSettingsDialog : public KDialogBase {
178 typedef KDialogBase super;
179
180 public:
181 TabletDeviceSettingsDialog(const TQString& deviceName,
182 DeviceSettings settings,
183 TQWidget *parent = 0,
184 const char *name = 0);
185 virtual ~TabletDeviceSettingsDialog();
186
187 DeviceSettings settings();
188
189 private:
190 WdgTabletDeviceSettings *m_page;
191 DeviceSettings m_settings;
192 };
193
194 void initTabletDevices();
195
196 TQValueVector<DeviceSettings> m_deviceSettings;
197#endif
198};
199
200//=======================
201
202
206class DisplaySettingsTab : public WdgDisplaySettings
207{
208TQ_OBJECT
209
210
211public:
212 DisplaySettingsTab( TQWidget *parent = 0, const char *name = 0 );
213
214public:
215 void setDefault();
216protected slots:
217 void slotUseOpenGLToggled(bool isChecked);
218};
219
220//=======================
221
222
226class GridSettingsTab : public WdgGridSettingsBase {
227 TQ_OBJECT
228
229 public:
230 GridSettingsTab(TQWidget* parent);
231 public:
232 void setDefault();
233 private slots:
234 void linkSpacingToggled(bool);
235 void spinBoxHSpacingChanged(int );
236 void spinBoxVSpacingChanged(int );
237 private:
238 bool m_linkSpacing;
239};
240
241//=======================
242
243
247class PreferencesDialog : public KDialogBase
248{
249 TQ_OBJECT
250
251
252public:
253
254 static bool editPreferences();
255
256
257protected:
258
259 PreferencesDialog( TQWidget *parent = 0, const char *name = 0 );
260 ~PreferencesDialog();
261
262protected:
263
264 GeneralTab* m_general;
265 ColorSettingsTab* m_colorSettings;
266 PerformanceTab* m_performanceSettings;
267 TabletSettingsTab * m_tabletSettings;
268 DisplaySettingsTab * m_displaySettings;
269 GridSettingsTab* m_gridSettings;
270
271protected slots:
272
273 void slotDefault();
274
275};
276
277#endif
Display settings tab for preferences dialog.
"General"-tab for preferences dialog
Grid settings tab for preferences dialog.
A combobox that is associated with a list of KisID's.
Chalk has a large number of extensible resources.
Definition kis_id.h:57
"Performance"-tab for preferences dialog
Tablet settings tab for preferences dialog.