module Graphics.X11.Xlib.Display(
allPlanes_aux,
blackPixel,
whitePixel,
connectionNumber,
defaultColormap,
defaultGC,
defaultDepth,
defaultScreen,
defaultScreenOfDisplay,
displayHeight,
displayHeightMM,
displayWidth,
displayWidthMM,
maxRequestSize,
displayMotionBufferSize,
resourceManagerString,
screenResourceString,
displayString,
imageByteOrder,
protocolRevision,
protocolVersion,
serverVendor,
screenCount,
defaultVisual,
displayCells,
displayPlanes,
screenOfDisplay,
defaultRootWindow,
rootWindow,
qLength,
noOp,
openDisplay,
closeDisplay,
) where
import Graphics.X11.Types
import Graphics.X11.Xlib.Types
import Foreign (throwIfNull, Ptr)
import Foreign.C
import System.IO.Unsafe
foreign import ccall unsafe "HsXlib.h XAllPlanes"
allPlanes_aux :: Pixel
foreign import ccall unsafe "HsXlib.h XBlackPixel"
blackPixel :: Display -> ScreenNumber -> Pixel
foreign import ccall unsafe "HsXlib.h XWhitePixel"
whitePixel :: Display -> ScreenNumber -> Pixel
foreign import ccall unsafe "HsXlib.h XConnectionNumber"
connectionNumber :: Display -> CInt
foreign import ccall unsafe "HsXlib.h XDefaultColormap"
defaultColormap :: Display -> ScreenNumber -> Colormap
foreign import ccall unsafe "HsXlib.h XDefaultGC"
defaultGC :: Display -> ScreenNumber -> GC
foreign import ccall unsafe "HsXlib.h XDefaultDepth"
defaultDepth :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XDefaultScreen"
defaultScreen :: Display -> ScreenNumber
foreign import ccall unsafe "HsXlib.h XDefaultScreenOfDisplay"
defaultScreenOfDisplay :: Display -> Screen
foreign import ccall unsafe "HsXlib.h XDisplayHeight"
displayHeight :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XDisplayHeightMM"
displayHeightMM :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XDisplayWidth"
displayWidth :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XDisplayWidthMM"
displayWidthMM :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XMaxRequestSize"
maxRequestSize :: Display -> CInt
foreign import ccall unsafe "HsXlib.h XDisplayMotionBufferSize"
displayMotionBufferSize :: Display -> CInt
resourceManagerString :: Display -> String
resourceManagerString display = xlibCString (xResourceManagerString display)
foreign import ccall unsafe "HsXlib.h XResourceManagerString"
xResourceManagerString :: Display -> IO CString
screenResourceString :: Screen -> String
screenResourceString screen = xlibCString (xScreenResourceString screen)
foreign import ccall unsafe "HsXlib.h XScreenResourceString"
xScreenResourceString :: Screen -> IO CString
displayString :: Display -> String
displayString display = xlibCString (xDisplayString display)
foreign import ccall unsafe "HsXlib.h XDisplayString"
xDisplayString :: Display -> IO CString
foreign import ccall unsafe "HsXlib.h XImageByteOrder"
imageByteOrder :: Display -> CInt
foreign import ccall unsafe "HsXlib.h XProtocolRevision"
protocolRevision :: Display -> CInt
foreign import ccall unsafe "HsXlib.h XProtocolVersion"
protocolVersion :: Display -> CInt
serverVendor :: Display -> String
serverVendor display = xlibCString (xServerVendor display)
foreign import ccall unsafe "HsXlib.h XServerVendor"
xServerVendor :: Display -> IO CString
foreign import ccall unsafe "HsXlib.h XScreenCount"
screenCount :: Display -> CInt
foreign import ccall unsafe "HsXlib.h XDefaultVisual"
defaultVisual :: Display -> ScreenNumber -> Visual
foreign import ccall unsafe "HsXlib.h XDisplayCells"
displayCells :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XDisplayPlanes"
displayPlanes :: Display -> ScreenNumber -> CInt
foreign import ccall unsafe "HsXlib.h XScreenOfDisplay"
screenOfDisplay :: Display -> ScreenNumber -> Screen
foreign import ccall unsafe "HsXlib.h XDefaultRootWindow"
defaultRootWindow :: Display -> Window
foreign import ccall unsafe "HsXlib.h XRootWindow"
rootWindow :: Display -> ScreenNumber -> IO Window
foreign import ccall unsafe "HsXlib.h XQLength"
qLength :: Display -> IO CInt
foreign import ccall unsafe "HsXlib.h XNoOp"
noOp :: Display -> IO ()
openDisplay :: String -> IO Display
openDisplay name =
withCString name $ \ c_name -> do
display <- throwIfNull "openDisplay" (xOpenDisplay c_name)
return (Display display)
foreign import ccall unsafe "HsXlib.h XOpenDisplay"
xOpenDisplay :: CString -> IO (Ptr Display)
foreign import ccall unsafe "HsXlib.h XCloseDisplay"
closeDisplay :: Display -> IO ()
xlibCString :: IO CString -> String
xlibCString act = unsafePerformIO $ do
cs <- act
peekCString cs