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
|
diff -p -up xxgdb-1.12/command.c.orig xxgdb-1.12/command.c
--- xxgdb-1.12/command.c.orig 2010-05-06 21:43:37.932032547 -0300
+++ xxgdb-1.12/command.c 2010-05-06 21:43:56.618036569 -0300
@@ -74,7 +74,7 @@
*
* forwardSearch() : forward string search
* reverseSearch() : reverse string search
- * Search() : call either forwardSearch() or reverseSearch()
+ * search() : call either forwardSearch() or reverseSearch()
* PopupSearch() : command callback for search button
* DoneSearch() : command callback for DONE button in search panel
* CreateSearchPopup() : create search panel
@@ -657,10 +657,8 @@ void PopupSearch(w, client_data, call_da
* If no text has been entered, the contents of the cut buffer are used
* for searching.
*/
-static void Search(w, direction, call_data)
- Widget w;
- XtPointer direction;
- XtPointer call_data;
+static void
+search(Widget w, XtPointer direction, XtPointer call_data)
{
XawTextBlock textblock;
XawTextPosition pos, left, right;
@@ -716,7 +714,7 @@ static void Activate(w, event, params, n
String *params;
Cardinal *num_params;
{
- Search(w, (XtPointer)FORWARD, NULL);
+ search(w, (XtPointer)FORWARD, NULL);
DoneSearch(w, (XtPointer)searchPopupShell, NULL);
}
@@ -747,8 +745,8 @@ static void CreateSearchPopup()
searchPopup = XtCreateManagedWidget("searchPopup", dialogWidgetClass,
searchPopupShell, args, n);
- AddButton(searchPopup, "<<", Search, (XtPointer) REVERSE);
- AddButton(searchPopup, ">>", Search, (XtPointer) FORWARD);
+ AddButton(searchPopup, "<<", search, (XtPointer) REVERSE);
+ AddButton(searchPopup, ">>", search, (XtPointer) FORWARD);
AddButton(searchPopup, "DONE", DoneSearch, (XtPointer)searchPopupShell);
dialogValue = XtNameToWidget(searchPopup, "value");
diff -p -up xxgdb-1.12/dialog.c.orig xxgdb-1.12/dialog.c
--- xxgdb-1.12/dialog.c.orig 2010-05-06 21:43:37.934032296 -0300
+++ xxgdb-1.12/dialog.c 2010-05-06 21:44:28.258027728 -0300
@@ -86,6 +86,12 @@ Boolean FalseSignal = FALSE; /* set to
static char DialogText[DIALOGSIZE]; /* text buffer for widget */
static XawTextPosition StartPos; /* starting position of input text */
+static XawTextEditType
+BeginDelete(Widget w);
+
+static void
+EndDelete(Widget w, XawTextEditType type);
+
/* This procedure prevents the user from deleting past the prompt, or
* any text appended by AppendDialogText() to the dialog window.
@@ -94,11 +100,8 @@ static XawTextPosition StartPos;
* character() can only delete the space character.
*/
/* ARGSUSED */
-static void InsertSpace(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+InsertSpace(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextBlock textblock;
XawTextPosition lastPos;
@@ -115,16 +118,70 @@ static void InsertSpace(w, event, params
}
}
+static XawTextEditType
+BeginDelete(Widget w)
+{
+ Widget src;
+ XawTextEditType type;
+ Arg args[1];
+
+ src = XawTextGetSource(w);
+ XtSetArg(args[0], XtNeditType, &type);
+ XtGetValues(src, args, 1);
+ if (type != XawtextEdit) {
+ XtSetArg(args[0], XtNeditType, XawtextEdit);
+ XtSetValues(src, args, 1);
+ }
+
+ return (type);
+}
+
+static void
+EndDelete(Widget w, XawTextEditType type)
+{
+ Widget src;
+ Arg args[1];
+
+ if (type != XawtextEdit) {
+ src = XawTextGetSource(w);
+ XtSetArg(args[0], XtNeditType, type);
+ XtSetValues(src, args, 1);
+ }
+}
+
+/*
+ * Previous logic of calling actions:
+ * InsertSpace() delete-previous-char()
+ * is not going to work because it must create a text in append only
+ * mode, so, hack it here to actually delete a character...
+ */
+void
+DeleteChar(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ XawTextEditType type;
+ XawTextBlock block;
+ XawTextPosition point;
+
+ if (StartPos < (point = XawTextGetInsertionPoint(w))) {
+ type = BeginDelete(w);
+ block.firstPos = 0;
+ block.length = 0;
+ block.ptr = "";
+ block.format = 8;
+ XawTextReplace(w, point - 1, point, &block);
+ XawTextSetInsertionPoint(w, point - 1);
+ EndDelete(w, type);
+ }
+}
+
/* Erases the preceding word.
* Simulates the action of the WERASE character (ctrl-W).
*/
/* ARGSUSED */
-void DeleteWord(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+DeleteWord(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
+ XawTextEditType type;
XawTextBlock textblock;
XawTextPosition pos;
Cardinal i;
@@ -138,8 +195,10 @@ void DeleteWord(w, event, params, num_pa
pos = TextGetLastPos(w);
for (i=pos; i > StartPos && DialogText[i-1] == ' '; i--);
for (; i > StartPos && DialogText[i-1] != ' '; i--);
+ type = BeginDelete(w);
XawTextReplace(w, i, pos, &textblock);
XawTextSetInsertionPoint(w, i);
+ EndDelete(w, type);
}
@@ -147,12 +206,10 @@ void DeleteWord(w, event, params, num_pa
* simulates the action of the KILL character (ctrl-U).
*/
/* ARGSUSED */
-void DeleteLine(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+DeleteLine(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
+ XawTextEditType type;
XawTextBlock textblock;
XawTextPosition pos, beginPos;
Cardinal i;
@@ -172,8 +229,10 @@ void DeleteLine(w, event, params, num_pa
return;
}
for (i=pos; i > beginPos && s[i-1] != '\n'; i--);
+ type = BeginDelete(w);
XawTextReplace(w, i, pos, &textblock);
XawTextSetInsertionPoint(w, i);
+ EndDelete(w, type);
}
@@ -183,11 +242,8 @@ void DeleteLine(w, event, params, num_pa
* it is stored in the global variable, Command.
*/
/* ARGSUSED */
-static void Dispatch(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+Dispatch(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
#ifdef GDB
/*
@@ -249,22 +305,16 @@ void signal_interrupt_dbx()
* Simulates the action of the INTR character (ctrl-C).
*/
/* ARGSUSED */
-static void SigInt(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+SigInt(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
signal_interrupt_dbx ();
}
/* Sends an EOF signal to dbx. (ctrl-D) */
/* ARGSUSED */
-static void SigEof(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+SigEof(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
write_dbx("\04");
}
@@ -274,11 +324,8 @@ static void SigEof(w, event, params, num
* Simulates the action of the QUIT character (ctrl-\)
*/
/* ARGSUSED */
-static void SigQuit(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+SigQuit(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
FalseSignal = TRUE;
@@ -301,29 +348,8 @@ Widget parent;
Arg args[MAXARGS];
Cardinal n;
- static XtActionsRec dialog_actions[] = {
- {"SigInt", (XtActionProc) SigInt},
- {"SigEof", (XtActionProc) SigEof},
- {"SigQuit", (XtActionProc) SigQuit},
- {"InsertSpace", (XtActionProc) InsertSpace},
- {"Dispatch", (XtActionProc) Dispatch},
- {NULL, NULL}
- };
-
- static String translations = "#override\n\
- Ctrl<Key>C: SigInt()\n\
- Ctrl<Key>D: SigEof()\n\
- Ctrl<Key>|: SigQuit()\n\
- Ctrl<Key>W: DeleteWord()\n\
- Ctrl<Key>U: DeleteLine()\n\
- Ctrl<Key>H: InsertSpace() delete-previous-character()\n\
- <Key>Delete: InsertSpace() delete-previous-character()\n\
- <Key>BackSpace: InsertSpace() delete-previous-character()\n\
- <Key>Return: newline() Dispatch()\n\
- ";
-
n = 0;
- XtSetArg(args[n], XtNuseStringInPlace, True); n++;
+ XtSetArg(args[n], XtNuseStringInPlace, True); n++;
XtSetArg(args[n], XtNstring, (XtArgVal) DialogText); n++;
XtSetArg(args[n], XtNlength, (XtArgVal) DIALOGSIZE); n++;
XtSetArg(args[n], XtNeditType, (XtArgVal) XawtextAppend); n++;
@@ -331,8 +357,6 @@ Widget parent;
XtSetArg(args[n], XtNwrap, XawtextWrapWord); n++;
dialogWindow = XtCreateManagedWidget("dialogWindow", asciiTextWidgetClass,
parent, args, n );
- XtOverrideTranslations(dialogWindow, XtParseTranslationTable(translations));
- XtAppAddActions(app_context, dialog_actions, XtNumber(dialog_actions));
}
#if 0 /* never used */
diff -p -up xxgdb-1.12/gdb_parser.c.orig xxgdb-1.12/gdb_parser.c
--- xxgdb-1.12/gdb_parser.c.orig 2010-05-06 21:43:37.936032292 -0300
+++ xxgdb-1.12/gdb_parser.c 2010-05-06 21:44:36.001027757 -0300
@@ -1053,7 +1053,6 @@ FILE *f;
if(errno == EAGAIN || errno == EWOULDBLOCK) {
break;
}
- perror("read from gdb");
exit(1);
/*NOTREACHED*/
}
diff -p -up xxgdb-1.12/global.h.orig xxgdb-1.12/global.h
--- xxgdb-1.12/global.h.orig 2010-05-06 21:43:37.938031470 -0300
+++ xxgdb-1.12/global.h 2010-05-06 21:44:48.480028375 -0300
@@ -111,10 +111,34 @@ extern void read_dbx(); /* get data f
extern void write_dbx(); /* send data to dbx */
extern void query_dbx(); /* ask dbx for info */
+extern void
+PopupSearch(Widget w, XtPointer client_data, XtPointer call_data);
+
/* dialog.c */
+extern void
+DeleteChar(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+DeleteLine(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+DeleteWord(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+Dispatch(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+InsertSpace(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SigInt(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SigEof(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SigQuit(Widget w, XEvent *event, String *params, Cardinal *num_params);
-extern void DeleteLine(); /* delete line action proc */
-extern void DeleteWord(); /* delete word action proc */
extern void CreateDialogWindow();
extern void AppendDialogText(); /* append text to buffer */
@@ -163,18 +187,53 @@ extern void UpdateUpdown(); /* update
extern void UpdateBomb(); /* update position of bomb */
/* source.c */
+extern void
+CreateSourceWindow(Widget parent);
+
+extern char *
+GetPathname(char *filename);
+
+extern int
+LoadCurrentFile(void);
+
+extern int
+LoadFile(char *filename);
+
+extern void
+MakeDirList(char *output);
+
+extern void
+NotifyResize(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+PrintSelection(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+Search(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SelectEnd(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SelectStart(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+SelectWord(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+source_init(void);
+
+extern void
+Update(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+#ifdef EDIT_BUTTON
+extern void
+EdAction(Widget w, XEvent *event, String *params, Cardinal *num_params);
+
+extern void
+StartEditor(void);
+#endif
-extern void SelectStart(); /* modified select-start */
-extern void SelectEnd(); /* modified select-end */
-extern void SelectWord(); /* my select word */
-extern void PrintSelection(); /* select variable and print */
-extern void Update(); /* update line label */
-extern void source_init(); /* init routine */
-extern void CreateSourceWindow();
-extern int LoadFile(); /* display source file */
-extern int LoadCurrentFile(); /* display source file */
-extern char *GetPathname(); /* get full path name of file */
-extern void MakeDirList(); /* maintain list of dirs */
/* utils.c */
diff -p -up xxgdb-1.12/source.c.orig xxgdb-1.12/source.c
--- xxgdb-1.12/source.c.orig 2010-05-06 21:43:37.940032123 -0300
+++ xxgdb-1.12/source.c 2010-05-06 21:43:56.626028358 -0300
@@ -106,7 +106,8 @@ static FileRec **fileTable; /* table of
static int fileTableSize; /* size of file table */
static char *dirList[MAXDIRS]; /* list of dirs for searching files */
-void source_init()
+void
+source_init(void)
{
dirList[0] = NULL;
}
@@ -116,11 +117,8 @@ void source_init()
* line label.
*/
/* ARGSUSED */
-void Update(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+extern void
+Update(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextPosition pos;
int topline;
@@ -171,11 +169,8 @@ void Update(w, event, params, num_params
* Invoked by ConfigureNotify event.
*/
/* ARGSUSED */
-static void NotifyResize(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+NotifyResize(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextPosition pos;
TextWidget ctx = (TextWidget) sourceWindow;
@@ -216,11 +211,8 @@ void UpdateLine(w, event, params, num_pa
* near the bottom of an Athena text widget window.
*/
/* ARGSUSED */
-void SelectStart(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+SelectStart(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextPosition topPosition;
@@ -241,11 +233,8 @@ void SelectStart(w, event, params, num_p
* selection and cut buffer 0.
*/
/* ARGSUSED */
-void SelectEnd(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+extern void
+SelectEnd(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextPosition begin, end, start;
Widget textsrc;
@@ -274,11 +263,8 @@ void SelectEnd(w, event, params, num_par
* It selects a word delimited by DELIMITERS, not whitespace.
*/
/* ARGSUSED */
-void SelectWord(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+SelectWord(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XawTextPosition pos, left, right, start;
XawTextBlock buffer;
@@ -328,11 +314,8 @@ void SelectWord(w, event, params, num_pa
/* Print the value of the expression in cut buffer 0. */
/* ARGSUSED */
-void PrintSelection(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+PrintSelection(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char command[LINESIZ];
char *string;
@@ -351,24 +334,16 @@ void PrintSelection(w, event, params, nu
#ifdef EDIT_BUTTON
/* allow invocation of favorite editor from within interface */
-extern void StartEditor();
-void EdAction(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+EdAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
StartEditor();
}
#endif /* EDIT_BUTTON */
/* fixes keybindings in source window */
-extern PopupSearch();
-void Search(w, event, params, num_params)
- Widget w;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+void
+Search(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
PopupSearch(w, NULL, NULL);
}
@@ -383,134 +358,12 @@ void Search(w, event, params, num_params
have operative keys in the editor window for moving around (move stop
signs and such around too) */
-void CreateSourceWindow(parent)
-Widget parent;
+void
+CreateSourceWindow(Widget parent)
{
- TextWidget ctx;
Arg args[MAXARGS];
Cardinal n;
- static XtActionsRec sbar_actions[] = {
- {"NotifyResize", NotifyResize},
- {"Update", Update},
- {NULL, NULL}
- };
-
- /* fixes keybindings in source window */
- static XtActionsRec text_actions[] = {
- {"Update", Update},
-#ifdef EDIT_BUTTON
- {"Editor", EdAction},
-#endif
- {"Search", Search},
- {NULL, NULL}
- };
-
-#ifdef EDIT_BUTTON
-
- static String eTextTranslations = "#override \n\
- Ctrl<Key>V: next-page() Update(warp) \n\
- Meta<Key>V: previous-page() Update(warp) \n\
- Ctrl<Key>N: next-line() Update() \n\
- Ctrl<Key>P: previous-line() Update() \n\
- Ctrl<Key>Z: scroll-one-line-up() Update(warp) \n\
- Meta<Key>Z: scroll-one-line-down() Update(warp) \n\
- Meta<Key>]: forward-paragraph() Update(warp) \n\
- Meta<Key>[: backward-paragraph() Update(warp) \n\
- Meta<Key>F: forward-word() Update() \n\
- Meta<Key>B: backward-word() Update() \n\
- Ctrl<Key>F: forward-character() Update() \n\
- Ctrl<Key>B: backward-character() Update() \n\
- Meta<Key>E: Editor() \n\
- Meta<Key><: beginning-of-file() Update(warp) \n\
- Meta<Key>>: end-of-file() Update(warp) \n\
- <Key>L: redraw-display() Update() \n\
- <Key>S: Search() Update() \n\
- <Key>R: Search() Update() \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \n\
- <Btn1Up>: Update() SelectEnd() \n\
- ";
-
- static String vTextTranslations = "#override \n\
- Ctrl<Key>F: next-page() Update(warp) \n\
- Ctrl<Key>B: previous-page() Update(warp) \n\
- Ctrl<Key>D: next-page() Update() \n\
- Ctrl<Key>U: previous-page() Update() \n\
- <Key>Return: next-line() Update() \n\
- <Key>-: previous-line() Update() \n\
- <Key>j: next-line() Update() \n\
- <Key>k: previous-line() Update() \n\
- <Key>space: forward-character() Update() \n\
- <Key>BackSpace: backward-character() Update() \n\
- <Key>1: beginning-of-file() Update(warp) \n\
- <Key>G: end-of-file() Update(warp) \n\
- <Key>E: Editor() \n\
- <Key>L: redraw-display() Update() \n\
- <Key>/: Search() Update() \n\
- <Key>?: Search() Update() \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \n\
- <Btn1Up>: Update() SelectEnd() \n\
- ";
-
-#else /* not EDIT_BUTTON */
-
- static String eTextTranslations = "#override \n\
- Ctrl<Key>V: next-page() Update(warp) \n\
- Meta<Key>V: previous-page() Update(warp) \n\
- Ctrl<Key>N: next-line() Update() \n\
- Ctrl<Key>P: previous-line() Update() \n\
- Ctrl<Key>Z: scroll-one-line-up() Update(warp) \n\
- Meta<Key>Z: scroll-one-line-down() Update(warp) \n\
- Meta<Key>]: forward-paragraph() Update(warp) \n\
- Meta<Key>[: backward-paragraph() Update(warp) \n\
- Meta<Key>F: forward-word() Update() \n\
- Meta<Key>B: backward-word() Update() \n\
- Ctrl<Key>F: forward-character() Update() \n\
- Ctrl<Key>B: backward-character() Update() \n\
- Meta<Key><: beginning-of-file() Update(warp) \n\
- Meta<Key>>: end-of-file() Update(warp) \n\
- <Key>L: redraw-display() Update() \n\
- <Key>S: Search() Update() \n\
- <Key>R: Search() Update() \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \n\
- <Btn1Up>: Update() SelectEnd() \n\
- ";
-
- static String vTextTranslations = "#override \n\
- Ctrl<Key>F: next-page() Update(warp) \n\
- Ctrl<Key>B: previous-page() Update(warp) \n\
- Ctrl<Key>D: next-page() Update() \n\
- Ctrl<Key>U: previous-page() Update() \n\
- <Key>Return: next-line() Update() \n\
- <Key>-: previous-line() Update() \n\
- <Key>j: next-line() Update() \n\
- <Key>k: previous-line() Update() \n\
- <Key>space: forward-character() Update() \n\
- <Key>BackSpace: backward-character() Update() \n\
- <Key>1: beginning-of-file() Update(warp) \n\
- <Key>G: end-of-file() Update(warp) \n\
- <Key>L: redraw-display() Update() \n\
- <Key>/: Search() Update() \n\
- <Key>?: Search() Update() \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \n\
- <Btn1Up>: Update() SelectEnd() \n\
- ";
-
-#endif /* EDIT_BUTTON */
-
- /* fixes keybindings in source window */
- static String sbarTranslations = "\
- <Configure>: NotifyResize() \n\
- <Btn2Down>: StartScroll(Continuous) MoveThumb() NotifyThumb() \
- Update() \n\
- <Btn2Motion>: MoveThumb() NotifyThumb() Update() \n\
- <BtnUp>: NotifyScroll(Proportional) EndScroll() Update() \n\
- ";
-
n = 0;
XtSetArg(args[n], XtNdefaultDistance, 0); n++;
sourceForm = XtCreateManagedWidget("sourceForm", formWidgetClass,
@@ -523,27 +376,6 @@ Widget parent;
XtSetArg(args[n], XtNscrollVertical, (XtArgVal) XawtextScrollAlways);n++;
sourceWindow = XtCreateManagedWidget("sourceWindow", asciiTextWidgetClass,
sourceForm, args, n);
-
- ctx = (TextWidget) sourceWindow;
- if (ctx->text.vbar)
- XtOverrideTranslations(ctx->text.vbar,
- XtParseTranslationTable(sbarTranslations));
- XtAppAddActions(app_context, sbar_actions, XtNumber(sbar_actions));
-
- /* fixes keybindings in source window */
- XtAppAddActions(app_context, text_actions, XtNumber(text_actions));
- if (app_resources.bindings && strcmp(app_resources.bindings, "vi") == 0)
- XtOverrideTranslations((Widget) ctx, XtParseTranslationTable(vTextTranslations));
- else
- XtOverrideTranslations((Widget) ctx, XtParseTranslationTable(eTextTranslations));
-
- /* setup tabulation */
- if (app_resources.tabstop >= 0) {
- int tab, tabs[256];
- for (n = 0, tab = 0; n < sizeof tabs / sizeof *tabs; n++)
- tabs[n] = (tab += app_resources.tabstop);
- XawTextSinkSetTabs(ctx->text.sink, sizeof tabs / sizeof *tabs, tabs);
- }
}
@@ -553,8 +385,8 @@ Widget parent;
* > Starting position of line #1 is 0, and is stored in linepos[1].
* > Search for '\n' till end of buffer.
*/
-static void BuildLinePos(file)
-FileRec *file;
+static void
+BuildLinePos(FileRec *file)
{
char *p;
int line, nlines;
@@ -587,7 +419,8 @@ FileRec *file;
* there might be another path to the same files.
*/
-static void CheckLookUpFileTable()
+static void
+CheckLookUpFileTable(void)
{
int i;
char * newfullname;
@@ -639,7 +472,8 @@ static void CheckLookUpFileTable()
* display if necessary.
*
*/
-void CleanUpFileTable ()
+void
+CleanUpFileTable(void)
{
CheckLookUpFileTable();
if (displayedFile == NULL)
@@ -651,9 +485,8 @@ void CleanUpFileTable ()
* If not found, create an entry and initialize proper fields,
* else, return pointer to entry found.
*/
-static int LookUpFileTable(pathname, filename, file)
-char *pathname, *filename;
-FileRec **file;
+static int
+LookUpFileTable(char *pathname, char *filename, FileRec **file)
{
struct stat fileinfo;
int fd;
@@ -754,7 +587,8 @@ FileRec **file;
/*
* Remember file position and current line before closing.
*/
-static void SaveDisplayedFileInfo()
+static void
+SaveDisplayedFileInfo(void)
{
XawTextPosition pos;
@@ -771,8 +605,8 @@ static void SaveDisplayedFileInfo()
* must recalculate bottomline because the window size might be
* different.
*/
-static void DisplayFile(file)
-FileRec *file;
+static void
+DisplayFile(FileRec *file)
{
Arg args[MAXARGS];
Cardinal n;
@@ -792,8 +626,8 @@ FileRec *file;
* the home directory of that user, or to the login home directory if user
* is not specified.
*/
-static char *expand(filename)
-char *filename;
+static char *
+expand(char *filename)
{
struct passwd *pwd;
char *string, *name, newfile[MAXNAME];
@@ -821,8 +655,8 @@ char *filename;
*
* With fix from Dave Gagne (daveg@fs1.ee.ubc.ca) 7/30/90
*/
-void MakeDirList(output)
-char *output;
+void
+MakeDirList(char *output)
{
/* fix bug where if text of a directories command is > 1k, crashes. Now works to 4k */
char *s, list[LINESIZ], command[LINESIZ];
@@ -889,8 +723,8 @@ char *output;
/* Returns the full pathname of a given file.
* It searches for the file from a list of directories.
*/
-char *GetPathname(filename)
-char *filename;
+char *
+GetPathname(char *filename)
{
char pathname[LINESIZ];
int i;
@@ -949,8 +783,8 @@ char *filename;
* 5. update the file label and the various signs on the source window.
* LoadFile returns 0 upon successful completion, -1 otherwise.
*/
-int LoadFile(filename)
-char *filename;
+int
+LoadFile(char *filename)
{
FileRec *file;
char *pathname;
@@ -980,7 +814,8 @@ char *filename;
}
}
-int LoadCurrentFile()
+int
+LoadCurrentFile(void)
{
#ifdef GDB
query_gdb ("info line\n", PARSE_ON | ECHO_OFF | FILTER_OFF);
@@ -991,10 +826,11 @@ int LoadCurrentFile()
}
#ifdef EDIT_BUTTON
-/* simply add editor button that calls $XXGDBWINEDIT, $WINEDIT, xxgdbedit in that order */
+/* simply add editor button that calls $EDITOR and xedit in that order */
/* allow invocation of fav. editor from within interface */
/* button and the EdAction action procedure for the source window */
-void StartEditor ()
+void
+StartEditor(void)
{
XawTextPosition pos;
char* editor;
@@ -1002,11 +838,9 @@ void StartEditor ()
int result;
if (displayedFile == NULL) return;
- editor = (char *) getenv("XXGDBWINEDIT");
- if (editor == NULL)
- editor = (char *) getenv("WINEDIT");
+ editor = (char *) getenv("EDITOR");
if (editor == NULL)
- editor = "xxgdbedit";
+ editor = "xedit";
pos = XawTextGetInsertionPoint(sourceWindow);
displayedFile->currentline = TextPositionToLine(pos);
sprintf(string, "nohup %s +%d %s&\n",
@@ -1043,8 +877,7 @@ void StartEditor ()
*
*/
char *
-GetSourcePathname (filename)
-char *filename;
+GetSourcePathname(char *filename)
{
char *srcpath;
char curr_src [MAXPATHLEN];
diff -p -up xxgdb-1.12/XDbx.ad.orig xxgdb-1.12/XDbx.ad
--- xxgdb-1.12/XDbx.ad.orig 2010-05-06 21:43:37.942032512 -0300
+++ xxgdb-1.12/XDbx.ad 2010-05-06 21:43:56.626028358 -0300
@@ -19,31 +19,41 @@
*sourceForm.preferredPaneSize: 320
*sourceWindow.leftMargin: 35
*sourceWindow.scrollHorizontal: whenNeeded
-*sourceWindow.translations: #override \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: Update(warp) SelectEnd() PrintSelection() \n\
- <Btn1Up>: Update(warp) SelectEnd() \n\
- <Key>Down: next-line() Update()\n\
- <Key>Up: previous-line() Update() \n\
- Ctrl<Key>L: redraw-display() Update() \n\
- Ctrl<Key>N: next-line() Update() \n\
- Ctrl<Key>P: previous-line() Update() \n\
- Ctrl<Key>V: next-page() Update() \n\
- Ctrl<Key>Z: scroll-one-line-up() Update() \n\
- Meta<Key>V: previous-page() Update() \n\
- Meta<Key>Z: scroll-one-line-down() Update() \n\
- :Meta<Key>\>: end-of-file() Update() \n\
- :Meta<Key>]: forward-paragraph() Update() \n\
- :Meta<Key>[: backward-paragraph() Update()
+*sourceWindow.translations: #override \
+ <Btn1Down>: set-keyboard-focus() SelectStart() SelectWord()\n\
+ Shift<Btn1Up>: Update(warp) SelectEnd() PrintSelection()\n\
+ <Btn1Up>: Update(warp) SelectEnd()\n\
+ <Key>Down: next-line() Update()\n\
+ <Key>Up: previous-line() Update()\n\
+ Ctrl<Key>L: redraw-display() Update()\n\
+ Ctrl<Key>N: next-line() Update()\n\
+ Ctrl<Key>P: previous-line() Update()\n\
+ Ctrl<Key>V: next-page() Update()\n\
+ Ctrl<Key>Z: scroll-one-line-up() Update()\n\
+ Meta<Key>V: previous-page() Update()\n\
+ Meta<Key>Z: scroll-one-line-down() Update()\n\
+ :Meta<Key>\>: end-of-file() Update()\n\
+ :Meta<Key>]: forward-paragraph() Update()\n\
+ :Meta<Key>[: backward-paragraph() Update()
*messageWindow*font: variable
*messageWindow.min: 30
*messageWindow.max: 30
*dialogWindow.preferredPaneSize: 200
*dialogWindow.resizeToPreferred: True
-*dialogWindow.translations: #override \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: SelectEnd() PrintSelection() \n\
- <Btn1Up>: SelectEnd() \n
+*dialogWindow.translations: #override \
+ <Btn1Down>: set-keyboard-focus() SelectStart() SelectWord()\n\
+ Shift<Btn1Up>: SelectEnd() PrintSelection()\n\
+ <Btn1Up>: SelectEnd()\n\
+ Ctrl<Key>C: SigInt()\n\
+ Ctrl<Key>D: SigEof()\n\
+ Ctrl<Key>|: SigQuit()\n\
+ <Key>Tab: no-op(r)\n\
+ Ctrl<Key>W: DeleteWord()\n\
+ Ctrl<Key>U: DeleteLine()\n\
+ Ctrl<Key>H: DeleteChar()\n\
+ <Key>Delete: DeleteChar()\n\
+ <Key>BackSpace: DeleteChar()\n\
+ <Key>Return: newline() Dispatch()
*commandWindow.preferredPaneSize: 135
*commandWindow.skipAdjust: True
!*commandWindow.hSpace: 14
@@ -55,8 +65,8 @@
*displayWindow.skipAdjust: True
*displayWindow.scrollVertical: whenNeeded
*displayWindow.scrollHorizontal: whenNeeded
-*displayWindow.translations: #override \n\
- <Btn1Down>: SelectStart() SelectWord() \n\
- Shift<Btn1Up>: SelectEnd() PrintSelection() \n\
- <Btn1Up>: SelectEnd() \n
+*displayWindow.translations: #override \
+ <Btn1Down>: set-keyboard-focus() SelectStart() SelectWord()\n\
+ Shift<Btn1Up>: SelectEnd() PrintSelection()\n\
+ <Btn1Up>: SelectEnd()
*popup*showGrip: False
diff -p -up xxgdb-1.12/xdbx.c.orig xxgdb-1.12/xdbx.c
--- xxgdb-1.12/xdbx.c.orig 2010-05-06 21:43:37.944031595 -0300
+++ xxgdb-1.12/xdbx.c 2010-05-06 21:43:56.628036652 -0300
@@ -191,19 +191,11 @@ String fallback_resources[] = {
#endif
"*sourceWindow.leftMargin: 35",
"*sourceWindow.scrollHorizontal: whenNeeded",
- "*sourceWindow.translations: #override \\n\
- <Btn1Down>: SelectStart() SelectWord() \\n\
- Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \\n\
- <Btn1Up>: Update() SelectEnd() \\n",
"*messageWindow*font: variable",
"*messageWindow.min: 30",
"*messageWindow.max: 30",
"*dialogWindow.preferredPaneSize: 240",
"*dialogWindow.resizeToPreferred: True",
- "*dialogWindow.translations: #override \\n\
- <Btn1Down>: SelectStart() SelectWord() \\n\
- Shift<Btn1Up>: SelectEnd() PrintSelection() \\n\
- <Btn1Up>: SelectEnd() \\n",
#ifdef NEW_INTERFACE
"*commandShell.geometry: 190x370+590+0",
#else
@@ -229,10 +221,6 @@ String fallback_resources[] = {
#endif
"*displayWindow.scrollVertical: whenNeeded",
"*displayWindow.scrollHorizontal: whenNeeded",
- "*displayWindow.translations: #override \\n\
- <Btn1Down>: SelectStart() SelectWord() \\n\
- Shift<Btn1Up>: SelectEnd() PrintSelection() \\n\
- <Btn1Up>: SelectEnd() \\n",
"*popup*showGrip: False",
"*bindings: emacs",
NULL,
@@ -271,14 +259,25 @@ static XrmOptionDescRec options[] = {
};
XtActionsRec xdbx_actions[] = {
- {"SelectStart", (XtActionProc) SelectStart},
- {"SelectEnd", (XtActionProc) SelectEnd},
- {"SelectWord", (XtActionProc) SelectWord},
- {"PrintSelection", (XtActionProc) PrintSelection},
- {"Update", (XtActionProc) Update},
- {"DeleteWord", (XtActionProc) DeleteWord},
- {"DeleteLine", (XtActionProc) DeleteLine},
- {NULL, NULL}
+#ifdef EDIT_BUTTON
+ {"Editor", EdAction},
+#endif
+ {"DeleteChar", DeleteChar},
+ {"DeleteLine", DeleteLine},
+ {"DeleteWord", DeleteWord},
+ {"Dispatch", Dispatch},
+ {"InsertSpace", InsertSpace},
+ {"NotifyResize", NotifyResize},
+ {"PrintSelection", PrintSelection},
+ {"Search", Search},
+ {"SelectEnd", SelectEnd},
+ {"SelectStart", SelectStart},
+ {"SelectWord", SelectWord},
+ {"SigEof", SigEof},
+ {"SigInt", SigInt},
+ {"SigQuit", SigQuit},
+ {"Update", Update},
+ {NULL, NULL}
};
static void Syntax(call)
|