termonad-4.5.0.0: Terminal emulator configurable in Haskell

Safe Haskell | None
Language | Haskell2010

Termonad.App

Synopsis

- 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 ()
- askShouldExit :: TMState -> IO ResponseType
- 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 ()
- comboBoxFill :: Show a => ComboBoxText -> [(a, Text)] -> IO ()
- comboBoxSetActive :: Show a => ComboBoxText -> a -> IO ()
- comboBoxGetActive :: (Show a, Enum a) => ComboBoxText -> [a] -> IO (Maybe a)
- applyNewPreferences :: TMState -> IO ()
- applyNewPreferencesToTab :: TMState -> TMNotebookTab -> IO ()
- showPreferencesDialog :: TMState -> IO ()
- appStartup :: Application -> IO ()
- start :: TMConfig -> IO ()
- defaultMain :: TMConfig -> IO ()

# Documentation

setupScreenStyle :: IO () Source #

createFontDescFromConfig :: TMConfig -> IO FontDescription Source #

createFontDesc :: FontSize -> Text -> IO FontDescription Source #

setFontDescSize :: FontDescription -> FontSize -> IO () Source #

adjustFontDescSize :: (FontSize -> FontSize) -> FontDescription -> IO () Source #

modifyFontSizeForAllTerms :: (FontSize -> FontSize) -> TMState -> IO () Source #

fontSizeFromFontDescription :: FontDescription -> IO FontSize Source #

fontConfigFromFontDescription :: FontDescription -> IO (Maybe FontConfig) Source #

compareScrolledWinAndTab :: ScrolledWindow -> TMNotebookTab -> Bool Source #

updateFLTabPos :: TMState -> Int -> Int -> IO () Source #

askShouldExit :: TMState -> IO ResponseType Source #

Try to figure out whether Termonad should exit. This also used to figure out if Termonad should close a given terminal.

This reads the `confirmExit` setting from `ConfigOptions` to check whether the user wants to be notified when either Termonad or a given terminal is about to be closed.

If `confirmExit` is `True`, 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 `ResponseType`.

If `confirmExit` is `False`, then this function always returns `ResponseTypeYes`.

forceQuit :: TMState -> IO () Source #

Force Termonad to exit without asking the user whether or not to do so.

setupTermonad :: TMConfig -> Application -> ApplicationWindow -> Builder -> IO () Source #

appActivate :: TMConfig -> Application -> IO () Source #

showAboutDialog :: Application -> IO () Source #

showFindDialog :: Application -> IO (Maybe Text) Source #

doFind :: TMState -> IO () Source #

findAbove :: TMState -> IO () Source #

findBelow :: TMState -> IO () Source #

setShowMenuBar :: Application -> Bool -> IO () Source #

comboBoxFill :: Show a => ComboBoxText -> [(a, Text)] -> IO () Source #

Fill a combo box with ids and labels

The ids are stored in the combobox as `Text`, so their type should be an instance of the `Show` type class.

comboBoxSetActive :: Show a => ComboBoxText -> a -> IO () Source #

Set the current active item in a combobox given an input id.

comboBoxGetActive :: (Show a, Enum a) => ComboBoxText -> [a] -> IO (Maybe a) Source #

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.

applyNewPreferences :: TMState -> IO () Source #

applyNewPreferencesToTab :: TMState -> TMNotebookTab -> IO () Source #

showPreferencesDialog :: TMState -> IO () Source #

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.

appStartup :: Application -> IO () Source #

start :: TMConfig -> IO () Source #

Run Termonad with the given `TMConfig`.

Do not perform any of the recompilation operations that the `defaultMain` function does.

defaultMain :: TMConfig -> IO () Source #

Run Termonad with the given `TMConfig`.

This function will check if there is a `~/.config/termonad/termonad.hs` file and a `~/.cache/termonad/termonad-linux-x86_64` 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.

- `~/.config/termonad/termonad.hs` exists, `~/.cache/termonad/termonad-linux-x86_64` exists

  The timestamps of these two files are checked. If the `~/.config/termonad/termonad.hs` file has been modified after the `~/.cache/termonad/termonad-linux-x86_64` binary, then Termonad will use GHC to recompile the `~/.config/termonad/termonad.hs` file, producing a new binary at `~/.cache/termonad/termonad-linux-x86_64`. This new binary will be re-executed. The `TMConfig` passed to this `defaultMain` will be effectively thrown away.

  If GHC fails to recompile the `~/.config/termonad/termonad.hs` file, then Termonad will just execute `start` with the `TMConfig` passed in.

  If the `~/.cache/termonad/termonad-linux-x86_64` binary has been modified after the `~/.config/termonad/termonad.hs` file, then Termonad will re-exec the `~/.cache/termonad/termonad-linux-x86_64` binary. The `TMConfig` passed to this `defaultMain` will be effectively thrown away.

- `~/.config/termonad/termonad.hs` exists, `~/.cache/termonad/termonad-linux-x86_64` does not exist

  Termonad will use GHC to recompile the `~/.config/termonad/termonad.hs` file, producing a new binary at `~/.cache/termonad/termonad-linux-x86_64`. This new binary will be re-executed. The `TMConfig` passed to this `defaultMain` will be effectively thrown away.

  If GHC fails to recompile the `~/.config/termonad/termonad.hs` file, then Termonad will just execute `start` with the `TMConfig` passed in.

- `~/.config/termonad/termonad.hs` does not exist, `~/.cache/termonad/termonad-linux-x86_64` exists

  Termonad will ignore the `~/.cache/termonad/termonad-linux-x86_64` binary and just run `start` with the `TMConfig` passed to this function.

- `~/.config/termonad/termonad.hs` does not exist, `~/.cache/termonad/termonad-linux-x86_64` does not exist

  Termonad will run `start` with the `TMConfig` passed to this function.

Other notes:

1. That the locations of `~/.config/termonad/termonad.hs` and `~/.cache/termonad/termonad-linux-x86_64` may differ depending on your system.
2. In your own `~/.config/termonad/termonad.hs` file, you can use either `defaultMain` or `start`. As long as you always execute the system-wide `termonad` binary (instead of the binary produced as `~/.cache/termonad/termonad-linux-x86_64`), the effect should be the same.