Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module defines types and operations used to store messages for display in the client's buffers.
- data Window = Window {
- _winMessages :: !WindowLines
- _winMarker :: !(Maybe Int)
- _winUnread :: !Int
- _winTotal :: !Int
- _winMention :: !WindowLineImportance
- winMessages :: Lens' Window WindowLines
- winUnread :: Lens' Window Int
- winTotal :: Lens' Window Int
- winMention :: Lens' Window WindowLineImportance
- winMarker :: Lens' Window (Maybe Int)
- data WindowLine = WindowLine {
- _wlSummary :: !IrcSummary
- _wlText :: !Text
- _wlImage' :: !Image'
- _wlFullImage' :: !Image'
- _wlImportance :: !WindowLineImportance
- _wlTimestamp :: !UTCTime
- wlSummary :: Lens' WindowLine IrcSummary
- wlText :: Lens' WindowLine Text
- wlImage :: Lens' WindowLine Image
- wlFullImage :: Lens' WindowLine Image
- wlImportance :: Lens' WindowLine WindowLineImportance
- wlTimestamp :: Lens' WindowLine UTCTime
- data WindowLineImportance
- emptyWindow :: Window
- addToWindow :: WindowLine -> Window -> Window
- windowSeen :: Window -> Window
- windowActivate :: Window -> Window
- windowDeactivate :: Window -> Window
Windows
A Window
tracks all of the messages and metadata for a particular
message buffer.
Window | |
|
winMessages :: Lens' Window WindowLines Source #
Window lines
data WindowLine Source #
A single message to be displayed in a window
WindowLine | |
|
wlFullImage :: Lens' WindowLine Image Source #
Lens for the _wlFullImage
field viewed in unpacked form.
Window line importance
data WindowLineImportance Source #
Flag for the important of a message being added to a window
WLBoring | Don't update unread count |
WLNormal | Increment unread count |
WLImportant | Increment unread count and set important flag |
Window operations
emptyWindow :: Window Source #
A window with no messages
addToWindow :: WindowLine -> Window -> Window Source #
Adds a given line to a window as the newest message. Window's unread count will be updated according to the given importance.
windowSeen :: Window -> Window Source #
Update the window clearing the unread count and important flag.
windowActivate :: Window -> Window Source #
Update the window when it first becomes active. If only boring messages have been added since last time the marker will be hidden.
windowDeactivate :: Window -> Window Source #
Update the window when it becomes inactive. This resets the activity marker to the bottom of the window.