fltkhs 0.5.4.2 → 0.5.4.3
raw patch · 15 files changed
+88/−76 lines, 15 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Graphics.UI.FLTK.LowLevel.FL: addAwakeHandler :: GlobalCallback -> IO Int
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (GHC.Types.Int -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetTabNav ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (GHC.Types.Int -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetInputType ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (GHC.Types.Int -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetWrap ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO GHC.Types.Int => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetInputType ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO GHC.Types.Int => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetWrap ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO GHC.Types.Int => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetTabNav ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
- Graphics.UI.FLTK.LowLevel.OverlayWindow: instance impl ~ GHC.Types.IO GHC.Types.Int => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.CanDoOverlay ()) Graphics.UI.FLTK.LowLevel.Hierarchy.OverlayWindow orig impl
- Graphics.UI.FLTK.LowLevel.SysMenuBar: instance impl ~ (GHC.Types.Int -> GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ClearSubmenu ()) Graphics.UI.FLTK.LowLevel.Hierarchy.SysMenuBar orig impl
- Graphics.UI.FLTK.LowLevel.Table: instance impl ~ (Graphics.UI.FLTK.LowLevel.Table.TableCoordinate -> GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.MoveCursor ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Table orig impl
- Graphics.UI.FLTK.LowLevel.Tree: instance impl ~ (Graphics.UI.FLTK.LowLevel.TreeItem.TreeItemLocator -> GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Deselect ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Tree orig impl
- Graphics.UI.FLTK.LowLevel.Tree: instance impl ~ (Graphics.UI.FLTK.LowLevel.TreeItem.TreeItemLocator -> GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Select ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Tree orig impl
- Graphics.UI.FLTK.LowLevel.Widget: instance (Graphics.UI.FLTK.LowLevel.Dispatch.Parent a Graphics.UI.FLTK.LowLevel.Hierarchy.Widget, impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref a -> GHC.Types.IO GHC.Types.Int)) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Contains ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Widget orig impl
- Graphics.UI.FLTK.LowLevel.Widget: instance (Graphics.UI.FLTK.LowLevel.Dispatch.Parent a Graphics.UI.FLTK.LowLevel.Hierarchy.Widget, impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref a -> GHC.Types.IO GHC.Types.Int)) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Inside ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Widget orig impl
+ Graphics.UI.FLTK.LowLevel.FL: addAwakeHandler_ :: GlobalCallback -> IO (Either AwakeRingFull ())
+ Graphics.UI.FLTK.LowLevel.Fl_Types: AwakeRingFull :: AwakeRingFull
+ Graphics.UI.FLTK.LowLevel.Fl_Types: OutOfRangeOrNotSubmenu :: OutOfRangeOrNotSubmenu
+ Graphics.UI.FLTK.LowLevel.Fl_Types: data AwakeRingFull
+ Graphics.UI.FLTK.LowLevel.Fl_Types: data OutOfRangeOrNotSubmenu
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Fl_Types.AwakeRingFull
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Fl_Types.OutOfRangeOrNotSubmenu
+ Graphics.UI.FLTK.LowLevel.Fl_Types: successOrAwakeRingFull :: Int -> Either AwakeRingFull ()
+ Graphics.UI.FLTK.LowLevel.Fl_Types: successOrOutOfRangeOrNotSubmenu :: Int -> Either OutOfRangeOrNotSubmenu ()
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (GHC.Types.Bool -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetTabNav ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (GHC.Types.Bool -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetWrap ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ (Graphics.UI.FLTK.LowLevel.Input.FlInputType -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetInputType ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO GHC.Types.Bool => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetTabNav ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO GHC.Types.Bool => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetWrap ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.Input: instance impl ~ GHC.Types.IO Graphics.UI.FLTK.LowLevel.Input.FlInputType => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetInputType ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Input orig impl
+ Graphics.UI.FLTK.LowLevel.OverlayWindow: instance impl ~ GHC.Types.IO GHC.Types.Bool => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.CanDoOverlay ()) Graphics.UI.FLTK.LowLevel.Hierarchy.OverlayWindow orig impl
+ Graphics.UI.FLTK.LowLevel.SysMenuBar: instance impl ~ (GHC.Types.Int -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.OutOfRangeOrNotSubmenu ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ClearSubmenu ()) Graphics.UI.FLTK.LowLevel.Hierarchy.SysMenuBar orig impl
+ Graphics.UI.FLTK.LowLevel.Table: instance impl ~ (Graphics.UI.FLTK.LowLevel.Table.TableCoordinate -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.NoChange ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.MoveCursor ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Table orig impl
+ Graphics.UI.FLTK.LowLevel.Tree: instance impl ~ (Graphics.UI.FLTK.LowLevel.TreeItem.TreeItemLocator -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.NoChange ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Deselect ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Tree orig impl
+ Graphics.UI.FLTK.LowLevel.Tree: instance impl ~ (Graphics.UI.FLTK.LowLevel.TreeItem.TreeItemLocator -> GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Fl_Types.NoChange ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Select ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Tree orig impl
+ Graphics.UI.FLTK.LowLevel.Widget: instance (Graphics.UI.FLTK.LowLevel.Dispatch.Parent a Graphics.UI.FLTK.LowLevel.Hierarchy.Widget, impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref a -> GHC.Types.IO GHC.Types.Bool)) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Contains ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Widget orig impl
+ Graphics.UI.FLTK.LowLevel.Widget: instance (Graphics.UI.FLTK.LowLevel.Dispatch.Parent a Graphics.UI.FLTK.LowLevel.Hierarchy.Widget, impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref a -> GHC.Types.IO GHC.Types.Bool)) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Inside ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Widget orig impl
- Graphics.UI.FLTK.LowLevel.FL: eventDispatch :: (Parent a Widget) => IO (Event -> Ref a -> IO (Int))
+ Graphics.UI.FLTK.LowLevel.FL: eventDispatch :: (Parent a Widget) => IO (Event -> Ref a -> IO (Either UnknownEvent ()))
- Graphics.UI.FLTK.LowLevel.FL: handle :: (Parent a Window) => Event -> Ref a -> IO Int
+ Graphics.UI.FLTK.LowLevel.FL: handle :: (Parent a Window) => Event -> Ref a -> IO (Either UnknownEvent ())
- Graphics.UI.FLTK.LowLevel.FL: handle_ :: (Parent a Window) => Event -> Ref a -> IO Int
+ Graphics.UI.FLTK.LowLevel.FL: handle_ :: (Parent a Window) => Event -> Ref a -> IO (Either UnknownEvent ())
- Graphics.UI.FLTK.LowLevel.FL: setEventDispatch :: (Parent a Widget) => (Event -> Ref a -> IO Int) -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: setEventDispatch :: (Parent a Widget) => (Event -> Ref a -> IO (Either UnknownEvent ())) -> IO ()
- Graphics.UI.FLTK.LowLevel.FL: setVisibleFocus :: Int -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: setVisibleFocus :: Bool -> IO ()
- Graphics.UI.FLTK.LowLevel.FL: visibleFocus :: IO Int
+ Graphics.UI.FLTK.LowLevel.FL: visibleFocus :: IO Bool
Files
- c-src/Fl_File_InputC.cpp +2/−2
- c-src/Fl_File_InputC.h +2/−2
- c-src/Fl_InputC.cpp +2/−2
- c-src/Fl_InputC.h +2/−2
- c-src/Fl_Input_C.cpp +2/−2
- c-src/Fl_Input_C.h +2/−2
- fltkhs.cabal +1/−1
- src/Graphics/UI/FLTK/LowLevel/FL.chs +22/−16
- src/Graphics/UI/FLTK/LowLevel/Fl_Types.chs +6/−0
- src/Graphics/UI/FLTK/LowLevel/Input.chs +22/−22
- src/Graphics/UI/FLTK/LowLevel/OverlayWindow.chs +3/−3
- src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs +3/−5
- src/Graphics/UI/FLTK/LowLevel/Table.chs +5/−5
- src/Graphics/UI/FLTK/LowLevel/Tree.chs +6/−6
- src/Graphics/UI/FLTK/LowLevel/Widget.chs +8/−6
c-src/Fl_File_InputC.cpp view
@@ -454,10 +454,10 @@ FL_EXPORT_C(void,Fl_File_Input_set_wrap)(fl_File_Input file_input,int b){ (static_cast<Fl_File_Input*>(file_input))->wrap(b); }- FL_EXPORT_C(void,Fl_File_Input_tab_nav)(fl_File_Input file_input,int val){+ FL_EXPORT_C(void,Fl_File_Input_set_tab_nav)(fl_File_Input file_input,int val){ (static_cast<Fl_File_Input*>(file_input))->tab_nav(val); }- FL_EXPORT_C(int,Fl_File_Input_set_tab_nav)(fl_File_Input file_input){+ FL_EXPORT_C(int,Fl_File_Input_tab_nav)(fl_File_Input file_input){ return (static_cast<Fl_File_Input*>(file_input))->tab_nav(); } FL_EXPORT_C(int,Fl_File_Input_set_value)(fl_File_Input file_input,const char* text){
c-src/Fl_File_InputC.h view
@@ -151,8 +151,8 @@ FL_EXPORT_C_HEADER(void,Fl_File_Input_set_readonly,(fl_File_Input file_input,int b)); FL_EXPORT_C_HEADER(int,Fl_File_Input_wrap,(fl_File_Input file_input)); FL_EXPORT_C_HEADER(void,Fl_File_Input_set_wrap,(fl_File_Input file_input,int b));- FL_EXPORT_C_HEADER(void,Fl_File_Input_tab_nav,(fl_File_Input file_input,int val));- FL_EXPORT_C_HEADER(int,Fl_File_Input_set_tab_nav,(fl_File_Input file_input));+ FL_EXPORT_C_HEADER(void,Fl_File_Input_set_tab_nav,(fl_File_Input file_input,int val));+ FL_EXPORT_C_HEADER(int,Fl_File_Input_tab_nav,(fl_File_Input file_input)); /* Fl_File_Input specific functions */ FL_EXPORT_C_HEADER(fl_File_Input,Fl_File_Input_New_WithLabel,(int x, int y, int w, int h, const char* label));
c-src/Fl_InputC.cpp view
@@ -464,10 +464,10 @@ FL_EXPORT_C(void,Fl_Input_set_wrap)(fl_Input input,int b){ (static_cast<Fl_Input*>(input))->wrap(b); }- FL_EXPORT_C(void,Fl_Input_tab_nav)(fl_Input input,int val){+ FL_EXPORT_C(void,Fl_Input_set_tab_nav)(fl_Input input,int val){ (static_cast<Fl_Input*>(input))->tab_nav(val); }- FL_EXPORT_C(int,Fl_Input_set_tab_nav)(fl_Input input){+ FL_EXPORT_C(int,Fl_Input_tab_nav)(fl_Input input){ return (static_cast<Fl_Input*>(input))->tab_nav(); } FL_EXPORT_C(void, Fl_Input_draw)(fl_Input o){
c-src/Fl_InputC.h view
@@ -161,8 +161,8 @@ FL_EXPORT_C_HEADER(void,Fl_Input_set_readonly,(fl_Input input,int b)); FL_EXPORT_C_HEADER(int,Fl_Input_wrap,(fl_Input input)); FL_EXPORT_C_HEADER(void,Fl_Input_set_wrap,(fl_Input input,int b));- FL_EXPORT_C_HEADER(void,Fl_Input_tab_nav,(fl_Input input,int val));- FL_EXPORT_C_HEADER(int,Fl_Input_set_tab_nav,(fl_Input input));+ FL_EXPORT_C_HEADER(void,Fl_Input_set_tab_nav,(fl_Input input,int val));+ FL_EXPORT_C_HEADER(int,Fl_Input_tab_nav,(fl_Input input)); FL_EXPORT_C_HEADER(fl_Input,Fl_OverriddenInput_New,(int X, int Y, int W, int H,fl_Widget_Virtual_Funcs* fs)); FL_EXPORT_C_HEADER(fl_Input,Fl_OverriddenInput_New_WithLabel,(int X, int Y, int W, int H, const char* label, fl_Widget_Virtual_Funcs* fs)); FL_EXPORT_C_HEADER(void,Fl_Input_draw,(fl_Input o));
c-src/Fl_Input_C.cpp view
@@ -394,10 +394,10 @@ FL_EXPORT_C(void,Fl_Input__set_wrap)(fl_Input_ input_,int b){ (static_cast<Fl_Input_*>(input_))->wrap(b); }- FL_EXPORT_C(void,Fl_Input__tab_nav)(fl_Input_ input_,int val){+ FL_EXPORT_C(void,Fl_Input__set_tab_nav)(fl_Input_ input_,int val){ (static_cast<Fl_Input_*>(input_))->tab_nav(val); }- FL_EXPORT_C(int,Fl_Input__set_tab_nav)(fl_Input_ input_){+ FL_EXPORT_C(int,Fl_Input__tab_nav)(fl_Input_ input_){ return (static_cast<Fl_Input_*>(input_))->tab_nav(); } #ifdef __cplusplus
c-src/Fl_Input_C.h view
@@ -147,8 +147,8 @@ FL_EXPORT_C_HEADER(void,Fl_Input__set_readonly,(fl_Input_ input_,int b)); FL_EXPORT_C_HEADER(int,Fl_Input__wrap,(fl_Input_ input_)); FL_EXPORT_C_HEADER(void,Fl_Input__set_wrap,(fl_Input_ input_,int b));- FL_EXPORT_C_HEADER(void,Fl_Input__tab_nav,(fl_Input_ input_,int val));- FL_EXPORT_C_HEADER(int,Fl_Input__set_tab_nav,(fl_Input_ input_));+ FL_EXPORT_C_HEADER(void,Fl_Input__set_tab_nav,(fl_Input_ input_,int val));+ FL_EXPORT_C_HEADER(int,Fl_Input__tab_nav,(fl_Input_ input_)); #ifdef __cplusplus } #endif
fltkhs.cabal view
@@ -1,5 +1,5 @@ name : fltkhs-version : 0.5.4.2+version : 0.5.4.3 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. license : MIT
src/Graphics/UI/FLTK/LowLevel/FL.chs view
@@ -15,7 +15,7 @@ ready, option, setOption,- addAwakeHandler,+ addAwakeHandler_, getAwakeHandler_, display, ownColormap,@@ -262,11 +262,12 @@ {# fun Fl_add_awake_handler_ as addAwakeHandler' {id `FunPtr CallbackPrim', id `(Ptr ())'} -> `Int' #}-addAwakeHandler :: GlobalCallback -> IO Int-addAwakeHandler awakeHandler =+addAwakeHandler_ :: GlobalCallback -> IO (Either AwakeRingFull ())+addAwakeHandler_ awakeHandler = do callbackPtr <- toGlobalCallbackPrim awakeHandler- addAwakeHandler' callbackPtr nullPtr+ res <- addAwakeHandler' callbackPtr nullPtr+ return (successOrAwakeRingFull res) {# fun Fl_get_awake_handler_ as getAwakeHandler_' {id `Ptr (FunPtr CallbackPrim)', id `Ptr (Ptr ())'} -> `Int' #}@@ -510,14 +511,14 @@ {} -> `()' supressWarningAboutRes #} {# fun Fl_handle as handle' { `Int',id `Ptr ()' } -> `Int' #}-handle :: (Parent a Window) => Event -> Ref a -> IO Int+handle :: (Parent a Window) => Event -> Ref a -> IO (Either UnknownEvent ()) handle e wp =- withRef wp (handle' (cFromEnum e))+ withRef wp (handle' (cFromEnum e)) >>= return . successOrUnknownEvent {# fun Fl_handle_ as handle_' { `Int',id `Ptr ()' } -> `Int' #}-handle_ :: (Parent a Window) => Event -> Ref a -> IO Int+handle_ :: (Parent a Window) => Event -> Ref a -> IO (Either UnknownEvent ()) handle_ e wp =- withRef wp (handle_' (cFromEnum e))+ withRef wp (handle_' (cFromEnum e)) >>= return . successOrUnknownEvent {# fun Fl_belowmouse as belowmouse { } -> `Maybe (Ref Widget)' unsafeToMaybeRef #} {# fun Fl_set_belowmouse as setBelowmouse'@@ -562,7 +563,8 @@ { id `Ptr (FunPtr EventDispatchPrim)' } -> `()' supressWarningAboutRes #} {# fun Fl_event_dispatch as eventDispatch' { } -> `FunPtr EventDispatchPrim' id #}-eventDispatch :: (Parent a Widget) => IO (Event -> Ref a -> IO (Int))+eventDispatch :: (Parent a Widget) =>+ IO (Event -> Ref a -> IO (Either UnknownEvent ())) eventDispatch = do funPtr <- eventDispatch'@@ -573,11 +575,13 @@ let eventNum = fromIntegral (fromEnum e) fun = unwrapEventDispatchPrim funPtr in fun eventNum (castPtr ptr) >>=- return . fromIntegral+ return . successOrUnknownEvent . fromIntegral ) ) -setEventDispatch :: (Parent a Widget) => (Event -> Ref a -> IO Int) -> IO ()+setEventDispatch ::+ (Parent a Widget) =>+ (Event -> Ref a -> IO (Either UnknownEvent ())) -> IO () setEventDispatch ed = do do let toPrim = (\e ptr ->@@ -585,7 +589,9 @@ in do obj <- toRef ptr result <- ed eventEnum obj- return $ fromIntegral result+ case result of+ Left _ -> return 0+ _ -> return 1 ) callbackPtr <- wrapEventDispatchPrim toPrim ptrToCallbackPtr <- new callbackPtr@@ -893,10 +899,10 @@ { } -> `Bool' toBool #} release :: IO () release = {#call Fl_release as fl_release #}-setVisibleFocus :: Int -> IO ()-setVisibleFocus = {#call Fl_set_visible_focus as fl_set_visible_focus #} . fromIntegral-visibleFocus :: IO Int-visibleFocus = {#call Fl_visible_focus as fl_visible_focus #} >>= return . fromIntegral+setVisibleFocus :: Bool -> IO ()+setVisibleFocus = {#call Fl_set_visible_focus as fl_set_visible_focus #} . cFromBool+visibleFocus :: IO Bool+visibleFocus = {#call Fl_visible_focus as fl_visible_focus #} >>= return . cToBool setDndTextOps :: Bool -> IO () setDndTextOps = {#call Fl_set_dnd_text_ops as fl_set_dnd_text_ops #} . fromBool dndTextOps :: IO Option
src/Graphics/UI/FLTK/LowLevel/Fl_Types.chs view
@@ -342,6 +342,12 @@ newtype PixmapHs = PixmapHs [T.Text] deriving Show data BitmapHs = BitmapHs B.ByteString Size deriving Show data Clipboard = InternalClipboard | SharedClipboard deriving Show+data OutOfRangeOrNotSubmenu = OutOfRangeOrNotSubmenu deriving Show+successOrOutOfRangeOrNotSubmenu :: Int -> Either OutOfRangeOrNotSubmenu ()+successOrOutOfRangeOrNotSubmenu status = if (status == (-1)) then Left OutOfRangeOrNotSubmenu else Right ()+data AwakeRingFull = AwakeRingFull deriving Show+successOrAwakeRingFull :: Int -> Either AwakeRingFull ()+successOrAwakeRingFull status = if (status == (-1)) then Left AwakeRingFull else Right () data UnknownEvent = UnknownEvent deriving Show successOrUnknownEvent :: Int -> Either UnknownEvent () successOrUnknownEvent status = if (status == 0) then Left UnknownEvent else Right ()
src/Graphics/UI/FLTK/LowLevel/Input.chs view
@@ -99,7 +99,7 @@ input (\p -> do t <- getInputType input- case (toEnum (fromIntegral t)) of+ case t of FlSecretInput -> secretInputHandle' p (fromIntegral . fromEnum $ event) _ -> inputHandle' p (fromIntegral . fromEnum $ event) )@@ -222,11 +222,11 @@ instance (impl ~ (Color -> IO ())) => Op (SetCursorColor ()) Input orig impl where runOp _ _ input n = withRef input $ \inputPtr -> setCursorColor' inputPtr n {# fun Fl_Input_input_type as inputType' { id `Ptr ()' } -> `Int' #}-instance (impl ~ ( IO (Int))) => Op (GetInputType ()) Input orig impl where- runOp _ _ input = withRef input $ \inputPtr -> inputType' inputPtr+instance (impl ~ ( IO (FlInputType))) => Op (GetInputType ()) Input orig impl where+ runOp _ _ input = withRef input $ \inputPtr -> inputType' inputPtr >>= return . toEnum . fromIntegral {# fun Fl_Input_set_input_type as setInputType' { id `Ptr ()',`Int' } -> `()' #}-instance (impl ~ (Int -> IO ())) => Op (SetInputType ()) Input orig impl where- runOp _ _ input t = withRef input $ \inputPtr -> setInputType' inputPtr t+instance (impl ~ (FlInputType -> IO ())) => Op (SetInputType ()) Input orig impl where+ runOp _ _ input t = withRef input $ \inputPtr -> setInputType' inputPtr (fromIntegral (fromEnum t)) {# fun Fl_Input_readonly as readonly' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (Int))) => Op (GetReadonly ()) Input orig impl where runOp _ _ input = withRef input $ \inputPtr -> readonly' inputPtr@@ -234,17 +234,17 @@ instance (impl ~ (Int -> IO ())) => Op (SetReadonly ()) Input orig impl where runOp _ _ input b = withRef input $ \inputPtr -> setReadonly' inputPtr b {# fun Fl_Input_wrap as wrap' { id `Ptr ()' } -> `Int' #}-instance (impl ~ ( IO (Int))) => Op (GetWrap ()) Input orig impl where- runOp _ _ input = withRef input $ \inputPtr -> wrap' inputPtr-{# fun Fl_Input_set_wrap as setWrap' { id `Ptr ()',`Int' } -> `()' #}-instance (impl ~ (Int -> IO ())) => Op (SetWrap ()) Input orig impl where- runOp _ _ input b = withRef input $ \inputPtr -> setWrap' inputPtr b-{# fun Fl_Input_tab_nav as tabNav' { id `Ptr ()',`Int' } -> `()' #}-instance (impl ~ (Int -> IO ())) => Op (GetTabNav ()) Input orig impl where- runOp _ _ input val = withRef input $ \inputPtr -> tabNav' inputPtr val-{# fun Fl_Input_set_tab_nav as setTabNav' { id `Ptr ()' } -> `Int' #}-instance (impl ~ ( IO (Int))) => Op (SetTabNav ()) Input orig impl where- runOp _ _ input = withRef input $ \inputPtr -> setTabNav' inputPtr+instance (impl ~ ( IO (Bool))) => Op (GetWrap ()) Input orig impl where+ runOp _ _ input = withRef input $ \inputPtr -> wrap' inputPtr >>= return . cToBool+{# fun Fl_Input_set_wrap as setWrap' { id `Ptr ()', `Int' } -> `()' #}+instance (impl ~ (Bool -> IO ())) => Op (SetWrap ()) Input orig impl where+ runOp _ _ input b = withRef input $ \inputPtr -> setWrap' inputPtr (cFromBool b)+{# fun Fl_Input_set_tab_nav as setTabNav' { id `Ptr ()', `Int'} -> `()' #}+instance (impl ~ (Bool -> IO ())) => Op (SetTabNav ()) Input orig impl where+ runOp _ _ input val = withRef input $ \inputPtr -> setTabNav' inputPtr (cFromBool val)+{# fun Fl_Input_tab_nav as tabNav' { id `Ptr ()' } -> `Int' #}+instance (impl ~ ( IO (Bool))) => Op (GetTabNav ()) Input orig impl where+ runOp _ _ input = withRef input $ \inputPtr -> tabNav' inputPtr >>= return . cToBool {# fun Fl_Input_draw as draw'' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Draw ()) Input orig impl where runOp _ _ input = withRef input $ \inputPtr -> draw'' inputPtr@@ -298,7 +298,7 @@ -- -- getCursorColor :: 'Ref' 'Input' -> 'IO' ('Color') ----- getInputType :: 'Ref' 'Input' -> 'IO' ('Int')+-- getInputType :: 'Ref' 'Input' -> 'IO' ('FlInputType') -- -- getMark :: 'Ref' 'Input' -> 'IO' ('Int') --@@ -312,7 +312,7 @@ -- -- getSize :: 'Ref' 'Input' -> 'IO' ('Int') ----- getTabNav :: 'Ref' 'Input' -> 'Int' -> 'IO' ()+-- getTabNav :: 'Ref' 'Input' -> 'IO' ('Bool') -- -- getTextcolor :: 'Ref' 'Input' -> 'IO' ('Color') --@@ -322,7 +322,7 @@ -- -- getValue :: 'Ref' 'Input' -> 'IO' 'T.Text' ----- getWrap :: 'Ref' 'Input' -> 'IO' ('Int')+-- getWrap :: 'Ref' 'Input' -> 'IO' ('Bool') -- -- handle :: 'Ref' 'Input' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ()) --@@ -346,7 +346,7 @@ -- -- setCursorColor :: 'Ref' 'Input' -> 'Color' -> 'IO' () ----- setInputType :: 'Ref' 'Input' -> 'Int' -> 'IO' ()+-- setInputType :: 'Ref' 'Input' -> 'FlInputType' -> 'IO' () -- -- setMark :: 'Ref' 'Input' -> 'Int' -> 'IO' ('Either' 'NoChange' ()) --@@ -360,7 +360,7 @@ -- -- setSize :: 'Ref' 'Input' -> 'Size' -> 'IO' () ----- setTabNav :: 'Ref' 'Input' -> 'IO' ('Int')+-- setTabNav :: 'Ref' 'Input' -> 'Bool' -> 'IO' () -- -- setTextcolor :: 'Ref' 'Input' -> 'Color' -> 'IO' () --@@ -372,7 +372,7 @@ -- -- setValue :: 'Ref' 'Input' -> 'T.Text' -> 'Maybe' 'Int' -> 'IO' ('Int') ----- setWrap :: 'Ref' 'Input' -> 'Int' -> 'IO' ()+-- setWrap :: 'Ref' 'Input' -> 'Bool' -> 'IO' () -- -- showWidget :: 'Ref' 'Input' -> 'IO' () --
src/Graphics/UI/FLTK/LowLevel/OverlayWindow.chs view
@@ -54,8 +54,8 @@ instance (impl ~ ( IO ())) => Op (Hide ()) OverlayWindow orig impl where runOp _ _ window = withRef window $ \windowPtr -> hide' windowPtr {# fun Fl_Overlay_Window_can_do_overlay as canDoOverlay' { id `Ptr ()' } -> `Int' #}-instance (impl ~ ( IO (Int))) => Op (CanDoOverlay ()) OverlayWindow orig impl where- runOp _ _ win = withRef win $ \winPtr -> canDoOverlay' winPtr+instance (impl ~ ( IO (Bool))) => Op (CanDoOverlay ()) OverlayWindow orig impl where+ runOp _ _ win = withRef win $ \winPtr -> canDoOverlay' winPtr >>= return . cToBool {# fun Fl_Overlay_Window_redraw_overlay as redrawOverlay' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (RedrawOverlay ()) OverlayWindow orig impl where runOp _ _ win = withRef win $ \winPtr -> redrawOverlay' winPtr@@ -63,7 +63,7 @@ -- $functions -- @ ----- canDoOverlay :: 'Ref' 'OverlayWindow' -> 'IO' 'Int'+-- canDoOverlay :: 'Ref' 'OverlayWindow' -> 'IO' ('Bool') -- -- destroy :: 'Ref' 'OverlayWindow' -> 'IO' () --
src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs view
@@ -69,8 +69,8 @@ instance (impl ~ ( IO ())) => Op (Clear ()) SysMenuBar orig impl where runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> clear' menu_Ptr {# fun Fl_Sys_Menu_Bar_clear_submenu as clearSubmenu' { id `Ptr ()',`Int' } -> `Int' #}-instance (impl ~ (Int -> IO (Int))) => Op (ClearSubmenu ()) SysMenuBar orig impl where- runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> clearSubmenu' menu_Ptr index'+instance (impl ~ (Int -> IO (Either OutOfRangeOrNotSubmenu ()))) => Op (ClearSubmenu ()) SysMenuBar orig impl where+ runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> clearSubmenu' menu_Ptr index' >>= return . successOrOutOfRangeOrNotSubmenu {# fun Fl_Sys_Menu_Bar_shortcut as shortcut' { id `Ptr ()',`Int',id `CInt' } -> `()' #} instance (impl ~ (Int -> ShortcutKeySequence -> IO ())) => Op (SetShortcut ()) SysMenuBar orig impl where runOp _ _ menu_ index' (ShortcutKeySequence modifiers char) =@@ -149,7 +149,7 @@ -- -- clear :: 'Ref' 'SysMenuBar' -> 'IO' () ----- clearSubmenu :: 'Ref' 'SysMenuBar' -> 'Int' -> 'IO' ('Int')+-- clearSubmenu :: 'Ref' 'SysMenuBar' -> 'Int' -> 'IO' ('Either' 'OutOfRangeOrNotSubmenu' ()) -- -- destroy :: 'Ref' 'SysMenuBar' -> 'IO' () --@@ -160,8 +160,6 @@ -- getMode :: 'Ref' 'SysMenuBar' -> 'Int' -> 'IO' ('Maybe' 'MenuItemFlags') -- -- global :: 'Ref' 'SysMenuBar' -> 'IO' ()------ handle :: 'Ref' 'SysMenuBar' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ()) -- -- handle :: 'Ref' 'SysMenuBar' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ()) --
src/Graphics/UI/FLTK/LowLevel/Table.chs view
@@ -275,8 +275,8 @@ instance (impl ~ ( Int -> Int -> Int -> Int -> IO ())) => Op (SetSelection ()) Table orig impl where runOp _ _ table row_top col_left row_bot col_right = withRef table $ \tablePtr -> setSelection' tablePtr row_top col_left row_bot col_right {# fun Fl_Table_move_cursor as moveCursor' { id `Ptr ()',`Int',`Int' } -> `Int' #}-instance (impl ~ ( TableCoordinate -> IO (Int))) => Op (MoveCursor ()) Table orig impl where- runOp _ _ table (TableCoordinate (Row r) (Column c)) = withRef table $ \tablePtr -> moveCursor' tablePtr r c+instance (impl ~ ( TableCoordinate -> IO (Either NoChange ()))) => Op (MoveCursor ()) Table orig impl where+ runOp _ _ table (TableCoordinate (Row r) (Column c)) = withRef table $ \tablePtr -> moveCursor' tablePtr r c >>= return . successOrNoChange {# fun Fl_Table_init_sizes as initSizes' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (InitSizes ()) Table orig impl where runOp _ _ table = withRef table $ \tablePtr -> initSizes' tablePtr@@ -337,7 +337,7 @@ instance (impl ~ ( IO ())) => Op (Draw ()) Table orig impl where runOp _ _ table = withRef table $ \tablePtr -> draw' tablePtr {# fun Fl_Table_handle as handle' { id `Ptr ()', cFromEnum `Event' } -> `Int' #}-instance (impl ~ ( Event -> IO(Either UnknownEvent ()))) => Op (Handle ()) Table orig impl where+instance (impl ~ ( Event -> IO( Either UnknownEvent ()))) => Op (Handle ()) Table orig impl where runOp _ _ table event = withRef table $ \tablePtr -> handle' tablePtr event >>= return . successOrUnknownEvent {# fun Fl_Table_resize_super as resizeSuper' { id `Ptr ()',`Int',`Int',`Int',`Int' } -> `()' #} instance (impl ~ ( Rectangle -> IO ())) => Op (ResizeSuper ()) Table orig impl where@@ -447,7 +447,7 @@ -- -- getVisibleCells :: 'Ref' 'Table' -> 'IO' ('TableCoordinate,TableCoordinate') ----- handle :: 'Ref' 'Table' -> 'Event' -> 'IO' ('Int')+-- handle :: 'Ref' 'Table' -> 'Event' -> 'IO' ( 'Either' 'UnknownEvent' () ) -- -- hide :: 'Ref' 'Table' -> 'IO' () --@@ -463,7 +463,7 @@ -- -- isSelected :: 'Ref' 'Table' -> 'TableCoordinate' -> 'IO' 'Bool' ----- moveCursor :: 'Ref' 'Table' -> 'TableCoordinate' -> 'IO' ('Int')+-- moveCursor :: 'Ref' 'Table' -> 'TableCoordinate' -> 'IO' ('Either' 'NoChange' ()) -- -- resize :: 'Ref' 'Table' -> 'Rectangle' -> 'IO' () --
src/Graphics/UI/FLTK/LowLevel/Tree.chs view
@@ -212,12 +212,12 @@ {# fun Fl_Tree_select_with_item_docallback as selectWithItemDocallback' { id `Ptr ()',id `Ptr ()',cFromBool `Bool' } -> `Int' #} {# fun Fl_Tree_select_with_path as selectWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #} {# fun Fl_Tree_select_with_path_docallback as selectWithPathDocallback' { id `Ptr ()',unsafeToCString `T.Text',cFromBool `Bool' } -> `Int' #}-instance (impl ~ (TreeItemLocator -> IO (Int)) ) => Op (Select ()) Tree orig impl where+instance (impl ~ (TreeItemLocator -> IO (Either NoChange ())) ) => Op (Select ()) Tree orig impl where runOp _ _ tree locator' = withRef tree $ \treePtr -> case locator' of- TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> selectWithItem' treePtr r'Ptr- TreeItemNameLocator (TreeItemName n') -> selectWithPath' treePtr n'+ TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> selectWithItem' treePtr r'Ptr >>= return . successOrNoChange+ TreeItemNameLocator (TreeItemName n') -> selectWithPath' treePtr n' >>= return . successOrNoChange instance (impl ~ (TreeItemLocator -> Bool -> IO ())) => Op (SelectAndCallback ()) Tree orig impl where runOp _ _ tree_item locator' docallback' = withRef tree_item $ \tree_itemPtr ->@@ -234,12 +234,12 @@ {# fun Fl_Tree_deselect_with_item_docallback as deselectWithItemDocallback' { id `Ptr ()',id `Ptr ()',cFromBool `Bool' } -> `Int' #} {# fun Fl_Tree_deselect_with_path as deselectWithPath' { id `Ptr ()', unsafeToCString `T.Text'} -> `Int' #} {# fun Fl_Tree_deselect_with_path_docallback as deselectWithPathDocallback' { id `Ptr ()',unsafeToCString `T.Text',cFromBool `Bool' } -> `Int' #}-instance (impl ~ (TreeItemLocator -> IO (Int)) ) => Op (Deselect ()) Tree orig impl where+instance (impl ~ (TreeItemLocator -> IO (Either NoChange ())) ) => Op (Deselect ()) Tree orig impl where runOp _ _ tree locator' = withRef tree $ \treePtr -> case locator' of- TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> deselectWithItem' treePtr r'Ptr- TreeItemNameLocator (TreeItemName n') -> deselectWithPath' treePtr n'+ TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> deselectWithItem' treePtr r'Ptr >>= return . successOrNoChange+ TreeItemNameLocator (TreeItemName n') -> deselectWithPath' treePtr n' >>= return . successOrNoChange instance (impl ~ (TreeItemLocator -> Bool -> IO ())) => Op (DeselectAndCallback ()) Tree orig impl where runOp _ _ tree_item locator' docallback' = withRef tree_item $ \tree_itemPtr ->
src/Graphics/UI/FLTK/LowLevel/Widget.chs view
@@ -390,11 +390,13 @@ instance (impl ~ (IO (Bool))) => Op (GetVisibleFocus ()) Widget orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> visibleFocus' widgetPtr {# fun Fl_Widget_contains as contains' { id `Ptr ()',id `Ptr ()' } -> `Int' #}-instance (Parent a Widget, impl ~ (Ref a -> IO Int)) => Op (Contains ()) Widget orig impl where- runOp _ _ widget otherWidget = withRef widget $ \widgetPtr -> withRef otherWidget $ \otherWidgetPtr -> contains' widgetPtr otherWidgetPtr+instance (Parent a Widget, impl ~ (Ref a -> IO Bool)) => Op (Contains ()) Widget orig impl where+ runOp _ _ widget otherWidget = withRef widget $ \widgetPtr -> withRef otherWidget $ \otherWidgetPtr ->+ contains' widgetPtr otherWidgetPtr >>= return . cToBool {# fun Fl_Widget_inside as inside' { id `Ptr ()',id `Ptr ()' } -> `Int' #}-instance (Parent a Widget, impl ~ (Ref a -> IO (Int))) => Op (Inside ()) Widget orig impl where- runOp _ _ widget otherWidget = withRef widget $ \widgetPtr -> withRef otherWidget $ \otherWidgetPtr -> inside' widgetPtr otherWidgetPtr+instance (Parent a Widget, impl ~ (Ref a -> IO (Bool))) => Op (Inside ()) Widget orig impl where+ runOp _ _ widget otherWidget = withRef widget $ \widgetPtr -> withRef otherWidget $ \otherWidgetPtr ->+ inside' widgetPtr otherWidgetPtr >>= return . cToBool {# fun Fl_Widget_redraw as redraw' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ (IO ())) => Op (Redraw ()) Widget orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> redraw' widgetPtr@@ -503,7 +505,7 @@ -- -- clearVisibleFocus :: 'Ref' 'Widget' -> 'IO' () ----- contains:: ('Parent' a 'Widget') => 'Ref' 'Widget' -> 'Ref' a -> 'IO' 'Int'+-- contains:: ('Parent' a 'Widget') => 'Ref' 'Widget' -> 'Ref' a -> 'IO' 'Bool' -- -- copyLabel :: 'Ref' 'Widget' -> 'T.Text' -> 'IO' () --@@ -589,7 +591,7 @@ -- -- hideSuper :: 'Ref' 'Widget' -> 'IO' () ----- inside:: ('Parent' a 'Widget') => 'Ref' 'Widget' -> 'Ref' a -> 'IO' ('Int')+-- inside:: ('Parent' a 'Widget') => 'Ref' 'Widget' -> 'Ref' a -> 'IO' ('Bool') -- -- measureLabel :: 'Ref' 'Widget' -> 'IO' ('Size') --