forked from qunying/rhide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idemain.cc
2895 lines (2676 loc) · 66.1 KB
/
idemain.cc
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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Copyright (C) 1996-2002 Robert H”hne, see COPYING.RH for details */
/* This file is part of RHIDE. */
#ifdef __DJGPP__
#include <go32.h>
#include <dpmi.h>
#include <dos.h>
#include <setjmp.h>
#include <sys/farptr.h>
#include <sys/exceptn.h>
#include <sys/movedata.h>
#include <crt0.h>
#endif // __DJGPP__
#include <dirent.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <locale.h>
#include <time.h>
#include <glob.h>
#define Uses_TApplication
#define Uses_TMenuBar
#define Uses_TStaticText
#define Uses_TKeys
#define Uses_editCommands
#define Uses_TDeskTop
#define Uses_fpstream
#define Uses_TDialog
#define Uses_MsgBox
#define Uses_TScreen
#define Uses_TMouse
#define Uses_TFileDialog
#define Uses_TFileInputLine
#define Uses_TValidator
#define Uses_TDirList
#define Uses_TButton
#define Uses_TEventQueue
#define Uses_TFileViewer
#define Uses_TSortedListBox
#define Uses_TStringCollection
#define Uses_TGKey
#define Uses_TFileCollection
#define Uses_TProject
#define Uses_TOptions
#define Uses_TDepCollection
#define Uses_TMemInfo
#define Uses_IDEConst
#define Uses_TIDEEditWindow
#define Uses_TIDEFileEditor
#define Uses_ideFunctions
#define Uses_ideCommands
#define Uses_TCEditor_Internal
#define Uses_TCEditor_Commands
#define Uses_TStringCollection
#define Uses_TNoCaseStringCollection
#define Uses_TDialog
#define Uses_TScroller
#include <libide.h>
#include <inf.h>
#define Uses_TInputLinePiped
#define Uses_TCEditor
#include <ceditor.h>
#include <edprint.h>
#if (TCEDITOR_VERSION >= 0x000447UL)
#include <loadshl.h>
#endif
#ifdef INTERNAL_DEBUGGER
#include <librhgdb.h>
#define Uses_tvgdbFunctions
#define Uses_tvgdbCommands
#define Uses_TInspector
#include <libtvgdb.h>
#include <tvgdbhis.h>
#endif
#define Uses_TSCollection
#define Uses_TWindowList
#define Uses_tvutilCommands
#define Uses_TCheckDialog
#define Uses_THintStatusLine
#define Uses_TMsgCollection
#define Uses_MsgRec
#define Uses_tvutilFunctions
#include <libtvuti.h>
#include <rhutils.h>
#include "rhide.h"
#include "rhidehis.h"
#include <libtvdem.h>
#include "ideapp.h"
#ifdef __linux__
//FIXME: on my Linux the symbol ERR is already defined
// in sys/ucontext.h, but since curses.h is needed only
// for timeout(), I think I can live with it.
#undef ERR
#include <curses.h>
#endif
#include <slpinter.h>
#include <loadkbin.h>
#define KeyBindFName "rhide.key"
#include <edhists.h>
void SaveScreen();
void RestoreScreen();
static int keep_temp_dir = 0;
#define DELTA(x) (*((long *)(x)))
static void
IDEPrintEditor(TCEditor * e)
{
if (e->IslineInEdition)
e->MakeEfectiveLineInEdition();
e->buffer[e->bufLen] = 0;
char *s = strrchr(e->fileName, '/');
if (!s)
s = e->fileName;
else
s++;
PrintSource(e->buffer, s, e->tabSize);
}
int global_argc = 0;
char **global_argv = NULL;
TIDEMemInfo *mem_info = NULL;
#define MemInfoWidth 10
static void
start_mem_info()
{
TRect r = TProgram::menuBar->getExtent();
int start = r.a.x;
r.a.x = r.b.x - MemInfoWidth;
mem_info = new TIDEMemInfo(r);
mem_info->growMode = gfGrowLoX;
TProgram::application->insert(mem_info);
// Reduce the menubar
r.b.x = r.a.x;
r.a.x = start;
TProgram::menuBar->changeBounds(r);
}
static void
end_mem_info()
{
TProgram::application->remove(mem_info);
destroy(mem_info);
mem_info = NULL;
// Enlarge the menuBar again
TRect r = TProgram::menuBar->getExtent();
r.b.x += MemInfoWidth;
TProgram::menuBar->changeBounds(r);
}
void
update_mem(int force = 0)
{
if (!project)
return;
if (!ShowMem && mem_info)
{
end_mem_info();
}
if (ShowMem)
{
if (!mem_info)
{
start_mem_info();
}
mem_info->update(force);
}
}
void
IDE::changeBounds(const TRect & bounds)
{
TApplication::changeBounds(bounds);
if (mem_info)
{
end_mem_info();
start_mem_info();
}
}
static void
update_words()
{
int i, count, repaint = 0;
if (!project)
return;
if (c_words_changed)
{
if (ReservedWords)
destroy(ReservedWords);
count = CReservedWords->getCount();
ReservedWords = new TStringCollection(count, 1);
for (i = 0; i < count; i++)
{
ReservedWords->insert(strdup((char *) CReservedWords->at(i)));
}
repaint = 1;
}
if ((gpc_words_changed) && (!UseFPC))
{
if (PascalRWords)
destroy(PascalRWords);
count = GPCReservedWords->getCount();
PascalRWords = new TStringCollection(count, 1);
for (i = 0; i < count; i++)
{
char *tmp = strdup((char *) GPCReservedWords->at(i));
string_down(tmp);
PascalRWords->insert(tmp);
}
repaint = 1;
}
if ((fpc_words_changed) && (UseFPC))
{
if (PascalRWords)
destroy(PascalRWords);
count = FPCReservedWords->getCount();
PascalRWords = new TStringCollection(count, 1);
for (i = 0; i < count; i++)
{
char *tmp = strdup((char *) FPCReservedWords->at(i));
string_down(tmp);
PascalRWords->insert(tmp);
}
repaint = 1;
}
if (user_words_changed)
{
if (UserWords)
destroy(UserWords);
count = RHIDEUserWords->getCount();
UserWords = new TStringCollection(count, 1);
for (i = 0; i < count; i++)
{
UserWords->insert(strdup((char *) RHIDEUserWords->at(i)));
}
repaint = 1;
}
if (c_words_changed || gpc_words_changed ||
fpc_words_changed || user_words_changed)
{
CreateSHShortCutTables();
}
c_words_changed =
gpc_words_changed = fpc_words_changed = user_words_changed = 0;
if (repaint)
Repaint();
}
int external_program_executed = 0;
void
check_for_external_modifications()
{
if (windows)
{
int count = windows->getCount();
int i;
TWindow *window;
for (i = 0; i < count; i++)
{
TEvent event;
window = DESKTOPWINDOW(i);
event.what = evBroadcast;
event.message.command = cmEditorAnswer;
window->handleEvent(event);
if (event.what == evNothing)
{
unsigned long ft;
#define IE ((TIDEFileEditor *)(((TCEditWindow *)window)->editor))
ft = time_of_file(IE->fileName);
if (ft > IE->edittime)
{
if (messageBox(mfYesNoCancel | mfInformation,
_("%s has been modified! Reload it?"),
IE->fileName) == cmYes)
{
IE->lock();
IE->loadFile();
IE->update(ufView);
IE->edittime = ft;
already_maked = 0;
IE->unlock();
}
}
#undef IE
}
}
}
}
#define D(x) disableCommand(x)
#define E(x) enableCommand(x)
static int should_update = 1;
static unsigned long last_clock;
static int last_diff = 1;
void
IDE::update()
{
unsigned i;
struct
{
unsigned _has_editors:1;
unsigned _has_project:1;
unsigned _current_is_editor:1;
unsigned _current_is_clip:1;
unsigned _current_is_fileview:1;
unsigned _current_is_project:1;
unsigned _target_is_exec:1;
unsigned _current_is_help:1;
unsigned _has_primary_file:1;
unsigned _dummy:23;
}
_flags;
*((uint32 *) & _flags) = 0;
#define has_editors _flags._has_editors
#define has_project _flags._has_project
#define current_is_editor _flags._current_is_editor
#define current_is_clip _flags._current_is_clip
#define current_is_fileview _flags._current_is_fileview
#define current_is_project _flags._current_is_project
#define target_is_exec _flags._target_is_exec
#define current_is_help _flags._current_is_help
#define has_primary_file _flags._has_primary_file
unsigned project_count = 0;
unsigned has_windows = 0;
unsigned has_closed_windows = 0;
TEvent event;
unsigned long _clock = time(NULL);
if (!should_update)
{
if (difftime(_clock, last_clock) > last_diff)
{
update_mem();
last_clock = _clock;
if (last_diff < 10)
last_diff++;
}
return;
}
else
{
last_clock = _clock;
last_diff = 1;
}
update_mem();
update_words();
has_primary_file = project ? Project.source_name != NULL : 0;
if (windows)
has_windows = windows->getCount();
if (closed_windows)
has_closed_windows = closed_windows->getCount();
if (has_windows)
{
for (i = 0; i < has_windows; i++)
{
event.what = evBroadcast;
event.message.command = cmEditorAnswer;
DESKTOPWINDOW(i)->handleEvent(event);
if (event.what == evNothing)
{
has_editors = 1;
}
}
// clipwindow ???
if ((TView *) TProgram::deskTop->current == (TView *) clipWindow)
current_is_clip = 1;
else if ((TView *) TProgram::deskTop->current == (TView *) project_window)
current_is_project = 1;
else
{
event.what = evBroadcast;
event.message.command = cmEditorAnswer;
TProgram::deskTop->current->handleEvent(event);
if (event.what == evNothing)
current_is_editor = 1;
else
{
event.what = evBroadcast;
event.message.command = cmFileViewAnswer;
TProgram::deskTop->current->handleEvent(event);
if (event.what == evNothing)
current_is_fileview = 1;
else
{
event.what = evBroadcast;
event.message.command = cmInfoAnswer;
TProgram::deskTop->current->handleEvent(event);
if (event.what == evNothing)
current_is_help = 1;
}
}
}
}
if (project)
if (Project.dest_file_type == FILE_COFF ||
Project.dest_file_type == FILE_EXE || has_primary_file)
target_is_exec = 1;
if (project_name)
{
has_project = 1;
if (Project.dependencies)
project_count = Project.dependencies->getCount();
}
if (!has_project)
{
D(cmCloseProject);
D(cmAddProjectItem);
D(cmDelProjectItem);
D(cmLocalOptions);
D(cmShowIncludes);
D(cmClearDependencies);
D(cmMakeClear);
D(cmShowProject);
D(cmWriteMake);
}
else
{
E(cmShowProject);
E(cmCloseProject);
E(cmAddProjectItem);
E(cmWriteMake);
if (!project_count)
{
D(cmDelProjectItem);
D(cmLocalOptions);
D(cmShowIncludes);
D(cmClearDependencies);
D(cmMakeClear);
}
else
{
E(cmDelProjectItem);
E(cmLocalOptions);
E(cmShowIncludes);
E(cmClearDependencies);
E(cmMakeClear);
}
}
if (!has_windows)
{
D(cmTile);
D(cmCascade);
D(cmNext);
D(cmPrev);
if (!has_closed_windows)
D(cmShowWindowList);
else
E(cmShowWindowList);
}
else
{
E(cmTile);
E(cmCascade);
E(cmNext);
E(cmPrev);
E(cmShowWindowList);
}
if (!target_is_exec)
{
D(cmRun);
D(cmStep);
D(cmTrace);
D(cmGoto);
D(cmStepNo);
D(cmTraceNo);
D(cmGotoNo);
D(cmFinish);
D(cmReset);
D(cmProgArgs);
D(cmToggleBreak);
D(cmAddWatchEntry);
D(cmBreakPoints);
D(cmFunctionList);
D(cmCallStack);
D(cmInspect);
D(cmAddDataWindow);
D(cmShowStackWindow);
}
else
{
if (current_is_editor)
{
E(cmToggleBreak);
E(cmGoto);
E(cmGotoNo);
E(cmcProfileEditor);
/*
Rectangular block commands
*/
E(cmcSelRectStart);
E(cmcSelRectEnd);
E(cmcSelRectHide);
E(cmcSelRectCopy);
E(cmcSelRectPaste);
E(cmcSelRectCut);
E(cmcSelRectDel);
E(cmcSelRectMove);
}
else
{
D(cmToggleBreak);
D(cmGoto);
D(cmGotoNo);
D(cmcProfileEditor);
/*
Rectangular block commands
*/
D(cmcSelRectStart);
D(cmcSelRectEnd);
D(cmcSelRectHide);
D(cmcSelRectCopy);
D(cmcSelRectPaste);
D(cmcSelRectCut);
D(cmcSelRectDel);
D(cmcSelRectMove);
}
if (!has_project && !has_editors)
{
D(cmAddWatchEntry);
D(cmBreakPoints);
D(cmRun);
D(cmStep);
D(cmTrace);
D(cmGoto);
D(cmStepNo);
D(cmTraceNo);
D(cmGotoNo);
D(cmFinish);
D(cmReset);
D(cmProgArgs);
D(cmFunctionList);
D(cmInspect);
D(cmAddDataWindow);
D(cmShowStackWindow);
}
else
{
E(cmAddWatchEntry);
E(cmBreakPoints);
E(cmRun);
E(cmStep);
E(cmTrace);
E(cmGoto);
E(cmStepNo);
E(cmTraceNo);
E(cmGotoNo);
E(cmFinish);
E(cmReset);
E(cmProgArgs);
E(cmFunctionList);
E(cmCallStack);
E(cmInspect);
E(cmAddDataWindow);
E(cmShowStackWindow);
}
}
if (!has_primary_file &&
((!has_project && !has_editors) || (has_project && !project_count)))
{
D(cmMake);
D(cmBuild);
D(cmLink);
D(cmRun);
D(cmGDB);
D(cmFSDB);
}
else
{
E(cmMake);
E(cmBuild);
E(cmLink);
if (!target_is_exec)
{
D(cmRun);
D(cmGDB);
D(cmFSDB);
}
else
{
E(cmRun);
E(cmGDB);
E(cmFSDB);
}
}
if (current_is_editor)
{
E(cmSaveEditor);
E(cmJumpToFunction);
E(cmPrint);
}
else
{
D(cmSaveEditor);
D(cmJumpToFunction);
D(cmPrint);
}
if (current_is_editor || current_is_clip)
{
E(cmSyntaxHelp);
E(cmcExpandAllTabs);
E(cmcCompactBuffer);
E(cmcFind);
E(cmcReplace);
E(cmcSearchAgain);
E(cmGotoLine);
E(cmcJumpToFunction);
E(cmcRecordMacro);
E(cmcStopMacro);
E(cmcPlayMacro);
if (clipWindow->editor->hasSelection())
{
E(cmcPaste);
}
else
{
D(cmcPaste);
}
if (((TCEditWindow *) TProgram::deskTop->current)->editor->hasSelection())
{
E(cmcCut);
E(cmcCopy);
E(cmcClear);
}
else
{
D(cmcCut);
D(cmcCopy);
D(cmcClear);
}
}
else
{
D(cmSyntaxHelp);
D(cmcExpandAllTabs);
D(cmcCompactBuffer);
D(cmcFind);
D(cmcReplace);
D(cmcSearchAgain);
D(cmGotoLine);
D(cmcJumpToFunction);
D(cmcRecordMacro);
D(cmcStopMacro);
D(cmcPlayMacro);
D(cmcPaste);
D(cmcCut);
D(cmcCopy);
D(cmcClear);
}
if (current_is_help)
{
#define IW (((TInfWindow *)TProgram::deskTop->current)->viewer)
if (IW->selRowEnd > IW->selRowStart ||
(IW->selRowEnd == IW->selRowStart && IW->selColEnd > IW->selColStart))
#undef IW
{
E(cmcCopy);
}
else
{
D(cmcCopy);
}
E(cmcFind);
E(cmcSearchAgain);
}
if (has_editors)
{
E(cmSaveAll);
}
else
{
D(cmSaveAll);
D(cmcUndo);
D(cmcRedo);
}
if (msg_window)
{
E(cmNextMessage);
E(cmPrevMessage);
}
else
{
D(cmNextMessage);
D(cmPrevMessage);
}
if (current_is_editor || (current_is_project && project_count))
{
E(cmCompile);
}
else
{
D(cmCompile);
}
if (dual_display)
{
D(cmUserScreen);
}
else
{
E(cmUserScreen);
}
#ifdef INTERNAL_DEBUGGER
if (debugger_started())
{
E(cmModifyRegister);
E(cmGotoDisass);
}
else
{
D(cmModifyRegister);
D(cmGotoDisass);
}
#endif
if (external_program_executed)
{
external_program_executed = 0;
check_for_external_modifications();
}
should_update = 0;
}
#undef D
#undef E
int update_flag = 1;
void
IDE::idle()
{
TApplication::idle();
#ifdef __DJGPP__
__dpmi_yield();
#else
if (inIdleTime > 10)
usleep(1);
#endif
if (update_flag > 0)
update();
}
void
SetMainTargetName(const char *name, TProject * _prj)
{
TProject *prj = _prj ? _prj : project;
if ((!_prj) && (!prj->dest_name || strcmp(name, FName(prj->dest_name))))
already_maked = 0;
if (prj->dest_name)
delete prj->dest_name;
InitFName(prj->dest_name, name);
prj->dest_file_type = get_file_type(name);
if (prj->source_name)
{
prj->source_file_type = get_file_type(FName(prj->source_name));
prj->compile_id = how_to_compile(prj->source_file_type,
prj->dest_file_type);
string_free(prj->main_function);
switch (prj->compile_id)
{
default:
prj->main_function = string_dup("main");
break;
case COMPILE_LINK_FPC_AUTOMAKE:
prj->main_function = string_dup("PASCALMAIN");
break;
case COMPILE_LINK_PASCAL_AUTOMAKE:
prj->main_function = string_dup("pascal_main_program");
break;
}
return;
}
prj->source_file_type = FILE_UNKNOWN;
prj->compile_id = how_to_compile(FILE_OBJECT, prj->dest_file_type);
}
void
TargetName()
{
char buffer[PATH_MAX];
buffer[0] = 0;
if (Project.dest_name)
strcpy(buffer, FName(Project.dest_name));
if (HistinputBox(_("Name of the main target"), _("~N~ame"),
buffer, 255, RHIDE_History_main_targetname) == cmOK)
{
BackslashToSlash(buffer);
SetMainTargetName(buffer);
}
}
static void
GotoLine(TIDEFileEditor * editor)
{
int line = editor->curPos.y + 1;
char temp[10];
if (editor->IslineInEdition)
editor->MakeEfectiveLineInEdition();
sprintf(temp, "%d", line);
if (ValidInputBox(_("Goto the line"), _("line ~n~umber"),
temp, 10, new TRangeValidator(1, editor->limit.y == 0 ?
1 : editor->limit.y)) ==
cmOK)
{
sscanf(temp, "%d", &line);
goto_line(editor, line);
}
}
void
Repaint()
{
if (NoShadows)
DisableShadows();
else
EnableShadows();
TProgram::deskTop->redraw();
TProgram::application->Redraw();
message(TProgram::application, evBroadcast, cmRedraw, NULL);
update_mem(1);
}
static void
About()
{
TDialog *dialog;
TStaticText *text;
char buffer[1000];
dialog = new TDialog(TRect(0, 0, 60, 19), _("About RHIDE"));
dialog->options |= ofCentered;
sprintf(buffer, "\003%s\n"
"\003(%s)\n"
"\003\n"
"\003%s\n"
"\003%s\n\003\n"
"\003%s, %d-%d\n"
"\003\n%s%s\n"
"%s%s\n"
"%s%s\n"
"Editor : %s\n"
#ifdef INTERNAL_DEBUGGER
"Debugger: %s\n"
#endif
,
IDEVersion,
build_date,
_("RHIDE is an Integrated Development Environment"),
#ifdef __DJGPP__
_("for developing DJGPP apps"),
#elif __linux__
_("for developing Linux apps"),
#else
_("for developing apps"),
#endif
_("Copyright (C) by Robert H”hne"),
1996, 2002,
_("Language: "), _("English"),
_("Translated by: "), _("Nobody"),
_("last updated: "), _("1998-11-29")
,TCEDITOR_VERSION_STR
#ifdef INTERNAL_DEBUGGER
, gdb_version()
#endif
);
text = new TStaticText(TRect(0, 0, 58, 14), buffer);
text->options |= ofCentered;
dialog->insert(text);
TRect r(25, dialog->size.y - 3, 35, dialog->size.y - 1);
dialog->insert(new TButton(r, _("~O~K"), cmOK, bfDefault));
TProgram::deskTop->execView(dialog);
destroy(dialog);
}
static int help_request = 0;
static ushort help_ctx;
void
IDE::getEvent(TEvent & event)
{
TApplication::getEvent(event);
if (help_request && event.what == evNothing)
{
event.what = evCommand;
event.message.command = cmHelp;
}
switch (event.what)
{
case evCommand:
switch (event.message.command)
{
case cmEnter:
event.what = evKeyDown;
event.keyDown.keyCode = kbSpace;
event.keyDown.charScan.charCode = ' ';
break;
case cmHelp:
if (help_request)
{
help_request = 0;
Help(help_ctx);
}
else
{
help_request = 1;
help_ctx = getHelpCtx();
event.message.command = 0xFFFF;
break;
}
clearEvent(event);
break;
default:
break;
}
default:
break;
}
if (event.what != evNothing && event.what != evMouseMove)
should_update = 1;
}
#define SC(command)\
case cm##command:\
command();\
clearEvent(event);\
break
#define SC2(command,function)\
case cm##command:\
function();\
clearEvent(event);\
break
#define SC3(command,function)\
case cm##command:\
function;\
clearEvent(event);\
break
/*
Return NULL or an allocated string.
*/
char *
WUC()
{
char *word;
TEvent event;