{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Clutter.Objects.Action
(
Action(..) ,
IsAction ,
toAction ,
#if defined(ENABLE_OVERLOADING)
ResolveActionMethod ,
#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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import {-# SOURCE #-} qualified GI.Clutter.Objects.ActorMeta as Clutter.ActorMeta
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Action = Action (SP.ManagedPtr Action)
deriving (Action -> Action -> Bool
(Action -> Action -> Bool)
-> (Action -> Action -> Bool) -> Eq Action
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
/= :: Action -> Action -> Bool
Eq)
instance SP.ManagedPtrNewtype Action where
toManagedPtr :: Action -> ManagedPtr Action
toManagedPtr (Action ManagedPtr Action
p) = ManagedPtr Action
p
foreign import ccall "clutter_action_get_type"
c_clutter_action_get_type :: IO B.Types.GType
instance B.Types.TypedObject Action where
glibType :: IO GType
glibType = IO GType
c_clutter_action_get_type
instance B.Types.GObject Action
class (SP.GObject o, O.IsDescendantOf Action o) => IsAction o
instance (SP.GObject o, O.IsDescendantOf Action o) => IsAction o
instance O.HasParentTypes Action
type instance O.ParentTypes Action = '[Clutter.ActorMeta.ActorMeta, GObject.Object.Object]
toAction :: (MIO.MonadIO m, IsAction o) => o -> m Action
toAction :: forall (m :: * -> *) o. (MonadIO m, IsAction o) => o -> m Action
toAction = IO Action -> m Action
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Action -> m Action) -> (o -> IO Action) -> o -> m Action
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Action -> Action) -> o -> IO Action
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Action -> Action
Action
instance B.GValue.IsGValue (Maybe Action) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_clutter_action_get_type
gvalueSet_ :: Ptr GValue -> Maybe Action -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Action
P.Nothing = Ptr GValue -> Ptr Action -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Action
forall a. Ptr a
FP.nullPtr :: FP.Ptr Action)
gvalueSet_ Ptr GValue
gv (P.Just Action
obj) = Action -> (Ptr Action -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Action
obj (Ptr GValue -> Ptr Action -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Action)
gvalueGet_ Ptr GValue
gv = do
Ptr Action
ptr <- Ptr GValue -> IO (Ptr Action)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Action)
if Ptr Action
ptr Ptr Action -> Ptr Action -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Action
forall a. Ptr a
FP.nullPtr
then Action -> Maybe Action
forall a. a -> Maybe a
P.Just (Action -> Maybe Action) -> IO Action -> IO (Maybe Action)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Action -> Action) -> Ptr Action -> IO Action
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Action -> Action
Action Ptr Action
ptr
else Maybe Action -> IO (Maybe Action)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Action
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveActionMethod (t :: Symbol) (o :: *) :: * where
ResolveActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveActionMethod "getActor" o = Clutter.ActorMeta.ActorMetaGetActorMethodInfo
ResolveActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveActionMethod "getEnabled" o = Clutter.ActorMeta.ActorMetaGetEnabledMethodInfo
ResolveActionMethod "getName" o = Clutter.ActorMeta.ActorMetaGetNameMethodInfo
ResolveActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveActionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveActionMethod "setEnabled" o = Clutter.ActorMeta.ActorMetaSetEnabledMethodInfo
ResolveActionMethod "setName" o = Clutter.ActorMeta.ActorMetaSetNameMethodInfo
ResolveActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveActionMethod t Action, O.OverloadedMethod info Action p) => OL.IsLabel t (Action -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveActionMethod t Action, O.OverloadedMethod info Action p, R.HasField t Action p) => R.HasField t Action p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveActionMethod t Action, O.OverloadedMethodInfo info Action) => OL.IsLabel t (O.MethodProxy info Action) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Action
type instance O.AttributeList Action = ActionAttributeList
type ActionAttributeList = ('[ '("actor", Clutter.ActorMeta.ActorMetaActorPropertyInfo), '("enabled", Clutter.ActorMeta.ActorMetaEnabledPropertyInfo), '("name", Clutter.ActorMeta.ActorMetaNamePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Action = ActionSignalList
type ActionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif