fltkhs 0.6.0.0 → 0.7.0.0
raw patch · 81 files changed
+658/−605 lines, 81 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Graphics.UI.FLTK.LowLevel.FL: PasteSourceClipboardImage :: PasteSource
- Graphics.UI.FLTK.LowLevel.FL: PasteSourceClipboardPlainText :: PasteSource
- Graphics.UI.FLTK.LowLevel.FL: PasteSourceSelectionBuffer :: PasteSource
- Graphics.UI.FLTK.LowLevel.FL: copy :: (Text) -> (Int) -> IO ((()))
- Graphics.UI.FLTK.LowLevel.FL: copyWithDestination :: (Text) -> (Int) -> (Int) -> IO ((()))
- Graphics.UI.FLTK.LowLevel.FL: data PasteSource
- Graphics.UI.FLTK.LowLevel.FL: glVisual :: (Mode) -> IO ((Bool))
- Graphics.UI.FLTK.LowLevel.FL: glVisualWithAlist :: (Mode) -> (Ptr CInt) -> IO ((Bool))
- Graphics.UI.FLTK.LowLevel.FL: paste :: (Parent a Widget) => Ref a -> PasteSource -> IO ()
- Graphics.UI.FLTK.LowLevel.FL: pasteWithSource :: (Ptr ()) -> (Int) -> IO ((()))
- Graphics.UI.FLTK.LowLevel.FL: setUseHighResGL :: Bool -> IO ()
- Graphics.UI.FLTK.LowLevel.FL: useHighResGL :: IO Bool
- Graphics.UI.FLTK.LowLevel.Fl_Enumerations: ModeOpenGL3 :: Mode
- Graphics.UI.FLTK.LowLevel.Fl_Types: FlGlContext :: Fl_GlContext -> FlGlContext
- Graphics.UI.FLTK.LowLevel.Fl_Types: newtype FlGlContext
- Graphics.UI.FLTK.LowLevel.Fl_Types: type Fl_GlContext = ((Ptr ()))
- Graphics.UI.FLTK.LowLevel.Gl: glColor :: (Color) -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDescent :: IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDraw :: Text -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDrawAt :: Text -> Float -> Float -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDrawChars :: Text -> Int -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDrawCharsAt :: Text -> Int -> Float -> Float -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDrawImage :: BitmapHs -> Position -> Maybe Depth -> Maybe LineSize -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glDrawInBox :: Text -> Rectangle -> AlignType -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glFinish :: IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glFont :: Font -> FontSize -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glHeight :: IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glMeasure :: Text -> Position -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glRect :: Rectangle -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glRectf :: Rectangle -> IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glStart :: IO ()
- Graphics.UI.FLTK.LowLevel.Gl: glWidth :: Text -> IO (Double)
- Graphics.UI.FLTK.LowLevel.Gl: glWidthChar :: Char -> IO (Double)
- Graphics.UI.FLTK.LowLevel.Gl: glWidthChars :: Text -> Int -> IO (Double)
- Graphics.UI.FLTK.LowLevel.GlWindow: glWindowCanDo :: Mode -> IO Bool
- Graphics.UI.FLTK.LowLevel.GlWindow: glWindowCustom :: Size -> Maybe Position -> Maybe Text -> Maybe (Ref GlWindow -> IO ()) -> CustomWidgetFuncs GlWindow -> CustomWindowFuncs GlWindow -> IO (Ref GlWindow)
- Graphics.UI.FLTK.LowLevel.GlWindow: glWindowNew :: Size -> Maybe Position -> Maybe Text -> IO (Ref GlWindow)
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ (GHC.Types.Bool -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetContextValid ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ (GHC.Types.Bool -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetValid ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: 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.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: 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.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Enumerations.Modes -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetMode ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: 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.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: 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.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref Graphics.UI.FLTK.LowLevel.Fl_Types.FlGlContext -> GHC.Types.Bool -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetContextWithDestroyFlag ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref Graphics.UI.FLTK.LowLevel.Fl_Types.FlGlContext -> GHC.Types.IO ())) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SetContext ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Destroy ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.DrawSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Flush ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.FlushSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Hide ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.HideOverlay ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.HideSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Invalidate ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.MakeOverlayCurrent ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.Ortho ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.RedrawOverlay ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ShowWidget ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.ShowWidgetSuper ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.SwapBuffers ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO (Graphics.UI.FLTK.LowLevel.Fl_Types.Ref Graphics.UI.FLTK.LowLevel.Fl_Types.FlGlContext)) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetContext ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Bool) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.CanDo ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: 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.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Bool) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetContextValid ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Bool) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetValid ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Float) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.PixelsPerUnit ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.PixelH ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO GHC.Types.Int) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.PixelW ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.GlWindow: instance (impl ~ GHC.Types.IO Graphics.UI.FLTK.LowLevel.Fl_Enumerations.Mode) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.GetMode ()) Graphics.UI.FLTK.LowLevel.Hierarchy.GlWindow orig impl
- Graphics.UI.FLTK.LowLevel.Glut: GlutActiveAlt :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutActiveCtrl :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutActiveShift :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorBottomLeftCorner :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorBottomRightCorner :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorBottomSide :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorCrosshair :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorCycle :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorDestroy :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorHelp :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorInfo :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorInherit :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorLeftArrow :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorLeftRight :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorLeftSide :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorNone :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorRightArrow :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorRightSide :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorSpray :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorText :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorTopLeftCorner :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorTopRightCorner :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorTopSide :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorUpDown :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutCursorWait :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeAccum :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeAlpha :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeDepth :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeDouble :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeIndex :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeMultisample :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModePossible :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeRgb :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeRgba :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeSingle :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeStencil :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDisplayModeStereo :: GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: GlutDown :: GlutUpDown
- Graphics.UI.FLTK.LowLevel.Glut: GlutEntered :: GlutEnteredLeft
- Graphics.UI.FLTK.LowLevel.Glut: GlutInitDisplayMode :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutInitWindowHeight :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutInitWindowWidth :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutInitWindowX :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutInitWindowY :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyDown :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyEnd :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF1 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF10 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF11 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF12 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF2 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF3 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF4 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF5 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF6 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF7 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF8 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyF9 :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyHome :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyInsert :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyLeft :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyPageDown :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyPageUp :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyRight :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutKeyUp :: GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutLeft :: GlutEnteredLeft
- Graphics.UI.FLTK.LowLevel.Glut: GlutLeftButton :: GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutMenu :: CInt -> GlutMenu
- Graphics.UI.FLTK.LowLevel.Glut: GlutMenuInUse :: GlutMenuState
- Graphics.UI.FLTK.LowLevel.Glut: GlutMenuNotInUse :: GlutMenuState
- Graphics.UI.FLTK.LowLevel.Glut: GlutMenuNumItems :: GlutMenuItems
- Graphics.UI.FLTK.LowLevel.Glut: GlutMiddleButton :: GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutNormal :: GlutDraw
- Graphics.UI.FLTK.LowLevel.Glut: GlutNormalDamaged :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutNotVisible :: GlutVisibility
- Graphics.UI.FLTK.LowLevel.Glut: GlutOverlay :: GlutDraw
- Graphics.UI.FLTK.LowLevel.Glut: GlutOverlayDamaged :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutOverlayPossible :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutReturnZero :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutRightButton :: GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: GlutScreenHeight :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutScreenWidth :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutTransparentIndex :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutUp :: GlutUpDown
- Graphics.UI.FLTK.LowLevel.Glut: GlutVersion :: GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: GlutVisible :: GlutVisibility
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindow :: CInt -> GlutWindow
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowAccumAlphaSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowAccumBlueSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowAccumGreenSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowAccumRedSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowAlphaSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowBlueSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowBufferSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowColormapSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowDepthSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowDoublebuffer :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowGreenSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowHeight :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowNumSamples :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowParent :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowRedSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowRgba :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowStencilSize :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowStereo :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowWidth :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowX :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: GlutWindowY :: GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: [menuNumber] :: GlutMenu -> CInt
- Graphics.UI.FLTK.LowLevel.Glut: [windowNumber] :: GlutWindow -> CInt
- Graphics.UI.FLTK.LowLevel.Glut: data GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: data GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: data GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: data GlutDraw
- Graphics.UI.FLTK.LowLevel.Glut: data GlutEnteredLeft
- Graphics.UI.FLTK.LowLevel.Glut: data GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: data GlutMenu
- Graphics.UI.FLTK.LowLevel.Glut: data GlutMenuItems
- Graphics.UI.FLTK.LowLevel.Glut: data GlutMenuState
- Graphics.UI.FLTK.LowLevel.Glut: data GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: data GlutUpDown
- Graphics.UI.FLTK.LowLevel.Glut: data GlutVisibility
- Graphics.UI.FLTK.LowLevel.Glut: data GlutWindow
- Graphics.UI.FLTK.LowLevel.Glut: data GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: glutAddMenuEntry :: Text -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutAddSubMenu :: (Text) -> (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutAttachMenu :: (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutChangeToMenuEntry :: Int -> Text -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutChangeToSubMenu :: (Int) -> (Text) -> (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutCreateMenu :: IO () -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutCreateSubWindow :: GlutWindow -> Rectangle -> IO GlutWindow
- Graphics.UI.FLTK.LowLevel.Glut: glutCreateWindow :: (Text) -> IO ((GlutWindow))
- Graphics.UI.FLTK.LowLevel.Glut: glutCursorFullCrossHair :: GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: glutDestroyMenu :: (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutDestroyWindow :: (GlutWindow) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutDetachMenu :: (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutDisplayFunc :: (IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutDisplayModePossible :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutEntryFunc :: (GlutEnteredLeft -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutEstablishOverlay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutFullScreen :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutGetMenu :: IO ((GlutMenu))
- Graphics.UI.FLTK.LowLevel.Glut: glutGetMenuNumItems :: IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutGetModifiers :: IO (([EventState]))
- Graphics.UI.FLTK.LowLevel.Glut: glutGetScreenSize :: IO Size
- Graphics.UI.FLTK.LowLevel.Glut: glutGetWindow :: IO ((GlutWindow))
- Graphics.UI.FLTK.LowLevel.Glut: glutGetWindowParent :: IO (Maybe GlutWindow)
- Graphics.UI.FLTK.LowLevel.Glut: glutGetWindowRectangle :: IO Rectangle
- Graphics.UI.FLTK.LowLevel.Glut: glutHasKeyboard :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutHasMouse :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutHideOverlay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutHideWindow :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutIconifyWindow :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutIdleFunc :: (IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutInitDisplayMode :: (GlutDisplayMode) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutInitWindowPosition :: Position -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutInitWindowSize :: Size -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutKeyboardFunc :: (Char -> Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutMainLoop :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutMenuStateFunc :: (GlutMenuState -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutMenuStatusFunc :: (GlutMenuState -> Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutMotionFunc :: (Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutMouseFunc :: (MouseButton -> GlutUpDown -> Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutNormalDamaged :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutNumMouseButtons :: IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutOther :: Word32 -> IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutOverlayDamaged :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutOverlayDisplayFunc :: (IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutOverlayPossible :: IO Bool
- Graphics.UI.FLTK.LowLevel.Glut: glutPassiveMotionFunc :: (Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPopWindow :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPositionWindow :: Position -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPostOverlayRedisplay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPostRedisplay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPostWindowRedisplay :: (GlutWindow) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutPushWindow :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutRemoveMenuItem :: (Int) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutRemoveOverlay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutReshapeFunc :: (Size -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutReshapeWindow :: Size -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSetCursor :: (GlutCursor) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSetIconTitle :: (Text) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSetMenu :: (GlutMenu) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSetWindow :: (GlutWindow) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSetWindowTitle :: (Text) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutShowOverlay :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutShowWindow :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidCone :: (Double) -> (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidCube :: (Double) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidDodecahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidIcosahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidOctahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidSphere :: (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidTeapot :: (Double) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidTetrahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSolidTorus :: (Double) -> (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSpecialFunc :: (GlutKeyboardCodes -> Position -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutSwapBuffers :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutTimerFunc :: Int -> (IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutTransparencyIndex :: IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutUseLayer :: (Word32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutVersion :: IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutVisibilityFunc :: (GlutVisibility -> IO ()) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWarpPointer :: Position -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWindowBufferSize :: IO Int
- Graphics.UI.FLTK.LowLevel.Glut: glutWireCone :: (Double) -> (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireCube :: (Double) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireDodecahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireIcosahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireOctahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireSphere :: (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireTeapot :: (Double) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireTetrahedron :: IO ()
- Graphics.UI.FLTK.LowLevel.Glut: glutWireTorus :: (Double) -> (Double) -> (Int32) -> (Int32) -> IO ()
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Classes.Eq Graphics.UI.FLTK.LowLevel.Glut.GlutMenu
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Classes.Eq Graphics.UI.FLTK.LowLevel.Glut.GlutWindow
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutDraw
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutEnteredLeft
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutMenuItems
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutMenuState
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutPeripheralProperties
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutUpDown
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutVisibility
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Glut.GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GLUTproc
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutConstants
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutCursor
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutDisplayMode
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutDraw
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutEnteredLeft
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutKeyboardCodes
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutMenu
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutMenuItems
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutMenuState
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutMouseCodes
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutPeripheralProperties
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutUpDown
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutVisibility
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutWindow
- Graphics.UI.FLTK.LowLevel.Glut: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Glut.GlutWindowProperties
- Graphics.UI.FLTK.LowLevel.Utils: unsafeFromCString :: CString -> Text
- Graphics.UI.FLTK.LowLevel.Utils: unsafeToCString :: Text -> CString
- Graphics.UI.FLTK.LowLevel.Utils: unsafeToMaybeRef :: Ptr () -> Maybe (Ref a)
- Graphics.UI.FLTK.LowLevel.Utils: unsafeToRef :: Ptr () -> (Ref a)
+ Graphics.UI.FLTK.LowLevel.FL: copyLengthToClipboard :: Text -> Int -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: copyLengthToSelectionBuffer :: Text -> Int -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: copyToClipboard :: Text -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: copyToSelectionBuffer :: Text -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: pasteFromClipboard :: (Parent a Widget) => Ref a -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: pasteFromSelectionBuffer :: (Parent a Widget) => Ref a -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: pasteImageFromClipboard :: (Parent a Widget) => Ref a -> IO ()
+ Graphics.UI.FLTK.LowLevel.FL: pasteImageFromSelectionBuffer :: (Parent a Widget) => Ref a -> IO ()
+ Graphics.UI.FLTK.LowLevel.Utils: cStringToMaybeText :: (HasCallStack) => CString -> IO (Maybe Text)
- Graphics.UI.FLTK.LowLevel.Ask: flInput :: Text -> IO ()
+ Graphics.UI.FLTK.LowLevel.Ask: flInput :: Text -> IO (Maybe Text)
- Graphics.UI.FLTK.LowLevel.Ask: flPassword :: Text -> IO ()
+ Graphics.UI.FLTK.LowLevel.Ask: flPassword :: Text -> IO (Maybe Text)
- Graphics.UI.FLTK.LowLevel.FL: belowmouse :: IO ((Maybe (Ref Widget)))
+ Graphics.UI.FLTK.LowLevel.FL: belowmouse :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: eventText :: IO ((Text))
+ Graphics.UI.FLTK.LowLevel.FL: eventText :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: firstWindow :: IO ((Maybe (Ref Window)))
+ Graphics.UI.FLTK.LowLevel.FL: firstWindow :: IO (Maybe (Ref Window))
- Graphics.UI.FLTK.LowLevel.FL: focus :: IO ((Maybe (Ref Widget)))
+ Graphics.UI.FLTK.LowLevel.FL: focus :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: getFont :: (Font) -> IO ((Text))
+ Graphics.UI.FLTK.LowLevel.FL: getFont :: Font -> IO Text
- Graphics.UI.FLTK.LowLevel.FL: getScheme :: (Text)
+ Graphics.UI.FLTK.LowLevel.FL: getScheme :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: grab :: IO ((Maybe (Ref Window)))
+ Graphics.UI.FLTK.LowLevel.FL: grab :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: help :: IO ((Text))
+ Graphics.UI.FLTK.LowLevel.FL: help :: IO Text
- Graphics.UI.FLTK.LowLevel.FL: modal :: IO ((Maybe (Ref Window)))
+ Graphics.UI.FLTK.LowLevel.FL: modal :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: nextWindow :: (Parent a Window) => Ref a -> IO (Maybe (Ref Window))
+ Graphics.UI.FLTK.LowLevel.FL: nextWindow :: Ref a -> IO (Maybe (Ref Window))
- Graphics.UI.FLTK.LowLevel.FL: readqueue :: IO ((Maybe (Ref Widget)))
+ Graphics.UI.FLTK.LowLevel.FL: readqueue :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: selectionOwner :: IO ((Maybe (Ref Widget)))
+ Graphics.UI.FLTK.LowLevel.FL: selectionOwner :: IO (Maybe (Ref Widget))
- Graphics.UI.FLTK.LowLevel.FL: setFontToString :: (Font) -> (Text) -> IO ((()))
+ Graphics.UI.FLTK.LowLevel.FL: setFontToString :: Font -> Text -> IO ()
- Graphics.UI.FLTK.LowLevel.MenuItem: addMenuItem :: (Parent menuItem MenuItem) => Either (Ref MenuPrim) (Ref MenuItem) -> Text -> Maybe Shortcut -> Maybe (Ref menuItem -> IO ()) -> MenuItemFlags -> (Ptr () -> Text -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> (Ptr () -> Text -> Text -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex)
+ Graphics.UI.FLTK.LowLevel.MenuItem: addMenuItem :: (Parent menuItem MenuItem) => Either (Ref MenuPrim) (Ref MenuItem) -> Text -> Maybe Shortcut -> Maybe (Ref menuItem -> IO ()) -> MenuItemFlags -> (Ptr () -> CString -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> (Ptr () -> CString -> CString -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex)
- Graphics.UI.FLTK.LowLevel.MenuPrim: insertMenuItem :: (Parent a MenuPrim) => Ref MenuPrim -> Int -> Text -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> (Ptr () -> Int -> Text -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> (Ptr () -> Int -> Text -> Text -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex)
+ Graphics.UI.FLTK.LowLevel.MenuPrim: insertMenuItem :: (Parent a MenuPrim) => Ref MenuPrim -> Int -> Text -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> (Ptr () -> Int -> CString -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> (Ptr () -> Int -> CString -> CString -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex)
- Graphics.UI.FLTK.LowLevel.Widget: widgetMaker :: forall a. (Parent a Widget) => Rectangle -> Maybe Text -> Maybe (Ref a -> IO ()) -> Maybe (CustomWidgetFuncs a) -> (Int -> Int -> Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> Text -> Ptr () -> IO (Ptr ())) -> IO (Ref a)
+ Graphics.UI.FLTK.LowLevel.Widget: widgetMaker :: forall a. (Parent a Widget) => Rectangle -> Maybe Text -> Maybe (Ref a -> IO ()) -> Maybe (CustomWidgetFuncs a) -> (Int -> Int -> Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> CString -> Ptr () -> IO (Ptr ())) -> IO (Ref a)
- Graphics.UI.FLTK.LowLevel.Window: windowMaker :: forall a b. (Parent a Window, Parent b Widget) => Size -> Maybe Position -> Maybe Text -> Maybe (Ref b -> IO ()) -> CustomWidgetFuncs b -> CustomWindowFuncs a -> (Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Text -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> Text -> Ptr () -> IO (Ptr ())) -> IO (Ref a)
+ Graphics.UI.FLTK.LowLevel.Window: windowMaker :: forall a b. (Parent a Window, Parent b Widget) => Size -> Maybe Position -> Maybe Text -> Maybe (Ref b -> IO ()) -> CustomWidgetFuncs b -> CustomWindowFuncs a -> (Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> CString -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> CString -> Ptr () -> IO (Ptr ())) -> IO (Ref a)
Files
- c-src/Fl_AskC.cpp +4/−4
- fltkhs.cabal +1/−1
- src/Graphics/UI/FLTK/LowLevel/Adjuster.chs +4/−6
- src/Graphics/UI/FLTK/LowLevel/Ask.chs +14/−10
- src/Graphics/UI/FLTK/LowLevel/BMPImage.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Box.chs +7/−7
- src/Graphics/UI/FLTK/LowLevel/Browser.chs +12/−12
- src/Graphics/UI/FLTK/LowLevel/Button.chs +1/−1
- src/Graphics/UI/FLTK/LowLevel/CheckButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Choice.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Clock.chs +4/−4
- src/Graphics/UI/FLTK/LowLevel/ColorChooser.chs +9/−8
- src/Graphics/UI/FLTK/LowLevel/Counter.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Dial.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/DoubleWindow.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Draw.chs +36/−38
- src/Graphics/UI/FLTK/LowLevel/FL.chs +93/−59
- src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs +1/−1
- src/Graphics/UI/FLTK/LowLevel/FileBrowser.chs +8/−8
- src/Graphics/UI/FLTK/LowLevel/FileInput.chs +6/−6
- src/Graphics/UI/FLTK/LowLevel/FillDial.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/FillSlider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/GIFImage.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Gl.chs +16/−16
- src/Graphics/UI/FLTK/LowLevel/GlWindow.chs +4/−4
- src/Graphics/UI/FLTK/LowLevel/Glut.chs +20/−8
- src/Graphics/UI/FLTK/LowLevel/Group.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/HorFillSlider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/HorNiceSlider.chs +3/−4
- src/Graphics/UI/FLTK/LowLevel/HorSlider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/HorValueSlider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Input.chs +24/−24
- src/Graphics/UI/FLTK/LowLevel/JPEGImage.chs +5/−4
- src/Graphics/UI/FLTK/LowLevel/LightButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/LineDial.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/MenuBar.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/MenuButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/MenuItem.chs +29/−24
- src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs +29/−25
- src/Graphics/UI/FLTK/LowLevel/NativeFileChooser.chs +22/−22
- src/Graphics/UI/FLTK/LowLevel/NiceSlider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Output.chs +5/−5
- src/Graphics/UI/FLTK/LowLevel/OverlayWindow.chs +5/−5
- src/Graphics/UI/FLTK/LowLevel/PNGImage.chs +4/−4
- src/Graphics/UI/FLTK/LowLevel/PNMImage.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Pack.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Positioner.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Progress.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/RadioLightButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/ReturnButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Roller.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/RoundButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Scrollbar.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Scrolled.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/SelectBrowser.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/SimpleTerminal.chs +6/−6
- src/Graphics/UI/FLTK/LowLevel/SingleWindow.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Slider.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Spinner.chs +6/−6
- src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs +10/−10
- src/Graphics/UI/FLTK/LowLevel/Table.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/TableRow.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Tabs.chs +5/−4
- src/Graphics/UI/FLTK/LowLevel/TextBuffer.chs +58/−59
- src/Graphics/UI/FLTK/LowLevel/TextDisplay.chs +10/−12
- src/Graphics/UI/FLTK/LowLevel/TextEditor.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Tile.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/ToggleButton.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/Tree.chs +30/−31
- src/Graphics/UI/FLTK/LowLevel/TreeItem.chs +25/−17
- src/Graphics/UI/FLTK/LowLevel/Utils.hs +13/−15
- src/Graphics/UI/FLTK/LowLevel/Valuator.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/ValueInput.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs +2/−11
- src/Graphics/UI/FLTK/LowLevel/Widget.chs +16/−16
- src/Graphics/UI/FLTK/LowLevel/Window.chs +25/−22
- src/Graphics/UI/FLTK/LowLevel/Wizard.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/XBMImage.chs +2/−2
- src/Graphics/UI/FLTK/LowLevel/XPMImage.chs +2/−2
c-src/Fl_AskC.cpp view
@@ -28,10 +28,10 @@ return fl_choice(q,b0,b1,b2,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); } FL_EXPORT_C(const char*,flc_input)(const char *label){- return fl_input(label,0,NULL);+ return fl_input("s",0,label); } FL_EXPORT_C(const char*,flc_input_with_deflt)(const char *label,const char* deflt){- return fl_input(label,deflt, NULL);+ return fl_input("s",deflt, label); } FL_EXPORT_C(const char*,flc_input_with_args)(const char *label,const char* arg1,const char* arg2,const char* arg3,const char* arg4,const char* arg5,const char* arg6,const char* arg7,const char* arg8,const char* arg9,const char* arg10){ return fl_input(label,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);@@ -40,10 +40,10 @@ return fl_input(label,deflt,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); } FL_EXPORT_C(const char *,flc_password)(const char *label){- return fl_password(label,0,NULL);+ return fl_password("%s",0,label); } FL_EXPORT_C(const char *,flc_password_with_deflt)(const char *label,const char* deflt){- return fl_password(label,deflt,NULL);+ return fl_password("%s",deflt,label); } FL_EXPORT_C(const char *,flc_password_with_args)(const char *label,const char* arg1,const char* arg2,const char* arg3,const char* arg4,const char* arg5,const char* arg6,const char* arg7,const char* arg8,const char* arg9,const char* arg10){ return fl_password(label,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
fltkhs.cabal view
@@ -1,5 +1,5 @@ name : fltkhs-version : 0.6.0.0+version : 0.7.0.0 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/Adjuster.chs view
@@ -26,7 +26,7 @@ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenAdjuster_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenAdjuster_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenAdjuster_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} adjusterCustom :: Rectangle -- ^ The bounds of this Adjuster@@ -45,15 +45,13 @@ {# fun Fl_Adjuster_New as adjusterNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Adjuster_New_WithLabel as adjusterNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Adjuster_New_WithLabel as adjusterNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} adjusterNew :: Rectangle -> Maybe T.Text -> IO (Ref Adjuster) adjusterNew rectangle l'= let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of- Nothing -> adjusterNew' x_pos y_pos width height >>=- toRef- Just l -> adjusterNewWithLabel' x_pos y_pos width height l >>=- toRef+ Nothing -> adjusterNew' x_pos y_pos width height >>= toRef+ Just l -> copyTextToCString l >>= \l' -> adjusterNewWithLabel' x_pos y_pos width height l' >>= toRef {# fun Fl_Adjuster_Destroy as adjusterDestroy' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ (IO ())) => Op (Destroy ()) Adjuster orig impl where
src/Graphics/UI/FLTK/LowLevel/Ask.chs view
@@ -36,18 +36,22 @@ flBeep Nothing = flBeep' flBeep (Just bt) = flBeepType' (fromIntegral (fromEnum bt)) -{# fun flc_input as flInput' { unsafeToCString `T.Text' } -> `()' #}-flInput :: T.Text -> IO ()-flInput = flInput'+{# fun flc_input as flInput' { `CString' } -> `CString' #}+flInput :: T.Text -> IO (Maybe T.Text)+flInput msg = do+ r <- copyTextToCString msg >>= flInput'+ cStringToMaybeText r -{# fun flc_password as flPassword' { unsafeToCString `T.Text' } -> `()' #}-flPassword :: T.Text -> IO ()-flPassword = flPassword'+{# fun flc_password as flPassword' { `CString' } -> `CString' #}+flPassword :: T.Text -> IO (Maybe T.Text)+flPassword msg = do+ r <- copyTextToCString msg >>= flPassword'+ cStringToMaybeText r -{# fun flc_message as flMessage' { unsafeToCString `T.Text' } -> `()' #}+{# fun flc_message as flMessage' { `CString' } -> `()' #} flMessage :: T.Text -> IO ()-flMessage = flMessage'+flMessage t = copyTextToCString t >>= flMessage' -{# fun flc_alert as flAlert' { unsafeToCString `T.Text' } -> `()' #}+{# fun flc_alert as flAlert' { `CString' } -> `()' #} flAlert :: T.Text -> IO ()-flAlert = flAlert'+flAlert t = copyTextToCString t >>= flAlert'
src/Graphics/UI/FLTK/LowLevel/BMPImage.chs view
@@ -18,10 +18,10 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.Text as T-{# fun Fl_BMP_Image_New as bmpImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_BMP_Image_New as bmpImageNew' { `CString' } -> `Ptr ()' id #} bmpImageNew :: T.Text -> IO (Either UnknownError (Ref BMPImage)) bmpImageNew filename' = do- ptr <- bmpImageNew' filename'+ ptr <- withText filename' bmpImageNew' ref' <- (toRef ptr :: IO (Ref BMPImage)) checkImage ref'
src/Graphics/UI/FLTK/LowLevel/Box.chs view
@@ -30,11 +30,11 @@ import Graphics.UI.FLTK.LowLevel.Widget {# fun Fl_Box_New as boxNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Box_New_WithLabel as boxNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_OverriddenBox_New_WithLabel as overriddenBoxNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Box_New_WithLabel as boxNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #}+{# fun Fl_OverriddenBox_New_WithLabel as overriddenBoxNewWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenBox_New as overriddenBoxNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_Box_New_WithBoxtype as boxNewWithBoxtype' {cFromEnum `Boxtype', `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_OverriddenBox_New_WithBoxtype as overriddenBoxNewWithBoxtype' {cFromEnum `Boxtype', `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Box_New_WithBoxtype as boxNewWithBoxtype' {cFromEnum `Boxtype', `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #}+{# fun Fl_OverriddenBox_New_WithBoxtype as overriddenBoxNewWithBoxtype' {cFromEnum `Boxtype', `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} boxCustom :: Rectangle -- ^ The bounds of this box -> Maybe T.Text -- ^ Optional label@@ -56,12 +56,12 @@ in case funcs' of Just fs -> do ptr <- customWidgetFunctionStruct draw' fs- ref <- overriddenBoxNewWithBoxtype' boxtype' x_pos y_pos width height l' (castPtr ptr) >>= toRef+ ref <- copyTextToCString l' >>= \l'' -> overriddenBoxNewWithBoxtype' boxtype' x_pos y_pos width height l'' (castPtr ptr) >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref Nothing ->- boxNewWithBoxtype' boxtype' x_pos y_pos width height l' >>= toRef+ copyTextToCString l' >>= \l'' -> boxNewWithBoxtype' boxtype' x_pos y_pos width height l'' >>= toRef boxNew :: Rectangle -> Maybe T.Text -> IO (Ref Box)@@ -78,7 +78,7 @@ boxNewWithBoxtype boxtype' rectangle' l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle' in do- ref <- boxNewWithBoxtype' boxtype' x_pos y_pos width height l' >>= toRef+ ref <- copyTextToCString l' >>= \l'' -> boxNewWithBoxtype' boxtype' x_pos y_pos width height l'' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/Browser.chs view
@@ -29,8 +29,8 @@ import Graphics.UI.FLTK.LowLevel.Widget {# fun Fl_Browser_New as browserNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Browser_New_WithLabel as browserNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_OverriddenBrowser_New_WithLabel as overriddenBrowserNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Browser_New_WithLabel as browserNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #}+{# fun Fl_OverriddenBrowser_New_WithLabel as overriddenBrowserNewWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenBrowser_New as overriddenBrowserNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} browserCustom :: Rectangle -> Maybe T.Text -> Maybe (Ref Browser -> IO ()) -> Maybe (CustomWidgetFuncs Browser) -> IO (Ref Browser) browserCustom rectangle l' draw' funcs' =@@ -64,19 +64,19 @@ {# fun Fl_Browser_remove as remove' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (LineNumber -> IO ())) => Op (Remove ()) Browser orig impl where runOp _ _ browser (LineNumber line) = withRef browser $ \browserPtr -> remove' browserPtr line-{# fun Fl_Browser_add as add' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Browser_add as add' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (Add ()) Browser orig impl where- runOp _ _ browser newtext = withRef browser $ \browserPtr -> add' browserPtr newtext-{# fun Fl_Browser_insert as insert' { id `Ptr ()',`Int',unsafeToCString `T.Text' } -> `()' #}+ runOp _ _ browser newtext = withRef browser $ \browserPtr -> copyTextToCString newtext >>= add' browserPtr+{# fun Fl_Browser_insert as insert' { id `Ptr ()',`Int',`CString' } -> `()' #} instance (impl ~ (LineNumber -> T.Text -> IO ())) => Op (Insert ()) Browser orig impl where- runOp _ _ browser (LineNumber line) newtext = withRef browser $ \browserPtr -> insert' browserPtr line newtext+ runOp _ _ browser (LineNumber line) newtext = withRef browser $ \browserPtr -> copyTextToCString newtext >>= insert' browserPtr line {# fun Fl_Browser_move as move' { id `Ptr ()',`Int',`Int' } -> `()' #} instance (impl ~ (LineNumber -> LineNumber -> IO ())) => Op (Move ()) Browser orig impl where runOp _ _ browser (LineNumber to) (LineNumber from) = withRef browser $ \browserPtr -> move' browserPtr to from-{# fun Fl_Browser_load as load' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Browser_load as load' { id `Ptr ()',`CString' } -> `Int' #} instance (impl ~ (T.Text -> IO (Either UnknownError ()))) => Op (Load ()) Browser orig impl where runOp _ _ browser filename = do- res <- withRef browser $ \browserPtr -> load' browserPtr filename+ res <- withRef browser $ \browserPtr -> withText filename (\f -> load' browserPtr f) if (res == 0) then return (Left UnknownError) else return (Right ()) {# fun Fl_Browser_swap as swap' { id `Ptr ()',`Int',`Int' } -> `()' #} instance (impl ~ (LineNumber -> LineNumber -> IO ())) => Op (Swap ()) Browser orig impl where@@ -132,12 +132,12 @@ {# fun Fl_Browser_set_value as setValue' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (LineNumber -> IO ())) => Op (SetValue ()) Browser orig impl where runOp _ _ browser (LineNumber line) = withRef browser $ \browserPtr -> setValue' browserPtr line-{# fun Fl_Browser_text as text' { id `Ptr ()',`Int' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Browser_text as text' { id `Ptr ()',`Int' } -> `CString' #} instance (impl ~ (LineNumber -> IO T.Text)) => Op (GetText ()) Browser orig impl where- runOp _ _ browser (LineNumber line) = withRef browser $ \browserPtr -> text' browserPtr line-{# fun Fl_Browser_set_text as setText' { id `Ptr ()',`Int', unsafeToCString `T.Text' } -> `()' #}+ runOp _ _ browser (LineNumber line) = withRef browser $ \browserPtr -> text' browserPtr line >>= cStringToText+{# fun Fl_Browser_set_text as setText' { id `Ptr ()',`Int', `CString' } -> `()' #} instance (impl ~ (LineNumber -> T.Text -> IO ())) => Op (SetText ()) Browser orig impl where- runOp _ _ browser (LineNumber line) newtext = withRef browser $ \browserPtr -> setText' browserPtr line newtext+ runOp _ _ browser (LineNumber line) newtext = withRef browser $ \browserPtr -> copyTextToCString newtext >>= setText' browserPtr line {# fun Fl_Browser_format_char as formatChar' { id `Ptr ()' } -> `CChar' id #} instance (impl ~ ( IO (Char))) => Op (GetFormatChar ()) Browser orig impl where runOp _ _ browser = withRef browser $ \browserPtr -> formatChar' browserPtr >>= return . castCCharToChar
src/Graphics/UI/FLTK/LowLevel/Button.chs view
@@ -30,7 +30,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Hierarchy -{# fun Fl_OverriddenButton_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenButton_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenButton_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} buttonCustom :: Rectangle -- ^ The bounds of this button -> Maybe T.Text -- ^ The button label
src/Graphics/UI/FLTK/LowLevel/CheckButton.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenCheck_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenCheck_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenCheck_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} checkButtonCustom :: Rectangle -- ^ The bounds of this CheckButton@@ -44,7 +44,7 @@ {# fun Fl_Check_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Check_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Check_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} checkButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref CheckButton) checkButtonNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Choice.chs view
@@ -28,7 +28,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenChoice_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenChoice_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenChoice_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} choiceCustom :: Rectangle -- ^ The bounds of this Choice@@ -47,7 +47,7 @@ {# fun Fl_Choice_New as choiceNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Choice_New_WithLabel as choiceNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Choice_New_WithLabel as choiceNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} choiceNew :: Rectangle -> Maybe T.Text -> IO (Ref Choice) choiceNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/Clock.chs view
@@ -50,7 +50,7 @@ data ClockSinceEpoch = ClockSinceEpoch Second deriving Show data ClockSetTimeType = ClockSetByTime ClockByTime | ClockSetSinceEpoch ClockSinceEpoch deriving Show -{# fun Fl_OverriddenClock_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenClock_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenClock_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} clockCustom :: Rectangle -- ^ The bounds of this Clock@@ -68,8 +68,8 @@ overriddenWidgetNewWithLabel' {# fun Fl_Clock_New as clockNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Clock_New_WithLabel as clockNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_Clock_New_WithClockType as clockNewWithClockType' { id `CUChar', `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Clock_New_WithLabel as clockNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #}+{# fun Fl_Clock_New_WithClockType as clockNewWithClockType' { id `CUChar', `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} clockNew :: Rectangle -> Maybe T.Text -> IO (Ref Clock) clockNew rectangle l' = widgetMaker@@ -84,7 +84,7 @@ clockNewWithType clocktype' rectangle' label' = let (x_pos, y_pos, width, height) = fromRectangle rectangle' in do- ref <- clockNewWithClockType' (castCharToCUChar . chr . fromEnum $ clocktype') x_pos y_pos width height label' >>= toRef+ ref <- copyTextToCString label' >>= \l' -> clockNewWithClockType' (castCharToCUChar . chr . fromEnum $ clocktype') x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/ColorChooser.chs view
@@ -104,7 +104,7 @@ toRgbPrim (rgbCustom funcs) >>= {#set fl_Color_Chooser_Virtual_Funcs->rgb #} structPtr return structPtr -{# fun Fl_OverriddenColor_Chooser_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()', id `Ptr ()' } -> `Ptr ()' id #}+{# fun Fl_OverriddenColor_Chooser_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()', id `Ptr ()' } -> `Ptr ()' id #} {# fun Fl_OverriddenColor_Chooser_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()', id `Ptr ()' } -> `Ptr ()' id #} colorChooserCustom :: Rectangle -- ^ The bounds of this ColorChooser@@ -121,7 +121,7 @@ colorChooser <- maybe (overriddenWidgetNew' x_pos y_pos width height (castPtr widgetFuncsPtr) (castPtr colorChooserFuncsPtr))- (\l -> overriddenWidgetNewWithLabel' x_pos y_pos width height l (castPtr widgetFuncsPtr) (castPtr colorChooserFuncsPtr))+ (\l -> copyTextToCString l >>= \l' -> overriddenWidgetNewWithLabel' x_pos y_pos width height l' (castPtr widgetFuncsPtr) (castPtr colorChooserFuncsPtr)) l' ref <- toRef colorChooser setFlag ref WidgetFlagCopiedLabel@@ -129,14 +129,15 @@ return ref {# fun Fl_Color_Chooser_New as colorchooserNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Color_Chooser_New_WithLabel as colorchooserNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Color_Chooser_New_WithLabel as colorchooserNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} colorChooserNew :: Rectangle -> Maybe T.Text -> IO (Ref ColorChooser) colorChooserNew rectangle l'= let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> colorchooserNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- colorchooserNewWithLabel' x_pos y_pos width height l >>= toRef+ l' <- copyTextToCString l+ ref <- colorchooserNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref@@ -297,8 +298,8 @@ v''' <- peek vPtr return (Just (Between0And6 (realToFrac h'''),Between0And1 (realToFrac s'''),Between0And1 (realToFrac v'''))) -{# fun flc_color_chooser_with_m as flc_color_chooser_with_m' {unsafeToCString `T.Text' , id `Ptr CDouble', id `Ptr CDouble', id `Ptr CDouble', `Int' } -> `Int' #}-{# fun flc_color_chooser_with_uchar_m as flc_color_chooser_with_uchar_m' {unsafeToCString `T.Text' , id `Ptr CUChar', id `Ptr CUChar', id `Ptr CUChar', `Int' } -> `Int' #}+{# fun flc_color_chooser_with_m as flc_color_chooser_with_m' {`CString' , id `Ptr CDouble', id `Ptr CDouble', id `Ptr CDouble', `Int' } -> `Int' #}+{# fun flc_color_chooser_with_uchar_m as flc_color_chooser_with_uchar_m' {`CString' , id `Ptr CUChar', id `Ptr CUChar', id `Ptr CUChar', `Int' } -> `Int' #} flcColorChooser :: T.Text -> ColorChooserRGB -> Maybe ColorChooserMode ->@@ -310,7 +311,7 @@ poke r''Ptr $ realToFrac r'' poke g''Ptr $ realToFrac g'' poke b''Ptr $ realToFrac b''- ret <- flc_color_chooser_with_m' name r''Ptr g''Ptr b''Ptr (maybe (-1) fromEnum mode)+ ret <- copyTextToCString name >>= \n' -> flc_color_chooser_with_m' n' r''Ptr g''Ptr b''Ptr (maybe (-1) fromEnum mode) if (ret == 0) then return Nothing else do@@ -328,7 +329,7 @@ poke r''Ptr (fromIntegral r) poke g''Ptr (fromIntegral g) poke b''Ptr (fromIntegral b)- ret <- flc_color_chooser_with_uchar_m' name r''Ptr g''Ptr b''Ptr (maybe (-1) fromEnum mode)+ ret <- copyTextToCString name >>= \n' -> flc_color_chooser_with_uchar_m' n' r''Ptr g''Ptr b''Ptr (maybe (-1) fromEnum mode) if (ret == 0) then return Nothing else do
src/Graphics/UI/FLTK/LowLevel/Counter.chs view
@@ -37,7 +37,7 @@ #endc {#enum CounterType {} deriving (Show, Eq) #} -{# fun Fl_OverriddenCounter_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenCounter_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenCounter_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} counterCustom :: Rectangle -- ^ The bounds of this Counter@@ -56,7 +56,7 @@ {# fun Fl_Counter_New as counterNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Counter_New_WithLabel as counterNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Counter_New_WithLabel as counterNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} counterNew :: Rectangle -> Maybe T.Text -> IO (Ref Counter) counterNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/Dial.chs view
@@ -37,7 +37,7 @@ #endc {#enum DialType {} deriving (Show, Eq) #} -{# fun Fl_OverriddenDial_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenDial_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenDial_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} dialCustom :: Rectangle -- ^ The bounds of this Dial@@ -55,7 +55,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Dial_New as dialNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Dial_New_WithLabel as dialNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Dial_New_WithLabel as dialNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} dialNew :: Rectangle -> Maybe T.Text -> IO (Ref Dial) dialNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/DoubleWindow.chs view
@@ -28,8 +28,8 @@ {# 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 #}-{# fun Fl_OverriddenDouble_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenDouble_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenDouble_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenDouble_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} doubleWindowCustom :: Size -- ^ Size of this window -> Maybe Position -- ^ Optional position of this window -> Maybe T.Text -- ^ Optional label
src/Graphics/UI/FLTK/LowLevel/Draw.chs view
@@ -225,9 +225,8 @@ joinStyleMask = case style of { LineDrawStyle _ _ (Just s) -> fromEnum s; LineDrawStyle _ _ Nothing -> 0} styleMask = lineStyleMask + capStyleMask + joinStyleMask _width = case width' of { Just (Width w) -> w ; _ -> 0 }- in do- _dashes <- maybe (return nullPtr) copyTextToCString dashes'- flcLineStyleWithWidthDashes' styleMask _width _dashes+ cCall = flcLineStyleWithWidthDashes' styleMask _width+ in maybe (cCall nullPtr) (\t -> withText t cCall) dashes' {# fun flc_rect as flcRect' { `Int',`Int',`Int',`Int' } -> `()' #} flcRect :: Rectangle -> IO ()@@ -442,53 +441,53 @@ flcDescent :: IO (Int) flcDescent = flcDescent' -{# fun flc_width as flcWidth' { unsafeToCString `T.Text' } -> `Double' #}+{# fun flc_width as flcWidth' { `CString' } -> `Double' #} flcWidth :: T.Text -> IO (PreciseWidth)-flcWidth txt = flcWidth' txt >>= return . PreciseWidth+flcWidth txt = withText txt ( \t -> flcWidth' t >>= return . PreciseWidth) {# fun flc_width_with_c as flcWidthWithC' { `Int' } -> `Double' #} flcWidthOfChar :: Int -> IO (PreciseWidth) flcWidthOfChar c = flcWidthWithC' c >>= return . PreciseWidth -{# fun flc_text_extents as flcTextExtents' { unsafeToCString `T.Text',alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv* } -> `()' #}+{# fun flc_text_extents as flcTextExtents' { `CString',alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv*,alloca- `Int' peekIntConv* } -> `()' #} flcTextExtents :: T.Text -> IO (Rectangle)-flcTextExtents s = flcTextExtents' s >>= \(rectangle') -> return $ (toRectangle rectangle')+flcTextExtents s = withText s flcTextExtents' >>= \(rectangle') -> return $ (toRectangle rectangle') -{# fun flc_latin1_to_local as flcLatin1ToLocal' { unsafeToCString `T.Text' } -> `T.Text' unsafeFromCString #}+{# fun flc_latin1_to_local as flcLatin1ToLocal' { `CString' } -> `CString' #} flcLatin1ToLocal :: T.Text -> IO T.Text-flcLatin1ToLocal t = flcLatin1ToLocal' t+flcLatin1ToLocal t = withText t flcLatin1ToLocal' >>= cStringToText -{# fun flc_local_to_latin1 as flcLocalToLatin1' { unsafeToCString `T.Text' } -> `T.Text' unsafeFromCString #}+{# fun flc_local_to_latin1 as flcLocalToLatin1' { `CString' } -> `CString' #} flcLocalToLatin1 :: T.Text -> IO T.Text-flcLocalToLatin1 t = flcLocalToLatin1' t+flcLocalToLatin1 t = withText t flcLocalToLatin1' >>= cStringToText -{# fun flc_mac_roman_to_local as flcMacRomanToLocal' { unsafeToCString `T.Text' } -> `T.Text' unsafeFromCString #}+{# fun flc_mac_roman_to_local as flcMacRomanToLocal' { `CString' } -> `CString'#} flcMacRomanToLocal :: T.Text -> IO T.Text-flcMacRomanToLocal t = flcMacRomanToLocal' t+flcMacRomanToLocal t = withText t flcMacRomanToLocal' >>= cStringToText -{# fun flc_local_to_mac_roman as flcLocalToMacRoman' { unsafeToCString `T.Text' } -> `T.Text' unsafeFromCString #}+{# fun flc_local_to_mac_roman as flcLocalToMacRoman' { `CString' } -> `CString' #} flcLocalToMacRoman :: T.Text -> IO T.Text-flcLocalToMacRoman t = flcLocalToMacRoman' t+flcLocalToMacRoman t = withText t flcLocalToMacRoman' >>= cStringToText -{# fun flc_draw as flcDraw' { unsafeToCString `T.Text',`Int',`Int' } -> `()' #}+{# fun flc_draw as flcDraw' { `CString',`Int',`Int' } -> `()' #} flcDraw :: T.Text -> Position -> IO ()-flcDraw str (Position (X x_pos') (Y y_pos')) = flcDraw' str x_pos' y_pos'+flcDraw str (Position (X x_pos') (Y y_pos')) = withText str (\s -> flcDraw' s x_pos' y_pos') -{# fun flc_draw_with_angle as flcDrawWithAngle' { `Int',unsafeToCString `T.Text',`Int',`Int' } -> `()' #}+{# fun flc_draw_with_angle as flcDrawWithAngle' { `Int',`CString',`Int',`Int' } -> `()' #} flcDrawWithAngle :: Int -> T.Text -> Position -> IO ()-flcDrawWithAngle angle str (Position (X x_pos') (Y y_pos')) = flcDrawWithAngle' angle str x_pos' y_pos'+flcDrawWithAngle angle str (Position (X x_pos') (Y y_pos')) = withText str ( \s -> flcDrawWithAngle' angle s x_pos' y_pos') -{# fun flc_rtl_draw as flcRtlDraw' { unsafeToCString `T.Text',`Int',`Int',`Int' } -> `()' #}+{# fun flc_rtl_draw as flcRtlDraw' { `CString',`Int',`Int',`Int' } -> `()' #} flcRtlDraw :: T.Text -> Int -> Position -> IO ()-flcRtlDraw str n (Position (X x_pos') (Y y_pos')) = flcRtlDraw' str n x_pos' y_pos'+flcRtlDraw str n (Position (X x_pos') (Y y_pos')) = withText str (\s -> flcRtlDraw' s n x_pos' y_pos') -{# fun flc_measure_with_draw_symbols as flcMeasureWithDrawSymbols' { unsafeToCString `T.Text', id `Ptr CInt', id `Ptr CInt', `CInt' } -> `()' #}+{# fun flc_measure_with_draw_symbols as flcMeasureWithDrawSymbols' { `CString', id `Ptr CInt', id `Ptr CInt', `CInt' } -> `()' #} flcMeasure :: T.Text -> Maybe Width -> Bool -> IO (Size) flcMeasure str word_wrap draw_symbols = alloca $ \widthPtr' -> alloca $ \heightPtr' -> let doit = do- flcMeasureWithDrawSymbols' str widthPtr' heightPtr' (fromBool draw_symbols)+ withText str (\s -> flcMeasureWithDrawSymbols' s widthPtr' heightPtr' (fromBool draw_symbols)) w' <- peekIntConv widthPtr' h' <- peekIntConv heightPtr' return $ toSize (w',h')@@ -496,17 +495,16 @@ poke widthPtr' (maybe 0 (\(Width w) -> fromIntegral w) word_wrap) doit -{# fun flc_draw_with_img_draw_symbols as flcDrawWithImgDrawSymbols' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int',`Int', id `Ptr ()',`Bool' } -> `()' #}-{# fun flc_draw_with_callthis_img_draw_symbols as flcDrawWithCallthisImgDrawSymbols' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int',`Int', id `FunPtr DrawCallbackPrim', id `Ptr ()',`Bool' } -> `()' #}+{# fun flc_draw_with_img_draw_symbols as flcDrawWithImgDrawSymbols' { `CString',`Int',`Int',`Int',`Int',`Int', id `Ptr ()',`Bool' } -> `()' #}+{# fun flc_draw_with_callthis_img_draw_symbols as flcDrawWithCallthisImgDrawSymbols' { `CString',`Int',`Int',`Int',`Int',`Int', id `FunPtr DrawCallbackPrim', id `Ptr ()',`Bool' } -> `()' #} flcDrawInBoxWithImageReference' :: T.Text -> Rectangle -> Alignments -> Maybe DrawCallback -> Ptr () -> Maybe Bool -> IO () flcDrawInBoxWithImageReference' string' rectangle' align' draw_callback' image_ptr draw_flags' = let (x_pos', y_pos', width', height') = fromRectangle rectangle' in case draw_callback' of- Nothing -> flcDrawWithImgDrawSymbols' string' x_pos' y_pos' width' height' (alignmentsToInt align') image_ptr (maybe False id draw_flags')-+ Nothing -> withText string' (\s -> flcDrawWithImgDrawSymbols' s x_pos' y_pos' width' height' (alignmentsToInt align') image_ptr (maybe False id draw_flags')) Just c' -> do fptr <- toDrawCallback c'- flcDrawWithCallthisImgDrawSymbols' string' x_pos' y_pos' width' height' (alignmentsToInt align') fptr image_ptr (maybe False id draw_flags')+ withText string' (\s -> flcDrawWithCallthisImgDrawSymbols' s x_pos' y_pos' width' height' (alignmentsToInt align') fptr image_ptr (maybe False id draw_flags')) flcDrawInBoxWithImageReference :: (Parent a Image) => T.Text -> Rectangle -> Alignments -> Maybe DrawCallback -> Ref a -> Maybe Bool -> IO () flcDrawInBoxWithImageReference string' rectangle' align' draw_callback' image' draw_flags' = withRef image' $ \imagePtr' -> flcDrawInBoxWithImageReference' string' rectangle' align' draw_callback' imagePtr' draw_flags'@@ -515,13 +513,13 @@ flcDrawInBox string' rectangle' align' draw_callback' draw_flags' = flcDrawInBoxWithImageReference' string' rectangle' align' draw_callback' (castPtr nullPtr) draw_flags' -{# fun flc_frame as flcFrame' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int' } -> `()' #}+{# fun flc_frame as flcFrame' { `CString',`Int',`Int',`Int',`Int' } -> `()' #} flcFrame :: T.Text -> Rectangle -> IO ()-flcFrame s rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in flcFrame' s x_pos' y_pos' width' height'+flcFrame s rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withText s ( \s' -> flcFrame' s' x_pos' y_pos' width' height') -{# fun flc_frame2 as flcFrame2' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int' } -> `()' #}+{# fun flc_frame2 as flcFrame2' { `CString',`Int',`Int',`Int',`Int' } -> `()' #} flcFrame2 :: T.Text -> Rectangle -> IO ()-flcFrame2 s rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in flcFrame2' s x_pos' y_pos' width' height'+flcFrame2 s rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withText s ( \s' -> flcFrame2' s' x_pos' y_pos' width' height') {# fun flc_draw_box as flcDrawBox' { cFromEnum `Boxtype',`Int',`Int',`Int',`Int',cFromColor `Color' } -> `()' #} flcDrawBox :: Boxtype -> Rectangle -> Color -> IO ()@@ -621,14 +619,14 @@ )) ) -{# fun flc_shortcut_label as flcShortcutLabel' { `CInt' } -> `T.Text' unsafeFromCString #}+{# fun flc_shortcut_label as flcShortcutLabel' { `CInt' } -> `CString' #} flcShortcutLabel :: ShortcutKeySequence -> IO T.Text flcShortcutLabel (ShortcutKeySequence eventstates keytype) =- flcShortcutLabel' (keySequenceToCInt eventstates keytype)+ flcShortcutLabel' (keySequenceToCInt eventstates keytype) >>= cStringToText -{# fun flc_old_shortcut as flcOldShortcut' { unsafeToCString `T.Text' } -> `CInt' #}+{# fun flc_old_shortcut as flcOldShortcut' { `CString' } -> `CInt' #} flcOldShortcut :: T.Text -> IO (Maybe ShortcutKeySequence)-flcOldShortcut s = flcOldShortcut' s >>= return . cIntToKeySequence+flcOldShortcut s = withText s flcOldShortcut' >>= return . cIntToKeySequence {# fun flc_overlay_rect as flcOverlayRect' { `Int',`Int',`Int',`Int' } -> `()' #} flcOverlayRect :: Rectangle -> IO ()@@ -670,12 +668,12 @@ flcResetSpot :: IO () flcResetSpot = flcResetSpot' -{# fun flc_draw_symbol as flcDrawSymbol' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int',cFromColor `Color' } -> `Int' #}+{# fun flc_draw_symbol as flcDrawSymbol' { `CString',`Int',`Int',`Int',`Int',cFromColor `Color' } -> `Int' #} flcDrawSymbol :: T.Text -> Rectangle -> Color -> IO (Either UnknownError ()) flcDrawSymbol label rectangle color' = let (x_pos', y_pos', width', height') = fromRectangle rectangle in do- res <- flcDrawSymbol' label x_pos' y_pos' width' height' color'+ res <- withText label (\l -> flcDrawSymbol' l x_pos' y_pos' width' height' color') if (res == 0) then return (Right ()) else return (Left UnknownError)
src/Graphics/UI/FLTK/LowLevel/FL.chs view
@@ -4,7 +4,6 @@ ( Option(..), ClipboardContents(..),- PasteSource(..), scrollbarSize, setScrollbarSize, selectionOwner,@@ -45,7 +44,6 @@ setPushed, setFocus, setHandler,- paste, toRectangle, fromRectangle, screenBounds,@@ -98,9 +96,14 @@ disableIm, pushed, focus,- copy,- copyWithDestination,- pasteWithSource,+ copyToClipboard,+ copyToSelectionBuffer,+ copyLengthToClipboard,+ copyLengthToSelectionBuffer,+ pasteImageFromSelectionBuffer,+ pasteFromSelectionBuffer,+ pasteImageFromClipboard,+ pasteFromClipboard, dnd, x, y,@@ -242,11 +245,6 @@ ClipboardContentsImage (Maybe (Ref Image)) | ClipboardContentsPlainText (Maybe T.Text) -data PasteSource =- PasteSourceSelectionBuffer- | PasteSourceClipboardPlainText- | PasteSourceClipboardImage- type EventDispatchPrim = (CInt -> Ptr () -> IO CInt)@@ -308,8 +306,9 @@ {# fun Fl_version as version {} -> `Double' #}-{# fun Fl_help as help- {} -> `T.Text' unsafeFromCString #}+{# fun Fl_help as help' {} -> `CString' #}+help :: IO T.Text+help = help' >>= cStringToText display :: T.Text -> IO () display text = TF.withCStringLen text $ \(str,_) -> {#call Fl_display as fl_display #} str@@ -345,8 +344,11 @@ (fromIntegral r) (fromIntegral g) (fromIntegral b)-{# fun pure Fl_scheme as getScheme- {} -> `T.Text' unsafeFromCString #}++{# fun pure Fl_scheme as getScheme' {} -> `CString' #}+getScheme :: IO T.Text+getScheme = cStringToText getScheme'+ setScheme :: T.Text -> IO Int setScheme sch = TF.withCStringLen sch $ \(str,_) -> {#call Fl_set_scheme as fl_set_scheme #} str >>= return . fromIntegral {# fun pure Fl_reload_scheme as reloadScheme {} -> `Int' #}@@ -364,8 +366,9 @@ {# fun Fl_set_scrollbar_size as setScrollbarSize { `Int' } -> `()' #} -{# fun Fl_readqueue as readqueue- { } -> `Maybe (Ref Widget)' unsafeToMaybeRef #}+{# fun Fl_readqueue as readqueue' { } -> `Ptr ()' #}+readqueue :: IO (Maybe (Ref Widget))+readqueue = readqueue' >>= toMaybeRef {# fun Fl_add_timeout as addTimeout { `Double', unsafeToCallbackPrim `GlobalCallback' } -> `()' supressWarningAboutRes #} {# fun Fl_repeat_timeout as repeatTimeout@@ -392,22 +395,27 @@ { } -> `()' supressWarningAboutRes #} {# fun Fl_flush as flush { } -> `()' supressWarningAboutRes #}-{# fun Fl_first_window as firstWindow- { } -> `Maybe (Ref Window)' unsafeToMaybeRef #}+{# fun Fl_first_window as firstWindow' { } -> `Ptr ()' #}+firstWindow :: IO (Maybe (Ref Window))+firstWindow = firstWindow' >>= toMaybeRef+ {# fun Fl_set_first_window as setFirstWindow' { id `Ptr ()' } -> `()' supressWarningAboutRes #} setFirstWindow :: (Parent a Window) => Ref a -> IO () setFirstWindow wp = withRef wp setFirstWindow'-{# fun Fl_next_window as nextWindow'- { id `Ptr ()' } -> `Maybe (Ref Window)' unsafeToMaybeRef #}-nextWindow :: (Parent a Window) => Ref a -> IO (Maybe (Ref Window))-nextWindow currWindow =- withRef currWindow nextWindow'-{# fun Fl_modal as modal- { } -> `Maybe (Ref Window)' unsafeToMaybeRef #}-{# fun Fl_grab as grab- { } -> `Maybe (Ref Window)' unsafeToMaybeRef #}+{# fun Fl_next_window as nextWindow' { id `Ptr ()' } -> `Ptr ()' #}+nextWindow :: Ref a -> IO (Maybe (Ref Window))+nextWindow currWindow = withRef currWindow (\ptr -> nextWindow' ptr >>= toMaybeRef)++{# fun Fl_modal as modal' { } -> `Ptr ()' #}+modal :: IO (Maybe (Ref Widget))+modal = modal' >>= toMaybeRef++{# fun Fl_grab as grab' { } -> `Ptr ()' #}+grab :: IO (Maybe (Ref Widget))+grab = grab' >>= toMaybeRef+ {# fun Fl_set_grab as setGrab' { id `Ptr ()' } -> `()' supressWarningAboutRes #} setGrab :: (Parent a Window) => Ref a -> IO ()@@ -503,16 +511,17 @@ {cFromKeyType `KeyType' } -> `Bool' toBool #} {# fun Fl_get_key as getKey {cFromKeyType `KeyType' } -> `Bool' toBool #}-{# fun Fl_event_text as eventText- { } -> `T.Text' unsafeFromCString #}+{# fun Fl_event_text as eventText' { } -> `CString' #}+eventText :: IO T.Text+eventText = eventText' >>= cStringToText {# fun Fl_event_length as eventLength { } -> `Int' #} {# fun Fl_event_clipboard as flEventClipboard' { } -> `Ptr ()' #}-{# fun Fl_event_clipboard_type as flEventClipboardType' { } -> `T.Text' unsafeFromCString #}+{# fun Fl_event_clipboard_type as flEventClipboardType' { } -> `CString' #} eventClipboardContents :: IO (Maybe ClipboardContents) eventClipboardContents = do- typeString <- flEventClipboardType'+ typeString <- flEventClipboardType' >>= cStringToText if (T.length typeString == 0) then return Nothing else case typeString of@@ -566,8 +575,9 @@ handle_ :: (Parent a Window) => Event -> Ref a -> IO (Either UnknownEvent ()) handle_ e wp = withRef wp (handle_' (cFromEnum e)) >>= return . successOrUnknownEvent-{# fun Fl_belowmouse as belowmouse- { } -> `Maybe (Ref Widget)' unsafeToMaybeRef #}+{# fun Fl_belowmouse as belowmouse' { } -> `Ptr ()' #}+belowmouse :: IO (Maybe (Ref Widget))+belowmouse = belowmouse' >>= toMaybeRef {# fun Fl_set_belowmouse as setBelowmouse' { id `Ptr ()' } -> `()' supressWarningAboutRes #} setBelowmouse :: (Parent a Widget) => Ref a -> IO ()@@ -580,14 +590,16 @@ { id `Ptr ()' } -> `()' supressWarningAboutRes #} setPushed :: (Parent a Widget) => Ref a -> IO () setPushed wp = withRef wp setPushed'-{# fun Fl_focus as focus- { } -> `Maybe (Ref Widget)' unsafeToMaybeRef #}+{# fun Fl_focus as focus' { } -> `Ptr ()' #}+focus :: IO (Maybe (Ref Widget))+focus = focus' >>= toMaybeRef {# fun Fl_set_focus as setFocus' { id `Ptr ()' } -> `()' supressWarningAboutRes #} setFocus :: (Parent a Widget) => Ref a -> IO () setFocus wp = withRef wp setFocus'-{# fun Fl_selection_owner as selectionOwner- { } -> `Maybe (Ref Widget)' unsafeToMaybeRef #}+{# fun Fl_selection_owner as selectionOwner' { } -> `Ptr ()' #}+selectionOwner :: IO (Maybe (Ref Widget))+selectionOwner = selectionOwner' >>= toMaybeRef {# fun Fl_set_selection_owner as setSelection_Owner' { id `Ptr ()' } -> `()' supressWarningAboutRes #} setSelectionOwner :: (Parent a Widget) => Ref a -> IO ()@@ -644,21 +656,36 @@ ptrToCallbackPtr <- new callbackPtr poke ptrToCallbackPtr callbackPtr setEventDispatch' ptrToCallbackPtr-{# fun Fl_copy as copy- { unsafeToCString `T.Text',`Int' } -> `()' supressWarningAboutRes #}-{# fun Fl_copy_with_destination as copyWithDestination- { unsafeToCString `T.Text',`Int',`Int' } -> `()' supressWarningAboutRes #}-{# fun Fl_paste_with_source as pasteWithSource- { id `Ptr ()',`Int' } -> `()' supressWarningAboutRes #}-{# fun Fl_paste_with_source_type as pasteWithSourceType- { id `Ptr ()',`Int', unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}-paste :: (Parent a Widget) => Ref a -> PasteSource -> IO ()-paste widget PasteSourceSelectionBuffer = withRef widget (\widgetPtr -> pasteWithSource widgetPtr 0)-paste widget PasteSourceClipboardPlainText =- withRef widget (\widgetPtr -> pasteWithSourceType widgetPtr 1 (T.pack "Fl::clipboard_plain_text"))-paste widget PasteSourceClipboardImage =- withRef widget (\widgetPtr -> pasteWithSourceType widgetPtr 1 (T.pack "Fl::clipboard_image")) +{# fun Fl_copy as copy' { `CString',`Int' } -> `()' supressWarningAboutRes #}+copyToClipboard :: T.Text -> IO ()+copyToClipboard t = withText t (\s' -> copy' s' 0)++copyToSelectionBuffer :: T.Text -> IO ()+copyToSelectionBuffer t = withText t (\s' -> copy' s' 1)++{# fun Fl_copy_with_destination as copyWithDestination { `CString',`Int',`Int' } -> `()' supressWarningAboutRes #}++copyLengthToClipboard :: T.Text -> Int -> IO ()+copyLengthToClipboard t l = withText t (\s' -> copyWithDestination s' l 0)++copyLengthToSelectionBuffer :: T.Text -> Int -> IO ()+copyLengthToSelectionBuffer t l = withText t (\s' -> copyWithDestination s' l 1)++{# fun Fl_paste_with_source_type as pasteWithSourceType { id `Ptr ()',`Int', `CString' } -> `()' supressWarningAboutRes #}++pasteImageFromSelectionBuffer :: (Parent a Widget) => Ref a -> IO ()+pasteImageFromSelectionBuffer widget = withRef widget (\widgetPtr -> withText (T.pack "Fl::clipboard_image") (\t -> pasteWithSourceType widgetPtr 0 t))++pasteFromSelectionBuffer :: (Parent a Widget) => Ref a -> IO ()+pasteFromSelectionBuffer widget = withRef widget (\widgetPtr -> withText (T.pack "Fl::clipboard_plain_text") (\t -> pasteWithSourceType widgetPtr 0 t))++pasteImageFromClipboard :: (Parent a Widget) => Ref a -> IO ()+pasteImageFromClipboard widget = withRef widget (\widgetPtr -> withText (T.pack "Fl::clipboard_image") (\t -> pasteWithSourceType widgetPtr 1 t))++pasteFromClipboard :: (Parent a Widget) => Ref a -> IO ()+pasteFromClipboard widget = withRef widget (\widgetPtr -> withText (T.pack "Fl::clipboard_plain_text") (\t -> pasteWithSourceType widgetPtr 1 t))+ {# fun Fl_dnd as dnd { } -> `Int' #} {# fun Fl_x as x@@ -808,17 +835,22 @@ removeFromColormap (Just (Color overlay)) c = freeColorWithOverlay' c (fromIntegral overlay) removeFromColormap Nothing c = freeColor' c #endif-{# fun Fl_get_font as getFont- { cFromFont `Font' } -> `T.Text' unsafeFromCString #}-{# fun Fl_get_font_name_with_attributes as getFontNameWithAttributes'- { cFromFont `Font', alloca- `Maybe FontAttribute' toAttribute* } -> `T.Text' unsafeFromCString #}+{# fun Fl_get_font as getFont' { cFromFont `Font' } -> `CString' #}+getFont :: Font -> IO T.Text+getFont f = getFont' f >>= cStringToText++{# fun Fl_get_font_name_with_attributes as getFontNameWithAttributes' { cFromFont `Font', alloca- `Maybe FontAttribute' toAttribute* } -> `CString' #}+getFontName :: Font -> IO (T.Text, Maybe FontAttribute)+getFontName f = do+ (str, fa) <- getFontNameWithAttributes' f+ t <- cStringToText str+ return (t, fa)+ toAttribute :: Ptr CInt -> IO (Maybe FontAttribute) toAttribute ptr = do attributeCode <- peekIntConv ptr return $ cToFontAttribute attributeCode-getFontName :: Font -> IO (T.Text, Maybe FontAttribute)-getFontName f = getFontNameWithAttributes' f {# fun Fl_get_font_sizes as getFontSizes' { cFromFont `Font', id `Ptr (Ptr CInt)' } -> `CInt' #} getFontSizes :: Font -> IO [FontSize]@@ -838,8 +870,10 @@ [0 .. ((fromIntegral arrLength) - 1)] return (map FontSize sizes) -{# fun Fl_set_font_by_string as setFontToString- { cFromFont `Font', unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_set_font_by_string as setFontToString'+ { cFromFont `Font', `CString' } -> `()' supressWarningAboutRes #}+setFontToString :: Font -> T.Text -> IO ()+setFontToString f t = withText t (\t' -> setFontToString' f t') {# fun Fl_set_font_by_font as setFontToFont { cFromFont `Font',cFromFont `Font' } -> `()' supressWarningAboutRes #} {# fun Fl_set_fonts as setFonts'
src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs view
@@ -334,7 +334,7 @@ -- $LookAndFeel -- Now FLTKHS has a [themes--- package](https://hackage.haskell.org/package/fltkhs/docs/Graphics-UI-FLTK-Theme-Light.html)+-- package](https://hackage.haskell.org/package/fltkhs-themes/docs/Graphics-UI-FLTK-Theme-Light.html) -- which considerably improves look and feel. The documentation for this package -- still applies because the theme mostly just re-draws widgets to look a little -- nicer so the fundamentals of the API are not touched.
src/Graphics/UI/FLTK/LowLevel/FileBrowser.chs view
@@ -38,7 +38,7 @@ {# pointer *Fl_File_Sort_F as FileSortF #} -{# fun Fl_OverriddenFile_Browser_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenFile_Browser_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenFile_Browser_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} fileBrowserCustom :: Rectangle -- ^ The bounds of this FileBrowser@@ -56,7 +56,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_File_Browser_New as fileBrowserNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_File_Browser_New_WithLabel as fileBrowserNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_File_Browser_New_WithLabel as fileBrowserNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} fileBrowserNew :: Rectangle -> Maybe T.Text -> IO (Ref FileBrowser) fileBrowserNew rectangle l'= widgetMaker@@ -73,12 +73,12 @@ {# fun Fl_File_Browser_iconsize as iconsize' { id `Ptr ()' } -> `CUChar' id #} instance (impl ~ ( IO (CUChar))) => Op (GetIconsize ()) FileBrowser orig impl where runOp _ _ fileBrowser = withRef fileBrowser $ \fileBrowserPtr -> iconsize' fileBrowserPtr-{# fun Fl_File_Browser_set_filter as setFilter' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_File_Browser_set_filter as setFilter' { id `Ptr ()', `CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetFilter ()) FileBrowser orig impl where- runOp _ _ fileBrowser text = withRef fileBrowser $ \fileBrowserPtr -> setFilter' fileBrowserPtr text-{# fun Fl_File_Browser_filter as filter' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ fileBrowser text = withRef fileBrowser $ \fileBrowserPtr -> copyTextToCString text >>= setFilter' fileBrowserPtr+{# fun Fl_File_Browser_filter as filter' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetFilter ()) FileBrowser orig impl where- runOp _ _ fileBrowser = withRef fileBrowser $ \fileBrowserPtr -> filter' fileBrowserPtr+ runOp _ _ fileBrowser = withRef fileBrowser $ \fileBrowserPtr -> filter' fileBrowserPtr >>= cStringToText {# fun Fl_File_Browser_set_textsize as setTextsize' { id `Ptr ()', id `CInt' } -> `()' #} instance (impl ~ (FontSize -> IO ())) => Op (SetTextsize ()) FileBrowser orig impl where runOp _ _ fileBrowser (FontSize text) = withRef fileBrowser $ \fileBrowserPtr -> setTextsize' fileBrowserPtr text@@ -91,10 +91,10 @@ {# fun Fl_File_Browser_filetype as filetype' { id `Ptr ()' } -> `Word8' #} instance (impl ~ IO (FileBrowserType)) => Op (GetFiletype ()) FileBrowser orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> filetype' widgetPtr >>= return . toEnum . fromInteger . toInteger-{# fun Fl_File_Browser_load as load' { id `Ptr ()', unsafeToCString `T.Text', id `FileSortF' } -> `CInt' id #}+{# fun Fl_File_Browser_load as load' { id `Ptr ()', `CString', id `FileSortF' } -> `CInt' id #} instance (impl ~ (T.Text -> FileSortF -> IO (Either UnknownError ()))) => Op (Load ()) FileBrowser orig impl where runOp _ _ widget dir sortF = withRef widget $ \widgetPtr -> do- status <- load' widgetPtr dir sortF+ status <- copyTextToCString dir >>= \d -> load' widgetPtr d sortF return (if (status == 0) then (Left UnknownError) else (Right ())) {# fun Fl_File_Browser_draw as draw'' { id `Ptr ()' } -> `()' #}
src/Graphics/UI/FLTK/LowLevel/FileInput.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenFile_Input_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenFile_Input_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenFile_Input_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} fileInputCustom :: Rectangle -- ^ The bounds of this FileInput@@ -44,7 +44,7 @@ {# fun Fl_File_Input_New as fileInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_File_Input_New_WithLabel as fileInputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_File_Input_New_WithLabel as fileInputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} fileInputNew :: Rectangle -> Maybe T.Text -> IO (Ref FileInput) fileInputNew rectangle l' = widgetMaker@@ -67,12 +67,12 @@ {# fun Fl_File_Input_set_errorcolor as setErrorColor' { id `Ptr ()',cFromColor `Color' } -> `()' #} instance (impl ~ (Color -> IO ())) => Op (SetErrorColor ()) FileInput orig impl where runOp _ _ fileInput b = withRef fileInput $ \fileInputPtr -> setErrorColor' fileInputPtr b-{# fun Fl_File_Input_set_value as setValue' { id `Ptr ()', unsafeToCString `T.Text'} -> `()' #}+{# fun Fl_File_Input_set_value as setValue' { id `Ptr ()', `CString'} -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetValue ()) FileInput orig impl where- runOp _ _ fileInput s = withRef fileInput $ \fileInputPtr -> setValue' fileInputPtr s-{# fun Fl_File_Input_value as getValue' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ fileInput s = withRef fileInput $ \fileInputPtr -> copyTextToCString s >>= setValue' fileInputPtr+{# fun Fl_File_Input_value as getValue' { id `Ptr ()' } -> `CString' #} instance (impl ~ (IO T.Text)) => Op (GetValue ()) FileInput orig impl where- runOp _ _ fileInput = withRef fileInput $ \fileInputPtr -> getValue' fileInputPtr+ runOp _ _ fileInput = withRef fileInput $ \fileInputPtr -> getValue' fileInputPtr >>= cStringToText {# fun Fl_File_Input_draw as draw'' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Draw ()) FileInput orig impl where runOp _ _ fileInput = withRef fileInput $ \fileInputPtr -> draw'' fileInputPtr
src/Graphics/UI/FLTK/LowLevel/FillDial.chs view
@@ -16,12 +16,12 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget-{# fun Fl_Fill_Dial_New as fillDialNew' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_Fill_Dial_New as fillDialNew' { `Int',`Int',`Int',`Int', `CString' } -> `Ptr ()' id #} fillDialNew :: Rectangle -> T.Text -> IO (Ref FillDial) fillDialNew rectangle l'= let (x_pos, y_pos, width, height) = fromRectangle rectangle in do- ref <- fillDialNew' x_pos y_pos width height l' >>= toRef+ ref <- copyTextToCString l' >>= \l'' -> fillDialNew' x_pos y_pos width height l'' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/FillSlider.chs view
@@ -19,14 +19,14 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget {# fun Fl_Fill_Slider_New as fillSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Fill_Slider_New_WithLabel as fillSliderNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Fill_Slider_New_WithLabel as fillSliderNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} fillSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref FillSlider) fillSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> fillSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- fillSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> fillSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/GIFImage.chs view
@@ -18,10 +18,10 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.Text as T-{# fun Fl_GIF_Image_New as gifImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_GIF_Image_New as gifImageNew' { `CString' } -> `Ptr ()' id #} gifImageNew :: T.Text -> IO (Either UnknownError (Ref GIFImage)) gifImageNew filename' = do- ptr <- gifImageNew' filename'+ ptr <- withText filename' gifImageNew' ref' <- (toRef ptr :: IO (Ref GIFImage)) checkImage ref'
src/Graphics/UI/FLTK/LowLevel/Gl.chs view
@@ -46,41 +46,41 @@ glFont :: Font -> FontSize -> IO () glFont fontid (FontSize size) = flcGlFont' fontid size -{# fun flc_gl_width as flcGlWidth' { unsafeToCString `T.Text' } -> `Double' #}+{# fun flc_gl_width as flcGlWidth' { `CString' } -> `Double' #} glWidth :: T.Text -> IO (Double)-glWidth str = flcGlWidth' str+glWidth str = withText str flcGlWidth' -{# fun flc_gl_width_with_n as flcGlWidthWithN' { unsafeToCString `T.Text',`Int' } -> `Double' #}+{# fun flc_gl_width_with_n as flcGlWidthWithN' { `CString',`Int' } -> `Double' #} glWidthChars :: T.Text -> Int -> IO (Double)-glWidthChars str n = flcGlWidthWithN' str n+glWidthChars str n = withText str (\s -> flcGlWidthWithN' s n) {# fun flc_gl_width_with_uchar_str as flcGlWidthWithUcharStr' { castCharToCUChar `Char' } -> `Double' #} glWidthChar :: Char -> IO (Double) glWidthChar str = flcGlWidthWithUcharStr' str -{# fun flc_gl_draw as flcGlDraw' { unsafeToCString `T.Text' } -> `()' #}+{# fun flc_gl_draw as flcGlDraw' { `CString' } -> `()' #} glDraw :: T.Text -> IO ()-glDraw str = flcGlDraw' str+glDraw str = withText str flcGlDraw' -{# fun flc_gl_draw_with_n as flcGlDrawWithN' { unsafeToCString `T.Text',`Int' } -> `()' #}+{# fun flc_gl_draw_with_n as flcGlDrawWithN' { `CString',`Int' } -> `()' #} glDrawChars :: T.Text -> Int -> IO ()-glDrawChars str n = flcGlDrawWithN' str n+glDrawChars str n = withText str (\s -> flcGlDrawWithN' s n) -{# fun flc_gl_draw_with_xy as flcGlDrawWithXy' { unsafeToCString `T.Text',`Float',`Float' } -> `()' #}+{# fun flc_gl_draw_with_xy as flcGlDrawWithXy' { `CString',`Float',`Float' } -> `()' #} glDrawAt :: T.Text -> Float -> Float -> IO ()-glDrawAt str x y = flcGlDrawWithXy' str x y+glDrawAt str x y = withText str (\s -> flcGlDrawWithXy' s x y) -{# fun flc_gl_draw_with_nxy as flcGlDrawWithNxy' { unsafeToCString `T.Text',`Int',`Float',`Float' } -> `()' #}+{# fun flc_gl_draw_with_nxy as flcGlDrawWithNxy' { `CString',`Int',`Float',`Float' } -> `()' #} glDrawCharsAt :: T.Text -> Int -> Float -> Float -> IO ()-glDrawCharsAt str n x y = flcGlDrawWithNxy' str n x y+glDrawCharsAt str n x y = withText str (\s -> flcGlDrawWithNxy' s n x y) -{# fun flc_gl_draw_with_xywh_align as flcGlDrawWithXywhAlign' { unsafeToCString `T.Text',`Int',`Int',`Int',`Int',cFromEnum `AlignType' } -> `()' #}+{# fun flc_gl_draw_with_xywh_align as flcGlDrawWithXywhAlign' { `CString',`Int',`Int',`Int',`Int',cFromEnum `AlignType' } -> `()' #} glDrawInBox :: T.Text -> Rectangle -> AlignType -> IO ()-glDrawInBox str rectangle align = let (x_pos', y_pos', width', height') = fromRectangle rectangle in flcGlDrawWithXywhAlign' str x_pos' y_pos' width' height' align+glDrawInBox str rectangle align = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withText str (\s -> flcGlDrawWithXywhAlign' s x_pos' y_pos' width' height' align) -{# fun flc_gl_measure as flcGlMeasure' { unsafeToCString `T.Text',`Int',`Int' } -> `()' #}+{# fun flc_gl_measure as flcGlMeasure' { `CString',`Int',`Int' } -> `()' #} glMeasure :: T.Text -> Position -> IO ()-glMeasure str (Position (X x_pos') (Y y_pos')) = flcGlMeasure' str x_pos' y_pos'+glMeasure str (Position (X x_pos') (Y y_pos')) = withText str (\s -> flcGlMeasure' s x_pos' y_pos') {# fun flc_gl_draw_image_with_d_ld as flcGlDrawImageWithDLd' { id `Ptr CUChar',`Int',`Int',`Int',`Int',`Int', `Int'} -> `()' #} glDrawImage :: BitmapHs -> Position -> Maybe Depth -> Maybe LineSize -> IO ()
src/Graphics/UI/FLTK/LowLevel/GlWindow.chs view
@@ -29,8 +29,8 @@ {# fun Fl_OverriddenGl_Window_New as overriddenWindowNew' {`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenGl_Window_NewXY as overriddenWindowNewXY' {`Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenGl_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenGl_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenGl_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenGl_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} glWindowCustom :: Size -- ^ The size of this window -> Maybe Position -- ^ The position of this window -> Maybe T.Text -- ^ The window label@@ -131,9 +131,9 @@ {# fun Fl_Gl_Window_set_mode as setMode' { id `Ptr ()',`Int' } -> `Int' #} instance (impl ~ (Modes -> IO ())) => Op (SetMode ()) GlWindow orig impl where runOp _ _ win a = withRef win $ \winPtr -> setMode' winPtr (modesToInt a) >> return ()-{# fun Fl_Gl_Window_context as context' { id `Ptr ()' } -> `Ref FlGlContext' unsafeToRef #}+{# fun Fl_Gl_Window_context as context' { id `Ptr ()' } -> `Ptr ()' unsafeToRef #} instance (impl ~ ( IO (Ref FlGlContext))) => Op (GetContext ()) GlWindow orig impl where- runOp _ _ win = withRef win $ \winPtr -> context' winPtr+ runOp _ _ win = withRef win $ \winPtr -> context' winPtr >>= toRef {# fun Fl_Gl_Window_set_context as setContext' { id `Ptr ()',id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ ( Ref FlGlContext -> IO ())) => Op (SetContext ()) GlWindow orig impl where runOp _ _ win context = withRef win $ \winPtr -> withRef context $ \contextPtr -> setContext' winPtr contextPtr
src/Graphics/UI/FLTK/LowLevel/Glut.chs view
@@ -403,7 +403,9 @@ glutInitWindowSize :: Size -> IO () glutInitWindowSize (Size (Width w) (Height h)) = glutInitWindowSize' (fromIntegral w) (fromIntegral h) {# fun flc_glutMainLoop as glutMainLoop { } -> `()' #}-{# fun flc_glutCreateWindow as glutCreateWindow {unsafeToCString `T.Text'} -> `GlutWindow' GlutWindow #}+{# fun flc_glutCreateWindow as glutCreateWindow' {`CString'} -> `GlutWindow' GlutWindow #}+glutCreateWindow :: T.Text -> IO ()+glutCreateWindow t = copyTextToCString t >>= glutCreateWindow' {# fun flc_glutCreateSubWindow as glutCreateSubWindow' {windowNumber `GlutWindow',`Int',`Int',`Int',`Int'} -> `GlutWindow' GlutWindow #} glutCreateSubWindow :: GlutWindow -> Rectangle -> IO GlutWindow glutCreateSubWindow glutWindow (Rectangle (Position (X x) (Y y)) (Size (Width w) (Height h))) =@@ -414,8 +416,12 @@ {# fun flc_glutSwapBuffers as glutSwapBuffers { } -> `()' #} {# fun flc_glutGetWindow as glutGetWindow { } -> `GlutWindow' GlutWindow #} {# fun flc_glutSetWindow as glutSetWindow {windowNumber `GlutWindow' } -> `()' #}-{# fun flc_glutSetWindowTitle as glutSetWindowTitle {unsafeToCString `T.Text' } -> `()' #}-{# fun flc_glutSetIconTitle as glutSetIconTitle {unsafeToCString `T.Text' } -> `()' #}+{# fun flc_glutSetWindowTitle as glutSetWindowTitle' {`CString' } -> `()' #}+glutSetWindowTitle :: T.Text -> IO ()+glutSetWindowTitle t = copyTextToCString t >>= glutSetWindowTitle'+{# fun flc_glutSetIconTitle as glutSetIconTitle' {`CString' } -> `()' #}+glutSetIconTitle :: T.Text -> IO ()+glutSetIconTitle t = copyTextToCString t >>= glutSetIconTitle' {# fun flc_glutPositionWindow as glutPositionWindow' {`Int', `Int' } -> `()' #} glutPositionWindow :: Position -> IO () glutPositionWindow (Position (X x) (Y y)) = glutPositionWindow' x y@@ -444,14 +450,20 @@ {# fun flc_glutDestroyMenu as glutDestroyMenu {menuNumber `GlutMenu'} -> `()' #} {# fun flc_glutGetMenu as glutGetMenu { } -> `GlutMenu' GlutMenu #} {# fun flc_glutSetMenu as glutSetMenu {menuNumber `GlutMenu'} -> `()' #}-{# fun flc_glutAddMenuEntry as glutAddMenuEntry' {unsafeToCString `T.Text', `Int' } -> `()' #}+{# fun flc_glutAddMenuEntry as glutAddMenuEntry' {`CString', `Int' } -> `()' #} glutAddMenuEntry :: T.Text -> IO ()-glutAddMenuEntry l = glutAddMenuEntry' l 0-{# fun flc_glutAddSubMenu as glutAddSubMenu {unsafeToCString `T.Text', menuNumber `GlutMenu' } -> `()' #}-{# fun flc_glutChangeToMenuEntry as glutChangeToMenuEntry' {`Int', unsafeToCString `T.Text', `Int'} -> `()' #}+glutAddMenuEntry l = copyTextToCString l >>= \l' -> glutAddMenuEntry' l' 0+{# fun flc_glutAddSubMenu as glutAddSubMenu' {`CString', menuNumber `GlutMenu' } -> `()' #}+glutAddSubMenu :: T.Text -> GlutMenu -> IO ()+glutAddSubMenu t mn = copyTextToCString t >>= \t' -> glutAddSubMenu' t' mn+{# fun flc_glutChangeToMenuEntry as glutChangeToMenuEntry'' {`Int', `CString', `Int'} -> `()' #}+glutChangeToMenuEntry :: Int -> T.Text -> Int -> IO ()+glutChangeToMenuEntry i t v = copyTextToCString t >>= \t' -> glutChangeToMenuEntry' i t' v glutChangeToMenuEntry :: Int -> T.Text -> IO () glutChangeToMenuEntry index label = glutChangeToMenuEntry' index label 0-{# fun flc_glutChangeToSubMenu as glutChangeToSubMenu {`Int', unsafeToCString `T.Text', menuNumber `GlutMenu' } -> `()' #}+{# fun flc_glutChangeToSubMenu as glutChangeToSubMenu' {`Int', `CString', menuNumber `GlutMenu' } -> `()' #}+glutChangeToSubMenu :: T.Text -> GlutMenu -> IO ()+glutChangeToSubMenu t m = copyTextToCString t >>= \t' -> glutChangeToSubMenu' t' m {# fun flc_glutRemoveMenuItem as glutRemoveMenuItem {`Int' } -> `()' #} {# fun flc_glutAttachMenu as glutAttachMenu {menuNumber `GlutMenu'} -> `()' #} {# fun flc_glutDetachMenu as glutDetachMenu {menuNumber `GlutMenu'} -> `()' #}
src/Graphics/UI/FLTK/LowLevel/Group.chs view
@@ -40,7 +40,7 @@ groupCurrent = groupCurrent' >>= toMaybeRef {# fun Fl_Group_New as groupNew' { `Int',`Int', `Int', `Int'} -> `Ptr ()' id #}-{# fun Fl_Group_New_WithLabel as groupNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Group_New_WithLabel as groupNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} groupNew :: Rectangle -> Maybe T.Text -> IO (Ref Group) groupNew rectangle label' = widgetMaker@@ -51,7 +51,7 @@ overriddenGroupNew' overriddenGroupNewWithLabel' -{# fun Fl_OverriddenGroup_New_WithLabel as overriddenGroupNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenGroup_New_WithLabel as overriddenGroupNewWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenGroup_New as overriddenGroupNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} groupCustom :: Rectangle -> Maybe T.Text -> Maybe (Ref Group -> IO ()) -> CustomWidgetFuncs Group -> IO (Ref Group) groupCustom rectangle l' draw' funcs' =
src/Graphics/UI/FLTK/LowLevel/HorFillSlider.chs view
@@ -19,7 +19,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget {# fun Fl_Hor_Fill_Slider_New as horFillSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Hor_Fill_Slider_New_WithLabel as horFillSliderNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Hor_Fill_Slider_New_WithLabel as horFillSliderNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} horFillSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref HorFillSlider) horFillSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle@@ -27,7 +27,7 @@ Nothing -> horFillSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- horFillSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> horFillSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/HorNiceSlider.chs view
@@ -19,15 +19,14 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Hor_Nice_Slider_New as horNiceSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Hor_Nice_Slider_New_WithLabel as horNiceSliderNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Hor_Nice_Slider_New_WithLabel as horNiceSliderNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} horNiceSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref HorNiceSlider) horNiceSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of- Nothing -> horNiceSliderNew' x_pos y_pos width height >>=- toRef+ Nothing -> horNiceSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- horNiceSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> horNiceSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/HorSlider.chs view
@@ -19,7 +19,7 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Hor_Slider_New as horSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Hor_Slider_New_WithLabel as horSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Hor_Slider_New_WithLabel as horSliderNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} horSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref HorSlider) horSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle@@ -27,7 +27,7 @@ Nothing -> horSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- horSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> horSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/HorValueSlider.chs view
@@ -19,7 +19,7 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Hor_Value_Slider_New as horValueSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Hor_Value_Slider_New_WithLabel as horValueSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Hor_Value_Slider_New_WithLabel as horValueSliderNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} horValueSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref HorValueSlider) horValueSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle@@ -27,7 +27,7 @@ Nothing -> horValueSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- horValueSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> horValueSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/Input.chs view
@@ -46,7 +46,7 @@ }; #endc {#enum FlInputType {}#}-{# fun Fl_OverriddenInput_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenInput_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenInput_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} inputCustom :: Rectangle -- ^ The bounds of this Input@@ -81,25 +81,25 @@ return i {# fun Fl_Input_New as inputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Input_New_WithLabel as inputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Input_New_WithLabel as inputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} {# fun Fl_Multiline_Input_New as multilineInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Multiline_Input_New_WithLabel as multilineInputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Multiline_Input_New_WithLabel as multilineInputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} {# fun Fl_Float_Input_New as floatInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Float_Input_New_WithLabel as floatInputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Float_Input_New_WithLabel as floatInputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} {# fun Fl_Int_Input_New as intInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Int_Input_New_WithLabel as intInputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Int_Input_New_WithLabel as intInputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} {# fun Fl_Secret_Input_New as secretInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Secret_Input_New_WithLabel as secretInputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Secret_Input_New_WithLabel as secretInputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} inputNew :: Rectangle -> Maybe T.Text -> Maybe FlInputType -> IO (Ref Input) inputNew rectangle l' flInputType = let (x_pos, y_pos, width, height) = fromRectangle rectangle constructor = case flInputType of- Just FlNormalInput -> maybe inputNew' (\l -> (\x y w h -> inputNewWithLabel' x y w h l)) l'- Just FlFloatInput -> maybe floatInputNew' (\l -> (\x y w h -> floatInputNewWithLabel' x y w h l)) l'- Just FlIntInput -> maybe intInputNew' (\l -> (\x y w h -> intInputNewWithLabel' x y w h l)) l'- Just FlMultilineInput -> maybe multilineInputNew' (\l -> (\x y w h -> multilineInputNewWithLabel' x y w h l)) l'- Just FlSecretInput -> maybe secretInputNew' (\l -> (\x y w h -> secretInputNewWithLabel' x y w h l)) l'- Just FlHiddenInput -> maybe inputNew' (\l -> (\x y w h -> inputNewWithLabel' x y w h l)) l'+ Just FlNormalInput -> maybe inputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> inputNewWithLabel' x y w h l')) l'+ Just FlFloatInput -> maybe floatInputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> floatInputNewWithLabel' x y w h l')) l'+ Just FlIntInput -> maybe intInputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> intInputNewWithLabel' x y w h l')) l'+ Just FlMultilineInput -> maybe multilineInputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> multilineInputNewWithLabel' x y w h l')) l'+ Just FlSecretInput -> maybe secretInputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> secretInputNewWithLabel' x y w h l')) l'+ Just FlHiddenInput -> maybe inputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> inputNewWithLabel' x y w h l')) l' Nothing -> inputNew' in do i <- constructor x_pos y_pos width height >>= toRef@@ -128,18 +128,18 @@ ) >>= return . successOrUnknownEvent -{# fun Fl_Input_set_value as setValue' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Input_set_value as setValue' { id `Ptr ()', `CString' } -> `Int' #} instance (impl ~ (T.Text -> IO (Either NoChange ()))) => Op (SetValue ()) Input orig impl where- runOp _ _ input text = withRef input $ \inputPtr -> setValue' inputPtr text >>= return . successOrNoChange+ runOp _ _ input text = withRef input $ \inputPtr -> copyTextToCString text >>= \t -> setValue' inputPtr t >>= return . successOrNoChange -{# fun Fl_Input_static_value as staticValue' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Input_static_value as staticValue' { id `Ptr ()', `CString' } -> `Int' #} instance (impl ~ (T.Text -> IO (Either NoChange ()))) => Op (StaticValue ()) Input orig impl where runOp _ _ input text = do- status' <- withRef input $ \inputPtr -> staticValue' inputPtr text+ status' <- withRef input $ \inputPtr -> copyTextToCString text >>= staticValue' inputPtr return $ successOrNoChange status'-{# fun Fl_Input_value as value' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Input_value as value' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetValue ()) Input orig impl where- runOp _ _ input = withRef input $ \inputPtr -> value' inputPtr+ runOp _ _ input = withRef input $ \inputPtr -> value' inputPtr >>= cStringToText {# fun Fl_Input_index as index' { id `Ptr ()',`Int' } -> `Int' #} instance (impl ~ (AtIndex -> IO (Char))) => Op (Index ()) Input orig impl where runOp _ _ input (AtIndex i) = withRef input $ \inputPtr -> index' inputPtr i >>= return . toEnum@@ -172,9 +172,9 @@ {# fun Fl_Input_set_mark as setMark' { id `Ptr ()',`Int' } -> `Int' #} instance (impl ~ (Int -> IO (Either NoChange ()))) => Op (SetMark ()) Input orig impl where runOp _ _ input m = withRef input $ \inputPtr -> setMark' inputPtr m >>= return . successOrNoChange-{# fun Fl_Input_replace as replace' { id `Ptr ()',`Int',`Int', unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Input_replace as replace' { id `Ptr ()',`Int',`Int', `CString' } -> `Int' #} instance (impl ~ (IndexRange -> T.Text -> IO (Either NoChange ()))) => Op (Replace ()) Input orig impl where- runOp _ _ input (IndexRange (AtIndex b) (AtIndex e)) text = withRef input $ \inputPtr -> replace' inputPtr b e text >>= return . successOrNoChange+ runOp _ _ input (IndexRange (AtIndex b) (AtIndex e)) text = withRef input $ \inputPtr -> copyTextToCString text >>= \t -> replace' inputPtr b e t >>= return . successOrNoChange {# fun Fl_Input_cut as cut' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (Either NoChange ()))) => Op (Cut ()) Input orig impl where runOp _ _ input = withRef input $ \inputPtr -> cut' inputPtr >>= return . successOrNoChange@@ -184,12 +184,12 @@ {# fun Fl_Input_cut_range as cutRange' { id `Ptr ()',`Int',`Int' } -> `Int' #} instance (impl ~ (IndexRange -> IO (Either NoChange ()))) => Op (CutRange ()) Input orig impl where runOp _ _ input (IndexRange (AtIndex a) (AtIndex b)) = withRef input $ \inputPtr -> cutRange' inputPtr a b >>= return . successOrNoChange-{# fun Fl_Input_insert as insert' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Input_insert as insert' { id `Ptr ()', `CString' } -> `Int' #} instance (impl ~ (T.Text -> IO (Either NoChange ()))) => Op (Insert ()) Input orig impl where- runOp _ _ input t = withRef input $ \inputPtr -> insert' inputPtr t >>= return . successOrNoChange-{# fun Fl_Input_insert_with_length as insertWithLength' { id `Ptr ()', unsafeToCString `T.Text',`Int' } -> `Int' #}+ runOp _ _ input t = withRef input $ \inputPtr -> copyTextToCString t >>= \t' -> insert' inputPtr t' >>= return . successOrNoChange+{# fun Fl_Input_insert_with_length as insertWithLength' { id `Ptr ()', `CString',`Int' } -> `Int' #} instance (impl ~ (T.Text -> Int -> IO (Either NoChange ()))) => Op (InsertWithLength ()) Input orig impl where- runOp _ _ input t l = withRef input $ \inputPtr -> insertWithLength' inputPtr t l >>= return . successOrNoChange+ runOp _ _ input t l = withRef input $ \inputPtr -> copyTextToCString t >>= \t' -> insertWithLength' inputPtr t' l >>= return . successOrNoChange {# fun Fl_Input_copy as copy' { id `Ptr ()',`Int' } -> `Int' #} instance (impl ~ (Clipboard -> IO (Either NoChange ()))) => Op (Copy ()) Input orig impl where runOp _ _ input clipboard = do
src/Graphics/UI/FLTK/LowLevel/JPEGImage.chs view
@@ -20,15 +20,16 @@ import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.ByteString as B import qualified Data.Text as T-{# fun Fl_JPEG_Image_New as jpegImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}-{# fun Fl_JPEG_Image_New_WithData as jpegImageNewWithData' { unsafeToCString `T.Text', id `Ptr CUChar' } -> `Ptr ()' id #}+{# fun Fl_JPEG_Image_New as jpegImageNew' { `CString' } -> `Ptr ()' id #}+{# fun Fl_JPEG_Image_New_WithData as jpegImageNewWithData' { `CString', id `Ptr CUChar' } -> `Ptr ()' id #} jpegImageNew :: T.Text -> IO (Either UnknownError (Ref JPEGImage))-jpegImageNew filename' = jpegImageNew' filename' >>= toRef >>= checkImage+jpegImageNew filename' = withText filename' jpegImageNew' >>= toRef >>= checkImage jpegImageNewWithData :: T.Text -> B.ByteString -> IO (Either UnknownError (Ref JPEGImage)) jpegImageNewWithData l' data' = do jpeg' <- copyByteStringToCString data'- jpegImageNewWithData' l' (castPtr jpeg') >>= toRef >>= checkImage+ labelString <- copyTextToCString l'+ jpegImageNewWithData' labelString (castPtr jpeg') >>= toRef >>= checkImage -- $hierarchy -- @
src/Graphics/UI/FLTK/LowLevel/LightButton.chs view
@@ -25,7 +25,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget-{# fun Fl_OverriddenLight_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenLight_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenLight_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} lightButtonCustom :: Rectangle -- ^ The bounds of this LightButton@@ -43,7 +43,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Light_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Light_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Light_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} lightButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref LightButton) lightButtonNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/LineDial.chs view
@@ -17,14 +17,14 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Line_Dial_New as lineDialNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Line_Dial_New_WithLabel as lineDialNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Line_Dial_New_WithLabel as lineDialNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} lineDialNew :: Rectangle -> Maybe T.Text -> IO (Ref LineDial) lineDialNew rectangle l'= let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> lineDialNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- lineDialNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> lineDialNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/MenuBar.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenMenu_Bar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenMenu_Bar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenMenu_Bar_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} menuBarCustom :: Rectangle -- ^ The bounds of this MenuBar@@ -44,7 +44,7 @@ {# 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 #}+{# fun Fl_Menu_Bar_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} menuBarNew :: Rectangle -> Maybe T.Text -> IO (Ref MenuBar) menuBarNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/MenuButton.chs view
@@ -40,7 +40,7 @@ }; #endc {#enum MenuButtonType {} deriving (Show, Eq) #}-{# fun Fl_OverriddenMenu_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenMenu_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenMenu_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} menuButtonCustom :: Rectangle -- ^ The bounds of this MenuButton@@ -59,7 +59,7 @@ {# fun Fl_Menu_Button_New as menuButtonNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Menu_Button_New_WithLabel as menuButtonNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Menu_Button_New_WithLabel as menuButtonNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} menuButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref MenuButton) menuButtonNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/MenuItem.chs view
@@ -75,17 +75,17 @@ instance (impl ~ IO (Maybe (Ref MenuItem))) => Op (GetFirst ()) MenuItem orig impl where runOp _ _ menu_item = withRef menu_item $ \menu_itemPtr -> first' menu_itemPtr >>=toMaybeRef -{# fun Fl_Menu_Item_label as label' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Menu_Item_label as label' { id `Ptr ()' } -> `CString' #} instance (impl ~ IO T.Text) => Op (GetLabel ()) MenuItem orig impl where- runOp _ _ menu_item = withRef menu_item $ \menu_itemPtr -> label' menu_itemPtr+ runOp _ _ menu_item = withRef menu_item $ \menu_itemPtr -> label' menu_itemPtr >>= cStringToText -{# fun Fl_Menu_Item_set_label as setLabel' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Menu_Item_set_label as setLabel' { id `Ptr ()', `CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetLabel ()) MenuItem orig impl where- runOp _ _ menu_item a = withRef menu_item $ \menu_itemPtr -> setLabel' menu_itemPtr a+ runOp _ _ menu_item a = withRef menu_item $ \menu_itemPtr -> copyTextToCString a >>= setLabel' menu_itemPtr -{# fun Fl_Menu_Item_set_label_with_labeltype as setLabelWithLabeltype' { id `Ptr ()',cFromEnum `Labeltype', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Menu_Item_set_label_with_labeltype as setLabelWithLabeltype' { id `Ptr ()',cFromEnum `Labeltype', `CString' } -> `()' #} instance (impl ~ (Labeltype -> T.Text -> IO ())) => Op (SetLabelWithLabeltype ()) MenuItem orig impl where- runOp _ _ menu_item labeltype b = withRef menu_item $ \menu_itemPtr -> setLabelWithLabeltype' menu_itemPtr labeltype b+ runOp _ _ menu_item labeltype b = withRef menu_item $ \menu_itemPtr -> copyTextToCString b >>= setLabelWithLabeltype' menu_itemPtr labeltype {# fun Fl_Menu_Item_labeltype as labeltype' { id `Ptr ()' } -> `Labeltype' cToEnum #} instance (impl ~ IO (Labeltype)) => Op (GetLabeltype ()) MenuItem orig impl where@@ -215,9 +215,9 @@ instance (impl ~ (MenuItemFlags -> IO ())) => Op (SetFlags ()) MenuItem orig impl where runOp _ _ menu_item flags = withRef menu_item $ \menu_itemPtr -> setFlags' menu_itemPtr (menuItemFlagsToInt flags) -{# fun Fl_Menu_Item_text as text' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Menu_Item_text as text' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetText ()) MenuItem orig impl where- runOp _ _ menu_item = withRef menu_item $ \menu_itemPtr -> text' menu_itemPtr+ runOp _ _ menu_item = withRef menu_item $ \menu_itemPtr -> text' menu_itemPtr >>= cStringToText {# fun Fl_Menu_Item_pulldown_with_args as pulldownWithArgs' { id `Ptr ()',`Int',`Int',`Int',`Int',id `Ptr ()', id `Ptr ()', id `Ptr ()', fromBool `Bool'} -> `Ptr ()' id #} instance (Parent a MenuPrim, Parent b MenuItem, Parent c MenuItem, impl ~ (Rectangle -> Maybe (Ref a) -> Maybe (Ref b) -> Maybe (Ref c) -> Maybe Bool -> IO (Maybe (Ref MenuItem)))) => Op (Pulldown ()) MenuItem orig impl where@@ -262,8 +262,8 @@ Maybe Shortcut -> Maybe (Ref menuItem -> IO ()) -> MenuItemFlags ->- (Ptr () -> T.Text -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->- (Ptr () -> T.Text -> T.Text -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->+ (Ptr () -> CString -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->+ (Ptr () -> CString -> CString -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex) addMenuItem refMenuOrMenuItem name shortcut cb flags addWithFlags addWithShortcutnameFlags = either@@ -277,34 +277,38 @@ ptr <- maybe (return (castPtrToFunPtr nullPtr)) toCallbackPrim cb idx' <- case shortcut of Just s' -> case s' of- KeySequence (ShortcutKeySequence modifiers char) ->+ KeySequence (ShortcutKeySequence modifiers char) -> do+ nameString <- copyTextToCString name addWithFlags menu_Ptr- name+ nameString (keySequenceToCInt modifiers char) (castFunPtr ptr) combinedFlags KeyFormat format' ->- if (not $ T.null format') then+ if (not $ T.null format') then do+ nameString <- copyTextToCString name+ formatString <- copyTextToCString format' addWithShortcutnameFlags- menu_Ptr- name- format'- (castFunPtr ptr)- combinedFlags+ menu_Ptr+ nameString+ formatString+ (castFunPtr ptr)+ combinedFlags else error errorMsg- Nothing ->+ Nothing -> do+ nameString <- copyTextToCString name addWithFlags menu_Ptr- name+ nameString 0 (castFunPtr ptr) combinedFlags return (AtIndex idx') -{# fun Fl_Menu_Item_insert_with_flags as insertWithFlags' { id `Ptr ()',`Int', unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}-{# fun Fl_Menu_Item_add_with_flags as addWithFlags' { id `Ptr ()', unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}-{# fun Fl_Menu_Item_add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', unsafeToCString `T.Text', unsafeToCString `T.Text',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Menu_Item_insert_with_flags as insertWithFlags' { id `Ptr ()',`Int', `CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}+{# fun Fl_Menu_Item_add_with_flags as addWithFlags' { id `Ptr ()', `CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}+{# fun Fl_Menu_Item_add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', `CString', `CString',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #} instance (Parent a MenuItem, impl ~ (T.Text -> Maybe Shortcut -> Maybe (Ref a -> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Add ()) MenuItem orig impl where runOp _ _ menu_item name shortcut cb flags = addMenuItem (Right menu_item) name shortcut cb flags addWithFlags' addWithShortcutnameFlags'@@ -316,10 +320,11 @@ shortcutCode = maybe 0 (\(ShortcutKeySequence modifiers char) -> keySequenceToCInt modifiers char ) ks in do ptr <- toCallbackPrim cb+ nameString <- copyTextToCString name idx' <- insertWithFlags' menu_itemPtr index'- name+ nameString shortcutCode (castFunPtr ptr) combinedFlags
src/Graphics/UI/FLTK/LowLevel/MenuPrim.chs view
@@ -32,8 +32,8 @@ import Control.Exception {# fun Fl_Menu__New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Menu__New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_OverriddenMenu__New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Menu__New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #}+{# fun Fl_OverriddenMenu__New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenMenu__New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} menu_Custom :: Rectangle -> Maybe T.Text -> Maybe (CustomWidgetFuncs MenuPrim) -> IO (Ref MenuPrim) menu_Custom rectangle l' funcs' =@@ -118,13 +118,13 @@ {# fun Fl_Menu__picked as picked' { id `Ptr ()',id `Ptr ()' } -> `Ptr ()' id #} instance (Parent a MenuItem, Parent b MenuItem, impl ~ (Ref a -> IO (Maybe (Ref b)))) => Op (Picked ()) MenuPrim orig impl where runOp _ _ menu_ item = withRef menu_ $ \menu_Ptr -> withRef item $ \itemPtr -> picked' menu_Ptr itemPtr >>= toMaybeRef-{# fun Fl_Menu__find_index_with_name as findIndexWithName' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Menu__find_index_with_name as findIndexWithName' { id `Ptr ()',`CString' } -> `Int' #} {# fun Fl_Menu__find_index_with_item as findIndexWithItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} instance (impl ~ (MenuItemLocator -> IO (Maybe Int))) => Op (FindIndex ()) MenuPrim orig impl where runOp _ _ menu_ menu_item_referene = withRef menu_ $ \menu_Ptr -> case menu_item_referene of- MenuItemNameLocator (MenuItemName name) -> findIndexWithName' menu_Ptr name >>= \r -> if (r == -1) then (return Nothing) else (return $ Just r)+ MenuItemNameLocator (MenuItemName name) -> withText name (\n -> findIndexWithName' menu_Ptr n >>= \r -> if (r == -1) then (return Nothing) else (return $ Just r)) MenuItemPointerLocator (MenuItemPointer menu_item) -> withRef menu_item $ \menu_itemPtr -> findIndexWithItem' menu_Ptr menu_itemPtr >>= \r -> if (r == -1) then (return Nothing) else (return $ Just r) {# fun Fl_Menu__test_shortcut as testShortcut' { id `Ptr ()' } -> `Ptr ()' id #}@@ -167,8 +167,8 @@ Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags ->- (Ptr () -> Int -> T.Text -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->- (Ptr () -> Int -> T.Text -> T.Text -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->+ (Ptr () -> Int -> CString -> CInt -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) ->+ (Ptr () -> Int -> CString -> CString -> FunPtr CallbackWithUserDataPrim -> Int -> IO Int) -> IO (AtIndex) insertMenuItem menu_ index' name shortcut cb flags insertWithFlags'' insertWithShortcutnameFlags'' = withRef menu_ $ \menu_Ptr -> do@@ -176,45 +176,49 @@ ptr <- toCallbackPrim cb idx' <- case shortcut of Just s' -> case s' of- KeySequence (ShortcutKeySequence modifiers char) ->+ KeySequence (ShortcutKeySequence modifiers char) -> do+ n <- copyTextToCString name insertWithFlags'' menu_Ptr index'- name+ n (keySequenceToCInt modifiers char) (castFunPtr ptr) combinedFlags- KeyFormat format' ->+ KeyFormat format' -> do+ f <- copyTextToCString format'+ n <- copyTextToCString name if (not $ T.null format') then insertWithShortcutnameFlags'' menu_Ptr index'- name- format'+ n+ f (castFunPtr ptr) combinedFlags else error "Fl_Menu_.menu_insert: shortcut format string cannot be empty"- Nothing ->+ Nothing -> do+ n <- copyTextToCString name insertWithFlags'' menu_Ptr index'- name+ n 0 (castFunPtr ptr) combinedFlags return (AtIndex idx') -{# fun Fl_Menu__insert_with_flags as insertWithFlags' { id `Ptr ()',`Int',unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}-{# fun Fl_Menu__insert_with_shortcutname_flags as insertWithShortcutnameFlags' { id `Ptr ()',`Int',unsafeToCString `T.Text', unsafeToCString `T.Text',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Menu__insert_with_flags as insertWithFlags' { id `Ptr ()',`Int',`CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}+{# fun Fl_Menu__insert_with_shortcutname_flags as insertWithShortcutnameFlags' { id `Ptr ()',`Int',`CString', `CString',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #} instance (Parent a MenuPrim, impl ~ ( AtIndex -> T.Text -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Insert ()) MenuPrim orig impl where runOp _ _ menu_ (AtIndex index') name shortcut cb flags = insertMenuItem menu_ index' name shortcut cb flags insertWithFlags' insertWithShortcutnameFlags' -{# fun Fl_Menu__add_with_name as add' { id `Ptr ()',unsafeToCString `T.Text'} -> `()' #}+{# fun Fl_Menu__add_with_name as add' { id `Ptr ()',`CString'} -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (AddName ()) MenuPrim orig impl where- runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> add' menu_Ptr name'-{# fun Fl_Menu__add_with_flags as addWithFlags' { id `Ptr ()',unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}-{# fun Fl_Menu__add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', unsafeToCString `T.Text', unsafeToCString `T.Text',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+ runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> copyTextToCString name' >>= add' menu_Ptr+{# fun Fl_Menu__add_with_flags as addWithFlags' { id `Ptr ()',`CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Menu__add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', `CString', `CString',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #} instance (Parent a MenuItem, impl ~ ( T.Text -> Maybe Shortcut -> Maybe (Ref a-> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Add ()) MenuPrim orig (impl) where runOp _ _ menu_ name shortcut cb flags = addMenuItem (Left menu_) name shortcut cb flags addWithFlags' addWithShortcutnameFlags'@@ -240,9 +244,9 @@ {# fun Fl_Menu__clear_submenu as clearSubmenu' { id `Ptr ()',`Int' } -> `Int' #} instance (impl ~ (AtIndex -> IO (Either OutOfRange ()))) => Op (ClearSubmenu ()) MenuPrim orig impl where runOp _ _ menu_ (AtIndex index') = withRef menu_ $ \menu_Ptr -> clearSubmenu' menu_Ptr index' >>= \ret' -> if ret' == -1 then return (Left OutOfRange) else return (Right ())-{# fun Fl_Menu__replace as replace' { id `Ptr ()',`Int', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Menu__replace as replace' { id `Ptr ()',`Int', `CString' } -> `()' #} instance (impl ~ (AtIndex -> T.Text -> IO ())) => Op (Replace ()) MenuPrim orig impl where- runOp _ _ menu_ (AtIndex index') name = withRef menu_ $ \menu_Ptr -> replace' menu_Ptr index' name+ runOp _ _ menu_ (AtIndex index') name = withRef menu_ $ \menu_Ptr -> copyTextToCString name >>= replace' menu_Ptr index' {# fun Fl_Menu__remove as remove' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (AtIndex -> IO ())) => Op (Remove ()) MenuPrim orig impl where runOp _ _ menu_ (AtIndex index') = withRef menu_ $ \menu_Ptr -> remove' menu_Ptr index'@@ -275,12 +279,12 @@ (MenuItemByPointer (MenuItemPointer menu_item)) -> withRef menu_item $ \menu_itemPtr -> valueWithItem' menu_Ptr menu_itemPtr >>= return . successOrNoChange-{# fun Fl_Menu__text as text' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Menu__text as text' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetText ()) MenuPrim orig impl where- runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> text' menu_Ptr-{# fun Fl_Menu__text_with_index as textWithIndex' { id `Ptr ()',`Int' } -> `T.Text' unsafeFromCString #}+ runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> text' menu_Ptr >>= cStringToText+{# fun Fl_Menu__text_with_index as textWithIndex' { id `Ptr ()',`Int' } -> `CString' #} instance (impl ~ (AtIndex -> IO T.Text)) => Op (GetTextWithIndex ()) MenuPrim orig impl where- runOp _ _ menu_ (AtIndex i) = withRef menu_ $ \menu_Ptr -> textWithIndex' menu_Ptr i+ runOp _ _ menu_ (AtIndex i) = withRef menu_ $ \menu_Ptr -> textWithIndex' menu_Ptr i >>= cStringToText {# fun Fl_Menu__textfont as textfont' { id `Ptr ()' } -> `Font' cToFont #} instance (impl ~ ( IO (Font))) => Op (GetTextfont ()) MenuPrim orig impl where runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> textfont' menu_Ptr
src/Graphics/UI/FLTK/LowLevel/NativeFileChooser.chs view
@@ -97,35 +97,35 @@ {# fun Fl_Native_File_Chooser_count as count' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (Int))) => Op (GetCount ()) NativeFileChooser orig impl where runOp _ _ chooser = withRef chooser $ \chooserPtr -> count' chooserPtr-{# fun Fl_Native_File_Chooser_filename as filename' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Native_File_Chooser_filename as filename' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetFilename ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> filename' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> filename' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_filename_with_i as filenameWithI' { id `Ptr ()',`Int' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Native_File_Chooser_filename_with_i as filenameWithI' { id `Ptr ()',`Int' } -> `CString' #} instance (impl ~ (AtIndex -> IO (Maybe T.Text))) => Op (GetFilenameAt ()) NativeFileChooser orig impl where- runOp _ _ chooser (AtIndex i) = withRef chooser $ \chooserPtr -> filenameWithI' chooserPtr i >>= \s ->+ runOp _ _ chooser (AtIndex i) = withRef chooser $ \chooserPtr -> filenameWithI' chooserPtr i >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_set_directory as setDirectory' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Native_File_Chooser_set_directory as setDirectory' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetDirectory ()) NativeFileChooser orig impl where- runOp _ _ chooser val = withRef chooser $ \chooserPtr -> setDirectory' chooserPtr val-{# fun Fl_Native_File_Chooser_directory as directory' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ chooser val = withRef chooser $ \chooserPtr -> copyTextToCString val >>= setDirectory' chooserPtr+{# fun Fl_Native_File_Chooser_directory as directory' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetDirectory ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> directory' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> directory' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_set_title as setTitle' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Native_File_Chooser_set_title as setTitle' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetTitle ()) NativeFileChooser orig impl where- runOp _ _ chooser title'' = withRef chooser $ \chooserPtr -> setTitle' chooserPtr title''-{# fun Fl_Native_File_Chooser_title as title' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ chooser title'' = withRef chooser $ \chooserPtr -> copyTextToCString title'' >>= setTitle' chooserPtr+{# fun Fl_Native_File_Chooser_title as title' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetTitle ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> title' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> title' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_filter as filter' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Native_File_Chooser_filter as filter' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetFilter ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> filter' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> filter' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_set_filter as setFilter' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Native_File_Chooser_set_filter as setFilter' { id `Ptr ()', `CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetFilter ()) NativeFileChooser orig impl where- runOp _ _ chooser filter'' = withRef chooser $ \chooserPtr -> setFilter' chooserPtr filter''+ runOp _ _ chooser filter'' = withRef chooser $ \chooserPtr -> copyTextToCString filter'' >>= setFilter' chooserPtr {# fun Fl_Native_File_Chooser_filters as filters' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (Int))) => Op (Filters ()) NativeFileChooser orig impl where runOp _ _ chooser = withRef chooser $ \chooserPtr -> filters' chooserPtr@@ -135,16 +135,16 @@ {# fun Fl_Native_File_Chooser_filter_value as filterValue' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (AtIndex))) => Op (GetFilterValue ()) NativeFileChooser orig impl where runOp _ _ chooser = withRef chooser $ \chooserPtr -> filterValue' chooserPtr >>= return . AtIndex-{# fun Fl_Native_File_Chooser_set_preset_file as setPresetFile' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Native_File_Chooser_set_preset_file as setPresetFile' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetPresetFile ()) NativeFileChooser orig impl where- runOp _ _ chooser preset' = withRef chooser $ \chooserPtr -> setPresetFile' chooserPtr preset'-{# fun Fl_Native_File_Chooser_preset_file as presetFile' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ chooser preset' = withRef chooser $ \chooserPtr -> copyTextToCString preset' >>= setPresetFile' chooserPtr+{# fun Fl_Native_File_Chooser_preset_file as presetFile' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetPresetFile ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> presetFile' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> presetFile' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s)-{# fun Fl_Native_File_Chooser_errmsg as errmsg' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Native_File_Chooser_errmsg as errmsg' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetErrmsg ()) NativeFileChooser orig impl where- runOp _ _ chooser = withRef chooser $ \chooserPtr -> errmsg' chooserPtr >>= \s ->+ runOp _ _ chooser = withRef chooser $ \chooserPtr -> errmsg' chooserPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s) {# fun Fl_Native_File_Chooser_show as show' { id `Ptr ()' } -> `Int' #} instance (impl ~ ( IO (NativeFileChooserUserAction))) => Op (ShowWidget ()) NativeFileChooser orig impl where
src/Graphics/UI/FLTK/LowLevel/NiceSlider.chs view
@@ -18,7 +18,7 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Nice_Slider_New as niceSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Nice_Slider_New_WithLabel as niceSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Nice_Slider_New_WithLabel as niceSliderNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} niceSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref NiceSlider) niceSliderNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle@@ -26,7 +26,7 @@ Nothing -> niceSliderNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- niceSliderNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> niceSliderNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/Output.chs view
@@ -36,7 +36,7 @@ FlMultilineOutput = FL_MULTILINE_OUTPUT }; #endc-{# fun Fl_OverriddenOutput_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenOutput_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenOutput_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} outputCustom :: Rectangle -- ^ The bounds of this Output@@ -56,15 +56,15 @@ {#enum FlOutputType {}#} {# fun Fl_Output_New as outputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Output_New_WithLabel as outputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Output_New_WithLabel as outputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} {# fun Fl_Multiline_Output_New as multilineOutputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Multiline_Output_New_WithLabel as multilineOutputNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Multiline_Output_New_WithLabel as multilineOutputNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} outputNew :: Rectangle -> Maybe T.Text -> Maybe FlOutputType -> IO (Ref Output) outputNew rectangle l' flOutputType = let (x_pos, y_pos, width, height) = fromRectangle rectangle constructor = case flOutputType of- Just FlNormalOutput -> maybe outputNew' (\l -> (\x y w h -> outputNewWithLabel' x y w h l)) l'- Just FlMultilineOutput -> maybe multilineOutputNew' (\l -> (\x y w h -> multilineOutputNewWithLabel' x y w h l)) l'+ Just FlNormalOutput -> maybe outputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> outputNewWithLabel' x y w h l')) l'+ Just FlMultilineOutput -> maybe multilineOutputNew' (\l -> (\x y w h -> copyTextToCString l >>= \l' -> multilineOutputNewWithLabel' x y w h l')) l' Nothing -> outputNew' in do ref <- constructor x_pos y_pos width height >>= toRef
src/Graphics/UI/FLTK/LowLevel/OverlayWindow.chs view
@@ -14,7 +14,7 @@ where #include "Fl_C.h" #include "Fl_Overlay_WindowC.h"-import Foreign+import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum) import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Hierarchy@@ -22,9 +22,9 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T -{# fun Fl_Overlay_Window_New_WithLabel as windowNewWithLabel' { `Int', `Int', unsafeToCString `T.Text', id `FunPtr CallbackPrim' } -> `Ptr ()' id #}+{# fun Fl_Overlay_Window_New_WithLabel as windowNewWithLabel' { `Int', `Int', `CString', id `FunPtr CallbackPrim' } -> `Ptr ()' id #} {# fun Fl_Overlay_Window_New as windowNew' { `Int', `Int', id `FunPtr CallbackPrim' } -> `Ptr ()' id #}-{# fun Fl_Overlay_Window_NewXY_WithLabel as windowNewWithXYLabel' { `Int', `Int', `Int', `Int', unsafeToCString `T.Text', id `FunPtr CallbackPrim' } -> `Ptr ()' id #}+{# fun Fl_Overlay_Window_NewXY_WithLabel as windowNewWithXYLabel' { `Int', `Int', `Int', `Int', `CString', id `FunPtr CallbackPrim' } -> `Ptr ()' id #} {# fun Fl_Overlay_Window_NewXY as windowNewWithXY' { `Int', `Int', `Int', `Int', id `FunPtr CallbackPrim' } -> `Ptr ()' id #} overlayWindowNew :: forall a. (Parent a OverlayWindow) => Size -> Maybe T.Text -> Maybe Position -> (Ref a -> IO ()) -> IO (Ref OverlayWindow)@@ -32,9 +32,9 @@ do fptr <- toCallbackPrim callback' ref <- case (title', position') of- (Just t, Just (Position (X x') (Y y'))) -> windowNewWithXYLabel' width' height' x' y' t fptr >>= toRef+ (Just t, Just (Position (X x') (Y y'))) -> copyTextToCString t >>= \t' -> windowNewWithXYLabel' width' height' x' y' t' fptr >>= toRef (Nothing, Just (Position (X x') (Y y'))) -> windowNewWithXY' width' height' x' y' fptr >>= toRef- (Just t, Nothing) -> windowNewWithLabel' width' height' t fptr >>= toRef+ (Just t, Nothing) -> copyTextToCString t >>= \t' -> windowNewWithLabel' width' height' t' fptr >>= toRef (Nothing, Nothing) -> windowNew' width' height' fptr >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip
src/Graphics/UI/FLTK/LowLevel/PNGImage.chs view
@@ -20,15 +20,15 @@ import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.ByteString as B import qualified Data.Text as T-{# fun Fl_PNG_Image_New as pngImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}-{# fun Fl_PNG_Image_New_WithData as pngImageNewWithData' { unsafeToCString `T.Text', id `Ptr CUChar', `Int' } -> `Ptr ()' id #}+{# fun Fl_PNG_Image_New as pngImageNew' { `CString' } -> `Ptr ()' id #}+{# fun Fl_PNG_Image_New_WithData as pngImageNewWithData' { `CString', id `Ptr CUChar', `Int' } -> `Ptr ()' id #} pngImageNew :: T.Text -> IO (Either UnknownError (Ref PNGImage))-pngImageNew filename' = pngImageNew' filename' >>= toRef >>= checkImage+pngImageNew filename' = withText filename' pngImageNew' >>= toRef >>= checkImage pngImageNewWithData :: T.Text -> B.ByteString -> IO (Either UnknownError (Ref PNGImage)) pngImageNewWithData l' data' = B.useAsCString data' $ \png' ->- pngImageNewWithData' l' (castPtr png') (B.length data') >>= toRef >>= checkImage+ copyTextToCString l' >>= \label -> pngImageNewWithData' label (castPtr png') (B.length data') >>= toRef >>= checkImage -- $hierarchy -- @
src/Graphics/UI/FLTK/LowLevel/PNMImage.chs view
@@ -18,10 +18,10 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.Text as T-{# fun Fl_PNM_Image_New as pnmImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_PNM_Image_New as pnmImageNew' { `CString' } -> `Ptr ()' id #} pnmImageNew :: T.Text -> IO (Either UnknownError (Ref PNMImage)) pnmImageNew filename' = do- ptr <- pnmImageNew' filename'+ ptr <- withText filename' pnmImageNew' ref' <- (toRef ptr :: IO (Ref PNMImage)) checkImage ref'
src/Graphics/UI/FLTK/LowLevel/Pack.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenPack_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenPack_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenPack_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} packCustom :: Rectangle -- ^ The bounds of this Pack@@ -43,7 +43,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Pack_New as packNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Pack_New_WithLabel as packNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Pack_New_WithLabel as packNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} packNew :: Rectangle -> Maybe T.Text -> IO (Ref Pack) packNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Positioner.chs view
@@ -26,7 +26,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T -{# fun Fl_OverriddenPositioner_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenPositioner_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenPositioner_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} positionerCustom :: Rectangle -- ^ The bounds of this Positioner@@ -45,7 +45,7 @@ {# fun Fl_Positioner_New as positionerNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Positioner_New_WithLabel as positionerNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Positioner_New_WithLabel as positionerNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} positionerNew :: Rectangle -> Maybe T.Text -> IO (Ref Positioner) positionerNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/Progress.chs view
@@ -27,7 +27,7 @@ import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenProgress_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenProgress_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenProgress_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} progressCustom :: Rectangle -- ^ The bounds of this Progress@@ -46,7 +46,7 @@ {# fun Fl_Progress_New as progressNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Progress_New_WithLabel as progressNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Progress_New_WithLabel as progressNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} progressNew :: Rectangle -> Maybe T.Text -> IO (Ref Progress) progressNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/RadioLightButton.chs view
@@ -20,14 +20,14 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Radio_Light_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Radio_Light_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Radio_Light_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} radioLightButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref RadioLightButton) radioLightButtonNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> widgetNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- widgetNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> widgetNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/RepeatButton.chs view
@@ -27,7 +27,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenRepeat_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenRepeat_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenRepeat_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} repeatButtonCustom :: Rectangle -- ^ The bounds of this RepeatButton@@ -46,7 +46,7 @@ {# fun Fl_Repeat_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Repeat_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Repeat_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} repeatButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref RepeatButton) repeatButtonNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/ReturnButton.chs view
@@ -27,7 +27,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenReturn_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenReturn_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenReturn_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} returnButtonCustom :: Rectangle -- ^ The bounds of this ReturnButton@@ -45,7 +45,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Return_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Return_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Return_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} returnButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref ReturnButton) returnButtonNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Roller.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenRoller_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenRoller_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenRoller_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} rollerCustom :: Rectangle -- ^ The bounds of this Roller@@ -44,7 +44,7 @@ {# fun Fl_Roller_New as rollerNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Roller_New_WithLabel as rollerNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Roller_New_WithLabel as rollerNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} rollerNew :: Rectangle -> Maybe T.Text -> IO (Ref Roller) rollerNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/RoundButton.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenRound_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenRound_Button_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenRound_Button_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} roundButtonCustom :: Rectangle -- ^ The bounds of this RoundButton@@ -42,7 +42,7 @@ overriddenWidgetNew' overriddenWidgetNewWithLabel' {# fun Fl_Round_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Round_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Round_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} roundButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref RoundButton) roundButtonNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Scrollbar.chs view
@@ -27,7 +27,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T -{# fun Fl_OverriddenScrollbar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenScrollbar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenScrollbar_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} scrollbarCustom :: Rectangle -- ^ The bounds of this Scrollbar@@ -46,7 +46,7 @@ {# fun Fl_Scrollbar_New as scrollbarNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Scrollbar_New_WithLabel as scrollbarNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Scrollbar_New_WithLabel as scrollbarNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} scrollbarNew :: Rectangle -> Maybe T.Text -> IO (Ref Scrollbar) scrollbarNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/Scrolled.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Fl_Enumerations-{# fun Fl_OverriddenScroll_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenScroll_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenScroll_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} scrolledCustom :: Rectangle -- ^ The bounds of this Scrolled@@ -44,7 +44,7 @@ {# fun Fl_Scroll_New as scrollNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Scroll_New_WithLabel as scrollNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Scroll_New_WithLabel as scrollNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} scrolledNew :: Rectangle -> Maybe T.Text -> IO (Ref Scrolled) scrolledNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/SelectBrowser.chs view
@@ -19,7 +19,7 @@ import Graphics.UI.FLTK.LowLevel.Widget import qualified Data.Text as T {# fun Fl_Select_Browser_New as selectBrowserNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Select_Browser_New_WithLabel as selectBrowserNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Select_Browser_New_WithLabel as selectBrowserNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} selectBrowserNew :: Rectangle -> Maybe T.Text -> IO (Ref SelectBrowser) selectBrowserNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle@@ -27,7 +27,7 @@ Nothing -> selectBrowserNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- selectBrowserNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> selectBrowserNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/SimpleTerminal.chs view
@@ -27,7 +27,7 @@ import qualified Foreign.ForeignPtr.Unsafe as Unsafe {# fun Fl_Simple_Terminal_New as simpleTerminalNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Simple_Terminal_New_WithLabel as simpleTerminalNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Simple_Terminal_New_WithLabel as simpleTerminalNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} simpleTerminalNew :: Rectangle -> Maybe T.Text -> IO (Ref SimpleTerminal) simpleTerminalNew rectangle l' = widgetMaker@@ -38,7 +38,7 @@ overriddenWidgetNew' overriddenWidgetNewWithLabel' -{# fun Fl_OverriddenSimple_Terminal_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSimple_Terminal_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenSimple_Terminal_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} simpleTerminalCustom :: Rectangle -- ^ The bounds of this SimpleTerminal@@ -84,12 +84,12 @@ {# fun Fl_Simple_Terminal_get_current_style_index as getCurrentStyleIndex' { id `Ptr ()'} -> `Int' #} instance (impl ~ (IO AtIndex)) => Op (GetCurrentStyleIndex ()) SimpleTerminal orig impl where runOp _ _ simple_terminal = withRef simple_terminal $ \simple_terminalPtr -> getCurrentStyleIndex' simple_terminalPtr >>= return . AtIndex-{# fun Fl_Simple_Terminal_set_text as setText' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Simple_Terminal_set_text as setText' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetText ()) SimpleTerminal orig impl where- runOp _ _ simple_terminal val = withRef simple_terminal $ \simple_terminalPtr -> setText' simple_terminalPtr val-{# fun Fl_Simple_Terminal_get_text as getText' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ simple_terminal val = withRef simple_terminal $ \simple_terminalPtr -> copyTextToCString val >>= setText' simple_terminalPtr+{# fun Fl_Simple_Terminal_get_text as getText' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetText ()) SimpleTerminal orig impl where- runOp _ _ simple_terminal = withRef simple_terminal $ \simple_terminalPtr -> getText' simple_terminalPtr+ runOp _ _ simple_terminal = withRef simple_terminal $ \simple_terminalPtr -> getText' simple_terminalPtr >>= cStringToText {# fun Fl_Simple_Terminal_clear as clear'' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Clear ()) SimpleTerminal orig impl where runOp _ _ simpleTerminal = withRef simpleTerminal $ \simpleTerminalPtr -> clear'' simpleTerminalPtr
src/Graphics/UI/FLTK/LowLevel/SingleWindow.chs view
@@ -28,8 +28,8 @@ {# 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 #}-{# fun Fl_OverriddenSingle_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenSingle_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSingle_Window_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSingle_Window_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} singleWindowCustom :: Size -- ^ Size of this window -> Maybe Position -- ^ Optional position of this window -> Maybe T.Text -- ^ Optional label
src/Graphics/UI/FLTK/LowLevel/Slider.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Hierarchy-{# fun Fl_OverriddenSlider_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSlider_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenSlider_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} sliderCustom :: Rectangle -- ^ The bounds of this Slider@@ -42,7 +42,7 @@ overriddenWidgetNew' overriddenWidgetNewWithLabel' {# fun Fl_Slider_New as sliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Slider_New_WithLabel as sliderNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Slider_New_WithLabel as sliderNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} sliderNew :: Rectangle -> Maybe T.Text -> IO (Ref Slider) sliderNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Spinner.chs view
@@ -35,7 +35,7 @@ }; #endc {#enum SpinnerType {} deriving (Show, Eq) #}-{# fun Fl_OverriddenSpinner_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSpinner_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenSpinner_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} spinnerCustom :: Rectangle -- ^ The bounds of this Spinner@@ -53,7 +53,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Spinner_New as spinnerNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Spinner_New_WithLabel as spinnerNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Spinner_New_WithLabel as spinnerNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} spinnerNew :: Rectangle -> Maybe T.Text -> IO (Ref Spinner) spinnerNew rectangle l'= widgetMaker@@ -88,12 +88,12 @@ {# fun Fl_Spinner_type as type' { id `Ptr ()' } -> `Word8' #} instance (impl ~ IO (SpinnerType)) => Op (GetType_ ()) Spinner orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> type' widgetPtr >>= return . toEnum . fromInteger . toInteger-{# fun Fl_Spinner_set_format as set_format' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Spinner_set_format as set_format' { id `Ptr ()', `CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> IO ())) => Op (SetFormat ()) Spinner orig impl where- runOp _ _ spinner f = withRef spinner $ \spinnerPtr -> set_format' spinnerPtr f-{# fun Fl_Spinner_format as format' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ spinner f = withRef spinner $ \spinnerPtr -> copyTextToCString f >>= set_format' spinnerPtr+{# fun Fl_Spinner_format as format' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO (Maybe T.Text))) => Op (GetFormat ()) Spinner orig impl where- runOp _ _ spinner = withRef spinner $ \spinnerPtr -> format' spinnerPtr >>= \s ->+ runOp _ _ spinner = withRef spinner $ \spinnerPtr -> format' spinnerPtr >>= \s -> cStringToText s >>= \s -> if (T.null s) then return Nothing else return (Just s) {# fun Fl_Spinner_value as value' { id `Ptr ()' } -> `Double' #} instance (impl ~ ( IO (Double))) => Op (GetValue ()) Spinner orig impl where
src/Graphics/UI/FLTK/LowLevel/SysMenuBar.chs view
@@ -28,7 +28,7 @@ import Graphics.UI.FLTK.LowLevel.MenuItem import Graphics.UI.FLTK.LowLevel.MenuPrim -{# fun Fl_OverriddenSys_Menu_Bar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenSys_Menu_Bar_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenSys_Menu_Bar_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} sysMenuBarCustom :: Rectangle -- ^ The bounds of this SysMenuBar@@ -45,7 +45,7 @@ overriddenWidgetNew' overriddenWidgetNewWithLabel' {# fun Fl_Sys_Menu_Bar_New as sysMenuBarNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Sys_Menu_Bar_New_WithLabel as sysMenuBarNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Sys_Menu_Bar_New_WithLabel as sysMenuBarNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} sysMenuBarNew :: Rectangle -> Maybe T.Text -> IO (Ref SysMenuBar) sysMenuBarNew rectangle l'= widgetMaker@@ -63,9 +63,9 @@ {# fun Fl_Sys_Menu_Bar_remove as remove' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (Int -> IO ())) => Op (Remove ()) SysMenuBar orig impl where runOp _ _ menu_ index' = withRef menu_ $ \menu_Ptr -> remove' menu_Ptr index'-{# fun Fl_Sys_Menu_Bar_replace as replace' { id `Ptr ()',`Int', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Sys_Menu_Bar_replace as replace' { id `Ptr ()',`Int', `CString' } -> `()' #} instance (impl ~ (AtIndex -> T.Text -> IO ())) => Op (Replace ()) SysMenuBar orig impl where- runOp _ _ menu_ (AtIndex index') name = withRef menu_ $ \menu_Ptr -> replace' menu_Ptr index' name+ runOp _ _ menu_ (AtIndex index') name = withRef menu_ $ \menu_Ptr -> copyTextToCString name >>= replace' menu_Ptr index' {# fun Fl_Sys_Menu_Bar_clear as clear' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Clear ()) SysMenuBar orig impl where runOp _ _ menu_ = withRef menu_ $ \menu_Ptr -> clear' menu_Ptr@@ -93,18 +93,18 @@ withRefs items $ \menu_itemsPtr -> menuWithM' menu_Ptr menu_itemsPtr (length items) -{# fun Fl_Sys_Menu_Bar_add_with_name as add' { id `Ptr ()',unsafeToCString `T.Text'} -> `()' #}+{# fun Fl_Sys_Menu_Bar_add_with_name as add' { id `Ptr ()',`CString'} -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (AddName ()) SysMenuBar orig impl where- runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> add' menu_Ptr name'+ runOp _ _ menu_ name' = withRef menu_ $ \menu_Ptr -> copyTextToCString name' >>= add' menu_Ptr -{# fun Fl_Sys_Menu_Bar_add_with_flags as addWithFlags' { id `Ptr ()',unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}-{# fun Fl_Sys_Menu_Bar_add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', unsafeToCString `T.Text', unsafeToCString `T.Text',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Sys_Menu_Bar_add_with_flags as addWithFlags' { id `Ptr ()',`CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Sys_Menu_Bar_add_with_shortcutname_flags as addWithShortcutnameFlags' { id `Ptr ()', `CString', `CString',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #} instance (Parent a MenuItem, impl ~ ( T.Text -> Maybe Shortcut -> Maybe (Ref a-> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Add ()) SysMenuBar orig (impl) where runOp _ _ menu_ name shortcut cb flags = addMenuItem (Left (safeCast menu_)) name shortcut cb flags addWithFlags' addWithShortcutnameFlags' -{# fun Fl_Sys_Menu_Bar_insert_with_flags as insertWithFlags' { id `Ptr ()',`Int',unsafeToCString `T.Text',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}-{# fun Fl_Sys_Menu_Bar_insert_with_shortcutname_flags as insertWithShortcutnameFlags' { id `Ptr ()',`Int',unsafeToCString `T.Text', unsafeToCString `T.Text',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #}+{# fun Fl_Sys_Menu_Bar_insert_with_flags as insertWithFlags' { id `Ptr ()',`Int',`CString',id `CInt',id `FunPtr CallbackWithUserDataPrim',`Int'} -> `Int' #}+{# fun Fl_Sys_Menu_Bar_insert_with_shortcutname_flags as insertWithShortcutnameFlags' { id `Ptr ()',`Int',`CString', `CString',id `FunPtr CallbackWithUserDataPrim',`Int' } -> `Int' #} instance (Parent a MenuPrim, impl ~ ( AtIndex -> T.Text -> Maybe Shortcut -> (Ref a -> IO ()) -> MenuItemFlags -> IO (AtIndex))) => Op (Insert ()) SysMenuBar orig impl where runOp _ _ menu_ (AtIndex index') name shortcut cb flags = insertMenuItem (safeCast menu_) index' name shortcut cb flags insertWithFlags' insertWithShortcutnameFlags' {# fun Fl_Sys_Menu_Bar_draw as draw'' { id `Ptr ()' } -> `()' #}
src/Graphics/UI/FLTK/LowLevel/Table.chs view
@@ -128,7 +128,7 @@ return ptr {# fun Fl_Table_New as tableNew' { `Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_Table_New_WithLabel as tableNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Table_New_WithLabel as tableNewWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #} tableCustom :: Rectangle -- ^ Bounds of this table -> Maybe T.Text -- ^ Optional label -> Maybe (Ref Table -> IO ()) -- ^ Optional custom table drawing function@@ -141,7 +141,7 @@ let (x_pos, y_pos, width, height) = fromRectangle rectangle ptr <- tableCustomFunctionStruct draw'' (Just drawCell') customWidgetFuncs' customTableFuncs' case label' of- (Just l') -> tableNewWithLabel' x_pos y_pos width height l' ptr >>= toRef+ (Just l') -> copyTextToCString l' >>= \l'' -> tableNewWithLabel' x_pos y_pos width height l'' ptr >>= toRef Nothing -> tableNew' x_pos y_pos width height ptr >>= toRef {# fun Fl_Table_Destroy as tableDestroy' { id `Ptr ()' } -> `()' supressWarningAboutRes #}
src/Graphics/UI/FLTK/LowLevel/TableRow.chs view
@@ -30,14 +30,14 @@ data TableRowSelectFlag = TableRowSelect | TableRowDeselect | TableRowToggle {# fun Fl_OverriddenTable_Row_New as tableRowNew' { `Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenTable_Row_New_WithLabel as tableRowNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenTable_Row_New_WithLabel as tableRowNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} tableRowNew :: Rectangle -> Maybe T.Text -> Maybe (Ref TableRow -> IO ()) -> (Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ()) -> CustomWidgetFuncs TableRow -> CustomTableFuncs TableRow -> IO (Ref TableRow) tableRowNew rectangle label' draw' drawCell' customWidgetFuncs' customTableFuncs' = do let (x_pos, y_pos, width, height) = fromRectangle rectangle ptr <- tableCustomFunctionStruct draw' (Just drawCell') customWidgetFuncs' customTableFuncs' case label' of- (Just l') -> tableRowNewWithLabel' x_pos y_pos width height l' ptr >>= toRef+ (Just l') -> copyTextToCString l' >>= \l'' -> tableRowNewWithLabel' x_pos y_pos width height l'' ptr >>= toRef Nothing -> do ref <- tableRowNew' x_pos y_pos width height ptr >>= toRef setFlag ref WidgetFlagCopiedLabel
src/Graphics/UI/FLTK/LowLevel/Tabs.chs view
@@ -99,7 +99,7 @@ toTabClientAreaPrim tabClientArea' >>= {#set fl_Tab_Virtual_Funcs->tab_client_area #} structPtr return structPtr -{# fun Fl_OverriddenTabs_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenTabs_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()', id `Ptr ()'} -> `Ptr ()' id #} tabsCustom :: Rectangle -- ^ The bounds of this Tabs -> Maybe T.Text -- ^ The Tabs label@@ -119,17 +119,18 @@ (tabClientArea tfs)) tabFuncs' widgetFuncsPtr <- customWidgetFunctionStruct (fmap tabDrawCustom tabFuncs') (maybe defaultCustomWidgetFuncs id widgetFuncs')- overriddenWidgetNewWithLabel' x_pos y_pos width height (maybe "" id l') tabFuncsPtr widgetFuncsPtr >>= toRef+ label' <- maybe (return nullPtr) copyTextToCString l'+ overriddenWidgetNewWithLabel' x_pos y_pos width height label' tabFuncsPtr widgetFuncsPtr >>= toRef {# fun Fl_Tabs_New as tabsNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Tabs_New_WithLabel as tabsNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Tabs_New_WithLabel as tabsNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} tabsNew :: Rectangle -> Maybe T.Text -> IO (Ref Tabs) tabsNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> tabsNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- tabsNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> tabsNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/TextBuffer.chs view
@@ -43,39 +43,39 @@ {# fun Fl_Text_Buffer_input_file_was_transcoded as inputFileWasTranscoded' { id `Ptr ()' } -> `Bool' cToBool #} instance ( impl ~ ( IO (Bool))) => Op (InputFileWasTranscoded ()) TextBuffer orig impl where runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> inputFileWasTranscoded' text_bufferPtr-{# fun Fl_Text_Buffer_file_encoding_warning_message as fileEncodingWarningMessage' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Text_Buffer_file_encoding_warning_message as fileEncodingWarningMessage' { id `Ptr ()' } -> `CString' #} instance ( impl ~ ( IO T.Text)) => Op (FileEncodingWarningMessage ()) TextBuffer orig impl where- runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> fileEncodingWarningMessage' text_bufferPtr+ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> fileEncodingWarningMessage' text_bufferPtr >>= cStringToText {# fun Fl_Text_Buffer_length as length' { id `Ptr ()' } -> `Int' #} instance ( impl ~ ( IO (Int))) => Op (GetLength ()) TextBuffer orig impl where runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> length' text_bufferPtr-{# fun Fl_Text_Buffer_text as text' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Text_Buffer_text as text' { id `Ptr ()' } -> `CString' #} instance ( impl ~ ( IO T.Text)) => Op (GetText ()) TextBuffer orig impl where- runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> text' text_bufferPtr-{# fun Fl_Text_Buffer_set_text as setText' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> text' text_bufferPtr >>= cStringToText+{# fun Fl_Text_Buffer_set_text as setText' { id `Ptr ()', `CString' } -> `()' #} instance ( impl ~ ( T.Text -> IO ())) => Op (SetText ()) TextBuffer orig impl where- runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> setText' text_bufferPtr text-{# fun Fl_Text_Buffer_text_range as textRange' { id `Ptr ()',`Int',`Int' } -> `T.Text' unsafeFromCString #}+ runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> copyTextToCString text >>= setText' text_bufferPtr+{# fun Fl_Text_Buffer_text_range as textRange' { id `Ptr ()',`Int',`Int' } -> `CString' #} instance ( impl ~ ( IndexRange -> IO T.Text)) => Op (TextRange ()) TextBuffer orig impl where- runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) = withRef text_buffer $ \text_bufferPtr -> textRange' text_bufferPtr start' end'+ runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) = withRef text_buffer $ \text_bufferPtr -> textRange' text_bufferPtr start' end' >>= cStringToText {# fun Fl_Text_Buffer_char_at as charAt' { id `Ptr ()',`Int' } -> `Int' #} instance ( impl ~ ( AtIndex -> IO (Char))) => Op (CharAt ()) TextBuffer orig impl where runOp _ _ text_buffer (AtIndex pos) = withRef text_buffer $ \text_bufferPtr -> charAt' text_bufferPtr pos >>= return . toEnum {# fun Fl_Text_Buffer_byte_at as byteAt' { id `Ptr ()',`Int' } -> `Char' castCCharToChar #} instance ( impl ~ ( AtIndex -> IO Char)) => Op (ByteAt ()) TextBuffer orig impl where runOp _ _ text_buffer (AtIndex pos) = withRef text_buffer $ \text_bufferPtr -> byteAt' text_bufferPtr pos-{# fun Fl_Text_Buffer_insert as insert' { id `Ptr ()',`Int', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Text_Buffer_insert as insert' { id `Ptr ()',`Int', `CString' } -> `()' #} instance ( impl ~ ( AtIndex -> T.Text -> IO ())) => Op (Insert ()) TextBuffer orig impl where- runOp _ _ text_buffer (AtIndex pos) text = withRef text_buffer $ \text_bufferPtr -> insert' text_bufferPtr pos text-{# fun Fl_Text_Buffer_append as append' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+ runOp _ _ text_buffer (AtIndex pos) text = withRef text_buffer $ \text_bufferPtr -> copyTextToCString text >>= insert' text_bufferPtr pos+{# fun Fl_Text_Buffer_append as append' { id `Ptr ()', `CString' } -> `()' #} instance ( impl ~ ( T.Text -> IO ())) => Op (AppendToBuffer ()) TextBuffer orig impl where- runOp _ _ text_buffer t = withRef text_buffer $ \text_bufferPtr -> append' text_bufferPtr t+ runOp _ _ text_buffer t = withRef text_buffer $ \text_bufferPtr -> copyTextToCString t >>= append' text_bufferPtr {# fun Fl_Text_Buffer_remove as remove' { id `Ptr ()',`Int',`Int' } -> `()' #} instance ( impl ~ ( IndexRange -> IO ())) => Op (Remove ()) TextBuffer orig impl where runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) = withRef text_buffer $ \text_bufferPtr -> remove' text_bufferPtr start' end'-{# fun Fl_Text_Buffer_replace as replace' { id `Ptr ()',`Int',`Int', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Text_Buffer_replace as replace' { id `Ptr ()',`Int',`Int', `CString' } -> `()' #} instance ( impl ~ ( IndexRange -> T.Text -> IO ())) => Op (Replace ()) TextBuffer orig impl where- runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) text = withRef text_buffer $ \text_bufferPtr -> replace' text_bufferPtr start' end' text+ runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) text = withRef text_buffer $ \text_bufferPtr -> copyTextToCString text >>= replace' text_bufferPtr start' end' {# fun Fl_Text_Buffer_copy as copy' { id `Ptr ()',id `Ptr ()',`Int',`Int',`Int' } -> `()' #} instance ( Parent a TextBuffer, impl ~ ( Ref a -> IndexRange -> AtIndex -> IO ())) => Op (Copy ()) TextBuffer orig impl where runOp _ _ text_buffer frombuf (IndexRange (AtIndex fromstart) (AtIndex fromend)) (AtIndex topos) = withRef text_buffer $ \text_bufferPtr -> withRef frombuf $ \frombufPtr -> copy' text_bufferPtr frombufPtr fromstart fromend topos@@ -92,57 +92,56 @@ instance ( impl ~ (Bool -> IO ())) => Op (CanUndo ()) TextBuffer orig impl where runOp _ _ text_buffer flag = withRef text_buffer $ \text_bufferPtr -> canUndoWithFlag' text_bufferPtr flag -{# fun Fl_Text_Buffer_insertfile as insertfile' { id `Ptr ()', unsafeToCString `T.Text',`Int' } -> `Int' #}+{# fun Fl_Text_Buffer_insertfile as insertfile' { id `Ptr ()', `CString',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> AtIndex -> IO (Either DataProcessingError ()))) => Op (Insertfile ()) TextBuffer orig impl where runOp _ _ text_buffer file (AtIndex pos) =- withRef text_buffer $ \text_bufferPtr ->- insertfile' text_bufferPtr file pos >>= return . successOrDataProcessingError--{# fun Fl_Text_Buffer_insertfile_with_buflen as insertfileWithBuflen' { id `Ptr ()', unsafeToCString `T.Text',`Int',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> insertfile' text_bufferPtr fs pos) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_insertfile_with_buflen as insertfileWithBuflen' { id `Ptr ()', `CString',`Int',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> AtIndex -> Int -> IO (Either DataProcessingError ()))) => Op (InsertfileWithBuflen ()) TextBuffer orig impl where runOp _ _ text_buffer file (AtIndex pos) buflen =- withRef text_buffer $ \text_bufferPtr ->- insertfileWithBuflen' text_bufferPtr file pos buflen >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_appendfile as appendfile' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> insertfileWithBuflen' text_bufferPtr fs pos buflen) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_appendfile as appendfile' { id `Ptr ()', `CString' } -> `Int' #} instance ( impl ~ ( T.Text -> IO (Either DataProcessingError ()))) => Op (Appendfile ()) TextBuffer orig impl where runOp _ _ text_buffer file =- withRef text_buffer $ \text_bufferPtr ->- appendfile' text_bufferPtr file >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_appendfile_with_buflen as appendfileWithBuflen' { id `Ptr ()', unsafeToCString `T.Text',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> appendfile' text_bufferPtr fs) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_appendfile_with_buflen as appendfileWithBuflen' { id `Ptr ()', `CString',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> Int -> IO (Either DataProcessingError ()))) => Op (AppendfileWithBuflen ()) TextBuffer orig impl where runOp _ _ text_buffer file buflen =- withRef text_buffer $ \text_bufferPtr ->- appendfileWithBuflen' text_bufferPtr file buflen >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_loadfile as loadfile' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> appendfileWithBuflen' text_bufferPtr fs buflen) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_loadfile as loadfile' { id `Ptr ()', `CString' } -> `Int' #} instance ( impl ~ ( T.Text -> IO (Either DataProcessingError ()))) => Op (Loadfile ()) TextBuffer orig impl where runOp _ _ text_buffer file =- withRef text_buffer $ \text_bufferPtr ->- loadfile' text_bufferPtr file >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_loadfile_with_buflen as loadfileWithBuflen' { id `Ptr ()', unsafeToCString `T.Text',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> loadfile' text_bufferPtr fs) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_loadfile_with_buflen as loadfileWithBuflen' { id `Ptr ()', `CString',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> Int -> IO (Either DataProcessingError ()))) => Op (LoadfileWithBuflen ()) TextBuffer orig impl where runOp _ _ text_buffer file buflen =- withRef text_buffer $ \text_bufferPtr ->- loadfileWithBuflen' text_bufferPtr file buflen >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_outputfile as outputfile' { id `Ptr ()', unsafeToCString `T.Text',`Int',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> loadfileWithBuflen' text_bufferPtr fs buflen) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_outputfile as outputfile' { id `Ptr ()', `CString',`Int',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> IndexRange -> IO (Either DataProcessingError ()))) => Op (Outputfile ()) TextBuffer orig impl where runOp _ _ text_buffer file (IndexRange (AtIndex start') (AtIndex end')) =- withRef text_buffer $ \text_bufferPtr ->- outputfile' text_bufferPtr file start' end' >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_outputfile_with_buflen as outputfileWithBuflen' { id `Ptr ()', unsafeToCString `T.Text',`Int',`Int',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> outputfile' text_bufferPtr fs start' end') >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_outputfile_with_buflen as outputfileWithBuflen' { id `Ptr ()', `CString',`Int',`Int',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> IndexRange -> Int -> IO (Either DataProcessingError ()))) => Op (OutputfileWithBuflen ()) TextBuffer orig impl where runOp _ _ text_buffer file (IndexRange (AtIndex start') (AtIndex end')) buflen =- withRef text_buffer $ \text_bufferPtr ->- outputfileWithBuflen' text_bufferPtr file start' end' buflen >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_savefile as savefile' { id `Ptr ()', unsafeToCString `T.Text' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> outputfileWithBuflen' text_bufferPtr fs start' end' buflen) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_savefile as savefile' { id `Ptr ()', `CString' } -> `Int' #} instance ( impl ~ ( T.Text -> IO (Either DataProcessingError ()))) => Op (Savefile ()) TextBuffer orig impl where runOp _ _ text_buffer file =- withRef text_buffer $ \text_bufferPtr ->- savefile' text_bufferPtr file >>= return . successOrDataProcessingError-{# fun Fl_Text_Buffer_savefile_with_buflen as savefileWithBuflen' { id `Ptr ()', unsafeToCString `T.Text',`Int' } -> `Int' #}+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> savefile' text_bufferPtr fs) >>= return . successOrDataProcessingError+{# fun Fl_Text_Buffer_savefile_with_buflen as savefileWithBuflen' { id `Ptr ()', `CString',`Int' } -> `Int' #} instance ( impl ~ ( T.Text -> Int -> IO (Either DataProcessingError ()))) => Op (SavefileWithBuflen ()) TextBuffer orig impl where runOp _ _ text_buffer file buflen =- withRef text_buffer $ \text_bufferPtr ->- savefileWithBuflen' text_bufferPtr file buflen >>= return . successOrDataProcessingError+ withRef text_buffer $ \text_bufferPtr -> do+ withText file (\fs -> savefileWithBuflen' text_bufferPtr fs buflen) >>= return . successOrDataProcessingError {# fun Fl_Text_Buffer_tab_distance as tabDistance' { id `Ptr ()' } -> `Int' #} instance ( impl ~ ( IO (Int))) => Op (GetTabDistance ()) TextBuffer orig impl where runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> tabDistance' text_bufferPtr@@ -164,15 +163,15 @@ withRef text_buffer $ \text_bufferPtr -> selectionPosition' text_bufferPtr >>= \(start',end') -> return (IndexRange (AtIndex start') (AtIndex end'))-{# fun Fl_Text_Buffer_selection_text as selectionText' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Text_Buffer_selection_text as selectionText' { id `Ptr ()' } -> `CString' #} instance ( impl ~ ( IO T.Text)) => Op (SelectionText ()) TextBuffer orig impl where- runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> selectionText' text_bufferPtr+ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> selectionText' text_bufferPtr >>= cStringToText {# fun Fl_Text_Buffer_remove_selection as removeSelection' { id `Ptr ()' } -> `()' #} instance ( impl ~ ( IO ())) => Op (RemoveSelection ()) TextBuffer orig impl where runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> removeSelection' text_bufferPtr-{# fun Fl_Text_Buffer_replace_selection as replaceSelection' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Text_Buffer_replace_selection as replaceSelection' { id `Ptr ()', `CString' } -> `()' #} instance ( impl ~ ( T.Text -> IO ())) => Op (ReplaceSelection ()) TextBuffer orig impl where- runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> replaceSelection' text_bufferPtr text+ runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> copyTextToCString text >>= replaceSelection' text_bufferPtr {# fun Fl_Text_Buffer_secondary_select as secondarySelect' { id `Ptr ()',`Int',`Int' } -> `()' #} instance ( impl ~ ( IndexRange -> IO ())) => Op (SecondarySelect ()) TextBuffer orig impl where runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) = withRef text_buffer $ \text_bufferPtr -> secondarySelect' text_bufferPtr start' end'@@ -188,15 +187,15 @@ withRef text_buffer $ \text_bufferPtr -> secondarySelectionPosition' text_bufferPtr >>= \(start',end') -> return (IndexRange (AtIndex start') (AtIndex end'))-{# fun Fl_Text_Buffer_secondary_selection_text as secondarySelectionText' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Text_Buffer_secondary_selection_text as secondarySelectionText' { id `Ptr ()' } -> `CString' #} instance ( impl ~ ( IO T.Text)) => Op (SecondarySelectionText ()) TextBuffer orig impl where- runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> secondarySelectionText' text_bufferPtr+ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> secondarySelectionText' text_bufferPtr >>= cStringToText {# fun Fl_Text_Buffer_remove_secondary_selection as removeSecondarySelection' { id `Ptr ()' } -> `()' #} instance ( impl ~ ( IO ())) => Op (RemoveSecondarySelection ()) TextBuffer orig impl where runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> removeSecondarySelection' text_bufferPtr-{# fun Fl_Text_Buffer_replace_secondary_selection as replaceSecondarySelection' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Text_Buffer_replace_secondary_selection as replaceSecondarySelection' { id `Ptr ()', `CString' } -> `()' #} instance ( impl ~ ( T.Text -> IO ())) => Op (ReplaceSecondarySelection ()) TextBuffer orig impl where- runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> replaceSecondarySelection' text_bufferPtr text+ runOp _ _ text_buffer text = withRef text_buffer $ \text_bufferPtr -> copyTextToCString text >>= replaceSecondarySelection' text_bufferPtr {# fun Fl_Text_Buffer_set_highlight as setHighlight' { id `Ptr ()',`Int',`Int' } -> `()' #} instance ( impl ~ ( IndexRange -> IO ())) => Op (SetHighlight ()) TextBuffer orig impl where runOp _ _ text_buffer (IndexRange (AtIndex start') (AtIndex end')) = withRef text_buffer $ \text_bufferPtr -> setHighlight' text_bufferPtr start' end'@@ -211,9 +210,9 @@ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> statusToIndexRange (highlightPosition' text_bufferPtr)-{# fun Fl_Text_Buffer_highlight_text as highlightText' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Text_Buffer_highlight_text as highlightText' { id `Ptr ()' } -> `CString' #} instance ( impl ~ ( IO T.Text)) => Op (HighlightText ()) TextBuffer orig impl where- runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> highlightText' text_bufferPtr+ runOp _ _ text_buffer = withRef text_buffer $ \text_bufferPtr -> highlightText' text_bufferPtr >>= cStringToText {# fun Fl_Text_Buffer_add_modify_callback as addModifyCallback' { id `Ptr ()',id `FunPtr TextModifyCbPrim',id `Ptr ()' } -> `()' #} instance (impl ~ (TextModifyCb -> IO (FunPtr ()))) => Op (AddModifyCallback ()) TextBuffer orig impl where runOp _ _ text_buffer bufmodifiedcb =@@ -306,21 +305,21 @@ if (status' == 0) then return (Left NotFound) else peekIntConv intPtr >>= return . Right . AtIndex-{# fun Fl_Text_Buffer_search_forward_with_matchcase as searchForwardWithMatchcase' { id `Ptr ()',`Int', unsafeToCString `T.Text',id `Ptr CInt', cFromBool `Bool' } -> `Int' #}+{# fun Fl_Text_Buffer_search_forward_with_matchcase as searchForwardWithMatchcase' { id `Ptr ()',`Int', `CString',id `Ptr CInt', cFromBool `Bool' } -> `Int' #} instance ( impl ~ (AtIndex -> T.Text -> Bool -> IO (Either NotFound AtIndex))) => Op (SearchForwardWithMatchcase ()) TextBuffer orig impl where runOp _ _ text_buffer (AtIndex startpos) searchstring matchcase = withRef text_buffer $ \text_bufferPtr -> alloca $ \intPtr -> do- status' <- searchForwardWithMatchcase' text_bufferPtr startpos searchstring intPtr matchcase+ status' <- withText searchstring (\s -> searchForwardWithMatchcase' text_bufferPtr startpos s intPtr matchcase) if (status' == 0) then return (Left NotFound) else peekIntConv intPtr >>= return . Right . AtIndex-{# fun Fl_Text_Buffer_search_backward_with_matchcase as searchBackwardWithMatchcase' { id `Ptr ()',`Int', unsafeToCString `T.Text',id `Ptr CInt', cFromBool `Bool' } -> `Int' #}+{# fun Fl_Text_Buffer_search_backward_with_matchcase as searchBackwardWithMatchcase' { id `Ptr ()',`Int', `CString',id `Ptr CInt', cFromBool `Bool' } -> `Int' #} instance ( impl ~ (AtIndex -> T.Text -> Bool -> IO (Either NotFound AtIndex))) => Op (SearchBackwardWithMatchcase ()) TextBuffer orig impl where runOp _ _ text_buffer (AtIndex startpos) searchstring matchcase = withRef text_buffer $ \text_bufferPtr -> alloca $ \intPtr -> do- status' <- searchBackwardWithMatchcase' text_bufferPtr startpos searchstring intPtr matchcase+ status' <- withText searchstring (\s -> searchBackwardWithMatchcase' text_bufferPtr startpos s intPtr matchcase) if (status' == 0) then return (Left NotFound) else peekIntConv intPtr >>= return . Right . AtIndex
src/Graphics/UI/FLTK/LowLevel/TextDisplay.chs view
@@ -78,7 +78,7 @@ indexStyleTableEntries :: [StyleTableEntry] -> [(Char, StyleTableEntry)] indexStyleTableEntries = zip ['A'..] -{# fun Fl_OverriddenText_Display_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenText_Display_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenText_Display_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} textDisplayCustom :: Rectangle -- ^ The bounds of this TextDisplay@@ -96,15 +96,13 @@ overriddenWidgetNewWithLabel' {# fun Fl_Text_Display_New as textDisplayNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Text_Display_New_WithLabel as textDisplayNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Text_Display_New_WithLabel as textDisplayNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} textDisplayNew :: Rectangle -> Maybe T.Text -> IO (Ref TextDisplay) textDisplayNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of- Nothing -> textDisplayNew' x_pos y_pos width height >>=- toRef- Just l -> textDisplayNewWithLabel' x_pos y_pos width height l >>=- toRef+ Nothing -> textDisplayNew' x_pos y_pos width height >>= toRef+ Just l -> copyTextToCString l >>= \l' -> textDisplayNewWithLabel' x_pos y_pos width height l' >>= toRef {# fun Fl_Text_Display_Destroy as textDisplayDestroy' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ (IO ())) => Op (Destroy ()) TextDisplay orig impl where@@ -121,9 +119,9 @@ {# fun Fl_Text_Display_scroll as scroll' { id `Ptr ()',`Int',`Int' } -> `()' #} instance (impl ~ (LineNumber -> AtIndex -> IO ())) => Op (Scroll ()) TextDisplay orig impl where runOp _ _ text_display (LineNumber toplinenum) (AtIndex horizoffset) = withRef text_display $ \text_displayPtr -> scroll' text_displayPtr toplinenum horizoffset-{# fun Fl_Text_Display_overstrike as overstrike' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Text_Display_overstrike as overstrike' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (Overstrike ()) TextDisplay orig impl where- runOp _ _ text_display text = withRef text_display $ \text_displayPtr -> overstrike' text_displayPtr text+ runOp _ _ text_display text = withRef text_display $ \text_displayPtr -> copyTextToCString text >>= overstrike' text_displayPtr {# fun Fl_Text_Display_set_insert_position as setInsertPosition' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ (AtIndex -> IO ())) => Op (SetInsertPosition ()) TextDisplay orig impl where runOp _ _ text_display (AtIndex newpos) = withRef text_display $ \text_displayPtr -> setInsertPosition' text_displayPtr newpos@@ -304,12 +302,12 @@ {# fun linenumber_align as linenumberAlign' { id `Ptr ()' } -> `AlignType' cToEnum #} instance (impl ~ ( IO (AlignType))) => Op (GetLinenumberAlign ()) TextDisplay orig impl where runOp _ _ text_display = withRef text_display $ \text_displayPtr -> linenumberAlign' text_displayPtr-{# fun set_linenumber_format as setLinenumberFormat' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun set_linenumber_format as setLinenumberFormat' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (T.Text -> IO ())) => Op (SetLinenumberFormat ()) TextDisplay orig impl where- runOp _ _ text_display val = withRef text_display $ \text_displayPtr -> setLinenumberFormat' text_displayPtr val-{# fun linenumber_format as linenumberFormat' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+ runOp _ _ text_display val = withRef text_display $ \text_displayPtr -> copyTextToCString val >>= setLinenumberFormat' text_displayPtr+{# fun linenumber_format as linenumberFormat' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetLinenumberFormat ()) TextDisplay orig impl where- runOp _ _ text_display = withRef text_display $ \text_displayPtr -> linenumberFormat' text_displayPtr+ runOp _ _ text_display = withRef text_display $ \text_displayPtr -> linenumberFormat' text_displayPtr >>= cStringToText {# fun Fl_Text_Display_wrap_mode as wrapMode' { id `Ptr ()', `CInt', `CInt'} -> `()' #} instance (impl ~ (WrapType -> IO ())) => Op (WrapMode ()) TextDisplay orig impl where runOp _ _ textDisplay wt =
src/Graphics/UI/FLTK/LowLevel/TextEditor.chs view
@@ -105,7 +105,7 @@ let currKb = KeyBinding (KeyBindingKeySequence evs keyType) (toFunRef function') go (accum ++ [currKb]) next' -{# fun Fl_OverriddenText_Editor_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenText_Editor_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenText_Editor_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} textEditorCustom :: Rectangle -- ^ The bounds of this TextEditor@@ -123,7 +123,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Text_Editor_New as textEditorNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Text_Editor_New_WithLabel as textEditorNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Text_Editor_New_WithLabel as textEditorNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} textEditorNew :: Rectangle -> Maybe T.Text -> IO (Ref TextEditor) textEditorNew rectangle l' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/Tile.chs view
@@ -27,7 +27,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T -{# fun Fl_OverriddenTile_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenTile_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenTile_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} tileCustom :: Rectangle -- ^ The bounds of this Tile@@ -46,7 +46,7 @@ {# fun Fl_Tile_New as tileNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Tile_New_WithLabel as tileNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Tile_New_WithLabel as tileNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} tileNew :: Rectangle -> Maybe T.Text -> IO (Ref Tile) tileNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/ToggleButton.chs view
@@ -26,14 +26,14 @@ import qualified Data.Text as T {# fun Fl_Toggle_Button_New as widgetNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Toggle_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Toggle_Button_New_WithLabel as widgetNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} toggleButtonNew :: Rectangle -> Maybe T.Text -> IO (Ref ToggleButton) toggleButtonNew rectangle l' = let (x_pos, y_pos, width, height) = fromRectangle rectangle in case l' of Nothing -> widgetNew' x_pos y_pos width height >>= toRef Just l -> do- ref <- widgetNewWithLabel' x_pos y_pos width height l >>= toRef+ ref <- copyTextToCString l >>= \l' -> widgetNewWithLabel' x_pos y_pos width height l' >>= toRef setFlag ref WidgetFlagCopiedLabel setFlag ref WidgetFlagCopiedTooltip return ref
src/Graphics/UI/FLTK/LowLevel/Tree.chs view
@@ -26,7 +26,7 @@ import qualified Data.Text as T import Graphics.UI.FLTK.LowLevel.Widget -{# fun Fl_OverriddenTree_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenTree_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenTree_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} treeCustom :: Rectangle -- ^ The bounds of this Tree@@ -45,7 +45,7 @@ {# fun Fl_Tree_New as treeNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Tree_New_WithLabel as treeNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Tree_New_WithLabel as treeNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} treeNew :: Rectangle -> Maybe T.Text -> IO (Ref Tree) treeNew rectangle l' = widgetMaker@@ -81,12 +81,12 @@ withRef item' $ \itemPtr -> withText path' $ \pathPtr -> addWithItemName' treePtr itemPtr pathPtr >>= toMaybeRef-{# fun Fl_Tree_insert_above as insertAbove' { id `Ptr ()',id `Ptr ()',unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_Tree_insert_above as insertAbove' { id `Ptr ()',id `Ptr ()',`CString' } -> `Ptr ()' id #} instance (Parent a TreeItem, impl ~ (Ref a -> T.Text -> IO (Maybe (Ref a)))) => Op (InsertAbove ()) Tree orig impl where- runOp _ _ tree above name = withRef tree $ \treePtr -> withRef above $ \abovePtr -> insertAbove' treePtr abovePtr name >>= toMaybeRef-{# fun Fl_Tree_insert as insert' { id `Ptr ()',id `Ptr ()',unsafeToCString `T.Text',`Int' } -> `Ptr ()' id #}+ runOp _ _ tree above name = withRef tree $ \treePtr -> withRef above $ \abovePtr -> copyTextToCString name >>= \n -> insertAbove' treePtr abovePtr n >>= toMaybeRef+{# fun Fl_Tree_insert as insert' { id `Ptr ()',id `Ptr ()',`CString',`Int' } -> `Ptr ()' id #} instance (Parent a TreeItem, impl ~ (Ref a -> T.Text -> AtIndex -> IO (Maybe (Ref a)))) => Op (Insert ()) Tree orig impl where- runOp _ _ tree item name (AtIndex pos) = withRef tree $ \treePtr -> withRef item $ \itemPtr -> insert' treePtr itemPtr name pos >>= toMaybeRef+ runOp _ _ tree item name (AtIndex pos) = withRef tree $ \treePtr -> withRef item $ \itemPtr -> copyTextToCString name >>= \n -> insert' treePtr itemPtr n pos >>= toMaybeRef {# fun Fl_Tree_remove as remove' { id `Ptr ()',id `Ptr ()' } -> `Int' #} instance (impl ~ (Ref TreeItem -> IO (Either TreeItemNotFound ())) ) => Op (Remove ()) Tree orig impl where runOp _ _ tree item = withRef tree $ \treePtr -> withRef item $ \itemPtr -> do@@ -98,9 +98,9 @@ {# fun Fl_Tree_clear_children as clearChildren' { id `Ptr ()',id `Ptr ()' } -> `()' #} instance (Parent a TreeItem, impl ~ (Ref a -> IO ()) ) => Op (ClearChildren ()) Tree orig impl where runOp _ _ tree item = withRef tree $ \treePtr -> withRef item $ \itemPtr -> clearChildren' treePtr itemPtr-{# fun Fl_Tree_find_item as findItem' { id `Ptr ()',unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_Tree_find_item as findItem' { id `Ptr ()',`CString' } -> `Ptr ()' id #} instance (impl ~ (T.Text -> IO (Maybe (Ref TreeItem))) ) => Op (FindItem ()) Tree orig impl where- runOp _ _ tree path = withRef tree $ \treePtr -> findItem' treePtr path >>= toMaybeRef+ runOp _ _ tree path = withRef tree $ \treePtr -> withText path (\p -> findItem' treePtr p >>= toMaybeRef) {# fun Fl_Tree_item_pathname as itemPathname' { id `Ptr ()', id `Ptr CChar', `Int', id `Ptr ()'} -> `Int' #} instance (Parent a TreeItem, impl ~ (Ref a -> IO (Maybe T.Text)) ) => Op (ItemPathname ()) Tree orig impl where runOp _ _ tree item =@@ -159,20 +159,20 @@ runOp _ _ tree item dir = withRef tree $ \treePtr -> withRef item $ \itemPtr -> nextSelectedItemWithItemDirection' treePtr itemPtr (maybe 0 (fromIntegral . fromEnum) dir) >>= toMaybeRef {# fun Fl_Tree_open_with_item as openWithItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} {# fun Fl_Tree_open_with_item_docallback as openWithItemDocallback' { id `Ptr ()',id `Ptr ()', cFromBool `Bool' } -> `Int' #}-{# fun Fl_Tree_open_with_path as openWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}-{# fun Fl_Tree_open_with_path_docallback as openWithPathDocallback' { id `Ptr ()', unsafeToCString `T.Text', cFromBool `Bool' } -> `Int' #}+{# fun Fl_Tree_open_with_path as openWithPath' { id `Ptr ()',`CString' } -> `Int' #}+{# fun Fl_Tree_open_with_path_docallback as openWithPathDocallback' { id `Ptr ()', `CString', cFromBool `Bool' } -> `Int' #} instance (impl ~ (TreeItemLocator -> IO ()) ) => Op (Open ()) Tree orig impl where runOp _ _ tree_item locator' = withRef tree_item $ \tree_itemPtr -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> openWithItem' tree_itemPtr itemRefPtr >> return ()- TreeItemNameLocator (TreeItemName n') -> openWithPath' tree_itemPtr n' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> openWithPath' tree_itemPtr n'' >> return ()) instance (impl ~ (TreeItemLocator -> Bool -> IO ())) => Op (OpenAndCallback ()) Tree orig impl where runOp _ _ tree_item locator' docallback' = withRef tree_item $ \tree_itemPtr -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> openWithItemDocallback' tree_itemPtr itemRefPtr docallback' >> return ()- TreeItemNameLocator (TreeItemName n') -> openWithPathDocallback' tree_itemPtr n' docallback' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> openWithPathDocallback' tree_itemPtr n'' docallback' >> return ()) {# fun Fl_Tree_open_toggle as openToggle' { id `Ptr ()',id `Ptr ()' } -> `()' #} {# fun Fl_Tree_open_toggle_with_docallback as openToggleWithDocallback' { id `Ptr ()',id `Ptr ()', cFromBool `Bool' } -> `()' #} instance (impl ~ (Ref TreeItem -> IO ()) ) => Op (OpenToggle ()) Tree orig impl where@@ -181,51 +181,50 @@ runOp _ _ tree item docallback = withRef tree $ \treePtr -> withRef item $ \itemPtr -> openToggleWithDocallback' treePtr itemPtr docallback {# fun Fl_Tree_close_with_item as closeWithItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} {# fun Fl_Tree_close_with_item_docallback as closeWithItemDocallback' { id `Ptr ()',id `Ptr ()', cFromBool `Bool' } -> `Int' #}-{# fun Fl_Tree_close_with_path as closeWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}-{# fun Fl_Tree_close_with_path_docallback as closeWithPathDocallback' { id `Ptr ()',unsafeToCString `T.Text', cFromBool `Bool' } -> `Int' #}+{# fun Fl_Tree_close_with_path as closeWithPath' { id `Ptr ()',`CString' } -> `Int' #}+{# fun Fl_Tree_close_with_path_docallback as closeWithPathDocallback' { id `Ptr ()',`CString', cFromBool `Bool' } -> `Int' #} instance (impl ~ (TreeItemLocator -> IO ()) ) => Op (Close ()) Tree orig impl where runOp _ _ tree_item locator' = withRef tree_item $ \tree_itemPtr -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> closeWithItem' tree_itemPtr itemRefPtr >> return ()- TreeItemNameLocator (TreeItemName n') -> closeWithPath' tree_itemPtr n' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> closeWithPath' tree_itemPtr n'' >> return ()) instance (impl ~ (TreeItemLocator -> Bool -> IO ())) => Op (CloseAndCallback ()) Tree orig impl where runOp _ _ tree_item locator' docallback' = withRef tree_item $ \tree_itemPtr -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> closeWithItemDocallback' tree_itemPtr itemRefPtr docallback' >> return ()- TreeItemNameLocator (TreeItemName n') -> closeWithPathDocallback' tree_itemPtr n' docallback' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> closeWithPathDocallback' tree_itemPtr n'' docallback' >> return ()) {# fun Fl_Tree_is_open_with_item as isOpenWithItem' { id `Ptr ()',id `Ptr ()' } -> `Bool' cToBool #}-{# fun Fl_Tree_is_open_with_path as isOpenWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Bool' cToBool #}+{# fun Fl_Tree_is_open_with_path as isOpenWithPath' { id `Ptr ()',`CString' } -> `Bool' cToBool #} instance (impl ~ (TreeItemLocator -> IO (Bool)) ) => Op (IsOpen ()) Tree orig impl where runOp _ _ tree locator' = withRef tree $ \treePtr -> case locator' of TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> isOpenWithItem' treePtr r'Ptr- TreeItemNameLocator (TreeItemName n') ->- isOpenWithPath' treePtr n'+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> isOpenWithPath' treePtr n'') {# fun Fl_Tree_is_close_with_item as isCloseWithItem' { id `Ptr ()',id `Ptr ()' } -> `Bool' cToBool #}-{# fun Fl_Tree_is_close_with_path as isCloseWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Bool' cToBool #}+{# fun Fl_Tree_is_close_with_path as isCloseWithPath' { id `Ptr ()',`CString' } -> `Bool' cToBool #} instance (impl ~ (TreeItemLocator -> IO (Bool)) ) => Op (IsClose ()) Tree orig impl where runOp _ _ tree locator' = withRef tree $ \treePtr -> case locator' of TreeItemPointerLocator (TreeItemPointer r') -> withRef r' $ \r'Ptr -> isCloseWithItem' treePtr r'Ptr- TreeItemNameLocator (TreeItemName n') -> isCloseWithPath' treePtr n'+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> isCloseWithPath' treePtr n'') {# fun Fl_Tree_select_with_item as selectWithItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} {# 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' #}+{# fun Fl_Tree_select_with_path as selectWithPath' { id `Ptr ()',`CString' } -> `Int' #}+{# fun Fl_Tree_select_with_path_docallback as selectWithPathDocallback' { id `Ptr ()',`CString',cFromBool `Bool' } -> `Int' #} 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 >>= return . successOrNoChange- TreeItemNameLocator (TreeItemName n') -> selectWithPath' treePtr n' >>= return . successOrNoChange+ TreeItemNameLocator (TreeItemName n') -> withText n' (\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 -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> selectWithItemDocallback' tree_itemPtr itemRefPtr docallback' >> return ()- TreeItemNameLocator (TreeItemName n') -> selectWithPathDocallback' tree_itemPtr n' docallback' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> selectWithPathDocallback' tree_itemPtr n'' docallback' >> return ()) {# fun Fl_Tree_select_toggle as selectToggle' { id `Ptr ()',id `Ptr ()' } -> `()' #} {# fun Fl_Tree_select_toggle_with_docallback as selectToggleWithDocallback' { id `Ptr ()',id `Ptr ()',cFromBool `Bool' } -> `()' #} instance (impl ~ (Ref TreeItem -> IO ()) ) => Op (SelectToggle ()) Tree orig impl where@@ -234,20 +233,20 @@ runOp _ _ tree item docallback = withRef tree $ \treePtr -> withRef item $ \itemPtr -> selectToggleWithDocallback' treePtr itemPtr docallback {# fun Fl_Tree_deselect_with_item as deselectWithItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} {# 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' #}+{# fun Fl_Tree_deselect_with_path as deselectWithPath' { id `Ptr ()', `CString'} -> `Int' #}+{# fun Fl_Tree_deselect_with_path_docallback as deselectWithPathDocallback' { id `Ptr ()',`CString',cFromBool `Bool' } -> `Int' #} 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 >>= return . successOrNoChange- TreeItemNameLocator (TreeItemName n') -> deselectWithPath' treePtr n' >>= return . successOrNoChange+ TreeItemNameLocator (TreeItemName n') -> withText n' (\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 -> case locator' of TreeItemPointerLocator (TreeItemPointer itemRef) -> withRef itemRef $ \itemRefPtr -> deselectWithItemDocallback' tree_itemPtr itemRefPtr docallback' >> return ()- TreeItemNameLocator (TreeItemName n') -> deselectWithPathDocallback' tree_itemPtr n' docallback' >> return ()+ TreeItemNameLocator (TreeItemName n') -> withText n' (\n'' -> deselectWithPathDocallback' tree_itemPtr n'' docallback' >> return ()) {# fun Fl_Tree_select_only as selectOnly' { id `Ptr ()',id `Ptr ()' } -> `()' #} {# fun Fl_Tree_select_only_with_docallback as selectOnlyWithDocallback' { id `Ptr ()',id `Ptr ()', cFromBool `Bool' } -> `()' #} instance (impl ~ (Ref TreeItem -> IO ()) ) => Op (SelectOnly ()) Tree orig impl where@@ -273,12 +272,12 @@ instance (impl ~ ( IO (Maybe (Ref TreeItem))) ) => Op (GetItemFocus ()) Tree orig impl where runOp _ _ tree = withRef tree $ \treePtr -> getItemFocus' treePtr >>= toMaybeRef {# fun Fl_Tree_is_selected_with_item as isSelectedWithItem' { id `Ptr ()',id `Ptr ()' } -> `Bool' cToBool #}-{# fun Fl_Tree_is_selected_with_path as isSelectedWithPath' { id `Ptr ()',unsafeToCString `T.Text' } -> `Bool' cToBool #}+{# fun Fl_Tree_is_selected_with_path as isSelectedWithPath' { id `Ptr ()',`CString' } -> `Bool' cToBool #} instance (impl ~ (TreeItemLocator -> IO (Bool)) ) => Op (IsSelected ()) Tree orig impl where runOp _ _ tree locator' = withRef tree $ \treePtr -> case locator' of TreeItemPointerLocator (TreeItemPointer item) -> withRef item $ \itemPtr -> isSelectedWithItem' treePtr itemPtr- TreeItemNameLocator (TreeItemName path) -> isSelectedWithPath' treePtr path+ TreeItemNameLocator (TreeItemName path) -> withText path (\p -> isSelectedWithPath' treePtr p) {# fun Fl_Tree_item_labelfont as itemLabelfont' { id `Ptr ()' } -> `Font' cToFont #} instance (impl ~ ( IO (Font)) ) => Op (GetItemLabelfont ()) Tree orig impl where runOp _ _ tree = withRef tree $ \treePtr -> itemLabelfont' treePtr
src/Graphics/UI/FLTK/LowLevel/TreeItem.chs view
@@ -74,17 +74,19 @@ {# fun Fl_Tree_Item_h as h' { id `Ptr ()' } -> `Int' #} instance (impl ~ IO Int) => Op (GetH ()) TreeItem orig impl where runOp _ _ tree_item = withRef tree_item $ \tree_itemPtr -> h' tree_itemPtr-{# fun Fl_Tree_Item_show_self_with_indent as showSelfWithIndent' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' #}+{# fun Fl_Tree_Item_show_self_with_indent as showSelfWithIndent' { id `Ptr ()',`CString' } -> `()' #} instance (impl ~ (Maybe T.Text -> IO ())) => Op (ShowSelf ()) TreeItem orig impl where runOp _ _ tree_item indent = case indent of- Just s' -> withRef tree_item $ \tree_itemPtr -> showSelfWithIndent' tree_itemPtr s'- Nothing -> withRef tree_item $ \tree_itemPtr -> showSelfWithIndent' tree_itemPtr ""+ Just s' -> withRef tree_item $ \tree_itemPtr ->+ copyTextToCString s' >>= showSelfWithIndent' tree_itemPtr+ Nothing -> withRef tree_item $ \tree_itemPtr ->+ copyTextToCString "" >>= showSelfWithIndent' tree_itemPtr {# fun Fl_Tree_Item_set_label as setLabel' { id `Ptr ()',id `Ptr CChar ' } -> `()' #} instance (impl ~ ( T.Text -> IO ())) => Op (SetLabel ()) TreeItem orig impl where runOp _ _ tree_item val = withRef tree_item $ \tree_itemPtr -> withText val (\valPtr -> setLabel' tree_itemPtr valPtr)-{# fun Fl_Tree_Item_label as label' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Tree_Item_label as label' { id `Ptr ()' } -> `CString' #} instance (impl ~ (IO T.Text)) => Op (GetLabel ()) TreeItem orig impl where- runOp _ _ tree_item = withRef tree_item $ \tree_itemPtr -> label' tree_itemPtr+ runOp _ _ tree_item = withRef tree_item $ \tree_itemPtr -> label' tree_itemPtr >>= cStringToText {# fun Fl_Tree_Item_set_labelfont as setLabelfont' { id `Ptr ()',cFromFont `Font' } -> `()' #} instance (impl ~ ( Font -> IO ())) => Op (SetLabelfont ()) TreeItem orig impl where runOp _ _ tree_item val = withRef tree_item $ \tree_itemPtr -> setLabelfont' tree_itemPtr val@@ -131,22 +133,22 @@ instance (impl ~ (IO (Bool))) => Op (HasChildren ()) TreeItem orig impl where runOp _ _ tree_item = withRef tree_item $ \tree_itemPtr -> hasChildren' tree_itemPtr -{# fun Fl_Tree_Item_find_child as findChild' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Tree_Item_find_child as findChild' { id `Ptr ()',`CString' } -> `Int' #} {# fun Fl_Tree_Item_find_child_by_item as findChildByItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #} instance (impl ~ ( TreeItemLocator -> IO (Maybe AtIndex))) => Op (FindChild ()) TreeItem orig impl where runOp _ _ tree_item locator' = withRef tree_item $ \tree_itemPtr -> do idx' <- case locator' of (TreeItemPointerLocator (TreeItemPointer item')) -> withRef item' $ \itemPtr-> findChildByItem' tree_itemPtr itemPtr- (TreeItemNameLocator (TreeItemName name')) -> findChild' tree_itemPtr name'+ (TreeItemNameLocator (TreeItemName name')) -> copyTextToCString name' >>= findChild' tree_itemPtr if idx' == -1 then return Nothing else (return $ Just (AtIndex idx')) {# fun Fl_Tree_Item_remove_child_by_item as removeChildByItem' { id `Ptr ()',id `Ptr ()' } -> `Int' #}-{# fun Fl_Tree_Item_remove_child as removeChild' { id `Ptr ()',unsafeToCString `T.Text' } -> `Int' #}+{# fun Fl_Tree_Item_remove_child as removeChild' { id `Ptr ()',`CString' } -> `Int' #} instance (impl ~ ( TreeItemLocator -> IO (Either UnknownError ()))) => Op (RemoveChild ()) TreeItem orig impl where runOp _ _ tree_item locator' = withRef tree_item $ \tree_itemPtr -> do status' <- case locator' of (TreeItemPointerLocator (TreeItemPointer item')) -> withRef item' $ \itemPtr-> removeChildByItem' tree_itemPtr itemPtr- (TreeItemNameLocator (TreeItemName name')) -> removeChild' tree_itemPtr name'+ (TreeItemNameLocator (TreeItemName name')) -> copyTextToCString name' >>= removeChild' tree_itemPtr if (status' < 0) then (return $ Left UnknownError) else (return $ Right ()) {# fun Fl_Tree_Item_clear_children as clearChildren' { id `Ptr ()' } -> `()' #} instance (impl ~ (IO ())) => Op (ClearChildren ()) TreeItem orig impl where@@ -169,13 +171,13 @@ withStrings path (\pathPtr -> findItem' tree_itemPtr (castPtr pathPtr) >>= toMaybeRef) {# fun Fl_Tree_Item_add_with as addWith' {id `Ptr ()', id `Ptr ()', id `Ptr CChar', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_Tree_Item_add_with_at as addWithAt' {id `Ptr ()', id `Ptr ()', id `Ptr ()' , id `Ptr (Ptr CChar)'} -> `Ptr ()' id #}-{# fun Fl_Tree_Item_add as add' {id `Ptr ()', id `Ptr ()', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Tree_Item_add as add' {id `Ptr ()', id `Ptr ()', `CString'} -> `Ptr ()' id #} {# fun Fl_Tree_Item_add_at as addAt' {id `Ptr ()', id `Ptr ()', id `Ptr (Ptr CChar)' } -> `Ptr ()' id #} instance (Parent a TreeItem, Parent b TreePrefs, impl ~ (Ref b -> TreeItemLocator -> IO (Maybe (Ref a)))) => Op (Add ()) TreeItem orig impl where runOp _ _ tree_item prefs arr = withRef tree_item $ \tree_itemPtr -> withRef prefs $ \prefsPtr -> case arr of- TreeItemNameLocator (TreeItemName n') -> add' tree_itemPtr prefsPtr n' >>= toMaybeRef+ TreeItemNameLocator (TreeItemName n') -> copyTextToCString n' >>= \nText -> add' tree_itemPtr prefsPtr nText >>= toMaybeRef TreeItemPointerLocator (TreeItemPointer p') -> withRef p' $ \p'Ptr -> addWith' tree_itemPtr prefsPtr (castPtr nullPtr) p'Ptr >>= toMaybeRef instance (Parent a TreeItem, Parent b TreePrefs, impl ~ (Ref b -> [T.Text] -> Maybe (Ref a) -> IO (Maybe (Ref a)))) => Op (AddAt ()) TreeItem orig impl where runOp _ _ tree_item prefs path item' =@@ -184,20 +186,26 @@ case item' of Nothing -> addAt' tree_itemPtr prefsPtr (castPtr pathPtr) >>= toMaybeRef Just i' -> withRef i' $ \i'Ptr -> addWithAt' tree_itemPtr prefsPtr i'Ptr pathPtr >>= toMaybeRef-{# fun Fl_Tree_Item_insert as insert' { id `Ptr ()',id `Ptr ()',unsafeToCString `T.Text' } -> `Ptr ()' id #}-{# fun Fl_Tree_Item_insert_with_pos as insertWithPos' { id `Ptr ()',id `Ptr ()',unsafeToCString `T.Text',`Int' } -> `Ptr ()' id #}+{# fun Fl_Tree_Item_insert as insert' { id `Ptr ()',id `Ptr ()',`CString' } -> `Ptr ()' id #}+{# fun Fl_Tree_Item_insert_with_pos as insertWithPos' { id `Ptr ()',id `Ptr ()',`CString',`Int' } -> `Ptr ()' id #} instance (Parent a TreePrefs, impl ~ (Ref a -> T.Text -> Maybe AtIndex -> IO (Maybe (Ref TreeItem)))) => Op (Insert ()) TreeItem orig impl where runOp _ _ tree_item prefs new_label pos' = withRef tree_item $ \tree_itemPtr -> withRef prefs $ \prefsPtr -> case pos' of- Nothing -> insert' tree_itemPtr prefsPtr new_label >>= toMaybeRef- Just (AtIndex p') -> insertWithPos' tree_itemPtr prefsPtr new_label p' >>= toMaybeRef-{# fun Fl_Tree_Item_insert_above as insertAbove' { id `Ptr ()',id `Ptr ()', unsafeToCString `T.Text' } -> `Ptr ()' id #}+ Nothing -> do+ t <- copyTextToCString new_label+ insert' tree_itemPtr prefsPtr t >>= toMaybeRef+ Just (AtIndex p') -> do+ t <- copyTextToCString new_label+ insertWithPos' tree_itemPtr prefsPtr t p' >>= toMaybeRef+{# fun Fl_Tree_Item_insert_above as insertAbove' { id `Ptr ()',id `Ptr ()', `CString' } -> `Ptr ()' id #} instance (Parent a TreePrefs, impl ~ (Ref a -> T.Text -> IO (Maybe (Ref TreeItem)))) => Op (InsertAbove ()) TreeItem orig impl where runOp _ _ tree_item prefs new_label = withRef tree_item $ \tree_itemPtr ->- withRef prefs $ \prefsPtr -> insertAbove' tree_itemPtr prefsPtr new_label >>= toMaybeRef+ withRef prefs $ \prefsPtr -> do+ t <- copyTextToCString new_label+ insertAbove' tree_itemPtr prefsPtr t >>= toMaybeRef {# fun Fl_Tree_Item_deparent as deparent' { id `Ptr ()', `Int'} -> `Ptr ()' id #} instance (impl ~ (AtIndex -> IO (Either UnknownError (Ref orig)))) => Op (Deparent ()) TreeItem orig impl where runOp _ _ tree_item (AtIndex pos') = withRef tree_item $ \tree_itemPtr -> do
src/Graphics/UI/FLTK/LowLevel/Utils.hs view
@@ -9,6 +9,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T import Data.List+import Data.Maybe import qualified Data.Text.Foreign as TF import qualified Data.Text.Encoding as E import Foreign@@ -300,18 +301,6 @@ let result = wrapInRef pp return $ result -unsafeToRef :: Ptr () -> (Ref a)-unsafeToRef = Unsafe.unsafePerformIO . toRef--unsafeToMaybeRef :: Ptr () -> Maybe (Ref a)-unsafeToMaybeRef = Unsafe.unsafePerformIO . toMaybeRef--unsafeToCString :: T.Text -> CString-unsafeToCString t = Unsafe.unsafePerformIO (copyTextToCString t)--unsafeFromCString :: CString -> T.Text-unsafeFromCString cstring = Unsafe.unsafePerformIO (cStringToText cstring)- #ifdef CALLSTACK_AVAILABLE cStringToText :: (?loc :: CallStack) => CString -> IO T.Text #elif defined(HASCALLSTACK_AVAILABLE)@@ -319,12 +308,21 @@ #else cStringToText :: CString -> IO T.Text #endif-cStringToText cstring =- if (cstring == nullPtr) then return ""+cStringToText = fmap (fromMaybe "") . cStringToMaybeText++#ifdef CALLSTACK_AVAILABLE+cStringToMaybeText :: (?loc :: CallStack) => CString -> IO (Maybe T.Text)+#elif defined(HASCALLSTACK_AVAILABLE)+cStringToMaybeText :: (HasCallStack) => CString -> IO (Maybe T.Text)+#else+cStringToMaybeText :: CString -> IO (Maybe T.Text)+#endif+cStringToMaybeText cstring =+ if (cstring == nullPtr) then return Nothing else do byteString <- B.packCString cstring either (\e -> traceStack (show e) (error ""))- return+ (return . Just) (E.decodeUtf8' byteString) toMaybeRef :: Ptr () -> IO (Maybe (Ref a))
src/Graphics/UI/FLTK/LowLevel/Valuator.chs view
@@ -37,8 +37,8 @@ #endc {#enum ValuatorType {} deriving (Show, Eq) #} {# fun Fl_Valuator_New as valuatorNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Valuator_New_WithLabel as valuatorNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}-{# fun Fl_OverriddenValuator_New_WithLabel as overriddenValuatorNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_Valuator_New_WithLabel as valuatorNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #}+{# fun Fl_OverriddenValuator_New_WithLabel as overriddenValuatorNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenValuator_New as overriddenValuatorNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} valuatorCustom :: Rectangle -> Maybe T.Text -> Maybe (Ref Valuator -> IO ()) -> Maybe (CustomWidgetFuncs Valuator) -> IO (Ref Valuator) valuatorCustom rectangle l' draw' funcs' =
src/Graphics/UI/FLTK/LowLevel/ValueInput.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenValue_Input_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenValue_Input_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenValue_Input_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} valueInputCustom :: Rectangle -- ^ The bounds of this ValueInput@@ -43,7 +43,7 @@ overriddenWidgetNewWithLabel' {# fun Fl_Value_Input_New as valueInputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Value_Input_New_WithLabel as valueInputNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Value_Input_New_WithLabel as valueInputNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} valueInputNew :: Rectangle -> Maybe T.Text -> IO (Ref ValueInput) valueInputNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/ValueOutput.chs view
@@ -25,7 +25,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenValue_Output_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenValue_Output_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenValue_Output_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} valueOutputCustom :: Rectangle -- ^ The bounds of this ValueOutput@@ -44,7 +44,7 @@ {# fun Fl_Value_Output_New as valueOutputNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Value_Output_New_WithLabel as valueOutputNewWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Value_Output_New_WithLabel as valueOutputNewWithLabel' { `Int',`Int',`Int',`Int',`CString'} -> `Ptr ()' id #} valueOutputNew :: Rectangle -> Maybe T.Text -> IO (Ref ValueOutput) valueOutputNew rectangle l'= widgetMaker
src/Graphics/UI/FLTK/LowLevel/ValueSlider.chs view
@@ -26,7 +26,7 @@ import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T -{# fun Fl_OverriddenValue_Slider_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenValue_Slider_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenValue_Slider_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} valueSliderCustom :: Rectangle -- ^ The bounds of this ValueSlider@@ -45,7 +45,7 @@ {# fun Fl_Value_Slider_New as valueSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}-{# fun Fl_Value_Slider_New_WithLabel as valueSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Value_Slider_New_WithLabel as valueSliderNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} valueSliderNew :: Rectangle -> Maybe T.Text -> IO (Ref ValueSlider) valueSliderNew rectangle l'= widgetMaker@@ -55,15 +55,6 @@ Nothing overriddenWidgetNew' overriddenWidgetNewWithLabel'---- {# fun Fl_Hor_Value_Slider_New as horValueSliderNew' { `Int',`Int',`Int',`Int' } -> `Ptr ()' id #}--- {# fun Fl_Hor_Value_Slider_New_WithLabel as horValueSliderNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}--- horValueSliderNew :: Rectangle -> Maybe String -> IO (HorValueSlider ())--- horValueSliderNew rectangle l'=--- let (x_pos, y_pos, width, height) = fromRectangle rectangle--- in case l' of--- Nothing -> horValueSliderNew' x_pos y_pos width height >>= toRef--- Just l -> horValueSliderNewWithLabel' x_pos y_pos width height l >>= toRef {# fun Fl_Value_Slider_Destroy as valueSliderDestroy' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ (IO ())) => Op (Destroy ()) ValueSlider orig impl where
src/Graphics/UI/FLTK/LowLevel/Widget.chs view
@@ -183,21 +183,21 @@ -> Maybe (Ref a -> IO ()) -- ^ Custom drawing function -> Maybe (CustomWidgetFuncs a) -- ^ Custom functions -> (Int -> Int -> Int -> Int -> Ptr () -> IO ( Ptr () )) -- ^ Foreign constructor to call if only custom functions are given- -> (Int -> Int -> Int -> Int -> T.Text -> Ptr () -> IO ( Ptr () )) -- ^ Foreign constructor to call if both title and custom functions are given+ -> (Int -> Int -> Int -> Int -> CString -> Ptr () -> IO ( Ptr () )) -- ^ Foreign constructor to call if both title and custom functions are given -> IO (Ref a) -- ^ Reference to the widget widgetMaker rectangle _label' draw' customFuncs' newWithCustomFuncs' newWithCustomFuncsLabel' = do let (x_pos, y_pos, width, height) = fromRectangle rectangle ptr <- customWidgetFunctionStruct draw' (maybe defaultCustomWidgetFuncs id customFuncs') widget <- maybe (newWithCustomFuncs' x_pos y_pos width height (castPtr ptr))- (\l -> newWithCustomFuncsLabel' x_pos y_pos width height l (castPtr ptr))+ (\l -> copyTextToCString l >>= \l' -> newWithCustomFuncsLabel' x_pos y_pos width height l' (castPtr ptr)) _label' ref <- toRef widget setFlag (safeCast ref :: Ref Widget) WidgetFlagCopiedLabel setFlag (safeCast ref :: Ref Widget) WidgetFlagCopiedTooltip return ref -{# fun Fl_OverriddenWidget_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenWidget_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenWidget_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} -- | Widget constructor. widgetCustom :: Rectangle -- ^ The bounds of this widget@@ -205,10 +205,10 @@ -> (Ref Widget -> IO ()) -- ^ Custom drawing function -> CustomWidgetFuncs Widget -- ^ Other custom functions -> IO (Ref Widget)-widgetCustom rectangle l' draw' funcs' = do+widgetCustom rectangle label' draw' funcs' = do ref <- widgetMaker rectangle- l'+ label' (Just draw') (Just funcs') overriddenWidgetNew'@@ -312,9 +312,9 @@ {# fun Fl_Widget_set_selection_color as setSelectionColor' { id `Ptr ()',cFromColor `Color' } -> `()' supressWarningAboutRes #} instance (impl ~ (Color -> IO ())) => Op (SetSelectionColor ()) Widget orig impl where runOp _ _ widget a = withRef widget $ \widgetPtr -> setSelectionColor' widgetPtr a-{# fun Fl_Widget_label as label' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Widget_label as label' { id `Ptr ()' } -> `CString' #} instance (impl ~ IO T.Text) => Op (GetLabel ()) Widget orig impl where- runOp _ _ widget = withRef widget $ \widgetPtr -> label' widgetPtr+ runOp _ _ widget = withRef widget $ \widgetPtr -> label' widgetPtr >>= cStringToText {# fun Fl_Widget_copy_label as copyLabel' { id `Ptr ()', `CString' } -> `()' supressWarningAboutRes #} instance (impl ~ ( T.Text -> IO ())) => Op (SetLabel ()) Widget orig impl where runOp _ _ widget text =@@ -354,27 +354,27 @@ {# fun Fl_Widget_set_labelsize as setLabelsize' { id `Ptr ()',id `CInt' } -> `()' supressWarningAboutRes #} instance (impl ~ ( FontSize -> IO ())) => Op (SetLabelsize ()) Widget orig impl where runOp _ _ widget (FontSize pix) = withRef widget $ \widgetPtr -> setLabelsize' widgetPtr pix-{# fun Fl_Widget_image as image' { id `Ptr ()' } -> `Maybe (Ref Image)' unsafeToMaybeRef #}+{# fun Fl_Widget_image as image' { id `Ptr ()' } -> `Ptr ()' #} instance (impl ~ (IO (Maybe (Ref Image)))) => Op (GetImage ()) Widget orig impl where- runOp _ _ widget = withRef widget $ \widgetPtr -> image' widgetPtr+ runOp _ _ widget = withRef widget $ \widgetPtr -> image' widgetPtr >>= toMaybeRef {# fun Fl_Widget_set_image as setImage' { id `Ptr ()',id `Ptr ()'} -> `()' supressWarningAboutRes #} instance (Parent a Image, impl ~ (Maybe( Ref a ) -> IO ())) => Op (SetImage ()) Widget orig impl where runOp _ _ widget pix = withRef widget $ \widgetPtr -> withMaybeRef pix $ \pixPtr -> setImage' widgetPtr pixPtr-{# fun Fl_Widget_deimage as deimage' { id `Ptr ()' } -> `Maybe (Ref Image)' unsafeToMaybeRef #}+{# fun Fl_Widget_deimage as deimage' { id `Ptr ()' } -> `Ptr ()' #} instance (impl ~ (IO (Maybe (Ref Image)))) => Op (GetDeimage ()) Widget orig impl where- runOp _ _ widget = withRef widget $ \widgetPtr -> deimage' widgetPtr+ runOp _ _ widget = withRef widget $ \widgetPtr -> deimage' widgetPtr >>= toMaybeRef {# fun Fl_Widget_set_deimage as setDeimage' { id `Ptr ()',id `Ptr ()'} -> `()' supressWarningAboutRes #} instance (Parent a Image, impl ~ (Maybe( Ref a ) -> IO ())) => Op (SetDeimage ()) Widget orig impl where runOp _ _ widget pix = withRef widget $ \widgetPtr -> withMaybeRef pix $ \pixPtr -> setDeimage' widgetPtr pixPtr-{# fun Fl_Widget_tooltip as tooltip' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Widget_tooltip as tooltip' { id `Ptr ()' } -> `CString' #} instance (impl ~ (IO T.Text)) => Op (GetTooltip ()) Widget orig impl where- runOp _ _ widget = withRef widget $ \widgetPtr -> tooltip' widgetPtr-{# fun Fl_Widget_copy_tooltip as copyTooltip' { id `Ptr ()', unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+ runOp _ _ widget = withRef widget $ \widgetPtr -> tooltip' widgetPtr >>= cStringToText+{# fun Fl_Widget_copy_tooltip as copyTooltip' { id `Ptr ()', `CString' } -> `()' supressWarningAboutRes #} instance (impl ~ ( T.Text -> IO ())) => Op (CopyTooltip ()) Widget orig impl where- runOp _ _ widget text = withRef widget $ \widgetPtr -> copyTooltip' widgetPtr text+ runOp _ _ widget text = withRef widget $ \widgetPtr -> withText text (\t -> copyTooltip' widgetPtr t) {# fun Fl_Widget_set_tooltip as setTooltip' { id `Ptr ()', `CString' } -> `()' supressWarningAboutRes #} instance (impl ~ ( T.Text -> IO ())) => Op (SetTooltip ()) Widget orig impl where- runOp _ _ widget text = withRef widget $ \widgetPtr -> withCString (T.unpack text) (\sPtr -> copyTooltip' widgetPtr text)+ runOp _ _ widget text = withRef widget $ \widgetPtr -> withText text (copyTooltip' widgetPtr) {# fun Fl_Widget_when as when' { id `Ptr ()' } -> `CInt' id #} instance (impl ~ IO [When]) => Op (GetWhen ()) Widget orig impl where runOp _ _ widget = withRef widget $ \widgetPtr ->
src/Graphics/UI/FLTK/LowLevel/Window.chs view
@@ -92,9 +92,9 @@ CustomWidgetFuncs b -> CustomWindowFuncs a -> (Int -> Int -> Ptr () -> IO (Ptr ())) ->- (Int -> Int -> T.Text -> Ptr () -> IO (Ptr ())) ->+ (Int -> Int -> CString -> Ptr () -> IO (Ptr ())) -> (Int -> Int -> Int -> Int -> Ptr () -> IO (Ptr ())) ->- (Int -> Int -> Int -> Int -> T.Text -> Ptr () -> IO (Ptr ())) ->+ (Int -> Int -> Int -> Int -> CString -> Ptr () -> IO (Ptr ())) -> IO (Ref a) windowMaker (Size (Width w) (Height h)) position@@ -113,16 +113,16 @@ ref <- case (position, title) of (Nothing, Nothing) -> custom' w h p >>= toRef (Just (Position (X x) (Y y)), Nothing) -> customXY' x y w h p >>= toRef- (Just (Position (X x) (Y y)), (Just l')) -> customXYWithLabel' x y w h l' p >>= toRef- (Nothing, (Just l')) -> customWithLabel' w h l' p >>= toRef+ (Just (Position (X x) (Y y)), (Just l')) -> copyTextToCString l' >>= \l'' -> customXYWithLabel' x y w h l'' p >>= toRef+ (Nothing, (Just l')) -> copyTextToCString l' >>= \l'' -> customWithLabel' w h l'' p >>= toRef setFlag (safeCast ref :: Ref Window) WidgetFlagCopiedLabel setFlag (safeCast ref :: Ref Window) WidgetFlagCopiedTooltip return ref {# fun Fl_OverriddenWindow_New as overriddenWindowNew' {`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenWindow_NewXY as overriddenWindowNewXY' {`Int',`Int', `Int', `Int', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenWindow_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}-{# fun Fl_OverriddenWindow_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenWindow_NewXY_WithLabel as overriddenWindowNewXYWithLabel' { `Int',`Int',`Int',`Int',`CString', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenWindow_New_WithLabel as overriddenWindowNewWithLabel' { `Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} windowCustom :: Size -- ^ Size of this window -> Maybe Position -- ^ Optional position of this window -> Maybe T.Text -- ^ Optional label@@ -314,37 +314,40 @@ structPtr <- optionalSizeRangeArgsToStruct args sizeRangeWithArgs' winPtr minw' minh' structPtr -{# fun Fl_Window_label as label' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Window_label as label' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetLabel ()) Window orig impl where- runOp _ _ win = withRef win $ \winPtr -> label' winPtr+ runOp _ _ win = withRef win $ \winPtr -> label' winPtr >>= cStringToText -{# fun Fl_Window_iconlabel as iconlabel' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Window_iconlabel as iconlabel' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetIconlabel ()) Window orig impl where- runOp _ _ win = withRef win $ \winPtr -> iconlabel' winPtr+ runOp _ _ win = withRef win $ \winPtr -> iconlabel' winPtr >>= cStringToText -{# fun Fl_Window_set_label as setLabel' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Window_set_label as setLabel' { id `Ptr ()',`CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> IO ())) => Op (SetLabel ()) Window orig impl where- runOp _ _ win l' = withRef win $ \winPtr -> setLabel' winPtr l'+ runOp _ _ win l' = withRef win $ \winPtr -> copyTextToCString l' >>= setLabel' winPtr -{# fun Fl_Window_set_iconlabel as setIconlabel' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Window_set_iconlabel as setIconlabel' { id `Ptr ()',`CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> IO ())) => Op (SetIconlabel ()) Window orig impl where- runOp _ _ win l' = withRef win $ \winPtr -> setIconlabel' winPtr l'+ runOp _ _ win l' = withRef win $ \winPtr -> copyTextToCString l' >>= setIconlabel' winPtr -{# fun Fl_Window_set_label_with_iconlabel as setLabelWithIconlabel' { id `Ptr ()',unsafeToCString `T.Text',unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Window_set_label_with_iconlabel as setLabelWithIconlabel' { id `Ptr ()',`CString',`CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> T.Text -> IO ())) => Op (SetLabelWithIconlabel ()) Window orig impl where- runOp _ _ win label iconlabel = withRef win $ \winPtr -> setLabelWithIconlabel' winPtr label iconlabel+ runOp _ _ win label iconlabel = withRef win $ \winPtr -> do+ l' <- copyTextToCString label+ il' <- copyTextToCString iconlabel+ setLabelWithIconlabel' winPtr l' il' -{# fun Fl_Window_copy_label as copyLabel' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Window_copy_label as copyLabel' { id `Ptr ()',`CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> IO ())) => Op (CopyLabel ()) Window orig impl where- runOp _ _ win a = withRef win $ \winPtr -> copyLabel' winPtr a+ runOp _ _ win a = withRef win $ \winPtr -> withText a (copyLabel' winPtr) -{# fun Fl_Window_xclass as xclass' { id `Ptr ()' } -> `T.Text' unsafeFromCString #}+{# fun Fl_Window_xclass as xclass' { id `Ptr ()' } -> `CString' #} instance (impl ~ ( IO T.Text)) => Op (GetXclass ()) Window orig impl where- runOp _ _ win = withRef win $ \winPtr -> xclass' winPtr+ runOp _ _ win = withRef win $ \winPtr -> xclass' winPtr >>= cStringToText -{# fun Fl_Window_set_xclass as setXclass' { id `Ptr ()',unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #}+{# fun Fl_Window_set_xclass as setXclass' { id `Ptr ()',`CString' } -> `()' supressWarningAboutRes #} instance (impl ~ (T.Text -> IO ())) => Op (SetXclass ()) Window orig impl where- runOp _ _ win c = withRef win $ \winPtr -> setXclass' winPtr c+ runOp _ _ win c = withRef win $ \winPtr -> copyTextToCString c >>= setXclass' winPtr {# fun Fl_Window_icon as icon' { id `Ptr ()' } -> `Ptr ()' id #} instance (impl ~ ( IO (Maybe (Ref Image)))) => Op (GetIcon ()) Window orig impl where
src/Graphics/UI/FLTK/LowLevel/Wizard.chs view
@@ -24,7 +24,7 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.Dispatch import qualified Data.Text as T-{# fun Fl_OverriddenWizard_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text', id `Ptr ()'} -> `Ptr ()' id #}+{# fun Fl_OverriddenWizard_New_WithLabel as overriddenWidgetNewWithLabel' { `Int',`Int',`Int',`Int', `CString', id `Ptr ()'} -> `Ptr ()' id #} {# fun Fl_OverriddenWizard_New as overriddenWidgetNew' { `Int',`Int',`Int',`Int', id `Ptr ()'} -> `Ptr ()' id #} wizardCustom :: Rectangle -- ^ The bounds of this Wizard@@ -43,7 +43,7 @@ {# fun Fl_Wizard_New as wizardNew' { `Int',`Int', `Int', `Int'} -> `Ptr ()' id #}-{# fun Fl_Wizard_New_WithLabel as wizardNewWithLabel' { `Int',`Int',`Int',`Int', unsafeToCString `T.Text'} -> `Ptr ()' id #}+{# fun Fl_Wizard_New_WithLabel as wizardNewWithLabel' { `Int',`Int',`Int',`Int', `CString'} -> `Ptr ()' id #} wizardNew :: Rectangle -> Maybe T.Text -> IO (Ref Wizard) wizardNew rectangle label' = widgetMaker
src/Graphics/UI/FLTK/LowLevel/XBMImage.chs view
@@ -18,10 +18,10 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.Text as T-{# fun Fl_XBM_Image_New as xbmImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_XBM_Image_New as xbmImageNew' { `CString' } -> `Ptr ()' id #} xbmImageNew :: T.Text -> IO (Either UnknownError (Ref XBMImage)) xbmImageNew filename' = do- ptr <- xbmImageNew' filename'+ ptr <- withText filename' (\f -> xbmImageNew' f) ref' <- (toRef ptr :: IO (Ref XBMImage)) checkImage ref'
src/Graphics/UI/FLTK/LowLevel/XPMImage.chs view
@@ -18,10 +18,10 @@ import Graphics.UI.FLTK.LowLevel.Hierarchy import Graphics.UI.FLTK.LowLevel.RGBImage import qualified Data.Text as T-{# fun Fl_XPM_Image_New as xpmImageNew' { unsafeToCString `T.Text' } -> `Ptr ()' id #}+{# fun Fl_XPM_Image_New as xpmImageNew' { `CString' } -> `Ptr ()' id #} xpmImageNew :: T.Text -> IO (Either UnknownError (Ref XPMImage)) xpmImageNew filename' = do- ptr <- xpmImageNew' filename'+ ptr <- withText filename' xpmImageNew' ref' <- (toRef ptr :: IO (Ref XPMImage)) checkImage ref'