Portability | unportable |
---|---|
Stability | provisional |
Safe Haskell | None |
X11 backend for Sindre. For internationalised keyboard input to work, make sure the locale is correctly set.
- data SindreX11M a
- data SindreX11Conf
- sindreX11override :: String -> SindreX11M ExitCode -> IO ExitCode
- sindreX11dock :: String -> SindreX11M ExitCode -> IO ExitCode
- sindreX11 :: String -> SindreX11M ExitCode -> IO ExitCode
- xopt :: Param SindreX11M a => Maybe String -> String -> String -> ConstructorM SindreX11M a
- data VisualOpts = VisualOpts {
- foreground :: Color
- background :: Color
- focusForeground :: Color
- focusBackground :: Color
- font :: Font
- visualOpts :: WidgetRef -> ConstructorM SindreX11M VisualOpts
- allocColor :: MonadIO m => XftMgr -> String -> m Color
- drawing :: VisualOpts -> (Rectangle -> Drawer -> Drawer -> ObjectM a SindreX11M [Rectangle]) -> Rectangle -> ObjectM a SindreX11M SpaceUse
- drawing' :: VisualOpts -> (Rectangle -> Drawer -> Drawer -> ObjectM a SindreX11M ()) -> Rectangle -> ObjectM a SindreX11M SpaceUse
- type X11Field s = FieldDesc s SindreX11M
- data Drawer = Drawer {
- fg :: forall f. CoreDrawer f
- bg :: forall f. CoreDrawer f
- drawerFont :: Font
- drawerFgColor :: Color
- drawerBgColor :: Color
- setFgColor :: Drawer -> Color -> IO Drawer
- setBgColor :: Drawer -> Color -> IO Drawer
- textExtents :: Font -> String -> SindreX11M (Int, Int)
- drawText :: (Integral x, Integral y, Integral z) => Color -> Font -> x -> y -> z -> String -> SindreX11M ()
- mkDial :: Constructor SindreX11M
- mkLabel :: Constructor SindreX11M
- mkBlank :: Constructor SindreX11M
- mkTextField :: Constructor SindreX11M
- mkInStream :: Handle -> ObjectRef -> SindreX11M (NewObject SindreX11M)
- mkHList :: Constructor SindreX11M
- mkVList :: Constructor SindreX11M
Documentation
data SindreX11M a Source
Sindre backend using Xlib.
data SindreX11Conf Source
The read-only configuration of the X11 backend, created during backend initialisation.
:: String | The display string (usually the value of the
environment variable |
-> SindreX11M ExitCode | The function returned by
|
-> IO ExitCode |
Execute Sindre in the X11 backend, grabbing control of the entire display and staying on top.
:: String | The display string (usually the value of the
environment variable |
-> SindreX11M ExitCode | The function returned by
|
-> IO ExitCode |
Execute Sindre in the X11 backend as a dock/statusbar.
:: String | The display string (usually the value of the
environment variable |
-> SindreX11M ExitCode | The function returned by
|
-> IO ExitCode |
Execute Sindre in the X11 backend as an ordinary client visible to the window manager.
:: Param SindreX11M a | |
=> Maybe String | Name of widget, using |
-> String | Widget class |
-> String | Property name |
-> ConstructorM SindreX11M a |
Performs a lookup in the X resources database for a given
property. The class used is Sindre.class.property
and the
name is progname.name.property
, where progname is the
value of getProgName
.
data VisualOpts Source
Options regarding visual appearance of widgets (colors and fonts).
VisualOpts | |
|
visualOpts :: WidgetRef -> ConstructorM SindreX11M VisualOptsSource
Read visual options from either widget parameters or the X
resources database using xopt
, or a combination. The following
graphical components are read:
Foreground color
- From
fg
parameter orforeground
X property. Background color
- From
bg
parameter orbackground
X property. Focus foreground color
- From
ffg
parameter orfocusForeground
X property. Focus background color
- From
fbg
parameter orfocusBackground
X property.
:: VisualOpts | |
-> (Rectangle -> Drawer -> Drawer -> ObjectM a SindreX11M [Rectangle]) | The body of the |
-> Rectangle | |
-> ObjectM a SindreX11M SpaceUse |
Helper function that makes it easier it write consistent widgets
in the X11 backend. The widget is automatically filled with its
(nonfocus) background color. You are supposed to use this in the
drawI
method of a Widget
instance definition. An example:
drawI = drawing myWidgetWin myWidgetVisual $ r fg bg ffg fbg -> do fg drawString 0 5 "foreground" bg drawString 0 15 "background" ffg drawString 0 25 "focus foreground" fbg drawString 0 35 "focus background"
drawing' :: VisualOpts -> (Rectangle -> Drawer -> Drawer -> ObjectM a SindreX11M ()) -> Rectangle -> ObjectM a SindreX11M SpaceUseSource
Variant of drawing
that assumes the entire rectangle is used.
type X11Field s = FieldDesc s SindreX11MSource
Drawer | |
|
textExtents :: Font -> String -> SindreX11M (Int, Int)Source
drawText :: (Integral x, Integral y, Integral z) => Color -> Font -> x -> y -> z -> String -> SindreX11M ()Source
mkLabel :: Constructor SindreX11MSource
Label displaying the text contained in the field label
, which
is also accepted as a widget parameter (defaults to the empty
string).
mkBlank :: Constructor SindreX11MSource
A blank widget, showing only background color, that can use as much or as little room as necessary. Useful for constraining the layout of other widgets.
mkTextField :: Constructor SindreX11MSource
Single-line text field, whose single field value
(also a
parameter, defaults to the empty string) is the contents of the
editing buffer.
mkInStream :: Handle -> ObjectRef -> SindreX11M (NewObject SindreX11M)Source
An input stream object wrapping the given Handle
. Input is
purely event-driven and line-oriented: the event lines
is sent
(roughly) for each sequence of lines that can be read without
blocking, with the payload being a single string value containing
the lines read since the last time the event was sent. When end of
file is reached, the eof
event (no payload) is sent.
mkHList :: Constructor SindreX11MSource
Horizontal dmenu-style list containing a list of elements, one of
which is the "selected" element. If the parameter i
is given a
true value, element matching will be case-insensitive. The
following methods are supported:
insert(string)
- Split
string
into lines and add each line as an element. clear()
- Delete all elements.
filter(string)
- Only display those elements that contain
string
. next()
- Move selection right.
prev()
- Move selection left.
first()
- Move to leftmost element.
last()
- Move to rightmost element.
The field selected
is the selected element.
mkVList :: Constructor SindreX11MSource
As mkHList
, except the list is vertical. The parameter lines
(default value 10) is the number of lines shown.