wmgeneral: Bump to 1998-09-14 version found in wmckgmail, wmitime, wmsmp.app, wmSMPmon, and wmtz.
Note that wmckgmail and wmtz were identical; this is the version we use. wmSMPmon differed only with some whitespace. wmitime differed only with a bugfix (a segfault when -display is given with no argument), but this will be fixed again in the next commit. wmsm.app had patched wmgeneral to work with its xpm; instead we patch its xpm to work with wmgeneral.
This commit is contained in:
parent
6c8c14e710
commit
a680f87666
|
@ -92,9 +92,9 @@ void RedrawWindow(void);
|
|||
void AddMouseRegion(int, int, int, int, int);
|
||||
int CheckMouseRegion(int, int);
|
||||
|
||||
/*****************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* parse_rcfile *|
|
||||
\*****************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void parse_rcfile(const char *filename, rckeys *keys) {
|
||||
|
||||
|
@ -127,9 +127,9 @@ void parse_rcfile(const char *filename, rckeys *keys) {
|
|||
}
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* parse_rcfile2 *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void parse_rcfile2(const char *filename, rckeys2 *keys) {
|
||||
|
||||
|
@ -161,9 +161,9 @@ void parse_rcfile2(const char *filename, rckeys2 *keys) {
|
|||
}
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* GetXPM *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
|
||||
|
||||
|
@ -184,9 +184,9 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
|
|||
}
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* GetColor *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
static Pixel GetColor(char *name) {
|
||||
|
||||
|
@ -204,9 +204,9 @@ static Pixel GetColor(char *name) {
|
|||
return color.pixel;
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* flush_expose *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
static int flush_expose(Window w) {
|
||||
|
||||
|
@ -219,9 +219,9 @@ static int flush_expose(Window w) {
|
|||
return i;
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* RedrawWindow *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void RedrawWindow(void) {
|
||||
|
||||
|
@ -233,9 +233,9 @@ void RedrawWindow(void) {
|
|||
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* RedrawWindowXY *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void RedrawWindowXY(int x, int y) {
|
||||
|
||||
|
@ -247,9 +247,9 @@ void RedrawWindowXY(int x, int y) {
|
|||
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* AddMouseRegion *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void AddMouseRegion(int index, int left, int top, int right, int bottom) {
|
||||
|
||||
|
@ -262,9 +262,9 @@ void AddMouseRegion(int index, int left, int top, int right, int bottom) {
|
|||
}
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* CheckMouseRegion *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
int CheckMouseRegion(int x, int y) {
|
||||
|
||||
|
@ -285,38 +285,41 @@ int CheckMouseRegion(int x, int y) {
|
|||
return (i-1);
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* createXBMfromXPM *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero = 0;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
for (k = 0; k != depth; k++) {
|
||||
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
for (i = numcol + 1; i < numcol + sy + 1; i++) {
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j = 0; j < sx * depth; j += depth) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
|
||||
curpixel=0;
|
||||
for (k = 0; k != depth; k++) {
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if (curpixel != zero) {
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
@ -330,52 +333,39 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
|||
}
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* copyXPMArea *|
|
||||
|* *|
|
||||
|* copies pixel area from master XPM to application window *|
|
||||
|* *|
|
||||
|* x,y: first corner of area to be copied from master XPM *|
|
||||
|* sx,sy: second corner of area to be copied from master XPM *|
|
||||
|* dx,dy: first corner of target area *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
|
||||
|
||||
XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
|
||||
|
||||
void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy)
|
||||
{
|
||||
XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC,
|
||||
x, y, sx, sy, dx, dy);
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* copyXBMArea *|
|
||||
|* *|
|
||||
|* copies pixel area from XBM to master XPM?!?!? *|
|
||||
|* *|
|
||||
|* x,y: first corner of area to be copied from XBM *|
|
||||
|* sx,sy: width and height of area to be copied from XBM *|
|
||||
|* dx,dy: first corner of target area *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy)
|
||||
{
|
||||
XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC,
|
||||
x, y, sx, sy, dx, dy);
|
||||
void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
|
||||
|
||||
XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* setMaskXY *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
|
||||
void setMaskXY(int x, int y) {
|
||||
|
||||
void setMaskXY(int x, int y)
|
||||
{
|
||||
XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
|
||||
XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
|
||||
}
|
||||
|
||||
/***************************************************************************\
|
||||
/*******************************************************************************\
|
||||
|* openXwindow *|
|
||||
\***************************************************************************/
|
||||
\*******************************************************************************/
|
||||
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
|
||||
|
||||
unsigned int borderwidth = 1;
|
||||
|
@ -392,7 +382,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
int dummy=0;
|
||||
int i, wx, wy;
|
||||
|
||||
for (i = 1; argv[i]; i++) {
|
||||
for (i=1; argv[i]; i++) {
|
||||
if (!strcmp(argv[i], "-display")) {
|
||||
display_name = argv[i+1];
|
||||
i++;
|
||||
|
@ -425,19 +415,16 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
fore_pix = GetColor("black");
|
||||
|
||||
XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
|
||||
&mysizehints.x, &mysizehints.y, &mysizehints.width,
|
||||
&mysizehints.height, &dummy);
|
||||
&mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
|
||||
|
||||
mysizehints.width = 64;
|
||||
mysizehints.height = 64;
|
||||
|
||||
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth,
|
||||
fore_pix, back_pix);
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
iconwin = XCreateSimpleWindow(display, win,
|
||||
mysizehints.x, mysizehints.y, mysizehints.width, mysizehints.height,
|
||||
borderwidth, fore_pix, back_pix);
|
||||
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
/* Activate hints */
|
||||
XSetWMNormalHints(display, win, &mysizehints);
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
---
|
||||
CHANGES:
|
||||
---
|
||||
14/09/1998 (Dave Clark, clarkd@skyia.com)
|
||||
* Updated createXBMfromXPM routine
|
||||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* Removed a bug from parse_rcfile. You could
|
||||
not use "start" in a command if a label was
|
||||
|
@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
|
|||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j;
|
||||
int width, height, numcol;
|
||||
char zero;
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
|
||||
sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
zero = xpm[1][0];
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j=0; j<sx; j++) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
if (xpm[i][j] != zero) {
|
||||
|
||||
curpixel=0;
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
---
|
||||
CHANGES:
|
||||
---
|
||||
14/09/1998 (Dave Clark, clarkd@skyia.com)
|
||||
* Updated createXBMfromXPM routine
|
||||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* Removed a bug from parse_rcfile. You could
|
||||
not use "start" in a command if a label was
|
||||
|
@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
|
|||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j;
|
||||
int width, height, numcol;
|
||||
char zero;
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
|
||||
sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
zero = xpm[1][0];
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j=0; j<sx; j++) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
if (xpm[i][j] != zero) {
|
||||
|
||||
curpixel=0;
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
---
|
||||
CHANGES:
|
||||
---
|
||||
14/09/1998 (Dave Clark, clarkd@skyia.com)
|
||||
* Updated createXBMfromXPM routine
|
||||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* Removed a bug from parse_rcfile. You could
|
||||
not use "start" in a command if a label was
|
||||
|
@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
|
|||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j;
|
||||
int width, height, numcol;
|
||||
char zero;
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
|
||||
sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
zero = xpm[1][0];
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j=0; j<sx; j++) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
if (xpm[i][j] != zero) {
|
||||
|
||||
curpixel=0;
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
|
|
@ -385,10 +385,6 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
for (i=1; argv[i]; i++) {
|
||||
if (!strcmp(argv[i], "-display")) {
|
||||
display_name = argv[i+1];
|
||||
if (!display_name)
|
||||
printf("Please provide an argument for "
|
||||
"-display.\n");
|
||||
else
|
||||
i++;
|
||||
}
|
||||
if (!strcmp(argv[i], "-geometry")) {
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
---
|
||||
CHANGES:
|
||||
---
|
||||
14/09/1998 (Dave Clark, clarkd@skyia.com)
|
||||
* Updated createXBMfromXPM routine
|
||||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* Removed a bug from parse_rcfile. You could
|
||||
not use "start" in a command if a label was
|
||||
|
@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
|
|||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j;
|
||||
int width, height, numcol;
|
||||
char zero;
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
|
||||
sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
zero = xpm[1][0];
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j=0; j<sx; j++) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
if (xpm[i][j] != zero) {
|
||||
|
||||
curpixel=0;
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
---
|
||||
CHANGES:
|
||||
---
|
||||
14/09/1998 (Dave Clark, clarkd@skyia.com)
|
||||
* Updated createXBMfromXPM routine
|
||||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* Removed a bug from parse_rcfile. You could
|
||||
not use "start" in a command if a label was
|
||||
|
@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
|
|||
\*******************************************************************************/
|
||||
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
||||
|
||||
int i,j;
|
||||
int width, height, numcol;
|
||||
char zero;
|
||||
int i,j,k;
|
||||
int width, height, numcol, depth;
|
||||
int zero=0;
|
||||
unsigned char bwrite;
|
||||
int bcount;
|
||||
int curpixel;
|
||||
|
||||
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
|
||||
|
||||
|
||||
sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
zero = xpm[1][0];
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
bcount = 0;
|
||||
bwrite = 0;
|
||||
for (j=0; j<sx; j++) {
|
||||
for (j=0; j<sx*depth; j+=depth) {
|
||||
bwrite >>= 1;
|
||||
if (xpm[i][j] != zero) {
|
||||
|
||||
curpixel=0;
|
||||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
curpixel <<=8;
|
||||
curpixel |= xpm[i][j+k];
|
||||
}
|
||||
|
||||
if ( curpixel != zero ) {
|
||||
bwrite += 128;
|
||||
}
|
||||
bcount++;
|
||||
|
|
|
@ -303,7 +303,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
|
|||
for (k=0; k!=depth; k++)
|
||||
{
|
||||
zero <<=8;
|
||||
zero |= xpm[2][k];
|
||||
zero |= xpm[1][k];
|
||||
}
|
||||
|
||||
for (i=numcol+1; i < numcol+sy+1; i++) {
|
||||
|
@ -411,7 +411,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
mysizehints.x = 0;
|
||||
mysizehints.y = 0;
|
||||
|
||||
back_pix = GetColor("black");
|
||||
back_pix = GetColor("white");
|
||||
fore_pix = GetColor("black");
|
||||
|
||||
XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* XPM */
|
||||
static char * wmsm_master_xpm[] = {
|
||||
"116 87 81 1",
|
||||
" c None",
|
||||
"116 87 80 1",
|
||||
". c #0000FF",
|
||||
"+ c #202020",
|
||||
"@ c #007D71",
|
||||
|
|
Loading…
Reference in a new issue