summaryrefslogtreecommitdiffstats
path: root/languages/pascal/compiler/dccoptions/optiontabs.cpp
blob: 306fe5a0d543138b58dc2b0bea2a0cf531e5870a (plain)
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
/***************************************************************************
 *   Copyright (C) 2003 by Alexander Dymo                                  *
 *   cloudtemple@mksat.net                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/
#include <kdialog.h>
#include <tdelocale.h>

#include <tqspinbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqvbuttongroup.h>
#include <tqapplication.h>
#include <tqpushbutton.h>

#include "flagboxes.h"

#include "optiontabs.h"

LinkerTab::LinkerTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), radioController(new FlagRadioButtonController()),
    pathController(new FlagPathEditController()),
    editController(new FlagEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    TQVButtonGroup *map_group = new TQVButtonGroup(i18n("Map File"), this);
    TQRadioButton *m_defaultMap = new TQRadioButton(i18n("Off"), map_group);
    m_defaultMap->setChecked(true);
    new FlagRadioButton(map_group, radioController,
                     "-GS", i18n("Segments"));
    new FlagRadioButton(map_group, radioController,
                     "-GP", i18n("Publics"));
    new FlagRadioButton(map_group, radioController,
                     "-GD", i18n("Detailed"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagPathEdit(this, "", pathController,
                     "--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
                     "-$M", i18n("Reserved address space:"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    layout->addStretch();
}

LinkerTab::~LinkerTab( )
{
    delete radioController;
    delete pathController;
    delete editController;
}

void LinkerTab::readFlags( TQStringList * str )
{
    pathController->readFlags(str);
    radioController->readFlags(str);
    editController->readFlags(str);
}

void LinkerTab::writeFlags( TQStringList * str )
{
    pathController->writeFlags(str);
    radioController->writeFlags(str);
    editController->writeFlags(str);
}



LocationsTab::LocationsTab( TQWidget * parent, const char * name )
    :TQWidget(parent, name), pathController(new FlagPathEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, ":", pathController,
                     "-I", i18n("Include search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-R", i18n("Resource search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-U", i18n("Unit search path (delimited by \":\"):"));
    new FlagPathEdit(this, ":", pathController,
                     "-O", i18n("Object search path (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addStretch();
}

LocationsTab::~LocationsTab( )
{
    delete pathController;
}

void LocationsTab::readFlags( TQStringList * str )
{
    pathController->readFlags(str);
}

void LocationsTab::writeFlags( TQStringList * str )
{
    pathController->writeFlags(str);
}



Locations2Tab::Locations2Tab( TQWidget * parent, const char * name )
    :TQWidget(parent, name), pathController(new FlagPathEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, "", pathController,
                     "-E", i18n("Executable output directory:"));
    new FlagPathEdit(this, "", pathController,
                     "-N", i18n("Unit output directory:"));
    new FlagPathEdit(this, "", pathController,
                     "-LE", i18n("Package directory:"));
    new FlagPathEdit(this, "", pathController,
                     "-LN", i18n("Package source code directory:"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addStretch();
}

Locations2Tab::~Locations2Tab( )
{
    delete pathController;
}

void Locations2Tab::readFlags( TQStringList * str )
{
    pathController->readFlags(str);
}

void Locations2Tab::writeFlags( TQStringList * str )
{
    pathController->writeFlags(str);
}



GeneralTab::GeneralTab( TQWidget * parent, const char * name )
    :TQWidget(parent, name), controller(new FlagCheckBoxController()),
    editController(new FlagEditController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    TQVButtonGroup *build_group = new TQVButtonGroup(i18n("Build"), this);
    new FlagCheckBox(build_group, controller,
                     "-B", i18n("Build all units"));
    new FlagCheckBox(build_group, controller,
                     "-M", i18n("Make modified units"));
    new FlagCheckBox(build_group, controller,
                     "-Q", i18n("Quiet compile"));
    new FlagCheckBox(build_group, controller,
                     "-Z", i18n("Disable implicit package compilation"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addSpacing(10);

    new FlagListEdit(this, ":", editController, "-D", i18n("Conditional defines (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    new FlagListEdit(this, ":", editController, "-A", i18n("Unit aliases in form unit=alias (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addSpacing(10);

    TQVButtonGroup *message_group = new TQVButtonGroup(i18n("Messages"), this);
    new FlagCheckBox(message_group, controller,
                     "-H", i18n("Output hint messages"));
    new FlagCheckBox(message_group, controller,
                     "-W", i18n("Output warning messages"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addSpacing(10);
    TQVButtonGroup *package_group = new TQVButtonGroup(i18n("Packages"), this);
    new FlagListEdit(package_group, ":", editController, "-LU", i18n("Build with packages (delimited by \":\"):"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    layout->addStretch();
}

GeneralTab::~GeneralTab( )
{
    delete controller;
    delete editController;
}

void GeneralTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    editController->readFlags(str);
}

void GeneralTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    editController->writeFlags(str);
}



CodegenTab::CodegenTab( TQWidget * parent, const char * name )
    :TQWidget(parent, name), controller(new FlagCheckBoxController()),
    listController(new FlagEditController()),
    radioController(new FlagRadioButtonController())
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    TQGridLayout *layout2 = new TQGridLayout(layout, 2, 2, KDialog::spacingHint());

    TQVButtonGroup *align_group = new TQVButtonGroup(i18n("Code Alignment && Stack Frames"), this);
    TQRadioButton *align_def = new TQRadioButton(i18n("Default (-$A8)"), align_group);
    align_def->setChecked(true);
    new FlagRadioButton(align_group, radioController,
                     "'-$A1'", i18n("Never align"));
    new FlagRadioButton(align_group, radioController,
                     "'-$A2'", i18n("On word boundaries"));
    new FlagRadioButton(align_group, radioController,
                     "'-$A4'", i18n("On double word boundaries"));
    new FlagRadioButton(align_group, radioController,
                     "'-$A8'", i18n("On quad word boundaries"));
    new FlagCheckBox(align_group, controller,
                     "'-$W+'", i18n("Generate stack frames"), "'-$W-'");
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout2->addWidget(align_group, 0, 0);

    TQVButtonGroup *enum_group = new TQVButtonGroup(i18n("Enumeration Size"), this);
    TQRadioButton *enum_def = new TQRadioButton(i18n("Default (-$Z1)"), enum_group);
    enum_def->setChecked(true);
    new FlagRadioButton(enum_group, radioController,
                     "'-$Z1'", i18n("Unsigned byte (256 values)"));
    new FlagRadioButton(enum_group, radioController,
                     "'-$Z2'", i18n("Unsigned word (64K values)"));
    new FlagRadioButton(enum_group, radioController,
                     "'-$Z4'", i18n("Unsigned double word (4096M values)"));
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout2->addWidget(enum_group, 0, 1);

    TQVButtonGroup *compile_group = new TQVButtonGroup(i18n("Compile Time Checks"), this);
    new FlagCheckBox(compile_group, controller,
                     "'-$C+'", i18n("Assertions"), "'-$C-'", "'-$C+'");
    new FlagCheckBox(compile_group, controller,
                     "'-$B+'", i18n("Complete boolean evaluation"), "'-$B-'");
    new FlagCheckBox(compile_group, controller,
                     "'-$X+'", i18n("Extended syntax"), "'-$X-'", "'-$X+'");
    new FlagCheckBox(compile_group, controller,
                     "'-$H+'", i18n("Long strings"), "'-$H-'", "'-$H+'");
    new FlagCheckBox(compile_group, controller,
                     "'-$P+'", i18n("Open string parameters"), "'-$P-'", "'-$P+'");
    new FlagCheckBox(compile_group, controller,
                     "'-$T+'", i18n("Type-checked pointers"), "'-$T-'");
    new FlagCheckBox(compile_group, controller,
                     "'-$V+'", i18n("Var-string checking"), "'-$V-'", "'-$V+'");
    new FlagCheckBox(compile_group, controller,
                     "'-$J+'", i18n("Writable typed constants"), "'-$J-'");
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout2->addWidget(compile_group, 1, 0);

    TQVButtonGroup *run_group = new TQVButtonGroup(i18n("Run Time Checks"), this);
    new FlagCheckBox(run_group, controller,
                     "'-$M+'", i18n("Runtime type information"), "'-$M-'");
    new FlagCheckBox(run_group, controller,
                     "'-$G+'", i18n("Imported data references"), "'-$G-'", "'-$G+'");
    new FlagCheckBox(run_group, controller,
                     "'-$I+'", i18n("Input/Output checking"), "'-$I-'", "'-$I+'");
    new FlagCheckBox(run_group, controller,
                     "'-$Q+'", i18n("Overflow checking"), "'-$Q-'");
    new FlagCheckBox(run_group, controller,
                     "'-$R+'", i18n("Range checking"), "'-$R-'");
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout2->addWidget(run_group, 1, 1);

    layout->addStretch();
}

CodegenTab::~CodegenTab( )
{
    delete controller;
    delete listController;
    delete radioController;
}

void CodegenTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    listController->readFlags(str);
    radioController->readFlags(str);
}

void CodegenTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    listController->writeFlags(str);
    radioController->writeFlags(str);
}



DebugOptimTab::DebugOptimTab( TQWidget * parent, const char * name )
    : TQWidget(parent, name), controller(new FlagCheckBoxController()),
    radioController(new FlagRadioButtonController)
{
    TQBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    TQVButtonGroup *optim_group = new TQVButtonGroup(i18n("Optimization"), this);
    new FlagCheckBox(optim_group, controller,
                     "'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
    layout->addWidget(optim_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQBoxLayout *layout2 = new TQHBoxLayout(layout, KDialog::spacingHint());

    TQVButtonGroup *debug_group = new TQVButtonGroup(i18n("Debugging"), this);
    new FlagCheckBox(debug_group, controller,
                     "'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
    new FlagCheckBox(debug_group, controller,
                     "'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
    gdb = new FlagCheckBox(debug_group, controller,
                     "-V", i18n("Debug information for GDB"));
    namespacedb = new FlagCheckBox(debug_group, controller,
                     "-VN", i18n("Namespace debug info"));
    symboldb = new FlagCheckBox(debug_group, controller,
                     "-VR", i18n("Write symbol info in an .rsm file"));
    layout2->addWidget(debug_group);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);

    TQVButtonGroup *debug_add = new TQVButtonGroup(i18n("Symbol Reference Information"), this);
    TQRadioButton *m_default = new TQRadioButton(i18n("Default (-$YD)"), debug_add);
    m_default->setChecked(true);
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y-'", i18n("No information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$YD'", i18n("Definition information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y+'", i18n("Full reference information"));
    layout2->addWidget(debug_add);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    layout->addSpacing(10);

    TQHBoxLayout *layout3 = new TQHBoxLayout(layout, KDialog::spacingHint());
    TQPushButton *release = new TQPushButton(i18n("Release"), this);
    TQPushButton *debug = new TQPushButton(i18n("Debug"), this);
    layout3->addWidget(release);
    layout3->addWidget(debug);
    TQApplication::sendPostedEvents(this, TQEvent::ChildInserted);
    connect(release, TQT_SIGNAL(clicked()), this, TQT_SLOT(setReleaseOptions()));
    connect(debug, TQT_SIGNAL(clicked()), this, TQT_SLOT(setDebugOptions()));

    layout->addStretch();
}

 DebugOptimTab::~ DebugOptimTab( )
{
    delete controller;
    delete radioController;
}

void DebugOptimTab::readFlags( TQStringList * str )
{
    controller->readFlags(str);
    radioController->readFlags(str);
}

void DebugOptimTab::writeFlags( TQStringList * str )
{
    controller->writeFlags(str);
    radioController->writeFlags(str);
}

void DebugOptimTab::setReleaseOptions()
{
    TQStringList sl = TQStringList::split(",", "'-$O+','-$Y-','-$D-','-$L-'");
    readFlags(&sl);
    gdb->setChecked(false);
    namespacedb->setChecked(false);
    symboldb->setChecked(false);
}

void DebugOptimTab::setDebugOptions()
{
    TQStringList sl = TQStringList::split(",", "'-$O-','-$Y+','-$D+','-$L+',-V,-VN");
    readFlags(&sl);
}

#include "optiontabs.moc"