diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-03-11 21:44:25 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:04:16 -0300 |
commit | f1d58be104f4020ef718a542d7f5ca72cd1f531b (patch) | |
tree | b6ab0cdc1de4bdda0a5df1f6c2771dec9ec3d02e | |
parent | 7d5dbf4a19ec6bbd36784f5d7307629b69dda873 (diff) |
Readd support for *international resource and default to false.
This allows several features, like syntax highlight and indentation,
turned off to be enabled again.
-rw-r--r-- | Xedit-noxprint.ad | 5 | ||||
-rw-r--r-- | Xedit-xprint.ad | 3 | ||||
-rw-r--r-- | commands.c | 10 | ||||
-rw-r--r-- | xedit.c | 33 | ||||
-rw-r--r-- | xedit.h | 1 |
5 files changed, 40 insertions, 12 deletions
diff --git a/Xedit-noxprint.ad b/Xedit-noxprint.ad index 16334a3..2b8bf25 100644 --- a/Xedit-noxprint.ad +++ b/Xedit-noxprint.ad @@ -5,7 +5,7 @@ *enableBackups: True *backupNameSuffix: ~ *changedBitmap: xlogo11 -*international: True +*international: False *hints:\ Use Control-S and Control-R to Search.\n\ @@ -257,7 +257,8 @@ c<Key>G: cancel-find-file()\n\ !*ispell.dictionary: br !*ispell.dictionaries: br american americanmed+ english !*ispell*br.wordChars: áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ- -!*ispell.ispellCommand: /usr/local/bin/ispell -B -m +*ispell.ispellCommand: /usr/bin/aspell -B -m +*ispell.lookCommand: /bin/egrep !*ispell*text.skipLines: .# *ispell.geometry: 0x0 diff --git a/Xedit-xprint.ad b/Xedit-xprint.ad index cb8445f..cbc272b 100644 --- a/Xedit-xprint.ad +++ b/Xedit-xprint.ad @@ -261,7 +261,8 @@ c<Key>G: cancel-find-file()\n\ !*ispell.dictionary: br !*ispell.dictionaries: br american americanmed+ english !*ispell*br.wordChars: áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ- -!*ispell.ispellCommand: /usr/local/bin/ispell -B -m +*ispell.ispellCommand: /usr/bin/aspell -B -m +*ispell.lookCommand: /bin/egrep !*ispell*text.skipLines: .# *ispell.geometry: 0x0 @@ -357,8 +357,9 @@ DoSave(Widget w, XtPointer client_data, XtPointer call_data) XtRemoveCallback(scratch, XtNcallback, SourceChanged, (XtPointer)item); item->source = scratch = - XtVaCreateWidget("textSource", - multiSrcObjectClass, + XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, @@ -495,8 +496,9 @@ ReallyDoLoad(char *name, char *filename) XtSetArg(args[num_args], XtNstring, NULL); num_args++; } - source = XtVaCreateWidget("textSource", - multiSrcObjectClass, + source = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, @@ -73,6 +73,7 @@ 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]; @@ -112,10 +113,12 @@ static XtResource resources[] = { #undef Offset +#ifdef INCLUDE_XPRINT_SUPPORT String fallback_resources[] = { "*international: True", /* set this globally for ALL widgets to avoid wiered crashes */ NULL }; +#endif int main(int argc, char *argv[]) @@ -123,8 +126,16 @@ main(int argc, char *argv[]) XtAppContext appcon; unsigned num_loaded = 0; +#ifdef INCLUDE_XPRINT_SUPPORT XtSetLanguageProc(NULL, NULL, NULL); - topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, fallback_resources, NULL, 0); +#endif + topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv, +#ifdef INCLUDE_XPRINT_SUPPORT + fallback_resources, +#else + NULL, +#endif + NULL, 0); XtAppAddActions(appcon, actions, XtNumber(actions)); XtOverrideTranslations @@ -246,8 +257,9 @@ main(int argc, char *argv[]) flags = 0; XtSetArg(args[num_args], XtNstring, NULL); num_args++; } - source = XtVaCreateWidget("textSource", - multiSrcObjectClass, topwindow, + source = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, NULL, NULL); @@ -354,11 +366,22 @@ makeButtonsAndBoxes(Widget parent) XtSetArg(arglist[num_args], XtNeditType, XawtextEdit); ++num_args; textwindow = XtCreateManagedWidget(editWindow, asciiTextWidgetClass, vpanes[0], arglist, num_args); + +#ifdef INCLUDE_XPRINT_SUPPORT + international = True; +#else + /* Get international resource value form the textwindow */ + num_args = 0; + XtSetArg(arglist[num_args], XtNinternational, &international); ++num_args; + XtGetValues(textwindow, arglist, num_args); +#endif + num_args = 0; XtSetArg(arglist[num_args], XtNtype, XawAsciiFile); ++num_args; XtSetArg(arglist[num_args], XtNeditType, XawtextEdit); ++num_args; - scratch = XtVaCreateWidget("textSource", - multiSrcObjectClass, topwindow, + scratch = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : + asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, NULL, NULL); @@ -100,6 +100,7 @@ extern struct _app_resources { extern Widget topwindow, textwindow, labelwindow, filenamewindow, messwidget; extern Widget dirlabel, dirwindow; +extern Boolean international; extern Boolean line_edit; /* externals in xedit.c */ |