gi-webkit2webextension-0.2.10.12: GI/WebKit2WebExtension/Objects/WebEditor.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}
module GI.WebKit2WebExtension.Objects.WebEditor
(
-- * Exported types
WebEditor(..) ,
WebEditorK ,
toWebEditor ,
noWebEditor ,
-- * Methods
-- ** webEditorGetPage
webEditorGetPage ,
-- * Signals
-- ** SelectionChanged
WebEditorSelectionChangedCallback ,
WebEditorSelectionChangedCallbackC ,
WebEditorSelectionChangedSignalInfo ,
afterWebEditorSelectionChanged ,
mkWebEditorSelectionChangedCallback ,
noWebEditorSelectionChangedCallback ,
onWebEditorSelectionChanged ,
webEditorSelectionChangedCallbackWrapper,
webEditorSelectionChangedClosure ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.WebKit2WebExtension.Types
import GI.WebKit2WebExtension.Callbacks
import qualified GI.GObject as GObject
newtype WebEditor = WebEditor (ForeignPtr WebEditor)
foreign import ccall "webkit_web_editor_get_type"
c_webkit_web_editor_get_type :: IO GType
type instance ParentTypes WebEditor = WebEditorParentTypes
type WebEditorParentTypes = '[GObject.Object]
instance GObject WebEditor where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_web_editor_get_type
class GObject o => WebEditorK o
instance (GObject o, IsDescendantOf WebEditor o) => WebEditorK o
toWebEditor :: WebEditorK o => o -> IO WebEditor
toWebEditor = unsafeCastTo WebEditor
noWebEditor :: Maybe WebEditor
noWebEditor = Nothing
-- signal WebEditor::selection-changed
type WebEditorSelectionChangedCallback =
IO ()
noWebEditorSelectionChangedCallback :: Maybe WebEditorSelectionChangedCallback
noWebEditorSelectionChangedCallback = Nothing
type WebEditorSelectionChangedCallbackC =
Ptr () -> -- object
Ptr () -> -- user_data
IO ()
foreign import ccall "wrapper"
mkWebEditorSelectionChangedCallback :: WebEditorSelectionChangedCallbackC -> IO (FunPtr WebEditorSelectionChangedCallbackC)
webEditorSelectionChangedClosure :: WebEditorSelectionChangedCallback -> IO Closure
webEditorSelectionChangedClosure cb = newCClosure =<< mkWebEditorSelectionChangedCallback wrapped
where wrapped = webEditorSelectionChangedCallbackWrapper cb
webEditorSelectionChangedCallbackWrapper ::
WebEditorSelectionChangedCallback ->
Ptr () ->
Ptr () ->
IO ()
webEditorSelectionChangedCallbackWrapper _cb _ _ = do
_cb
onWebEditorSelectionChanged :: (GObject a, MonadIO m) => a -> WebEditorSelectionChangedCallback -> m SignalHandlerId
onWebEditorSelectionChanged obj cb = liftIO $ connectWebEditorSelectionChanged obj cb SignalConnectBefore
afterWebEditorSelectionChanged :: (GObject a, MonadIO m) => a -> WebEditorSelectionChangedCallback -> m SignalHandlerId
afterWebEditorSelectionChanged obj cb = connectWebEditorSelectionChanged obj cb SignalConnectAfter
connectWebEditorSelectionChanged :: (GObject a, MonadIO m) =>
a -> WebEditorSelectionChangedCallback -> SignalConnectMode -> m SignalHandlerId
connectWebEditorSelectionChanged obj cb after = liftIO $ do
cb' <- mkWebEditorSelectionChangedCallback (webEditorSelectionChangedCallbackWrapper cb)
connectSignalFunPtr obj "selection-changed" cb' after
type instance AttributeList WebEditor = WebEditorAttributeList
type WebEditorAttributeList = ('[ ] :: [(Symbol, *)])
data WebEditorSelectionChangedSignalInfo
instance SignalInfo WebEditorSelectionChangedSignalInfo where
type HaskellCallbackType WebEditorSelectionChangedSignalInfo = WebEditorSelectionChangedCallback
connectSignal _ = connectWebEditorSelectionChanged
type instance SignalList WebEditor = WebEditorSignalList
type WebEditorSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("selection-changed", WebEditorSelectionChangedSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
-- method WebEditor::get_page
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit2WebExtension" "WebEditor", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit2WebExtension" "WebEditor", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "WebKit2WebExtension" "WebPage"
-- throws : False
-- Skip return : False
foreign import ccall "webkit_web_editor_get_page" webkit_web_editor_get_page ::
Ptr WebEditor -> -- _obj : TInterface "WebKit2WebExtension" "WebEditor"
IO (Ptr WebPage)
webEditorGetPage ::
(MonadIO m, WebEditorK a) =>
a -> -- _obj
m WebPage
webEditorGetPage _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_web_editor_get_page _obj'
checkUnexpectedReturnNULL "webkit_web_editor_get_page" result
result' <- (newObject WebPage) result
touchManagedPtr _obj
return result'