From 82eb9509e9e273e8e9e7e584553ccc49f476d4a3 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Mon, 20 Jan 2025 00:42:19 +1300 Subject: Filled holes in Fl_Text_Editor binding and make key/modifier/shortcut/flag representations more in line with C++ --- doc/fl_text_editor.html | 208 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 155 insertions(+), 53 deletions(-) (limited to 'doc/fl_text_editor.html') diff --git a/doc/fl_text_editor.html b/doc/fl_text_editor.html index 25d75f0..a946819 100644 --- a/doc/fl_text_editor.html +++ b/doc/fl_text_editor.html @@ -57,7 +57,7 @@ -   + Key_Func Default_Key_Func @@ -67,8 +67,27 @@ -   - Key_Binding_List + Key_Binding + Key_Binding_Array + + + + Key_Binding + Key_Binding_Vectors.Vector + + + + + + + + + + + +
Static Attributes
Use the add_default_key_bindings function.
+Default_Key_Bindings : constant Key_Binding_Array := ...
+
@@ -82,7 +101,9 @@
 static Key_Binding * global_key_bindings;
 
-  +
+Global_Key_Bindings : Key_Binding_Vectors.Vector;
+
@@ -169,7 +190,7 @@ procedure KF_Ctrl_Shift_Up static int kf_copy(int c, Fl_Text_Editor *e);
-procedure Copy
+procedure KF_Copy
        (This : in out Text_Editor'Class);
 
@@ -210,7 +231,7 @@ procedure KF_Ctrl_Up static int kf_cut(int c, Fl_Text_Editor *e);
-procedure Cut
+procedure KF_Cut
        (This : in out Text_Editor'Class);
 
@@ -220,7 +241,7 @@ procedure Cut static int kf_default(int c, Fl_Text_Editor *e);
-procedure Default
+procedure KF_Default
        (This : in out Text_Editor'Class;
         Key  : in     Key_Combo);
 
@@ -231,7 +252,7 @@ procedure Default static int kf_delete(int c, Fl_Text_Editor *e);
-procedure Delete
+procedure KF_Delete
        (This : in out Text_Editor'Class);
 
@@ -310,21 +331,70 @@ procedure KF_Left
 static int kf_m_s_move(int c, Fl_Text_Editor *e);
 
-  +
+procedure KF_Meta_Shift_Home
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_End
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Page_Down
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Page_Up
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Down
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Left
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Right
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Shift_Up
+       (This : in out Text_Editor'Class);
+
 static int kf_meta_move(int c, Fl_Text_Editor *e);
 
-  +
+procedure KF_Meta_Home
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_End
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Page_Down
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Page_Up
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Down
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Left
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Right
+       (This : in out Text_Editor'Class);
+
+procedure KF_Meta_Up
+       (This : in out Text_Editor'Class);
+
 static int kf_move(int c, Fl_Text_Editor *e);
 
-  +Already covered by KF_Home, KF_End, KF_Page_Down, KF_Page_Up, +KF_Down, KF_Left, KF_Right, KF_Up. @@ -352,7 +422,7 @@ procedure KF_Page_Up static int kf_paste(int c, Fl_Text_Editor *e);
-procedure Paste
+procedure KF_Paste
        (This : in out Text_Editor'Class);
 
@@ -372,7 +442,7 @@ procedure KF_Right static int kf_select_all(int c, Fl_Text_Editor *e);
-procedure Select_All
+procedure KF_Select_All
        (This : in out Text_Editor'Class);
 
@@ -408,12 +478,20 @@ procedure KF_Shift_Up + +Write your own function to handle a tab press. +
+procedure KF_Tab
+       (This : in out Text_Editor'Class);
+
+ +
 static int kf_undo(int c, Fl_Text_Editor *e);
 
-procedure Undo
+procedure KF_Undo
        (This : in out Text_Editor'Class);
 
@@ -439,18 +517,7 @@ procedure KF_Up
 void add_default_key_bindings(Key_Binding **list);
 
-  - - - -
-void add_key_binding(int key, int state, Key_Func f, Key_Binding **list);
-
-
-procedure Add_Key_Binding
-       (This : in out Text_Editor;
-        Bind : in     Key_Binding);
-
+Construct an array or populate a vector manually using the Default_Key_Bindings array. @@ -462,23 +529,28 @@ procedure Add_Key_Binding (This : in out Text_Editor; Key : in Key_Combo; Func : in Key_Func); + +procedure Add_Key_Binding + (This : in out Text_Editor; + Bind : in Key_Binding); - 
-procedure Add_Key_Bindings
-       (This : in out Text_Editor;
-        List : in     Key_Binding_List);
+void add_key_binding(int key, int state, Key_Func f,
+    Key_Binding **list);
 
+Construct an array or populate a vector manually. +Add key bindings to an Fl_Text_Editor one by one.
-Key_Func bound_key_function(int key, int state, Key_Binding *list) const;
+procedure Add_Key_Bindings
+       (This : in out Text_Editor;
+        Bind : in     Key_Binding_Array);
 
-  @@ -493,6 +565,24 @@ function Get_Bound_Key_Function + +After adding a key binding to an editor there does not appear to +be a way to obtain a full accounting of what bindings exist afterwards. +
+function Get_All_Bound_Key_Functions
+       (This : in Text_Editor)
+    return Key_Binding_Array;
+
+ + + +
+Key_Func bound_key_function(int key, int state,
+    Key_Binding *list) const;
+
+Search an array or vector using standard operations. + +
 void default_key_function(Key_Func f);
@@ -505,7 +595,7 @@ procedure Set_Default_Key_Function
   
 
   
- 
+Keep track of what default key function you set manually.
 
 function Get_Default_Key_Function
        (This : in Text_Editor)
@@ -527,17 +617,6 @@ function Handle
 
   
 
-void insert_mode(int b);
-
-
-procedure Set_Insert_Mode
-       (This : in out Text_Editor;
-        To   : in     Insert_Mode);
-
- - - -
 int insert_mode();
 
@@ -549,12 +628,12 @@ function Get_Insert_Mode
 
   
 
-void remove_all_key_bindings(Key_Binding **list);
+void insert_mode(int b);
 
-procedure Remove_Key_Bindings
+procedure Set_Insert_Mode
        (This : in out Text_Editor;
-        List : in     Key_Binding_List);
+        To   : in     Insert_Mode);
 
@@ -570,9 +649,20 @@ procedure Remove_All_Key_Bindings
-void remove_key_binding(int key, int state, Key_Binding **list);
+void remove_all_key_bindings(Key_Binding **list);
+
+Use standard operations to manipulate an array or vector. + + + +
+void remove_key_binding(int key, int state);
 
+procedure Remove_Key_Binding
+       (This : in out Text_Editor;
+        Key  : in     Key_Combo);
+
 procedure Remove_Key_Binding
        (This : in out Text_Editor;
         Bind : in     Key_Binding);
@@ -581,12 +671,17 @@ procedure Remove_Key_Binding
 
   
 
-void remove_key_binding(int key, int state);
+void remove_key_binding(int key, int state, Key_Binding **list);
 
+Use standard operations to manipulate an array or vector. + + + +Remove key bindings from an Fl_Text_Editor one by one.
-procedure Remove_Key_Binding
+procedure Remove_Key_Bindings
        (This : in out Text_Editor;
-        Key  : in     Key_Combo);
+        Bind : in     Key_Binding_Array);
 
@@ -623,14 +718,21 @@ procedure Set_Tab_Mode
 int handle_key();
 
-  +
+function Handle_Key
+       (This : in out Text_Editor)
+    return Event_Outcome;
+
 void maybe_do_callback();
 
-  +
+procedure Maybe_Do_Callback
+       (This : in out Text_Editor);
+
-- cgit