-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Terminal emulator configurable in Haskell
--   
--   Termonad is a terminal emulator configurable in Haskell. It is
--   extremely customizable and provides hooks to modify the default
--   behavior. It can be thought of as the "XMonad" of terminal emulators.
--   Termonad was featured on an <a>episode</a> of <a>DistroTube</a>. This
--   video gives a short overview of Termonad.
--   
--   Please see <a>README.md</a> for more information.
@package termonad
@version 4.5.0.0

module Termonad.Pcre
pcre2Multiline :: CUInt
inline_c_ffi_6989586621679088752 :: IO CUInt

module Termonad.Prelude

-- | <a>&amp;</a> is a reverse application operator. This provides
--   notational convenience. Its precedence is one higher than that of the
--   forward application operator <a>$</a>, which allows <a>&amp;</a> to be
--   nested in <a>$</a>.
--   
--   This is a version of <tt><a>flip</a> <a>id</a></tt>, where <a>id</a>
--   is specialized from <tt>a -&gt; a</tt> to <tt>(a -&gt; b) -&gt; (a
--   -&gt; b)</tt> which by the associativity of <tt>(-&gt;)</tt> is <tt>(a
--   -&gt; b) -&gt; a -&gt; b</tt>. flipping this yields <tt>a -&gt; (a
--   -&gt; b) -&gt; b</tt> which is the type signature of <a>&amp;</a>
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; 5 &amp; (+1) &amp; show
--   "6"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; sqrt $ [1 / n^2 | n &lt;- [1..1000]] &amp; sum &amp; (*6)
--   3.1406380562059946
--   </pre>
(&) :: a -> (a -> b) -> b
infixl 1 &

-- | The parameterizable maybe monad, obtained by composing an arbitrary
--   monad with the <a>Maybe</a> monad.
--   
--   Computations are actions that may produce a value or exit.
--   
--   The <a>return</a> function yields a computation that produces that
--   value, while <tt>&gt;&gt;=</tt> sequences two subcomputations, exiting
--   if either computation does.
newtype MaybeT (m :: Type -> Type) a
MaybeT :: m (Maybe a) -> MaybeT (m :: Type -> Type) a
[runMaybeT] :: MaybeT (m :: Type -> Type) a -> m (Maybe a)
hPutStrLn :: MonadIO m => Handle -> Text -> m ()
whenJust :: Monoid m => Maybe a -> (a -> m) -> m


-- | This module contains two things:
--   
--   <ol>
--   <li>Extension functions to libraries like GTK. These functions wrap up
--   some generic GTK functionality. They are not Termonad-specific.</li>
--   <li>Wrappers around functionality that is only specific to certain
--   versions of libraries like GTK or VTE.</li>
--   </ol>
--   
--   For instance, <a>terminalSetEnableSixelIfExists</a> is a wrapper
--   around <tt>terminalSetEnableSixel</tt>. Sixel support is only availble
--   in vte &gt;= 0.63, so if a user tries to compile Termonad with a
--   version of vte less than 0.63, this function won't do anything.
module Termonad.Gtk
objFromBuildUnsafe :: GObject o => Builder -> Text -> (ManagedPtr o -> o) -> IO o

-- | Unsafely creates a new <a>Application</a>. This calls <a>fail</a> if
--   it cannot create the <a>Application</a> for some reason.
--   
--   This can fail for different reasons, one of which being that
--   application name does not have a period in it.
appNew :: (HasCallStack, MonadIO m, MonadFail m) => Maybe Text -> [ApplicationFlags] -> m Application

-- | Tests to see if two GTK widgets point to the same thing. This should
--   only happen if they are actually the same thing.
widgetEq :: (MonadIO m, IsWidget a, IsWidget b) => a -> b -> m Bool

-- | Wrapper around <tt>terminalSetEnableSixel</tt>. The
--   <tt>terminalSetEnableSixel</tt> function is only available starting
--   with vte-0.63. This function has no effect when compiling against
--   previous versions of vte.
terminalSetEnableSixelIfExists :: (HasCallStack, MonadIO m, IsTerminal t) => t -> Bool -> m ()

module Termonad.Types

-- | A wrapper around a VTE <a>Terminal</a>. This also stores the process
--   ID of the process running on this terminal, as well as a <a>Unique</a>
--   that can be used for comparing terminals.
data TMTerm
TMTerm :: !Terminal -> !Int -> !Unique -> TMTerm

-- | The actual <a>Terminal</a>.
[term] :: TMTerm -> !Terminal

-- | The process ID of the process running in <a>term</a>.
[pid] :: TMTerm -> !Int

-- | A <a>Unique</a> for comparing different <a>TMTerm</a> for uniqueness.
[unique] :: TMTerm -> !Unique

-- | A container that holds everything in a given terminal window. The
--   <a>term</a> in the <a>TMTerm</a> is inside the
--   <a>tmNotebookTabTermContainer</a> <a>ScrolledWindow</a>. The notebook
--   tab <a>Label</a> is also available.
data TMNotebookTab
TMNotebookTab :: !ScrolledWindow -> !TMTerm -> !Label -> TMNotebookTab

-- | The <a>ScrolledWindow</a> holding the VTE <a>Terminal</a>.
[tmNotebookTabTermContainer] :: TMNotebookTab -> !ScrolledWindow

-- | The <a>Terminal</a> insidie the <a>ScrolledWindow</a>.
[tmNotebookTabTerm] :: TMNotebookTab -> !TMTerm

-- | The <a>Label</a> holding the title of the <a>Terminal</a> in the
--   <a>Notebook</a> tab.
[tmNotebookTabLabel] :: TMNotebookTab -> !Label

-- | This holds the GTK <a>Notebook</a> containing multiple tabs of
--   <a>Terminal</a>s. We keep a separate list of terminals in
--   <a>tmNotebookTabs</a>.
data TMNotebook
TMNotebook :: !Notebook -> !FocusList TMNotebookTab -> TMNotebook

-- | This is the GTK <a>Notebook</a> that holds multiple tabs of
--   <a>Terminal</a>s.
[tmNotebook] :: TMNotebook -> !Notebook

-- | A <a>FocusList</a> containing references to each individual
--   <a>TMNotebookTab</a>.
[tmNotebookTabs] :: TMNotebook -> !FocusList TMNotebookTab
data TMState'
TMState :: !Application -> !ApplicationWindow -> !TMNotebook -> !FontDescription -> !TMConfig -> TMState'
[tmStateApp] :: TMState' -> !Application
[tmStateAppWin] :: TMState' -> !ApplicationWindow
[tmStateNotebook] :: TMState' -> !TMNotebook
[tmStateFontDesc] :: TMState' -> !FontDescription
[tmStateConfig] :: TMState' -> !TMConfig
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 ()

-- | 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 <a>FontSizePoints</a> first and
--   see how it looks. It should generally correspond to font sizes you are
--   used to from other applications.
data FontSize

-- | 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 <a>fontDescriptionSetSize</a> is used to
--   set the font size. See the documentation for that function for more
--   info.
FontSizePoints :: Int -> FontSize

-- | This sets the font size based on "device units". In general, this can
--   be thought of as one pixel. The function
--   <a>fontDescriptionSetAbsoluteSize</a> is used to set the font size.
--   See the documentation for that function for more info.
FontSizeUnits :: Double -> FontSize

-- | The default <a>FontSize</a> used if not specified.
--   
--   <pre>
--   &gt;&gt;&gt; defaultFontSize
--   FontSizePoints 12
--   </pre>
defaultFontSize :: FontSize

-- | Modify a <a>FontSize</a> by adding some value.
--   
--   <pre>
--   &gt;&gt;&gt; modFontSize 1 (FontSizePoints 13)
--   FontSizePoints 14
--   
--   &gt;&gt;&gt; modFontSize 1 (FontSizeUnits 9.0)
--   FontSizeUnits 10.0
--   </pre>
--   
--   You can reduce the font size by passing a negative value.
--   
--   <pre>
--   &gt;&gt;&gt; modFontSize (-2) (FontSizePoints 13)
--   FontSizePoints 11
--   </pre>
--   
--   If you try to create a font size less than 1, then the old font size
--   will be used.
--   
--   <pre>
--   &gt;&gt;&gt; modFontSize (-10) (FontSizePoints 5)
--   FontSizePoints 5
--   
--   &gt;&gt;&gt; modFontSize (-1) (FontSizeUnits 1.0)
--   FontSizeUnits 1.0
--   </pre>
modFontSize :: Int -> FontSize -> FontSize

-- | Settings for the font to be used in Termonad.
data FontConfig
FontConfig :: !Text -> !FontSize -> FontConfig

-- | The font family to use. Example: <tt>"DejaVu Sans Mono"</tt> or
--   <tt>"Source Code Pro"</tt>
[fontFamily] :: FontConfig -> !Text

-- | The font size.
[fontSize] :: FontConfig -> !FontSize

-- | The default <a>FontConfig</a> to use if not specified.
--   
--   <pre>
--   &gt;&gt;&gt; defaultFontConfig == FontConfig {fontFamily = "Monospace", fontSize = defaultFontSize}
--   True
--   </pre>
defaultFontConfig :: FontConfig

-- | This data type represents an option that can either be <a>Set</a> or
--   <a>Unset</a>.
--   
--   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 <tt>cursorFgColour</tt> and
--   <tt>cursorBgColour</tt> options supplied by the <tt>ColourConfig</tt>
--   <tt>ConfigExtension</tt>. By default, <tt>cursorFgColour</tt> and
--   <tt>cursorBgColour</tt> are both <a>Unset</a>. However, when
--   <tt>cursorBgColour</tt> is <a>Set</a>, <tt>cursorFgColour</tt>
--   defaults to the color of the text underneath. There is no way to
--   represent this by setting <tt>cursorFgColour</tt>.
data Option a
Unset :: Option a
Set :: !a -> Option a

-- | Run a function over the value contained in an <a>Option</a>. Return
--   <a>mempty</a> when <a>Option</a> is <a>Unset</a>.
--   
--   <pre>
--   &gt;&gt;&gt; whenSet (Set [1,2,3]) (++ [4,5,6]) :: [Int]
--   [1,2,3,4,5,6]
--   
--   &gt;&gt;&gt; whenSet Unset (++ [4,5,6]) :: [Int]
--   []
--   </pre>
whenSet :: Monoid m => Option a -> (a -> m) -> m

-- | Whether or not to show the scroll bar in a terminal.
data ShowScrollbar

-- | 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.
ShowScrollbarNever :: ShowScrollbar

-- | Always show the scrollbar, even if it is not needed.
ShowScrollbarAlways :: ShowScrollbar

-- | Only show the scrollbar if there are too many lines on the terminal to
--   show all at once.
ShowScrollbarIfNeeded :: ShowScrollbar

-- | Whether or not to show the tab bar for switching tabs.
data ShowTabBar

-- | Never show the tab bar, even if there are multiple tabs open. This may
--   be confusing if you plan on using multiple tabs.
ShowTabBarNever :: ShowTabBar

-- | Always show the tab bar, even if you only have one tab open.
ShowTabBarAlways :: ShowTabBar

-- | Only show the tab bar if you have multiple tabs open.
ShowTabBarIfNeeded :: ShowTabBar

-- | Configuration options for Termonad.
--   
--   See <a>defaultConfigOptions</a> for the default values.
data ConfigOptions
ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> !Bool -> ConfigOptions

-- | Specific options for fonts.
[fontConfig] :: ConfigOptions -> !FontConfig

-- | When to show the scroll bar.
[showScrollbar] :: ConfigOptions -> !ShowScrollbar

-- | The number of lines to keep in the scroll back history for each
--   terminal.
[scrollbackLen] :: ConfigOptions -> !Integer

-- | Whether or not to ask you for confirmation when closing individual
--   terminals or Termonad itself. It is generally safer to keep this as
--   <a>True</a>.
[confirmExit] :: ConfigOptions -> !Bool

-- | When double-clicking on text in the terminal with the mouse, Termonad
--   will use this value to determine what to highlight. The individual
--   characters in this list will be counted as part of a word.
--   
--   For instance if <a>wordCharExceptions</a> is <tt>""</tt>, then when
--   you double-click on the text <tt>http://</tt>, only the <tt>http</tt>
--   portion will be highlighted. If <a>wordCharExceptions</a> is
--   <tt>":"</tt>, then the <tt>http:</tt> portion will be highlighted.
[wordCharExceptions] :: ConfigOptions -> !Text

-- | Whether or not to show the <tt>File</tt> <tt>Edit</tt> etc menu.
[showMenu] :: ConfigOptions -> !Bool

-- | When to show the tab bar.
[showTabBar] :: ConfigOptions -> !ShowTabBar

-- | How to handle cursor blink.
[cursorBlinkMode] :: ConfigOptions -> !CursorBlinkMode

-- | This option controls whether or not to force bold text to use colors
--   from the <a>ExtendedPalatte</a>.
--   
--   If <a>True</a>, then colored bold text will <i>always</i> use colors
--   from the <a>ExtendedPalatte</a>. There will be no way to print bold
--   text colored with the <a>BasicPalatte</a>.
--   
--   This often isn't a big problem, since many TUI applications use bold
--   in combination with colors from the <a>ExtendedPalatte</a>. Also, the
--   VTE default blue color can be difficult to read with a dark
--   background, and enabling this can work around the problem. See
--   <a>https://github.com/cdepillabout/termonad/issues/177</a> for more
--   information.
--   
--   If <a>False</a>, then bold can be applied separately to colors from
--   both the <a>BasicPalatte</a> and <a>ExtendedPalatte</a>.
[boldIsBright] :: ConfigOptions -> !Bool

-- | Enable SIXEL to draw graphics in a terminal.
--   
--   In order for this option to do anything, you need to be using a
--   version of VTE &gt;= 0.63, and compile VTE with SIXEL support.
--   
--   Note that even if you do the above, there may still be some problems
--   with SIXEL support in VTE. Follow
--   <a>https://gitlab.gnome.org/GNOME/vte/-/issues/253</a> for more
--   information.
[enableSixel] :: ConfigOptions -> !Bool

-- | Allow terminal to use bold text.
--   
--   You may want to disable this, for instance, if you use a font that
--   doesn't look good when bold.
[allowBold] :: ConfigOptions -> !Bool

-- | The default <a>ConfigOptions</a>.
--   
--   <pre>
--   &gt;&gt;&gt; :{
--     let defConfOpt =
--           ConfigOptions
--             { fontConfig = defaultFontConfig
--             , showScrollbar = ShowScrollbarIfNeeded
--             , scrollbackLen = 10000
--             , confirmExit = True
--             , wordCharExceptions = "-#%&amp;+,./=?@\\_~\183:"
--             , showMenu = True
--             , showTabBar = ShowTabBarIfNeeded
--             , cursorBlinkMode = CursorBlinkModeOn
--             , boldIsBright = False
--             , enableSixel = False
--             , allowBold = True
--             }
--     in defaultConfigOptions == defConfOpt
--   :}
--   True
--   </pre>
defaultConfigOptions :: ConfigOptions

-- | The Termonad <a>ConfigOptions</a> along with the <a>ConfigHooks</a>.
data TMConfig
TMConfig :: !ConfigOptions -> !ConfigHooks -> TMConfig
[options] :: TMConfig -> !ConfigOptions
[hooks] :: TMConfig -> !ConfigHooks

-- | The default <a>TMConfig</a>.
--   
--   <a>options</a> is <a>defaultConfigOptions</a> and <a>hooks</a> is
--   <a>defaultConfigHooks</a>.
defaultTMConfig :: TMConfig

-- | Hooks into certain termonad operations and VTE events. Used to modify
--   termonad's behaviour in order to implement new functionality. Fields
--   should have sane <tt>Semigroup</tt> and <tt>Monoid</tt> instances so
--   that config extensions can be combined uniformly and new hooks can be
--   added without incident.
newtype ConfigHooks
ConfigHooks :: (TMState -> Terminal -> IO ()) -> ConfigHooks

-- | Produce an IO action to run on creation of new <tt>Terminal</tt>,
--   given <tt>TMState</tt> and the <tt>Terminal</tt> in question.
[createTermHook] :: ConfigHooks -> TMState -> Terminal -> IO ()

-- | Default values for the <a>ConfigHooks</a>.
--   
--   <ul>
--   <li>The default function for <a>createTermHook</a> is
--   <a>defaultCreateTermHook</a>.</li>
--   </ul>
defaultConfigHooks :: ConfigHooks

-- | Default value for <a>createTermHook</a>. Does nothing.
defaultCreateTermHook :: TMState -> Terminal -> IO ()
data FocusNotSameErr
FocusListFocusExistsButNoNotebookTabWidget :: FocusNotSameErr
NotebookTabWidgetDiffersFromFocusListFocus :: FocusNotSameErr
NotebookTabWidgetExistsButNoFocusListFocus :: FocusNotSameErr
data TabsDoNotMatch

-- | The first <a>Int</a> is the number of tabs in the actual GTK
--   <a>Notebook</a>. The second <a>Int</a> is the number of tabs in the
--   <a>FocusList</a>.
TabLengthsDifferent :: Int -> Int -> TabsDoNotMatch

-- | The tab at index <a>Int</a> is different between the actual GTK
--   <a>Notebook</a> and the <a>FocusList</a>.
TabAtIndexDifferent :: Int -> TabsDoNotMatch
data TMStateInvariantErr
FocusNotSame :: FocusNotSameErr -> Int -> TMStateInvariantErr
TabsDoNotMatch :: TabsDoNotMatch -> TMStateInvariantErr

-- | Gather up the invariants for <a>TMState</a> and return them as a list.
--   
--   If no invariants have been violated, then this function should return
--   an empty list.
invariantTMState' :: TMState' -> IO [TMStateInvariantErr]

-- | Check the invariants for <a>TMState</a>, and call <a>fail</a> if we
--   find that they have been violated.
assertInvariantTMState :: TMState -> IO ()
pPrintTMState :: TMState -> IO ()
instance GHC.Internal.Enum.Enum Termonad.Types.ShowScrollbar
instance GHC.Internal.Enum.Enum Termonad.Types.ShowTabBar
instance GHC.Classes.Eq Termonad.Types.ConfigOptions
instance GHC.Classes.Eq Termonad.Types.FontConfig
instance GHC.Classes.Eq Termonad.Types.FontSize
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Types.Option a)
instance GHC.Classes.Eq Termonad.Types.ShowScrollbar
instance GHC.Classes.Eq Termonad.Types.ShowTabBar
instance GHC.Classes.Eq Termonad.Types.TMNotebookTab
instance GHC.Classes.Eq Termonad.Types.TMTerm
instance GHC.Internal.Data.Foldable.Foldable Termonad.Types.Option
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ConfigOptions
instance Data.Aeson.Types.FromJSON.FromJSON GI.Vte.Enums.CursorBlinkMode
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.FontConfig
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.FontSize
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ShowScrollbar
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ShowTabBar
instance GHC.Internal.Base.Functor Termonad.Types.Option
instance GHC.Internal.Generics.Generic Termonad.Types.ConfigOptions
instance GHC.Internal.Generics.Generic Termonad.Types.FontConfig
instance GHC.Internal.Generics.Generic Termonad.Types.FontSize
instance GHC.Internal.Generics.Generic Termonad.Types.ShowScrollbar
instance GHC.Internal.Generics.Generic Termonad.Types.ShowTabBar
instance GHC.Classes.Ord a => GHC.Classes.Ord (Termonad.Types.Option a)
instance GHC.Internal.Read.Read a => GHC.Internal.Read.Read (Termonad.Types.Option a)
instance GHC.Internal.Show.Show Termonad.Types.ConfigHooks
instance GHC.Internal.Show.Show Termonad.Types.ConfigOptions
instance GHC.Internal.Show.Show Termonad.Types.FocusNotSameErr
instance GHC.Internal.Show.Show Termonad.Types.FontConfig
instance GHC.Internal.Show.Show Termonad.Types.FontSize
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Termonad.Types.Option a)
instance GHC.Internal.Show.Show Termonad.Types.ShowScrollbar
instance GHC.Internal.Show.Show Termonad.Types.ShowTabBar
instance GHC.Internal.Show.Show Termonad.Types.TMConfig
instance GHC.Internal.Show.Show Termonad.Types.TMNotebook
instance GHC.Internal.Show.Show Termonad.Types.TMNotebookTab
instance GHC.Internal.Show.Show Termonad.Types.TMState'
instance GHC.Internal.Show.Show Termonad.Types.TMStateInvariantErr
instance GHC.Internal.Show.Show Termonad.Types.TMTerm
instance GHC.Internal.Show.Show Termonad.Types.TabsDoNotMatch
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ConfigOptions
instance Data.Aeson.Types.ToJSON.ToJSON GI.Vte.Enums.CursorBlinkMode
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.FontConfig
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.FontSize
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ShowScrollbar
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ShowTabBar

module Termonad.PreferencesFile

-- | Get the path to the preferences file
--   <tt>~/.config/termonad/termonad.yaml</tt>.
getPreferencesFile :: IO FilePath

-- | Read the configuration for the preferences file
--   <tt>~/.config/termonad/termonad.yaml</tt>. This file stores only the
--   <a>options</a> of <a>TMConfig</a> so <a>hooks</a> are initialized with
--   <a>defaultConfigHooks</a>. If the file doesn't exist, create it with
--   the default values.
--   
--   Any options that do not exist will get initialized with values from
--   <a>defaultConfigOptions</a>.
tmConfigFromPreferencesFile :: IO TMConfig

-- | Read the <a>ConfigOptions</a> out of a configuration file.
--   
--   Merge the raw <a>ConfigOptions</a> with <a>defaultConfigOptions</a>.
--   This makes sure that old versions of the configuration file will still
--   be able to be read even if new options are added to
--   <a>ConfigOptions</a> in new versions of Termonad.
readFileWithDefaults :: FilePath -> IO (Either Text ConfigOptions)

-- | Merge <a>Value</a>s recursively.
--   
--   This merges <a>Value</a>s recursively in <a>Object</a> values, taking
--   values that have been explicitly over the defaults. The defaults are
--   only used if there is no value that has been explicitly set.
--   
--   For <a>Array</a>, <a>String</a>, <a>Number</a>, <a>Bool</a>, and
--   <a>Null</a>, take the first <a>Value</a> (the one that has been
--   explicitly set in the user's config file):
--   
--   <pre>
--   &gt;&gt;&gt; mergeObjVals (Array [Number 1, Number 2]) (Array [String "hello"])
--   Array [Number 1.0,Number 2.0]
--   
--   &gt;&gt;&gt; mergeObjVals (String "hello") (String "bye")
--   String "hello"
--   
--   &gt;&gt;&gt; mergeObjVals (Number 1) (Number 2)
--   Number 1.0
--   
--   &gt;&gt;&gt; mergeObjVals (Bool True) (Bool False)
--   Bool True
--   
--   &gt;&gt;&gt; mergeObjVals Null Null
--   Null
--   </pre>
--   
--   Note that <a>Value</a>s in <a>Array</a>s are not recursed into:
--   
--   <pre>
--   &gt;&gt;&gt; let obj1 = object ["hello" .= Number 2]
--   
--   &gt;&gt;&gt; let obj2 = object ["hello" .= String "bye"]
--   
--   &gt;&gt;&gt; mergeObjVals (Array [obj1]) (Array [obj2])
--   Array [Object (fromList [("hello",Number 2.0)])]
--   </pre>
--   
--   <a>Object</a>s are recursed into. Unique keys from both Maps will be
--   used. Keys that are in both Maps will be merged according to the rules
--   above:
--   
--   <pre>
--   &gt;&gt;&gt; let object1 = object ["hello" .= Number 1, "bye" .= Number 100]
--   
--   &gt;&gt;&gt; let object2 = object ["hello" .= Number 2, "goat" .= String "chicken"]
--   
--   &gt;&gt;&gt; mergeObjVals object1 object2
--   Object (fromList [("bye",Number 100.0),("goat",String "chicken"),("hello",Number 1.0)])
--   </pre>
--   
--   <a>Value</a>s of different types will use the second <a>Value</a>:
--   
--   <pre>
--   &gt;&gt;&gt; mergeObjVals Null (String "bye")
--   String "bye"
--   
--   &gt;&gt;&gt; mergeObjVals (Bool True) (Number 2)
--   Number 2.0
--   
--   &gt;&gt;&gt; mergeObjVals (Object mempty) (Bool False)
--   Bool False
--   </pre>
mergeObjVals :: Value -> Value -> Value
writePreferencesFile :: FilePath -> ConfigOptions -> IO ()

-- | Save the configuration to the preferences file
--   <tt>~/.config/termonad/termonad.yaml</tt>
saveToPreferencesFile :: TMConfig -> IO ()

module Termonad.Lenses
lensPid :: Lens' TMTerm Int
lensTerm :: Lens' TMTerm Terminal
lensUnique :: Lens' TMTerm Unique
lensTMNotebookTabLabel :: Lens' TMNotebookTab Label
lensTMNotebookTabTerm :: Lens' TMNotebookTab TMTerm
lensTMNotebookTabTermContainer :: Lens' TMNotebookTab ScrolledWindow
lensTMNotebook :: Lens' TMNotebook Notebook
lensTMNotebookTabs :: Lens' TMNotebook (FocusList TMNotebookTab)
lensTMStateApp :: Lens' TMState' Application
lensTMStateAppWin :: Lens' TMState' ApplicationWindow
lensTMStateConfig :: Lens' TMState' TMConfig
lensTMStateFontDesc :: Lens' TMState' FontDescription
lensTMStateNotebook :: Lens' TMState' TMNotebook
_FontSizePoints :: Prism' FontSize Int
_FontSizeUnits :: Prism' FontSize Double
lensFontFamily :: Lens' FontConfig Text
lensFontSize :: Lens' FontConfig FontSize
lensAllowBold :: Lens' ConfigOptions Bool
lensBoldIsBright :: Lens' ConfigOptions Bool
lensConfirmExit :: Lens' ConfigOptions Bool
lensCursorBlinkMode :: Lens' ConfigOptions CursorBlinkMode
lensEnableSixel :: Lens' ConfigOptions Bool
lensFontConfig :: Lens' ConfigOptions FontConfig
lensScrollbackLen :: Lens' ConfigOptions Integer
lensShowMenu :: Lens' ConfigOptions Bool
lensShowScrollbar :: Lens' ConfigOptions ShowScrollbar
lensShowTabBar :: Lens' ConfigOptions ShowTabBar
lensWordCharExceptions :: Lens' ConfigOptions Text
lensCreateTermHook :: Iso' ConfigHooks (TMState -> Terminal -> IO ())
lensHooks :: Lens' TMConfig ConfigHooks
lensOptions :: Lens' TMConfig ConfigOptions

module Termonad.Term
focusTerm :: Int -> TMState -> IO ()
altNumSwitchTerm :: Int -> TMState -> IO ()
termNextPage :: TMState -> IO ()
termPrevPage :: TMState -> IO ()
termExitFocused :: TMState -> IO ()
termClose :: TMNotebookTab -> TMState -> IO ()
termExitWithConfirmation :: TMNotebookTab -> TMState -> IO ()
termExit :: TMNotebookTab -> TMState -> IO ()
relabelTabs :: TMState -> IO ()

-- | Compute the text for a <a>Label</a> for a GTK Notebook tab.
--   
--   <pre>
--   &gt;&gt;&gt; computeTabLabel 0 (Just "me@machine:~")
--   "1. me@machine:~"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; computeTabLabel 5 (Just "bash process")
--   "6. bash process"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; computeTabLabel 2 Nothing
--   "3. shell"
--   </pre>
computeTabLabel :: Int -> Maybe Text -> Text

-- | Update the given <a>Label</a> for a GTK Notebook tab.
--   
--   The new text for the label is determined by the <a>computeTabLabel</a>
--   function.
relabelTab :: Notebook -> Label -> ScrolledWindow -> Terminal -> IO ()
showScrollbarToPolicy :: ShowScrollbar -> PolicyType
createScrolledWin :: TMState -> IO ScrolledWindow
createNotebookTabLabel :: IO (Box, Label, Button)
setShowTabs :: TMConfig -> Notebook -> IO ()
toRGBA :: Colour Double -> IO RGBA

-- | TODO: This should probably be implemented in an external package,
--   since it is a generally useful utility.
--   
--   It should also be implemented for windows and osx.
cwdOfPid :: Int -> IO (Maybe Text)

-- | Get the current working directory from the shell in the focused tab of
--   a notebook.
--   
--   Returns <a>Nothing</a> if there is no focused tab of the notebook, or
--   the current working directory could not be detected for the shell.
getCWDFromFocusedTab :: TMNotebook -> IO (Maybe Text)

-- | Create the VTE <a>Terminal</a>, set the fonts and options
createAndInitVteTerm :: FontDescription -> ConfigOptions -> IO Terminal

-- | Starts a shell in a terminal and return a new TMTerm
launchShell :: Terminal -> Maybe Text -> IO Int

-- | Add a page to the notebook and switch to it.
addPage :: TMState -> TMNotebookTab -> Box -> IO ()

-- | Set the keyboard focus on a vte terminal
setFocusOn :: ApplicationWindow -> Terminal -> IO ()

-- | Create a new <a>TMTerm</a>, setting it up and adding it to the
--   GTKNotebook.
createTerm :: (TMState -> EventKey -> IO Bool) -> TMState -> IO TMTerm

-- | Popup the context menu on right click
handleMousePress :: ApplicationWindow -> Terminal -> EventButton -> IO Bool
eventButtonToEvent :: EventButton -> Event

module Termonad.Keys
showKeys :: EventKey -> IO Bool
data Key
Key :: Word32 -> Set ModifierType -> Key
[keyVal] :: Key -> Word32
[keyMods] :: Key -> Set ModifierType
toKey :: Word32 -> Set ModifierType -> Key
keyMap :: Map Key (TMState -> IO Bool)
stopProp :: (TMState -> IO a) -> TMState -> IO Bool
removeStrangeModifiers :: Key -> Key
handleKeyPress :: TMState -> EventKey -> IO Bool
instance GHC.Classes.Eq Termonad.Keys.Key
instance GHC.Classes.Ord Termonad.Keys.Key
instance GHC.Internal.Show.Show Termonad.Keys.Key


-- | To use this config extension in your
--   <tt>~/.config/termonad/termonad.hs</tt>, first import this module.
--   Create a new <a>ColourExtension</a> with the
--   <a>createColourExtension</a> function. Then add the
--   <a>ColourExtension</a> to your <a>TMConfig</a> with the
--   <a>addColourExtension</a> function.
--   
--   See <a>this code</a> for a simple example.
--   
--   When setting colors, you may find it convenient to use the
--   <a>print-console-colors</a> package, which provides an executable
--   called <tt>print-console-colors</tt> that prints all of the colors for
--   your terminal.
module Termonad.Config.Colour

-- | The configuration for the colors used by Termonad.
--   
--   <a>foregroundColour</a> and <a>backgroundColour</a> allow you to set
--   the color of the foreground text and background of the terminal.
--   
--   <a>highlightFgColour</a> and <a>highlightBgColour</a> allow you to set
--   the color of the foreground and background of the highlighted text.
--   
--   <a>palette</a> allows you to set the full color palette used by the
--   terminal. See <a>Palette</a> for more information.
--   
--   If you don't set <a>foregroundColour</a>, <a>backgroundColour</a>,
--   <a>highlightFgColour</a>, <a>highlightBgColour</a>, or <a>palette</a>,
--   the defaults from VTE are used.
--   
--   If you want to use a terminal with a white (or light) background and a
--   black foreground, it may be a good idea to change some of the colors
--   in the <a>Palette</a> as well.
--   
--   VTE works as follows: if you don't explicitly set a background or
--   foreground color, it takes the 0th colour from the <a>palette</a> to
--   be the background color, and the 7th colour from the <a>palette</a> to
--   be the foreground color. If you notice oddities with colouring in
--   certain applications, it may be helpful to make sure that these
--   <a>palette</a> colours match up with the <a>backgroundColour</a> and
--   <a>foregroundColour</a> you have set.)
--   
--   <a>cursorFgColour</a> and <a>cursorBgColour</a> allow you to set the
--   foreground color of the text under the cursor, as well as the color of
--   the cursor itself.
--   
--   Termonad will behave differently depending on the combination
--   <a>cursorFgColour</a> and <a>cursorBgColour</a> being <a>Set</a> vs.
--   <a>Unset</a>. Here is the summary of the different possibilities:
--   
--   <ul>
--   <li><a>cursorFgColour</a> is <a>Set</a> and <a>cursorBgColour</a> is
--   <a>Set</a>The foreground and background colors of the cursor are as
--   you have set.</li>
--   <li><a>cursorFgColour</a> is <a>Set</a> and <a>cursorBgColour</a> is
--   <a>Unset</a>The cursor background color turns completely black so that
--   it is not visible. The foreground color of the cursor is the color
--   that you have <a>Set</a>. This ends up being mostly unusable, so you
--   are recommended to always <a>Set</a> <a>cursorBgColour</a> when you
--   have <a>Set</a> <a>cursorFgColour</a>.</li>
--   <li><a>cursorFgColour</a> is <a>Unset</a> and <a>cursorBgColour</a> is
--   <a>Set</a>The cursor background color becomes the color you
--   <a>Set</a>, while the cursor foreground color doesn't change from the
--   letter it is over. For instance, imagine there is a letter on the
--   screen with a black background and a green foreground. If you bring
--   the cursor overtop of it, the cursor background will be the color you
--   have <a>Set</a>, while the cursor foreground will be green.This is
--   completely usable, but is slightly annoying if you place the cursor
--   over a letter with the same foreground color as the cursor's
--   background color, because the letter will not be readable. For
--   instance, imagine you have set your cursor background color to red,
--   and somewhere on the screen there is a letter with a black background
--   and a red foreground. If you move your cursor over the letter, the
--   background of the cursor will be red (as you have set), and the cursor
--   foreground will be red (to match the original foreground color of the
--   letter). This will make it so you can't actually read the letter,
--   because the foreground and background are both red.</li>
--   <li><a>cursorFgColour</a> is <a>Unset</a> and <a>cursorBgColour</a> is
--   <a>Unset</a>This combination makes the cursor inverse of whatever text
--   it is over. If your cursor is over red text with a black background,
--   the cursor background will be red and the cursor foreground will be
--   black.This is the default.</li>
--   </ul>
--   
--   <a>cursorFgColour</a> is not supported in <tt>vte-2.91</tt> versions
--   older than 0.44. (This is somewhat confusing. Note that
--   <tt>vte-2.91</tt> is the name of the system library, and <tt>0.44</tt>
--   is its version number.)
--   
--   See <a>defaultColourConfig</a> for the defaults for
--   <a>ColourConfig</a> used in Termonad.
data ColourConfig c
ColourConfig :: !Option c -> !Option c -> !Option c -> !Option c -> !Option c -> !Option c -> !Palette c -> ColourConfig c

-- | Foreground color of the cursor. This is the color of the text that the
--   cursor is over. This is not supported on older versions of VTE.
[cursorFgColour] :: ColourConfig c -> !Option c

-- | Background color of the cursor. This is the color of the cursor
--   itself.
[cursorBgColour] :: ColourConfig c -> !Option c

-- | Color of the default foreground text in the terminal.
[foregroundColour] :: ColourConfig c -> !Option c

-- | Background color for the terminal
[backgroundColour] :: ColourConfig c -> !Option c

-- | Foreground color for the highlighted text.
[highlightFgColour] :: ColourConfig c -> !Option c

-- | Background color for the highlighted text.
[highlightBgColour] :: ColourConfig c -> !Option c

-- | Color palette for the terminal. See <a>Palette</a>.
[palette] :: ColourConfig c -> !Palette c

-- | Default setting for a <a>ColourConfig</a>. The cursor colors, font
--   foreground color, background color, highlighted text color, and color
--   palette are all left at the defaults set by VTE.
--   
--   <pre>
--   &gt;&gt;&gt; defaultColourConfig
--   ColourConfig {cursorFgColour = Unset, cursorBgColour = Unset, foregroundColour = Unset, backgroundColour = Unset, highlightFgColour = Unset, highlightBgColour = Unset, palette = NoPalette}
--   </pre>
defaultColourConfig :: ColourConfig (AlphaColour Double)

-- | This newtype is for length 8 lists. Construct it with <a>mkList8</a>
--   or <a>unsafeMkList8</a>
data List8 a

-- | This newtype is for length 6 lists. Construct it with <a>mkList6</a>
--   or <a>unsafeMkList6</a>
data List6 a

-- | This newtype is for length 24 lists. Construct it with <a>mkList24</a>
--   or <a>unsafeMkList24</a>
data List24 a

-- | This newtype is for 6x6x6 matrices.. Construct it with <a>mkMatrix</a>
--   or <a>unsafeMkMatrix</a>
data Matrix a

-- | Typesafe smart constructor for length 8 lists.
mkList8 :: [a] -> Maybe (List8 a)

-- | Unsafe smart constructor for length 8 lists.
unsafeMkList8 :: [a] -> List8 a

-- | Set a given value in a <a>List8</a>.
--   
--   Internally uses <a>setAt</a>. See documentation on <a>setAt</a> for
--   some examples.
setAtList8 :: Int -> a -> List8 a -> List8 a

-- | Set a given value in a <a>List8</a>.
--   
--   Internally uses <a>overAt</a>. See documentation on <a>overAt</a> for
--   some examples.
overAtList8 :: Int -> (a -> a) -> List8 a -> List8 a

-- | Typesafe smart constructor for length 6 lists.
mkList6 :: [a] -> Maybe (List6 a)

-- | Unsafe smart constructor for length 6 lists.
unsafeMkList6 :: [a] -> List6 a

-- | Set a given value in a <a>List6</a>.
--   
--   Internally uses <a>setAt</a>. See documentation on <a>setAt</a> for
--   some examples.
setAtList6 :: Int -> a -> List6 a -> List6 a

-- | Set a given value in a <a>List6</a>.
--   
--   Internally uses <a>overAt</a>. See documentation on <a>overAt</a> for
--   some examples.
overAtList6 :: Int -> (a -> a) -> List6 a -> List6 a

-- | Typesafe smart constructor for length 24 lists.
mkList24 :: [a] -> Maybe (List24 a)

-- | Unsafe smart constructor for length 24 lists.
unsafeMkList24 :: [a] -> List24 a

-- | Set a given value in a <a>List24</a>.
--   
--   Internally uses <a>setAt</a>. See documentation on <a>setAt</a> for
--   some examples.
setAtList24 :: Int -> a -> List24 a -> List24 a

-- | Set a given value in a <a>List24</a>.
--   
--   Internally uses <a>overAt</a>. See documentation on <a>overAt</a> for
--   some examples.
overAtList24 :: Int -> (a -> a) -> List24 a -> List24 a

-- | Unsafe smart constructor for 6x6x6 Matrices.
mkMatrix :: [[[a]]] -> Maybe (Matrix a)

-- | Unsafe smart constructor for 6x6x6 Matrices.
unsafeMkMatrix :: [[[a]]] -> Matrix a

-- | Set a given value in a <a>Matrix</a>.
--   
--   Internally uses <a>setAt</a>. See documentation on <a>setAt</a> for
--   some examples.
setAtMatrix :: Int -> Int -> Int -> a -> Matrix a -> Matrix a

-- | Set a given value in a <a>Matrix</a>.
--   
--   Internally uses <a>overAt</a>. See documentation on <a>overAt</a> for
--   some examples.
overAtMatrix :: Int -> Int -> Int -> (a -> a) -> Matrix a -> Matrix a
lensCursorFgColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensCursorBgColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensForegroundColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensBackgroundColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensHighlightFgColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensHighlightBgColour :: forall c f. Functor f => (Option c -> f (Option c)) -> ColourConfig c -> f (ColourConfig c)
lensPalette :: forall c f. Functor f => (Palette c -> f (Palette c)) -> ColourConfig c -> f (ColourConfig c)

-- | Extension that allows setting colors for terminals in Termonad.
data ColourExtension
ColourExtension :: MVar (ColourConfig (AlphaColour Double)) -> (TMState -> Terminal -> IO ()) -> ColourExtension

-- | <a>MVar</a> holding the current <a>ColourConfig</a>. This could
--   potentially be passed to other extensions or user code. This would
--   allow changing the colors for new terminals in realtime.
[colourExtConf] :: ColourExtension -> MVar (ColourConfig (AlphaColour Double))

-- | The <tt>createTermHook</tt> used by the <a>ColourExtension</a>. This
--   sets the colors for a new terminal based on the <a>ColourConfig</a> in
--   <a>colourExtConf</a>.
[colourExtCreateTermHook] :: ColourExtension -> TMState -> Terminal -> IO ()

-- | Create a <a>ColourExtension</a> based on a given <a>ColourConfig</a>.
--   
--   Most users will want to use this.
createColourExtension :: ColourConfig (AlphaColour Double) -> IO ColourExtension

-- | Create a <a>ColourExtension</a> based on <a>defaultColourConfig</a>.
--   
--   Note that this is not needed if you just want to use the default
--   colors for Termonad. However, if you want to pass around the
--   <a>MVar</a> <a>ColourConfig</a> for extensions to use, then you may
--   need this function.
createDefColourExtension :: IO ColourExtension

-- | This is similar to <a>addColourConfig</a>, but can be used on a
--   <a>ColourExtension</a> created with <a>createColourExtension</a>.
addColourExtension :: TMConfig -> ColourExtension -> TMConfig

-- | Add a given <a>ColourConfig</a> to a <a>TMConfig</a>. This adds
--   <a>colourHook</a> to the <tt>createTermHook</tt> in <a>TMConfig</a>.
addColourConfig :: TMConfig -> ColourConfig (AlphaColour Double) -> IO TMConfig

-- | The default <tt>createTermHook</tt> for
--   <a>colourExtCreateTermHook</a>. Set the colors for a terminal based on
--   the given <a>ColourConfig</a>.
colourHook :: MVar (ColourConfig (AlphaColour Double)) -> TMState -> Terminal -> IO ()

-- | This function shows how to combine <tt>createTermHook</tt>s.
--   
--   This first runs the old hook, followed by the new hook.
--   
--   This is used internally by <a>addColourConfig</a> and
--   <a>addColourExtension</a>.
addColourHook :: (TMState -> Terminal -> IO ()) -> (TMState -> Terminal -> IO ()) -> TMState -> Terminal -> IO ()

-- | This is the color palette to use for the terminal. Each data
--   constructor lets you set progressively more colors. These colors are
--   used by the terminal to render <a>ANSI escape color codes</a>.
--   
--   There are 256 total terminal colors. <a>BasicPalette</a> lets you set
--   the first 8, <a>ExtendedPalette</a> lets you set the first 16,
--   <a>ColourCubePalette</a> lets you set the first 232, and
--   <a>FullPalette</a> lets you set all 256.
--   
--   The first 8 colors codes are the standard colors. The next 8 are the
--   extended (light) colors. The next 216 are a full color cube. The last
--   24 are a grey scale.
--   
--   The following image gives an idea of what each individual color looks
--   like:
--   
--   
--   This picture does not exactly match up with Termonad's default colors,
--   but it gives an idea of what each block of colors represents.
--   
--   You can use <a>defaultStandardColours</a>, <a>defaultLightColours</a>,
--   <a>defaultColourCube</a>, and <a>defaultGreyscale</a> as a starting
--   point to customize the colors. The only time you'd need to use a
--   constructor other than <a>NoPalette</a> is when you want to customize
--   the default colors. That is to say, using <a>FullPalette</a> with all
--   the defaults should give you the same result as using
--   <a>NoPalette</a>.
data Palette c

-- | Don't set any colors and just use the default from VTE. This is a
--   black background with light grey text.
NoPalette :: Palette c

-- | Set the colors from the standard colors.
BasicPalette :: !List8 c -> Palette c

-- | Set the colors from the extended (light) colors (as well as standard
--   colors).
ExtendedPalette :: !List8 c -> !List8 c -> Palette c

-- | Set the colors from the color cube (as well as the standard colors and
--   extended colors).
ColourCubePalette :: !List8 c -> !List8 c -> !Matrix c -> Palette c

-- | Set the colors from the grey scale (as well as the standard colors,
--   extended colors, and color cube).
FullPalette :: !List8 c -> !List8 c -> !Matrix c -> !List24 c -> Palette c

-- | A <tt>Vec</tt> of standard colors. Default value for
--   <a>BasicPalette</a>.
--   
--   <pre>
--   &gt;&gt;&gt; showColourVec defaultStandardColours
--   ["#000000ff","#c00000ff","#00c000ff","#c0c000ff","#0000c0ff","#c000c0ff","#00c0c0ff","#c0c0c0ff"]
--   </pre>
defaultStandardColours :: (Ord b, Floating b) => List8 (AlphaColour b)

-- | A <tt>Vec</tt> of extended (light) colors. Default value for
--   <a>ExtendedPalette</a>.
--   
--   <pre>
--   &gt;&gt;&gt; showColourVec defaultLightColours
--   ["#3f3f3fff","#ff3f3fff","#3fff3fff","#ffff3fff","#3f3fffff","#ff3fffff","#3fffffff","#ffffffff"]
--   </pre>
defaultLightColours :: (Ord b, Floating b) => List8 (AlphaColour b)

-- | A matrix of a 6 x 6 x 6 color cube. Default value for
--   <a>ColourCubePalette</a>.
--   
--   <pre>
--   &gt;&gt;&gt; putStrLn $ pack $ showColourCube defaultColourCube
--   [ [ #000000ff, #00005fff, #000087ff, #0000afff, #0000d7ff, #0000ffff
--     , #005f00ff, #005f5fff, #005f87ff, #005fafff, #005fd7ff, #005fffff
--     , #008700ff, #00875fff, #008787ff, #0087afff, #0087d7ff, #0087ffff
--     , #00af00ff, #00af5fff, #00af87ff, #00afafff, #00afd7ff, #00afffff
--     , #00d700ff, #00d75fff, #00d787ff, #00d7afff, #00d7d7ff, #00d7ffff
--     , #00ff00ff, #00ff5fff, #00ff87ff, #00ffafff, #00ffd7ff, #00ffffff
--     ]
--   , [ #5f0000ff, #5f005fff, #5f0087ff, #5f00afff, #5f00d7ff, #5f00ffff
--     , #5f5f00ff, #5f5f5fff, #5f5f87ff, #5f5fafff, #5f5fd7ff, #5f5fffff
--     , #5f8700ff, #5f875fff, #5f8787ff, #5f87afff, #5f87d7ff, #5f87ffff
--     , #5faf00ff, #5faf5fff, #5faf87ff, #5fafafff, #5fafd7ff, #5fafffff
--     , #5fd700ff, #5fd75fff, #5fd787ff, #5fd7afff, #5fd7d7ff, #5fd7ffff
--     , #5fff00ff, #5fff5fff, #5fff87ff, #5fffafff, #5fffd7ff, #5fffffff
--     ]
--   , [ #870000ff, #87005fff, #870087ff, #8700afff, #8700d7ff, #8700ffff
--     , #875f00ff, #875f5fff, #875f87ff, #875fafff, #875fd7ff, #875fffff
--     , #878700ff, #87875fff, #878787ff, #8787afff, #8787d7ff, #8787ffff
--     , #87af00ff, #87af5fff, #87af87ff, #87afafff, #87afd7ff, #87afffff
--     , #87d700ff, #87d75fff, #87d787ff, #87d7afff, #87d7d7ff, #87d7ffff
--     , #87ff00ff, #87ff5fff, #87ff87ff, #87ffafff, #87ffd7ff, #87ffffff
--     ]
--   , [ #af0000ff, #af005fff, #af0087ff, #af00afff, #af00d7ff, #af00ffff
--     , #af5f00ff, #af5f5fff, #af5f87ff, #af5fafff, #af5fd7ff, #af5fffff
--     , #af8700ff, #af875fff, #af8787ff, #af87afff, #af87d7ff, #af87ffff
--     , #afaf00ff, #afaf5fff, #afaf87ff, #afafafff, #afafd7ff, #afafffff
--     , #afd700ff, #afd75fff, #afd787ff, #afd7afff, #afd7d7ff, #afd7ffff
--     , #afff00ff, #afff5fff, #afff87ff, #afffafff, #afffd7ff, #afffffff
--     ]
--   , [ #d70000ff, #d7005fff, #d70087ff, #d700afff, #d700d7ff, #d700ffff
--     , #d75f00ff, #d75f5fff, #d75f87ff, #d75fafff, #d75fd7ff, #d75fffff
--     , #d78700ff, #d7875fff, #d78787ff, #d787afff, #d787d7ff, #d787ffff
--     , #d7af00ff, #d7af5fff, #d7af87ff, #d7afafff, #d7afd7ff, #d7afffff
--     , #d7d700ff, #d7d75fff, #d7d787ff, #d7d7afff, #d7d7d7ff, #d7d7ffff
--     , #d7ff00ff, #d7ff5fff, #d7ff87ff, #d7ffafff, #d7ffd7ff, #d7ffffff
--     ]
--   , [ #ff0000ff, #ff005fff, #ff0087ff, #ff00afff, #ff00d7ff, #ff00ffff
--     , #ff5f00ff, #ff5f5fff, #ff5f87ff, #ff5fafff, #ff5fd7ff, #ff5fffff
--     , #ff8700ff, #ff875fff, #ff8787ff, #ff87afff, #ff87d7ff, #ff87ffff
--     , #ffaf00ff, #ffaf5fff, #ffaf87ff, #ffafafff, #ffafd7ff, #ffafffff
--     , #ffd700ff, #ffd75fff, #ffd787ff, #ffd7afff, #ffd7d7ff, #ffd7ffff
--     , #ffff00ff, #ffff5fff, #ffff87ff, #ffffafff, #ffffd7ff, #ffffffff
--     ]
--   ]
--   </pre>
defaultColourCube :: (Ord b, Floating b) => Matrix (AlphaColour b)

-- | A List of a grey scale. Default value for <a>FullPalette</a>.
--   
--   <pre>
--   &gt;&gt;&gt; fmap sRGB32show defaultGreyscale
--   List24 {getList24 = ["#080808ff","#121212ff","#1c1c1cff","#262626ff","#303030ff","#3a3a3aff","#444444ff","#4e4e4eff","#585858ff","#626262ff","#6c6c6cff","#767676ff","#808080ff","#8a8a8aff","#949494ff","#9e9e9eff","#a8a8a8ff","#b2b2b2ff","#bcbcbcff","#c6c6c6ff","#d0d0d0ff","#dadadaff","#e4e4e4ff","#eeeeeeff"]}
--   </pre>
defaultGreyscale :: (Ord b, Floating b) => List24 (AlphaColour b)

-- | This type represents a <a>Colour</a> that may be semi-transparent.
--   
--   The <a>Monoid</a> instance allows you to composite colours.
--   
--   <pre>
--   x `mappend` y == x `over` y
--   </pre>
--   
--   To get the (pre-multiplied) colour channel of an <a>AlphaColour</a>
--   <tt>c</tt>, simply composite <tt>c</tt> over black.
--   
--   <pre>
--   c `over` black
--   </pre>
data AlphaColour a

-- | Create an <a>AlphaColour</a> that is fully <a>opaque</a>.
--   
--   <pre>
--   &gt;&gt;&gt; sRGB32show $ createColour 64 96 128
--   "#406080ff"
--   
--   &gt;&gt;&gt; sRGB32show $ createColour 0 0 0
--   "#000000ff"
--   </pre>
--   
--   Similar to <a>sRGB24</a> but for <a>AlphaColour</a>.
createColour :: Word8 -> Word8 -> Word8 -> AlphaColour Double

-- | Create an <a>AlphaColour</a> from a four <a>Word8</a>s.
--   
--   <pre>
--   &gt;&gt;&gt; sRGB32show $ sRGB32 64 96 128 255
--   "#406080ff"
--   
--   &gt;&gt;&gt; sRGB32show $ sRGB32 0x08 0x10 0x20 0x01
--   "#08102001"
--   </pre>
--   
--   Note that if you specify the alpha as 0 (which means completely
--   translucent), all the color channels will be set to 0 as well.
--   
--   <pre>
--   &gt;&gt;&gt; sRGB32show $ sRGB32 100 150 200 0
--   "#00000000"
--   </pre>
--   
--   Similar to <a>sRGB24</a> but also includes an alpha channel. Most
--   users will probably want to use <a>createColour</a> instead.
sRGB32 :: Word8 -> Word8 -> Word8 -> Word8 -> AlphaColour Double

-- | Show an <a>AlphaColour</a> in hex.
--   
--   <pre>
--   &gt;&gt;&gt; sRGB32show (opaque red)
--   "#ff0000ff"
--   </pre>
--   
--   Similar to <a>sRGB24show</a>.
sRGB32show :: AlphaColour Double -> String

-- | Creates an opaque <a>AlphaColour</a> from a <a>Colour</a>.
opaque :: Num a => Colour a -> AlphaColour a

-- | This <a>AlphaColour</a> is entirely transparent and has no associated
--   colour channel.
transparent :: Num a => AlphaColour a

-- | A helper function for showing all the colors in <tt>Vec</tt> of
--   colors.
showColourVec :: List8 (AlphaColour Double) -> [String]

-- | Helper function for showing all the colors in a color cube. This is
--   used for debugging.
showColourCube :: Matrix (AlphaColour Double) -> String

-- | Convert a <a>Palette</a> to a list of colors. This is helpful for
--   debugging.
paletteToList :: Palette c -> [c]

-- | Create a vector of colors based on input bits.
--   
--   This is used to derive <a>defaultStandardColours</a> and
--   <a>defaultLightColours</a>.
--   
--   <pre>
--   &gt;&gt;&gt; coloursFromBits 192 0 == defaultStandardColours
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; coloursFromBits 192 63 == defaultLightColours
--   True
--   </pre>
--   
--   In general, as an end-user, you shouldn't need to use this.
coloursFromBits :: (Ord b, Floating b) => Word8 -> Word8 -> List8 (AlphaColour b)

-- | Specify a colour cube with one colour vector for its displacement and
--   three colour vectors for its edges. Produces a uniform 6x6x6 grid
--   bounded by and orthognal to the faces.
cube :: Fractional b => AlphaColour b -> AlphaColour b -> AlphaColour b -> AlphaColour b -> Matrix (AlphaColour b)

-- | Set a given value in a list.
--   
--   <pre>
--   &gt;&gt;&gt; setAt 2 "hello" ["a","b","c","d"]
--   ["a","b","hello","d"]
--   </pre>
--   
--   You can set the first and last values in the list as well:
--   
--   <pre>
--   &gt;&gt;&gt; setAt 0 "hello" ["a","b","c","d"]
--   ["hello","b","c","d"]
--   
--   &gt;&gt;&gt; setAt 3 "hello" ["a","b","c","d"]
--   ["a","b","c","hello"]
--   </pre>
--   
--   If you try to set a value outside of the list, you'll get back the
--   same list:
--   
--   <pre>
--   &gt;&gt;&gt; setAt (-10) "hello" ["a","b","c","d"]
--   ["a","b","c","d"]
--   
--   &gt;&gt;&gt; setAt 100 "hello" ["a","b","c","d"]
--   ["a","b","c","d"]
--   </pre>
setAt :: Int -> a -> [a] -> [a]

-- | Update a given value in a list.
--   
--   <pre>
--   &gt;&gt;&gt; overAt 2 (\x -&gt; x ++ x) ["a","b","c","d"]
--   ["a","b","cc","d"]
--   </pre>
--   
--   You can update the first and last values in the list as well:
--   
--   <pre>
--   &gt;&gt;&gt; overAt 0 (\x -&gt; "bye") ["a","b","c","d"]
--   ["bye","b","c","d"]
--   
--   &gt;&gt;&gt; overAt 3 (\x -&gt; "") ["a","b","c","d"]
--   ["a","b","c",""]
--   </pre>
--   
--   If you try to set a value outside of the list, you'll get back the
--   same list:
--   
--   <pre>
--   &gt;&gt;&gt; overAt (-10) (\_ -&gt; "foobar") ["a","b","c","d"]
--   ["a","b","c","d"]
--   
--   &gt;&gt;&gt; overAt 100 (\_ -&gt; "baz") ["a","b","c","d"]
--   ["a","b","c","d"]
--   </pre>
overAt :: Int -> (a -> a) -> [a] -> [a]
instance GHC.Classes.Eq c => GHC.Classes.Eq (Termonad.Config.Colour.ColourConfig c)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List24 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List6 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List8 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.Matrix a)
instance GHC.Classes.Eq c => GHC.Classes.Eq (Termonad.Config.Colour.Palette c)
instance GHC.Internal.Data.Foldable.Foldable Termonad.Config.Colour.List24
instance GHC.Internal.Data.Foldable.Foldable Termonad.Config.Colour.List6
instance GHC.Internal.Data.Foldable.Foldable Termonad.Config.Colour.List8
instance GHC.Internal.Data.Foldable.Foldable Termonad.Config.Colour.Matrix
instance GHC.Internal.Data.Foldable.Foldable Termonad.Config.Colour.Palette
instance GHC.Internal.Base.Functor Termonad.Config.Colour.ColourConfig
instance GHC.Internal.Base.Functor Termonad.Config.Colour.List24
instance GHC.Internal.Base.Functor Termonad.Config.Colour.List6
instance GHC.Internal.Base.Functor Termonad.Config.Colour.List8
instance GHC.Internal.Base.Functor Termonad.Config.Colour.Matrix
instance GHC.Internal.Base.Functor Termonad.Config.Colour.Palette
instance GHC.Internal.Show.Show c => GHC.Internal.Show.Show (Termonad.Config.Colour.ColourConfig c)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Termonad.Config.Colour.List24 a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Termonad.Config.Colour.List6 a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Termonad.Config.Colour.List8 a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Termonad.Config.Colour.Matrix a)
instance GHC.Internal.Show.Show c => GHC.Internal.Show.Show (Termonad.Config.Colour.Palette c)


-- | This module exposes termonad's basic configuration options. To set
--   these options in your config, first ensure you've imported
--   <a>Termonad</a>.
--   
--   Then for your main, apply <a>start</a> or <a>defaultMain</a> to a
--   <a>TMConfig</a> value. We suggest you build such values by performing
--   record updates on the <a>defaultTMConfig</a> rather than using the
--   <a>TMConfig</a> constructor, as the latter is much more likely to
--   break when there are changes to the <a>TMConfig</a> type.
--   
--   E.g.
--   
--   <pre>
--   -- Re-exports this module.
--   import <a>Termonad</a>
--   
--   main :: IO ()
--   main = <tt>start</tt> $ <a>defaultTMConfig</a>
--     { <a>showScrollbar</a> = <a>ShowScrollbarNever</a>
--     , <a>confirmExit</a> = False
--     , <a>showMenu</a> = False
--     , <a>cursorBlinkMode</a> = <a>CursorBlinkModeOff</a>
--     }
--   </pre>
--   
--   Additional options can be found in the following modules.
--   
--   <ul>
--   <li><a>Termonad.Config.Colour</a></li>
--   </ul>
--   
--   If you want to see an example configuration file, as well as an
--   explanation for how to use Termonad, see the Termonad <a>README</a>.
module Termonad.Config

-- | The Termonad <a>ConfigOptions</a> along with the <a>ConfigHooks</a>.
data TMConfig
TMConfig :: !ConfigOptions -> !ConfigHooks -> TMConfig
[options] :: TMConfig -> !ConfigOptions
[hooks] :: TMConfig -> !ConfigHooks

-- | The default <a>TMConfig</a>.
--   
--   <a>options</a> is <a>defaultConfigOptions</a> and <a>hooks</a> is
--   <a>defaultConfigHooks</a>.
defaultTMConfig :: TMConfig

-- | Configuration options for Termonad.
--   
--   See <a>defaultConfigOptions</a> for the default values.
data ConfigOptions
ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> !Bool -> ConfigOptions

-- | Specific options for fonts.
[fontConfig] :: ConfigOptions -> !FontConfig

-- | When to show the scroll bar.
[showScrollbar] :: ConfigOptions -> !ShowScrollbar

-- | The number of lines to keep in the scroll back history for each
--   terminal.
[scrollbackLen] :: ConfigOptions -> !Integer

-- | Whether or not to ask you for confirmation when closing individual
--   terminals or Termonad itself. It is generally safer to keep this as
--   <a>True</a>.
[confirmExit] :: ConfigOptions -> !Bool

-- | When double-clicking on text in the terminal with the mouse, Termonad
--   will use this value to determine what to highlight. The individual
--   characters in this list will be counted as part of a word.
--   
--   For instance if <a>wordCharExceptions</a> is <tt>""</tt>, then when
--   you double-click on the text <tt>http://</tt>, only the <tt>http</tt>
--   portion will be highlighted. If <a>wordCharExceptions</a> is
--   <tt>":"</tt>, then the <tt>http:</tt> portion will be highlighted.
[wordCharExceptions] :: ConfigOptions -> !Text

-- | Whether or not to show the <tt>File</tt> <tt>Edit</tt> etc menu.
[showMenu] :: ConfigOptions -> !Bool

-- | When to show the tab bar.
[showTabBar] :: ConfigOptions -> !ShowTabBar

-- | How to handle cursor blink.
[cursorBlinkMode] :: ConfigOptions -> !CursorBlinkMode

-- | This option controls whether or not to force bold text to use colors
--   from the <a>ExtendedPalatte</a>.
--   
--   If <a>True</a>, then colored bold text will <i>always</i> use colors
--   from the <a>ExtendedPalatte</a>. There will be no way to print bold
--   text colored with the <a>BasicPalatte</a>.
--   
--   This often isn't a big problem, since many TUI applications use bold
--   in combination with colors from the <a>ExtendedPalatte</a>. Also, the
--   VTE default blue color can be difficult to read with a dark
--   background, and enabling this can work around the problem. See
--   <a>https://github.com/cdepillabout/termonad/issues/177</a> for more
--   information.
--   
--   If <a>False</a>, then bold can be applied separately to colors from
--   both the <a>BasicPalatte</a> and <a>ExtendedPalatte</a>.
[boldIsBright] :: ConfigOptions -> !Bool

-- | Enable SIXEL to draw graphics in a terminal.
--   
--   In order for this option to do anything, you need to be using a
--   version of VTE &gt;= 0.63, and compile VTE with SIXEL support.
--   
--   Note that even if you do the above, there may still be some problems
--   with SIXEL support in VTE. Follow
--   <a>https://gitlab.gnome.org/GNOME/vte/-/issues/253</a> for more
--   information.
[enableSixel] :: ConfigOptions -> !Bool

-- | Allow terminal to use bold text.
--   
--   You may want to disable this, for instance, if you use a font that
--   doesn't look good when bold.
[allowBold] :: ConfigOptions -> !Bool

-- | The default <a>ConfigOptions</a>.
--   
--   <pre>
--   &gt;&gt;&gt; :{
--     let defConfOpt =
--           ConfigOptions
--             { fontConfig = defaultFontConfig
--             , showScrollbar = ShowScrollbarIfNeeded
--             , scrollbackLen = 10000
--             , confirmExit = True
--             , wordCharExceptions = "-#%&amp;+,./=?@\\_~\183:"
--             , showMenu = True
--             , showTabBar = ShowTabBarIfNeeded
--             , cursorBlinkMode = CursorBlinkModeOn
--             , boldIsBright = False
--             , enableSixel = False
--             , allowBold = True
--             }
--     in defaultConfigOptions == defConfOpt
--   :}
--   True
--   </pre>
defaultConfigOptions :: ConfigOptions

-- | Hooks into certain termonad operations and VTE events. Used to modify
--   termonad's behaviour in order to implement new functionality. Fields
--   should have sane <tt>Semigroup</tt> and <tt>Monoid</tt> instances so
--   that config extensions can be combined uniformly and new hooks can be
--   added without incident.
newtype ConfigHooks
ConfigHooks :: (TMState -> Terminal -> IO ()) -> ConfigHooks

-- | Produce an IO action to run on creation of new <tt>Terminal</tt>,
--   given <tt>TMState</tt> and the <tt>Terminal</tt> in question.
[createTermHook] :: ConfigHooks -> TMState -> Terminal -> IO ()

-- | Default values for the <a>ConfigHooks</a>.
--   
--   <ul>
--   <li>The default function for <a>createTermHook</a> is
--   <a>defaultCreateTermHook</a>.</li>
--   </ul>
defaultConfigHooks :: ConfigHooks

-- | 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 <a>FontSizePoints</a> first and
--   see how it looks. It should generally correspond to font sizes you are
--   used to from other applications.
data FontSize

-- | 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 <a>fontDescriptionSetSize</a> is used to
--   set the font size. See the documentation for that function for more
--   info.
FontSizePoints :: Int -> FontSize

-- | This sets the font size based on "device units". In general, this can
--   be thought of as one pixel. The function
--   <a>fontDescriptionSetAbsoluteSize</a> is used to set the font size.
--   See the documentation for that function for more info.
FontSizeUnits :: Double -> FontSize

-- | The default <a>FontSize</a> used if not specified.
--   
--   <pre>
--   &gt;&gt;&gt; defaultFontSize
--   FontSizePoints 12
--   </pre>
defaultFontSize :: FontSize

-- | Settings for the font to be used in Termonad.
data FontConfig
FontConfig :: !Text -> !FontSize -> FontConfig

-- | The font family to use. Example: <tt>"DejaVu Sans Mono"</tt> or
--   <tt>"Source Code Pro"</tt>
[fontFamily] :: FontConfig -> !Text

-- | The font size.
[fontSize] :: FontConfig -> !FontSize

-- | The default <a>FontConfig</a> to use if not specified.
--   
--   <pre>
--   &gt;&gt;&gt; defaultFontConfig == FontConfig {fontFamily = "Monospace", fontSize = defaultFontSize}
--   True
--   </pre>
defaultFontConfig :: FontConfig

-- | This data type represents an option that can either be <a>Set</a> or
--   <a>Unset</a>.
--   
--   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 <tt>cursorFgColour</tt> and
--   <tt>cursorBgColour</tt> options supplied by the <tt>ColourConfig</tt>
--   <tt>ConfigExtension</tt>. By default, <tt>cursorFgColour</tt> and
--   <tt>cursorBgColour</tt> are both <a>Unset</a>. However, when
--   <tt>cursorBgColour</tt> is <a>Set</a>, <tt>cursorFgColour</tt>
--   defaults to the color of the text underneath. There is no way to
--   represent this by setting <tt>cursorFgColour</tt>.
data Option a
Unset :: Option a
Set :: !a -> Option a

-- | Whether or not to show the scroll bar in a terminal.
data ShowScrollbar

-- | 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.
ShowScrollbarNever :: ShowScrollbar

-- | Always show the scrollbar, even if it is not needed.
ShowScrollbarAlways :: ShowScrollbar

-- | Only show the scrollbar if there are too many lines on the terminal to
--   show all at once.
ShowScrollbarIfNeeded :: ShowScrollbar

-- | Whether or not to show the tab bar for switching tabs.
data ShowTabBar

-- | Never show the tab bar, even if there are multiple tabs open. This may
--   be confusing if you plan on using multiple tabs.
ShowTabBarNever :: ShowTabBar

-- | Always show the tab bar, even if you only have one tab open.
ShowTabBarAlways :: ShowTabBar

-- | Only show the tab bar if you have multiple tabs open.
ShowTabBarIfNeeded :: ShowTabBar

-- | An enumerated type which can be used to indicate the cursor blink mode
--   for the terminal.
data CursorBlinkMode

-- | Follow GTK+ settings for cursor blinking.
CursorBlinkModeSystem :: CursorBlinkMode

-- | Cursor blinks.
CursorBlinkModeOn :: CursorBlinkMode

-- | Cursor does not blink.
CursorBlinkModeOff :: CursorBlinkMode

-- | Catch-all for unknown values
AnotherCursorBlinkMode :: Int -> CursorBlinkMode

-- | Read the configuration for the preferences file
--   <tt>~/.config/termonad/termonad.yaml</tt>. This file stores only the
--   <a>options</a> of <a>TMConfig</a> so <a>hooks</a> are initialized with
--   <a>defaultConfigHooks</a>. If the file doesn't exist, create it with
--   the default values.
--   
--   Any options that do not exist will get initialized with values from
--   <a>defaultConfigOptions</a>.
tmConfigFromPreferencesFile :: IO TMConfig

module Termonad.XML
interfaceDoc :: Document
interfaceText :: Text
menuDoc :: Document
menuText :: Text
aboutDoc :: Document
aboutText :: Text
closeTabDoc :: Document
closeTabText :: Text
preferencesText :: Text

module Termonad.App
setupScreenStyle :: IO ()
createFontDescFromConfig :: TMConfig -> IO FontDescription
createFontDesc :: FontSize -> Text -> IO FontDescription
setFontDescSize :: FontDescription -> FontSize -> IO ()
adjustFontDescSize :: (FontSize -> FontSize) -> FontDescription -> IO ()
modifyFontSizeForAllTerms :: (FontSize -> FontSize) -> TMState -> IO ()
fontSizeFromFontDescription :: FontDescription -> IO FontSize
fontConfigFromFontDescription :: FontDescription -> IO (Maybe FontConfig)
compareScrolledWinAndTab :: ScrolledWindow -> TMNotebookTab -> Bool
updateFLTabPos :: TMState -> Int -> Int -> IO ()

-- | Try to figure out whether Termonad should exit. This also used to
--   figure out if Termonad should close a given terminal.
--   
--   This reads the <a>confirmExit</a> setting from <a>ConfigOptions</a> to
--   check whether the user wants to be notified when either Termonad or a
--   given terminal is about to be closed.
--   
--   If <a>confirmExit</a> is <a>True</a>, then a dialog is presented to
--   the user asking them if they really want to exit or close the
--   terminal. Their response is sent back as a <a>ResponseType</a>.
--   
--   If <a>confirmExit</a> is <a>False</a>, then this function always
--   returns <a>ResponseTypeYes</a>.
askShouldExit :: TMState -> IO ResponseType

-- | Force Termonad to exit without asking the user whether or not to do
--   so.
forceQuit :: TMState -> IO ()
setupTermonad :: TMConfig -> Application -> ApplicationWindow -> Builder -> IO ()
appActivate :: TMConfig -> Application -> IO ()
showAboutDialog :: Application -> IO ()
showFindDialog :: Application -> IO (Maybe Text)
doFind :: TMState -> IO ()
findAbove :: TMState -> IO ()
findBelow :: TMState -> IO ()
setShowMenuBar :: Application -> Bool -> IO ()

-- | Fill a combo box with ids and labels
--   
--   The ids are stored in the combobox as <a>Text</a>, so their type
--   should be an instance of the <a>Show</a> type class.
comboBoxFill :: Show a => ComboBoxText -> [(a, Text)] -> IO ()

-- | Set the current active item in a combobox given an input id.
comboBoxSetActive :: Show a => ComboBoxText -> a -> IO ()

-- | Get the current active item in a combobox
--   
--   The list of values to be searched in the combobox must be given as a
--   parameter. These values are converted to Text then compared to the
--   current id.
comboBoxGetActive :: (Show a, Enum a) => ComboBoxText -> [a] -> IO (Maybe a)
applyNewPreferences :: TMState -> IO ()
applyNewPreferencesToTab :: TMState -> TMNotebookTab -> IO ()

-- | Show the preferences dialog.
--   
--   When the user clicks on the Ok button, it copies the new settings to
--   TMState. Then apply them to the current terminals.
showPreferencesDialog :: TMState -> IO ()
appStartup :: Application -> IO ()

-- | Run Termonad with the given <a>TMConfig</a>.
--   
--   Do not perform any of the recompilation operations that the
--   <a>defaultMain</a> function does.
start :: TMConfig -> IO ()

-- | Run Termonad with the given <a>TMConfig</a>.
--   
--   This function will check if there is a
--   <tt>~/.config/termonad/termonad.hs</tt> file and a
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary. Termonad will
--   perform different actions based on whether or not these two files
--   exist.
--   
--   Here are the four different possible actions based on the existence of
--   these two files.
--   
--   <ul>
--   <li><tt>~/.config/termonad/termonad.hs</tt> exists,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> existsThe timestamps
--   of these two files are checked. If the
--   <tt>~/.config/termonad/termonad.hs</tt> file has been modified after
--   the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary, then
--   Termonad will use GHC to recompile the
--   <tt>~/.config/termonad/termonad.hs</tt> file, producing a new binary
--   at <tt>~/.cache/termonad/termonad-linux-x86_64</tt>. This new binary
--   will be re-executed. The <a>TMConfig</a> passed to this
--   <a>defaultMain</a> will be effectively thrown away.If GHC fails to
--   recompile the <tt>~/.config/termonad/termonad.hs</tt> file, then
--   Termonad will just execute <a>start</a> with the <a>TMConfig</a>
--   passed in.If the <tt>~/.cache/termonad/termonad-linux-x86_64</tt>
--   binary has been modified after the
--   <tt>~/.config/termonad/termonad.hs</tt> file, then Termonad will
--   re-exec the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary.
--   The <a>TMConfig</a> passed to this <a>defaultMain</a> will be
--   effectively thrown away.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> exists,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> does not
--   existTermonad will use GHC to recompile the
--   <tt>~/.config/termonad/termonad.hs</tt> file, producing a new binary
--   at <tt>~/.cache/termonad/termonad-linux-x86_64</tt>. This new binary
--   will be re-executed. The <a>TMConfig</a> passed to this
--   <a>defaultMain</a> will be effectively thrown away.If GHC fails to
--   recompile the <tt>~/.config/termonad/termonad.hs</tt> file, then
--   Termonad will just execute <a>start</a> with the <a>TMConfig</a>
--   passed in.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> does not exist,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> existsTermonad will
--   ignore the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary and
--   just run <a>start</a> with the <a>TMConfig</a> passed to this
--   function.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> does not exist,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> does not
--   existTermonad will run <a>start</a> with the <a>TMConfig</a> passed to
--   this function.</li>
--   </ul>
--   
--   Other notes:
--   
--   <ol>
--   <li>That the locations of <tt>~/.config/termonad/termonad.hs</tt> and
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> may differ depending
--   on your system.</li>
--   <li>In your own <tt>~/.config/termonad/termonad.hs</tt> file, you can
--   use either <a>defaultMain</a> or <a>start</a>. As long as you always
--   execute the system-wide <tt>termonad</tt> binary (instead of the
--   binary produced as <tt>~/.cache/termonad/termonad-linux-x86_64</tt>),
--   the effect should be the same.</li>
--   </ol>
defaultMain :: TMConfig -> IO ()


-- | This module exposes termonad's basic configuration options, as well as
--   <a>defaultMain</a>.
--   
--   If you want to configure Termonad, please take a look at
--   <a>Termonad.Config</a>.
module Termonad

-- | Run Termonad with the given <a>TMConfig</a>.
--   
--   This function will check if there is a
--   <tt>~/.config/termonad/termonad.hs</tt> file and a
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary. Termonad will
--   perform different actions based on whether or not these two files
--   exist.
--   
--   Here are the four different possible actions based on the existence of
--   these two files.
--   
--   <ul>
--   <li><tt>~/.config/termonad/termonad.hs</tt> exists,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> existsThe timestamps
--   of these two files are checked. If the
--   <tt>~/.config/termonad/termonad.hs</tt> file has been modified after
--   the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary, then
--   Termonad will use GHC to recompile the
--   <tt>~/.config/termonad/termonad.hs</tt> file, producing a new binary
--   at <tt>~/.cache/termonad/termonad-linux-x86_64</tt>. This new binary
--   will be re-executed. The <a>TMConfig</a> passed to this
--   <a>defaultMain</a> will be effectively thrown away.If GHC fails to
--   recompile the <tt>~/.config/termonad/termonad.hs</tt> file, then
--   Termonad will just execute <a>start</a> with the <a>TMConfig</a>
--   passed in.If the <tt>~/.cache/termonad/termonad-linux-x86_64</tt>
--   binary has been modified after the
--   <tt>~/.config/termonad/termonad.hs</tt> file, then Termonad will
--   re-exec the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary.
--   The <a>TMConfig</a> passed to this <a>defaultMain</a> will be
--   effectively thrown away.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> exists,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> does not
--   existTermonad will use GHC to recompile the
--   <tt>~/.config/termonad/termonad.hs</tt> file, producing a new binary
--   at <tt>~/.cache/termonad/termonad-linux-x86_64</tt>. This new binary
--   will be re-executed. The <a>TMConfig</a> passed to this
--   <a>defaultMain</a> will be effectively thrown away.If GHC fails to
--   recompile the <tt>~/.config/termonad/termonad.hs</tt> file, then
--   Termonad will just execute <a>start</a> with the <a>TMConfig</a>
--   passed in.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> does not exist,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> existsTermonad will
--   ignore the <tt>~/.cache/termonad/termonad-linux-x86_64</tt> binary and
--   just run <a>start</a> with the <a>TMConfig</a> passed to this
--   function.</li>
--   <li><tt>~/.config/termonad/termonad.hs</tt> does not exist,
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> does not
--   existTermonad will run <a>start</a> with the <a>TMConfig</a> passed to
--   this function.</li>
--   </ul>
--   
--   Other notes:
--   
--   <ol>
--   <li>That the locations of <tt>~/.config/termonad/termonad.hs</tt> and
--   <tt>~/.cache/termonad/termonad-linux-x86_64</tt> may differ depending
--   on your system.</li>
--   <li>In your own <tt>~/.config/termonad/termonad.hs</tt> file, you can
--   use either <a>defaultMain</a> or <a>start</a>. As long as you always
--   execute the system-wide <tt>termonad</tt> binary (instead of the
--   binary produced as <tt>~/.cache/termonad/termonad-linux-x86_64</tt>),
--   the effect should be the same.</li>
--   </ol>
defaultMain :: TMConfig -> IO ()

-- | Run Termonad with the given <a>TMConfig</a>.
--   
--   Do not perform any of the recompilation operations that the
--   <a>defaultMain</a> function does.
start :: TMConfig -> IO ()
