From 27c175dad8470229a512540edaae24787c65c3b7 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 7 Jan 2022 07:50:23 +0100 Subject: Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. --- FL/Fl_Graphics_Driver.H | 2 ++ src/Fl_Graphics_Driver.cxx | 2 ++ src/Fl_cocoa.mm | 5 ----- src/Fl_win32.cxx | 2 -- src/Fl_x.cxx | 2 +- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 1 + src/fl_font.cxx | 5 +++++ 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 480b3c995..fe1e8d029 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -356,8 +356,10 @@ public: virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s); // default implementation may be enough virtual float scale_bitmap_for_PostScript(); + // next 3 are related to X Input Method virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win); virtual void reset_spot(); + virtual void set_status(int X, int Y, int W, int H); // each platform implements these 3 functions its own way virtual void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h); virtual Fl_Region XRectangleRegion(int x, int y, int w, int h); diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index 8329355ba..4601568a3 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -124,6 +124,8 @@ void Fl_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, int H // nothing to do, reimplement in driver if needed } +void Fl_Graphics_Driver::set_status(int X, int Y, int W, int H) {} + /** see fl_reset_spot() */ void Fl_Graphics_Driver::reset_spot() diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index ad4e21c8f..faab62392 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -141,11 +141,6 @@ static CFStringRef kTISPropertyInputSourceType; typedef void (*KeyScript_type)(short); static KeyScript_type KeyScript; -/* fltk-utf8 placekeepers */ -void fl_set_status(int x, int y, int w, int h) -{ -} - /* * Mac keyboard lookup table diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 9b972a9f7..20fc5ea13 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -328,8 +328,6 @@ static struct FD { extern unsigned int fl_codepage; -void fl_set_status(int x, int y, int w, int h) {} - void Fl_WinAPI_System_Driver::add_fd(int n, int events, void (*cb)(FL_SOCKET, void *), void *v) { remove_fd(n, events); int i = nfds++; diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 55c249ecd..f76d45980 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -585,7 +585,7 @@ static void fl_new_ic() } -void fl_set_status(int x, int y, int w, int h) +void Fl_Xlib_Graphics_Driver::set_status(int x, int y, int w, int h) { XVaNestedList status_attr; status_area.x = x; diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 4dbf3c3ce..f7619ef10 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -208,6 +208,7 @@ protected: virtual float scale_bitmap_for_PostScript(); virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win); virtual void reset_spot(); + virtual void set_status(int X, int Y, int W, int H); virtual const char* get_font_name(Fl_Font fnum, int* ap); virtual int get_font_sizes(Fl_Font fnum, int*& sizep); #if !USE_XFT diff --git a/src/fl_font.cxx b/src/fl_font.cxx index 24d547e8f..df7df43d7 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -58,3 +58,8 @@ void fl_reset_spot() { Fl_Graphics_Driver::default_driver().reset_spot(); } + +void fl_set_status(int X, int Y, int W, int H) +{ + Fl_Graphics_Driver::default_driver().set_status(X, Y, W, H); +} -- cgit v1.2.3