diff options
| author | Manolo Gouy <Manolo> | 2016-03-28 16:17:39 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-28 16:17:39 +0000 |
| commit | 4fbbab8b41f4775752587f18c7d1b32bbd947c27 (patch) | |
| tree | 2b00fbd77ab8778f586bbe861cf715ffedee608f /src/drivers/Posix/Fl_Posix_System_Driver.cxx | |
| parent | 28d1a2d6848d5abe555fd0ddae8b57cec6f900ca (diff) | |
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
Diffstat (limited to 'src/drivers/Posix/Fl_Posix_System_Driver.cxx')
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 16c71f56e..9cdf8c2dd 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -20,6 +20,8 @@ #include "Fl_Posix_System_Driver.H" #include <FL/Fl.H> +extern XIC fl_xim_ic; // in Fl_x.cxx + // Pointers you can use to change FLTK to a foreign language. // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx @@ -42,6 +44,24 @@ int Fl_Posix_System_Driver::XParseGeometry(const char* string, int* x, int* y, return ::XParseGeometry(string, x, y, width, height); } +int Fl_Posix_System_Driver::compose(int& del) { + int condition; + unsigned char ascii = (unsigned char)Fl::e_text[0]; + condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) ; + if (condition) { del = 0; return 0;} // this stuff is to be treated as a function key + 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; +} + +void Fl_Posix_System_Driver::compose_reset() +{ + Fl::compose_state = 0; + if (fl_xim_ic) XmbResetIC(fl_xim_ic); +} + // // End of "$Id$". // |
