1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-05-05 07:44:20 +00:00

Change icon, cursor images and masks to const uint8_t (#239)

The predefined cursors (image and mask) are better represented
as arrays of const uint8_t rather than char.  Likewise for the
window icon.  Track this change in the functions that take the
image and mask as arguments, casting only when we get to the
X library functions that take char*.
This commit is contained in:
Nick Briggs
2021-01-19 10:16:08 -08:00
committed by GitHub
parent a42189fb8b
commit 26857f3131
5 changed files with 41 additions and 39 deletions

View File

@@ -74,7 +74,7 @@ void Init_XCursor() {
cursorlist = (struct MXCURSOR *)malloc(sizeof(struct MXCURSOR));
cursorlist->next = NULL;
for (i = 0; i < CURSORHEIGHT; i++) cursorlist->bitmap[i] = newbm[i];
set_Xcursor(currentdsp, (unsigned char *)newbm, 0, 0, &(cursorlist->Xid), 1);
set_Xcursor(currentdsp, (uint8_t *)newbm, 0, 0, &(cursorlist->Xid), 1);
DefineCursor(currentdsp->display_id, currentdsp->DisplayWindow, &(cursorlist->Xid));
} /* end Init_XCursor */
@@ -113,9 +113,9 @@ void Set_XCursor(int x, int y)
for (i = 0; i < CURSORHEIGHT; i++) clp->bitmap[i] = newbm[i];
#ifdef NEWXCURSOR
/* JDS 000521 Added "15-" to fix cursor troubles at window edge */
set_Xcursor(currentdsp, (unsigned char *)newbm, x, 15 - y, &(clp->Xid), 1);
set_Xcursor(currentdsp, (uint8_t *)newbm, x, 15 - y, &(clp->Xid), 1);
#else
set_Xcursor(currentdsp, (unsigned char *)newbm, 0, 0, &(clp->Xid), 1);
set_Xcursor(currentdsp, (uint8_t *)newbm, 0, 0, &(clp->Xid), 1);
#endif /* NEWXCURSOR */
clp->next = cursorlist;
cursorlist = clp;
@@ -191,7 +191,7 @@ void init_Xcursor(Display *display, Window window)
/* */
/************************************************************************/
void set_Xcursor(DspInterface dsp, unsigned char *bitmap, int hotspot_x, int hotspot_y, Cursor *return_cursor, int from_lisp)
void set_Xcursor(DspInterface dsp, const uint8_t *bitmap, int hotspot_x, int hotspot_y, Cursor *return_cursor, int from_lisp)
{
extern unsigned char reversedbits[];
unsigned char image[32];