Previous: Idle Callbacks and Timeouts, Up: Part V Overview of Main Functions [Contents][Index]
For convenience the library exports a number of global variables. These are:
FL_OBJECT *FL_EVENTThis is a special object returned by fl_do_forms() etc.
when an X event is received that isn’t coming from a form under the
control of the library, e.g., for a window that was opened directly
via Xlib functions. Upon receiving this special event the application
program can and must remove the pending event from the queue using
fl_XNextEvent().
FL_FORM *fl_current_formThis variable is always set to the currently active form.
Display *fl_displayThis variable is set to the display (X server) the program is
connected to and is needed as an argument for many Xlib functions.
It’s recommended not to use this global variable but instead either
the function fl_get_display() or
FL_FormDisplay() (the latter accepts a form pointer as
its argument and will also be safe in future versions of the library
that may support multiple connections).
int fl_screenThis variable is set to the default screen of the display connection.
Window fl_rootThis variable is set to the root window.
Window fl_vrootSome window managers have problems with obtaining the corrent root
window and applications don’t work with the normal root windows. In
this case fl_vroot can be used instead.
int fl_scrw, fl_scrhThese variables contain the screens width and height.
int fl_modeThe variable contains the visual mode in use, it should be one of the
Xlib constants PseudoColor, TrueColor,
DirectColor, StaticColor, GrayScale or
can be
used (the latter accepts a form pointer as its argument and is thus
also safe for future versions that may allow multiple connections).
StaticGray. Alternatively, the functions
fl_get_vclass() or fl_get_form_vclass()
FL_State fl_state[6]This array of structure of type FL_State contains a lot
of information about the graphics mode, where each structure has the
information for each of the visual modes. Of interest is only the
entry for the visual mode in use, fl_vmode.
double fl_dpidouble fl_get_dpi()The fl_dpi variable contains the screen resolution (in dots
per inch), averaged over the resolutions in x- and
y-direction. The funtion is a convenience macros with the same
result.
Visual *fl_visualVisual *fl_get_visual()Convenience macros that expands to the Visual pointer in use.
Same as fl_state[fl_vmode].xvinfo->visual.
Colormap fl_colormapColormap fl_get_colormap()Convenience macros that expands to the currently used Colormap.
Same as fl_state[fl_vmode].colormap.
char *fl_ul_magic_charThis variable points to the character used to indicate underlining
in labels and other texts. If it appears as the very first character
of a string all characters in that string are underlined, otherwise
the character direct in front of it. Per default it’s set to
'\b'.
Previous: Idle Callbacks and Timeouts, Up: Part V Overview of Main Functions [Contents][Index]