{-# LINE 2 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
module Graphics.UI.Gtk.Gdk.DrawWindow (
DrawWindow,
DrawWindowClass,
castToDrawWindow, gTypeDrawWindow,
WindowState(..),
NativeWindowId,
toNativeWindowId,
fromNativeWindowId,
drawWindowGetState,
drawWindowScroll,
drawWindowClear,
drawWindowClearArea,
drawWindowClearAreaExpose,
drawWindowRaise,
drawWindowLower,
drawWindowRegisterDnd,
drawWindowBeginPaintRect,
drawWindowBeginPaintRegion,
drawWindowEndPaint,
drawWindowInvalidateRect,
drawWindowInvalidateRegion,
drawWindowGetUpdateArea,
drawWindowFreezeUpdates,
drawWindowThawUpdates,
drawWindowProcessUpdates,
drawWindowSetAcceptFocus,
drawWindowShapeCombineMask,
drawWindowShapeCombineRegion,
drawWindowSetChildShapes,
drawWindowMergeChildShapes,
drawWindowGetPointer,
drawWindowGetPointerPos,
drawWindowGetOrigin,
drawWindowSetCursor,
drawWindowForeignNew,
drawWindowGetDefaultRootWindow,
drawWindowGetWidth,
drawWindowGetHeight,
) where
import Control.Monad (liftM)
import Data.Maybe (fromMaybe)
import System.Glib.FFI
import System.Glib.Flags (toFlags)
import Graphics.UI.Gtk.Types
{-# LINE 107 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
import Graphics.UI.Gtk.Gdk.Enums
{-# LINE 108 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
import Graphics.UI.Gtk.Gdk.Region
{-# LINE 110 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
import Graphics.UI.Gtk.Gdk.Cursor
{-# LINE 112 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
import Graphics.UI.Gtk.General.Structs
{-# LINE 115 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
drawWindowGetState :: DrawWindowClass self => self
-> IO [WindowState]
drawWindowGetState self =
liftM (toFlags . fromIntegral) $
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_state argPtr1)
{-# LINE 124 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowScroll :: DrawWindowClass self => self
-> Int
-> Int
-> IO ()
drawWindowScroll self dx dy =
(\(DrawWindow arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_scroll argPtr1 arg2 arg3)
{-# LINE 143 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(fromIntegral dx)
(fromIntegral dy)
drawWindowClear :: DrawWindowClass self => self -> IO ()
drawWindowClear self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_clear argPtr1)
{-# LINE 154 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowClearArea :: DrawWindowClass self => self
-> Int
-> Int
-> Int
-> Int
-> IO ()
drawWindowClearArea self x y width height =
(\(DrawWindow arg1) arg2 arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_clear_area argPtr1 arg2 arg3 arg4 arg5)
{-# LINE 167 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(fromIntegral x)
(fromIntegral y)
(fromIntegral width)
(fromIntegral height)
drawWindowClearAreaExpose :: DrawWindowClass self => self
-> Int
-> Int
-> Int
-> Int
-> IO ()
drawWindowClearAreaExpose self x y width height =
(\(DrawWindow arg1) arg2 arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_clear_area_e argPtr1 arg2 arg3 arg4 arg5)
{-# LINE 185 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(fromIntegral x)
(fromIntegral y)
(fromIntegral width)
(fromIntegral height)
drawWindowRaise :: DrawWindowClass self => self -> IO ()
drawWindowRaise self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_raise argPtr1)
{-# LINE 203 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowLower :: DrawWindowClass self => self -> IO ()
drawWindowLower self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_lower argPtr1)
{-# LINE 221 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowRegisterDnd :: DrawWindowClass self => self -> IO ()
drawWindowRegisterDnd self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_register_dnd argPtr1)
{-# LINE 228 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowBeginPaintRect :: DrawWindowClass self => self
-> Rectangle
-> IO ()
drawWindowBeginPaintRect self rectangle = with rectangle $ \rectPtr ->
(\(DrawWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_begin_paint_rect argPtr1 arg2) (toDrawWindow self) (castPtr rectPtr)
drawWindowBeginPaintRegion :: DrawWindowClass self => self
-> Region
-> IO ()
drawWindowBeginPaintRegion self region =
(\(DrawWindow arg1) (Region arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gdk_window_begin_paint_region argPtr1 argPtr2)
{-# LINE 285 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
region
drawWindowEndPaint :: DrawWindowClass self => self -> IO ()
drawWindowEndPaint self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_end_paint argPtr1)
{-# LINE 300 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowInvalidateRect :: DrawWindowClass self => self
-> Rectangle
-> Bool
-> IO ()
drawWindowInvalidateRect self rect invalidateChildren =
with rect $ \rectPtr ->
(\(DrawWindow arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_invalidate_rect argPtr1 arg2 arg3)
{-# LINE 313 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(castPtr rectPtr)
(fromBool invalidateChildren)
drawWindowInvalidateRegion :: DrawWindowClass self => self
-> Region
-> Bool
-> IO ()
drawWindowInvalidateRegion self region invalidateChildren =
(\(DrawWindow arg1) (Region arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gdk_window_invalidate_region argPtr1 argPtr2 arg3)
{-# LINE 335 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
region
(fromBool invalidateChildren)
drawWindowGetUpdateArea :: DrawWindowClass self => self
-> IO (Maybe Region)
drawWindowGetUpdateArea self = do
reg <- (\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_update_area argPtr1) (toDrawWindow self)
if reg==nullPtr then return Nothing else liftM Just (makeNewRegion reg)
drawWindowFreezeUpdates :: DrawWindowClass self => self -> IO ()
drawWindowFreezeUpdates self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_freeze_updates argPtr1)
{-# LINE 366 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowThawUpdates :: DrawWindowClass self => self -> IO ()
drawWindowThawUpdates self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_thaw_updates argPtr1)
{-# LINE 373 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowProcessUpdates :: DrawWindowClass self => self
-> Bool
-> IO ()
drawWindowProcessUpdates self updateChildren =
(\(DrawWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_process_updates argPtr1 arg2)
{-# LINE 392 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(fromBool updateChildren)
drawWindowSetAcceptFocus :: DrawWindowClass self => self
-> Bool
-> IO ()
drawWindowSetAcceptFocus self acceptFocus =
(\(DrawWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_set_accept_focus argPtr1 arg2)
{-# LINE 409 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(fromBool acceptFocus)
drawWindowShapeCombineMask :: DrawWindowClass self => self
-> Maybe Pixmap
-> Int
-> Int
-> IO ()
drawWindowShapeCombineMask self (Just (Pixmap mask)) offsetX offsetY =
withForeignPtr mask $ \maskPtr ->
(\(DrawWindow arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_shape_combine_mask argPtr1 arg2 arg3 arg4)
{-# LINE 441 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(castPtr maskPtr)
(fromIntegral offsetX)
(fromIntegral offsetY)
drawWindowShapeCombineMask self Nothing offsetX offsetY =
(\(DrawWindow arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_shape_combine_mask argPtr1 arg2 arg3 arg4)
{-# LINE 447 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
nullPtr
(fromIntegral offsetX)
(fromIntegral offsetY)
drawWindowShapeCombineRegion :: DrawWindowClass self => self
-> Maybe Region
-> Int
-> Int
-> IO ()
drawWindowShapeCombineRegion self (Just reg) offsetX offsetY =
(\(DrawWindow arg1) (Region arg2) arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gdk_window_shape_combine_region argPtr1 argPtr2 arg3 arg4)
{-# LINE 479 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
reg
(fromIntegral offsetX)
(fromIntegral offsetY)
drawWindowShapeCombineRegion self Nothing offsetX offsetY =
(\(DrawWindow arg1) (Region arg2) arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gdk_window_shape_combine_region argPtr1 argPtr2 arg3 arg4)
{-# LINE 485 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
(Region nullForeignPtr)
(fromIntegral offsetX)
(fromIntegral offsetY)
drawWindowSetChildShapes :: DrawWindowClass self => self -> IO ()
drawWindowSetChildShapes self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_set_child_shapes argPtr1)
{-# LINE 499 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowMergeChildShapes :: DrawWindowClass self => self -> IO ()
drawWindowMergeChildShapes self =
(\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_merge_child_shapes argPtr1)
{-# LINE 511 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
drawWindowGetPointer :: DrawWindowClass self => self
-> IO (Maybe (Bool, Int, Int, [Modifier]))
drawWindowGetPointer self =
alloca $ \xPtr -> alloca $ \yPtr -> alloca $ \mPtr -> do
winPtr <- (\(DrawWindow arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_pointer argPtr1 arg2 arg3 arg4) (toDrawWindow self)
xPtr yPtr mPtr
if winPtr==nullPtr then return Nothing else do
same <- withForeignPtr (unDrawWindow (toDrawWindow self)) $ \dPtr ->
return (winPtr==dPtr)
x <- peek xPtr
y <- peek yPtr
m <- peek mPtr
return (Just (same, fromIntegral x, fromIntegral y,
toFlags (fromIntegral m)))
drawWindowGetPointerPos :: DrawWindowClass self => self
-> IO (Maybe DrawWindow, Int, Int, [Modifier])
drawWindowGetPointerPos self =
alloca $ \xPtr -> alloca $ \yPtr -> alloca $ \mPtr -> do
winPtr <- (\(DrawWindow arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_pointer argPtr1 arg2 arg3 arg4) (toDrawWindow self)
xPtr yPtr mPtr
x <- peek xPtr
y <- peek yPtr
m <- peek mPtr
mWin <- if winPtr==nullPtr then return Nothing else liftM Just $
makeNewGObject mkDrawWindow (return winPtr)
return (mWin, fromIntegral x, fromIntegral y, toFlags (fromIntegral m))
drawWindowGetOrigin :: DrawWindow
-> IO (Int, Int)
drawWindowGetOrigin self =
alloca $ \xPtr ->
alloca $ \yPtr -> do
(\(DrawWindow arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_origin argPtr1 arg2 arg3)
{-# LINE 578 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
(toDrawWindow self)
xPtr
yPtr
x <- peek xPtr
y <- peek yPtr
return (fromIntegral x, fromIntegral y)
drawWindowSetCursor :: DrawWindow -> Maybe Cursor -> IO ()
drawWindowSetCursor self cursor =
(\(DrawWindow arg1) (Cursor arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gdk_window_set_cursor argPtr1 argPtr2)
{-# LINE 595 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
self
(fromMaybe (Cursor nullForeignPtr) cursor)
drawWindowForeignNew :: NativeWindowId -> IO (Maybe DrawWindow)
drawWindowForeignNew anid = maybeNull (wrapNewGObject mkDrawWindow) $
liftM castPtr $ gdk_window_foreign_new (fromNativeWindowId anid)
drawWindowGetDefaultRootWindow ::
IO DrawWindow
drawWindowGetDefaultRootWindow =
makeNewGObject mkDrawWindow $
gdk_get_default_root_window
{-# LINE 615 "./Graphics/UI/Gtk/Gdk/DrawWindow.chs" #-}
drawWindowGetWidth :: DrawWindow -> IO Int
drawWindowGetWidth self =
liftM fromIntegral $ (\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_width argPtr1) (toDrawWindow self)
drawWindowGetHeight :: DrawWindow -> IO Int
drawWindowGetHeight self =
liftM fromIntegral $ (\(DrawWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gdk_window_get_height argPtr1) (toDrawWindow self)
foreign import ccall safe "gdk_window_get_state"
gdk_window_get_state :: ((Ptr DrawWindow) -> (IO CInt))
foreign import ccall safe "gdk_window_scroll"
gdk_window_scroll :: ((Ptr DrawWindow) -> (CInt -> (CInt -> (IO ()))))
foreign import ccall safe "gdk_window_clear"
gdk_window_clear :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_clear_area"
gdk_window_clear_area :: ((Ptr DrawWindow) -> (CInt -> (CInt -> (CInt -> (CInt -> (IO ()))))))
foreign import ccall safe "gdk_window_clear_area_e"
gdk_window_clear_area_e :: ((Ptr DrawWindow) -> (CInt -> (CInt -> (CInt -> (CInt -> (IO ()))))))
foreign import ccall safe "gdk_window_raise"
gdk_window_raise :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_lower"
gdk_window_lower :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_register_dnd"
gdk_window_register_dnd :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_begin_paint_rect"
gdk_window_begin_paint_rect :: ((Ptr DrawWindow) -> ((Ptr ()) -> (IO ())))
foreign import ccall safe "gdk_window_begin_paint_region"
gdk_window_begin_paint_region :: ((Ptr DrawWindow) -> ((Ptr Region) -> (IO ())))
foreign import ccall safe "gdk_window_end_paint"
gdk_window_end_paint :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_invalidate_rect"
gdk_window_invalidate_rect :: ((Ptr DrawWindow) -> ((Ptr ()) -> (CInt -> (IO ()))))
foreign import ccall safe "gdk_window_invalidate_region"
gdk_window_invalidate_region :: ((Ptr DrawWindow) -> ((Ptr Region) -> (CInt -> (IO ()))))
foreign import ccall safe "gdk_window_get_update_area"
gdk_window_get_update_area :: ((Ptr DrawWindow) -> (IO (Ptr Region)))
foreign import ccall safe "gdk_window_freeze_updates"
gdk_window_freeze_updates :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_thaw_updates"
gdk_window_thaw_updates :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_process_updates"
gdk_window_process_updates :: ((Ptr DrawWindow) -> (CInt -> (IO ())))
foreign import ccall safe "gdk_window_set_accept_focus"
gdk_window_set_accept_focus :: ((Ptr DrawWindow) -> (CInt -> (IO ())))
foreign import ccall safe "gdk_window_shape_combine_mask"
gdk_window_shape_combine_mask :: ((Ptr DrawWindow) -> ((Ptr ()) -> (CInt -> (CInt -> (IO ())))))
foreign import ccall safe "gdk_window_shape_combine_region"
gdk_window_shape_combine_region :: ((Ptr DrawWindow) -> ((Ptr Region) -> (CInt -> (CInt -> (IO ())))))
foreign import ccall safe "gdk_window_set_child_shapes"
gdk_window_set_child_shapes :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_merge_child_shapes"
gdk_window_merge_child_shapes :: ((Ptr DrawWindow) -> (IO ()))
foreign import ccall safe "gdk_window_get_pointer"
gdk_window_get_pointer :: ((Ptr DrawWindow) -> ((Ptr CInt) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO (Ptr DrawWindow))))))
foreign import ccall safe "gdk_window_get_origin"
gdk_window_get_origin :: ((Ptr DrawWindow) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO CInt))))
foreign import ccall safe "gdk_window_set_cursor"
gdk_window_set_cursor :: ((Ptr DrawWindow) -> ((Ptr Cursor) -> (IO ())))
foreign import ccall safe "gdk_window_foreign_new"
gdk_window_foreign_new :: (CUInt -> (IO (Ptr DrawWindow)))
foreign import ccall safe "gdk_get_default_root_window"
gdk_get_default_root_window :: (IO (Ptr DrawWindow))
foreign import ccall safe "gdk_window_get_width"
gdk_window_get_width :: ((Ptr DrawWindow) -> (IO CInt))
foreign import ccall safe "gdk_window_get_height"
gdk_window_get_height :: ((Ptr DrawWindow) -> (IO CInt))