module Graphics.UI.Gtk.WebKit.DOM.Node
(nodeInsertBefore, nodeReplaceChild, nodeRemoveChild,
nodeAppendChild, nodeHasChildNodes, nodeCloneNode, nodeNormalize,
nodeIsSupported, nodeIsSameNode, nodeIsEqualNode, nodeLookupPrefix,
nodeIsDefaultNamespace, nodeLookupNamespaceURI,
nodeCompareDocumentPosition, nodeContains, nodeDispatchEvent,
cELEMENT_NODE, cATTRIBUTE_NODE, cTEXT_NODE, cCDATA_SECTION_NODE,
cENTITY_REFERENCE_NODE, cENTITY_NODE, cPROCESSING_INSTRUCTION_NODE,
cCOMMENT_NODE, cDOCUMENT_NODE, cDOCUMENT_TYPE_NODE,
cDOCUMENT_FRAGMENT_NODE, cNOTATION_NODE,
cDOCUMENT_POSITION_DISCONNECTED, cDOCUMENT_POSITION_PRECEDING,
cDOCUMENT_POSITION_FOLLOWING, cDOCUMENT_POSITION_CONTAINS,
cDOCUMENT_POSITION_CONTAINED_BY,
cDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, nodeGetNodeName,
nodeSetNodeValue, nodeGetNodeValue, nodeGetNodeType,
nodeGetParentNode, nodeGetChildNodes, nodeGetFirstChild,
nodeGetLastChild, nodeGetPreviousSibling, nodeGetNextSibling,
nodeGetOwnerDocument, nodeGetNamespaceURI, nodeSetPrefix,
nodeGetPrefix, nodeGetLocalName, nodeGetBaseURI,
nodeSetTextContent, nodeGetTextContent, nodeGetParentElement, Node,
NodeClass, castToNode, gTypeNode, toNode)
where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
nodeInsertBefore ::
(NodeClass self, NodeClass newChild, NodeClass refChild) =>
self -> Maybe newChild -> Maybe refChild -> IO (Maybe Node)
nodeInsertBefore self newChild refChild
= maybeNull (makeNewGObject mkNode)
(propagateGError $
\ errorPtr_ ->
(\(Node arg1) (Node arg2) (Node arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->webkit_dom_node_insert_before argPtr1 argPtr2 argPtr3 arg4) (toNode self)
(maybe (Node nullForeignPtr) toNode newChild)
(maybe (Node nullForeignPtr) toNode refChild)
errorPtr_)
nodeReplaceChild ::
(NodeClass self, NodeClass newChild, NodeClass oldChild) =>
self -> Maybe newChild -> Maybe oldChild -> IO (Maybe Node)
nodeReplaceChild self newChild oldChild
= maybeNull (makeNewGObject mkNode)
(propagateGError $
\ errorPtr_ ->
(\(Node arg1) (Node arg2) (Node arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->webkit_dom_node_replace_child argPtr1 argPtr2 argPtr3 arg4) (toNode self)
(maybe (Node nullForeignPtr) toNode newChild)
(maybe (Node nullForeignPtr) toNode oldChild)
errorPtr_)
nodeRemoveChild ::
(NodeClass self, NodeClass oldChild) =>
self -> Maybe oldChild -> IO (Maybe Node)
nodeRemoveChild self oldChild
= maybeNull (makeNewGObject mkNode)
(propagateGError $
\ errorPtr_ ->
(\(Node arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_remove_child argPtr1 argPtr2 arg3) (toNode self)
(maybe (Node nullForeignPtr) toNode oldChild)
errorPtr_)
nodeAppendChild ::
(NodeClass self, NodeClass newChild) =>
self -> Maybe newChild -> IO (Maybe Node)
nodeAppendChild self newChild
= maybeNull (makeNewGObject mkNode)
(propagateGError $
\ errorPtr_ ->
(\(Node arg1) (Node arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_append_child argPtr1 argPtr2 arg3) (toNode self)
(maybe (Node nullForeignPtr) toNode newChild)
errorPtr_)
nodeHasChildNodes :: (NodeClass self) => self -> IO Bool
nodeHasChildNodes self
= toBool <$>
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_has_child_nodes argPtr1) (toNode self))
nodeCloneNode ::
(NodeClass self) => self -> Bool -> IO (Maybe Node)
nodeCloneNode self deep
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_clone_node argPtr1 arg2) (toNode self)
(fromBool deep))
nodeNormalize :: (NodeClass self) => self -> IO ()
nodeNormalize self
= (\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_normalize argPtr1) (toNode self)
nodeIsSupported ::
(NodeClass self, GlibString string) =>
self -> string -> string -> IO Bool
nodeIsSupported self feature version
= toBool <$>
(withUTFString version $
\ versionPtr ->
withUTFString feature $
\ featurePtr ->
(\(Node arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_is_supported argPtr1 arg2 arg3) (toNode self) featurePtr
versionPtr)
nodeIsSameNode ::
(NodeClass self, NodeClass other) => self -> Maybe other -> IO Bool
nodeIsSameNode self other
= toBool <$>
((\(Node arg1) (Node arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_is_same_node argPtr1 argPtr2) (toNode self)
(maybe (Node nullForeignPtr) toNode other))
nodeIsEqualNode ::
(NodeClass self, NodeClass other) => self -> Maybe other -> IO Bool
nodeIsEqualNode self other
= toBool <$>
((\(Node arg1) (Node arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_is_equal_node argPtr1 argPtr2) (toNode self)
(maybe (Node nullForeignPtr) toNode other))
nodeLookupPrefix ::
(NodeClass self, GlibString string) => self -> string -> IO string
nodeLookupPrefix self namespaceURI
= (withUTFString namespaceURI $
\ namespaceURIPtr ->
(\(Node arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_lookup_prefix argPtr1 arg2) (toNode self)
namespaceURIPtr)
>>=
readUTFString
nodeIsDefaultNamespace ::
(NodeClass self, GlibString string) => self -> string -> IO Bool
nodeIsDefaultNamespace self namespaceURI
= toBool <$>
(withUTFString namespaceURI $
\ namespaceURIPtr ->
(\(Node arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_is_default_namespace argPtr1 arg2) (toNode self)
namespaceURIPtr)
nodeLookupNamespaceURI ::
(NodeClass self, GlibString string) => self -> string -> IO string
nodeLookupNamespaceURI self prefix
= (withUTFString prefix $
\ prefixPtr ->
(\(Node arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_lookup_namespace_uri argPtr1 arg2) (toNode self)
prefixPtr)
>>=
readUTFString
nodeCompareDocumentPosition ::
(NodeClass self, NodeClass other) => self -> Maybe other -> IO Word
nodeCompareDocumentPosition self other
= fromIntegral <$>
((\(Node arg1) (Node arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_compare_document_position argPtr1 argPtr2) (toNode self)
(maybe (Node nullForeignPtr) toNode other))
nodeContains ::
(NodeClass self, NodeClass other) => self -> Maybe other -> IO Bool
nodeContains self other
= toBool <$>
((\(Node arg1) (Node arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_contains argPtr1 argPtr2) (toNode self)
(maybe (Node nullForeignPtr) toNode other))
nodeDispatchEvent ::
(NodeClass self, EventClass event) =>
self -> Maybe event -> IO Bool
nodeDispatchEvent self event
= toBool <$>
(propagateGError $
\ errorPtr_ ->
(\(Node arg1) (Event arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->webkit_dom_node_dispatch_event argPtr1 argPtr2 arg3) (toNode self)
(maybe (Event nullForeignPtr) toEvent event)
errorPtr_)
cELEMENT_NODE = 1
cATTRIBUTE_NODE = 2
cTEXT_NODE = 3
cCDATA_SECTION_NODE = 4
cENTITY_REFERENCE_NODE = 5
cENTITY_NODE = 6
cPROCESSING_INSTRUCTION_NODE = 7
cCOMMENT_NODE = 8
cDOCUMENT_NODE = 9
cDOCUMENT_TYPE_NODE = 10
cDOCUMENT_FRAGMENT_NODE = 11
cNOTATION_NODE = 12
cDOCUMENT_POSITION_DISCONNECTED = 1
cDOCUMENT_POSITION_PRECEDING = 2
cDOCUMENT_POSITION_FOLLOWING = 4
cDOCUMENT_POSITION_CONTAINS = 8
cDOCUMENT_POSITION_CONTAINED_BY = 16
cDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32
nodeGetNodeName ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetNodeName self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_node_name argPtr1) (toNode self)) >>=
readUTFString
nodeSetNodeValue ::
(NodeClass self, GlibString string) => self -> string -> IO ()
nodeSetNodeValue self val
= propagateGError $
\ errorPtr_ ->
withUTFString val $
\ valPtr ->
(\(Node arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_set_node_value argPtr1 arg2 arg3) (toNode self) valPtr
errorPtr_
nodeGetNodeValue ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetNodeValue self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_node_value argPtr1) (toNode self)) >>=
readUTFString
nodeGetNodeType :: (NodeClass self) => self -> IO Word
nodeGetNodeType self
= fromIntegral <$>
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_node_type argPtr1) (toNode self))
nodeGetParentNode :: (NodeClass self) => self -> IO (Maybe Node)
nodeGetParentNode self
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_parent_node argPtr1) (toNode self))
nodeGetChildNodes ::
(NodeClass self) => self -> IO (Maybe NodeList)
nodeGetChildNodes self
= maybeNull (makeNewGObject mkNodeList)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_child_nodes argPtr1) (toNode self))
nodeGetFirstChild :: (NodeClass self) => self -> IO (Maybe Node)
nodeGetFirstChild self
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_first_child argPtr1) (toNode self))
nodeGetLastChild :: (NodeClass self) => self -> IO (Maybe Node)
nodeGetLastChild self
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_last_child argPtr1) (toNode self))
nodeGetPreviousSibling ::
(NodeClass self) => self -> IO (Maybe Node)
nodeGetPreviousSibling self
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_previous_sibling argPtr1) (toNode self))
nodeGetNextSibling :: (NodeClass self) => self -> IO (Maybe Node)
nodeGetNextSibling self
= maybeNull (makeNewGObject mkNode)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_next_sibling argPtr1) (toNode self))
nodeGetOwnerDocument ::
(NodeClass self) => self -> IO (Maybe Document)
nodeGetOwnerDocument self
= maybeNull (makeNewGObject mkDocument)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_owner_document argPtr1) (toNode self))
nodeGetNamespaceURI ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetNamespaceURI self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_namespace_uri argPtr1) (toNode self)) >>=
readUTFString
nodeSetPrefix ::
(NodeClass self, GlibString string) => self -> string -> IO ()
nodeSetPrefix self val
= propagateGError $
\ errorPtr_ ->
withUTFString val $
\ valPtr ->
(\(Node arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_set_prefix argPtr1 arg2 arg3) (toNode self) valPtr
errorPtr_
nodeGetPrefix ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetPrefix self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_prefix argPtr1) (toNode self)) >>=
readUTFString
nodeGetLocalName ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetLocalName self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_local_name argPtr1) (toNode self)) >>=
readUTFString
nodeGetBaseURI ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetBaseURI self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_base_uri argPtr1) (toNode self)) >>=
readUTFString
nodeSetTextContent ::
(NodeClass self, GlibString string) => self -> string -> IO ()
nodeSetTextContent self val
= propagateGError $
\ errorPtr_ ->
withUTFString val $
\ valPtr ->
(\(Node arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_set_text_content argPtr1 arg2 arg3) (toNode self) valPtr
errorPtr_
nodeGetTextContent ::
(NodeClass self, GlibString string) => self -> IO string
nodeGetTextContent self
= ((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_text_content argPtr1) (toNode self)) >>=
readUTFString
nodeGetParentElement ::
(NodeClass self) => self -> IO (Maybe Element)
nodeGetParentElement self
= maybeNull (makeNewGObject mkElement)
((\(Node arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_node_get_parent_element argPtr1) (toNode self))
foreign import ccall safe "webkit_dom_node_insert_before"
webkit_dom_node_insert_before :: ((Ptr Node) -> ((Ptr Node) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node))))))
foreign import ccall safe "webkit_dom_node_replace_child"
webkit_dom_node_replace_child :: ((Ptr Node) -> ((Ptr Node) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node))))))
foreign import ccall safe "webkit_dom_node_remove_child"
webkit_dom_node_remove_child :: ((Ptr Node) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))
foreign import ccall safe "webkit_dom_node_append_child"
webkit_dom_node_append_child :: ((Ptr Node) -> ((Ptr Node) -> ((Ptr (Ptr ())) -> (IO (Ptr Node)))))
foreign import ccall safe "webkit_dom_node_has_child_nodes"
webkit_dom_node_has_child_nodes :: ((Ptr Node) -> (IO CInt))
foreign import ccall safe "webkit_dom_node_clone_node"
webkit_dom_node_clone_node :: ((Ptr Node) -> (CInt -> (IO (Ptr Node))))
foreign import ccall safe "webkit_dom_node_normalize"
webkit_dom_node_normalize :: ((Ptr Node) -> (IO ()))
foreign import ccall safe "webkit_dom_node_is_supported"
webkit_dom_node_is_supported :: ((Ptr Node) -> ((Ptr CChar) -> ((Ptr CChar) -> (IO CInt))))
foreign import ccall safe "webkit_dom_node_is_same_node"
webkit_dom_node_is_same_node :: ((Ptr Node) -> ((Ptr Node) -> (IO CInt)))
foreign import ccall safe "webkit_dom_node_is_equal_node"
webkit_dom_node_is_equal_node :: ((Ptr Node) -> ((Ptr Node) -> (IO CInt)))
foreign import ccall safe "webkit_dom_node_lookup_prefix"
webkit_dom_node_lookup_prefix :: ((Ptr Node) -> ((Ptr CChar) -> (IO (Ptr CChar))))
foreign import ccall safe "webkit_dom_node_is_default_namespace"
webkit_dom_node_is_default_namespace :: ((Ptr Node) -> ((Ptr CChar) -> (IO CInt)))
foreign import ccall safe "webkit_dom_node_lookup_namespace_uri"
webkit_dom_node_lookup_namespace_uri :: ((Ptr Node) -> ((Ptr CChar) -> (IO (Ptr CChar))))
foreign import ccall safe "webkit_dom_node_compare_document_position"
webkit_dom_node_compare_document_position :: ((Ptr Node) -> ((Ptr Node) -> (IO CUShort)))
foreign import ccall safe "webkit_dom_node_contains"
webkit_dom_node_contains :: ((Ptr Node) -> ((Ptr Node) -> (IO CInt)))
foreign import ccall safe "webkit_dom_node_dispatch_event"
webkit_dom_node_dispatch_event :: ((Ptr Node) -> ((Ptr Event) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "webkit_dom_node_get_node_name"
webkit_dom_node_get_node_name :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_set_node_value"
webkit_dom_node_set_node_value :: ((Ptr Node) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))
foreign import ccall safe "webkit_dom_node_get_node_value"
webkit_dom_node_get_node_value :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_get_node_type"
webkit_dom_node_get_node_type :: ((Ptr Node) -> (IO CUShort))
foreign import ccall safe "webkit_dom_node_get_parent_node"
webkit_dom_node_get_parent_node :: ((Ptr Node) -> (IO (Ptr Node)))
foreign import ccall safe "webkit_dom_node_get_child_nodes"
webkit_dom_node_get_child_nodes :: ((Ptr Node) -> (IO (Ptr NodeList)))
foreign import ccall safe "webkit_dom_node_get_first_child"
webkit_dom_node_get_first_child :: ((Ptr Node) -> (IO (Ptr Node)))
foreign import ccall safe "webkit_dom_node_get_last_child"
webkit_dom_node_get_last_child :: ((Ptr Node) -> (IO (Ptr Node)))
foreign import ccall safe "webkit_dom_node_get_previous_sibling"
webkit_dom_node_get_previous_sibling :: ((Ptr Node) -> (IO (Ptr Node)))
foreign import ccall safe "webkit_dom_node_get_next_sibling"
webkit_dom_node_get_next_sibling :: ((Ptr Node) -> (IO (Ptr Node)))
foreign import ccall safe "webkit_dom_node_get_owner_document"
webkit_dom_node_get_owner_document :: ((Ptr Node) -> (IO (Ptr Document)))
foreign import ccall safe "webkit_dom_node_get_namespace_uri"
webkit_dom_node_get_namespace_uri :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_set_prefix"
webkit_dom_node_set_prefix :: ((Ptr Node) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))
foreign import ccall safe "webkit_dom_node_get_prefix"
webkit_dom_node_get_prefix :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_get_local_name"
webkit_dom_node_get_local_name :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_get_base_uri"
webkit_dom_node_get_base_uri :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_set_text_content"
webkit_dom_node_set_text_content :: ((Ptr Node) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))
foreign import ccall safe "webkit_dom_node_get_text_content"
webkit_dom_node_get_text_content :: ((Ptr Node) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_dom_node_get_parent_element"
webkit_dom_node_get_parent_element :: ((Ptr Node) -> (IO (Ptr Element)))