summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--body/c_fl_event.cpp8
-rw-r--r--body/c_fl_event.h2
-rw-r--r--body/c_fl_static.cpp12
-rw-r--r--body/c_fl_static.h3
-rw-r--r--body/fltk-event.adb24
-rw-r--r--body/fltk-menu_items.adb6
-rw-r--r--body/fltk-screen.adb4
-rw-r--r--body/fltk-static.adb33
-rw-r--r--body/fltk-widgets-menus-menu_bars-systemwide.adb21
-rw-r--r--body/fltk-widgets-menus.adb20
-rw-r--r--body/fltk-widgets.adb27
-rw-r--r--body/fltk.adb79
-rw-r--r--doc/enumerations.html13
-rw-r--r--doc/fl.html123
-rw-r--r--doc/fl_(fltk-event).html20
-rw-r--r--doc/fl_(fltk-screen).html9
-rw-r--r--doc/fl_(fltk-static).html141
-rw-r--r--doc/fl_browser_.html9
-rw-r--r--doc/fl_file_chooser.html6
-rw-r--r--doc/fl_pack.html4
-rw-r--r--doc/fl_scroll.html9
-rw-r--r--doc/fl_text_display.html25
-rw-r--r--doc/fl_widget.html10
-rw-r--r--spec/fltk-event.ads8
-rw-r--r--spec/fltk-screen.ads4
-rw-r--r--spec/fltk-static.ads19
-rw-r--r--spec/fltk-widgets.ads99
-rw-r--r--spec/fltk.ads161
-rw-r--r--test/cursor.adb4
29 files changed, 504 insertions, 399 deletions
diff --git a/body/c_fl_event.cpp b/body/c_fl_event.cpp
index 59a22df..d8760af 100644
--- a/body/c_fl_event.cpp
+++ b/body/c_fl_event.cpp
@@ -59,6 +59,14 @@ void fl_event_set_focus(void * w) {
Fl::focus(static_cast<Fl_Widget*>(w));
}
+int fl_event_get_visible_focus() {
+ return Fl::visible_focus();
+}
+
+void fl_event_set_visible_focus(int f) {
+ Fl::visible_focus(f);
+}
+
diff --git a/body/c_fl_event.h b/body/c_fl_event.h
index cc1f930..34daf2b 100644
--- a/body/c_fl_event.h
+++ b/body/c_fl_event.h
@@ -21,6 +21,8 @@ extern "C" void * fl_event_get_belowmouse();
extern "C" void fl_event_set_belowmouse(void * w);
extern "C" void * fl_event_get_focus();
extern "C" void fl_event_set_focus(void * w);
+extern "C" int fl_event_get_visible_focus();
+extern "C" void fl_event_set_visible_focus(int f);
extern "C" int fl_event_compose(int &d);
diff --git a/body/c_fl_static.cpp b/body/c_fl_static.cpp
index ad4cfe9..0b45115 100644
--- a/body/c_fl_static.cpp
+++ b/body/c_fl_static.cpp
@@ -219,14 +219,6 @@ void fl_static_disable_im() {
Fl::disable_im();
}
-int fl_static_get_visible_focus() {
- return Fl::visible_focus();
-}
-
-void fl_static_set_visible_focus(int f) {
- Fl::visible_focus(f);
-}
-
@@ -257,10 +249,6 @@ void * fl_static_readqueue() {
return Fl::readqueue();
}
-void fl_static_do_widget_deletion() {
- Fl::do_widget_deletion();
-}
-
diff --git a/body/c_fl_static.h b/body/c_fl_static.h
index 692750b..2622544 100644
--- a/body/c_fl_static.h
+++ b/body/c_fl_static.h
@@ -75,8 +75,6 @@ extern "C" void fl_static_set_dnd_text_ops(int t);
extern "C" void fl_static_enable_im();
extern "C" void fl_static_disable_im();
-extern "C" int fl_static_get_visible_focus();
-extern "C" void fl_static_set_visible_focus(int f);
extern "C" void fl_static_default_atclose(void * w);
@@ -87,7 +85,6 @@ extern "C" void * fl_static_modal();
extern "C" void * fl_static_readqueue();
-extern "C" void fl_static_do_widget_deletion();
extern "C" const char * fl_static_get_scheme();
diff --git a/body/fltk-event.adb b/body/fltk-event.adb
index 8c3db1f..2c96792 100644
--- a/body/fltk-event.adb
+++ b/body/fltk-event.adb
@@ -92,6 +92,16 @@ package body FLTK.Event is
pragma Import (C, fl_event_set_focus, "fl_event_set_focus");
pragma Inline (fl_event_set_focus);
+ function fl_event_get_visible_focus
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_get_visible_focus, "fl_event_get_visible_focus");
+ pragma Inline (fl_event_get_visible_focus);
+
+ procedure fl_event_set_visible_focus
+ (T : in Interfaces.C.int);
+ pragma Import (C, fl_event_set_visible_focus, "fl_event_set_visible_focus");
+ pragma Inline (fl_event_set_visible_focus);
+
@@ -477,6 +487,20 @@ package body FLTK.Event is
end Set_Focus;
+ function Has_Visible_Focus
+ return Boolean is
+ begin
+ return fl_event_get_visible_focus /= 0;
+ end Has_Visible_Focus;
+
+
+ procedure Set_Visible_Focus
+ (To : in Boolean) is
+ begin
+ fl_event_set_visible_focus (Boolean'Pos (To));
+ end Set_Visible_Focus;
+
+
-- Multikey --
diff --git a/body/fltk-menu_items.adb b/body/fltk-menu_items.adb
index 4ab9f7f..7ee4d61 100644
--- a/body/fltk-menu_items.adb
+++ b/body/fltk-menu_items.adb
@@ -298,7 +298,7 @@ package body FLTK.Menu_Items is
(Interfaces.C.To_C (Text),
Callback_Convert.To_Address (Action),
To_C (Shortcut),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
end return;
end Create;
@@ -552,7 +552,7 @@ package body FLTK.Menu_Items is
(This : in Menu_Item)
return Menu_Flag is
begin
- return Menu_Flag (fl_menu_item_get_flags (This.Void_Ptr));
+ return Cint_To_MFlag (fl_menu_item_get_flags (This.Void_Ptr));
end Get_Flags;
@@ -560,7 +560,7 @@ package body FLTK.Menu_Items is
(This : in out Menu_Item;
To : in Menu_Flag) is
begin
- fl_menu_item_set_flags (This.Void_Ptr, Interfaces.C.int (To));
+ fl_menu_item_set_flags (This.Void_Ptr, MFlag_To_Cint (To));
end Set_Flags;
diff --git a/body/fltk-screen.adb b/body/fltk-screen.adb
index 54618fe..89f7413 100644
--- a/body/fltk-screen.adb
+++ b/body/fltk-screen.adb
@@ -139,11 +139,11 @@ package body FLTK.Screen is
-- Environment --
- procedure Set_Display_Var
+ procedure Set_Display_String
(Value : in String) is
begin
fl_screen_display (Interfaces.C.To_C (Value));
- end Set_Display_Var;
+ end Set_Display_String;
diff --git a/body/fltk-static.adb b/body/fltk-static.adb
index 59a3aa2..bd64a9e 100644
--- a/body/fltk-static.adb
+++ b/body/fltk-static.adb
@@ -310,21 +310,6 @@ package body FLTK.Static is
- -- Input Focus --
-
- function fl_static_get_visible_focus
- return Interfaces.C.int;
- pragma Import (C, fl_static_get_visible_focus, "fl_static_get_visible_focus");
- pragma Inline (fl_static_get_visible_focus);
-
- procedure fl_static_set_visible_focus
- (T : in Interfaces.C.int);
- pragma Import (C, fl_static_set_visible_focus, "fl_static_set_visible_focus");
- pragma Inline (fl_static_set_visible_focus);
-
-
-
-
-- Windows --
procedure fl_static_default_atclose
@@ -951,24 +936,6 @@ package body FLTK.Static is
- -- Input Focus --
-
- function Has_Visible_Focus
- return Boolean is
- begin
- return fl_static_get_visible_focus /= 0;
- end Has_Visible_Focus;
-
-
- procedure Set_Visible_Focus
- (To : in Boolean) is
- begin
- fl_static_set_visible_focus (Boolean'Pos (To));
- end Set_Visible_Focus;
-
-
-
-
-- Windows --
procedure Default_Window_Close
diff --git a/body/fltk-widgets-menus-menu_bars-systemwide.adb b/body/fltk-widgets-menus-menu_bars-systemwide.adb
index e96772e..c09ef93 100644
--- a/body/fltk-widgets-menus-menu_bars-systemwide.adb
+++ b/body/fltk-widgets-menus-menu_bars-systemwide.adb
@@ -340,7 +340,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Add;
@@ -359,7 +359,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -378,7 +378,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Add;
@@ -397,7 +397,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -418,7 +418,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Insert;
@@ -439,7 +439,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -460,7 +460,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Insert;
@@ -481,7 +481,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -593,7 +593,8 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
Place : in Index)
return Menu_Flag is
begin
- return Menu_Flag (fl_sys_menu_bar_get_mode (This.Void_Ptr, Interfaces.C.int (Place) - 1));
+ return Cint_To_MFlag
+ (fl_sys_menu_bar_get_mode (This.Void_Ptr, Interfaces.C.int (Place) - 1));
end Get_Flags;
@@ -605,7 +606,7 @@ package body FLTK.Widgets.Menus.Menu_Bars.Systemwide is
fl_sys_menu_bar_set_mode
(This.Void_Ptr,
Interfaces.C.int (Place) - 1,
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
end Set_Flags;
diff --git a/body/fltk-widgets-menus.adb b/body/fltk-widgets-menus.adb
index 3344efd..ede63a3 100644
--- a/body/fltk-widgets-menus.adb
+++ b/body/fltk-widgets-menus.adb
@@ -598,7 +598,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Add;
@@ -617,7 +617,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -636,7 +636,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Add;
@@ -655,7 +655,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -676,7 +676,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Insert;
@@ -697,7 +697,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -718,7 +718,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
end Insert;
@@ -739,7 +739,7 @@ package body FLTK.Widgets.Menus is
Interfaces.C.To_C (Text),
Interfaces.C.To_C (Shortcut),
Callback_Convert.To_Address (Action),
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
begin
This.Adjust_Item_Store;
return Index (Added_Spot + 1);
@@ -1186,7 +1186,7 @@ package body FLTK.Widgets.Menus is
Place : in Index)
return Menu_Flag is
begin
- return Menu_Flag (fl_menu_get_mode (This.Void_Ptr, Interfaces.C.int (Place) - 1));
+ return Cint_To_MFlag (fl_menu_get_mode (This.Void_Ptr, Interfaces.C.int (Place) - 1));
end Get_Flags;
@@ -1198,7 +1198,7 @@ package body FLTK.Widgets.Menus is
fl_menu_set_mode
(This.Void_Ptr,
Interfaces.C.int (Place) - 1,
- Interfaces.C.int (Flags));
+ MFlag_To_Cint (Flags));
end Set_Flags;
diff --git a/body/fltk-widgets.adb b/body/fltk-widgets.adb
index 8bc5c86..f5ae433 100644
--- a/body/fltk-widgets.adb
+++ b/body/fltk-widgets.adb
@@ -26,33 +26,6 @@ package body FLTK.Widgets is
package Chk renames Ada.Assertions;
- function "+"
- (Left, Right : in Callback_Flag)
- return Callback_Flag is
- begin
- return
- (Changed => Left.Changed or Right.Changed,
- Interact => Left.Interact or Right.Interact,
- Release => Left.Release or Right.Release,
- Enter_Key => Left.Enter_Key or Right.Enter_Key);
- end "+";
-
-
- function "+"
- (Left, Right : in Damage_Mask)
- return Damage_Mask is
- begin
- return
- (Child => Left.Child or Right.Child,
- Expose => Left.Expose or Right.Expose,
- Scroll => Left.Scroll or Right.Scroll,
- Overlay => Left.Overlay or Right.Overlay,
- User_1 => Left.User_1 or Right.User_1,
- User_2 => Left.User_2 or Right.User_2,
- Full => Left.Full or Right.Full);
- end "+";
-
-
package Group_Convert is new
System.Address_To_Access_Conversions (FLTK.Widgets.Groups.Group'Class);
diff --git a/body/fltk.adb b/body/fltk.adb
index cebf1a9..48023f2 100644
--- a/body/fltk.adb
+++ b/body/fltk.adb
@@ -339,7 +339,7 @@ package body FLTK is
(Left, Right : in Alignment)
return Alignment is
begin
- return Left and (not Right);
+ return Left and not Right;
end "-";
@@ -581,16 +581,91 @@ package body FLTK is
+ -- Callback Flags --
+
+ type Callback_Bitmask is mod 2 ** Interfaces.C.unsigned_char'Size;
+
+ function CFlag_To_Bits is new
+ Ada.Unchecked_Conversion (Callback_Flag, Callback_Bitmask);
+
+ function Bits_To_CFlag is new
+ Ada.Unchecked_Conversion (Callback_Bitmask, Callback_Flag);
+
+
+ function "+"
+ (Left, Right : in Callback_Flag)
+ return Callback_Flag is
+ begin
+ return Bits_To_CFlag (CFlag_To_Bits (Left) or CFlag_To_Bits (Right));
+ end "+";
+
+
+ function "-"
+ (Left, Right : in Callback_Flag)
+ return Callback_Flag is
+ begin
+ return Bits_To_CFlag (CFlag_To_Bits (Left) and not CFlag_To_Bits (Right));
+ end "-";
+
+
+
+
-- Menu Flags --
+ type Menu_Bitmask is mod 2 ** Interfaces.C.int'Size;
+
+ function MFlag_To_Bits is new
+ Ada.Unchecked_Conversion (Menu_Flag, Menu_Bitmask);
+
+ function Bits_To_MFlag is new
+ Ada.Unchecked_Conversion (Menu_Bitmask, Menu_Flag);
+
+
function "+"
(Left, Right : in Menu_Flag)
return Menu_Flag is
begin
- return Left or Right;
+ return Bits_To_MFlag (MFlag_To_Bits (Left) or MFlag_To_Bits (Right));
+ end "+";
+
+
+ function "-"
+ (Left, Right : in Menu_Flag)
+ return Menu_Flag is
+ begin
+ return Bits_To_MFlag (MFlag_To_Bits (Left) and not MFlag_To_Bits (Right));
+ end "-";
+
+
+
+
+ -- Damage Bits --
+
+ type Damage_Bitmask is mod 2 ** Interfaces.C.unsigned_char'Size;
+
+ function Damage_To_Bits is new
+ Ada.Unchecked_Conversion (Damage_Mask, Damage_Bitmask);
+
+ function Bits_To_Damage is new
+ Ada.Unchecked_Conversion (Damage_Bitmask, Damage_Mask);
+
+
+ function "+"
+ (Left, Right : in Damage_Mask)
+ return Damage_Mask is
+ begin
+ return Bits_To_Damage (Damage_To_Bits (Left) or Damage_To_Bits (Right));
end "+";
+ function "-"
+ (Left, Right : in Damage_Mask)
+ return Damage_Mask is
+ begin
+ return Bits_To_Damage (Damage_To_Bits (Left) and not Damage_To_Bits (Right));
+ end "-";
+
+
-- Versioning --
diff --git a/doc/enumerations.html b/doc/enumerations.html
index 937a7a9..3533cd9 100644
--- a/doc/enumerations.html
+++ b/doc/enumerations.html
@@ -131,13 +131,18 @@
</tr>
<tr>
- <td>int</td>
- <td>Version_Number</td>
+ <td>Fl_When</td>
+ <td>Callback_Flag</td>
</tr>
<tr>
- <td>Fl_When</td>
- <td>Callback_Flag (in FLTK.Widgets)</td>
+ <td>Fl_Damage</td>
+ <td>Damage_Mask</td>
+ </tr>
+
+ <tr>
+ <td>int</td>
+ <td>Version_Number</td>
</tr>
</table>
diff --git a/doc/fl.html b/doc/fl.html
index 7803d33..7d4d3ee 100644
--- a/doc/fl.html
+++ b/doc/fl.html
@@ -37,30 +37,20 @@
</tr>
<tr>
- <td>enum</td>
+ <td>enum {<br />
+ FL_MENU_INACTIVE = 1,<br />
+ FL_MENU_TOGGLE = 2,<br />
+ FL_MENU_VALUE = 4,<br />
+ FL_MENU_RADIO = 8,<br />
+ FL_MENU_INVISIBLE = 0x10,<br />
+ FL_SUBMENU_POINTER = 0x20,<br />
+ FL_SUBMENU = 0x40,<br />
+ FL_MENU_DIVIDER = 0x80,<br />
+ FL_MENU_HORIZONTAL = 0x100 }<br />
+ </td>
<td>Menu_Flag</td>
</tr>
- <tr>
- <td>Fl_Abort_Handler</td>
- <td>&nbsp;</td>
- </tr>
-
- <tr>
- <td>Fl_Args_Handler</td>
- <td>&nbsp;</td>
- </tr>
-
- <tr>
- <td>Fl_Atclose_Handler</td>
- <td>&nbsp;</td>
- </tr>
-
- <tr>
- <td>Fl_Old_Idle_Handler</td>
- <td>&nbsp;</td>
- </tr>
-
</table>
@@ -78,34 +68,6 @@
<table class="function">
- <tr><th colspan="2">Static Attributes</th></tr>
-
- <tr>
-<td><pre>
-static void (*atclose)(Fl_Window *, void *);
-</pre></td>
-<td>Deprecated, set the callback for the Window instead.</td>
- </tr>
-
- <tr>
-<td><pre>
-static const char * const help = helpmsg + 13;
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
-static void (*idle)();
-</pre></td>
-<td>Should not be used directly.</td>
- </tr>
-
-</table>
-
-
-
-<table class="function">
<tr><th colspan="2">Static Functions and Procedures</th></tr>
<tr>
@@ -141,27 +103,6 @@ function API_Version
<tr>
<td><pre>
-static int arg(int argc, char **argv, int &i);
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
-static int args(int argc, char **argv, int &i, Fl_Args_Handler cb=0);
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
-static void args(int argc, char **argv);
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
static void awake(void *message=0);
</pre></td>
<td><pre>
@@ -171,13 +112,6 @@ procedure Awake;
<tr>
<td><pre>
-static int awake(Fl_Awake_Handler cb, void *message=0);
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
static void cairo_autolink_context(bool alink);
</pre></td>
<td>&nbsp;</td>
@@ -257,6 +191,13 @@ static void delete_widget(Fl_Widget *w);
<tr>
<td><pre>
+static void do_widget_deletion();
+</pre></td>
+<td>Marked as internal use only.</td>
+ </tr>
+
+ <tr>
+<td><pre>
static void flush();
</pre></td>
<td><pre>
@@ -327,27 +268,6 @@ function Run
<tr>
<td><pre>
-static void set_abort(Fl_Abort_Handler f);
-</pre></td>
-<td>Marked as backwards compatibility only.</td>
- </tr>
-
- <tr>
-<td><pre>
-static void set_atclose(Fl_Atclose_Handler f);
-</pre></td>
-<td>Marked as backwards compatibility only.</td>
- </tr>
-
- <tr>
-<td><pre>
-static void set_idle(Fl_Old_Idle_Handler cb);
-</pre></td>
-<td>Deprecated, use add_idle / Add_Idle instead.</td>
- </tr>
-
- <tr>
-<td><pre>
static void * thread_message();
</pre></td>
<td>&nbsp;</td>
@@ -397,13 +317,6 @@ function Version
<tr>
<td><pre>
-static int visual(int);
-</pre></td>
-<td>&nbsp;</td>
- </tr>
-
- <tr>
-<td><pre>
static int wait();
</pre></td>
<td><pre>
diff --git a/doc/fl_(fltk-event).html b/doc/fl_(fltk-event).html
index 72a007c..3aaca1f 100644
--- a/doc/fl_(fltk-event).html
+++ b/doc/fl_(fltk-event).html
@@ -519,6 +519,26 @@ static int test_shortcut(Fl_Shortcut);
<td>&nbsp;</td>
</tr>
+ <tr>
+<td><pre>
+static int visible_focus();
+</pre></td>
+<td><pre>
+function Has_Visible_Focus
+ return Boolean;
+</pre></td>
+ </tr>
+
+ <tr>
+<td><pre>
+static void visible_focus(int v);
+</pre></td>
+<td><pre>
+procedure Set_Visible_Focus
+ (To : in Boolean);
+</pre></td>
+ </tr>
+
</table>
diff --git a/doc/fl_(fltk-screen).html b/doc/fl_(fltk-screen).html
index fddc17d..a5f8722 100644
--- a/doc/fl_(fltk-screen).html
+++ b/doc/fl_(fltk-screen).html
@@ -36,7 +36,7 @@
static void display(const char *);
</pre></td>
<td><pre>
-procedure Set_Display_Var
+procedure Set_Display_String
(Value : in String);
</pre></td>
</tr>
@@ -178,6 +178,13 @@ procedure Work_Area
<tr>
<td><pre>
+static int visual(int);
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
static int w();
</pre></td>
<td><pre>
diff --git a/doc/fl_(fltk-static).html b/doc/fl_(fltk-static).html
index 031ff3f..3afc53a 100644
--- a/doc/fl_(fltk-static).html
+++ b/doc/fl_(fltk-static).html
@@ -32,13 +32,23 @@
<tr><th colspan="2">Types</th></tr>
<tr>
- <td>Fl_Awake_Handler</td>
- <td>Awake_Handler</td>
+ <td>Fl_Abort_Handler</td>
+ <td>&nbsp;</td>
</tr>
<tr>
- <td>Fl_Timeout_Handler</td>
- <td>Timeout_Handler</td>
+ <td>Fl_Args_Handler</td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>Fl_Atclose_Handler</td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>Fl_Awake_Handler</td>
+ <td>Awake_Handler</td>
</tr>
<tr>
@@ -47,6 +57,21 @@
</tr>
<tr>
+ <td>Fl_Old_Idle_Handler</td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>Fl_System_Handler</td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>Fl_Timeout_Handler</td>
+ <td>Timeout_Handler</td>
+ </tr>
+
+ <tr>
<td>int</td>
<td>Buffer_Kind</td>
</tr>
@@ -91,11 +116,6 @@
<td>Option</td>
</tr>
- <tr>
- <td>Fl_System_Handler</td>
- <td>&nbsp;</td>
- </tr>
-
</table>
@@ -105,6 +125,13 @@
<tr>
<td><pre>
+static void (*atclose)(Fl_Window *, void *);
+</pre></td>
+<td>Deprecated, set the callback for the Window instead.</td>
+ </tr>
+
+ <tr>
+<td><pre>
static char const * const clipboard_image = "image";
</pre></td>
<td>&nbsp;</td>
@@ -117,6 +144,20 @@ static char const * const clipboard_plain_text = "text/plain";
<td>&nbsp;</td>
</tr>
+ <tr>
+<td><pre>
+static const char * const help = helpmsg + 13;
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
+static void (*idle)();
+</pre></td>
+<td>Should not be used directly.</td>
+ </tr>
+
</table>
@@ -191,7 +232,8 @@ procedure Add_Idle
<tr>
<td><pre>
-static void add_system_handler(Fl_System_Handler h, void *data);
+static void add_system_handler(Fl_System_Handler h,
+ void *data);
</pre></td>
<td>&nbsp;</td>
</tr>
@@ -210,6 +252,35 @@ procedure Add_Timeout
<tr>
<td><pre>
+static int arg(int argc, char **argv, int &i);
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
+static int args(int argc, char **argv, int &i,
+ Fl_Args_Handler cb=0);
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
+static void args(int argc, char **argv);
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
+static int awake(Fl_Awake_Handler cb, void *message=0);
+</pre></td>
+<td>&nbsp;</td>
+ </tr>
+
+ <tr>
+<td><pre>
static void background(uchar, uchar, uchar);
</pre></td>
<td><pre>
@@ -349,15 +420,6 @@ procedure Set_Drag_Drop_Text_Support
<tr>
<td><pre>
-static void do_widget_deletion();
-</pre></td>
-<td><pre>
-procedure Do_Widget_Deletion;
-</pre></td>
- </tr>
-
- <tr>
-<td><pre>
static int draw_box_active();
</pre></td>
<td><pre>
@@ -781,6 +843,20 @@ static void selection_owner(Fl_Widget *);
<tr>
<td><pre>
+static void set_abort(Fl_Abort_Handler f);
+</pre></td>
+<td>Marked as backwards compatibility only.</td>
+ </tr>
+
+ <tr>
+<td><pre>
+static void set_atclose(Fl_Atclose_Handler f);
+</pre></td>
+<td>Marked as backwards compatibility only.</td>
+ </tr>
+
+ <tr>
+<td><pre>
static void set_box_color(Fl_Color);
</pre></td>
<td>&nbsp;</td>
@@ -788,7 +864,8 @@ static void set_box_color(Fl_Color);
<tr>
<td><pre>
-static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F *, uchar, uchar, uchar, uchar);
+static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F *,
+ uchar, uchar, uchar, uchar);
</pre></td>
<td>&nbsp;</td>
</tr>
@@ -851,36 +928,24 @@ procedure Setup_Fonts
<tr>
<td><pre>
-static void set_labeltype(Fl_Labeltype, Fl_Label_Draw_F *, FL_Label_Measure_F *);
+static void set_idle(Fl_Old_Idle_Handler cb);
</pre></td>
-<td>&nbsp;</td>
+<td>Deprecated, use add_idle / Add_Idle instead.</td>
</tr>
<tr>
<td><pre>
-static void set_labeltype(Fl_Labeltype, Fl_Labeltype from);
+static void set_labeltype(Fl_Labeltype, Fl_Label_Draw_F *,
+ FL_Label_Measure_F *);
</pre></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><pre>
-static int visible_focus();
-</pre></td>
-<td><pre>
-function Has_Visible_Focus
- return Boolean;
-</pre></td>
- </tr>
-
- <tr>
-<td><pre>
-static void visible_focus(int v);
-</pre></td>
-<td><pre>
-procedure Set_Visible_Focus
- (To : in Boolean);
+static void set_labeltype(Fl_Labeltype, Fl_Labeltype from);
</pre></td>
+<td>&nbsp;</td>
</tr>
</table>
diff --git a/doc/fl_browser_.html b/doc/fl_browser_.html
index 1ee2a6a..a09e2e4 100644
--- a/doc/fl_browser_.html
+++ b/doc/fl_browser_.html
@@ -47,7 +47,14 @@ already extended from it.</p>
</tr>
<tr>
- <td>enum mode</td>
+ <td>enum {<br />
+ HORIZONTAL = 1,<br />
+ VERTICAL = 2,<br />
+ BOTH = 3,<br />
+ ALWAYS_ON = 4,<br />
+ HORIZONTAL_ALWAYS = 5,<br />
+ VERTICAL_ALWAYS = 6,<br />
+ BOTH_ALWAYS = 7 }</td>
<td>Scrollbar_Mode</td>
</tr>
diff --git a/doc/fl_file_chooser.html b/doc/fl_file_chooser.html
index 24bd6d8..f186ca4 100644
--- a/doc/fl_file_chooser.html
+++ b/doc/fl_file_chooser.html
@@ -45,7 +45,11 @@ See Fl_Ask for related symbols that are not members of the Fl_File_Chooser class
</tr>
<tr>
- <td>enum {SINGLE=0, MULTI=1, CREATE=2, DIRECTORY=4}</td>
+ <td>enum {<br />
+ SINGLE = 0,<br />
+ MULTI = 1,<br />
+ CREATE = 2,<br />
+ DIRECTORY = 4 }</td>
<td>Chooser_Kind</td>
</tr>
diff --git a/doc/fl_pack.html b/doc/fl_pack.html
index 1a7a887..f850557 100644
--- a/doc/fl_pack.html
+++ b/doc/fl_pack.html
@@ -42,7 +42,9 @@
</tr>
<tr>
- <td>enum { VERTICAL = 0, HORIZONTAL = 1 }</td>
+ <td>enum {<br />
+ VERTICAL = 0,<br />
+ HORIZONTAL = 1 }</td>
<td>Pack_Kind</td>
</tr>
diff --git a/doc/fl_scroll.html b/doc/fl_scroll.html
index c55dba5..4c8977b 100644
--- a/doc/fl_scroll.html
+++ b/doc/fl_scroll.html
@@ -42,7 +42,14 @@
</tr>
<tr>
- <td>enum { HORIZONTAL = 1, VERTICAL = 2, BOTH = 3, ALWAYS_ON = 4, HORIZONTAL_ALWAYS = 5, VERTICAL_ALWAYS = 6, BOTH_ALWAYS = 7 }
+ <td>enum {<br />
+ HORIZONTAL = 1,<br />
+ VERTICAL = 2,<br />
+ BOTH = 3,<br />
+ ALWAYS_ON = 4,<br />
+ HORIZONTAL_ALWAYS = 5,<br />
+ VERTICAL_ALWAYS = 6,<br />
+ BOTH_ALWAYS = 7 }
<td>Scroll_Kind</td>
</tr>
diff --git a/doc/fl_text_display.html b/doc/fl_text_display.html
index 8d0d20a..54b2f54 100644
--- a/doc/fl_text_display.html
+++ b/doc/fl_text_display.html
@@ -42,22 +42,39 @@
</tr>
<tr>
- <td>enum { NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR, BLOCK_CURSOR, HEAVY_CURSOR, SIMPLE_CURSOR }</td>
+ <td>enum {<br />
+ NORMAL_CURSOR,<br />
+ CARET_CURSOR,<br />
+ DIM_CURSOR,<br />
+ BLOCK_CURSOR,<br />
+ HEAVY_CURSOR,<br />
+ SIMPLE_CURSOR }</td>
<td>Cursor_Style</td>
</tr>
<tr>
- <td>enum { CURSOR_POS, CHARACTER_POS }</td>
+ <td>enum {<br />
+ CURSOR_POS,<br />
+ CHARACTER_POS }</td>
<td>Position_Kind</td>
</tr>
<tr>
- <td>enum { DRAG_NONE = -2, DRAG_START_DND = -1, DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2 }</td>
+ <td>enum {<br />
+ DRAG_NONE = -2,<br />
+ DRAG_START_DND = -1,<br />
+ DRAG_CHAR = 0,<br />
+ DRAG_WORD = 1,<br />
+ DRAG_LINE = 2 }</td>
<td>&nbsp;</td>
</tr>
<tr>
- <td>enum { WRAP_NONE, WRAP_AT_COLUMN, WRAP_AT_PIXEL, WRAP_AT_BOUNDS }</td>
+ <td>enum {<br />
+ WRAP_NONE,<br />
+ WRAP_AT_COLUMN,<br />
+ WRAP_AT_PIXEL,<br />
+ WRAP_AT_BOUNDS }</td>
<td>Wrap_Mode</td>
</tr>
diff --git a/doc/fl_widget.html b/doc/fl_widget.html
index c5c2f16..0552325 100644
--- a/doc/fl_widget.html
+++ b/doc/fl_widget.html
@@ -46,16 +46,6 @@
<td>Widget_Callback</td>
</tr>
- <tr>
- <td>Fl_When (in Enumerations)</td>
- <td>Callback_Flag</td>
- </tr>
-
- <tr>
- <td>uchar</td>
- <td>Damage_Mask</td>
- </tr>
-
</table>
diff --git a/spec/fltk-event.ads b/spec/fltk-event.ads
index e512432..483f317 100644
--- a/spec/fltk-event.ads
+++ b/spec/fltk-event.ads
@@ -79,6 +79,12 @@ package FLTK.Event is
procedure Set_Focus
(To : in FLTK.Widgets.Widget'Class);
+ function Has_Visible_Focus
+ return Boolean;
+
+ procedure Set_Visible_Focus
+ (To : in Boolean);
+
@@ -236,6 +242,8 @@ private
pragma Inline (Set_Below_Mouse);
pragma Inline (Get_Focus);
pragma Inline (Set_Focus);
+ pragma Inline (Has_Visible_Focus);
+ pragma Inline (Set_Visible_Focus);
pragma Inline (Compose);
pragma Inline (Compose_Reset);
diff --git a/spec/fltk-screen.ads b/spec/fltk-screen.ads
index 8a26d9c..ccfd224 100644
--- a/spec/fltk-screen.ads
+++ b/spec/fltk-screen.ads
@@ -9,7 +9,7 @@ package FLTK.Screen is
-- Environment --
- procedure Set_Display_Var
+ procedure Set_Display_String
(Value : in String);
@@ -90,7 +90,7 @@ package FLTK.Screen is
private
- pragma Inline (Set_Display_Var);
+ pragma Inline (Set_Display_String);
pragma Inline (Get_X);
pragma Inline (Get_Y);
diff --git a/spec/fltk-static.ads b/spec/fltk-static.ads
index 71d5b3f..a2a9ff4 100644
--- a/spec/fltk-static.ads
+++ b/spec/fltk-static.ads
@@ -18,10 +18,10 @@ package FLTK.Static is
type Awake_Handler is access procedure;
- type Timeout_Handler is access procedure;
-
type Idle_Handler is access procedure;
+ type Timeout_Handler is access procedure;
+
type Buffer_Kind is (Selection, Clipboard);
@@ -266,18 +266,12 @@ package FLTK.Static is
- -- Input Focus --
+ -- Input Methods --
procedure Enable_System_Input;
procedure Disable_System_Input;
- function Has_Visible_Focus
- return Boolean;
-
- procedure Set_Visible_Focus
- (To : in Boolean);
-
@@ -307,8 +301,6 @@ package FLTK.Static is
function Read_Queue
return access FLTK.Widgets.Widget'Class;
- procedure Do_Widget_Deletion;
-
@@ -366,8 +358,6 @@ private
pragma Import (C, Enable_System_Input, "fl_static_enable_im");
pragma Import (C, Disable_System_Input, "fl_static_disable_im");
- pragma Import (C, Do_Widget_Deletion, "fl_static_do_widget_deletion");
-
pragma Import (C, Reload_Scheme, "fl_static_reload_scheme");
@@ -427,8 +417,6 @@ private
pragma Inline (Enable_System_Input);
pragma Inline (Disable_System_Input);
- pragma Inline (Has_Visible_Focus);
- pragma Inline (Set_Visible_Focus);
pragma Inline (Default_Window_Close);
pragma Inline (Get_First_Window);
@@ -437,7 +425,6 @@ private
pragma Inline (Get_Top_Modal);
pragma Inline (Read_Queue);
- pragma Inline (Do_Widget_Deletion);
pragma Inline (Get_Scheme);
pragma Inline (Set_Scheme);
diff --git a/spec/fltk-widgets.ads b/spec/fltk-widgets.ads
index 144e1f7..67c1625 100644
--- a/spec/fltk-widgets.ads
+++ b/spec/fltk-widgets.ads
@@ -14,7 +14,6 @@ limited with
private with
- Ada.Unchecked_Conversion,
System.Address_To_Access_Conversions,
Interfaces.C,
FLTK.Widget_Callback_Conversions;
@@ -32,46 +31,6 @@ package FLTK.Widgets is
(Item : in out Widget'Class);
- type Callback_Flag is record
- Changed : Boolean := False;
- Interact : Boolean := False;
- Release : Boolean := False;
- Enter_Key : Boolean := False;
- end record;
-
- function "+" (Left, Right : in Callback_Flag) return Callback_Flag;
-
- Call_Never : constant Callback_Flag;
- When_Changed : constant Callback_Flag;
- When_Interact : constant Callback_Flag;
- When_Release : constant Callback_Flag;
- When_Release_Always : constant Callback_Flag;
- When_Enter_Key : constant Callback_Flag;
- When_Enter_Key_Always : constant Callback_Flag;
-
-
- type Damage_Mask is record
- Child : Boolean := False;
- Expose : Boolean := False;
- Scroll : Boolean := False;
- Overlay : Boolean := False;
- User_1 : Boolean := False;
- User_2 : Boolean := False;
- Full : Boolean := False;
- end record;
-
- function "+" (Left, Right : in Damage_Mask) return Damage_Mask;
-
- Damage_None : constant Damage_Mask;
- Damage_Child : constant Damage_Mask;
- Damage_Expose : constant Damage_Mask;
- Damage_Scroll : constant Damage_Mask;
- Damage_Overlay : constant Damage_Mask;
- Damage_User_1 : constant Damage_Mask;
- Damage_User_2 : constant Damage_Mask;
- Damage_Full : constant Damage_Mask;
-
-
package Forge is
@@ -557,64 +516,6 @@ private
(This : in out Widget);
- for Callback_Flag use record
- Changed at 0 range 0 .. 0;
- Interact at 0 range 1 .. 1;
- Release at 0 range 2 .. 2;
- Enter_Key at 0 range 3 .. 3;
- end record;
-
- for Callback_Flag'Size use Interfaces.C.unsigned_char'Size;
-
- Call_Never : constant Callback_Flag := (others => False);
- When_Changed : constant Callback_Flag := (Changed => True, others => False);
- When_Interact : constant Callback_Flag := (Interact => True, others => False);
- When_Release : constant Callback_Flag := (Release => True, others => False);
- When_Enter_Key : constant Callback_Flag := (Enter_Key => True, others => False);
-
- When_Release_Always : constant Callback_Flag :=
- (Release => True, Interact => True, others => False);
- When_Enter_Key_Always : constant Callback_Flag :=
- (Enter_Key => True, Interact => True, others => False);
-
-
- for Damage_Mask use record
- Child at 0 range 0 .. 0;
- Expose at 0 range 1 .. 1;
- Scroll at 0 range 2 .. 2;
- Overlay at 0 range 3 .. 3;
- User_1 at 0 range 4 .. 4;
- User_2 at 0 range 5 .. 5;
- -- bit 6 missing
- Full at 0 range 7 .. 7;
- end record;
-
- for Damage_Mask'Size use Interfaces.C.unsigned_char'Size;
-
- Damage_None : constant Damage_Mask := (others => False);
- Damage_Child : constant Damage_Mask := (Child => True, others => False);
- Damage_Expose : constant Damage_Mask := (Expose => True, others => False);
- Damage_Scroll : constant Damage_Mask := (Scroll => True, others => False);
- Damage_Overlay : constant Damage_Mask := (Overlay => True, others => False);
- Damage_User_1 : constant Damage_Mask := (User_1 => True, others => False);
- Damage_User_2 : constant Damage_Mask := (User_2 => True, others => False);
- Damage_Full : constant Damage_Mask := (Full => True, others => False);
-
-
- function Flag_To_UChar is new
- Ada.Unchecked_Conversion (Callback_Flag, Interfaces.C.unsigned_char);
-
- function UChar_To_Flag is new
- Ada.Unchecked_Conversion (Interfaces.C.unsigned_char, Callback_Flag);
-
-
- function Mask_To_UChar is new
- Ada.Unchecked_Conversion (Damage_Mask, Interfaces.C.unsigned_char);
-
- function UChar_To_Mask is new
- Ada.Unchecked_Conversion (Interfaces.C.unsigned_char, Damage_Mask);
-
-
-- the user data portion should always be a reference back to the Ada binding
procedure Callback_Hook
(W, U : in Storage.Integer_Address);
diff --git a/spec/fltk.ads b/spec/fltk.ads
index 24e68fe..ddac9b2 100644
--- a/spec/fltk.ads
+++ b/spec/fltk.ads
@@ -10,6 +10,7 @@ with
private with
+ Ada.Unchecked_Conversion,
Interfaces.C,
System.Storage_Elements;
@@ -416,13 +417,45 @@ package FLTK is
+ -- Callback Flags --
+
+ type Callback_Flag is record
+ Changed : Boolean := False;
+ Interact : Boolean := False;
+ Release : Boolean := False;
+ Enter_Key : Boolean := False;
+ end record;
+
+ function "+" (Left, Right : in Callback_Flag) return Callback_Flag;
+ function "-" (Left, Right : in Callback_Flag) return Callback_Flag;
+
+ Call_Never : constant Callback_Flag;
+ When_Changed : constant Callback_Flag;
+ When_Interact : constant Callback_Flag;
+ When_Release : constant Callback_Flag;
+ When_Release_Always : constant Callback_Flag;
+ When_Enter_Key : constant Callback_Flag;
+ When_Enter_Key_Always : constant Callback_Flag;
+
+
+
+
-- Menu Flags --
- -- Should these be moved to FLTK.Menu_Items?
+ -- It's easier to have this here rather than in Menu_Items for visibility reasons.
- type Menu_Flag is private;
+ type Menu_Flag is record
+ Inactive : Boolean := False;
+ Toggle : Boolean := False;
+ Value : Boolean := False;
+ Radio : Boolean := False;
+ Invisible : Boolean := False;
+ Submenu : Boolean := False;
+ Divider : Boolean := False;
+ end record;
function "+" (Left, Right : in Menu_Flag) return Menu_Flag;
+ function "-" (Left, Right : in Menu_Flag) return Menu_Flag;
Flag_Normal : constant Menu_Flag;
Flag_Inactive : constant Menu_Flag;
@@ -436,6 +469,33 @@ package FLTK is
+ -- Damage Bits --
+
+ type Damage_Mask is record
+ Child : Boolean := False;
+ Expose : Boolean := False;
+ Scroll : Boolean := False;
+ Overlay : Boolean := False;
+ User_1 : Boolean := False;
+ User_2 : Boolean := False;
+ Full : Boolean := False;
+ end record;
+
+ function "+" (Left, Right : in Damage_Mask) return Damage_Mask;
+ function "-" (Left, Right : in Damage_Mask) return Damage_Mask;
+
+ Damage_None : constant Damage_Mask;
+ Damage_Child : constant Damage_Mask;
+ Damage_Expose : constant Damage_Mask;
+ Damage_Scroll : constant Damage_Mask;
+ Damage_Overlay : constant Damage_Mask;
+ Damage_User_1 : constant Damage_Mask;
+ Damage_User_2 : constant Damage_Mask;
+ Damage_Full : constant Damage_Mask;
+
+
+
+
-- Versioning --
type Version_Number is new Natural;
@@ -687,17 +747,94 @@ private
- type Menu_Flag is new Interfaces.Unsigned_8;
+ for Callback_Flag use record
+ Changed at 0 range 0 .. 0;
+ Interact at 0 range 1 .. 1;
+ Release at 0 range 2 .. 2;
+ Enter_Key at 0 range 3 .. 3;
+ end record;
+
+ for Callback_Flag'Size use Interfaces.C.unsigned_char'Size;
+
+ Call_Never : constant Callback_Flag := (others => False);
+ When_Changed : constant Callback_Flag := (Changed => True, others => False);
+ When_Interact : constant Callback_Flag := (Interact => True, others => False);
+ When_Release : constant Callback_Flag := (Release => True, others => False);
+ When_Enter_Key : constant Callback_Flag := (Enter_Key => True, others => False);
+
+ When_Release_Always : constant Callback_Flag :=
+ (Release => True, Interact => True, others => False);
+ When_Enter_Key_Always : constant Callback_Flag :=
+ (Enter_Key => True, Interact => True, others => False);
+
+ function Flag_To_UChar is new
+ Ada.Unchecked_Conversion (Callback_Flag, Interfaces.C.unsigned_char);
+
+ function UChar_To_Flag is new
+ Ada.Unchecked_Conversion (Interfaces.C.unsigned_char, Callback_Flag);
+
+
+
+
+ for Menu_Flag use record
+ Inactive at 0 range 0 .. 0;
+ Toggle at 0 range 1 .. 1;
+ Value at 0 range 2 .. 2;
+ Radio at 0 range 3 .. 3;
+ Invisible at 0 range 4 .. 4;
+ -- Submenu_Pointer unused
+ Submenu at 0 range 6 .. 6;
+ Divider at 0 range 7 .. 7;
+ end record;
+
+ for Menu_Flag'Size use Interfaces.C.int'Size;
+
+ Flag_Normal : constant Menu_Flag := (others => False);
+ Flag_Inactive : constant Menu_Flag := (Inactive => True, others => False);
+ Flag_Toggle : constant Menu_Flag := (Toggle => True, others => False);
+ Flag_Value : constant Menu_Flag := (Value => True, others => False);
+ Flag_Radio : constant Menu_Flag := (Radio => True, others => False);
+ Flag_Invisible : constant Menu_Flag := (Invisible => True, others => False);
+ -- Flag_Submenu_Pointer unused
+ Flag_Submenu : constant Menu_Flag := (Submenu => True, others => False);
+ Flag_Divider : constant Menu_Flag := (Divider => True, others => False);
+
+ function MFlag_To_Cint is new
+ Ada.Unchecked_Conversion (Menu_Flag, Interfaces.C.int);
+
+ function Cint_To_MFlag is new
+ Ada.Unchecked_Conversion (Interfaces.C.int, Menu_Flag);
+
+
+
+
+ for Damage_Mask use record
+ Child at 0 range 0 .. 0;
+ Expose at 0 range 1 .. 1;
+ Scroll at 0 range 2 .. 2;
+ Overlay at 0 range 3 .. 3;
+ User_1 at 0 range 4 .. 4;
+ User_2 at 0 range 5 .. 5;
+ -- bit 6 missing
+ Full at 0 range 7 .. 7;
+ end record;
+
+ for Damage_Mask'Size use Interfaces.C.unsigned_char'Size;
+
+ Damage_None : constant Damage_Mask := (others => False);
+ Damage_Child : constant Damage_Mask := (Child => True, others => False);
+ Damage_Expose : constant Damage_Mask := (Expose => True, others => False);
+ Damage_Scroll : constant Damage_Mask := (Scroll => True, others => False);
+ Damage_Overlay : constant Damage_Mask := (Overlay => True, others => False);
+ Damage_User_1 : constant Damage_Mask := (User_1 => True, others => False);
+ Damage_User_2 : constant Damage_Mask := (User_2 => True, others => False);
+ Damage_Full : constant Damage_Mask := (Full => True, others => False);
+
+ function Mask_To_UChar is new
+ Ada.Unchecked_Conversion (Damage_Mask, Interfaces.C.unsigned_char);
- Flag_Normal : constant Menu_Flag := 2#00000000#;
- Flag_Inactive : constant Menu_Flag := 2#00000001#;
- Flag_Toggle : constant Menu_Flag := 2#00000010#;
- Flag_Value : constant Menu_Flag := 2#00000100#;
- Flag_Radio : constant Menu_Flag := 2#00001000#;
- Flag_Invisible : constant Menu_Flag := 2#00010000#;
- -- Flag_Submenu_Pointer unlikely to be used
- Flag_Submenu : constant Menu_Flag := 2#01000000#;
- Flag_Divider : constant Menu_Flag := 2#10000000#;
+ function UChar_To_Mask is new
+ Ada.Unchecked_Conversion (Interfaces.C.unsigned_char, Damage_Mask);
diff --git a/test/cursor.adb b/test/cursor.adb
index e968b6f..93d3f2b 100644
--- a/test/cursor.adb
+++ b/test/cursor.adb
@@ -16,7 +16,7 @@ with
use type
- FLTK.Widgets.Callback_Flag;
+ FLTK.Callback_Flag;
function Cursor
@@ -95,7 +95,7 @@ begin
The_Choices.Add ("FL_CURSOR_NONE", Choice_Callback'Unrestricted_Access);
The_Choices.Set_Callback (Choice_Callback'Unrestricted_Access);
- The_Choices.Set_When (FLTK.Widgets.When_Release + FLTK.Widgets.When_Interact);
+ The_Choices.Set_When (FLTK.When_Release + FLTK.When_Interact);
The_Choices.Set_Chosen (1);
The_Slider.Set_Alignment (FLTK.Align_Left);