summaryrefslogtreecommitdiff
path: root/xedit.c
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2004-09-02 08:40:32 +0000
committerKevin E Martin <kem@kem.org>2004-09-02 08:40:32 +0000
commit3981cffbb6f4f4fe4227481c51083063a9ea995e (patch)
treed27d76de4d0835d3448cb1978060c74a3e1df3dd /xedit.c
parent6b12ddbb33c8722e50e7f69f456ba0ba72b76ddd (diff)
Restore xman and xedit changes that were previously reverted, and makerel-0-6-1lg3d-rel-0-7-0lg3d-baseXORG-6_8_1XORG-6_8_0XORG-6_7_99_904
Xprint support optional (Bug #1273, Roland Mainz).
Diffstat (limited to 'xedit.c')
-rw-r--r--xedit.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/xedit.c b/xedit.c
index 8648c06..073078d 100644
--- a/xedit.c
+++ b/xedit.c
@@ -41,6 +41,9 @@ static XtActionsRec actions[] = {
{"quit", QuitAction},
{"save-file", SaveFile},
{"load-file", LoadFile},
+#ifdef INCLUDE_XPRINT_SUPPORT
+{"print-file", PrintFile},
+#endif /* INCLUDE_XPRINT_SUPPORT */
{"find-file", FindFile},
{"cancel-find-file", CancelFindFile},
{"file-completion", FileCompletion},
@@ -71,7 +74,6 @@ static XawTextPositionInfo infos[3];
Widget topwindow, textwindow, messwidget, labelwindow, filenamewindow;
Widget scratch, hpane, vpanes[2], labels[3], texts[3], forms[3], positions[3];
Widget options_popup, dirlabel, dirwindow;
-Boolean international;
Boolean line_edit;
XawTextWrapMode wrapmodes[3];
@@ -111,6 +113,11 @@ static XtResource resources[] = {
#undef Offset
+String fallback_resources[] = {
+ "*international: True", /* set this globally for ALL widgets to avoid wiered crashes */
+ NULL
+};
+
int
main(int argc, char *argv[])
{
@@ -118,7 +125,7 @@ main(int argc, char *argv[])
unsigned num_loaded = 0;
XtSetLanguageProc(NULL, NULL, NULL);
- topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, NULL, NULL, 0);
+ topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, fallback_resources, NULL, 0);
XtAppAddActions(appcon, actions, XtNumber(actions));
XtOverrideTranslations
@@ -240,9 +247,8 @@ main(int argc, char *argv[])
flags = 0;
XtSetArg(args[num_args], XtNstring, NULL); num_args++;
}
- source = XtVaCreateWidget("textSource", international ?
- multiSrcObjectClass
- : asciiSrcObjectClass, topwindow,
+ source = XtVaCreateWidget("textSource",
+ multiSrcObjectClass, topwindow,
XtNtype, XawAsciiFile,
XtNeditType, XawtextEdit,
NULL, NULL);
@@ -281,7 +287,7 @@ main(int argc, char *argv[])
XtSetKeyboardFocus(topwindow, textwindow);
XtAppMainLoop(appcon);
- exit(0);
+ return EXIT_SUCCESS;
}
static void
@@ -302,6 +308,9 @@ makeButtonsAndBoxes(Widget parent)
MakeCommandButton(b_row, "quit", DoQuit);
MakeCommandButton(b_row, "save", DoSave);
MakeCommandButton(b_row, "load", DoLoad);
+#ifdef INCLUDE_XPRINT_SUPPORT
+ MakeCommandButton(b_row, "print", DoPrint);
+#endif /* INCLUDE_XPRINT_SUPPORT */
filenamewindow = MakeStringBox(b_row, "filename", NULL);
}
hintswindow = XtCreateManagedWidget("bc_label", labelWidgetClass,
@@ -347,15 +356,10 @@ makeButtonsAndBoxes(Widget parent)
textwindow = XtCreateManagedWidget(editWindow, asciiTextWidgetClass,
vpanes[0], arglist, num_args);
num_args = 0;
- XtSetArg(arglist[num_args], XtNinternational, &international); ++num_args;
- XtGetValues(textwindow, arglist, num_args);
-
- num_args = 0;
XtSetArg(arglist[num_args], XtNtype, XawAsciiFile); ++num_args;
XtSetArg(arglist[num_args], XtNeditType, XawtextEdit); ++num_args;
- scratch = XtVaCreateWidget("textSource", international ?
- multiSrcObjectClass
- : asciiSrcObjectClass, topwindow,
+ scratch = XtVaCreateWidget("textSource",
+ multiSrcObjectClass, topwindow,
XtNtype, XawAsciiFile,
XtNeditType, XawtextEdit,
NULL, NULL);