{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Json.Objects.Generator
(
Generator(..) ,
IsGenerator ,
toGenerator ,
#if defined(ENABLE_OVERLOADING)
ResolveGeneratorMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
GeneratorGetIndentMethodInfo ,
#endif
generatorGetIndent ,
#if defined(ENABLE_OVERLOADING)
GeneratorGetIndentCharMethodInfo ,
#endif
generatorGetIndentChar ,
#if defined(ENABLE_OVERLOADING)
GeneratorGetPrettyMethodInfo ,
#endif
generatorGetPretty ,
#if defined(ENABLE_OVERLOADING)
GeneratorGetRootMethodInfo ,
#endif
generatorGetRoot ,
generatorNew ,
#if defined(ENABLE_OVERLOADING)
GeneratorSetIndentMethodInfo ,
#endif
generatorSetIndent ,
#if defined(ENABLE_OVERLOADING)
GeneratorSetIndentCharMethodInfo ,
#endif
generatorSetIndentChar ,
#if defined(ENABLE_OVERLOADING)
GeneratorSetPrettyMethodInfo ,
#endif
generatorSetPretty ,
#if defined(ENABLE_OVERLOADING)
GeneratorSetRootMethodInfo ,
#endif
generatorSetRoot ,
#if defined(ENABLE_OVERLOADING)
GeneratorToDataMethodInfo ,
#endif
generatorToData ,
#if defined(ENABLE_OVERLOADING)
GeneratorToFileMethodInfo ,
#endif
generatorToFile ,
#if defined(ENABLE_OVERLOADING)
GeneratorToGstringMethodInfo ,
#endif
generatorToGstring ,
#if defined(ENABLE_OVERLOADING)
GeneratorToStreamMethodInfo ,
#endif
generatorToStream ,
#if defined(ENABLE_OVERLOADING)
GeneratorIndentPropertyInfo ,
#endif
constructGeneratorIndent ,
#if defined(ENABLE_OVERLOADING)
generatorIndent ,
#endif
getGeneratorIndent ,
setGeneratorIndent ,
#if defined(ENABLE_OVERLOADING)
GeneratorIndentCharPropertyInfo ,
#endif
constructGeneratorIndentChar ,
#if defined(ENABLE_OVERLOADING)
generatorIndentChar ,
#endif
getGeneratorIndentChar ,
setGeneratorIndentChar ,
#if defined(ENABLE_OVERLOADING)
GeneratorPrettyPropertyInfo ,
#endif
constructGeneratorPretty ,
#if defined(ENABLE_OVERLOADING)
generatorPretty ,
#endif
getGeneratorPretty ,
setGeneratorPretty ,
#if defined(ENABLE_OVERLOADING)
GeneratorRootPropertyInfo ,
#endif
constructGeneratorRoot ,
#if defined(ENABLE_OVERLOADING)
generatorRoot ,
#endif
getGeneratorRoot ,
setGeneratorRoot ,
) 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 qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Json.Structs.Node as Json.Node
newtype Generator = Generator (SP.ManagedPtr Generator)
deriving (Generator -> Generator -> Bool
(Generator -> Generator -> Bool)
-> (Generator -> Generator -> Bool) -> Eq Generator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Generator -> Generator -> Bool
== :: Generator -> Generator -> Bool
$c/= :: Generator -> Generator -> Bool
/= :: Generator -> Generator -> Bool
Eq)
instance SP.ManagedPtrNewtype Generator where
toManagedPtr :: Generator -> ManagedPtr Generator
toManagedPtr (Generator ManagedPtr Generator
p) = ManagedPtr Generator
p
foreign import ccall "json_generator_get_type"
c_json_generator_get_type :: IO B.Types.GType
instance B.Types.TypedObject Generator where
glibType :: IO GType
glibType = IO GType
c_json_generator_get_type
instance B.Types.GObject Generator
class (SP.GObject o, O.IsDescendantOf Generator o) => IsGenerator o
instance (SP.GObject o, O.IsDescendantOf Generator o) => IsGenerator o
instance O.HasParentTypes Generator
type instance O.ParentTypes Generator = '[GObject.Object.Object]
toGenerator :: (MIO.MonadIO m, IsGenerator o) => o -> m Generator
toGenerator :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> m Generator
toGenerator = IO Generator -> m Generator
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Generator -> m Generator)
-> (o -> IO Generator) -> o -> m Generator
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Generator -> Generator) -> o -> IO Generator
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Generator -> Generator
Generator
instance B.GValue.IsGValue (Maybe Generator) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_json_generator_get_type
gvalueSet_ :: Ptr GValue -> Maybe Generator -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Generator
P.Nothing = Ptr GValue -> Ptr Generator -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Generator
forall a. Ptr a
FP.nullPtr :: FP.Ptr Generator)
gvalueSet_ Ptr GValue
gv (P.Just Generator
obj) = Generator -> (Ptr Generator -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Generator
obj (Ptr GValue -> Ptr Generator -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Generator)
gvalueGet_ Ptr GValue
gv = do
Ptr Generator
ptr <- Ptr GValue -> IO (Ptr Generator)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Generator)
if Ptr Generator
ptr Ptr Generator -> Ptr Generator -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Generator
forall a. Ptr a
FP.nullPtr
then Generator -> Maybe Generator
forall a. a -> Maybe a
P.Just (Generator -> Maybe Generator)
-> IO Generator -> IO (Maybe Generator)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Generator -> Generator)
-> Ptr Generator -> IO Generator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Generator -> Generator
Generator Ptr Generator
ptr
else Maybe Generator -> IO (Maybe Generator)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Generator
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveGeneratorMethod (t :: Symbol) (o :: *) :: * where
ResolveGeneratorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveGeneratorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveGeneratorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveGeneratorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveGeneratorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveGeneratorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveGeneratorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveGeneratorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveGeneratorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveGeneratorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveGeneratorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveGeneratorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveGeneratorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveGeneratorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveGeneratorMethod "toData" o = GeneratorToDataMethodInfo
ResolveGeneratorMethod "toFile" o = GeneratorToFileMethodInfo
ResolveGeneratorMethod "toGstring" o = GeneratorToGstringMethodInfo
ResolveGeneratorMethod "toStream" o = GeneratorToStreamMethodInfo
ResolveGeneratorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveGeneratorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveGeneratorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveGeneratorMethod "getIndent" o = GeneratorGetIndentMethodInfo
ResolveGeneratorMethod "getIndentChar" o = GeneratorGetIndentCharMethodInfo
ResolveGeneratorMethod "getPretty" o = GeneratorGetPrettyMethodInfo
ResolveGeneratorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveGeneratorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveGeneratorMethod "getRoot" o = GeneratorGetRootMethodInfo
ResolveGeneratorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveGeneratorMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveGeneratorMethod "setIndent" o = GeneratorSetIndentMethodInfo
ResolveGeneratorMethod "setIndentChar" o = GeneratorSetIndentCharMethodInfo
ResolveGeneratorMethod "setPretty" o = GeneratorSetPrettyMethodInfo
ResolveGeneratorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveGeneratorMethod "setRoot" o = GeneratorSetRootMethodInfo
ResolveGeneratorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGeneratorMethod t Generator, O.OverloadedMethod info Generator p) => OL.IsLabel t (Generator -> 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 ~ ResolveGeneratorMethod t Generator, O.OverloadedMethod info Generator p, R.HasField t Generator p) => R.HasField t Generator p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveGeneratorMethod t Generator, O.OverloadedMethodInfo info Generator) => OL.IsLabel t (O.MethodProxy info Generator) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getGeneratorIndent :: (MonadIO m, IsGenerator o) => o -> m Word32
getGeneratorIndent :: forall (m :: * -> *) o. (MonadIO m, IsGenerator o) => o -> m Word32
getGeneratorIndent o
obj = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"indent"
setGeneratorIndent :: (MonadIO m, IsGenerator o) => o -> Word32 -> m ()
setGeneratorIndent :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> Word32 -> m ()
setGeneratorIndent o
obj Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"indent" Word32
val
constructGeneratorIndent :: (IsGenerator o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructGeneratorIndent :: forall o (m :: * -> *).
(IsGenerator o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructGeneratorIndent Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"indent" Word32
val
#if defined(ENABLE_OVERLOADING)
data GeneratorIndentPropertyInfo
instance AttrInfo GeneratorIndentPropertyInfo where
type AttrAllowedOps GeneratorIndentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint GeneratorIndentPropertyInfo = IsGenerator
type AttrSetTypeConstraint GeneratorIndentPropertyInfo = (~) Word32
type AttrTransferTypeConstraint GeneratorIndentPropertyInfo = (~) Word32
type AttrTransferType GeneratorIndentPropertyInfo = Word32
type AttrGetType GeneratorIndentPropertyInfo = Word32
type AttrLabel GeneratorIndentPropertyInfo = "indent"
type AttrOrigin GeneratorIndentPropertyInfo = Generator
attrGet = getGeneratorIndent
attrSet = setGeneratorIndent
attrTransfer _ v = do
return v
attrConstruct = constructGeneratorIndent
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.indent"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#g:attr:indent"
})
#endif
getGeneratorIndentChar :: (MonadIO m, IsGenerator o) => o -> m Word32
getGeneratorIndentChar :: forall (m :: * -> *) o. (MonadIO m, IsGenerator o) => o -> m Word32
getGeneratorIndentChar o
obj = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"indent-char"
setGeneratorIndentChar :: (MonadIO m, IsGenerator o) => o -> Word32 -> m ()
setGeneratorIndentChar :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> Word32 -> m ()
setGeneratorIndentChar o
obj Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"indent-char" Word32
val
constructGeneratorIndentChar :: (IsGenerator o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructGeneratorIndentChar :: forall o (m :: * -> *).
(IsGenerator o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructGeneratorIndentChar Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"indent-char" Word32
val
#if defined(ENABLE_OVERLOADING)
data GeneratorIndentCharPropertyInfo
instance AttrInfo GeneratorIndentCharPropertyInfo where
type AttrAllowedOps GeneratorIndentCharPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint GeneratorIndentCharPropertyInfo = IsGenerator
type AttrSetTypeConstraint GeneratorIndentCharPropertyInfo = (~) Word32
type AttrTransferTypeConstraint GeneratorIndentCharPropertyInfo = (~) Word32
type AttrTransferType GeneratorIndentCharPropertyInfo = Word32
type AttrGetType GeneratorIndentCharPropertyInfo = Word32
type AttrLabel GeneratorIndentCharPropertyInfo = "indent-char"
type AttrOrigin GeneratorIndentCharPropertyInfo = Generator
attrGet = getGeneratorIndentChar
attrSet = setGeneratorIndentChar
attrTransfer _ v = do
return v
attrConstruct = constructGeneratorIndentChar
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.indentChar"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#g:attr:indentChar"
})
#endif
getGeneratorPretty :: (MonadIO m, IsGenerator o) => o -> m Bool
getGeneratorPretty :: forall (m :: * -> *) o. (MonadIO m, IsGenerator o) => o -> m Bool
getGeneratorPretty o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"pretty"
setGeneratorPretty :: (MonadIO m, IsGenerator o) => o -> Bool -> m ()
setGeneratorPretty :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> Bool -> m ()
setGeneratorPretty o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"pretty" Bool
val
constructGeneratorPretty :: (IsGenerator o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructGeneratorPretty :: forall o (m :: * -> *).
(IsGenerator o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructGeneratorPretty Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"pretty" Bool
val
#if defined(ENABLE_OVERLOADING)
data GeneratorPrettyPropertyInfo
instance AttrInfo GeneratorPrettyPropertyInfo where
type AttrAllowedOps GeneratorPrettyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint GeneratorPrettyPropertyInfo = IsGenerator
type AttrSetTypeConstraint GeneratorPrettyPropertyInfo = (~) Bool
type AttrTransferTypeConstraint GeneratorPrettyPropertyInfo = (~) Bool
type AttrTransferType GeneratorPrettyPropertyInfo = Bool
type AttrGetType GeneratorPrettyPropertyInfo = Bool
type AttrLabel GeneratorPrettyPropertyInfo = "pretty"
type AttrOrigin GeneratorPrettyPropertyInfo = Generator
attrGet = getGeneratorPretty
attrSet = setGeneratorPretty
attrTransfer _ v = do
return v
attrConstruct = constructGeneratorPretty
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.pretty"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#g:attr:pretty"
})
#endif
getGeneratorRoot :: (MonadIO m, IsGenerator o) => o -> m (Maybe Json.Node.Node)
getGeneratorRoot :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> m (Maybe Node)
getGeneratorRoot o
obj = IO (Maybe Node) -> m (Maybe Node)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Node) -> m (Maybe Node))
-> IO (Maybe Node) -> m (Maybe Node)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Node -> Node) -> IO (Maybe Node)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"root" ManagedPtr Node -> Node
Json.Node.Node
setGeneratorRoot :: (MonadIO m, IsGenerator o) => o -> Json.Node.Node -> m ()
setGeneratorRoot :: forall (m :: * -> *) o.
(MonadIO m, IsGenerator o) =>
o -> Node -> m ()
setGeneratorRoot o
obj Node
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Node -> IO ()
forall a b.
(GObject a, GBoxed b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj String
"root" (Node -> Maybe Node
forall a. a -> Maybe a
Just Node
val)
constructGeneratorRoot :: (IsGenerator o, MIO.MonadIO m) => Json.Node.Node -> m (GValueConstruct o)
constructGeneratorRoot :: forall o (m :: * -> *).
(IsGenerator o, MonadIO m) =>
Node -> m (GValueConstruct o)
constructGeneratorRoot Node
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Node -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"root" (Node -> Maybe Node
forall a. a -> Maybe a
P.Just Node
val)
#if defined(ENABLE_OVERLOADING)
data GeneratorRootPropertyInfo
instance AttrInfo GeneratorRootPropertyInfo where
type AttrAllowedOps GeneratorRootPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint GeneratorRootPropertyInfo = IsGenerator
type AttrSetTypeConstraint GeneratorRootPropertyInfo = (~) Json.Node.Node
type AttrTransferTypeConstraint GeneratorRootPropertyInfo = (~) Json.Node.Node
type AttrTransferType GeneratorRootPropertyInfo = Json.Node.Node
type AttrGetType GeneratorRootPropertyInfo = (Maybe Json.Node.Node)
type AttrLabel GeneratorRootPropertyInfo = "root"
type AttrOrigin GeneratorRootPropertyInfo = Generator
attrGet = getGeneratorRoot
attrSet = setGeneratorRoot
attrTransfer _ v = do
return v
attrConstruct = constructGeneratorRoot
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.root"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#g:attr:root"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Generator
type instance O.AttributeList Generator = GeneratorAttributeList
type GeneratorAttributeList = ('[ '("indent", GeneratorIndentPropertyInfo), '("indentChar", GeneratorIndentCharPropertyInfo), '("pretty", GeneratorPrettyPropertyInfo), '("root", GeneratorRootPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
generatorIndent :: AttrLabelProxy "indent"
generatorIndent = AttrLabelProxy
generatorIndentChar :: AttrLabelProxy "indentChar"
generatorIndentChar = AttrLabelProxy
generatorPretty :: AttrLabelProxy "pretty"
generatorPretty = AttrLabelProxy
generatorRoot :: AttrLabelProxy "root"
generatorRoot = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Generator = GeneratorSignalList
type GeneratorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "json_generator_new" json_generator_new ::
IO (Ptr Generator)
generatorNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Generator
generatorNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Generator
generatorNew = IO Generator -> m Generator
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Generator -> m Generator) -> IO Generator -> m Generator
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
result <- IO (Ptr Generator)
json_generator_new
Text -> Ptr Generator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"generatorNew" Ptr Generator
result
Generator
result' <- ((ManagedPtr Generator -> Generator)
-> Ptr Generator -> IO Generator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Generator -> Generator
Generator) Ptr Generator
result
Generator -> IO Generator
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Generator
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "json_generator_get_indent" json_generator_get_indent ::
Ptr Generator ->
IO Word32
generatorGetIndent ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> m Word32
generatorGetIndent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> m Word32
generatorGetIndent a
generator = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Word32
result <- Ptr Generator -> IO Word32
json_generator_get_indent Ptr Generator
generator'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data GeneratorGetIndentMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorGetIndentMethodInfo a signature where
overloadedMethod = generatorGetIndent
instance O.OverloadedMethodInfo GeneratorGetIndentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorGetIndent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorGetIndent"
})
#endif
foreign import ccall "json_generator_get_indent_char" json_generator_get_indent_char ::
Ptr Generator ->
IO CInt
generatorGetIndentChar ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> m Char
generatorGetIndentChar :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> m Char
generatorGetIndentChar a
generator = IO Char -> m Char
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Char -> m Char) -> IO Char -> m Char
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
CInt
result <- Ptr Generator -> IO CInt
json_generator_get_indent_char Ptr Generator
generator'
let result' :: Char
result' = (Int -> Char
chr (Int -> Char) -> (CInt -> Int) -> CInt -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Char -> IO Char
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Char
result'
#if defined(ENABLE_OVERLOADING)
data GeneratorGetIndentCharMethodInfo
instance (signature ~ (m Char), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorGetIndentCharMethodInfo a signature where
overloadedMethod = generatorGetIndentChar
instance O.OverloadedMethodInfo GeneratorGetIndentCharMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorGetIndentChar",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorGetIndentChar"
})
#endif
foreign import ccall "json_generator_get_pretty" json_generator_get_pretty ::
Ptr Generator ->
IO CInt
generatorGetPretty ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> m Bool
generatorGetPretty :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> m Bool
generatorGetPretty a
generator = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
CInt
result <- Ptr Generator -> IO CInt
json_generator_get_pretty Ptr Generator
generator'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data GeneratorGetPrettyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorGetPrettyMethodInfo a signature where
overloadedMethod = generatorGetPretty
instance O.OverloadedMethodInfo GeneratorGetPrettyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorGetPretty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorGetPretty"
})
#endif
foreign import ccall "json_generator_get_root" json_generator_get_root ::
Ptr Generator ->
IO (Ptr Json.Node.Node)
generatorGetRoot ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> m (Maybe Json.Node.Node)
generatorGetRoot :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> m (Maybe Node)
generatorGetRoot a
generator = IO (Maybe Node) -> m (Maybe Node)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Node) -> m (Maybe Node))
-> IO (Maybe Node) -> m (Maybe Node)
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr Node
result <- Ptr Generator -> IO (Ptr Node)
json_generator_get_root Ptr Generator
generator'
Maybe Node
maybeResult <- Ptr Node -> (Ptr Node -> IO Node) -> IO (Maybe Node)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Node
result ((Ptr Node -> IO Node) -> IO (Maybe Node))
-> (Ptr Node -> IO Node) -> IO (Maybe Node)
forall a b. (a -> b) -> a -> b
$ \Ptr Node
result' -> do
Node
result'' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Json.Node.Node) Ptr Node
result'
Node -> IO Node
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Maybe Node -> IO (Maybe Node)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Node
maybeResult
#if defined(ENABLE_OVERLOADING)
data GeneratorGetRootMethodInfo
instance (signature ~ (m (Maybe Json.Node.Node)), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorGetRootMethodInfo a signature where
overloadedMethod = generatorGetRoot
instance O.OverloadedMethodInfo GeneratorGetRootMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorGetRoot",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorGetRoot"
})
#endif
foreign import ccall "json_generator_set_indent" json_generator_set_indent ::
Ptr Generator ->
Word32 ->
IO ()
generatorSetIndent ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> Word32
-> m ()
generatorSetIndent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> Word32 -> m ()
generatorSetIndent a
generator Word32
indentLevel = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr Generator -> Word32 -> IO ()
json_generator_set_indent Ptr Generator
generator' Word32
indentLevel
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeneratorSetIndentMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorSetIndentMethodInfo a signature where
overloadedMethod = generatorSetIndent
instance O.OverloadedMethodInfo GeneratorSetIndentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorSetIndent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorSetIndent"
})
#endif
foreign import ccall "json_generator_set_indent_char" json_generator_set_indent_char ::
Ptr Generator ->
CInt ->
IO ()
generatorSetIndentChar ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> Char
-> m ()
generatorSetIndentChar :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> Char -> m ()
generatorSetIndentChar a
generator Char
indentChar = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
let indentChar' :: CInt
indentChar' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Char -> Int) -> Char -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) Char
indentChar
Ptr Generator -> CInt -> IO ()
json_generator_set_indent_char Ptr Generator
generator' CInt
indentChar'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeneratorSetIndentCharMethodInfo
instance (signature ~ (Char -> m ()), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorSetIndentCharMethodInfo a signature where
overloadedMethod = generatorSetIndentChar
instance O.OverloadedMethodInfo GeneratorSetIndentCharMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorSetIndentChar",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorSetIndentChar"
})
#endif
foreign import ccall "json_generator_set_pretty" json_generator_set_pretty ::
Ptr Generator ->
CInt ->
IO ()
generatorSetPretty ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> Bool
-> m ()
generatorSetPretty :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> Bool -> m ()
generatorSetPretty a
generator Bool
isPretty = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
let isPretty' :: CInt
isPretty' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
isPretty
Ptr Generator -> CInt -> IO ()
json_generator_set_pretty Ptr Generator
generator' CInt
isPretty'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeneratorSetPrettyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorSetPrettyMethodInfo a signature where
overloadedMethod = generatorSetPretty
instance O.OverloadedMethodInfo GeneratorSetPrettyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorSetPretty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorSetPretty"
})
#endif
foreign import ccall "json_generator_set_root" json_generator_set_root ::
Ptr Generator ->
Ptr Json.Node.Node ->
IO ()
generatorSetRoot ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> Json.Node.Node
-> m ()
generatorSetRoot :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> Node -> m ()
generatorSetRoot a
generator Node
node = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Generator -> Ptr Node -> IO ()
json_generator_set_root Ptr Generator
generator' Ptr Node
node'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeneratorSetRootMethodInfo
instance (signature ~ (Json.Node.Node -> m ()), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorSetRootMethodInfo a signature where
overloadedMethod = generatorSetRoot
instance O.OverloadedMethodInfo GeneratorSetRootMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorSetRoot",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorSetRoot"
})
#endif
foreign import ccall "json_generator_to_data" json_generator_to_data ::
Ptr Generator ->
Ptr Word64 ->
IO CString
generatorToData ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> m ((T.Text, Word64))
generatorToData :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> m (Text, Word64)
generatorToData a
generator = IO (Text, Word64) -> m (Text, Word64)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Word64) -> m (Text, Word64))
-> IO (Text, Word64) -> m (Text, Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
CString
result <- Ptr Generator -> Ptr Word64 -> IO CString
json_generator_to_data Ptr Generator
generator' Ptr Word64
length_
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"generatorToData" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
(Text, Word64) -> IO (Text, Word64)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Word64
length_')
#if defined(ENABLE_OVERLOADING)
data GeneratorToDataMethodInfo
instance (signature ~ (m ((T.Text, Word64))), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorToDataMethodInfo a signature where
overloadedMethod = generatorToData
instance O.OverloadedMethodInfo GeneratorToDataMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorToData",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorToData"
})
#endif
foreign import ccall "json_generator_to_file" json_generator_to_file ::
Ptr Generator ->
CString ->
Ptr (Ptr GError) ->
IO CInt
generatorToFile ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> [Char]
-> m ()
generatorToFile :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> String -> m ()
generatorToFile a
generator String
filename = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
CString
filename' <- String -> IO CString
stringToCString String
filename
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Generator -> CString -> Ptr (Ptr GError) -> IO CInt
json_generator_to_file Ptr Generator
generator' CString
filename'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
data GeneratorToFileMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorToFileMethodInfo a signature where
overloadedMethod = generatorToFile
instance O.OverloadedMethodInfo GeneratorToFileMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorToFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorToFile"
})
#endif
foreign import ccall "json_generator_to_gstring" json_generator_to_gstring ::
Ptr Generator ->
Ptr GLib.String.String ->
IO (Ptr GLib.String.String)
generatorToGstring ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a) =>
a
-> GLib.String.String
-> m GLib.String.String
generatorToGstring :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGenerator a) =>
a -> String -> m String
generatorToGstring a
generator String
string = IO String -> m String
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr Generator -> Ptr String -> IO (Ptr String)
json_generator_to_gstring Ptr Generator
generator' Ptr String
string'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"generatorToGstring" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
GLib.String.String) Ptr String
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data GeneratorToGstringMethodInfo
instance (signature ~ (GLib.String.String -> m GLib.String.String), MonadIO m, IsGenerator a) => O.OverloadedMethod GeneratorToGstringMethodInfo a signature where
overloadedMethod = generatorToGstring
instance O.OverloadedMethodInfo GeneratorToGstringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorToGstring",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorToGstring"
})
#endif
foreign import ccall "json_generator_to_stream" json_generator_to_stream ::
Ptr Generator ->
Ptr Gio.OutputStream.OutputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
generatorToStream ::
(B.CallStack.HasCallStack, MonadIO m, IsGenerator a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m ()
generatorToStream :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsGenerator a, IsOutputStream b,
IsCancellable c) =>
a -> b -> Maybe c -> m ()
generatorToStream a
generator b
stream Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Generator
generator' <- a -> IO (Ptr Generator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
generator
Ptr OutputStream
stream' <- b -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
stream
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Generator
-> Ptr OutputStream
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
json_generator_to_stream Ptr Generator
generator' Ptr OutputStream
stream' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
generator
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
stream
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data GeneratorToStreamMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsGenerator a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod GeneratorToStreamMethodInfo a signature where
overloadedMethod = generatorToStream
instance O.OverloadedMethodInfo GeneratorToStreamMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Objects.Generator.generatorToStream",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.3/docs/GI-Json-Objects-Generator.html#v:generatorToStream"
})
#endif