From 4fbbab8b41f4775752587f18c7d1b32bbd947c27 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Mon, 28 Mar 2016 16:17:39 +0000 Subject: Rewrite Fl_compose.cxx under the driver model. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11454 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.H | 1 + src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/drivers/WinAPI') diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index c937c97da..049c516d4 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -45,6 +45,7 @@ public: virtual void warning(const char *format, va_list args); virtual void error(const char *format, va_list args); virtual void fatal(const char *format, va_list args); + virtual int compose(int &del); }; #endif // FL_WINAPI_SYSTEM_DRIVER_H diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 8ea6113a0..b05796eb5 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -19,6 +19,7 @@ #include "../../config_lib.h" #include "Fl_WinAPI_System_Driver.H" +#include #include #include @@ -51,6 +52,21 @@ void Fl_WinAPI_System_Driver::fatal(const char *format, va_list args) { ::exit(1); } +int Fl_WinAPI_System_Driver::compose(int &del) { + unsigned char ascii = (unsigned char)Fl::e_text[0]; + int condition = (Fl::e_state & (FL_ALT | FL_META)) && !(ascii & 128) ; + if (condition) { // this stuff is to be treated as a function key + del = 0; + return 0; + } + del = Fl::compose_state; + Fl::compose_state = 0; + // Only insert non-control characters: + if ( (!Fl::compose_state) && ! (ascii & ~31 && ascii!=127)) { + return 0; + } + return 1; +} // // End of "$Id$". -- cgit v1.2.3