#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Poppler.Objects.Movie
(
Movie(..) ,
IsMovie ,
toMovie ,
noMovie ,
#if ENABLE_OVERLOADING
MovieGetFilenameMethodInfo ,
#endif
movieGetFilename ,
#if ENABLE_OVERLOADING
MovieGetPlayModeMethodInfo ,
#endif
movieGetPlayMode ,
#if ENABLE_OVERLOADING
MovieNeedPosterMethodInfo ,
#endif
movieNeedPoster ,
#if ENABLE_OVERLOADING
MovieShowControlsMethodInfo ,
#endif
movieShowControls ,
) 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 {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
newtype Movie = Movie (ManagedPtr Movie)
foreign import ccall "poppler_movie_get_type"
c_poppler_movie_get_type :: IO GType
instance GObject Movie where
gobjectType = c_poppler_movie_get_type
class (GObject o, O.IsDescendantOf Movie o) => IsMovie o
instance (GObject o, O.IsDescendantOf Movie o) => IsMovie o
instance O.HasParentTypes Movie
type instance O.ParentTypes Movie = '[GObject.Object.Object]
toMovie :: (MonadIO m, IsMovie o) => o -> m Movie
toMovie = liftIO . unsafeCastTo Movie
noMovie :: Maybe Movie
noMovie = Nothing
#if ENABLE_OVERLOADING
type family ResolveMovieMethod (t :: Symbol) (o :: *) :: * where
ResolveMovieMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMovieMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMovieMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMovieMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMovieMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMovieMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMovieMethod "needPoster" o = MovieNeedPosterMethodInfo
ResolveMovieMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMovieMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMovieMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMovieMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMovieMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMovieMethod "showControls" o = MovieShowControlsMethodInfo
ResolveMovieMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMovieMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMovieMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMovieMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMovieMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMovieMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMovieMethod "getFilename" o = MovieGetFilenameMethodInfo
ResolveMovieMethod "getPlayMode" o = MovieGetPlayModeMethodInfo
ResolveMovieMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMovieMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMovieMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMovieMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMovieMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMovieMethod t Movie, O.MethodInfo info Movie p) => OL.IsLabel t (Movie -> 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 Movie
type instance O.AttributeList Movie = MovieAttributeList
type MovieAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Movie = MovieSignalList
type MovieSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_movie_get_filename" poppler_movie_get_filename ::
Ptr Movie ->
IO CString
movieGetFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsMovie a) =>
a
-> m T.Text
movieGetFilename popplerMovie = liftIO $ do
popplerMovie' <- unsafeManagedPtrCastPtr popplerMovie
result <- poppler_movie_get_filename popplerMovie'
checkUnexpectedReturnNULL "movieGetFilename" result
result' <- cstringToText result
touchManagedPtr popplerMovie
return result'
#if ENABLE_OVERLOADING
data MovieGetFilenameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMovie a) => O.MethodInfo MovieGetFilenameMethodInfo a signature where
overloadedMethod _ = movieGetFilename
#endif
foreign import ccall "poppler_movie_get_play_mode" poppler_movie_get_play_mode ::
Ptr Movie ->
IO CUInt
movieGetPlayMode ::
(B.CallStack.HasCallStack, MonadIO m, IsMovie a) =>
a
-> m Poppler.Enums.MoviePlayMode
movieGetPlayMode popplerMovie = liftIO $ do
popplerMovie' <- unsafeManagedPtrCastPtr popplerMovie
result <- poppler_movie_get_play_mode popplerMovie'
let result' = (toEnum . fromIntegral) result
touchManagedPtr popplerMovie
return result'
#if ENABLE_OVERLOADING
data MovieGetPlayModeMethodInfo
instance (signature ~ (m Poppler.Enums.MoviePlayMode), MonadIO m, IsMovie a) => O.MethodInfo MovieGetPlayModeMethodInfo a signature where
overloadedMethod _ = movieGetPlayMode
#endif
foreign import ccall "poppler_movie_need_poster" poppler_movie_need_poster ::
Ptr Movie ->
IO CInt
movieNeedPoster ::
(B.CallStack.HasCallStack, MonadIO m, IsMovie a) =>
a
-> m Bool
movieNeedPoster popplerMovie = liftIO $ do
popplerMovie' <- unsafeManagedPtrCastPtr popplerMovie
result <- poppler_movie_need_poster popplerMovie'
let result' = (/= 0) result
touchManagedPtr popplerMovie
return result'
#if ENABLE_OVERLOADING
data MovieNeedPosterMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMovie a) => O.MethodInfo MovieNeedPosterMethodInfo a signature where
overloadedMethod _ = movieNeedPoster
#endif
foreign import ccall "poppler_movie_show_controls" poppler_movie_show_controls ::
Ptr Movie ->
IO CInt
movieShowControls ::
(B.CallStack.HasCallStack, MonadIO m, IsMovie a) =>
a
-> m Bool
movieShowControls popplerMovie = liftIO $ do
popplerMovie' <- unsafeManagedPtrCastPtr popplerMovie
result <- poppler_movie_show_controls popplerMovie'
let result' = (/= 0) result
touchManagedPtr popplerMovie
return result'
#if ENABLE_OVERLOADING
data MovieShowControlsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMovie a) => O.MethodInfo MovieShowControlsMethodInfo a signature where
overloadedMethod _ = movieShowControls
#endif