This commit is contained in:
Nishi 2026-04-24 01:43:38 +09:00
commit da20432c31
8 changed files with 149 additions and 1483 deletions

File diff suppressed because it is too large Load diff

View file

@ -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);

View file

@ -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;

View file

@ -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++) {

View file

@ -1,65 +1,50 @@
#include <Mw/Milsko.h>
/**
* 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 /* ..#............. */
}
};

View file

@ -1,55 +1,8 @@
#include <Mw/Milsko.h>
/**
* 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}};

View file

@ -1,65 +1,50 @@
#include <Mw/Milsko.h>
/**
* 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 /* ......##.. */
}
};

View file

@ -1,65 +1,50 @@
#include <Mw/Milsko.h>
/**
* 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 /* ####.#### */
}
};