diff options
Diffstat (limited to 'src/fltk_binding')
-rw-r--r-- | src/fltk_binding/c_fl_text_buffer.cpp | 9 | ||||
-rw-r--r-- | src/fltk_binding/c_fl_text_buffer.h | 1 | ||||
-rw-r--r-- | src/fltk_binding/fltk-text_buffers.adb | 19 | ||||
-rw-r--r-- | src/fltk_binding/fltk-text_buffers.ads | 6 |
4 files changed, 33 insertions, 2 deletions
diff --git a/src/fltk_binding/c_fl_text_buffer.cpp b/src/fltk_binding/c_fl_text_buffer.cpp index a28286f..20699e8 100644 --- a/src/fltk_binding/c_fl_text_buffer.cpp +++ b/src/fltk_binding/c_fl_text_buffer.cpp @@ -71,11 +71,16 @@ void fl_text_buffer_select(TEXTBUFFER tb, int s, int e) { int fl_text_buffer_skip_lines(TEXTBUFFER tb, int s, int l) { - reinterpret_cast<Fl_Text_Buffer*>(tb)->skip_lines(s, l); + return reinterpret_cast<Fl_Text_Buffer*>(tb)->skip_lines(s, l); } int fl_text_buffer_rewind_lines(TEXTBUFFER tb, int s, int l) { - reinterpret_cast<Fl_Text_Buffer*>(tb)->rewind_lines(s, l); + return reinterpret_cast<Fl_Text_Buffer*>(tb)->rewind_lines(s, l); +} + + +unsigned int fl_text_buffer_char_at(TEXTBUFFER tb, int p) { + return reinterpret_cast<Fl_Text_Buffer*>(tb)->char_at(p); } diff --git a/src/fltk_binding/c_fl_text_buffer.h b/src/fltk_binding/c_fl_text_buffer.h index ed95a6d..0ee2e5a 100644 --- a/src/fltk_binding/c_fl_text_buffer.h +++ b/src/fltk_binding/c_fl_text_buffer.h @@ -24,6 +24,7 @@ extern "C" int fl_text_buffer_search_forward(TEXTBUFFER tb, int start, const cha extern "C" void fl_text_buffer_select(TEXTBUFFER tb, int s, int e); extern "C" int fl_text_buffer_skip_lines(TEXTBUFFER tb, int s, int l); extern "C" int fl_text_buffer_rewind_lines(TEXTBUFFER tb, int s, int l); +extern "C" unsigned int fl_text_buffer_char_at(TEXTBUFFER tb, int p); #endif diff --git a/src/fltk_binding/fltk-text_buffers.adb b/src/fltk_binding/fltk-text_buffers.adb index ab752ff..5db105d 100644 --- a/src/fltk_binding/fltk-text_buffers.adb +++ b/src/fltk_binding/fltk-text_buffers.adb @@ -96,6 +96,12 @@ package body FLTK.Text_Buffers is return Interfaces.C.int; pragma Import (C, fl_text_buffer_rewind_lines, "fl_text_buffer_rewind_lines"); + function fl_text_buffer_char_at + (TB : in System.Address; + P : in Interfaces.C.int) + return Interfaces.C.unsigned; + pragma Import (C, fl_text_buffer_char_at, "fl_text_buffer_char_at"); + @@ -376,5 +382,18 @@ package body FLTK.Text_Buffers is end Rewind_Lines; + + + function Character_At + (This : in Text_Buffer; + Pos : in Natural) + return Character is + begin + return Character'Val (fl_text_buffer_char_at + (This.Void_Ptr, + Interfaces.C.int (Pos))); + end Character_At; + + end FLTK.Text_Buffers; diff --git a/src/fltk_binding/fltk-text_buffers.ads b/src/fltk_binding/fltk-text_buffers.ads index 5b260d6..171fd84 100644 --- a/src/fltk_binding/fltk-text_buffers.ads +++ b/src/fltk_binding/fltk-text_buffers.ads @@ -105,6 +105,12 @@ package FLTK.Text_Buffers is return Natural; + function Character_At + (This : in Text_Buffer; + Pos : in Natural) + return Character; + + private |