| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Termonad.Types
Contents
Synopsis
- data TMTerm = TMTerm {}
- data TMNotebookTab = TMNotebookTab {}
- data TMNotebook = TMNotebook {}
- data TMState' = TMState {}
- type TMState = MVar TMState'
- createTMTerm :: Terminal -> Int -> Unique -> TMTerm
- newTMTerm :: Terminal -> Int -> IO TMTerm
- getFocusedTermFromState :: TMState -> IO (Maybe Terminal)
- createTMNotebookTab :: Label -> ScrolledWindow -> TMTerm -> TMNotebookTab
- createTMNotebook :: Notebook -> FocusList TMNotebookTab -> TMNotebook
- createEmptyTMNotebook :: Notebook -> TMNotebook
- notebookToList :: Notebook -> IO [Widget]
- newTMState :: TMConfig -> Application -> ApplicationWindow -> TMNotebook -> FontDescription -> IO TMState
- newEmptyTMState :: TMConfig -> Application -> ApplicationWindow -> Notebook -> FontDescription -> IO TMState
- newTMStateSingleTerm :: TMConfig -> Application -> ApplicationWindow -> Notebook -> Label -> ScrolledWindow -> Terminal -> Int -> FontDescription -> IO TMState
- traceShowMTMState :: TMState -> IO ()
- data FontSize
- defaultFontSize :: FontSize
- modFontSize :: Int -> FontSize -> FontSize
- data FontConfig = FontConfig {
- fontFamily :: !Text
- fontSize :: !FontSize
- defaultFontConfig :: FontConfig
- data Option a
- whenSet :: Monoid m => Option a -> (a -> m) -> m
- data ShowScrollbar
- data ShowTabBar
- data ConfigOptions = ConfigOptions {
- fontConfig :: !FontConfig
- showScrollbar :: !ShowScrollbar
- scrollbackLen :: !Integer
- confirmExit :: !Bool
- wordCharExceptions :: !Text
- showMenu :: !Bool
- showTabBar :: !ShowTabBar
- cursorBlinkMode :: !CursorBlinkMode
- boldIsBright :: !Bool
- enableSixel :: !Bool
- allowBold :: !Bool
- defaultConfigOptions :: ConfigOptions
- data TMConfig = TMConfig {
- options :: !ConfigOptions
- hooks :: !ConfigHooks
- defaultTMConfig :: TMConfig
- newtype ConfigHooks = ConfigHooks {
- createTermHook :: TMState -> Terminal -> IO ()
- defaultConfigHooks :: ConfigHooks
- defaultCreateTermHook :: TMState -> Terminal -> IO ()
- data FocusNotSameErr
- data TabsDoNotMatch
- data TMStateInvariantErr
- invariantTMState' :: TMState' -> IO [TMStateInvariantErr]
- assertInvariantTMState :: TMState -> IO ()
- pPrintTMState :: TMState -> IO ()
Documentation
A wrapper around a VTE Terminal. This also stores the process ID of the
process running on this terminal, as well as a Unique that can be used for
comparing terminals.
Constructors
| TMTerm | |
data TMNotebookTab Source #
A container that holds everything in a given terminal window. The term
in the TMTerm is inside the tmNotebookTabTermContainer ScrolledWindow.
The notebook tab Label is also available.
Constructors
| TMNotebookTab | |
Fields
| |
Instances
| Show TMNotebookTab Source # | |
Defined in Termonad.Types | |
| Eq TMNotebookTab Source # | |
Defined in Termonad.Types Methods (==) :: TMNotebookTab -> TMNotebookTab -> Bool Source # (/=) :: TMNotebookTab -> TMNotebookTab -> Bool Source # | |
data TMNotebook Source #
This holds the GTK Notebook containing multiple tabs of Terminals. We
keep a separate list of terminals in tmNotebookTabs.
Constructors
| TMNotebook | |
Fields
| |
Instances
| Show TMNotebook Source # | |
Defined in Termonad.Types | |
Constructors
| TMState | |
Fields | |
createTMNotebookTab :: Label -> ScrolledWindow -> TMTerm -> TMNotebookTab Source #
newTMState :: TMConfig -> Application -> ApplicationWindow -> TMNotebook -> FontDescription -> IO TMState Source #
newEmptyTMState :: TMConfig -> Application -> ApplicationWindow -> Notebook -> FontDescription -> IO TMState Source #
newTMStateSingleTerm :: TMConfig -> Application -> ApplicationWindow -> Notebook -> Label -> ScrolledWindow -> Terminal -> Int -> FontDescription -> IO TMState Source #
traceShowMTMState :: TMState -> IO () Source #
The font size for the Termonad terminal. There are two ways to set the fontsize, corresponding to the two different ways to set the font size in the Pango font rendering library.
If you're not sure which to use, try FontSizePoints first and see how it
looks. It should generally correspond to font sizes you are used to from
other applications.
Constructors
| FontSizePoints Int | This sets the font size based on "points". The conversion between a
point and an actual size depends on the system configuration and the
output device. The function |
| FontSizeUnits Double | This sets the font size based on "device units". In general, this
can be thought of as one pixel. The function
|
Instances
defaultFontSize :: FontSize Source #
The default FontSize used if not specified.
>>>defaultFontSizeFontSizePoints 12
modFontSize :: Int -> FontSize -> FontSize Source #
Modify a FontSize by adding some value.
>>>modFontSize 1 (FontSizePoints 13)FontSizePoints 14>>>modFontSize 1 (FontSizeUnits 9.0)FontSizeUnits 10.0
You can reduce the font size by passing a negative value.
>>>modFontSize (-2) (FontSizePoints 13)FontSizePoints 11
If you try to create a font size less than 1, then the old font size will be used.
>>>modFontSize (-10) (FontSizePoints 5)FontSizePoints 5>>>modFontSize (-1) (FontSizeUnits 1.0)FontSizeUnits 1.0
data FontConfig Source #
Settings for the font to be used in Termonad.
Constructors
| FontConfig | |
Fields
| |
Instances
| FromJSON FontConfig Source # | |||||
Defined in Termonad.Types Methods parseJSON :: Value -> Parser FontConfig Source # parseJSONList :: Value -> Parser [FontConfig] Source # | |||||
| ToJSON FontConfig Source # | |||||
Defined in Termonad.Types Methods toJSON :: FontConfig -> Value Source # toEncoding :: FontConfig -> Encoding Source # toJSONList :: [FontConfig] -> Value Source # toEncodingList :: [FontConfig] -> Encoding Source # omitField :: FontConfig -> Bool Source # | |||||
| Generic FontConfig Source # | |||||
Defined in Termonad.Types Associated Types
| |||||
| Show FontConfig Source # | |||||
Defined in Termonad.Types | |||||
| Eq FontConfig Source # | |||||
Defined in Termonad.Types Methods (==) :: FontConfig -> FontConfig -> Bool Source # (/=) :: FontConfig -> FontConfig -> Bool Source # | |||||
| type Rep FontConfig Source # | |||||
Defined in Termonad.Types type Rep FontConfig = D1 ('MetaData "FontConfig" "Termonad.Types" "termonad-4.5.0.0-7uU3irOtqdH6C5UVGNCsC8" 'False) (C1 ('MetaCons "FontConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "fontFamily") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "fontSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FontSize))) | |||||
defaultFontConfig :: FontConfig Source #
The default FontConfig to use if not specified.
>>>defaultFontConfig == FontConfig {fontFamily = "Monospace", fontSize = defaultFontSize}True
This data type represents an option that can either be Set or Unset.
This data type is used in situations where leaving an option unset results in a special state that is not representable by setting any specific value.
Examples of this include the cursorFgColour and cursorBgColour options
supplied by the ColourConfig ConfigExtension. By default,
cursorFgColour and cursorBgColour are both Unset. However, when
cursorBgColour is Set, cursorFgColour defaults to the color of the text
underneath. There is no way to represent this by setting cursorFgColour.
Instances
| Functor Option Source # | |
| Foldable Option Source # | |
Defined in Termonad.Types Methods fold :: Monoid m => Option m -> m Source # foldMap :: Monoid m => (a -> m) -> Option a -> m Source # foldMap' :: Monoid m => (a -> m) -> Option a -> m Source # foldr :: (a -> b -> b) -> b -> Option a -> b Source # foldr' :: (a -> b -> b) -> b -> Option a -> b Source # foldl :: (b -> a -> b) -> b -> Option a -> b Source # foldl' :: (b -> a -> b) -> b -> Option a -> b Source # foldr1 :: (a -> a -> a) -> Option a -> a Source # foldl1 :: (a -> a -> a) -> Option a -> a Source # toList :: Option a -> [a] Source # null :: Option a -> Bool Source # length :: Option a -> Int Source # elem :: Eq a => a -> Option a -> Bool Source # maximum :: Ord a => Option a -> a Source # minimum :: Ord a => Option a -> a Source # | |
| Read a => Read (Option a) Source # | |
| Show a => Show (Option a) Source # | |
| Eq a => Eq (Option a) Source # | |
| Ord a => Ord (Option a) Source # | |
Defined in Termonad.Types | |
data ShowScrollbar Source #
Whether or not to show the scroll bar in a terminal.
Constructors
| ShowScrollbarNever | Never show the scroll bar, even if there are too many lines on the terminal to show all at once. You should still be able to scroll with the mouse wheel. |
| ShowScrollbarAlways | Always show the scrollbar, even if it is not needed. |
| ShowScrollbarIfNeeded | Only show the scrollbar if there are too many lines on the terminal to show all at once. |
Instances
| FromJSON ShowScrollbar Source # | |||||
Defined in Termonad.Types Methods parseJSON :: Value -> Parser ShowScrollbar Source # parseJSONList :: Value -> Parser [ShowScrollbar] Source # | |||||
| ToJSON ShowScrollbar Source # | |||||
Defined in Termonad.Types Methods toJSON :: ShowScrollbar -> Value Source # toEncoding :: ShowScrollbar -> Encoding Source # toJSONList :: [ShowScrollbar] -> Value Source # toEncodingList :: [ShowScrollbar] -> Encoding Source # omitField :: ShowScrollbar -> Bool Source # | |||||
| Enum ShowScrollbar Source # | |||||
Defined in Termonad.Types Methods succ :: ShowScrollbar -> ShowScrollbar Source # pred :: ShowScrollbar -> ShowScrollbar Source # toEnum :: Int -> ShowScrollbar Source # fromEnum :: ShowScrollbar -> Int Source # enumFrom :: ShowScrollbar -> [ShowScrollbar] Source # enumFromThen :: ShowScrollbar -> ShowScrollbar -> [ShowScrollbar] Source # enumFromTo :: ShowScrollbar -> ShowScrollbar -> [ShowScrollbar] Source # enumFromThenTo :: ShowScrollbar -> ShowScrollbar -> ShowScrollbar -> [ShowScrollbar] Source # | |||||
| Generic ShowScrollbar Source # | |||||
Defined in Termonad.Types Associated Types
Methods from :: ShowScrollbar -> Rep ShowScrollbar x Source # to :: Rep ShowScrollbar x -> ShowScrollbar Source # | |||||
| Show ShowScrollbar Source # | |||||
Defined in Termonad.Types | |||||
| Eq ShowScrollbar Source # | |||||
Defined in Termonad.Types Methods (==) :: ShowScrollbar -> ShowScrollbar -> Bool Source # (/=) :: ShowScrollbar -> ShowScrollbar -> Bool Source # | |||||
| type Rep ShowScrollbar Source # | |||||
Defined in Termonad.Types type Rep ShowScrollbar = D1 ('MetaData "ShowScrollbar" "Termonad.Types" "termonad-4.5.0.0-7uU3irOtqdH6C5UVGNCsC8" 'False) (C1 ('MetaCons "ShowScrollbarNever" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ShowScrollbarAlways" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ShowScrollbarIfNeeded" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data ShowTabBar Source #
Whether or not to show the tab bar for switching tabs.
Constructors
| ShowTabBarNever | Never show the tab bar, even if there are multiple tabs open. This may be confusing if you plan on using multiple tabs. |
| ShowTabBarAlways | Always show the tab bar, even if you only have one tab open. |
| ShowTabBarIfNeeded | Only show the tab bar if you have multiple tabs open. |
Instances
| FromJSON ShowTabBar Source # | |||||
Defined in Termonad.Types Methods parseJSON :: Value -> Parser ShowTabBar Source # parseJSONList :: Value -> Parser [ShowTabBar] Source # | |||||
| ToJSON ShowTabBar Source # | |||||
Defined in Termonad.Types Methods toJSON :: ShowTabBar -> Value Source # toEncoding :: ShowTabBar -> Encoding Source # toJSONList :: [ShowTabBar] -> Value Source # toEncodingList :: [ShowTabBar] -> Encoding Source # omitField :: ShowTabBar -> Bool Source # | |||||
| Enum ShowTabBar Source # | |||||
Defined in Termonad.Types Methods succ :: ShowTabBar -> ShowTabBar Source # pred :: ShowTabBar -> ShowTabBar Source # toEnum :: Int -> ShowTabBar Source # fromEnum :: ShowTabBar -> Int Source # enumFrom :: ShowTabBar -> [ShowTabBar] Source # enumFromThen :: ShowTabBar -> ShowTabBar -> [ShowTabBar] Source # enumFromTo :: ShowTabBar -> ShowTabBar -> [ShowTabBar] Source # enumFromThenTo :: ShowTabBar -> ShowTabBar -> ShowTabBar -> [ShowTabBar] Source # | |||||
| Generic ShowTabBar Source # | |||||
Defined in Termonad.Types Associated Types
| |||||
| Show ShowTabBar Source # | |||||
Defined in Termonad.Types | |||||
| Eq ShowTabBar Source # | |||||
Defined in Termonad.Types Methods (==) :: ShowTabBar -> ShowTabBar -> Bool Source # (/=) :: ShowTabBar -> ShowTabBar -> Bool Source # | |||||
| type Rep ShowTabBar Source # | |||||
Defined in Termonad.Types type Rep ShowTabBar = D1 ('MetaData "ShowTabBar" "Termonad.Types" "termonad-4.5.0.0-7uU3irOtqdH6C5UVGNCsC8" 'False) (C1 ('MetaCons "ShowTabBarNever" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ShowTabBarAlways" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ShowTabBarIfNeeded" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data ConfigOptions Source #
Configuration options for Termonad.
See defaultConfigOptions for the default values.
Constructors
| ConfigOptions | |
Fields
| |
Instances
| FromJSON ConfigOptions Source # | |||||
Defined in Termonad.Types Methods parseJSON :: Value -> Parser ConfigOptions Source # parseJSONList :: Value -> Parser [ConfigOptions] Source # | |||||
| ToJSON ConfigOptions Source # | |||||
Defined in Termonad.Types Methods toJSON :: ConfigOptions -> Value Source # toEncoding :: ConfigOptions -> Encoding Source # toJSONList :: [ConfigOptions] -> Value Source # toEncodingList :: [ConfigOptions] -> Encoding Source # omitField :: ConfigOptions -> Bool Source # | |||||
| Generic ConfigOptions Source # | |||||
Defined in Termonad.Types Associated Types
Methods from :: ConfigOptions -> Rep ConfigOptions x Source # to :: Rep ConfigOptions x -> ConfigOptions Source # | |||||
| Show ConfigOptions Source # | |||||
Defined in Termonad.Types | |||||
| Eq ConfigOptions Source # | |||||
Defined in Termonad.Types Methods (==) :: ConfigOptions -> ConfigOptions -> Bool Source # (/=) :: ConfigOptions -> ConfigOptions -> Bool Source # | |||||
| type Rep ConfigOptions Source # | |||||
Defined in Termonad.Types type Rep ConfigOptions = D1 ('MetaData "ConfigOptions" "Termonad.Types" "termonad-4.5.0.0-7uU3irOtqdH6C5UVGNCsC8" 'False) (C1 ('MetaCons "ConfigOptions" 'PrefixI 'True) (((S1 ('MetaSel ('Just "fontConfig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FontConfig) :*: S1 ('MetaSel ('Just "showScrollbar") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShowScrollbar)) :*: (S1 ('MetaSel ('Just "scrollbackLen") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer) :*: (S1 ('MetaSel ('Just "confirmExit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "wordCharExceptions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) :*: ((S1 ('MetaSel ('Just "showMenu") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "showTabBar") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShowTabBar) :*: S1 ('MetaSel ('Just "cursorBlinkMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CursorBlinkMode))) :*: (S1 ('MetaSel ('Just "boldIsBright") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "enableSixel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "allowBold") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))))) | |||||
defaultConfigOptions :: ConfigOptions Source #
The default ConfigOptions.
>>>:{let defConfOpt = ConfigOptions { fontConfig = defaultFontConfig , showScrollbar = ShowScrollbarIfNeeded , scrollbackLen = 10000 , confirmExit = True , wordCharExceptions = "-#%&+,./=?@\\_~\183:" , showMenu = True , showTabBar = ShowTabBarIfNeeded , cursorBlinkMode = CursorBlinkModeOn , boldIsBright = False , enableSixel = False , allowBold = True } in defaultConfigOptions == defConfOpt :} True
The Termonad ConfigOptions along with the ConfigHooks.
Constructors
| TMConfig | |
Fields
| |
defaultTMConfig :: TMConfig Source #
The default TMConfig.
options is defaultConfigOptions and hooks is defaultConfigHooks.
newtype ConfigHooks Source #
Hooks into certain termonad operations and VTE events. Used to modify
termonad's behaviour in order to implement new functionality. Fields should
have sane Semigroup and Monoid instances so that config extensions can
be combined uniformly and new hooks can be added without incident.
Constructors
| ConfigHooks | |
Fields
| |
Instances
| Show ConfigHooks Source # | |
Defined in Termonad.Types | |
defaultConfigHooks :: ConfigHooks Source #
Default values for the ConfigHooks.
- The default function for
createTermHookisdefaultCreateTermHook.
defaultCreateTermHook :: TMState -> Terminal -> IO () Source #
Default value for createTermHook. Does nothing.
data FocusNotSameErr Source #
Constructors
| FocusListFocusExistsButNoNotebookTabWidget | |
| NotebookTabWidgetDiffersFromFocusListFocus | |
| NotebookTabWidgetExistsButNoFocusListFocus |
Instances
| Show FocusNotSameErr Source # | |
Defined in Termonad.Types | |
data TabsDoNotMatch Source #
Constructors
| TabLengthsDifferent Int Int | The first |
| TabAtIndexDifferent Int | The tab at index |
Instances
| Show TabsDoNotMatch Source # | |
Defined in Termonad.Types | |
data TMStateInvariantErr Source #
Constructors
| FocusNotSame FocusNotSameErr Int | |
| TabsDoNotMatch TabsDoNotMatch |
Instances
| Show TMStateInvariantErr Source # | |
Defined in Termonad.Types | |
invariantTMState' :: TMState' -> IO [TMStateInvariantErr] Source #
Gather up the invariants for TMState and return them as a list.
If no invariants have been violated, then this function should return an empty list.
assertInvariantTMState :: TMState -> IO () Source #
pPrintTMState :: TMState -> IO () Source #
Orphan instances
| FromJSON CursorBlinkMode Source # | |
Methods parseJSON :: Value -> Parser CursorBlinkMode Source # parseJSONList :: Value -> Parser [CursorBlinkMode] Source # | |
| ToJSON CursorBlinkMode Source # | |
Methods toJSON :: CursorBlinkMode -> Value Source # toEncoding :: CursorBlinkMode -> Encoding Source # toJSONList :: [CursorBlinkMode] -> Value Source # toEncodingList :: [CursorBlinkMode] -> Encoding Source # omitField :: CursorBlinkMode -> Bool Source # | |