{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Poppler.Objects.AnnotCircle
(
AnnotCircle(..) ,
IsAnnotCircle ,
toAnnotCircle ,
#if defined(ENABLE_OVERLOADING)
ResolveAnnotCircleMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AnnotCircleGetInteriorColorMethodInfo ,
#endif
annotCircleGetInteriorColor ,
annotCircleNew ,
#if defined(ENABLE_OVERLOADING)
AnnotCircleSetInteriorColorMethodInfo ,
#endif
annotCircleSetInteriorColor ,
) 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.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.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.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Objects.AnnotMarkup as Poppler.AnnotMarkup
import {-# SOURCE #-} qualified GI.Poppler.Objects.Document as Poppler.Document
import {-# SOURCE #-} qualified GI.Poppler.Structs.Color as Poppler.Color
import {-# SOURCE #-} qualified GI.Poppler.Structs.Rectangle as Poppler.Rectangle
newtype AnnotCircle = AnnotCircle (SP.ManagedPtr AnnotCircle)
deriving (AnnotCircle -> AnnotCircle -> Bool
(AnnotCircle -> AnnotCircle -> Bool)
-> (AnnotCircle -> AnnotCircle -> Bool) -> Eq AnnotCircle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnnotCircle -> AnnotCircle -> Bool
$c/= :: AnnotCircle -> AnnotCircle -> Bool
== :: AnnotCircle -> AnnotCircle -> Bool
$c== :: AnnotCircle -> AnnotCircle -> Bool
Eq)
instance SP.ManagedPtrNewtype AnnotCircle where
toManagedPtr :: AnnotCircle -> ManagedPtr AnnotCircle
toManagedPtr (AnnotCircle ManagedPtr AnnotCircle
p) = ManagedPtr AnnotCircle
p
foreign import ccall "poppler_annot_circle_get_type"
c_poppler_annot_circle_get_type :: IO B.Types.GType
instance B.Types.TypedObject AnnotCircle where
glibType :: IO GType
glibType = IO GType
c_poppler_annot_circle_get_type
instance B.Types.GObject AnnotCircle
instance B.GValue.IsGValue AnnotCircle where
toGValue :: AnnotCircle -> IO GValue
toGValue AnnotCircle
o = do
GType
gtype <- IO GType
c_poppler_annot_circle_get_type
AnnotCircle -> (Ptr AnnotCircle -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AnnotCircle
o (GType
-> (GValue -> Ptr AnnotCircle -> IO ())
-> Ptr AnnotCircle
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AnnotCircle -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AnnotCircle
fromGValue GValue
gv = do
Ptr AnnotCircle
ptr <- GValue -> IO (Ptr AnnotCircle)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AnnotCircle)
(ManagedPtr AnnotCircle -> AnnotCircle)
-> Ptr AnnotCircle -> IO AnnotCircle
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AnnotCircle -> AnnotCircle
AnnotCircle Ptr AnnotCircle
ptr
class (SP.GObject o, O.IsDescendantOf AnnotCircle o) => IsAnnotCircle o
instance (SP.GObject o, O.IsDescendantOf AnnotCircle o) => IsAnnotCircle o
instance O.HasParentTypes AnnotCircle
type instance O.ParentTypes AnnotCircle = '[Poppler.AnnotMarkup.AnnotMarkup, Poppler.Annot.Annot, GObject.Object.Object]
toAnnotCircle :: (MonadIO m, IsAnnotCircle o) => o -> m AnnotCircle
toAnnotCircle :: o -> m AnnotCircle
toAnnotCircle = IO AnnotCircle -> m AnnotCircle
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotCircle -> m AnnotCircle)
-> (o -> IO AnnotCircle) -> o -> m AnnotCircle
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AnnotCircle -> AnnotCircle) -> o -> IO AnnotCircle
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AnnotCircle -> AnnotCircle
AnnotCircle
#if defined(ENABLE_OVERLOADING)
type family ResolveAnnotCircleMethod (t :: Symbol) (o :: *) :: * where
ResolveAnnotCircleMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAnnotCircleMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAnnotCircleMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAnnotCircleMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAnnotCircleMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAnnotCircleMethod "hasPopup" o = Poppler.AnnotMarkup.AnnotMarkupHasPopupMethodInfo
ResolveAnnotCircleMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAnnotCircleMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAnnotCircleMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAnnotCircleMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAnnotCircleMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAnnotCircleMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAnnotCircleMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAnnotCircleMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAnnotCircleMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAnnotCircleMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAnnotCircleMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAnnotCircleMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
ResolveAnnotCircleMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
ResolveAnnotCircleMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
ResolveAnnotCircleMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAnnotCircleMethod "getDate" o = Poppler.AnnotMarkup.AnnotMarkupGetDateMethodInfo
ResolveAnnotCircleMethod "getExternalData" o = Poppler.AnnotMarkup.AnnotMarkupGetExternalDataMethodInfo
ResolveAnnotCircleMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
ResolveAnnotCircleMethod "getInteriorColor" o = AnnotCircleGetInteriorColorMethodInfo
ResolveAnnotCircleMethod "getLabel" o = Poppler.AnnotMarkup.AnnotMarkupGetLabelMethodInfo
ResolveAnnotCircleMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
ResolveAnnotCircleMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
ResolveAnnotCircleMethod "getOpacity" o = Poppler.AnnotMarkup.AnnotMarkupGetOpacityMethodInfo
ResolveAnnotCircleMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
ResolveAnnotCircleMethod "getPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupIsOpenMethodInfo
ResolveAnnotCircleMethod "getPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupRectangleMethodInfo
ResolveAnnotCircleMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAnnotCircleMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAnnotCircleMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
ResolveAnnotCircleMethod "getReplyTo" o = Poppler.AnnotMarkup.AnnotMarkupGetReplyToMethodInfo
ResolveAnnotCircleMethod "getSubject" o = Poppler.AnnotMarkup.AnnotMarkupGetSubjectMethodInfo
ResolveAnnotCircleMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
ResolveAnnotCircleMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
ResolveAnnotCircleMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAnnotCircleMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAnnotCircleMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
ResolveAnnotCircleMethod "setInteriorColor" o = AnnotCircleSetInteriorColorMethodInfo
ResolveAnnotCircleMethod "setLabel" o = Poppler.AnnotMarkup.AnnotMarkupSetLabelMethodInfo
ResolveAnnotCircleMethod "setOpacity" o = Poppler.AnnotMarkup.AnnotMarkupSetOpacityMethodInfo
ResolveAnnotCircleMethod "setPopup" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupMethodInfo
ResolveAnnotCircleMethod "setPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupIsOpenMethodInfo
ResolveAnnotCircleMethod "setPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupRectangleMethodInfo
ResolveAnnotCircleMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAnnotCircleMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
ResolveAnnotCircleMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAnnotCircleMethod t AnnotCircle, O.MethodInfo info AnnotCircle p) => OL.IsLabel t (AnnotCircle -> 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 AnnotCircle
type instance O.AttributeList AnnotCircle = AnnotCircleAttributeList
type AnnotCircleAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AnnotCircle = AnnotCircleSignalList
type AnnotCircleSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_annot_circle_new" poppler_annot_circle_new ::
Ptr Poppler.Document.Document ->
Ptr Poppler.Rectangle.Rectangle ->
IO (Ptr AnnotCircle)
annotCircleNew ::
(B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
a
-> Poppler.Rectangle.Rectangle
-> m AnnotCircle
annotCircleNew :: a -> Rectangle -> m AnnotCircle
annotCircleNew a
doc Rectangle
rect = IO AnnotCircle -> m AnnotCircle
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AnnotCircle -> m AnnotCircle)
-> IO AnnotCircle -> m AnnotCircle
forall a b. (a -> b) -> a -> b
$ do
Ptr Document
doc' <- a -> IO (Ptr Document)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
doc
Ptr Rectangle
rect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
rect
Ptr AnnotCircle
result <- Ptr Document -> Ptr Rectangle -> IO (Ptr AnnotCircle)
poppler_annot_circle_new Ptr Document
doc' Ptr Rectangle
rect'
Text -> Ptr AnnotCircle -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotCircleNew" Ptr AnnotCircle
result
AnnotCircle
result' <- ((ManagedPtr AnnotCircle -> AnnotCircle)
-> Ptr AnnotCircle -> IO AnnotCircle
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AnnotCircle -> AnnotCircle
AnnotCircle) Ptr AnnotCircle
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
doc
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
rect
AnnotCircle -> IO AnnotCircle
forall (m :: * -> *) a. Monad m => a -> m a
return AnnotCircle
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "poppler_annot_circle_get_interior_color" poppler_annot_circle_get_interior_color ::
Ptr AnnotCircle ->
IO (Ptr Poppler.Color.Color)
annotCircleGetInteriorColor ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotCircle a) =>
a
-> m Poppler.Color.Color
annotCircleGetInteriorColor :: a -> m Color
annotCircleGetInteriorColor a
popplerAnnot = IO Color -> m Color
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Color -> m Color) -> IO Color -> m Color
forall a b. (a -> b) -> a -> b
$ do
Ptr AnnotCircle
popplerAnnot' <- a -> IO (Ptr AnnotCircle)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Color
result <- Ptr AnnotCircle -> IO (Ptr Color)
poppler_annot_circle_get_interior_color Ptr AnnotCircle
popplerAnnot'
Text -> Ptr Color -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"annotCircleGetInteriorColor" Ptr Color
result
Color
result' <- ((ManagedPtr Color -> Color) -> Ptr Color -> IO Color
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Color -> Color
Poppler.Color.Color) Ptr Color
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Color -> IO Color
forall (m :: * -> *) a. Monad m => a -> m a
return Color
result'
#if defined(ENABLE_OVERLOADING)
data AnnotCircleGetInteriorColorMethodInfo
instance (signature ~ (m Poppler.Color.Color), MonadIO m, IsAnnotCircle a) => O.MethodInfo AnnotCircleGetInteriorColorMethodInfo a signature where
overloadedMethod = annotCircleGetInteriorColor
#endif
foreign import ccall "poppler_annot_circle_set_interior_color" poppler_annot_circle_set_interior_color ::
Ptr AnnotCircle ->
Ptr Poppler.Color.Color ->
IO ()
annotCircleSetInteriorColor ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotCircle a) =>
a
-> Maybe (Poppler.Color.Color)
-> m ()
annotCircleSetInteriorColor :: a -> Maybe Color -> m ()
annotCircleSetInteriorColor a
popplerAnnot Maybe Color
popplerColor = 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 AnnotCircle
popplerAnnot' <- a -> IO (Ptr AnnotCircle)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
popplerAnnot
Ptr Color
maybePopplerColor <- case Maybe Color
popplerColor of
Maybe Color
Nothing -> Ptr Color -> IO (Ptr Color)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Color
forall a. Ptr a
nullPtr
Just Color
jPopplerColor -> do
Ptr Color
jPopplerColor' <- Color -> IO (Ptr Color)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Color
jPopplerColor
Ptr Color -> IO (Ptr Color)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Color
jPopplerColor'
Ptr AnnotCircle -> Ptr Color -> IO ()
poppler_annot_circle_set_interior_color Ptr AnnotCircle
popplerAnnot' Ptr Color
maybePopplerColor
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
popplerAnnot
Maybe Color -> (Color -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Color
popplerColor Color -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AnnotCircleSetInteriorColorMethodInfo
instance (signature ~ (Maybe (Poppler.Color.Color) -> m ()), MonadIO m, IsAnnotCircle a) => O.MethodInfo AnnotCircleSetInteriorColorMethodInfo a signature where
overloadedMethod = annotCircleSetInteriorColor
#endif