1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
//
// Core options header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 2025 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
// https://www.fltk.org/COPYING.php
//
// Please see the following page on how to report bugs and issues:
//
// https://www.fltk.org/bugs.php
//
/** \file FL/core/options.H
\brief Application and system wide options management.
This file is included within class Fl in FL/Fl.H.
*/
// --- Options declarations ---
/** Enumerator for global FLTK options.
These options can be set system wide, per user, or for the running
application only.
\see Fl::option(Fl_Option, bool)
\see Fl::option(Fl_Option)
*/
typedef enum {
/// When switched on, moving the text cursor beyond the start or end of
/// a text in a text widget will change focus to the next text widget.
/// (This is considered 'old' behavior)
///
/// When switched off (default), the cursor will stop at the end of the text.
/// Pressing Tab or Ctrl-Tab will advance the keyboard focus.
///
/// See also: Fl_Input_::tab_nav()
///
OPTION_ARROW_FOCUS = 0,
// When switched on, FLTK will use the file chooser dialog that comes
// with your operating system whenever possible. When switched off, FLTK
// will present its own file chooser.
// \todo implement me
// OPTION_NATIVE_FILECHOOSER,
// When Filechooser Preview is enabled, the FLTK or native file chooser
// will show a preview of a selected file (if possible) before the user
// decides to choose the file.
// \todo implement me
// OPTION_FILECHOOSER_PREVIEW,
/// If visible focus is switched on (default), FLTK will draw a dotted rectangle
/// inside the widget that will receive the next keystroke. If switched
/// off, no such indicator will be drawn and keyboard navigation
/// is disabled.
OPTION_VISIBLE_FOCUS,
/// If text drag-and-drop is enabled (default), the user can select and drag text
/// from any text widget. If disabled, no dragging is possible, however
/// dropping text from other applications still works.
OPTION_DND_TEXT,
/// If tooltips are enabled (default), hovering the mouse over a widget with a
/// tooltip text will open a little tooltip window until the mouse leaves
/// the widget. If disabled, no tooltip is shown.
OPTION_SHOW_TOOLTIPS,
/// When switched on (default), Fl_Native_File_Chooser runs GTK file dialogs
/// if the GTK library is available on the platform (linux/unix only).
/// When switched off, GTK file dialogs aren't used even if the GTK library is available.
OPTION_FNFC_USES_GTK,
/// Meaningful for the Wayland/X11 platform only. When switched on, the library uses a Zenity-based file dialog.
/// When switched off (default), no zenity-based file dialog is used.
OPTION_FNFC_USES_ZENITY,
/// Meaningful for the Wayland/X11 platform only.
/// When switched on, the library uses a kdialog-based file dialog if command 'kdialog' is available on the running system.
/// When switched off (default), no kdialog-based file dialog is used.
OPTION_FNFC_USES_KDIALOG,
/// When switched on (default), Fl_Printer runs the GTK printer dialog
/// if the GTK library is available on the platform (linux/unix only).
/// When switched off, the GTK printer dialog isn't used even if the GTK library is available.
OPTION_PRINTER_USES_GTK,
/// When switched on (default), the library shows in a transient yellow window the zoom factor
/// value.
/// When switched off, no such window gets displayed.
OPTION_SHOW_SCALING,
/// When switched on and when the keyboard in use has '+' in the shifted position of its key,
/// pressing that key and ctrl triggers the zoom-in operation.
/// When switched off (default), the zoom-in operation requires that also the shift key is pressed.
/// Under macOS, this option has no effect because the OS itself generates cmd= followed
/// by cmd+ when pressing cmd and the '=|+' key without pressing shift.
OPTION_SIMPLE_ZOOM_SHORTCUT,
// don't change this, leave it always as the last element
/// For internal use only.
OPTION_LAST
} Fl_Option;
/*
Return a global setting for all FLTK applications, possibly overridden
by a setting specifically for this application.
*/
static FL_EXPORT bool option(Fl_Option opt);
/*
Override an option while the application is running.
*/
static FL_EXPORT void option(Fl_Option opt, bool val);
// Visible focus methods...
/**
Gets or sets the visible keyboard focus on buttons and other
non-text widgets. The default mode is to enable keyboard focus
for all widgets.
*/
static FL_EXPORT inline void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
/**
Gets or sets the visible keyboard focus on buttons and other
non-text widgets. The default mode is to enable keyboard focus
for all widgets.
*/
static FL_EXPORT inline int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
// Drag-n-drop text operation methods...
/**
Sets whether drag and drop text operations are supported.
This specifically affects whether selected text can
be dragged from text fields or dragged within a text field as a
cut/paste shortcut.
*/
static FL_EXPORT inline void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
/**
Gets whether drag and drop text operations are
supported. This returns whether selected text can
be dragged from text fields or dragged within a text field as a
cut/paste shortcut.
*/
static FL_EXPORT inline int dnd_text_ops() { return option(OPTION_DND_TEXT); }
|