diff --git a/resource/font/deccurs.bdf b/resource/font/deccurs.bdf deleted file mode 100644 index c3502d4..0000000 --- a/resource/font/deccurs.bdf +++ /dev/null @@ -1,1256 +0,0 @@ -STARTFONT 2.1 -FONT DECW$CURSOR -SIZE 31 78 78 -FONTBOUNDINGBOX 31 31 -15 -16 -STARTPROPERTIES 5 -FOUNDRY "Digital Equipment Corporation" -NOTICE "These images are owned by Digital Equipment Corporation" -FONT_ASCENT 16 -FONT_DESCENT 16 -COPYRIGHT "Copyright (c) Digital Equipment Corporation,1988. All Rights Reserved." -COMMENT -COMMENT Permission to use, copy, modify, and distribute this software and -COMMENT its documentation for any purpose and without fee is hereby granted, -COMMENT provided that the above copyright notices appear in all copies and -COMMENT that both those copyright notices and this permission notice appear -COMMENT in supporting documentation, and that the name -COMMENT Digital Equipment Corporation not be used in advertising or -COMMENT publicity pertaining to distribution of the software without -COMMENT specific, written prior permission. Digital -COMMENT Equipment Corporation makes no representations about the suitability -COMMENT of this software for any purpose. It is provided "as is" without -COMMENT express or implied warranty. -COMMENT -COMMENT DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL -COMMENT WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED -COMMENT WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -COMMENT DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, -COMMENT INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER -COMMENT RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -COMMENT CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -COMMENT CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -COMMENT -ENDPROPERTIES -CHARS 54 -COMMENT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -STARTCHAR decw$c_select_cursor -ENCODING -1 0 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -15 -BITMAP -0000 -6000 -7800 -3E00 -3F80 -1FE0 -1FF8 -0F80 -0FC0 -06E0 -0670 -0238 -021c -000e -0004 -0000 -ENDCHAR -STARTCHAR decw$c_select_cursor_mask -ENCODING -1 1 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -15 -BITMAP -E000 -f800 -fe00 -7f80 -7fe0 -3ff8 -3ffc -1ff8 -1fe0 -0ff0 -0ff8 -077c -073e -021f -000e -0004 -ENDCHAR -STARTCHAR decw$c_help_cursor -ENCODING -1 2 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -14 -BITMAP -0000 -6000 -70e0 -3bf0 -1ff8 -0ff8 -07fc -0bfc -07fc -03fb -00f6 -002f -001e -000c -0000 -0000 -ENDCHAR -STARTCHAR decw$c_help_cursor_mask -ENCODING -1 3 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -14 -BITMAP -e000 -f0e0 -fbf0 -7ff8 -3ffc -1ffc -1ffe -1ffe -0fff -07ff -03ff -00ff -003e -001c -0000 -0000 -ENDCHAR -STARTCHAR decw$c_wait_cursor -ENCODING -1 4 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -14 -BITMAP -2000 -5548 -a814 -500a -23c4 -4760 -0f72 -4f70 -0c72 -4ff0 -07e2 -23c4 -100a -0815 -02aa -0004 -ENDCHAR -STARTCHAR decw$c_wait_cursor_mask -ENCODING -1 5 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -14 -BITMAP -3000 -7d48 -fffc -fffe -7ffc -7ffc -3ffe -7ffc -3ffe -7ffc -3ffe -3ffe -1fff -0fff -02be -000c -ENDCHAR -STARTCHAR decw$c_inactive_cursor -ENCODING -1 6 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -8 -BITMAP -07c0 -1830 -2008 -4004 -4004 -8002 -9ff2 -9ff2 -9ff2 -8002 -4004 -4004 -2008 -1830 -07c0 -0000 -ENDCHAR -STARTCHAR decw$c_inactive_cursor_mask -ENCODING -1 7 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -8 -BITMAP -07c0 -1ff0 -3ff8 -7ffc -7ffc -fffe -fffe -fffe -fffe -fffe -7ffc -7ffc -3ff8 -1ff0 -07c0 -0000 -ENDCHAR -STARTCHAR decw$c_resize_cursor -ENCODING -1 8 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -6 -9 -BITMAP -0000 -78f0 -4010 -5dd0 -5050 -1040 -0000 -1040 -5050 -5dd0 -4010 -78f0 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_resize_cursor_mask -ENCODING -1 9 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -6 -9 -BITMAP -f078 -f8f8 -f8f8 -fdf8 -7ff0 -18c0 -0880 -18c0 -7ff0 -fdf8 -f8f8 -f8f8 -f078 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_vpane_cursor -ENCODING -1 10 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -6 -8 -BITMAP -0200 -0500 -0880 -1240 -2720 -4f90 -8008 -7ff0 -8008 -4f90 -2720 -1240 -0880 -0500 -0200 -0000 -ENDCHAR -STARTCHAR decw$c_vpane_cursor_mask -ENCODING -1 11 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -6 -8 -BITMAP -0200 -0700 -0f80 -1fc0 -3fe0 -7ff0 -fff8 -7ff0 -fff8 -7ff0 -3fe0 -1fc0 -0f80 -0700 -0200 -0000 -ENDCHAR -STARTCHAR decw$c_hpane_cursor -ENCODING -1 12 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -7 -9 -BITMAP -0280 -0540 -0920 -1110 -2548 -4d64 -9d72 -4d64 -2548 -1110 -0920 -0540 -0280 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_hpane_cursor_mask -ENCODING -1 13 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -7 -9 -BITMAP -0280 -07c0 -0fe0 -1ff0 -3ff8 -7ffc -fffe -7ffc -3ff8 -1ff0 -0fe0 -07c0 -0280 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_text_insertion_cursor -ENCODING -1 14 -SWIDTH 0 0 -DWIDTH 7 0 -BBX 7 16 -3 -7 -BITMAP -0000 -8800 -5000 -2000 -2000 -2000 -2000 -2000 -2000 -2000 -2000 -2000 -2000 -5000 -8800 -0000 -ENDCHAR -STARTCHAR decw$c_text_insertion_cursor_mask -ENCODING -1 15 -SWIDTH 0 0 -DWIDTH 7 0 -BBX 7 16 -3 -7 -BITMAP -0000 -cc00 -7800 -3000 -3000 -3000 -3000 -3000 -3000 -3000 -3000 -3000 -3000 -7800 -cc00 -0000 -ENDCHAR -STARTCHAR decw$c_bitmap_text_insertion_cursor -ENCODING -1 16 -SWIDTH 0 0 -DWIDTH 8 0 -BBX 8 16 -3 -5 -BITMAP -0000 -4400 -2800 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -aa00 -1000 -1000 -2800 -4400 -0000 -ENDCHAR -STARTCHAR decw$c_bitmap_text_insertion_cursor_mask -ENCODING -1 17 -SWIDTH 0 0 -DWIDTH 8 0 -BBX 8 16 -3 -5 -BITMAP -0000 -6600 -3c00 -1800 -1800 -1800 -1800 -1800 -1800 -1800 -ff00 -1800 -1800 -3c00 -6600 -0000 -ENDCHAR -STARTCHAR decw$c_crosshair_cursor -ENCODING -1 18 -SWIDTH 0 0 -DWIDTH 13 0 -BBX 13 13 -6 -6 -BITMAP -0700 -0500 -0500 -0500 -0500 -fdf8 -8008 -fdf8 -0500 -0500 -0500 -0500 -0700 -ENDCHAR -STARTCHAR decw$c_crosshair_cursor_mask -ENCODING -1 19 -SWIDTH 0 0 -DWIDTH 13 0 -BBX 13 13 -6 -6 -BITMAP -0700 -0700 -0700 -0700 -0700 -fff8 -fff8 -fff8 -0700 -0700 -0700 -0700 -0700 -ENDCHAR -STARTCHAR decw$c_draw_cursor -ENCODING -1 20 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 15 -8 -7 -BITMAP -0380 -0280 -06c0 -0820 -16d0 -2ee8 -ec6e -8002 -ec6e -2ee8 -16d0 -0820 -06c0 -0280 -0380 -ENDCHAR -STARTCHAR decw$c_draw_cursor_mask -ENCODING -1 21 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 15 -8 -7 -BITMAP -0380 -0380 -07c0 -0fe0 -1ff0 -3ff8 -fc7e -fc7e -fc7e -3ff8 -1ff0 -0fe0 -07c0 -0380 -0380 -ENDCHAR -STARTCHAR decw$c_rpencil_cursor -ENCODING -1 22 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -1 -2 -BITMAP -0000 -001C -001C -002C -00D0 -01E0 -03e0 -07c0 -0f80 -1f00 -1e00 -2c00 -3000 -4000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_rpencil_cursor_mask -ENCODING -1 23 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -1 -2 -BITMAP -001c -003e -007e -00fe -01fc -03f8 -07f0 -0fe0 -1fc0 -3f80 -3f00 -7e00 -7c00 -f000 -c000 -0000 -ENDCHAR -STARTCHAR decw$c_centercursor -ENCODING -1 24 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -5 -15 -BITMAP -0000 -0400 -0400 -0e00 -0e00 -1f00 -1f00 -3f80 -3f80 -64c0 -4440 -0400 -0400 -0400 -0400 -0000 -ENDCHAR -STARTCHAR decw$c_centercursor_mask -ENCODING -1 25 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -5 -15 -BITMAP -0400 -0e00 -0e00 -1f00 -1f00 -3f80 -3f80 -7fc0 -7fc0 -ffe0 -eee0 -ce60 -0e00 -0e00 -0e00 -0e00 -ENDCHAR -STARTCHAR decw$c_rightselect_cursor -ENCODING -1 26 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -15 -BITMAP -0000 -0006 -001e -007c -01fc -07f8 -1ff8 -01f0 -03f0 -0760 -0e60 -1c40 -3840 -7000 -2000 -0000 -ENDCHAR -STARTCHAR decw$c_rightselect_cursor_mask -ENCODING -1 27 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -15 -BITMAP -0007 -001f -007f -01fe -07fe -1ffc -3ffc -1ff8 -07f8 -0ff0 -1ff0 -3ee0 -7ce0 -f840 -7000 -2000 -ENDCHAR -STARTCHAR decw$c_wselect_cursor -ENCODING -1 28 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -10 -BITMAP -0000 -0060 -01c0 -0780 -1f80 -7ffe -1f80 -0780 -01c0 -0060 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_wselect_cursor_mask -ENCODING -1 29 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -10 -BITMAP -0070 -01f0 -07e0 -1fc0 -7fff -ffff -7fff -1fc0 -07e0 -01f0 -0070 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_eselect_cursor -ENCODING -1 30 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -10 -BITMAP -0000 -0600 -0380 -01e0 -01f8 -7ffe -01f8 -01e0 -0380 -0600 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_eselect_cursor_mask -ENCODING -1 31 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -10 -BITMAP -0e00 -0f80 -07e0 -03f8 -fffe -ffff -fffe -03f8 -07e0 -0f80 -0e00 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_x_cursor -ENCODING -1 32 -SWIDTH 0 0 -DWIDTH 13 0 -BBX 13 12 -6 -6 -BITMAP -e038 -9048 -4890 -2520 -1240 -0880 -0880 -1240 -2520 -4890 -9048 -e038 -ENDCHAR -STARTCHAR decw$c_x_cursor_mask -ENCODING -1 33 -SWIDTH 0 0 -DWIDTH 13 0 -BBX 13 12 -6 -6 -BITMAP -e038 -f078 -78f0 -3de0 -1fc0 -0f80 -0f80 -1fc0 -3de0 -78f0 -f078 -e038 -ENDCHAR -STARTCHAR decw$c_circle_cursor -ENCODING -1 34 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 13 -7 -7 -BITMAP -0700 -18c0 -2020 -4010 -4010 -8008 -8008 -8008 -4010 -4010 -2020 -18c0 -0700 -ENDCHAR -STARTCHAR decw$c_circle_cursor_mask -ENCODING -1 35 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 13 -7 -7 -BITMAP -0700 -1fc0 -38e0 -6030 -6030 -c018 -c018 -c018 -6030 -6030 -38e0 -1fc0 -0700 -ENDCHAR -STARTCHAR decw$c_mouse_cursor -ENCODING -1 36 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -7 -BITMAP -0000 -0000 -07c0 -1450 -2448 -2448 -4444 -7ffc -7ffc -7ffc -7ffc -3ff8 -3ff8 -1ff0 -07c0 -0000 -ENDCHAR -STARTCHAR decw$c_mouse_cursor_mask -ENCODING -1 37 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -7 -BITMAP -0100 -07c0 -1ff0 -3ff8 -7ffc -7ffc -fffe -fffe -fffe -fffe -fffe -7ffc -7ffc -3ff8 -1ff0 -07c0 -ENDCHAR -STARTCHAR decw$c_lpencil_cursor -ENCODING -1 38 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -1 -2 -BITMAP -0000 -3800 -3800 -3400 -0b00 -0780 -07c0 -03e0 -01f0 -00f8 -0078 -0034 -000c -0002 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_lpencil_cursor_mask -ENCODING -1 39 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -1 -2 -BITMAP -3800 -7c00 -7e00 -7f00 -3f80 -1fc0 -0fe0 -07f0 -03f8 -01fc -00fc -007e -003e -000f -0003 -0000 -ENDCHAR -STARTCHAR decw$c_leftgrab_cursor -ENCODING -1 40 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -15 -BITMAP -0000 -6c00 -3680 -5b40 -6da0 -36f0 -1bf8 -0ff8 -07f8 -3bf8 -0ff6 -07ee -005c -003c -0018 -0000 -ENDCHAR -STARTCHAR decw$c_leftgrab_cursor_mask -ENCODING -1 41 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -15 -BITMAP -6c00 -ff80 -7fc0 -ffe0 -fff0 -7ff8 -3ffc -1ffc -3ffc -7ffe -7fff -0ffe -07fe -007c -0038 -0010 -ENDCHAR -STARTCHAR decw$c_grabhand_cursor -ENCODING -1 42 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -15 -BITMAP -0000 -0100 -0540 -0540 -0540 -0550 -6550 -37d0 -17f0 -1ff0 -1ff0 -0ff0 -07e0 -07e0 -0000 -07e0 -ENDCHAR -STARTCHAR decw$c_grabhand_cursor_mask -ENCODING -1 43 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -8 -15 -BITMAP -0100 -07c0 -0fe0 -0fe0 -0ff0 -6ff8 -fff8 -7ff8 -3ff8 -3ff8 -3ff8 -1ff8 -0ff0 -0ff0 -0ff0 -0ff0 -ENDCHAR -STARTCHAR decw$c_rightgrab_cursor -ENCODING -1 44 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -15 -BITMAP -0000 -0036 -016c -02da -05b6 -0f6c -1fd8 -1ff0 -1fe0 -1fdc -6ff0 -77e0 -3a00 -3c00 -1800 -0000 -ENDCHAR -STARTCHAR decw$c_rightgrab_cursor_mask -ENCODING -1 45 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -15 -BITMAP -0036 -01ff -03fe -07ff -0fff -1ffe -3ffc -3ff8 -3ffc -7ffe -fffe -7ff0 -7fe0 -3e00 -1c00 -0800 -ENDCHAR -STARTCHAR decw$c_leftpointing_cursor -ENCODING -1 46 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -13 -BITMAP -0000 -00e0 -7ff0 -01fb -07fb -03fb -03fa -01f3 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_leftpointing_cursor_mask -ENCODING -1 47 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 0 -13 -BITMAP -03e0 -7ff0 -ffff -7fff -0fff -0fff -07ff -07ff -03f7 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_uppointing_cursor -ENCODING -1 48 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -15 -BITMAP -0000 -2000 -2000 -2000 -2000 -2800 -3e00 -3f00 -7f00 -7f00 -7f00 -3f00 -1e00 -0000 -1f00 -1d00 -ENDCHAR -STARTCHAR decw$c_uppointing_cursor_mask -ENCODING -1 49 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -2 -15 -BITMAP -2000 -7000 -7000 -7000 -7c00 -7f00 -ff80 -ff80 -ff80 -ff80 -ff80 -7f80 -3f00 -3f80 -3f80 -3f80 -ENDCHAR -STARTCHAR decw$c_rightpointing_cursor -ENCODING -1 50 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -13 -BITMAP -0000 -0700 -0ffe -df80 -dfe0 -dfc0 -5fc0 -cf80 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_rightpointing_cursor_mask -ENCODING -1 51 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -15 -13 -BITMAP -07c0 -0ffe -ffff -fffe -fff0 -fff0 -ffe0 -ffe0 -efc0 -0000 -0000 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_check_cursor -ENCODING -1 52 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -5 -6 -BITMAP -000e -0012 -0024 -0048 -e090 -9120 -4a40 -2480 -1100 -0a00 -0400 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -STARTCHAR decw$c_check_cursor_mask -ENCODING -1 53 -SWIDTH 0 0 -DWIDTH 16 0 -BBX 16 16 -5 -6 -BITMAP -000e -001e -003c -0078 -e0f0 -f1e0 -7bc0 -3f80 -1f00 -0e00 -0400 -0000 -0000 -0000 -0000 -0000 -ENDCHAR -ENDFONT diff --git a/src/backend/gdi.c b/src/backend/gdi.c index b7bebe0..bbeb8dc 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -605,6 +605,8 @@ HCURSOR MwLLGDICreateCursor(MwCursor* image, MwCursor* mask) { ys = mask->height + mask->y; ys = image->height + image->y - ys; + if(ys < 0) ys = -ys; + memset(dmask, 0xff, (MwCursorDataHeight / 8) * MwCursorDataHeight); memset(dimage, 0, (MwCursorDataHeight / 8) * MwCursorDataHeight); diff --git a/src/backend/wayland.c b/src/backend/wayland.c index f677762..b53011c 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -1754,8 +1754,16 @@ static void clip(MwLL handle) { my = MIN(my, y + ws[i]->wayland.wh); } + cx = cy = 50; + + if(mx < cx) mx = cx; + if(my < cy) my = cy; + arrfree(ws); + if(mx < cx) mx = cx; + if(my < cy) my = cy; + handle->wayland.clipping_rect.x = cx - x; handle->wayland.clipping_rect.y = cy - y; handle->wayland.clipping_rect.width = mx - cx; @@ -2432,17 +2440,19 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) { buffer_destroy(&handle->wayland.cursor); wl_surface_destroy(handle->wayland.cursor.surface); } - buffer_setup(&handle->wayland.cursor, image->width, image->height); + buffer_setup(&handle->wayland.cursor, mask->width, mask->height); memset(handle->wayland.cursor.buf_back, 0, handle->wayland.cursor.buf_size); xs = -mask->x + image->x; ys = mask->height + mask->y; ys = image->height + image->y - ys; + if(ys < 0) ys = -ys; + for(y = 0; y < mask->height; y++) { unsigned int d = mask->data[y]; for(x = mask->width - 1; x >= 0; x--) { - int idx = ((y * image->width) + x) * 4; + int idx = ((y * mask->width) + x) * 4; if(d & 1) { handle->wayland.cursor.buf_back[idx + 3] = 255; @@ -2454,7 +2464,7 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) { unsigned int d = image->data[y]; for(x = image->width - 1; x >= 0; x--) { int px = 0; - int idx = (((y + ys) * image->width) + (x + xs)) * 4; + int idx = (((y + ys) * mask->width) + (x + xs)) * 4; if(d & 1) { px = 255; diff --git a/src/backend/x11.c b/src/backend/x11.c index 8d93e6a..67489cd 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -1124,6 +1124,8 @@ Cursor MwLLX11CreateCursor(Display* display, MwCursor* image, MwCursor* mask) { ys = mask->height + mask->y; ys = image->height + image->y - ys; + if(ys < 0) ys = -ys; + memset(cimage->data, 0, cimage->bytes_per_line * cimage->height); memset(cmask->data, 0, cmask->bytes_per_line * cmask->height); for(y = 0; y < mask->height; y++) { diff --git a/src/cursor/arrow.c b/src/cursor/arrow.c index ca53c5e..fab8af1 100644 --- a/src/cursor/arrow.c +++ b/src/cursor/arrow.c @@ -1,65 +1,50 @@ #include /** + * Created by bitmaptobdf + * * Copyright notice: - * Copyright (c) Digital Equipment Corporation,1988. All Rights Reserved. - */ -/** - * 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 notices appear in all copies and - * that both those copyright notices and this permission notice appear - * in supporting documentation, and that the name - * Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. Digital - * Equipment Corporation makes no representations about the suitability - * of this software for any purpose. It is provided "as is" without - * express or implied warranty. - * DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * These ""glyphs"" are unencumbered */ MwCursor MwCursorArrow = { - 16, 16, -15, -15, { - 0, /* ................ */ - 6, /* .............##. */ - 30, /* ...........####. */ - 124, /* .........#####.. */ - 508, /* .......#######.. */ - 2040, /* .....########... */ - 8184, /* ...##########... */ - 496, /* .......#####.... */ - 1008, /* ......######.... */ - 1888, /* .....###.##..... */ - 3680, /* ....###..##..... */ - 7232, /* ...###...#...... */ - 14400, /* ..###....#...... */ - 28672, /* .###............ */ - 8192, /* ..#............. */ - 0 /* ................ */ - }}; + 14, 14, -13, -14, + { + 3, /* ............## */ + 15, /* ..........#### */ + 62, /* ........#####. */ + 254, /* ......#######. */ + 1020, /* ....########.. */ + 4092, /* ..##########.. */ + 248, /* ......#####... */ + 504, /* .....######... */ + 944, /* ....###.##.... */ + 1840, /* ...###..##.... */ + 3616, /* ..###...#..... */ + 7200, /* .###....#..... */ + 14336, /* ###........... */ + 4096, /* .#............ */ + 0, + 0 + } +}; MwCursor MwCursorArrowMask = { - 16, 16, -15, -15, { - 7, /* .............### */ - 31, /* ...........##### */ - 127, /* .........####### */ - 510, /* .......########. */ - 2046, /* .....##########. */ - 8188, /* ...###########.. */ - 16380, /* ..############.. */ - 8184, /* ...##########... */ - 2040, /* .....########... */ - 4080, /* ....########.... */ - 8176, /* ...#########.... */ - 16096, /* ..#####.###..... */ - 31968, /* .#####..###..... */ - 63552, /* #####....#...... */ - 28672, /* .###............ */ - 8192 /* ..#............. */ - }}; + 16, 16, -14, -15, + { + 7, /* .............### */ + 31, /* ...........##### */ + 127, /* .........####### */ + 510, /* .......########. */ + 2046, /* .....##########. */ + 8188, /* ...###########.. */ + 16380, /* ..############.. */ + 16376, /* ..###########... */ + 2040, /* .....########... */ + 4080, /* ....########.... */ + 8176, /* ...#########.... */ + 16096, /* ..#####.###..... */ + 31968, /* .#####..###..... */ + 63552, /* #####....#...... */ + 28672, /* .###............ */ + 8192 /* ..#............. */ + } +}; diff --git a/src/cursor/cross.c b/src/cursor/cross.c index 9465510..8c53739 100644 --- a/src/cursor/cross.c +++ b/src/cursor/cross.c @@ -1,55 +1,8 @@ #include /** + * Created by bitmaptobdf + * * Copyright notice: - * Copyright (c) Digital Equipment Corporation,1988. All Rights Reserved. + * These ""glyphs"" are unencumbered */ -/** - * 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 notices appear in all copies and - * that both those copyright notices and this permission notice appear - * in supporting documentation, and that the name - * Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. Digital - * Equipment Corporation makes no representations about the suitability - * of this software for any purpose. It is provided "as is" without - * express or implied warranty. - * DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -MwCursor MwCursorCross = { - 13, 12, -6, -6, {7175, /* ###.......### */ - 4617, /* #..#.....#..# */ - 2322, /* .#..#...#..#. */ - 1188, /* ..#..#.#..#.. */ - 584, /* ...#..#..#... */ - 272, /* ....#...#.... */ - 272, /* ....#...#.... */ - 584, /* ...#..#..#... */ - 1188, /* ..#..#.#..#.. */ - 2322, /* .#..#...#..#. */ - 4617, /* #..#.....#..# */ - 7175, /* ###.......### */ - 0, 0, 0, 0}}; -MwCursor MwCursorCrossMask = { - 13, 12, -6, -6, {7175, /* ###.......### */ - 7695, /* ####.....#### */ - 3870, /* .####...####. */ - 1980, /* ..####.####.. */ - 1016, /* ...#######... */ - 496, /* ....#####.... */ - 496, /* ....#####.... */ - 1016, /* ...#######... */ - 1980, /* ..####.####.. */ - 3870, /* .####...####. */ - 7695, /* ####.....#### */ - 7175, /* ###.......### */ - 0, 0, 0, 0}}; diff --git a/src/cursor/default.c b/src/cursor/default.c index 1116d90..9f1f146 100644 --- a/src/cursor/default.c +++ b/src/cursor/default.c @@ -1,65 +1,50 @@ #include /** + * Created by bitmaptobdf + * * Copyright notice: - * Copyright (c) Digital Equipment Corporation,1988. All Rights Reserved. - */ -/** - * 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 notices appear in all copies and - * that both those copyright notices and this permission notice appear - * in supporting documentation, and that the name - * Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. Digital - * Equipment Corporation makes no representations about the suitability - * of this software for any purpose. It is provided "as is" without - * express or implied warranty. - * DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * These ""glyphs"" are unencumbered */ MwCursor MwCursorDefault = { - 16, 16, 0, -15, { - 0, /* ................ */ - 24576, /* .##............. */ - 30720, /* .####........... */ - 15872, /* ..#####......... */ - 16256, /* ..#######....... */ - 8160, /* ...########..... */ - 8184, /* ...##########... */ - 3968, /* ....#####....... */ - 4032, /* ....######...... */ - 1760, /* .....##.###..... */ - 1648, /* .....##..###.... */ - 568, /* ......#...###... */ - 540, /* ......#....###.. */ - 14, /* ............###. */ - 4, /* .............#.. */ - 0 /* ................ */ - }}; + 8, 14, 0, -14, + { + 128, /* #....... */ + 192, /* ##...... */ + 224, /* ###..... */ + 240, /* ####.... */ + 248, /* #####... */ + 252, /* ######.. */ + 254, /* #######. */ + 255, /* ######## */ + 248, /* #####... */ + 216, /* ##.##... */ + 140, /* #...##.. */ + 12, /* ....##.. */ + 6, /* .....##. */ + 6, /* .....##. */ + 0, + 0 + } +}; MwCursor MwCursorDefaultMask = { - 16, 16, 0, -15, { - 57344, /* ###............. */ - 63488, /* #####........... */ - 65024, /* #######......... */ - 32640, /* .########....... */ - 32736, /* .##########..... */ - 16376, /* ..###########... */ - 16380, /* ..############.. */ - 8184, /* ...##########... */ - 8160, /* ...########..... */ - 4080, /* ....########.... */ - 4088, /* ....#########... */ - 1916, /* .....###.#####.. */ - 1854, /* .....###..#####. */ - 543, /* ......#....##### */ - 14, /* ............###. */ - 4 /* .............#.. */ - }}; + 10, 16, -1, -15, + { + 768, /* ##........ */ + 896, /* ###....... */ + 960, /* ####...... */ + 992, /* #####..... */ + 1008, /* ######.... */ + 1016, /* #######... */ + 1020, /* ########.. */ + 1022, /* #########. */ + 1023, /* ########## */ + 1023, /* ########## */ + 1016, /* #######... */ + 956, /* ###.####.. */ + 828, /* ##..####.. */ + 30, /* .....####. */ + 30, /* .....####. */ + 12 /* ......##.. */ + } +}; diff --git a/src/cursor/text.c b/src/cursor/text.c index 4f0ea94..fa2c372 100644 --- a/src/cursor/text.c +++ b/src/cursor/text.c @@ -1,65 +1,50 @@ #include /** + * Created by bitmaptobdf + * * Copyright notice: - * Copyright (c) Digital Equipment Corporation,1988. All Rights Reserved. - */ -/** - * 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 notices appear in all copies and - * that both those copyright notices and this permission notice appear - * in supporting documentation, and that the name - * Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. Digital - * Equipment Corporation makes no representations about the suitability - * of this software for any purpose. It is provided "as is" without - * express or implied warranty. - * DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * These ""glyphs"" are unencumbered */ MwCursor MwCursorText = { - 7, 16, -3, -7, { - 0, /* ....... */ - 68, /* #...#.. */ - 40, /* .#.#... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 16, /* ..#.... */ - 40, /* .#.#... */ - 68, /* #...#.. */ - 0 /* ....... */ - }}; + 7, 14, -3, -7, + { + 119, /* ###.### */ + 28, /* ..###.. */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 8, /* ...#... */ + 28, /* ..###.. */ + 119, /* ###.### */ + 0, + 0 + } +}; MwCursor MwCursorTextMask = { - 7, 16, -3, -7, { - 0, /* ....... */ - 102, /* ##..##. */ - 60, /* .####.. */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 24, /* ..##... */ - 60, /* .####.. */ - 102, /* ##..##. */ - 0 /* ....... */ - }}; + 9, 16, -4, -8, + { + 495, /* ####.#### */ + 511, /* ######### */ + 511, /* ######### */ + 124, /* ..#####.. */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 56, /* ...###... */ + 124, /* ..#####.. */ + 511, /* ######### */ + 511, /* ######### */ + 495 /* ####.#### */ + } +};