fltkhs 0.5.2.4 → 0.5.2.5
raw patch · 8 files changed
+53/−752 lines, 8 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Graphics.UI.FLTK.LowLevel.Timer: hiddenTimerNew :: Rectangle -> Text -> IO (Ref HiddenTimer)
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (GHC.Types.Bool -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetSuspended ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (GHC.Types.Double -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetValue ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Enumerations.Event -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.UnknownEvent ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Handle ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Enumerations.Event -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.UnknownEvent ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.HandleSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.CountDirection -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetDirection ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Rectangle -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Resize ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Rectangle -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ResizeSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Destroy ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Draw ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.DrawSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Hide ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.HideSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ShowWidget ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO () => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ShowWidgetSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO GHC.Types.Bool => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetSuspended ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO GHC.Types.Double => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetValue ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: instance impl ~ GHC.Types.IO Graphics.UI.FLTK.LowLevel.Fl_Types.CountDirection => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetDirection ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Timer orig impl
- Graphics.UI.FLTK.LowLevel.Timer: timerCustom :: Rectangle -> Text -> Maybe (Ref Timer -> IO ()) -> Maybe (CustomWidgetFuncs Timer) -> IO (Ref Timer)
- Graphics.UI.FLTK.LowLevel.Timer: timerNew :: Rectangle -> Text -> IO (Ref Timer)
- Graphics.UI.FLTK.LowLevel.Timer: valueTimerNew :: Rectangle -> Text -> IO (Ref ValueTimer)
Files
- c-src/Fl_File_BrowserC.cpp +18/−0
- c-src/Fl_TimerC.cpp +0/−390
- c-src/Fl_TimerC.h +0/−147
- c-src/Makefile.in +0/−1
- fltkhs.cabal +2/−4
- src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs +31/−36
- src/Graphics/UI/FLTK/LowLevel/Fl_Types.chs +2/−4
- src/Graphics/UI/FLTK/LowLevel/Timer.chs +0/−170
c-src/Fl_File_BrowserC.cpp view
@@ -595,6 +595,24 @@ FL_EXPORT_C(void, Fl_File_Browser_hide_super)(fl_File_Browser o){ (static_cast<Fl_DerivedFile_Browser*>(o))->hide_super(); }+ FL_EXPORT_C(fl_File_Browser, Fl_File_Browser_New_WithLabel)(int x, int y, int w, int h, const char* label){+ fl_Widget_Virtual_Funcs* fs = Fl_Widget_default_virtual_funcs();+ Fl_DerivedFile_Browser* b = new Fl_DerivedFile_Browser(x,y,w,h,label,fs);+ return (fl_File_Browser)b;+ }+ FL_EXPORT_C(fl_File_Browser, Fl_File_Browser_New)(int x, int y, int w, int h){+ fl_Widget_Virtual_Funcs* fs = Fl_Widget_default_virtual_funcs();+ Fl_DerivedFile_Browser* b = new Fl_DerivedFile_Browser(x,y,w,h,fs);+ return (fl_File_Browser)b;+ }+ FL_EXPORT_C(fl_File_Browser, Fl_OverriddenFile_Browser_New)(int X, int Y, int W, int H,fl_Widget_Virtual_Funcs* fs){+ Fl_DerivedFile_Browser* b = new Fl_DerivedFile_Browser(X,Y,W,H,fs);+ return (fl_File_Browser)b;+ }+ FL_EXPORT_C(fl_File_Browser, Fl_OverriddenFile_Browser_New_WithLabel)(int X, int Y, int W, int H, const char* label, fl_Widget_Virtual_Funcs* fs){+ Fl_DerivedFile_Browser* b = new Fl_DerivedFile_Browser(X,Y,W,H,label,fs);+ return (fl_File_Browser)b;+ } #ifdef __cplusplus } #endif
− c-src/Fl_TimerC.cpp
@@ -1,390 +0,0 @@-#include "Fl_TimerC.h"-#ifdef __cplusplus-EXPORT {- Fl_DerivedTimer::Fl_DerivedTimer(uchar t,int X, int Y, int W, int H, const char *l, fl_Widget_Virtual_Funcs* funcs) : Fl_Timer(t,X,Y,W,H,l){- overriddenFuncs = funcs;- other_data = (void*)0;- }- Fl_DerivedTimer::~Fl_DerivedTimer(){- free(overriddenFuncs);- }- void Fl_DerivedTimer::draw(){- if (this->overriddenFuncs->draw != NULL) {- this->overriddenFuncs->draw((fl_Timer) this);- }- else {- Fl_Timer::draw();- }- }-- void Fl_DerivedTimer::draw_super(){- Fl_Timer::draw();- }-- int Fl_DerivedTimer::handle(int event){- int i;- if (this->overriddenFuncs->handle != NULL) {- i = this->overriddenFuncs->handle((fl_Timer) this,event);- }- else {- i = Fl_Timer::handle(event);- }- return i;- }- int Fl_DerivedTimer::handle_super(int event){- return Fl_Timer::handle(event);- }-- void Fl_DerivedTimer::resize(int x, int y, int w, int h){- if (this->overriddenFuncs->resize != NULL) {- this->overriddenFuncs->resize((fl_Timer) this,x,y,w,h);- }- else {- Fl_Timer::resize(x,y,w,h);- }- }-- void Fl_DerivedTimer::resize_super(int x, int y, int w, int h){- Fl_Timer::resize(x,y,w,h);- }- void Fl_DerivedTimer::show(){- if (this->overriddenFuncs->show != NULL) {- this->overriddenFuncs->show((fl_Timer) this);- }- else {- Fl_Timer::show();- }- }- void Fl_DerivedTimer::show_super(){- Fl_Timer::show();- }-- void Fl_DerivedTimer::hide(){- if (this->overriddenFuncs->hide != NULL) {- this->overriddenFuncs->hide((fl_Timer) this);- }- else {- Fl_Timer::hide();- }- }- void Fl_DerivedTimer::hide_super(){- Fl_Timer::hide();- }-#endif- FL_EXPORT_C(fl_Group,Fl_Timer_parent)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->parent();- }- FL_EXPORT_C(void,Fl_Timer_set_parent)(fl_Timer adjuster,fl_Group grp){- (static_cast<Fl_Timer*>(adjuster))->parent((static_cast<Fl_Group*>(grp)));- }- FL_EXPORT_C(uchar,Fl_Timer_type)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->type();- }- FL_EXPORT_C(void,Fl_Timer_set_type)(fl_Timer adjuster,uchar t){- (static_cast<Fl_Timer*>(adjuster))->type(t);- }- FL_EXPORT_C(int,Fl_Timer_x)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->x();- }- FL_EXPORT_C(int,Fl_Timer_y)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->y();- }- FL_EXPORT_C(int,Fl_Timer_w)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->w();- }- FL_EXPORT_C(int,Fl_Timer_h)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->h();- }- FL_EXPORT_C(void,Fl_Timer_set_align)(fl_Timer adjuster,Fl_Align alignment){- (static_cast<Fl_Timer*>(adjuster))->align(alignment);- }- FL_EXPORT_C(Fl_Align,Fl_Timer_align)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->align();- }- FL_EXPORT_C(Fl_Boxtype,Fl_Timer_box)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->box();- }- FL_EXPORT_C(void,Fl_Timer_set_box)(fl_Timer adjuster,Fl_Boxtype new_box){- (static_cast<Fl_Timer*>(adjuster))->box(new_box);- }- FL_EXPORT_C(Fl_Color,Fl_Timer_color)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->color();- }- FL_EXPORT_C(void,Fl_Timer_set_color)(fl_Timer adjuster,Fl_Color bg){- (static_cast<Fl_Timer*>(adjuster))->color(bg);- }- FL_EXPORT_C(void,Fl_Timer_set_color_with_bg_sel)(fl_Timer adjuster,Fl_Color bg,Fl_Color a){- (static_cast<Fl_Timer*>(adjuster))->color(bg,a);- }- FL_EXPORT_C(Fl_Color,Fl_Timer_selection_color)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->selection_color();- }- FL_EXPORT_C(void,Fl_Timer_set_selection_color)(fl_Timer adjuster,Fl_Color a){- (static_cast<Fl_Timer*>(adjuster))->selection_color(a);- }- FL_EXPORT_C(const char*,Fl_Timer_label)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->label();- }- FL_EXPORT_C(void,Fl_Timer_copy_label)(fl_Timer adjuster,const char* new_label){- (static_cast<Fl_Timer*>(adjuster))->copy_label(new_label);- }- FL_EXPORT_C(void,Fl_Timer_set_label)(fl_Timer adjuster,const char* text){- (static_cast<Fl_Timer*>(adjuster))->label(text);- }- FL_EXPORT_C(Fl_Labeltype,Fl_Timer_labeltype)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->labeltype();- }- FL_EXPORT_C(void,Fl_Timer_set_labeltype)(fl_Timer adjuster,Fl_Labeltype a){- (static_cast<Fl_Timer*>(adjuster))->labeltype(a);- }- FL_EXPORT_C(Fl_Color,Fl_Timer_labelcolor)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->labelcolor();- }- FL_EXPORT_C(void,Fl_Timer_set_labelcolor)(fl_Timer adjuster,Fl_Color c){- (static_cast<Fl_Timer*>(adjuster))->labelcolor(c);- }- FL_EXPORT_C(Fl_Font,Fl_Timer_labelfont)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->labelfont();- }- FL_EXPORT_C(void,Fl_Timer_set_labelfont)(fl_Timer adjuster,Fl_Font c){- (static_cast<Fl_Timer*>(adjuster))->labelfont(c);- }- FL_EXPORT_C(Fl_Fontsize,Fl_Timer_labelsize)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->labelsize();- }- FL_EXPORT_C(void,Fl_Timer_set_labelsize)(fl_Timer adjuster,Fl_Fontsize pix){- (static_cast<Fl_Timer*>(adjuster))->labelsize(pix);- }- FL_EXPORT_C(fl_Image,Fl_Timer_image)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->image();- }- FL_EXPORT_C(void,Fl_Timer_set_image)(fl_Timer adjuster,fl_Image pix){- (static_cast<Fl_Timer*>(adjuster))->image((static_cast<Fl_Image*>(pix)));- }- FL_EXPORT_C(fl_Image,Fl_Timer_deimage)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->deimage();- }- FL_EXPORT_C(void,Fl_Timer_set_deimage)(fl_Timer adjuster,fl_Image pix){- (static_cast<Fl_Timer*>(adjuster))->deimage((static_cast<Fl_Image*>(pix)));- }- FL_EXPORT_C(const char*,Fl_Timer_tooltip)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->tooltip();- }- FL_EXPORT_C(void,Fl_Timer_copy_tooltip)(fl_Timer adjuster,const char* text){- (static_cast<Fl_Timer*>(adjuster))->copy_tooltip(text);- }- FL_EXPORT_C(void,Fl_Timer_set_tooltip)(fl_Timer adjuster,const char* text){- (static_cast<Fl_Timer*>(adjuster))->tooltip(text);- }- FL_EXPORT_C(void,Fl_Timer_set_callback_with_user_data)(fl_Timer adjuster,fl_Callback* cb,void* p){- Fl_Timer* castedTimer = (static_cast<Fl_Timer*>(adjuster));- new C_to_Fl_Callback(castedTimer, cb, p);- }- FL_EXPORT_C(void,Fl_Timer_set_callback)(fl_Timer adjuster,fl_Callback* cb){- Fl_Timer* castedTimer = (static_cast<Fl_Timer*>(adjuster));- new C_to_Fl_Callback(castedTimer, cb);- }- FL_EXPORT_C(void*,Fl_Timer_user_data)(fl_Timer adjuster){- C_to_Fl_Callback* stored_cb = (static_cast<C_to_Fl_Callback*>((static_cast<Fl_Timer*>(adjuster))->user_data()));- if(stored_cb){- return stored_cb->get_user_data();- }- else {- return (static_cast<Fl_Timer*>(adjuster))->user_data();- }- }- FL_EXPORT_C(void,Fl_Timer_set_user_data)(fl_Timer adjuster,void* v){- C_to_Fl_Callback* stored_cb = (static_cast<C_to_Fl_Callback*>((static_cast<Fl_Timer*>(adjuster))->user_data()));- if (stored_cb) {- stored_cb->set_user_data(v);- (static_cast<Fl_Timer*>(adjuster))->user_data(stored_cb);- }- else {- (static_cast<Fl_Timer*>(adjuster))->user_data(v);- }- }- FL_EXPORT_C(long,Fl_Timer_argument)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->argument();- }- FL_EXPORT_C(void,Fl_Timer_set_argument)(fl_Timer adjuster,long v){- (static_cast<Fl_Timer*>(adjuster))->argument(v);- }- FL_EXPORT_C(Fl_When,Fl_Timer_when)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->when();- }- FL_EXPORT_C(void,Fl_Timer_set_when)(fl_Timer adjuster,uchar i){- (static_cast<Fl_Timer*>(adjuster))->when(i);- }- FL_EXPORT_C(unsigned int,Fl_Timer_visible)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->visible();- }- FL_EXPORT_C(int,Fl_Timer_visible_r)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->visible_r();- }- FL_EXPORT_C(void,Fl_Timer_set_visible)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->visible();- }- FL_EXPORT_C(void,Fl_Timer_clear_visible)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->clear_visible();- }- FL_EXPORT_C(unsigned int,Fl_Timer_active)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->active();- }- FL_EXPORT_C(int,Fl_Timer_active_r)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->active_r();- }- FL_EXPORT_C(void,Fl_Timer_activate)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->activate();- }- FL_EXPORT_C(void,Fl_Timer_deactivate)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->deactivate();- }- FL_EXPORT_C(unsigned int,Fl_Timer_output)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->output();- }- FL_EXPORT_C(void,Fl_Timer_set_output)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->output();- }- FL_EXPORT_C(void,Fl_Timer_clear_output)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->clear_output();- }- FL_EXPORT_C(unsigned int,Fl_Timer_takesevents)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->takesevents();- }- FL_EXPORT_C(void,Fl_Timer_set_changed)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->changed();- }- FL_EXPORT_C(void,Fl_Timer_clear_changed)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->clear_changed();- }- FL_EXPORT_C(int,Fl_Timer_take_focus)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->take_focus();- }- FL_EXPORT_C(void,Fl_Timer_set_visible_focus)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->set_visible_focus();- }- FL_EXPORT_C(void,Fl_Timer_clear_visible_focus)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->clear_visible_focus();- }- FL_EXPORT_C(void,Fl_Timer_modify_visible_focus)(fl_Timer adjuster,int v){- (static_cast<Fl_Timer*>(adjuster))->visible_focus(v);- }- FL_EXPORT_C(unsigned int,Fl_Timer_visible_focus)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->visible_focus();- }- FL_EXPORT_C(int,Fl_Timer_contains)(fl_Timer adjuster,fl_Widget w){- return (static_cast<Fl_Timer*>(adjuster))->contains((static_cast<Fl_Widget*>(w)));- }- FL_EXPORT_C(int,Fl_Timer_inside)(fl_Timer adjuster,fl_Widget w){- return (static_cast<Fl_Timer*>(adjuster))->inside((static_cast<Fl_Widget*>(w)));- }- FL_EXPORT_C(void,Fl_Timer_redraw)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->redraw();- }- FL_EXPORT_C(void,Fl_Timer_redraw_label)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->redraw_label();- }- FL_EXPORT_C(uchar,Fl_Timer_damage)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->damage();- }- FL_EXPORT_C(void,Fl_Timer_clear_damage_with_bitmask)(fl_Timer adjuster,uchar c){- (static_cast<Fl_Timer*>(adjuster))->clear_damage(c);- }- FL_EXPORT_C(void,Fl_Timer_clear_damage)(fl_Timer adjuster){- (static_cast<Fl_Timer*>(adjuster))->clear_damage();- }- FL_EXPORT_C(void,Fl_Timer_damage_with_text)(fl_Timer adjuster,uchar c){- (static_cast<Fl_Timer*>(adjuster))->damage(c);- }- FL_EXPORT_C(void,Fl_Timer_damage_inside_widget)(fl_Timer adjuster,uchar c,int x,int y,int w,int h){- (static_cast<Fl_Timer*>(adjuster))->damage(c,x,y,w,h);- }- FL_EXPORT_C(void,Fl_Timer_draw_label_with_xywh_alignment)(fl_Timer adjuster,int x,int y,int w,int h,Fl_Align alignment){- (static_cast<Fl_Timer*>(adjuster))->draw_label(x,y,w,h,alignment);- }- FL_EXPORT_C(void,Fl_Timer_measure_label)(fl_Timer adjuster,int* ww,int* hh){- (static_cast<Fl_Timer*>(adjuster))->measure_label(*ww,*hh);- }- FL_EXPORT_C(fl_Window,Fl_Timer_window)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->window();- }- FL_EXPORT_C(fl_Window,Fl_Timer_top_window)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->top_window();- }- FL_EXPORT_C(fl_Window,Fl_Timer_top_window_offset)(fl_Timer adjuster,int* xoff,int* yoff){- return (fl_Window)(static_cast<Fl_Timer*>(adjuster))->top_window_offset(*xoff,*yoff);- }- FL_EXPORT_C(fl_Gl_Window,Fl_Timer_as_gl_window)(fl_Timer adjuster){- return (static_cast<Fl_Timer*>(adjuster))->as_gl_window();- }- FL_EXPORT_C(fl_Timer,Fl_Value_Timer_New)(int x,int y,int w,int h,const char* label){- Fl_Timer* adjuster = new Fl_Timer(FL_VALUE_TIMER,x,y,w,h,label);- return (fl_Timer) adjuster;- }- FL_EXPORT_C(fl_Timer,Fl_Hidden_Timer_New)(int x,int y,int w,int h,const char* label){- Fl_Timer* adjuster = new Fl_Timer(FL_HIDDEN_TIMER,x,y,w,h,label);- return (fl_Timer) adjuster;- }- FL_EXPORT_C(void,Fl_Timer_Destroy)(fl_Timer timer){- delete (static_cast<Fl_Timer*>(timer));- }- FL_EXPORT_C(char,Fl_Timer_direction)(fl_Timer timer){- return (static_cast<Fl_Timer*>(timer))->direction();- }- FL_EXPORT_C(void,Fl_Timer_set_direction)(fl_Timer timer,char d){- (static_cast<Fl_Timer*>(timer))->direction(d);- }- FL_EXPORT_C(void,Fl_Timer_set_value)(fl_Timer timer, double value) {- (static_cast<Fl_Timer*>(timer)->value(value));- }- FL_EXPORT_C(double, Fl_Timer_value)(fl_Timer timer){- return (static_cast<Fl_Timer*>(timer)->value());- }- FL_EXPORT_C(char,Fl_Timer_suspended)(fl_Timer timer){- return (static_cast<Fl_Timer*>(timer))->suspended();- }- FL_EXPORT_C(void,Fl_Timer_set_suspended)(fl_Timer timer,char s){- (static_cast<Fl_Timer*>(timer))->suspended(s);- }- FL_EXPORT_C(fl_Timer, Fl_Timer_New_WithLabel)(int X, int Y, int W, int H, const char* label){- fl_Widget_Virtual_Funcs* fs = Fl_Widget_default_virtual_funcs();- Fl_DerivedTimer* w = new Fl_DerivedTimer(FL_NORMAL_TIMER,X,Y,W,H,label,fs);- return (fl_Timer)w;- }- FL_EXPORT_C(fl_Timer, Fl_OverriddenTimer_New_WithLabel)(int X, int Y, int W, int H, const char* label, fl_Widget_Virtual_Funcs* fs){- Fl_DerivedTimer* w = new Fl_DerivedTimer(FL_NORMAL_TIMER,X,Y,W,H,label,fs);- return (fl_Timer)w;- }- FL_EXPORT_C(void, Fl_Timer_draw)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->draw();- }- FL_EXPORT_C(void, Fl_Timer_draw_super)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->draw_super();- }- FL_EXPORT_C(int, Fl_Timer_handle)(fl_Timer o, int event){- return (static_cast<Fl_DerivedTimer*>(o))->handle(event);- }- FL_EXPORT_C(int, Fl_Timer_handle_super)(fl_Timer o, int event){- return (static_cast<Fl_DerivedTimer*>(o))->handle_super(event);- }- FL_EXPORT_C(void, Fl_Timer_resize)(fl_Timer o, int x, int y, int w, int h){- (static_cast<Fl_DerivedTimer*>(o))->resize(x,y,w,h);- }- FL_EXPORT_C(void, Fl_Timer_resize_super)(fl_Timer o, int x, int y, int w, int h){- (static_cast<Fl_DerivedTimer*>(o))->resize_super(x,y,w,h);- }- FL_EXPORT_C(void, Fl_Timer_show)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->show();- }- FL_EXPORT_C(void, Fl_Timer_show_super)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->show_super();- }- FL_EXPORT_C(void, Fl_Timer_hide)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->hide();- }- FL_EXPORT_C(void, Fl_Timer_hide_super)(fl_Timer o){- (static_cast<Fl_DerivedTimer*>(o))->hide_super();- }-#ifdef __cplusplus-}-#endif
− c-src/Fl_TimerC.h
@@ -1,147 +0,0 @@-#ifndef __FL_TIMER_C__-#define __FL_TIMER_C__-#ifdef __cplusplus-// always include the FL/*.H headers before local headers-// Fl_Widget is included transitively and needed for-// the callback mechanism included below to work.-#include "FL/Fl.H"-#include "FL/Fl_Timer.H"-#include "Fl_CallbackC.h"-#include "Fl_WidgetC.h"-EXPORT {- class Fl_DerivedTimer : public Fl_Timer {- fl_Widget_Virtual_Funcs* overriddenFuncs;- void* other_data;- public:- virtual void draw();- void draw_super();- virtual int handle(int event);- int handle_super(int event);- virtual void resize(int x, int y, int w, int h);- void resize_super(int x, int y, int w, int h);- virtual void show();- void show_super();- virtual void hide();- void hide_super();- Fl_DerivedTimer(uchar t, int X, int Y, int W, int H, const char *l, fl_Widget_Virtual_Funcs* funcs);- ~Fl_DerivedTimer();- };-#endif- /* Inherited from Fl_Widget */- FL_EXPORT_C(int , Fl_Timer_handle )(fl_Timer timer,int event);- FL_EXPORT_C(void, Fl_Timer_resize )(fl_Timer timer,int x, int y, int w, int h);- FL_EXPORT_C(void, Fl_Timer_show )(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_hide )(fl_Timer timer);- FL_EXPORT_C(fl_Window, Fl_Timer_as_window )(fl_Timer timer);- FL_EXPORT_C(fl_Gl_Window, Fl_Timer_as_gl_window)(fl_Timer timer);- FL_EXPORT_C(fl_Group, Fl_Timer_parent)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_parent)(fl_Timer timer, fl_Group grp);- FL_EXPORT_C(uchar, Fl_Timer_type)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_type)(fl_Timer timer, uchar t);-- FL_EXPORT_C(int, Fl_Timer_x)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_y)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_w)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_h)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_align)(fl_Timer timer, Fl_Align alignment);- FL_EXPORT_C(Fl_Align, Fl_Timer_align)(fl_Timer timer);- FL_EXPORT_C(Fl_Boxtype, Fl_Timer_box)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_box)(fl_Timer timer, Fl_Boxtype new_box);- FL_EXPORT_C(Fl_Color, Fl_Timer_color)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_color)(fl_Timer timer, Fl_Color bg);- FL_EXPORT_C(void, Fl_Timer_set_color_with_bg_sel)(fl_Timer timer,Fl_Color bg, Fl_Color a);- FL_EXPORT_C(Fl_Color, Fl_Timer_selection_color)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_selection_color)(fl_Timer timer, Fl_Color a);- FL_EXPORT_C(const char*, Fl_Timer_label)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_copy_label)(fl_Timer timer, const char* new_label);- FL_EXPORT_C(void, Fl_Timer_set_label)(fl_Timer timer, const char* text);- FL_EXPORT_C(Fl_Labeltype, Fl_Timer_labeltype)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_labeltype)(fl_Timer timer, Fl_Labeltype a);- FL_EXPORT_C(Fl_Color, Fl_Timer_labelcolor)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_labelcolor)(fl_Timer timer, Fl_Color c);- FL_EXPORT_C(Fl_Font, Fl_Timer_labelfont)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_labelfont)(fl_Timer timer, Fl_Font c);- FL_EXPORT_C(Fl_Fontsize, Fl_Timer_labelsize)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_labelsize)(fl_Timer timer, Fl_Fontsize pix);- FL_EXPORT_C(fl_Image, Fl_Timer_image)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_image)(fl_Timer timer, fl_Image pix);- FL_EXPORT_C(fl_Image, Fl_Timer_deimage)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_deimage)(fl_Timer timer, fl_Image pix);- FL_EXPORT_C(const char*, Fl_Timer_tooltip)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_copy_tooltip)(fl_Timer timer, const char* text);- FL_EXPORT_C(void, Fl_Timer_set_tooltip)(fl_Timer timer, const char* text);- FL_EXPORT_C(void, Fl_Timer_set_callback_with_user_data)(fl_Timer timer, fl_Callback* cb, void* p);- FL_EXPORT_C(void, Fl_Timer_set_callback)(fl_Timer timer, fl_Callback* cb);- FL_EXPORT_C(void*, Fl_Timer_user_data)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_user_data)(fl_Timer timer, void* v);- FL_EXPORT_C(long, Fl_Timer_argument)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_argument)(fl_Timer timer, long v);- FL_EXPORT_C(Fl_When, Fl_Timer_when)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_when)(fl_Timer timer, uchar i);- FL_EXPORT_C(unsigned int, Fl_Timer_visible)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_visible_r)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_visible)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_clear_visible)(fl_Timer timer);- FL_EXPORT_C(unsigned int, Fl_Timer_active)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_active_r)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_activate)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_deactivate)(fl_Timer timer);- FL_EXPORT_C(unsigned int, Fl_Timer_output)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_output)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_clear_output)(fl_Timer timer);- FL_EXPORT_C(unsigned int, Fl_Timer_takesevents)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_changed)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_clear_changed)(fl_Timer timer);- FL_EXPORT_C(int, Fl_Timer_take_focus)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_visible_focus)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_clear_visible_focus)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_modify_visible_focus)(fl_Timer timer, int v);- FL_EXPORT_C(unsigned int, Fl_Timer_visible_focus)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_do_callback)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_do_callback_with_widget_and_user_data)(fl_Timer timer, fl_Widget w, long arg);- FL_EXPORT_C(void, Fl_Timer_do_callback_with_widget_and_default_user_data)(fl_Timer timer, fl_Widget w);- FL_EXPORT_C(int, Fl_Timer_contains)(fl_Timer timer, fl_Widget w);- FL_EXPORT_C(int, Fl_Timer_inside)(fl_Timer timer, fl_Widget w);- FL_EXPORT_C(void, Fl_Timer_redraw)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_redraw_label)(fl_Timer timer);- FL_EXPORT_C(uchar, Fl_Timer_damage)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_clear_damage_with_bitmask)(fl_Timer timer, uchar c);- FL_EXPORT_C(void, Fl_Timer_clear_damage)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_damage_with_text)(fl_Timer timer, uchar c);- FL_EXPORT_C(void, Fl_Timer_damage_inside_widget)(fl_Timer timer, uchar c, int x , int y , int w, int h);- FL_EXPORT_C(void, Fl_Timer_draw_label_with_xywh_alignment)(fl_Timer timer, int x , int y , int w, int h, Fl_Align alignment);- FL_EXPORT_C(void, Fl_Timer_measure_label)(fl_Timer timer, int* ww , int* hh);- FL_EXPORT_C(fl_Window, Fl_Timer_window)(fl_Timer timer);- FL_EXPORT_C(fl_Window, Fl_Timer_top_window)(fl_Timer timer);- FL_EXPORT_C(fl_Window , Fl_Timer_top_window_offset)(fl_Timer timer, int* xoff, int* yoff);- FL_EXPORT_C(fl_Group, Fl_Timer_as_group)(fl_Timer timer);- FL_EXPORT_C(fl_Gl_Window, Fl_Timer_as_gl_window)(fl_Timer timer);-- FL_EXPORT_C(fl_Timer, Fl_Timer_New)(int x, int y, int w, int h, const char* l);- FL_EXPORT_C(fl_Timer, Fl_Value_Timer_New)(int x, int y, int w, int h, const char* l);- FL_EXPORT_C(fl_Timer, Fl_Hidden_Timer_New)(int x, int y, int w, int h, const char* l);-- FL_EXPORT_C(void, Fl_Timer_Destroy)(fl_Timer timer);-- FL_EXPORT_C(char, Fl_Timer_direction)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_direction)(fl_Timer timer, char d);- FL_EXPORT_C(double, Fl_Timer_value)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_value)(fl_Timer timer, double value);- FL_EXPORT_C(char, Fl_Timer_suspended)(fl_Timer timer);- FL_EXPORT_C(void, Fl_Timer_set_suspended)(fl_Timer timer, char s);- FL_EXPORT_C(fl_Timer, Fl_OverriddenTimer_New)(int X, int Y, int W, int H,fl_Widget_Virtual_Funcs* fs);- FL_EXPORT_C(fl_Timer, Fl_OverriddenTimer_New_WithLabel)(int X, int Y, int W, int H, const char* label, fl_Widget_Virtual_Funcs* fs);- FL_EXPORT_C(void, Fl_Timer_draw)(fl_Timer o);- FL_EXPORT_C(void, Fl_Timer_draw_super)(fl_Timer o);- FL_EXPORT_C(int, Fl_Timer_handle)(fl_Timer o, int event);- FL_EXPORT_C(int, Fl_Timer_handle_super)(fl_Timer o, int event);- FL_EXPORT_C(void, Fl_Timer_resize)(fl_Timer o, int x, int y, int w, int h);- FL_EXPORT_C(void, Fl_Timer_resize_super)(fl_Timer o, int x, int y, int w, int h);- FL_EXPORT_C(void, Fl_Timer_show)(fl_Timer o);- FL_EXPORT_C(void, Fl_Timer_show_super)(fl_Timer o);- FL_EXPORT_C(void, Fl_Timer_hide)(fl_Timer o);- FL_EXPORT_C(void, Fl_Timer_hide_super)(fl_Timer o);-#ifdef __cplusplus-}-#endif-#endif /*#ifndef __FL_TIMER_C__*/
c-src/Makefile.in view
@@ -6,7 +6,6 @@ CPPFILES= \ Fl_Menu_ButtonC.cpp \ Fl_PositionerC.cpp \- Fl_TimerC.cpp \ Fl_Value_OutputC.cpp \ Fl_Value_SliderC.cpp \ Fl_ScrollbarC.cpp \
fltkhs.cabal view
@@ -1,8 +1,7 @@ name : fltkhs-version : 0.5.2.4+version : 0.5.2.5 synopsis : FLTK bindings-description:- Low level bindings for the FLTK GUI toolkit. For installation and quick start instruction please scroll all the way down to the README.+description: Low level bindings for the FLTK GUI toolkit. For installation and quick start instruction please scroll all the way down to the README. license : MIT license-file : LICENSE tested-with: GHC >=7.8.1@@ -76,7 +75,6 @@ Graphics.UI.FLTK.LowLevel.ValueSlider Graphics.UI.FLTK.LowLevel.ValueInput Graphics.UI.FLTK.LowLevel.ValueOutput- Graphics.UI.FLTK.LowLevel.Timer Graphics.UI.FLTK.LowLevel.Progress Graphics.UI.FLTK.LowLevel.Positioner Graphics.UI.FLTK.LowLevel.Input
src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs view
@@ -128,7 +128,6 @@ module Graphics.UI.FLTK.LowLevel.Tabs, module Graphics.UI.FLTK.LowLevel.Table, module Graphics.UI.FLTK.LowLevel.TableRow,- module Graphics.UI.FLTK.LowLevel.Timer, module Graphics.UI.FLTK.LowLevel.ToggleButton, module Graphics.UI.FLTK.LowLevel.Tree, module Graphics.UI.FLTK.LowLevel.TreeItem,@@ -215,7 +214,6 @@ import Graphics.UI.FLTK.LowLevel.ValueSlider import Graphics.UI.FLTK.LowLevel.ValueInput import Graphics.UI.FLTK.LowLevel.ValueOutput-import Graphics.UI.FLTK.LowLevel.Timer import Graphics.UI.FLTK.LowLevel.Progress import Graphics.UI.FLTK.LowLevel.Positioner import Graphics.UI.FLTK.LowLevel.Input@@ -264,7 +262,7 @@ -- $Motivation -- This library aims to make it easy for users to build native apps that work portably across platforms. ----- The original author is also very interested the renewed interested in user+-- I'm also very interested the renewed interested in user -- interfaces in the programming community, whether the various kinds of -- functional reactive programming, meta-object protocol UI's, or something like -- React.js.@@ -279,10 +277,10 @@ -- security issues. -- -- == Why FLTK?--- - The original author chose FLTK because it was small enough that one person could bind the whole thing in an initial+-- - I chose FLTK because it was small enough that one person could bind the whole thing in an initial -- pass. Larger toolkits like QT, although way slicker, would require many man-years of effort. -- - FLTK is quite featureful--- - FLTK is mature and maintained, the project is about 20 years old and author has had good experiences with the community+-- - FLTK is mature and maintained, the project is about 20 years old and I have had good experiences with the community -- - FLTK comes with a simple but quite useful GUI builder, <https://en.wikipedia.org/wiki/FLUID Fluid> which is now able to -- generate Haskell code. See the `Fluid Support` section for more details. --@@ -290,7 +288,7 @@ -- These are all great projects and produce really nice UI's, but they all fail -- at least one of criterion listed under the __Goals__ section below. ----- To the author's knowledge, as of the first quarter of 2016, no other package+-- To my knowledge, as of the second quarter of 2017, no other package -- in the Haskell ecosystem meets all those constraints. -- @@ -322,7 +320,7 @@ -- the 'fltkhs-fluidtohs' utility to automatically convert any Fluid in 'src' -- directory into a Haskell module of the same name during the preprocess step. -- This means using Fluid in a FLTKHS project is as simple as creating a Fluid--- interface and running 'cabal build' or 'cabal install'.+-- interface and running 'stack build --flag fltkhs:bundled' or 'stack install --flag fltkhs:bundled'. -- -- Additionally the <https://github.com/deech/fltkhs-fluid-demos fltkhs-fluid-demos> package -- comes with a number of demos that show off how Fluid integrates with FLTKS.@@ -346,7 +344,7 @@ -- "theme file" that applies uniformly to all widgets in the app. -- -- == Compile Times--- Currently a dense app (~ 160-180 widgets crammed into the same window) takes+-- Currently a dense app with ~ 160-180 widgets crammed into the same window takes -- 9-12 seconds to compile with GHC 7.10.3 on a 32GB quad-core machine. -- The good news is that this is a <https://ghc.haskell.org/trac/ghc/ticket/12506 known issue>. --@@ -947,21 +945,17 @@ -- $GettingStarted ----- It is assumed that by this point the user has successfully installed this--- library and demos in <http://github.com/deech/fltkhs-demos fltkhs-demos> (see--- above).+-- By this point, I assume that you have successfully installed <https://github.com/deech/fltkhs-hello-world hello world>+-- (see above) or one of the <https://github.com/deech/fltkhs-demos demo> <https://github.com/deech/fltkhs-fluid-demos packages>. -- -- -- = Quick Start--- The quickest way to get started is to the download the--- <http://github.com/deech/fltkhs-hello-world FLTKHS project skeleton>. It is a--- simple `hello-world` program that shows the basics of widget creation and--- callbacks. The project's Cabal file comes pre-configured with the options--- necessary to produce a statically-linked executable so a simple 'cabal--- configure && cabal build' should result in an 'fltkhs-hello-world' executable--- in the 'dist' directory.+-- The quickest way to get started is to look at the source for the+-- <http://github.com/deech/fltkhs-hello-world FLTKHS project skeleton>. Though it is a+-- simple app it shows the basics of widget creation and+-- callbacks. ----- Other demos that ship with this package show more complicated usage of the API.+-- Other <https://github.com/deech/fltkhs-demos demo> <https://github.com/deech/fltkhs-fluid-demos packages> show more complicated usage of the API. -- -- Since the API is a low-level binding, code using it takes on the imperative -- style of the underlying toolkit. Fortunately it should look pretty familiar@@ -974,7 +968,7 @@ -- = Guide to the Haddock Docs -- -- Convenient access to the underlying C++ is achieved using typeclasses and--- type-level programming to emulate classes and subclasses. This approach makes+-- type-level programming to emulate OO classes and multiple dispatch. This approach makes -- Haddock very unhappy and the generated documentation is frequently unhelpful. -- For instance, newcomers to this library are urged not to look at -- "Graphics.UI.FLTK.LowLevel.Dispatch" or@@ -1017,7 +1011,7 @@ -- Unfortunately to see this more helpful type signature the poor reader has to -- navigate to the corresponding widget's module, find the __Functions__ header -- and scroll down to the desired function. Haddock, unfortunately, does not--- support anchors that link to a named point in the page. The author is /very/+-- support anchors that link to a named point in the page. I'm /very/ -- open to ideas on how to make this easier. -- -- Carrying on the previous example from the __Widget Creation__ section, the@@ -1089,7 +1083,8 @@ -- widget construction time that give Haskell complete control on <https://hackage.haskell.org/package/fltkhs-0.5.1.3/docs/Graphics-UI-FLTK-LowLevel-Widget.html#v:widgetCustom drawing>, -- <https://hackage.haskell.org/package/fltkhs-0.5.1.3/docs/Graphics-UI-FLTK-LowLevel-Widget.html#t:CustomWidgetFuncs handling, resizing and other key functions>. This means that the Haskell user has -- complete control of look-and-feel and the event loop. The <https://github.com/deech/fltkhs-demos/blob/master/src/Examples/table-as-container.hs#L105 table> demos are--- an example of drawing in Haskell. An example of taking over the event loop is an FLTKHS <https://github.com/deech/fltkhs-reflex-host proof-of-concept> that <https://github.com/deech/fltkhs-reflex-host/blob/master/src/reflex-host.hs#L33 overrides> the FLTKHS event loop with the <https://hackage.haskell.org/package/reflex Reflex FRP> allowing+-- an example of drawing in Haskell. An example of taking over the event loop is an FLTKHS <https://github.com/deech/fltkhs-reflex-host proof-of-concept> that <https://github.com/deech/fltkhs-reflex-host/blob/master/src/reflex-host.hs#L33 overrides>+-- the FLTKHS event loop with the <https://hackage.haskell.org/package/reflex Reflex FRP> allowing -- native functional reactive programming. The sky is the limit! -- -- When providing custom methods the object constructor is no longer@@ -1140,7 +1135,6 @@ -- function name suffixed with \"Super\". For instance, the user can provide a -- custom implementation of /handle/ on "Graphics.UI.FLTK.LowLevel.Window" via -- the constructor and every call to /handle/ invokes that implementation, but- -- the user can also call /handleSuper/ to get at the default C++ -- implementation. This comes in handy when the custom function is just setting -- up variables or logging and wants underlying implementation to take over at@@ -1148,11 +1142,11 @@ -- -- __Warning__: since calls to the default implementation of the function, -- /handleSuper/, for example, are available to the widget they are--- automatically available to all subclasses of the widget. The author--- acknowledges this is a confusing aspect of the library's design but hopes the+-- automatically available to all subclasses of the widget. I+-- acknowledge this is a confusing aspect of the library's design but hopes the -- benefit of being able to get at the default implementation out-weighs the--- trap the user might fall into. If this becomes a pervasive problem the author--- is open to removing this functionality.+-- trap the user might fall into. If this becomes a pervasive problem I'm+-- open to removing this functionality. -- -- $Compilation@@ -1167,7 +1161,7 @@ -- longer to compile. To further emphasize, there does not appear to be any -- runtime performance issues. This is only a compile time problem. ----- To preserve the user's and the author's sanity a flag `fastCompile` has been+-- To preserve the user's and my sanity a flag `fastCompile` has been -- introduced to the <https://github.com/deech/fltkhs-demos fltkhs-demos> and -- to the <https://github.com/deech/fltkhs-fluid-demos fltkhs-fluid-demos>. -- This flag which tells the compiler to skip the specialising step when@@ -1179,7 +1173,7 @@ -- Stack to ignore it during the `build` step: -- -- @--- > stack build --flag fltkhs-demos:-fastCompile+-- > stack build --flag fltkhs:bundled --flag fltkhs-demos:-fastCompile -- @ -- -- In the <https://github.com/deech/fltkhs-hello-world fltkhs> and the@@ -1189,20 +1183,21 @@ -- Stack to enable it during the `configure` step: -- -- @--- > stack build --flag fltkhs-hello-world:fastCompile+-- > stack build --flag fltkhs:bundled --flag fltkhs-hello-world:fastCompile -- @ -- -- =File Layout -- @ -- Root--- - c-src -- The C bindings--- - c-examples -- demos written using the C bindings (not installed)+-- - c-src -- The C bindings+-- - c-examples -- demos written using the C bindings (not installed)+-- - fltk-<version>.tar.gz -- The bundled FLTK library -- - src--- - TestPrograms -- Haskell test programs--- - Fluid -- The Fluid file to Haskell conversion utility+-- - TestPrograms -- Haskell test programs+-- - Fluid -- The Fluid file to Haskell conversion utility -- - Graphics -- - UI -- - FLTK--- - LowLevel -- Haskell bindings--- - scripts -- various helper scripts (probably not interesting to anyone but the original author)+-- - LowLevel -- Haskell bindings+-- - scripts -- various helper scripts (probably not interesting to anyone but myself) -- @
src/Graphics/UI/FLTK/LowLevel/Fl_Types.chs view
@@ -445,12 +445,10 @@ isNull :: Ref a -> IO Bool isNull (Ref fptr) =- withForeignPtr fptr $+ withForeignPtr fptr (\ptrToRefPtr -> do refPtr <- peek ptrToRefPtr- if (refPtr == nullPtr)- then return True- else return False+ return (refPtr == nullPtr) ) unsafeRefToPtr :: Ref a -> IO (Ptr ())
− src/Graphics/UI/FLTK/LowLevel/Timer.chs
@@ -1,170 +0,0 @@-{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-module Graphics.UI.FLTK.LowLevel.Timer- (- -- * Constructor- timerNew,- timerCustom,- -- * Hierarchy- --- -- $hierarchy-- valueTimerNew,- hiddenTimerNew- -- * Functions- --- -- $functions- )-where-#include "Fl_ExportMacros.h"-#include "Fl_Types.h"-#include "Fl_TimerC.h"-import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Graphics.UI.FLTK.LowLevel.Widget-import Graphics.UI.FLTK.LowLevel.Fl_Enumerations-import Graphics.UI.FLTK.LowLevel.Fl_Types-import Graphics.UI.FLTK.LowLevel.Utils-import Graphics.UI.FLTK.LowLevel.Hierarchy-import Graphics.UI.FLTK.LowLevel.Dispatch-import qualified Data.Text as T--{# fun Fl_OverriddenTimer_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenTimer_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #}-timerCustom ::- Rectangle -- ^ The bounds of this Timer- -> T.Text -- ^ The Timer label- -> Maybe (Ref Timer -> IO ()) -- ^ Optional custom drawing function- -> Maybe (CustomWidgetFuncs Timer) -- ^ Optional custom widget functions- -> IO (Ref Timer)-timerCustom rectangle l' draw' funcs' =- widgetMaker- rectangle- (Just l')- draw'- funcs'- overriddenWidgetNew'- overriddenWidgetNewWithLabel'---{# fun Fl_Timer_New as timerNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}-timerNew :: Rectangle -> T.Text -> IO (Ref Timer)-timerNew rectangle l'=- let (x_pos, y_pos, width, height) = fromRectangle rectangle- in timerNewWithLabel' x_pos y_pos width height l' >>= toRef-{# fun Fl_Value_Timer_New as valueTimerNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}-valueTimerNew :: Rectangle -> T.Text -> IO (Ref ValueTimer)-valueTimerNew rectangle l'=- let (x_pos, y_pos, width, height) = fromRectangle rectangle- in- valueTimerNewWithLabel' x_pos y_pos width height l' >>= toRef--{# fun Fl_Hidden_Timer_New as hiddenTimerNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}-hiddenTimerNew :: Rectangle -> T.Text -> IO (Ref HiddenTimer)-hiddenTimerNew rectangle l'=- let (x_pos, y_pos, width, height) = fromRectangle rectangle- in- hiddenTimerNewWithLabel' x_pos y_pos width height l' >>= toRef--{# fun Fl_Timer_Destroy as timerDestroy' { id `Ptr ()' } -> `()' supressWarningAboutRes #}-instance (impl ~ (IO ())) => Op (Destroy ()) Timer orig impl where- runOp _ _ win = swapRef win $ \winPtr -> do- timerDestroy' winPtr- return nullPtr-{# fun Fl_Timer_direction as direction' { id `Ptr ()' } -> `CChar' id #}-instance (impl ~ ( IO (CountDirection))) => Op (GetDirection ()) Timer orig impl where- runOp _ _ adjuster = withRef adjuster $ \adjusterPtr -> direction' adjusterPtr >>= return . ccharToCountDirection-{# fun Fl_Timer_set_direction as setDirection' { id `Ptr ()',id `CChar' } -> `()' #}-instance (impl ~ (CountDirection -> IO ())) => Op (SetDirection ()) Timer orig impl where- runOp _ _ adjuster d = withRef adjuster $ \adjusterPtr -> setDirection' adjusterPtr (countDirectionToCChar d)-{# fun Fl_Timer_value as value' { id `Ptr ()' } -> `Double' #}-instance (impl ~ ( IO (Double))) => Op (GetValue ()) Timer orig impl where- runOp _ _ adjuster = withRef adjuster $ \adjusterPtr -> value' adjusterPtr-{# fun Fl_Timer_set_value as setValue' { id `Ptr ()',`Double' } -> `()' #}-instance (impl ~ (Double -> IO ())) => Op (SetValue ()) Timer orig impl where- runOp _ _ adjuster value = withRef adjuster $ \adjusterPtr -> setValue' adjusterPtr value-{# fun Fl_Timer_suspended as suspended' { id `Ptr ()' } -> `Bool' cToBool #}-instance (impl ~ ( IO (Bool))) => Op (GetSuspended ()) Timer orig impl where- runOp _ _ adjuster = withRef adjuster $ \adjusterPtr -> suspended' adjusterPtr-{# fun Fl_Timer_set_suspended as setSuspended' { id `Ptr ()', cFromBool `Bool' } -> `()' #}-instance (impl ~ (Bool -> IO ())) => Op (SetSuspended ()) Timer orig impl where- runOp _ _ adjuster s = withRef adjuster $ \adjusterPtr -> setSuspended' adjusterPtr s-{# fun Fl_Timer_draw as draw'' { id `Ptr ()' } -> `()' #}-instance (impl ~ ( IO ())) => Op (Draw ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> draw'' timerPtr-{# fun Fl_Timer_draw_super as drawSuper' { id `Ptr ()' } -> `()' supressWarningAboutRes #}-instance (impl ~ ( IO ())) => Op (DrawSuper ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> drawSuper' timerPtr-{#fun Fl_Timer_handle as timerHandle' { id `Ptr ()', id `CInt' } -> `Int' #}-instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) Timer orig impl where- runOp _ _ timer event = withRef timer (\p -> timerHandle' p (fromIntegral . fromEnum $ event)) >>= return . successOrUnknownEvent-{# fun Fl_Timer_handle_super as handleSuper' { id `Ptr ()',`Int' } -> `Int' #}-instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (HandleSuper ()) Timer orig impl where- runOp _ _ timer event = withRef timer $ \timerPtr -> handleSuper' timerPtr (fromIntegral (fromEnum event)) >>= return . successOrUnknownEvent-{# fun Fl_Timer_resize as resize' { id `Ptr ()',`Int',`Int',`Int',`Int' } -> `()' supressWarningAboutRes #}-instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) Timer orig impl where- runOp _ _ timer rectangle = withRef timer $ \timerPtr -> do- let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle- resize' timerPtr x_pos y_pos w_pos h_pos-{# fun Fl_Timer_resize_super as resizeSuper' { id `Ptr ()',`Int',`Int',`Int',`Int' } -> `()' supressWarningAboutRes #}-instance (impl ~ (Rectangle -> IO ())) => Op (ResizeSuper ()) Timer orig impl where- runOp _ _ timer rectangle =- let (x_pos, y_pos, width, height) = fromRectangle rectangle- in withRef timer $ \timerPtr -> resizeSuper' timerPtr x_pos y_pos width height-{# fun Fl_Timer_hide as hide' { id `Ptr ()' } -> `()' #}-instance (impl ~ ( IO ())) => Op (Hide ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> hide' timerPtr-{# fun Fl_Timer_hide_super as hideSuper' { id `Ptr ()' } -> `()' supressWarningAboutRes #}-instance (impl ~ ( IO ())) => Op (HideSuper ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> hideSuper' timerPtr-{# fun Fl_Timer_show as show' { id `Ptr ()' } -> `()' #}-instance (impl ~ ( IO ())) => Op (ShowWidget ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> show' timerPtr-{# fun Fl_Timer_show_super as showSuper' { id `Ptr ()' } -> `()' supressWarningAboutRes #}-instance (impl ~ ( IO ())) => Op (ShowWidgetSuper ()) Timer orig impl where- runOp _ _ timer = withRef timer $ \timerPtr -> showSuper' timerPtr---- $functions--- @------ destroy :: 'Ref' 'Timer' -> 'IO' ()------ draw :: 'Ref' 'Timer' -> 'IO' ()------ drawSuper :: 'Ref' 'Timer' -> 'IO' ()------ getDirection :: 'Ref' 'Timer' -> 'IO' ('CountDirection')------ getSuspended :: 'Ref' 'Timer' -> 'IO' ('Bool')------ getValue :: 'Ref' 'Timer' -> 'IO' ('Double')------ handle :: 'Ref' 'Timer' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())------ handleSuper :: 'Ref' 'Timer' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())------ hide :: 'Ref' 'Timer' -> 'IO' ()------ hideSuper :: 'Ref' 'Timer' -> 'IO' ()------ resize :: 'Ref' 'Timer' -> 'Rectangle' -> 'IO' ()------ resizeSuper :: 'Ref' 'Timer' -> 'Rectangle' -> 'IO' ()------ setDirection :: 'Ref' 'Timer' -> 'CountDirection' -> 'IO' ()------ setSuspended :: 'Ref' 'Timer' -> 'Bool' -> 'IO' ()------ setValue :: 'Ref' 'Timer' -> 'Double' -> 'IO' ()------ showWidget :: 'Ref' 'Timer' -> 'IO' ()------ showWidgetSuper :: 'Ref' 'Timer' -> 'IO' ()--- @---- $hierarchy--- @--- "Graphics.UI.FLTK.LowLevel.Widget"--- |--- v--- "Graphics.UI.FLTK.LowLevel.Timer"--- @