diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-01-07 16:34:44 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-01-07 16:34:54 +0100 |
| commit | 5bab46940c9dc6ad272e4cbf7970a7261aaff210 (patch) | |
| tree | 1e47a2b99a54a1e479094be43207c25a7f61fdc6 /src/drivers/Quartz | |
| parent | 27c175dad8470229a512540edaae24787c65c3b7 (diff) | |
Re-organize cross-platform support for text input methods.
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms
(X11, Windows, macOS). This support has an interface with FLTK that is
common for X11 and Windows, via (undocumented) functions fl_set_spot(),
fl_set_status() and fl_reset_spot().
In contrast, and because it's been developed independently, the
interface between the macOS TIM and FLTK 1.3 is completely different :
static functions FL::insertion_point_location() and Fl::reset_marked_text().
The present change implements a single TIM/FLTK interface
used by all platforms based on functions fl_set_spot() and
fl_reset_spot().
The previous macOS-specific functions FL::insertion_point_location() and
Fl::reset_marked_text() are maintained only for compatibility with 1.3
and deprecated.
Diffstat (limited to 'src/drivers/Quartz')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H index f59a39d79..fcbbe810b 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H @@ -174,6 +174,8 @@ protected: virtual void restore_scale(float); virtual void antialias(int state); virtual int antialias(); + virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win); + virtual void reset_spot(); }; class Fl_Quartz_Printer_Graphics_Driver : public Fl_Quartz_Graphics_Driver { diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index c18f7c300..85872f9ed 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -17,7 +17,7 @@ #include <config.h> #include "Fl_Quartz_Graphics_Driver.H" #include "../Darwin/Fl_Darwin_System_Driver.H" -#include "../../Fl_Screen_Driver.H" +#include "../Cocoa/Fl_Cocoa_Screen_Driver.H" #include <FL/platform.H> #include <FL/fl_draw.H> #include <FL/Fl_Image_Surface.H> @@ -182,3 +182,11 @@ void Fl_Quartz_Graphics_Driver::restore_scale(float s) { CGContextScaleCTM(gc_, s, s); } } + +void Fl_Quartz_Graphics_Driver::set_spot(int /*font*/, int size, int X, int Y, int /*W*/, int /*H*/, Fl_Window* /*win*/) { + Fl_Cocoa_Screen_Driver::insertion_point_location(X, Y, size); +} + +void Fl_Quartz_Graphics_Driver::reset_spot() { + Fl_Cocoa_Screen_Driver::reset_marked_text(); +} |
