packages feed

fltkhs 0.5.1.0 → 0.5.1.1

raw patch · 91 files changed

+205/−241 lines, 91 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Graphics.UI.FLTK.LowLevel.FL: abiVersion :: IO Int
- Graphics.UI.FLTK.LowLevel.FL: apiVersion :: IO Int
- Graphics.UI.FLTK.LowLevel.FL: boxColor :: Color -> IO Color
- Graphics.UI.FLTK.LowLevel.FL: localAlt :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: localCtrl :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: localMeta :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: localShift :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: setBoxColor :: Color -> IO ()
- Graphics.UI.FLTK.LowLevel.Hierarchy: data Fail a
- Graphics.UI.FLTK.LowLevel.Hierarchy: data SetOnly a
- Graphics.UI.FLTK.LowLevel.Hierarchy: fail :: (HasCallStack, Match r ~ FindOp a a (Fail ()), Op (Fail ()) r a impl) => Ref a -> impl
- Graphics.UI.FLTK.LowLevel.Hierarchy: setOnly :: (HasCallStack, Match r ~ FindOp a a (SetOnly ()), Op (SetOnly ()) r a impl) => Ref a -> impl
- Graphics.UI.FLTK.LowLevel.Image: ImageErrFileAccess :: ImageFail
- Graphics.UI.FLTK.LowLevel.Image: ImageErrFormat :: ImageFail
- Graphics.UI.FLTK.LowLevel.Image: ImageErrNoImage :: ImageFail
- Graphics.UI.FLTK.LowLevel.Image: data ImageFail
- Graphics.UI.FLTK.LowLevel.Image: instance GHC.Classes.Eq Graphics.UI.FLTK.LowLevel.Image.ImageFail
- Graphics.UI.FLTK.LowLevel.Image: instance GHC.Classes.Ord Graphics.UI.FLTK.LowLevel.Image.ImageFail
- Graphics.UI.FLTK.LowLevel.Image: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Image.ImageFail
- Graphics.UI.FLTK.LowLevel.Image: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Image.ImageFail
- Graphics.UI.FLTK.LowLevel.Image: instance impl ~ GHC.Types.IO (Data.Either.Either Graphics.UI.FLTK.LowLevel.Image.ImageFail ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Fail ()) Graphics.UI.FLTK.LowLevel.Hierarchy.Image orig impl
- Graphics.UI.FLTK.LowLevel.MenuPrim: instance (Graphics.UI.FLTK.LowLevel.Dispatch.Parent a Graphics.UI.FLTK.LowLevel.Hierarchy.MenuItem, impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref a -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetOnly ()) Graphics.UI.FLTK.LowLevel.Hierarchy.MenuPrim orig impl

Files

README.md view
@@ -3,9 +3,7 @@  Fltkhs aims to be a complete Haskell binding to the [FLTK GUI library] [1]. -NOTE: As of version 0.5.0.1 only FLTK 1.3.4-1 is supported. Old code written against FLTK 1.3.3 will still work, 1.3.4 does not remove any functionality.--NOTE: As of version 0.4.0.0, due to the introduction of closed type families, only GHC >= 7.8.1 is supported.+While the current recommended version of FLTK is 1.3.4, the previous version 1.3.3. is also supported since some Linux distributions haven't upgraded yet.  Quick Install -------------
c-src/Fl_C.cpp view
@@ -594,6 +594,7 @@     Fl_Widget* refPtr = &ref;     Fl::release_widget_pointer(refPtr);   }+#if FL_API_VERSION == 10304   FL_EXPORT_C(void,Fl_set_box_color)(Fl_Color c) {     Fl::set_box_color(c);   }@@ -618,6 +619,8 @@   FL_EXPORT_C(const char*,Fl_local_shift)(){     return fl_local_shift;   }+#endif+ #ifdef __cplusplus } #endif
c-src/Fl_C.h view
@@ -257,6 +257,7 @@   FL_EXPORT_C(void              ,Fl_release_widget_pointer)(fl_Widget w);   FL_EXPORT_C(void              ,Fl_clear_widget_pointer)(fl_Widget w);   FL_EXPORT_C(void              ,Fl_clear_widget_pointer)(fl_Widget w);+#if FL_API_VERSION == 10304   FL_EXPORT_C(void              ,Fl_set_box_color)(Fl_Color c);   FL_EXPORT_C(Fl_Color          ,Fl_box_color)(Fl_Color c);   FL_EXPORT_C(int               ,Fl_abi_version)();@@ -265,6 +266,7 @@   FL_EXPORT_C(const char*       ,Fl_local_meta)();   FL_EXPORT_C(const char*       ,Fl_local_alt)();   FL_EXPORT_C(const char*       ,Fl_local_shift)();+#endif #ifdef __cplusplus } #endif
c-src/Fl_DeviceC.cpp view
@@ -43,10 +43,12 @@   Fl_Font_Descriptor* _d = static_cast<Fl_Font_Descriptor*>(d);  return (static_cast<Fl_Graphics_Driver*>(graphics_driver))->font_descriptor(_d); }+#if FL_API_VERSION == 10304 FL_EXPORT_C(int, fl_Graphics_Driver_draw_scaled)(fl_Graphics_Driver graphics_driver, fl_Image i,  int X, int Y, int W, int H) {   return (static_cast<Fl_Graphics_Driver*>(graphics_driver))->draw_scaled(static_cast<Fl_Image*>(i),X,Y,W,H); }+#endif FL_EXPORT_C(void,Fl_Graphics_Driver_Destroy)(fl_Graphics_Driver graphics_driver){  delete (static_cast<Fl_Graphics_Driver*>(graphics_driver)); }
c-src/Fl_DeviceC.h view
@@ -25,7 +25,9 @@   FL_EXPORT_C(Fl_Color, Fl_Graphics_Driver_color)(fl_Graphics_Driver graphics_driver);   FL_EXPORT_C(fl_Font_Descriptor, Fl_Graphics_Driver_font_descriptor)(fl_Graphics_Driver graphics_driver);   FL_EXPORT_C(void, Fl_Graphics_Driver_set_font_descriptor)(fl_Graphics_Driver graphics_driver,fl_Font_Descriptor d);+#if FL_API_VERSION == 10304   FL_EXPORT_C(int, fl_Graphics_Driver_draw_scaled)(fl_Graphics_Driver graphics_driver, fl_Image i,int X, int Y, int W, int H);+#endif   FL_EXPORT_C(void, Fl_Graphics_Driver_Destroy)(fl_Graphics_Driver graphics_driver);    // Fl_Surface_Device
c-src/Fl_ImageC.cpp view
@@ -147,9 +147,11 @@   FL_EXPORT_C(void,Fl_Image_uncache)(fl_Image image){     return (static_cast<Fl_DerivedImage*>(image))->uncache();   }+#if FL_API_VERSION == 10304   FL_EXPORT_C(int, Fl_Image_fail)(fl_Image image){     return (static_cast<Fl_DerivedImage*>(image))->fail();   }+#endif  #ifdef __cplusplus }
c-src/Fl_ImageC.h view
@@ -61,7 +61,9 @@   FL_EXPORT_C(void,Fl_Image_draw_with)(fl_Image image,int X,int Y,int W,int H);   FL_EXPORT_C(void, Fl_Image_draw)(fl_Image image,int X, int Y);   FL_EXPORT_C(void, Fl_Image_uncache)(fl_Image image);+#if FL_API_VERSION == 10304   FL_EXPORT_C(int, Fl_Image_fail)(fl_Image image);+#endif #ifdef __cplusplus } #endif
c-src/Fl_Menu_C.cpp view
@@ -615,9 +615,11 @@   FL_EXPORT_C(void,Fl_Menu__set_down_color)(fl_Menu_ menu_,unsigned c){     (static_cast<Fl_DerivedMenu_*>(menu_))->down_color(c);   }+#if FL_API_VERSION == 10304   FL_EXPORT_C(void, Fl_Menu__set_only)(fl_Menu_ menu_, fl_Menu_Item m){     (static_cast<Fl_DerivedMenu_*>(menu_))->setonly(static_cast<Fl_Menu_Item*>(m));   }+#endif #ifdef __cplusplus } #endif
c-src/Fl_Menu_C.h view
@@ -207,7 +207,9 @@   FL_EXPORT_C(void, Fl_Menu__set_down_box)(fl_Menu_ menu_, Fl_Boxtype b);   FL_EXPORT_C(Fl_Color, Fl_Menu__down_color)(fl_Menu_ menu_);   FL_EXPORT_C(void, Fl_Menu__set_down_color)(fl_Menu_ menu_, unsigned c);+#if FL_API_VERSION == 10304   FL_EXPORT_C(void, Fl_Menu__set_only)(fl_Menu_ menu_, fl_Menu_Item m);+#endif #ifdef __cplusplus } #endif
fltkhs.cabal view
@@ -1,5 +1,5 @@ name : fltkhs-version : 0.5.1.0+version : 0.5.1.1 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.@@ -9,9 +9,9 @@ author : Aditya Siram maintainer: aditya.siram@gmail.com homepage: http://github.com/deech/fltkhs--- bug-reports:--- copyright:-category: UI,Graphics+bug-reports: https://github.com/deech/fltkhs/issues+copyright: © 2017 Aditya Siram All Rights Reserved+category: UI,Graphics,GUI,User Interfaces build-type: Custom cabal-version: >=1.24 source-repository head
scripts/doc-parser.hs view
@@ -16,15 +16,25 @@ spacesOrNewLines =   skipMany $ (char ' ') <|> (char '\n') <|> crlf -parseInstances = go (return [])+parseInstances = go False (return ([],[]))   where-    go accum = ((try (eof >> accum)) <|>-                (try (do-                    newline >> string "instance"-                    soFar <- accum-                    opInstance <- parseInstance-                    go (return (soFar ++ [opInstance])))) <|>-                (anyChar >> go accum))+    go inIfdef accum = ((try (eof >> accum)) <|>+                        (try (do+                            newline >> string "#if FL_API_VERSION == 10304" >> endOfLine+                            go True accum)) <|>+                        (try (do+                            newline >> string "#endif" >> endOfLine+                            go False accum)) <|>+                        (try (do+                            newline >> string "instance"+                            (soFar, newVersionOnly)<- accum+                            opInstance <- parseInstance+                            go inIfdef+                               (return+                                 (if inIfdef+                                  then (soFar, newVersionOnly ++ [opInstance])+                                  else (soFar ++ [opInstance], newVersionOnly))))) <|>+                        (anyChar >> go inIfdef accum)) parseInstance = do   spaces   char '('@@ -140,7 +150,7 @@   let parseWidgetFile contents =         case (parse parseInstances "" contents) of           Left err        -> error (show err)-          Right instances -> Just instances+          Right (functions, newVersionOnly) -> (Just functions, Just newVersionOnly)   let hier' = map                 (\o -> case (parse runHierarchyParser "" o) of                    Left err -> Nothing@@ -158,8 +168,10 @@       putStr "\n"     (Just (Functions w)) -> do       contents <- readWidgetFile w-      let parsed = parseWidgetFile contents-      let instances = maybe [] (sort . map (\(c, sig, mName, wType) -> pprint ((c, sig), mName, wType)))-                        parsed-      putStr $ intercalate "\n--\n" (map ((++) "-- ") instances)+      let (functions, inNewVersionOnly) = parseWidgetFile contents+      let rendered = maybe [] (sort . map (\(c, sig, mName, wType) -> pprint ((c, sig), mName, wType)))+      putStr $ intercalate "\n--\n" (map ((++) "-- ") (rendered functions))+      putStr "\n"+      putStr $ "\n-- Available in FLTK 1.3.4 only: \n"+      putStr $ intercalate "\n--\n" (map ((++) "-- ") (rendered inNewVersionOnly))       putStr "\n"
src/Fluid/Generate.hs view
@@ -44,9 +44,9 @@     lookup flWidgetType buttonType   | flClassName == "Fl_Browser" =     lookup flWidgetType browserType-  | flClassName == "Fl_MenuItem" =+  | flClassName == "MenuItem" =     lookup flWidgetType menuItemType-  | flClassName == "Fl_MenuButton" =+  | flClassName == "Fl_Menu_Button" =     lookup flWidgetType menuButtonType   | flClassName == "Fl_Dial" =     lookup flWidgetType dialType@@ -148,7 +148,7 @@     Types.Tooltip t ->       apply "setTooltip" name (Just $ show $ collapseString t)     Types.When w ->-      apply "setWhen" name (Just $ "[" ++ (snd (whenType !! w)) ++ "]")+      apply "setWhen" name (Just $ "[" ++ (whenType !! w) ++ "]")     Types.Hotspot ->       (apply "getWindow" name Nothing) ++       " >>= " ++@@ -240,12 +240,18 @@   in   (maybe menuItemName (\(Label l) -> (collapseString l)) label , attrsWithoutLabel) -menuItemCode :: String -> String -> String -> [String] -> [Attribute] -> ([String], [Attribute])-menuItemCode mn menuItemName label menuPath restAttrs =-  let callbackCode callback = [+menuItemCode :: String -> String -> String -> [String] -> [String] -> [Attribute] -> ([String], [Attribute])+menuItemCode mn menuItemName label flags menuPath restAttrs =+  let labelCode l = [+                      "let { label = \"" ++ (concat (intersperse "/" ((reverse menuPath) ++ [l]))) ++ "\"}"+                    ]+      callbackCode callback = [                                 "let { callback :: Maybe (Ref MenuItem -> IO ()); callback = " ++ callback ++ "}"                               ]-      (((), attrs), haskellCode)+      shortcutCode sc = [+                          "let { shortcut :: Maybe Shortcut ; shortcut = " ++ sc ++ "}"+                        ]+      (((), (attrs, _)), haskellCode)         = (runIdentity             (runWriterT               (runStateT@@ -253,32 +259,45 @@                     let attrCode :: (Attribute -> Bool) ->                                     (Attribute -> [String]) ->                                     [String] ->-                                    StateT [Attribute] (WriterT [String] Identity) ()-                        attrCode findAttr toCode fallback = do-                          currentAttrs <- get+                                    Bool ->+                                    StateT ([Attribute], [String]) (WriterT [String] Identity) ()+                        attrCode findAttr toCode fallback isFlag = do+                          (currentAttrs, flags) <- get                           let (attr, restAttrs') = findDrop currentAttrs findAttr-                          modify (\_ -> restAttrs')-                          tell (maybe fallback toCode attr)+                          modify (\_ -> (restAttrs', flags))+                          if isFlag then modify (\(attrs, flags) -> (attrs, flags ++ (maybe [] toCode attr)))+                            else tell (maybe fallback toCode attr)+                    tell (labelCode label)+                    attrCode (\a -> case a of Divider -> True; _ -> False)+                             (\_ -> ["MenuItemDivider"])+                             []+                             True+                    attrCode (\a -> case a of Types.WidgetType _ -> True; _ -> False)+                             (\(WidgetType w) -> maybe [] (\t -> [t]) (typeToHs "MenuItem" (collapseString w)))+                             []+                             True                     attrCode (\a -> case a of Callback _ -> True; _ -> False)                              (\(Callback c) -> callbackCode (collapseString c))                              (callbackCode "(Nothing :: Maybe (Ref MenuItem -> IO ())) ")-                    tell ["let { label = \"" ++ (concat (intersperse "/" ((reverse menuPath) ++ [label]))) ++ "\"}" ]+                             False+                    attrCode (\a -> case a of Shortcut _ -> True; _ -> False)+                             (\(Shortcut s) ->+                                 maybe+                                 (shortcutCode  "Nothing")+                                 (\ks -> shortcutCode (show ks))+                                 (cIntToKeySequence ((read s) :: CInt)))+                             (shortcutCode "Nothing")+                             False+                    (_,newFlags) <- get                     tell ["(MenuItemIndex idx) <- add " ++                           mn ++ " label " ++-                          "(Nothing :: Maybe Shortcut) " +++                          "shortcut " ++                           "callback " ++-                          "(MenuItemFlags [])",+                          "(MenuItemFlags [" ++ (concat (intersperse "," (flags ++ newFlags))) ++ "])",                           mn ++ "_menuItems <- getMenu " ++ mn,                           "let {" ++ menuItemName ++ " = fromJust (" ++ mn ++ "_menuItems !! idx)}"                          ]-                    attrCode (\a -> case a of Shortcut _ -> True; _ -> False)-                             (\(Shortcut s) ->-                                 maybe-                                 []-                                 (\ks -> ["setShortcut " ++ mn ++ " idx (" ++ (show ks) ++ ")"])-                                 (cIntToKeySequence ((read s) :: CInt)))-                             []-                ) restAttrs)))+                ) (restAttrs, []))))   in     (haskellCode, attrs) determineClassName :: String -> [Attribute] -> (Maybe (String, String, String), [Attribute])@@ -352,6 +371,8 @@                                                                 })                                                                (case flClassName of {                                                                     "Fl_Choice" -> [];+                                                                    "Fl_Menu_Bar" -> [];+                                                                    "Fl_Menu_Button" -> [];                                                                     _ -> ([newLabel] ++ menuPath)                                                                })                                                                tree)@@ -364,14 +385,10 @@                            "Submenu" ->                               case menuName of                                 Just mn ->-                                  let (haskellCode, newAttrs) = menuItemCode mn newName newLabel menuPath attrsWithoutLabel+                                  let flags = ["Submenu"]+                                      (haskellCode, newAttrs) = menuItemCode mn newName newLabel flags menuPath attrsWithoutLabel                                   in                                   haskellCode ++-                                  [-                                    "flags " ++ " <- getFlags " ++ newName,-                                    "let {newFlags = maybe (MenuItemFlags [Submenu]) (\\(MenuItemFlags fs)-> (MenuItemFlags (fs ++ [Submenu]))) flags}",-                                    "setMode " ++ mn ++ " idx newFlags"-                                  ] ++                                   (map (attributeG newFlClassName newName) newAttrs) ++                                   innerTreeOutput                                 _ ->@@ -383,11 +400,11 @@                              (constructorG newFlClassName hsConstructor (Just newName) posSize) ++                              (map (attributeG newFlClassName newName) attrsWithoutLabel) ++                              innerTreeOutput-                           "Fl_Choice" ->+                           m | m == "Fl_Choice" || m == "Fl_Menu_Button"->                              (constructorG newFlClassName hsConstructor (Just newName) posSize) ++                              (map (attributeG newFlClassName newName) restAttrs) ++-                             ["setMenu " ++ newName ++ " ([] :: [Ref MenuItem])"] ++-                             innerTreeOutput+                             innerTreeOutput +++                             ["setValue " ++ newName ++ " (MenuItemByIndex (MenuItemIndex " ++ (show 0) ++ "))"]                            _ ->                              (constructorG newFlClassName hsConstructor (Just newName) posSize) ++                              (map (attributeG newFlClassName newName) attrsWithoutLabel) ++@@ -413,7 +430,7 @@                                   case menuName of                                      Just mn ->                                        let (label, attrsWithoutLabel) = menuLabel newName restAttrs-                                           (haskellCode, newAttrs) = menuItemCode mn newName label menuPath attrsWithoutLabel+                                           (haskellCode, newAttrs) = menuItemCode mn newName label [] menuPath attrsWithoutLabel                                        in haskellCode ++ (map (attributeG newFlClassName newName) newAttrs)                                      _ -> []                                _ -> (constructorG newFlClassName hsConstructor (Just newName) posSize) ++
src/Fluid/Lookup.hs view
@@ -29,7 +29,7 @@ labelType :: [(String, String)] alignmentType :: [(String, String)] sliderType :: [(String, String)]-whenType :: [(String, String)]+whenType :: [String] inputType :: [(String, String)] outputType :: [(String, String)] packType :: [(String, String)]@@ -143,11 +143,16 @@   ("Vert Knob"  ,"VertNiceSliderType"),   ("Horz Knob"  ,"HorNiceSliderType")  ]+ whenType = [-  ("Never"     ,"WhenNever"),-  ("Release"   ,"WhenRelease"),-  ("Changed"   ,"WhenChanged"),-  ("Enter key" ,"WhenEnterKey")+  "WhenNever"+  ,"WhenChanged"+  ,"WhenNotChanged"+  ,"WhenRelease"+  ,"WhenReleaseAlways"+  ,"WhenEnterKey"+  ,"WhenEnterKeyAlways"+  ,"WhenEnterKeyChanged"  ] inputType = [   ("Normal", "FlNormalInput"),@@ -284,7 +289,7 @@   ,("Fl_Table",("Table", "tableNew"))   ,("Fl_Scroll",("Scroll", "scrollNew"))   ,("Fl_Menu_Bar",("MenuBar", "sysMenuBarNew"))-  ,("Menu_Button",("MenuButton", "menuButtonNew"))+  ,("Fl_Menu_Button",("MenuButton", "menuButtonNew"))   ,("Fl_Choice",("Choice", "choiceNew"))   ,("Fl_Browser",("Browser", "browserNew" ))   ,("Fl_Tabs",("Tabs", "tabsNew"))@@ -293,6 +298,7 @@   ,("Fl_Text_Display", ("TextDisplay", "textDisplayNew"))   ,("Fl_Text_Editor", ("TextEditor", "textEditorNew"))   ,("Fl_Tile", ("Tile", "tileNew"))+  ,("Fl_File_Browser", ("FileBrowser", "fileBrowserNew"))   ]  imageExtensions =
src/Fluid/Migrate.hs view
@@ -3,7 +3,7 @@ import Graphics.UI.FLTK.LowLevel.Utils import Fluid.Types import Fluid.Lookup-import Foreign.C.Types+ import Data.List import Data.Ord 
src/Graphics/UI/FLTK/LowLevel/Adjuster.chs view
@@ -17,7 +17,6 @@ #include "Fl_Types.h" #include "Fl_AdjusterC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Ask.chs view
@@ -13,7 +13,7 @@ #include "Fl_Types.h" #include "Fl_AskC.h" import C2HS hiding (cFromEnum, cToBool,cToEnum)-import Foreign.C.Types+ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Utils 
src/Graphics/UI/FLTK/LowLevel/Bitmap.chs view
@@ -16,7 +16,6 @@ #include "Fl_Types.h" #include "Fl_BitmapC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Box.chs view
@@ -20,7 +20,7 @@ #include "Fl_Types.h" #include "Fl_BoxC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Browser.chs view
@@ -19,7 +19,7 @@ #include "Fl_BrowserC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Button.chs view
@@ -21,7 +21,7 @@ #include "Fl_ExportMacros.h" #include "Fl_Types.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Widget import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types
src/Graphics/UI/FLTK/LowLevel/CheckButton.chs view
@@ -16,7 +16,6 @@ #include "Fl_Check_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Choice.chs view
@@ -18,7 +18,6 @@ #include "Fl_ChoiceC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.MenuItem import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types
src/Graphics/UI/FLTK/LowLevel/Clock.chs view
@@ -24,7 +24,6 @@ #include "Fl_Types.h" #include "Fl_ClockC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ColorChooser.chs view
@@ -20,7 +20,7 @@ #include "Fl_Types.h" #include "Fl_Color_ChooserC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/CopySurface.chs view
@@ -16,7 +16,6 @@ #include "Fl_Types.h" #include "Fl_Copy_SurfaceC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Counter.chs view
@@ -20,7 +20,6 @@ #include "Fl_CounterC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Dial.chs view
@@ -19,7 +19,6 @@ #include "Fl_DialC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/DoubleWindow.chs view
@@ -25,8 +25,6 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Widget import Graphics.UI.FLTK.LowLevel.Window-import C2HS hiding (cFromEnum, toBool,cToEnum)-  {# fun Fl_OverriddenDouble_Window_New as overriddenWindowNew' {`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenDouble_Window_NewXY as overriddenWindowNewXY' {`Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}
src/Graphics/UI/FLTK/LowLevel/Draw.chs view
@@ -120,7 +120,6 @@ #include "Fl_C.h" #include "Fl_DrawC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/FL.chs view
@@ -157,6 +157,7 @@      setEventDispatch,      eventText,      eventLength,+#if FL_API_VERSION == 10304      setBoxColor,      boxColor,      abiVersion,@@ -165,12 +166,13 @@      localMeta,      localAlt,      localShift+#endif     ) where #include "Fl_C.h" import C2HS hiding (cFromEnum, cToBool,cToEnum) import Data.IORef-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils@@ -834,6 +836,7 @@ releaseWidgetPointer wp = withRef wp {#call Fl_release_widget_pointer as fl_release_widget_pointer #} clearWidgetPointer :: (Parent a Widget) => Ref a -> IO () clearWidgetPointer wp = withRef wp {#call Fl_clear_widget_pointer as fl_Clear_Widget_Pointer #}+#if FL_API_VERSION == 10304 setBoxColor :: Color -> IO () setBoxColor c = {#call Fl_set_box_color as fl_set_box_color #} (cFromColor c) boxColor :: Color -> IO Color@@ -850,3 +853,4 @@ localMeta = {#call Fl_local_meta as fl_local_meta #} >>= cStringToText localShift :: IO T.Text localShift = {#call Fl_local_shift as fl_local_shift #} >>= cStringToText+#endif
src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs view
@@ -320,90 +320,21 @@ -- library is considered usable. And most of these issues are being aggressively -- addressed but in the interests of full disclosure ... ----- == Look & Feel (All users)--- The look and feel of FLTK apps can be charitably described as /retro/. And since--- FLTK has no support for theming it is also baked in. FLTK was designed for the+-- == Look & Feel+-- The default look FLTK apps can be charitably described as /retro/. And+-- FLTK has no support for theming since it was designed for the -- embedded domain and trades off slickness for speed, portability and--- binary size. This is unlikely to change.------ == Compile Times (All users)--- Currently a dense app (~ 160-180 widgets crammed into the same window) takes--- 9-12 seconds to compile on a 32GB quad-core machine. Surprisingly it only goes up--- to 10-15 seconds on a 8GB machine indicating that GHC pegs one processor and RAM--- does not matter. Educated guess, most of the time is being spent traversing type-level lists--- and chasing down orphan instances. The hope is that this will all go away once GHC 8 has settled--- in and all the type-level gymnastics can been replaced with OverloadedRecordFields.------ == GHCi (Linux, *BSD & OSX Yosemite)--- The GHC 7.10.x series has an unfortunate--- <https://ghc.haskell.org/trac/ghc/ticket/10568 regression> that causes GHCi to--- crash when loading the shared library that contains the C bindings to the C++--- API. The REPL loads fine in GHC 7.8.x. This means that each FLTKHS app needs a--- special GHC environment just for running the REPL. This is achieved by bundling--- another Stack file (arbitrarily called 'stack-repl.yaml') with sample apps--- and skeletons specially for loading an app into GHCi but also means that users--- have to do the following to load a GUI app into the REPL:------ @--- > STACK_YAML=stack-repl.yaml stack ghci ...--- @------ Furthermore once an app is launched via the REPL closing the main app window--- brings the REPL back to a prompt as it should but does not go away. The window--- stays around ghosted for the life of the session. The user has to `:quit` GHCi in--- order to get rid of it. So while the REPL is still useful for querying functions etc.--- and trying things out it leaves a lot of trash behind. Hopefully the fix is simply a--- case of the author knowing how GHCi and the FFI interact.------ == GHCi + Stack (OSX El Capitan)--- Running FLTKHS in GHCi via Stack on El Capitan is broken. The reason is that--- the @Setup.hs@ that comes with FLTKHS requires Cabal-1.2.x. So before running the repl we need to do:------ @--- > STACK_YAML=stack-repl.yaml stack setup --upgrade-cabal--- @------ This breaks on El Capitan with an error:------ @--- > Setup: \/usr\/bin\/ar: permission denied--- @------ This is a known <https://github.com/haskell/cabal/issues/2653 bug> and unfortunately the--- <https://ghc.haskell.org/trac/ghc/blog/weekly20150721#MacOSXElCapitansupport workaround> is--- pretty horrific. Barring that there is no hope for FLTKHS and GHCi on El Capitan.------ To see why it's necessary to use `stack-repl.yaml` please see the previous section--- "GHCi (Linux, *BSD & OSD Yosemite)".------ == GHC 7.10.3 And Beyond (Windows only)--- _UPDATE_: This issue has been resolved by updates to 'language-c' and 'c2hs'. This--- section will be removed in a subsequent release.------ FLTKHS does not work with GHC 7.10.3 on Windows. Period. GHC 7.10.2 and 7.8.4 on--- Windows work fine. The problem is the MinGW environment that comes bundled with--- GHC 7.10.3 has brought to a light and unfortunate--- <https://github.com/haskell/c2hs/issues/157 bug> in the `language-c` package--- that C2HS depends on. Until this is fixed FLTKHS will not build.------ The workaround is bundling yet another special Stack file (arbitrarily called--- "stack-windows.yaml") that allows Windows users to run FLTKHS with GHC 7.10.2.--- Most importantly this pins all Windows users to 7.10.2 until the issue is--- resolved and as an added inconvenience all Stack commands in Windows have to be--- prefixed with the cheesy:+-- binary size. ----- @--- > STACK_YAML= stack-windows.yaml stack ...--- @+-- But that doesn't mean the user is limited to the default! FLTK is quite flexible+-- and it is pretty easy to change the way a widget looks and behaves but there is no+-- "theme file" that applies uniformly to all widgets in the app. ----- == GHCi (Windows only)--- GHCi does not work with FLTKHS on Windows at all. At least on Windows 7, attempting--- load an app into the REPL generates a weird error message about not being able to--- find `uuid.dll`.+-- == Compile Times+-- Currently a dense app (~ 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>. ----- Hopefully this is just an issue of the author not understand GHCi on Windows and--- will be resolved quickly.- -- $StackTrace -- -- In a traditional callback-heavy API such as FLTKHS null pointers happen which@@ -1018,24 +949,7 @@ -- @ -- > stack build --flag fltkhs-hello-world:fastCompile -- @---- $CabalREPLIssues ----- The recommended way to load FLTKHS app into GHCi is the use the--- `stack-repl.yaml` that comes bundled with the--- <http://github.com/deech/fltkhs-hello-world FLTKHS project skeleton>. The--- reasons are outlined in the "GHCi (All Users)" subsection of "Obstacles" above.------ The REPL in the skeleton, for example, be run with:------ @--- > STACK_YAML=stack-repl.yaml stack setup --upgrade-cabal--- > STACK_YAML=stack-repl.yaml stack ghci fltkhs-hello-world:exe:fltkhs-hello-world--- @------ The '--upgrade-cabal' flag above tells GHC to use the version in--- 'stack-repl.yaml' (7.8.4) but upgrade the Cabal to 1.2.2.- -- =File Layout -- @ -- Root
src/Graphics/UI/FLTK/LowLevel/FileBrowser.chs view
@@ -26,7 +26,7 @@ #include "Fl_WidgetC.h" #include "FL/filename.H" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/FileInput.chs view
@@ -16,7 +16,6 @@ #include "Fl_Types.h" #include "Fl_File_InputC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/FillDial.chs view
@@ -11,7 +11,6 @@ #include "Fl_Types.h" #include "Fl_DialC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/FillSlider.chs view
@@ -13,7 +13,6 @@ #include "Fl_Types.h" #include "Fl_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Gl.chs view
@@ -24,7 +24,6 @@ #include "Fl_C.h" #include "glC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/GlWindow.chs view
@@ -18,7 +18,6 @@ #include "Fl_Double_WindowC.h" #include "Fl_Gl_WindowC.h" import Foreign-import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum) import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Group.chs view
@@ -20,7 +20,6 @@ #include "Fl_WidgetC.h" #include "Fl_GroupC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Fl_Types
src/Graphics/UI/FLTK/LowLevel/Hierarchy.hs view
@@ -534,8 +534,10 @@          setTextcolor,          DownBox,          downBox,+#if FL_API_VERSION == 10304          SetOnly,          setOnly,+#endif          -- * MenuBar          MenuBar,          -- * SysMenuBar@@ -562,8 +564,10 @@          drawResize,          Uncache,          uncache,+#if FL_API_VERSION == 10304          Fail,          fail,+#endif          -- * Bitmap          Bitmap,          -- * Pixmap@@ -2278,8 +2282,13 @@   (SetDownBox   (GetDownColor   (SetDownColor+#if FL_API_VERSION == 10304   (SetOnly-  ()))))))))))))))))))))))))))))))))))))))))))))))+#endif+  ())))))))))))))))))))))))))))))))))))))))))))))+#if FL_API_VERSION == 10304+  )+#endif  type instance Functions MenuPrim = MenuPrimFuncs @@ -2308,7 +2317,9 @@ MAKE_METHOD(GetTextcolor,getTextcolor) MAKE_METHOD(SetTextcolor,setTextcolor) MAKE_METHOD(DownBox,downBox)+#if FL_API_VERSION == 10304 MAKE_METHOD(SetOnly,setOnly)+#endif  data CMenuBar parent type MenuBar = CMenuBar MenuPrim@@ -2379,8 +2390,13 @@   (DrawResize   (Draw   (Uncache+#if FL_API_VERSION == 10304   (Fail-  ()))))))))))))))+#endif+  ())))))))))))))+#if FL_API_VERSION == 10304+  )+#endif  type instance Functions Image = ImageFuncs @@ -2392,7 +2408,9 @@ MAKE_METHOD(Desaturate,desaturate) MAKE_METHOD(DrawResize,drawResize) MAKE_METHOD(Uncache,uncache)+#if FL_API_VERSION == 10304 MAKE_METHOD(Fail,fail)+#endif  data CBitmap parent type Bitmap = CBitmap Image@@ -3992,7 +4010,8 @@   (GetTextsize   (GetFiletype   (SetFiletype-  ()))))))))+  (Load+  ()))))))))) type instance Functions FileBrowser = FileBrowserFuncs  MAKE_METHOD(SetIconsize, setIconsize)
src/Graphics/UI/FLTK/LowLevel/HorFillSlider.chs view
@@ -13,7 +13,6 @@ #include "Fl_Types.h" #include "Fl_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/HorNiceSlider.chs view
@@ -13,7 +13,6 @@ #include "Fl_Types.h" #include "Fl_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/HorSlider.chs view
@@ -13,7 +13,6 @@ #include "Fl_Types.h" #include "Fl_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/HorValueSlider.chs view
@@ -13,7 +13,6 @@ #include "Fl_Types.h" #include "Fl_Value_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Image.chs view
@@ -2,7 +2,9 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.UI.FLTK.LowLevel.Image        (+#if FL_API_VERSION == 10304        ImageFail(..),+#endif        ImageFuncs(..),        defaultImageFuncs,        imageNew,@@ -25,13 +27,13 @@ #include "Fl_Types.h" #include "Fl_ImageC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types 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 +#if FL_API_VERSION == 10304 #c enum ImageFail {   ImageErrNoImage = ERR_NO_IMAGE,@@ -40,6 +42,7 @@ }; #endc {#enum ImageFail {} deriving (Show, Eq, Ord) #}+#endif  type ColorAverageCallback        = Ref Image -> Color -> Float -> IO () type ImageDrawCallback           = Ref Image -> Position -> Size -> Maybe X -> Maybe Y -> IO ()@@ -181,6 +184,7 @@ instance (impl ~ ( IO ())) => Op (Uncache ()) Image orig impl where   runOp _ _ image = withRef image $ \imagePtr -> uncache' imagePtr +#if FL_API_VERSION == 10304 {#fun Fl_Image_fail as fail' { id `Ptr ()'} -> `CInt' #} instance (impl ~ (IO (Either ImageFail ()))) => Op (Fail ()) Image orig impl where   runOp _ _ image = withRef image $ \imagePtr -> do@@ -188,6 +192,7 @@     if (res == 0)       then return (Right ())       else return (Left (cToEnum res))+#endif  -- $functions -- @@@ -203,8 +208,6 @@ -- -- drawResize :: 'Ref' 'Image' -> 'Position' -> 'Size' -> 'Maybe' 'X' -> 'Maybe' 'Y' -> 'IO' () ----- fail :: 'Ref' 'Image' -> 'IO' ('Either' 'ImageFail' ())--- -- getCount :: 'Ref' 'Image' -> 'IO' ('Int') -- -- getD :: 'Ref' 'Image' -> 'IO' ('Int')@@ -218,6 +221,9 @@ -- inactive :: 'Ref' 'Image' -> 'IO' () -- -- uncache :: 'Ref' 'Image' -> 'IO' ()+--+-- Available in FLTK 1.3.4 only:+-- fail :: 'Ref' 'Image' -> 'IO' ('Either' 'ImageFail' ()) -- @  -- $hierarchy
src/Graphics/UI/FLTK/LowLevel/ImageSurface.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_Image_SurfaceC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Input.chs view
@@ -26,7 +26,6 @@ #include "Fl_Multiline_OutputC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/IntInput.chs view
@@ -12,7 +12,6 @@ #include "Fl_Types.h" #include "Fl_Int_InputC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/LightButton.chs view
@@ -17,7 +17,6 @@ #include "Fl_Light_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/LineDial.chs view
@@ -11,7 +11,6 @@ #include "Fl_Types.h" #include "Fl_DialC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/MenuBar.chs view
@@ -16,14 +16,13 @@ #include "Fl_Types.h" #include "Fl_Menu_BarC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ 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.Dispatch import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Hierarchy-import Graphics.UI.FLTK.LowLevel.MenuItem  {# fun Fl_Menu_Bar_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #} {# fun Fl_Menu_Bar_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}
src/Graphics/UI/FLTK/LowLevel/MenuButton.chs view
@@ -19,7 +19,6 @@ #include "Fl_Menu_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs view
@@ -19,7 +19,7 @@ #include "Fl_Menu_C.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Widget import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types@@ -297,10 +297,12 @@ {# fun Fl_Menu__set_down_color as setDownColor' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (Int ->  IO ())) => Op (SetDownColor ()) MenuPrim orig impl where   runOp _ _ menu_ c = withRef menu_ $ \menu_Ptr -> setDownColor' menu_Ptr c+#if FL_API_VERSION == 10304 {# fun Fl_Menu__set_only as setonly' { id `Ptr ()', id `Ptr ()' } -> `()' #} instance (Parent a MenuItem, impl ~ (Ref a -> IO ())) => Op (SetOnly ()) MenuPrim orig impl where   runOp _ _ menu_ item = withRef menu_ $ \menu_Ptr ->                             withRef item $ \item_Ptr -> setonly' menu_Ptr item_Ptr+#endif  -- $functions -- @@@ -377,8 +379,6 @@ -- -- setMode :: 'Ref' 'MenuPrim' -> 'Int' -> 'MenuItemFlags' -> 'IO' () ----- setOnly:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'Ref' a -> 'IO' ()--- -- setShortcut :: 'Ref' 'MenuPrim' -> 'Int' -> 'ShortcutKeySequence' -> 'IO' () -- -- setSize :: 'Ref' 'MenuPrim' -> 'Int' -> 'Int' -> 'IO' ()@@ -396,6 +396,9 @@ -- showWidgetSuper :: 'Ref' 'MenuPrim' -> 'IO' () -- -- testShortcut:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'IO' ('Maybe' ('Ref' a))+--+-- Available in FLTK 1.3.4 only:+-- setOnly:: ('Parent' a 'MenuItem') => 'Ref' 'MenuPrim' -> 'Ref' a -> 'IO' () -- -- @ 
src/Graphics/UI/FLTK/LowLevel/NativeFileChooser.chs view
@@ -21,7 +21,7 @@ #include "Fl_Types.h" #include "Fl_Native_File_ChooserC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/NiceSlider.chs view
@@ -12,7 +12,6 @@ #include "Fl_Types.h" #include "Fl_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Output.chs view
@@ -21,7 +21,6 @@ #include "Fl_Multiline_OutputC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/OverlayWindow.chs view
@@ -20,7 +20,6 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-import C2HS hiding (cFromEnum, toBool,cToEnum)  {# fun Fl_Overlay_Window_New_WithLabel as windowNewWithLabel' { `Int', `Int', unsafeToCString `T.Text', id `FunPtr CallbackPrim' } -> `Ptr ()' id #} {# fun Fl_Overlay_Window_New as windowNew' { `Int', `Int', id `FunPtr CallbackPrim' } -> `Ptr ()' id #}
src/Graphics/UI/FLTK/LowLevel/Pack.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_PackC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Pixmap.chs view
@@ -16,7 +16,6 @@ #include "Fl_Types.h" #include "Fl_PixmapC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Positioner.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_PositionerC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Progress.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_ProgressC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/RGBImage.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_RGB_ImageC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/RadioLightButton.chs view
@@ -13,7 +13,7 @@ #include "Fl_Radio_Light_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs view
@@ -17,7 +17,7 @@ #include "Fl_Repeat_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ReturnButton.chs view
@@ -17,7 +17,7 @@ #include "Fl_Return_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Roller.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_RollerC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/RoundButton.chs view
@@ -17,7 +17,7 @@ #include "Fl_Round_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Scrollbar.chs view
@@ -18,7 +18,7 @@ #include "Fl_ScrollbarC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Scrolled.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_ScrollC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/SelectBrowser.chs view
@@ -12,7 +12,7 @@ #include "Fl_Types.h" #include "Fl_Select_BrowserC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/SimpleCounter.chs view
@@ -11,7 +11,7 @@ #include "Fl_Types.h" #include "Fl_CounterC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/SingleWindow.chs view
@@ -25,7 +25,6 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Widget import Graphics.UI.FLTK.LowLevel.Window-import C2HS hiding (cFromEnum, toBool,cToEnum)  {# fun Fl_OverriddenSingle_Window_New as overriddenWindowNew' {`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenSingle_Window_NewXY as overriddenWindowNewXY' {`Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}
src/Graphics/UI/FLTK/LowLevel/Slider.chs view
@@ -17,7 +17,7 @@ #include "Fl_SliderC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Spinner.chs view
@@ -20,7 +20,7 @@ #include "Fl_SpinnerC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs view
@@ -17,7 +17,7 @@ #include "Fl_Sys_Menu_BarC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Table.chs view
@@ -27,7 +27,7 @@ #include "Fl_Types.h" #include "Fl_TableC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget import Graphics.UI.FLTK.LowLevel.Fl_Types
src/Graphics/UI/FLTK/LowLevel/TableRow.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_Table_RowC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget
src/Graphics/UI/FLTK/LowLevel/Tabs.chs view
@@ -18,7 +18,7 @@ #include "Fl_Types.h" #include "Fl_TabsC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/TextBuffer.chs view
@@ -16,7 +16,7 @@ #include "Fl_Types.h" #include "Fl_Text_BufferC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/TextDisplay.chs view
@@ -18,7 +18,7 @@ #include "Fl_Types.h" #include "Fl_Text_DisplayC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import qualified Foreign.Concurrent as FC import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
src/Graphics/UI/FLTK/LowLevel/TextEditor.chs view
@@ -23,7 +23,7 @@ #include "Fl_Types.h" #include "Fl_Text_EditorC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/TextSelection.chs view
@@ -15,7 +15,7 @@ #include "Fl_Types.h" #include "Fl_Text_SelectionC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/Tile.chs view
@@ -18,7 +18,7 @@ #include "Fl_Types.h" #include "Fl_TileC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Timer.chs view
@@ -19,7 +19,7 @@ #include "Fl_Types.h" #include "Fl_TimerC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ToggleButton.chs view
@@ -17,7 +17,7 @@ #include "Fl_Toggle_ButtonC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy
src/Graphics/UI/FLTK/LowLevel/TreePrefs.chs view
@@ -16,7 +16,7 @@ #include "Fl_Types.h" #include "Fl_Tree_PrefsC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Valuator.chs view
@@ -20,7 +20,7 @@ #include "Fl_ValuatorC.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ValueInput.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_Value_InputC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_Value_OutputC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs view
@@ -17,7 +17,7 @@ #include "Fl_Types.h" #include "Fl_Value_SliderC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Widget.chs view
@@ -23,7 +23,7 @@ #include "Fl_Types.h" #include "Fl_WidgetC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils
src/Graphics/UI/FLTK/LowLevel/Wizard.chs view
@@ -16,7 +16,7 @@ #include "Fl_Types.h" #include "Fl_WizardC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)-import Foreign.C.Types+ import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy