-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Binding to libSDL -- -- Simple DirectMedia Layer (libSDL) is a cross-platform multimedia -- library designed to provide low level access to audio, keyboard, -- mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. It -- is used by MPEG playback software, emulators, and many popular games, -- including the award winning Linux port of "Civilization: Call To -- Power." @package SDL @version 0.6.2 -- | Various small functions which makes the binding process easier. module Graphics.UI.SDL.Utilities class Enum a b | a -> b succ :: Enum a b => a -> a pred :: Enum a b => a -> a toEnum :: Enum a b => b -> a fromEnum :: Enum a b => a -> b enumFromTo :: Enum a b => a -> a -> [a] intToBool :: Int -> IO Int -> IO Bool toBitmask :: (Enum a b, Bits b) => [a] -> b fromBitmask :: (Bounded a, Enum a b, Bits b) => b -> [a] fromCInt :: Num a => CInt -> a toCInt :: Int -> CInt module Graphics.UI.SDL.CPUInfo -- | This function returns True if the CPU has the RDTSC -- instruction. hasRDTSC :: Bool -- | This function returns True if the CPU has MMX features. hasMMX :: Bool -- | This function returns True if the CPU has MMX Ext. features. hasMMXExt :: Bool -- | This function returns True if the CPU has 3DNow features. has3DNow :: Bool -- | This function returns True if the CPU has 3DNow! Ext. -- features. has3DNowExt :: Bool -- | This function returns True if the CPU has SSE features. hasSSE :: Bool -- | This function returns True if the CPU has SSE2 features. hasSSE2 :: Bool -- | This function returns True if the CPU has AltiVec features. hasAltiVec :: Bool module Graphics.UI.SDL.Version compiledFor :: Version linkedWith :: IO Version instance Storable SDLVersion module Graphics.UI.SDL.Keysym data Keysym Keysym :: SDLKey -> [Modifier] -> Char -> Keysym symKey :: Keysym -> SDLKey symModifiers :: Keysym -> [Modifier] symUnicode :: Keysym -> Char data Modifier KeyModNone :: Modifier KeyModLeftShift :: Modifier KeyModRightShift :: Modifier KeyModLeftCtrl :: Modifier KeyModRightCtrl :: Modifier KeyModLeftAlt :: Modifier KeyModRightAlt :: Modifier KeyModLeftMeta :: Modifier KeyModRightMeta :: Modifier KeyModNum :: Modifier KeyModCaps :: Modifier KeyModMode :: Modifier KeyModCtrl :: Modifier KeyModShift :: Modifier KeyModAlt :: Modifier KeyModMeta :: Modifier data SDLKey SDLK_UNKNOWN :: SDLKey SDLK_FIRST :: SDLKey SDLK_BACKSPACE :: SDLKey SDLK_TAB :: SDLKey SDLK_CLEAR :: SDLKey SDLK_RETURN :: SDLKey SDLK_PAUSE :: SDLKey SDLK_ESCAPE :: SDLKey SDLK_SPACE :: SDLKey SDLK_EXCLAIM :: SDLKey SDLK_QUOTEDBL :: SDLKey SDLK_HASH :: SDLKey SDLK_DOLLAR :: SDLKey SDLK_AMPERSAND :: SDLKey SDLK_QUOTE :: SDLKey SDLK_LEFTPAREN :: SDLKey SDLK_RIGHTPAREN :: SDLKey SDLK_ASTERISK :: SDLKey SDLK_PLUS :: SDLKey SDLK_COMMA :: SDLKey SDLK_MINUS :: SDLKey SDLK_PERIOD :: SDLKey SDLK_SLASH :: SDLKey SDLK_0 :: SDLKey SDLK_1 :: SDLKey SDLK_2 :: SDLKey SDLK_3 :: SDLKey SDLK_4 :: SDLKey SDLK_5 :: SDLKey SDLK_6 :: SDLKey SDLK_7 :: SDLKey SDLK_8 :: SDLKey SDLK_9 :: SDLKey SDLK_COLON :: SDLKey SDLK_SEMICOLON :: SDLKey SDLK_LESS :: SDLKey SDLK_EQUALS :: SDLKey SDLK_GREATER :: SDLKey SDLK_QUESTION :: SDLKey SDLK_AT :: SDLKey SDLK_LEFTBRACKET :: SDLKey SDLK_BACKSLASH :: SDLKey SDLK_RIGHTBRACKET :: SDLKey SDLK_CARET :: SDLKey SDLK_UNDERSCORE :: SDLKey SDLK_BACKQUOTE :: SDLKey SDLK_a :: SDLKey SDLK_b :: SDLKey SDLK_c :: SDLKey SDLK_d :: SDLKey SDLK_e :: SDLKey SDLK_f :: SDLKey SDLK_g :: SDLKey SDLK_h :: SDLKey SDLK_i :: SDLKey SDLK_j :: SDLKey SDLK_k :: SDLKey SDLK_l :: SDLKey SDLK_m :: SDLKey SDLK_n :: SDLKey SDLK_o :: SDLKey SDLK_p :: SDLKey SDLK_q :: SDLKey SDLK_r :: SDLKey SDLK_s :: SDLKey SDLK_t :: SDLKey SDLK_u :: SDLKey SDLK_v :: SDLKey SDLK_w :: SDLKey SDLK_x :: SDLKey SDLK_y :: SDLKey SDLK_z :: SDLKey SDLK_DELETE :: SDLKey SDLK_WORLD_0 :: SDLKey SDLK_WORLD_1 :: SDLKey SDLK_WORLD_2 :: SDLKey SDLK_WORLD_3 :: SDLKey SDLK_WORLD_4 :: SDLKey SDLK_WORLD_5 :: SDLKey SDLK_WORLD_6 :: SDLKey SDLK_WORLD_7 :: SDLKey SDLK_WORLD_8 :: SDLKey SDLK_WORLD_9 :: SDLKey SDLK_WORLD_10 :: SDLKey SDLK_WORLD_11 :: SDLKey SDLK_WORLD_12 :: SDLKey SDLK_WORLD_13 :: SDLKey SDLK_WORLD_14 :: SDLKey SDLK_WORLD_15 :: SDLKey SDLK_WORLD_16 :: SDLKey SDLK_WORLD_17 :: SDLKey SDLK_WORLD_18 :: SDLKey SDLK_WORLD_19 :: SDLKey SDLK_WORLD_20 :: SDLKey SDLK_WORLD_21 :: SDLKey SDLK_WORLD_22 :: SDLKey SDLK_WORLD_23 :: SDLKey SDLK_WORLD_24 :: SDLKey SDLK_WORLD_25 :: SDLKey SDLK_WORLD_26 :: SDLKey SDLK_WORLD_27 :: SDLKey SDLK_WORLD_28 :: SDLKey SDLK_WORLD_29 :: SDLKey SDLK_WORLD_30 :: SDLKey SDLK_WORLD_31 :: SDLKey SDLK_WORLD_32 :: SDLKey SDLK_WORLD_33 :: SDLKey SDLK_WORLD_34 :: SDLKey SDLK_WORLD_35 :: SDLKey SDLK_WORLD_36 :: SDLKey SDLK_WORLD_37 :: SDLKey SDLK_WORLD_38 :: SDLKey SDLK_WORLD_39 :: SDLKey SDLK_WORLD_40 :: SDLKey SDLK_WORLD_41 :: SDLKey SDLK_WORLD_42 :: SDLKey SDLK_WORLD_43 :: SDLKey SDLK_WORLD_44 :: SDLKey SDLK_WORLD_45 :: SDLKey SDLK_WORLD_46 :: SDLKey SDLK_WORLD_47 :: SDLKey SDLK_WORLD_48 :: SDLKey SDLK_WORLD_49 :: SDLKey SDLK_WORLD_50 :: SDLKey SDLK_WORLD_51 :: SDLKey SDLK_WORLD_52 :: SDLKey SDLK_WORLD_53 :: SDLKey SDLK_WORLD_54 :: SDLKey SDLK_WORLD_55 :: SDLKey SDLK_WORLD_56 :: SDLKey SDLK_WORLD_57 :: SDLKey SDLK_WORLD_58 :: SDLKey SDLK_WORLD_59 :: SDLKey SDLK_WORLD_60 :: SDLKey SDLK_WORLD_61 :: SDLKey SDLK_WORLD_62 :: SDLKey SDLK_WORLD_63 :: SDLKey SDLK_WORLD_64 :: SDLKey SDLK_WORLD_65 :: SDLKey SDLK_WORLD_66 :: SDLKey SDLK_WORLD_67 :: SDLKey SDLK_WORLD_68 :: SDLKey SDLK_WORLD_69 :: SDLKey SDLK_WORLD_70 :: SDLKey SDLK_WORLD_71 :: SDLKey SDLK_WORLD_72 :: SDLKey SDLK_WORLD_73 :: SDLKey SDLK_WORLD_74 :: SDLKey SDLK_WORLD_75 :: SDLKey SDLK_WORLD_76 :: SDLKey SDLK_WORLD_77 :: SDLKey SDLK_WORLD_78 :: SDLKey SDLK_WORLD_79 :: SDLKey SDLK_WORLD_80 :: SDLKey SDLK_WORLD_81 :: SDLKey SDLK_WORLD_82 :: SDLKey SDLK_WORLD_83 :: SDLKey SDLK_WORLD_84 :: SDLKey SDLK_WORLD_85 :: SDLKey SDLK_WORLD_86 :: SDLKey SDLK_WORLD_87 :: SDLKey SDLK_WORLD_88 :: SDLKey SDLK_WORLD_89 :: SDLKey SDLK_WORLD_90 :: SDLKey SDLK_WORLD_91 :: SDLKey SDLK_WORLD_92 :: SDLKey SDLK_WORLD_93 :: SDLKey SDLK_WORLD_94 :: SDLKey SDLK_WORLD_95 :: SDLKey SDLK_KP0 :: SDLKey SDLK_KP1 :: SDLKey SDLK_KP2 :: SDLKey SDLK_KP3 :: SDLKey SDLK_KP4 :: SDLKey SDLK_KP5 :: SDLKey SDLK_KP6 :: SDLKey SDLK_KP7 :: SDLKey SDLK_KP8 :: SDLKey SDLK_KP9 :: SDLKey SDLK_KP_PERIOD :: SDLKey SDLK_KP_DIVIDE :: SDLKey SDLK_KP_MULTIPLY :: SDLKey SDLK_KP_MINUS :: SDLKey SDLK_KP_PLUS :: SDLKey SDLK_KP_ENTER :: SDLKey SDLK_KP_EQUALS :: SDLKey SDLK_UP :: SDLKey SDLK_DOWN :: SDLKey SDLK_RIGHT :: SDLKey SDLK_LEFT :: SDLKey SDLK_INSERT :: SDLKey SDLK_HOME :: SDLKey SDLK_END :: SDLKey SDLK_PAGEUP :: SDLKey SDLK_PAGEDOWN :: SDLKey SDLK_F1 :: SDLKey SDLK_F2 :: SDLKey SDLK_F3 :: SDLKey SDLK_F4 :: SDLKey SDLK_F5 :: SDLKey SDLK_F6 :: SDLKey SDLK_F7 :: SDLKey SDLK_F8 :: SDLKey SDLK_F9 :: SDLKey SDLK_F10 :: SDLKey SDLK_F11 :: SDLKey SDLK_F12 :: SDLKey SDLK_F13 :: SDLKey SDLK_F14 :: SDLKey SDLK_F15 :: SDLKey SDLK_NUMLOCK :: SDLKey SDLK_CAPSLOCK :: SDLKey SDLK_SCROLLOCK :: SDLKey SDLK_RSHIFT :: SDLKey SDLK_LSHIFT :: SDLKey SDLK_RCTRL :: SDLKey SDLK_LCTRL :: SDLKey SDLK_RALT :: SDLKey SDLK_LALT :: SDLKey SDLK_RMETA :: SDLKey SDLK_LMETA :: SDLKey SDLK_LSUPER :: SDLKey SDLK_RSUPER :: SDLKey SDLK_MODE :: SDLKey SDLK_COMPOSE :: SDLKey SDLK_HELP :: SDLKey SDLK_PRINT :: SDLKey SDLK_SYSREQ :: SDLKey SDLK_BREAK :: SDLKey SDLK_MENU :: SDLKey SDLK_POWER :: SDLKey SDLK_EURO :: SDLKey SDLK_UNDO :: SDLKey SDLK_LAST :: SDLKey instance Eq SDLKey instance Ord SDLKey instance Show SDLKey instance Eq Modifier instance Ord Modifier instance Show Modifier instance Show Keysym instance Eq Keysym instance Enum SDLKey Word32 instance Bounded SDLKey instance Enum Modifier Word32 instance Bounded Modifier instance Storable Keysym module Graphics.UI.SDL.Color data Color Color :: Word8 -> Word8 -> Word8 -> Color colorRed :: Color -> Word8 colorGreen :: Color -> Word8 colorBlue :: Color -> Word8 newtype Pixel Pixel :: Word32 -> Pixel instance Show Pixel instance Eq Pixel instance Ord Pixel instance Storable Pixel instance Storable Color module Graphics.UI.SDL.Audio data AudioFormat AudioU8 :: AudioFormat AudioS8 :: AudioFormat AudioU16LSB :: AudioFormat AudioS16LSB :: AudioFormat AudioU16MSB :: AudioFormat AudioS16MSB :: AudioFormat AudioU16Sys :: AudioFormat AudioS16Sys :: AudioFormat fromAudioFormat :: AudioFormat -> Word16 toAudioFormat :: Word16 -> AudioFormat instance Show AudioFormat instance Eq AudioFormat instance Ord AudioFormat instance Enum AudioFormat module Graphics.UI.SDL.Types data SurfaceStruct type Surface = ForeignPtr SurfaceStruct data VideoInfoStruct type VideoInfo = ForeignPtr VideoInfoStruct data RWopsStruct type RWops = ForeignPtr RWopsStruct data PixelFormatStruct type PixelFormat = ForeignPtr PixelFormatStruct data JoystickStruct type Joystick = ForeignPtr JoystickStruct data Hat HatCentered :: Hat HatUp :: Hat HatRight :: Hat HatDown :: Hat HatLeft :: Hat HatRightUp :: Hat HatRightDown :: Hat HatLeftUp :: Hat HatLeftDown :: Hat data TimerIDStruct data SurfaceFlag SWSurface :: SurfaceFlag HWSurface :: SurfaceFlag OpenGL :: SurfaceFlag ASyncBlit :: SurfaceFlag OpenGLBlit :: SurfaceFlag Resizable :: SurfaceFlag NoFrame :: SurfaceFlag HWAccel :: SurfaceFlag SrcColorKey :: SurfaceFlag RLEAccel :: SurfaceFlag SrcAlpha :: SurfaceFlag PreAlloc :: SurfaceFlag AnyFormat :: SurfaceFlag HWPalette :: SurfaceFlag DoubleBuf :: SurfaceFlag Fullscreen :: SurfaceFlag surfaceGetPixelFormat :: Surface -> PixelFormat surfaceGetWidth :: Surface -> Int surfaceGetHeight :: Surface -> Int surfaceGetFlags :: Surface -> IO [SurfaceFlag] surfaceGetPitch :: Surface -> Word16 surfaceGetPixels :: Surface -> IO Pixels pixelFormatGetAlpha :: PixelFormat -> IO Word8 pixelFormatGetColorKey :: PixelFormat -> IO Pixel pixelFormatGetBitsPerPixel :: PixelFormat -> IO Word8 pixelFormatGetBytesPerPixel :: PixelFormat -> IO Word8 videoInfoWidth :: VideoInfo -> Int videoInfoHeight :: VideoInfo -> Int instance Eq SurfaceFlag instance Ord SurfaceFlag instance Show SurfaceFlag instance Read SurfaceFlag instance Show Hat instance Eq Hat instance Ord Hat instance Enum SurfaceFlag Word32 instance Bounded SurfaceFlag instance Enum Hat Word8 instance Bounded Hat module Graphics.UI.SDL.Time getTicks :: IO Word32 delay :: Word32 -> IO () module Graphics.UI.SDL.Rect data Rect Rect :: Int -> Int -> Int -> Int -> Rect rectX :: Rect -> Int rectY :: Rect -> Int rectW :: Rect -> Int rectH :: Rect -> Int instance Show Rect instance Eq Rect instance Ord Rect instance Storable Rect module Graphics.UI.SDL.General -- | Initializes SDL. This should be called before all other SDL functions. init :: [InitFlag] -> IO () withInit :: [InitFlag] -> IO a -> IO a -- | After SDL has been initialized with SDL_Init you may initialize -- uninitialized subsystems with SDL_InitSubSystem. initSubSystem :: [InitFlag] -> IO () quitSubSystem :: [InitFlag] -> IO () quit :: IO () -- | wasInit allows you to see which SDL subsytems have been initialized wasInit :: [InitFlag] -> IO [InitFlag] -- | Returns a string containing the last error. Nothing if no error. getError :: IO (Maybe String) failWithError :: String -> IO a unwrapBool :: String -> IO Bool -> IO () unwrapMaybe :: String -> IO (Maybe a) -> IO a unwrapInt :: (Int -> Bool) -> String -> IO Int -> IO Int data InitFlag InitTimer :: InitFlag InitAudio :: InitFlag InitVideo :: InitFlag InitCDROM :: InitFlag InitJoystick :: InitFlag InitNoParachute :: InitFlag InitEventthread :: InitFlag InitEverything :: InitFlag instance Eq InitFlag instance Ord InitFlag instance Show InitFlag instance Read InitFlag instance Enum InitFlag Word32 instance Bounded InitFlag module Graphics.UI.SDL.WindowManagement data GrabMode GrabQuery :: GrabMode GrabOff :: GrabMode GrabOn :: GrabMode -- | Sets the window title and icon name. setCaption :: String -> String -> IO () -- | Sets the window title and icon name. Use Nothing to unset. rawSetCaption :: Maybe String -> Maybe String -> IO () -- | Gets the window title and icon name. getCaption :: IO (Maybe String, Maybe String) -- | Iconify/Minimise the window. iconifyWindow :: IO Bool -- | Toggles fullscreen mode. Returns False on error. tryToggleFullscreen :: Surface -> IO Bool -- | Toggles fullscreen mode. Throws an exception on error. toggleFullscreen :: Surface -> IO () -- | Grabbing means that the mouse is confined to the application window, -- and nearly all keyboard input is passed directly to the application, -- and not interpreted by a window manager, if any. grabInput :: Bool -> IO () -- | Returns the current grabbing mode. queryGrabMode :: IO GrabMode instance Show GrabMode instance Eq GrabMode module Graphics.UI.SDL.RWOps fromFile :: FilePath -> String -> IO RWops tryFromFile :: FilePath -> String -> IO (Maybe RWops) free :: RWops -> IO () with :: FilePath -> String -> (RWops -> IO a) -> IO a mkFinalizedRW :: Ptr RWopsStruct -> IO RWops module Graphics.UI.SDL.Video data Palette data Toggle Disable :: Toggle Enable :: Toggle Query :: Toggle fromToggle :: Num a => Toggle -> a toToggle :: Num a => a -> Toggle -- | Returns the video surface or Nothing on error. tryGetVideoSurface :: IO (Maybe Surface) -- | Returns the video surface, throwing an exception on error. getVideoSurface :: IO Surface -- | Returns the video driver name or Nothing on error. Notice, -- the driver name is limited to 256 chars. tryVideoDriverName :: IO (Maybe String) -- | Returns the video driver name, throwing an exception on error. See -- also tryVideoDriverName. videoDriverName :: IO String getVideoInfo :: IO VideoInfo data ListModes -- | List of available resolutions. Modes :: [Rect] -> ListModes -- | No modes available! NonAvailable :: ListModes -- | All resolutions available. AnyOK :: ListModes -- | Returns the available screen resolutions for the given format and -- video flags. listModes :: Maybe PixelFormat -> [SurfaceFlag] -> IO ListModes -- | Check to see if a particular video mode is supported. Returns the -- bits-per-pixel of the closest available mode with the given width, -- height and requested surface flags, or Nothing on error. videoModeOK :: Int -> Int -> Int -> [SurfaceFlag] -> IO (Maybe Int) -- | Set up a video mode with the specified width, height and -- bits-per-pixel. Returns Nothing on error. trySetVideoMode :: Int -> Int -> Int -> [SurfaceFlag] -> IO (Maybe Surface) -- | Same as trySetVideoMode except it throws an exception on error. setVideoMode :: Int -> Int -> Int -> [SurfaceFlag] -> IO Surface -- | Makes sure the given area is updated on the given screen. updateRect :: Surface -> Rect -> IO () -- | Makes sure the given list of rectangles is updated on the given -- screen. The rectangles are not automatically merged or checked for -- overlap. In general, the programmer can use his knowledge about his -- particular rectangles to merge them in an efficient way, to avoid -- overdraw. updateRects :: Surface -> [Rect] -> IO () -- | Swaps screen buffers. tryFlip :: Surface -> IO Bool -- | Same as tryFlip but throws an exception on error. flip :: Surface -> IO () -- | Sets a portion of the colormap for the given 8-bit surface. setColors :: Surface -> [Color] -> Int -> IO Bool -- | Sets the colors in the palette of an 8-bit surface. setPalette :: Surface -> [Palette] -> [Color] -> Int -> IO Bool setGamma :: Float -> Float -> Float -> IO Bool tryGetGammaRamp :: IO (Maybe ([Word16], [Word16], [Word16])) getGammaRamp :: IO ([Word16], [Word16], [Word16]) trySetGammaRamp :: [Word16] -> [Word16] -> [Word16] -> IO Bool setGammaRamp :: [Word16] -> [Word16] -> [Word16] -> IO () -- | Map a RGB color value to a pixel format. mapRGB :: PixelFormat -> Word8 -> Word8 -> Word8 -> IO Pixel -- | Map a RGBA color value to a pixel format. mapRGBA :: PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO Pixel -- | Get RGB values from a pixel in the specified pixel format. getRGB :: Pixel -> PixelFormat -> IO (Word8, Word8, Word8) -- | Gets RGBA values from a pixel in the specified pixel format. getRGBA :: Pixel -> PixelFormat -> IO (Word8, Word8, Word8, Word8) -- | Creates an empty Surface. Returns Nothing on error. tryCreateRGBSurface :: [SurfaceFlag] -> Int -> Int -> Int -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Maybe Surface) -- | Creates an empty Surface. Throws an exception on error. createRGBSurface :: [SurfaceFlag] -> Int -> Int -> Int -> Word32 -> Word32 -> Word32 -> Word32 -> IO Surface -- | Creates an empty Surface with (r/g/b/a)mask determined from -- the local endian. Returns Nothing on error. tryCreateRGBSurfaceEndian :: [SurfaceFlag] -> Int -> Int -> Int -> IO (Maybe Surface) -- | Creates an empty Surface with (r/g/b/a)mask determined from -- the local endian. Throws an exception on error. createRGBSurfaceEndian :: [SurfaceFlag] -> Int -> Int -> Int -> IO Surface tryCreateRGBSurfaceFrom :: Ptr a -> Int -> Int -> Int -> Int -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Maybe Surface) createRGBSurfaceFrom :: Ptr a -> Int -> Int -> Int -> Int -> Word32 -> Word32 -> Word32 -> Word32 -> IO Surface -- | Forces the finalization of a Surface. Only supported with -- GHC. freeSurface :: Surface -> IO () -- | Locks a surface for direct access. lockSurface :: Surface -> IO Bool -- | Unlocks a previously locked surface. unlockSurface :: Surface -> IO () loadBMP :: FilePath -> IO Surface saveBMP :: Surface -> FilePath -> IO Bool setColorKey :: Surface -> [SurfaceFlag] -> Pixel -> IO Bool -- | Adjusts the alpha properties of a surface. setAlpha :: Surface -> [SurfaceFlag] -> Word8 -> IO Bool -- | Sets the clipping rectangle for a surface. setClipRect :: Surface -> Maybe Rect -> IO () -- | Gets the clipping rectangle for a surface. getClipRect :: Surface -> IO Rect -- | Run an action with a given clipping rect applied. If an exception is -- raised, then withClipRect will re-raise the exception (after resetting -- the original clipping rect). withClipRect :: Surface -> Maybe Rect -> IO a -> IO a -- | Converts a surface to the same format as another surface. Returns -- Nothing on error. tryConvertSurface :: Surface -> PixelFormat -> [SurfaceFlag] -> IO (Maybe Surface) -- | Converts a surface to the same format as another surface. Throws an -- exception on error. convertSurface :: Surface -> PixelFormat -> [SurfaceFlag] -> IO Surface -- | This function performs a fast blit from the source surface to the -- destination surface. blitSurface :: Surface -> Maybe Rect -> Surface -> Maybe Rect -> IO Bool -- | This function performs a fast fill of the given rectangle with some -- color. fillRect :: Surface -> Maybe Rect -> Pixel -> IO Bool -- | Converts a surface to the display format. Returns Nothing on -- error. tryDisplayFormat :: Surface -> IO (Maybe Surface) -- | Converts a surface to the display format. Throws an exception on -- error. displayFormat :: Surface -> IO Surface -- | Converts a surface to the display format. Returns Nothing on -- error. tryDisplayFormatAlpha :: Surface -> IO (Maybe Surface) -- | Converts a surface to the display format. Throws an exception on -- error. displayFormatAlpha :: Surface -> IO Surface -- | Sets the position of the mouse cursor. warpMouse :: Word16 -> Word16 -> IO () -- | Toggle whether or not the cursor is shown on the screen. showCursor :: Bool -> IO () -- | Returns True when the cursor is set to visible. See also -- showCursor. queryCursorState :: IO Bool type GLAttr = CInt type GLValue = CInt glRedSize :: GLAttr glGreenSize :: GLAttr glBlueSize :: GLAttr glAlphaSize :: GLAttr glBufferSize :: GLAttr glDoubleBuffer :: GLAttr glDepthSize :: GLAttr glStencilSize :: GLAttr glAccumRedSize :: GLAttr glAccumGreenSize :: GLAttr glAccumBlueSize :: GLAttr glAccumAlphaSize :: GLAttr glStereo :: GLAttr glMultiSampleBuffers :: GLAttr glMultiSampleSamples :: GLAttr -- | Gets the value of a special SDL/OpenGL attribute. Returns -- Nothing on error. tryGLGetAttribute :: GLAttr -> IO (Maybe GLValue) -- | Gets the value of a special SDL/OpenGL attribute. Throws an exception -- on error. glGetAttribute :: GLAttr -> IO GLValue -- | Sets a special SDL/OpenGL attribute. Returns False on error. tryGLSetAttribute :: GLAttr -> GLValue -> IO Bool -- | Sets a special SDL/OpenGL attribute. Throws an exception on error. glSetAttribute :: GLAttr -> GLValue -> IO () -- | Swaps OpenGL framebuffers/Update Display. glSwapBuffers :: IO () mkFinalizedSurface :: Ptr SurfaceStruct -> IO Surface instance Show ListModes instance Eq ListModes instance Ord ListModes instance Eq Toggle instance Ord Toggle instance Show Toggle instance Show Palette instance Eq Palette instance Ord Palette instance Enum Palette Int instance Bounded Palette module Graphics.UI.SDL.Events -- | High level event structure. data Event NoEvent :: Event GotFocus :: [Focus] -> Event LostFocus :: [Focus] -> Event KeyDown :: !Keysym -> Event KeyUp :: !Keysym -> Event MouseMotion :: !Word16 -> !Word16 -> !Int16 -> !Int16 -> Event MouseButtonDown :: !Word16 -> !Word16 -> !MouseButton -> Event MouseButtonUp :: !Word16 -> !Word16 -> !MouseButton -> Event -- | device index, axis index, axis value. JoyAxisMotion :: !Word8 -> !Word8 -> !Int16 -> Event -- | device index, trackball index, relative motion. JoyBallMotion :: !Word8 -> !Word8 -> !Int16 -> !Int16 -> Event -- | device index, hat index, hat position. JoyHatMotion :: !Word8 -> !Word8 -> !Word8 -> Event -- | device index, button index. JoyButtonDown :: !Word8 -> !Word8 -> Event -- | device index, button index. JoyButtonUp :: !Word8 -> !Word8 -> Event -- | When Resizable is passed as a flag to -- Graphics.UI.SDL.Video.setVideoMode the user is allowed to -- resize the applications window. When the window is resized an -- VideoResize is reported, with the new window width and height -- values. When an VideoResize is recieved the window should be -- resized to the new dimensions using -- Graphics.UI.SDL.Video.setVideoMode. VideoResize :: !Int -> !Int -> Event -- | A VideoExpose event is triggered when the screen has been -- modified outside of the application, usually by the window manager and -- needs to be redrawn. VideoExpose :: Event Quit :: Event User :: !UserEventID -> !Int -> !Ptr () -> !Ptr () -> Event Unknown :: Event -- | Low level event structure keeping a one-to-one relation with the C -- event structure. data SDLEvent SDLNoEvent :: SDLEvent SDLActiveEvent :: SDLEvent SDLKeyDown :: SDLEvent SDLKeyUp :: SDLEvent SDLMouseMotion :: SDLEvent SDLMouseButtonDown :: SDLEvent SDLMouseButtonUp :: SDLEvent SDLJoyAxisMotion :: SDLEvent SDLJoyBallMotion :: SDLEvent SDLJoyHatMotion :: SDLEvent SDLJoyButtonDown :: SDLEvent SDLJoyButtonUp :: SDLEvent SDLQuit :: SDLEvent SDLSysWMEvent :: SDLEvent SDLVideoResize :: SDLEvent SDLVideoExpose :: SDLEvent SDLUserEvent :: Word8 -> SDLEvent SDLNumEvents :: SDLEvent -- | Typed user events ranging from 0 to 7 data UserEventID UID0 :: UserEventID UID1 :: UserEventID UID2 :: UserEventID UID3 :: UserEventID UID4 :: UserEventID UID5 :: UserEventID UID6 :: UserEventID UID7 :: UserEventID data MouseButton ButtonLeft :: MouseButton ButtonMiddle :: MouseButton ButtonRight :: MouseButton ButtonWheelUp :: MouseButton ButtonWheelDown :: MouseButton ButtonUnknown :: !Word8 -> MouseButton data Focus MouseFocus :: Focus InputFocus :: Focus ApplicationFocus :: Focus -- | Constructs a safe pointer from an arbitrary value. toSafePtr :: Typeable a => a -> IO SafePtr -- | Get object from a safe pointer. Nothing on type mismatch. tryFromSafePtr :: Typeable a => SafePtr -> IO (Maybe a) -- | Get object from a safe pointer. Throws an exception on type mismatch. fromSafePtr :: Typeable a => SafePtr -> IO a -- | Return the type of the object the safe pointer was created from. typeOfSafePtr :: SafePtr -> IO TypeRep -- | Sets keyboard repeat rate. Returns False on error. enableKeyRepeat :: Int -> Int -> IO Bool -- | Enables or disables unicode translation. enableUnicode :: Bool -> IO () -- | Returns the current state of unicode translation. See also -- enableUnicode. queryUnicodeState :: IO Bool -- | Gets the name of an SDL virtual keysym. getKeyName :: SDLKey -> String -- | Retrieves the current state of the mouse. Returns (X position, Y -- position, pressed buttons). getMouseState :: IO (Int, Int, [MouseButton]) -- | Retrieve the current state of the mouse. Like getMouseState -- except that X and Y are set to the change since last call to -- getRelativeMouseState. getRelativeMouseState :: IO (Int, Int, [MouseButton]) -- | Gets the state of modifier keys. getModState :: IO [Modifier] -- | Sets the internal state of modifier keys. setModState :: [Modifier] -> IO () -- | Pushes an event onto the event queue. Returns False on error. tryPushEvent :: Event -> IO Bool -- | Pushes an event onto the event queue. Throws an exception on error. pushEvent :: Event -> IO () -- | Polls for currently pending events. pollEvent :: IO Event -- | Waits indefinitely for the next available event. waitEvent :: IO Event -- | Waits indefinitely for the next available event. Blocks Haskell -- threads. waitEventBlocking :: IO Event -- | Pumps the event loop, gathering events from the input devices. pumpEvents :: IO () -- | Enable or disable events from being processed. enableEvent :: SDLEvent -> Bool -> IO () -- | Checks current state of a event. See also enableEvent. queryEventState :: SDLEvent -> IO Bool -- | Gets the state of the application. getAppState :: IO [Focus] instance Show UserEventID instance Eq UserEventID instance Enum UserEventID instance Show Focus instance Eq Focus instance Ord Focus instance Show MouseButton instance Eq MouseButton instance Ord MouseButton instance Show Event instance Eq Event instance Eq SDLEvent instance Ord SDLEvent instance Show SDLEvent instance Storable Event instance Enum Focus Word8 instance Bounded Focus instance Enum MouseButton Word8 instance Bounded SDLEvent module Graphics.UI.SDL.Joystick -- | Counts the number of joysticks attached to the system. countAvailable :: IO Int -- | Gets joystick name. Returns Nothing on error. tryName :: JoystickIndex -> IO (Maybe String) -- | Gets joystick name. Throws an exception on error. name :: JoystickIndex -> IO String -- | Opens a joystick for use. Returns Nothing on error. tryOpen :: JoystickIndex -> IO (Maybe Joystick) -- | Opens a joystick for use. Throws an exception on error. open :: JoystickIndex -> IO Joystick -- | Determines if a joystick has been opened. opened :: JoystickIndex -> IO Bool -- | Gets the index of an Joystick. index :: Joystick -> JoystickIndex -- | Gets the number of joystick axes. axesAvailable :: Joystick -> Int -- | Gets the number of joystick trackballs. ballsAvailable :: Joystick -> Int -- | Gets the number of joystick hats. hatsAvailable :: Joystick -> Int -- | Gets the number of joystick buttons. buttonsAvailable :: Joystick -> Int -- | Updates the state of all joysticks. update :: IO () -- | Gets the current state of an axis. getAxis :: Joystick -> Word8 -> IO Int16 -- | Gets the current state of a joystick hat. getHat :: Joystick -> Word8 -> IO [Hat] -- | Gets the current state of a given button on a given joystick. getButton :: Joystick -> Word8 -> IO Bool -- | Gets relative trackball motion. getBall :: Joystick -> Word8 -> IO (Maybe (Int16, Int16)) -- | Force finalization of a previous opened Joystick. Only -- supported with GHC. close :: Joystick -> IO () module Graphics.UI.SDL