--- modules/FvwmM4/FvwmM4.c.orig Wed Dec 11 01:41:45 1996 +++ modules/FvwmM4/FvwmM4.c Tue May 6 22:13:29 1997 @@ -330,6 +330,9 @@ #ifdef XPM strcat(options, "XPM "); #endif +#ifdef I18N + strcat(options, "I18N "); +#endif strcat(options, "M4 "); --- modules/FvwmM4/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmM4/Makefile.in Tue May 6 22:13:29 1997 @@ -18,7 +18,7 @@ fvwm_dir=@prefix@/lib/X11/@fvwm_name@ PATH_DEFINES = -DFVWMDIR=\"${fvwm_dir}\" -EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE +EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE @local_defines@ # # Libs --- modules/FvwmCpp/FvwmCpp.c.orig Wed Dec 11 01:41:42 1996 +++ modules/FvwmCpp/FvwmCpp.c Tue May 6 22:13:29 1997 @@ -299,6 +299,9 @@ #ifdef XPM strcat(options, "XPM "); #endif +#ifdef I18N + strcat(options, "I18N "); +#endif strcat(options, "Cpp "); --- modules/FvwmCpp/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmCpp/Makefile.in Tue May 6 22:13:29 1997 @@ -26,7 +26,7 @@ LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} PATH_DEFINES = -DFVWMDIR=\"${fvwm_dir}\" -EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE +EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} --- modules/FvwmForm/FvwmForm.c.orig Tue May 6 22:11:54 1997 +++ modules/FvwmForm/FvwmForm.c Tue May 6 22:13:30 1997 @@ -6,6 +6,7 @@ * given, provided that this copyright is kept intact. */ #include +#include #include #include @@ -13,6 +14,9 @@ #include #include #include +#ifdef I18N +#include +#endif #include #define XK_MISCELLANY #include @@ -174,6 +178,15 @@ }; Font fonts[3]; XFontStruct *xfs[3]; +#ifdef I18N +XFontSet setxfs[3]; +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(set ## x,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(set/**/x,y,z) +#endif +#define XDrawImageString(t,u,v,w,x,y,z) XmbDrawImageString(t,u,FONTSET,v,w,x,y,z) +#endif Cursor xc_ibeam, xc_hand; @@ -187,7 +200,7 @@ static int N = 8; /* copy a string until '\0', or up to n chars, and delete trailing spaces */ -char *CopyString (char *cp, int n) +char *CopyNString (char *cp, int n) { char *dp, *bp; if (n == 0) @@ -195,7 +208,7 @@ bp = dp = (char *)malloc(n+1); while (n-- > 0) *dp++ = *cp++; - while (isspace(*(--dp))); + while (isspace(((unsigned char)(*(--dp))))); *(++dp) = '\0'; return bp; } @@ -233,7 +246,7 @@ if (c == '\\') { *(dp++) = '\\'; *(dp++) = *(cp++); - } else if (isspace(c) || c == '\0') { + } else if (isspace((unsigned char)c) || c == '\0') { *dp = '\0'; return bp; } else @@ -262,6 +275,10 @@ char *cp; Line *cur_line, *line; Item *item, *cur_sel, *cur_button; +#ifdef I18N + char **ml; + XFontStruct **fs_list; +#endif #define AddToLine(item) { cur_line->items[cur_line->n++] = item; cur_line->size_x += item->header.size_x; if (cur_line->size_y < item->header.size_y) cur_line->size_y = item->header.size_y; } @@ -282,15 +299,23 @@ def_button.button.key = IB_CONTINUE; /* default fonts in case the *FFFont's are missing */ +#ifdef I18N + setxfs[f_text] = setxfs[f_input] = setxfs[f_button] = + GetFontSetOrFixed(dpy, "fixed"); + XFontsOfFontSet(setxfs[f_text], &fs_list, &ml); + xfs[f_text] = xfs[f_input] = xfs[f_button] = fs_list[0]; + fonts[f_text] = fonts[f_input] = fonts[f_button] = xfs[f_text]->fid; +#else xfs[f_text] = xfs[f_input] = xfs[f_button] = GetFontOrFixed(dpy, "fixed"); fonts[f_text] = fonts[f_input] = fonts[f_button] = xfs[f_text]->fid; +#endif prog_name_len = strlen(prog_name); while (GetConfigLine(fd,&line_buf),line_buf) { cp = line_buf; - while (isspace(*cp)) cp++; /* skip blanks */ + while (isspace((unsigned char)*cp)) cp++; /* skip blanks */ if (*cp != '*') continue; if (strncmp(++cp, prog_name, prog_name_len) != 0) continue; cp += prog_name_len; @@ -305,66 +330,87 @@ else if (strncmp(cp, "Position", 8) == 0) { cp += 8; geom = 1; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; gx = atoi(cp); - while (!isspace(*cp)) cp++; - while (isspace(*cp)) cp++; + while (!isspace((unsigned char)*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; gy = atoi(cp); fprintf(fp_err, "Position @ (%d, %d)\n", gx, gy); continue; } else if (strncmp(cp, "Fore", 4) == 0) { cp += 4; - while (isspace(*cp)) cp++; - color_names[c_fore] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + color_names[c_fore] = CopyNString(cp, 0); fprintf(fp_err, "ColorFore: %s\n", color_names[c_fore]); continue; } else if (strncmp(cp, "Back", 4) == 0) { cp += 4; - while (isspace(*cp)) cp++; - color_names[c_back] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + color_names[c_back] = CopyNString(cp, 0); fprintf(fp_err, "ColorBack: %s\n", color_names[c_back]); continue; } else if (strncmp(cp, "ItemFore", 8) == 0) { cp += 8; - while (isspace(*cp)) cp++; - color_names[c_itemfore] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + color_names[c_itemfore] = CopyNString(cp, 0); fprintf(fp_err, "ColorItemFore: %s\n", color_names[c_itemfore]); continue; } else if (strncmp(cp, "ItemBack", 8) == 0) { cp += 8; - while (isspace(*cp)) cp++; - color_names[c_itemback] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + color_names[c_itemback] = CopyNString(cp, 0); fprintf(fp_err, "ColorItemBack: %s\n", color_names[c_itemback]); continue; } else if (strncmp(cp, "Font", 4) == 0) { cp += 4; - while (isspace(*cp)) cp++; - font_names[f_text] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + font_names[f_text] = CopyNString(cp, 0); fprintf(fp_err, "Font: %s\n", font_names[f_text]); +#ifdef I18N + setxfs[f_text] = GetFontSetOrFixed(dpy, font_names[f_text]); + XFontsOfFontSet(setxfs[f_text], &fs_list, &ml); + xfs[f_text] = fs_list[0]; + fonts[f_text] = xfs[f_text]->fid; +#else xfs[f_text] = GetFontOrFixed(dpy, font_names[f_text]); fonts[f_text] = xfs[f_text]->fid; +#endif continue; } else if (strncmp(cp, "ButtonFont", 10) == 0) { cp += 10; - while (isspace(*cp)) cp++; - font_names[f_button] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + font_names[f_button] = CopyNString(cp, 0); fprintf(fp_err, "ButtonFont: %s\n", font_names[f_button]); +#ifdef I18N + setxfs[f_button] = GetFontSetOrFixed(dpy, font_names[f_button]); + XFontsOfFontSet(setxfs[f_button], &fs_list, &ml); + xfs[f_button] = fs_list[0]; + fonts[f_button] = xfs[f_button]->fid; +#else xfs[f_button] = GetFontOrFixed(dpy, font_names[f_button]); fonts[f_button] = xfs[f_button]->fid; +#endif continue; } else if (strncmp(cp, "InputFont", 9) == 0) { cp += 9; - while (isspace(*cp)) cp++; - font_names[f_input] = CopyString(cp, 0); + while (isspace((unsigned char)*cp)) cp++; + font_names[f_input] = CopyNString(cp, 0); fprintf(fp_err, "InputFont: %s\n", font_names[f_input]); +#ifdef I18N + setxfs[f_input] = GetFontSetOrFixed(dpy, font_names[f_input]); + XFontsOfFontSet(setxfs[f_input], &fs_list, &ml); + xfs[f_input] = fs_list[0]; + fonts[f_input] = xfs[f_input]->fid; +#else xfs[f_input] = GetFontOrFixed(dpy, font_names[f_input]); fonts[f_input] = xfs[f_input]->fid; +#endif continue; } else if (strncmp(cp, "Line", 4) == 0) { cp += 4; cur_line = lines + n_lines++; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (strncmp(cp, "left", 4) == 0) cur_line->justify = L_LEFT; else if (strncmp(cp, "right", 5) == 0) @@ -382,7 +428,7 @@ item = items + n_items++; item->type = I_TEXT; item->header.name = ""; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (*cp == '\"') item->text.value = CopyQuotedString(++cp); else @@ -401,13 +447,13 @@ cp += 5; item = items + n_items++; item->type = I_INPUT; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; item->header.name = CopySolidString(cp); cp += strlen(item->header.name); - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; item->input.size = atoi(cp); - while (!isspace(*cp)) cp++; - while (isspace(*cp)) cp++; + while (!isspace((unsigned char)*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (*cp == '\"') item->input.init_value = CopyQuotedString(++cp); else @@ -430,10 +476,10 @@ cp += 9; cur_sel = items + n_items++; cur_sel->type = I_SELECT; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; cur_sel->header.name = CopySolidString(cp); cp += strlen(cur_sel->header.name); - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (strncmp(cp, "multiple", 8) == 0) cur_sel->select.key = IS_MULTIPLE; else @@ -447,19 +493,19 @@ cp += 6; item = items + n_items++; item->type = I_CHOICE; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; item->header.name = CopySolidString(cp); cp += strlen(item->header.name); - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; item->choice.value = CopySolidString(cp); cp += strlen(item->choice.value); - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (strncmp(cp, "on", 2) == 0) item->choice.init_on = 1; else item->choice.init_on = 0; - while (!isspace(*cp)) cp++; - while (isspace(*cp)) cp++; + while (!isspace((unsigned char)*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (*cp == '\"') item->choice.text = CopyQuotedString(++cp); else @@ -480,19 +526,19 @@ item = items + n_items++; item->type = I_BUTTON; item->header.name = ""; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (strncmp(cp, "restart", 7) == 0) item->button.key = IB_RESTART; else if (strncmp(cp, "quit", 4) == 0) item->button.key = IB_QUIT; else item->button.key = IB_CONTINUE; - while (!isspace(*cp)) cp++; - while (isspace(*cp)) cp++; + while (!isspace((unsigned char)*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; if (*cp == '\"') { item->button.text = CopyQuotedString(++cp); cp += strlen(item->button.text) + 1; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; } else item->button.text = ""; if (*cp == '^') @@ -514,9 +560,9 @@ } else if (strncmp(cp, "Command", 7) == 0) { /* syntax: *FFCommand */ cp += 7; - while (isspace(*cp)) cp++; + while (isspace((unsigned char)*cp)) cp++; cur_button->button.commands[cur_button->button.n++] = - CopyString(cp, 0); + CopyNString(cp, 0); } } /* end of switch() */ /* get the geometry right */ @@ -694,12 +740,20 @@ case I_TEXT: x = item->header.pos_x + TEXT_SPC; y = item->header.pos_y + TEXT_SPC + xfs[f_text]->ascent; +#ifdef I18N +#undef FONTSET +#define FONTSET setxfs[f_text] +#endif XDrawImageString(dpy, frame, gc_text, x, y, item->text.value, item->text.n); break; case I_CHOICE: x = item->header.pos_x + TEXT_SPC + item->header.size_y; y = item->header.pos_y + TEXT_SPC + xfs[f_text]->ascent; +#ifdef I18N +#undef FONTSET +#define FONTSET setxfs[f_text] +#endif XDrawImageString(dpy, frame, gc_text, x, y, item->choice.text, item->choice.n); break; @@ -744,6 +798,10 @@ x, BOX_SPC, x, dy - BOX_SPC); } len = item->input.n - item->input.left; +#ifdef I18N +#undef FONTSET +#define FONTSET setxfs[f_input] +#endif if (len > item->input.size) len = item->input.size; else @@ -834,6 +892,10 @@ xsegs[3].x2 = dx - 1, xsegs[3].y2 = dy; XDrawSegments(dpy, item->header.win, gc_button, xsegs, 4); XSetForeground(dpy, gc_button, colors[c_itemfore]); +#ifdef I18N +#undef FONTSET +#define FONTSET setxfs[f_button] +#endif XDrawImageString(dpy, item->header.win, gc_button, BOX_SPC + TEXT_SPC, BOX_SPC + TEXT_SPC + xfs[f_button]->ascent, @@ -900,7 +962,7 @@ *(vp++) = '\0'; break; } - else if (!isspace(x)) + else if (!isspace((unsigned char)x)) *(vp++) = x; } for (i = 0; i < n_items; i++) { @@ -1363,6 +1425,10 @@ { int len, x, dy; len = cur_text->input.n - cur_text->input.left; +#ifdef I18N +#undef FONTSET +#define FONTSET setxfs[f_input] +#endif if (len > cur_text->input.size) len = cur_text->input.size; else @@ -1477,6 +1543,10 @@ { FILE *fdopen(); int i; + +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif buf = (char *)malloc(N); /* some kludge */ --- modules/FvwmForm/FvwmForm.man.orig Tue Apr 30 04:28:00 1996 +++ modules/FvwmForm/FvwmForm.man Tue May 6 22:13:30 1997 @@ -145,7 +145,7 @@ .B \fImultiple\fP This is a multiple-choice selection. .TP 4 -.B *FvwmFormChoice \fIname\fP \fIvalue\fP on | off "\fIstring\fP" +.B *FvwmFormChoice \fIname\fP \fIvalue\fP "on | off" "\fIstring\fP" Specifies a choice for a selection. The choice item has a \fIname\fP and a \fIvalue\fP. The \fIstring\fP will be displayed to the right of the choice button --- modules/FvwmForm/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmForm/Makefile.in Tue May 6 22:13:30 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmSave/FvwmSave.c.orig Wed Dec 11 03:09:26 1996 +++ modules/FvwmSave/FvwmSave.c Tue May 6 22:13:30 1997 @@ -247,7 +247,7 @@ for(i=0;i #include #include +#ifdef I18N +#include +#endif #include "../../fvwm/module.h" #include "FvwmIdent.h" @@ -59,6 +62,9 @@ Window main_win; Window app_win; XFontStruct *font; +#ifdef I18N +XFontSet fontset; +#endif int Width, Height,win_x,win_y; @@ -88,6 +94,10 @@ int Clength; char *tline; +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif + /* Save the program name for error messages and config parsing */ temp = argv[0]; s=strrchr(argv[0], '/'); @@ -345,6 +355,12 @@ int JunkX, JunkY; unsigned int JunkMask; int x,y; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif if(!found) { @@ -356,11 +372,20 @@ close(fd[1]); /* load the font */ +#ifdef I18N + if ((fontset = XCreateFontSet(dpy, font_string, &ml, &mc, &ds)) == NULL) { + if ((fontset = XCreateFontSet(dpy, "fixed", &ml, &mc, &ds)) == NULL) + exit(1); + } + XFontsOfFontSet(fontset, &fs_list, &ml); + font = fs_list[0]; +#else if ((font = XLoadQueryFont(dpy, font_string)) == NULL) { if ((font = XLoadQueryFont(dpy, "fixed")) == NULL) exit(1); }; +#endif /* make window infomation list */ MakeList(); --- modules/FvwmIdent/FvwmIdent.h.orig Wed Dec 11 01:41:45 1996 +++ modules/FvwmIdent/FvwmIdent.h Tue May 6 22:13:31 1997 @@ -66,6 +66,11 @@ void list_res_name(unsigned long *body); void list_end(void); +#ifdef I18N +#define XTextWidth(x,y,z) XmbTextEscapement(fontset,y,z) +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,fontset,v,w,x,y,z) +#endif + #ifdef BROKEN_SUN_HEADERS #include "../../fvwm/sun_headers.h" #endif --- modules/FvwmIdent/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmIdent/Makefile.in Tue May 6 22:13:31 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmPager/FvwmPager.c.orig Wed Dec 11 01:41:45 1996 +++ modules/FvwmPager/FvwmPager.c Tue May 6 22:13:32 1997 @@ -34,6 +34,9 @@ #include #include #include +#ifdef I18N +#include +#endif #include "../../fvwm/module.h" @@ -87,6 +90,9 @@ char line[100]; char mask_mesg[50]; +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif /* Save our program name - for error messages */ temp = argv[0]; s=strrchr(argv[0], '/'); @@ -818,7 +824,7 @@ (strncasecmp(tline, CatString3("*", MyName, "Geometry"),Clength+9)==0)) { tmp = &tline[Clength+9]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) { tmp++; } @@ -858,7 +864,7 @@ Clength+13)==0)) { tmp = &tline[Clength+13]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp & 0xff))&&(*tmp != '\n'))&&(*tmp != 0)) { tmp++; } @@ -886,8 +892,8 @@ if((desk >= desk1)&&(desk <=desk2)) { n = 0; - while(isspace(tline[Clength+6+n]))n++; - while(!isspace(tline[Clength+6+n]))n++; + while(isspace((unsigned char)tline[Clength+6+n] & 0xff))n++; + while(!isspace((unsigned char)tline[Clength+6+n] & 0xff))n++; free(Desks[desk - desk1].label); CopyString(&Desks[desk - desk1].label,&tline[Clength+6+n]); } @@ -931,8 +937,8 @@ if((desk >= desk1)&&(desk <=desk2)) { n = 0; - while(isspace(tline[Clength+10+n]))n++; - while(!isspace(tline[Clength+10+n]))n++; + while(isspace((unsigned char)tline[Clength+10+n]))n++; + while(!isspace((unsigned char)tline[Clength+10+n]))n++; free(Desks[desk - desk1].Dcolor); CopyString(&Desks[desk - desk1].Dcolor,&tline[Clength+10+n]); #ifdef DEBUG --- modules/FvwmPager/x_pager.c.orig Wed Dec 11 01:41:46 1996 +++ modules/FvwmPager/x_pager.c Tue May 6 22:13:32 1997 @@ -32,6 +32,16 @@ extern int StartIconic; extern int icon_w, icon_h, icon_x, icon_y; XFontStruct *font, *windowFont; +#ifdef I18N +XFontSet fontset, windowFontset; +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,FONTSET,v,w,x,y,z) +#define XDrawImageString(t,u,v,w,x,y,z) XmbDrawImageString(t,u,FONTSET,v,w,x,y,z) +#endif GC NormalGC,DashedGC,HiliteGC,rvGC; GC StdGC; @@ -97,6 +107,12 @@ { XWMHints wmhints; XClassHint class1; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif XTextProperty name; unsigned long valuemask; @@ -115,6 +131,18 @@ wm_del_win = XInternAtom(dpy,"WM_DELETE_WINDOW",False); /* load the font */ +#ifdef I18N + if (!uselabel || ((fontset = XCreateFontSet(dpy, font_string, &ml, &mc, &ds)) == NULL)) + { + if ((fontset = XCreateFontSet(dpy, "fixed", &ml, &mc, &ds)) == NULL) + { + fprintf(stderr,"%s: No fonts available\n",MyName); + exit(1); + } + } + XFontsOfFontSet(fontset, &fs_list, &ml); + font = fs_list[0]; +#else if (!uselabel || ((font = XLoadQueryFont(dpy, font_string)) == NULL)) { if ((font = XLoadQueryFont(dpy, "fixed")) == NULL) @@ -123,18 +151,36 @@ exit(1); } }; +#endif + if(uselabel) label_h = font->ascent + font->descent+2; else label_h = 0; - +#ifdef I18N + if(smallFont != NULL) + { + windowFontset = XCreateFontSet(dpy, smallFont, &ml, &mc, &ds); + if (windowFontset != NULL) + { + XFontsOfFontSet(windowFontset, &fs_list, &ml); + windowFont = fs_list[0]; + } + } + else + { + windowFontset = NULL; + windowFont = NULL; + } +#else if(smallFont!= NULL) { windowFont= XLoadQueryFont(dpy, smallFont); } else windowFont= NULL; +#endif /* Load the colors */ fore_pix = GetColor(PagerFore); @@ -641,6 +687,9 @@ { int n1,m1,x,y,n,m,i; XTextProperty name; +#ifdef I18N + int ret; +#endif char str[100],*sptr; static int icon_desk_shown = -1000; @@ -677,11 +726,22 @@ sprintf(str,"Desk %d",Scr.CurrentDesk); sptr = &str[0]; } +#ifdef I18N + if ((ret = XmbTextListToTextProperty(dpy,&sptr,1,XStdICCTextStyle,&name)) + == XNoMemory) + { + fprintf(stderr,"%s: cannot allocate window name",MyName); + return; + } + else if (ret != Success) + return; +#else if (XStringListToTextProperty(&sptr,1,&name) == 0) { fprintf(stderr,"%s: cannot allocate window name",MyName); return; } +#endif XSetWMIconName(dpy,Scr.Pager_w,&name); } } @@ -792,6 +852,10 @@ if((w<= desk_w)&&(uselabel)) { hor_off = (desk_w -w)/2; +#ifdef I18N +#undef FONTSET +#define FONTSET fontset +#endif if(i == (Scr.CurrentDesk - desk1)) XDrawString (dpy, Desks[i].title_w,rvGC,hor_off,font->ascent +1 , ptr, strlen(ptr)); @@ -1507,6 +1571,10 @@ XChangeGC(dpy, StdGC,Globalgcm,&Globalgcv); } +#ifdef I18N +#undef FONTSET +#define FONTSET windowFontset +#endif if(t->PagerView != None) { XClearWindow(dpy, t->PagerView); @@ -1544,6 +1612,10 @@ XChangeGC(dpy,StdGC,Globalgcm,&Globalgcv); } +#ifdef I18N +#undef FONTSET +#define FONTSET windowFontset +#endif XClearWindow(dpy, t->IconView); XDrawString (dpy, t->IconView,StdGC,2,windowFont->ascent+2 , t->icon_name, strlen(t->icon_name)); --- modules/FvwmPager/Makefile.in.orig Wed Sep 11 03:25:35 1996 +++ modules/FvwmPager/Makefile.in Tue May 6 22:13:32 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmWinList/ButtonArray.c.orig Wed Dec 11 01:41:49 1996 +++ modules/FvwmWinList/ButtonArray.c Tue May 6 22:13:33 1997 @@ -26,7 +26,19 @@ #define max(a,b) (((a)>(b)) ? (a) : (b)) #endif +#ifdef I18N +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,ButtonFontset,v,w,x,y,z) +#endif + extern XFontStruct *ButtonFont; +#ifdef I18N +extern XFontSet ButtonFontset; +#endif extern Display *dpy; extern Window win; extern GC shadow[MAX_COLOUR_SETS],hilite[MAX_COLOUR_SETS]; --- modules/FvwmWinList/FvwmWinList.c.orig Wed Dec 11 01:41:49 1996 +++ modules/FvwmWinList/FvwmWinList.c Tue May 6 22:13:33 1997 @@ -72,6 +72,15 @@ #include #include #include +#ifdef I18N +#include +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,ButtonFontset,v,w,x,y,z) +#endif #include "../../fvwm/module.h" #include @@ -99,6 +108,9 @@ GC graph[MAX_COLOUR_SETS],shadow[MAX_COLOUR_SETS],hilite[MAX_COLOUR_SETS]; GC background[MAX_COLOUR_SETS]; XFontStruct *ButtonFont; +#ifdef I18N +XFontSet ButtonFontset; +#endif int fontheight; static Atom wm_del_win; Atom MwmAtom = None; @@ -152,6 +164,9 @@ strcat(Module, temp); Clength = strlen(Module); +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif /* Open the console for messages */ OpenConsole(); @@ -759,7 +774,7 @@ { char *temp; temp=string; - while(isspace(*temp)) temp++; + while(isspace((unsigned char)*temp)) temp++; if(strncasecmp(temp, "Click1", 6)==0) CopyString(&ClickAction[0],&temp[6]); else if(strncasecmp(temp, "Click2", 6)==0) @@ -924,6 +939,13 @@ ******************************************************************************/ void StartMeUp() { +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif + if (!(dpy = XOpenDisplay(""))) { fprintf(stderr,"%s: can't open display %s", Module, @@ -938,10 +960,18 @@ ScreenHeight = DisplayHeight(dpy,screen); ScreenWidth = DisplayWidth(dpy,screen); +#ifdef I18N + if ((ButtonFontset=XCreateFontSet(dpy,font_string,&ml,&mc,&ds)) == NULL) { + if ((ButtonFontset=XCreateFontSet(dpy,"fixed",&ml,&mc,&ds)) == NULL) exit(1); + } + XFontsOfFontSet(ButtonFontset,&fs_list,&ml); + ButtonFont = fs_list[0]; +#else if ((ButtonFont=XLoadQueryFont(dpy,font_string))==NULL) { if ((ButtonFont=XLoadQueryFont(dpy,"fixed"))==NULL) exit(1); } +#endif fontheight = ButtonFont->ascent+ButtonFont->descent; --- modules/FvwmWinList/Makefile.in.orig Wed Sep 11 03:25:37 1996 +++ modules/FvwmWinList/Makefile.in Tue May 6 22:13:33 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmBacker/FvwmBacker.c.orig Wed Dec 11 01:41:39 1996 +++ modules/FvwmBacker/FvwmBacker.c Tue May 6 22:13:33 1997 @@ -327,10 +327,10 @@ char *temp; int num; temp=string; - while(isspace(*temp)) temp++; + while(isspace((unsigned char)*temp)) temp++; num=atoi(temp); - while(!isspace(*temp)) temp++; - while(isspace(*temp)) temp++; + while(!isspace((unsigned char)*temp)) temp++; + while(isspace((unsigned char)*temp)) temp++; if (DeskCount<1) { commands=(Command*)safemalloc((num+1)*sizeof(Command)); while(DeskCount +#endif + #include "FvwmIconBox.h" #include char *MyName; XFontStruct *font; +#ifdef I18N +XFontSet fontset; +#define XTextWidth(x,y,z) XmbTextEscapement(fontset,y,z) +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,fontset,v,w,x,y,z) +#endif Display *dpy; /* which display are we talking to */ int x_fd,fd_width; @@ -169,6 +178,10 @@ char *temp, *s; XIconSize* size; +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif + temp = argv[0]; s=strrchr(argv[0], '/'); @@ -880,6 +893,12 @@ XGCValues gcv; unsigned long gcm; unsigned long mask; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif h_margin = margin1*2 + bar_width + margin2 + 8; v_margin = margin1*2 + bar_width + margin2 + 8; @@ -888,6 +907,18 @@ _XA_WM_PROTOCOLS = XInternAtom (dpy, "WM_PROTOCOLS", False); /* load the font */ +#ifdef I18N + if ((fontset = XCreateFontSet(dpy, font_string, &ml, &mc, &ds)) == NULL) + { + if ((fontset = XCreateFontSet(dpy, "fixed", &ml, &mc, &ds)) == NULL) + { + fprintf(stderr,"%s: No fonts available\n",MyName); + exit(1); + } + } + XFontsOfFontSet(fontset, &fs_list, &ml); + font = fs_list[0]; +#else if ((font = XLoadQueryFont(dpy, font_string)) == NULL) { if ((font = XLoadQueryFont(dpy, "fixed")) == NULL) @@ -896,6 +927,7 @@ exit(1); } }; +#endif if ((local_flags & HIDE_H)) v_margin -= bar_width + margin2 + 4; @@ -1435,7 +1467,7 @@ if (strncasecmp(tline,CatString3("*", MyName, "Geometry"),Clength+9)==0){ tmp = &tline[Clength+9]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) tmp++; tmp[strlen(tmp)-1] = 0; flags = XParseGeometry(tmp,&g_x,&g_y,&width,&height); @@ -1454,7 +1486,7 @@ } else if (strncasecmp(tline,CatString3("*", MyName, "MaxIconSize"),Clength+12)==0){ tmp = &tline[Clength+12]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) tmp++; tmp[strlen(tmp)-1] = 0; @@ -1518,7 +1550,7 @@ else if (strncasecmp(tline,CatString3("*",MyName, "Resolution"),Clength+11)==0){ tmp = &tline[Clength+11]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) tmp++; if (strncasecmp(tmp, "Desk", 4) == 0){ m_mask |= M_NEW_DESK; @@ -1533,7 +1565,7 @@ else if (strncasecmp(tline,CatString3("*",MyName, "SortIcons"),Clength+10)==0){ tmp = &tline[Clength+10]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) tmp++; if (strlen(tmp) == 0){ /* the case where no argument is given */ sortby = ICONNAME; @@ -1550,7 +1582,7 @@ }else if (strncasecmp(tline,CatString3("*",MyName, "HideSC"),Clength+7)==0){ tmp = &tline[Clength+7]; - while(((isspace(*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) + while(((isspace((unsigned char)*tmp))&&(*tmp != '\n'))&&(*tmp != 0)) tmp++; if (strncasecmp(tmp, "Horizontal", 10) == 0) local_flags |= HIDE_H; @@ -1603,11 +1635,11 @@ /* file */ /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; - while(!isspace(*end)&&(*end != '\n')&&(*end != 0)) + while(!isspace((unsigned char)*end)&&(*end != '\n')&&(*end != 0)) end++; len = end - start; ptr = safemalloc(len+1); @@ -1664,11 +1696,11 @@ f->mouse = 0; /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) + while((!isspace((unsigned char)*end))&&(*end!='\n')&&(*end!=0)) end++; if (strncasecmp(start, "1", 1) == 0) f->mouse = Button1; @@ -1679,11 +1711,11 @@ /* click or doubleclick */ tline = end; /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) + while((!isspace((unsigned char)*end))&&(*end!='\n')&&(*end!=0)) end++; if (strncasecmp(start, "Click", 5) == 0) f->type = CLICK; @@ -1693,13 +1725,13 @@ /* actions */ tline = end; /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; tmp = tline; while((*tmp!='\n')&&(*tmp!=0)){ - if (!isspace(*tmp)) + if (!isspace((unsigned char)*tmp)) end = tmp; tmp++; } @@ -1729,11 +1761,11 @@ KeySym keysym; /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; - while((!isspace(*end))&&(*end!='\n')&&(*end!=0)) + while((!isspace((unsigned char)*end))&&(*end!='\n')&&(*end!=0)) end++; nlen = end - start; nptr = safemalloc(nlen+1); @@ -1743,13 +1775,13 @@ /* actions */ tline = end; /* skip spaces */ - while(isspace(*tline)&&(*tline != '\n')&&(*tline != 0)) + while(isspace((unsigned char)*tline)&&(*tline != '\n')&&(*tline != 0)) tline++; start = tline; end = tline; tmp = tline; while((*tmp!='\n')&&(*tmp!=0)){ - if (!isspace(*tmp)) + if (!isspace((unsigned char)*tmp)) end = tmp; tmp++; } --- modules/FvwmIconBox/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmIconBox/Makefile.in Tue May 6 22:13:34 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_INCLUDES=-DXPM -DSHAPE +EXTRA_INCLUDES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_INCLUDES} --- modules/FvwmSaveDesk/FvwmSaveDesk.c.orig Wed Dec 11 01:41:46 1996 +++ modules/FvwmSaveDesk/FvwmSaveDesk.c Tue May 6 22:13:34 1997 @@ -262,7 +262,7 @@ for(i=0;i #endif +#ifdef I18N +#include +#endif #include #include #include @@ -146,6 +149,33 @@ } #endif +#ifdef I18N +/* + * fake XFetchName() function + */ +static Status MyXFetchName(dpy, win, winname) +Display *dpy; +Window win; +char **winname; +{ + XTextProperty text; + char **list; + int nitems; + + if (XGetWMName(dpy, win, &text)) { + if (text.value) + text.nitems = strlen(text.value); + if (XmbTextPropertyToTextList(dpy, &text, &list, &nitems) >= Success && + *list) { + *winname = *list; + return 0; + } + return 1; + } +} +#define XFetchName(x,y,z) MyXFetchName(x,y,z) +#endif + /** *** Some fancy routines straight out of the manual :-) Used in DeadPipe. **/ @@ -350,6 +380,9 @@ char *temp, *s; button_info *b,*ub; +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif temp=argv[0]; s=strrchr(argv[0],'/'); if(s) temp=s+1; @@ -615,7 +648,7 @@ stays down until window "identifier" materializes */ i=4; while(act[i]!=0 && act[i]!='"' && - isspace(act[i])) + isspace((unsigned char)act[i])) i++; if(act[i] == '"') { @@ -637,7 +670,7 @@ tmp=mymalloc(strlen(act)); strcpy(tmp,"Exec "); - while(act[i2]!=0 && isspace(act[i2])) + while(act[i2]!=0 && isspace((unsigned char)act[i2])) i2++; strcat(tmp,&act[i2]); MySendText(fd,tmp,0); @@ -782,6 +815,13 @@ { int i,j,x=0,y=0; XFontStruct *font; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; + XFontSet fontset; +#endif if(!b) return; @@ -838,12 +878,28 @@ if(strncasecmp(b->font_string,"none",4)==0) b->font=NULL; +#ifdef I18N + else if(!(b->fontset=XCreateFontSet(Dpy,b->font_string,&ml,&mc,&ds))) + { + b->font = NULL; + b->flags&=~b_Font; + fprintf(stderr,"%s: Couldn't load fontset %s\n",MyName, + b->font_string); + } + else + { + /* fontset found */ + XFontsOfFontSet(fontset, &fs_list, &ml); + b->font = fs_list[0]; + } +#else else if(!(b->font=XLoadQueryFont(Dpy,b->font_string))) { b->flags&=~b_Font; fprintf(stderr,"%s: Couldn't load font %s\n",MyName, b->font_string); } +#endif } if(b->flags&b_Container && b->c->flags&b_Font) @@ -853,6 +909,30 @@ # endif if(strncasecmp(b->c->font_string,"none",4)==0) b->c->font=NULL; +#ifdef I18N + else if(!(b->c->fontset=XCreateFontSet(Dpy,b->c->font_string,&ml,&mc,&ds))) + { + fprintf(stderr,"%s: Couldn't load fontset %s\n",MyName, + b->c->font_string); + if(b==UberButton) + { + if(!(b->c->fontset=XCreateFontSet(Dpy,"fixed",&ml,&mc,&ds))) { + fprintf(stderr,"%s: Couldn't load fontset fixed\n",MyName); + b->c->font = NULL; + } + } + else { + b->c->font = NULL; + b->c->flags&=~b_Font; + } + } + else + { + /* fontset found */ + XFontsOfFontSet(b->c->fontset, &fs_list, &ml); + b->c->font = fs_list[0]; + } +#else else if(!(b->c->font=XLoadQueryFont(Dpy,b->c->font_string))) { fprintf(stderr,"%s: Couldn't load font %s\n",MyName, @@ -865,6 +945,7 @@ else b->c->flags&=~b_Font; } +#endif } @@ -910,7 +991,11 @@ else b->flags&=~b_Icon; +#ifdef I18N + if(b->flags&b_Title && (fontset = buttonFontSet(b)) && (font=buttonFont(b))) +#else if(b->flags&b_Title && (font=buttonFont(b))) +#endif { # ifdef DEBUG_LOADDATA fprintf(stderr,", title \"%s\"",b->title); --- modules/FvwmButtons/FvwmButtons.h.orig Wed Dec 11 01:41:41 1996 +++ modules/FvwmButtons/FvwmButtons.h Tue May 6 22:13:35 1997 @@ -92,6 +92,9 @@ byte xpad,ypad; /* b_Padding */ signed char framew; /* b_Frame */ XFontStruct *font; /* b_Font */ +#ifdef I18N + XFontSet fontset; /* b_Font */ +#endif char *font_string; /* b_Font */ char *back; /* b_Back */ char *fore; /* b_Fore */ @@ -111,6 +114,9 @@ /* conditional fields */ /* applicable if these flags are set */ XFontStruct *font; /* b_Font */ +#ifdef I18N + XFontSet fontset; /* b_Font */ +#endif char *font_string; /* b_Font */ char *back; /* b_Back */ char *fore; /* b_Fore */ @@ -152,6 +158,15 @@ #endif #ifndef abs #define abs(a) (((a)>=0)?(a):-(a)) +#endif + +#ifdef I18N +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,fontset,v,w,x,y,z) #endif /* -------------------------------- prototypes ----------------------------- */ --- modules/FvwmButtons/button.c.orig Wed Dec 11 01:41:40 1996 +++ modules/FvwmButtons/button.c Tue May 6 22:13:35 1997 @@ -156,6 +156,25 @@ return None; } +#ifdef I18N +/** +*** buttonFontSet() +*** Give the font pointer for this button +**/ +XFontSet buttonFontSet(button_info *b) +{ + if(b->flags&b_Font) + return b->fontset; + while((b=b->parent)) + if(b->c->flags&b_Font) + return b->c->fontset; +#ifdef DEBUG + fprintf(stderr,"%s: BUG: No fontset definition?\n",MyName); +#endif + return None; +} +#endif + /** *** buttonFore() *** Give the foreground pixel of this button --- modules/FvwmButtons/button.h.orig Wed Dec 11 01:41:41 1996 +++ modules/FvwmButtons/button.h Tue May 6 22:13:36 1997 @@ -35,6 +35,9 @@ int buttonXPad(button_info*); int buttonYPad(button_info*); XFontStruct *buttonFont(button_info*); +#ifdef I18N +XFontSet buttonFontSet(button_info*); +#endif Pixel buttonFore(button_info*); Pixel buttonBack(button_info*); Pixel buttonHilite(button_info*); --- modules/FvwmButtons/draw.c.orig Wed Dec 11 01:41:40 1996 +++ modules/FvwmButtons/draw.c Tue May 6 22:13:36 1997 @@ -23,6 +23,9 @@ #include #include +#ifdef I18N +#include +#endif #include #include #include @@ -173,6 +176,9 @@ int f,x,y,px,py; int ix,iy,iw,ih; XFontStruct *font=buttonFont(b); +#ifdef I18N + XFontSet fontset = buttonFontSet(b); +#endif XGCValues gcv; unsigned long gcm=0; int rev=0; --- modules/FvwmButtons/parse.c.orig Wed Dec 11 01:41:41 1996 +++ modules/FvwmButtons/parse.c Tue May 6 22:13:36 1997 @@ -63,7 +63,7 @@ else { b=t=*s; - while(**s && !isspace(**s) && **s!=')' && **s!=',') + while(**s && !isspace((unsigned char)**s) && **s!=')' && **s!=',') (*s)++; t=*s; } --- modules/FvwmButtons/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmButtons/Makefile.in Tue May 6 22:13:36 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmDebug/FvwmDebug.c.orig Wed Dec 11 01:41:42 1996 +++ modules/FvwmDebug/FvwmDebug.c Tue May 6 22:13:37 1997 @@ -62,7 +62,7 @@ } else /* parent */ { - if (waitpid(pid, NULL, WNOHANG) != pid) + if (ReapChildrenPid(pid) != pid) { dup2(PIPE[1], STDOUT_FILENO); dup2(PIPE[1], STDERR_FILENO); --- modules/FvwmDebug/FvwmDebug.h.orig Wed Dec 11 01:41:43 1996 +++ modules/FvwmDebug/FvwmDebug.h Tue May 6 22:13:37 1997 @@ -38,3 +38,13 @@ #include "../../fvwm/sun_headers.h" #endif +#ifdef HAVE_WAITPID +#define ReapChildrenPid(pid) waitpid(pid, NULL, WNOHANG) +#else +#define ReapChildrenPid(pid) wait4(pid, NULL, WNOHANG, NULL) +#endif + +#ifdef sony_news +typedef int pid_t; +#define setvbuf(a,b,c,d) setlinebuf(a) +#endif --- modules/FvwmDebug/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmDebug/Makefile.in Tue May 6 22:13:38 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmTaskBar/ButtonArray.c.orig Wed Dec 11 01:41:47 1996 +++ modules/FvwmTaskBar/ButtonArray.c Tue May 6 22:13:38 1997 @@ -23,7 +23,19 @@ #include "ButtonArray.h" #include "Mallocs.h" +#ifdef I18N +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,fontset,v,w,x,y,z) +#endif + extern XFontStruct *ButtonFont, *SelButtonFont; +#ifdef I18N +extern XFontSet ButtonFontset, SelButtonFontset; +#endif extern Display *dpy; extern Window win; extern GC shadow, hilite, graph, whitegc, blackgc, checkered; @@ -112,6 +124,9 @@ int state, x3p, newx; int search_len; XFontStruct *font; +#ifdef I18N + XFontSet fontset; +#endif XGCValues gcv; unsigned long gcm; @@ -123,9 +138,23 @@ if (state != BUTTON_UP) { x++; y++; } if (state == BUTTON_BRIGHT || button == StartButton) +#ifdef I18N + { + font = SelButtonFont; + fontset = SelButtonFontset; + } +#else font = SelButtonFont; +#endif else +#ifdef I18N + { + font = ButtonFont; + fontset = ButtonFontset; + } +#else font = ButtonFont; +#endif gcm = GCFont; gcv.font = font->fid; --- modules/FvwmTaskBar/FvwmTaskBar.c.orig Thu Dec 12 05:58:36 1996 +++ modules/FvwmTaskBar/FvwmTaskBar.c Tue May 6 22:13:39 1997 @@ -45,6 +45,9 @@ #include #include #include +#ifdef I18N +#include +#endif #include "../../fvwm/module.h" #include @@ -85,6 +88,9 @@ Pixel back, fore; GC graph, shadow, hilite, blackgc, whitegc; XFontStruct *ButtonFont, *SelButtonFont; +#ifdef I18N +XFontSet ButtonFontset, SelButtonFontset; +#endif int fontheight; static Atom wm_del_win; Atom MwmAtom = None; @@ -171,6 +177,9 @@ strcat(Module, temp); Clength = strlen(Module); +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif /* Open the console for messages */ OpenConsole(); @@ -625,7 +634,7 @@ tline = fgets(line,(sizeof line)-1,ptr); while (tline != (char *)0) { - while (isspace(*tline))tline++; + while (isspace((unsigned char)*tline))tline++; if (strlen(tline)>1 && tline[0] != '#') { if(strncasecmp(tline, CatString3(Module, "Font",""),Clength+4)==0) CopyString(&font_string,&tline[Clength+4]); @@ -635,7 +644,7 @@ CopyString(&ForeColor,&tline[Clength+4]); else if(strncasecmp(tline,CatString3(Module, "Geometry",""), Clength+8)==0) { str = &tline[Clength+9]; - while(((isspace(*str))&&(*str != '\n'))&&(*str != 0)) str++; + while(((isspace((unsigned char)*str))&&(*str != '\n'))&&(*str != 0)) str++; str[strlen(str)-1] = 0; UpdateString(&geometry,str); } else if(strncasecmp(tline,CatString3(Module, "Back",""), Clength+4)==0) @@ -1035,7 +1044,7 @@ { char *temp; temp=string; - while(isspace(*temp)) temp++; + while(isspace((unsigned char)*temp)) temp++; if(strncasecmp(temp, "Click1", 6)==0) CopyString(&ClickAction[0],&temp[6]); else if(strncasecmp(temp, "Click2", 6)==0) @@ -1057,6 +1066,12 @@ unsigned int dummy1,dummy2; int x,y,ret,count; Window dummyroot,dummychild; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif if (!(dpy = XOpenDisplay(""))) { fprintf(stderr,"%s: can't open display %s", Module, @@ -1075,6 +1090,22 @@ if (selfont_string == NULL) selfont_string = font_string; +#ifdef I18N + if ((ButtonFontset=XCreateFontSet(dpy,font_string,&ml,&mc,&ds)) == NULL) { + if ((ButtonFontset=XCreateFontSet(dpy,"fixed",&ml,&mc,&ds)) == NULL) + ConsoleMessage("Couldn't load fixed font. Exiting!\n"); + exit(1); + } + XFontsOfFontSet(ButtonFontset,&fs_list,&ml); + ButtonFont = fs_list[0]; + if ((SelButtonFontset=XCreateFontSet(dpy,selfont_string,&ml,&mc,&ds)) == NULL) { + if ((SelButtonFontset=XCreateFontSet(dpy,"fixed",&ml,&mc,&ds)) == NULL) + ConsoleMessage("Couldn't load fixed font. Exiting!\n"); + exit(1); + } + XFontsOfFontSet(SelButtonFontset,&fs_list,&ml); + SelButtonFont = fs_list[0]; +#else if ((ButtonFont = XLoadQueryFont(dpy, font_string)) == NULL) { if ((ButtonFont = XLoadQueryFont(dpy, "fixed")) == NULL) { ConsoleMessage("Couldn't load fixed font. Exiting!\n"); @@ -1087,6 +1118,7 @@ exit(1); } } +#endif fontheight = SelButtonFont->ascent + SelButtonFont->descent; --- modules/FvwmTaskBar/Goodies.c.orig Thu Dec 12 06:09:20 1996 +++ modules/FvwmTaskBar/Goodies.c Tue May 6 22:13:39 1997 @@ -28,6 +28,15 @@ GC statusgc, dategc; XFontStruct *StatusFont; +#ifdef I18N +XFontSet StatusFontset; +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,StatusFontset,v,w,x,y,z) +#endif int stwin_width = 100, goodies_width = 0; int anymail, unreadmail, newmail, mailcleared = 0; int fontheight, clock_width; @@ -64,7 +73,9 @@ if (strcasecmp(&tline[Clength+8], "None") == 0) { NoMailCheck = True; } else { - UpdateString(&mailpath, &tline[Clength+11]); + UpdateString(&mailpath, &tline[Clength+8]); + mailpath[strlen(mailpath)-1] = 0; + } } else if(strncasecmp(tline,CatString3(Module, "ClockFormat",""), Clength+11)==0) { @@ -96,6 +107,12 @@ char tmp[1024]; XGCValues gcval; unsigned long gcmask; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif if (mailpath == NULL) { strcpy(tmp, DEFAULT_MAIL_PATH); @@ -104,12 +121,23 @@ UpdateString(&mailpath, tmp); } +#ifdef I18N + if ((StatusFontset=XCreateFontSet(dpy,statusfont_string,&ml,&mc,&ds))==NULL) { + if ((StatusFontset=XCreateFontSet(dpy,"fixed",&ml,&mc,&ds))==NULL) { + ConsoleMessage("Couldn't load fixed fontset...exiting !\n"); + exit(1); + } + } + XFontsOfFontSet(StatusFontset,&fs_list,&ml); + StatusFont = fs_list[0]; +#else if ((StatusFont = XLoadQueryFont(dpy, statusfont_string)) == NULL) { if ((StatusFont = XLoadQueryFont(dpy, "fixed")) == NULL) { ConsoleMessage("Couldn't load fixed font. Exiting!\n"); exit(1); } } +#endif fontheight = StatusFont->ascent + StatusFont->descent; --- modules/FvwmTaskBar/Goodies.h.orig Wed Dec 11 01:41:48 1996 +++ modules/FvwmTaskBar/Goodies.h Tue May 6 22:13:39 1997 @@ -1,4 +1,8 @@ +#ifdef __FreeBSD__ +#define DEFAULT_MAIL_PATH "/var/mail/" +#else #define DEFAULT_MAIL_PATH "/var/spool/mail/" +#endif #define DEFAULT_BELL_VOLUME 20 /* Tip window types */ --- modules/FvwmTaskBar/Start.c.orig Wed Dec 11 01:41:48 1996 +++ modules/FvwmTaskBar/Start.c Tue May 6 22:13:39 1997 @@ -4,10 +4,19 @@ #include #include "ButtonArray.h" +#include /* NULL may be defined */ extern Display *dpy; extern Window Root, win; extern XFontStruct *ButtonFont; +#ifdef I18N +extern XFontSet ButtonFontset; +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#endif extern int Clength; extern char *PixmapPath; extern char *IconPath; --- modules/FvwmTaskBar/Makefile.in.orig Wed Sep 11 03:25:37 1996 +++ modules/FvwmTaskBar/Makefile.in Tue May 6 22:13:40 1997 @@ -25,7 +25,7 @@ FVWM_LIBRARY=-l${fvwm_name} LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} --- modules/FvwmIconMan/FvwmIconMan.c.orig Wed Dec 11 01:41:44 1996 +++ modules/FvwmIconMan/FvwmIconMan.c Tue May 6 22:13:40 1997 @@ -1,4 +1,5 @@ #include "FvwmIconMan.h" +#include #include "../../fvwm/module.h" static int fd_width; @@ -659,6 +660,10 @@ char *temp, *s; FvwmPacketBody temppacket; +#ifdef I18N + setlocale(LC_CTYPE, ""); +#endif + if ((char *)&temppacket.add_config_data.window_gravity - (char *)&temppacket != 21 * sizeof (long)) { fprintf (stderr, "Bad packet structure. Can't run. Sorry\n"); @@ -690,7 +695,7 @@ read_in_resources (argv[3]); assert (globals.managers); - fd_width = sysconf(_SC_OPEN_MAX); + fd_width = GetFdWidth(); SetMessageMask(Fvwm_fd,M_CONFIGURE_WINDOW | M_RES_CLASS | M_RES_NAME | M_ADD_WINDOW | M_DESTROY_WINDOW | M_ICON_NAME | --- modules/FvwmIconMan/FvwmIconMan.h.orig Wed Dec 11 01:41:44 1996 +++ modules/FvwmIconMan/FvwmIconMan.h Tue May 6 22:13:40 1997 @@ -17,6 +17,10 @@ #include #include #include +#ifdef I18N +#include +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,man->ButtonFontset,v,w,x,y,z) +#endif #if defined ___AIX || defined _AIX || defined __QNX__ || defined ___AIXV3 || defined AIXV3 || defined _SEQUENT_ #include @@ -190,6 +194,9 @@ reliefContext[NUM_CONTEXTS]; GC shadowContext[NUM_CONTEXTS], flatContext[NUM_CONTEXTS]; XFontStruct *ButtonFont; +#ifdef I18N + XFontSet ButtonFontset; +#endif int fontheight, boxheight; int win_width, win_height; int win_x, win_y, win_title, win_border; --- modules/FvwmIconMan/xmanager.c.orig Wed Dec 11 01:41:44 1996 +++ modules/FvwmIconMan/xmanager.c Tue May 6 22:13:40 1997 @@ -701,6 +701,12 @@ int i, val, x, y; unsigned int width, height; WinManager *man; +#ifdef I18N + char **ml; + int mc; + char *ds; + XFontStruct **fs_list; +#endif ConsoleDebug ("In init_window\n"); @@ -716,6 +722,17 @@ man->cursor_in_window = 0; if (man->fontname) { +#ifdef I18N + man->ButtonFontset = XCreateFontSet (theDisplay, man->fontname, &ml, &mc, &ds); + if (!man->ButtonFontset) { + if (!(man->ButtonFontset = XCreateFontSet (theDisplay, FONT_STRING, &ml, &mc, &ds))) { + ConsoleMessage ("Can't get fontset\n"); + ShutMeDown (1); + } + } + XFontsOfFontSet(man->ButtonFontset,&fs_list,&ml); + man->ButtonFont = fs_list[0]; +#else man->ButtonFont = XLoadQueryFont (theDisplay, man->fontname); if (!man->ButtonFont) { if (!(man->ButtonFont = XLoadQueryFont (theDisplay, FONT_STRING))) { @@ -723,12 +740,22 @@ ShutMeDown (1); } } +#endif } else { +#ifdef I18N + if (!(man->ButtonFontset = XCreateFontSet (theDisplay, FONT_STRING, &ml, &mc, &ds))) { + ConsoleMessage ("Can't get fontset\n"); + ShutMeDown (1); + } + XFontsOfFontSet(man->ButtonFontset,&fs_list,&ml); + man->ButtonFont = fs_list[0]; +#else if (!(man->ButtonFont = XLoadQueryFont (theDisplay, FONT_STRING))) { ConsoleMessage ("Can't get font\n"); ShutMeDown (1); } +#endif } for ( i = 0; i < NUM_CONTEXTS; i++ ) { --- modules/FvwmIconMan/Makefile.in.orig Wed Sep 11 03:25:34 1996 +++ modules/FvwmIconMan/Makefile.in Tue May 6 22:13:41 1997 @@ -26,7 +26,7 @@ LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} PATH_DEFINES = -DFVWMDIR=\"${fvwm_dir}\" -EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE +EXTRA_DEFINES=${PATH_DEFINES} -DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} --- fvwm/add_window.c.orig Wed Dec 11 01:19:40 1996 +++ fvwm/add_window.c Tue May 6 22:13:41 1997 @@ -99,6 +99,13 @@ XrmValue rm_value; XTextProperty text_prop; extern Bool PPosOverride; +#ifdef I18N + Atom actual_type; + int actual_format; + unsigned long nitems, bytesafter; + char **list; + int num; +#endif NeedToResizeToo = False; /* allocate space for the fvwm window */ @@ -123,15 +130,82 @@ } if ( XGetWMName(dpy, tmp_win->w, &text_prop) != 0 ) { +#ifdef I18N + if (text_prop.value) text_prop.nitems = strlen(text_prop.value); + if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) >= Success + && num > 0 && *list) +#ifndef EVIL + { + tmp_win->name = *list; + tmp_win->realname = *list; + } + else + { + tmp_win->name = NoName; + tmp_win->realname = NoName; + } +#else /* EVIL */ + { + tmp_win->name = *list; + tmp_win->realname = *list; + if((tmp_win->name != NULL) && (strcmp(tmp_win->name, "")==0)) { + XGetWMName(dpy, tmp_win->w, &text_prop); + tmp_win->name = (char *)text_prop.value ; + tmp_win->realname = (char *)text_prop.value ; + } + } + else + { + XGetWMName(dpy, tmp_win->w, &text_prop); + tmp_win->name = (char *)text_prop.value ; + tmp_win->realname = (char *)text_prop.value ; + } +#endif /* EVIL */ +#else /* I18N */ tmp_win->name = (char *)text_prop.value; tmp_win->realname = (char *)text_prop.value; +#endif /* I18N */ } else { tmp_win->name = NoName; tmp_win->realname = NoName; } +#ifdef I18N + if (XGetWindowProperty(dpy, tmp_win->w, XA_WM_ICON_NAME, 0L, 200L, False, + AnyPropertyType, &actual_type, &actual_format, &nitems, + &bytesafter,(unsigned char **)&tmp_win->icon_name) + == Success && actual_type != None) { + text_prop.value = tmp_win->icon_name; + text_prop.encoding = actual_type; + text_prop.format = actual_format; + text_prop.nitems = nitems; + if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) >= Success + && num > 0 && *list) +#ifndef EVIL + tmp_win->icon_name = *list; + else + tmp_win->icon_name = NULL; +#else /* EVIL */ + { + tmp_win->icon_name = *list; + if((tmp_win->icon_name != NULL) && (strcmp(tmp_win->icon_name, "")==0)) { + XGetWMIconName (dpy, tmp_win->w, &text_prop); + tmp_win->icon_name = (char *) text_prop.value; + } + } + else + { + XGetWMIconName (dpy, tmp_win->w, &text_prop); + tmp_win->icon_name = (char *)text_prop.value ; + } +#endif /* EVIL */ + } + else + tmp_win->icon_name = NULL; +#else /* I18N */ XGetWMIconName (dpy, tmp_win->w, &text_prop); tmp_win->icon_name = (char *) text_prop.value; +#endif /* I18N */ if (tmp_win->icon_name != (char *)NULL) tmp_win->realname = tmp_win->icon_name; @@ -481,7 +555,34 @@ XChangeWindowAttributes (dpy, tmp_win->w, valuemask, &attributes); if ( XGetWMName(dpy, tmp_win->w, &text_prop) != 0 ) +#ifdef I18N + { + if (text_prop.value) text_prop.nitems = strlen(text_prop.value); + if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) >= Success + && num > 0 && *list) +#ifndef EVIL + tmp_win->name = *list; + else + tmp_win->name = NoName; +#else /* EVIL */ + { + tmp_win->name = *list; + tmp_win->realname = *list; + if((tmp_win->name != NULL) && (strcmp(tmp_win->name, "")==0)) { + XGetWMName(dpy, tmp_win->w, &text_prop); + tmp_win->name = (char *)text_prop.value ; + } + } + else + { + XGetWMName(dpy, tmp_win->w, &text_prop); + tmp_win->name = (char *)text_prop.value ; + } +#endif /* EVIL */ + } +#else /* I18N */ tmp_win->name = (char *)text_prop.value ; +#endif /* I18N */ else tmp_win->name = NoName; --- fvwm/borders.c.orig Wed Dec 11 06:35:48 1996 +++ fvwm/borders.c Tue May 6 22:13:41 1997 @@ -396,6 +396,11 @@ if (NewTitle) XClearWindow (dpy, t->title_w); +#ifdef I18N +#undef FONTSET +#define FONTSET Scr.WindowFont.fontset +#endif /* I18N */ + /* for mono, we clear an area in the title bar where the window * title goes, so that its more legible. For color, no need */ if(Scr.d_depth<2) --- fvwm/builtins.c.orig Wed Dec 11 01:36:30 1996 +++ fvwm/builtins.c Tue May 6 22:13:42 1997 @@ -7,6 +7,7 @@ ****************************************************************************/ #include +#include "../include/fvwm/fvwmlib.h" #include #include @@ -754,7 +755,15 @@ { if (execl(exec_shell_name, exec_shell_name, "-c", cmd, NULL)==-1) { +#if defined(sun) && !defined(SVR4) + /* XXX: dirty hack for SunOS 4.x */ + extern char *sys_errlist[]; + + /* no strerror() function, see sys_errlist[] instead */ + fvwm_msg(ERR,"exec_function","execl failed (%s)",sys_errlist[errno]); +#else fvwm_msg(ERR,"exec_function","execl failed (%s)",strerror(errno)); +#endif exit(100); } } @@ -1441,18 +1450,35 @@ char *font= NULL; extern char *white,*black; int wid,hei; +#ifdef I18N + XFontSetExtents *fset_extents; + XFontStruct **fs_list; + char **ml; +#endif action = GetNextToken(action, &font); +#ifdef I18N + if ((font == NULL)|| + (Scr.StdFont.fontset = GetFontSetOrFixed(dpy, font)) == NULL) +#else if ((font == NULL)|| (Scr.StdFont.font = GetFontOrFixed(dpy, font)) == NULL) +#endif { fprintf(stderr, "[SetMenuFont]: ERROR -- Couldn't load font '%s' or 'fixed'\n", (font==NULL)?("NULL"):(font)); exit(1); } +#ifdef I18N + XFontsOfFontSet(Scr.StdFont.fontset, &fs_list, &ml); + Scr.StdFont.font = fs_list[0]; + fset_extents = XExtentsOfFontSet(Scr.StdFont.fontset); + Scr.StdFont.height = fset_extents->max_logical_extent.height; +#else Scr.StdFont.height = Scr.StdFont.font->ascent + Scr.StdFont.font->descent; +#endif Scr.StdFont.y = Scr.StdFont.font->ascent; Scr.EntryHeight = Scr.StdFont.height + HEIGHT_EXTRA; @@ -1492,18 +1518,35 @@ { char *font; FvwmWindow *tmp; +#ifdef I18N + XFontSetExtents *fset_extents; + XFontStruct **fs_list; + char **ml; +#endif action = GetNextToken(action,&font); +#ifdef I18N + if ((Scr.IconFont.fontset = GetFontSetOrFixed(dpy, font)) == NULL) +#else if ((Scr.IconFont.font = GetFontOrFixed(dpy, font))==NULL) +#endif { fvwm_msg(ERR,"LoadIconFont","Couldn't load font '%s' or 'fixed'\n", font); free(font); return; } +#ifdef I18N + XFontsOfFontSet(Scr.IconFont.fontset, &fs_list, &ml); + Scr.IconFont.font = fs_list[0]; + fset_extents = XExtentsOfFontSet(Scr.IconFont.fontset); + Scr.IconFont.height = + fset_extents->max_logical_extent.height; +#else Scr.IconFont.height= Scr.IconFont.font->ascent+Scr.IconFont.font->descent; +#endif Scr.IconFont.y = Scr.IconFont.font->ascent; free(font); @@ -1527,14 +1570,28 @@ FvwmWindow *tmp,*hi; int x,y,w,h,extra_height; XFontStruct *newfont; +#ifdef I18N + XFontSetExtents *fset_extents; + XFontStruct **fs_list; + char **ml; +#endif action = GetNextToken(action,&font); +#ifdef I18N + if ((Scr.WindowFont.fontset = GetFontSetOrFixed(dpy,font)) != NULL) + { + XFontsOfFontSet(Scr.WindowFont.fontset, &fs_list, &ml); + Scr.WindowFont.font = fs_list[0]; + fset_extents = XExtentsOfFontSet(Scr.WindowFont.fontset); + Scr.WindowFont.height = fset_extents->max_logical_extent.height; +#else if ((newfont = GetFontOrFixed(dpy, font))!=NULL) { Scr.WindowFont.font = newfont; Scr.WindowFont.height= Scr.WindowFont.font->ascent+Scr.WindowFont.font->descent; +#endif Scr.WindowFont.y = Scr.WindowFont.font->ascent; extra_height = Scr.TitleHeight; Scr.TitleHeight = Scr.WindowFont.font->ascent+Scr.WindowFont.font->descent+3; @@ -1670,7 +1727,7 @@ return; t = action; - while(isspace(*t)&&(*t!= 0)) + while(isspace((unsigned char)*t)&&(*t!= 0)) t++; if(*t == '[') { --- fvwm/events.c.orig Wed Dec 11 01:19:42 1996 +++ fvwm/events.c Tue May 6 22:13:42 1997 @@ -459,6 +459,14 @@ void HandlePropertyNotify() { XTextProperty text_prop; +#ifdef I18N + Atom actual = None; + int actual_format; + unsigned long nitems, bytesafter; + char *prop = NULL; + char **list; + int num; +#endif if ((!Tmp_win)||(XGetGeometry(dpy, Tmp_win->w, &JunkRoot, &JunkX, &JunkY, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth) == 0)) @@ -467,12 +475,51 @@ switch (Event.xproperty.atom) { case XA_WM_NAME: +#ifdef I18N + if (XGetWindowProperty (dpy, Tmp_win->w, Event.xproperty.atom, 0L, + MAX_NAME_LEN, False, AnyPropertyType, &actual, + &actual_format, &nitems, &bytesafter, + (unsigned char **) &prop) != Success || + actual == None) + return; + text_prop.value = prop; + text_prop.encoding = actual; + text_prop.format = actual_format; + text_prop.nitems = nitems; + if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) < Success) + return; +#ifdef EVIL + if (!(num > 0 && *list)) { + if (!XGetWMName(dpy, Tmp_win->w, &text_prop)) + return; + free_window_name (Tmp_win); + Tmp_win->name = (char *)text_prop.value; + } else { + prop = *list; + Tmp_win->name = prop; + if((Tmp_win->name != NULL) && (strcmp(Tmp_win->name, "") == 0)) { + if (!XGetWMName(dpy, Tmp_win->w, &text_prop)) + return; + free_window_name (Tmp_win); + Tmp_win->name = (char *)text_prop.value; + } + } +#else /* EVIL */ + if (!(num > 0 && *list)) + prop = NoName; + else + prop = *list; + free_window_name (Tmp_win); + Tmp_win->name = prop; +#endif /* EVIL */ +#else /* I18N */ if (!XGetWMName(dpy, Tmp_win->w, &text_prop)) return; free_window_name (Tmp_win); Tmp_win->name = (char *)text_prop.value; +#endif /* I18N */ if (Tmp_win->name == NULL) Tmp_win->name = NoName; BroadcastName(M_WINDOW_NAME,Tmp_win->w,Tmp_win->frame, @@ -496,10 +543,49 @@ break; case XA_WM_ICON_NAME: +#ifdef I18N + if (XGetWindowProperty (dpy, Tmp_win->w, Event.xproperty.atom, 0L, + MAX_NAME_LEN, False, AnyPropertyType, &actual, + &actual_format, &nitems, &bytesafter, + (unsigned char **) &prop) != Success || + actual == None) + return; + text_prop.value = prop; + text_prop.encoding = actual; + text_prop.format = actual_format; + text_prop.nitems = nitems; + if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) < Success) + return; +#ifdef EVIL + if (!(num > 0 && *list)) { + if (!XGetWMIconName (dpy, Tmp_win->w, &text_prop)) + return; + free_icon_name (Tmp_win); + Tmp_win->icon_name = (char *) text_prop.value; + } else { + prop = *list; + Tmp_win->icon_name = prop; + if((Tmp_win->icon_name != NULL) && (strcmp(Tmp_win->icon_name, "") == 0)) { + if (!XGetWMIconName (dpy, Tmp_win->w, &text_prop)) + return; + free_icon_name (Tmp_win); + Tmp_win->icon_name = (char *) text_prop.value; + } + } +#else /* EVIL */ + if (!(num > 0 && *list)) + prop = NoName; + else + prop = *list; + free_icon_name (Tmp_win); + Tmp_win->icon_name = prop; +#endif /* EVIL */ +#else /* I18N */ if (!XGetWMIconName (dpy, Tmp_win->w, &text_prop)) return; free_icon_name (Tmp_win); Tmp_win->icon_name = (char *) text_prop.value; +#endif /* I18N */ if (Tmp_win->icon_name == NULL) Tmp_win->icon_name = NoName; BroadcastName(M_ICON_NAME,Tmp_win->w,Tmp_win->frame, --- fvwm/fvwm.c.orig Wed Dec 11 02:17:23 1996 +++ fvwm/fvwm.c Tue May 6 22:13:42 1997 @@ -35,6 +35,10 @@ #include #endif /* SHAPE */ +#ifdef I18N +#include +#endif + #if defined (sparc) && defined (SVR4) /* Solaris has sysinfo instead of gethostname. */ #include @@ -139,6 +143,10 @@ OpenConsole(); DBUG("main","Entered, about to parse args"); +#ifdef I18N + if (setlocale(LC_CTYPE, "") == NULL) + fvwm_msg(ERR, "main", "Can't set locale. Check your $LC_CTYPE or $LANG.\n"); +#endif for (i = 1; i < argc; i++) { if (strncasecmp(argv[i],"-debug",6)==0) --- fvwm/fvwm.h.orig Wed Dec 11 02:15:29 1996 +++ fvwm/fvwm.h Tue May 6 22:13:43 1997 @@ -110,6 +110,9 @@ typedef struct MyFont { XFontStruct *font; /* font structure */ +#ifdef I18N + XFontSet fontset; /* font set */ +#endif int height; /* height of the font */ int y; /* Y coordinate to draw characters */ } MyFont; --- fvwm/fvwm95.man.orig Wed Dec 11 03:07:21 1996 +++ fvwm/fvwm95.man Tue May 6 22:13:43 1997 @@ -636,7 +636,7 @@ .IP "Exec \fIcommand\fP" Executes \fIcommand\fP. Exec does not require an additional 'exec' at -the beginning or '&' at the end of the command. +the beginning or \'&' at the end of the command. The following example binds function key F1 in the root window, with no modifiers, to the exec function. The program rxvt will be started --- fvwm/icons.c.orig Wed Dec 11 01:19:42 1996 +++ fvwm/icons.c Tue May 6 22:13:43 1997 @@ -300,6 +300,11 @@ x = (Tmp_win->icon_w_width - Tmp_win->icon_t_width)/2; if(x<3)x=3; +#ifdef I18N +#undef FONTSET +#define FONTSET Scr.IconFont.fontset +#endif + XDrawString (dpy, Tmp_win->icon_w, Scr.ScratchGC3, x, Tmp_win->icon_w_height-Scr.IconFont.height+ Scr.IconFont.y-3, --- fvwm/menus.c.orig Wed Dec 11 01:19:42 1996 +++ fvwm/menus.c Tue May 6 22:13:44 1997 @@ -263,6 +263,10 @@ DrawSeparator(mr->w,ShadowGC,Scr.BlackGC,1,mr->height-2, mr->width-2, mr->height-2,1); +#ifdef I18N +#undef FONTSET +#define FONTSET Scr.StdFont.fontset +#endif if (*mi->item) if (check_allowed_function(mi)) { --- fvwm/misc.c.orig Wed Dec 11 01:19:42 1996 +++ fvwm/misc.c Tue May 6 22:13:44 1997 @@ -726,11 +726,11 @@ if(source == NULL) return NULL; - while(isspace(*source)) + while(isspace((unsigned char)*source)) source++; len = strlen(source); tmp = source + len -1; - while(((isspace(*tmp))||(*tmp == '\n'))&&(tmp >=source)) + while(((isspace((unsigned char)*tmp))||(*tmp == '\n'))&&(tmp >=source)) { tmp--; len--; @@ -763,9 +763,9 @@ *token = NULL; return NULL; } - while(isspace(*t)&&(*t != 0))t++; + while(isspace((unsigned char)*t)&&(*t != 0))t++; start = t; - while(!isspace(*t)&&(*t != 0)) + while(!isspace((unsigned char)*t)&&(*t != 0)) { /* Check for qouted text */ if(*t == '"') --- fvwm/misc.h.orig Wed Dec 11 01:19:44 1996 +++ fvwm/misc.h Tue May 6 22:13:44 1997 @@ -105,6 +105,15 @@ Globalgcm = GCFont | GCForeground | GCBackground; \ XChangeGC(dpy,Scr.ScratchGC3,Globalgcm,&Globalgcv); \ } +#ifdef I18N +#ifdef __STDC__ +#define XTextWidth(x,y,z) XmbTextEscapement(x ## set,y,z) +#else +#define XTextWidth(x,y,z) XmbTextEscapement(x/**/set,y,z) +#endif +#define XDrawString(t,u,v,w,x,y,z) XmbDrawString(t,u,FONTSET,v,w,x,y,z) +#define XDrawImageString(t,u,v,w,x,y,z) XmbDrawImageString(t,u,FONTSET,v,w,x,y,z) +#endif #ifdef NO_ICONS #define ICON_HEIGHT 1 --- fvwm/move.c.orig Wed Dec 11 01:19:42 1996 +++ fvwm/move.c Tue May 6 22:13:44 1997 @@ -296,6 +296,10 @@ offset = (Scr.SizeStringWidth + SIZE_HINDENT*2 - XTextWidth(Scr.StdFont.font,str,strlen(str)))/2; +#ifdef I18N +#undef FONTSET +#define FONTSET Scr.StdFont.fontset +#endif XDrawString (dpy, Scr.SizeWindow, Scr.WinGC, offset, Scr.StdFont.font->ascent + SIZE_VINDENT, --- fvwm/read.c.orig Wed Dec 11 02:18:08 1996 +++ fvwm/read.c Tue May 6 22:13:45 1997 @@ -13,6 +13,9 @@ #include #include #include +#ifdef I18N +#include +#endif #include "fvwm.h" #include "menus.h" @@ -59,6 +62,9 @@ int thisfileno; extern Bool Restarting; extern XEvent Event; +#ifdef I18N + char *Lang; +#endif thisfileno = numfilesread; numfilesread++; @@ -90,12 +96,37 @@ if (Home == NULL) Home = "./"; HomeLen = strlen(Home); +#ifdef I18N + if((Lang = setlocale(LC_CTYPE, NULL)) != NULL) { + /* find the LOCALE directory to look in */ + home_file = safemalloc(HomeLen + strlen(Lang) + strlen(ofilename)+4); + strcpy(home_file,Home); + strcat(home_file,"/"); + strcat(home_file,Lang); + strcat(home_file,"/"); + strcat(home_file,ofilename); + filename = home_file; + fd = fopen(filename,"r"); + } + if(fd == NULL) { + if((filename != NULL)&&(filename!= ofilename)) + free(filename); + /* do it as original */ + home_file = safemalloc(HomeLen + strlen(ofilename)+3); + strcpy(home_file,Home); + strcat(home_file,"/"); + strcat(home_file,ofilename); + filename = home_file; + fd = fopen(filename,"r"); + } +#else home_file = safemalloc(HomeLen + strlen(ofilename)+3); strcpy(home_file,Home); strcat(home_file,"/"); strcat(home_file,ofilename); filename = home_file; fd = fopen(filename,"r"); +#endif } if((fd == NULL)&&(ofilename[0] != '/')) { @@ -149,7 +180,7 @@ tline = fgets(line+l-2,sizeof(line)-l,fd); } tline=line; - while(isspace(*tline))tline++; + while(isspace((unsigned char)*tline))tline++; /* should these next checks be moved into ExecuteFunction? */ if((strlen(&tline[0])>1)&&(tline[0]!='#')&&(tline[0]!='*')) ExecuteFunction(tline,tmp_win,eventp,context,*Module); --- fvwm/resize.c.orig Wed Dec 11 01:19:43 1996 +++ fvwm/resize.c Tue May 6 22:13:45 1997 @@ -415,6 +415,10 @@ Scr.StdFont.height,False); } +#ifdef I18N +#undef FONTSET +#define FONTSET Scr.StdFont.fontset +#endif XDrawString (dpy, Scr.SizeWindow, Scr.WinGC, offset, Scr.StdFont.font->ascent + SIZE_VINDENT, str, 13); --- fvwm/style.c.orig Wed Dec 11 01:19:43 1996 +++ fvwm/style.c Tue May 6 22:13:45 1997 @@ -64,13 +64,13 @@ if((name == NULL)||(restofline == NULL)) return; - while(isspace(*restofline)&&(*restofline != 0))restofline++; + while(isspace((unsigned char)*restofline)&&(*restofline != 0))restofline++; line = restofline; if(restofline == NULL)return; while((*restofline != 0)&&(*restofline != '\n')) { - while(isspace(*restofline)) restofline++; + while(isspace((unsigned char)*restofline)) restofline++; switch (tolower(restofline[0])) { case 'a': @@ -84,11 +84,11 @@ if(strncasecmp(restofline,"BackColor",9)==0) { restofline +=9; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; tmp = restofline; len = 0; while((tmp != NULL)&&(*tmp != 0)&&(*tmp != ',')&& - (*tmp != '\n')&&(!isspace(*tmp))) + (*tmp != '\n')&&(!isspace((unsigned char)*tmp))) { tmp++; len++; @@ -107,11 +107,11 @@ restofline +=6; sscanf(restofline,"%d",&butt); - while(isspace(*restofline))restofline++; - while((!isspace(*restofline))&&(*restofline!= 0)&& + while(isspace((unsigned char)*restofline))restofline++; + while((!isspace((unsigned char)*restofline))&&(*restofline!= 0)&& (*restofline != ',')&&(*restofline != '\n')) restofline++; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; on_buttons |= (1<<(butt-1)); } @@ -120,22 +120,22 @@ restofline +=11; off_flags |= BW_FLAG; sscanf(restofline,"%d",&bw); - while(isspace(*restofline))restofline++; - while((!isspace(*restofline))&&(*restofline!= 0)&& + while(isspace((unsigned char)*restofline))restofline++; + while((!isspace((unsigned char)*restofline))&&(*restofline!= 0)&& (*restofline != ',')&&(*restofline != '\n')) restofline++; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; } break; case 'c': if(strncasecmp(restofline,"Color",5)==0) { restofline +=5; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; tmp = restofline; len = 0; while((tmp != NULL)&&(*tmp != 0)&&(*tmp != ',')&& - (*tmp != '\n')&&(*tmp != '/')&&(!isspace(*tmp))) + (*tmp != '\n')&&(*tmp != '/')&&(!isspace((unsigned char)*tmp))) { tmp++; len++; @@ -148,15 +148,15 @@ off_flags |= FORE_COLOR_FLAG; } - while(isspace(*tmp))tmp++; + while(isspace((unsigned char)*tmp))tmp++; if(*tmp == '/') { tmp++; - while(isspace(*tmp))tmp++; + while(isspace((unsigned char)*tmp))tmp++; restofline = tmp; len = 0; while((tmp != NULL)&&(*tmp != 0)&&(*tmp != ',')&& - (*tmp != '\n')&&(*tmp != '/')&&(!isspace(*tmp))) + (*tmp != '\n')&&(*tmp != '/')&&(!isspace((unsigned char)*tmp))) { tmp++; len++; @@ -216,11 +216,11 @@ if(strncasecmp(restofline,"ForeColor",9)==0) { restofline +=9; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; tmp = restofline; len = 0; while((tmp != NULL)&&(*tmp != 0)&&(*tmp != ',')&& - (*tmp != '\n')&&(!isspace(*tmp))) + (*tmp != '\n')&&(!isspace((unsigned char)*tmp))) { tmp++; len++; @@ -259,11 +259,11 @@ restofline +=11; off_flags |= NOBW_FLAG; sscanf(restofline,"%d",&nobw); - while(isspace(*restofline))restofline++; - while((!isspace(*restofline))&&(*restofline!= 0)&& + while(isspace((unsigned char)*restofline))restofline++; + while((!isspace((unsigned char)*restofline))&&(*restofline!= 0)&& (*restofline != ',')&&(*restofline != '\n')) restofline++; - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; } break; case 'i': @@ -280,8 +280,8 @@ &IconBox[2],&IconBox[3]); for(i=0;i 0) { @@ -614,7 +614,7 @@ free(tmp); } } - while(isspace(*restofline)) restofline++; + while(isspace((unsigned char)*restofline)) restofline++; } break; case 'v': @@ -641,7 +641,7 @@ break; } - while(isspace(*restofline))restofline++; + while(isspace((unsigned char)*restofline))restofline++; if(*restofline == ',') restofline++; else if((*restofline != 0)&&(*restofline != '\n')) --- fvwm/Makefile.in.orig Wed Sep 11 03:02:35 1996 +++ fvwm/Makefile.in Tue May 6 22:13:46 1997 @@ -29,7 +29,7 @@ -DFVWMDIR=\"${fvwm_dir}\" \ -DFVWMRC=\"${fvwm_rc}\" -EXTRA_DEFINES=-DXPM -DSHAPE ${PATH_DEFINES} +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ ${PATH_DEFINES} CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} --- libs/GetFontSet.c.orig Tue May 6 22:13:46 1997 +++ libs/GetFontSet.c Tue May 6 22:13:46 1997 @@ -0,0 +1,37 @@ +/* This file brings from GetFont.c */ + +#include + +#include +#include +#include + +#include +#include + +#include + +/* +** loads fontset or "fixed" on failure +*/ +XFontSet GetFontSetOrFixed(Display *disp, char *fontname) +{ + XFontSet fontset; + char **ml; + int mc; + char *ds; + + if ((fontset = XCreateFontSet(disp,fontname,&ml,&mc,&ds))==NULL) + { + fprintf(stderr, + "[GetFontSetOrFixed]: WARNING -- can't get fontset %s, trying 'fixed'", + fontname); + /* fixed should always be avail, so try that */ + if ((fontset = XCreateFontSet(disp,"fixed",&ml,&mc,&ds))==NULL) + { + fprintf(stderr,"[GetFontSetOrFixed]: ERROR -- can't get fontset 'fixed'"); + } + } + return fontset; +} + --- libs/GetLine.c.orig Tue Jun 25 00:59:24 1996 +++ libs/GetLine.c Tue May 6 22:13:46 1997 @@ -36,7 +36,7 @@ *tline = NULL; if(*tline != NULL) { - while(isspace(**tline))(*tline)++; + while(isspace((unsigned char)**tline))(*tline)++; } /* fprintf(stderr,"%x %x\n",header[1],M_END_CONFIG_INFO);*/ --- libs/strutils.c.orig Wed Dec 11 01:33:25 1996 +++ libs/strutils.c Tue May 6 22:13:47 1997 @@ -91,14 +91,14 @@ int len; char *start; - while(((isspace(*source))&&(*source != '\n'))&&(*source != 0)) source++; + while(((isspace((unsigned char)*source))&&(*source != '\n'))&&(*source != 0)) source++; len = 0; start = source; while((*source != '\n')&&(*source != 0)) len++, source++; source--; - while((isspace(*source))&&(*source != 0)&&(len >0)) len--, source--; + while((isspace((unsigned char)*source))&&(*source != 0)&&(len >0)) len--, source--; *dest = safemalloc(len+1); strncpy(*dest,start,len); --- libs/Makefile.in.orig Wed Dec 11 01:34:50 1996 +++ libs/Makefile.in Tue May 6 22:13:47 1997 @@ -14,7 +14,7 @@ fvwm_rc=@fvwm_rc@ fvwm_name=@fvwm_name@ -EXTRA_DEFINES=-DXPM -DSHAPE +EXTRA_DEFINES=-DXPM -DSHAPE @local_defines@ CC=@CC@ INCLUDES=-I${top_srcdir}/include ${x_includes} CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES} @@ -29,6 +29,7 @@ SRCS=GetFdWidth.c \ GetFont.c \ + GetFontSet.c \ GetLine.c \ Picture.c \ ReadPacket.c \ @@ -46,6 +47,7 @@ OBJS=GetFdWidth.o \ GetFont.o \ + GetFontSet.o \ GetLine.o \ Picture.o \ ReadPacket.o \ --- include/fvwm/fvwmlib.h.orig Wed Dec 11 02:09:04 1996 +++ include/fvwm/fvwmlib.h Tue May 6 22:13:47 1997 @@ -48,5 +48,8 @@ void DestroyPicture(Display *, Picture *p); XFontStruct *GetFontOrFixed(Display *disp, char *fontname); +#ifdef I18N +XFontSet GetFontSetOrFixed(Display *disp, char *fontname); +#endif #endif --- configure.in.orig Wed Dec 11 01:09:36 1996 +++ configure.in Tue May 6 22:13:47 1997 @@ -102,6 +102,7 @@ #------------------------------------------------------------------- AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"]) +AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]) fvwm95_checkBoth=0 AC_CHECK_FUNC(connect, fvwm95_checkSocket=0, fvwm95_checkSocket=1) @@ -173,7 +174,7 @@ if test "x$x_includes" != x ; then x_includes="-I$x_includes" fi - +local_defines="-DI18N" #------------------------------------------------------------------- # @@ -187,6 +188,7 @@ AC_SUBST(fvwm_icons) AC_SUBST(fvwm_name) AC_SUBST(fvwm_rc) +AC_SUBST(local_defines) #------------------------------------------------------------------- --- configure.orig Wed Dec 11 01:55:16 1996 +++ configure Tue May 6 22:16:10 1997 @@ -1292,6 +1292,44 @@ echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking for -lxpg4""... $ac_c" 1>&6 +ac_lib_var=`echo xpg4'_'setlocale | tr './+\055' '__p_'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lxpg4 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lxpg4" +else + echo "$ac_t""no" 1>&6 +fi + fvwm95_checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 @@ -1299,7 +1337,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1350,7 +1388,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1386,7 +1424,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -1434,7 +1472,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1481,7 +1519,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1526,11 +1564,11 @@ ac_cv_c_cross=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_cross=no else @@ -1548,7 +1586,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1556,7 +1594,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1571,7 +1609,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1589,7 +1627,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1610,7 +1648,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1621,7 +1659,7 @@ exit (0); } EOF -{ (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then : else @@ -1653,7 +1691,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1729,7 +1767,7 @@ ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break fi @@ -1776,7 +1814,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1829,7 +1867,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1949,12 +1987,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2021,7 +2059,7 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -2131,7 +2169,7 @@ if test "x$x_includes" != x ; then x_includes="-I$x_includes" fi - +local_defines="-DI18N" #------------------------------------------------------------------- # @@ -2147,6 +2185,7 @@ + #------------------------------------------------------------------- # # always build Makefiles in examples subdir @@ -2318,6 +2357,7 @@ s%@fvwm_icons@%$fvwm_icons%g s%@fvwm_name@%$fvwm_name%g s%@fvwm_rc@%$fvwm_rc%g +s%@local_defines@%$local_defines%g CEOF EOF --- Makefile.in.orig Wed Jun 26 01:26:47 1996 +++ Makefile.in Tue May 6 22:13:48 1997 @@ -11,6 +11,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ subdirs=libs fvwm modules utils sample.fvwmrc xpmroot icons mini-icons +local_defines=@local_defines@ CFLAGS = -O