module GI.Ggit.Structs.Note
(
Note(..) ,
noNote ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
NoteGetIdMethodInfo ,
#endif
noteGetId ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
NoteGetMessageMethodInfo ,
#endif
noteGetMessage ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
NoteRefMethodInfo ,
#endif
noteRef ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
NoteUnrefMethodInfo ,
#endif
noteUnref ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.Ggit.Structs.OId as Ggit.OId
newtype Note = Note (ManagedPtr Note)
foreign import ccall "ggit_note_get_type" c_ggit_note_get_type ::
IO GType
instance BoxedObject Note where
boxedType _ = c_ggit_note_get_type
noNote :: Maybe Note
noNote = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Note
type instance O.AttributeList Note = NoteAttributeList
type NoteAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_note_get_id" ggit_note_get_id ::
Ptr Note ->
IO (Ptr Ggit.OId.OId)
noteGetId ::
(B.CallStack.HasCallStack, MonadIO m) =>
Note
-> m Ggit.OId.OId
noteGetId note = liftIO $ do
note' <- unsafeManagedPtrGetPtr note
result <- ggit_note_get_id note'
checkUnexpectedReturnNULL "noteGetId" result
result' <- (newBoxed Ggit.OId.OId) result
touchManagedPtr note
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data NoteGetIdMethodInfo
instance (signature ~ (m Ggit.OId.OId), MonadIO m) => O.MethodInfo NoteGetIdMethodInfo Note signature where
overloadedMethod _ = noteGetId
#endif
foreign import ccall "ggit_note_get_message" ggit_note_get_message ::
Ptr Note ->
IO CString
noteGetMessage ::
(B.CallStack.HasCallStack, MonadIO m) =>
Note
-> m T.Text
noteGetMessage note = liftIO $ do
note' <- unsafeManagedPtrGetPtr note
result <- ggit_note_get_message note'
checkUnexpectedReturnNULL "noteGetMessage" result
result' <- cstringToText result
touchManagedPtr note
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data NoteGetMessageMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo NoteGetMessageMethodInfo Note signature where
overloadedMethod _ = noteGetMessage
#endif
foreign import ccall "ggit_note_ref" ggit_note_ref ::
Ptr Note ->
IO (Ptr Note)
noteRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
Note
-> m Note
noteRef note = liftIO $ do
note' <- unsafeManagedPtrGetPtr note
result <- ggit_note_ref note'
checkUnexpectedReturnNULL "noteRef" result
result' <- (wrapBoxed Note) result
touchManagedPtr note
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data NoteRefMethodInfo
instance (signature ~ (m Note), MonadIO m) => O.MethodInfo NoteRefMethodInfo Note signature where
overloadedMethod _ = noteRef
#endif
foreign import ccall "ggit_note_unref" ggit_note_unref ::
Ptr Note ->
IO ()
noteUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
Note
-> m ()
noteUnref note = liftIO $ do
note' <- unsafeManagedPtrGetPtr note
ggit_note_unref note'
touchManagedPtr note
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data NoteUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo NoteUnrefMethodInfo Note signature where
overloadedMethod _ = noteUnref
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveNoteMethod (t :: Symbol) (o :: *) :: * where
ResolveNoteMethod "ref" o = NoteRefMethodInfo
ResolveNoteMethod "unref" o = NoteUnrefMethodInfo
ResolveNoteMethod "getId" o = NoteGetIdMethodInfo
ResolveNoteMethod "getMessage" o = NoteGetMessageMethodInfo
ResolveNoteMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNoteMethod t Note, O.MethodInfo info Note p) => O.IsLabelProxy t (Note -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveNoteMethod t Note, O.MethodInfo info Note p) => O.IsLabel t (Note -> 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
#endif