{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Structs.PopupLayout
(
PopupLayout(..) ,
#if defined(ENABLE_OVERLOADING)
ResolvePopupLayoutMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PopupLayoutCopyMethodInfo ,
#endif
popupLayoutCopy ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutEqualMethodInfo ,
#endif
popupLayoutEqual ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetAnchorHintsMethodInfo ,
#endif
popupLayoutGetAnchorHints ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetAnchorRectMethodInfo ,
#endif
popupLayoutGetAnchorRect ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetOffsetMethodInfo ,
#endif
popupLayoutGetOffset ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetRectAnchorMethodInfo ,
#endif
popupLayoutGetRectAnchor ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetShadowWidthMethodInfo ,
#endif
popupLayoutGetShadowWidth ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutGetSurfaceAnchorMethodInfo ,
#endif
popupLayoutGetSurfaceAnchor ,
popupLayoutNew ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutRefMethodInfo ,
#endif
popupLayoutRef ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetAnchorHintsMethodInfo ,
#endif
popupLayoutSetAnchorHints ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetAnchorRectMethodInfo ,
#endif
popupLayoutSetAnchorRect ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetOffsetMethodInfo ,
#endif
popupLayoutSetOffset ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetRectAnchorMethodInfo ,
#endif
popupLayoutSetRectAnchor ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetShadowWidthMethodInfo ,
#endif
popupLayoutSetShadowWidth ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutSetSurfaceAnchorMethodInfo ,
#endif
popupLayoutSetSurfaceAnchor ,
#if defined(ENABLE_OVERLOADING)
PopupLayoutUnrefMethodInfo ,
#endif
popupLayoutUnref ,
) 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 {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
#else
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
#endif
newtype = (SP.ManagedPtr PopupLayout)
deriving (PopupLayout -> PopupLayout -> Bool
(PopupLayout -> PopupLayout -> Bool)
-> (PopupLayout -> PopupLayout -> Bool) -> Eq PopupLayout
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PopupLayout -> PopupLayout -> Bool
== :: PopupLayout -> PopupLayout -> Bool
$c/= :: PopupLayout -> PopupLayout -> Bool
/= :: PopupLayout -> PopupLayout -> Bool
Eq)
instance SP.ManagedPtrNewtype PopupLayout where
toManagedPtr :: PopupLayout -> ManagedPtr PopupLayout
toManagedPtr (PopupLayout ManagedPtr PopupLayout
p) = ManagedPtr PopupLayout
p
foreign import ccall "gdk_popup_layout_get_type" ::
IO GType
type instance O.ParentTypes PopupLayout = '[]
instance O.HasParentTypes PopupLayout
instance B.Types.TypedObject PopupLayout where
glibType :: IO GType
glibType = IO GType
c_gdk_popup_layout_get_type
instance B.Types.GBoxed PopupLayout
instance B.GValue.IsGValue (Maybe PopupLayout) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_popup_layout_get_type
gvalueSet_ :: Ptr GValue -> Maybe PopupLayout -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PopupLayout
P.Nothing = Ptr GValue -> Ptr PopupLayout -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr PopupLayout
forall a. Ptr a
FP.nullPtr :: FP.Ptr PopupLayout)
gvalueSet_ Ptr GValue
gv (P.Just PopupLayout
obj) = PopupLayout -> (Ptr PopupLayout -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PopupLayout
obj (Ptr GValue -> Ptr PopupLayout -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe PopupLayout)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr PopupLayout)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr PopupLayout)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newBoxed PopupLayout ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PopupLayout
type instance O.AttributeList PopupLayout = PopupLayoutAttributeList
type PopupLayoutAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_popup_layout_new" ::
Ptr Gdk.Rectangle.Rectangle ->
CUInt ->
CUInt ->
IO (Ptr PopupLayout)
popupLayoutNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gdk.Rectangle.Rectangle
-> Gdk.Enums.Gravity
-> Gdk.Enums.Gravity
-> m PopupLayout
Rectangle
anchorRect Gravity
rectAnchor Gravity
surfaceAnchor = IO PopupLayout -> m PopupLayout
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PopupLayout -> m PopupLayout)
-> IO PopupLayout -> m PopupLayout
forall a b. (a -> b) -> a -> b
$ do
anchorRect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
anchorRect
let rectAnchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
rectAnchor
let surfaceAnchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
surfaceAnchor
result <- gdk_popup_layout_new anchorRect' rectAnchor' surfaceAnchor'
checkUnexpectedReturnNULL "popupLayoutNew" result
result' <- (wrapBoxed PopupLayout) result
touchManagedPtr anchorRect
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_popup_layout_copy" ::
Ptr PopupLayout ->
IO (Ptr PopupLayout)
popupLayoutCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m PopupLayout
PopupLayout
layout = IO PopupLayout -> m PopupLayout
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PopupLayout -> m PopupLayout)
-> IO PopupLayout -> m PopupLayout
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_copy layout'
checkUnexpectedReturnNULL "popupLayoutCopy" result
result' <- (wrapBoxed PopupLayout) result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutCopyMethodInfo
instance (signature ~ (m PopupLayout), MonadIO m) => O.OverloadedMethod PopupLayoutCopyMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutCopy
instance O.OverloadedMethodInfo PopupLayoutCopyMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutCopy"
})
#endif
foreign import ccall "gdk_popup_layout_equal" ::
Ptr PopupLayout ->
Ptr PopupLayout ->
IO CInt
popupLayoutEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> PopupLayout
-> m Bool
PopupLayout
layout PopupLayout
other = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
other' <- unsafeManagedPtrGetPtr other
result <- gdk_popup_layout_equal layout' other'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr layout
touchManagedPtr other
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutEqualMethodInfo
instance (signature ~ (PopupLayout -> m Bool), MonadIO m) => O.OverloadedMethod PopupLayoutEqualMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutEqual
instance O.OverloadedMethodInfo PopupLayoutEqualMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutEqual"
})
#endif
foreign import ccall "gdk_popup_layout_get_anchor_hints" ::
Ptr PopupLayout ->
IO CUInt
popupLayoutGetAnchorHints ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m [Gdk.Flags.AnchorHints]
PopupLayout
layout = IO [AnchorHints] -> m [AnchorHints]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AnchorHints] -> m [AnchorHints])
-> IO [AnchorHints] -> m [AnchorHints]
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_get_anchor_hints layout'
let result' = CUInt -> [AnchorHints]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetAnchorHintsMethodInfo
instance (signature ~ (m [Gdk.Flags.AnchorHints]), MonadIO m) => O.OverloadedMethod PopupLayoutGetAnchorHintsMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetAnchorHints
instance O.OverloadedMethodInfo PopupLayoutGetAnchorHintsMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetAnchorHints",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetAnchorHints"
})
#endif
foreign import ccall "gdk_popup_layout_get_anchor_rect" ::
Ptr PopupLayout ->
IO (Ptr Gdk.Rectangle.Rectangle)
popupLayoutGetAnchorRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m Gdk.Rectangle.Rectangle
PopupLayout
layout = IO Rectangle -> m Rectangle
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rectangle -> m Rectangle) -> IO Rectangle -> m Rectangle
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_get_anchor_rect layout'
checkUnexpectedReturnNULL "popupLayoutGetAnchorRect" result
result' <- (newBoxed Gdk.Rectangle.Rectangle) result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetAnchorRectMethodInfo
instance (signature ~ (m Gdk.Rectangle.Rectangle), MonadIO m) => O.OverloadedMethod PopupLayoutGetAnchorRectMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetAnchorRect
instance O.OverloadedMethodInfo PopupLayoutGetAnchorRectMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetAnchorRect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetAnchorRect"
})
#endif
foreign import ccall "gdk_popup_layout_get_offset" ::
Ptr PopupLayout ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
popupLayoutGetOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m ((Int32, Int32))
PopupLayout
layout = IO (Int32, Int32) -> m (Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
dx <- allocMem :: IO (Ptr Int32)
dy <- allocMem :: IO (Ptr Int32)
gdk_popup_layout_get_offset layout' dx dy
dx' <- peek dx
dy' <- peek dy
touchManagedPtr layout
freeMem dx
freeMem dy
return (dx', dy')
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetOffsetMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m) => O.OverloadedMethod PopupLayoutGetOffsetMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetOffset
instance O.OverloadedMethodInfo PopupLayoutGetOffsetMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetOffset"
})
#endif
foreign import ccall "gdk_popup_layout_get_rect_anchor" ::
Ptr PopupLayout ->
IO CUInt
popupLayoutGetRectAnchor ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m Gdk.Enums.Gravity
PopupLayout
layout = IO Gravity -> m Gravity
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Gravity -> m Gravity) -> IO Gravity -> m Gravity
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_get_rect_anchor layout'
let result' = (Int -> Gravity
forall a. Enum a => Int -> a
toEnum (Int -> Gravity) -> (CUInt -> Int) -> CUInt -> Gravity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetRectAnchorMethodInfo
instance (signature ~ (m Gdk.Enums.Gravity), MonadIO m) => O.OverloadedMethod PopupLayoutGetRectAnchorMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetRectAnchor
instance O.OverloadedMethodInfo PopupLayoutGetRectAnchorMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetRectAnchor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetRectAnchor"
})
#endif
foreign import ccall "gdk_popup_layout_get_shadow_width" gdk_popup_layout_get_shadow_width ::
Ptr PopupLayout ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
popupLayoutGetShadowWidth ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m ((Int32, Int32, Int32, Int32))
popupLayoutGetShadowWidth :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PopupLayout -> m (Int32, Int32, Int32, Int32)
popupLayoutGetShadowWidth PopupLayout
layout = IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32))
-> IO (Int32, Int32, Int32, Int32)
-> m (Int32, Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
left <- allocMem :: IO (Ptr Int32)
right <- allocMem :: IO (Ptr Int32)
top <- allocMem :: IO (Ptr Int32)
bottom <- allocMem :: IO (Ptr Int32)
gdk_popup_layout_get_shadow_width layout' left right top bottom
left' <- peek left
right' <- peek right
top' <- peek top
bottom' <- peek bottom
touchManagedPtr layout
freeMem left
freeMem right
freeMem top
freeMem bottom
return (left', right', top', bottom')
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetShadowWidthMethodInfo
instance (signature ~ (m ((Int32, Int32, Int32, Int32))), MonadIO m) => O.OverloadedMethod PopupLayoutGetShadowWidthMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetShadowWidth
instance O.OverloadedMethodInfo PopupLayoutGetShadowWidthMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetShadowWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetShadowWidth"
})
#endif
foreign import ccall "gdk_popup_layout_get_surface_anchor" ::
Ptr PopupLayout ->
IO CUInt
popupLayoutGetSurfaceAnchor ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m Gdk.Enums.Gravity
PopupLayout
layout = IO Gravity -> m Gravity
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Gravity -> m Gravity) -> IO Gravity -> m Gravity
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_get_surface_anchor layout'
let result' = (Int -> Gravity
forall a. Enum a => Int -> a
toEnum (Int -> Gravity) -> (CUInt -> Int) -> CUInt -> Gravity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutGetSurfaceAnchorMethodInfo
instance (signature ~ (m Gdk.Enums.Gravity), MonadIO m) => O.OverloadedMethod PopupLayoutGetSurfaceAnchorMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutGetSurfaceAnchor
instance O.OverloadedMethodInfo PopupLayoutGetSurfaceAnchorMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutGetSurfaceAnchor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutGetSurfaceAnchor"
})
#endif
foreign import ccall "gdk_popup_layout_ref" ::
Ptr PopupLayout ->
IO (Ptr PopupLayout)
popupLayoutRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m PopupLayout
PopupLayout
layout = IO PopupLayout -> m PopupLayout
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PopupLayout -> m PopupLayout)
-> IO PopupLayout -> m PopupLayout
forall a b. (a -> b) -> a -> b
$ do
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
result <- gdk_popup_layout_ref layout'
checkUnexpectedReturnNULL "popupLayoutRef" result
result' <- (wrapBoxed PopupLayout) result
touchManagedPtr layout
return result'
#if defined(ENABLE_OVERLOADING)
data PopupLayoutRefMethodInfo
instance (signature ~ (m PopupLayout), MonadIO m) => O.OverloadedMethod PopupLayoutRefMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutRef
instance O.OverloadedMethodInfo PopupLayoutRefMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutRef"
})
#endif
foreign import ccall "gdk_popup_layout_set_anchor_hints" ::
Ptr PopupLayout ->
CUInt ->
IO ()
popupLayoutSetAnchorHints ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> [Gdk.Flags.AnchorHints]
-> m ()
PopupLayout
layout [AnchorHints]
anchorHints = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
let anchorHints' = [AnchorHints] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [AnchorHints]
anchorHints
gdk_popup_layout_set_anchor_hints layout' anchorHints'
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetAnchorHintsMethodInfo
instance (signature ~ ([Gdk.Flags.AnchorHints] -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetAnchorHintsMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetAnchorHints
instance O.OverloadedMethodInfo PopupLayoutSetAnchorHintsMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetAnchorHints",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetAnchorHints"
})
#endif
foreign import ccall "gdk_popup_layout_set_anchor_rect" ::
Ptr PopupLayout ->
Ptr Gdk.Rectangle.Rectangle ->
IO ()
popupLayoutSetAnchorRect ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> Gdk.Rectangle.Rectangle
-> m ()
PopupLayout
layout Rectangle
anchorRect = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
anchorRect' <- unsafeManagedPtrGetPtr anchorRect
gdk_popup_layout_set_anchor_rect layout' anchorRect'
touchManagedPtr layout
touchManagedPtr anchorRect
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetAnchorRectMethodInfo
instance (signature ~ (Gdk.Rectangle.Rectangle -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetAnchorRectMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetAnchorRect
instance O.OverloadedMethodInfo PopupLayoutSetAnchorRectMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetAnchorRect",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetAnchorRect"
})
#endif
foreign import ccall "gdk_popup_layout_set_offset" ::
Ptr PopupLayout ->
Int32 ->
Int32 ->
IO ()
popupLayoutSetOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> Int32
-> Int32
-> m ()
PopupLayout
layout Int32
dx Int32
dy = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
gdk_popup_layout_set_offset layout' dx dy
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetOffsetMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetOffsetMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetOffset
instance O.OverloadedMethodInfo PopupLayoutSetOffsetMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetOffset"
})
#endif
foreign import ccall "gdk_popup_layout_set_rect_anchor" ::
Ptr PopupLayout ->
CUInt ->
IO ()
popupLayoutSetRectAnchor ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> Gdk.Enums.Gravity
-> m ()
PopupLayout
layout Gravity
anchor = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
let anchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
anchor
gdk_popup_layout_set_rect_anchor layout' anchor'
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetRectAnchorMethodInfo
instance (signature ~ (Gdk.Enums.Gravity -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetRectAnchorMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetRectAnchor
instance O.OverloadedMethodInfo PopupLayoutSetRectAnchorMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetRectAnchor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetRectAnchor"
})
#endif
foreign import ccall "gdk_popup_layout_set_shadow_width" gdk_popup_layout_set_shadow_width ::
Ptr PopupLayout ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO ()
popupLayoutSetShadowWidth ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> Int32
-> Int32
-> Int32
-> Int32
-> m ()
popupLayoutSetShadowWidth :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PopupLayout -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
popupLayoutSetShadowWidth PopupLayout
layout Int32
left Int32
right Int32
top Int32
bottom = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
gdk_popup_layout_set_shadow_width layout' left right top bottom
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetShadowWidthMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetShadowWidthMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetShadowWidth
instance O.OverloadedMethodInfo PopupLayoutSetShadowWidthMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetShadowWidth",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetShadowWidth"
})
#endif
foreign import ccall "gdk_popup_layout_set_surface_anchor" ::
Ptr PopupLayout ->
CUInt ->
IO ()
popupLayoutSetSurfaceAnchor ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> Gdk.Enums.Gravity
-> m ()
PopupLayout
layout Gravity
anchor = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
let anchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
anchor
gdk_popup_layout_set_surface_anchor layout' anchor'
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutSetSurfaceAnchorMethodInfo
instance (signature ~ (Gdk.Enums.Gravity -> m ()), MonadIO m) => O.OverloadedMethod PopupLayoutSetSurfaceAnchorMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutSetSurfaceAnchor
instance O.OverloadedMethodInfo PopupLayoutSetSurfaceAnchorMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutSetSurfaceAnchor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutSetSurfaceAnchor"
})
#endif
foreign import ccall "gdk_popup_layout_unref" ::
Ptr PopupLayout ->
IO ()
popupLayoutUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
PopupLayout
-> m ()
PopupLayout
layout = 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
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
gdk_popup_layout_unref layout'
touchManagedPtr layout
return ()
#if defined(ENABLE_OVERLOADING)
data PopupLayoutUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod PopupLayoutUnrefMethodInfo PopupLayout signature where
overloadedMethod = popupLayoutUnref
instance O.OverloadedMethodInfo PopupLayoutUnrefMethodInfo PopupLayout where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.PopupLayout.popupLayoutUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Structs-PopupLayout.html#v:popupLayoutUnref"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePopupLayoutMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolvePopupLayoutMethod "copy" o = PopupLayoutCopyMethodInfo
ResolvePopupLayoutMethod "equal" o = PopupLayoutEqualMethodInfo
ResolvePopupLayoutMethod "ref" o = PopupLayoutRefMethodInfo
ResolvePopupLayoutMethod "unref" o = PopupLayoutUnrefMethodInfo
ResolvePopupLayoutMethod "getAnchorHints" o = PopupLayoutGetAnchorHintsMethodInfo
ResolvePopupLayoutMethod "getAnchorRect" o = PopupLayoutGetAnchorRectMethodInfo
ResolvePopupLayoutMethod "getOffset" o = PopupLayoutGetOffsetMethodInfo
ResolvePopupLayoutMethod "getRectAnchor" o = PopupLayoutGetRectAnchorMethodInfo
ResolvePopupLayoutMethod "getShadowWidth" o = PopupLayoutGetShadowWidthMethodInfo
ResolvePopupLayoutMethod "getSurfaceAnchor" o = PopupLayoutGetSurfaceAnchorMethodInfo
ResolvePopupLayoutMethod "setAnchorHints" o = PopupLayoutSetAnchorHintsMethodInfo
ResolvePopupLayoutMethod "setAnchorRect" o = PopupLayoutSetAnchorRectMethodInfo
ResolvePopupLayoutMethod "setOffset" o = PopupLayoutSetOffsetMethodInfo
ResolvePopupLayoutMethod "setRectAnchor" o = PopupLayoutSetRectAnchorMethodInfo
ResolvePopupLayoutMethod "setShadowWidth" o = PopupLayoutSetShadowWidthMethodInfo
ResolvePopupLayoutMethod "setSurfaceAnchor" o = PopupLayoutSetSurfaceAnchorMethodInfo
ResolvePopupLayoutMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePopupLayoutMethod t PopupLayout, O.OverloadedMethod info PopupLayout p) => OL.IsLabel t (PopupLayout -> 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 ~ ResolvePopupLayoutMethod t PopupLayout, O.OverloadedMethod info PopupLayout p, R.HasField t PopupLayout p) => R.HasField t PopupLayout p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePopupLayoutMethod t PopupLayout, O.OverloadedMethodInfo info PopupLayout) => OL.IsLabel t (O.MethodProxy info PopupLayout) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif