head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.38 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.36 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.34 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.32 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.30 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.28 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.26 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.24 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.22 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.20 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.18 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.16 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.14 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.12 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.2.0.10 pkgsrc-2022Q3-base:1.2 pkgsrc-2022Q2:1.2.0.8 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.2.0.6 pkgsrc-2022Q1-base:1.2 pkgsrc-2021Q4:1.2.0.4 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.2 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.1.0.154 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.152 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.150 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.148 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.144 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.124 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.146 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.142 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.140 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.138 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.136 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.134 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.132 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.130 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.128 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.126 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.122 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.120 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.118 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.116 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.114 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.112 pkgsrc-2016Q1-base:1.1 pkgsrc-2015Q4:1.1.0.110 pkgsrc-2015Q4-base:1.1 pkgsrc-2015Q3:1.1.0.108 pkgsrc-2015Q3-base:1.1 pkgsrc-2015Q2:1.1.0.106 pkgsrc-2015Q2-base:1.1 pkgsrc-2015Q1:1.1.0.104 pkgsrc-2015Q1-base:1.1 pkgsrc-2014Q4:1.1.0.102 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.100 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.98 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.96 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.94 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.92 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.90 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.88 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.86 pkgsrc-2012Q4-base:1.1 pkgsrc-2012Q3:1.1.0.84 pkgsrc-2012Q3-base:1.1 pkgsrc-2012Q2:1.1.0.82 pkgsrc-2012Q2-base:1.1 pkgsrc-2012Q1:1.1.0.80 pkgsrc-2012Q1-base:1.1 pkgsrc-2011Q4:1.1.0.78 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.76 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.74 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.72 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.70 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.68 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.66 pkgsrc-2010Q2-base:1.1 pkgsrc-2010Q1:1.1.0.64 pkgsrc-2010Q1-base:1.1 pkgsrc-2009Q4:1.1.0.62 pkgsrc-2009Q4-base:1.1 pkgsrc-2009Q3:1.1.0.60 pkgsrc-2009Q3-base:1.1 pkgsrc-2009Q2:1.1.0.58 pkgsrc-2009Q2-base:1.1 pkgsrc-2009Q1:1.1.0.56 pkgsrc-2009Q1-base:1.1 pkgsrc-2008Q4:1.1.0.54 pkgsrc-2008Q4-base:1.1 pkgsrc-2008Q3:1.1.0.52 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.50 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.48 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.46 pkgsrc-2008Q1:1.1.0.44 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.42 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.40 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.38 pkgsrc-2007Q2-base:1.1 pkgsrc-2007Q1:1.1.0.36 pkgsrc-2007Q1-base:1.1 pkgsrc-2006Q4:1.1.0.34 pkgsrc-2006Q4-base:1.1 pkgsrc-2006Q3:1.1.0.32 pkgsrc-2006Q3-base:1.1 pkgsrc-2006Q2:1.1.0.30 pkgsrc-2006Q2-base:1.1 pkgsrc-2006Q1:1.1.0.28 pkgsrc-2006Q1-base:1.1 pkgsrc-2005Q4:1.1.0.26 pkgsrc-2005Q4-base:1.1 pkgsrc-2005Q3:1.1.0.24 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.22 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.20 pkgsrc-2005Q1-base:1.1 pkgsrc-2004Q4:1.1.0.18 pkgsrc-2004Q4-base:1.1 pkgsrc-2004Q3:1.1.0.16 pkgsrc-2004Q3-base:1.1 pkgsrc-2004Q2:1.1.0.14 pkgsrc-2004Q2-base:1.1 pkgsrc-2004Q1:1.1.0.12 pkgsrc-2004Q1-base:1.1 pkgsrc-2003Q4:1.1.0.10 pkgsrc-2003Q4-base:1.1 netbsd-1-6-1:1.1.0.6 netbsd-1-6-1-base:1.1 netbsd-1-6:1.1.0.8 netbsd-1-6-RELEASE-base:1.1 pkgviews:1.1.0.4 pkgviews-base:1.1 buildlink2:1.1.0.2 buildlink2-base:1.1 netbsd-1-5-PATCH003:1.1 netbsd-1-5-PATCH001:1.1; locks; strict; comment @# @; 1.2 date 2021.08.27.03.41.41; author ryoon; state Exp; branches; next 1.1; commitid wIjhdTQDrTwXNy6D; 1.1 date 2001.02.12.14.09.25; author wiz; state Exp; branches; next ; desc @@ 1.2 log @xcopilot: Workaround for NetBSD/amd64. Bump PKGREVISION * Add workaround for NetBSD/amd64. Not tested under other LP64PLATFORMS and OSes. * Include some header files to resolve implicit uses. * Fix some warinigs. @ text @$NetBSD: patch-ag,v 1.1 2001/02/12 14:09:25 wiz Exp $ --- display.c.orig 1998-08-25 13:56:02.000000000 +0000 +++ display.c @@@@ -272,8 +272,13 @@@@ static void xcpPutImage(int x, int y, in } static int xcpHandleExpose(XEvent *event) { - xcpPutImage(event->xexpose.x, event->xexpose.y, event->xexpose.width, - event->xexpose.height); + if (shared->LcdPower == lcdOff) { + XClearWindow (xcpDisplay, xcpLCDWindow); + XFlush(xcpDisplay); + } + else + xcpPutImage(event->xexpose.x, event->xexpose.y, event->xexpose.width, + event->xexpose.height); return event->xexpose.count; } @@@@ -360,15 +365,26 @@@@ static void xcpKeyEvent(int down, int ke typedef struct _Key { const char *name; XRectangle bounds; + KeySym key; } Key; -static Key keys[] = {{"power", {0, 281, 16, 22}}, - {"up", {100, 280, 25, 12}}, - {"down", {100, 302, 25, 12}}, - {"datebook", {24, 277, 28, 29}}, - {"phone", {63, 277, 28, 29}}, - {"todo", {134, 277, 28, 29}}, - {"memo", {173, 277, 28, 29}}}; +typedef struct _NonprintKey { + KeySym sym; + int code; +} NonprintKey; + +static Key keys[] = {{"power", {0, 281, 16, 22}, XK_Escape}, + {"up", {100, 280, 25, 12}, XK_Page_Up}, + {"down", {100, 302, 25, 12}, XK_Page_Down}, + {"datebook", {24, 277, 28, 29}, XK_F9}, + {"phone", {63, 277, 28, 29}, XK_F10}, + {"todo", {134, 277, 28, 29}, XK_F11}, + {"memo", {173, 277, 28, 29}, XK_F12}}; + +static NonprintKey nonprint_keys[] = {{XK_Left, 0x1c /* chrLeftArrow */}, + {XK_Right, 0x1d /* chrRightArrow */}, + {XK_Down, 0x103 /* vchrNextField */}, + {XK_Up, 0x10c /* vchrPrevField */}}; static void HandleKey(Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch) @@@@ -502,7 +518,7 @@@@ static void xcpKBtoASCII(shared_img *shp { static KeySym keysym; static XComposeStatus compose; - int count, bufsize, in; + int count, bufsize, in, i, code; char buffer[8]; bufsize = 8; @@@@ -511,16 +527,55 @@@@ static void xcpKBtoASCII(shared_img *shp bufsize, &keysym, &compose); + + for (i = 0; i < XtNumber(keys); i++) + if (keysym == keys[i].key) { + xcpKeyEvent(1, i); + return; + } + + if (count > 0) { + if (buffer[0] == '\r') + code = '\n'; + else + code = buffer[0]; + } + else { + for (i = 0; i < XtNumber(nonprint_keys); i++) + if (keysym == nonprint_keys[i].sym) { + count = 1; + code = nonprint_keys[i].code; + } + } + if (count > 0) { - if (buffer[0] == '\r') { - buffer[0] = '\n'; - } in = shptr->kbin; - shptr->kb[in] = buffer[0]; + shptr->kb[in] = code; shptr->kbin = (in + 1) & 7; } } +static void xcpKBKey(XEvent *event) +{ + static KeySym keysym; + static XComposeStatus compose; + int count, bufsize, in, i; + char buffer[8]; + + bufsize = 8; + count = XLookupString((XKeyEvent *) event, + buffer, + bufsize, + &keysym, + &compose); + + for (i = 0; i < XtNumber(keys); i++) + if (keysym == keys[i].key) { + xcpKeyEvent(0, i); + return; + } +} + static void HandleClientMessage(Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch) { @@@@ -542,6 +597,8 @@@@ static void HandleXEvents(Widget w, XtPo case KeyPress: xcpKBtoASCII(shptr, event); break; + case KeyRelease: + xcpKBKey(event); case ButtonPress: /* a mouse button was pressed */ if (event->xbutton.button == 3) do_menu(event->xbutton.x_root, event->xbutton.y_root); @@@@ -623,7 +680,7 @@@@ char *xcpInitialize(shared_img *shptr, X XtNborder, BlackPixel(xcpDisplay, xcpScreenNum), NULL); XtAddEventHandler(topWidget, ButtonPressMask | KeyPressMask | - OwnerGrabButtonMask, False, HandleXEvents, + KeyReleaseMask | OwnerGrabButtonMask, False, HandleXEvents, (XtPointer)shptr); /* @@@@ -936,8 +993,14 @@@@ static void xcpUpdateLCD(char *sbuf, con #ifdef WORDS_BIGENDIAN #define GOOD_ENDIAN(x) (x) #else +# if __INTPTR_WIDTH__ == 32 /* Wonk: sizeof(unsigned char *) must be == sizeof(uint32) - Ian */ -#define GOOD_ENDIAN(x) ((unsigned char *)(((uint32)(x))^1UL)) +# define GOOD_ENDIAN(x) ((unsigned char *)(((uint32)(x))^1UL)) +# elif __INTPTR_WIDTH__ == 64 +# define GOOD_ENDIAN(x) ((unsigned char *)(((__uint64_t)(x))^1UL)) +# else +# error This architecture is not supported. +# endif #endif #define PUTPIXEL(type, dstptr, x) { \ @ 1.1 log @Add three patches supplied by Dieter Baron : - When pilot is off, don't redraw contents of screen, clear it - bind hardware buttons to keys (F9-F12 Applications, pgup/pgdown, ESC (power)) - make cursor keys work (left/right, next/previous field) XXX: homepage (== main download site) doesn't seem to exist any more. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- display.c.orig Tue Aug 25 15:56:02 1998 +++ display.c Tue Feb 6 15:02:19 2001 @@@@ -272,8 +272,13 @@@@ d21 1 a21 1 @@@@ -360,15 +365,26 @@@@ d55 1 a55 1 @@@@ -502,7 +518,7 @@@@ d64 1 a64 1 @@@@ -511,16 +527,55 @@@@ d124 1 a124 1 @@@@ -542,6 +597,8 @@@@ d133 1 a133 1 @@@@ -623,7 +680,7 @@@@ d142 16 @