#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
module Graphics.Win32.GDI.HDC
( module Graphics.Win32.GDI.HDC
) where
import System.Win32.Types
import Graphics.Win32.GDI.Types
import Foreign
#include "windows_cconv.h"
getPixel :: HDC -> Int -> Int -> IO COLORREF
getPixel :: HDC -> Int -> Int -> IO Word32
getPixel HDC
dc Int
x Int
y = HDC -> Int -> Int -> IO Word32
c_GetPixel HDC
dc Int
x Int
y
foreign import WINDOWS_CCONV unsafe "windows.h GetPixel"
c_GetPixel :: HDC -> Int -> Int -> IO COLORREF
setArcDirection :: HDC -> ArcDirection -> IO ArcDirection
setArcDirection :: HDC -> RegionType -> IO RegionType
setArcDirection HDC
dc RegionType
dir =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetArcDirection" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> RegionType -> IO RegionType
c_SetArcDirection HDC
dc RegionType
dir
foreign import WINDOWS_CCONV unsafe "windows.h SetArcDirection"
c_SetArcDirection :: HDC -> ArcDirection -> IO ArcDirection
getArcDirection :: HDC -> IO ArcDirection
getArcDirection :: HDC -> IO RegionType
getArcDirection HDC
dc =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetArcDirection" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> IO RegionType
c_GetArcDirection HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetArcDirection"
c_GetArcDirection :: HDC -> IO ArcDirection
setPolyFillMode :: HDC -> PolyFillMode -> IO PolyFillMode
setPolyFillMode :: HDC -> RegionType -> IO RegionType
setPolyFillMode HDC
dc RegionType
mode =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetPolyFillMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> RegionType -> IO RegionType
c_SetPolyFillMode HDC
dc RegionType
mode
foreign import WINDOWS_CCONV unsafe "windows.h SetPolyFillMode"
c_SetPolyFillMode :: HDC -> PolyFillMode -> IO PolyFillMode
getPolyFillMode :: HDC -> IO PolyFillMode
getPolyFillMode :: HDC -> IO RegionType
getPolyFillMode HDC
dc =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetPolyFillMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> IO RegionType
c_GetPolyFillMode HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetPolyFillMode"
c_GetPolyFillMode :: HDC -> IO PolyFillMode
setGraphicsMode :: HDC -> GraphicsMode -> IO GraphicsMode
setGraphicsMode :: HDC -> Word32 -> IO Word32
setGraphicsMode HDC
dc Word32
mode =
String -> IO Word32 -> IO Word32
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetGraphicsMode" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO Word32
c_SetGraphicsMode HDC
dc Word32
mode
foreign import WINDOWS_CCONV unsafe "windows.h SetGraphicsMode"
c_SetGraphicsMode :: HDC -> GraphicsMode -> IO GraphicsMode
getGraphicsMode :: HDC -> IO GraphicsMode
getGraphicsMode :: HDC -> IO Word32
getGraphicsMode HDC
dc =
String -> IO Word32 -> IO Word32
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetGraphicsMode" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> IO Word32
c_GetGraphicsMode HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetGraphicsMode"
c_GetGraphicsMode :: HDC -> IO GraphicsMode
setStretchBltMode :: HDC -> StretchBltMode -> IO StretchBltMode
setStretchBltMode :: HDC -> RegionType -> IO RegionType
setStretchBltMode HDC
dc RegionType
mode =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetStretchBltMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> RegionType -> IO RegionType
c_SetStretchBltMode HDC
dc RegionType
mode
foreign import WINDOWS_CCONV unsafe "windows.h SetStretchBltMode"
c_SetStretchBltMode :: HDC -> StretchBltMode -> IO StretchBltMode
getStretchBltMode :: HDC -> IO StretchBltMode
getStretchBltMode :: HDC -> IO RegionType
getStretchBltMode HDC
dc =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetStretchBltMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> IO RegionType
c_GetStretchBltMode HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetStretchBltMode"
c_GetStretchBltMode :: HDC -> IO StretchBltMode
setBkColor :: HDC -> COLORREF -> IO COLORREF
setBkColor :: HDC -> Word32 -> IO Word32
setBkColor HDC
dc Word32
color =
String -> IO Word32 -> IO Word32
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetBkColor" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO Word32
c_SetBkColor HDC
dc Word32
color
foreign import WINDOWS_CCONV unsafe "windows.h SetBkColor"
c_SetBkColor :: HDC -> COLORREF -> IO COLORREF
getBkColor :: HDC -> IO COLORREF
getBkColor :: HDC -> IO Word32
getBkColor HDC
dc =
String -> IO Word32 -> IO Word32
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetBkColor" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> IO Word32
c_GetBkColor HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetBkColor"
c_GetBkColor :: HDC -> IO COLORREF
setTextColor :: HDC -> COLORREF -> IO COLORREF
setTextColor :: HDC -> Word32 -> IO Word32
setTextColor HDC
dc Word32
color =
(Word32 -> Bool) -> String -> IO Word32 -> IO Word32
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
cLR_INVALID) String
"SetTextColor" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO Word32
c_SetTextColor HDC
dc Word32
color
foreign import WINDOWS_CCONV unsafe "windows.h SetTextColor"
c_SetTextColor :: HDC -> COLORREF -> IO COLORREF
getTextColor :: HDC -> IO COLORREF
getTextColor :: HDC -> IO Word32
getTextColor HDC
dc =
(Word32 -> Bool) -> String -> IO Word32 -> IO Word32
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
cLR_INVALID) String
"GetTextColor" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> IO Word32
c_GetTextColor HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetTextColor"
c_GetTextColor :: HDC -> IO COLORREF
setBkMode :: HDC -> BackgroundMode -> IO BackgroundMode
setBkMode :: HDC -> RegionType -> IO RegionType
setBkMode HDC
dc RegionType
mode =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SetBkMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> RegionType -> IO RegionType
c_SetBkMode HDC
dc RegionType
mode
foreign import WINDOWS_CCONV unsafe "windows.h SetBkMode"
c_SetBkMode :: HDC -> BackgroundMode -> IO BackgroundMode
getBkMode :: HDC -> IO BackgroundMode
getBkMode :: HDC -> IO RegionType
getBkMode HDC
dc =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"GetBkMode" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> IO RegionType
c_GetBkMode HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetBkMode"
c_GetBkMode :: HDC -> IO BackgroundMode
setBrushOrgEx :: HDC -> Int -> Int -> IO POINT
setBrushOrgEx :: HDC -> Int -> Int -> IO POINT
setBrushOrgEx HDC
dc Int
x Int
y =
(Ptr POINT -> IO POINT) -> IO POINT
forall a. (Ptr POINT -> IO a) -> IO a
allocaPOINT ((Ptr POINT -> IO POINT) -> IO POINT)
-> (Ptr POINT -> IO POINT) -> IO POINT
forall a b. (a -> b) -> a -> b
$ \ Ptr POINT
pt -> do
String -> IO Bool -> IO ()
failIfFalse_ String
"SetBrushOrgEx" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> Int -> Int -> Ptr POINT -> IO Bool
c_SetBrushOrgEx HDC
dc Int
x Int
y Ptr POINT
pt
Ptr POINT -> IO POINT
peekPOINT Ptr POINT
pt
foreign import WINDOWS_CCONV unsafe "windows.h SetBrushOrgEx"
c_SetBrushOrgEx :: HDC -> Int -> Int -> Ptr POINT -> IO Bool
getBrushOrgEx :: HDC -> IO POINT
getBrushOrgEx :: HDC -> IO POINT
getBrushOrgEx HDC
dc =
(Ptr POINT -> IO POINT) -> IO POINT
forall a. (Ptr POINT -> IO a) -> IO a
allocaPOINT ((Ptr POINT -> IO POINT) -> IO POINT)
-> (Ptr POINT -> IO POINT) -> IO POINT
forall a b. (a -> b) -> a -> b
$ \ Ptr POINT
pt -> do
String -> IO Bool -> IO ()
failIfFalse_ String
"GetBrushOrgEx" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> Ptr POINT -> IO Bool
c_GetBrushOrgEx HDC
dc Ptr POINT
pt
Ptr POINT -> IO POINT
peekPOINT Ptr POINT
pt
foreign import WINDOWS_CCONV unsafe "windows.h GetBrushOrgEx"
c_GetBrushOrgEx :: HDC -> Ptr POINT -> IO Bool
setTextAlign :: HDC -> TextAlignment -> IO TextAlignment
setTextAlign :: HDC -> Word32 -> IO Word32
setTextAlign HDC
dc Word32
align =
(Word32 -> Bool) -> String -> IO Word32 -> IO Word32
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
forall a. Num a => a
gDI_ERROR) String
"SetTextAlign" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO Word32
c_SetTextAlign HDC
dc Word32
align
foreign import WINDOWS_CCONV unsafe "windows.h SetTextAlign"
c_SetTextAlign :: HDC -> TextAlignment -> IO TextAlignment
getTextAlign :: HDC -> IO TextAlignment
getTextAlign :: HDC -> IO Word32
getTextAlign HDC
dc =
(Word32 -> Bool) -> String -> IO Word32 -> IO Word32
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
forall a. Num a => a
gDI_ERROR) String
"GetTextAlign" (IO Word32 -> IO Word32) -> IO Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ HDC -> IO Word32
c_GetTextAlign HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetTextAlign"
c_GetTextAlign :: HDC -> IO TextAlignment
setTextCharacterExtra :: HDC -> Int -> IO Int
HDC
dc Int
extra =
(Int -> Bool) -> String -> IO Int -> IO Int
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
0x80000000 :: Word32)) String
"SetTextCharacterExtra" (IO Int -> IO Int) -> IO Int -> IO Int
forall a b. (a -> b) -> a -> b
$
HDC -> Int -> IO Int
c_SetTextCharacterExtra HDC
dc Int
extra
foreign import WINDOWS_CCONV unsafe "windows.h SetTextCharacterExtra"
:: HDC -> Int -> IO Int
getTextCharacterExtra :: HDC -> IO Int
HDC
dc =
(Int -> Bool) -> String -> IO Int -> IO Int
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
0x80000000 :: Word32)) String
"GetTextCharacterExtra" (IO Int -> IO Int) -> IO Int -> IO Int
forall a b. (a -> b) -> a -> b
$ HDC -> IO Int
c_GetTextCharacterExtra HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h GetTextCharacterExtra"
:: HDC -> IO Int
getMiterLimit :: HDC -> IO Float
getMiterLimit :: HDC -> IO FLOAT
getMiterLimit HDC
dc =
(Ptr FLOAT -> IO FLOAT) -> IO FLOAT
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr FLOAT -> IO FLOAT) -> IO FLOAT)
-> (Ptr FLOAT -> IO FLOAT) -> IO FLOAT
forall a b. (a -> b) -> a -> b
$ \ Ptr FLOAT
p_res -> do
String -> IO Bool -> IO ()
failIfFalse_ String
"GetMiterLimit" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> Ptr FLOAT -> IO Bool
c_GetMiterLimit HDC
dc Ptr FLOAT
p_res
Ptr FLOAT -> IO FLOAT
forall a. Storable a => Ptr a -> IO a
peek Ptr FLOAT
p_res
foreign import WINDOWS_CCONV unsafe "windows.h GetMiterLimit"
c_GetMiterLimit :: HDC -> Ptr FLOAT -> IO Bool
setMiterLimit :: HDC -> Float -> IO Float
setMiterLimit :: HDC -> FLOAT -> IO FLOAT
setMiterLimit HDC
dc FLOAT
new_limit =
(Ptr FLOAT -> IO FLOAT) -> IO FLOAT
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr FLOAT -> IO FLOAT) -> IO FLOAT)
-> (Ptr FLOAT -> IO FLOAT) -> IO FLOAT
forall a b. (a -> b) -> a -> b
$ \ Ptr FLOAT
p_old_limit -> do
String -> IO Bool -> IO ()
failIfFalse_ String
"SetMiterLimit" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> FLOAT -> Ptr FLOAT -> IO Bool
c_SetMiterLimit HDC
dc FLOAT
new_limit Ptr FLOAT
p_old_limit
Ptr FLOAT -> IO FLOAT
forall a. Storable a => Ptr a -> IO a
peek Ptr FLOAT
p_old_limit
foreign import WINDOWS_CCONV unsafe "windows.h SetMiterLimit"
c_SetMiterLimit :: HDC -> FLOAT -> Ptr FLOAT -> IO Bool
saveDC :: HDC -> IO Int
saveDC :: HDC -> IO Int
saveDC HDC
dc =
String -> IO Int -> IO Int
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SaveDC" (IO Int -> IO Int) -> IO Int -> IO Int
forall a b. (a -> b) -> a -> b
$ HDC -> IO Int
c_SaveDC HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h SaveDC"
c_SaveDC :: HDC -> IO Int
restoreDC :: HDC -> Int -> IO ()
restoreDC :: HDC -> Int -> IO ()
restoreDC HDC
dc Int
saved =
String -> IO Bool -> IO ()
failIfFalse_ String
"RestoreDC" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> Int -> IO Bool
c_RestoreDC HDC
dc Int
saved
foreign import WINDOWS_CCONV unsafe "windows.h RestoreDC"
c_RestoreDC :: HDC -> Int -> IO Bool
getCurrentBitmap :: HDC -> IO HBITMAP
getCurrentBitmap :: HDC -> IO HDC
getCurrentBitmap HDC
dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"GetCurrentBitmap" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO HDC
c_GetCurrentBitmap HDC
dc Word32
oBJ_BITMAP
foreign import WINDOWS_CCONV unsafe "windows.h GetCurrentObject"
c_GetCurrentBitmap :: HDC -> UINT -> IO HBITMAP
getCurrentBrush :: HDC -> IO HBRUSH
getCurrentBrush :: HDC -> IO HDC
getCurrentBrush HDC
dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"GetCurrentBrush" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO HDC
c_GetCurrentBrush HDC
dc Word32
oBJ_BRUSH
foreign import WINDOWS_CCONV unsafe "windows.h GetCurrentObject"
c_GetCurrentBrush :: HDC -> UINT -> IO HBRUSH
getCurrentFont :: HDC -> IO HFONT
getCurrentFont :: HDC -> IO HDC
getCurrentFont HDC
dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"GetCurrentFont" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO HDC
c_GetCurrentFont HDC
dc Word32
oBJ_FONT
foreign import WINDOWS_CCONV unsafe "windows.h GetCurrentObject"
c_GetCurrentFont :: HDC -> UINT -> IO HFONT
getCurrentPalette :: HDC -> IO HPALETTE
getCurrentPalette :: HDC -> IO HDC
getCurrentPalette HDC
dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"GetCurrentPalette" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO HDC
c_GetCurrentPalette HDC
dc Word32
oBJ_PAL
foreign import WINDOWS_CCONV unsafe "windows.h GetCurrentObject"
c_GetCurrentPalette :: HDC -> UINT -> IO HPALETTE
getCurrentPen :: HDC -> IO HPEN
getCurrentPen :: HDC -> IO HDC
getCurrentPen HDC
dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"GetCurrentPen" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> Word32 -> IO HDC
c_GetCurrentPen HDC
dc Word32
oBJ_PEN
foreign import WINDOWS_CCONV unsafe "windows.h GetCurrentObject"
c_GetCurrentPen :: HDC -> UINT -> IO HPEN
selectBitmap :: HDC -> HBITMAP -> IO HBITMAP
selectBitmap :: HDC -> HDC -> IO HDC
selectBitmap HDC
dc HDC
bitmap =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"SelectBitmap" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO HDC
c_SelectBitmap HDC
dc HDC
bitmap
foreign import WINDOWS_CCONV unsafe "windows.h SelectObject"
c_SelectBitmap :: HDC -> HBITMAP -> IO HBITMAP
selectBrush :: HDC -> HBRUSH -> IO HBRUSH
selectBrush :: HDC -> HDC -> IO HDC
selectBrush HDC
dc HDC
brush =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"SelectBrush" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO HDC
c_SelectBrush HDC
dc HDC
brush
foreign import WINDOWS_CCONV unsafe "windows.h SelectObject"
c_SelectBrush :: HDC -> HBRUSH -> IO HBRUSH
selectFont :: HDC -> HFONT -> IO HFONT
selectFont :: HDC -> HDC -> IO HDC
selectFont HDC
dc HDC
font =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"SelectFont" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO HDC
c_SelectFont HDC
dc HDC
font
foreign import WINDOWS_CCONV unsafe "windows.h SelectObject"
c_SelectFont :: HDC -> HFONT -> IO HFONT
selectPen :: HDC -> HPEN -> IO HPEN
selectPen :: HDC -> HDC -> IO HDC
selectPen HDC
dc HDC
pen =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"SelectPen" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO HDC
c_SelectPen HDC
dc HDC
pen
foreign import WINDOWS_CCONV unsafe "windows.h SelectObject"
c_SelectPen :: HDC -> HPEN -> IO HPEN
selectPalette :: HDC -> HPALETTE -> Bool -> IO HPALETTE
selectPalette :: HDC -> HDC -> Bool -> IO HDC
selectPalette HDC
dc HDC
palette Bool
force_bg =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"SelectPalette" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> Bool -> IO HDC
c_SelectPalette HDC
dc HDC
palette Bool
force_bg
foreign import WINDOWS_CCONV unsafe "windows.h SelectPalette"
c_SelectPalette :: HDC -> HPALETTE -> Bool -> IO HPALETTE
selectRgn :: HDC -> HRGN -> IO RegionType
selectRgn :: HDC -> HRGN -> IO RegionType
selectRgn HDC
dc HRGN
rgn =
HRGN -> (HDC -> IO RegionType) -> IO RegionType
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr HRGN
rgn ((HDC -> IO RegionType) -> IO RegionType)
-> (HDC -> IO RegionType) -> IO RegionType
forall a b. (a -> b) -> a -> b
$ \ HDC
p_rgn ->
(RegionType -> Bool) -> String -> IO RegionType -> IO RegionType
forall a. (a -> Bool) -> String -> IO a -> IO a
failIf (RegionType -> RegionType -> Bool
forall a. Eq a => a -> a -> Bool
== RegionType
forall a. Num a => a
gDI_ERROR) String
"SelectRgn" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO RegionType
c_SelectRgn HDC
dc HDC
p_rgn
foreign import ccall unsafe "windows.h SelectObjectInt"
c_SelectRgn :: HDC -> PRGN -> IO RegionType
selectClipRgn :: HDC -> Maybe HRGN -> IO RegionType
selectClipRgn :: HDC -> Maybe HRGN -> IO RegionType
selectClipRgn HDC
dc Maybe HRGN
mb_rgn =
(HRGN -> (HDC -> IO RegionType) -> IO RegionType)
-> Maybe HRGN -> (HDC -> IO RegionType) -> IO RegionType
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith HRGN -> (HDC -> IO RegionType) -> IO RegionType
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Maybe HRGN
mb_rgn ((HDC -> IO RegionType) -> IO RegionType)
-> (HDC -> IO RegionType) -> IO RegionType
forall a b. (a -> b) -> a -> b
$ \ HDC
p_rgn ->
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SelectClipRgn" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> IO RegionType
c_SelectClipRgn HDC
dc HDC
p_rgn
foreign import WINDOWS_CCONV unsafe "windows.h SelectClipRgn"
c_SelectClipRgn :: HDC -> PRGN -> IO RegionType
extSelectClipRgn :: HDC -> Maybe HRGN -> ClippingMode -> IO RegionType
extSelectClipRgn :: HDC -> Maybe HRGN -> RegionType -> IO RegionType
extSelectClipRgn HDC
dc Maybe HRGN
mb_rgn RegionType
mode =
(HRGN -> (HDC -> IO RegionType) -> IO RegionType)
-> Maybe HRGN -> (HDC -> IO RegionType) -> IO RegionType
forall a b c.
(a -> (Ptr b -> IO c) -> IO c)
-> Maybe a -> (Ptr b -> IO c) -> IO c
maybeWith HRGN -> (HDC -> IO RegionType) -> IO RegionType
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr Maybe HRGN
mb_rgn ((HDC -> IO RegionType) -> IO RegionType)
-> (HDC -> IO RegionType) -> IO RegionType
forall a b. (a -> b) -> a -> b
$ \ HDC
p_rgn ->
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"ExtSelectClipRgn" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> RegionType -> IO RegionType
c_ExtSelectClipRgn HDC
dc HDC
p_rgn RegionType
mode
foreign import WINDOWS_CCONV unsafe "windows.h ExtSelectClipRgn"
c_ExtSelectClipRgn :: HDC -> PRGN -> ClippingMode -> IO RegionType
selectClipPath :: HDC -> ClippingMode -> IO RegionType
selectClipPath :: HDC -> RegionType -> IO RegionType
selectClipPath HDC
dc RegionType
mode =
String -> IO RegionType -> IO RegionType
forall a. (Eq a, Num a) => String -> IO a -> IO a
failIfZero String
"SelectClipPath" (IO RegionType -> IO RegionType) -> IO RegionType -> IO RegionType
forall a b. (a -> b) -> a -> b
$ HDC -> RegionType -> IO RegionType
c_SelectClipPath HDC
dc RegionType
mode
foreign import WINDOWS_CCONV unsafe "windows.h SelectClipPath"
c_SelectClipPath :: HDC -> ClippingMode -> IO RegionType
cancelDC :: HDC -> IO ()
cancelDC :: HDC -> IO ()
cancelDC HDC
dc =
String -> IO Bool -> IO ()
failIfFalse_ String
"CancelDC" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> IO Bool
c_CancelDC HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h CancelDC"
c_CancelDC :: HDC -> IO Bool
createCompatibleDC :: Maybe HDC -> IO HDC
createCompatibleDC :: Maybe HDC -> IO HDC
createCompatibleDC Maybe HDC
mb_dc =
String -> IO HDC -> IO HDC
forall a. String -> IO (Ptr a) -> IO (Ptr a)
failIfNull String
"CreateCompatibleDC" (IO HDC -> IO HDC) -> IO HDC -> IO HDC
forall a b. (a -> b) -> a -> b
$ HDC -> IO HDC
c_CreateCompatibleDC (Maybe HDC -> HDC
forall a. Maybe (Ptr a) -> Ptr a
maybePtr Maybe HDC
mb_dc)
foreign import WINDOWS_CCONV unsafe "windows.h CreateCompatibleDC"
c_CreateCompatibleDC :: HDC -> IO HDC
deleteDC :: HDC -> IO ()
deleteDC :: HDC -> IO ()
deleteDC HDC
dc =
String -> IO Bool -> IO ()
failIfFalse_ String
"DeleteDC" (IO Bool -> IO ()) -> IO Bool -> IO ()
forall a b. (a -> b) -> a -> b
$ HDC -> IO Bool
c_DeleteDC HDC
dc
foreign import WINDOWS_CCONV unsafe "windows.h DeleteDC"
c_DeleteDC :: HDC -> IO Bool