{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GES.Objects.CommandLineFormatter
(
CommandLineFormatter(..) ,
IsCommandLineFormatter ,
toCommandLineFormatter ,
#if defined(ENABLE_OVERLOADING)
ResolveCommandLineFormatterMethod ,
#endif
commandLineFormatterGetHelp ,
commandLineFormatterGetTimelineUri ,
) 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.Kind as DK
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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GES.Callbacks as GES.Callbacks
import {-# SOURCE #-} qualified GI.GES.Enums as GES.Enums
import {-# SOURCE #-} qualified GI.GES.Flags as GES.Flags
import {-# SOURCE #-} qualified GI.GES.Interfaces.Extractable as GES.Extractable
import {-# SOURCE #-} qualified GI.GES.Interfaces.MetaContainer as GES.MetaContainer
import {-# SOURCE #-} qualified GI.GES.Objects.Asset as GES.Asset
import {-# SOURCE #-} qualified GI.GES.Objects.BaseEffect as GES.BaseEffect
import {-# SOURCE #-} qualified GI.GES.Objects.Clip as GES.Clip
import {-# SOURCE #-} qualified GI.GES.Objects.Container as GES.Container
import {-# SOURCE #-} qualified GI.GES.Objects.Formatter as GES.Formatter
import {-# SOURCE #-} qualified GI.GES.Objects.Group as GES.Group
import {-# SOURCE #-} qualified GI.GES.Objects.Layer as GES.Layer
import {-# SOURCE #-} qualified GI.GES.Objects.Marker as GES.Marker
import {-# SOURCE #-} qualified GI.GES.Objects.MarkerList as GES.MarkerList
import {-# SOURCE #-} qualified GI.GES.Objects.Operation as GES.Operation
import {-# SOURCE #-} qualified GI.GES.Objects.Timeline as GES.Timeline
import {-# SOURCE #-} qualified GI.GES.Objects.TimelineElement as GES.TimelineElement
import {-# SOURCE #-} qualified GI.GES.Objects.Track as GES.Track
import {-# SOURCE #-} qualified GI.GES.Objects.TrackElement as GES.TrackElement
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Date as GLib.Date
import qualified GI.GObject.Objects.InitiallyUnowned as GObject.InitiallyUnowned
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gst.Interfaces.ChildProxy as Gst.ChildProxy
import qualified GI.Gst.Objects.Bin as Gst.Bin
import qualified GI.Gst.Objects.ControlBinding as Gst.ControlBinding
import qualified GI.Gst.Objects.ControlSource as Gst.ControlSource
import qualified GI.Gst.Objects.Element as Gst.Element
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Objects.Pad as Gst.Pad
import qualified GI.Gst.Structs.Caps as Gst.Caps
import qualified GI.Gst.Structs.DateTime as Gst.DateTime
#else
import {-# SOURCE #-} qualified GI.GES.Interfaces.Extractable as GES.Extractable
import {-# SOURCE #-} qualified GI.GES.Objects.Formatter as GES.Formatter
import {-# SOURCE #-} qualified GI.GES.Objects.Timeline as GES.Timeline
import qualified GI.GObject.Objects.Object as GObject.Object
#endif
newtype CommandLineFormatter = CommandLineFormatter (SP.ManagedPtr CommandLineFormatter)
deriving (CommandLineFormatter -> CommandLineFormatter -> Bool
(CommandLineFormatter -> CommandLineFormatter -> Bool)
-> (CommandLineFormatter -> CommandLineFormatter -> Bool)
-> Eq CommandLineFormatter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CommandLineFormatter -> CommandLineFormatter -> Bool
== :: CommandLineFormatter -> CommandLineFormatter -> Bool
$c/= :: CommandLineFormatter -> CommandLineFormatter -> Bool
/= :: CommandLineFormatter -> CommandLineFormatter -> Bool
Eq)
instance SP.ManagedPtrNewtype CommandLineFormatter where
toManagedPtr :: CommandLineFormatter -> ManagedPtr CommandLineFormatter
toManagedPtr (CommandLineFormatter ManagedPtr CommandLineFormatter
p) = ManagedPtr CommandLineFormatter
p
foreign import ccall "ges_command_line_formatter_get_type"
c_ges_command_line_formatter_get_type :: IO B.Types.GType
instance B.Types.TypedObject CommandLineFormatter where
glibType :: IO GType
glibType = IO GType
c_ges_command_line_formatter_get_type
instance B.Types.GObject CommandLineFormatter
class (SP.GObject o, O.IsDescendantOf CommandLineFormatter o) => IsCommandLineFormatter o
instance (SP.GObject o, O.IsDescendantOf CommandLineFormatter o) => IsCommandLineFormatter o
instance O.HasParentTypes CommandLineFormatter
type instance O.ParentTypes CommandLineFormatter = '[GES.Formatter.Formatter, GObject.Object.Object, GES.Extractable.Extractable]
toCommandLineFormatter :: (MIO.MonadIO m, IsCommandLineFormatter o) => o -> m CommandLineFormatter
toCommandLineFormatter :: forall (m :: * -> *) o.
(MonadIO m, IsCommandLineFormatter o) =>
o -> m CommandLineFormatter
toCommandLineFormatter = IO CommandLineFormatter -> m CommandLineFormatter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CommandLineFormatter -> m CommandLineFormatter)
-> (o -> IO CommandLineFormatter) -> o -> m CommandLineFormatter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CommandLineFormatter -> CommandLineFormatter)
-> o -> IO CommandLineFormatter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr CommandLineFormatter -> CommandLineFormatter
CommandLineFormatter
instance B.GValue.IsGValue (Maybe CommandLineFormatter) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ges_command_line_formatter_get_type
gvalueSet_ :: Ptr GValue -> Maybe CommandLineFormatter -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CommandLineFormatter
P.Nothing = Ptr GValue -> Ptr CommandLineFormatter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CommandLineFormatter
forall a. Ptr a
FP.nullPtr :: FP.Ptr CommandLineFormatter)
gvalueSet_ Ptr GValue
gv (P.Just CommandLineFormatter
obj) = CommandLineFormatter
-> (Ptr CommandLineFormatter -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CommandLineFormatter
obj (Ptr GValue -> Ptr CommandLineFormatter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe CommandLineFormatter)
gvalueGet_ Ptr GValue
gv = do
Ptr CommandLineFormatter
ptr <- Ptr GValue -> IO (Ptr CommandLineFormatter)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CommandLineFormatter)
if Ptr CommandLineFormatter
ptr Ptr CommandLineFormatter -> Ptr CommandLineFormatter -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr CommandLineFormatter
forall a. Ptr a
FP.nullPtr
then CommandLineFormatter -> Maybe CommandLineFormatter
forall a. a -> Maybe a
P.Just (CommandLineFormatter -> Maybe CommandLineFormatter)
-> IO CommandLineFormatter -> IO (Maybe CommandLineFormatter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr CommandLineFormatter -> CommandLineFormatter)
-> Ptr CommandLineFormatter -> IO CommandLineFormatter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr CommandLineFormatter -> CommandLineFormatter
CommandLineFormatter Ptr CommandLineFormatter
ptr
else Maybe CommandLineFormatter -> IO (Maybe CommandLineFormatter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CommandLineFormatter
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCommandLineFormatterMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveCommandLineFormatterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCommandLineFormatterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCommandLineFormatterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCommandLineFormatterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCommandLineFormatterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCommandLineFormatterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCommandLineFormatterMethod "loadFromUri" o = GES.Formatter.FormatterLoadFromUriMethodInfo
ResolveCommandLineFormatterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCommandLineFormatterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCommandLineFormatterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCommandLineFormatterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCommandLineFormatterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCommandLineFormatterMethod "saveToUri" o = GES.Formatter.FormatterSaveToUriMethodInfo
ResolveCommandLineFormatterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCommandLineFormatterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCommandLineFormatterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCommandLineFormatterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCommandLineFormatterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCommandLineFormatterMethod "getAsset" o = GES.Extractable.ExtractableGetAssetMethodInfo
ResolveCommandLineFormatterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCommandLineFormatterMethod "getId" o = GES.Extractable.ExtractableGetIdMethodInfo
ResolveCommandLineFormatterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCommandLineFormatterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCommandLineFormatterMethod "setAsset" o = GES.Extractable.ExtractableSetAssetMethodInfo
ResolveCommandLineFormatterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCommandLineFormatterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCommandLineFormatterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCommandLineFormatterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCommandLineFormatterMethod t CommandLineFormatter, O.OverloadedMethod info CommandLineFormatter p) => OL.IsLabel t (CommandLineFormatter -> 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 ~ ResolveCommandLineFormatterMethod t CommandLineFormatter, O.OverloadedMethod info CommandLineFormatter p, R.HasField t CommandLineFormatter p) => R.HasField t CommandLineFormatter p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCommandLineFormatterMethod t CommandLineFormatter, O.OverloadedMethodInfo info CommandLineFormatter) => OL.IsLabel t (O.MethodProxy info CommandLineFormatter) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CommandLineFormatter
type instance O.AttributeList CommandLineFormatter = CommandLineFormatterAttributeList
type CommandLineFormatterAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CommandLineFormatter = CommandLineFormatterSignalList
type CommandLineFormatterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "ges_command_line_formatter_get_help" ges_command_line_formatter_get_help ::
Int32 ->
Ptr CString ->
IO CString
commandLineFormatterGetHelp ::
(B.CallStack.HasCallStack, MonadIO m) =>
[T.Text]
-> m T.Text
commandLineFormatterGetHelp :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Text] -> m Text
commandLineFormatterGetHelp [Text]
commands = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
let nargs :: Int32
nargs = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Text] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Text]
commands
Ptr (Ptr CChar)
commands' <- [Text] -> IO (Ptr (Ptr CChar))
packUTF8CArray [Text]
commands
Ptr CChar
result <- Int32 -> Ptr (Ptr CChar) -> IO (Ptr CChar)
ges_command_line_formatter_get_help Int32
nargs Ptr (Ptr CChar)
commands'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"commandLineFormatterGetHelp" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
(Int32 -> (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Int32
nargs) Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
commands'
Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
commands'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ges_command_line_formatter_get_timeline_uri" ges_command_line_formatter_get_timeline_uri ::
Ptr GES.Timeline.Timeline ->
IO CString
commandLineFormatterGetTimelineUri ::
(B.CallStack.HasCallStack, MonadIO m, GES.Timeline.IsTimeline a) =>
a
-> m T.Text
commandLineFormatterGetTimelineUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTimeline a) =>
a -> m Text
commandLineFormatterGetTimelineUri a
timeline = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Timeline
timeline' <- a -> IO (Ptr Timeline)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
timeline
Ptr CChar
result <- Ptr Timeline -> IO (Ptr CChar)
ges_command_line_formatter_get_timeline_uri Ptr Timeline
timeline'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"commandLineFormatterGetTimelineUri" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
timeline
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
#endif