{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GdkPixbuf.Objects.Pixbuf
(
#if defined(ENABLE_OVERLOADING)
PixbufGetOptionsMethodInfo ,
#endif
Pixbuf(..) ,
IsPixbuf ,
toPixbuf ,
#if defined(ENABLE_OVERLOADING)
ResolvePixbufMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufAddAlphaMethodInfo ,
#endif
pixbufAddAlpha ,
#if defined(ENABLE_OVERLOADING)
PixbufApplyEmbeddedOrientationMethodInfo,
#endif
pixbufApplyEmbeddedOrientation ,
pixbufCalculateRowstride ,
#if defined(ENABLE_OVERLOADING)
PixbufCompositeMethodInfo ,
#endif
pixbufComposite ,
#if defined(ENABLE_OVERLOADING)
PixbufCompositeColorMethodInfo ,
#endif
pixbufCompositeColor ,
#if defined(ENABLE_OVERLOADING)
PixbufCompositeColorSimpleMethodInfo ,
#endif
pixbufCompositeColorSimple ,
#if defined(ENABLE_OVERLOADING)
PixbufCopyMethodInfo ,
#endif
pixbufCopy ,
#if defined(ENABLE_OVERLOADING)
PixbufCopyAreaMethodInfo ,
#endif
pixbufCopyArea ,
#if defined(ENABLE_OVERLOADING)
PixbufCopyOptionsMethodInfo ,
#endif
pixbufCopyOptions ,
#if defined(ENABLE_OVERLOADING)
PixbufFillMethodInfo ,
#endif
pixbufFill ,
#if defined(ENABLE_OVERLOADING)
PixbufFlipMethodInfo ,
#endif
pixbufFlip ,
#if defined(ENABLE_OVERLOADING)
PixbufGetBitsPerSampleMethodInfo ,
#endif
pixbufGetBitsPerSample ,
#if defined(ENABLE_OVERLOADING)
PixbufGetByteLengthMethodInfo ,
#endif
pixbufGetByteLength ,
#if defined(ENABLE_OVERLOADING)
PixbufGetColorspaceMethodInfo ,
#endif
pixbufGetColorspace ,
pixbufGetFileInfo ,
pixbufGetFileInfoAsync ,
pixbufGetFileInfoFinish ,
pixbufGetFormats ,
#if defined(ENABLE_OVERLOADING)
PixbufGetHasAlphaMethodInfo ,
#endif
pixbufGetHasAlpha ,
#if defined(ENABLE_OVERLOADING)
PixbufGetHeightMethodInfo ,
#endif
pixbufGetHeight ,
#if defined(ENABLE_OVERLOADING)
PixbufGetNChannelsMethodInfo ,
#endif
pixbufGetNChannels ,
#if defined(ENABLE_OVERLOADING)
PixbufGetOptionMethodInfo ,
#endif
pixbufGetOption ,
#if defined(ENABLE_OVERLOADING)
PixbufGetPixelsMethodInfo ,
#endif
pixbufGetPixels ,
#if defined(ENABLE_OVERLOADING)
PixbufGetRowstrideMethodInfo ,
#endif
pixbufGetRowstride ,
#if defined(ENABLE_OVERLOADING)
PixbufGetWidthMethodInfo ,
#endif
pixbufGetWidth ,
pixbufInitModules ,
pixbufNew ,
pixbufNewFromBytes ,
pixbufNewFromData ,
pixbufNewFromFile ,
pixbufNewFromFileAtScale ,
pixbufNewFromFileAtSize ,
pixbufNewFromInline ,
pixbufNewFromResource ,
pixbufNewFromResourceAtScale ,
pixbufNewFromStream ,
pixbufNewFromStreamAsync ,
pixbufNewFromStreamAtScale ,
pixbufNewFromStreamAtScaleAsync ,
pixbufNewFromStreamFinish ,
pixbufNewFromXpmData ,
#if defined(ENABLE_OVERLOADING)
PixbufNewSubpixbufMethodInfo ,
#endif
pixbufNewSubpixbuf ,
#if defined(ENABLE_OVERLOADING)
PixbufReadPixelBytesMethodInfo ,
#endif
pixbufReadPixelBytes ,
#if defined(ENABLE_OVERLOADING)
PixbufReadPixelsMethodInfo ,
#endif
pixbufReadPixels ,
#if defined(ENABLE_OVERLOADING)
PixbufRemoveOptionMethodInfo ,
#endif
pixbufRemoveOption ,
#if defined(ENABLE_OVERLOADING)
PixbufRotateSimpleMethodInfo ,
#endif
pixbufRotateSimple ,
#if defined(ENABLE_OVERLOADING)
PixbufSaturateAndPixelateMethodInfo ,
#endif
pixbufSaturateAndPixelate ,
#if defined(ENABLE_OVERLOADING)
PixbufSaveToBuffervMethodInfo ,
#endif
pixbufSaveToBufferv ,
#if defined(ENABLE_OVERLOADING)
PixbufSaveToCallbackvMethodInfo ,
#endif
pixbufSaveToCallbackv ,
pixbufSaveToStreamFinish ,
#if defined(ENABLE_OVERLOADING)
PixbufSaveToStreamvMethodInfo ,
#endif
pixbufSaveToStreamv ,
#if defined(ENABLE_OVERLOADING)
PixbufSaveToStreamvAsyncMethodInfo ,
#endif
pixbufSaveToStreamvAsync ,
#if defined(ENABLE_OVERLOADING)
PixbufSavevMethodInfo ,
#endif
pixbufSavev ,
#if defined(ENABLE_OVERLOADING)
PixbufScaleMethodInfo ,
#endif
pixbufScale ,
#if defined(ENABLE_OVERLOADING)
PixbufScaleSimpleMethodInfo ,
#endif
pixbufScaleSimple ,
#if defined(ENABLE_OVERLOADING)
PixbufSetOptionMethodInfo ,
#endif
pixbufSetOption ,
#if defined(ENABLE_OVERLOADING)
PixbufBitsPerSamplePropertyInfo ,
#endif
constructPixbufBitsPerSample ,
getPixbufBitsPerSample ,
#if defined(ENABLE_OVERLOADING)
pixbufBitsPerSample ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufColorspacePropertyInfo ,
#endif
constructPixbufColorspace ,
getPixbufColorspace ,
#if defined(ENABLE_OVERLOADING)
pixbufColorspace ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufHasAlphaPropertyInfo ,
#endif
constructPixbufHasAlpha ,
getPixbufHasAlpha ,
#if defined(ENABLE_OVERLOADING)
pixbufHasAlpha ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufHeightPropertyInfo ,
#endif
constructPixbufHeight ,
getPixbufHeight ,
#if defined(ENABLE_OVERLOADING)
pixbufHeight ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufNChannelsPropertyInfo ,
#endif
constructPixbufNChannels ,
getPixbufNChannels ,
#if defined(ENABLE_OVERLOADING)
pixbufNChannels ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufPixelBytesPropertyInfo ,
#endif
constructPixbufPixelBytes ,
getPixbufPixelBytes ,
#if defined(ENABLE_OVERLOADING)
pixbufPixelBytes ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufPixelsPropertyInfo ,
#endif
constructPixbufPixels ,
getPixbufPixels ,
#if defined(ENABLE_OVERLOADING)
pixbufPixels ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufRowstridePropertyInfo ,
#endif
constructPixbufRowstride ,
getPixbufRowstride ,
#if defined(ENABLE_OVERLOADING)
pixbufRowstride ,
#endif
#if defined(ENABLE_OVERLOADING)
PixbufWidthPropertyInfo ,
#endif
constructPixbufWidth ,
getPixbufWidth ,
#if defined(ENABLE_OVERLOADING)
pixbufWidth ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GdkPixbuf.Callbacks as GdkPixbuf.Callbacks
import {-# SOURCE #-} qualified GI.GdkPixbuf.Enums as GdkPixbuf.Enums
import {-# SOURCE #-} qualified GI.GdkPixbuf.Structs.PixbufFormat as GdkPixbuf.PixbufFormat
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
newtype Pixbuf = Pixbuf (SP.ManagedPtr Pixbuf)
deriving (Pixbuf -> Pixbuf -> Bool
(Pixbuf -> Pixbuf -> Bool)
-> (Pixbuf -> Pixbuf -> Bool) -> Eq Pixbuf
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Pixbuf -> Pixbuf -> Bool
== :: Pixbuf -> Pixbuf -> Bool
$c/= :: Pixbuf -> Pixbuf -> Bool
/= :: Pixbuf -> Pixbuf -> Bool
Eq)
instance SP.ManagedPtrNewtype Pixbuf where
toManagedPtr :: Pixbuf -> ManagedPtr Pixbuf
toManagedPtr (Pixbuf ManagedPtr Pixbuf
p) = ManagedPtr Pixbuf
p
foreign import ccall "gdk_pixbuf_get_type"
c_gdk_pixbuf_get_type :: IO B.Types.GType
instance B.Types.TypedObject Pixbuf where
glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_get_type
instance B.Types.GObject Pixbuf
class (SP.GObject o, O.IsDescendantOf Pixbuf o) => IsPixbuf o
instance (SP.GObject o, O.IsDescendantOf Pixbuf o) => IsPixbuf o
instance O.HasParentTypes Pixbuf
type instance O.ParentTypes Pixbuf = '[GObject.Object.Object, Gio.Icon.Icon, Gio.LoadableIcon.LoadableIcon]
toPixbuf :: (MIO.MonadIO m, IsPixbuf o) => o -> m Pixbuf
toPixbuf :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Pixbuf
toPixbuf = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Pixbuf -> m Pixbuf) -> (o -> IO Pixbuf) -> o -> m Pixbuf
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Pixbuf -> Pixbuf) -> o -> IO Pixbuf
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Pixbuf -> Pixbuf
Pixbuf
instance B.GValue.IsGValue (Maybe Pixbuf) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_pixbuf_get_type
gvalueSet_ :: Ptr GValue -> Maybe Pixbuf -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Pixbuf
P.Nothing = Ptr GValue -> Ptr Pixbuf -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Pixbuf
forall a. Ptr a
FP.nullPtr :: FP.Ptr Pixbuf)
gvalueSet_ Ptr GValue
gv (P.Just Pixbuf
obj) = Pixbuf -> (Ptr Pixbuf -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Pixbuf
obj (Ptr GValue -> Ptr Pixbuf -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Pixbuf)
gvalueGet_ Ptr GValue
gv = do
Ptr Pixbuf
ptr <- Ptr GValue -> IO (Ptr Pixbuf)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Pixbuf)
if Ptr Pixbuf
ptr Ptr Pixbuf -> Ptr Pixbuf -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Pixbuf
forall a. Ptr a
FP.nullPtr
then Pixbuf -> Maybe Pixbuf
forall a. a -> Maybe a
P.Just (Pixbuf -> Maybe Pixbuf) -> IO Pixbuf -> IO (Maybe Pixbuf)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf Ptr Pixbuf
ptr
else Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolvePixbufMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolvePixbufMethod "addAlpha" o = PixbufAddAlphaMethodInfo
ResolvePixbufMethod "applyEmbeddedOrientation" o = PixbufApplyEmbeddedOrientationMethodInfo
ResolvePixbufMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePixbufMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePixbufMethod "composite" o = PixbufCompositeMethodInfo
ResolvePixbufMethod "compositeColor" o = PixbufCompositeColorMethodInfo
ResolvePixbufMethod "compositeColorSimple" o = PixbufCompositeColorSimpleMethodInfo
ResolvePixbufMethod "copy" o = PixbufCopyMethodInfo
ResolvePixbufMethod "copyArea" o = PixbufCopyAreaMethodInfo
ResolvePixbufMethod "copyOptions" o = PixbufCopyOptionsMethodInfo
ResolvePixbufMethod "equal" o = Gio.Icon.IconEqualMethodInfo
ResolvePixbufMethod "fill" o = PixbufFillMethodInfo
ResolvePixbufMethod "flip" o = PixbufFlipMethodInfo
ResolvePixbufMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePixbufMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePixbufMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePixbufMethod "hash" o = Gio.Icon.IconHashMethodInfo
ResolvePixbufMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePixbufMethod "load" o = Gio.LoadableIcon.LoadableIconLoadMethodInfo
ResolvePixbufMethod "loadAsync" o = Gio.LoadableIcon.LoadableIconLoadAsyncMethodInfo
ResolvePixbufMethod "loadFinish" o = Gio.LoadableIcon.LoadableIconLoadFinishMethodInfo
ResolvePixbufMethod "newSubpixbuf" o = PixbufNewSubpixbufMethodInfo
ResolvePixbufMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePixbufMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePixbufMethod "readPixelBytes" o = PixbufReadPixelBytesMethodInfo
ResolvePixbufMethod "readPixels" o = PixbufReadPixelsMethodInfo
ResolvePixbufMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePixbufMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePixbufMethod "removeOption" o = PixbufRemoveOptionMethodInfo
ResolvePixbufMethod "rotateSimple" o = PixbufRotateSimpleMethodInfo
ResolvePixbufMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePixbufMethod "saturateAndPixelate" o = PixbufSaturateAndPixelateMethodInfo
ResolvePixbufMethod "saveToBufferv" o = PixbufSaveToBuffervMethodInfo
ResolvePixbufMethod "saveToCallbackv" o = PixbufSaveToCallbackvMethodInfo
ResolvePixbufMethod "saveToStreamv" o = PixbufSaveToStreamvMethodInfo
ResolvePixbufMethod "saveToStreamvAsync" o = PixbufSaveToStreamvAsyncMethodInfo
ResolvePixbufMethod "savev" o = PixbufSavevMethodInfo
ResolvePixbufMethod "scale" o = PixbufScaleMethodInfo
ResolvePixbufMethod "scaleSimple" o = PixbufScaleSimpleMethodInfo
ResolvePixbufMethod "serialize" o = Gio.Icon.IconSerializeMethodInfo
ResolvePixbufMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePixbufMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePixbufMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePixbufMethod "toString" o = Gio.Icon.IconToStringMethodInfo
ResolvePixbufMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePixbufMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePixbufMethod "getBitsPerSample" o = PixbufGetBitsPerSampleMethodInfo
ResolvePixbufMethod "getByteLength" o = PixbufGetByteLengthMethodInfo
ResolvePixbufMethod "getColorspace" o = PixbufGetColorspaceMethodInfo
ResolvePixbufMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePixbufMethod "getHasAlpha" o = PixbufGetHasAlphaMethodInfo
ResolvePixbufMethod "getHeight" o = PixbufGetHeightMethodInfo
ResolvePixbufMethod "getNChannels" o = PixbufGetNChannelsMethodInfo
ResolvePixbufMethod "getOption" o = PixbufGetOptionMethodInfo
ResolvePixbufMethod "getOptions" o = PixbufGetOptionsMethodInfo
ResolvePixbufMethod "getPixels" o = PixbufGetPixelsMethodInfo
ResolvePixbufMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePixbufMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePixbufMethod "getRowstride" o = PixbufGetRowstrideMethodInfo
ResolvePixbufMethod "getWidth" o = PixbufGetWidthMethodInfo
ResolvePixbufMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePixbufMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePixbufMethod "setOption" o = PixbufSetOptionMethodInfo
ResolvePixbufMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePixbufMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePixbufMethod t Pixbuf, O.OverloadedMethod info Pixbuf p) => OL.IsLabel t (Pixbuf -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolvePixbufMethod t Pixbuf, O.OverloadedMethod info Pixbuf p, R.HasField t Pixbuf p) => R.HasField t Pixbuf p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePixbufMethod t Pixbuf, O.OverloadedMethodInfo info Pixbuf) => OL.IsLabel t (O.MethodProxy info Pixbuf) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getPixbufBitsPerSample :: (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufBitsPerSample :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufBitsPerSample o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"bits-per-sample"
constructPixbufBitsPerSample :: (IsPixbuf o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructPixbufBitsPerSample :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructPixbufBitsPerSample Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"bits-per-sample" Int32
val
#if defined(ENABLE_OVERLOADING)
data PixbufBitsPerSamplePropertyInfo
instance AttrInfo PixbufBitsPerSamplePropertyInfo where
type AttrAllowedOps PixbufBitsPerSamplePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufBitsPerSamplePropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufBitsPerSamplePropertyInfo = (~) Int32
type AttrTransferTypeConstraint PixbufBitsPerSamplePropertyInfo = (~) Int32
type AttrTransferType PixbufBitsPerSamplePropertyInfo = Int32
type AttrGetType PixbufBitsPerSamplePropertyInfo = Int32
type AttrLabel PixbufBitsPerSamplePropertyInfo = "bits-per-sample"
type AttrOrigin PixbufBitsPerSamplePropertyInfo = Pixbuf
attrGet = getPixbufBitsPerSample
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufBitsPerSample
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.bitsPerSample"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:bitsPerSample"
})
#endif
getPixbufColorspace :: (MonadIO m, IsPixbuf o) => o -> m GdkPixbuf.Enums.Colorspace
getPixbufColorspace :: forall (m :: * -> *) o.
(MonadIO m, IsPixbuf o) =>
o -> m Colorspace
getPixbufColorspace o
obj = IO Colorspace -> m Colorspace
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Colorspace -> m Colorspace) -> IO Colorspace -> m Colorspace
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Colorspace
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"colorspace"
constructPixbufColorspace :: (IsPixbuf o, MIO.MonadIO m) => GdkPixbuf.Enums.Colorspace -> m (GValueConstruct o)
constructPixbufColorspace :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Colorspace -> m (GValueConstruct o)
constructPixbufColorspace Colorspace
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Colorspace -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"colorspace" Colorspace
val
#if defined(ENABLE_OVERLOADING)
data PixbufColorspacePropertyInfo
instance AttrInfo PixbufColorspacePropertyInfo where
type AttrAllowedOps PixbufColorspacePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufColorspacePropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufColorspacePropertyInfo = (~) GdkPixbuf.Enums.Colorspace
type AttrTransferTypeConstraint PixbufColorspacePropertyInfo = (~) GdkPixbuf.Enums.Colorspace
type AttrTransferType PixbufColorspacePropertyInfo = GdkPixbuf.Enums.Colorspace
type AttrGetType PixbufColorspacePropertyInfo = GdkPixbuf.Enums.Colorspace
type AttrLabel PixbufColorspacePropertyInfo = "colorspace"
type AttrOrigin PixbufColorspacePropertyInfo = Pixbuf
attrGet = getPixbufColorspace
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufColorspace
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.colorspace"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:colorspace"
})
#endif
getPixbufHasAlpha :: (MonadIO m, IsPixbuf o) => o -> m Bool
getPixbufHasAlpha :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Bool
getPixbufHasAlpha o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"has-alpha"
constructPixbufHasAlpha :: (IsPixbuf o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructPixbufHasAlpha :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructPixbufHasAlpha Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"has-alpha" Bool
val
#if defined(ENABLE_OVERLOADING)
data PixbufHasAlphaPropertyInfo
instance AttrInfo PixbufHasAlphaPropertyInfo where
type AttrAllowedOps PixbufHasAlphaPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufHasAlphaPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufHasAlphaPropertyInfo = (~) Bool
type AttrTransferTypeConstraint PixbufHasAlphaPropertyInfo = (~) Bool
type AttrTransferType PixbufHasAlphaPropertyInfo = Bool
type AttrGetType PixbufHasAlphaPropertyInfo = Bool
type AttrLabel PixbufHasAlphaPropertyInfo = "has-alpha"
type AttrOrigin PixbufHasAlphaPropertyInfo = Pixbuf
attrGet = getPixbufHasAlpha
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufHasAlpha
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.hasAlpha"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:hasAlpha"
})
#endif
getPixbufHeight :: (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufHeight :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufHeight o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"height"
constructPixbufHeight :: (IsPixbuf o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructPixbufHeight :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructPixbufHeight Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"height" Int32
val
#if defined(ENABLE_OVERLOADING)
data PixbufHeightPropertyInfo
instance AttrInfo PixbufHeightPropertyInfo where
type AttrAllowedOps PixbufHeightPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufHeightPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufHeightPropertyInfo = (~) Int32
type AttrTransferTypeConstraint PixbufHeightPropertyInfo = (~) Int32
type AttrTransferType PixbufHeightPropertyInfo = Int32
type AttrGetType PixbufHeightPropertyInfo = Int32
type AttrLabel PixbufHeightPropertyInfo = "height"
type AttrOrigin PixbufHeightPropertyInfo = Pixbuf
attrGet = getPixbufHeight
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufHeight
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.height"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:height"
})
#endif
getPixbufNChannels :: (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufNChannels :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufNChannels o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"n-channels"
constructPixbufNChannels :: (IsPixbuf o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructPixbufNChannels :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructPixbufNChannels Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"n-channels" Int32
val
#if defined(ENABLE_OVERLOADING)
data PixbufNChannelsPropertyInfo
instance AttrInfo PixbufNChannelsPropertyInfo where
type AttrAllowedOps PixbufNChannelsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufNChannelsPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufNChannelsPropertyInfo = (~) Int32
type AttrTransferTypeConstraint PixbufNChannelsPropertyInfo = (~) Int32
type AttrTransferType PixbufNChannelsPropertyInfo = Int32
type AttrGetType PixbufNChannelsPropertyInfo = Int32
type AttrLabel PixbufNChannelsPropertyInfo = "n-channels"
type AttrOrigin PixbufNChannelsPropertyInfo = Pixbuf
attrGet = getPixbufNChannels
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufNChannels
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.nChannels"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:nChannels"
})
#endif
getPixbufPixelBytes :: (MonadIO m, IsPixbuf o) => o -> m (Maybe GLib.Bytes.Bytes)
getPixbufPixelBytes :: forall (m :: * -> *) o.
(MonadIO m, IsPixbuf o) =>
o -> m (Maybe Bytes)
getPixbufPixelBytes o
obj = IO (Maybe Bytes) -> m (Maybe Bytes)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Bytes) -> m (Maybe Bytes))
-> IO (Maybe Bytes) -> m (Maybe Bytes)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Bytes -> Bytes) -> IO (Maybe Bytes)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"pixel-bytes" ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes
constructPixbufPixelBytes :: (IsPixbuf o, MIO.MonadIO m) => GLib.Bytes.Bytes -> m (GValueConstruct o)
constructPixbufPixelBytes :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Bytes -> m (GValueConstruct o)
constructPixbufPixelBytes Bytes
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Bytes -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"pixel-bytes" (Bytes -> Maybe Bytes
forall a. a -> Maybe a
P.Just Bytes
val)
#if defined(ENABLE_OVERLOADING)
data PixbufPixelBytesPropertyInfo
instance AttrInfo PixbufPixelBytesPropertyInfo where
type AttrAllowedOps PixbufPixelBytesPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PixbufPixelBytesPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufPixelBytesPropertyInfo = (~) GLib.Bytes.Bytes
type AttrTransferTypeConstraint PixbufPixelBytesPropertyInfo = (~) GLib.Bytes.Bytes
type AttrTransferType PixbufPixelBytesPropertyInfo = GLib.Bytes.Bytes
type AttrGetType PixbufPixelBytesPropertyInfo = (Maybe GLib.Bytes.Bytes)
type AttrLabel PixbufPixelBytesPropertyInfo = "pixel-bytes"
type AttrOrigin PixbufPixelBytesPropertyInfo = Pixbuf
attrGet = getPixbufPixelBytes
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufPixelBytes
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixelBytes"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:pixelBytes"
})
#endif
getPixbufPixels :: (MonadIO m, IsPixbuf o) => o -> m (Ptr ())
getPixbufPixels :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m (Ptr ())
getPixbufPixels o
obj = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
B.Properties.getObjectPropertyPtr o
obj String
"pixels"
constructPixbufPixels :: (IsPixbuf o, MIO.MonadIO m) => Ptr () -> m (GValueConstruct o)
constructPixbufPixels :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Ptr () -> m (GValueConstruct o)
constructPixbufPixels Ptr ()
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyPtr String
"pixels" Ptr ()
val
#if defined(ENABLE_OVERLOADING)
data PixbufPixelsPropertyInfo
instance AttrInfo PixbufPixelsPropertyInfo where
type AttrAllowedOps PixbufPixelsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufPixelsPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufPixelsPropertyInfo = (~) (Ptr ())
type AttrTransferTypeConstraint PixbufPixelsPropertyInfo = (~) (Ptr ())
type AttrTransferType PixbufPixelsPropertyInfo = Ptr ()
type AttrGetType PixbufPixelsPropertyInfo = (Ptr ())
type AttrLabel PixbufPixelsPropertyInfo = "pixels"
type AttrOrigin PixbufPixelsPropertyInfo = Pixbuf
attrGet = getPixbufPixels
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufPixels
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixels"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:pixels"
})
#endif
getPixbufRowstride :: (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufRowstride :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufRowstride o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"rowstride"
constructPixbufRowstride :: (IsPixbuf o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructPixbufRowstride :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructPixbufRowstride Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"rowstride" Int32
val
#if defined(ENABLE_OVERLOADING)
data PixbufRowstridePropertyInfo
instance AttrInfo PixbufRowstridePropertyInfo where
type AttrAllowedOps PixbufRowstridePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufRowstridePropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufRowstridePropertyInfo = (~) Int32
type AttrTransferTypeConstraint PixbufRowstridePropertyInfo = (~) Int32
type AttrTransferType PixbufRowstridePropertyInfo = Int32
type AttrGetType PixbufRowstridePropertyInfo = Int32
type AttrLabel PixbufRowstridePropertyInfo = "rowstride"
type AttrOrigin PixbufRowstridePropertyInfo = Pixbuf
attrGet = getPixbufRowstride
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufRowstride
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.rowstride"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:rowstride"
})
#endif
getPixbufWidth :: (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufWidth :: forall (m :: * -> *) o. (MonadIO m, IsPixbuf o) => o -> m Int32
getPixbufWidth o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"width"
constructPixbufWidth :: (IsPixbuf o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructPixbufWidth :: forall o (m :: * -> *).
(IsPixbuf o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructPixbufWidth Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"width" Int32
val
#if defined(ENABLE_OVERLOADING)
data PixbufWidthPropertyInfo
instance AttrInfo PixbufWidthPropertyInfo where
type AttrAllowedOps PixbufWidthPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PixbufWidthPropertyInfo = IsPixbuf
type AttrSetTypeConstraint PixbufWidthPropertyInfo = (~) Int32
type AttrTransferTypeConstraint PixbufWidthPropertyInfo = (~) Int32
type AttrTransferType PixbufWidthPropertyInfo = Int32
type AttrGetType PixbufWidthPropertyInfo = Int32
type AttrLabel PixbufWidthPropertyInfo = "width"
type AttrOrigin PixbufWidthPropertyInfo = Pixbuf
attrGet = getPixbufWidth
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPixbufWidth
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.width"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#g:attr:width"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Pixbuf
type instance O.AttributeList Pixbuf = PixbufAttributeList
type PixbufAttributeList = ('[ '("bitsPerSample", PixbufBitsPerSamplePropertyInfo), '("colorspace", PixbufColorspacePropertyInfo), '("hasAlpha", PixbufHasAlphaPropertyInfo), '("height", PixbufHeightPropertyInfo), '("nChannels", PixbufNChannelsPropertyInfo), '("pixelBytes", PixbufPixelBytesPropertyInfo), '("pixels", PixbufPixelsPropertyInfo), '("rowstride", PixbufRowstridePropertyInfo), '("width", PixbufWidthPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
pixbufBitsPerSample :: AttrLabelProxy "bitsPerSample"
pixbufBitsPerSample = AttrLabelProxy
pixbufColorspace :: AttrLabelProxy "colorspace"
pixbufColorspace = AttrLabelProxy
pixbufHasAlpha :: AttrLabelProxy "hasAlpha"
pixbufHasAlpha = AttrLabelProxy
pixbufHeight :: AttrLabelProxy "height"
pixbufHeight = AttrLabelProxy
pixbufNChannels :: AttrLabelProxy "nChannels"
pixbufNChannels = AttrLabelProxy
pixbufPixelBytes :: AttrLabelProxy "pixelBytes"
pixbufPixelBytes = AttrLabelProxy
pixbufPixels :: AttrLabelProxy "pixels"
pixbufPixels = AttrLabelProxy
pixbufRowstride :: AttrLabelProxy "rowstride"
pixbufRowstride = AttrLabelProxy
pixbufWidth :: AttrLabelProxy "width"
pixbufWidth = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Pixbuf = PixbufSignalList
type PixbufSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_pixbuf_new" gdk_pixbuf_new ::
CUInt ->
CInt ->
Int32 ->
Int32 ->
Int32 ->
IO (Ptr Pixbuf)
pixbufNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
GdkPixbuf.Enums.Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> m (Maybe Pixbuf)
pixbufNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Colorspace -> Bool -> Int32 -> Int32 -> Int32 -> m (Maybe Pixbuf)
pixbufNew Colorspace
colorspace Bool
hasAlpha Int32
bitsPerSample Int32
width Int32
height = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
let colorspace' :: CUInt
colorspace' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Colorspace -> Int) -> Colorspace -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Colorspace -> Int
forall a. Enum a => a -> Int
fromEnum) Colorspace
colorspace
let hasAlpha' :: CInt
hasAlpha' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
hasAlpha
Ptr Pixbuf
result <- CUInt -> CInt -> Int32 -> Int32 -> Int32 -> IO (Ptr Pixbuf)
gdk_pixbuf_new CUInt
colorspace' CInt
hasAlpha' Int32
bitsPerSample Int32
width Int32
height
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_bytes" gdk_pixbuf_new_from_bytes ::
Ptr GLib.Bytes.Bytes ->
CUInt ->
CInt ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO (Ptr Pixbuf)
pixbufNewFromBytes ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.Bytes.Bytes
-> GdkPixbuf.Enums.Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> Int32
-> m Pixbuf
pixbufNewFromBytes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Bytes
-> Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> Int32
-> m Pixbuf
pixbufNewFromBytes Bytes
data_ Colorspace
colorspace Bool
hasAlpha Int32
bitsPerSample Int32
width Int32
height Int32
rowstride = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
Ptr Bytes
data_' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
data_
let colorspace' :: CUInt
colorspace' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Colorspace -> Int) -> Colorspace -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Colorspace -> Int
forall a. Enum a => a -> Int
fromEnum) Colorspace
colorspace
let hasAlpha' :: CInt
hasAlpha' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
hasAlpha
Ptr Pixbuf
result <- Ptr Bytes
-> CUInt
-> CInt
-> Int32
-> Int32
-> Int32
-> Int32
-> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_bytes Ptr Bytes
data_' CUInt
colorspace' CInt
hasAlpha' Int32
bitsPerSample Int32
width Int32
height Int32
rowstride
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufNewFromBytes" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
data_
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_data" gdk_pixbuf_new_from_data ::
Ptr Word8 ->
CUInt ->
CInt ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
FunPtr GdkPixbuf.Callbacks.C_PixbufDestroyNotify ->
Ptr () ->
IO (Ptr Pixbuf)
pixbufNewFromData ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr Word8
-> GdkPixbuf.Enums.Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> Int32
-> Maybe (GdkPixbuf.Callbacks.PixbufDestroyNotify)
-> m Pixbuf
pixbufNewFromData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr Word8
-> Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> Int32
-> Maybe PixbufDestroyNotify
-> m Pixbuf
pixbufNewFromData Ptr Word8
data_ Colorspace
colorspace Bool
hasAlpha Int32
bitsPerSample Int32
width Int32
height Int32
rowstride Maybe PixbufDestroyNotify
destroyFn = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
let colorspace' :: CUInt
colorspace' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Colorspace -> Int) -> Colorspace -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Colorspace -> Int
forall a. Enum a => a -> Int
fromEnum) Colorspace
colorspace
let hasAlpha' :: CInt
hasAlpha' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
hasAlpha
FunPtr C_PixbufDestroyNotify
maybeDestroyFn <- case Maybe PixbufDestroyNotify
destroyFn of
Maybe PixbufDestroyNotify
Nothing -> FunPtr C_PixbufDestroyNotify -> IO (FunPtr C_PixbufDestroyNotify)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_PixbufDestroyNotify
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just PixbufDestroyNotify
jDestroyFn -> do
Ptr (FunPtr C_PixbufDestroyNotify)
ptrdestroyFn <- IO (Ptr (FunPtr C_PixbufDestroyNotify))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GdkPixbuf.Callbacks.C_PixbufDestroyNotify))
FunPtr C_PixbufDestroyNotify
jDestroyFn' <- C_PixbufDestroyNotify -> IO (FunPtr C_PixbufDestroyNotify)
GdkPixbuf.Callbacks.mk_PixbufDestroyNotify (Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
-> C_PixbufDestroyNotify -> C_PixbufDestroyNotify
GdkPixbuf.Callbacks.wrap_PixbufDestroyNotify (Ptr (FunPtr C_PixbufDestroyNotify)
-> Maybe (Ptr (FunPtr C_PixbufDestroyNotify))
forall a. a -> Maybe a
Just Ptr (FunPtr C_PixbufDestroyNotify)
ptrdestroyFn) (PixbufDestroyNotify -> C_PixbufDestroyNotify
GdkPixbuf.Callbacks.drop_closures_PixbufDestroyNotify PixbufDestroyNotify
jDestroyFn))
Ptr (FunPtr C_PixbufDestroyNotify)
-> FunPtr C_PixbufDestroyNotify -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_PixbufDestroyNotify)
ptrdestroyFn FunPtr C_PixbufDestroyNotify
jDestroyFn'
FunPtr C_PixbufDestroyNotify -> IO (FunPtr C_PixbufDestroyNotify)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_PixbufDestroyNotify
jDestroyFn'
let destroyFnData :: Ptr a
destroyFnData = Ptr a
forall a. Ptr a
nullPtr
Ptr Pixbuf
result <- Ptr Word8
-> CUInt
-> CInt
-> Int32
-> Int32
-> Int32
-> Int32
-> FunPtr C_PixbufDestroyNotify
-> Ptr ()
-> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_data Ptr Word8
data_ CUInt
colorspace' CInt
hasAlpha' Int32
bitsPerSample Int32
width Int32
height Int32
rowstride FunPtr C_PixbufDestroyNotify
maybeDestroyFn Ptr ()
forall a. Ptr a
destroyFnData
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufNewFromData" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_file" gdk_pixbuf_new_from_file ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m (Maybe Pixbuf)
pixbufNewFromFile :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> m (Maybe Pixbuf)
pixbufNewFromFile String
filename = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- String -> IO CString
stringToCString String
filename
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_file CString
filename'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_file_at_scale" gdk_pixbuf_new_from_file_at_scale ::
CString ->
Int32 ->
Int32 ->
CInt ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromFileAtScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> Int32
-> Int32
-> Bool
-> m (Maybe Pixbuf)
pixbufNewFromFileAtScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> Int32 -> Int32 -> Bool -> m (Maybe Pixbuf)
pixbufNewFromFileAtScale String
filename Int32
width Int32
height Bool
preserveAspectRatio = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- String -> IO CString
stringToCString String
filename
let preserveAspectRatio' :: CInt
preserveAspectRatio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
preserveAspectRatio
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ CString
-> Int32 -> Int32 -> CInt -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_file_at_scale CString
filename' Int32
width Int32
height CInt
preserveAspectRatio'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_file_at_size" gdk_pixbuf_new_from_file_at_size ::
CString ->
Int32 ->
Int32 ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromFileAtSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> Int32
-> Int32
-> m (Maybe Pixbuf)
pixbufNewFromFileAtSize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> Int32 -> Int32 -> m (Maybe Pixbuf)
pixbufNewFromFileAtSize String
filename Int32
width Int32
height = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- String -> IO CString
stringToCString String
filename
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ CString -> Int32 -> Int32 -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_file_at_size CString
filename' Int32
width Int32
height
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_inline" gdk_pixbuf_new_from_inline ::
Int32 ->
Ptr Word8 ->
CInt ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
{-# DEPRECATED pixbufNewFromInline ["(Since version 2.32)","Use @GResource@ instead."] #-}
pixbufNewFromInline ::
(B.CallStack.HasCallStack, MonadIO m) =>
ByteString
-> Bool
-> m Pixbuf
pixbufNewFromInline :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> Bool -> m Pixbuf
pixbufNewFromInline ByteString
data_ Bool
copyPixels = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
let dataLength :: Int32
dataLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
data_
Ptr Word8
data_' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
data_
let copyPixels' :: CInt
copyPixels' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
copyPixels
IO Pixbuf -> IO () -> IO Pixbuf
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ Int32 -> Ptr Word8 -> CInt -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_inline Int32
dataLength Ptr Word8
data_' CInt
copyPixels'
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufNewFromInline" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
PixbufDestroyNotify
forall a. Ptr a -> IO ()
freeMem Ptr Word8
data_'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
) (do
PixbufDestroyNotify
forall a. Ptr a -> IO ()
freeMem Ptr Word8
data_'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_resource" gdk_pixbuf_new_from_resource ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromResource ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe Pixbuf)
pixbufNewFromResource :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe Pixbuf)
pixbufNewFromResource Text
resourcePath = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_resource CString
resourcePath'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_resource_at_scale" gdk_pixbuf_new_from_resource_at_scale ::
CString ->
Int32 ->
Int32 ->
CInt ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromResourceAtScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Int32
-> Int32
-> Bool
-> m (Maybe Pixbuf)
pixbufNewFromResourceAtScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Int32 -> Int32 -> Bool -> m (Maybe Pixbuf)
pixbufNewFromResourceAtScale Text
resourcePath Int32
width Int32
height Bool
preserveAspectRatio = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
let preserveAspectRatio' :: CInt
preserveAspectRatio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
preserveAspectRatio
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ CString
-> Int32 -> Int32 -> CInt -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_resource_at_scale CString
resourcePath' Int32
width Int32
height CInt
preserveAspectRatio'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_stream" gdk_pixbuf_new_from_stream ::
Ptr Gio.InputStream.InputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromStream ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (Maybe Pixbuf)
pixbufNewFromStream :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a -> Maybe b -> m (Maybe Pixbuf)
pixbufNewFromStream a
stream Maybe b
cancellable = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ Ptr InputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_stream Ptr InputStream
stream' Ptr Cancellable
maybeCancellable
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_stream_at_scale" gdk_pixbuf_new_from_stream_at_scale ::
Ptr Gio.InputStream.InputStream ->
Int32 ->
Int32 ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromStreamAtScale ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Int32
-> Bool
-> Maybe (b)
-> m (Maybe Pixbuf)
pixbufNewFromStreamAtScale :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a -> Int32 -> Int32 -> Bool -> Maybe b -> m (Maybe Pixbuf)
pixbufNewFromStreamAtScale a
stream Int32
width Int32
height Bool
preserveAspectRatio Maybe b
cancellable = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let preserveAspectRatio' :: CInt
preserveAspectRatio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
preserveAspectRatio
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ Ptr InputStream
-> Int32
-> Int32
-> CInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_stream_at_scale Ptr InputStream
stream' Int32
width Int32
height CInt
preserveAspectRatio' Ptr Cancellable
maybeCancellable
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_stream_finish" gdk_pixbuf_new_from_stream_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Pixbuf)
pixbufNewFromStreamFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m (Maybe Pixbuf)
pixbufNewFromStreamFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m (Maybe Pixbuf)
pixbufNewFromStreamFinish a
asyncResult = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
asyncResult' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asyncResult
IO (Maybe Pixbuf) -> IO () -> IO (Maybe Pixbuf)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Pixbuf
result <- (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr (Ptr GError) -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_stream_finish Ptr AsyncResult
asyncResult'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asyncResult
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_xpm_data" gdk_pixbuf_new_from_xpm_data ::
Ptr CString ->
IO (Ptr Pixbuf)
pixbufNewFromXpmData ::
(B.CallStack.HasCallStack, MonadIO m) =>
[T.Text]
-> m Pixbuf
pixbufNewFromXpmData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
[Text] -> m Pixbuf
pixbufNewFromXpmData [Text]
data_ = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
Ptr CString
data_' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
data_
Ptr Pixbuf
result <- Ptr CString -> IO (Ptr Pixbuf)
gdk_pixbuf_new_from_xpm_data Ptr CString
data_'
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufNewFromXpmData" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
data_'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
data_'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_add_alpha" gdk_pixbuf_add_alpha ::
Ptr Pixbuf ->
CInt ->
Word8 ->
Word8 ->
Word8 ->
IO (Ptr Pixbuf)
pixbufAddAlpha ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Bool
-> Word8
-> Word8
-> Word8
-> m Pixbuf
pixbufAddAlpha :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Bool -> Word8 -> Word8 -> Word8 -> m Pixbuf
pixbufAddAlpha a
pixbuf Bool
substituteColor Word8
r Word8
g Word8
b = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
let substituteColor' :: CInt
substituteColor' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
substituteColor
Ptr Pixbuf
result <- Ptr Pixbuf -> CInt -> Word8 -> Word8 -> Word8 -> IO (Ptr Pixbuf)
gdk_pixbuf_add_alpha Ptr Pixbuf
pixbuf' CInt
substituteColor' Word8
r Word8
g Word8
b
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufAddAlpha" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
data PixbufAddAlphaMethodInfo
instance (signature ~ (Bool -> Word8 -> Word8 -> Word8 -> m Pixbuf), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufAddAlphaMethodInfo a signature where
overloadedMethod = pixbufAddAlpha
instance O.OverloadedMethodInfo PixbufAddAlphaMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufAddAlpha",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufAddAlpha"
})
#endif
foreign import ccall "gdk_pixbuf_apply_embedded_orientation" gdk_pixbuf_apply_embedded_orientation ::
Ptr Pixbuf ->
IO (Ptr Pixbuf)
pixbufApplyEmbeddedOrientation ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m (Maybe Pixbuf)
pixbufApplyEmbeddedOrientation :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m (Maybe Pixbuf)
pixbufApplyEmbeddedOrientation a
src = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
Ptr Pixbuf
result <- Ptr Pixbuf -> IO (Ptr Pixbuf)
gdk_pixbuf_apply_embedded_orientation Ptr Pixbuf
src'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufApplyEmbeddedOrientationMethodInfo
instance (signature ~ (m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufApplyEmbeddedOrientationMethodInfo a signature where
overloadedMethod = pixbufApplyEmbeddedOrientation
instance O.OverloadedMethodInfo PixbufApplyEmbeddedOrientationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufApplyEmbeddedOrientation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufApplyEmbeddedOrientation"
})
#endif
foreign import ccall "gdk_pixbuf_composite" gdk_pixbuf_composite ::
Ptr Pixbuf ->
Ptr Pixbuf ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CUInt ->
Int32 ->
IO ()
pixbufComposite ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> GdkPixbuf.Enums.InterpType
-> Int32
-> m ()
pixbufComposite :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> InterpType
-> Int32
-> m ()
pixbufComposite a
src b
dest Int32
destX Int32
destY Int32
destWidth Int32
destHeight Double
offsetX Double
offsetY Double
scaleX Double
scaleY InterpType
interpType Int32
overallAlpha = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
Ptr Pixbuf
dest' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
let offsetX' :: CDouble
offsetX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetX
let offsetY' :: CDouble
offsetY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetY
let scaleX' :: CDouble
scaleX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleX
let scaleY' :: CDouble
scaleY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleY
let interpType' :: CUInt
interpType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (InterpType -> Int) -> InterpType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum) InterpType
interpType
Ptr Pixbuf
-> Ptr Pixbuf
-> Int32
-> Int32
-> Int32
-> Int32
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CUInt
-> Int32
-> IO ()
gdk_pixbuf_composite Ptr Pixbuf
src' Ptr Pixbuf
dest' Int32
destX Int32
destY Int32
destWidth Int32
destHeight CDouble
offsetX' CDouble
offsetY' CDouble
scaleX' CDouble
scaleY' CUInt
interpType' Int32
overallAlpha
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufCompositeMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> Double -> Double -> Double -> GdkPixbuf.Enums.InterpType -> Int32 -> m ()), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufCompositeMethodInfo a signature where
overloadedMethod = pixbufComposite
instance O.OverloadedMethodInfo PixbufCompositeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufComposite",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufComposite"
})
#endif
foreign import ccall "gdk_pixbuf_composite_color" gdk_pixbuf_composite_color ::
Ptr Pixbuf ->
Ptr Pixbuf ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CUInt ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
Word32 ->
Word32 ->
IO ()
pixbufCompositeColor ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> GdkPixbuf.Enums.InterpType
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> m ()
pixbufCompositeColor :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> InterpType
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> m ()
pixbufCompositeColor a
src b
dest Int32
destX Int32
destY Int32
destWidth Int32
destHeight Double
offsetX Double
offsetY Double
scaleX Double
scaleY InterpType
interpType Int32
overallAlpha Int32
checkX Int32
checkY Int32
checkSize Word32
color1 Word32
color2 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
Ptr Pixbuf
dest' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
let offsetX' :: CDouble
offsetX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetX
let offsetY' :: CDouble
offsetY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetY
let scaleX' :: CDouble
scaleX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleX
let scaleY' :: CDouble
scaleY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleY
let interpType' :: CUInt
interpType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (InterpType -> Int) -> InterpType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum) InterpType
interpType
Ptr Pixbuf
-> Ptr Pixbuf
-> Int32
-> Int32
-> Int32
-> Int32
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CUInt
-> Int32
-> Int32
-> Int32
-> Int32
-> Word32
-> Word32
-> IO ()
gdk_pixbuf_composite_color Ptr Pixbuf
src' Ptr Pixbuf
dest' Int32
destX Int32
destY Int32
destWidth Int32
destHeight CDouble
offsetX' CDouble
offsetY' CDouble
scaleX' CDouble
scaleY' CUInt
interpType' Int32
overallAlpha Int32
checkX Int32
checkY Int32
checkSize Word32
color1 Word32
color2
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufCompositeColorMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> Double -> Double -> Double -> GdkPixbuf.Enums.InterpType -> Int32 -> Int32 -> Int32 -> Int32 -> Word32 -> Word32 -> m ()), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufCompositeColorMethodInfo a signature where
overloadedMethod = pixbufCompositeColor
instance O.OverloadedMethodInfo PixbufCompositeColorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufCompositeColor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufCompositeColor"
})
#endif
foreign import ccall "gdk_pixbuf_composite_color_simple" gdk_pixbuf_composite_color_simple ::
Ptr Pixbuf ->
Int32 ->
Int32 ->
CUInt ->
Int32 ->
Int32 ->
Word32 ->
Word32 ->
IO (Ptr Pixbuf)
pixbufCompositeColorSimple ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Int32
-> Int32
-> GdkPixbuf.Enums.InterpType
-> Int32
-> Int32
-> Word32
-> Word32
-> m (Maybe Pixbuf)
pixbufCompositeColorSimple :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Int32
-> Int32
-> InterpType
-> Int32
-> Int32
-> Word32
-> Word32
-> m (Maybe Pixbuf)
pixbufCompositeColorSimple a
src Int32
destWidth Int32
destHeight InterpType
interpType Int32
overallAlpha Int32
checkSize Word32
color1 Word32
color2 = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
let interpType' :: CUInt
interpType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (InterpType -> Int) -> InterpType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum) InterpType
interpType
Ptr Pixbuf
result <- Ptr Pixbuf
-> Int32
-> Int32
-> CUInt
-> Int32
-> Int32
-> Word32
-> Word32
-> IO (Ptr Pixbuf)
gdk_pixbuf_composite_color_simple Ptr Pixbuf
src' Int32
destWidth Int32
destHeight CUInt
interpType' Int32
overallAlpha Int32
checkSize Word32
color1 Word32
color2
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufCompositeColorSimpleMethodInfo
instance (signature ~ (Int32 -> Int32 -> GdkPixbuf.Enums.InterpType -> Int32 -> Int32 -> Word32 -> Word32 -> m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufCompositeColorSimpleMethodInfo a signature where
overloadedMethod = pixbufCompositeColorSimple
instance O.OverloadedMethodInfo PixbufCompositeColorSimpleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufCompositeColorSimple",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufCompositeColorSimple"
})
#endif
foreign import ccall "gdk_pixbuf_copy" gdk_pixbuf_copy ::
Ptr Pixbuf ->
IO (Ptr Pixbuf)
pixbufCopy ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m (Maybe Pixbuf)
pixbufCopy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m (Maybe Pixbuf)
pixbufCopy a
pixbuf = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr Pixbuf
result <- Ptr Pixbuf -> IO (Ptr Pixbuf)
gdk_pixbuf_copy Ptr Pixbuf
pixbuf'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufCopyMethodInfo
instance (signature ~ (m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufCopyMethodInfo a signature where
overloadedMethod = pixbufCopy
instance O.OverloadedMethodInfo PixbufCopyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufCopy"
})
#endif
foreign import ccall "gdk_pixbuf_copy_area" gdk_pixbuf_copy_area ::
Ptr Pixbuf ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
Ptr Pixbuf ->
Int32 ->
Int32 ->
IO ()
pixbufCopyArea ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> b
-> Int32
-> Int32
-> m ()
pixbufCopyArea :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> Int32 -> Int32 -> Int32 -> Int32 -> b -> Int32 -> Int32 -> m ()
pixbufCopyArea a
srcPixbuf Int32
srcX Int32
srcY Int32
width Int32
height b
destPixbuf Int32
destX Int32
destY = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
srcPixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
srcPixbuf
Ptr Pixbuf
destPixbuf' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
destPixbuf
Ptr Pixbuf
-> Int32
-> Int32
-> Int32
-> Int32
-> Ptr Pixbuf
-> Int32
-> Int32
-> IO ()
gdk_pixbuf_copy_area Ptr Pixbuf
srcPixbuf' Int32
srcX Int32
srcY Int32
width Int32
height Ptr Pixbuf
destPixbuf' Int32
destX Int32
destY
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
srcPixbuf
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
destPixbuf
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufCopyAreaMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> b -> Int32 -> Int32 -> m ()), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufCopyAreaMethodInfo a signature where
overloadedMethod = pixbufCopyArea
instance O.OverloadedMethodInfo PixbufCopyAreaMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufCopyArea",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufCopyArea"
})
#endif
foreign import ccall "gdk_pixbuf_copy_options" gdk_pixbuf_copy_options ::
Ptr Pixbuf ->
Ptr Pixbuf ->
IO CInt
pixbufCopyOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> m Bool
pixbufCopyOptions :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a -> b -> m Bool
pixbufCopyOptions a
srcPixbuf b
destPixbuf = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
srcPixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
srcPixbuf
Ptr Pixbuf
destPixbuf' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
destPixbuf
CInt
result <- Ptr Pixbuf -> Ptr Pixbuf -> IO CInt
gdk_pixbuf_copy_options Ptr Pixbuf
srcPixbuf' Ptr Pixbuf
destPixbuf'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
srcPixbuf
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
destPixbuf
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufCopyOptionsMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufCopyOptionsMethodInfo a signature where
overloadedMethod = pixbufCopyOptions
instance O.OverloadedMethodInfo PixbufCopyOptionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufCopyOptions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufCopyOptions"
})
#endif
foreign import ccall "gdk_pixbuf_fill" gdk_pixbuf_fill ::
Ptr Pixbuf ->
Word32 ->
IO ()
pixbufFill ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Word32
-> m ()
pixbufFill :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Word32 -> m ()
pixbufFill a
pixbuf Word32
pixel = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr Pixbuf -> Word32 -> IO ()
gdk_pixbuf_fill Ptr Pixbuf
pixbuf' Word32
pixel
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufFillMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufFillMethodInfo a signature where
overloadedMethod = pixbufFill
instance O.OverloadedMethodInfo PixbufFillMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufFill",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufFill"
})
#endif
foreign import ccall "gdk_pixbuf_flip" gdk_pixbuf_flip ::
Ptr Pixbuf ->
CInt ->
IO (Ptr Pixbuf)
pixbufFlip ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Bool
-> m (Maybe Pixbuf)
pixbufFlip :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Bool -> m (Maybe Pixbuf)
pixbufFlip a
src Bool
horizontal = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
let horizontal' :: CInt
horizontal' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
horizontal
Ptr Pixbuf
result <- Ptr Pixbuf -> CInt -> IO (Ptr Pixbuf)
gdk_pixbuf_flip Ptr Pixbuf
src' CInt
horizontal'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufFlipMethodInfo
instance (signature ~ (Bool -> m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufFlipMethodInfo a signature where
overloadedMethod = pixbufFlip
instance O.OverloadedMethodInfo PixbufFlipMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufFlip",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufFlip"
})
#endif
foreign import ccall "gdk_pixbuf_get_bits_per_sample" gdk_pixbuf_get_bits_per_sample ::
Ptr Pixbuf ->
IO Int32
pixbufGetBitsPerSample ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Int32
pixbufGetBitsPerSample :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Int32
pixbufGetBitsPerSample a
pixbuf = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Int32
result <- Ptr Pixbuf -> IO Int32
gdk_pixbuf_get_bits_per_sample Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetBitsPerSampleMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetBitsPerSampleMethodInfo a signature where
overloadedMethod = pixbufGetBitsPerSample
instance O.OverloadedMethodInfo PixbufGetBitsPerSampleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetBitsPerSample",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetBitsPerSample"
})
#endif
foreign import ccall "gdk_pixbuf_get_byte_length" gdk_pixbuf_get_byte_length ::
Ptr Pixbuf ->
IO Word64
pixbufGetByteLength ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Word64
pixbufGetByteLength :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Word64
pixbufGetByteLength a
pixbuf = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Word64
result <- Ptr Pixbuf -> IO Word64
gdk_pixbuf_get_byte_length Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetByteLengthMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetByteLengthMethodInfo a signature where
overloadedMethod = pixbufGetByteLength
instance O.OverloadedMethodInfo PixbufGetByteLengthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetByteLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetByteLength"
})
#endif
foreign import ccall "gdk_pixbuf_get_colorspace" gdk_pixbuf_get_colorspace ::
Ptr Pixbuf ->
IO CUInt
pixbufGetColorspace ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m GdkPixbuf.Enums.Colorspace
pixbufGetColorspace :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Colorspace
pixbufGetColorspace a
pixbuf = IO Colorspace -> m Colorspace
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Colorspace -> m Colorspace) -> IO Colorspace -> m Colorspace
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CUInt
result <- Ptr Pixbuf -> IO CUInt
gdk_pixbuf_get_colorspace Ptr Pixbuf
pixbuf'
let result' :: Colorspace
result' = (Int -> Colorspace
forall a. Enum a => Int -> a
toEnum (Int -> Colorspace) -> (CUInt -> Int) -> CUInt -> Colorspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Colorspace -> IO Colorspace
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Colorspace
result'
#if defined(ENABLE_OVERLOADING)
data PixbufGetColorspaceMethodInfo
instance (signature ~ (m GdkPixbuf.Enums.Colorspace), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetColorspaceMethodInfo a signature where
overloadedMethod = pixbufGetColorspace
instance O.OverloadedMethodInfo PixbufGetColorspaceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetColorspace",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetColorspace"
})
#endif
foreign import ccall "gdk_pixbuf_get_has_alpha" gdk_pixbuf_get_has_alpha ::
Ptr Pixbuf ->
IO CInt
pixbufGetHasAlpha ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Bool
pixbufGetHasAlpha :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Bool
pixbufGetHasAlpha a
pixbuf = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CInt
result <- Ptr Pixbuf -> IO CInt
gdk_pixbuf_get_has_alpha Ptr Pixbuf
pixbuf'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufGetHasAlphaMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetHasAlphaMethodInfo a signature where
overloadedMethod = pixbufGetHasAlpha
instance O.OverloadedMethodInfo PixbufGetHasAlphaMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetHasAlpha",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetHasAlpha"
})
#endif
foreign import ccall "gdk_pixbuf_get_height" gdk_pixbuf_get_height ::
Ptr Pixbuf ->
IO Int32
pixbufGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Int32
pixbufGetHeight :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Int32
pixbufGetHeight a
pixbuf = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Int32
result <- Ptr Pixbuf -> IO Int32
gdk_pixbuf_get_height Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetHeightMethodInfo a signature where
overloadedMethod = pixbufGetHeight
instance O.OverloadedMethodInfo PixbufGetHeightMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetHeight"
})
#endif
foreign import ccall "gdk_pixbuf_get_n_channels" gdk_pixbuf_get_n_channels ::
Ptr Pixbuf ->
IO Int32
pixbufGetNChannels ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Int32
pixbufGetNChannels :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Int32
pixbufGetNChannels a
pixbuf = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Int32
result <- Ptr Pixbuf -> IO Int32
gdk_pixbuf_get_n_channels Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetNChannelsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetNChannelsMethodInfo a signature where
overloadedMethod = pixbufGetNChannels
instance O.OverloadedMethodInfo PixbufGetNChannelsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetNChannels",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetNChannels"
})
#endif
foreign import ccall "gdk_pixbuf_get_option" gdk_pixbuf_get_option ::
Ptr Pixbuf ->
CString ->
IO CString
pixbufGetOption ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> T.Text
-> m (Maybe T.Text)
pixbufGetOption :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Text -> m (Maybe Text)
pixbufGetOption a
pixbuf Text
key = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CString
key' <- Text -> IO CString
textToCString Text
key
CString
result <- Ptr Pixbuf -> CString -> IO CString
gdk_pixbuf_get_option Ptr Pixbuf
pixbuf' CString
key'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufGetOptionMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetOptionMethodInfo a signature where
overloadedMethod = pixbufGetOption
instance O.OverloadedMethodInfo PixbufGetOptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetOption",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetOption"
})
#endif
#if defined(ENABLE_OVERLOADING)
data PixbufGetOptionsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "getOptions" Pixbuf) => O.OverloadedMethod PixbufGetOptionsMethodInfo o p where
overloadedMethod = undefined
instance (o ~ O.UnsupportedMethodError "getOptions" Pixbuf) => O.OverloadedMethodInfo PixbufGetOptionsMethodInfo o where
overloadedMethodInfo = undefined
#endif
foreign import ccall "gdk_pixbuf_get_pixels_with_length" gdk_pixbuf_get_pixels_with_length ::
Ptr Pixbuf ->
Ptr Word32 ->
IO (Ptr Word8)
pixbufGetPixels ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m ByteString
pixbufGetPixels :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m ByteString
pixbufGetPixels a
pixbuf = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr Word32
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Word8
result <- Ptr Pixbuf -> Ptr Word32 -> IO (Ptr Word8)
gdk_pixbuf_get_pixels_with_length Ptr Pixbuf
pixbuf' Ptr Word32
length_
Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
Text -> PixbufDestroyNotify
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufGetPixels" Ptr Word8
result
ByteString
result' <- (Word32 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word32
length_') Ptr Word8
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
ByteString -> IO ByteString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result'
#if defined(ENABLE_OVERLOADING)
data PixbufGetPixelsMethodInfo
instance (signature ~ (m ByteString), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetPixelsMethodInfo a signature where
overloadedMethod = pixbufGetPixels
instance O.OverloadedMethodInfo PixbufGetPixelsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetPixels",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetPixels"
})
#endif
foreign import ccall "gdk_pixbuf_get_rowstride" gdk_pixbuf_get_rowstride ::
Ptr Pixbuf ->
IO Int32
pixbufGetRowstride ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Int32
pixbufGetRowstride :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Int32
pixbufGetRowstride a
pixbuf = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Int32
result <- Ptr Pixbuf -> IO Int32
gdk_pixbuf_get_rowstride Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetRowstrideMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetRowstrideMethodInfo a signature where
overloadedMethod = pixbufGetRowstride
instance O.OverloadedMethodInfo PixbufGetRowstrideMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetRowstride",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetRowstride"
})
#endif
foreign import ccall "gdk_pixbuf_get_width" gdk_pixbuf_get_width ::
Ptr Pixbuf ->
IO Int32
pixbufGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Int32
pixbufGetWidth :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Int32
pixbufGetWidth a
pixbuf = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Int32
result <- Ptr Pixbuf -> IO Int32
gdk_pixbuf_get_width Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PixbufGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufGetWidthMethodInfo a signature where
overloadedMethod = pixbufGetWidth
instance O.OverloadedMethodInfo PixbufGetWidthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufGetWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufGetWidth"
})
#endif
foreign import ccall "gdk_pixbuf_new_subpixbuf" gdk_pixbuf_new_subpixbuf ::
Ptr Pixbuf ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO (Ptr Pixbuf)
pixbufNewSubpixbuf ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> m Pixbuf
pixbufNewSubpixbuf :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Int32 -> Int32 -> Int32 -> Int32 -> m Pixbuf
pixbufNewSubpixbuf a
srcPixbuf Int32
srcX Int32
srcY Int32
width Int32
height = IO Pixbuf -> m Pixbuf
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Pixbuf -> m Pixbuf) -> IO Pixbuf -> m Pixbuf
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
srcPixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
srcPixbuf
Ptr Pixbuf
result <- Ptr Pixbuf -> Int32 -> Int32 -> Int32 -> Int32 -> IO (Ptr Pixbuf)
gdk_pixbuf_new_subpixbuf Ptr Pixbuf
srcPixbuf' Int32
srcX Int32
srcY Int32
width Int32
height
Text -> Ptr Pixbuf -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufNewSubpixbuf" Ptr Pixbuf
result
Pixbuf
result' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
srcPixbuf
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result'
#if defined(ENABLE_OVERLOADING)
data PixbufNewSubpixbufMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m Pixbuf), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufNewSubpixbufMethodInfo a signature where
overloadedMethod = pixbufNewSubpixbuf
instance O.OverloadedMethodInfo PixbufNewSubpixbufMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufNewSubpixbuf",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufNewSubpixbuf"
})
#endif
foreign import ccall "gdk_pixbuf_read_pixel_bytes" gdk_pixbuf_read_pixel_bytes ::
Ptr Pixbuf ->
IO (Ptr GLib.Bytes.Bytes)
pixbufReadPixelBytes ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m GLib.Bytes.Bytes
pixbufReadPixelBytes :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Bytes
pixbufReadPixelBytes a
pixbuf = IO Bytes -> m Bytes
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr Bytes
result <- Ptr Pixbuf -> IO (Ptr Bytes)
gdk_pixbuf_read_pixel_bytes Ptr Pixbuf
pixbuf'
Text -> Ptr Bytes -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"pixbufReadPixelBytes" Ptr Bytes
result
Bytes
result' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Bytes -> IO Bytes
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bytes
result'
#if defined(ENABLE_OVERLOADING)
data PixbufReadPixelBytesMethodInfo
instance (signature ~ (m GLib.Bytes.Bytes), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufReadPixelBytesMethodInfo a signature where
overloadedMethod = pixbufReadPixelBytes
instance O.OverloadedMethodInfo PixbufReadPixelBytesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufReadPixelBytes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufReadPixelBytes"
})
#endif
foreign import ccall "gdk_pixbuf_read_pixels" gdk_pixbuf_read_pixels ::
Ptr Pixbuf ->
IO Word8
pixbufReadPixels ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> m Word8
pixbufReadPixels :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> m Word8
pixbufReadPixels a
pixbuf = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Word8
result <- Ptr Pixbuf -> IO Word8
gdk_pixbuf_read_pixels Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Word8 -> IO Word8
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result
#if defined(ENABLE_OVERLOADING)
data PixbufReadPixelsMethodInfo
instance (signature ~ (m Word8), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufReadPixelsMethodInfo a signature where
overloadedMethod = pixbufReadPixels
instance O.OverloadedMethodInfo PixbufReadPixelsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufReadPixels",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufReadPixels"
})
#endif
foreign import ccall "gdk_pixbuf_remove_option" gdk_pixbuf_remove_option ::
Ptr Pixbuf ->
CString ->
IO CInt
pixbufRemoveOption ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> T.Text
-> m Bool
pixbufRemoveOption :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Text -> m Bool
pixbufRemoveOption a
pixbuf Text
key = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CString
key' <- Text -> IO CString
textToCString Text
key
CInt
result <- Ptr Pixbuf -> CString -> IO CInt
gdk_pixbuf_remove_option Ptr Pixbuf
pixbuf' CString
key'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufRemoveOptionMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufRemoveOptionMethodInfo a signature where
overloadedMethod = pixbufRemoveOption
instance O.OverloadedMethodInfo PixbufRemoveOptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufRemoveOption",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufRemoveOption"
})
#endif
foreign import ccall "gdk_pixbuf_rotate_simple" gdk_pixbuf_rotate_simple ::
Ptr Pixbuf ->
CUInt ->
IO (Ptr Pixbuf)
pixbufRotateSimple ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> GdkPixbuf.Enums.PixbufRotation
-> m (Maybe Pixbuf)
pixbufRotateSimple :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> PixbufRotation -> m (Maybe Pixbuf)
pixbufRotateSimple a
src PixbufRotation
angle = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
let angle' :: CUInt
angle' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (PixbufRotation -> Int) -> PixbufRotation -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PixbufRotation -> Int
forall a. Enum a => a -> Int
fromEnum) PixbufRotation
angle
Ptr Pixbuf
result <- Ptr Pixbuf -> CUInt -> IO (Ptr Pixbuf)
gdk_pixbuf_rotate_simple Ptr Pixbuf
src' CUInt
angle'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufRotateSimpleMethodInfo
instance (signature ~ (GdkPixbuf.Enums.PixbufRotation -> m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufRotateSimpleMethodInfo a signature where
overloadedMethod = pixbufRotateSimple
instance O.OverloadedMethodInfo PixbufRotateSimpleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufRotateSimple",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufRotateSimple"
})
#endif
foreign import ccall "gdk_pixbuf_saturate_and_pixelate" gdk_pixbuf_saturate_and_pixelate ::
Ptr Pixbuf ->
Ptr Pixbuf ->
CFloat ->
CInt ->
IO ()
pixbufSaturateAndPixelate ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Float
-> Bool
-> m ()
pixbufSaturateAndPixelate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a -> b -> Float -> Bool -> m ()
pixbufSaturateAndPixelate a
src b
dest Float
saturation Bool
pixelate = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
Ptr Pixbuf
dest' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
let saturation' :: CFloat
saturation' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
saturation
let pixelate' :: CInt
pixelate' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
pixelate
Ptr Pixbuf -> Ptr Pixbuf -> CFloat -> CInt -> IO ()
gdk_pixbuf_saturate_and_pixelate Ptr Pixbuf
src' Ptr Pixbuf
dest' CFloat
saturation' CInt
pixelate'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufSaturateAndPixelateMethodInfo
instance (signature ~ (b -> Float -> Bool -> m ()), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufSaturateAndPixelateMethodInfo a signature where
overloadedMethod = pixbufSaturateAndPixelate
instance O.OverloadedMethodInfo PixbufSaturateAndPixelateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSaturateAndPixelate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSaturateAndPixelate"
})
#endif
foreign import ccall "gdk_pixbuf_save_to_bufferv" gdk_pixbuf_save_to_bufferv ::
Ptr Pixbuf ->
Ptr (Ptr Word8) ->
Ptr Word64 ->
CString ->
Ptr CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
pixbufSaveToBufferv ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> T.Text
-> Maybe ([T.Text])
-> Maybe ([T.Text])
-> m (ByteString)
pixbufSaveToBufferv :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Text -> Maybe [Text] -> Maybe [Text] -> m ByteString
pixbufSaveToBufferv a
pixbuf Text
type_ Maybe [Text]
optionKeys Maybe [Text]
optionValues = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr (Ptr Word8)
buffer <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word8))
Ptr Word64
bufferSize <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
CString
type_' <- Text -> IO CString
textToCString Text
type_
Ptr CString
maybeOptionKeys <- case Maybe [Text]
optionKeys of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionKeys -> do
Ptr CString
jOptionKeys' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionKeys
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionKeys'
Ptr CString
maybeOptionValues <- case Maybe [Text]
optionValues of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionValues -> do
Ptr CString
jOptionValues' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionValues
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionValues'
IO ByteString -> IO () -> IO ByteString
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Pixbuf
-> Ptr (Ptr Word8)
-> Ptr Word64
-> CString
-> Ptr CString
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
gdk_pixbuf_save_to_bufferv Ptr Pixbuf
pixbuf' Ptr (Ptr Word8)
buffer Ptr Word64
bufferSize CString
type_' Ptr CString
maybeOptionKeys Ptr CString
maybeOptionValues
Word64
bufferSize' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
bufferSize
Ptr Word8
buffer' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
buffer
ByteString
buffer'' <- (Word64 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word64
bufferSize') Ptr Word8
buffer'
PixbufDestroyNotify
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buffer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
buffer
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
bufferSize
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
ByteString -> IO ByteString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
buffer''
) (do
Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
buffer
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
bufferSize
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
)
#if defined(ENABLE_OVERLOADING)
data PixbufSaveToBuffervMethodInfo
instance (signature ~ (T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> m (ByteString)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufSaveToBuffervMethodInfo a signature where
overloadedMethod = pixbufSaveToBufferv
instance O.OverloadedMethodInfo PixbufSaveToBuffervMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSaveToBufferv",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSaveToBufferv"
})
#endif
foreign import ccall "gdk_pixbuf_save_to_callbackv" gdk_pixbuf_save_to_callbackv ::
Ptr Pixbuf ->
FunPtr GdkPixbuf.Callbacks.C_PixbufSaveFunc ->
Ptr () ->
CString ->
Ptr CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
pixbufSaveToCallbackv ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> GdkPixbuf.Callbacks.PixbufSaveFunc
-> T.Text
-> Maybe ([T.Text])
-> Maybe ([T.Text])
-> m ()
pixbufSaveToCallbackv :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> PixbufSaveFunc -> Text -> Maybe [Text] -> Maybe [Text] -> m ()
pixbufSaveToCallbackv a
pixbuf PixbufSaveFunc
saveFunc Text
type_ Maybe [Text]
optionKeys Maybe [Text]
optionValues = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
FunPtr C_PixbufSaveFunc
saveFunc' <- C_PixbufSaveFunc -> IO (FunPtr C_PixbufSaveFunc)
GdkPixbuf.Callbacks.mk_PixbufSaveFunc (Maybe (Ptr (FunPtr C_PixbufSaveFunc))
-> PixbufSaveFunc_WithClosures -> C_PixbufSaveFunc
GdkPixbuf.Callbacks.wrap_PixbufSaveFunc Maybe (Ptr (FunPtr C_PixbufSaveFunc))
forall a. Maybe a
Nothing (PixbufSaveFunc -> PixbufSaveFunc_WithClosures
GdkPixbuf.Callbacks.drop_closures_PixbufSaveFunc PixbufSaveFunc
saveFunc))
CString
type_' <- Text -> IO CString
textToCString Text
type_
Ptr CString
maybeOptionKeys <- case Maybe [Text]
optionKeys of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionKeys -> do
Ptr CString
jOptionKeys' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionKeys
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionKeys'
Ptr CString
maybeOptionValues <- case Maybe [Text]
optionValues of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionValues -> do
Ptr CString
jOptionValues' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionValues
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionValues'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Pixbuf
-> FunPtr C_PixbufSaveFunc
-> Ptr ()
-> CString
-> Ptr CString
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
gdk_pixbuf_save_to_callbackv Ptr Pixbuf
pixbuf' FunPtr C_PixbufSaveFunc
saveFunc' Ptr ()
forall a. Ptr a
userData CString
type_' Ptr CString
maybeOptionKeys Ptr CString
maybeOptionValues
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_PixbufSaveFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_PixbufSaveFunc
saveFunc'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_PixbufSaveFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_PixbufSaveFunc
saveFunc'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
)
#if defined(ENABLE_OVERLOADING)
data PixbufSaveToCallbackvMethodInfo
instance (signature ~ (GdkPixbuf.Callbacks.PixbufSaveFunc -> T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> m ()), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufSaveToCallbackvMethodInfo a signature where
overloadedMethod = pixbufSaveToCallbackv
instance O.OverloadedMethodInfo PixbufSaveToCallbackvMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSaveToCallbackv",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSaveToCallbackv"
})
#endif
foreign import ccall "gdk_pixbuf_save_to_streamv" gdk_pixbuf_save_to_streamv ::
Ptr Pixbuf ->
Ptr Gio.OutputStream.OutputStream ->
CString ->
Ptr CString ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
pixbufSaveToStreamv ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> T.Text
-> Maybe ([T.Text])
-> Maybe ([T.Text])
-> Maybe (c)
-> m ()
pixbufSaveToStreamv :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsPixbuf a, IsOutputStream b,
IsCancellable c) =>
a -> b -> Text -> Maybe [Text] -> Maybe [Text] -> Maybe c -> m ()
pixbufSaveToStreamv a
pixbuf b
stream Text
type_ Maybe [Text]
optionKeys Maybe [Text]
optionValues Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr OutputStream
stream' <- b -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
stream
CString
type_' <- Text -> IO CString
textToCString Text
type_
Ptr CString
maybeOptionKeys <- case Maybe [Text]
optionKeys of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionKeys -> do
Ptr CString
jOptionKeys' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionKeys
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionKeys'
Ptr CString
maybeOptionValues <- case Maybe [Text]
optionValues of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionValues -> do
Ptr CString
jOptionValues' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionValues
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionValues'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Pixbuf
-> Ptr OutputStream
-> CString
-> Ptr CString
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
gdk_pixbuf_save_to_streamv Ptr Pixbuf
pixbuf' Ptr OutputStream
stream' CString
type_' Ptr CString
maybeOptionKeys Ptr CString
maybeOptionValues Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
stream
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
)
#if defined(ENABLE_OVERLOADING)
data PixbufSaveToStreamvMethodInfo
instance (signature ~ (b -> T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> Maybe (c) -> m ()), MonadIO m, IsPixbuf a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod PixbufSaveToStreamvMethodInfo a signature where
overloadedMethod = pixbufSaveToStreamv
instance O.OverloadedMethodInfo PixbufSaveToStreamvMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSaveToStreamv",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSaveToStreamv"
})
#endif
foreign import ccall "gdk_pixbuf_save_to_streamv_async" gdk_pixbuf_save_to_streamv_async ::
Ptr Pixbuf ->
Ptr Gio.OutputStream.OutputStream ->
CString ->
Ptr CString ->
Ptr CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
pixbufSaveToStreamvAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> T.Text
-> Maybe ([T.Text])
-> Maybe ([T.Text])
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufSaveToStreamvAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsPixbuf a, IsOutputStream b,
IsCancellable c) =>
a
-> b
-> Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
pixbufSaveToStreamvAsync a
pixbuf b
stream Text
type_ Maybe [Text]
optionKeys Maybe [Text]
optionValues Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
Ptr OutputStream
stream' <- b -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
stream
CString
type_' <- Text -> IO CString
textToCString Text
type_
Ptr CString
maybeOptionKeys <- case Maybe [Text]
optionKeys of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionKeys -> do
Ptr CString
jOptionKeys' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionKeys
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionKeys'
Ptr CString
maybeOptionValues <- case Maybe [Text]
optionValues of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionValues -> do
Ptr CString
jOptionValues' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionValues
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionValues'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Pixbuf
-> Ptr OutputStream
-> CString
-> Ptr CString
-> Ptr CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_pixbuf_save_to_streamv_async Ptr Pixbuf
pixbuf' Ptr OutputStream
stream' CString
type_' Ptr CString
maybeOptionKeys Ptr CString
maybeOptionValues Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
stream
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufSaveToStreamvAsyncMethodInfo
instance (signature ~ (b -> T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsPixbuf a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod PixbufSaveToStreamvAsyncMethodInfo a signature where
overloadedMethod = pixbufSaveToStreamvAsync
instance O.OverloadedMethodInfo PixbufSaveToStreamvAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSaveToStreamvAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSaveToStreamvAsync"
})
#endif
foreign import ccall "gdk_pixbuf_savev" gdk_pixbuf_savev ::
Ptr Pixbuf ->
CString ->
CString ->
Ptr CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO CInt
pixbufSavev ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> [Char]
-> T.Text
-> Maybe ([T.Text])
-> Maybe ([T.Text])
-> m ()
pixbufSavev :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> String -> Text -> Maybe [Text] -> Maybe [Text] -> m ()
pixbufSavev a
pixbuf String
filename Text
type_ Maybe [Text]
optionKeys Maybe [Text]
optionValues = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CString
filename' <- String -> IO CString
stringToCString String
filename
CString
type_' <- Text -> IO CString
textToCString Text
type_
Ptr CString
maybeOptionKeys <- case Maybe [Text]
optionKeys of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionKeys -> do
Ptr CString
jOptionKeys' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionKeys
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionKeys'
Ptr CString
maybeOptionValues <- case Maybe [Text]
optionValues of
Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
Just [Text]
jOptionValues -> do
Ptr CString
jOptionValues' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jOptionValues
Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jOptionValues'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Pixbuf
-> CString
-> CString
-> Ptr CString
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
gdk_pixbuf_savev Ptr Pixbuf
pixbuf' CString
filename' CString
type_' Ptr CString
maybeOptionKeys Ptr CString
maybeOptionValues
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
type_'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionKeys
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeOptionValues
)
#if defined(ENABLE_OVERLOADING)
data PixbufSavevMethodInfo
instance (signature ~ ([Char] -> T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> m ()), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufSavevMethodInfo a signature where
overloadedMethod = pixbufSavev
instance O.OverloadedMethodInfo PixbufSavevMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSavev",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSavev"
})
#endif
foreign import ccall "gdk_pixbuf_scale" gdk_pixbuf_scale ::
Ptr Pixbuf ->
Ptr Pixbuf ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CUInt ->
IO ()
pixbufScale ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> GdkPixbuf.Enums.InterpType
-> m ()
pixbufScale :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPixbuf a, IsPixbuf b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> Double
-> Double
-> Double
-> InterpType
-> m ()
pixbufScale a
src b
dest Int32
destX Int32
destY Int32
destWidth Int32
destHeight Double
offsetX Double
offsetY Double
scaleX Double
scaleY InterpType
interpType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
Ptr Pixbuf
dest' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
dest
let offsetX' :: CDouble
offsetX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetX
let offsetY' :: CDouble
offsetY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
offsetY
let scaleX' :: CDouble
scaleX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleX
let scaleY' :: CDouble
scaleY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
scaleY
let interpType' :: CUInt
interpType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (InterpType -> Int) -> InterpType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum) InterpType
interpType
Ptr Pixbuf
-> Ptr Pixbuf
-> Int32
-> Int32
-> Int32
-> Int32
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CUInt
-> IO ()
gdk_pixbuf_scale Ptr Pixbuf
src' Ptr Pixbuf
dest' Int32
destX Int32
destY Int32
destWidth Int32
destHeight CDouble
offsetX' CDouble
offsetY' CDouble
scaleX' CDouble
scaleY' CUInt
interpType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
dest
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data PixbufScaleMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> Double -> Double -> Double -> GdkPixbuf.Enums.InterpType -> m ()), MonadIO m, IsPixbuf a, IsPixbuf b) => O.OverloadedMethod PixbufScaleMethodInfo a signature where
overloadedMethod = pixbufScale
instance O.OverloadedMethodInfo PixbufScaleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufScale"
})
#endif
foreign import ccall "gdk_pixbuf_scale_simple" gdk_pixbuf_scale_simple ::
Ptr Pixbuf ->
Int32 ->
Int32 ->
CUInt ->
IO (Ptr Pixbuf)
pixbufScaleSimple ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> Int32
-> Int32
-> GdkPixbuf.Enums.InterpType
-> m (Maybe Pixbuf)
pixbufScaleSimple :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Int32 -> Int32 -> InterpType -> m (Maybe Pixbuf)
pixbufScaleSimple a
src Int32
destWidth Int32
destHeight InterpType
interpType = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
src' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
let interpType' :: CUInt
interpType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (InterpType -> Int) -> InterpType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum) InterpType
interpType
Ptr Pixbuf
result <- Ptr Pixbuf -> Int32 -> Int32 -> CUInt -> IO (Ptr Pixbuf)
gdk_pixbuf_scale_simple Ptr Pixbuf
src' Int32
destWidth Int32
destHeight CUInt
interpType'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data PixbufScaleSimpleMethodInfo
instance (signature ~ (Int32 -> Int32 -> GdkPixbuf.Enums.InterpType -> m (Maybe Pixbuf)), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufScaleSimpleMethodInfo a signature where
overloadedMethod = pixbufScaleSimple
instance O.OverloadedMethodInfo PixbufScaleSimpleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufScaleSimple",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufScaleSimple"
})
#endif
foreign import ccall "gdk_pixbuf_set_option" gdk_pixbuf_set_option ::
Ptr Pixbuf ->
CString ->
CString ->
IO CInt
pixbufSetOption ::
(B.CallStack.HasCallStack, MonadIO m, IsPixbuf a) =>
a
-> T.Text
-> T.Text
-> m Bool
pixbufSetOption :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
a -> Text -> Text -> m Bool
pixbufSetOption a
pixbuf Text
key Text
value = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Pixbuf
pixbuf' <- a -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pixbuf
CString
key' <- Text -> IO CString
textToCString Text
key
CString
value' <- Text -> IO CString
textToCString Text
value
CInt
result <- Ptr Pixbuf -> CString -> CString -> IO CInt
gdk_pixbuf_set_option Ptr Pixbuf
pixbuf' CString
key' CString
value'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pixbuf
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PixbufSetOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> m Bool), MonadIO m, IsPixbuf a) => O.OverloadedMethod PixbufSetOptionMethodInfo a signature where
overloadedMethod = pixbufSetOption
instance O.OverloadedMethodInfo PixbufSetOptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GdkPixbuf.Objects.Pixbuf.pixbufSetOption",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.31/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufSetOption"
})
#endif
foreign import ccall "gdk_pixbuf_calculate_rowstride" gdk_pixbuf_calculate_rowstride ::
CUInt ->
CInt ->
Int32 ->
Int32 ->
Int32 ->
IO Int32
pixbufCalculateRowstride ::
(B.CallStack.HasCallStack, MonadIO m) =>
GdkPixbuf.Enums.Colorspace
-> Bool
-> Int32
-> Int32
-> Int32
-> m Int32
pixbufCalculateRowstride :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Colorspace -> Bool -> Int32 -> Int32 -> Int32 -> m Int32
pixbufCalculateRowstride Colorspace
colorspace Bool
hasAlpha Int32
bitsPerSample Int32
width Int32
height = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
let colorspace' :: CUInt
colorspace' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Colorspace -> Int) -> Colorspace -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Colorspace -> Int
forall a. Enum a => a -> Int
fromEnum) Colorspace
colorspace
let hasAlpha' :: CInt
hasAlpha' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
hasAlpha
Int32
result <- CUInt -> CInt -> Int32 -> Int32 -> Int32 -> IO Int32
gdk_pixbuf_calculate_rowstride CUInt
colorspace' CInt
hasAlpha' Int32
bitsPerSample Int32
width Int32
height
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_get_file_info" gdk_pixbuf_get_file_info ::
CString ->
Ptr Int32 ->
Ptr Int32 ->
IO (Ptr GdkPixbuf.PixbufFormat.PixbufFormat)
pixbufGetFileInfo ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m ((Maybe GdkPixbuf.PixbufFormat.PixbufFormat, Int32, Int32))
pixbufGetFileInfo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> m (Maybe PixbufFormat, Int32, Int32)
pixbufGetFileInfo String
filename = IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32))
-> IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- String -> IO CString
stringToCString String
filename
Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr PixbufFormat
result <- CString -> Ptr Int32 -> Ptr Int32 -> IO (Ptr PixbufFormat)
gdk_pixbuf_get_file_info CString
filename' Ptr Int32
width Ptr Int32
height
Maybe PixbufFormat
maybeResult <- Ptr PixbufFormat
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PixbufFormat
result ((Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat))
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. (a -> b) -> a -> b
$ \Ptr PixbufFormat
result' -> do
PixbufFormat
result'' <- ((ManagedPtr PixbufFormat -> PixbufFormat)
-> Ptr PixbufFormat -> IO PixbufFormat
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr PixbufFormat -> PixbufFormat
GdkPixbuf.PixbufFormat.PixbufFormat) Ptr PixbufFormat
result'
PixbufFormat -> IO PixbufFormat
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufFormat
result''
Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
(Maybe PixbufFormat, Int32, Int32)
-> IO (Maybe PixbufFormat, Int32, Int32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe PixbufFormat
maybeResult, Int32
width', Int32
height')
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_get_file_info_async" gdk_pixbuf_get_file_info_async ::
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
pixbufGetFileInfoAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
[Char]
-> Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufGetFileInfoAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
String -> Maybe a -> Maybe AsyncReadyCallback -> m ()
pixbufGetFileInfoAsync String
filename Maybe a
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- String -> IO CString
stringToCString String
filename
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just a
jCancellable -> do
Ptr Cancellable
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_pixbuf_get_file_info_async CString
filename' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_get_file_info_finish" gdk_pixbuf_get_file_info_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Int32 ->
Ptr Int32 ->
Ptr (Ptr GError) ->
IO (Ptr GdkPixbuf.PixbufFormat.PixbufFormat)
pixbufGetFileInfoFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m ((Maybe GdkPixbuf.PixbufFormat.PixbufFormat, Int32, Int32))
pixbufGetFileInfoFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m (Maybe PixbufFormat, Int32, Int32)
pixbufGetFileInfoFinish a
asyncResult = IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32))
-> IO (Maybe PixbufFormat, Int32, Int32)
-> m (Maybe PixbufFormat, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
asyncResult' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asyncResult
Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
IO (Maybe PixbufFormat, Int32, Int32)
-> IO () -> IO (Maybe PixbufFormat, Int32, Int32)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr PixbufFormat
result <- (Ptr (Ptr GError) -> IO (Ptr PixbufFormat))
-> IO (Ptr PixbufFormat)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr PixbufFormat))
-> IO (Ptr PixbufFormat))
-> (Ptr (Ptr GError) -> IO (Ptr PixbufFormat))
-> IO (Ptr PixbufFormat)
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult
-> Ptr Int32
-> Ptr Int32
-> Ptr (Ptr GError)
-> IO (Ptr PixbufFormat)
gdk_pixbuf_get_file_info_finish Ptr AsyncResult
asyncResult' Ptr Int32
width Ptr Int32
height
Maybe PixbufFormat
maybeResult <- Ptr PixbufFormat
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PixbufFormat
result ((Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat))
-> (Ptr PixbufFormat -> IO PixbufFormat) -> IO (Maybe PixbufFormat)
forall a b. (a -> b) -> a -> b
$ \Ptr PixbufFormat
result' -> do
PixbufFormat
result'' <- ((ManagedPtr PixbufFormat -> PixbufFormat)
-> Ptr PixbufFormat -> IO PixbufFormat
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr PixbufFormat -> PixbufFormat
GdkPixbuf.PixbufFormat.PixbufFormat) Ptr PixbufFormat
result'
PixbufFormat -> IO PixbufFormat
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PixbufFormat
result''
Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asyncResult
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
(Maybe PixbufFormat, Int32, Int32)
-> IO (Maybe PixbufFormat, Int32, Int32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe PixbufFormat
maybeResult, Int32
width', Int32
height')
) (do
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_get_formats" gdk_pixbuf_get_formats ::
IO (Ptr (GSList (Ptr GdkPixbuf.PixbufFormat.PixbufFormat)))
pixbufGetFormats ::
(B.CallStack.HasCallStack, MonadIO m) =>
m [GdkPixbuf.PixbufFormat.PixbufFormat]
pixbufGetFormats :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [PixbufFormat]
pixbufGetFormats = IO [PixbufFormat] -> m [PixbufFormat]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PixbufFormat] -> m [PixbufFormat])
-> IO [PixbufFormat] -> m [PixbufFormat]
forall a b. (a -> b) -> a -> b
$ do
Ptr (GSList (Ptr PixbufFormat))
result <- IO (Ptr (GSList (Ptr PixbufFormat)))
gdk_pixbuf_get_formats
[Ptr PixbufFormat]
result' <- Ptr (GSList (Ptr PixbufFormat)) -> IO [Ptr PixbufFormat]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr PixbufFormat))
result
[PixbufFormat]
result'' <- (Ptr PixbufFormat -> IO PixbufFormat)
-> [Ptr PixbufFormat] -> IO [PixbufFormat]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr PixbufFormat -> PixbufFormat)
-> Ptr PixbufFormat -> IO PixbufFormat
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr PixbufFormat -> PixbufFormat
GdkPixbuf.PixbufFormat.PixbufFormat) [Ptr PixbufFormat]
result'
Ptr (GSList (Ptr PixbufFormat)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr PixbufFormat))
result
[PixbufFormat] -> IO [PixbufFormat]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [PixbufFormat]
result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_init_modules" gdk_pixbuf_init_modules ::
CString ->
Ptr (Ptr GError) ->
IO CInt
pixbufInitModules ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
pixbufInitModules :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
pixbufInitModules Text
path = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
path' <- Text -> IO CString
textToCString Text
path
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO CInt
gdk_pixbuf_init_modules CString
path'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_stream_async" gdk_pixbuf_new_from_stream_async ::
Ptr Gio.InputStream.InputStream ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
pixbufNewFromStreamAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufNewFromStreamAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
pixbufNewFromStreamAsync a
stream Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr InputStream
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_pixbuf_new_from_stream_async Ptr InputStream
stream' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_new_from_stream_at_scale_async" gdk_pixbuf_new_from_stream_at_scale_async ::
Ptr Gio.InputStream.InputStream ->
Int32 ->
Int32 ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
pixbufNewFromStreamAtScaleAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Int32
-> Bool
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
pixbufNewFromStreamAtScaleAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) =>
a
-> Int32
-> Int32
-> Bool
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
pixbufNewFromStreamAtScaleAsync a
stream Int32
width Int32
height Bool
preserveAspectRatio Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr InputStream
stream' <- a -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let preserveAspectRatio' :: CInt
preserveAspectRatio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
preserveAspectRatio
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr InputStream
-> Int32
-> Int32
-> CInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_pixbuf_new_from_stream_at_scale_async Ptr InputStream
stream' Int32
width Int32
height CInt
preserveAspectRatio' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_pixbuf_save_to_stream_finish" gdk_pixbuf_save_to_stream_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
pixbufSaveToStreamFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m ()
pixbufSaveToStreamFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m ()
pixbufSaveToStreamFinish a
asyncResult = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
asyncResult' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asyncResult
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gdk_pixbuf_save_to_stream_finish Ptr AsyncResult
asyncResult'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asyncResult
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif