diff options
| author | Manolo Gouy <Manolo> | 2017-06-29 09:44:35 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-06-29 09:44:35 +0000 |
| commit | 7dc496e97d3d9fbc71ffd75b6c4ceb5cfe93ffa5 (patch) | |
| tree | f1d72ac73196a8d05462f1b46a8d3888e2ae645b /src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | |
| parent | c6c4e8d426bba89736d1fc79eb464c5b6d14935f (diff) | |
HiDPI support for WIN32 platform: begin to support screen-specific scale factor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12280 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index e81120fea..6dbfa7848 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -37,14 +37,14 @@ protected: RECT screens[MAX_SCREENS]; RECT work_area[MAX_SCREENS]; float dpi[MAX_SCREENS][2]; + float scale_of_screen[MAX_SCREENS]; static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM); BOOL screen_cb(HMONITOR mon, HDC, LPRECT r); - int screen_num_unscaled(int x, int y); int get_mouse_unscaled(int &mx, int &my); public: - Fl_WinAPI_Screen_Driver() : Fl_Screen_Driver() { scale_ = 1; } + Fl_WinAPI_Screen_Driver() : Fl_Screen_Driver() { } // --- display management virtual int visual(int flags); // --- screen configuration @@ -55,6 +55,7 @@ public: virtual int h(); virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); virtual void screen_dpi(float &h, float &v, int n=0); + int screen_num_unscaled(int x, int y); float DWM_scaling_factor(int screen_num); virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); // --- audible output @@ -87,11 +88,9 @@ public: return SYSTEMWIDE_APP_SCALING; } #endif - virtual float scale(int n) {return scale_;} - virtual void scale(int n, float f) { scale_ = f;} + virtual float scale(int n) {return scale_of_screen[n];} + virtual void scale(int n, float f) { scale_of_screen[n] = f;} virtual float desktop_scale_factor(); -private: - float scale_; }; |
