X11-1.10.3: A binding to the X11 graphics library
Copyright(c) Alastair Reid 1999-2003
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Graphics.X11.Xlib

Description

A collection of FFI declarations for interfacing with Xlib.

The library aims to provide a direct translation of the X binding into Haskell so the most important documentation you should read is The Xlib Programming Manual, available online at http://tronche.com/gui/x/xlib/. Let me say that again because it is very important. Get hold of this documentation and read it: it tells you almost everything you need to know to use this library.

Synopsis

Conventions

In translating the library, we had to change names to conform with Haskell's lexical syntax: function names and names of constants must start with a lowercase letter; type names must start with an uppercase letter. The case of the remaining letters is unchanged.

In addition, we chose to take advantage of Haskell's module system to allow us to drop common prefixes (X, XA_, etc.) attached to X11 identifiers.

We named enumeration types so that function types would be easier to understand. For example, we added Status, WindowClass, etc. Note that the types are synonyms for Int so no extra typesafety was obtained.

We consistently raise exceptions when a function returns an error code. In practice, this only affects the following functions because most Xlib functions do not return error codes: allocColor, allocNamedColor, fetchBuffer, fetchBytes, fontFromGC, getGeometry, getIconName, iconifyWindow, loadQueryFont, lookupColor, openDisplay, parseColor, queryBestCursor, queryBestSize, queryBestStipple, queryBestTile, rotateBuffers, selectInput, storeBuffer, storeBytes, withdrawWindow.

Types

newtype Display Source #

pointer to an X11 Display structure

Constructors

Display (Ptr Display) 

Instances

Instances details
Data Display Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Display -> c Display #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Display #

toConstr :: Display -> Constr #

dataTypeOf :: Display -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Display) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Display) #

gmapT :: (forall b. Data b => b -> b) -> Display -> Display #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Display -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Display -> r #

gmapQ :: (forall d. Data d => d -> u) -> Display -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Display -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Display -> m Display #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Display -> m Display #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Display -> m Display #

Show Display Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq Display Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Display -> Display -> Bool #

(/=) :: Display -> Display -> Bool #

Ord Display Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

data Screen Source #

pointer to an X11 Screen structure

Instances

Instances details
Data Screen Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Screen -> c Screen #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Screen #

toConstr :: Screen -> Constr #

dataTypeOf :: Screen -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Screen) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Screen) #

gmapT :: (forall b. Data b => b -> b) -> Screen -> Screen #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Screen -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Screen -> r #

gmapQ :: (forall d. Data d => d -> u) -> Screen -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Screen -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Screen -> m Screen #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Screen -> m Screen #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Screen -> m Screen #

Show Screen Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq Screen Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Screen -> Screen -> Bool #

(/=) :: Screen -> Screen -> Bool #

Ord Screen Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

data Visual Source #

pointer to an X11 Visual structure

Instances

Instances details
Data Visual Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Visual -> c Visual #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Visual #

toConstr :: Visual -> Constr #

dataTypeOf :: Visual -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Visual) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Visual) #

gmapT :: (forall b. Data b => b -> b) -> Visual -> Visual #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Visual -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Visual -> r #

gmapQ :: (forall d. Data d => d -> u) -> Visual -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Visual -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Visual -> m Visual #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Visual -> m Visual #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Visual -> m Visual #

Show Visual Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq Visual Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Visual -> Visual -> Bool #

(/=) :: Visual -> Visual -> Bool #

Ord Visual Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

data GC Source #

pointer to an X11 GC structure

Instances

Instances details
Data GC Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GC -> c GC #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GC #

toConstr :: GC -> Constr #

dataTypeOf :: GC -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GC) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GC) #

gmapT :: (forall b. Data b => b -> b) -> GC -> GC #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GC -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GC -> r #

gmapQ :: (forall d. Data d => d -> u) -> GC -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GC -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GC -> m GC #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GC -> m GC #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GC -> m GC #

Show GC Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

showsPrec :: Int -> GC -> ShowS #

show :: GC -> String #

showList :: [GC] -> ShowS #

Eq GC Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: GC -> GC -> Bool #

(/=) :: GC -> GC -> Bool #

Ord GC Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

compare :: GC -> GC -> Ordering #

(<) :: GC -> GC -> Bool #

(<=) :: GC -> GC -> Bool #

(>) :: GC -> GC -> Bool #

(>=) :: GC -> GC -> Bool #

max :: GC -> GC -> GC #

min :: GC -> GC -> GC #

data SetWindowAttributes Source #

pointer to an X11 XSetWindowAttributes structure

Instances

Instances details
Data SetWindowAttributes Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SetWindowAttributes -> c SetWindowAttributes #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SetWindowAttributes #

toConstr :: SetWindowAttributes -> Constr #

dataTypeOf :: SetWindowAttributes -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SetWindowAttributes) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SetWindowAttributes) #

gmapT :: (forall b. Data b => b -> b) -> SetWindowAttributes -> SetWindowAttributes #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SetWindowAttributes -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SetWindowAttributes -> r #

gmapQ :: (forall d. Data d => d -> u) -> SetWindowAttributes -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SetWindowAttributes -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SetWindowAttributes -> m SetWindowAttributes #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SetWindowAttributes -> m SetWindowAttributes #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SetWindowAttributes -> m SetWindowAttributes #

Show SetWindowAttributes Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq SetWindowAttributes Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Ord SetWindowAttributes Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

data Point Source #

counterpart of an X11 XPoint structure

Constructors

Point 

Fields

Instances

Instances details
Data Point Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Point -> c Point #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Point #

toConstr :: Point -> Constr #

dataTypeOf :: Point -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Point) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Point) #

gmapT :: (forall b. Data b => b -> b) -> Point -> Point #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point -> r #

gmapQ :: (forall d. Data d => d -> u) -> Point -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Point -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point -> m Point #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point -> m Point #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point -> m Point #

Storable Point Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

sizeOf :: Point -> Int #

alignment :: Point -> Int #

peekElemOff :: Ptr Point -> Int -> IO Point #

pokeElemOff :: Ptr Point -> Int -> Point -> IO () #

peekByteOff :: Ptr b -> Int -> IO Point #

pokeByteOff :: Ptr b -> Int -> Point -> IO () #

peek :: Ptr Point -> IO Point #

poke :: Ptr Point -> Point -> IO () #

Show Point Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

showsPrec :: Int -> Point -> ShowS #

show :: Point -> String #

showList :: [Point] -> ShowS #

Eq Point Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Point -> Point -> Bool #

(/=) :: Point -> Point -> Bool #

data Rectangle Source #

counterpart of an X11 XRectangle structure

Instances

Instances details
Data Rectangle Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Rectangle -> c Rectangle #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Rectangle #

toConstr :: Rectangle -> Constr #

dataTypeOf :: Rectangle -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Rectangle) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rectangle) #

gmapT :: (forall b. Data b => b -> b) -> Rectangle -> Rectangle #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Rectangle -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Rectangle -> r #

gmapQ :: (forall d. Data d => d -> u) -> Rectangle -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Rectangle -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle #

Storable Rectangle Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Read Rectangle Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Show Rectangle Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq Rectangle Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

data Arc Source #

counterpart of an X11 XArc structure

Instances

Instances details
Storable Arc Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

sizeOf :: Arc -> Int #

alignment :: Arc -> Int #

peekElemOff :: Ptr Arc -> Int -> IO Arc #

pokeElemOff :: Ptr Arc -> Int -> Arc -> IO () #

peekByteOff :: Ptr b -> Int -> IO Arc #

pokeByteOff :: Ptr b -> Int -> Arc -> IO () #

peek :: Ptr Arc -> IO Arc #

poke :: Ptr Arc -> Arc -> IO () #

Show Arc Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

showsPrec :: Int -> Arc -> ShowS #

show :: Arc -> String #

showList :: [Arc] -> ShowS #

Eq Arc Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Arc -> Arc -> Bool #

(/=) :: Arc -> Arc -> Bool #

data Segment Source #

counterpart of an X11 XSegment structure

Constructors

Segment 

Instances

Instances details
Data Segment Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Segment -> c Segment #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Segment #

toConstr :: Segment -> Constr #

dataTypeOf :: Segment -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Segment) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Segment) #

gmapT :: (forall b. Data b => b -> b) -> Segment -> Segment #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Segment -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Segment -> r #

gmapQ :: (forall d. Data d => d -> u) -> Segment -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Segment -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Segment -> m Segment #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Segment -> m Segment #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Segment -> m Segment #

Storable Segment Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Show Segment Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Eq Segment Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Segment -> Segment -> Bool #

(/=) :: Segment -> Segment -> Bool #

data Color Source #

counterpart of an X11 XColor structure

Instances

Instances details
Data Color Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Color -> c Color #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Color #

toConstr :: Color -> Constr #

dataTypeOf :: Color -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Color) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Color) #

gmapT :: (forall b. Data b => b -> b) -> Color -> Color #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQ :: (forall d. Data d => d -> u) -> Color -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Color -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

Storable Color Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

sizeOf :: Color -> Int #

alignment :: Color -> Int #

peekElemOff :: Ptr Color -> Int -> IO Color #

pokeElemOff :: Ptr Color -> Int -> Color -> IO () #

peekByteOff :: Ptr b -> Int -> IO Color #

pokeByteOff :: Ptr b -> Int -> Color -> IO () #

peek :: Ptr Color -> IO Color #

poke :: Ptr Color -> Color -> IO () #

Show Color Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

Eq Color Source # 
Instance details

Defined in Graphics.X11.Xlib.Types

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

X11 library functions