-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | tinytools-vty is a terminal based monospace unicode diagram editing tool -- -- tinytools-vty is a terminal based monospace unicode diagram editing -- tool @package tinytools-vty @version 0.1.0.4 module Data.String.Unicode.Lookup module Potato.Flow.TutorialState tutorialState :: (OwlPFState, ControllerMeta) module Potato.Flow.Vty.Attrs lg_default :: Attr lg_textfield_normal :: Attr lg_textfield_modifying :: Attr lg_textfield_cursor :: Attr lg_layer_inheritselect :: Attr lg_layer_selected :: Attr lg_manip :: Attr lg_canvas_cursor :: Attr lg_canvas_default :: Attr lg_canvas_oob :: Attr renderHandlerColorToVtyColor :: RenderHandleColor -> Color lg_make_canvas_cursor :: RenderHandleColor -> Attr module Potato.Flow.Vty.Input convertModifiers :: [Modifier] -> [KeyModifier] convertKey :: Key -> Maybe KeyboardKey convertButton :: Button -> Maybe MouseButton makeLMouseDataInputEv :: (Reflex t, MonadFix m, MonadHold t m, HasInput t m) => Dynamic t (Int, Int) -> Bool -> m (Event t LMouseData) module Potato.Flow.Vty.PotatoReader kTinyToolsFileExtension :: IsString a => a addTinyToolsFileExtensionIfNecessary :: FilePath -> FilePath data PotatoStyle PotatoStyle :: Attr -> (RenderHandleColor -> Attr) -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> PotatoStyle [_potatoStyle_canvasCursor] :: PotatoStyle -> Attr [_potatoStyle_makeCanvasManipulator] :: PotatoStyle -> RenderHandleColor -> Attr [_potatoStyle_normal] :: PotatoStyle -> Attr [_potatoStyle_selected] :: PotatoStyle -> Attr [_potatoStyle_layers_softSelected] :: PotatoStyle -> Attr [_potatoStyle_canvas_oob] :: PotatoStyle -> Attr [_potatoStyle_textfield_normal] :: PotatoStyle -> Attr [_potatoStyle_textfield_modifying] :: PotatoStyle -> Attr [_potatoStyle_textfield_cursor] :: PotatoStyle -> Attr data PotatoConfig t PotatoConfig :: Behavior t PotatoStyle -> Behavior t (Maybe FilePath) -> Behavior t FilePath -> Behavior t (Maybe FilePath) -> PotatoConfig t [_potatoConfig_style] :: PotatoConfig t -> Behavior t PotatoStyle [_potatoConfig_appCurrentOpenFile] :: PotatoConfig t -> Behavior t (Maybe FilePath) [_potatoConfig_appCurrentDirectory] :: PotatoConfig t -> Behavior t FilePath [_potatoConfig_appPrintFile] :: PotatoConfig t -> Behavior t (Maybe FilePath) -- | A class for things that can dynamically gain and lose focus class (Reflex t, Monad m) => HasPotato t m | m -> t askPotato :: HasPotato t m => m (PotatoConfig t) -- | A widget that has access to information about whether it is focused newtype PotatoReader t m a PotatoReader :: ReaderT (PotatoConfig t) m a -> PotatoReader t m a [unPotatoReader] :: PotatoReader t m a -> ReaderT (PotatoConfig t) m a -- | Run a FocusReader action with the given focus value TODO flip -- arg order to match ReaderT oops... runPotatoReader :: (Reflex t, Monad m) => PotatoReader t m a -> PotatoConfig t -> m a instance Reflex.Class.MonadSample t m => Reflex.Class.MonadSample t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Control.Monad.Ref.MonadRef m => Control.Monad.Ref.MonadRef (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Class.MonadHold t m => Reflex.Class.MonadHold t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance GHC.Base.Monad m => GHC.Base.Monad (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance GHC.Base.Functor m => GHC.Base.Functor (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.NotReady.Class.NotReady t m => Reflex.NotReady.Class.NotReady t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.PerformEvent.Class.PerformEvent t m => Reflex.PerformEvent.Class.PerformEvent t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.PostBuild.Class.PostBuild t m => Reflex.PostBuild.Class.PostBuild t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.TriggerEvent.Class.TriggerEvent t m => Reflex.TriggerEvent.Class.TriggerEvent t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance (Reflex.Vty.Widget.HasInput t m, GHC.Base.Monad m) => Reflex.Vty.Widget.HasInput t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Vty.Widget.Layout.HasFocus t m => Reflex.Vty.Widget.Layout.HasFocus t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Vty.Widget.HasFocusReader t m => Reflex.Vty.Widget.HasFocusReader t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Vty.Widget.HasTheme t m => Reflex.Vty.Widget.HasTheme t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Vty.Widget.HasDisplayRegion t m => Reflex.Vty.Widget.HasDisplayRegion t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance (GHC.Base.Monad m, Reflex.Class.Reflex t) => Potato.Flow.Vty.PotatoReader.HasPotato t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Reflex.Vty.Widget.HasImageWriter t m => Reflex.Vty.Widget.HasImageWriter t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance (Reflex.Class.Reflex t, Reflex.Vty.Widget.Layout.HasLayout t m) => Reflex.Vty.Widget.Layout.HasLayout t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance (Reflex.Adjustable.Class.Adjustable t m, Control.Monad.Fix.MonadFix m, Reflex.Class.MonadHold t m) => Reflex.Adjustable.Class.Adjustable t (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Control.Monad.Trans.Class.MonadTrans (Potato.Flow.Vty.PotatoReader.PotatoReader t) instance Control.Monad.NodeId.MonadNodeId m => Control.Monad.NodeId.MonadNodeId (Potato.Flow.Vty.PotatoReader.PotatoReader t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Control.Monad.Trans.Reader.ReaderT x m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.BehaviorWriter.Base.BehaviorWriterT t x m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.DynamicWriter.Base.DynamicWriterT t x m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.EventWriter.Base.EventWriterT t x m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Control.Monad.NodeId.NodeIdT m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.Input t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.ImageWriter t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.DisplayRegion t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.FocusReader t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.Layout.Focus t m) instance Potato.Flow.Vty.PotatoReader.HasPotato t m => Potato.Flow.Vty.PotatoReader.HasPotato t (Reflex.Vty.Widget.Layout.Layout t m) instance Reflex.Class.Reflex t => Data.Default.Class.Default (Potato.Flow.Vty.PotatoReader.PotatoConfig t) instance Data.Default.Class.Default Potato.Flow.Vty.PotatoReader.PotatoStyle instance (Reflex.Vty.Widget.HasInput t m, GHC.Base.Monad m) => Reflex.Vty.Widget.HasInput t (Control.Monad.Trans.Reader.ReaderT r m) instance (Reflex.Class.Reflex t, Reflex.Vty.Widget.Layout.HasFocus t m, GHC.Base.Monad m) => Reflex.Vty.Widget.Layout.HasFocus t (Control.Monad.Trans.Reader.ReaderT r m) module Potato.Reflex.Vty.Host -- | A functional reactive vty application. type VtyApp t m = MonadVtyApp t m => DisplayRegion " The initial display size (updates to this come as events)" -> Event t Event " Vty input events." -> m (VtyResult t) " The output of the 'VtyApp'. The application runs in a context that, among other things, allows new events to be created and triggered ('TriggerEvent'), provides access to an event that fires immediately upon app instantiation ('PostBuild'), and allows actions to be run upon occurrences of events ('PerformEvent')." -- | The output of a VtyApp. data VtyResult t VtyResult :: Behavior t Picture -> Event t () -> VtyResult t -- | The current vty output. runVtyAppWithHandle samples this value -- every time an event fires and updates the display. [_vtyResult_picture] :: VtyResult t -> Behavior t Picture -- | An event that requests application termination. [_vtyResult_shutdown] :: VtyResult t -> Event t () -- | Returns the standard vty configuration with mouse mode enabled. getDefaultVty :: IO Vty -- | Run a VtyApp with a Vty handle with a standard -- configuration. runVtyApp :: (forall t m. VtyApp t m) -> IO () -- | Runs a VtyApp in a given Vty. Same as -- Reflex.Vty.runVtyAppWithHandle except does some bonus potato stuff runVtyAppWithHandle :: Vty -> (forall t m. VtyApp t m) -> IO () -- | The constraints necessary to run a VtyApp. See -- runVtyAppWithHandle for more on why each of these are necessary -- and how they can be fulfilled. type MonadVtyApp t m = (Reflex t, MonadHold t m, MonadFix m, PrimMonad (HostFrame t), ReflexHost t, MonadIO (HostFrame t), Ref m ~ IORef, Ref (HostFrame t) ~ IORef, MonadRef (HostFrame t), NotReady t m, TriggerEvent t m, PostBuild t m, PerformEvent t m, MonadIO m, MonadIO (Performable m), MonadSample t (Performable m), Adjustable t m) -- | A synonym for the underlying vty event type from Vty. This -- should probably ultimately be replaced by something defined in this -- library. type VtyEvent = Event module Potato.Reflex.Vty.Widget data SingleClick SingleClick :: Button -> (Int, Int) -> [Modifier] -> Bool -> SingleClick [_singleClick_button] :: SingleClick -> Button -- | coordinates of down click [_singleClick_coordinates] :: SingleClick -> (Int, Int) [_singleClick_modifiers] :: SingleClick -> [Modifier] [_singleClick_didDragOff] :: SingleClick -> Bool singleClick :: (Reflex t, MonadHold t m, MonadFix m, HasInput t m) => Button -> m (Event t SingleClick) singleClickNoDragOffSimple :: (Reflex t, MonadHold t m, MonadFix m, HasInput t m) => Button -> m (Event t ()) singleClickWithDownState :: (Reflex t, MonadHold t m, MonadFix m, HasInput t m) => Button -> m (Event t SingleClick, Dynamic t Bool) data DoubleClickConfig DoubleClickConfig :: Integer -> Button -> DoubleClickConfig [_doubleClickConfig_timeTolerance] :: DoubleClickConfig -> Integer [_dobuleClickConfig_button] :: DoubleClickConfig -> Button doubleClick :: (Reflex t, MonadHold t m, MonadFix m, PerformEvent t m, MonadIO (Performable m), HasInput t m) => DoubleClickConfig -> m (Event t ()) doubleClickSimple :: (Reflex t, MonadHold t m, MonadFix m, PerformEvent t m, MonadIO (Performable m), HasInput t m) => m (Event t ()) -- | A split of the available space into two parts with a draggable -- separator. Starts with half the space allocated to each, and the first -- pane has focus. Clicking in a pane switches focus. splitHDrag :: (Reflex t, MonadFix m, MonadHold t m, HasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasFocusReader t m) => Int -> m () -> m a -> m b -> m (a, b) data DragState DragStart :: DragState Dragging :: DragState DragEnd :: DragState -- | Same as Drag but able to track drag start case data Drag2 Drag2 :: (Int, Int) -> (Int, Int) -> Button -> [Modifier] -> DragState -> Drag2 -- | Where the drag began [_drag2_from] :: Drag2 -> (Int, Int) -- | Where the mouse currently is [_drag2_to] :: Drag2 -> (Int, Int) -- | Which mouse button is dragging [_drag2_button] :: Drag2 -> Button -- | What modifiers are held [_drag2_modifiers] :: Drag2 -> [Modifier] -- | Whether the drag ended (the mouse button was released) [_drag2_state] :: Drag2 -> DragState -- | Same as drag but returns Drag2 which tracks drag start -- events drag2 :: (Reflex t, MonadFix m, MonadHold t m, HasInput t m) => Button -> m (Event t Drag2) instance GHC.Show.Show Potato.Reflex.Vty.Widget.SingleClick instance GHC.Classes.Ord Potato.Reflex.Vty.Widget.SingleClick instance GHC.Classes.Eq Potato.Reflex.Vty.Widget.SingleClick instance GHC.Show.Show Potato.Reflex.Vty.Widget.DragState instance GHC.Classes.Ord Potato.Reflex.Vty.Widget.DragState instance GHC.Classes.Eq Potato.Reflex.Vty.Widget.DragState instance GHC.Show.Show Potato.Reflex.Vty.Widget.Drag2 instance GHC.Classes.Ord Potato.Reflex.Vty.Widget.Drag2 instance GHC.Classes.Eq Potato.Reflex.Vty.Widget.Drag2 module Potato.Reflex.Vty.Helpers type MonadWidget t m = (Reflex t, MonadHold t m, MonadFix m, NotReady t m, Adjustable t m, PostBuild t m, PerformEvent t m, TriggerEvent t m, MonadNodeId m, MonadIO (Performable m), MonadSample t m, MonadIO m, HasImageWriter t m, MonadNodeId m, HasDisplayRegion t m, HasFocusReader t m, HasInput t m, HasTheme t m) type MonadLayoutWidget t m = (MonadWidget t m, HasFocus t m, HasLayout t m) debugFocus :: (HasFocusReader t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => m () debugInput :: (MonadHold t m, HasInput t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => m () debugSize :: (MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => m () dragTest :: (MonadHold t m, MonadFix m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasTheme t m) => m () richTextConfig_simpleForeColorAttr :: Reflex t => RichTextConfig t debugStreamBeh :: (MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => [Behavior t Text] -> m () debugStream :: (MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => [Event t Text] -> m () fmapLabelShow :: (Functor f, Show a) => Text -> f a -> f Text countEv :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Dynamic t Int) vLayoutPad :: (PostBuild t m, MonadHold t m, MonadFix m, MonadNodeId m, HasFocusReader t m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m) => Int -> m a -> m a drag2AttachOnStart :: forall t m a. (Reflex t, MonadFix m, MonadHold t m, HasInput t m) => Button -> Behavior t a -> m (Event t (a, Drag2)) module Potato.Flow.Vty.Info data InfoWidgetConfig t InfoWidgetConfig :: Dynamic t Selection -> InfoWidgetConfig t [_infoWidgetConfig_selection] :: InfoWidgetConfig t -> Dynamic t Selection data InfoWidget t InfoWidget :: InfoWidget t holdInfoWidget :: forall t m. MonadWidget t m => InfoWidgetConfig t -> m (InfoWidget t) module Potato.Flow.Vty.Canvas data CanvasWidgetConfig t CanvasWidgetConfig :: Dynamic t XY -> Dynamic t BroadPhaseState -> Dynamic t RenderedCanvasRegion -> Dynamic t RenderedCanvasRegion -> Dynamic t SCanvas -> Dynamic t HandlerRenderOutput -> CanvasWidgetConfig t [_canvasWidgetConfig_pan] :: CanvasWidgetConfig t -> Dynamic t XY [_canvasWidgetConfig_broadPhase] :: CanvasWidgetConfig t -> Dynamic t BroadPhaseState [_canvasWidgetConfig_renderedCanvas] :: CanvasWidgetConfig t -> Dynamic t RenderedCanvasRegion [_canvasWidgetConfig_renderedSelection] :: CanvasWidgetConfig t -> Dynamic t RenderedCanvasRegion [_canvasWidgetConfig_canvas] :: CanvasWidgetConfig t -> Dynamic t SCanvas [_canvasWidgetConfig_handles] :: CanvasWidgetConfig t -> Dynamic t HandlerRenderOutput data CanvasWidget t CanvasWidget :: Event t LMouseData -> Event t XY -> CanvasWidget t [_canvasWidget_mouse] :: CanvasWidget t -> Event t LMouseData [_canvasWidget_regionDim] :: CanvasWidget t -> Event t XY holdCanvasWidget :: forall t m. (MonadWidget t m, HasPotato t m) => CanvasWidgetConfig t -> m (CanvasWidget t) module Potato.Flow.Vty.AppKbCmd data AppKbCmd t AppKbCmd :: Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> AppKbCmd t [_appKbCmd_save] :: AppKbCmd t -> Event t () [_appKbCmd_open] :: AppKbCmd t -> Event t () [_appKbCmd_print] :: AppKbCmd t -> Event t () [_appKbCmd_quit] :: AppKbCmd t -> Event t () [_appKbCmd_forceQuit] :: AppKbCmd t -> Event t () [_appKbCmd_new] :: AppKbCmd t -> Event t () [_appKbCmd_capturedInput] :: AppKbCmd t -> Event t () holdAppKbCmd :: MonadWidget t m => m (AppKbCmd t) module Potato.Flow.Vty.Common ffilterButtonIndex :: Reflex t => Int -> Event t Int -> Event t () oneLineButton :: forall t m. (MonadFix m, MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m) => Behavior t (Attr, Attr) -> Dynamic t Text -> m (Event t ()) -- | option to pass in height is a hack to work around circular dependency -- issues as when using Layout, displayWidth may be dependent on returned -- dynamic height buttonList :: forall t m. (MonadFix m, MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasTheme t m) => Dynamic t [Text] -> Maybe (Dynamic t Int) -> m (Event t Int, Dynamic t Int) -- | option to pass in height is a hack to work around circular dependency -- issues as when using Layout, displayWidth may be dependent on returned -- dynamic height override style: does not modify state internally, -- instead state must be passed back in radioList :: forall t m. (Reflex t, MonadNodeId m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasTheme t m) => Dynamic t [Text] -> Dynamic t [Int] -> Maybe (Dynamic t Int) -> m (Event t Int, Dynamic t Int) radioListSimple :: forall t m. (Reflex t, MonadFix m, MonadHold t m, MonadNodeId m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasTheme t m) => Int -> [Text] -> m (Dynamic t Int) -- | creates a check box "[x]" in upper left corner of region override -- style: does not modify state internally, instead state must be passed -- back in checkBox :: forall t m. (Reflex t, MonadFix m, HasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasTheme t m) => Dynamic t Bool -> m (Event t Bool) module Potato.Flow.Vty.Tools data Tool Tool_Select :: Tool Tool_Pan :: Tool Tool_Box :: Tool Tool_Line :: Tool Tool_Text :: Tool Tool_TextArea :: Tool data ToolWidgetConfig t ToolWidgetConfig :: Dynamic t Tool -> Dynamic t Int -> ToolWidgetConfig t [_toolWidgetConfig_tool] :: ToolWidgetConfig t -> Dynamic t Tool [_toolWidgetConfig_widthDyn] :: ToolWidgetConfig t -> Dynamic t Int data ToolWidget t ToolWidget :: Event t Tool -> Dynamic t Int -> ToolWidget t [_toolWidget_setTool] :: ToolWidget t -> Event t Tool [_toolWidget_heightDyn] :: ToolWidget t -> Dynamic t Int holdToolsWidget :: forall t m. (PostBuild t m, MonadWidget t m) => ToolWidgetConfig t -> m (ToolWidget t) module Potato.Flow.Vty.ToolOptions data ToolOptionsWidgetConfig t ToolOptionsWidgetConfig :: Dynamic t Tool -> Dynamic t Int -> ToolOptionsWidgetConfig t [_toolOptionsWidgetConfig_tool] :: ToolOptionsWidgetConfig t -> Dynamic t Tool [_toolOptionsWidgetConfig_widthDyn] :: ToolOptionsWidgetConfig t -> Dynamic t Int data ToolOptionsWidget t ToolOptionsWidget :: Event t () -> Dynamic t Int -> ToolOptionsWidget t [_toolOptionsWidget_setOption] :: ToolOptionsWidget t -> Event t () [_toolOptionsWidget_heightDyn] :: ToolOptionsWidget t -> Dynamic t Int holdToolOptionsWidget :: forall t m. (PostBuild t m, MonadWidget t m) => ToolOptionsWidgetConfig t -> m (ToolOptionsWidget t) module Potato.Reflex.Vty.Widget.Menu holdMenuWidget :: a instance GHC.Show.Show k => GHC.Show.Show (Potato.Reflex.Vty.Widget.Menu.MenuTreeNode k) instance GHC.Classes.Eq k => GHC.Classes.Eq (Potato.Reflex.Vty.Widget.Menu.MenuTreeNode k) module Potato.Reflex.Vty.Widget.Popup -- | popupPane can only emit a single event before closing itself clicking -- outside the popup closes the popup and emits no events (conisder -- disabling this as default behavior?) popupPane :: forall t m a. MonadWidget t m => PopupPaneSize -> Event t (PopupInputWidget t m a) -> m (Event t a, Dynamic t Bool) -- | a simple popup pane the inner popup pane event closes the popup pane -- (e.g. notification dialog box with "ok" button) clicking outside or -- pressing escape closes the popup and emits no events popupPaneSimple :: forall t m a. MonadWidget t m => PopupPaneSize -> Event t (m (Event t a)) -> m (Event t a, Dynamic t Bool) instance Data.Default.Class.Default Potato.Reflex.Vty.Widget.Popup.PopupPaneSize module Potato.Reflex.Vty.Widget.ScrollBar vScrollBar :: forall t m a. MonadWidget t m => Int -> Dynamic t Int -> m (Dynamic t Int) module Potato.Flow.Vty.Layer data LayerWidgetConfig t LayerWidgetConfig :: Dynamic t LayersState -> Dynamic t LayersViewHandlerRenderOutput -> Dynamic t Selection -> LayerWidgetConfig t [_layerWidgetConfig_layers] :: LayerWidgetConfig t -> Dynamic t LayersState [_layerWidgetConfig_layersView] :: LayerWidgetConfig t -> Dynamic t LayersViewHandlerRenderOutput [_layerWidgetConfig_selection] :: LayerWidgetConfig t -> Dynamic t Selection data LayerWidget t LayerWidget :: Event t LMouseData -> Event t () -> LayerWidget t [_layerWidget_mouse] :: LayerWidget t -> Event t LMouseData [_layerWidget_newFolderEv] :: LayerWidget t -> Event t () holdLayerWidget :: forall t m. (MonadWidget t m, HasPotato t m) => LayerWidgetConfig t -> m (LayerWidget t) module Potato.Reflex.Vty.Widget.TextInputHelpers infiniteWidthDyn :: Reflex t => Dynamic t Int type UpdateTextZipperMethod = Event -> Maybe (TextZipper -> TextZipper) makeCaptureFromUpdateTextZipperMethod :: (Reflex t, MonadFix m, MonadNodeId m, HasInput t m) => UpdateTextZipperMethod -> m (Event t ()) makeModifyEventFromUpdateTextZipperMethod :: UpdateTextZipperMethod -> Event -> TextZipper -> TextZipper updateTextZipperForSingleCharacter :: UpdateTextZipperMethod updateTextZipperForNumberInput :: UpdateTextZipperMethod singleCellTextInput :: (MonadWidget t m, HasPotato t m) => Event t (TextZipper -> TextZipper) -> TextZipper -> m (Dynamic t Text) dimensionInput :: (MonadWidget t m, HasPotato t m) => Dynamic t Int -> m (Dynamic t Int) updateTextZipperForFilenameCharacters :: UpdateTextZipperMethod filenameInputFireEventOnLoseFocus :: (MonadWidget t m, HasPotato t m, HasFocus t m) => Text -> Event t Text -> m (Event t Text) filenameInput :: (MonadWidget t m, HasPotato t m) => Text -> Event t Text -> m (Dynamic t Text) -- | Turn a Span into an Image dropSpan :: Int -> [Span Attr] -> [Span Attr] renderTextZipper :: (MonadWidget t m, HasPotato t m) => Dynamic t Int -> Dynamic t Int -> Dynamic t TextZipper -> m (Dynamic t (DisplayLines Attr)) textInputCustom' :: (MonadWidget t m, HasPotato t m) => Dynamic t Int -> Dynamic t Int -> Event t (TextZipper -> TextZipper) -> TextZipper -> m (Dynamic t Text) textInputCustom :: (MonadWidget t m, HasPotato t m) => Event t (TextZipper -> TextZipper) -> TextZipper -> m (Dynamic t Text) module Potato.Reflex.Vty.Widget.FileExplorer data FileExplorerWidgetConfig t FileExplorerWidgetConfig :: Behavior t Attr -> (FilePath -> Bool) -> FilePath -> FileExplorerWidgetConfig t [_fileExplorerWidgetConfig_clickDownStyle] :: FileExplorerWidgetConfig t -> Behavior t Attr [_fileExplorerWidgetConfig_fileFilter] :: FileExplorerWidgetConfig t -> FilePath -> Bool [_fileExplorerWidgetConfig_initialFile] :: FileExplorerWidgetConfig t -> FilePath data FileExplorerWidget t FileExplorerWidget :: Behavior t Text -> Behavior t FilePath -> Event t FilePath -> Dynamic t FilePath -> Event t () -> Event t () -> FileExplorerWidget t [_fileExplorerWidget_filename] :: FileExplorerWidget t -> Behavior t Text [_fileExplorerWidget_fullfilename] :: FileExplorerWidget t -> Behavior t FilePath [_fileExplorerWidget_doubleClickFile] :: FileExplorerWidget t -> Event t FilePath [_fileExplorerWidget_directory] :: FileExplorerWidget t -> Dynamic t FilePath [_fileExplorerWidget_returnOnfilename] :: FileExplorerWidget t -> Event t () [_fileExplorerWidget_doubleClick] :: FileExplorerWidget t -> Event t () holdFileExplorerWidget :: forall t m. (MonadLayoutWidget t m, HasPotato t m) => FileExplorerWidgetConfig t -> m (FileExplorerWidget t) module Potato.Flow.Vty.SaveAsWindow data SaveAsWindowConfig t SaveAsWindowConfig :: Event t FilePath -> SaveAsWindowConfig t -- | Event to launch the popup window to save file as Text is previous file -- name or empty string [_saveAsWindowConfig_saveAs] :: SaveAsWindowConfig t -> Event t FilePath popupSaveAsWindow :: forall t m. (MonadWidget t m, HasPotato t m) => SaveAsWindowConfig t -> m (Event t FilePath, Dynamic t Bool) data SaveBeforeActionConfig t SaveBeforeActionConfig :: Behavior t Bool -> Event t () -> Event t () -> Event t () -> Event t (Either Text FilePath) -> SaveBeforeActionConfig t [_saveBeforeActionConfig_unsavedChangesBeh] :: SaveBeforeActionConfig t -> Behavior t Bool [_saveBeforeActionConfig_open] :: SaveBeforeActionConfig t -> Event t () [_saveBeforeActionConfig_new] :: SaveBeforeActionConfig t -> Event t () [_saveBeforeActionConfig_exit] :: SaveBeforeActionConfig t -> Event t () [_saveBeforeActionConfig_saveOutcomeEv] :: SaveBeforeActionConfig t -> Event t (Either Text FilePath) data SaveBeforeActionType SaveBeforeActionType_Open :: SaveBeforeActionType SaveBeforeActionType_New :: SaveBeforeActionType SaveBeforeActionType_Exit :: SaveBeforeActionType SaveBeforeActionType_None :: SaveBeforeActionType data SaveBeforeActionOutput t SaveBeforeActionOutput :: Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> SaveBeforeActionOutput t [_saveBeforeActionOutput_save] :: SaveBeforeActionOutput t -> Event t () [_saveBeforeActionOutput_saveAs] :: SaveBeforeActionOutput t -> Event t () [_saveBeforeActionOutput_new] :: SaveBeforeActionOutput t -> Event t () [_saveBeforeActionOutput_open] :: SaveBeforeActionOutput t -> Event t () [_saveBeforeActionOutput_exit] :: SaveBeforeActionOutput t -> Event t () hackAlign3 :: Reflex t => Event t a -> Event t b -> Event t c -> Event t (These a (These b c)) hackFanThese3 :: Reflex t => Event t (These a (These b c)) -> (Event t a, Event t b, Event t c) popupSaveBeforeExit :: forall t m. (MonadWidget t m, HasPotato t m) => SaveBeforeActionConfig t -> m (SaveBeforeActionOutput t, Dynamic t Bool) instance GHC.Classes.Eq Potato.Flow.Vty.SaveAsWindow.SaveBeforeActionType instance GHC.Show.Show Potato.Flow.Vty.SaveAsWindow.SaveBeforeActionType module Potato.Flow.Vty.OpenWindow data OpenWindowConfig t OpenWindowConfig :: Event t FilePath -> OpenWindowConfig t -- | Event to launch the popup window to open file starting in the given -- directory [_openWindowConfig_open] :: OpenWindowConfig t -> Event t FilePath popupOpenWindow :: forall t m. (MonadWidget t m, HasPotato t m) => OpenWindowConfig t -> m (Event t FilePath, Dynamic t Bool) module Potato.Flow.Vty.Alert popupAlert :: forall t m. (MonadWidget t m, HasPotato t m) => Event t Text -> m (Dynamic t Bool) module Potato.Flow.Vty.Params data ParamsWidgetConfig t ParamsWidgetConfig :: Dynamic t Selection -> Dynamic t SCanvas -> Dynamic t PotatoDefaultParameters -> Dynamic t Tool -> Event t () -> ParamsWidgetConfig t [_paramsWidgetConfig_selectionDyn] :: ParamsWidgetConfig t -> Dynamic t Selection [_paramsWidgetConfig_canvasDyn] :: ParamsWidgetConfig t -> Dynamic t SCanvas [_paramsWidgetConfig_defaultParamsDyn] :: ParamsWidgetConfig t -> Dynamic t PotatoDefaultParameters [_paramsWidgetConfig_toolDyn] :: ParamsWidgetConfig t -> Dynamic t Tool [_paramsWidgetConfig_loseFocusEv] :: ParamsWidgetConfig t -> Event t () data ParamsWidget t ParamsWidget :: Event t Llama -> Event t XY -> Event t SetPotatoDefaultParameters -> Event t () -> Dynamic t Int -> ParamsWidget t [_paramsWidget_paramsEvent] :: ParamsWidget t -> Event t Llama [_paramsWidget_canvasSizeEvent] :: ParamsWidget t -> Event t XY [_paramsWidget_setDefaultParamsEvent] :: ParamsWidget t -> Event t SetPotatoDefaultParameters [_paramsWidget_captureInputEv] :: ParamsWidget t -> Event t () [_paramsWidget_widgetHeight] :: ParamsWidget t -> Dynamic t Int holdParamsWidget :: forall t m. (MonadWidget t m, HasPotato t m) => ParamsWidgetConfig t -> m (ParamsWidget t) -- | method to extract common parameters from a selection returns Nothing -- if nothing in the selection has the selected param returns Just -- (selection, Nothing) if selection that has the selected param do not -- share the same value selectParamsFromSelection :: Eq a => ParamsSelector a -> Selection -> Maybe (Selection, Maybe a) networkParamsWidgetOutputDynForTesting :: (MonadWidget t m, HasPotato t m) => ParamsWidgetOutputDyn t m b -> m (Dynamic t Int, Event t (), Event t b) holdSuperStyleWidget :: forall t m. (MonadLayoutWidget t m, HasPotato t m) => ParamsWidgetFn t m SuperStyle (Either Llama SetPotatoDefaultParameters) instance GHC.Show.Show Potato.Flow.Vty.Params.SuperStyleCell instance GHC.Show.Show Reflex.Vty.Widget.Layout.FocusId module Potato.Flow.Vty.Left data LeftWidgetConfig t LeftWidgetConfig :: GoatWidget t -> LeftWidgetConfig t [_layersWidgetConfig_goatW] :: LeftWidgetConfig t -> GoatWidget t holdLeftWidget :: forall t m. (MonadWidget t m, HasPotato t m) => LeftWidgetConfig t -> m (LeftWidget t) data LeftWidget t LeftWidget :: LayerWidget t -> ToolWidget t -> ParamsWidget t -> MenuButtonsWidget t -> Event t GoatFocusedArea -> LeftWidget t [_leftWidget_layersW] :: LeftWidget t -> LayerWidget t [_leftWidget_toolsW] :: LeftWidget t -> ToolWidget t [_leftWidget_paramsW] :: LeftWidget t -> ParamsWidget t [_leftWidget_menuButtonsW] :: LeftWidget t -> MenuButtonsWidget t [_leftWidget_setFocusEvent] :: LeftWidget t -> Event t GoatFocusedArea data MenuButtonsWidget t MenuButtonsWidget :: Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> Event t () -> MenuButtonsWidget t [_menuButtonsWidget_newEv] :: MenuButtonsWidget t -> Event t () [_menuButtonsWidget_openEv] :: MenuButtonsWidget t -> Event t () [_menuButtonsWidget_saveEv] :: MenuButtonsWidget t -> Event t () [_menuButtonsWidget_saveAsEv] :: MenuButtonsWidget t -> Event t () [_menuButtonsWidget_exportEv] :: MenuButtonsWidget t -> Event t () [_menuButtonsWidget_quitEv] :: MenuButtonsWidget t -> Event t () module Potato.Flow.Vty.Main -- | run a VtyWidget using term width map written to disk with -- write-term-width for the current terminal uses default if the file -- does not exist potatoMainWidget :: (forall t m. (MonadVtyApp t m, HasImageWriter t m, MonadNodeId m, HasDisplayRegion t m, HasFocusReader t m, HasInput t m, HasTheme t m) => m (Event t ())) -> IO () mainPFWidget :: forall t m. MonadWidget t m => MainPFWidgetConfig -> m (Event t ()) mainPFWidgetWithBypass :: forall t m. MonadWidget t m => MainPFWidgetConfig -> Event t WSEvent -> m (Event t ()) data MainPFWidgetConfig MainPFWidgetConfig :: Maybe FilePath -> FilePath -> (OwlPFState, ControllerMeta) -> Bool -> MainPFWidgetConfig [_mainPFWidgetConfig_initialFile] :: MainPFWidgetConfig -> Maybe FilePath [_mainPFWidgetConfig_homeDirectory] :: MainPFWidgetConfig -> FilePath -- | will be overriden by initialFile if set [_mainPFWidgetConfig_initialState] :: MainPFWidgetConfig -> (OwlPFState, ControllerMeta) [_mainPFWidgetConfig_showWelcome] :: MainPFWidgetConfig -> Bool somedefaultpfcfg :: MainPFWidgetConfig tinytoolsConfigDir :: IO FilePath instance Data.Default.Class.Default Potato.Flow.Vty.Main.MainPFWidgetConfig module Potato.Reflex.Vty.Widget.Windows instance GHC.Show.Show Potato.Reflex.Vty.Widget.Windows.DockDirection module Reflex.Vty.Test.Monad.Host runReflexTestT :: forall intref inev out t m a. TestGuestConstraints t m => (inev, intref) -> (inev -> TestGuestT t m out) -> ReflexTestT t intref out m a -> m () type TestGuestT t (m :: Type -> Type) = TriggerEventT t PostBuildT t PerformEventT t m type TestGuestConstraints t (m :: Type -> Type) = (MonadReflexHost t m, MonadHold t m, MonadSample t m, Ref m ~ Ref IO, MonadRef m, MonadRef HostFrame t, Ref HostFrame t ~ Ref IO, MonadIO HostFrame t, PrimMonad HostFrame t, MonadIO m, MonadFix m) -- | since we work with this type directly a lot, it helps to wrap it -- around a type synonym type ReflexTriggerRef t (m :: Type -> Type) a = Ref m Maybe EventTrigger t a -- | the inner monad that reflex is running in likely 'SpiderHost Global' type family InnerMonad (m :: Type -> Type) :: Type -> Type -- | in practice, this will likely be a record containing events and -- behaviors for the monad user to build a ReadPhase that is -- passed into fireQueuedEventsAndRead type family OutputEvents (m :: Type -> Type) -- | since event subscriptions also happen within the monad, input triggers -- created via newEventWithTriggerRef may be stuck in the -- Nothing state as there are no listeners yet therefore it's -- necessary to pass in IORefs to the EventTriggers, thus the name of -- this type in practice, this will likely be a record containing many -- trigger refs and the monad user must deref them all type family InputTriggerRefs (m :: Type -> Type) class MonadReflexTest t (m :: Type -> Type) | m -> t where { -- | since event subscriptions also happen within the monad, input triggers -- created via newEventWithTriggerRef may be stuck in the -- Nothing state as there are no listeners yet therefore it's -- necessary to pass in IORefs to the EventTriggers, thus the name of -- this type in practice, this will likely be a record containing many -- trigger refs and the monad user must deref them all type family InputTriggerRefs (m :: Type -> Type); -- | in practice, this will likely be a record containing events and -- behaviors for the monad user to build a ReadPhase that is -- passed into fireQueuedEventsAndRead type family OutputEvents (m :: Type -> Type); -- | the inner monad that reflex is running in likely 'SpiderHost Global' type family InnerMonad (m :: Type -> Type) :: Type -> Type; } -- | see comments for InputTriggerRefs inputTriggerRefs :: MonadReflexTest t m => m (InputTriggerRefs m) -- | all queued triggers will fire simultaneous on the next execution of -- fireQueuedEventsAndRead queueEventTrigger :: MonadReflexTest t m => DSum (EventTrigger t) Identity -> m () -- | same as queueEventTrigger except works with trigger refs if the -- trigger ref derefs to Nothing, the event does not get queued queueEventTriggerRef :: MonadReflexTest t m => Ref (InnerMonad m) (Maybe (EventTrigger t a)) -> a -> m () -- | see comments for OutputEvents outputs :: MonadReflexTest t m => m (OutputEvents m) -- | fire all queued events and run a ReadPhase to produce results from the -- execution frames readphase takes place in the inner monad fireQueuedEventsAndRead :: MonadReflexTest t m => ReadPhase (InnerMonad m) a -> m [a] -- | same as above with no ReadPhase fireQueuedEvents :: MonadReflexTest t m => m [()] -- | implementation of MonadReflexTest data ReflexTestT t intref out (m :: Type -> Type) a -- | reflex-vty variant of ReflexTestT which packages an -- VtyEvent into the input and 'Behavior t [V.Image]' into the -- output uintref and uout allow user to add their own -- inputs and outputs uintref will often just be some singleton -- type (e.g. ()) as the app being tested still has access to -- the input 'Event t VtyEvent' through the VtyWidget monad type ReflexVtyTestT t uintref uout m = ReflexTestT t (uintref, ReflexTriggerRef t m VtyEvent) (uout, Behavior t [Image]) m -- | queue a VtyEvent queueVtyEvent :: MonadRef m => VtyEvent -> ReflexVtyTestT t uintref uout m () -- | obtain vty inputs vtyInputTriggerRefs :: MonadRef m => ReflexVtyTestT t uintref uout m (ReflexTriggerRef t m VtyEvent) -- | obtain user defined inputs userInputTriggerRefs :: MonadRef m => ReflexVtyTestT t uintref uout m uintref -- | obtain user defined outputs userOutputs :: MonadRef m => ReflexVtyTestT t uintref uout m uout -- | obtain vty outputs vtyOutputs :: MonadRef m => ReflexVtyTestT t uintref uout m (Behavior t [Image]) -- | queue mouse event queueMouseEvent :: MonadRef m => Either MouseDown MouseUp -> ReflexVtyTestT t uintref uout m () -- | queue mouse event in a DynRegion queueMouseEventInRegion :: (Reflex t, MonadSample t m, MonadRef m) => Dynamic t Region -> Either MouseDown MouseUp -> ReflexVtyTestT t uintref uout m () -- | queue mouse event in a DynRegion if (local) mouse coordinates -- are outside of the (absolute) region, returns False and does not queue -- any event queueMouseEventInRegionGated :: (Reflex t, MonadSample t m, MonadRef m) => Dynamic t Region -> Either MouseDown MouseUp -> ReflexVtyTestT t uintref uout m Bool -- | queue and fire a series of mouse events representing a mouse drag -- returns collected outputs queueMouseDrag :: (Reflex t, MonadSample t m, MonadRef m) => Button -> [Modifier] -> NonEmpty (Int, Int) -> ((Int, Int) -> ReadPhase m a) -> ReflexVtyTestT t uintref uout m (NonEmpty [a]) -- | same as queueMouseDrag but coordinates are translated to a region queueMouseDragInRegion :: (Reflex t, MonadSample t m, MonadRef m) => Dynamic t Region -> Button -> [Modifier] -> NonEmpty (Int, Int) -> ((Int, Int) -> ReadPhase m a) -> ReflexVtyTestT t uintref uout m (NonEmpty [a]) -- | run a ReflexVtyTestT analogous to runReflexTestT runReflexVtyTestT :: forall uintref uinev uout t m a. (MonadVtyApp t (TestGuestT t m), TestGuestConstraints t m) => (Int, Int) -> (uinev, uintref) -> (forall widget. InnerWidgetConstraints t widget => uinev -> widget uout) -> ReflexVtyTestT t uintref uout m a -> m () -- | class to help bind network and types to a ReflexVtyTestT -- analogous to ReflexTestApp class ReflexVtyTestApp app t m | app -> t m where { data VtyAppInputTriggerRefs app :: Type; data VtyAppInputEvents app :: Type; data VtyAppOutput app :: Type; } getApp :: (ReflexVtyTestApp app t m, InnerWidgetConstraints t widget) => VtyAppInputEvents app -> widget (VtyAppOutput app) makeInputs :: ReflexVtyTestApp app t m => m (VtyAppInputEvents app, VtyAppInputTriggerRefs app) runReflexVtyTestApp :: (ReflexVtyTestApp app t m, MonadVtyApp t (TestGuestT t m), TestGuestConstraints t m) => (Int, Int) -> ReflexVtyTestT t (VtyAppInputTriggerRefs app) (VtyAppOutput app) m () -> m () module Reflex.Vty.Test.Monad.Host.TH -- | reference the t variable your quasi-quotes. e.g. 'Event $(tv) -- ()' tv :: Q Type -- | reference a specific input event tinput :: String -> String -> Q Exp -- | reference the output constructor toutputcon :: String -> Q Exp -- | call me to generate code declareStuff :: String -> [(String, Q Type)] -> [(String, Q Type)] -> Q Exp -> Q [Dec] getAppInputEventsArgName :: Name declareNetworkData :: Name -> Q [Dec] declareNetworkInstance :: Name -> [(String, Q Type)] -> [(String, Q Type)] -> Q Exp -> Q [Dec] normalBang :: Bang convertNameToPrefixedNameField :: Name -> String -> Name convertNameToPrefixedNameType :: Name -> String -> Name varNetwork :: Name -> Type declareOutputs :: Name -> [(String, Q Type)] -> Q Dec mkvar :: String -> Q Type declareInputs :: Name -> [(String, Q Type)] -> Q [Dec] declareMakeInputs :: Name -> [(String, Q Type)] -> Q Dec declareGetApp :: Name -> Q Exp -> Q Dec