{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2WebExtension.Objects.ContextMenu
(
ContextMenu(..) ,
IsContextMenu ,
toContextMenu ,
#if defined(ENABLE_OVERLOADING)
ResolveContextMenuMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ContextMenuAppendMethodInfo ,
#endif
contextMenuAppend ,
#if defined(ENABLE_OVERLOADING)
ContextMenuFirstMethodInfo ,
#endif
contextMenuFirst ,
#if defined(ENABLE_OVERLOADING)
ContextMenuGetItemAtPositionMethodInfo ,
#endif
contextMenuGetItemAtPosition ,
#if defined(ENABLE_OVERLOADING)
ContextMenuGetItemsMethodInfo ,
#endif
contextMenuGetItems ,
#if defined(ENABLE_OVERLOADING)
ContextMenuGetNItemsMethodInfo ,
#endif
contextMenuGetNItems ,
#if defined(ENABLE_OVERLOADING)
ContextMenuGetUserDataMethodInfo ,
#endif
contextMenuGetUserData ,
#if defined(ENABLE_OVERLOADING)
ContextMenuInsertMethodInfo ,
#endif
contextMenuInsert ,
#if defined(ENABLE_OVERLOADING)
ContextMenuLastMethodInfo ,
#endif
contextMenuLast ,
#if defined(ENABLE_OVERLOADING)
ContextMenuMoveItemMethodInfo ,
#endif
contextMenuMoveItem ,
contextMenuNew ,
contextMenuNewWithItems ,
#if defined(ENABLE_OVERLOADING)
ContextMenuPrependMethodInfo ,
#endif
contextMenuPrepend ,
#if defined(ENABLE_OVERLOADING)
ContextMenuRemoveMethodInfo ,
#endif
contextMenuRemove ,
#if defined(ENABLE_OVERLOADING)
ContextMenuRemoveAllMethodInfo ,
#endif
contextMenuRemoveAll ,
#if defined(ENABLE_OVERLOADING)
ContextMenuSetUserDataMethodInfo ,
#endif
contextMenuSetUserData ,
) 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.WebKit2WebExtension.Objects.ContextMenuItem as WebKit2WebExtension.ContextMenuItem
newtype = (SP.ManagedPtr ContextMenu)
deriving (ContextMenu -> ContextMenu -> Bool
(ContextMenu -> ContextMenu -> Bool)
-> (ContextMenu -> ContextMenu -> Bool) -> Eq ContextMenu
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContextMenu -> ContextMenu -> Bool
$c/= :: ContextMenu -> ContextMenu -> Bool
== :: ContextMenu -> ContextMenu -> Bool
$c== :: ContextMenu -> ContextMenu -> Bool
Eq)
instance SP.ManagedPtrNewtype ContextMenu where
toManagedPtr :: ContextMenu -> ManagedPtr ContextMenu
toManagedPtr (ContextMenu ManagedPtr ContextMenu
p) = ManagedPtr ContextMenu
p
foreign import ccall "webkit_context_menu_get_type"
:: IO B.Types.GType
instance B.Types.TypedObject ContextMenu where
glibType :: IO GType
glibType = IO GType
c_webkit_context_menu_get_type
instance B.Types.GObject ContextMenu
instance B.GValue.IsGValue ContextMenu where
toGValue :: ContextMenu -> IO GValue
toGValue ContextMenu
o = do
GType
gtype <- IO GType
c_webkit_context_menu_get_type
ContextMenu -> (Ptr ContextMenu -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ContextMenu
o (GType
-> (GValue -> Ptr ContextMenu -> IO ())
-> Ptr ContextMenu
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr ContextMenu -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO ContextMenu
fromGValue GValue
gv = do
Ptr ContextMenu
ptr <- GValue -> IO (Ptr ContextMenu)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr ContextMenu)
(ManagedPtr ContextMenu -> ContextMenu)
-> Ptr ContextMenu -> IO ContextMenu
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ContextMenu -> ContextMenu
ContextMenu Ptr ContextMenu
ptr
class (SP.GObject o, O.IsDescendantOf ContextMenu o) => o
instance (SP.GObject o, O.IsDescendantOf ContextMenu o) => IsContextMenu o
instance O.HasParentTypes ContextMenu
type instance O.ParentTypes ContextMenu = '[GObject.Object.Object]
toContextMenu :: (MonadIO m, IsContextMenu o) => o -> m ContextMenu
= IO ContextMenu -> m ContextMenu
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenu -> m ContextMenu)
-> (o -> IO ContextMenu) -> o -> m ContextMenu
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ContextMenu -> ContextMenu) -> o -> IO ContextMenu
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr ContextMenu -> ContextMenu
ContextMenu
#if defined(ENABLE_OVERLOADING)
type family ResolveContextMenuMethod (t :: Symbol) (o :: *) :: * where
ResolveContextMenuMethod "append" o = ContextMenuAppendMethodInfo
ResolveContextMenuMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveContextMenuMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveContextMenuMethod "first" o = ContextMenuFirstMethodInfo
ResolveContextMenuMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveContextMenuMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveContextMenuMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveContextMenuMethod "insert" o = ContextMenuInsertMethodInfo
ResolveContextMenuMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveContextMenuMethod "last" o = ContextMenuLastMethodInfo
ResolveContextMenuMethod "moveItem" o = ContextMenuMoveItemMethodInfo
ResolveContextMenuMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveContextMenuMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveContextMenuMethod "prepend" o = ContextMenuPrependMethodInfo
ResolveContextMenuMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveContextMenuMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveContextMenuMethod "remove" o = ContextMenuRemoveMethodInfo
ResolveContextMenuMethod "removeAll" o = ContextMenuRemoveAllMethodInfo
ResolveContextMenuMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveContextMenuMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveContextMenuMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveContextMenuMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveContextMenuMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveContextMenuMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveContextMenuMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveContextMenuMethod "getItemAtPosition" o = ContextMenuGetItemAtPositionMethodInfo
ResolveContextMenuMethod "getItems" o = ContextMenuGetItemsMethodInfo
ResolveContextMenuMethod "getNItems" o = ContextMenuGetNItemsMethodInfo
ResolveContextMenuMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveContextMenuMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveContextMenuMethod "getUserData" o = ContextMenuGetUserDataMethodInfo
ResolveContextMenuMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveContextMenuMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveContextMenuMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveContextMenuMethod "setUserData" o = ContextMenuSetUserDataMethodInfo
ResolveContextMenuMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContextMenuMethod t ContextMenu, O.MethodInfo info ContextMenu p) => OL.IsLabel t (ContextMenu -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ContextMenu
type instance O.AttributeList ContextMenu = ContextMenuAttributeList
type ContextMenuAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ContextMenu = ContextMenuSignalList
type ContextMenuSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_context_menu_new" ::
IO (Ptr ContextMenu)
contextMenuNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m ContextMenu
= IO ContextMenu -> m ContextMenu
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenu -> m ContextMenu)
-> IO ContextMenu -> m ContextMenu
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
result <- IO (Ptr ContextMenu)
webkit_context_menu_new
Text -> Ptr ContextMenu -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuNew" Ptr ContextMenu
result
ContextMenu
result' <- ((ManagedPtr ContextMenu -> ContextMenu)
-> Ptr ContextMenu -> IO ContextMenu
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContextMenu -> ContextMenu
ContextMenu) Ptr ContextMenu
result
ContextMenu -> IO ContextMenu
forall (m :: * -> *) a. Monad m => a -> m a
return ContextMenu
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "webkit_context_menu_new_with_items" ::
Ptr (GList (Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem)) ->
IO (Ptr ContextMenu)
contextMenuNewWithItems ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem a) =>
[a]
-> m ContextMenu
[a]
items = IO ContextMenu -> m ContextMenu
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenu -> m ContextMenu)
-> IO ContextMenu -> m ContextMenu
forall a b. (a -> b) -> a -> b
$ do
[Ptr ContextMenuItem]
items' <- (a -> IO (Ptr ContextMenuItem)) -> [a] -> IO [Ptr ContextMenuItem]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [a]
items
Ptr (GList (Ptr ContextMenuItem))
items'' <- [Ptr ContextMenuItem] -> IO (Ptr (GList (Ptr ContextMenuItem)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr ContextMenuItem]
items'
Ptr ContextMenu
result <- Ptr (GList (Ptr ContextMenuItem)) -> IO (Ptr ContextMenu)
webkit_context_menu_new_with_items Ptr (GList (Ptr ContextMenuItem))
items''
Text -> Ptr ContextMenu -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuNewWithItems" Ptr ContextMenu
result
ContextMenu
result' <- ((ManagedPtr ContextMenu -> ContextMenu)
-> Ptr ContextMenu -> IO ContextMenu
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContextMenu -> ContextMenu
ContextMenu) Ptr ContextMenu
result
(a -> IO ()) -> [a] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [a]
items
Ptr (GList (Ptr ContextMenuItem)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr ContextMenuItem))
items''
ContextMenu -> IO ContextMenu
forall (m :: * -> *) a. Monad m => a -> m a
return ContextMenu
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "webkit_context_menu_append" ::
Ptr ContextMenu ->
Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem ->
IO ()
contextMenuAppend ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) =>
a
-> b
-> m ()
a
menu b
item = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
item' <- b -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
item
Ptr ContextMenu -> Ptr ContextMenuItem -> IO ()
webkit_context_menu_append Ptr ContextMenu
menu' Ptr ContextMenuItem
item'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuAppendMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) => O.MethodInfo ContextMenuAppendMethodInfo a signature where
overloadedMethod = contextMenuAppend
#endif
foreign import ccall "webkit_context_menu_first" ::
Ptr ContextMenu ->
IO (Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem)
contextMenuFirst ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m WebKit2WebExtension.ContextMenuItem.ContextMenuItem
a
menu = IO ContextMenuItem -> m ContextMenuItem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenuItem -> m ContextMenuItem)
-> IO ContextMenuItem -> m ContextMenuItem
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
result <- Ptr ContextMenu -> IO (Ptr ContextMenuItem)
webkit_context_menu_first Ptr ContextMenu
menu'
Text -> Ptr ContextMenuItem -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuFirst" Ptr ContextMenuItem
result
ContextMenuItem
result' <- ((ManagedPtr ContextMenuItem -> ContextMenuItem)
-> Ptr ContextMenuItem -> IO ContextMenuItem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContextMenuItem -> ContextMenuItem
WebKit2WebExtension.ContextMenuItem.ContextMenuItem) Ptr ContextMenuItem
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
ContextMenuItem -> IO ContextMenuItem
forall (m :: * -> *) a. Monad m => a -> m a
return ContextMenuItem
result'
#if defined(ENABLE_OVERLOADING)
data ContextMenuFirstMethodInfo
instance (signature ~ (m WebKit2WebExtension.ContextMenuItem.ContextMenuItem), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuFirstMethodInfo a signature where
overloadedMethod = contextMenuFirst
#endif
foreign import ccall "webkit_context_menu_get_item_at_position" ::
Ptr ContextMenu ->
Word32 ->
IO (Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem)
contextMenuGetItemAtPosition ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> Word32
-> m WebKit2WebExtension.ContextMenuItem.ContextMenuItem
a
menu Word32
position = IO ContextMenuItem -> m ContextMenuItem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenuItem -> m ContextMenuItem)
-> IO ContextMenuItem -> m ContextMenuItem
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
result <- Ptr ContextMenu -> Word32 -> IO (Ptr ContextMenuItem)
webkit_context_menu_get_item_at_position Ptr ContextMenu
menu' Word32
position
Text -> Ptr ContextMenuItem -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuGetItemAtPosition" Ptr ContextMenuItem
result
ContextMenuItem
result' <- ((ManagedPtr ContextMenuItem -> ContextMenuItem)
-> Ptr ContextMenuItem -> IO ContextMenuItem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContextMenuItem -> ContextMenuItem
WebKit2WebExtension.ContextMenuItem.ContextMenuItem) Ptr ContextMenuItem
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
ContextMenuItem -> IO ContextMenuItem
forall (m :: * -> *) a. Monad m => a -> m a
return ContextMenuItem
result'
#if defined(ENABLE_OVERLOADING)
data ContextMenuGetItemAtPositionMethodInfo
instance (signature ~ (Word32 -> m WebKit2WebExtension.ContextMenuItem.ContextMenuItem), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuGetItemAtPositionMethodInfo a signature where
overloadedMethod = contextMenuGetItemAtPosition
#endif
foreign import ccall "webkit_context_menu_get_items" ::
Ptr ContextMenu ->
IO (Ptr (GList (Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem)))
contextMenuGetItems ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m [WebKit2WebExtension.ContextMenuItem.ContextMenuItem]
a
menu = IO [ContextMenuItem] -> m [ContextMenuItem]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ContextMenuItem] -> m [ContextMenuItem])
-> IO [ContextMenuItem] -> m [ContextMenuItem]
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr (GList (Ptr ContextMenuItem))
result <- Ptr ContextMenu -> IO (Ptr (GList (Ptr ContextMenuItem)))
webkit_context_menu_get_items Ptr ContextMenu
menu'
[Ptr ContextMenuItem]
result' <- Ptr (GList (Ptr ContextMenuItem)) -> IO [Ptr ContextMenuItem]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr ContextMenuItem))
result
[ContextMenuItem]
result'' <- (Ptr ContextMenuItem -> IO ContextMenuItem)
-> [Ptr ContextMenuItem] -> IO [ContextMenuItem]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr ContextMenuItem -> ContextMenuItem)
-> Ptr ContextMenuItem -> IO ContextMenuItem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContextMenuItem -> ContextMenuItem
WebKit2WebExtension.ContextMenuItem.ContextMenuItem) [Ptr ContextMenuItem]
result'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
[ContextMenuItem] -> IO [ContextMenuItem]
forall (m :: * -> *) a. Monad m => a -> m a
return [ContextMenuItem]
result''
#if defined(ENABLE_OVERLOADING)
data ContextMenuGetItemsMethodInfo
instance (signature ~ (m [WebKit2WebExtension.ContextMenuItem.ContextMenuItem]), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuGetItemsMethodInfo a signature where
overloadedMethod = contextMenuGetItems
#endif
foreign import ccall "webkit_context_menu_get_n_items" ::
Ptr ContextMenu ->
IO Word32
contextMenuGetNItems ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m Word32
a
menu = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Word32
result <- Ptr ContextMenu -> IO Word32
webkit_context_menu_get_n_items Ptr ContextMenu
menu'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ContextMenuGetNItemsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuGetNItemsMethodInfo a signature where
overloadedMethod = contextMenuGetNItems
#endif
foreign import ccall "webkit_context_menu_get_user_data" ::
Ptr ContextMenu ->
IO (Ptr GVariant)
contextMenuGetUserData ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m GVariant
a
menu = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr GVariant
result <- Ptr ContextMenu -> IO (Ptr GVariant)
webkit_context_menu_get_user_data Ptr ContextMenu
menu'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuGetUserData" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data ContextMenuGetUserDataMethodInfo
instance (signature ~ (m GVariant), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuGetUserDataMethodInfo a signature where
overloadedMethod = contextMenuGetUserData
#endif
foreign import ccall "webkit_context_menu_insert" ::
Ptr ContextMenu ->
Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem ->
Int32 ->
IO ()
contextMenuInsert ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) =>
a
-> b
-> Int32
-> m ()
a
menu b
item Int32
position = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
item' <- b -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
item
Ptr ContextMenu -> Ptr ContextMenuItem -> Int32 -> IO ()
webkit_context_menu_insert Ptr ContextMenu
menu' Ptr ContextMenuItem
item' Int32
position
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuInsertMethodInfo
instance (signature ~ (b -> Int32 -> m ()), MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) => O.MethodInfo ContextMenuInsertMethodInfo a signature where
overloadedMethod = contextMenuInsert
#endif
foreign import ccall "webkit_context_menu_last" ::
Ptr ContextMenu ->
IO (Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem)
contextMenuLast ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m WebKit2WebExtension.ContextMenuItem.ContextMenuItem
a
menu = IO ContextMenuItem -> m ContextMenuItem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContextMenuItem -> m ContextMenuItem)
-> IO ContextMenuItem -> m ContextMenuItem
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
result <- Ptr ContextMenu -> IO (Ptr ContextMenuItem)
webkit_context_menu_last Ptr ContextMenu
menu'
Text -> Ptr ContextMenuItem -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contextMenuLast" Ptr ContextMenuItem
result
ContextMenuItem
result' <- ((ManagedPtr ContextMenuItem -> ContextMenuItem)
-> Ptr ContextMenuItem -> IO ContextMenuItem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContextMenuItem -> ContextMenuItem
WebKit2WebExtension.ContextMenuItem.ContextMenuItem) Ptr ContextMenuItem
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
ContextMenuItem -> IO ContextMenuItem
forall (m :: * -> *) a. Monad m => a -> m a
return ContextMenuItem
result'
#if defined(ENABLE_OVERLOADING)
data ContextMenuLastMethodInfo
instance (signature ~ (m WebKit2WebExtension.ContextMenuItem.ContextMenuItem), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuLastMethodInfo a signature where
overloadedMethod = contextMenuLast
#endif
foreign import ccall "webkit_context_menu_move_item" ::
Ptr ContextMenu ->
Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem ->
Int32 ->
IO ()
contextMenuMoveItem ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) =>
a
-> b
-> Int32
-> m ()
a
menu b
item Int32
position = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
item' <- b -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
item
Ptr ContextMenu -> Ptr ContextMenuItem -> Int32 -> IO ()
webkit_context_menu_move_item Ptr ContextMenu
menu' Ptr ContextMenuItem
item' Int32
position
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuMoveItemMethodInfo
instance (signature ~ (b -> Int32 -> m ()), MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) => O.MethodInfo ContextMenuMoveItemMethodInfo a signature where
overloadedMethod = contextMenuMoveItem
#endif
foreign import ccall "webkit_context_menu_prepend" ::
Ptr ContextMenu ->
Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem ->
IO ()
contextMenuPrepend ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) =>
a
-> b
-> m ()
a
menu b
item = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
item' <- b -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
item
Ptr ContextMenu -> Ptr ContextMenuItem -> IO ()
webkit_context_menu_prepend Ptr ContextMenu
menu' Ptr ContextMenuItem
item'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuPrependMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) => O.MethodInfo ContextMenuPrependMethodInfo a signature where
overloadedMethod = contextMenuPrepend
#endif
foreign import ccall "webkit_context_menu_remove" ::
Ptr ContextMenu ->
Ptr WebKit2WebExtension.ContextMenuItem.ContextMenuItem ->
IO ()
contextMenuRemove ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) =>
a
-> b
-> m ()
a
menu b
item = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenuItem
item' <- b -> IO (Ptr ContextMenuItem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
item
Ptr ContextMenu -> Ptr ContextMenuItem -> IO ()
webkit_context_menu_remove Ptr ContextMenu
menu' Ptr ContextMenuItem
item'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuRemoveMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsContextMenu a, WebKit2WebExtension.ContextMenuItem.IsContextMenuItem b) => O.MethodInfo ContextMenuRemoveMethodInfo a signature where
overloadedMethod = contextMenuRemove
#endif
foreign import ccall "webkit_context_menu_remove_all" ::
Ptr ContextMenu ->
IO ()
contextMenuRemoveAll ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> m ()
a
menu = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr ContextMenu -> IO ()
webkit_context_menu_remove_all Ptr ContextMenu
menu'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuRemoveAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuRemoveAllMethodInfo a signature where
overloadedMethod = contextMenuRemoveAll
#endif
foreign import ccall "webkit_context_menu_set_user_data" ::
Ptr ContextMenu ->
Ptr GVariant ->
IO ()
contextMenuSetUserData ::
(B.CallStack.HasCallStack, MonadIO m, IsContextMenu a) =>
a
-> GVariant
-> m ()
a
menu GVariant
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContextMenu
menu' <- a -> IO (Ptr ContextMenu)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
menu
Ptr GVariant
userData' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
userData
Ptr ContextMenu -> Ptr GVariant -> IO ()
webkit_context_menu_set_user_data Ptr ContextMenu
menu' Ptr GVariant
userData'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
menu
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
userData
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContextMenuSetUserDataMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsContextMenu a) => O.MethodInfo ContextMenuSetUserDataMethodInfo a signature where
overloadedMethod = contextMenuSetUserData
#endif