-- | Copyright : Will Thompson and Iñaki García Etxebarria -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.GtkSource.Functions ( -- * Methods -- ** checkVersion #method:checkVersion# checkVersion , -- ** finalize #method:finalize# finalize , -- ** getMajorVersion #method:getMajorVersion# getMajorVersion , -- ** getMicroVersion #method:getMicroVersion# getMicroVersion , -- ** getMinorVersion #method:getMinorVersion# getMinorVersion , -- ** init #method:init# init , -- ** schedulerAdd #method:schedulerAdd# schedulerAdd , -- ** schedulerAddFull #method:schedulerAddFull# schedulerAddFull , -- ** schedulerRemove #method:schedulerRemove# schedulerRemove , -- ** utilsEscapeSearchText #method:utilsEscapeSearchText# utilsEscapeSearchText , -- ** utilsUnescapeSearchText #method:utilsUnescapeSearchText# utilsUnescapeSearchText , ) 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 GI.GLib.Callbacks as GLib.Callbacks import qualified GI.GtkSource.Callbacks as GtkSource.Callbacks -- function utils_unescape_search_text -- Args: [ Arg -- { argCName = "text" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the text to unescape." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gtk_source_utils_unescape_search_text" gtk_source_utils_unescape_search_text :: CString -> -- text : TBasicType TUTF8 IO CString -- | Use this function before [method/@searchSettings@/.set_search_text], to -- unescape the following sequences of characters: @\\n@, @\\r@, @\\t@ and @\\\\@. -- The purpose is to easily write those characters in a search entry. -- -- Note that unescaping the search text is not needed for regular expression -- searches. -- -- See also: [func/@utilsEscapeSearchText@/]. utilsUnescapeSearchText :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@text@/: the text to unescape. -> m T.Text -- ^ __Returns:__ the unescaped /@text@/. utilsUnescapeSearchText :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Text utilsUnescapeSearchText Text text = 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 CString text' <- Text -> IO CString textToCString Text text CString result <- CString -> IO CString gtk_source_utils_unescape_search_text CString text' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "utilsUnescapeSearchText" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString text' Text -> IO Text forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function utils_escape_search_text -- Args: [ Arg -- { argCName = "text" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the text to escape." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gtk_source_utils_escape_search_text" gtk_source_utils_escape_search_text :: CString -> -- text : TBasicType TUTF8 IO CString -- | Use this function to escape the following characters: @\\n@, @\\r@, @\\t@ and @\\@. -- -- For a regular expression search, use 'GI.GLib.Functions.regexEscapeString' instead. -- -- One possible use case is to take the t'GI.Gtk.Objects.TextBuffer.TextBuffer'\'s selection and put it in a -- search entry. The selection can contain tabulations, newlines, etc. So it\'s -- better to escape those special characters to better fit in the search entry. -- -- See also: [func/@utilsUnescapeSearchText@/]. -- -- \<warning> -- Warning: the escape and unescape functions are not reciprocal! For example, -- escape (unescape (\\)) = \\. So avoid cycles such as: search entry -> unescape -- -> search settings -> escape -> search entry. The original search entry text -- may be modified. -- \<\/warning> utilsEscapeSearchText :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@text@/: the text to escape. -> m T.Text -- ^ __Returns:__ the escaped /@text@/. utilsEscapeSearchText :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Text utilsEscapeSearchText Text text = 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 CString text' <- Text -> IO CString textToCString Text text CString result <- CString -> IO CString gtk_source_utils_escape_search_text CString text' Text -> CString -> IO () forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "utilsEscapeSearchText" CString result Text result' <- HasCallStack => CString -> IO Text CString -> IO Text cstringToText CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString result CString -> IO () forall a. Ptr a -> IO () freeMem CString text' Text -> IO Text forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function scheduler_remove -- Args: [ Arg -- { argCName = "handler_id" -- , argType = TBasicType TUInt64 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the handler id" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_source_scheduler_remove" gtk_source_scheduler_remove :: Word64 -> -- handler_id : TBasicType TUInt64 IO () -- | Removes a scheduler callback previously registered with -- [func/@schedulerAdd@/] or [func/@schedulerAddFull@/]. -- -- /Since: 5.2/ schedulerRemove :: (B.CallStack.HasCallStack, MonadIO m) => Word64 -- ^ /@handlerId@/: the handler id -> m () schedulerRemove :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word64 -> m () schedulerRemove Word64 handlerId = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Word64 -> IO () gtk_source_scheduler_remove Word64 handlerId () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () -- function scheduler_add_full -- Args: [ Arg -- { argCName = "callback" -- , argType = -- TInterface -- Name { namespace = "GtkSource" , name = "SchedulerCallback" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the callback to execute" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeNotified -- , argClosure = 1 -- , argDestroy = 2 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "user data for @callback" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "notify" -- , argType = -- TInterface Name { namespace = "GLib" , name = "DestroyNotify" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "closure notify for @user_data" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt64) -- throws : False -- Skip return : False foreign import ccall "gtk_source_scheduler_add_full" gtk_source_scheduler_add_full :: FunPtr GtkSource.Callbacks.C_SchedulerCallback -> -- callback : TInterface (Name {namespace = "GtkSource", name = "SchedulerCallback"}) Ptr () -> -- user_data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) IO Word64 -- | Adds a new callback that will be executed as time permits on the main thread. -- -- This is useful when you need to do a lot of background work but want to do -- it incrementally. -- -- /@callback@/ will be provided a deadline that it should complete it\'s work by -- (or near) and can be checked using 'GI.GLib.Functions.getMonotonicTime' for comparison. -- -- Use [func/@schedulerRemove@/] to remove the handler. -- -- /Since: 5.2/ schedulerAddFull :: (B.CallStack.HasCallStack, MonadIO m) => GtkSource.Callbacks.SchedulerCallback -- ^ /@callback@/: the callback to execute -> m Word64 schedulerAddFull :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SchedulerCallback -> m Word64 schedulerAddFull SchedulerCallback callback = IO Word64 -> m Word64 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64 forall a b. (a -> b) -> a -> b $ do FunPtr C_SchedulerCallback callback' <- C_SchedulerCallback -> IO (FunPtr C_SchedulerCallback) GtkSource.Callbacks.mk_SchedulerCallback (Maybe (Ptr (FunPtr C_SchedulerCallback)) -> SchedulerCallback_WithClosures -> C_SchedulerCallback GtkSource.Callbacks.wrap_SchedulerCallback Maybe (Ptr (FunPtr C_SchedulerCallback)) forall a. Maybe a Nothing (SchedulerCallback -> SchedulerCallback_WithClosures GtkSource.Callbacks.drop_closures_SchedulerCallback SchedulerCallback callback)) let userData :: Ptr () userData = FunPtr C_SchedulerCallback -> Ptr () forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_SchedulerCallback callback' let notify :: FunPtr (Ptr a -> IO ()) notify = FunPtr (Ptr a -> IO ()) forall a. FunPtr (Ptr a -> IO ()) SP.safeFreeFunPtrPtr Word64 result <- FunPtr C_SchedulerCallback -> Ptr () -> FunPtr C_DestroyNotify -> IO Word64 gtk_source_scheduler_add_full FunPtr C_SchedulerCallback callback' Ptr () userData FunPtr C_DestroyNotify forall a. FunPtr (Ptr a -> IO ()) notify Word64 -> IO Word64 forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Word64 result -- function scheduler_add -- Args: [ Arg -- { argCName = "callback" -- , argType = -- TInterface -- Name { namespace = "GtkSource" , name = "SchedulerCallback" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the callback to execute" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = 1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "user data for @callback" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt64) -- throws : False -- Skip return : False foreign import ccall "gtk_source_scheduler_add" gtk_source_scheduler_add :: FunPtr GtkSource.Callbacks.C_SchedulerCallback -> -- callback : TInterface (Name {namespace = "GtkSource", name = "SchedulerCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO Word64 -- | Simplified version of [func/@schedulerAddFull@/]. -- -- /Since: 5.2/ schedulerAdd :: (B.CallStack.HasCallStack, MonadIO m) => GtkSource.Callbacks.SchedulerCallback -- ^ /@callback@/: the callback to execute -> m Word64 schedulerAdd :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SchedulerCallback -> m Word64 schedulerAdd SchedulerCallback callback = IO Word64 -> m Word64 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64 forall a b. (a -> b) -> a -> b $ do Ptr (FunPtr C_SchedulerCallback) ptrcallback <- IO (Ptr (FunPtr C_SchedulerCallback)) forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr (FunPtr GtkSource.Callbacks.C_SchedulerCallback)) FunPtr C_SchedulerCallback callback' <- C_SchedulerCallback -> IO (FunPtr C_SchedulerCallback) GtkSource.Callbacks.mk_SchedulerCallback (Maybe (Ptr (FunPtr C_SchedulerCallback)) -> SchedulerCallback_WithClosures -> C_SchedulerCallback GtkSource.Callbacks.wrap_SchedulerCallback (Ptr (FunPtr C_SchedulerCallback) -> Maybe (Ptr (FunPtr C_SchedulerCallback)) forall a. a -> Maybe a Just Ptr (FunPtr C_SchedulerCallback) ptrcallback) (SchedulerCallback -> SchedulerCallback_WithClosures GtkSource.Callbacks.drop_closures_SchedulerCallback SchedulerCallback callback)) Ptr (FunPtr C_SchedulerCallback) -> FunPtr C_SchedulerCallback -> IO () forall a. Storable a => Ptr a -> a -> IO () poke Ptr (FunPtr C_SchedulerCallback) ptrcallback FunPtr C_SchedulerCallback callback' let userData :: Ptr a userData = Ptr a forall a. Ptr a nullPtr Word64 result <- FunPtr C_SchedulerCallback -> Ptr () -> IO Word64 gtk_source_scheduler_add FunPtr C_SchedulerCallback callback' Ptr () forall a. Ptr a userData Word64 -> IO Word64 forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Word64 result -- function init -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_source_init" gtk_source_init :: IO () -- | Initializes the GtkSourceView library (e.g. for the internationalization). -- -- This function can be called several times, but is meant to be called at the -- beginning of @/main()/@, before any other GtkSourceView function call. init :: (B.CallStack.HasCallStack, MonadIO m) => m () init :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m () init = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gtk_source_init () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () -- function get_minor_version -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gtk_source_get_minor_version" gtk_source_get_minor_version :: IO Word32 -- | Returns the minor version number of the GtkSourceView library. -- (e.g. in GtkSourceView version 3.20.0 this is 20.) -- -- This function is in the library, so it represents the GtkSourceView library -- your code is running against. Contrast with the 'GI.GtkSource.Constants.MINOR_VERSION' -- macro, which represents the minor version of the GtkSourceView headers you -- have included when compiling your code. getMinorVersion :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 -- ^ __Returns:__ the minor version number of the GtkSourceView library getMinorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32 getMinorVersion = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- IO Word32 gtk_source_get_minor_version Word32 -> IO Word32 forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function get_micro_version -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gtk_source_get_micro_version" gtk_source_get_micro_version :: IO Word32 -- | Returns the micro version number of the GtkSourceView library. -- (e.g. in GtkSourceView version 3.20.0 this is 0.) -- -- This function is in the library, so it represents the GtkSourceView library -- your code is running against. Contrast with the 'GI.GtkSource.Constants.MICRO_VERSION' -- macro, which represents the micro version of the GtkSourceView headers you -- have included when compiling your code. getMicroVersion :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 -- ^ __Returns:__ the micro version number of the GtkSourceView library getMicroVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32 getMicroVersion = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- IO Word32 gtk_source_get_micro_version Word32 -> IO Word32 forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function get_major_version -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "gtk_source_get_major_version" gtk_source_get_major_version :: IO Word32 -- | Returns the major version number of the GtkSourceView library. -- (e.g. in GtkSourceView version 3.20.0 this is 3.) -- -- This function is in the library, so it represents the GtkSourceView library -- your code is running against. Contrast with the 'GI.GtkSource.Constants.MAJOR_VERSION' -- macro, which represents the major version of the GtkSourceView headers you -- have included when compiling your code. getMajorVersion :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 -- ^ __Returns:__ the major version number of the GtkSourceView library getMajorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32 getMajorVersion = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do Word32 result <- IO Word32 gtk_source_get_major_version Word32 -> IO Word32 forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function finalize -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_source_finalize" gtk_source_finalize :: IO () -- | Free the resources allocated by GtkSourceView. For example it unrefs the -- singleton objects. -- -- It is not mandatory to call this function, it\'s just to be friendlier to -- memory debugging tools. This function is meant to be called at the end of -- @/main()/@. It can be called several times. finalize :: (B.CallStack.HasCallStack, MonadIO m) => m () finalize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m () finalize = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do IO () gtk_source_finalize () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () -- function check_version -- Args: [ Arg -- { argCName = "major" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the major version to check" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "minor" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the minor version to check" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "micro" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the micro version to check" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_source_check_version" gtk_source_check_version :: Word32 -> -- major : TBasicType TUInt Word32 -> -- minor : TBasicType TUInt Word32 -> -- micro : TBasicType TUInt IO CInt -- | Like GTK_SOURCE_CHECK_VERSION, but the check for gtk_source_check_version is -- at runtime instead of compile time. This is useful for compiling -- against older versions of GtkSourceView, but using features from newer -- versions. checkVersion :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@major@/: the major version to check -> Word32 -- ^ /@minor@/: the minor version to check -> Word32 -- ^ /@micro@/: the micro version to check -> m Bool -- ^ __Returns:__ 'P.True' if the version of the GtkSourceView currently loaded -- is the same as or newer than the passed-in version. checkVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m Bool checkVersion Word32 major Word32 minor Word32 micro = IO Bool -> m Bool forall a. IO a -> m a 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 CInt result <- Word32 -> Word32 -> Word32 -> IO CInt gtk_source_check_version Word32 major Word32 minor Word32 micro let result' :: Bool result' = (CInt -> CInt -> Bool forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result Bool -> IO Bool forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Bool result'