{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Poppler.Objects.Layer
(
Layer(..) ,
IsLayer ,
toLayer ,
noLayer ,
#if defined(ENABLE_OVERLOADING)
ResolveLayerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
LayerGetRadioButtonGroupIdMethodInfo ,
#endif
layerGetRadioButtonGroupId ,
#if defined(ENABLE_OVERLOADING)
LayerGetTitleMethodInfo ,
#endif
layerGetTitle ,
#if defined(ENABLE_OVERLOADING)
LayerHideMethodInfo ,
#endif
layerHide ,
#if defined(ENABLE_OVERLOADING)
LayerIsParentMethodInfo ,
#endif
layerIsParent ,
#if defined(ENABLE_OVERLOADING)
LayerIsVisibleMethodInfo ,
#endif
layerIsVisible ,
#if defined(ENABLE_OVERLOADING)
LayerShowMethodInfo ,
#endif
layerShow ,
) 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.GI.Base.Signals as B.Signals
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
newtype Layer = Layer (ManagedPtr Layer)
deriving (Layer -> Layer -> Bool
(Layer -> Layer -> Bool) -> (Layer -> Layer -> Bool) -> Eq Layer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Layer -> Layer -> Bool
$c/= :: Layer -> Layer -> Bool
== :: Layer -> Layer -> Bool
$c== :: Layer -> Layer -> Bool
Eq)
foreign import ccall "poppler_layer_get_type"
c_poppler_layer_get_type :: IO GType
instance GObject Layer where
gobjectType :: IO GType
gobjectType = IO GType
c_poppler_layer_get_type
instance B.GValue.IsGValue Layer where
toGValue :: Layer -> IO GValue
toGValue o :: Layer
o = do
GType
gtype <- IO GType
c_poppler_layer_get_type
Layer -> (Ptr Layer -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Layer
o (GType -> (GValue -> Ptr Layer -> IO ()) -> Ptr Layer -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Layer -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Layer
fromGValue gv :: GValue
gv = do
Ptr Layer
ptr <- GValue -> IO (Ptr Layer)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Layer)
(ManagedPtr Layer -> Layer) -> Ptr Layer -> IO Layer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Layer -> Layer
Layer Ptr Layer
ptr
class (GObject o, O.IsDescendantOf Layer o) => IsLayer o
instance (GObject o, O.IsDescendantOf Layer o) => IsLayer o
instance O.HasParentTypes Layer
type instance O.ParentTypes Layer = '[GObject.Object.Object]
toLayer :: (MonadIO m, IsLayer o) => o -> m Layer
toLayer :: o -> m Layer
toLayer = IO Layer -> m Layer
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Layer -> m Layer) -> (o -> IO Layer) -> o -> m Layer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Layer -> Layer) -> o -> IO Layer
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Layer -> Layer
Layer
noLayer :: Maybe Layer
noLayer :: Maybe Layer
noLayer = Maybe Layer
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveLayerMethod (t :: Symbol) (o :: *) :: * where
ResolveLayerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveLayerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveLayerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveLayerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveLayerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveLayerMethod "hide" o = LayerHideMethodInfo
ResolveLayerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveLayerMethod "isParent" o = LayerIsParentMethodInfo
ResolveLayerMethod "isVisible" o = LayerIsVisibleMethodInfo
ResolveLayerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveLayerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveLayerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveLayerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveLayerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveLayerMethod "show" o = LayerShowMethodInfo
ResolveLayerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveLayerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveLayerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveLayerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveLayerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveLayerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveLayerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveLayerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveLayerMethod "getRadioButtonGroupId" o = LayerGetRadioButtonGroupIdMethodInfo
ResolveLayerMethod "getTitle" o = LayerGetTitleMethodInfo
ResolveLayerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveLayerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveLayerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveLayerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveLayerMethod t Layer, O.MethodInfo info Layer p) => OL.IsLabel t (Layer -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Layer
type instance O.AttributeList Layer = LayerAttributeList
type LayerAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Layer = LayerSignalList
type LayerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_layer_get_radio_button_group_id" poppler_layer_get_radio_button_group_id ::
Ptr Layer ->
IO Int32
layerGetRadioButtonGroupId ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m Int32
layerGetRadioButtonGroupId :: a -> m Int32
layerGetRadioButtonGroupId layer :: a
layer = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
Int32
result <- Ptr Layer -> IO Int32
poppler_layer_get_radio_button_group_id Ptr Layer
layer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data LayerGetRadioButtonGroupIdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayer a) => O.MethodInfo LayerGetRadioButtonGroupIdMethodInfo a signature where
overloadedMethod = layerGetRadioButtonGroupId
#endif
foreign import ccall "poppler_layer_get_title" poppler_layer_get_title ::
Ptr Layer ->
IO CString
layerGetTitle ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m T.Text
layerGetTitle :: a -> m Text
layerGetTitle layer :: a
layer = IO Text -> m Text
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 Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
CString
result <- Ptr Layer -> IO CString
poppler_layer_get_title Ptr Layer
layer'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "layerGetTitle" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data LayerGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsLayer a) => O.MethodInfo LayerGetTitleMethodInfo a signature where
overloadedMethod = layerGetTitle
#endif
foreign import ccall "poppler_layer_hide" poppler_layer_hide ::
Ptr Layer ->
IO ()
layerHide ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m ()
layerHide :: a -> m ()
layerHide layer :: a
layer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
Ptr Layer -> IO ()
poppler_layer_hide Ptr Layer
layer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data LayerHideMethodInfo
instance (signature ~ (m ()), MonadIO m, IsLayer a) => O.MethodInfo LayerHideMethodInfo a signature where
overloadedMethod = layerHide
#endif
foreign import ccall "poppler_layer_is_parent" poppler_layer_is_parent ::
Ptr Layer ->
IO CInt
layerIsParent ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m Bool
layerIsParent :: a -> m Bool
layerIsParent layer :: a
layer = IO Bool -> m Bool
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 Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
CInt
result <- Ptr Layer -> IO CInt
poppler_layer_is_parent Ptr Layer
layer'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data LayerIsParentMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayer a) => O.MethodInfo LayerIsParentMethodInfo a signature where
overloadedMethod = layerIsParent
#endif
foreign import ccall "poppler_layer_is_visible" poppler_layer_is_visible ::
Ptr Layer ->
IO CInt
layerIsVisible ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m Bool
layerIsVisible :: a -> m Bool
layerIsVisible layer :: a
layer = IO Bool -> m Bool
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 Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
CInt
result <- Ptr Layer -> IO CInt
poppler_layer_is_visible Ptr Layer
layer'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data LayerIsVisibleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayer a) => O.MethodInfo LayerIsVisibleMethodInfo a signature where
overloadedMethod = layerIsVisible
#endif
foreign import ccall "poppler_layer_show" poppler_layer_show ::
Ptr Layer ->
IO ()
layerShow ::
(B.CallStack.HasCallStack, MonadIO m, IsLayer a) =>
a
-> m ()
layerShow :: a -> m ()
layerShow layer :: a
layer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Layer
layer' <- a -> IO (Ptr Layer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layer
Ptr Layer -> IO ()
poppler_layer_show Ptr Layer
layer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data LayerShowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsLayer a) => O.MethodInfo LayerShowMethodInfo a signature where
overloadedMethod = layerShow
#endif