1
/***************************************************************************
2
* Copyright (C) 2003 by Alexander Dymo *
3
* cloudtemple@mksat.net *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
16
#include <qvbuttongroup.h>
17
#include <qapplication.h>
18
#include <qpushbutton.h>
20
#include "flagboxes.h"
22
#include "optiontabs.h"
24
LinkerTab::LinkerTab( QWidget * parent, const char * name )
25
: QWidget(parent, name), radioController(new FlagRadioButtonController()),
26
pathController(new FlagPathEditController()),
27
editController(new FlagEditController())
29
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
30
layout->setAutoAdd(true);
32
QVButtonGroup *map_group = new QVButtonGroup(i18n("Map File"), this);
33
QRadioButton *m_defaultMap = new QRadioButton(i18n("Off"), map_group);
34
m_defaultMap->setChecked(true);
35
new FlagRadioButton(map_group, radioController,
36
"-GS", i18n("Segments"));
37
new FlagRadioButton(map_group, radioController,
38
"-GP", i18n("Publics"));
39
new FlagRadioButton(map_group, radioController,
40
"-GD", i18n("Detailed"));
41
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
42
layout->addSpacing(10);
44
new FlagPathEdit(this, "", pathController,
45
"--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
46
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
47
layout->addSpacing(10);
49
new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
50
"-$M", i18n("Reserved address space:"));
51
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
52
layout->addSpacing(10);
57
LinkerTab::~LinkerTab( )
59
delete radioController;
60
delete pathController;
61
delete editController;
64
void LinkerTab::readFlags( QStringList * str )
66
pathController->readFlags(str);
67
radioController->readFlags(str);
68
editController->readFlags(str);
71
void LinkerTab::writeFlags( QStringList * str )
73
pathController->writeFlags(str);
74
radioController->writeFlags(str);
75
editController->writeFlags(str);
80
LocationsTab::LocationsTab( QWidget * parent, const char * name )
81
:QWidget(parent, name), pathController(new FlagPathEditController())
83
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
84
layout->setAutoAdd(true);
86
new FlagPathEdit(this, ":", pathController,
87
"-I", i18n("Include search path (delimited by \":\"):"));
88
new FlagPathEdit(this, ":", pathController,
89
"-R", i18n("Resource search path (delimited by \":\"):"));
90
new FlagPathEdit(this, ":", pathController,
91
"-U", i18n("Unit search path (delimited by \":\"):"));
92
new FlagPathEdit(this, ":", pathController,
93
"-O", i18n("Object search path (delimited by \":\"):"));
94
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
98
LocationsTab::~LocationsTab( )
100
delete pathController;
103
void LocationsTab::readFlags( QStringList * str )
105
pathController->readFlags(str);
108
void LocationsTab::writeFlags( QStringList * str )
110
pathController->writeFlags(str);
115
Locations2Tab::Locations2Tab( QWidget * parent, const char * name )
116
:QWidget(parent, name), pathController(new FlagPathEditController())
118
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
119
layout->setAutoAdd(true);
121
new FlagPathEdit(this, "", pathController,
122
"-E", i18n("Executable output directory:"));
123
new FlagPathEdit(this, "", pathController,
124
"-N", i18n("Unit output directory:"));
125
new FlagPathEdit(this, "", pathController,
126
"-LE", i18n("Package directory:"));
127
new FlagPathEdit(this, "", pathController,
128
"-LN", i18n("Package source code directory:"));
129
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
130
layout->addStretch();
133
Locations2Tab::~Locations2Tab( )
135
delete pathController;
138
void Locations2Tab::readFlags( QStringList * str )
140
pathController->readFlags(str);
143
void Locations2Tab::writeFlags( QStringList * str )
145
pathController->writeFlags(str);
150
GeneralTab::GeneralTab( QWidget * parent, const char * name )
151
:QWidget(parent, name), controller(new FlagCheckBoxController()),
152
editController(new FlagEditController())
154
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
155
layout->setAutoAdd(true);
157
QVButtonGroup *build_group = new QVButtonGroup(i18n("Build"), this);
158
new FlagCheckBox(build_group, controller,
159
"-B", i18n("Build all units"));
160
new FlagCheckBox(build_group, controller,
161
"-M", i18n("Make modified units"));
162
new FlagCheckBox(build_group, controller,
163
"-Q", i18n("Quiet compile"));
164
new FlagCheckBox(build_group, controller,
165
"-Z", i18n("Disable implicit package compilation"));
166
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
168
layout->addSpacing(10);
170
new FlagListEdit(this, ":", editController, "-D", i18n("Conditional defines (delimited by \":\"):"));
171
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
173
new FlagListEdit(this, ":", editController, "-A", i18n("Unit aliases in form unit=alias (delimited by \":\"):"));
174
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
176
layout->addSpacing(10);
178
QVButtonGroup *message_group = new QVButtonGroup(i18n("Messages"), this);
179
new FlagCheckBox(message_group, controller,
180
"-H", i18n("Output hint messages"));
181
new FlagCheckBox(message_group, controller,
182
"-W", i18n("Output warning messages"));
183
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
185
layout->addSpacing(10);
186
QVButtonGroup *package_group = new QVButtonGroup(i18n("Packages"), this);
187
new FlagListEdit(package_group, ":", editController, "-LU", i18n("Build with packages (delimited by \":\"):"));
188
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
190
layout->addStretch();
193
GeneralTab::~GeneralTab( )
196
delete editController;
199
void GeneralTab::readFlags( QStringList * str )
201
controller->readFlags(str);
202
editController->readFlags(str);
205
void GeneralTab::writeFlags( QStringList * str )
207
controller->writeFlags(str);
208
editController->writeFlags(str);
213
CodegenTab::CodegenTab( QWidget * parent, const char * name )
214
:QWidget(parent, name), controller(new FlagCheckBoxController()),
215
listController(new FlagEditController()),
216
radioController(new FlagRadioButtonController())
218
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
219
// layout->setAutoAdd(true);
221
QGridLayout *layout2 = new QGridLayout(layout, 2, 2, KDialog::spacingHint());
223
QVButtonGroup *align_group = new QVButtonGroup(i18n("Code Alignment && Stack Frames"), this);
224
QRadioButton *align_def = new QRadioButton(i18n("Default (-$A8)"), align_group);
225
align_def->setChecked(true);
226
new FlagRadioButton(align_group, radioController,
227
"'-$A1'", i18n("Never align"));
228
new FlagRadioButton(align_group, radioController,
229
"'-$A2'", i18n("On word boundaries"));
230
new FlagRadioButton(align_group, radioController,
231
"'-$A4'", i18n("On double word boundaries"));
232
new FlagRadioButton(align_group, radioController,
233
"'-$A8'", i18n("On quad word boundaries"));
234
new FlagCheckBox(align_group, controller,
235
"'-$W+'", i18n("Generate stack frames"), "'-$W-'");
236
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
237
layout2->addWidget(align_group, 0, 0);
239
QVButtonGroup *enum_group = new QVButtonGroup(i18n("Enumeration Size"), this);
240
QRadioButton *enum_def = new QRadioButton(i18n("Default (-$Z1)"), enum_group);
241
enum_def->setChecked(true);
242
new FlagRadioButton(enum_group, radioController,
243
"'-$Z1'", i18n("Unsigned byte (256 values)"));
244
new FlagRadioButton(enum_group, radioController,
245
"'-$Z2'", i18n("Unsigned word (64K values)"));
246
new FlagRadioButton(enum_group, radioController,
247
"'-$Z4'", i18n("Unsigned double word (4096M values)"));
248
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
249
layout2->addWidget(enum_group, 0, 1);
251
QVButtonGroup *compile_group = new QVButtonGroup(i18n("Compile Time Checks"), this);
252
new FlagCheckBox(compile_group, controller,
253
"'-$C+'", i18n("Assertions"), "'-$C-'", "'-$C+'");
254
new FlagCheckBox(compile_group, controller,
255
"'-$B+'", i18n("Complete boolean evaluation"), "'-$B-'");
256
new FlagCheckBox(compile_group, controller,
257
"'-$X+'", i18n("Extended syntax"), "'-$X-'", "'-$X+'");
258
new FlagCheckBox(compile_group, controller,
259
"'-$H+'", i18n("Long strings"), "'-$H-'", "'-$H+'");
260
new FlagCheckBox(compile_group, controller,
261
"'-$P+'", i18n("Open string parameters"), "'-$P-'", "'-$P+'");
262
new FlagCheckBox(compile_group, controller,
263
"'-$T+'", i18n("Type-checked pointers"), "'-$T-'");
264
new FlagCheckBox(compile_group, controller,
265
"'-$V+'", i18n("Var-string checking"), "'-$V-'", "'-$V+'");
266
new FlagCheckBox(compile_group, controller,
267
"'-$J+'", i18n("Writable typed constants"), "'-$J-'");
268
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
269
layout2->addWidget(compile_group, 1, 0);
271
QVButtonGroup *run_group = new QVButtonGroup(i18n("Run Time Checks"), this);
272
new FlagCheckBox(run_group, controller,
273
"'-$M+'", i18n("Runtime type information"), "'-$M-'");
274
new FlagCheckBox(run_group, controller,
275
"'-$G+'", i18n("Imported data references"), "'-$G-'", "'-$G+'");
276
new FlagCheckBox(run_group, controller,
277
"'-$I+'", i18n("Input/Output checking"), "'-$I-'", "'-$I+'");
278
new FlagCheckBox(run_group, controller,
279
"'-$Q+'", i18n("Overflow checking"), "'-$Q-'");
280
new FlagCheckBox(run_group, controller,
281
"'-$R+'", i18n("Range checking"), "'-$R-'");
282
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
283
layout2->addWidget(run_group, 1, 1);
285
layout->addStretch();
288
CodegenTab::~CodegenTab( )
291
delete listController;
292
delete radioController;
295
void CodegenTab::readFlags( QStringList * str )
297
controller->readFlags(str);
298
listController->readFlags(str);
299
radioController->readFlags(str);
302
void CodegenTab::writeFlags( QStringList * str )
304
controller->writeFlags(str);
305
listController->writeFlags(str);
306
radioController->writeFlags(str);
311
DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
312
: QWidget(parent, name), controller(new FlagCheckBoxController()),
313
radioController(new FlagRadioButtonController)
315
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
316
// layout->setAutoAdd(true);
318
QVButtonGroup *optim_group = new QVButtonGroup(i18n("Optimization"), this);
319
new FlagCheckBox(optim_group, controller,
320
"'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
321
layout->addWidget(optim_group);
322
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
323
layout->addSpacing(10);
325
QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
327
QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
328
new FlagCheckBox(debug_group, controller,
329
"'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
330
new FlagCheckBox(debug_group, controller,
331
"'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
332
gdb = new FlagCheckBox(debug_group, controller,
333
"-V", i18n("Debug information for GDB"));
334
namespacedb = new FlagCheckBox(debug_group, controller,
335
"-VN", i18n("Namespace debug info"));
336
symboldb = new FlagCheckBox(debug_group, controller,
337
"-VR", i18n("Write symbol info in an .rsm file"));
338
layout2->addWidget(debug_group);
339
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
341
QVButtonGroup *debug_add = new QVButtonGroup(i18n("Symbol Reference Information"), this);
342
QRadioButton *m_default = new QRadioButton(i18n("Default (-$YD)"), debug_add);
343
m_default->setChecked(true);
344
new FlagRadioButton(debug_add, radioController,
345
"'-$Y-'", i18n("No information"));
346
new FlagRadioButton(debug_add, radioController,
347
"'-$YD'", i18n("Definition information"));
348
new FlagRadioButton(debug_add, radioController,
349
"'-$Y+'", i18n("Full reference information"));
350
layout2->addWidget(debug_add);
351
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
352
layout->addSpacing(10);
354
QHBoxLayout *layout3 = new QHBoxLayout(layout, KDialog::spacingHint());
355
QPushButton *release = new QPushButton(i18n("Release"), this);
356
QPushButton *debug = new QPushButton(i18n("Debug"), this);
357
layout3->addWidget(release);
358
layout3->addWidget(debug);
359
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
360
connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
361
connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));
363
layout->addStretch();
366
DebugOptimTab::~ DebugOptimTab( )
369
delete radioController;
372
void DebugOptimTab::readFlags( QStringList * str )
374
controller->readFlags(str);
375
radioController->readFlags(str);
378
void DebugOptimTab::writeFlags( QStringList * str )
380
controller->writeFlags(str);
381
radioController->writeFlags(str);
384
void DebugOptimTab::setReleaseOptions()
386
QStringList sl = QStringList::split(",", "'-$O+','-$Y-','-$D-','-$L-'");
388
gdb->setChecked(false);
389
namespacedb->setChecked(false);
390
symboldb->setChecked(false);
393
void DebugOptimTab::setDebugOptions()
395
QStringList sl = QStringList::split(",", "'-$O-','-$Y+','-$D+','-$L+',-V,-VN");
399
#include "optiontabs.moc"