diff options
Diffstat (limited to 'src/c_fl_file_input.cpp')
-rw-r--r-- | src/c_fl_file_input.cpp | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/src/c_fl_file_input.cpp b/src/c_fl_file_input.cpp deleted file mode 100644 index f4fcc4f..0000000 --- a/src/c_fl_file_input.cpp +++ /dev/null @@ -1,100 +0,0 @@ - - -#include <FL/Fl_File_Input.H> -#include "c_fl_file_input.h" -#include "c_fl_type.h" - - - - -class My_File_Input : public Fl_File_Input { - public: - using Fl_File_Input::Fl_File_Input; - friend void file_input_set_draw_hook(FILE_INPUT i, void * d); - friend void fl_file_input_draw(FILE_INPUT i); - friend void file_input_set_handle_hook(FILE_INPUT i, void * h); - friend int fl_file_input_handle(FILE_INPUT i, int e); - protected: - void draw(); - void real_draw(); - int handle(int e); - int real_handle(int e); - d_hook_p draw_hook; - h_hook_p handle_hook; -}; - -void My_File_Input::draw() { - (*draw_hook)(this->user_data()); -} - -void My_File_Input::real_draw() { - Fl_File_Input::draw(); -} - -int My_File_Input::handle(int e) { - return (*handle_hook)(this->user_data(), e); -} - -int My_File_Input::real_handle(int e) { - return Fl_File_Input::handle(e); -} - -void file_input_set_draw_hook(FILE_INPUT i, void * d) { - reinterpret_cast<My_File_Input*>(i)->draw_hook = reinterpret_cast<d_hook_p>(d); -} - -void fl_file_input_draw(FILE_INPUT i) { - reinterpret_cast<My_File_Input*>(i)->real_draw(); -} - -void file_input_set_handle_hook(FILE_INPUT i, void * h) { - reinterpret_cast<My_File_Input*>(i)->handle_hook = reinterpret_cast<h_hook_p>(h); -} - -int fl_file_input_handle(FILE_INPUT i, int e) { - return reinterpret_cast<My_File_Input*>(i)->real_handle(e); -} - - - - -FILE_INPUT new_fl_file_input(int x, int y, int w, int h, char* label) { - My_File_Input *i = new My_File_Input(x, y, w, h, label); - return i; -} - -void free_fl_file_input(FILE_INPUT i) { - delete reinterpret_cast<My_File_Input*>(i); -} - - - - -int fl_file_input_get_down_box(FILE_INPUT i) { - return reinterpret_cast<Fl_File_Input*>(i)->down_box(); -} - -void fl_file_input_set_down_box(FILE_INPUT i, int t) { - reinterpret_cast<Fl_File_Input*>(i)->down_box(static_cast<Fl_Boxtype>(t)); -} - -unsigned int fl_file_input_get_errorcolor(FILE_INPUT i) { - return reinterpret_cast<Fl_File_Input*>(i)->errorcolor(); -} - -void fl_file_input_set_errorcolor(FILE_INPUT i, unsigned int t) { - reinterpret_cast<Fl_File_Input*>(i)->errorcolor(t); -} - - - - -const char * fl_file_input_get_value(FILE_INPUT i) { - return reinterpret_cast<Fl_File_Input*>(i)->value(); -} - -void fl_file_input_set_value(FILE_INPUT i, const char * s, int len) { - reinterpret_cast<Fl_File_Input*>(i)->value(s,len); -} - - |