{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.Builder
(
Builder(..) ,
IsBuilder ,
toBuilder ,
#if defined(ENABLE_OVERLOADING)
ResolveBuilderMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BuilderAddCallbackSymbolMethodInfo ,
#endif
builderAddCallbackSymbol ,
#if defined(ENABLE_OVERLOADING)
BuilderAddFromFileMethodInfo ,
#endif
builderAddFromFile ,
#if defined(ENABLE_OVERLOADING)
BuilderAddFromResourceMethodInfo ,
#endif
builderAddFromResource ,
#if defined(ENABLE_OVERLOADING)
BuilderAddFromStringMethodInfo ,
#endif
builderAddFromString ,
#if defined(ENABLE_OVERLOADING)
BuilderAddObjectsFromFileMethodInfo ,
#endif
builderAddObjectsFromFile ,
#if defined(ENABLE_OVERLOADING)
BuilderAddObjectsFromResourceMethodInfo ,
#endif
builderAddObjectsFromResource ,
#if defined(ENABLE_OVERLOADING)
BuilderAddObjectsFromStringMethodInfo ,
#endif
builderAddObjectsFromString ,
#if defined(ENABLE_OVERLOADING)
BuilderConnectSignalsMethodInfo ,
#endif
builderConnectSignals ,
#if defined(ENABLE_OVERLOADING)
BuilderConnectSignalsFullMethodInfo ,
#endif
builderConnectSignalsFull ,
#if defined(ENABLE_OVERLOADING)
BuilderExposeObjectMethodInfo ,
#endif
builderExposeObject ,
#if defined(ENABLE_OVERLOADING)
BuilderExtendWithTemplateMethodInfo ,
#endif
builderExtendWithTemplate ,
#if defined(ENABLE_OVERLOADING)
BuilderGetApplicationMethodInfo ,
#endif
builderGetApplication ,
#if defined(ENABLE_OVERLOADING)
BuilderGetObjectMethodInfo ,
#endif
builderGetObject ,
#if defined(ENABLE_OVERLOADING)
BuilderGetObjectsMethodInfo ,
#endif
builderGetObjects ,
#if defined(ENABLE_OVERLOADING)
BuilderGetTranslationDomainMethodInfo ,
#endif
builderGetTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
BuilderGetTypeFromNameMethodInfo ,
#endif
builderGetTypeFromName ,
builderNew ,
builderNewFromFile ,
builderNewFromResource ,
builderNewFromString ,
#if defined(ENABLE_OVERLOADING)
BuilderSetApplicationMethodInfo ,
#endif
builderSetApplication ,
#if defined(ENABLE_OVERLOADING)
BuilderSetTranslationDomainMethodInfo ,
#endif
builderSetTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
BuilderValueFromStringMethodInfo ,
#endif
builderValueFromString ,
#if defined(ENABLE_OVERLOADING)
BuilderValueFromStringTypeMethodInfo ,
#endif
builderValueFromStringType ,
#if defined(ENABLE_OVERLOADING)
BuilderTranslationDomainPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
builderTranslationDomain ,
#endif
clearBuilderTranslationDomain ,
constructBuilderTranslationDomain ,
getBuilderTranslationDomain ,
setBuilderTranslationDomain ,
) 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.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Objects.Application as Gtk.Application
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype Builder = Builder (SP.ManagedPtr Builder)
deriving (Builder -> Builder -> Bool
(Builder -> Builder -> Bool)
-> (Builder -> Builder -> Bool) -> Eq Builder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Builder -> Builder -> Bool
== :: Builder -> Builder -> Bool
$c/= :: Builder -> Builder -> Bool
/= :: Builder -> Builder -> Bool
Eq)
instance SP.ManagedPtrNewtype Builder where
toManagedPtr :: Builder -> ManagedPtr Builder
toManagedPtr (Builder ManagedPtr Builder
p) = ManagedPtr Builder
p
foreign import ccall "gtk_builder_get_type"
c_gtk_builder_get_type :: IO B.Types.GType
instance B.Types.TypedObject Builder where
glibType :: IO GType
glibType = IO GType
c_gtk_builder_get_type
instance B.Types.GObject Builder
class (SP.GObject o, O.IsDescendantOf Builder o) => IsBuilder o
instance (SP.GObject o, O.IsDescendantOf Builder o) => IsBuilder o
instance O.HasParentTypes Builder
type instance O.ParentTypes Builder = '[GObject.Object.Object]
toBuilder :: (MIO.MonadIO m, IsBuilder o) => o -> m Builder
toBuilder :: forall (m :: * -> *) o. (MonadIO m, IsBuilder o) => o -> m Builder
toBuilder = IO Builder -> m Builder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Builder -> m Builder) -> (o -> IO Builder) -> o -> m Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Builder -> Builder) -> o -> IO Builder
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Builder -> Builder
Builder
instance B.GValue.IsGValue (Maybe Builder) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_builder_get_type
gvalueSet_ :: Ptr GValue -> Maybe Builder -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Builder
P.Nothing = Ptr GValue -> Ptr Builder -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Builder
forall a. Ptr a
FP.nullPtr :: FP.Ptr Builder)
gvalueSet_ Ptr GValue
gv (P.Just Builder
obj) = Builder -> (Ptr Builder -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Builder
obj (Ptr GValue -> Ptr Builder -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Builder)
gvalueGet_ Ptr GValue
gv = do
Ptr Builder
ptr <- Ptr GValue -> IO (Ptr Builder)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Builder)
if Ptr Builder
ptr Ptr Builder -> Ptr Builder -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Builder
forall a. Ptr a
FP.nullPtr
then Builder -> Maybe Builder
forall a. a -> Maybe a
P.Just (Builder -> Maybe Builder) -> IO Builder -> IO (Maybe Builder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Builder -> Builder) -> Ptr Builder -> IO Builder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Builder -> Builder
Builder Ptr Builder
ptr
else Maybe Builder -> IO (Maybe Builder)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Builder
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveBuilderMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveBuilderMethod "addCallbackSymbol" o = BuilderAddCallbackSymbolMethodInfo
ResolveBuilderMethod "addFromFile" o = BuilderAddFromFileMethodInfo
ResolveBuilderMethod "addFromResource" o = BuilderAddFromResourceMethodInfo
ResolveBuilderMethod "addFromString" o = BuilderAddFromStringMethodInfo
ResolveBuilderMethod "addObjectsFromFile" o = BuilderAddObjectsFromFileMethodInfo
ResolveBuilderMethod "addObjectsFromResource" o = BuilderAddObjectsFromResourceMethodInfo
ResolveBuilderMethod "addObjectsFromString" o = BuilderAddObjectsFromStringMethodInfo
ResolveBuilderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBuilderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBuilderMethod "connectSignals" o = BuilderConnectSignalsMethodInfo
ResolveBuilderMethod "connectSignalsFull" o = BuilderConnectSignalsFullMethodInfo
ResolveBuilderMethod "exposeObject" o = BuilderExposeObjectMethodInfo
ResolveBuilderMethod "extendWithTemplate" o = BuilderExtendWithTemplateMethodInfo
ResolveBuilderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBuilderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBuilderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBuilderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBuilderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBuilderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBuilderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBuilderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBuilderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBuilderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBuilderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBuilderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBuilderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBuilderMethod "valueFromString" o = BuilderValueFromStringMethodInfo
ResolveBuilderMethod "valueFromStringType" o = BuilderValueFromStringTypeMethodInfo
ResolveBuilderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBuilderMethod "getApplication" o = BuilderGetApplicationMethodInfo
ResolveBuilderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBuilderMethod "getObject" o = BuilderGetObjectMethodInfo
ResolveBuilderMethod "getObjects" o = BuilderGetObjectsMethodInfo
ResolveBuilderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBuilderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBuilderMethod "getTranslationDomain" o = BuilderGetTranslationDomainMethodInfo
ResolveBuilderMethod "getTypeFromName" o = BuilderGetTypeFromNameMethodInfo
ResolveBuilderMethod "setApplication" o = BuilderSetApplicationMethodInfo
ResolveBuilderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBuilderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBuilderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBuilderMethod "setTranslationDomain" o = BuilderSetTranslationDomainMethodInfo
ResolveBuilderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBuilderMethod t Builder, O.OverloadedMethod info Builder p) => OL.IsLabel t (Builder -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveBuilderMethod t Builder, O.OverloadedMethod info Builder p, R.HasField t Builder p) => R.HasField t Builder p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBuilderMethod t Builder, O.OverloadedMethodInfo info Builder) => OL.IsLabel t (O.MethodProxy info Builder) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getBuilderTranslationDomain :: (MonadIO m, IsBuilder o) => o -> m T.Text
getBuilderTranslationDomain :: forall (m :: * -> *) o. (MonadIO m, IsBuilder o) => o -> m Text
getBuilderTranslationDomain o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getBuilderTranslationDomain" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"translation-domain"
setBuilderTranslationDomain :: (MonadIO m, IsBuilder o) => o -> T.Text -> m ()
setBuilderTranslationDomain :: forall (m :: * -> *) o.
(MonadIO m, IsBuilder o) =>
o -> Text -> m ()
setBuilderTranslationDomain o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"translation-domain" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructBuilderTranslationDomain :: (IsBuilder o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructBuilderTranslationDomain :: forall o (m :: * -> *).
(IsBuilder o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructBuilderTranslationDomain Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"translation-domain" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
clearBuilderTranslationDomain :: (MonadIO m, IsBuilder o) => o -> m ()
clearBuilderTranslationDomain :: forall (m :: * -> *) o. (MonadIO m, IsBuilder o) => o -> m ()
clearBuilderTranslationDomain o
obj = 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
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"translation-domain" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data BuilderTranslationDomainPropertyInfo
instance AttrInfo BuilderTranslationDomainPropertyInfo where
type AttrAllowedOps BuilderTranslationDomainPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint BuilderTranslationDomainPropertyInfo = IsBuilder
type AttrSetTypeConstraint BuilderTranslationDomainPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint BuilderTranslationDomainPropertyInfo = (~) T.Text
type AttrTransferType BuilderTranslationDomainPropertyInfo = T.Text
type AttrGetType BuilderTranslationDomainPropertyInfo = T.Text
type AttrLabel BuilderTranslationDomainPropertyInfo = "translation-domain"
type AttrOrigin BuilderTranslationDomainPropertyInfo = Builder
attrGet = getBuilderTranslationDomain
attrSet = setBuilderTranslationDomain
attrTransfer _ v = do
return v
attrConstruct = constructBuilderTranslationDomain
attrClear = clearBuilderTranslationDomain
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.translationDomain"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#g:attr:translationDomain"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Builder
type instance O.AttributeList Builder = BuilderAttributeList
type BuilderAttributeList = ('[ '("translationDomain", BuilderTranslationDomainPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
builderTranslationDomain :: AttrLabelProxy "translationDomain"
builderTranslationDomain = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Builder = BuilderSignalList
type BuilderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_builder_new" gtk_builder_new ::
IO (Ptr Builder)
builderNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Builder
builderNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Builder
builderNew = IO Builder -> m Builder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Builder -> m Builder) -> IO Builder -> m Builder
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
result <- IO (Ptr Builder)
gtk_builder_new
Text -> Ptr Builder -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"builderNew" Ptr Builder
result
Builder
result' <- ((ManagedPtr Builder -> Builder) -> Ptr Builder -> IO Builder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Builder -> Builder
Builder) Ptr Builder
result
Builder -> IO Builder
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Builder
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_builder_new_from_file" gtk_builder_new_from_file ::
CString ->
IO (Ptr Builder)
builderNewFromFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Builder
builderNewFromFile :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m Builder
builderNewFromFile Text
filename = IO Builder -> m Builder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Builder -> m Builder) -> IO Builder -> m Builder
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- Text -> IO CString
textToCString Text
filename
Ptr Builder
result <- CString -> IO (Ptr Builder)
gtk_builder_new_from_file CString
filename'
Text -> Ptr Builder -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"builderNewFromFile" Ptr Builder
result
Builder
result' <- ((ManagedPtr Builder -> Builder) -> Ptr Builder -> IO Builder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Builder -> Builder
Builder) Ptr Builder
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Builder -> IO Builder
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Builder
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_builder_new_from_resource" gtk_builder_new_from_resource ::
CString ->
IO (Ptr Builder)
builderNewFromResource ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Builder
builderNewFromResource :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m Builder
builderNewFromResource Text
resourcePath = IO Builder -> m Builder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Builder -> m Builder) -> IO Builder -> m Builder
forall a b. (a -> b) -> a -> b
$ do
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
Ptr Builder
result <- CString -> IO (Ptr Builder)
gtk_builder_new_from_resource CString
resourcePath'
Text -> Ptr Builder -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"builderNewFromResource" Ptr Builder
result
Builder
result' <- ((ManagedPtr Builder -> Builder) -> Ptr Builder -> IO Builder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Builder -> Builder
Builder) Ptr Builder
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
Builder -> IO Builder
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Builder
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_builder_new_from_string" gtk_builder_new_from_string ::
CString ->
Int64 ->
IO (Ptr Builder)
builderNewFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Int64
-> m Builder
builderNewFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Int64 -> m Builder
builderNewFromString Text
string Int64
length_ = IO Builder -> m Builder
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Builder -> m Builder) -> IO Builder -> m Builder
forall a b. (a -> b) -> a -> b
$ do
CString
string' <- Text -> IO CString
textToCString Text
string
Ptr Builder
result <- CString -> Int64 -> IO (Ptr Builder)
gtk_builder_new_from_string CString
string' Int64
length_
Text -> Ptr Builder -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"builderNewFromString" Ptr Builder
result
Builder
result' <- ((ManagedPtr Builder -> Builder) -> Ptr Builder -> IO Builder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Builder -> Builder
Builder) Ptr Builder
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
Builder -> IO Builder
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Builder
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_builder_add_callback_symbol" gtk_builder_add_callback_symbol ::
Ptr Builder ->
CString ->
FunPtr GObject.Callbacks.C_Callback ->
IO ()
builderAddCallbackSymbol ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> GObject.Callbacks.Callback
-> m ()
builderAddCallbackSymbol :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> IO () -> m ()
builderAddCallbackSymbol a
builder Text
callbackName IO ()
callbackSymbol = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
callbackName' <- Text -> IO CString
textToCString Text
callbackName
FunPtr (IO ())
callbackSymbol' <- IO () -> IO (FunPtr (IO ()))
GObject.Callbacks.mk_Callback (Maybe (Ptr (FunPtr (IO ()))) -> IO () -> IO ()
GObject.Callbacks.wrap_Callback Maybe (Ptr (FunPtr (IO ())))
forall a. Maybe a
Nothing IO ()
callbackSymbol)
Ptr Builder -> CString -> FunPtr (IO ()) -> IO ()
gtk_builder_add_callback_symbol Ptr Builder
builder' CString
callbackName' FunPtr (IO ())
callbackSymbol'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
callbackName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderAddCallbackSymbolMethodInfo
instance (signature ~ (T.Text -> GObject.Callbacks.Callback -> m ()), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddCallbackSymbolMethodInfo a signature where
overloadedMethod = builderAddCallbackSymbol
instance O.OverloadedMethodInfo BuilderAddCallbackSymbolMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddCallbackSymbol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddCallbackSymbol"
})
#endif
foreign import ccall "gtk_builder_add_from_file" gtk_builder_add_from_file ::
Ptr Builder ->
CString ->
Ptr (Ptr GError) ->
IO Word32
builderAddFromFile ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> m Word32
builderAddFromFile :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> m Word32
builderAddFromFile a
builder Text
filename = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
filename' <- Text -> IO CString
textToCString Text
filename
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder -> CString -> Ptr (Ptr GError) -> IO Word32
gtk_builder_add_from_file Ptr Builder
builder' CString
filename'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddFromFileMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddFromFileMethodInfo a signature where
overloadedMethod = builderAddFromFile
instance O.OverloadedMethodInfo BuilderAddFromFileMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddFromFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddFromFile"
})
#endif
foreign import ccall "gtk_builder_add_from_resource" gtk_builder_add_from_resource ::
Ptr Builder ->
CString ->
Ptr (Ptr GError) ->
IO Word32
builderAddFromResource ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> m Word32
builderAddFromResource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> m Word32
builderAddFromResource a
builder Text
resourcePath = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder -> CString -> Ptr (Ptr GError) -> IO Word32
gtk_builder_add_from_resource Ptr Builder
builder' CString
resourcePath'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddFromResourceMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddFromResourceMethodInfo a signature where
overloadedMethod = builderAddFromResource
instance O.OverloadedMethodInfo BuilderAddFromResourceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddFromResource",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddFromResource"
})
#endif
foreign import ccall "gtk_builder_add_from_string" gtk_builder_add_from_string ::
Ptr Builder ->
CString ->
Int64 ->
Ptr (Ptr GError) ->
IO Word32
builderAddFromString ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> Int64
-> m Word32
builderAddFromString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> Int64 -> m Word32
builderAddFromString a
builder Text
buffer Int64
length_ = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
buffer' <- Text -> IO CString
textToCString Text
buffer
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder -> CString -> Int64 -> Ptr (Ptr GError) -> IO Word32
gtk_builder_add_from_string Ptr Builder
builder' CString
buffer' Int64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddFromStringMethodInfo
instance (signature ~ (T.Text -> Int64 -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddFromStringMethodInfo a signature where
overloadedMethod = builderAddFromString
instance O.OverloadedMethodInfo BuilderAddFromStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddFromString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddFromString"
})
#endif
foreign import ccall "gtk_builder_add_objects_from_file" gtk_builder_add_objects_from_file ::
Ptr Builder ->
CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO Word32
builderAddObjectsFromFile ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> [T.Text]
-> m Word32
builderAddObjectsFromFile :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> [Text] -> m Word32
builderAddObjectsFromFile a
builder Text
filename [Text]
objectIds = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
filename' <- Text -> IO CString
textToCString Text
filename
Ptr CString
objectIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
objectIds
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> CString -> Ptr CString -> Ptr (Ptr GError) -> IO Word32
gtk_builder_add_objects_from_file Ptr Builder
builder' CString
filename' Ptr CString
objectIds'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddObjectsFromFileMethodInfo
instance (signature ~ (T.Text -> [T.Text] -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddObjectsFromFileMethodInfo a signature where
overloadedMethod = builderAddObjectsFromFile
instance O.OverloadedMethodInfo BuilderAddObjectsFromFileMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddObjectsFromFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddObjectsFromFile"
})
#endif
foreign import ccall "gtk_builder_add_objects_from_resource" gtk_builder_add_objects_from_resource ::
Ptr Builder ->
CString ->
Ptr CString ->
Ptr (Ptr GError) ->
IO Word32
builderAddObjectsFromResource ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> [T.Text]
-> m Word32
builderAddObjectsFromResource :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> [Text] -> m Word32
builderAddObjectsFromResource a
builder Text
resourcePath [Text]
objectIds = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
resourcePath' <- Text -> IO CString
textToCString Text
resourcePath
Ptr CString
objectIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
objectIds
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> CString -> Ptr CString -> Ptr (Ptr GError) -> IO Word32
gtk_builder_add_objects_from_resource Ptr Builder
builder' CString
resourcePath' Ptr CString
objectIds'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
resourcePath'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddObjectsFromResourceMethodInfo
instance (signature ~ (T.Text -> [T.Text] -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddObjectsFromResourceMethodInfo a signature where
overloadedMethod = builderAddObjectsFromResource
instance O.OverloadedMethodInfo BuilderAddObjectsFromResourceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddObjectsFromResource",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddObjectsFromResource"
})
#endif
foreign import ccall "gtk_builder_add_objects_from_string" gtk_builder_add_objects_from_string ::
Ptr Builder ->
CString ->
Word64 ->
Ptr CString ->
Ptr (Ptr GError) ->
IO Word32
builderAddObjectsFromString ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> Word64
-> [T.Text]
-> m Word32
builderAddObjectsFromString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> Word64 -> [Text] -> m Word32
builderAddObjectsFromString a
builder Text
buffer Word64
length_ [Text]
objectIds = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
buffer' <- Text -> IO CString
textToCString Text
buffer
Ptr CString
objectIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
objectIds
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> CString
-> Word64
-> Ptr CString
-> Ptr (Ptr GError)
-> IO Word32
gtk_builder_add_objects_from_string Ptr Builder
builder' CString
buffer' Word64
length_ Ptr CString
objectIds'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
objectIds'
)
#if defined(ENABLE_OVERLOADING)
data BuilderAddObjectsFromStringMethodInfo
instance (signature ~ (T.Text -> Word64 -> [T.Text] -> m Word32), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderAddObjectsFromStringMethodInfo a signature where
overloadedMethod = builderAddObjectsFromString
instance O.OverloadedMethodInfo BuilderAddObjectsFromStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderAddObjectsFromString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderAddObjectsFromString"
})
#endif
foreign import ccall "gtk_builder_connect_signals" gtk_builder_connect_signals ::
Ptr Builder ->
Ptr () ->
IO ()
builderConnectSignals ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> Ptr ()
-> m ()
builderConnectSignals :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Ptr () -> m ()
builderConnectSignals a
builder Ptr ()
userData = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr Builder -> Ptr () -> IO ()
gtk_builder_connect_signals Ptr Builder
builder' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderConnectSignalsMethodInfo
instance (signature ~ (Ptr () -> m ()), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderConnectSignalsMethodInfo a signature where
overloadedMethod = builderConnectSignals
instance O.OverloadedMethodInfo BuilderConnectSignalsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderConnectSignals",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderConnectSignals"
})
#endif
foreign import ccall "gtk_builder_connect_signals_full" gtk_builder_connect_signals_full ::
Ptr Builder ->
FunPtr Gtk.Callbacks.C_BuilderConnectFunc ->
Ptr () ->
IO ()
builderConnectSignalsFull ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> Gtk.Callbacks.BuilderConnectFunc
-> m ()
builderConnectSignalsFull :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> BuilderConnectFunc -> m ()
builderConnectSignalsFull a
builder BuilderConnectFunc
func = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
FunPtr C_BuilderConnectFunc
func' <- C_BuilderConnectFunc -> IO (FunPtr C_BuilderConnectFunc)
Gtk.Callbacks.mk_BuilderConnectFunc (Maybe (Ptr (FunPtr C_BuilderConnectFunc))
-> BuilderConnectFunc_WithClosures -> C_BuilderConnectFunc
Gtk.Callbacks.wrap_BuilderConnectFunc Maybe (Ptr (FunPtr C_BuilderConnectFunc))
forall a. Maybe a
Nothing (BuilderConnectFunc -> BuilderConnectFunc_WithClosures
Gtk.Callbacks.drop_closures_BuilderConnectFunc BuilderConnectFunc
func))
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Builder -> FunPtr C_BuilderConnectFunc -> Ptr () -> IO ()
gtk_builder_connect_signals_full Ptr Builder
builder' FunPtr C_BuilderConnectFunc
func' Ptr ()
forall a. Ptr a
userData
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_BuilderConnectFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_BuilderConnectFunc
func'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderConnectSignalsFullMethodInfo
instance (signature ~ (Gtk.Callbacks.BuilderConnectFunc -> m ()), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderConnectSignalsFullMethodInfo a signature where
overloadedMethod = builderConnectSignalsFull
instance O.OverloadedMethodInfo BuilderConnectSignalsFullMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderConnectSignalsFull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderConnectSignalsFull"
})
#endif
foreign import ccall "gtk_builder_expose_object" gtk_builder_expose_object ::
Ptr Builder ->
CString ->
Ptr GObject.Object.Object ->
IO ()
builderExposeObject ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a, GObject.Object.IsObject b) =>
a
-> T.Text
-> b
-> m ()
builderExposeObject :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBuilder a, IsObject b) =>
a -> Text -> b -> m ()
builderExposeObject a
builder Text
name b
object = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Object
object' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
object
Ptr Builder -> CString -> Ptr Object -> IO ()
gtk_builder_expose_object Ptr Builder
builder' CString
name' Ptr Object
object'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
object
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderExposeObjectMethodInfo
instance (signature ~ (T.Text -> b -> m ()), MonadIO m, IsBuilder a, GObject.Object.IsObject b) => O.OverloadedMethod BuilderExposeObjectMethodInfo a signature where
overloadedMethod = builderExposeObject
instance O.OverloadedMethodInfo BuilderExposeObjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderExposeObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderExposeObject"
})
#endif
foreign import ccall "gtk_builder_extend_with_template" gtk_builder_extend_with_template ::
Ptr Builder ->
Ptr Gtk.Widget.Widget ->
CGType ->
CString ->
Word64 ->
Ptr (Ptr GError) ->
IO Word32
builderExtendWithTemplate ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a, Gtk.Widget.IsWidget b) =>
a
-> b
-> GType
-> T.Text
-> Word64
-> m Word32
builderExtendWithTemplate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBuilder a, IsWidget b) =>
a -> b -> GType -> Text -> Word64 -> m Word32
builderExtendWithTemplate a
builder b
widget GType
templateType Text
buffer Word64
length_ = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr Widget
widget' <- b -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
widget
let templateType' :: Word64
templateType' = GType -> Word64
gtypeToCGType GType
templateType
CString
buffer' <- Text -> IO CString
textToCString Text
buffer
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> Ptr Widget
-> Word64
-> CString
-> Word64
-> Ptr (Ptr GError)
-> IO Word32
gtk_builder_extend_with_template Ptr Builder
builder' Ptr Widget
widget' Word64
templateType' CString
buffer' Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
widget
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
buffer'
)
#if defined(ENABLE_OVERLOADING)
data BuilderExtendWithTemplateMethodInfo
instance (signature ~ (b -> GType -> T.Text -> Word64 -> m Word32), MonadIO m, IsBuilder a, Gtk.Widget.IsWidget b) => O.OverloadedMethod BuilderExtendWithTemplateMethodInfo a signature where
overloadedMethod = builderExtendWithTemplate
instance O.OverloadedMethodInfo BuilderExtendWithTemplateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderExtendWithTemplate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderExtendWithTemplate"
})
#endif
foreign import ccall "gtk_builder_get_application" gtk_builder_get_application ::
Ptr Builder ->
IO (Ptr Gtk.Application.Application)
builderGetApplication ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> m (Maybe Gtk.Application.Application)
builderGetApplication :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> m (Maybe Application)
builderGetApplication a
builder = IO (Maybe Application) -> m (Maybe Application)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Application) -> m (Maybe Application))
-> IO (Maybe Application) -> m (Maybe Application)
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr Application
result <- Ptr Builder -> IO (Ptr Application)
gtk_builder_get_application Ptr Builder
builder'
Maybe Application
maybeResult <- Ptr Application
-> (Ptr Application -> IO Application) -> IO (Maybe Application)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Application
result ((Ptr Application -> IO Application) -> IO (Maybe Application))
-> (Ptr Application -> IO Application) -> IO (Maybe Application)
forall a b. (a -> b) -> a -> b
$ \Ptr Application
result' -> do
Application
result'' <- ((ManagedPtr Application -> Application)
-> Ptr Application -> IO Application
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Application -> Application
Gtk.Application.Application) Ptr Application
result'
Application -> IO Application
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Application
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
Maybe Application -> IO (Maybe Application)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Application
maybeResult
#if defined(ENABLE_OVERLOADING)
data BuilderGetApplicationMethodInfo
instance (signature ~ (m (Maybe Gtk.Application.Application)), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderGetApplicationMethodInfo a signature where
overloadedMethod = builderGetApplication
instance O.OverloadedMethodInfo BuilderGetApplicationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderGetApplication",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderGetApplication"
})
#endif
foreign import ccall "gtk_builder_get_object" gtk_builder_get_object ::
Ptr Builder ->
CString ->
IO (Ptr GObject.Object.Object)
builderGetObject ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> m (Maybe GObject.Object.Object)
builderGetObject :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> m (Maybe Object)
builderGetObject a
builder Text
name = IO (Maybe Object) -> m (Maybe Object)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Object) -> m (Maybe Object))
-> IO (Maybe Object) -> m (Maybe Object)
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Object
result <- Ptr Builder -> CString -> IO (Ptr Object)
gtk_builder_get_object Ptr Builder
builder' CString
name'
Maybe Object
maybeResult <- Ptr Object -> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Object
result ((Ptr Object -> IO Object) -> IO (Maybe Object))
-> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ \Ptr Object
result' -> do
Object
result'' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
result'
Object -> IO Object
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Maybe Object -> IO (Maybe Object)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
maybeResult
#if defined(ENABLE_OVERLOADING)
data BuilderGetObjectMethodInfo
instance (signature ~ (T.Text -> m (Maybe GObject.Object.Object)), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderGetObjectMethodInfo a signature where
overloadedMethod = builderGetObject
instance O.OverloadedMethodInfo BuilderGetObjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderGetObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderGetObject"
})
#endif
foreign import ccall "gtk_builder_get_objects" gtk_builder_get_objects ::
Ptr Builder ->
IO (Ptr (GSList (Ptr GObject.Object.Object)))
builderGetObjects ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> m [GObject.Object.Object]
builderGetObjects :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> m [Object]
builderGetObjects a
builder = IO [Object] -> m [Object]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Object] -> m [Object]) -> IO [Object] -> m [Object]
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr (GSList (Ptr Object))
result <- Ptr Builder -> IO (Ptr (GSList (Ptr Object)))
gtk_builder_get_objects Ptr Builder
builder'
[Ptr Object]
result' <- Ptr (GSList (Ptr Object)) -> IO [Ptr Object]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Object))
result
[Object]
result'' <- (Ptr Object -> IO Object) -> [Ptr Object] -> IO [Object]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) [Ptr Object]
result'
Ptr (GSList (Ptr Object)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Object))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
[Object] -> IO [Object]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Object]
result''
#if defined(ENABLE_OVERLOADING)
data BuilderGetObjectsMethodInfo
instance (signature ~ (m [GObject.Object.Object]), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderGetObjectsMethodInfo a signature where
overloadedMethod = builderGetObjects
instance O.OverloadedMethodInfo BuilderGetObjectsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderGetObjects",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderGetObjects"
})
#endif
foreign import ccall "gtk_builder_get_translation_domain" gtk_builder_get_translation_domain ::
Ptr Builder ->
IO CString
builderGetTranslationDomain ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> m T.Text
builderGetTranslationDomain :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> m Text
builderGetTranslationDomain a
builder = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
result <- Ptr Builder -> IO CString
gtk_builder_get_translation_domain Ptr Builder
builder'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"builderGetTranslationDomain" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BuilderGetTranslationDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderGetTranslationDomainMethodInfo a signature where
overloadedMethod = builderGetTranslationDomain
instance O.OverloadedMethodInfo BuilderGetTranslationDomainMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderGetTranslationDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderGetTranslationDomain"
})
#endif
foreign import ccall "gtk_builder_get_type_from_name" gtk_builder_get_type_from_name ::
Ptr Builder ->
CString ->
IO CGType
builderGetTypeFromName ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> T.Text
-> m GType
builderGetTypeFromName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Text -> m GType
builderGetTypeFromName a
builder Text
typeName = IO GType -> m GType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
typeName' <- Text -> IO CString
textToCString Text
typeName
Word64
result <- Ptr Builder -> CString -> IO Word64
gtk_builder_get_type_from_name Ptr Builder
builder' CString
typeName'
let result' :: GType
result' = Word64 -> GType
GType Word64
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
typeName'
GType -> IO GType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data BuilderGetTypeFromNameMethodInfo
instance (signature ~ (T.Text -> m GType), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderGetTypeFromNameMethodInfo a signature where
overloadedMethod = builderGetTypeFromName
instance O.OverloadedMethodInfo BuilderGetTypeFromNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderGetTypeFromName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderGetTypeFromName"
})
#endif
foreign import ccall "gtk_builder_set_application" gtk_builder_set_application ::
Ptr Builder ->
Ptr Gtk.Application.Application ->
IO ()
builderSetApplication ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a, Gtk.Application.IsApplication b) =>
a
-> b
-> m ()
builderSetApplication :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBuilder a, IsApplication b) =>
a -> b -> m ()
builderSetApplication a
builder b
application = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr Application
application' <- b -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
application
Ptr Builder -> Ptr Application -> IO ()
gtk_builder_set_application Ptr Builder
builder' Ptr Application
application'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
application
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderSetApplicationMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBuilder a, Gtk.Application.IsApplication b) => O.OverloadedMethod BuilderSetApplicationMethodInfo a signature where
overloadedMethod = builderSetApplication
instance O.OverloadedMethodInfo BuilderSetApplicationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderSetApplication",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderSetApplication"
})
#endif
foreign import ccall "gtk_builder_set_translation_domain" gtk_builder_set_translation_domain ::
Ptr Builder ->
CString ->
IO ()
builderSetTranslationDomain ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> Maybe (T.Text)
-> m ()
builderSetTranslationDomain :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> Maybe Text -> m ()
builderSetTranslationDomain a
builder Maybe Text
domain = 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
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
CString
maybeDomain <- case Maybe Text
domain of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jDomain -> do
CString
jDomain' <- Text -> IO CString
textToCString Text
jDomain
CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jDomain'
Ptr Builder -> CString -> IO ()
gtk_builder_set_translation_domain Ptr Builder
builder' CString
maybeDomain
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDomain
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BuilderSetTranslationDomainMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderSetTranslationDomainMethodInfo a signature where
overloadedMethod = builderSetTranslationDomain
instance O.OverloadedMethodInfo BuilderSetTranslationDomainMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderSetTranslationDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderSetTranslationDomain"
})
#endif
foreign import ccall "gtk_builder_value_from_string" gtk_builder_value_from_string ::
Ptr Builder ->
Ptr GParamSpec ->
CString ->
Ptr GValue ->
Ptr (Ptr GError) ->
IO CInt
builderValueFromString ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> GParamSpec
-> T.Text
-> m (GValue)
builderValueFromString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> GParamSpec -> Text -> m GValue
builderValueFromString a
builder GParamSpec
pspec Text
string = IO GValue -> m GValue
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
Ptr GParamSpec
pspec' <- GParamSpec -> IO (Ptr GParamSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
CString
string' <- Text -> IO CString
textToCString Text
string
Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
24 :: IO (Ptr GValue)
IO GValue -> IO () -> IO GValue
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> Ptr GParamSpec
-> CString
-> Ptr GValue
-> Ptr (Ptr GError)
-> IO CInt
gtk_builder_value_from_string Ptr Builder
builder' Ptr GParamSpec
pspec' CString
string' Ptr GValue
value
GValue
value' <- Ptr GValue -> IO GValue
B.GValue.wrapGValuePtr Ptr GValue
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
GParamSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
GValue -> IO GValue
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
value'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
Ptr GValue -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr GValue
value
)
#if defined(ENABLE_OVERLOADING)
data BuilderValueFromStringMethodInfo
instance (signature ~ (GParamSpec -> T.Text -> m (GValue)), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderValueFromStringMethodInfo a signature where
overloadedMethod = builderValueFromString
instance O.OverloadedMethodInfo BuilderValueFromStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderValueFromString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderValueFromString"
})
#endif
foreign import ccall "gtk_builder_value_from_string_type" gtk_builder_value_from_string_type ::
Ptr Builder ->
CGType ->
CString ->
Ptr GValue ->
Ptr (Ptr GError) ->
IO CInt
builderValueFromStringType ::
(B.CallStack.HasCallStack, MonadIO m, IsBuilder a) =>
a
-> GType
-> T.Text
-> m (GValue)
builderValueFromStringType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuilder a) =>
a -> GType -> Text -> m GValue
builderValueFromStringType a
builder GType
type_ Text
string = IO GValue -> m GValue
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
Ptr Builder
builder' <- a -> IO (Ptr Builder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
builder
let type_' :: Word64
type_' = GType -> Word64
gtypeToCGType GType
type_
CString
string' <- Text -> IO CString
textToCString Text
string
Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
24 :: IO (Ptr GValue)
IO GValue -> IO () -> IO GValue
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Builder
-> Word64 -> CString -> Ptr GValue -> Ptr (Ptr GError) -> IO CInt
gtk_builder_value_from_string_type Ptr Builder
builder' Word64
type_' CString
string' Ptr GValue
value
GValue
value' <- Ptr GValue -> IO GValue
B.GValue.wrapGValuePtr Ptr GValue
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
builder
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
GValue -> IO GValue
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
value'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
Ptr GValue -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr GValue
value
)
#if defined(ENABLE_OVERLOADING)
data BuilderValueFromStringTypeMethodInfo
instance (signature ~ (GType -> T.Text -> m (GValue)), MonadIO m, IsBuilder a) => O.OverloadedMethod BuilderValueFromStringTypeMethodInfo a signature where
overloadedMethod = builderValueFromStringType
instance O.OverloadedMethodInfo BuilderValueFromStringTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Builder.builderValueFromStringType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Builder.html#v:builderValueFromStringType"
})
#endif