home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2084 < prev    next >
Internet Message Format  |  1990-12-28  |  21KB

  1. From: jv@mh.nl (Johan Vromans)
  2. Newsgroups: comp.windows.x,comp.sources.d,alt.sources
  3. Subject: X11R3 mods for TVTWM, Patchlevel 4
  4. Message-ID: <1990Nov17.130254.16454@squirrel.mh.nl>
  5. Date: 17 Nov 90 13:02:54 GMT
  6.  
  7. This is a set of fixes for tvtwm to compile under X11R3.
  8. It has been updated for patchlevel 4, but will probably work for
  9. patchlevel 3 as well.
  10.  
  11. It creates a (local) subdirectory X11/Xmu and X11/bitmaps to hold some
  12. of the X11R4 include files, and supplies two missing subroutines (also
  13. copied from X11R4).
  14.  
  15. A pre-configured "Makefile.local" is supplied. It is set for GCC, so
  16. you might want/need to change it (or supply "CC=cc" with the "make").
  17.  
  18. The only source file modified is "util.c", using "#ifdef X11R3"
  19. conditionals. 
  20.  
  21. After this patch, a regular "imake" will still do a X11R4 build, but
  22. "make -f Makefile.local" will do a X11R3 build.
  23.  
  24. Credits: some of the work has been done by Jon Block, jon@nucleus.mi.org.
  25.  
  26. ================ changed files ================
  27.  
  28.     util.c            # changed bitmap lookup
  29.  
  30. ================ new files ================
  31.  
  32.     Makefile.local        # massaged from imaked Makefile
  33.     ./X11/Xmu/CharSet.h    # stolen from X11R4
  34.     ./X11/Xmu/Drawing.h    # stolen from X11R4
  35.     ./X11/bitmaps/menu12    # local artwork
  36.     DrawLogo.c        # stolen from X11R4
  37.     Lower.c            # stolen from X11R4
  38.  
  39. ================ end of hype ================
  40.     
  41. *** /dev/null    Wed Oct 17 15:45:06 1990
  42. --- Makefile.local    Wed Oct 17 15:45:06 1990
  43. ***************
  44. *** 0
  45.  
  46. --- 1,143 -----
  47. + CC = gcc
  48. + MV = mv
  49. + RM = rm -f
  50. + SHELL = /bin/sh
  51. + # architecture specific flags
  52. + # hp9000 hpux6.5 x11r4
  53. + #A_CFLAGS = -Wc,-Nd4000,-Ns3300,-Ne700,-Np200 -DSYSV  
  54. + # sun3 sunos4.03 x11r4
  55. + #A_CFLAGS = 
  56. + # ibm032 acis4.3 x11r4
  57. + #A_CFLAGS = -DSIGNALRETURNSINT -DNOPUTENV
  58. + CFLAGS = -O -DX11R3 -I. -I/usr/include/mit ${A_CFLAGS}
  59. + YFLAGS = -d
  60. + DIFF =  gram.y lex.l add_window.c gc.c list.c twm.c \
  61. +         parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
  62. +         cursor.c icons.c desktop.c
  63. + SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c \
  64. +         parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
  65. +         cursor.c icons.c desktop.c move.c vdt.c Lower.c DrawLogo.c
  66. + OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o \
  67. +         parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
  68. +         cursor.o icons.o move.o vdt.o Lower.o DrawLogo.o
  69. + INCS = add_window.h dekstop.h desktop.h events.h gc.h iconmgr.h icons.h \
  70. +     list.h menus.h parse.h resize.h screen.h twm.h util.h version.h
  71. + LIBS = -lXmu -lX11 -lXext
  72. + all: twm
  73. + twm: $(OBJS)
  74. +     $(CC) $(CFLAGS) -o twm $(OBJS) $(LIBS)
  75. + gram.h gram.c: gram.y
  76. +     yacc $(YFLAGS) gram.y
  77. +     $(MV) y.tab.c gram.c
  78. +     $(MV) y.tab.h gram.h
  79. + clean:
  80. +     $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c ${OBJS}
  81. + deftwmrc.c:  system.twmrc
  82. +     $(RM) $@
  83. +     echo '/* ' >>$@
  84. +     echo ' * This file is generated automatically from the default' >>$@
  85. +     echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@
  86. +     echo ' */' >>$@
  87. +     echo '' >>$@
  88. +     echo 'char *defTwmrc[] = {' >>$@
  89. +     sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/    "/' -e 's/$$/",/' \
  90. +         system.twmrc >>$@
  91. +     echo '    (char *) 0 };' >>$@
  92. + diffs:
  93. +     ./makediff 1.1 ${DIFF}
  94. +     @echo 'Now go in and remove the chaff from diffs.'
  95. +         
  96. + depend: gram.c gram.h lex.c
  97. +     makedepend ${SRCS} ${INCS}
  98. +     
  99. + # DO NOT DELETE THIS LINE -- make depend depends on it.
  100. + gram.o: /usr/include/stdio.h /usr/include/ctype.h twm.h
  101. + gram.o: /usr/include/X11/Xlib.h /usr/include/sys/types.h /usr/include/X11/X.h
  102. + gram.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h menus.h list.h
  103. + gram.o: util.h screen.h iconmgr.h parse.h /usr/include/X11/Xos.h
  104. + gram.o: /usr/include/strings.h /usr/include/sys/file.h /usr/include/fcntl.h
  105. + gram.o: /usr/include/sys/time.h
  106. + lex.o: /usr/include/stdio.h gram.h parse.h
  107. + add_window.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  108. + add_window.o: /usr/include/sys/types.h /usr/include/X11/X.h
  109. + add_window.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h
  110. + add_window.o: /usr/include/X11/Xatom.h add_window.h util.h resize.h parse.h
  111. + add_window.o: list.h events.h menus.h screen.h iconmgr.h
  112. + gc.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  113. + gc.o: /usr/include/sys/types.h /usr/include/X11/X.h /usr/include/X11/Xutil.h
  114. + gc.o: /usr/include/X11/cursorfont.h util.h screen.h list.h menus.h iconmgr.h
  115. + list.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  116. + list.o: /usr/include/sys/types.h /usr/include/X11/X.h
  117. + list.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h screen.h
  118. + list.o: list.h menus.h iconmgr.h gram.h
  119. + twm.o: /usr/include/stdio.h /usr/include/signal.h /usr/include/sys/signal.h
  120. + twm.o: /usr/include/fcntl.h twm.h /usr/include/X11/Xlib.h
  121. + twm.o: /usr/include/sys/types.h /usr/include/X11/X.h /usr/include/X11/Xutil.h
  122. + twm.o: /usr/include/X11/cursorfont.h add_window.h gc.h parse.h version.h
  123. + twm.o: menus.h events.h util.h gram.h screen.h list.h iconmgr.h
  124. + twm.o: /usr/include/X11/Xproto.h /usr/include/X11/Xmd.h
  125. + twm.o: /usr/include/X11/Xprotostr.h
  126. + parse.o: /usr/include/stdio.h /usr/include/X11/Xos.h /usr/include/sys/types.h
  127. + parse.o: /usr/include/strings.h /usr/include/sys/file.h /usr/include/fcntl.h
  128. + parse.o: /usr/include/sys/time.h twm.h
  129. + parse.o: /usr/include/X11/Xlib.h /usr/include/X11/X.h
  130. + parse.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h screen.h
  131. + parse.o: list.h menus.h iconmgr.h util.h gram.h parse.h
  132. + menus.o: /usr/include/stdio.h /usr/include/signal.h /usr/include/sys/signal.h
  133. + menus.o: /usr/include/X11/Xos.h /usr/include/sys/types.h
  134. + menus.o: /usr/include/strings.h /usr/include/sys/file.h /usr/include/fcntl.h
  135. + menus.o: /usr/include/sys/time.h twm.h /usr/include/X11/Xlib.h
  136. + menus.o: /usr/include/X11/X.h /usr/include/X11/Xutil.h
  137. + menus.o: /usr/include/X11/cursorfont.h gc.h menus.h resize.h events.h util.h
  138. + menus.o: parse.h gram.h screen.h list.h iconmgr.h
  139. + menus.o: /usr/include/X11/bitmaps/scales version.h
  140. + events.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  141. + events.o: /usr/include/sys/types.h /usr/include/X11/X.h
  142. + events.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h
  143. + events.o: /usr/include/X11/Xatom.h add_window.h menus.h events.h resize.h
  144. + events.o: parse.h gram.h util.h screen.h list.h iconmgr.h version.h
  145. + resize.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  146. + resize.o: /usr/include/sys/types.h /usr/include/X11/X.h
  147. + resize.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h parse.h
  148. + resize.o: util.h resize.h add_window.h screen.h list.h menus.h iconmgr.h
  149. + util.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  150. + util.o: /usr/include/sys/types.h /usr/include/X11/X.h
  151. + util.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h util.h gram.h
  152. + util.o: screen.h list.h menus.h iconmgr.h /usr/include/X11/Xos.h
  153. + util.o: /usr/include/strings.h /usr/include/sys/file.h /usr/include/fcntl.h
  154. + util.o: /usr/include/sys/time.h /usr/include/X11/Xatom.h
  155. + iconmgr.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  156. + iconmgr.o: /usr/include/sys/types.h /usr/include/X11/X.h
  157. + iconmgr.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h util.h
  158. + iconmgr.o: parse.h screen.h list.h menus.h iconmgr.h resize.h add_window.h
  159. + iconmgr.o: siconify.bm /usr/include/X11/Xos.h /usr/include/strings.h
  160. + iconmgr.o: /usr/include/sys/file.h /usr/include/fcntl.h
  161. + iconmgr.o: /usr/include/sys/time.h
  162. + cursor.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  163. + cursor.o: /usr/include/sys/types.h /usr/include/X11/X.h
  164. + cursor.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h
  165. + cursor.o: /usr/include/X11/Xos.h /usr/include/strings.h
  166. + cursor.o: /usr/include/sys/file.h /usr/include/fcntl.h
  167. + cursor.o: /usr/include/sys/time.h screen.h list.h menus.h iconmgr.h util.h
  168. + icons.o: /usr/include/stdio.h twm.h /usr/include/X11/Xlib.h
  169. + icons.o: /usr/include/sys/types.h /usr/include/X11/X.h
  170. + icons.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h screen.h
  171. + icons.o: list.h menus.h iconmgr.h icons.h gram.h parse.h util.h
  172. + lex.o: /usr/include/stdio.h gram.h parse.h
  173. + screen.o: /usr/include/X11/Xlib.h /usr/include/sys/types.h
  174. + screen.o: /usr/include/X11/X.h /usr/include/X11/Xutil.h
  175. + screen.o: /usr/include/X11/cursorfont.h list.h menus.h iconmgr.h
  176. + twm.o: /usr/include/X11/Xlib.h /usr/include/sys/types.h /usr/include/X11/X.h
  177. + twm.o: /usr/include/X11/Xutil.h /usr/include/X11/cursorfont.h
  178. *** /dev/null    Wed Oct 17 15:45:06 1990
  179. --- X11/Xmu/CharSet.h    Wed Oct 17 15:46:03 1990
  180. ***************
  181. *** 0
  182.  
  183. --- 1,28 -----
  184. + /*
  185. +  * $XConsortium: CharSet.h,v 1.2 89/09/22 15:33:14 jim Exp $
  186. +  *
  187. +  * Copyright 1988 by the Massachusetts Institute of Technology
  188. +  *
  189. +  * Permission to use, copy, modify, and distribute this software and its
  190. +  * documentation for any purpose and without fee is hereby granted, provided 
  191. +  * that the above copyright notice appear in all copies and that both that 
  192. +  * copyright notice and this permission notice appear in supporting 
  193. +  * documentation, and that the name of M.I.T. not be used in advertising
  194. +  * or publicity pertaining to distribution of the software without specific, 
  195. +  * written prior permission. M.I.T. makes no representations about the 
  196. +  * suitability of this software for any purpose.  It is provided "as is"
  197. +  * without express or implied warranty.
  198. +  *
  199. +  * The X Window System is a Trademark of MIT.
  200. +  *
  201. +  * The interfaces described by this header file are for miscellaneous utilities
  202. +  * and are not part of the Xlib standard.
  203. +  */
  204. + #ifndef _XMU_CHARSET_H_
  205. + #define _XMU_CHARSET_H_
  206. + extern void XmuCopyISOLatin1Lowered();
  207. + extern void XmuCopyISOLatin1Uppered();
  208. + extern int XmuCompareISOLatin1();
  209. + #endif /* _XMU_CHARSET_H_ */
  210. *** /dev/null    Wed Oct 17 15:45:06 1990
  211. --- X11/Xmu/Drawing.h    Wed Oct 17 15:46:04 1990
  212. ***************
  213. *** 0
  214.  
  215. --- 1,33 -----
  216. + /*
  217. +  * $XConsortium: Drawing.h,v 1.3 89/10/03 08:37:53 rws Exp $
  218. +  *
  219. +  * Copyright 1988 by the Massachusetts Institute of Technology
  220. +  *
  221. +  * Permission to use, copy, modify, and distribute this software and its
  222. +  * documentation for any purpose and without fee is hereby granted, provided 
  223. +  * that the above copyright notice appear in all copies and that both that 
  224. +  * copyright notice and this permission notice appear in supporting 
  225. +  * documentation, and that the name of M.I.T. not be used in advertising
  226. +  * or publicity pertaining to distribution of the software without specific, 
  227. +  * written prior permission. M.I.T. makes no representations about the 
  228. +  * suitability of this software for any purpose.  It is provided "as is"
  229. +  * without express or implied warranty.
  230. +  *
  231. +  * The X Window System is a Trademark of MIT.
  232. +  *
  233. +  * The interfaces described by this header file are for miscellaneous utilities
  234. +  * and are not part of the Xlib standard.
  235. +  */
  236. + #ifndef _XMU_DRAWING_H_
  237. + #define _XMU_DRAWING_H_
  238. + void XmuDrawRoundedRectangle();
  239. + void XmuFillRoundedRectangle();
  240. + void XmuDrawLogo();
  241. + Pixmap XmuCreatePixmapFromBitmap();
  242. + Pixmap XmuCreateStippledPixmap();
  243. + Pixmap XmuLocateBitmapFile();
  244. + int XmuReadBitmapData(), XmuReadBitmapDataFromFile();
  245. + #endif /* _XMU_DRAWING_H_ */
  246. *** /dev/null    Wed Oct 17 15:45:06 1990
  247. --- X11/bitmaps/menu12    Wed Oct 17 15:46:24 1990
  248. ***************
  249. *** 0
  250.  
  251. --- 1,5 -----
  252. + #define menu12_width 16
  253. + #define menu12_height 12
  254. + static char menu12_bits[] = {
  255. +    0x00, 0x00, 0x3f, 0x06, 0x03, 0x0c, 0x03, 0x18, 0x03, 0x30, 0x03, 0x60,
  256. +    0xf3, 0xff, 0x03, 0x60, 0x03, 0x30, 0x03, 0x18, 0x03, 0x0c, 0x3f, 0x06};
  257. *** util.c~    Wed Oct 17 15:46:40 1990
  258. --- util.c    Wed Oct 17 15:46:40 1990
  259. ***************
  260. *** 356,362
  261.        */
  262.       bigname = ExpandFilename (name);
  263.       if (!bigname) return None;
  264.       /*
  265.        * look along bitmapFilePath resource same as toolkit clients
  266.        */
  267.  
  268. --- 356,362 -----
  269.        */
  270.       bigname = ExpandFilename (name);
  271.       if (!bigname) return None;
  272. ! #ifndef X11R3
  273.       /*
  274.        * look along bitmapFilePath resource same as toolkit clients
  275.        */
  276. ***************
  277. *** 363,368
  278.       pm = XmuLocateBitmapFile (ScreenOfDisplay(dpy, Scr->screen), bigname,
  279.                     NULL, 0, widthp, heightp, &HotX, &HotY);
  280.       if (pm == None && Scr->IconDirectory && bigname[0] != '/') {
  281.       if (bigname != name) free (bigname);
  282.       /*
  283.        * Attempt to find icon in old IconDirectory (now obsolete)
  284.  
  285. --- 363,373 -----
  286.       pm = XmuLocateBitmapFile (ScreenOfDisplay(dpy, Scr->screen), bigname,
  287.                     NULL, 0, widthp, heightp, &HotX, &HotY);
  288.       if (pm == None && Scr->IconDirectory && bigname[0] != '/') {
  289. + #else
  290. +     if (XReadBitmapFile (dpy, Scr->Root, bigname, 
  291. +              widthp, heightp, &pm, &HotX, &HotY) != BitmapSuccess &&
  292. +     Scr->IconDirectory && name[0] != '/') {
  293. + #endif
  294.       if (bigname != name) free (bigname);
  295.       /*
  296.        * Attempt to find icon in old IconDirectory (now obsolete)
  297. *** /dev/null    Wed Oct 17 15:45:06 1990
  298. --- DrawLogo.c    Wed Oct 17 15:45:06 1990
  299. ***************
  300. *** 0
  301.  
  302. --- 1,150 -----
  303. + #ifndef lint
  304. + static char Xrcsid[] = "$XConsortium: DrawLogo.c,v 1.1 89/05/11 14:01:55 kit Exp $";
  305. + #endif
  306. + #include <X11/Xlib.h>  
  307. + /*
  308. + Copyright 1988 by the Massachusetts Institute of Technology
  309. + Permission to use, copy, modify, and distribute this
  310. + software and its documentation for any purpose and without
  311. + fee is hereby granted, provided that the above copyright
  312. + notice appear in all copies and that both that copyright
  313. + notice and this permission notice appear in supporting
  314. + documentation, and that the name of M.I.T. not be used in
  315. + advertising or publicity pertaining to distribution of the
  316. + software without specific, written prior permission.
  317. + M.I.T. makes no representations about the suitability of
  318. + this software for any purpose.  It is provided "as is"
  319. + without express or implied warranty.
  320. + */
  321. + /*
  322. +  *  Draw the "official" X Window System Logo, designed by Danny Chong
  323. +  *
  324. +  *  Written by Ollie Jones, Apollo Computer
  325. +  *
  326. +  *  Does some fancy stuff to make the logo look acceptable even
  327. +  *  if it is tiny.  Also makes the various linear elements of
  328. +  *  the logo line up as well as possible considering rasterization.
  329. +  */
  330. + XmuDrawLogo(dpy, drawable, gcFore, gcBack, x, y, width, height)
  331. +     Display *dpy;
  332. +     Drawable drawable;
  333. +     GC gcFore, gcBack;
  334. +     int x, y;
  335. +     unsigned int width, height;
  336. + {
  337. +     unsigned int size;
  338. +     int d11, d21, d31;
  339. +     XPoint poly[4];
  340. +     XFillRectangle(dpy, drawable, gcBack, x, y, width, height);
  341. +     /* for now, do a centered even-sized square, at least for now */
  342. +     size = width;
  343. +     if (height < width)
  344. +      size = height;
  345. +     size &= ~1;
  346. +     x += (width - size) >> 1;
  347. +     y += (height - size) >> 1;
  348. + /*    
  349. +  *           ----- 
  350. +  *          /    /
  351. +  *         /    /
  352. +  *        /    /
  353. +  *       /    /
  354. +  *      /____/
  355. +  */
  356. +     d11 = (size / 11);
  357. +     if (d11 < 1) d11 = 1;
  358. +     d21 = (d11+3) / 4;
  359. +     d31 = d11 + d11 + d21;
  360. +     poly[0].x = x + size;              poly[0].y = y;
  361. +     poly[1].x = x + size-d31;          poly[1].y = y;
  362. +     poly[2].x = x + 0;                 poly[2].y = y + size;
  363. +     poly[3].x = x + d31;               poly[3].y = y + size;
  364. +     XFillPolygon(dpy, drawable, gcFore, poly, 4, Convex, CoordModeOrigin);
  365. + /*    
  366. +  *           ------ 
  367. +  *          /     /
  368. +  *         /  __ /
  369. +  *        /  /  /
  370. +  *       /  /  /
  371. +  *      /__/__/
  372. +  */
  373. +     poly[0].x = x + d31/2;                       poly[0].y = y + size;
  374. +     poly[1].x = x + size / 2;                    poly[1].y = y + size/2;
  375. +     poly[2].x = x + (size/2)+(d31-(d31/2));      poly[2].y = y + size/2;
  376. +     poly[3].x = x + d31;                         poly[3].y = y + size;
  377. +     XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
  378. + /*    
  379. +  *           ------ 
  380. +  *          /  /  /
  381. +  *         /--/  /
  382. +  *        /     /
  383. +  *       /     /
  384. +  *      /_____/
  385. +  */
  386. +     poly[0].x = x + size - d31/2;                poly[0].y = y;
  387. +     poly[1].x = x + size / 2;                    poly[1].y = y + size/2;
  388. +     poly[2].x = x + (size/2)-(d31-(d31/2));      poly[2].y = y + size/2;
  389. +     poly[3].x = x + size - d31;                  poly[3].y = y;
  390. +     XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
  391. + /*
  392. +  * -----
  393. +  * \    \
  394. +  *  \    \
  395. +  *   \    \
  396. +  *    \    \
  397. +  *     \____\
  398. +  */
  399. +     poly[0].x = x;                     poly[0].y = y;
  400. +     poly[1].x = x + size/4;            poly[1].y = y;
  401. +     poly[2].x = x + size;              poly[2].y = y + size;
  402. +     poly[3].x = x + size - size/4;     poly[3].y = y + size;
  403. +     XFillPolygon(dpy, drawable, gcFore, poly, 4, Convex, CoordModeOrigin);
  404. + /*    
  405. +  *          /
  406. +  *         /
  407. +  *        /
  408. +  *       /
  409. +  *      /
  410. +  */
  411. +     poly[0].x = x + size- d11;        poly[0].y = y;
  412. +     poly[1].x = x + size-( d11+d21);  poly[1].y = y;
  413. +     poly[2].x = x + d11;              poly[2].y = y + size;
  414. +     poly[3].x = x + d11 + d21;        poly[3].y = y + size;
  415. +     XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
  416. + }
  417. + #ifdef XAW_BC
  418. + /*
  419. +  * For Compatability Only.
  420. +  */
  421. + XDrawLogo(dpy, drawable, gcFore, gcBack, x, y, width, height)
  422. +     Display *dpy;
  423. +     Drawable drawable;
  424. +     GC gcFore, gcBack;
  425. +     int x, y;
  426. +     unsigned int width, height;
  427. + {
  428. +   XmuDrawLogo(dpy, drawable, gcFore, gcBack, x, y, width, height);
  429. + }
  430. + #endif /* XAW_BC */
  431. *** /dev/null    Wed Oct 17 15:45:06 1990
  432. --- Lower.c    Wed Oct 17 15:45:06 1990
  433. ***************
  434. *** 0
  435.  
  436. --- 1,100 -----
  437. + static char rcsid[] =
  438. +     "$XConsortium: Lower.c,v 1.3 89/11/11 16:31:07 jim Exp $";
  439. + /* 
  440. +  * Copyright 1988 by the Massachusetts Institute of Technology
  441. +  *
  442. +  * Permission to use, copy, modify, and distribute this software and its
  443. +  * documentation for any purpose and without fee is hereby granted, provided 
  444. +  * that the above copyright notice appear in all copies and that both that 
  445. +  * copyright notice and this permission notice appear in supporting 
  446. +  * documentation, and that the name of M.I.T. not be used in advertising
  447. +  * or publicity pertaining to distribution of the software without specific, 
  448. +  * written prior permission. M.I.T. makes no representations about the 
  449. +  * suitability of this software for any purpose.  It is provided "as is"
  450. +  * without express or implied warranty.
  451. +  *
  452. +  */
  453. + #define  XK_LATIN1
  454. + #include <X11/keysymdef.h>
  455. + /*
  456. +  * ISO Latin-1 case conversion routine
  457. +  */
  458. + void
  459. + XmuCopyISOLatin1Lowered(dst, src)
  460. +     char *dst, *src;
  461. + {
  462. +     register unsigned char *dest, *source;
  463. +     for (dest = (unsigned char *)dst, source = (unsigned char *)src;
  464. +      *source;
  465. +      source++, dest++)
  466. +     {
  467. +     if ((*source >= XK_A) && (*source <= XK_Z))
  468. +         *dest = *source + (XK_a - XK_A);
  469. +     else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis))
  470. +         *dest = *source + (XK_agrave - XK_Agrave);
  471. +     else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn))
  472. +         *dest = *source + (XK_oslash - XK_Ooblique);
  473. +     else
  474. +         *dest = *source;
  475. +     }
  476. +     *dest = '\0';
  477. + }
  478. + void
  479. + XmuCopyISOLatin1Uppered(dst, src)
  480. +     char *dst, *src;
  481. + {
  482. +     register unsigned char *dest, *source;
  483. +     for (dest = (unsigned char *)dst, source = (unsigned char *)src;
  484. +      *source;
  485. +      source++, dest++)
  486. +     {
  487. +     if ((*source >= XK_a) && (*source <= XK_z))
  488. +         *dest = *source - (XK_a - XK_A);
  489. +     else if ((*source >= XK_agrave) && (*source <= XK_odiaeresis))
  490. +         *dest = *source - (XK_agrave - XK_Agrave);
  491. +     else if ((*source >= XK_slash) && (*source <= XK_thorn))
  492. +         *dest = *source - (XK_oslash - XK_Ooblique);
  493. +     else
  494. +         *dest = *source;
  495. +     }
  496. +     *dest = '\0';
  497. + }
  498. + int XmuCompareISOLatin1 (first, second)
  499. +     char *first, *second;
  500. + {
  501. +     register unsigned char *ap, *bp;
  502. +     for (ap = (unsigned char *) first, bp = (unsigned char *) second;
  503. +      *ap && *bp; ap++, bp++) {
  504. +     register unsigned char a, b;
  505. +     if ((a = *ap) != (b = *bp)) {
  506. +         /* try lowercasing and try again */
  507. +         if ((a >= XK_A) && (a <= XK_Z))
  508. +           a += (XK_a - XK_A);
  509. +         else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis))
  510. +           a += (XK_agrave - XK_Agrave);
  511. +         else if ((a >= XK_Ooblique) && (a <= XK_Thorn))
  512. +           a += (XK_oslash - XK_Ooblique);
  513. +         if ((b >= XK_A) && (b <= XK_Z))
  514. +           b += (XK_a - XK_A);
  515. +         else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis))
  516. +           b += (XK_agrave - XK_Agrave);
  517. +         else if ((b >= XK_Ooblique) && (b <= XK_Thorn))
  518. +           b += (XK_oslash - XK_Ooblique);
  519. +         if (a != b) break;
  520. +     }
  521. +     }
  522. +     return (((int) *ap) - ((int) *bp));
  523. + }
  524. -- 
  525. Johan Vromans                       jv@mh.nl via internet backbones
  526. Multihouse Automatisering bv               uucp: ..!{uunet,hp4nl}!mh.nl!jv
  527. Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
  528. ------------------------ "Arms are made for hugging" -------------------------
  529.