4 Best viewed with vim5, using ts=4
6 wmgeneral was taken from wmppp.
8 It has a lot of routines which most of the wm* programs use.
10 ------------------------------------------------------------
12 Author: Martijn Pieterse (pieterse@xs4all.nl)
17 15/08/2002 (Brad Jorsch, anomie@users.sourceforge.net)
18 * Updated createXBMfromXPM to handle the case where the XBM is to be
19 wider than the XPM, or the XBM width is not a multiple of 8.
20 * Pulled createXBMfromXPM into its own file, because it's the same in
23 11/08/2002 (Brad Jorsch, anomie@users.sourceforge.net)
24 * Removed the rc-file and mouse region stuff to their own files.
25 * Renamed this file to "wmgeneral-x11.c"
26 * Renamed a few of the functions
28 28/08/2001 (Brad Jorsch, anomie@users.sourceforge.net)
29 * Added EnableMouseRegion and DisableMouseRegion
30 * Got annoyed with the 81-character lines. Fixed it. If you don't like
31 it, find a different copy of wmgeneral.c ;)
32 * GraphicsExpose events are enabled here.
33 * GetXPM is exported. It optionally takes an XpmColorSymbol array.
34 * GetColor is exported.
36 30/09/2000 (Brad Jorsch, anomie@users.sourceforge.net)
37 * You know, wmgen.mask sounds like a much nicer place to store the
38 mask... why don't we do that?
40 21/09/1999 (Brad Jorsch, anomie@users.sourceforge.net)
41 * Changed openXwindow to use only the filename, sans path,
42 as the name and class properties of the app.
44 14/09/1998 (Dave Clark, clarkd@skyia.com)
45 * Updated createXBMfromXPM routine
46 * Now supports >256 colors
47 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
48 * Removed a bug from parse_rcfile. You could
49 not use "start" in a command if a label was
51 * Changed the needed geometry string.
52 We don't use window size, and don't support
54 03/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
56 02/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
57 * Added -geometry support (untested)
58 28/08/1998 (Martijn Pieterse, pieterse@xs4all.nl)
59 * Added createXBMfromXPM routine
60 * Saves a lot of work with changing xpm's.
61 02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
62 * changed the read_rc_file to parse_rcfile, as suggested by Marcelo E. Magallon
63 * debugged the parse_rc file.
64 30/04/1998 (Martijn Pieterse, pieterse@xs4all.nl)
65 * Ripped similar code from all the wm* programs,
66 and put them in a single file.
72 /******************************************************************************\
73 |* createXBMfromXPM *|
74 \******************************************************************************/
75 void createXBMfromXPM(char *xbm
, char **xpm
, int sx
, int sy
) {
78 int width
, height
, numcol
, depth
;
86 sscanf(*xpm
, "%d %d %d %d", &width
, &height
, &numcol
, &depth
);
89 for (k
=0; k
!=depth
; k
++)
95 for (i
=numcol
+1; i
< numcol
+sy
+1; i
++) {
98 for (j
=0; j
<sx
*depth
; j
+=depth
) {
103 for (k
=0; k
!=depth
; k
++)
106 curpixel
|= xpm
[i
][j
+k
];
112 if ( curpixel
!= zero
) {