{- |
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.WebKit.Objects.DOMWebKitPoint
    ( 

-- * Exported types
    DOMWebKitPoint(..)                      ,
    IsDOMWebKitPoint                        ,
    toDOMWebKitPoint                        ,
    noDOMWebKitPoint                        ,


 -- * Methods
-- ** getX #method:getX#
    DOMWebKitPointGetXMethodInfo            ,
    dOMWebKitPointGetX                      ,


-- ** getY #method:getY#
    DOMWebKitPointGetYMethodInfo            ,
    dOMWebKitPointGetY                      ,


-- ** setX #method:setX#
    DOMWebKitPointSetXMethodInfo            ,
    dOMWebKitPointSetX                      ,


-- ** setY #method:setY#
    DOMWebKitPointSetYMethodInfo            ,
    dOMWebKitPointSetY                      ,




 -- * Properties
-- ** x #attr:x#
    DOMWebKitPointXPropertyInfo             ,
    constructDOMWebKitPointX                ,
    dOMWebKitPointX                         ,
    getDOMWebKitPointX                      ,
    setDOMWebKitPointX                      ,


-- ** y #attr:y#
    DOMWebKitPointYPropertyInfo             ,
    constructDOMWebKitPointY                ,
    dOMWebKitPointY                         ,
    getDOMWebKitPointY                      ,
    setDOMWebKitPointY                      ,




    ) 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.DOMObject as WebKit.DOMObject

newtype DOMWebKitPoint = DOMWebKitPoint (ManagedPtr DOMWebKitPoint)
foreign import ccall "webkit_dom_webkit_point_get_type"
    c_webkit_dom_webkit_point_get_type :: IO GType

instance GObject DOMWebKitPoint where
    gobjectType _ = c_webkit_dom_webkit_point_get_type
    

class GObject o => IsDOMWebKitPoint o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMWebKitPoint a) =>
    IsDOMWebKitPoint a
#endif
instance IsDOMWebKitPoint DOMWebKitPoint
instance WebKit.DOMObject.IsDOMObject DOMWebKitPoint
instance GObject.Object.IsObject DOMWebKitPoint

toDOMWebKitPoint :: IsDOMWebKitPoint o => o -> IO DOMWebKitPoint
toDOMWebKitPoint = unsafeCastTo DOMWebKitPoint

noDOMWebKitPoint :: Maybe DOMWebKitPoint
noDOMWebKitPoint = Nothing

type family ResolveDOMWebKitPointMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMWebKitPointMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMWebKitPointMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMWebKitPointMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMWebKitPointMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMWebKitPointMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMWebKitPointMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMWebKitPointMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMWebKitPointMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMWebKitPointMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMWebKitPointMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDOMWebKitPointMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDOMWebKitPointMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMWebKitPointMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMWebKitPointMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMWebKitPointMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMWebKitPointMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMWebKitPointMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMWebKitPointMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMWebKitPointMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMWebKitPointMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMWebKitPointMethod "getX" o = DOMWebKitPointGetXMethodInfo
    ResolveDOMWebKitPointMethod "getY" o = DOMWebKitPointGetYMethodInfo
    ResolveDOMWebKitPointMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMWebKitPointMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMWebKitPointMethod "setX" o = DOMWebKitPointSetXMethodInfo
    ResolveDOMWebKitPointMethod "setY" o = DOMWebKitPointSetYMethodInfo
    ResolveDOMWebKitPointMethod l o = O.MethodResolutionFailed l o

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

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

-- VVV Prop "x"
   -- Type: TBasicType TFloat
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getDOMWebKitPointX :: (MonadIO m, IsDOMWebKitPoint o) => o -> m Float
getDOMWebKitPointX obj = liftIO $ getObjectPropertyFloat obj "x"

setDOMWebKitPointX :: (MonadIO m, IsDOMWebKitPoint o) => o -> Float -> m ()
setDOMWebKitPointX obj val = liftIO $ setObjectPropertyFloat obj "x" val

constructDOMWebKitPointX :: (IsDOMWebKitPoint o) => Float -> IO (GValueConstruct o)
constructDOMWebKitPointX val = constructObjectPropertyFloat "x" val

data DOMWebKitPointXPropertyInfo
instance AttrInfo DOMWebKitPointXPropertyInfo where
    type AttrAllowedOps DOMWebKitPointXPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DOMWebKitPointXPropertyInfo = (~) Float
    type AttrBaseTypeConstraint DOMWebKitPointXPropertyInfo = IsDOMWebKitPoint
    type AttrGetType DOMWebKitPointXPropertyInfo = Float
    type AttrLabel DOMWebKitPointXPropertyInfo = "x"
    type AttrOrigin DOMWebKitPointXPropertyInfo = DOMWebKitPoint
    attrGet _ = getDOMWebKitPointX
    attrSet _ = setDOMWebKitPointX
    attrConstruct _ = constructDOMWebKitPointX
    attrClear _ = undefined

-- VVV Prop "y"
   -- Type: TBasicType TFloat
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getDOMWebKitPointY :: (MonadIO m, IsDOMWebKitPoint o) => o -> m Float
getDOMWebKitPointY obj = liftIO $ getObjectPropertyFloat obj "y"

setDOMWebKitPointY :: (MonadIO m, IsDOMWebKitPoint o) => o -> Float -> m ()
setDOMWebKitPointY obj val = liftIO $ setObjectPropertyFloat obj "y" val

constructDOMWebKitPointY :: (IsDOMWebKitPoint o) => Float -> IO (GValueConstruct o)
constructDOMWebKitPointY val = constructObjectPropertyFloat "y" val

data DOMWebKitPointYPropertyInfo
instance AttrInfo DOMWebKitPointYPropertyInfo where
    type AttrAllowedOps DOMWebKitPointYPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DOMWebKitPointYPropertyInfo = (~) Float
    type AttrBaseTypeConstraint DOMWebKitPointYPropertyInfo = IsDOMWebKitPoint
    type AttrGetType DOMWebKitPointYPropertyInfo = Float
    type AttrLabel DOMWebKitPointYPropertyInfo = "y"
    type AttrOrigin DOMWebKitPointYPropertyInfo = DOMWebKitPoint
    attrGet _ = getDOMWebKitPointY
    attrSet _ = setDOMWebKitPointY
    attrConstruct _ = constructDOMWebKitPointY
    attrClear _ = undefined

instance O.HasAttributeList DOMWebKitPoint
type instance O.AttributeList DOMWebKitPoint = DOMWebKitPointAttributeList
type DOMWebKitPointAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("x", DOMWebKitPointXPropertyInfo), '("y", DOMWebKitPointYPropertyInfo)] :: [(Symbol, *)])

dOMWebKitPointX :: AttrLabelProxy "x"
dOMWebKitPointX = AttrLabelProxy

dOMWebKitPointY :: AttrLabelProxy "y"
dOMWebKitPointY = AttrLabelProxy

type instance O.SignalList DOMWebKitPoint = DOMWebKitPointSignalList
type DOMWebKitPointSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

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

foreign import ccall "webkit_dom_webkit_point_get_x" webkit_dom_webkit_point_get_x :: 
    Ptr DOMWebKitPoint ->                   -- self : TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"})
    IO CFloat

{- |
/No description available in the introspection data./
-}
dOMWebKitPointGetX ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMWebKitPoint a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMWebKitPoint.DOMWebKitPoint' -}
    -> m Float
    {- ^ __Returns:__ A @/gfloat/@ -}
dOMWebKitPointGetX self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_webkit_point_get_x self'
    let result' = realToFrac result
    touchManagedPtr self
    return result'

data DOMWebKitPointGetXMethodInfo
instance (signature ~ (m Float), MonadIO m, IsDOMWebKitPoint a) => O.MethodInfo DOMWebKitPointGetXMethodInfo a signature where
    overloadedMethod _ = dOMWebKitPointGetX

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

foreign import ccall "webkit_dom_webkit_point_get_y" webkit_dom_webkit_point_get_y :: 
    Ptr DOMWebKitPoint ->                   -- self : TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"})
    IO CFloat

{- |
/No description available in the introspection data./
-}
dOMWebKitPointGetY ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMWebKitPoint a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMWebKitPoint.DOMWebKitPoint' -}
    -> m Float
    {- ^ __Returns:__ A @/gfloat/@ -}
dOMWebKitPointGetY self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_webkit_point_get_y self'
    let result' = realToFrac result
    touchManagedPtr self
    return result'

data DOMWebKitPointGetYMethodInfo
instance (signature ~ (m Float), MonadIO m, IsDOMWebKitPoint a) => O.MethodInfo DOMWebKitPointGetYMethodInfo a signature where
    overloadedMethod _ = dOMWebKitPointGetY

-- method DOMWebKitPoint::set_x
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMWebKitPoint", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TFloat, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gfloat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_webkit_point_set_x" webkit_dom_webkit_point_set_x :: 
    Ptr DOMWebKitPoint ->                   -- self : TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"})
    CFloat ->                               -- value : TBasicType TFloat
    IO ()

{- |
/No description available in the introspection data./
-}
dOMWebKitPointSetX ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMWebKitPoint a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMWebKitPoint.DOMWebKitPoint' -}
    -> Float
    {- ^ /@value@/: A @/gfloat/@ -}
    -> m ()
dOMWebKitPointSetX self value = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let value' = realToFrac value
    webkit_dom_webkit_point_set_x self' value'
    touchManagedPtr self
    return ()

data DOMWebKitPointSetXMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m, IsDOMWebKitPoint a) => O.MethodInfo DOMWebKitPointSetXMethodInfo a signature where
    overloadedMethod _ = dOMWebKitPointSetX

-- method DOMWebKitPoint::set_y
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMWebKitPoint", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TBasicType TFloat, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gfloat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_webkit_point_set_y" webkit_dom_webkit_point_set_y :: 
    Ptr DOMWebKitPoint ->                   -- self : TInterface (Name {namespace = "WebKit", name = "DOMWebKitPoint"})
    CFloat ->                               -- value : TBasicType TFloat
    IO ()

{- |
/No description available in the introspection data./
-}
dOMWebKitPointSetY ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMWebKitPoint a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMWebKitPoint.DOMWebKitPoint' -}
    -> Float
    {- ^ /@value@/: A @/gfloat/@ -}
    -> m ()
dOMWebKitPointSetY self value = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let value' = realToFrac value
    webkit_dom_webkit_point_set_y self' value'
    touchManagedPtr self
    return ()

data DOMWebKitPointSetYMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m, IsDOMWebKitPoint a) => O.MethodInfo DOMWebKitPointSetYMethodInfo a signature where
    overloadedMethod _ = dOMWebKitPointSetY