tacme: add 32x32 boxcursor - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 43b0d532bd3c1e4fbd4385c6470db12dbf7a5ad8
 (DIR) parent fe92b4a0b1a8268238bce088cd081da9b802b465
 (HTM) Author: Russ Cox <rsc@swtch.com>
       Date:   Thu, 15 Nov 2018 20:52:18 -0500
       
       acme: add 32x32 boxcursor
       
       The only difference from the upscaled 16x16
       is a one-pixel adjustment in the offset position,
       but this at least exercises setcursor2.
       
       Diffstat:
         M src/cmd/acme/acme.c                 |      68 +++++++++++++++++++++++++++++++
         M src/cmd/acme/cols.c                 |       2 +-
         M src/cmd/acme/dat.h                  |       1 +
         M src/cmd/acme/rows.c                 |       2 +-
       
       4 files changed, 71 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
       t@@ -966,6 +966,74 @@ Cursor boxcursor = {
                 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x00, 0x00}
        };
        
       +Cursor2 boxcursor2 = {
       +        {-15, -15},
       +        {0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xC0, 0x03, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF, 
       +         0xFF, 0xFF, 0xFF, 0xFF},
       +        {0x00, 0x00, 0x00, 0x00, 
       +         0x00, 0x00, 0x00, 0x00, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0x00, 0x00, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x3F, 0xFF, 0xFF, 0xFC, 
       +         0x00, 0x00, 0x00, 0x00, 
       +         0x00, 0x00, 0x00, 0x00}
       +};
       +
        void
        iconinit(void)
        {
 (DIR) diff --git a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
       t@@ -477,7 +477,7 @@ coldragwin(Column *c, Window *w, int but)
                Column *nc;
        
                clearmouse();
       -        setcursor(mousectl, &boxcursor);
       +        setcursor2(mousectl, &boxcursor, &boxcursor2);
                b = mouse->buttons;
                op = mouse->xy;
                while(mouse->buttons == b)
 (DIR) diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
       t@@ -525,6 +525,7 @@ Image                *button;
        Image                *but2col;
        Image                *but3col;
        Cursor                boxcursor;
       +Cursor2                boxcursor2;
        Row                        row;
        int                        timerpid;
        Disk                        *disk;
 (DIR) diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
       t@@ -148,7 +148,7 @@ rowdragcol(Row *row, Column *c, int _0)
                USED(_0);
        
                clearmouse();
       -        setcursor(mousectl, &boxcursor);
       +        setcursor2(mousectl, &boxcursor, &boxcursor2);
                b = mouse->buttons;
                op = mouse->xy;
                while(mouse->buttons == b)