FLTK 1.4.1
|
Fl global screen functions declared in <FL/Fl.H>. More...
Functions | |
static int | Fl::h () |
Returns the height in pixels of the main screen work area. | |
static void | Fl::keyboard_screen_scaling (int value) |
Controls the possibility to scale all windows by ctrl/+/-/0/ or cmd/+/-/0/. More... | |
static int | Fl::screen_count () |
Gets the total count of available screens. More... | |
static void | Fl::screen_dpi (float &h, float &v, int n=0) |
Gets the screen resolution in dots-per-inch for the given screen. More... | |
static int | Fl::screen_num (int x, int y) |
Gets the screen number of a screen that contains the specified screen position x , y . More... | |
static int | Fl::screen_num (int x, int y, int w, int h) |
Gets the screen number of the screen which intersects the most with the rectangle defined by x , y , w , h . More... | |
static float | Fl::screen_scale (int n) |
Gets the GUI scaling factor of screen number n . More... | |
static void | Fl::screen_scale (int n, float factor) |
Sets the GUI scaling factor of screen number n . More... | |
static int | Fl::screen_scaling_supported () |
Returns whether scaling factors are supported by this platform. More... | |
static void | Fl::screen_work_area (int &X, int &Y, int &W, int &H) |
Gets the bounding box of the work area of the screen that contains the mouse pointer. More... | |
static void | Fl::screen_work_area (int &X, int &Y, int &W, int &H, int mx, int my) |
Gets the bounding box of the work area of a screen that contains the specified screen position mx , my . More... | |
static void | Fl::screen_work_area (int &X, int &Y, int &W, int &H, int n) |
Gets the bounding box of the work area of the given screen. More... | |
static void | Fl::screen_xywh (int &X, int &Y, int &W, int &H) |
Gets the bounding box of a screen that contains the mouse pointer. More... | |
static void | Fl::screen_xywh (int &X, int &Y, int &W, int &H, int mx, int my) |
Gets the bounding box of a screen that contains the specified screen position mx , my . More... | |
static void | Fl::screen_xywh (int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) |
Gets the screen bounding rect for the screen which intersects the most with the rectangle defined by mx , my , mw , mh . More... | |
static void | Fl::screen_xywh (int &X, int &Y, int &W, int &H, int n) |
Gets the screen bounding rect for the given screen. More... | |
static int | Fl::w () |
Returns the width in pixels of the main screen work area. | |
static int | Fl::x () |
Returns the leftmost x coordinate of the main screen work area. | |
static int | Fl::y () |
Returns the topmost y coordinate of the main screen work area. | |
Fl global screen functions declared in <FL/Fl.H>.
FLTK supports high-DPI screens using a screen scaling factor. The scaling factor is initialized by the library to a value based on information obtained from the OS. If this initial value is not satisfactory, the FLTK_SCALING_FACTOR environment variable can be set to a value FLTK will multiply to the OS-given value. The 2 variants of functions Fl::screen_scale() allow to programmatically get and set scaling factor values. The scaling factor value can be further changed at runtime by typing Ctrl/+/-/0/
(Cmd/+/-/0/
under macOS). See FL_SHORTCUT for more details about these shortcuts.
|
static |
Controls the possibility to scale all windows by ctrl/+/-/0/ or cmd/+/-/0/.
This function should be called before fl_open_display() runs. If it is not called, the default is to handle these keys for window scaling.
value
must be 0 (zero) - all other values result in undefined behavior and are reserved for future extension.value | 0 to stop recognition of ctrl/+/-/0/ (or cmd/+/-/0/ under macOS) keys as window scaling. |
|
static |
Gets the total count of available screens.
|
static |
Gets the screen resolution in dots-per-inch for the given screen.
[out] | h,v | horizontal and vertical resolution |
[in] | n | the screen number (0 to Fl::screen_count() - 1) |
|
static |
Gets the screen number of a screen that contains the specified screen position x
, y
.
[in] | x,y | the absolute screen position |
x
, y
) may belong to distinct screens. In that situation other APIs should be preferred, e.g. Fl_Window::screen_num() and Fl::screen_scale(int).
|
static |
Gets the screen number of the screen which intersects the most with the rectangle defined by x
, y
, w
, h
.
[in] | x,y,w,h | the rectangle to search for intersection with |
|
static |
Gets the GUI scaling factor of screen number n
.
The valid range of n
is 0 .. Fl::screen_count() - 1.
The return value is 1.0
if screen scaling is not supported or n
is outside the valid range.
1.0
)
|
static |
Sets the GUI scaling factor of screen number n
.
The valid range of n
is 0 .. Fl::screen_count() - 1.
This method does nothing if n
is out of range or screen scaling is not supported by this platform.
Otherwise it also sets the scaling factor of all windows mapped to screen number n
or all screens, depending on the type of screen scaling support on the platform.
[in] | n | screen number |
[in] | factor | scaling factor of screen n |
|
static |
Returns whether scaling factors are supported by this platform.
0 | scaling factors are not supported by this platform |
1 | a single scaling factor is shared by all screens |
2 | each screen can have its own scaling factor |
|
static |
Gets the bounding box of the work area of the screen that contains the mouse pointer.
[out] | X,Y,W,H | the work area bounding box |
|
static |
Gets the bounding box of the work area of a screen that contains the specified screen position mx
, my
.
[out] | X,Y,W,H | the work area bounding box |
[in] | mx,my | the absolute screen position |
|
static |
Gets the bounding box of the work area of the given screen.
[out] | X,Y,W,H | the work area bounding box |
[in] | n | the screen number (0 to Fl::screen_count() - 1) |
X
,Y,W,H are given in FLTK units, that is, in drawing units divided by the scaling factor of screen n
.
|
static |
Gets the bounding box of a screen that contains the mouse pointer.
[out] | X,Y,W,H | the corresponding screen bounding box |
|
static |
Gets the bounding box of a screen that contains the specified screen position mx
, my
.
[out] | X,Y,W,H | the corresponding screen bounding box |
[in] | mx,my | the absolute screen position |
|
static |
Gets the screen bounding rect for the screen which intersects the most with the rectangle defined by mx
, my
, mw
, mh
.
[out] | X,Y,W,H | the corresponding screen bounding box |
[in] | mx,my,mw,mh | the rectangle to search for intersection with |
|
static |
Gets the screen bounding rect for the given screen.
Under Windows, Mac OS X, and X11 + the Gnome desktop, screen #0 contains the menubar/taskbar
[out] | X,Y,W,H | the corresponding screen bounding box |
[in] | n | the screen number (0 to Fl::screen_count() - 1) |
X
,Y,W,H are given in FLTK units, that is, in drawing units divided by the scaling factor of screen n
.