{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

The WebKit Inspector is a graphical tool to inspect and change
the content of a 'GI.WebKit.Objects.WebView.WebView'. It also includes an interactive
JavaScriptDebugger. Using this class one can get a GtkWidget which
can be embedded into an application to show the inspector.

The inspector is available when the 'GI.WebKit.Objects.WebSettings.WebSettings' of the
'GI.WebKit.Objects.WebView.WebView' has set the 'GI.WebKit.Objects.WebSettings.WebSettings':@/enable-developer-extras/@
to true otherwise no inspector is available.

\<informalexample>\<programlisting>
\/\<!-- -->* Enable the developer extras *\<!-- -->\/
WebKitWebSettings *setting = webkit_web_view_get_settings (WEBKIT_WEB_VIEW(my_webview));
g_object_set (G_OBJECT(settings), \"enable-developer-extras\", TRUE, NULL);

\/\<!-- -->* load some data or reload to be able to inspect the page*\<!-- -->\/
webkit_web_view_open (WEBKIT_WEB_VIEW(my_webview), \"http:\/\/www.gnome.org\");

\/\<!-- -->* Embed the inspector somewhere *\<!-- -->\/
WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview));
g_signal_connect (G_OBJECT (inspector), \"inspect-web-view\", G_CALLBACK(create_gtk_window_around_it), NULL);
g_signal_connect (G_OBJECT (inspector), \"show-window\", G_CALLBACK(show_inpector_window), NULL));
g_signal_connect (G_OBJECT (inspector), \"notify::inspected-uri\", G_CALLBACK(inspected_uri_changed_do_stuff), NULL);
\<\/programlisting>\<\/informalexample>
-}

module GI.WebKit.Objects.WebInspector
    ( 

-- * Exported types
    WebInspector(..)                        ,
    IsWebInspector                          ,
    toWebInspector                          ,
    noWebInspector                          ,


 -- * Methods
-- ** close #method:close#
    WebInspectorCloseMethodInfo             ,
    webInspectorClose                       ,


-- ** getInspectedUri #method:getInspectedUri#
    WebInspectorGetInspectedUriMethodInfo   ,
    webInspectorGetInspectedUri             ,


-- ** getWebView #method:getWebView#
    WebInspectorGetWebViewMethodInfo        ,
    webInspectorGetWebView                  ,


-- ** inspectCoordinates #method:inspectCoordinates#
    WebInspectorInspectCoordinatesMethodInfo,
    webInspectorInspectCoordinates          ,


-- ** inspectNode #method:inspectNode#
    WebInspectorInspectNodeMethodInfo       ,
    webInspectorInspectNode                 ,


-- ** show #method:show#
    WebInspectorShowMethodInfo              ,
    webInspectorShow                        ,




 -- * Properties
-- ** inspectedUri #attr:inspectedUri#
    WebInspectorInspectedUriPropertyInfo    ,
    getWebInspectorInspectedUri             ,
    webInspectorInspectedUri                ,


-- ** javascriptProfilingEnabled #attr:javascriptProfilingEnabled#
    WebInspectorJavascriptProfilingEnabledPropertyInfo,
    constructWebInspectorJavascriptProfilingEnabled,
    getWebInspectorJavascriptProfilingEnabled,
    setWebInspectorJavascriptProfilingEnabled,
    webInspectorJavascriptProfilingEnabled  ,


-- ** timelineProfilingEnabled #attr:timelineProfilingEnabled#
    WebInspectorTimelineProfilingEnabledPropertyInfo,
    constructWebInspectorTimelineProfilingEnabled,
    getWebInspectorTimelineProfilingEnabled ,
    setWebInspectorTimelineProfilingEnabled ,
    webInspectorTimelineProfilingEnabled    ,


-- ** webView #attr:webView#
    WebInspectorWebViewPropertyInfo         ,
    getWebInspectorWebView                  ,
    webInspectorWebView                     ,




 -- * Signals
-- ** attachWindow #signal:attachWindow#
    C_WebInspectorAttachWindowCallback      ,
    WebInspectorAttachWindowCallback        ,
    WebInspectorAttachWindowSignalInfo      ,
    afterWebInspectorAttachWindow           ,
    genClosure_WebInspectorAttachWindow     ,
    mk_WebInspectorAttachWindowCallback     ,
    noWebInspectorAttachWindowCallback      ,
    onWebInspectorAttachWindow              ,
    wrap_WebInspectorAttachWindowCallback   ,


-- ** closeWindow #signal:closeWindow#
    C_WebInspectorCloseWindowCallback       ,
    WebInspectorCloseWindowCallback         ,
    WebInspectorCloseWindowSignalInfo       ,
    afterWebInspectorCloseWindow            ,
    genClosure_WebInspectorCloseWindow      ,
    mk_WebInspectorCloseWindowCallback      ,
    noWebInspectorCloseWindowCallback       ,
    onWebInspectorCloseWindow               ,
    wrap_WebInspectorCloseWindowCallback    ,


-- ** detachWindow #signal:detachWindow#
    C_WebInspectorDetachWindowCallback      ,
    WebInspectorDetachWindowCallback        ,
    WebInspectorDetachWindowSignalInfo      ,
    afterWebInspectorDetachWindow           ,
    genClosure_WebInspectorDetachWindow     ,
    mk_WebInspectorDetachWindowCallback     ,
    noWebInspectorDetachWindowCallback      ,
    onWebInspectorDetachWindow              ,
    wrap_WebInspectorDetachWindowCallback   ,


-- ** finished #signal:finished#
    C_WebInspectorFinishedCallback          ,
    WebInspectorFinishedCallback            ,
    WebInspectorFinishedSignalInfo          ,
    afterWebInspectorFinished               ,
    genClosure_WebInspectorFinished         ,
    mk_WebInspectorFinishedCallback         ,
    noWebInspectorFinishedCallback          ,
    onWebInspectorFinished                  ,
    wrap_WebInspectorFinishedCallback       ,


-- ** inspectWebView #signal:inspectWebView#
    C_WebInspectorInspectWebViewCallback    ,
    WebInspectorInspectWebViewCallback      ,
    WebInspectorInspectWebViewSignalInfo    ,
    afterWebInspectorInspectWebView         ,
    genClosure_WebInspectorInspectWebView   ,
    mk_WebInspectorInspectWebViewCallback   ,
    noWebInspectorInspectWebViewCallback    ,
    onWebInspectorInspectWebView            ,
    wrap_WebInspectorInspectWebViewCallback ,


-- ** showWindow #signal:showWindow#
    C_WebInspectorShowWindowCallback        ,
    WebInspectorShowWindowCallback          ,
    WebInspectorShowWindowSignalInfo        ,
    afterWebInspectorShowWindow             ,
    genClosure_WebInspectorShowWindow       ,
    mk_WebInspectorShowWindowCallback       ,
    noWebInspectorShowWindowCallback        ,
    onWebInspectorShowWindow                ,
    wrap_WebInspectorShowWindowCallback     ,




    ) 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
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMNode as WebKit.DOMNode
import {-# SOURCE #-} qualified GI.WebKit.Objects.WebView as WebKit.WebView

newtype WebInspector = WebInspector (ManagedPtr WebInspector)
foreign import ccall "webkit_web_inspector_get_type"
    c_webkit_web_inspector_get_type :: IO GType

instance GObject WebInspector where
    gobjectType _ = c_webkit_web_inspector_get_type
    

class GObject o => IsWebInspector o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError WebInspector a) =>
    IsWebInspector a
#endif
instance IsWebInspector WebInspector
instance GObject.Object.IsObject WebInspector

toWebInspector :: IsWebInspector o => o -> IO WebInspector
toWebInspector = unsafeCastTo WebInspector

noWebInspector :: Maybe WebInspector
noWebInspector = Nothing

type family ResolveWebInspectorMethod (t :: Symbol) (o :: *) :: * where
    ResolveWebInspectorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWebInspectorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWebInspectorMethod "close" o = WebInspectorCloseMethodInfo
    ResolveWebInspectorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWebInspectorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWebInspectorMethod "inspectCoordinates" o = WebInspectorInspectCoordinatesMethodInfo
    ResolveWebInspectorMethod "inspectNode" o = WebInspectorInspectNodeMethodInfo
    ResolveWebInspectorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWebInspectorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWebInspectorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWebInspectorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWebInspectorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWebInspectorMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveWebInspectorMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveWebInspectorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWebInspectorMethod "show" o = WebInspectorShowMethodInfo
    ResolveWebInspectorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWebInspectorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWebInspectorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWebInspectorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWebInspectorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWebInspectorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWebInspectorMethod "getInspectedUri" o = WebInspectorGetInspectedUriMethodInfo
    ResolveWebInspectorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWebInspectorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWebInspectorMethod "getWebView" o = WebInspectorGetWebViewMethodInfo
    ResolveWebInspectorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWebInspectorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWebInspectorMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveWebInspectorMethod t WebInspector, O.MethodInfo info WebInspector p) => O.IsLabelProxy t (WebInspector -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveWebInspectorMethod t WebInspector, O.MethodInfo info WebInspector p) => O.IsLabel t (WebInspector -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- signal WebInspector::attach-window
type WebInspectorAttachWindowCallback =
    IO Bool

noWebInspectorAttachWindowCallback :: Maybe WebInspectorAttachWindowCallback
noWebInspectorAttachWindowCallback = Nothing

type C_WebInspectorAttachWindowCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_WebInspectorAttachWindowCallback :: C_WebInspectorAttachWindowCallback -> IO (FunPtr C_WebInspectorAttachWindowCallback)

genClosure_WebInspectorAttachWindow :: WebInspectorAttachWindowCallback -> IO Closure
genClosure_WebInspectorAttachWindow cb = do
    let cb' = wrap_WebInspectorAttachWindowCallback cb
    mk_WebInspectorAttachWindowCallback cb' >>= newCClosure


wrap_WebInspectorAttachWindowCallback ::
    WebInspectorAttachWindowCallback ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_WebInspectorAttachWindowCallback _cb _ _ = do
    result <- _cb 
    let result' = (fromIntegral . fromEnum) result
    return result'


onWebInspectorAttachWindow :: (GObject a, MonadIO m) => a -> WebInspectorAttachWindowCallback -> m SignalHandlerId
onWebInspectorAttachWindow obj cb = liftIO $ connectWebInspectorAttachWindow obj cb SignalConnectBefore
afterWebInspectorAttachWindow :: (GObject a, MonadIO m) => a -> WebInspectorAttachWindowCallback -> m SignalHandlerId
afterWebInspectorAttachWindow obj cb = connectWebInspectorAttachWindow obj cb SignalConnectAfter

connectWebInspectorAttachWindow :: (GObject a, MonadIO m) =>
                                   a -> WebInspectorAttachWindowCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorAttachWindow obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorAttachWindowCallback cb
    cb'' <- mk_WebInspectorAttachWindowCallback cb'
    connectSignalFunPtr obj "attach-window" cb'' after

-- signal WebInspector::close-window
type WebInspectorCloseWindowCallback =
    IO Bool

noWebInspectorCloseWindowCallback :: Maybe WebInspectorCloseWindowCallback
noWebInspectorCloseWindowCallback = Nothing

type C_WebInspectorCloseWindowCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_WebInspectorCloseWindowCallback :: C_WebInspectorCloseWindowCallback -> IO (FunPtr C_WebInspectorCloseWindowCallback)

genClosure_WebInspectorCloseWindow :: WebInspectorCloseWindowCallback -> IO Closure
genClosure_WebInspectorCloseWindow cb = do
    let cb' = wrap_WebInspectorCloseWindowCallback cb
    mk_WebInspectorCloseWindowCallback cb' >>= newCClosure


wrap_WebInspectorCloseWindowCallback ::
    WebInspectorCloseWindowCallback ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_WebInspectorCloseWindowCallback _cb _ _ = do
    result <- _cb 
    let result' = (fromIntegral . fromEnum) result
    return result'


onWebInspectorCloseWindow :: (GObject a, MonadIO m) => a -> WebInspectorCloseWindowCallback -> m SignalHandlerId
onWebInspectorCloseWindow obj cb = liftIO $ connectWebInspectorCloseWindow obj cb SignalConnectBefore
afterWebInspectorCloseWindow :: (GObject a, MonadIO m) => a -> WebInspectorCloseWindowCallback -> m SignalHandlerId
afterWebInspectorCloseWindow obj cb = connectWebInspectorCloseWindow obj cb SignalConnectAfter

connectWebInspectorCloseWindow :: (GObject a, MonadIO m) =>
                                  a -> WebInspectorCloseWindowCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorCloseWindow obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorCloseWindowCallback cb
    cb'' <- mk_WebInspectorCloseWindowCallback cb'
    connectSignalFunPtr obj "close-window" cb'' after

-- signal WebInspector::detach-window
type WebInspectorDetachWindowCallback =
    IO Bool

noWebInspectorDetachWindowCallback :: Maybe WebInspectorDetachWindowCallback
noWebInspectorDetachWindowCallback = Nothing

type C_WebInspectorDetachWindowCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_WebInspectorDetachWindowCallback :: C_WebInspectorDetachWindowCallback -> IO (FunPtr C_WebInspectorDetachWindowCallback)

genClosure_WebInspectorDetachWindow :: WebInspectorDetachWindowCallback -> IO Closure
genClosure_WebInspectorDetachWindow cb = do
    let cb' = wrap_WebInspectorDetachWindowCallback cb
    mk_WebInspectorDetachWindowCallback cb' >>= newCClosure


wrap_WebInspectorDetachWindowCallback ::
    WebInspectorDetachWindowCallback ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_WebInspectorDetachWindowCallback _cb _ _ = do
    result <- _cb 
    let result' = (fromIntegral . fromEnum) result
    return result'


onWebInspectorDetachWindow :: (GObject a, MonadIO m) => a -> WebInspectorDetachWindowCallback -> m SignalHandlerId
onWebInspectorDetachWindow obj cb = liftIO $ connectWebInspectorDetachWindow obj cb SignalConnectBefore
afterWebInspectorDetachWindow :: (GObject a, MonadIO m) => a -> WebInspectorDetachWindowCallback -> m SignalHandlerId
afterWebInspectorDetachWindow obj cb = connectWebInspectorDetachWindow obj cb SignalConnectAfter

connectWebInspectorDetachWindow :: (GObject a, MonadIO m) =>
                                   a -> WebInspectorDetachWindowCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorDetachWindow obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorDetachWindowCallback cb
    cb'' <- mk_WebInspectorDetachWindowCallback cb'
    connectSignalFunPtr obj "detach-window" cb'' after

-- signal WebInspector::finished
type WebInspectorFinishedCallback =
    IO ()

noWebInspectorFinishedCallback :: Maybe WebInspectorFinishedCallback
noWebInspectorFinishedCallback = Nothing

type C_WebInspectorFinishedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_WebInspectorFinishedCallback :: C_WebInspectorFinishedCallback -> IO (FunPtr C_WebInspectorFinishedCallback)

genClosure_WebInspectorFinished :: WebInspectorFinishedCallback -> IO Closure
genClosure_WebInspectorFinished cb = do
    let cb' = wrap_WebInspectorFinishedCallback cb
    mk_WebInspectorFinishedCallback cb' >>= newCClosure


wrap_WebInspectorFinishedCallback ::
    WebInspectorFinishedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_WebInspectorFinishedCallback _cb _ _ = do
    _cb 


onWebInspectorFinished :: (GObject a, MonadIO m) => a -> WebInspectorFinishedCallback -> m SignalHandlerId
onWebInspectorFinished obj cb = liftIO $ connectWebInspectorFinished obj cb SignalConnectBefore
afterWebInspectorFinished :: (GObject a, MonadIO m) => a -> WebInspectorFinishedCallback -> m SignalHandlerId
afterWebInspectorFinished obj cb = connectWebInspectorFinished obj cb SignalConnectAfter

connectWebInspectorFinished :: (GObject a, MonadIO m) =>
                               a -> WebInspectorFinishedCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorFinished obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorFinishedCallback cb
    cb'' <- mk_WebInspectorFinishedCallback cb'
    connectSignalFunPtr obj "finished" cb'' after

-- signal WebInspector::inspect-web-view
type WebInspectorInspectWebViewCallback =
    WebKit.WebView.WebView ->
    IO WebKit.WebView.WebView

noWebInspectorInspectWebViewCallback :: Maybe WebInspectorInspectWebViewCallback
noWebInspectorInspectWebViewCallback = Nothing

type C_WebInspectorInspectWebViewCallback =
    Ptr () ->                               -- object
    Ptr WebKit.WebView.WebView ->
    Ptr () ->                               -- user_data
    IO (Ptr WebKit.WebView.WebView)

foreign import ccall "wrapper"
    mk_WebInspectorInspectWebViewCallback :: C_WebInspectorInspectWebViewCallback -> IO (FunPtr C_WebInspectorInspectWebViewCallback)

genClosure_WebInspectorInspectWebView :: WebInspectorInspectWebViewCallback -> IO Closure
genClosure_WebInspectorInspectWebView cb = do
    let cb' = wrap_WebInspectorInspectWebViewCallback cb
    mk_WebInspectorInspectWebViewCallback cb' >>= newCClosure


wrap_WebInspectorInspectWebViewCallback ::
    WebInspectorInspectWebViewCallback ->
    Ptr () ->
    Ptr WebKit.WebView.WebView ->
    Ptr () ->
    IO (Ptr WebKit.WebView.WebView)
wrap_WebInspectorInspectWebViewCallback _cb _ webView _ = do
    webView' <- (newObject WebKit.WebView.WebView) webView
    result <- _cb  webView'
    result' <- unsafeManagedPtrCastPtr result
    return result'


onWebInspectorInspectWebView :: (GObject a, MonadIO m) => a -> WebInspectorInspectWebViewCallback -> m SignalHandlerId
onWebInspectorInspectWebView obj cb = liftIO $ connectWebInspectorInspectWebView obj cb SignalConnectBefore
afterWebInspectorInspectWebView :: (GObject a, MonadIO m) => a -> WebInspectorInspectWebViewCallback -> m SignalHandlerId
afterWebInspectorInspectWebView obj cb = connectWebInspectorInspectWebView obj cb SignalConnectAfter

connectWebInspectorInspectWebView :: (GObject a, MonadIO m) =>
                                     a -> WebInspectorInspectWebViewCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorInspectWebView obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorInspectWebViewCallback cb
    cb'' <- mk_WebInspectorInspectWebViewCallback cb'
    connectSignalFunPtr obj "inspect-web-view" cb'' after

-- signal WebInspector::show-window
type WebInspectorShowWindowCallback =
    IO Bool

noWebInspectorShowWindowCallback :: Maybe WebInspectorShowWindowCallback
noWebInspectorShowWindowCallback = Nothing

type C_WebInspectorShowWindowCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_WebInspectorShowWindowCallback :: C_WebInspectorShowWindowCallback -> IO (FunPtr C_WebInspectorShowWindowCallback)

genClosure_WebInspectorShowWindow :: WebInspectorShowWindowCallback -> IO Closure
genClosure_WebInspectorShowWindow cb = do
    let cb' = wrap_WebInspectorShowWindowCallback cb
    mk_WebInspectorShowWindowCallback cb' >>= newCClosure


wrap_WebInspectorShowWindowCallback ::
    WebInspectorShowWindowCallback ->
    Ptr () ->
    Ptr () ->
    IO CInt
wrap_WebInspectorShowWindowCallback _cb _ _ = do
    result <- _cb 
    let result' = (fromIntegral . fromEnum) result
    return result'


onWebInspectorShowWindow :: (GObject a, MonadIO m) => a -> WebInspectorShowWindowCallback -> m SignalHandlerId
onWebInspectorShowWindow obj cb = liftIO $ connectWebInspectorShowWindow obj cb SignalConnectBefore
afterWebInspectorShowWindow :: (GObject a, MonadIO m) => a -> WebInspectorShowWindowCallback -> m SignalHandlerId
afterWebInspectorShowWindow obj cb = connectWebInspectorShowWindow obj cb SignalConnectAfter

connectWebInspectorShowWindow :: (GObject a, MonadIO m) =>
                                 a -> WebInspectorShowWindowCallback -> SignalConnectMode -> m SignalHandlerId
connectWebInspectorShowWindow obj cb after = liftIO $ do
    let cb' = wrap_WebInspectorShowWindowCallback cb
    cb'' <- mk_WebInspectorShowWindowCallback cb'
    connectSignalFunPtr obj "show-window" cb'' after

-- VVV Prop "inspected-uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebInspectorInspectedUri :: (MonadIO m, IsWebInspector o) => o -> m T.Text
getWebInspectorInspectedUri obj = liftIO $ checkUnexpectedNothing "getWebInspectorInspectedUri" $ getObjectPropertyString obj "inspected-uri"

data WebInspectorInspectedUriPropertyInfo
instance AttrInfo WebInspectorInspectedUriPropertyInfo where
    type AttrAllowedOps WebInspectorInspectedUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebInspectorInspectedUriPropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebInspectorInspectedUriPropertyInfo = IsWebInspector
    type AttrGetType WebInspectorInspectedUriPropertyInfo = T.Text
    type AttrLabel WebInspectorInspectedUriPropertyInfo = "inspected-uri"
    type AttrOrigin WebInspectorInspectedUriPropertyInfo = WebInspector
    attrGet _ = getWebInspectorInspectedUri
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "javascript-profiling-enabled"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getWebInspectorJavascriptProfilingEnabled :: (MonadIO m, IsWebInspector o) => o -> m Bool
getWebInspectorJavascriptProfilingEnabled obj = liftIO $ getObjectPropertyBool obj "javascript-profiling-enabled"

setWebInspectorJavascriptProfilingEnabled :: (MonadIO m, IsWebInspector o) => o -> Bool -> m ()
setWebInspectorJavascriptProfilingEnabled obj val = liftIO $ setObjectPropertyBool obj "javascript-profiling-enabled" val

constructWebInspectorJavascriptProfilingEnabled :: (IsWebInspector o) => Bool -> IO (GValueConstruct o)
constructWebInspectorJavascriptProfilingEnabled val = constructObjectPropertyBool "javascript-profiling-enabled" val

data WebInspectorJavascriptProfilingEnabledPropertyInfo
instance AttrInfo WebInspectorJavascriptProfilingEnabledPropertyInfo where
    type AttrAllowedOps WebInspectorJavascriptProfilingEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint WebInspectorJavascriptProfilingEnabledPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint WebInspectorJavascriptProfilingEnabledPropertyInfo = IsWebInspector
    type AttrGetType WebInspectorJavascriptProfilingEnabledPropertyInfo = Bool
    type AttrLabel WebInspectorJavascriptProfilingEnabledPropertyInfo = "javascript-profiling-enabled"
    type AttrOrigin WebInspectorJavascriptProfilingEnabledPropertyInfo = WebInspector
    attrGet _ = getWebInspectorJavascriptProfilingEnabled
    attrSet _ = setWebInspectorJavascriptProfilingEnabled
    attrConstruct _ = constructWebInspectorJavascriptProfilingEnabled
    attrClear _ = undefined

-- VVV Prop "timeline-profiling-enabled"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getWebInspectorTimelineProfilingEnabled :: (MonadIO m, IsWebInspector o) => o -> m Bool
getWebInspectorTimelineProfilingEnabled obj = liftIO $ getObjectPropertyBool obj "timeline-profiling-enabled"

setWebInspectorTimelineProfilingEnabled :: (MonadIO m, IsWebInspector o) => o -> Bool -> m ()
setWebInspectorTimelineProfilingEnabled obj val = liftIO $ setObjectPropertyBool obj "timeline-profiling-enabled" val

constructWebInspectorTimelineProfilingEnabled :: (IsWebInspector o) => Bool -> IO (GValueConstruct o)
constructWebInspectorTimelineProfilingEnabled val = constructObjectPropertyBool "timeline-profiling-enabled" val

data WebInspectorTimelineProfilingEnabledPropertyInfo
instance AttrInfo WebInspectorTimelineProfilingEnabledPropertyInfo where
    type AttrAllowedOps WebInspectorTimelineProfilingEnabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint WebInspectorTimelineProfilingEnabledPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint WebInspectorTimelineProfilingEnabledPropertyInfo = IsWebInspector
    type AttrGetType WebInspectorTimelineProfilingEnabledPropertyInfo = Bool
    type AttrLabel WebInspectorTimelineProfilingEnabledPropertyInfo = "timeline-profiling-enabled"
    type AttrOrigin WebInspectorTimelineProfilingEnabledPropertyInfo = WebInspector
    attrGet _ = getWebInspectorTimelineProfilingEnabled
    attrSet _ = setWebInspectorTimelineProfilingEnabled
    attrConstruct _ = constructWebInspectorTimelineProfilingEnabled
    attrClear _ = undefined

-- VVV Prop "web-view"
   -- Type: TInterface (Name {namespace = "WebKit", name = "WebView"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebInspectorWebView :: (MonadIO m, IsWebInspector o) => o -> m WebKit.WebView.WebView
getWebInspectorWebView obj = liftIO $ checkUnexpectedNothing "getWebInspectorWebView" $ getObjectPropertyObject obj "web-view" WebKit.WebView.WebView

data WebInspectorWebViewPropertyInfo
instance AttrInfo WebInspectorWebViewPropertyInfo where
    type AttrAllowedOps WebInspectorWebViewPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebInspectorWebViewPropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebInspectorWebViewPropertyInfo = IsWebInspector
    type AttrGetType WebInspectorWebViewPropertyInfo = WebKit.WebView.WebView
    type AttrLabel WebInspectorWebViewPropertyInfo = "web-view"
    type AttrOrigin WebInspectorWebViewPropertyInfo = WebInspector
    attrGet _ = getWebInspectorWebView
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList WebInspector
type instance O.AttributeList WebInspector = WebInspectorAttributeList
type WebInspectorAttributeList = ('[ '("inspectedUri", WebInspectorInspectedUriPropertyInfo), '("javascriptProfilingEnabled", WebInspectorJavascriptProfilingEnabledPropertyInfo), '("timelineProfilingEnabled", WebInspectorTimelineProfilingEnabledPropertyInfo), '("webView", WebInspectorWebViewPropertyInfo)] :: [(Symbol, *)])

webInspectorInspectedUri :: AttrLabelProxy "inspectedUri"
webInspectorInspectedUri = AttrLabelProxy

webInspectorJavascriptProfilingEnabled :: AttrLabelProxy "javascriptProfilingEnabled"
webInspectorJavascriptProfilingEnabled = AttrLabelProxy

webInspectorTimelineProfilingEnabled :: AttrLabelProxy "timelineProfilingEnabled"
webInspectorTimelineProfilingEnabled = AttrLabelProxy

webInspectorWebView :: AttrLabelProxy "webView"
webInspectorWebView = AttrLabelProxy

data WebInspectorAttachWindowSignalInfo
instance SignalInfo WebInspectorAttachWindowSignalInfo where
    type HaskellCallbackType WebInspectorAttachWindowSignalInfo = WebInspectorAttachWindowCallback
    connectSignal _ = connectWebInspectorAttachWindow

data WebInspectorCloseWindowSignalInfo
instance SignalInfo WebInspectorCloseWindowSignalInfo where
    type HaskellCallbackType WebInspectorCloseWindowSignalInfo = WebInspectorCloseWindowCallback
    connectSignal _ = connectWebInspectorCloseWindow

data WebInspectorDetachWindowSignalInfo
instance SignalInfo WebInspectorDetachWindowSignalInfo where
    type HaskellCallbackType WebInspectorDetachWindowSignalInfo = WebInspectorDetachWindowCallback
    connectSignal _ = connectWebInspectorDetachWindow

data WebInspectorFinishedSignalInfo
instance SignalInfo WebInspectorFinishedSignalInfo where
    type HaskellCallbackType WebInspectorFinishedSignalInfo = WebInspectorFinishedCallback
    connectSignal _ = connectWebInspectorFinished

data WebInspectorInspectWebViewSignalInfo
instance SignalInfo WebInspectorInspectWebViewSignalInfo where
    type HaskellCallbackType WebInspectorInspectWebViewSignalInfo = WebInspectorInspectWebViewCallback
    connectSignal _ = connectWebInspectorInspectWebView

data WebInspectorShowWindowSignalInfo
instance SignalInfo WebInspectorShowWindowSignalInfo where
    type HaskellCallbackType WebInspectorShowWindowSignalInfo = WebInspectorShowWindowCallback
    connectSignal _ = connectWebInspectorShowWindow

type instance O.SignalList WebInspector = WebInspectorSignalList
type WebInspectorSignalList = ('[ '("attachWindow", WebInspectorAttachWindowSignalInfo), '("closeWindow", WebInspectorCloseWindowSignalInfo), '("detachWindow", WebInspectorDetachWindowSignalInfo), '("finished", WebInspectorFinishedSignalInfo), '("inspectWebView", WebInspectorInspectWebViewSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("showWindow", WebInspectorShowWindowSignalInfo)] :: [(Symbol, *)])

-- method WebInspector::close
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebInspector that will be closed", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_close" webkit_web_inspector_close :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    IO ()

{- |
Causes the Web Inspector to be closed.

@since 1.1.17
-}
webInspectorClose ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a) =>
    a
    {- ^ /@webInspector@/: the 'GI.WebKit.Objects.WebInspector.WebInspector' that will be closed -}
    -> m ()
webInspectorClose webInspector = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    webkit_web_inspector_close webInspector'
    touchManagedPtr webInspector
    return ()

data WebInspectorCloseMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebInspector a) => O.MethodInfo WebInspectorCloseMethodInfo a signature where
    overloadedMethod _ = webInspectorClose

-- method WebInspector::get_inspected_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebInspector", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_get_inspected_uri" webkit_web_inspector_get_inspected_uri :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    IO CString

{- |
Obtains the URI that is currently being inspected.

@since 1.0.3
-}
webInspectorGetInspectedUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a) =>
    a
    {- ^ /@webInspector@/: a 'GI.WebKit.Objects.WebInspector.WebInspector' -}
    -> m T.Text
    {- ^ __Returns:__ a pointer to the URI as an internally allocated string; it
should not be freed, modified or stored. -}
webInspectorGetInspectedUri webInspector = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    result <- webkit_web_inspector_get_inspected_uri webInspector'
    checkUnexpectedReturnNULL "webInspectorGetInspectedUri" result
    result' <- cstringToText result
    touchManagedPtr webInspector
    return result'

data WebInspectorGetInspectedUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebInspector a) => O.MethodInfo WebInspectorGetInspectedUriMethodInfo a signature where
    overloadedMethod _ = webInspectorGetInspectedUri

-- method WebInspector::get_web_view
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebInspector", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit", name = "WebView"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_get_web_view" webkit_web_inspector_get_web_view :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    IO (Ptr WebKit.WebView.WebView)

{- |
Obtains the 'GI.WebKit.Objects.WebView.WebView' that is used to render the
inspector. The 'GI.WebKit.Objects.WebView.WebView' instance is created by the
application, by handling the 'GI.WebKit.Objects.WebInspector.WebInspector'::@/inspect-web-view/@ signal. This means
that this method may return 'Nothing' if the user hasn\'t inspected
anything.

@since 1.0.3
-}
webInspectorGetWebView ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a) =>
    a
    {- ^ /@webInspector@/: a 'GI.WebKit.Objects.WebInspector.WebInspector' -}
    -> m WebKit.WebView.WebView
    {- ^ __Returns:__ the 'GI.WebKit.Objects.WebView.WebView' instance that is used
to render the inspector or 'Nothing' if it is not yet created. -}
webInspectorGetWebView webInspector = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    result <- webkit_web_inspector_get_web_view webInspector'
    checkUnexpectedReturnNULL "webInspectorGetWebView" result
    result' <- (newObject WebKit.WebView.WebView) result
    touchManagedPtr webInspector
    return result'

data WebInspectorGetWebViewMethodInfo
instance (signature ~ (m WebKit.WebView.WebView), MonadIO m, IsWebInspector a) => O.MethodInfo WebInspectorGetWebViewMethodInfo a signature where
    overloadedMethod _ = webInspectorGetWebView

-- method WebInspector::inspect_coordinates
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebInspector that will do the inspection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the X coordinate of the node to be inspected", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the Y coordinate of the node to be inspected", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_inspect_coordinates" webkit_web_inspector_inspect_coordinates :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    IO ()

{- |
Causes the Web Inspector to inspect the node that is located at the
given coordinates of the widget. The coordinates should be relative
to the 'GI.WebKit.Objects.WebView.WebView' widget, not to the scrollable content, and
may be obtained from a 'GI.Gdk.Unions.Event.Event' directly.

This means /@x@/, and /@y@/ being zero doesn\'t guarantee you will hit the
left-most top corner of the content, since the contents may have
been scrolled.

@since 1.1.17
-}
webInspectorInspectCoordinates ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a) =>
    a
    {- ^ /@webInspector@/: the 'GI.WebKit.Objects.WebInspector.WebInspector' that will do the inspection -}
    -> Double
    {- ^ /@x@/: the X coordinate of the node to be inspected -}
    -> Double
    {- ^ /@y@/: the Y coordinate of the node to be inspected -}
    -> m ()
webInspectorInspectCoordinates webInspector x y = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    let x' = realToFrac x
    let y' = realToFrac y
    webkit_web_inspector_inspect_coordinates webInspector' x' y'
    touchManagedPtr webInspector
    return ()

data WebInspectorInspectCoordinatesMethodInfo
instance (signature ~ (Double -> Double -> m ()), MonadIO m, IsWebInspector a) => O.MethodInfo WebInspectorInspectCoordinatesMethodInfo a signature where
    overloadedMethod _ = webInspectorInspectCoordinates

-- method WebInspector::inspect_node
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebInspector that will do the inspection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "node", argType = TInterface (Name {namespace = "WebKit", name = "DOMNode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitDOMNode to inspect", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_inspect_node" webkit_web_inspector_inspect_node :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    Ptr WebKit.DOMNode.DOMNode ->           -- node : TInterface (Name {namespace = "WebKit", name = "DOMNode"})
    IO ()

{- |
Causes the Web Inspector to inspect the given node.

@since 1.3.7
-}
webInspectorInspectNode ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a, WebKit.DOMNode.IsDOMNode b) =>
    a
    {- ^ /@webInspector@/: the 'GI.WebKit.Objects.WebInspector.WebInspector' that will do the inspection -}
    -> b
    {- ^ /@node@/: the 'GI.WebKit.Objects.DOMNode.DOMNode' to inspect -}
    -> m ()
webInspectorInspectNode webInspector node = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    node' <- unsafeManagedPtrCastPtr node
    webkit_web_inspector_inspect_node webInspector' node'
    touchManagedPtr webInspector
    touchManagedPtr node
    return ()

data WebInspectorInspectNodeMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsWebInspector a, WebKit.DOMNode.IsDOMNode b) => O.MethodInfo WebInspectorInspectNodeMethodInfo a signature where
    overloadedMethod _ = webInspectorInspectNode

-- method WebInspector::show
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_inspector", argType = TInterface (Name {namespace = "WebKit", name = "WebInspector"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebInspector that will be shown", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_inspector_show" webkit_web_inspector_show :: 
    Ptr WebInspector ->                     -- web_inspector : TInterface (Name {namespace = "WebKit", name = "WebInspector"})
    IO ()

{- |
Causes the Web Inspector to be shown.

@since 1.1.17
-}
webInspectorShow ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebInspector a) =>
    a
    {- ^ /@webInspector@/: the 'GI.WebKit.Objects.WebInspector.WebInspector' that will be shown -}
    -> m ()
webInspectorShow webInspector = liftIO $ do
    webInspector' <- unsafeManagedPtrCastPtr webInspector
    webkit_web_inspector_show webInspector'
    touchManagedPtr webInspector
    return ()

data WebInspectorShowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebInspector a) => O.MethodInfo WebInspectorShowMethodInfo a signature where
    overloadedMethod _ = webInspectorShow