This commit is contained in:
purplerain 2024-10-06 22:00:57 +00:00
parent 50c8bafd9f
commit ac06c97e30
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
820 changed files with 467502 additions and 386453 deletions

View file

@ -140,7 +140,7 @@ void SetGraphic(LPBYTE lpBMData, XImage *image)
int loc = 0;
int actBytesPerLine;
int maxLoc;
// initialise
actBytesPerLine = (image->width + 7) / 8;
bmSize = actBytesPerLine * image->height;
@ -163,7 +163,7 @@ void SetGraphic(LPBYTE lpBMData, XImage *image)
SetByte(lpBMData, w32val, loc, maxLoc);
loc++;
}
// check for a line of graphic
if (++lineBitCnt == image->width)
{
@ -210,13 +210,13 @@ LCreateBitmap(XImage *image, HBITMAP *hBitmap, HPALETTE *hPalette)
palette[1][2] = 000; /* blue */
/* allocate memory for the bitmap header */
lpbi = (LPBITMAPINFO)LocalAlloc(LPTR,
lpbi = (LPBITMAPINFO)LocalAlloc(LPTR,
sizeof(BITMAPINFOHEADER) + (2 * sizeof(RGBQUAD)));
if (lpbi == NULL)
{
return;
return;
}
/* set bitmap header info */
lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
lpbi->bmiHeader.biWidth = image->width;
@ -235,7 +235,7 @@ LCreateBitmap(XImage *image, HBITMAP *hBitmap, HPALETTE *hPalette)
/* create bitmap area */
hScreenDC = CreateCompatibleDC(hdc);
*hBitmap = CreateDIBSection(hScreenDC, lpbi, DIB_RGB_COLORS,
*hBitmap = CreateDIBSection(hScreenDC, lpbi, DIB_RGB_COLORS,
&lpBMData, NULL, 0);
if (*hBitmap == NULL && lpBMData == NULL)
@ -253,11 +253,11 @@ LCreateBitmap(XImage *image, HBITMAP *hBitmap, HPALETTE *hPalette)
SetGraphic(lpBMData, image);
/* create logical palette header */
lpLogPal = (LPLOGPALETTE)LocalAlloc(LPTR,
lpLogPal = (LPLOGPALETTE)LocalAlloc(LPTR,
sizeof(LOGPALETTE) + (1 * sizeof(PALETTEENTRY)));
if (lpLogPal == NULL)
{
return;
return;
}
/* set logical palette info */
@ -274,7 +274,7 @@ LCreateBitmap(XImage *image, HBITMAP *hBitmap, HPALETTE *hPalette)
*hPalette = CreatePalette(lpLogPal);
if (*hPalette == NULL)
{
return;
return;
}
/* clean up palette creation data */
@ -283,7 +283,7 @@ LCreateBitmap(XImage *image, HBITMAP *hBitmap, HPALETTE *hPalette)
/* -------------------------------------------------------------------- */
/* the following functions to create, destroy, modify and access the
/* the following functions to create, destroy, modify and access the
GC Info structure
*/
int GCCreate(void)
@ -357,7 +357,7 @@ HDC GCGetDC(Drawable d, GC gc)
{
if (dbhdc == NULL)
/* create a compatible DC from the saved intial DC. To draw
to this DC we still need to put a HBITMAP into it (not
to this DC we still need to put a HBITMAP into it (not
done in this function)
*/
if ((dbhdc = CreateCompatibleDC(hdc)) == NULL)
@ -450,7 +450,7 @@ HDC GCGetDC(Drawable d, GC gc)
switch (gcInfo[gc].lineAttributes.lineStyle)
{
case LineSolid:
case LineSolid:
penstyle |= PS_SOLID; break;
case LineOnOffDash:
penstyle |= PS_DASH; break;
@ -498,13 +498,13 @@ HDC GCGetDC(Drawable d, GC gc)
palarray[1][2] = blue[gcInfo[gc].color.background]; /* blue */
/* create logical palette header */
lpLogPal = (LPLOGPALETTE)LocalAlloc(LPTR,
lpLogPal = (LPLOGPALETTE)LocalAlloc(LPTR,
sizeof(LOGPALETTE) + (1 * sizeof(PALETTEENTRY)));
if (lpLogPal == NULL)
{
sprintf(message, "palette: Cannot alloacte memory for logical palette");
xlockmore_set_debug(message);
return NULL;
return NULL;
}
/* set logical palette info */
@ -524,11 +524,11 @@ HDC GCGetDC(Drawable d, GC gc)
sprintf(message, "palette: CreatePalette() returned NULL");
xlockmore_set_debug(message);
LocalFree(lpLogPal);
return NULL;
return NULL;
}
/* set palette color */
palette = SelectPalette(lhdc, palette, FALSE);
palette = SelectPalette(lhdc, palette, FALSE);
/* clean up palette creation data */
DeleteObject(palette);
@ -559,8 +559,8 @@ HDC GCGetDC(Drawable d, GC gc)
/* check if we need to FillStippled, and if so don't make a
* brush, we will deal with this later (see XFillRectangle)
*/
else if (gcInfo[gc].stipple.graphic != -1 &&
! (gcInfo[gc].fillStyle.hasFillStyle == TRUE &&
else if (gcInfo[gc].stipple.graphic != -1 &&
! (gcInfo[gc].fillStyle.hasFillStyle == TRUE &&
gcInfo[gc].fillStyle.value == FillStippled))
{
/* pattern brush */
@ -673,7 +673,7 @@ HDC GCGetDC(Drawable d, GC gc)
}
}
/*
/*
* if we call this function again and there is no change to the DC
* that needs to be done, we want to just return the DC that had
* already been set up. Set the information to allow this
@ -783,7 +783,7 @@ int sigmask(int signum)
* BlackPixel
* returns the color cell of Black
* NOTE: this is currently set to the end of the color
* palette table,
* palette table,
*/
unsigned long BlackPixel(Display *display, int screen_number)
{
@ -918,7 +918,7 @@ void XAddHosts(Display *display, XHostAddress *hosts, int num_hosts)
* XAllocColor
* not currently used
*/
Status XAllocColor(Display *display, Colormap colormap,
Status XAllocColor(Display *display, Colormap colormap,
XColor *screen_in_out)
{
screen_in_out->pixel = 0;
@ -985,15 +985,15 @@ void XChangeGC(Display *display, GC gc, unsigned long valuemask,
}
if (valuemask & GCLineWidth)
{
XSetLineAttributes(display, gc,
values->line_width,
XSetLineAttributes(display, gc,
values->line_width,
gcInfo[gc].lineAttributes.lineStyle,
gcInfo[gc].lineAttributes.capStyle,
gcInfo[gc].lineAttributes.joinStyle);
}
if (valuemask & GCLineStyle)
{
XSetLineAttributes(display, gc,
XSetLineAttributes(display, gc,
gcInfo[gc].lineAttributes.width,
values->line_style,
gcInfo[gc].lineAttributes.capStyle,
@ -1001,7 +1001,7 @@ void XChangeGC(Display *display, GC gc, unsigned long valuemask,
}
if (valuemask & GCCapStyle)
{
XSetLineAttributes(display, gc,
XSetLineAttributes(display, gc,
gcInfo[gc].lineAttributes.width,
gcInfo[gc].lineAttributes.lineStyle,
values->cap_style,
@ -1009,7 +1009,7 @@ void XChangeGC(Display *display, GC gc, unsigned long valuemask,
}
if (valuemask & GCJoinStyle)
{
XSetLineAttributes(display, gc,
XSetLineAttributes(display, gc,
gcInfo[gc].lineAttributes.width,
gcInfo[gc].lineAttributes.lineStyle,
gcInfo[gc].lineAttributes.capStyle,
@ -1040,7 +1040,7 @@ void XChangeGC(Display *display, GC gc, unsigned long valuemask,
* XCheckMaskEvent
* not currently used, return True
*/
Bool XCheckMaskEvent(Display *display, long event_mask,
Bool XCheckMaskEvent(Display *display, long event_mask,
XEvent *event_return)
{
return True;
@ -1084,8 +1084,8 @@ void XCloseDisplay(Display *display)
* XConfigureWindow
* not currently used
*/
void XConfigureWindow(Display *display, Window w,
unsigned int value_mask,
void XConfigureWindow(Display *display, Window w,
unsigned int value_mask,
XWindowChanges *values)
{
}
@ -1094,7 +1094,7 @@ void XConfigureWindow(Display *display, Window w,
* XCopyArea
* copies one drawable to another
*/
int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned int width, unsigned height,
int dest_x, int dest_y)
{
@ -1144,7 +1144,7 @@ int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
}
/* copy src to destination */
if (BitBlt(hDestDC, dest_x, dest_y, width, height, hSrcDC,
if (BitBlt(hDestDC, dest_x, dest_y, width, height, hSrcDC,
src_x, src_y, SRCCOPY) == 0)
{
xlockmore_set_debug("XCopyArea: BitBlt() failed");
@ -1176,7 +1176,7 @@ Colormap XCopyColormapAndFree(Display *display, Colormap colormap)
* to be implemented
*/
int XCopyPlane(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned width, int height,
int src_x, int src_y, unsigned width, int height,
int dest_x, int dest_y, unsigned long plane)
{
return 0;
@ -1186,7 +1186,7 @@ int XCopyPlane(Display *display, Drawable src, Drawable dest, GC gc,
* XCreateBitmapFromData
* used to create a bitmap
*/
Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
char *data, unsigned int width,
unsigned int height)
{
@ -1205,7 +1205,7 @@ Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
LCreateBitmap(&image, &hBitmap, &hPalette);
DeleteObject(hPalette); /* we don't need the palette */
if (hBitmap == NULL)
{
bmInfo[pm].isActive = FALSE;
@ -1223,7 +1223,7 @@ Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
* XCreateColormap
* used to create the colormap
*/
Colormap XCreateColormap(Display *display, Window w,
Colormap XCreateColormap(Display *display, Window w,
Visual *visual, int alloc)
{
return None;
@ -1242,7 +1242,7 @@ Cursor XCreateFontCursor(Display *display, unsigned int shape)
* XCreateGC
* creates a copy of the GC
*/
GC XCreateGC(Display *display, Drawable drawable,
GC XCreateGC(Display *display, Drawable drawable,
unsigned long valuemask, XGCValues *values)
{
GC newGc;
@ -1277,7 +1277,7 @@ GC XCreateGC(Display *display, Drawable drawable,
* XCreateImage
* creates an XImage structure and populates it
*/
XImage *XCreateImage(Display *display, Visual *visual,
XImage *XCreateImage(Display *display, Visual *visual,
unsigned int depth, int format, int offset,
char *data, unsigned int width,
unsigned int height, int bitmap_pad,
@ -1287,7 +1287,7 @@ XImage *XCreateImage(Display *display, Visual *visual,
if ((newImage = malloc(sizeof(XImage))) == NULL)
return NULL;
memset(newImage, 0, sizeof(XImage));
newImage->width = width;
@ -1317,8 +1317,8 @@ Pixmap XCreatePixmap(Display *display, Drawable d, unsigned int width,
return None;
/* create the bitmap */
if ((hBitmap =
(depth == 1) ? CreateBitmap(width, height, depth, 1, NULL) :
if ((hBitmap =
(depth == 1) ? CreateBitmap(width, height, depth, 1, NULL) :
CreateCompatibleBitmap(hdc, width, height)) == NULL)
{
bmInfo[pm].isActive = FALSE;
@ -1449,7 +1449,7 @@ void XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
if (angle2 == 0) {
/* Special case - In X this is a point but Arc in Windows would
do a complete elipse! Draw a (thick) line instead. */
XDrawLine(display, d, gc, xa1, ya1, xa1, ya1);
} else {
@ -1477,7 +1477,7 @@ void XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
* XDrawImageString
* not currently used
*/
void XDrawImageString(Display *display, Drawable d, GC gc,
void XDrawImageString(Display *display, Drawable d, GC gc,
int x, int y, char *string, int length)
{
}
@ -1486,7 +1486,7 @@ void XDrawImageString(Display *display, Drawable d, GC gc,
* XDrawLine
* draws a line on the screen in the current pen color
*/
void XDrawLine(Display *display, Drawable d, GC gc,
void XDrawLine(Display *display, Drawable d, GC gc,
int x1, int y1, int x2, int y2)
{
HDC dc;
@ -1509,8 +1509,8 @@ void XDrawLine(Display *display, Drawable d, GC gc,
/*-
* XDrawLines
* draws a series of lines on the screen. Liness may be
* specified as being (1) relative to the origin, or
* (2) relative to the previous line (with the first line
* specified as being (1) relative to the origin, or
* (2) relative to the previous line (with the first line
* relative to the origin).
*/
void XDrawLines(Display *display, Drawable d, GC gc,
@ -1589,11 +1589,11 @@ void XDrawPoint(Display *display, Drawable d, GC gc, int x, int y)
/*-
* XDrawPoints
* draws a series of points on the screen. Points may be
* specified as being (1) relative to the origin, or
* (2) relative to the previous point (with the first point
* specified as being (1) relative to the origin, or
* (2) relative to the previous point (with the first point
* relative to the origin).
*/
void XDrawPoints(Display *display, Drawable d, GC gc,
void XDrawPoints(Display *display, Drawable d, GC gc,
XPoint *pts, int numpts, int mode)
{
int i;
@ -1707,7 +1707,7 @@ void XDrawSegments(Display *display, Drawable d, GC gc,
lpbTypes[cCount] = PT_LINETO;
lppt[cCount].x = segs[i].x2;
lppt[cCount].y = segs[i].y2;
cCount++;
cCount++;
}
PolyDraw(dc, lppt, lpbTypes, cCount);
@ -1723,7 +1723,7 @@ void XDrawSegments(Display *display, Drawable d, GC gc,
* XDrawString
* Draws a string of characters at specified location
*/
void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
char *string, int length)
{
int prevMode;
@ -1790,7 +1790,7 @@ void XFillArc(Display *display, Drawable d, GC gc, int x, int y,
if (angle2 == 0) {
/* Special case - In X this is a point but Arc in Windows would
do a complete elipse! Draw a (thick) line instead. */
XDrawLine(display, d, gc, cx, cy, xa1, ya1);
} else {
@ -1816,7 +1816,7 @@ void XFillArc(Display *display, Drawable d, GC gc, int x, int y,
}
oldPen = SelectObject(dc, noPen);
/* should check for a pie or chord filled arc type, but
/* should check for a pie or chord filled arc type, but
currently assuming pie filled arc */
Pie(dc, x, y, x + width, y + height, xa1, ya1, xa2, ya2);
@ -1861,11 +1861,11 @@ void XFillArcs(Display *display, Drawable d, GC gc,
if (arcs[i].angle2 == 0) {
/* Special case - In X this is a point but Arc in Windows would
do a complete elipse! Draw a (thick) line instead. */
XDrawLine(display, d, gc, cx, cy, xa1, ya1);
} else {
if (d > 0 && d < NUMBER_BITMAP)
if (bmInfo[d].isActive == TRUE)
hOldBitmap = SelectObject(dc, DrawableGetBitmap(d));
@ -1874,9 +1874,9 @@ void XFillArcs(Display *display, Drawable d, GC gc,
xa2 = (int)((rx * cos(a2)) + cx);
ya2 = (int)((ry * sin(a2)) + cy);
/* should check for a pie or chord filled arc type, but
/* should check for a pie or chord filled arc type, but
currently assuming pie filled arc */
Pie(dc, arcs[i].x, arcs[i].y, arcs[i].x + arcs[i].width,
Pie(dc, arcs[i].x, arcs[i].y, arcs[i].x + arcs[i].width,
arcs[i].y + arcs[i].height, xa1, ya1, xa2, ya2);
if (hOldBitmap)
@ -1930,7 +1930,7 @@ void XFillPolygon(Display *display, Drawable d, GC gc, XPoint *points,
pts[i].y = ty;
}
}
Polygon(dc, pts, npoints);
/* free memory */
@ -1944,13 +1944,13 @@ void XFillPolygon(Display *display, Drawable d, GC gc, XPoint *points,
* XFillRectangle
* draws a filled rectangle on screen
*/
void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height)
{
HPEN oldPen;
HDC dc;
HBITMAP hOldBitmap = NULL;
if ((dc = GCGetDC(d, gc)) == NULL)
return;
@ -1959,7 +1959,7 @@ void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
hOldBitmap = SelectObject(dc, DrawableGetBitmap(d));
/* check if we are doing a FillStippled fill or a normal rectangle */
if (gcInfo[gc].fillStyle.hasFillStyle == TRUE &&
if (gcInfo[gc].fillStyle.hasFillStyle == TRUE &&
gcInfo[gc].fillStyle.value == FillStippled)
{
HBITMAP hOldBitmapS = NULL;
@ -1994,7 +1994,7 @@ void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
for (i=y; i<y+height; i+=sHeight)
for (j=x; j<x+width; j+=sWidth)
if (MaskBlt(dc, j, i, sWidth, sHeight, hStippleDC, 0, 0, hStipple, 0, 0,
if (MaskBlt(dc, j, i, sWidth, sHeight, hStippleDC, 0, 0, hStipple, 0, 0,
MAKEROP4(0x00AA0029, SRCCOPY)) == 0)
xlockmore_set_debug("XFillRectangle: MaskBlt() failed");
@ -2074,8 +2074,8 @@ void XFreeColormap(Display *display, Colormap colormap)
* XFreeColors
* not currently used
*/
void XFreeColors(Display *display, Colormap colormap,
unsigned long pixels[], int npixels,
void XFreeColors(Display *display, Colormap colormap,
unsigned long pixels[], int npixels,
unsigned long planes)
{
}
@ -2188,7 +2188,7 @@ Status XGetWindowAttributes(Display *display, Window w,
* XGrabKeyboard
* not currently used
*/
int XGrabKeyboard(Display *display, Window grab_window,
int XGrabKeyboard(Display *display, Window grab_window,
Bool owner_events, int pointer_mode,
int keyboard_mode, Time time)
{
@ -2200,7 +2200,7 @@ int XGrabKeyboard(Display *display, Window grab_window,
* not currently used
*/
int XGrabPointer(Display *display, Window grab_window, Bool owner_events,
unsigned int event_mask, int pointer_mode,
unsigned int event_mask, int pointer_mode,
int keyboard_mode, Window confine_to, Cursor cursor,
Time time)
{
@ -2283,7 +2283,7 @@ Display *XOpenDisplay(char *display_name)
* XParseColor
* not currently used
*/
Status XParseColor(Display *display, Colormap colormap,
Status XParseColor(Display *display, Colormap colormap,
char *spec, XColor *exact_def_return)
{
return 0;
@ -2333,7 +2333,7 @@ void XPutImage(Display *display, Drawable d, GC gc, XImage *image, int src_x,
{
if (image->depth != 1)
return;
if ((hBitmapDC = CreateCompatibleDC(dc)) == NULL)
return;
@ -2356,7 +2356,7 @@ void XPutImage(Display *display, Drawable d, GC gc, XImage *image, int src_x,
/* set the correct color table */
SetDIBColorTable(hBitmapDC, 0, 1, &rgbQuad);
BitBlt(dc, dest_x, dest_y, width, height, hBitmapDC,
BitBlt(dc, dest_x, dest_y, width, height, hBitmapDC,
src_x, src_y, SRCCOPY);
SelectObject(hBitmapDC, hOldBitmap);
@ -2378,13 +2378,13 @@ int XPutPixel(XImage *ximage, int x, int y, unsigned long pixel)
{
int pos = 0;
unsigned long val = 0;
/* check ximage points to an image */
if (ximage == NULL)
{
return 0;
}
/* check x & y are within range */
if ((x < 0 || x > ximage->width - 1) ||
(y < 0 || y > ximage->height - 1))
@ -2398,7 +2398,7 @@ int XPutPixel(XImage *ximage, int x, int y, unsigned long pixel)
int byte_pos = 0;
int oldval = 0;
int i = 0;
pos = (ximage->bytes_per_line * y) + (x / 8);
byte_pos = x % 8;
oldval = ximage->data[pos];
@ -2453,7 +2453,7 @@ Bool XQueryPointer(Display *display, Window w, Window *root_return,
* XQueryTree
* not currently used
*/
Status XQueryTree(Display *display, Window w, Window *root_return,
Status XQueryTree(Display *display, Window w, Window *root_return,
Window *parent_return, Window **children_return,
unsigned int *nchildren_return)
{
@ -2541,7 +2541,7 @@ XrmDatabase XrmGetFileDatabase(char *filename)
* not currently used, return True
*/
Bool XrmGetResource(XrmDatabase database, char *str_name,
char *str_class, char **str_type_return,
char *str_class, char **str_type_return,
XrmValue *value_return)
{
return True;
@ -2690,7 +2690,7 @@ int XSetGraphicsExposures(Display *display, GC gc, Bool graphics_exposures)
* XSetLineAttributes
* creates a new pen that has the attributes given
*/
void XSetLineAttributes(Display *display, GC gc,
void XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style)
{
@ -2772,7 +2772,7 @@ void XStoreColors(Display *display, Colormap colormap, XColor color[],
* XStringListToTextProperty
* not currently used
*/
Status XStringListToTextProperty(char **list, int count,
Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return)
{
return 0;
@ -2810,7 +2810,7 @@ Bool XTranslateCoordinates(Display* display, Window src_w, Window dest_w,
if (GetDCOrgEx(hdc, &p)) {
*dest_x_return = p.x + src_x;
*dest_y_return = p.y + src_y;
} else {
*dest_x_return = src_x;
*dest_y_return = src_y;

View file

@ -40,7 +40,7 @@ extern RECT rc; /* coords of the screen */
/* -------------------------------------------------------------------- */
/*****************************************************************
* ERROR CODES
* ERROR CODES
*****************************************************************/
#define Success 0 /* everything's okay */
@ -55,9 +55,9 @@ extern RECT rc; /* coords of the screen */
#define BadDrawable 9 /* parameter not a Pixmap or Window */
#define BadAccess 10 /* depending on context:
- key/button already grabbed
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
color map entry.
- attempt to modify the access control
list from other than the local host.
@ -157,30 +157,30 @@ extern RECT rc; /* coords of the screen */
#define GrabFrozen (4)
#define NoEventMask 0L
#define KeyPressMask (1L<<0)
#define KeyReleaseMask (1L<<1)
#define ButtonPressMask (1L<<2)
#define ButtonReleaseMask (1L<<3)
#define EnterWindowMask (1L<<4)
#define LeaveWindowMask (1L<<5)
#define PointerMotionMask (1L<<6)
#define PointerMotionHintMask (1L<<7)
#define Button1MotionMask (1L<<8)
#define Button2MotionMask (1L<<9)
#define Button3MotionMask (1L<<10)
#define Button4MotionMask (1L<<11)
#define Button5MotionMask (1L<<12)
#define ButtonMotionMask (1L<<13)
#define KeymapStateMask (1L<<14)
#define ExposureMask (1L<<15)
#define VisibilityChangeMask (1L<<16)
#define StructureNotifyMask (1L<<17)
#define ResizeRedirectMask (1L<<18)
#define SubstructureNotifyMask (1L<<19)
#define SubstructureRedirectMask (1L<<20)
#define FocusChangeMask (1L<<21)
#define PropertyChangeMask (1L<<22)
#define ColormapChangeMask (1L<<23)
#define KeyPressMask (1L<<0)
#define KeyReleaseMask (1L<<1)
#define ButtonPressMask (1L<<2)
#define ButtonReleaseMask (1L<<3)
#define EnterWindowMask (1L<<4)
#define LeaveWindowMask (1L<<5)
#define PointerMotionMask (1L<<6)
#define PointerMotionHintMask (1L<<7)
#define Button1MotionMask (1L<<8)
#define Button2MotionMask (1L<<9)
#define Button3MotionMask (1L<<10)
#define Button4MotionMask (1L<<11)
#define Button5MotionMask (1L<<12)
#define ButtonMotionMask (1L<<13)
#define KeymapStateMask (1L<<14)
#define ExposureMask (1L<<15)
#define VisibilityChangeMask (1L<<16)
#define StructureNotifyMask (1L<<17)
#define ResizeRedirectMask (1L<<18)
#define SubstructureNotifyMask (1L<<19)
#define SubstructureRedirectMask (1L<<20)
#define FocusChangeMask (1L<<21)
#define PropertyChangeMask (1L<<22)
#define ColormapChangeMask (1L<<23)
#define OwnerGrabButtonMask (1L<<24)
#define KeyPress 2
@ -216,7 +216,7 @@ extern RECT rc; /* coords of the screen */
#define ColormapNotify 32
#define ClientMessage 33
#define MappingNotify 34
#define LASTEvent 35
#define LASTEvent 35
#define VisibilityUnobscured (0)
#define VisibilityPartiallyObscured (1)
@ -654,7 +654,7 @@ typedef struct {
/* XrmBinding & XrmBindingList types: not needed for WIN32 */
typedef enum {
XrmBindTightly,
XrmBindTightly,
XrmBindLoosely
} XrmBinding, *XrmBindingList;
@ -783,7 +783,7 @@ int WhitePixelOfScreen(Screen *screen);
void XAddHosts(Display *display, XHostAddress *hosts, int num_hosts);
Status XAllocColor(Display *display, Colormap colormap,
Status XAllocColor(Display *display, Colormap colormap,
XColor *screen_in_out);
Status XAllocColorCells(Display *display, Colormap colormap,
Bool contig, unsigned long plane_masks_return[],
@ -795,31 +795,31 @@ Status XAllocNamedColor(Display *display, Colormap colormap,
void XBell(Display *display, int percent);
void XChangeGC(Display *display, GC gc, unsigned long valuemask,
XGCValues *values);
Bool XCheckMaskEvent(Display *display, long event_mask,
Bool XCheckMaskEvent(Display *display, long event_mask,
XEvent *event_return);
void XClearArea(Display *display, Window w, int x, int y,
unsigned int width, unsigned int height, Bool exposures);
void XClearWindow(Display *display, Window w);
void XCloseDisplay(Display *display);
void XConfigureWindow(Display *display, Window w,
unsigned int value_mask,
void XConfigureWindow(Display *display, Window w,
unsigned int value_mask,
XWindowChanges *values);
int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned int width, unsigned height,
int dest_x, int dest_y);
int XCopyPlane(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned width, int height, int dest_x,
int dest_y, unsigned long plane);
Colormap XCopyColormapAndFree(Display *display, Colormap colormap);
Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
Colormap XCopyColormapAndFree(Display *display, Colormap colormap);
Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
char *data, unsigned int width,
unsigned int height);
Colormap XCreateColormap(Display *display, Window w,
Colormap XCreateColormap(Display *display, Window w,
Visual *visual, int alloc);
Cursor XCreateFontCursor(Display *display, unsigned int shape);
GC XCreateGC(Display *display, Drawable drawable,
GC XCreateGC(Display *display, Drawable drawable,
unsigned long valuemask, XGCValues *values);
XImage *XCreateImage(Display *display, Visual *visual,
XImage *XCreateImage(Display *display, Visual *visual,
unsigned int depth, int format, int offset,
char *data, unsigned int width,
unsigned int height, int bitmap_pad,
@ -839,20 +839,20 @@ void XDisableAccessControl(Display *display);
void XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height,
int angle1, int angle2);
void XDrawImageString(Display *display, Drawable d, GC gc,
void XDrawImageString(Display *display, Drawable d, GC gc,
int x, int y, char *string, int length);
void XDrawLine(Display *display, Drawable d, GC gc,
void XDrawLine(Display *display, Drawable d, GC gc,
int x1, int y1, int x2, int y2);
void XDrawLines(Display *display, Drawable d, GC gc,
XPoint *points, int npoints, int mode);
void XDrawPoint(Display *display, Drawable d, GC gc, int x, int y);
void XDrawPoints(Display *display, Drawable d, GC gc,
void XDrawPoints(Display *display, Drawable d, GC gc,
XPoint *pts, int numpts, int mode);
void XDrawRectangle(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height);
void XDrawSegments(Display *display, Drawable d, GC gc,
XSegment *segs, int numsegs);
void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
char *string, int length);
void XEnableAccessControl(Display *display);
void XFillArc(Display *display, Drawable d, GC gc, int x, int y,
@ -862,15 +862,15 @@ void XFillArcs(Display *display, Drawable d, GC gc,
XArc *arcs, int narcs);
void XFillPolygon(Display *display, Drawable d, GC gc, XPoint *points,
int npoints, int shape, int mode);
void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height);
void XFillRectangles(Display *display, Drawable d, GC gc,
XRectangle *rectangles, int nrectangles);
void XFlush(Display *display);
void XFree(void *data);
void XFreeColormap(Display *display, Colormap colormap);
void XFreeColors(Display *display, Colormap colormap,
unsigned long pixels[], int npixels,
void XFreeColors(Display *display, Colormap colormap,
unsigned long pixels[], int npixels,
unsigned long planes);
void XFreeCursor(Display *display, Cursor cursor);
int XFreeFont(Display *display, XFontStruct *font_struct);
@ -883,11 +883,11 @@ XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
int *nitems_return);
Status XGetWindowAttributes(Display *display, Window w,
XWindowAttributes *window_attr_return);
int XGrabKeyboard(Display *display, Window grab_window,
int XGrabKeyboard(Display *display, Window grab_window,
Bool owner_events, int pointer_mode,
int keyboard_mode, Time time);
int XGrabPointer(Display *display, Window grab_window, Bool owner_events,
unsigned int event_mask, int pointer_mode,
unsigned int event_mask, int pointer_mode,
int keyboard_mode, Window confine_to, Cursor cursor,
Time time);
void XGrabServer(Display *display);
@ -901,7 +901,7 @@ int XLookupString(XKeyEvent *event_struct, char *buffer_return,
void XMapWindow(Display *display, Window w);
void XNextEvent(Display *display, XEvent *event_return);
Display *XOpenDisplay(char *display_name);
Status XParseColor(Display *display, Colormap colormap,
Status XParseColor(Display *display, Colormap colormap,
char *spec, XColor *exact_def_return);
int XPending(Display *display);
void XPutBackEvent(Display *display, XEvent *event);
@ -915,7 +915,7 @@ Bool XQueryPointer(Display *display, Window w, Window *root_return,
Window *child_return, int *root_x_return, int *root_y_return,
int *win_x_return, int *win_y_return,
unsigned int *mask_return);
Status XQueryTree(Display *display, Window w, Window *root_return,
Status XQueryTree(Display *display, Window w, Window *root_return,
Window *parent_return, Window **children_return,
unsigned int *nchildren_return);
void XRaiseWindow(Display *display, Window w);
@ -927,7 +927,7 @@ char *XResourceManagerString(Display *display);
void XrmDestroyDatabase(XrmDatabase database);
XrmDatabase XrmGetFileDatabase(char *filename);
Bool XrmGetResource(XrmDatabase database, char *str_name,
char *str_class, char **str_type_return,
char *str_class, char **str_type_return,
XrmValue *value_return);
XrmDatabase XrmGetStringDatabase(char *data);
void XrmInitialize(void);
@ -942,7 +942,7 @@ void XSetFont(Display *display, GC gc, Font font);
void XSetForeground(Display *display, GC gc, unsigned long foreground);
void XSetFunction(Display *display, GC gc, int function);
int XSetGraphicsExposures(Display *display, GC gc, Bool graphics_exposures);
void XSetLineAttributes(Display *display, GC gc,
void XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style);
void XSetScreenSaver(Display *display, int timeout, int interval,
@ -951,10 +951,10 @@ void XSetStipple(Display *display, GC gc, Pixmap stipple);
void XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin);
void XSetWindowColormap(Display *display, Window w, Colormap colormap);
void XSetWMName(Display *display, Window w, XTextProperty *text_prop);
Status XStringListToTextProperty(char **list, int count,
Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return);
void XStoreColors(Display *display, Colormap colormap, XColor color[],
int ncolors);
int ncolors);
void XSync(Display *display, Bool discard);
int XTextWidth(XFontStruct *font_struct, char *string, int count);
Bool XTranslateCoordinates(Display* display, Window src_w, Window dest_w,

View file

@ -7,7 +7,7 @@ Requirements.
-------------
Windows 95, 98, ME or Windows NT, 2000, XP running 256 colors or greater.
Don't know the minimum spec. machine, but I have run it on a
Don't know the minimum spec. machine, but I have run it on a
Pentium 166 (Win95), Pentium Pro 200 (Win NT), Pentium II 233 (Win95),
Pentium III 1000 (Win98) and Pentium 4 3Ghz (XP Pro).
@ -72,10 +72,10 @@ xlock95 is also not yet coded to handle multiple screens.
Notes.
------
If you have used an older version than 0.4, it was called
If you have used an older version than 0.4, it was called
"xlock.scr". This is not needed anymore and can be deleted from
Windows system directory. Also timings from the older versions are
different than the versions 0.4 and above, so modes will be either
different than the versions 0.4 and above, so modes will be either
faster or slower.
If you have used a version between 0.4 and 0.6, it was called
@ -87,7 +87,7 @@ time, there are 86 modes. These are:
Ant, Ant3D, Apollonian, Ball, Bat, Blot, Bouboule, Bounce, Braid,
Bug, Clock, Coral, Crystal, Daisy, Deco, Demon, Dilemma, Discrete,
Dragon, Drift, Euler2D, Eyes, Fadeplot, Fiberlamp, Flame, Flow,
Dragon, Drift, Euler2D, Eyes, Fadeplot, Fiberlamp, Flame, Flow,
Forest, Galaxy, Grav, Helix, Hop, Hyper, Ico, Image, Juggle, Julia,
Kaleid, Kumppa, Laser, Life, Life1D, Life3D, Lightning, Lisa, Lissie,
Loop, Lyapunov, Mandelbrot, Matrix, Maze, Mountain, Munch, Nose,
@ -116,9 +116,9 @@ Future of Xlockmore95.
----------------------
At this stage I have done intermediate releases of Xlockmore95. I
know there are more modes I can add, but as to adding all the modes
that exist in Xlockmore, I'm not sure it is possible. There are modes
that use XPM images (X PixMap images), opengl, and there may be
know there are more modes I can add, but as to adding all the modes
that exist in Xlockmore, I'm not sure it is possible. There are modes
that use XPM images (X PixMap images), opengl, and there may be
X11 functions that just won't map easily to win32 functions (I've been
adding them on an as needed basis).
@ -136,7 +136,7 @@ This is a list of what I would like to do (but I'm not promising)...
Differences with X11 & Bugs.
----------------------------
ball, crystal, munch, pyro, tik_tak:
ball, crystal, munch, pyro, tik_tak:
XSetFunction() isn't drawing correctly.
ant: truchet drawing messed up
@ -165,7 +165,7 @@ version 0.2 (not a public release)
. added Coral mode
version 0.3
. wasn't initialising some pointer variables, which could cause an
. wasn't initialising some pointer variables, which could cause an
error if circumstances allowed. This is now fixed.
. added the ability to redefine the color palette in a mode class.
@ -179,39 +179,39 @@ version 0.4 (debug build)
. added code for XDrawArc(), XFillArc() & XFillPolygon()
. changed from using my own base source code to using the source code
for xlockmore 4.07. I still have to use some of my own code for
start-up and initialisation of the screen saver (cannot get around
for xlockmore 4.07. I still have to use some of my own code for
start-up and initialisation of the screen saver (cannot get around
this due to differences between X11 and Win32), and of course all
the X11 functions and structures. But the rest is xlockmore 4.07
the X11 functions and structures. But the rest is xlockmore 4.07
code. At some point I will see if David will integrate the Win32
source code into the official distrubution.
. As a result a lot more modes are now added. These are:
Braid, Clock, Daisy, Drift, Flame, Galaxy, Geometry, Grav, Helix,
Hop, Lightning, Lisa, Lissie, Petal, Qix, Roll, Rotor, Sphere,
Braid, Clock, Daisy, Drift, Flame, Galaxy, Geometry, Grav, Helix,
Hop, Lightning, Lisa, Lissie, Petal, Qix, Roll, Rotor, Sphere,
Spiral, Spline, Triangle, Turtle
version 0.5
. determined that the problem with the Galaxy mode in the release
build was to do with VC++. When VC++ optimizes for speed, Galaxy
. determined that the problem with the Galaxy mode in the release
build was to do with VC++. When VC++ optimizes for speed, Galaxy
does not work. I now optimize for size.
. life3d: added an extra check to life3dfile, to see if it was NULL
before doing the strlen() on it. This has fixed a crash I was
before doing the strlen() on it. This has fixed a crash I was
getting with it. This is the only mode I have changed.
. added code for XCreateGC(), XChangeGC(), XDrawLines(), XFillArcs(),
XFillRectangles(), XSetFunction() so the following modes now work:
Ant, Ball, Bouboule, Bug, Crystal, Demon, Laser, Life3d, Loop,
Ant, Ball, Bouboule, Bug, Crystal, Demon, Laser, Life3d, Loop,
Mountain, Munch, Pyro, Wire
version 0.6
. added code for XDrawSegments(), XClearArea() so the following modes
now work: Hyper, Ico, Kaleid, Worm
. added code to set each modes default options (if there are any).
This affects every mode, but only boolean and string types are being
set at the moment. Ico refused to work until either edges or faces
. added code to set each modes default options (if there are any).
This affects every mode, but only boolean and string types are being
set at the moment. Ico refused to work until either edges or faces
were defined as true. This also allowed me to remove the code I
added to life3d.
@ -236,21 +236,21 @@ version 0.7
. filled in code for XDrawString(), though it doesn't affect anything
(yet)
. added code for XDrawRectangle(), XStoreColors() so the following
. added code for XDrawRectangle(), XStoreColors() so the following
modes now works: mandelbrot, tube
. added empty function calls to XPutImage(), XCreateBitmapFromData(),
. added empty function calls to XPutImage(), XCreateBitmapFromData(),
XSetBackground(), XSetFillStyle(), XSetStipple() so Maze now works
(minus the operating system graphic)
. fixed up XSetFunction so now it should utilise different drawing
. fixed up XSetFunction so now it should utilise different drawing
functions. It does not seem to be 100% correct, but much better than
before.
version 0.8 (8-Oct-2004)
. added code for XPutImage() so now the operating system graphic is
drawn in Maze.
. added code for XCreateBitmapFromData(), XFreePixmap(), XCreateGC(),
XFreeGC()
@ -264,11 +264,11 @@ version 0.10 (26-Jul-2005)
. fixed XDrawArc(), XFillArc() & XFillArcs so they draw fully the
complete angles. This was causing a graphical error in some modes,
for example clock.
. fixed setting the stipple brush color on an XSetForeground. Now the
bad paths of Maze are the correct color.
. fixed most of the broken modes. I think this had to do with
. fixed most of the broken modes. I think this had to do with
recreating the pen for a filled arc in XFillArc(). It wasn't always
creating the new pen. I create it now as null, so the border is not
drawn, and to make up for this I make the arc a little larger in the
@ -287,7 +287,7 @@ version 0.11 (29-Sep-2005)
. updated to use xlockmore-5.19. This is the first step of getting my
source code integrated into the offical source. A number of changes
had to be made to my code, but it was mostly OK. The following modes
are removed in this new version (removed in the official code):
are removed in this new version (removed in the official code):
geometry (14-Sep-2005)
. many modes have changed, but some have now a few issues (maze - OS
@ -308,7 +308,7 @@ Please don't email David with questions about Xlockmore95.
[Well actually David does not mind if you cc him :) ]
They can be directed to me: petey_leinonen@yahoo.com.au
You can find the latest information about xlockmore from
You can find the latest information about xlockmore from
David A. Bagley's site at http://www.tux.org/~bagleyd/xlockmore.html
@ -323,11 +323,11 @@ Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation.
supporting documentation.
Please note that I do not provide any warranties, and that you use this
executable and/or source code at your own risk. I will not be held
responsible for any damage that is incurred by using the executable
executable and/or source code at your own risk. I will not be held
responsible for any damage that is incurred by using the executable
and/or source code.

View file

@ -12,7 +12,7 @@ decay (requires ???, black screen)
deluxe (requires ???, red screen)
fire (requires OpenGL)
flag (requires utsname.h)
fzort
fzort
gears (requires OpenGL)
glplanet (requires OpenGL)
goop (requires XCopyPlane(), XSetPlaneMask())

View file

@ -1,4 +1,4 @@
#include <windows.h>
#include <windows.h>
#include <scrnsave.h>
#include <stdlib.h>
#include <time.h>
@ -34,10 +34,10 @@ char *xlock95_get_modelist() {
else {
TCHAR buf[10];
DWORD size = sizeof(buf);
if (RegQueryValueEx(skey,"Enabled",NULL,NULL,(LPBYTE)buf, &size)
if (RegQueryValueEx(skey,"Enabled",NULL,NULL,(LPBYTE)buf, &size)
!=ERROR_SUCCESS)
enabled[m] = 1; /* Default is enabled */
else
else
enabled[m] = (strncmp(buf, "1", 2) == 0);
RegCloseKey(skey);
}
@ -65,7 +65,7 @@ BOOL WINAPI ScreenSaverConfigureDialog(hDlg, message, wParam, lParam)
LONG res;
char key[1024];
switch(message)
switch(message)
{
case WM_INITDIALOG:
m=8;
@ -79,15 +79,15 @@ BOOL WINAPI ScreenSaverConfigureDialog(hDlg, message, wParam, lParam)
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
switch(LOWORD(wParam))
{
case MODE_LIST:
switch (HIWORD(wParam))
switch (HIWORD(wParam))
{
case LBN_SELCHANGE:
m = SendDlgItemMessage(hDlg, MODE_LIST, LB_GETCURSEL, 0, 0);
if(m >= 0 && m < numprocs-1) {
SetDlgItemText(hDlg, DESC_LABEL, LockProcs[m].desc);
if(m >= 0 && m < numprocs-1) {
SetDlgItemText(hDlg, DESC_LABEL, LockProcs[m].desc);
SetDlgItemText(hDlg, DELAY_TEXT,
_itoa(LockProcs[m].def_delay, tchBuffer, 10));
SetDlgItemText(hDlg, COUNT_TEXT,
@ -101,10 +101,10 @@ BOOL WINAPI ScreenSaverConfigureDialog(hDlg, message, wParam, lParam)
return TRUE;
break;
case LBN_DBLCLK:
m = SendDlgItemMessage(hDlg, MODE_LIST, LB_GETCURSEL, 0, 0);
m = SendDlgItemMessage(hDlg, MODE_LIST, LB_GETCURSEL, 0, 0);
if(m >= 0 && m < numprocs-1) {
enabled[m] = !enabled[m];
SendDlgItemMessage(hDlg, ENABLE_BUTTON, BM_SETCHECK,
(WPARAM)(enabled[m]?
BST_CHECKED:BST_UNCHECKED), 0);
@ -119,7 +119,7 @@ BOOL WINAPI ScreenSaverConfigureDialog(hDlg, message, wParam, lParam)
}
break;
case ENABLE_BUTTON:
switch (HIWORD(wParam))
switch (HIWORD(wParam))
{
case BN_CLICKED:
m = SendDlgItemMessage(hDlg, MODE_LIST, LB_GETCURSEL, 0, 0);
@ -195,8 +195,8 @@ LONG WINAPI ScreenSaverProc(HWND myhwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
{
// Stop the timer
if (uTimer)
KillTimer(hwnd, uTimer);
if (uTimer)
KillTimer(hwnd, uTimer);
xlockmore_destroy();
}
break;

View file

@ -16,7 +16,7 @@ FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Mode", MODE_BOX, 5, 10, 80, 105
LISTBOX MODE_LIST, 10, 20, 70, 100, WS_VSCROLL|LBS_USETABSTOPS
GROUPBOX "", DESC_LABEL, 90, 10, 80, 80
LTEXT "Delay", DELAY_LABEL, 100, 20, 20, 10
LTEXT "", DELAY_TEXT, 130, 20, 20, 10