From c5daa2f62f27e0eaf84368bed0d2d47f58687d7d Mon Sep 17 00:00:00 2001 From: Woody Hawthorne Date: Sun, 15 Nov 2015 19:35:13 +1100 Subject: [PATCH 1/2] Fix (potential) compiler warnings about redefining PI --- src/gmisc/gmisc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h index 8f858682..ebef8156 100644 --- a/src/gmisc/gmisc.h +++ b/src/gmisc/gmisc.h @@ -75,7 +75,9 @@ typedef int32_t fixed; /** * @brief The famous number pi */ +#ifndef PI #define PI 3.1415926535897932384626433832795028841971693993751 +#endif /** * @brief pi as a fixed point From 9ea93ff8e51dc7dd9ed12c6311886f5cce196157 Mon Sep 17 00:00:00 2001 From: Woody Hawthorne Date: Sun, 15 Nov 2015 19:45:43 +1100 Subject: [PATCH 2/2] Fix virtual keyboard --- src/gwin/gwin_class.h | 2 +- src/gwin/gwin_widget.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h index d9e6d97e..c5c83bb0 100644 --- a/src/gwin/gwin_class.h +++ b/src/gwin/gwin_class.h @@ -321,7 +321,7 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit); */ void _gwinSendEvent(GHandle gh, GEventType type); - #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || defined(__DOXYGEN__) + #if ((GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD) || defined(__DOXYGEN__) /** * @brief Move the focus off the current focus window. * diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index 1bf91b11..a97e170a 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -21,7 +21,7 @@ // Our listener for events for widgets static GListener gl; -#if GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD +#if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD // Our current focus window static GHandle _widgetInFocus; #endif @@ -366,7 +366,7 @@ void _gwidgetInit(void) geventRegisterCallback(&gl, gwidgetEvent, 0); geventAttachSource(&gl, ginputGetMouse(GMOUSE_ALL_INSTANCES), GLISTEN_MOUSEMETA|GLISTEN_MOUSEDOWNMOVES); - #if GINPUT_NEED_KEYBOARD + #if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD geventAttachSource(&gl, ginputGetKeyboard(GKEYBOARD_ALL_INSTANCES), GLISTEN_KEYUP); #endif }