fl_Callback* C_to_Fl_Callback::get_callback(Fl_Menu_Item* m) { fl_Callback* cb = NULL; if (m->callback()) { C_to_Fl_Callback* wrappedCb = (C_to_Fl_Callback*)m->user_data(); if (wrappedCb) { cb = wrappedCb->inner_callback(); } } return cb; }
fl_Callback* C_to_Fl_Callback::get_callback(Fl_Widget* w) { fl_Callback* cb = NULL; if (w->callback()) { C_to_Fl_Callback* wrappedCb = (C_to_Fl_Callback*)w->user_data(); if (wrappedCb) { cb = wrappedCb->inner_callback(); } } return cb; }
int C_to_Fl_Callback::intercept(int key, fl_Text_Editor editor){ DerivedText_Editor* e = (static_cast<DerivedText_Editor*>(editor)); C_to_Fl_Callback* context = e->get_curr_callback_context(); return context->runCallback(key,e); }
FL_EXPORT_C(void,Fl_Menu_Item_set_callback)(fl_Menu_Item menu_item,fl_Callback* c){ C_to_Fl_Callback* callback = new C_to_Fl_Callback(c); callback->set_callback(static_cast<Fl_Menu_Item*>(menu_item)); }
FL_EXPORT_C(void, Fl_File_Chooser_callback_with_user_data)(fl_File_Chooser file_chooser, void (*cb)(fl_File_Chooser, void* ), void* user_data) { C_to_Fl_Callback * c = new C_to_Fl_Callback (cb, user_data); c->set_callback (static_cast<Fl_File_Chooser *> (file_chooser)); }
FL_EXPORT_C(void, Fl_File_Chooser_callback)(fl_File_Chooser file_chooser, void (*cb)(fl_File_Chooser, void* )) { C_to_Fl_Callback * c = new C_to_Fl_Callback (cb); c->set_callback (static_cast<Fl_File_Chooser *> (file_chooser)); }