From 0ab12e71030a1221e8cb79a7e9dbe362018e37de Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 18 Sep 2024 02:36:11 -0400 Subject: [PATCH] Use uint32_t for codepoint type in text events. --- include/widget/Widget.hpp | 2 +- include/widget/event.hpp | 2 +- src/widget/event.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/widget/Widget.hpp b/include/widget/Widget.hpp index 0e9ef0f2..c869a10f 100644 --- a/include/widget/Widget.hpp +++ b/include/widget/Widget.hpp @@ -299,7 +299,7 @@ struct Widget : WeakBase { /** An event prototype with a Unicode character. */ struct TextBaseEvent { /** Unicode code point of the character */ - int codepoint; + uint32_t codepoint; }; /** Occurs when a character is typed while the mouse is hovering a Widget. Recurses. diff --git a/include/widget/event.hpp b/include/widget/event.hpp index 43a037fc..9e82cdd2 100644 --- a/include/widget/event.hpp +++ b/include/widget/event.hpp @@ -148,7 +148,7 @@ struct EventState { bool handleHover(math::Vec pos, math::Vec mouseDelta); bool handleLeave(); bool handleScroll(math::Vec pos, math::Vec scrollDelta); - bool handleText(math::Vec pos, int codepoint); + bool handleText(math::Vec pos, uint32_t codepoint); bool handleKey(math::Vec pos, int key, int scancode, int action, int mods); bool handleDrop(math::Vec pos, const std::vector& paths); bool handleDirty(); diff --git a/src/widget/event.cpp b/src/widget/event.cpp index 7958cfe4..9592565d 100644 --- a/src/widget/event.cpp +++ b/src/widget/event.cpp @@ -268,7 +268,7 @@ bool EventState::handleDrop(math::Vec pos, const std::vector& paths return !!cPathDrop.target; } -bool EventState::handleText(math::Vec pos, int codepoint) { +bool EventState::handleText(math::Vec pos, uint32_t codepoint) { if (selectedWidget) { // Dispatch SelectTextEvent EventContext cSelectText;