{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Interfaces.Paintable
(
Paintable(..) ,
IsPaintable ,
toPaintable ,
#if defined(ENABLE_OVERLOADING)
ResolvePaintableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PaintableComputeConcreteSizeMethodInfo ,
#endif
paintableComputeConcreteSize ,
#if defined(ENABLE_OVERLOADING)
PaintableGetCurrentImageMethodInfo ,
#endif
paintableGetCurrentImage ,
#if defined(ENABLE_OVERLOADING)
PaintableGetFlagsMethodInfo ,
#endif
paintableGetFlags ,
#if defined(ENABLE_OVERLOADING)
PaintableGetIntrinsicAspectRatioMethodInfo,
#endif
paintableGetIntrinsicAspectRatio ,
#if defined(ENABLE_OVERLOADING)
PaintableGetIntrinsicHeightMethodInfo ,
#endif
paintableGetIntrinsicHeight ,
#if defined(ENABLE_OVERLOADING)
PaintableGetIntrinsicWidthMethodInfo ,
#endif
paintableGetIntrinsicWidth ,
#if defined(ENABLE_OVERLOADING)
PaintableInvalidateContentsMethodInfo ,
#endif
paintableInvalidateContents ,
#if defined(ENABLE_OVERLOADING)
PaintableInvalidateSizeMethodInfo ,
#endif
paintableInvalidateSize ,
paintableNewEmpty ,
#if defined(ENABLE_OVERLOADING)
PaintableSnapshotMethodInfo ,
#endif
paintableSnapshot ,
PaintableInvalidateContentsCallback ,
#if defined(ENABLE_OVERLOADING)
PaintableInvalidateContentsSignalInfo ,
#endif
afterPaintableInvalidateContents ,
onPaintableInvalidateContents ,
PaintableInvalidateSizeCallback ,
#if defined(ENABLE_OVERLOADING)
PaintableInvalidateSizeSignalInfo ,
#endif
afterPaintableInvalidateSize ,
onPaintableInvalidateSize ,
) 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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
#endif
newtype Paintable = Paintable (SP.ManagedPtr Paintable)
deriving (Paintable -> Paintable -> Bool
(Paintable -> Paintable -> Bool)
-> (Paintable -> Paintable -> Bool) -> Eq Paintable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Paintable -> Paintable -> Bool
== :: Paintable -> Paintable -> Bool
$c/= :: Paintable -> Paintable -> Bool
/= :: Paintable -> Paintable -> Bool
Eq)
instance SP.ManagedPtrNewtype Paintable where
toManagedPtr :: Paintable -> ManagedPtr Paintable
toManagedPtr (Paintable ManagedPtr Paintable
p) = ManagedPtr Paintable
p
foreign import ccall "gdk_paintable_get_type"
c_gdk_paintable_get_type :: IO B.Types.GType
instance B.Types.TypedObject Paintable where
glibType :: IO GType
glibType = IO GType
c_gdk_paintable_get_type
instance B.Types.GObject Paintable
class (SP.GObject o, O.IsDescendantOf Paintable o) => IsPaintable o
instance (SP.GObject o, O.IsDescendantOf Paintable o) => IsPaintable o
instance O.HasParentTypes Paintable
type instance O.ParentTypes Paintable = '[GObject.Object.Object]
toPaintable :: (MIO.MonadIO m, IsPaintable o) => o -> m Paintable
toPaintable :: forall (m :: * -> *) o.
(MonadIO m, IsPaintable o) =>
o -> m Paintable
toPaintable = IO Paintable -> m Paintable
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Paintable -> m Paintable)
-> (o -> IO Paintable) -> o -> m Paintable
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Paintable -> Paintable) -> o -> IO Paintable
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Paintable -> Paintable
Paintable
instance B.GValue.IsGValue (Maybe Paintable) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_paintable_get_type
gvalueSet_ :: Ptr GValue -> Maybe Paintable -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Paintable
P.Nothing = Ptr GValue -> Ptr Paintable -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Paintable
forall a. Ptr a
FP.nullPtr :: FP.Ptr Paintable)
gvalueSet_ Ptr GValue
gv (P.Just Paintable
obj) = Paintable -> (Ptr Paintable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Paintable
obj (Ptr GValue -> Ptr Paintable -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Paintable)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Paintable)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Paintable)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Paintable ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Paintable
type instance O.AttributeList Paintable = PaintableAttributeList
type PaintableAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePaintableMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolvePaintableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePaintableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePaintableMethod "computeConcreteSize" o = PaintableComputeConcreteSizeMethodInfo
ResolvePaintableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePaintableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePaintableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePaintableMethod "invalidateContents" o = PaintableInvalidateContentsMethodInfo
ResolvePaintableMethod "invalidateSize" o = PaintableInvalidateSizeMethodInfo
ResolvePaintableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePaintableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePaintableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePaintableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePaintableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePaintableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePaintableMethod "snapshot" o = PaintableSnapshotMethodInfo
ResolvePaintableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePaintableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePaintableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePaintableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePaintableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePaintableMethod "getCurrentImage" o = PaintableGetCurrentImageMethodInfo
ResolvePaintableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePaintableMethod "getFlags" o = PaintableGetFlagsMethodInfo
ResolvePaintableMethod "getIntrinsicAspectRatio" o = PaintableGetIntrinsicAspectRatioMethodInfo
ResolvePaintableMethod "getIntrinsicHeight" o = PaintableGetIntrinsicHeightMethodInfo
ResolvePaintableMethod "getIntrinsicWidth" o = PaintableGetIntrinsicWidthMethodInfo
ResolvePaintableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePaintableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePaintableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePaintableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePaintableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePaintableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePaintableMethod t Paintable, O.OverloadedMethod info Paintable p) => OL.IsLabel t (Paintable -> 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 ~ ResolvePaintableMethod t Paintable, O.OverloadedMethod info Paintable p, R.HasField t Paintable p) => R.HasField t Paintable p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePaintableMethod t Paintable, O.OverloadedMethodInfo info Paintable) => OL.IsLabel t (O.MethodProxy info Paintable) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "gdk_paintable_compute_concrete_size" gdk_paintable_compute_concrete_size ::
Ptr Paintable ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
Ptr CDouble ->
Ptr CDouble ->
IO ()
paintableComputeConcreteSize ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> Double
-> Double
-> Double
-> Double
-> m ((Double, Double))
paintableComputeConcreteSize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> Double -> Double -> Double -> Double -> m (Double, Double)
paintableComputeConcreteSize a
paintable Double
specifiedWidth Double
specifiedHeight Double
defaultWidth Double
defaultHeight = IO (Double, Double) -> m (Double, Double)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Double, Double) -> m (Double, Double))
-> IO (Double, Double) -> m (Double, Double)
forall a b. (a -> b) -> a -> b
$ do
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
let specifiedWidth' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
specifiedWidth
let specifiedHeight' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
specifiedHeight
let defaultWidth' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
defaultWidth
let defaultHeight' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
defaultHeight
concreteWidth <- allocMem :: IO (Ptr CDouble)
concreteHeight <- allocMem :: IO (Ptr CDouble)
gdk_paintable_compute_concrete_size paintable' specifiedWidth' specifiedHeight' defaultWidth' defaultHeight' concreteWidth concreteHeight
concreteWidth' <- peek concreteWidth
let concreteWidth'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
concreteWidth'
concreteHeight' <- peek concreteHeight
let concreteHeight'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
concreteHeight'
touchManagedPtr paintable
freeMem concreteWidth
freeMem concreteHeight
return (concreteWidth'', concreteHeight'')
#if defined(ENABLE_OVERLOADING)
data PaintableComputeConcreteSizeMethodInfo
instance (signature ~ (Double -> Double -> Double -> Double -> m ((Double, Double))), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableComputeConcreteSizeMethodInfo a signature where
overloadedMethod = paintableComputeConcreteSize
instance O.OverloadedMethodInfo PaintableComputeConcreteSizeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableComputeConcreteSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableComputeConcreteSize"
})
#endif
foreign import ccall "gdk_paintable_get_current_image" gdk_paintable_get_current_image ::
Ptr Paintable ->
IO (Ptr Paintable)
paintableGetCurrentImage ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m Paintable
paintableGetCurrentImage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m Paintable
paintableGetCurrentImage a
paintable = IO Paintable -> m Paintable
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Paintable -> m Paintable) -> IO Paintable -> m Paintable
forall a b. (a -> b) -> a -> b
$ do
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
result <- gdk_paintable_get_current_image paintable'
checkUnexpectedReturnNULL "paintableGetCurrentImage" result
result' <- (wrapObject Paintable) result
touchManagedPtr paintable
return result'
#if defined(ENABLE_OVERLOADING)
data PaintableGetCurrentImageMethodInfo
instance (signature ~ (m Paintable), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableGetCurrentImageMethodInfo a signature where
overloadedMethod = paintableGetCurrentImage
instance O.OverloadedMethodInfo PaintableGetCurrentImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableGetCurrentImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableGetCurrentImage"
})
#endif
foreign import ccall "gdk_paintable_get_flags" gdk_paintable_get_flags ::
Ptr Paintable ->
IO CUInt
paintableGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m [Gdk.Flags.PaintableFlags]
paintableGetFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m [PaintableFlags]
paintableGetFlags a
paintable = IO [PaintableFlags] -> m [PaintableFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PaintableFlags] -> m [PaintableFlags])
-> IO [PaintableFlags] -> m [PaintableFlags]
forall a b. (a -> b) -> a -> b
$ do
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
result <- gdk_paintable_get_flags paintable'
let result' = CUInt -> [PaintableFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr paintable
return result'
#if defined(ENABLE_OVERLOADING)
data PaintableGetFlagsMethodInfo
instance (signature ~ (m [Gdk.Flags.PaintableFlags]), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableGetFlagsMethodInfo a signature where
overloadedMethod = paintableGetFlags
instance O.OverloadedMethodInfo PaintableGetFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableGetFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableGetFlags"
})
#endif
foreign import ccall "gdk_paintable_get_intrinsic_aspect_ratio" gdk_paintable_get_intrinsic_aspect_ratio ::
Ptr Paintable ->
IO CDouble
paintableGetIntrinsicAspectRatio ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m Double
paintableGetIntrinsicAspectRatio :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m Double
paintableGetIntrinsicAspectRatio a
paintable = IO Double -> m Double
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
result <- gdk_paintable_get_intrinsic_aspect_ratio paintable'
let result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
touchManagedPtr paintable
return result'
#if defined(ENABLE_OVERLOADING)
data PaintableGetIntrinsicAspectRatioMethodInfo
instance (signature ~ (m Double), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableGetIntrinsicAspectRatioMethodInfo a signature where
overloadedMethod = paintableGetIntrinsicAspectRatio
instance O.OverloadedMethodInfo PaintableGetIntrinsicAspectRatioMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableGetIntrinsicAspectRatio",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableGetIntrinsicAspectRatio"
})
#endif
foreign import ccall "gdk_paintable_get_intrinsic_height" gdk_paintable_get_intrinsic_height ::
Ptr Paintable ->
IO Int32
paintableGetIntrinsicHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m Int32
paintableGetIntrinsicHeight :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m Int32
paintableGetIntrinsicHeight a
paintable = 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
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
result <- gdk_paintable_get_intrinsic_height paintable'
touchManagedPtr paintable
return result
#if defined(ENABLE_OVERLOADING)
data PaintableGetIntrinsicHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableGetIntrinsicHeightMethodInfo a signature where
overloadedMethod = paintableGetIntrinsicHeight
instance O.OverloadedMethodInfo PaintableGetIntrinsicHeightMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableGetIntrinsicHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableGetIntrinsicHeight"
})
#endif
foreign import ccall "gdk_paintable_get_intrinsic_width" gdk_paintable_get_intrinsic_width ::
Ptr Paintable ->
IO Int32
paintableGetIntrinsicWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m Int32
paintableGetIntrinsicWidth :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m Int32
paintableGetIntrinsicWidth a
paintable = 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
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
result <- gdk_paintable_get_intrinsic_width paintable'
touchManagedPtr paintable
return result
#if defined(ENABLE_OVERLOADING)
data PaintableGetIntrinsicWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableGetIntrinsicWidthMethodInfo a signature where
overloadedMethod = paintableGetIntrinsicWidth
instance O.OverloadedMethodInfo PaintableGetIntrinsicWidthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableGetIntrinsicWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableGetIntrinsicWidth"
})
#endif
foreign import ccall "gdk_paintable_invalidate_contents" gdk_paintable_invalidate_contents ::
Ptr Paintable ->
IO ()
paintableInvalidateContents ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m ()
paintableInvalidateContents :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m ()
paintableInvalidateContents a
paintable = 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
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
gdk_paintable_invalidate_contents paintable'
touchManagedPtr paintable
return ()
#if defined(ENABLE_OVERLOADING)
data PaintableInvalidateContentsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableInvalidateContentsMethodInfo a signature where
overloadedMethod = paintableInvalidateContents
instance O.OverloadedMethodInfo PaintableInvalidateContentsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableInvalidateContents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableInvalidateContents"
})
#endif
foreign import ccall "gdk_paintable_invalidate_size" gdk_paintable_invalidate_size ::
Ptr Paintable ->
IO ()
paintableInvalidateSize ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a) =>
a
-> m ()
paintableInvalidateSize :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPaintable a) =>
a -> m ()
paintableInvalidateSize a
paintable = 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
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
gdk_paintable_invalidate_size paintable'
touchManagedPtr paintable
return ()
#if defined(ENABLE_OVERLOADING)
data PaintableInvalidateSizeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsPaintable a) => O.OverloadedMethod PaintableInvalidateSizeMethodInfo a signature where
overloadedMethod = paintableInvalidateSize
instance O.OverloadedMethodInfo PaintableInvalidateSizeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableInvalidateSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableInvalidateSize"
})
#endif
foreign import ccall "gdk_paintable_snapshot" gdk_paintable_snapshot ::
Ptr Paintable ->
Ptr Gdk.Snapshot.Snapshot ->
CDouble ->
CDouble ->
IO ()
paintableSnapshot ::
(B.CallStack.HasCallStack, MonadIO m, IsPaintable a, Gdk.Snapshot.IsSnapshot b) =>
a
-> b
-> Double
-> Double
-> m ()
paintableSnapshot :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsPaintable a, IsSnapshot b) =>
a -> b -> Double -> Double -> m ()
paintableSnapshot a
paintable b
snapshot Double
width Double
height = 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
paintable' <- a -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
paintable
snapshot' <- unsafeManagedPtrCastPtr snapshot
let width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
let height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
gdk_paintable_snapshot paintable' snapshot' width' height'
touchManagedPtr paintable
touchManagedPtr snapshot
return ()
#if defined(ENABLE_OVERLOADING)
data PaintableSnapshotMethodInfo
instance (signature ~ (b -> Double -> Double -> m ()), MonadIO m, IsPaintable a, Gdk.Snapshot.IsSnapshot b) => O.OverloadedMethod PaintableSnapshotMethodInfo a signature where
overloadedMethod = paintableSnapshot
instance O.OverloadedMethodInfo PaintableSnapshotMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable.paintableSnapshot",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#v:paintableSnapshot"
})
#endif
foreign import ccall "gdk_paintable_new_empty" gdk_paintable_new_empty ::
Int32 ->
Int32 ->
IO (Ptr Paintable)
paintableNewEmpty ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> Int32
-> m Paintable
paintableNewEmpty :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Int32 -> Int32 -> m Paintable
paintableNewEmpty Int32
intrinsicWidth Int32
intrinsicHeight = IO Paintable -> m Paintable
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Paintable -> m Paintable) -> IO Paintable -> m Paintable
forall a b. (a -> b) -> a -> b
$ do
result <- Int32 -> Int32 -> IO (Ptr Paintable)
gdk_paintable_new_empty Int32
intrinsicWidth Int32
intrinsicHeight
checkUnexpectedReturnNULL "paintableNewEmpty" result
result' <- (wrapObject Paintable) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
type PaintableInvalidateContentsCallback =
IO ()
type C_PaintableInvalidateContentsCallback =
Ptr Paintable ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_PaintableInvalidateContentsCallback :: C_PaintableInvalidateContentsCallback -> IO (FunPtr C_PaintableInvalidateContentsCallback)
wrap_PaintableInvalidateContentsCallback ::
GObject a => (a -> PaintableInvalidateContentsCallback) ->
C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateContentsCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateContentsCallback a -> IO ()
gi'cb Ptr Paintable
gi'selfPtr Ptr ()
_ = do
Ptr Paintable -> (Paintable -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Paintable
gi'selfPtr ((Paintable -> IO ()) -> IO ()) -> (Paintable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Paintable
gi'self -> a -> IO ()
gi'cb (Paintable -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Paintable
gi'self)
onPaintableInvalidateContents :: (IsPaintable a, MonadIO m) => a -> ((?self :: a) => PaintableInvalidateContentsCallback) -> m SignalHandlerId
onPaintableInvalidateContents :: forall a (m :: * -> *).
(IsPaintable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onPaintableInvalidateContents a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_PaintableInvalidateContentsCallback
wrapped' = (a -> IO ()) -> C_PaintableInvalidateContentsCallback
forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateContentsCallback a -> IO ()
wrapped
wrapped'' <- C_PaintableInvalidateContentsCallback
-> IO (FunPtr C_PaintableInvalidateContentsCallback)
mk_PaintableInvalidateContentsCallback C_PaintableInvalidateContentsCallback
wrapped'
connectSignalFunPtr obj "invalidate-contents" wrapped'' SignalConnectBefore Nothing
afterPaintableInvalidateContents :: (IsPaintable a, MonadIO m) => a -> ((?self :: a) => PaintableInvalidateContentsCallback) -> m SignalHandlerId
afterPaintableInvalidateContents :: forall a (m :: * -> *).
(IsPaintable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterPaintableInvalidateContents a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_PaintableInvalidateContentsCallback
wrapped' = (a -> IO ()) -> C_PaintableInvalidateContentsCallback
forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateContentsCallback a -> IO ()
wrapped
wrapped'' <- C_PaintableInvalidateContentsCallback
-> IO (FunPtr C_PaintableInvalidateContentsCallback)
mk_PaintableInvalidateContentsCallback C_PaintableInvalidateContentsCallback
wrapped'
connectSignalFunPtr obj "invalidate-contents" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data PaintableInvalidateContentsSignalInfo
instance SignalInfo PaintableInvalidateContentsSignalInfo where
type HaskellCallbackType PaintableInvalidateContentsSignalInfo = PaintableInvalidateContentsCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_PaintableInvalidateContentsCallback cb
cb'' <- mk_PaintableInvalidateContentsCallback cb'
connectSignalFunPtr obj "invalidate-contents" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable::invalidate-contents"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#g:signal:invalidateContents"})
#endif
type PaintableInvalidateSizeCallback =
IO ()
type C_PaintableInvalidateSizeCallback =
Ptr Paintable ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_PaintableInvalidateSizeCallback :: C_PaintableInvalidateSizeCallback -> IO (FunPtr C_PaintableInvalidateSizeCallback)
wrap_PaintableInvalidateSizeCallback ::
GObject a => (a -> PaintableInvalidateSizeCallback) ->
C_PaintableInvalidateSizeCallback
wrap_PaintableInvalidateSizeCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateSizeCallback a -> IO ()
gi'cb Ptr Paintable
gi'selfPtr Ptr ()
_ = do
Ptr Paintable -> (Paintable -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Paintable
gi'selfPtr ((Paintable -> IO ()) -> IO ()) -> (Paintable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Paintable
gi'self -> a -> IO ()
gi'cb (Paintable -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Paintable
gi'self)
onPaintableInvalidateSize :: (IsPaintable a, MonadIO m) => a -> ((?self :: a) => PaintableInvalidateSizeCallback) -> m SignalHandlerId
onPaintableInvalidateSize :: forall a (m :: * -> *).
(IsPaintable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onPaintableInvalidateSize a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_PaintableInvalidateContentsCallback
wrapped' = (a -> IO ()) -> C_PaintableInvalidateContentsCallback
forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateSizeCallback a -> IO ()
wrapped
wrapped'' <- C_PaintableInvalidateContentsCallback
-> IO (FunPtr C_PaintableInvalidateContentsCallback)
mk_PaintableInvalidateSizeCallback C_PaintableInvalidateContentsCallback
wrapped'
connectSignalFunPtr obj "invalidate-size" wrapped'' SignalConnectBefore Nothing
afterPaintableInvalidateSize :: (IsPaintable a, MonadIO m) => a -> ((?self :: a) => PaintableInvalidateSizeCallback) -> m SignalHandlerId
afterPaintableInvalidateSize :: forall a (m :: * -> *).
(IsPaintable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterPaintableInvalidateSize a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_PaintableInvalidateContentsCallback
wrapped' = (a -> IO ()) -> C_PaintableInvalidateContentsCallback
forall a.
GObject a =>
(a -> IO ()) -> C_PaintableInvalidateContentsCallback
wrap_PaintableInvalidateSizeCallback a -> IO ()
wrapped
wrapped'' <- C_PaintableInvalidateContentsCallback
-> IO (FunPtr C_PaintableInvalidateContentsCallback)
mk_PaintableInvalidateSizeCallback C_PaintableInvalidateContentsCallback
wrapped'
connectSignalFunPtr obj "invalidate-size" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data PaintableInvalidateSizeSignalInfo
instance SignalInfo PaintableInvalidateSizeSignalInfo where
type HaskellCallbackType PaintableInvalidateSizeSignalInfo = PaintableInvalidateSizeCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_PaintableInvalidateSizeCallback cb
cb'' <- mk_PaintableInvalidateSizeCallback cb'
connectSignalFunPtr obj "invalidate-size" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Interfaces.Paintable::invalidate-size"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Interfaces-Paintable.html#g:signal:invalidateSize"})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Paintable = PaintableSignalList
type PaintableSignalList = ('[ '("invalidateContents", PaintableInvalidateContentsSignalInfo), '("invalidateSize", PaintableInvalidateSizeSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif