{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Interfaces.Popup
(
Popup(..) ,
IsPopup ,
toPopup ,
#if defined(ENABLE_OVERLOADING)
ResolvePopupMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PopupGetAutohideMethodInfo ,
#endif
popupGetAutohide ,
#if defined(ENABLE_OVERLOADING)
PopupGetParentMethodInfo ,
#endif
popupGetParent ,
#if defined(ENABLE_OVERLOADING)
PopupGetPositionXMethodInfo ,
#endif
popupGetPositionX ,
#if defined(ENABLE_OVERLOADING)
PopupGetPositionYMethodInfo ,
#endif
popupGetPositionY ,
#if defined(ENABLE_OVERLOADING)
PopupGetRectAnchorMethodInfo ,
#endif
popupGetRectAnchor ,
#if defined(ENABLE_OVERLOADING)
PopupGetSurfaceAnchorMethodInfo ,
#endif
popupGetSurfaceAnchor ,
#if defined(ENABLE_OVERLOADING)
PopupPresentMethodInfo ,
#endif
popupPresent ,
#if defined(ENABLE_OVERLOADING)
PopupAutohidePropertyInfo ,
#endif
constructPopupAutohide ,
getPopupAutohide ,
#if defined(ENABLE_OVERLOADING)
popupAutohide ,
#endif
#if defined(ENABLE_OVERLOADING)
PopupParentPropertyInfo ,
#endif
constructPopupParent ,
getPopupParent ,
#if defined(ENABLE_OVERLOADING)
popupParent ,
#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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.Text as T
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Structs.PopupLayout as Gdk.PopupLayout
newtype = (SP.ManagedPtr Popup)
deriving (Popup -> Popup -> Bool
(Popup -> Popup -> Bool) -> (Popup -> Popup -> Bool) -> Eq Popup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Popup -> Popup -> Bool
$c/= :: Popup -> Popup -> Bool
== :: Popup -> Popup -> Bool
$c== :: Popup -> Popup -> Bool
Eq)
instance SP.ManagedPtrNewtype Popup where
toManagedPtr :: Popup -> ManagedPtr Popup
toManagedPtr (Popup ManagedPtr Popup
p) = ManagedPtr Popup
p
foreign import ccall "gdk_popup_get_type"
:: IO B.Types.GType
instance B.Types.TypedObject Popup where
glibType :: IO GType
glibType = IO GType
c_gdk_popup_get_type
instance B.Types.GObject Popup
instance B.GValue.IsGValue Popup where
toGValue :: Popup -> IO GValue
toGValue Popup
o = do
GType
gtype <- IO GType
c_gdk_popup_get_type
Popup -> (Ptr Popup -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Popup
o (GType -> (GValue -> Ptr Popup -> IO ()) -> Ptr Popup -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Popup -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Popup
fromGValue GValue
gv = do
Ptr Popup
ptr <- GValue -> IO (Ptr Popup)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Popup)
(ManagedPtr Popup -> Popup) -> Ptr Popup -> IO Popup
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Popup -> Popup
Popup Ptr Popup
ptr
class (SP.GObject o, O.IsDescendantOf Popup o) => o
instance (SP.GObject o, O.IsDescendantOf Popup o) => IsPopup o
instance O.HasParentTypes Popup
type instance O.ParentTypes Popup = '[GObject.Object.Object, Gdk.Surface.Surface]
toPopup :: (MonadIO m, IsPopup o) => o -> m Popup
= IO Popup -> m Popup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Popup -> m Popup) -> (o -> IO Popup) -> o -> m Popup
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Popup -> Popup) -> o -> IO Popup
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Popup -> Popup
Popup
getPopupAutohide :: (MonadIO m, IsPopup o) => o -> m Bool
o
obj = IO Bool -> m Bool
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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"autohide"
constructPopupAutohide :: (IsPopup o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"autohide" Bool
val
#if defined(ENABLE_OVERLOADING)
data PopupAutohidePropertyInfo
instance AttrInfo PopupAutohidePropertyInfo where
type AttrAllowedOps PopupAutohidePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PopupAutohidePropertyInfo = IsPopup
type AttrSetTypeConstraint PopupAutohidePropertyInfo = (~) Bool
type AttrTransferTypeConstraint PopupAutohidePropertyInfo = (~) Bool
type AttrTransferType PopupAutohidePropertyInfo = Bool
type AttrGetType PopupAutohidePropertyInfo = Bool
type AttrLabel PopupAutohidePropertyInfo = "autohide"
type AttrOrigin PopupAutohidePropertyInfo = Popup
attrGet = getPopupAutohide
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPopupAutohide
attrClear = undefined
#endif
getPopupParent :: (MonadIO m, IsPopup o) => o -> m Gdk.Surface.Surface
o
obj = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Surface) -> IO Surface
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getPopupParent" (IO (Maybe Surface) -> IO Surface)
-> IO (Maybe Surface) -> IO Surface
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Surface -> Surface) -> IO (Maybe Surface)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"parent" ManagedPtr Surface -> Surface
Gdk.Surface.Surface
constructPopupParent :: (IsPopup o, MIO.MonadIO m, Gdk.Surface.IsSurface a) => a -> m (GValueConstruct o)
a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"parent" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data PopupParentPropertyInfo
instance AttrInfo PopupParentPropertyInfo where
type AttrAllowedOps PopupParentPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PopupParentPropertyInfo = IsPopup
type AttrSetTypeConstraint PopupParentPropertyInfo = Gdk.Surface.IsSurface
type AttrTransferTypeConstraint PopupParentPropertyInfo = Gdk.Surface.IsSurface
type AttrTransferType PopupParentPropertyInfo = Gdk.Surface.Surface
type AttrGetType PopupParentPropertyInfo = Gdk.Surface.Surface
type AttrLabel PopupParentPropertyInfo = "parent"
type AttrOrigin PopupParentPropertyInfo = Popup
attrGet = getPopupParent
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Surface.Surface v
attrConstruct = constructPopupParent
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Popup
type instance O.AttributeList Popup = PopupAttributeList
type PopupAttributeList = ('[ '("autohide", PopupAutohidePropertyInfo), '("cursor", Gdk.Surface.SurfaceCursorPropertyInfo), '("display", Gdk.Surface.SurfaceDisplayPropertyInfo), '("frameClock", Gdk.Surface.SurfaceFrameClockPropertyInfo), '("mapped", Gdk.Surface.SurfaceMappedPropertyInfo), '("parent", PopupParentPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
popupAutohide :: AttrLabelProxy "autohide"
popupAutohide = AttrLabelProxy
popupParent :: AttrLabelProxy "parent"
popupParent = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePopupMethod (t :: Symbol) (o :: *) :: * where
ResolvePopupMethod "beep" o = Gdk.Surface.SurfaceBeepMethodInfo
ResolvePopupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePopupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePopupMethod "createCairoContext" o = Gdk.Surface.SurfaceCreateCairoContextMethodInfo
ResolvePopupMethod "createGlContext" o = Gdk.Surface.SurfaceCreateGlContextMethodInfo
ResolvePopupMethod "createSimilarSurface" o = Gdk.Surface.SurfaceCreateSimilarSurfaceMethodInfo
ResolvePopupMethod "createVulkanContext" o = Gdk.Surface.SurfaceCreateVulkanContextMethodInfo
ResolvePopupMethod "destroy" o = Gdk.Surface.SurfaceDestroyMethodInfo
ResolvePopupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePopupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePopupMethod "freezeUpdates" o = Gdk.Surface.SurfaceFreezeUpdatesMethodInfo
ResolvePopupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePopupMethod "hide" o = Gdk.Surface.SurfaceHideMethodInfo
ResolvePopupMethod "isDestroyed" o = Gdk.Surface.SurfaceIsDestroyedMethodInfo
ResolvePopupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePopupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePopupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePopupMethod "present" o = PopupPresentMethodInfo
ResolvePopupMethod "queueExpose" o = Gdk.Surface.SurfaceQueueExposeMethodInfo
ResolvePopupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePopupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePopupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePopupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePopupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePopupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePopupMethod "thawUpdates" o = Gdk.Surface.SurfaceThawUpdatesMethodInfo
ResolvePopupMethod "translateCoordinates" o = Gdk.Surface.SurfaceTranslateCoordinatesMethodInfo
ResolvePopupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePopupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePopupMethod "getAutohide" o = PopupGetAutohideMethodInfo
ResolvePopupMethod "getCursor" o = Gdk.Surface.SurfaceGetCursorMethodInfo
ResolvePopupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePopupMethod "getDeviceCursor" o = Gdk.Surface.SurfaceGetDeviceCursorMethodInfo
ResolvePopupMethod "getDevicePosition" o = Gdk.Surface.SurfaceGetDevicePositionMethodInfo
ResolvePopupMethod "getDisplay" o = Gdk.Surface.SurfaceGetDisplayMethodInfo
ResolvePopupMethod "getFrameClock" o = Gdk.Surface.SurfaceGetFrameClockMethodInfo
ResolvePopupMethod "getHeight" o = Gdk.Surface.SurfaceGetHeightMethodInfo
ResolvePopupMethod "getMapped" o = Gdk.Surface.SurfaceGetMappedMethodInfo
ResolvePopupMethod "getParent" o = PopupGetParentMethodInfo
ResolvePopupMethod "getPositionX" o = PopupGetPositionXMethodInfo
ResolvePopupMethod "getPositionY" o = PopupGetPositionYMethodInfo
ResolvePopupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePopupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePopupMethod "getRectAnchor" o = PopupGetRectAnchorMethodInfo
ResolvePopupMethod "getScaleFactor" o = Gdk.Surface.SurfaceGetScaleFactorMethodInfo
ResolvePopupMethod "getSupportMultidevice" o = Gdk.Surface.SurfaceGetSupportMultideviceMethodInfo
ResolvePopupMethod "getSurfaceAnchor" o = PopupGetSurfaceAnchorMethodInfo
ResolvePopupMethod "getWidth" o = Gdk.Surface.SurfaceGetWidthMethodInfo
ResolvePopupMethod "setCursor" o = Gdk.Surface.SurfaceSetCursorMethodInfo
ResolvePopupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePopupMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePopupMethod "setDeviceCursor" o = Gdk.Surface.SurfaceSetDeviceCursorMethodInfo
ResolvePopupMethod "setInputRegion" o = Gdk.Surface.SurfaceSetInputRegionMethodInfo
ResolvePopupMethod "setOpaqueRegion" o = Gdk.Surface.SurfaceSetOpaqueRegionMethodInfo
ResolvePopupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePopupMethod "setShadowWidth" o = Gdk.Surface.SurfaceSetShadowWidthMethodInfo
ResolvePopupMethod "setSupportMultidevice" o = Gdk.Surface.SurfaceSetSupportMultideviceMethodInfo
ResolvePopupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePopupMethod t Popup, O.MethodInfo info Popup p) => OL.IsLabel t (Popup -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "gdk_popup_get_autohide" ::
Ptr Popup ->
IO CInt
popupGetAutohide ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Bool
a
popup = IO Bool -> m Bool
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 Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
CInt
result <- Ptr Popup -> IO CInt
gdk_popup_get_autohide Ptr Popup
popup'
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
popup
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PopupGetAutohideMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsPopup a) => O.MethodInfo PopupGetAutohideMethodInfo a signature where
overloadedMethod = popupGetAutohide
#endif
foreign import ccall "gdk_popup_get_parent" ::
Ptr Popup ->
IO (Ptr Gdk.Surface.Surface)
popupGetParent ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Gdk.Surface.Surface
a
popup = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
Ptr Surface
result <- Ptr Popup -> IO (Ptr Surface)
gdk_popup_get_parent Ptr Popup
popup'
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"popupGetParent" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popup
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data PopupGetParentMethodInfo
instance (signature ~ (m Gdk.Surface.Surface), MonadIO m, IsPopup a) => O.MethodInfo PopupGetParentMethodInfo a signature where
overloadedMethod = popupGetParent
#endif
foreign import ccall "gdk_popup_get_position_x" ::
Ptr Popup ->
IO Int32
popupGetPositionX ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Int32
a
popup = IO Int32 -> m Int32
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 Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
Int32
result <- Ptr Popup -> IO Int32
gdk_popup_get_position_x Ptr Popup
popup'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popup
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PopupGetPositionXMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPopup a) => O.MethodInfo PopupGetPositionXMethodInfo a signature where
overloadedMethod = popupGetPositionX
#endif
foreign import ccall "gdk_popup_get_position_y" ::
Ptr Popup ->
IO Int32
popupGetPositionY ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Int32
a
popup = IO Int32 -> m Int32
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 Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
Int32
result <- Ptr Popup -> IO Int32
gdk_popup_get_position_y Ptr Popup
popup'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popup
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data PopupGetPositionYMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsPopup a) => O.MethodInfo PopupGetPositionYMethodInfo a signature where
overloadedMethod = popupGetPositionY
#endif
foreign import ccall "gdk_popup_get_rect_anchor" ::
Ptr Popup ->
IO CUInt
popupGetRectAnchor ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Gdk.Enums.Gravity
a
popup = IO Gravity -> m Gravity
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
Ptr Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
CUInt
result <- Ptr Popup -> IO CUInt
gdk_popup_get_rect_anchor Ptr Popup
popup'
let result' :: Gravity
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popup
Gravity -> IO Gravity
forall (m :: * -> *) a. Monad m => a -> m a
return Gravity
result'
#if defined(ENABLE_OVERLOADING)
data PopupGetRectAnchorMethodInfo
instance (signature ~ (m Gdk.Enums.Gravity), MonadIO m, IsPopup a) => O.MethodInfo PopupGetRectAnchorMethodInfo a signature where
overloadedMethod = popupGetRectAnchor
#endif
foreign import ccall "gdk_popup_get_surface_anchor" ::
Ptr Popup ->
IO CUInt
popupGetSurfaceAnchor ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> m Gdk.Enums.Gravity
a
popup = IO Gravity -> m Gravity
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
Ptr Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
CUInt
result <- Ptr Popup -> IO CUInt
gdk_popup_get_surface_anchor Ptr Popup
popup'
let result' :: Gravity
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popup
Gravity -> IO Gravity
forall (m :: * -> *) a. Monad m => a -> m a
return Gravity
result'
#if defined(ENABLE_OVERLOADING)
data PopupGetSurfaceAnchorMethodInfo
instance (signature ~ (m Gdk.Enums.Gravity), MonadIO m, IsPopup a) => O.MethodInfo PopupGetSurfaceAnchorMethodInfo a signature where
overloadedMethod = popupGetSurfaceAnchor
#endif
foreign import ccall "gdk_popup_present" ::
Ptr Popup ->
Int32 ->
Int32 ->
Ptr Gdk.PopupLayout.PopupLayout ->
IO CInt
popupPresent ::
(B.CallStack.HasCallStack, MonadIO m, IsPopup a) =>
a
-> Int32
-> Int32
-> Gdk.PopupLayout.PopupLayout
-> m Bool
a
popup Int32
width Int32
height PopupLayout
layout = IO Bool -> m Bool
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 Popup
popup' <- a -> IO (Ptr Popup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popup
Ptr PopupLayout
layout' <- PopupLayout -> IO (Ptr PopupLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PopupLayout
layout
CInt
result <- Ptr Popup -> Int32 -> Int32 -> Ptr PopupLayout -> IO CInt
gdk_popup_present Ptr Popup
popup' Int32
width Int32
height Ptr PopupLayout
layout'
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
popup
PopupLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PopupLayout
layout
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data PopupPresentMethodInfo
instance (signature ~ (Int32 -> Int32 -> Gdk.PopupLayout.PopupLayout -> m Bool), MonadIO m, IsPopup a) => O.MethodInfo PopupPresentMethodInfo a signature where
overloadedMethod = popupPresent
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Popup = PopupSignalList
type PopupSignalList = ('[ '("enterMonitor", Gdk.Surface.SurfaceEnterMonitorSignalInfo), '("event", Gdk.Surface.SurfaceEventSignalInfo), '("leaveMonitor", Gdk.Surface.SurfaceLeaveMonitorSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("popupLayoutChanged", Gdk.Surface.SurfacePopupLayoutChangedSignalInfo), '("render", Gdk.Surface.SurfaceRenderSignalInfo), '("sizeChanged", Gdk.Surface.SurfaceSizeChangedSignalInfo)] :: [(Symbol, *)])
#endif