diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-11-11 08:00:48 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-11-11 08:00:48 +1100 |
commit | bee437918713d9fc2213a5a554ac02f4e7af3249 (patch) | |
tree | 948f17dbde91d057669575e50c6f2e885026b27e /fltk-text_buffers.ads | |
parent | faabff73b74307cdec73264116291857d679aef7 (diff) |
Simplified text_buffer callbacks
Diffstat (limited to 'fltk-text_buffers.ads')
-rw-r--r-- | fltk-text_buffers.ads | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/fltk-text_buffers.ads b/fltk-text_buffers.ads index a560076..a021dbf 100644 --- a/fltk-text_buffers.ads +++ b/fltk-text_buffers.ads @@ -13,23 +13,19 @@ package FLTK.Text_Buffers is type Position is new Natural; + type Modification is (Insert, Restyle, Delete, None); - type Modification is (Insert, Restyle, Delete, None); - type Modify_Callback is interface; - procedure Call - (This : in Modify_Callback; - Action : in Modification; + type Modify_Callback is access procedure + (Action : in Modification; Place : in Position; Length : in Natural; - Deleted_Text : in String) is abstract; + Deleted_Text : in String); - type Predelete_Callback is interface; - procedure Call - (This : in Predelete_Callback; - Place : in Position; - Length : in Natural) is abstract; + type Predelete_Callback is access procedure + (Place : in Position; + Length : in Natural); function Create @@ -40,12 +36,12 @@ package FLTK.Text_Buffers is procedure Add_Modify_Callback (This : in out Text_Buffer; - Func : not null access Modify_Callback'Class); + Func : in Modify_Callback); procedure Add_Predelete_Callback (This : in out Text_Buffer; - Func : not null access Predelete_Callback'Class); + Func : in Predelete_Callback); procedure Call_Modify_Callbacks @@ -98,21 +94,17 @@ package FLTK.Text_Buffers is private - type Modify_Access is access all Modify_Callback'Class; - type Predelete_Access is access all Predelete_Callback'Class; - - package Modify_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => Modify_Access); + Element_Type => Modify_Callback); package Predelete_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => Predelete_Access); + Element_Type => Predelete_Callback); type Text_Buffer is new Wrapper with record - Modify_CBs : Modify_Vectors.Vector; + Modify_CBs : Modify_Vectors.Vector; Predelete_CBs : Predelete_Vectors.Vector; end record; |