module X11Types where import Data.Ix(Ix) import Data.Word(Word8,Word16,Word32) import Data.Int(Int16) type Point = (Int16,Int16) data Rect = R {left,top:: !Int16, width,height:: !Word16} deriving (Eq,Ord,Show) data Line = L {x1,x2,y1,y2:: !Int16} deriving (Eq,Ord,Show) rect (x,y) (w,h) = R x y w h newtype Pixel = Pixel Word32 deriving (Eq,Ord,Show) newtype Window = Window XID deriving (Eq,Ord,Show) newtype GC = GC XID deriving (Eq,Ord,Show) newtype Font = Font XID deriving (Eq,Ord,Show) newtype Atom = Atom XID deriving (Eq,Ord,Show) newtype Colormap = Colormap XID deriving (Eq,Ord,Show) newtype Cursor = Cursor XID deriving (Eq,Ord,Show) newtype Pixmap = Pixmap XID deriving (Eq,Ord,Show) newtype Keysym = KS XID deriving (Eq,Ord,Show) newtype DbeBackBufferId = DbeBackBufferId XID deriving (Eq,Ord,Show) type XID = Word32 -- top three bits guaranteed to be zero newtype Keycode = KC Word8 deriving (Eq,Ord,Ix,Show) data RGB = RGB Word16 Word16 Word16 deriving Show data Color = Color Pixel RGB RGB deriving Show -- Predefined Atoms atom_PRIMARY = Atom 1 atom_ATOM = Atom 4 atom_STRING = Atom 31 atom_WM_NAME = Atom 39 -- Special Keysyms noSymbol = KS 0 voidSymbol = KS 0x00ffffff