diff options
author | Jed Barber <jjbarber@y7mail.com> | 2018-05-09 23:28:04 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2018-05-09 23:28:04 +1000 |
commit | cdcf5839899276b041b56b70798055f0d438bbdb (patch) | |
tree | 8f6637b3dfdbd92ab7d8b520b85aa7132290983d | |
parent | f18aa62c78dd25851d47b611f564a14fabb5a5e2 (diff) |
Text_Editor key bindings hopefully fixed, yet more polishing
-rw-r--r-- | doc/fl_graphics_driver.html | 197 | ||||
-rw-r--r-- | doc/fl_preferences.html | 449 | ||||
-rw-r--r-- | doc/fl_surface_device.html | 106 | ||||
-rw-r--r-- | doc/fl_text_editor.html | 573 | ||||
-rw-r--r-- | progress.txt | 12 | ||||
-rw-r--r-- | src/c_fl_graphics_driver.cpp | 18 | ||||
-rw-r--r-- | src/c_fl_graphics_driver.h | 18 | ||||
-rw-r--r-- | src/c_fl_preferences.h | 40 | ||||
-rw-r--r-- | src/c_fl_surface.cpp | 3 | ||||
-rw-r--r-- | src/c_fl_surface.h | 8 | ||||
-rw-r--r-- | src/c_fl_text_editor.h | 114 | ||||
-rw-r--r-- | src/fltk-devices-graphics.adb | 9 | ||||
-rw-r--r-- | src/fltk-devices-graphics.ads | 19 | ||||
-rw-r--r-- | src/fltk-devices-surfaces.adb | 4 | ||||
-rw-r--r-- | src/fltk-devices-surfaces.ads | 11 | ||||
-rw-r--r-- | src/fltk-environment.adb | 21 | ||||
-rw-r--r-- | src/fltk-environment.ads | 23 | ||||
-rw-r--r-- | src/fltk-widgets-groups-text_displays-text_editors.adb | 212 | ||||
-rw-r--r-- | src/fltk-widgets-groups-text_displays-text_editors.ads | 114 |
19 files changed, 1762 insertions, 189 deletions
diff --git a/doc/fl_graphics_driver.html b/doc/fl_graphics_driver.html new file mode 100644 index 0000000..9f613ef --- /dev/null +++ b/doc/fl_graphics_driver.html @@ -0,0 +1,197 @@ + +<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Fl_Graphics_Driver Binding Map</title> + <link href="map.css" rel="stylesheet"> + </head> + + <body> + + +<h2>Fl_Graphics_Driver Binding Map</h2> + + +<table class="package"> + <tr><th colspan="2">Package name</th></tr> + + <tr> + <td>Fl_Graphics_Driver</td> + <td>FLTK.Devices.Graphics</td> + </tr> + +</table> + + + +<table class="type"> + <tr><th colspan="2">Types</th></tr> + + <tr> + <td>Fl_Graphics_Driver</td> + <td>Graphics_Driver</td> + </tr> + + <tr> + <td> </td> + <td>Graphics_Driver_Reference</td> + </tr> + + <tr> + <td>matrix</td> + <td> </td> + </tr> + +</table> + + + +<table class="function"> + <tr><th colspan="2">Functions and Procedures</th></tr> + + <tr> +<td><pre> +Fl_Graphics_Driver(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +virtual const char * class_name(); +</pre></td> +<td>Use runtime tag checks instead</td> + </tr> + + <tr> +<td><pre> +Fl_Color color(); +</pre></td> +<td><pre> +function Get_Color + (This : in Graphics_Driver) + return Color; +</pre></td> + </tr> + + <tr> +<td><pre> +virtual int descent(); +</pre></td> +<td><pre> +function Get_Text_Descent + (This : in Graphics_Driver) + return Integer; +</pre></td> + </tr> + + <tr> +<td><pre> +virtual int draw_scaled(Fl_Image *img, int X, int Y, int W, int H); +</pre></td> +<td><pre> +procedure Draw_Scaled_Image + (This : in Graphics_Driver; + Img : in FLTK.Images.Image'Class; + X, Y, W, H : in Integer); +</pre></td> + </tr> + + <tr> +<td><pre> +virtual void font(Fl_Font face, Fl_Fontsize fsize); +</pre></td> +<td><pre> +procedure Set_Font + (This : in Graphics_Driver; + Face : in Font_Kind; + Size : in Font_Size); +</pre></td> + </tr> + + <tr> +<td><pre> +Fl_Font font(); +</pre></td> +<td><pre> +function Get_Font_Kind + (This : in Graphics_Driver) + return Font_Kind; +</pre></td> + </tr> + + <tr> +<td><pre> +Fl_Font_Descriptor * font_descriptor(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +void font_descriptor(Fl_Font_Descriptor *d); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +virtual int height(); +</pre></td> +<td><pre> +function Get_Line_Height + (This : in Graphics_Driver) + return Integer; +</pre></td> + </tr> + + <tr> +<td><pre> +Fl_Fontsize size(); +</pre></td> +<td><pre> +function Get_Font_Size + (This : in Graphics_Driver) + return Font_Size; +</pre></td> + </tr> + + <tr> +<td><pre> +virtual void text_extents(const char *, int n, int &dx, int &dy, int &w, int &h); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +virtual double width(const char *str, int n); +</pre></td> +<td><pre> +function Get_Width + (This : in Graphics_Driver; + Str : in String) + return Long_Float; +</pre></td> + </tr> + + <tr> +<td><pre> +virtual double width(unsigned int c); +</pre></td> +<td><pre> +function Get_Width + (This : in Graphics_Driver; + Char : in Character) + return Long_Float; +</pre></td> + </tr> + +</table> + + + </body> +</html> + diff --git a/doc/fl_preferences.html b/doc/fl_preferences.html new file mode 100644 index 0000000..b3d5ec0 --- /dev/null +++ b/doc/fl_preferences.html @@ -0,0 +1,449 @@ + +<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Fl_Preferences Binding Map</title> + <link href="map.css" rel="stylesheet"> + </head> + + <body> + + +<h2>Fl_Preferences Binding Map</h2> + + +<table class="package"> + <tr><th colspan="2">Package name</th></tr> + + <tr> + <td>Fl_Preferences</td> + <td>FLTK.Environment</td> + </tr> + +</table> + + + +<table class="type"> + <tr><th colspan="2">Types</th></tr> + + <tr> + <td>Fl_Preferences</td> + <td>Preferences</td> + </tr> + + <tr> + <td> </td> + <td>Preferences_Reference</td> + </tr> + + <tr> + <td>Entry</td> + <td> </td> + </tr> + + <tr> + <td>Root</td> + <td>Scope</td> + </tr> + + <tr> + <td>ID</td> + <td> </td> + </tr> + +</table> + + + +<table class="function"> + <tr><th colspan="2">Functions and Procedures</th></tr> + + <tr> +<td><pre> +Fl_Preferences(Root root, const char *vendor, const char *application); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +Fl_Preferences(const char *path, const char *vendor, const char *application); +</pre></td> +<td><pre> +function From_Filesystem + (Path, Vendor, Application : in String) + return Preferences; +</pre></td> + </tr> + + <tr> +<td><pre> +Fl_Preferences(Fl_Preferences &parent, const char *group); +Fl_Preferences(Fl_Preferences *parent, const char *group); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +Fl_Preferences(Fl_Preferences &parent, int groupIndex); +Fl_Preferences(Fl_Preferences *parent, int groupIndex); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +Fl_Preferences(const Fl_Preferences &); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char clear(); +</pre></td> +<td><pre> +procedure Clear + (This : in out Preferences); +</pre></td> + </tr> + + <tr> +<td><pre> +char deleteAllEntries(); +</pre></td> +<td><pre> +procedure Delete_All_Entries + (This : in out Preferences); +</pre></td> + </tr> + + <tr> +<td><pre> +char deleteAllGroups(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char deleteEntry(const char *entry); +</pre></td> +<td><pre> +procedure Delete_Entry + (This : in out Preferences; + Key : in String); +</pre></td> + </tr> + + <tr> +<td><pre> +char deleteGroup(const char *group); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +int entries(); +</pre></td> +<td><pre> +function Number_Of_Entries + (This : in Preferences) + return Natural; +</pre></td> + </tr> + + <tr> +<td><pre> +const char * entry(int index); +</pre></td> +<td><pre> +function Get_Key + (This : in Preferences; + Index : in Natural) + return String; +</pre></td> + </tr> + + <tr> +<td><pre> +char entryExists(const char *key); +</pre></td> +<td><pre> +function Entry_Exists + (This : in Preferences; + Key : in String) + return Boolean; +</pre></td> + </tr> + + <tr> +<td><pre> +void flush(); +</pre></td> +<td><pre> +procedure Flush + (This : in Preferences); +</pre></td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, int &value, int defaultValue); +</pre></td> +<td><pre> +function Get + (This : in Preferences; + Key : in String) + return Integer; + +function Get + (This : in Preferences; + Key : in String; + Default : in Integer) + return Integer; +</pre></td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, float &value, float defaultValue); +</pre></td> +<td><pre> +function Get + (This : in Preferences; + Key : in String) + return Float; + +function Get + (This : in Preferences; + Key : in String; + Default : in Float) + return Float; +</pre></td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, double &value, double defaultValue); +</pre></td> +<td><pre> +function Get + (This : in Preferences; + Key : in String) + return Long_Float; + +function Get + (This : in Preferences; + Key : in String; + Default : in Long_Float) + return Long_Float; +</pre></td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, char *&value, const char *defaultValue); +</pre></td> +<td><pre> +function Get + (This : in Preferences; + Key : in String) + return String; + +function Get + (This : in Preferences; + Key : in String; + Default : in String) + return String; +</pre></td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, char *value, const char *defaultValue, int maxSize); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, void *&value, const void *defaultValue, int defaultSize); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char get(const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char getUserdataPath(char *path, int pathlen); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +const char * group(int num_group); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char groupExists(const char *key); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +int groups(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +ID id(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +const char * name(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +const char * path(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, int value); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in Integer); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, float value); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in Float); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, float value, int precision); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in Float; + Precision : in Natural); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, double value); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in Long_Float); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, double value, int precision); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in Long_Float; + Precision : in Natural); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, const char *value); +</pre></td> +<td><pre> +procedure Set + (This : in out Preferences; + Key : in String; + Value : in String); +</pre></td> + </tr> + + <tr> +<td><pre> +char set(const char *entry, const void *value, int size); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +int size(const char *entry); +</pre></td> +<td><pre> +function Entry_Size + (This : in Preferences; + Key : in String) + return Natural; +</pre></td> + </tr> + + <tr> +<td><pre> +static const char * newUUID(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +static char remove(ID id_); +</pre></td> +<td>TBA</td> + </tr> + +</table> + + + </body> +</html> + diff --git a/doc/fl_surface_device.html b/doc/fl_surface_device.html new file mode 100644 index 0000000..6da46c9 --- /dev/null +++ b/doc/fl_surface_device.html @@ -0,0 +1,106 @@ + +<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Fl_Surface_Device Binding Map</title> + <link href="map.css" rel="stylesheet"> + </head> + + <body> + + +<h2>Fl_Surface_Device Binding Map</h2> + + +<table class="package"> + <tr><th colspan="2">Package name</th></tr> + + <tr> + <td>Fl_Surface_Device</td> + <td>FLTK.Devices.Surfaces</td> + </tr> + +</table> + + + +<table class="type"> + <tr><th colspan="2">Types</th></tr> + + <tr> + <td>Fl_Surface_Device</td> + <td>Surface_Device</td> + </tr> + + <tr> + <td> </td> + <td>Surface_Device_Reference</td> + </tr> + +</table> + + + +<table class="function"> + <tr><th colspan="2">Functions and Procedures</th></tr> + + <tr> +<td><pre> +Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver); +</pre></td> +<td><pre> +function Create + (Graphics : in out FLTK.Devices.Graphics.Graphics_Driver) + return Surface_Device; +</pre></td> + </tr> + + <tr> +<td><pre> +const char * class_name(); +</pre></td> +<td>Use runtime tag checks instead</td> + </tr> + + <tr> +<td><pre> +void driver(Fl_Graphics_Driver *graphics_driver); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +Fl_Graphics_Driver * driver(); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +virtual void set_current(void); +</pre></td> +<td><pre> +procedure Set_Current + (This : in out Surface_Device); +</pre></td> + </tr> + + <tr> +<td><pre> +static Fl_Surface_Device * surface(); +</pre></td> +<td><pre> +function Get_Current + return access Surface_Device'Class; +</pre></td> + </tr> + +</table> + + + </body> +</html> + diff --git a/doc/fl_text_editor.html b/doc/fl_text_editor.html new file mode 100644 index 0000000..88bf734 --- /dev/null +++ b/doc/fl_text_editor.html @@ -0,0 +1,573 @@ + +<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Fl_Text_Editor Binding Map</title> + <link href="map.css" rel="stylesheet"> + </head> + + <body> + + +<h2>Fl_Text_Editor Binding Map</h2> + + +<table class="package"> + <tr><th colspan="2">Package name</th></tr> + + <tr> + <td>Fl_Text_Editor</td> + <td>FLTK.Widgets.Groups.Text_Displays.Text_Editors</td> + </tr> + +</table> + + + +<table class="type"> + <tr><th colspan="2">Types</th></tr> + + <tr> + <td>Fl_Text_Editor</td> + <td>Text_Editor</td> + </tr> + + <tr> + <td> </td> + <td>Text_Editor_Reference</td> + </tr> + + <tr> + <td> </td> + <td>Insert_Mode</td> + </tr> + + <tr> + <td>Key_Func</td> + <td>Key_Func</td> + </tr> + + <tr> + <td> </td> + <td>Default_Key_Func</td> + </tr> + + <tr> + <td>Key_Binding</td> + <td>Key_Binding</td> + </tr> + + <tr> + <td> </td> + <td>Key_Binding_List</td> + </tr> + +</table> + + + +<table class="function"> + <tr><th colspan="2">Functions and Procedures</th></tr> + + <tr> +<td><pre> +Fl_Text_Editor(int X, int Y, int W, int H, const char *L=0); +</pre></td> +<td><pre> +function Create + (X, Y, W, H : in Integer; + Text : in String) + return Text_Editor; +</pre></td> + </tr> + + <tr> +<td><pre> +void add_default_key_bindings(Key_Binding **list); +</pre></td> +<td> </td> + </tr> + + <tr> +<td><pre> +void add_key_binding(int key, int state, Key_Func f, Key_Binding **list); +</pre></td> +<td><pre> +procedure Add_Key_Binding + (This : in out Text_Editor; + Bind : in Key_Binding); +</pre></td> + </tr> + + <tr> +<td><pre> +void add_key_binding(int key, int state, Key_Func f); +</pre></td> +<td><pre> +procedure Add_Key_Binding + (This : in out Text_Editor; + Key : in Key_Combo; + Func : in Key_Func); +</pre></td> + </tr> + + <tr> +<td> </td> +<td><pre> +procedure Add_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List); +</pre></td> + </tr> + + <tr> +<td><pre> +Key_Func bound_key_function(int key, int state, Key_Binding *list) const; +</pre></td> +<td> </td> + </tr> + + <tr> +<td><pre> +Key_Func bound_key_function(int key, int state) const; +</pre></td> +<td><pre> +function Get_Bound_Key_Function + (This : in Text_Editor; + Key : in Key_Combo) + return Key_Func; +</pre></td> + </tr> + + <tr> +<td><pre> +void default_key_function(Key_Func f); +</pre></td> +<td><pre> +procedure Set_Default_Key_Function + (This : in out Text_Editor; + Func : in Default_Key_Func); +</pre></td> + </tr> + + <tr> +<td> </td> +<td><pre> +function Get_Default_Key_Function + (This : in Text_Editor) + return Default_Key_Func; +</pre></td> + </tr> + + <tr> +<td> </td> +<td><pre> +procedure Draw + (This : in out Text_Editor); +</pre></td> + </tr> + + <tr> +<td><pre> +virtual int handle(int e); +</pre></td> +<td><pre> +function Handle + (This : in out Text_Editor; + Event : in Event_Kind) + return Event_Outcome; +</pre></td> + </tr> + + <tr> +<td><pre> +void insert_mode(int b); +</pre></td> +<td><pre> +procedure Set_Insert_Mode + (This : in out Text_Editor; + To : in Insert_Mode); +</pre></td> + </tr> + + <tr> +<td><pre> +int insert_mode(); +</pre></td> +<td><pre> +function Get_Insert_Mode + (This : in Text_Editor) + return Insert_Mode; +</pre></td> + </tr> + + <tr> +<td><pre> +void remove_all_key_bindings(Key_Binding **list); +</pre></td> +<td><pre> +procedure Remove_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List); +</pre></td> + </tr> + + <tr> +<td><pre> +void remove_all_key_bindings(); +</pre></td> +<td><pre> +procedure Remove_All_Key_Bindings + (This : in out Text_Editor); +</pre></td> + </tr> + + <tr> +<td><pre> +void remove_key_binding(int key, int state, Key_Binding **list); +</pre></td> +<td><pre> +procedure Remove_Key_Binding + (This : in out Text_Editor; + Bind : in Key_Binding); +</pre></td> + </tr> + + <tr> +<td><pre> +void remove_key_binding(int key, int state); +</pre></td> +<td><pre> +procedure Remove_Key_Binding + (This : in out Text_Editor; + Key : in Key_Combo); +</pre></td> + </tr> + + <tr> +<td><pre> +void tab_nav(int val); +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +int tab_nav() const; +</pre></td> +<td>TBA</td> + </tr> + + <tr> +<td><pre> +static int kf_backspace(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Backspace + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_c_s_move(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Ctrl_Shift_Home + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_End + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Page_Down + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Page_Up + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Down + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Left + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Right + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Shift_Up + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_copy(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Copy + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_ctrl_move(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Ctrl_Home + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_End + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Page_Down + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Page_Up + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Down + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Left + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Right + (This : in out Text_Editor'Class); + +procedure KF_Ctrl_Up + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_cut(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Cut + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_default(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Default + (This : in out Text_Editor'Class; + Key : in Key_Combo); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_delete(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Delete + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_down(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Down + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_end(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_End + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_enter(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Enter + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_home(int, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Home + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_ignore(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Ignore + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_insert(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Insert + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_left(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Left + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_m_s_move(int c, Fl_Text_Editor *e); +</pre></td> +<td> </td> + </tr> + + <tr> +<td><pre> +static int kf_meta_move(int c, Fl_Text_Editor *e); +</pre></td> +<td> </td> + </tr> + + <tr> +<td><pre> +static int kf_move(int c, Fl_Text_Editor *e); +</pre></td> +<td> </td> + </tr> + + <tr> +<td><pre> +static int kf_page_down(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Page_Down + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_page_up(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Page_Up + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_paste(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Paste + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_right(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Right + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_select_all(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Select_All + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_shift_move(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Shift_Home + (This : in out Text_Editor'Class); + +procedure KF_Shift_End + (This : in out Text_Editor'Class); + +procedure KF_Shift_Page_Down + (This : in out Text_Editor'Class); + +procedure KF_Shift_Page_Up + (This : in out Text_Editor'Class); + +procedure KF_Shift_Down + (This : in out Text_Editor'Class); + +procedure KF_Shift_Left + (This : in out Text_Editor'Class); + +procedure KF_Shift_Right + (This : in out Text_Editor'Class); + +procedure KF_Shift_Up + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_undo(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure Undo + (This : in out Text_Editor'Class); +</pre></td> + </tr> + + <tr> +<td><pre> +static int kf_up(int c, Fl_Text_Editor *e); +</pre></td> +<td><pre> +procedure KF_Up + (This : in out Text_Editor'Class); +</pre></td> + </tr> + +</table> + + + </body> +</html> + diff --git a/progress.txt b/progress.txt index bcfa1ec..9dcba9f 100644 --- a/progress.txt +++ b/progress.txt @@ -56,6 +56,7 @@ FLTK.Widgets.Groups.Scrolls FLTK.Widgets.Groups.Spinners FLTK.Widgets.Groups.Tabbed FLTK.Widgets.Groups.Text_Displays +FLTK.Widgets.Groups.Text_Displays.Text_Editors FLTK.Widgets.Groups.Tiled FLTK.Widgets.Groups.Windows FLTK.Widgets.Groups.Windows.Double @@ -96,16 +97,14 @@ FLTK.Widgets.Valuators.Sliders.Horizontal Done: -FLTK.Widgets.Groups.Text_Displays.Text_Editors - Partially Done: -FLTK.Devices.Graphics -FLTK.Devices.Surfaces -FLTK.Environment +FLTK.Devices.Graphics (incomplete API, otherwise polished) +FLTK.Devices.Surfaces (incomplete API, otherwise polished) +FLTK.Environment (incomplete API, otherwise polished) FLTK.Widgets FLTK.Widgets.Groups FLTK.Widgets.Menus @@ -142,9 +141,7 @@ FL_Cairo_Window - mark all methods as inline - make sure all C++ reinterpret_cast for methods is to the Fl object, not the My object, because inheriting -- consistent unicode utf-8 support (is this even fully supported by FLTK? if not, nevermind...) - check FLTK library internals to see which char* return values need dealloc -- remove custom exception types in favour of Program_Error? or at least a generic FLTK_Error? - qualify all C++ virtual method calls with the class name to prevent dynamic dispatch on C++ side - provide documentation for how C++ methods map to Ada functions and procedures @@ -160,6 +157,7 @@ Bugs to fix: Fl_Help_View ABI_VERSION checks Fl_Tooltip ABI_VERSION checks +Fl_Text_Editor tab_nav ABI_VERSION checks Fl_Wizard draw() method private/protected GNAT bug with type_invariant combined with derived type and a begin section in a package, eg dialogs.adb diff --git a/src/c_fl_graphics_driver.cpp b/src/c_fl_graphics_driver.cpp index 187ece9..73112b4 100644 --- a/src/c_fl_graphics_driver.cpp +++ b/src/c_fl_graphics_driver.cpp @@ -15,19 +15,23 @@ unsigned int fl_graphics_driver_color(GRAPHICS_DRIVER g) { int fl_graphics_driver_descent(GRAPHICS_DRIVER g) { - return reinterpret_cast<Fl_Graphics_Driver*>(g)->descent(); + // virtual so disable dispatch + return reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::descent(); } int fl_graphics_driver_height(GRAPHICS_DRIVER g) { - return reinterpret_cast<Fl_Graphics_Driver*>(g)->height(); + // virtual so disable dispatch + return reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::height(); } double fl_graphics_driver_width(GRAPHICS_DRIVER g, unsigned int c) { - return reinterpret_cast<Fl_Graphics_Driver*>(g)->width(c); + // virtual so disable dispatch + return reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::width(c); } double fl_graphics_driver_width2(GRAPHICS_DRIVER g, const char * s, int l) { - return reinterpret_cast<Fl_Graphics_Driver*>(g)->width(s,l); + // virtual so disable dispatch + return reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::width(s,l); } int fl_graphics_driver_get_font(GRAPHICS_DRIVER g) { @@ -39,14 +43,16 @@ int fl_graphics_driver_size(GRAPHICS_DRIVER g) { } void fl_graphics_driver_set_font(GRAPHICS_DRIVER g, int f, int s) { - reinterpret_cast<Fl_Graphics_Driver*>(g)->font(f,s); + // virtual so disable dispatch + reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::font(f,s); } void fl_graphics_driver_draw_scaled(GRAPHICS_DRIVER g, void * i, int x, int y, int w, int h) { - reinterpret_cast<Fl_Graphics_Driver*>(g)->draw_scaled(reinterpret_cast<Fl_Image*>(i),x,y,w,h); + // virtual so disable dispatch + reinterpret_cast<Fl_Graphics_Driver*>(g)->Fl_Graphics_Driver::draw_scaled(reinterpret_cast<Fl_Image*>(i),x,y,w,h); } diff --git a/src/c_fl_graphics_driver.h b/src/c_fl_graphics_driver.h index d255400..545a300 100644 --- a/src/c_fl_graphics_driver.h +++ b/src/c_fl_graphics_driver.h @@ -11,19 +11,19 @@ typedef void* GRAPHICS_DRIVER; -extern "C" unsigned int fl_graphics_driver_color(GRAPHICS_DRIVER g); +extern "C" inline unsigned int fl_graphics_driver_color(GRAPHICS_DRIVER g); -extern "C" int fl_graphics_driver_descent(GRAPHICS_DRIVER g); -extern "C" int fl_graphics_driver_height(GRAPHICS_DRIVER g); -extern "C" double fl_graphics_driver_width(GRAPHICS_DRIVER g, unsigned int c); -extern "C" double fl_graphics_driver_width2(GRAPHICS_DRIVER g, const char * s, int l); -extern "C" int fl_graphics_driver_get_font(GRAPHICS_DRIVER g); -extern "C" int fl_graphics_driver_size(GRAPHICS_DRIVER g); -extern "C" void fl_graphics_driver_set_font(GRAPHICS_DRIVER g, int f, int s); +extern "C" inline int fl_graphics_driver_descent(GRAPHICS_DRIVER g); +extern "C" inline int fl_graphics_driver_height(GRAPHICS_DRIVER g); +extern "C" inline double fl_graphics_driver_width(GRAPHICS_DRIVER g, unsigned int c); +extern "C" inline double fl_graphics_driver_width2(GRAPHICS_DRIVER g, const char * s, int l); +extern "C" inline int fl_graphics_driver_get_font(GRAPHICS_DRIVER g); +extern "C" inline int fl_graphics_driver_size(GRAPHICS_DRIVER g); +extern "C" inline void fl_graphics_driver_set_font(GRAPHICS_DRIVER g, int f, int s); -extern "C" void fl_graphics_driver_draw_scaled(GRAPHICS_DRIVER g, void * i, int x, int y, int w, int h); +extern "C" inline void fl_graphics_driver_draw_scaled(GRAPHICS_DRIVER g, void * i, int x, int y, int w, int h); #endif diff --git a/src/c_fl_preferences.h b/src/c_fl_preferences.h index e8581c2..9bda444 100644 --- a/src/c_fl_preferences.h +++ b/src/c_fl_preferences.h @@ -11,38 +11,38 @@ typedef void* PREFS; -extern "C" PREFS new_fl_preferences(char * p, char * v, char * a); -extern "C" void free_fl_preferences(PREFS e); +extern "C" inline PREFS new_fl_preferences(char * p, char * v, char * a); +extern "C" inline void free_fl_preferences(PREFS e); -extern "C" int fl_preferences_entries(PREFS e); -extern "C" const char * fl_preferences_entry(PREFS e, int i); -extern "C" int fl_preferences_entryexists(PREFS e, const char * k); -extern "C" int fl_preferences_size(PREFS e, const char * k); +extern "C" inline int fl_preferences_entries(PREFS e); +extern "C" inline const char * fl_preferences_entry(PREFS e, int i); +extern "C" inline int fl_preferences_entryexists(PREFS e, const char * k); +extern "C" inline int fl_preferences_size(PREFS e, const char * k); -extern "C" int fl_preferences_get_int(PREFS e, const char * k, int& v, int d); -extern "C" int fl_preferences_get_float(PREFS e, const char * k, float& v, float d); -extern "C" int fl_preferences_get_double(PREFS e, const char * k, double& v, double d); -extern "C" int fl_preferences_get_str(PREFS e, const char * k, char *& v, const char * d); +extern "C" inline int fl_preferences_get_int(PREFS e, const char * k, int& v, int d); +extern "C" inline int fl_preferences_get_float(PREFS e, const char * k, float& v, float d); +extern "C" inline int fl_preferences_get_double(PREFS e, const char * k, double& v, double d); +extern "C" inline int fl_preferences_get_str(PREFS e, const char * k, char *& v, const char * d); -extern "C" int fl_preferences_set_int(PREFS e, const char * k, int v); -extern "C" int fl_preferences_set_float(PREFS e, const char * k, float v); -extern "C" int fl_preferences_set_float_prec(PREFS e, const char * k, float v, int p); -extern "C" int fl_preferences_set_double(PREFS e, const char * k, double v); -extern "C" int fl_preferences_set_double_prec(PREFS e, const char * k, double v, int p); -extern "C" int fl_preferences_set_str(PREFS e, const char * k, const char * v); +extern "C" inline int fl_preferences_set_int(PREFS e, const char * k, int v); +extern "C" inline int fl_preferences_set_float(PREFS e, const char * k, float v); +extern "C" inline int fl_preferences_set_float_prec(PREFS e, const char * k, float v, int p); +extern "C" inline int fl_preferences_set_double(PREFS e, const char * k, double v); +extern "C" inline int fl_preferences_set_double_prec(PREFS e, const char * k, double v, int p); +extern "C" inline int fl_preferences_set_str(PREFS e, const char * k, const char * v); -extern "C" int fl_preferences_deleteentry(PREFS e, const char * k); -extern "C" int fl_preferences_deleteallentries(PREFS e); -extern "C" int fl_preferences_clear(PREFS e); +extern "C" inline int fl_preferences_deleteentry(PREFS e, const char * k); +extern "C" inline int fl_preferences_deleteallentries(PREFS e); +extern "C" inline int fl_preferences_clear(PREFS e); -extern "C" void fl_preferences_flush(PREFS e); +extern "C" inline void fl_preferences_flush(PREFS e); #endif diff --git a/src/c_fl_surface.cpp b/src/c_fl_surface.cpp index 89d661f..ea37c9e 100644 --- a/src/c_fl_surface.cpp +++ b/src/c_fl_surface.cpp @@ -28,7 +28,8 @@ void free_fl_surface(SURFACE s) { void fl_surface_set_current(SURFACE s) { - reinterpret_cast<Fl_Surface_Device*>(s)->set_current(); + // virtual so disable dispatch + reinterpret_cast<Fl_Surface_Device*>(s)->Fl_Surface_Device::set_current(); } SURFACE fl_surface_get_surface(void) { diff --git a/src/c_fl_surface.h b/src/c_fl_surface.h index dd8d8e9..c763709 100644 --- a/src/c_fl_surface.h +++ b/src/c_fl_surface.h @@ -11,14 +11,14 @@ typedef void* SURFACE; -extern "C" SURFACE new_fl_surface(void * g); -extern "C" void free_fl_surface(SURFACE s); +extern "C" inline SURFACE new_fl_surface(void * g); +extern "C" inline void free_fl_surface(SURFACE s); -extern "C" void fl_surface_set_current(SURFACE s); -extern "C" SURFACE fl_surface_get_surface(void); +extern "C" inline void fl_surface_set_current(SURFACE s); +extern "C" inline SURFACE fl_surface_get_surface(void); #endif diff --git a/src/c_fl_text_editor.h b/src/c_fl_text_editor.h index 5f73cbc..0fabaff 100644 --- a/src/c_fl_text_editor.h +++ b/src/c_fl_text_editor.h @@ -11,89 +11,89 @@ typedef void* TEXTEDITOR; -extern "C" void text_editor_set_draw_hook(TEXTEDITOR te, void * d); -extern "C" void fl_text_editor_draw(TEXTEDITOR te); -extern "C" void text_editor_set_handle_hook(TEXTEDITOR te, void * h); -extern "C" int fl_text_editor_handle(TEXTEDITOR te, int e); +extern "C" inline void text_editor_set_draw_hook(TEXTEDITOR te, void * d); +extern "C" inline void fl_text_editor_draw(TEXTEDITOR te); +extern "C" inline void text_editor_set_handle_hook(TEXTEDITOR te, void * h); +extern "C" inline int fl_text_editor_handle(TEXTEDITOR te, int e); -extern "C" TEXTEDITOR new_fl_text_editor(int x, int y, int w, int h, char* label); -extern "C" void free_fl_text_editor(TEXTEDITOR te); +extern "C" inline TEXTEDITOR new_fl_text_editor(int x, int y, int w, int h, char* label); +extern "C" inline void free_fl_text_editor(TEXTEDITOR te); -extern "C" void fl_text_editor_default(TEXTEDITOR te, int k); +extern "C" inline void fl_text_editor_default(TEXTEDITOR te, int k); -extern "C" void fl_text_editor_undo(TEXTEDITOR te); -extern "C" void fl_text_editor_cut(TEXTEDITOR te); -extern "C" void fl_text_editor_copy(TEXTEDITOR te); -extern "C" void fl_text_editor_paste(TEXTEDITOR te); -extern "C" void fl_text_editor_delete(TEXTEDITOR te); -extern "C" void fl_text_editor_select_all(TEXTEDITOR te); +extern "C" inline void fl_text_editor_undo(TEXTEDITOR te); +extern "C" inline void fl_text_editor_cut(TEXTEDITOR te); +extern "C" inline void fl_text_editor_copy(TEXTEDITOR te); +extern "C" inline void fl_text_editor_paste(TEXTEDITOR te); +extern "C" inline void fl_text_editor_delete(TEXTEDITOR te); +extern "C" inline void fl_text_editor_select_all(TEXTEDITOR te); -extern "C" void fl_text_editor_backspace(TEXTEDITOR te); -extern "C" void fl_text_editor_insert(TEXTEDITOR te); -extern "C" void fl_text_editor_enter(TEXTEDITOR te); -extern "C" void fl_text_editor_ignore(TEXTEDITOR te); +extern "C" inline void fl_text_editor_backspace(TEXTEDITOR te); +extern "C" inline void fl_text_editor_insert(TEXTEDITOR te); +extern "C" inline void fl_text_editor_enter(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ignore(TEXTEDITOR te); -extern "C" void fl_text_editor_home(TEXTEDITOR te); -extern "C" void fl_text_editor_end(TEXTEDITOR te); -extern "C" void fl_text_editor_page_down(TEXTEDITOR te); -extern "C" void fl_text_editor_page_up(TEXTEDITOR te); -extern "C" void fl_text_editor_down(TEXTEDITOR te); -extern "C" void fl_text_editor_left(TEXTEDITOR te); -extern "C" void fl_text_editor_right(TEXTEDITOR te); -extern "C" void fl_text_editor_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_home(TEXTEDITOR te); +extern "C" inline void fl_text_editor_end(TEXTEDITOR te); +extern "C" inline void fl_text_editor_page_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_page_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_left(TEXTEDITOR te); +extern "C" inline void fl_text_editor_right(TEXTEDITOR te); +extern "C" inline void fl_text_editor_up(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_home(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_end(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_page_down(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_page_up(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_down(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_left(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_right(TEXTEDITOR te); -extern "C" void fl_text_editor_shift_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_home(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_end(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_page_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_page_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_left(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_right(TEXTEDITOR te); +extern "C" inline void fl_text_editor_shift_up(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_home(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_end(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_page_down(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_page_up(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_down(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_left(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_right(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_home(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_end(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_page_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_page_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_left(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_right(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_up(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_home(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_end(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_page_down(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_page_up(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_down(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_left(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_right(TEXTEDITOR te); -extern "C" void fl_text_editor_ctrl_shift_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_home(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_end(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_page_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_page_up(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_down(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_left(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_right(TEXTEDITOR te); +extern "C" inline void fl_text_editor_ctrl_shift_up(TEXTEDITOR te); -extern "C" void fl_text_editor_add_key_binding(TEXTEDITOR te, int k, int s, void * f); -extern "C" void fl_text_editor_remove_key_binding(TEXTEDITOR te, int k, int s); -extern "C" void fl_text_editor_remove_all_key_bindings(TEXTEDITOR te); -extern "C" void fl_text_editor_set_default_key_function(TEXTEDITOR te, void * f); +extern "C" inline void fl_text_editor_add_key_binding(TEXTEDITOR te, int k, int s, void * f); +extern "C" inline void fl_text_editor_remove_key_binding(TEXTEDITOR te, int k, int s); +extern "C" inline void fl_text_editor_remove_all_key_bindings(TEXTEDITOR te); +extern "C" inline void fl_text_editor_set_default_key_function(TEXTEDITOR te, void * f); -extern "C" int fl_text_editor_get_insert_mode(TEXTEDITOR te); -extern "C" void fl_text_editor_set_insert_mode(TEXTEDITOR te, int i); +extern "C" inline int fl_text_editor_get_insert_mode(TEXTEDITOR te); +extern "C" inline void fl_text_editor_set_insert_mode(TEXTEDITOR te, int i); -//extern "C" int fl_text_editor_get_tab_nav(TEXTEDITOR te); -//extern "C" void fl_text_editor_set_tab_nav(TEXTEDITOR te, int t); +//extern "C" inline int fl_text_editor_get_tab_nav(TEXTEDITOR te); +//extern "C" inline void fl_text_editor_set_tab_nav(TEXTEDITOR te, int t); #endif diff --git a/src/fltk-devices-graphics.adb b/src/fltk-devices-graphics.adb index 1341d67..e267690 100644 --- a/src/fltk-devices-graphics.adb +++ b/src/fltk-devices-graphics.adb @@ -13,6 +13,7 @@ package body FLTK.Devices.Graphics is (G : in System.Address) return Interfaces.C.unsigned; pragma Import (C, fl_graphics_driver_color, "fl_graphics_driver_color"); + pragma Inline (fl_graphics_driver_color); @@ -21,17 +22,20 @@ package body FLTK.Devices.Graphics is (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_descent, "fl_graphics_driver_descent"); + pragma Inline (fl_graphics_driver_descent); function fl_graphics_driver_height (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_height, "fl_graphics_driver_height"); + pragma Inline (fl_graphics_driver_height); function fl_graphics_driver_width (G : in System.Address; C : in Interfaces.C.unsigned) return Interfaces.C.double; pragma Import (C, fl_graphics_driver_width, "fl_graphics_driver_width"); + pragma Inline (fl_graphics_driver_width); function fl_graphics_driver_width2 (G : in System.Address; @@ -39,21 +43,25 @@ package body FLTK.Devices.Graphics is L : in Interfaces.C.int) return Interfaces.C.double; pragma Import (C, fl_graphics_driver_width2, "fl_graphics_driver_width2"); + pragma Inline (fl_graphics_driver_width2); function fl_graphics_driver_get_font (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_get_font, "fl_graphics_driver_get_font"); + pragma Inline (fl_graphics_driver_get_font); function fl_graphics_driver_size (G : in System.Address) return Interfaces.C.int; pragma Import (C, fl_graphics_driver_size, "fl_graphics_driver_size"); + pragma Inline (fl_graphics_driver_size); procedure fl_graphics_driver_set_font (G : in System.Address; K, S : in Interfaces.C.int); pragma Import (C, fl_graphics_driver_set_font, "fl_graphics_driver_set_font"); + pragma Inline (fl_graphics_driver_set_font); @@ -62,6 +70,7 @@ package body FLTK.Devices.Graphics is (G, I : in System.Address; X, Y, W, H : in Interfaces.C.int); pragma Import (C, fl_graphics_driver_draw_scaled, "fl_graphics_driver_draw_scaled"); + pragma Inline (fl_graphics_driver_draw_scaled); diff --git a/src/fltk-devices-graphics.ads b/src/fltk-devices-graphics.ads index b407da4..abb6c5f 100644 --- a/src/fltk-devices-graphics.ads +++ b/src/fltk-devices-graphics.ads @@ -10,6 +10,9 @@ package FLTK.Devices.Graphics is type Graphics_Driver is new Device with private; + type Graphics_Driver_Reference (Data : not null access Graphics_Driver'Class) is + limited null record with Implicit_Dereference => Data; + @@ -66,5 +69,21 @@ private type Graphics_Driver is new Device with null record; + + + pragma Inline (Get_Color); + + + pragma Inline (Get_Text_Descent); + pragma Inline (Get_Line_Height); + pragma Inline (Get_Width); + pragma Inline (Get_Font_Kind); + pragma Inline (Get_Font_Size); + pragma Inline (Set_Font); + + + pragma Inline (Draw_Scaled_Image); + + end FLTK.Devices.Graphics; diff --git a/src/fltk-devices-surfaces.adb b/src/fltk-devices-surfaces.adb index 7b95bec..400bd87 100644 --- a/src/fltk-devices-surfaces.adb +++ b/src/fltk-devices-surfaces.adb @@ -16,10 +16,12 @@ package body FLTK.Devices.Surfaces is (G : in System.Address) return System.Address; pragma Import (C, new_fl_surface, "new_fl_surface"); + pragma Inline (new_fl_surface); procedure free_fl_surface (S : in System.Address); pragma Import (C, free_fl_surface, "free_fl_surface"); + pragma Inline (free_fl_surface); @@ -27,10 +29,12 @@ package body FLTK.Devices.Surfaces is procedure fl_surface_set_current (S : in System.Address); pragma Import (C, fl_surface_set_current, "fl_surface_set_current"); + pragma Inline (fl_surface_set_current); function fl_surface_get_surface return System.Address; pragma Import (C, fl_surface_get_surface, "fl_surface_get_surface"); + pragma Inline (fl_surface_get_surface); diff --git a/src/fltk-devices-surfaces.ads b/src/fltk-devices-surfaces.ads index 418903e..24a2838 100644 --- a/src/fltk-devices-surfaces.ads +++ b/src/fltk-devices-surfaces.ads @@ -10,6 +10,9 @@ package FLTK.Devices.Surfaces is type Surface_Device is new Device with private; + type Surface_Device_Reference (Data : not null access Surface_Device'Class) is + limited null record with Implicit_Dereference => Data; + @@ -40,9 +43,17 @@ private (This : in out Surface_Device); + + Original_Surface : aliased Surface_Device; Current_Ptr : access Surface_Device'Class := Original_Surface'Access; + + + pragma Inline (Get_Current); + pragma Inline (Set_Current); + + end FLTK.Devices.Surfaces; diff --git a/src/fltk-environment.adb b/src/fltk-environment.adb index 22a0bd9..1c4cf28 100644 --- a/src/fltk-environment.adb +++ b/src/fltk-environment.adb @@ -18,10 +18,12 @@ package body FLTK.Environment is (P, V, A : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_preferences, "new_fl_preferences"); + pragma Inline (new_fl_preferences); procedure free_fl_preferences (E : in System.Address); pragma Import (C, free_fl_preferences, "free_fl_preferences"); + pragma Inline (free_fl_preferences); @@ -30,24 +32,28 @@ package body FLTK.Environment is (E : in System.Address) return Interfaces.C.int; pragma Import (C, fl_preferences_entries, "fl_preferences_entries"); + pragma Inline (fl_preferences_entries); function fl_preferences_entry (E : in System.Address; I : in Interfaces.C.int) return Interfaces.C.Strings.chars_ptr; pragma Import (C, fl_preferences_entry, "fl_preferences_entry"); + pragma Inline (fl_preferences_entry); function fl_preferences_entryexists (E : in System.Address; K : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, fl_preferences_entryexists, "fl_preferences_entryexists"); + pragma Inline (fl_preferences_entryexists); function fl_preferences_size (E : in System.Address; K : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, fl_preferences_size, "fl_preferences_size"); + pragma Inline (fl_preferences_size); @@ -59,6 +65,7 @@ package body FLTK.Environment is D : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_preferences_get_int, "fl_preferences_get_int"); + pragma Inline (fl_preferences_get_int); function fl_preferences_get_float (E : in System.Address; @@ -67,6 +74,7 @@ package body FLTK.Environment is D : in Interfaces.C.C_float) return Interfaces.C.int; pragma Import (C, fl_preferences_get_float, "fl_preferences_get_float"); + pragma Inline (fl_preferences_get_float); function fl_preferences_get_double (E : in System.Address; @@ -75,6 +83,7 @@ package body FLTK.Environment is D : in Interfaces.C.double) return Interfaces.C.int; pragma Import (C, fl_preferences_get_double, "fl_preferences_get_double"); + pragma Inline (fl_preferences_get_double); function fl_preferences_get_str (E : in System.Address; @@ -83,6 +92,7 @@ package body FLTK.Environment is D : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, fl_preferences_get_str, "fl_preferences_get_str"); + pragma Inline (fl_preferences_get_str); @@ -93,6 +103,7 @@ package body FLTK.Environment is V : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_preferences_set_int, "fl_preferences_set_int"); + pragma Inline (fl_preferences_set_int); function fl_preferences_set_float (E : in System.Address; @@ -100,6 +111,7 @@ package body FLTK.Environment is V : in Interfaces.C.C_float) return Interfaces.C.int; pragma Import (C, fl_preferences_set_float, "fl_preferences_set_float"); + pragma Inline (fl_preferences_set_float); function fl_preferences_set_float_prec (E : in System.Address; @@ -108,6 +120,7 @@ package body FLTK.Environment is P : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_preferences_set_float_prec, "fl_preferences_set_float_prec"); + pragma Inline (fl_preferences_set_float_prec); function fl_preferences_set_double (E : in System.Address; @@ -115,6 +128,7 @@ package body FLTK.Environment is V : in Interfaces.C.double) return Interfaces.C.int; pragma Import (C, fl_preferences_set_double, "fl_preferences_set_double"); + pragma Inline (fl_preferences_set_double); function fl_preferences_set_double_prec (E : in System.Address; @@ -123,6 +137,7 @@ package body FLTK.Environment is P : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_preferences_set_double_prec, "fl_preferences_set_double_prec"); + pragma Inline (fl_preferences_set_double_prec); function fl_preferences_set_str (E : in System.Address; @@ -130,6 +145,7 @@ package body FLTK.Environment is V : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, fl_preferences_set_str, "fl_preferences_set_str"); + pragma Inline (fl_preferences_set_str); @@ -139,16 +155,19 @@ package body FLTK.Environment is K : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, fl_preferences_deleteentry, "fl_preferences_deleteentry"); + pragma Inline (fl_preferences_deleteentry); function fl_preferences_deleteallentries (E : in System.Address) return Interfaces.C.int; pragma Import (C, fl_preferences_deleteallentries, "fl_preferences_deleteallentries"); + pragma Inline (fl_preferences_deleteallentries); function fl_preferences_clear (E : in System.Address) return Interfaces.C.int; pragma Import (C, fl_preferences_clear, "fl_preferences_clear"); + pragma Inline (fl_preferences_clear); @@ -156,6 +175,7 @@ package body FLTK.Environment is procedure fl_preferences_flush (E : in System.Address); pragma Import (C, fl_preferences_flush, "fl_preferences_flush"); + pragma Inline (fl_preferences_flush); @@ -210,6 +230,7 @@ package body FLTK.Environment is fl_preferences_entry (This.Void_Ptr, Interfaces.C.int (Index)); Str : String := Interfaces.C.Strings.Value (Key); begin + -- no need for dealloc? return Str; end Get_Key; diff --git a/src/fltk-environment.ads b/src/fltk-environment.ads index a163d19..cfa63a8 100644 --- a/src/fltk-environment.ads +++ b/src/fltk-environment.ads @@ -5,6 +5,9 @@ package FLTK.Environment is type Preferences is new Wrapper with private; + type Preferences_Reference (Data : not null access Preferences'Class) is + limited null record with Implicit_Dereference => Data; + type Scope is (Root, User); @@ -159,5 +162,25 @@ private (This : in out Preferences); + + + pragma Inline (Number_Of_Entries); + pragma Inline (Get_Key); + pragma Inline (Entry_Exists); + pragma Inline (Entry_Size); + + + pragma Inline (Get); + pragma Inline (Set); + + + pragma Inline (Delete_Entry); + pragma Inline (Delete_All_Entries); + pragma Inline (Clear); + + + pragma Inline (Flush); + + end FLTK.Environment; diff --git a/src/fltk-widgets-groups-text_displays-text_editors.adb b/src/fltk-widgets-groups-text_displays-text_editors.adb index f467862..9d0f51b 100644 --- a/src/fltk-widgets-groups-text_displays-text_editors.adb +++ b/src/fltk-widgets-groups-text_displays-text_editors.adb @@ -2,11 +2,13 @@ with + FLTK.Event, Interfaces.C, System; use type + Interfaces.C.unsigned_long, System.Address; @@ -16,10 +18,12 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure text_editor_set_draw_hook (W, D : in System.Address); pragma Import (C, text_editor_set_draw_hook, "text_editor_set_draw_hook"); + pragma Inline (text_editor_set_draw_hook); procedure text_editor_set_handle_hook (W, H : in System.Address); pragma Import (C, text_editor_set_handle_hook, "text_editor_set_handle_hook"); + pragma Inline (text_editor_set_handle_hook); @@ -29,10 +33,12 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is Text : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_text_editor, "new_fl_text_editor"); + pragma Inline (new_fl_text_editor); procedure free_fl_text_editor (TE : in System.Address); pragma Import (C, free_fl_text_editor, "free_fl_text_editor"); + pragma Inline (free_fl_text_editor); @@ -41,6 +47,7 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is (TE : in System.Address; K : in Interfaces.C.int); pragma Import (C, fl_text_editor_default, "fl_text_editor_default"); + pragma Inline (fl_text_editor_default); @@ -48,26 +55,32 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_undo (TE : in System.Address); pragma Import (C, fl_text_editor_undo, "fl_text_editor_undo"); + pragma Inline (fl_text_editor_undo); procedure fl_text_editor_cut (TE : in System.Address); pragma Import (C, fl_text_editor_cut, "fl_text_editor_cut"); + pragma Inline (fl_text_editor_cut); procedure fl_text_editor_copy (TE : in System.Address); pragma Import (C, fl_text_editor_copy, "fl_text_editor_copy"); + pragma Inline (fl_text_editor_copy); procedure fl_text_editor_paste (TE : in System.Address); pragma Import (C, fl_text_editor_paste, "fl_text_editor_paste"); + pragma Inline (fl_text_editor_paste); procedure fl_text_editor_delete (TE : in System.Address); pragma Import (C, fl_text_editor_delete, "fl_text_editor_delete"); + pragma Inline (fl_text_editor_delete); procedure fl_text_editor_select_all (TE : in System.Address); pragma Import (C, fl_text_editor_select_all, "fl_text_editor_select_all"); + pragma Inline (fl_text_editor_select_all); @@ -75,18 +88,22 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_backspace (TE : in System.Address); pragma Import (C, fl_text_editor_backspace, "fl_text_editor_backspace"); + pragma Inline (fl_text_editor_backspace); procedure fl_text_editor_insert (TE : in System.Address); pragma Import (C, fl_text_editor_insert, "fl_text_editor_insert"); + pragma Inline (fl_text_editor_insert); procedure fl_text_editor_enter (TE : in System.Address); pragma Import (C, fl_text_editor_enter, "fl_text_editor_enter"); + pragma Inline (fl_text_editor_enter); procedure fl_text_editor_ignore (TE : in System.Address); pragma Import (C, fl_text_editor_ignore, "fl_text_editor_ignore"); + pragma Inline (fl_text_editor_ignore); @@ -94,34 +111,42 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_home (TE : in System.Address); pragma Import (C, fl_text_editor_home, "fl_text_editor_home"); + pragma Inline (fl_text_editor_home); procedure fl_text_editor_end (TE : in System.Address); pragma Import (C, fl_text_editor_end, "fl_text_editor_end"); + pragma Inline (fl_text_editor_end); procedure fl_text_editor_page_down (TE : in System.Address); pragma Import (C, fl_text_editor_page_down, "fl_text_editor_page_down"); + pragma Inline (fl_text_editor_page_down); procedure fl_text_editor_page_up (TE : in System.Address); pragma Import (C, fl_text_editor_page_up, "fl_text_editor_page_up"); + pragma Inline (fl_text_editor_page_up); procedure fl_text_editor_down (TE : in System.Address); pragma Import (C, fl_text_editor_down, "fl_text_editor_down"); + pragma Inline (fl_text_editor_down); procedure fl_text_editor_left (TE : in System.Address); pragma Import (C, fl_text_editor_left, "fl_text_editor_left"); + pragma Inline (fl_text_editor_left); procedure fl_text_editor_right (TE : in System.Address); pragma Import (C, fl_text_editor_right, "fl_text_editor_right"); + pragma Inline (fl_text_editor_right); procedure fl_text_editor_up (TE : in System.Address); pragma Import (C, fl_text_editor_up, "fl_text_editor_up"); + pragma Inline (fl_text_editor_up); @@ -129,34 +154,42 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_shift_home (TE : in System.Address); pragma Import (C, fl_text_editor_shift_home, "fl_text_editor_shift_home"); + pragma Inline (fl_text_editor_shift_home); procedure fl_text_editor_shift_end (TE : in System.Address); pragma Import (C, fl_text_editor_shift_end, "fl_text_editor_shift_end"); + pragma Inline (fl_text_editor_shift_end); procedure fl_text_editor_shift_page_down (TE : in System.Address); pragma Import (C, fl_text_editor_shift_page_down, "fl_text_editor_shift_page_down"); + pragma Inline (fl_text_editor_shift_page_down); procedure fl_text_editor_shift_page_up (TE : in System.Address); pragma Import (C, fl_text_editor_shift_page_up, "fl_text_editor_shift_page_up"); + pragma Inline (fl_text_editor_shift_page_up); procedure fl_text_editor_shift_down (TE : in System.Address); pragma Import (C, fl_text_editor_shift_down, "fl_text_editor_shift_down"); + pragma Inline (fl_text_editor_shift_down); procedure fl_text_editor_shift_left (TE : in System.Address); pragma Import (C, fl_text_editor_shift_left, "fl_text_editor_shift_left"); + pragma Inline (fl_text_editor_shift_left); procedure fl_text_editor_shift_right (TE : in System.Address); pragma Import (C, fl_text_editor_shift_right, "fl_text_editor_shift_right"); + pragma Inline (fl_text_editor_shift_right); procedure fl_text_editor_shift_up (TE : in System.Address); pragma Import (C, fl_text_editor_shift_up, "fl_text_editor_shift_up"); + pragma Inline (fl_text_editor_shift_up); @@ -164,34 +197,42 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_ctrl_home (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_home, "fl_text_editor_ctrl_home"); + pragma Inline (fl_text_editor_ctrl_home); procedure fl_text_editor_ctrl_end (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_end, "fl_text_editor_ctrl_end"); + pragma Inline (fl_text_editor_ctrl_end); procedure fl_text_editor_ctrl_page_down (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_page_down, "fl_text_editor_ctrl_page_down"); + pragma Inline (fl_text_editor_ctrl_page_down); procedure fl_text_editor_ctrl_page_up (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_page_up, "fl_text_editor_ctrl_page_up"); + pragma Inline (fl_text_editor_ctrl_page_up); procedure fl_text_editor_ctrl_down (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_down, "fl_text_editor_ctrl_down"); + pragma Inline (fl_text_editor_ctrl_down); procedure fl_text_editor_ctrl_left (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_left, "fl_text_editor_ctrl_left"); + pragma Inline (fl_text_editor_ctrl_left); procedure fl_text_editor_ctrl_right (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_right, "fl_text_editor_ctrl_right"); + pragma Inline (fl_text_editor_ctrl_right); procedure fl_text_editor_ctrl_up (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_up, "fl_text_editor_ctrl_up"); + pragma Inline (fl_text_editor_ctrl_up); @@ -199,34 +240,42 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_ctrl_shift_home (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_home, "fl_text_editor_ctrl_shift_home"); + pragma Inline (fl_text_editor_ctrl_shift_home); procedure fl_text_editor_ctrl_shift_end (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_end, "fl_text_editor_ctrl_shift_end"); + pragma Inline (fl_text_editor_ctrl_shift_end); procedure fl_text_editor_ctrl_shift_page_down (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_page_down, "fl_text_editor_ctrl_shift_page_down"); + pragma Inline (fl_text_editor_ctrl_shift_page_down); procedure fl_text_editor_ctrl_shift_page_up (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_page_up, "fl_text_editor_ctrl_shift_page_up"); + pragma Inline (fl_text_editor_ctrl_shift_page_up); procedure fl_text_editor_ctrl_shift_down (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_down, "fl_text_editor_ctrl_shift_down"); + pragma Inline (fl_text_editor_ctrl_shift_down); procedure fl_text_editor_ctrl_shift_left (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_left, "fl_text_editor_ctrl_shift_left"); + pragma Inline (fl_text_editor_ctrl_shift_left); procedure fl_text_editor_ctrl_shift_right (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_right, "fl_text_editor_ctrl_shift_right"); + pragma Inline (fl_text_editor_ctrl_shift_right); procedure fl_text_editor_ctrl_shift_up (TE : in System.Address); pragma Import (C, fl_text_editor_ctrl_shift_up, "fl_text_editor_ctrl_shift_up"); + pragma Inline (fl_text_editor_ctrl_shift_up); @@ -236,22 +285,26 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is K, S : in Interfaces.C.int; F : in System.Address); pragma Import (C, fl_text_editor_add_key_binding, "fl_text_editor_add_key_binding"); + pragma Inline (fl_text_editor_add_key_binding); -- this particular procedure won't be necessary when FLTK keybindings fixed procedure fl_text_editor_remove_key_binding (TE : in System.Address; K, S : in Interfaces.C.int); pragma Import (C, fl_text_editor_remove_key_binding, "fl_text_editor_remove_key_binding"); + pragma Inline (fl_text_editor_remove_key_binding); procedure fl_text_editor_remove_all_key_bindings (TE : in System.Address); pragma Import (C, fl_text_editor_remove_all_key_bindings, "fl_text_editor_remove_all_key_bindings"); + pragma Inline (fl_text_editor_remove_all_key_bindings); procedure fl_text_editor_set_default_key_function (TE, F : in System.Address); pragma Import (C, fl_text_editor_set_default_key_function, "fl_text_editor_set_default_key_function"); + pragma Inline (fl_text_editor_set_default_key_function); @@ -260,11 +313,13 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is (TE : in System.Address) return Interfaces.C.int; pragma Import (C, fl_text_editor_get_insert_mode, "fl_text_editor_get_insert_mode"); + pragma Inline (fl_text_editor_get_insert_mode); procedure fl_text_editor_set_insert_mode (TE : in System.Address; I : in Interfaces.C.int); pragma Import (C, fl_text_editor_set_insert_mode, "fl_text_editor_set_insert_mode"); + pragma Inline (fl_text_editor_set_insert_mode); @@ -273,11 +328,13 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is -- (TE : in System.Address) -- return Interfaces.C.int; -- pragma Import (C, fl_text_editor_get_tab_nav, "fl_text_editor_get_tab_nav"); + -- pragma Inline (fl_text_editor_get_tab_nav); -- procedure fl_text_editor_set_tab_nav -- (TE : in System.Address; -- T : in Interfaces.C.int); -- pragma Import (C, fl_text_editor_set_tab_nav, "fl_text_editor_set_tab_nav"); + -- pragma Inline (fl_text_editor_set_tab_nav); @@ -285,12 +342,14 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is procedure fl_text_editor_draw (W : in System.Address); pragma Import (C, fl_text_editor_draw, "fl_text_editor_draw"); + pragma Inline (fl_text_editor_draw); function fl_text_editor_handle (W : in System.Address; E : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_text_editor_handle, "fl_text_editor_handle"); + pragma Inline (fl_text_editor_handle); @@ -302,8 +361,9 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is is Ada_Editor : access Text_Editor'Class := Editor_Convert.To_Pointer (fl_widget_get_user_data (E)); + Modi : Modifier := FLTK.Event.Last_Modifier; Ada_Key : Key_Combo := - To_Ada (Interfaces.C.unsigned_long (K)); + To_Ada (Interfaces.C.unsigned_long (K) + To_C (Modi)); Found_Binding : Boolean := False; begin @@ -339,33 +399,33 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is -- remove this type and array once FLTK keybindings fixed - type To_Remove is record - Press : Keypress; - Modif : Interfaces.C.int; - end record; - - To_Remove_List : array (Positive range <>) of To_Remove := - ((Home_Key, 0), - (End_Key, 0), - (Page_Down_Key, 0), - (Page_Up_Key, 0), - (Down_Key, 0), - (Left_Key, 0), - (Right_Key, 0), - (Up_Key, 0), - (Character'Pos ('/'), Interfaces.C.int (Mod_Ctrl)), - (Delete_Key, Interfaces.C.int (Mod_Shift)), - (Insert_Key, Interfaces.C.int (Mod_Ctrl)), - (Insert_Key, Interfaces.C.int (Mod_Shift))); - - use type Interfaces.C.int; - To_Remove_Weird : array (Positive range <>) of To_Remove := - ((Enter_Key, -1), - (Keypad_Enter_Key, -1), - (Backspace_Key, -1), - (Insert_Key, -1), - (Delete_Key, -1), - (Escape_Key, -1)); + -- type To_Remove is record + -- Press : Keypress; + -- Modif : Interfaces.C.int; + -- end record; + + -- To_Remove_List : array (Positive range <>) of To_Remove := + -- ((Home_Key, 0), + -- (End_Key, 0), + -- (Page_Down_Key, 0), + -- (Page_Up_Key, 0), + -- (Down_Key, 0), + -- (Left_Key, 0), + -- (Right_Key, 0), + -- (Up_Key, 0), + -- (Character'Pos ('/'), Interfaces.C.int (Mod_Ctrl)), + -- (Delete_Key, Interfaces.C.int (Mod_Shift)), + -- (Insert_Key, Interfaces.C.int (Mod_Ctrl)), + -- (Insert_Key, Interfaces.C.int (Mod_Shift))); + + -- use type Interfaces.C.int; + -- To_Remove_Weird : array (Positive range <>) of To_Remove := + -- ((Enter_Key, -1), + -- (Keypad_Enter_Key, -1), + -- (Backspace_Key, -1), + -- (Insert_Key, -1), + -- (Delete_Key, -1), + -- (Escape_Key, -1)); @@ -402,33 +462,33 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is -- remove these loops and uncomment subsequent "remove_all_key_bindings" -- when FLTK keybindings fixed - for B of To_Remove_List loop - fl_text_editor_remove_key_binding - (This.Void_Ptr, - Interfaces.C.int (B.Press), - B.Modif * 65536); - end loop; - for B of To_Remove_Weird loop - fl_text_editor_remove_key_binding - (This.Void_Ptr, - Interfaces.C.int (B.Press), - B.Modif); - end loop; - -- fl_text_editor_remove_all_key_bindings (This.Void_Ptr); + -- for B of To_Remove_List loop + -- fl_text_editor_remove_key_binding + -- (This.Void_Ptr, + -- Interfaces.C.int (B.Press), + -- B.Modif * 65536); + -- end loop; + -- for B of To_Remove_Weird loop + -- fl_text_editor_remove_key_binding + -- (This.Void_Ptr, + -- Interfaces.C.int (B.Press), + -- B.Modif); + -- end loop; + fl_text_editor_remove_all_key_bindings (This.Void_Ptr); fl_text_editor_set_default_key_function (This.Void_Ptr, Key_Func_Hook'Address); -- this is irritatingly required due to how FLTK handles certain keys - for B of Default_Key_Bindings loop - -- remove this conditional once FLTK keybindings fixed - if B.Key.Modcode = Mod_None then - fl_text_editor_add_key_binding - (This.Void_Ptr, - Interfaces.C.int (B.Key.Keycode), - Interfaces.C.int (B.Key.Modcode) * 65536, - Key_Func_Hook'Address); - end if; - end loop; + -- for B of Default_Key_Bindings loop + -- -- remove this conditional once FLTK keybindings fixed + -- if B.Key.Modcode = Mod_None then + -- fl_text_editor_add_key_binding + -- (This.Void_Ptr, + -- Interfaces.C.int (B.Key.Keycode), + -- Interfaces.C.int (B.Key.Modcode) * 65536, + -- Key_Func_Hook'Address); + -- end if; + -- end loop; end return; end Create; @@ -772,6 +832,16 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is end Add_Key_Binding; + procedure Add_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List) is + begin + for I of List loop + This.Bindings.Append (I); + end loop; + end Add_Key_Bindings; + + function Get_Bound_Key_Function (This : in Text_Editor; Key : in Key_Combo) @@ -799,12 +869,12 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is end loop; -- remove this once FLTK keybindings fixed - if Key.Modcode /= Mod_None then - fl_text_editor_remove_key_binding - (This.Void_Ptr, - Interfaces.C.int (Key.Keycode), - Interfaces.C.int (Key.Modcode) * 65536); - end if; + -- if Key.Modcode /= Mod_None then + -- fl_text_editor_remove_key_binding + -- (This.Void_Ptr, + -- Interfaces.C.int (Key.Keycode), + -- Interfaces.C.int (Key.Modcode) * 65536); + -- end if; end Remove_Key_Binding; @@ -812,7 +882,7 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is (This : in out Text_Editor; Bind : in Key_Binding) is - use type Interfaces.C.int; + -- use type Interfaces.C.int; begin for I in reverse 1 .. Integer (This.Bindings.Length) loop if This.Bindings.Reference (I).Key = Bind.Key then @@ -821,23 +891,33 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is end loop; -- remove this once FLTK keybindings fixed - if Bind.Key.Modcode /= Mod_None then - fl_text_editor_remove_key_binding - (This.Void_Ptr, - Interfaces.C.int (Bind.Key.Keycode), - Interfaces.C.int (Bind.Key.Modcode) * 65536); - end if; + -- if Bind.Key.Modcode /= Mod_None then + -- fl_text_editor_remove_key_binding + -- (This.Void_Ptr, + -- Interfaces.C.int (Bind.Key.Keycode), + -- Interfaces.C.int (Bind.Key.Modcode) * 65536); + -- end if; end Remove_Key_Binding; + procedure Remove_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List) is + begin + for I of List loop + This.Remove_Key_Binding (I); + end loop; + end Remove_Key_Bindings; + + procedure Remove_All_Key_Bindings (This : in out Text_Editor) is begin This.Bindings := Binding_Vectors.Empty_Vector; - This.Default_Func := null; + -- This.Default_Func := null; -- remove this once FLTK keybindings fixed - fl_text_editor_remove_all_key_bindings (This.Void_Ptr); + -- fl_text_editor_remove_all_key_bindings (This.Void_Ptr); end Remove_All_Key_Bindings; diff --git a/src/fltk-widgets-groups-text_displays-text_editors.ads b/src/fltk-widgets-groups-text_displays-text_editors.ads index 29413e6..2430e0b 100644 --- a/src/fltk-widgets-groups-text_displays-text_editors.ads +++ b/src/fltk-widgets-groups-text_displays-text_editors.ads @@ -11,7 +11,11 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is type Text_Editor is new Text_Display with private; + type Text_Editor_Reference (Data : not null access Text_Editor'Class) is + limited null record with Implicit_Dereference => Data; + type Insert_Mode is (Before, After); + -- type Tab_Navigation is (Insert_Char, Widget_Focus); type Key_Func is access procedure @@ -200,12 +204,12 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is (Mod_None + Backspace_Key, KF_Backspace'Access), (Mod_None + Insert_Key, KF_Insert'Access), - (Mod_None + Delete_Key, Delete'Access), - (Mod_Ctrl + 'c', Copy'Access), - (Mod_Ctrl + 'v', Paste'Access), - (Mod_Ctrl + 'x', Cut'Access), - (Mod_Ctrl + 'z', Undo'Access), - (Mod_Ctrl + 'a', Select_All'Access), + (Mod_None + Delete_Key, Delete'Access), + (Mod_Ctrl + 'c', Copy'Access), + (Mod_Ctrl + 'v', Paste'Access), + (Mod_Ctrl + 'x', Cut'Access), + (Mod_Ctrl + 'z', Undo'Access), + (Mod_Ctrl + 'a', Select_All'Access), (Mod_None + Home_Key, KF_Home'Access), (Mod_None + End_Key, KF_End'Access), @@ -246,19 +250,6 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is - -- NOTE NOTE NOTE NOTE NOTE - -- - -- Changing the keybindings for Shortcut_Keys that include modifiers - -- currently does not work due to some bugbear in the FLTK side of things. - -- - -- Until that's fixed, the default keybindings for those key combinations - -- that include modifiers have been left in place. - -- - -- NOTE NOTE NOTE NOTE NOTE - - - - procedure Add_Key_Binding (This : in out Text_Editor; Key : in Key_Combo; @@ -268,6 +259,10 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is (This : in out Text_Editor; Bind : in Key_Binding); + procedure Add_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List); + function Get_Bound_Key_Function (This : in Text_Editor; Key : in Key_Combo) @@ -281,6 +276,10 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is (This : in out Text_Editor; Bind : in Key_Binding); + procedure Remove_Key_Bindings + (This : in out Text_Editor; + List : in Key_Binding_List); + procedure Remove_All_Key_Bindings (This : in out Text_Editor); @@ -359,5 +358,82 @@ private package Editor_Convert is new System.Address_To_Access_Conversions (Text_Editor'Class); + + + pragma Inline (Default); + + + pragma Inline (Undo); + pragma Inline (Cut); + pragma Inline (Copy); + pragma Inline (Paste); + pragma Inline (Delete); + pragma Inline (Select_All); + + + pragma Inline (KF_Backspace); + pragma Inline (KF_Insert); + pragma Inline (KF_Enter); + pragma Inline (KF_Ignore); + + + pragma Inline (KF_Home); + pragma Inline (KF_End); + pragma Inline (KF_Page_Down); + pragma Inline (KF_Page_Up); + pragma Inline (KF_Down); + pragma Inline (KF_Left); + pragma Inline (KF_Right); + pragma Inline (KF_Up); + + + pragma Inline (KF_Shift_Home); + pragma Inline (KF_Shift_End); + pragma Inline (KF_Shift_Page_Down); + pragma Inline (KF_Shift_Page_Up); + pragma Inline (KF_Shift_Down); + pragma Inline (KF_Shift_Left); + pragma Inline (KF_Shift_Right); + pragma Inline (KF_Shift_Up); + + + pragma Inline (KF_Ctrl_Home); + pragma Inline (KF_Ctrl_End); + pragma Inline (KF_Ctrl_Page_Down); + pragma Inline (KF_Ctrl_Page_Up); + pragma Inline (KF_Ctrl_Down); + pragma Inline (KF_Ctrl_Left); + pragma Inline (KF_Ctrl_Right); + pragma Inline (KF_Ctrl_Up); + + + pragma Inline (KF_Ctrl_Shift_Home); + pragma Inline (KF_Ctrl_Shift_End); + pragma Inline (KF_Ctrl_Shift_Page_Down); + pragma Inline (KF_Ctrl_Shift_Page_Up); + pragma Inline (KF_Ctrl_Shift_Down); + pragma Inline (KF_Ctrl_Shift_Left); + pragma Inline (KF_Ctrl_Shift_Right); + pragma Inline (KF_Ctrl_Shift_Up); + + + pragma Inline (Add_Key_Binding); + pragma Inline (Remove_All_Key_Bindings); + pragma Inline (Get_Default_Key_Function); + pragma Inline (Set_Default_Key_Function); + + + pragma Inline (Get_Insert_Mode); + pragma Inline (Set_Insert_Mode); + + + -- pragma Inline (Get_Tab_Nav_Mode); + -- pragma Inline (Set_Tab_Nav_Mode); + + + pragma Inline (Draw); + pragma Inline (Handle); + + end FLTK.Widgets.Groups.Text_Displays.Text_Editors; |