HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleX11-1.10.3Haskell98

Graphics.X11.Xlib

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.

  • 17 types
  • PackageX11-1.10.3
  • Exports17
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceXlib.hs

Conventions

0 declarations

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

17 declarations
newtypenewtype Display
#

pointer to an X11 Display structure

Constructors

Instances4Eq, Data, Ord, Show
  • Eq DisplayDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Data DisplayDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Ord DisplayDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Show DisplayDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
newtypenewtype Screen
#

pointer to an X11 Screen structure

Instances4Eq, Data, Ord, Show
  • Eq ScreenDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Data ScreenDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Ord ScreenDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Show ScreenDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
newtypenewtype Visual
#

pointer to an X11 Visual structure

Instances4Eq, Data, Ord, Show
  • Eq VisualDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Data VisualDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Ord VisualDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Show VisualDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
newtypenewtype GC
#

pointer to an X11 GC structure

Instances4Eq, Data, Ord, Show
  • Eq GCDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Data GCDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Ord GCDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Show GCDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
datadata VisualInfo
#
Instances4Eq, Show, Storable, Default
datadata Point
#

counterpart of an X11 XPoint structure

Constructors

Instances4Eq, Data, Show, Storable
  • Eq PointDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Data PointDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Show PointDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
  • Storable PointDefined in X11-1.10.3 · Graphics.X11.Xlib.Types
datadata Rectangle
#

counterpart of an X11 XRectangle structure

Instances5Eq, Data, Read, Show, Storable

X11 library functions

0 declarations