module GI.WebKit.Objects.WebPlugin
(
WebPlugin(..) ,
IsWebPlugin ,
toWebPlugin ,
noWebPlugin ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginGetDescriptionMethodInfo ,
#endif
webPluginGetDescription ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginGetEnabledMethodInfo ,
#endif
webPluginGetEnabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginGetNameMethodInfo ,
#endif
webPluginGetName ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginGetPathMethodInfo ,
#endif
webPluginGetPath ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginSetEnabledMethodInfo ,
#endif
webPluginSetEnabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
WebPluginEnabledPropertyInfo ,
#endif
constructWebPluginEnabled ,
getWebPluginEnabled ,
setWebPluginEnabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
webPluginEnabled ,
#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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
newtype WebPlugin = WebPlugin (ManagedPtr WebPlugin)
foreign import ccall "webkit_web_plugin_get_type"
c_webkit_web_plugin_get_type :: IO GType
instance GObject WebPlugin where
gobjectType _ = c_webkit_web_plugin_get_type
class GObject o => IsWebPlugin o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError WebPlugin a) =>
IsWebPlugin a
#endif
instance IsWebPlugin WebPlugin
instance GObject.Object.IsObject WebPlugin
toWebPlugin :: (MonadIO m, IsWebPlugin o) => o -> m WebPlugin
toWebPlugin = liftIO . unsafeCastTo WebPlugin
noWebPlugin :: Maybe WebPlugin
noWebPlugin = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveWebPluginMethod (t :: Symbol) (o :: *) :: * where
ResolveWebPluginMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveWebPluginMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveWebPluginMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveWebPluginMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveWebPluginMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveWebPluginMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveWebPluginMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveWebPluginMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveWebPluginMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveWebPluginMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveWebPluginMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveWebPluginMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveWebPluginMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveWebPluginMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveWebPluginMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveWebPluginMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveWebPluginMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveWebPluginMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveWebPluginMethod "getDescription" o = WebPluginGetDescriptionMethodInfo
ResolveWebPluginMethod "getEnabled" o = WebPluginGetEnabledMethodInfo
ResolveWebPluginMethod "getName" o = WebPluginGetNameMethodInfo
ResolveWebPluginMethod "getPath" o = WebPluginGetPathMethodInfo
ResolveWebPluginMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveWebPluginMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveWebPluginMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveWebPluginMethod "setEnabled" o = WebPluginSetEnabledMethodInfo
ResolveWebPluginMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveWebPluginMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveWebPluginMethod t WebPlugin, O.MethodInfo info WebPlugin p) => O.IsLabelProxy t (WebPlugin -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveWebPluginMethod t WebPlugin, O.MethodInfo info WebPlugin p) => O.IsLabel t (WebPlugin -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getWebPluginEnabled :: (MonadIO m, IsWebPlugin o) => o -> m Bool
getWebPluginEnabled obj = liftIO $ getObjectPropertyBool obj "enabled"
setWebPluginEnabled :: (MonadIO m, IsWebPlugin o) => o -> Bool -> m ()
setWebPluginEnabled obj val = liftIO $ setObjectPropertyBool obj "enabled" val
constructWebPluginEnabled :: (IsWebPlugin o) => Bool -> IO (GValueConstruct o)
constructWebPluginEnabled val = constructObjectPropertyBool "enabled" val
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginEnabledPropertyInfo
instance AttrInfo WebPluginEnabledPropertyInfo where
type AttrAllowedOps WebPluginEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint WebPluginEnabledPropertyInfo = (~) Bool
type AttrBaseTypeConstraint WebPluginEnabledPropertyInfo = IsWebPlugin
type AttrGetType WebPluginEnabledPropertyInfo = Bool
type AttrLabel WebPluginEnabledPropertyInfo = "enabled"
type AttrOrigin WebPluginEnabledPropertyInfo = WebPlugin
attrGet _ = getWebPluginEnabled
attrSet _ = setWebPluginEnabled
attrConstruct _ = constructWebPluginEnabled
attrClear _ = undefined
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList WebPlugin
type instance O.AttributeList WebPlugin = WebPluginAttributeList
type WebPluginAttributeList = ('[ '("enabled", WebPluginEnabledPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
webPluginEnabled :: AttrLabelProxy "enabled"
webPluginEnabled = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList WebPlugin = WebPluginSignalList
type WebPluginSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_web_plugin_get_description" webkit_web_plugin_get_description ::
Ptr WebPlugin ->
IO CString
webPluginGetDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsWebPlugin a) =>
a
-> m T.Text
webPluginGetDescription plugin = liftIO $ do
plugin' <- unsafeManagedPtrCastPtr plugin
result <- webkit_web_plugin_get_description plugin'
checkUnexpectedReturnNULL "webPluginGetDescription" result
result' <- cstringToText result
touchManagedPtr plugin
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebPlugin a) => O.MethodInfo WebPluginGetDescriptionMethodInfo a signature where
overloadedMethod _ = webPluginGetDescription
#endif
foreign import ccall "webkit_web_plugin_get_enabled" webkit_web_plugin_get_enabled ::
Ptr WebPlugin ->
IO CInt
webPluginGetEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsWebPlugin a) =>
a
-> m Bool
webPluginGetEnabled plugin = liftIO $ do
plugin' <- unsafeManagedPtrCastPtr plugin
result <- webkit_web_plugin_get_enabled plugin'
let result' = (/= 0) result
touchManagedPtr plugin
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginGetEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsWebPlugin a) => O.MethodInfo WebPluginGetEnabledMethodInfo a signature where
overloadedMethod _ = webPluginGetEnabled
#endif
foreign import ccall "webkit_web_plugin_get_name" webkit_web_plugin_get_name ::
Ptr WebPlugin ->
IO CString
webPluginGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsWebPlugin a) =>
a
-> m T.Text
webPluginGetName plugin = liftIO $ do
plugin' <- unsafeManagedPtrCastPtr plugin
result <- webkit_web_plugin_get_name plugin'
checkUnexpectedReturnNULL "webPluginGetName" result
result' <- cstringToText result
touchManagedPtr plugin
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebPlugin a) => O.MethodInfo WebPluginGetNameMethodInfo a signature where
overloadedMethod _ = webPluginGetName
#endif
foreign import ccall "webkit_web_plugin_get_path" webkit_web_plugin_get_path ::
Ptr WebPlugin ->
IO CString
webPluginGetPath ::
(B.CallStack.HasCallStack, MonadIO m, IsWebPlugin a) =>
a
-> m T.Text
webPluginGetPath plugin = liftIO $ do
plugin' <- unsafeManagedPtrCastPtr plugin
result <- webkit_web_plugin_get_path plugin'
checkUnexpectedReturnNULL "webPluginGetPath" result
result' <- cstringToText result
touchManagedPtr plugin
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginGetPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebPlugin a) => O.MethodInfo WebPluginGetPathMethodInfo a signature where
overloadedMethod _ = webPluginGetPath
#endif
foreign import ccall "webkit_web_plugin_set_enabled" webkit_web_plugin_set_enabled ::
Ptr WebPlugin ->
CInt ->
IO ()
webPluginSetEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsWebPlugin a) =>
a
-> Bool
-> m ()
webPluginSetEnabled plugin enabled = liftIO $ do
plugin' <- unsafeManagedPtrCastPtr plugin
let enabled' = (fromIntegral . fromEnum) enabled
webkit_web_plugin_set_enabled plugin' enabled'
touchManagedPtr plugin
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data WebPluginSetEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsWebPlugin a) => O.MethodInfo WebPluginSetEnabledMethodInfo a signature where
overloadedMethod _ = webPluginSetEnabled
#endif