| Copyright | (c) Alastair Reid 1999-2003 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell98 |
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
- module Graphics.X11.Types
- newtype Display = Display (Ptr Display)
- data Screen
- data Visual
- data GC
- data SetWindowAttributes
- data VisualInfo = VisualInfo {}
- data Point = Point {}
- data Rectangle = Rectangle {
- rect_x :: !Position
- rect_y :: !Position
- rect_width :: !Dimension
- rect_height :: !Dimension
- data Arc = Arc {
- arc_x :: Position
- arc_y :: Position
- arc_width :: Dimension
- arc_height :: Dimension
- arc_angle1 :: Angle
- arc_angle2 :: Angle
- data Segment = Segment {}
- data Color = Color {
- color_pixel :: Pixel
- color_red :: Word16
- color_green :: Word16
- color_blue :: Word16
- color_flags :: Word8
- type Pixel = Word64
- type Position = Int32
- type Dimension = Word32
- type Angle = CInt
- type ScreenNumber = Word32
- type Buffer = CInt
- module Graphics.X11.Xlib.Event
- module Graphics.X11.Xlib.Display
- module Graphics.X11.Xlib.Screen
- module Graphics.X11.Xlib.Window
- module Graphics.X11.Xlib.Context
- module Graphics.X11.Xlib.Color
- module Graphics.X11.Xlib.Cursor
- module Graphics.X11.Xlib.Font
- module Graphics.X11.Xlib.Atom
- module Graphics.X11.Xlib.Region
- module Graphics.X11.Xlib.Image
- module Graphics.X11.Xlib.Misc
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
module Graphics.X11.Types
pointer to an X11 Display structure
Instances
| Data Display Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Display Source # toConstr :: Display -> Constr Source # dataTypeOf :: Display -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Display) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Display) Source # gmapT :: (forall b. Data b => b -> b) -> Display -> Display Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Display -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Display -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Display -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Display -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Display -> m Display Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Display -> m Display Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Display -> m Display Source # | |
| Show Display Source # | |
| Eq Display Source # | |
| Ord Display Source # | |
Defined in Graphics.X11.Xlib.Types | |
pointer to an X11 Screen structure
Instances
| Data Screen Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Screen Source # toConstr :: Screen -> Constr Source # dataTypeOf :: Screen -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Screen) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Screen) Source # gmapT :: (forall b. Data b => b -> b) -> Screen -> Screen Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Screen -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Screen -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Screen -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Screen -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Screen -> m Screen Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Screen -> m Screen Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Screen -> m Screen Source # | |
| Show Screen Source # | |
| Eq Screen Source # | |
| Ord Screen Source # | |
pointer to an X11 Visual structure
Instances
| Data Visual Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Visual Source # toConstr :: Visual -> Constr Source # dataTypeOf :: Visual -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Visual) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Visual) Source # gmapT :: (forall b. Data b => b -> b) -> Visual -> Visual Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Visual -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Visual -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Visual -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Visual -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Visual -> m Visual Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Visual -> m Visual Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Visual -> m Visual Source # | |
| Show Visual Source # | |
| Eq Visual Source # | |
| Ord Visual Source # | |
pointer to an X11 GC structure
Instances
| Data GC Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GC Source # toConstr :: GC -> Constr Source # dataTypeOf :: GC -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GC) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GC) Source # gmapT :: (forall b. Data b => b -> b) -> GC -> GC Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GC -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GC -> r Source # gmapQ :: (forall d. Data d => d -> u) -> GC -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> GC -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GC -> m GC Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GC -> m GC Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GC -> m GC Source # | |
| Show GC Source # | |
| Eq GC Source # | |
| Ord GC Source # | |
data SetWindowAttributes Source #
pointer to an X11 XSetWindowAttributes structure
Instances
data VisualInfo Source #
counterpart of an X11 XVisualInfo structure
Constructors
| VisualInfo | |
Fields | |
Instances
| Storable VisualInfo Source # | |
Defined in Graphics.X11.Xlib.Types Methods sizeOf :: VisualInfo -> Int Source # alignment :: VisualInfo -> Int Source # peekElemOff :: Ptr VisualInfo -> Int -> IO VisualInfo Source # pokeElemOff :: Ptr VisualInfo -> Int -> VisualInfo -> IO () Source # peekByteOff :: Ptr b -> Int -> IO VisualInfo Source # pokeByteOff :: Ptr b -> Int -> VisualInfo -> IO () Source # peek :: Ptr VisualInfo -> IO VisualInfo Source # poke :: Ptr VisualInfo -> VisualInfo -> IO () Source # | |
| Show VisualInfo Source # | |
Defined in Graphics.X11.Xlib.Types | |
| Default VisualInfo Source # | |
Defined in Graphics.X11.Xlib.Types Methods def :: VisualInfo Source # | |
| Eq VisualInfo Source # | |
Defined in Graphics.X11.Xlib.Types Methods (==) :: VisualInfo -> VisualInfo -> Bool Source # (/=) :: VisualInfo -> VisualInfo -> Bool Source # | |
counterpart of an X11 XPoint structure
Instances
| Data Point Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Point Source # toConstr :: Point -> Constr Source # dataTypeOf :: Point -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Point) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Point) Source # gmapT :: (forall b. Data b => b -> b) -> Point -> Point Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Point -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Point -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point -> m Point Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point -> m Point Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point -> m Point Source # | |
| Storable Point Source # | |
Defined in Graphics.X11.Xlib.Types Methods sizeOf :: Point -> Int Source # alignment :: Point -> Int Source # peekElemOff :: Ptr Point -> Int -> IO Point Source # pokeElemOff :: Ptr Point -> Int -> Point -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Point Source # pokeByteOff :: Ptr b -> Int -> Point -> IO () Source # | |
| Show Point Source # | |
| Eq Point Source # | |
counterpart of an X11 XRectangle structure
Constructors
| Rectangle | |
Fields
| |
Instances
counterpart of an X11 XArc structure
Constructors
| Arc | |
Fields
| |
Instances
| Storable Arc Source # | |
Defined in Graphics.X11.Xlib.Types | |
| Show Arc Source # | |
| Eq Arc Source # | |
counterpart of an X11 XSegment structure
Constructors
| Segment | |
Instances
| Data Segment Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Segment Source # toConstr :: Segment -> Constr Source # dataTypeOf :: Segment -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Segment) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Segment) Source # gmapT :: (forall b. Data b => b -> b) -> Segment -> Segment Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Segment -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Segment -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Segment -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Segment -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Segment -> m Segment Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Segment -> m Segment Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Segment -> m Segment Source # | |
| Storable Segment Source # | |
Defined in Graphics.X11.Xlib.Types Methods sizeOf :: Segment -> Int Source # alignment :: Segment -> Int Source # peekElemOff :: Ptr Segment -> Int -> IO Segment Source # pokeElemOff :: Ptr Segment -> Int -> Segment -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Segment Source # pokeByteOff :: Ptr b -> Int -> Segment -> IO () Source # | |
| Show Segment Source # | |
| Eq Segment Source # | |
counterpart of an X11 XColor structure
Constructors
| Color | |
Fields
| |
Instances
| Data Color Source # | |
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 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Color Source # toConstr :: Color -> Constr Source # dataTypeOf :: Color -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Color) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Color) Source # gmapT :: (forall b. Data b => b -> b) -> Color -> Color Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Color -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Color -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Color -> m Color Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color Source # | |
| Storable Color Source # | |
Defined in Graphics.X11.Xlib.Types Methods sizeOf :: Color -> Int Source # alignment :: Color -> Int Source # peekElemOff :: Ptr Color -> Int -> IO Color Source # pokeElemOff :: Ptr Color -> Int -> Color -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Color Source # pokeByteOff :: Ptr b -> Int -> Color -> IO () Source # | |
| Show Color Source # | |
| Eq Color Source # | |
type ScreenNumber = Word32 Source #
X11 library functions
module Graphics.X11.Xlib.Event
module Graphics.X11.Xlib.Display
module Graphics.X11.Xlib.Screen
module Graphics.X11.Xlib.Window
module Graphics.X11.Xlib.Context
module Graphics.X11.Xlib.Color
module Graphics.X11.Xlib.Cursor
module Graphics.X11.Xlib.Font
module Graphics.X11.Xlib.Atom
module Graphics.X11.Xlib.Region
module Graphics.X11.Xlib.Image
module Graphics.X11.Xlib.Misc