{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Structs.DragSurfaceSize
(
DragSurfaceSize(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveDragSurfaceSizeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DragSurfaceSizeSetSizeMethodInfo ,
#endif
dragSurfaceSizeSetSize ,
) 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)
#else
#endif
newtype DragSurfaceSize = DragSurfaceSize (SP.ManagedPtr DragSurfaceSize)
deriving (DragSurfaceSize -> DragSurfaceSize -> Bool
(DragSurfaceSize -> DragSurfaceSize -> Bool)
-> (DragSurfaceSize -> DragSurfaceSize -> Bool)
-> Eq DragSurfaceSize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DragSurfaceSize -> DragSurfaceSize -> Bool
== :: DragSurfaceSize -> DragSurfaceSize -> Bool
$c/= :: DragSurfaceSize -> DragSurfaceSize -> Bool
/= :: DragSurfaceSize -> DragSurfaceSize -> Bool
Eq)
instance SP.ManagedPtrNewtype DragSurfaceSize where
toManagedPtr :: DragSurfaceSize -> ManagedPtr DragSurfaceSize
toManagedPtr (DragSurfaceSize ManagedPtr DragSurfaceSize
p) = ManagedPtr DragSurfaceSize
p
instance BoxedPtr DragSurfaceSize where
boxedPtrCopy :: DragSurfaceSize -> IO DragSurfaceSize
boxedPtrCopy = DragSurfaceSize -> IO DragSurfaceSize
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: DragSurfaceSize -> IO ()
boxedPtrFree = \DragSurfaceSize
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DragSurfaceSize
type instance O.AttributeList DragSurfaceSize = DragSurfaceSizeAttributeList
type DragSurfaceSizeAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_drag_surface_size_set_size" gdk_drag_surface_size_set_size ::
Ptr DragSurfaceSize ->
Int32 ->
Int32 ->
IO ()
dragSurfaceSizeSetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
DragSurfaceSize
-> Int32
-> Int32
-> m ()
dragSurfaceSizeSetSize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DragSurfaceSize -> Int32 -> Int32 -> m ()
dragSurfaceSizeSetSize DragSurfaceSize
size Int32
width Int32
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
size' <- DragSurfaceSize -> IO (Ptr DragSurfaceSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DragSurfaceSize
size
gdk_drag_surface_size_set_size size' width height
touchManagedPtr size
return ()
#if defined(ENABLE_OVERLOADING)
data DragSurfaceSizeSetSizeMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod DragSurfaceSizeSetSizeMethodInfo DragSurfaceSize signature where
overloadedMethod = dragSurfaceSizeSetSize
instance O.OverloadedMethodInfo DragSurfaceSizeSetSizeMethodInfo DragSurfaceSize where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.DragSurfaceSize.dragSurfaceSizeSetSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-DragSurfaceSize.html#v:dragSurfaceSizeSetSize"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveDragSurfaceSizeMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDragSurfaceSizeMethod "setSize" o = DragSurfaceSizeSetSizeMethodInfo
ResolveDragSurfaceSizeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDragSurfaceSizeMethod t DragSurfaceSize, O.OverloadedMethod info DragSurfaceSize p) => OL.IsLabel t (DragSurfaceSize -> 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 ~ ResolveDragSurfaceSizeMethod t DragSurfaceSize, O.OverloadedMethod info DragSurfaceSize p, R.HasField t DragSurfaceSize p) => R.HasField t DragSurfaceSize p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDragSurfaceSizeMethod t DragSurfaceSize, O.OverloadedMethodInfo info DragSurfaceSize) => OL.IsLabel t (O.MethodProxy info DragSurfaceSize) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif