#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Handy.Objects.EnumValueObject
(
EnumValueObject(..) ,
IsEnumValueObject ,
toEnumValueObject ,
noEnumValueObject ,
#if ENABLE_OVERLOADING
EnumValueObjectGetNameMethodInfo ,
#endif
enumValueObjectGetName ,
#if ENABLE_OVERLOADING
EnumValueObjectGetNickMethodInfo ,
#endif
enumValueObjectGetNick ,
#if ENABLE_OVERLOADING
EnumValueObjectGetValueMethodInfo ,
#endif
enumValueObjectGetValue ,
enumValueObjectNew ,
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.GObject.Structs.EnumValue as GObject.EnumValue
newtype EnumValueObject = EnumValueObject (ManagedPtr EnumValueObject)
foreign import ccall "hdy_enum_value_object_get_type"
c_hdy_enum_value_object_get_type :: IO GType
instance GObject EnumValueObject where
gobjectType = c_hdy_enum_value_object_get_type
class (GObject o, O.IsDescendantOf EnumValueObject o) => IsEnumValueObject o
instance (GObject o, O.IsDescendantOf EnumValueObject o) => IsEnumValueObject o
instance O.HasParentTypes EnumValueObject
type instance O.ParentTypes EnumValueObject = '[GObject.Object.Object]
toEnumValueObject :: (MonadIO m, IsEnumValueObject o) => o -> m EnumValueObject
toEnumValueObject = liftIO . unsafeCastTo EnumValueObject
noEnumValueObject :: Maybe EnumValueObject
noEnumValueObject = Nothing
#if ENABLE_OVERLOADING
type family ResolveEnumValueObjectMethod (t :: Symbol) (o :: *) :: * where
ResolveEnumValueObjectMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveEnumValueObjectMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveEnumValueObjectMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveEnumValueObjectMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveEnumValueObjectMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveEnumValueObjectMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveEnumValueObjectMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveEnumValueObjectMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveEnumValueObjectMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveEnumValueObjectMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveEnumValueObjectMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveEnumValueObjectMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveEnumValueObjectMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveEnumValueObjectMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveEnumValueObjectMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveEnumValueObjectMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveEnumValueObjectMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveEnumValueObjectMethod "getName" o = EnumValueObjectGetNameMethodInfo
ResolveEnumValueObjectMethod "getNick" o = EnumValueObjectGetNickMethodInfo
ResolveEnumValueObjectMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveEnumValueObjectMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveEnumValueObjectMethod "getValue" o = EnumValueObjectGetValueMethodInfo
ResolveEnumValueObjectMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveEnumValueObjectMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEnumValueObjectMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEnumValueObjectMethod t EnumValueObject, O.MethodInfo info EnumValueObject p) => OL.IsLabel t (EnumValueObject -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EnumValueObject
type instance O.AttributeList EnumValueObject = EnumValueObjectAttributeList
type EnumValueObjectAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList EnumValueObject = EnumValueObjectSignalList
type EnumValueObjectSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "hdy_enum_value_object_new" hdy_enum_value_object_new ::
Ptr GObject.EnumValue.EnumValue ->
IO (Ptr EnumValueObject)
enumValueObjectNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
GObject.EnumValue.EnumValue
-> m EnumValueObject
enumValueObjectNew enumValue = liftIO $ do
enumValue' <- unsafeManagedPtrGetPtr enumValue
result <- hdy_enum_value_object_new enumValue'
checkUnexpectedReturnNULL "enumValueObjectNew" result
result' <- (wrapObject EnumValueObject) result
touchManagedPtr enumValue
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "hdy_enum_value_object_get_name" hdy_enum_value_object_get_name ::
Ptr EnumValueObject ->
IO CString
enumValueObjectGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
a
-> m T.Text
enumValueObjectGetName self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- hdy_enum_value_object_get_name self'
checkUnexpectedReturnNULL "enumValueObjectGetName" result
result' <- cstringToText result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data EnumValueObjectGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetNameMethodInfo a signature where
overloadedMethod _ = enumValueObjectGetName
#endif
foreign import ccall "hdy_enum_value_object_get_nick" hdy_enum_value_object_get_nick ::
Ptr EnumValueObject ->
IO CString
enumValueObjectGetNick ::
(B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
a
-> m T.Text
enumValueObjectGetNick self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- hdy_enum_value_object_get_nick self'
checkUnexpectedReturnNULL "enumValueObjectGetNick" result
result' <- cstringToText result
touchManagedPtr self
return result'
#if ENABLE_OVERLOADING
data EnumValueObjectGetNickMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetNickMethodInfo a signature where
overloadedMethod _ = enumValueObjectGetNick
#endif
foreign import ccall "hdy_enum_value_object_get_value" hdy_enum_value_object_get_value ::
Ptr EnumValueObject ->
IO Int32
enumValueObjectGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
a
-> m Int32
enumValueObjectGetValue self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- hdy_enum_value_object_get_value self'
touchManagedPtr self
return result
#if ENABLE_OVERLOADING
data EnumValueObjectGetValueMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetValueMethodInfo a signature where
overloadedMethod _ = enumValueObjectGetValue
#endif