{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.CharsetConverter
(
CharsetConverter(..) ,
IsCharsetConverter ,
toCharsetConverter ,
#if defined(ENABLE_OVERLOADING)
ResolveCharsetConverterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CharsetConverterGetNumFallbacksMethodInfo,
#endif
charsetConverterGetNumFallbacks ,
#if defined(ENABLE_OVERLOADING)
CharsetConverterGetUseFallbackMethodInfo,
#endif
charsetConverterGetUseFallback ,
charsetConverterNew ,
#if defined(ENABLE_OVERLOADING)
CharsetConverterSetUseFallbackMethodInfo,
#endif
charsetConverterSetUseFallback ,
#if defined(ENABLE_OVERLOADING)
CharsetConverterFromCharsetPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
charsetConverterFromCharset ,
#endif
constructCharsetConverterFromCharset ,
getCharsetConverterFromCharset ,
#if defined(ENABLE_OVERLOADING)
CharsetConverterToCharsetPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
charsetConverterToCharset ,
#endif
constructCharsetConverterToCharset ,
getCharsetConverterToCharset ,
#if defined(ENABLE_OVERLOADING)
CharsetConverterUseFallbackPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
charsetConverterUseFallback ,
#endif
constructCharsetConverterUseFallback ,
getCharsetConverterUseFallback ,
setCharsetConverterUseFallback ,
) 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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GObject.Structs.Parameter as GObject.Parameter
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Converter as Gio.Converter
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Converter as Gio.Converter
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
#endif
newtype CharsetConverter = CharsetConverter (SP.ManagedPtr CharsetConverter)
deriving (CharsetConverter -> CharsetConverter -> Bool
(CharsetConverter -> CharsetConverter -> Bool)
-> (CharsetConverter -> CharsetConverter -> Bool)
-> Eq CharsetConverter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CharsetConverter -> CharsetConverter -> Bool
== :: CharsetConverter -> CharsetConverter -> Bool
$c/= :: CharsetConverter -> CharsetConverter -> Bool
/= :: CharsetConverter -> CharsetConverter -> Bool
Eq)
instance SP.ManagedPtrNewtype CharsetConverter where
toManagedPtr :: CharsetConverter -> ManagedPtr CharsetConverter
toManagedPtr (CharsetConverter ManagedPtr CharsetConverter
p) = ManagedPtr CharsetConverter
p
foreign import ccall "g_charset_converter_get_type"
c_g_charset_converter_get_type :: IO B.Types.GType
instance B.Types.TypedObject CharsetConverter where
glibType :: IO GType
glibType = IO GType
c_g_charset_converter_get_type
instance B.Types.GObject CharsetConverter
class (SP.GObject o, O.IsDescendantOf CharsetConverter o) => IsCharsetConverter o
instance (SP.GObject o, O.IsDescendantOf CharsetConverter o) => IsCharsetConverter o
instance O.HasParentTypes CharsetConverter
type instance O.ParentTypes CharsetConverter = '[GObject.Object.Object, Gio.Converter.Converter, Gio.Initable.Initable]
toCharsetConverter :: (MIO.MonadIO m, IsCharsetConverter o) => o -> m CharsetConverter
toCharsetConverter :: forall (m :: * -> *) o.
(MonadIO m, IsCharsetConverter o) =>
o -> m CharsetConverter
toCharsetConverter = IO CharsetConverter -> m CharsetConverter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CharsetConverter -> m CharsetConverter)
-> (o -> IO CharsetConverter) -> o -> m CharsetConverter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CharsetConverter -> CharsetConverter)
-> o -> IO CharsetConverter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr CharsetConverter -> CharsetConverter
CharsetConverter
instance B.GValue.IsGValue (Maybe CharsetConverter) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_charset_converter_get_type
gvalueSet_ :: Ptr GValue -> Maybe CharsetConverter -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CharsetConverter
P.Nothing = Ptr GValue -> Ptr CharsetConverter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CharsetConverter
forall a. Ptr a
FP.nullPtr :: FP.Ptr CharsetConverter)
gvalueSet_ Ptr GValue
gv (P.Just CharsetConverter
obj) = CharsetConverter -> (Ptr CharsetConverter -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CharsetConverter
obj (Ptr GValue -> Ptr CharsetConverter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe CharsetConverter)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr CharsetConverter)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CharsetConverter)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject CharsetConverter ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCharsetConverterMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveCharsetConverterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCharsetConverterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCharsetConverterMethod "convert" o = Gio.Converter.ConverterConvertMethodInfo
ResolveCharsetConverterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCharsetConverterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCharsetConverterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCharsetConverterMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveCharsetConverterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCharsetConverterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCharsetConverterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCharsetConverterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCharsetConverterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCharsetConverterMethod "reset" o = Gio.Converter.ConverterResetMethodInfo
ResolveCharsetConverterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCharsetConverterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCharsetConverterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCharsetConverterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCharsetConverterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCharsetConverterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCharsetConverterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCharsetConverterMethod "getNumFallbacks" o = CharsetConverterGetNumFallbacksMethodInfo
ResolveCharsetConverterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCharsetConverterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCharsetConverterMethod "getUseFallback" o = CharsetConverterGetUseFallbackMethodInfo
ResolveCharsetConverterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCharsetConverterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCharsetConverterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCharsetConverterMethod "setUseFallback" o = CharsetConverterSetUseFallbackMethodInfo
ResolveCharsetConverterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCharsetConverterMethod t CharsetConverter, O.OverloadedMethod info CharsetConverter p) => OL.IsLabel t (CharsetConverter -> 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 ~ ResolveCharsetConverterMethod t CharsetConverter, O.OverloadedMethod info CharsetConverter p, R.HasField t CharsetConverter p) => R.HasField t CharsetConverter p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCharsetConverterMethod t CharsetConverter, O.OverloadedMethodInfo info CharsetConverter) => OL.IsLabel t (O.MethodProxy info CharsetConverter) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getCharsetConverterFromCharset :: (MonadIO m, IsCharsetConverter o) => o -> m (Maybe T.Text)
getCharsetConverterFromCharset :: forall (m :: * -> *) o.
(MonadIO m, IsCharsetConverter o) =>
o -> m (Maybe Text)
getCharsetConverterFromCharset o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe 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
"from-charset"
constructCharsetConverterFromCharset :: (IsCharsetConverter o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructCharsetConverterFromCharset :: forall o (m :: * -> *).
(IsCharsetConverter o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructCharsetConverterFromCharset 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
"from-charset" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data CharsetConverterFromCharsetPropertyInfo
instance AttrInfo CharsetConverterFromCharsetPropertyInfo where
type AttrAllowedOps CharsetConverterFromCharsetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CharsetConverterFromCharsetPropertyInfo = IsCharsetConverter
type AttrSetTypeConstraint CharsetConverterFromCharsetPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint CharsetConverterFromCharsetPropertyInfo = (~) T.Text
type AttrTransferType CharsetConverterFromCharsetPropertyInfo = T.Text
type AttrGetType CharsetConverterFromCharsetPropertyInfo = (Maybe T.Text)
type AttrLabel CharsetConverterFromCharsetPropertyInfo = "from-charset"
type AttrOrigin CharsetConverterFromCharsetPropertyInfo = CharsetConverter
attrGet = getCharsetConverterFromCharset
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCharsetConverterFromCharset
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.fromCharset"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#g:attr:fromCharset"
})
#endif
getCharsetConverterToCharset :: (MonadIO m, IsCharsetConverter o) => o -> m (Maybe T.Text)
getCharsetConverterToCharset :: forall (m :: * -> *) o.
(MonadIO m, IsCharsetConverter o) =>
o -> m (Maybe Text)
getCharsetConverterToCharset o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe 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
"to-charset"
constructCharsetConverterToCharset :: (IsCharsetConverter o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructCharsetConverterToCharset :: forall o (m :: * -> *).
(IsCharsetConverter o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructCharsetConverterToCharset 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
"to-charset" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data CharsetConverterToCharsetPropertyInfo
instance AttrInfo CharsetConverterToCharsetPropertyInfo where
type AttrAllowedOps CharsetConverterToCharsetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CharsetConverterToCharsetPropertyInfo = IsCharsetConverter
type AttrSetTypeConstraint CharsetConverterToCharsetPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint CharsetConverterToCharsetPropertyInfo = (~) T.Text
type AttrTransferType CharsetConverterToCharsetPropertyInfo = T.Text
type AttrGetType CharsetConverterToCharsetPropertyInfo = (Maybe T.Text)
type AttrLabel CharsetConverterToCharsetPropertyInfo = "to-charset"
type AttrOrigin CharsetConverterToCharsetPropertyInfo = CharsetConverter
attrGet = getCharsetConverterToCharset
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCharsetConverterToCharset
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.toCharset"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#g:attr:toCharset"
})
#endif
getCharsetConverterUseFallback :: (MonadIO m, IsCharsetConverter o) => o -> m Bool
getCharsetConverterUseFallback :: forall (m :: * -> *) o.
(MonadIO m, IsCharsetConverter o) =>
o -> m Bool
getCharsetConverterUseFallback o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"use-fallback"
setCharsetConverterUseFallback :: (MonadIO m, IsCharsetConverter o) => o -> Bool -> m ()
setCharsetConverterUseFallback :: forall (m :: * -> *) o.
(MonadIO m, IsCharsetConverter o) =>
o -> Bool -> m ()
setCharsetConverterUseFallback o
obj Bool
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 -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"use-fallback" Bool
val
constructCharsetConverterUseFallback :: (IsCharsetConverter o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructCharsetConverterUseFallback :: forall o (m :: * -> *).
(IsCharsetConverter o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructCharsetConverterUseFallback Bool
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 -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"use-fallback" Bool
val
#if defined(ENABLE_OVERLOADING)
data CharsetConverterUseFallbackPropertyInfo
instance AttrInfo CharsetConverterUseFallbackPropertyInfo where
type AttrAllowedOps CharsetConverterUseFallbackPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint CharsetConverterUseFallbackPropertyInfo = IsCharsetConverter
type AttrSetTypeConstraint CharsetConverterUseFallbackPropertyInfo = (~) Bool
type AttrTransferTypeConstraint CharsetConverterUseFallbackPropertyInfo = (~) Bool
type AttrTransferType CharsetConverterUseFallbackPropertyInfo = Bool
type AttrGetType CharsetConverterUseFallbackPropertyInfo = Bool
type AttrLabel CharsetConverterUseFallbackPropertyInfo = "use-fallback"
type AttrOrigin CharsetConverterUseFallbackPropertyInfo = CharsetConverter
attrGet = getCharsetConverterUseFallback
attrSet = setCharsetConverterUseFallback
attrTransfer _ v = do
return v
attrConstruct = constructCharsetConverterUseFallback
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.useFallback"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#g:attr:useFallback"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CharsetConverter
type instance O.AttributeList CharsetConverter = CharsetConverterAttributeList
type CharsetConverterAttributeList = ('[ '("fromCharset", CharsetConverterFromCharsetPropertyInfo), '("toCharset", CharsetConverterToCharsetPropertyInfo), '("useFallback", CharsetConverterUseFallbackPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
charsetConverterFromCharset :: AttrLabelProxy "fromCharset"
charsetConverterFromCharset = AttrLabelProxy
charsetConverterToCharset :: AttrLabelProxy "toCharset"
charsetConverterToCharset = AttrLabelProxy
charsetConverterUseFallback :: AttrLabelProxy "useFallback"
charsetConverterUseFallback = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CharsetConverter = CharsetConverterSignalList
type CharsetConverterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_charset_converter_new" g_charset_converter_new ::
CString ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr CharsetConverter)
charsetConverterNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> m CharsetConverter
charsetConverterNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Text -> m CharsetConverter
charsetConverterNew Text
toCharset Text
fromCharset = IO CharsetConverter -> m CharsetConverter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CharsetConverter -> m CharsetConverter)
-> IO CharsetConverter -> m CharsetConverter
forall a b. (a -> b) -> a -> b
$ do
toCharset' <- Text -> IO CString
textToCString Text
toCharset
fromCharset' <- textToCString fromCharset
onException (do
result <- propagateGError $ g_charset_converter_new toCharset' fromCharset'
checkUnexpectedReturnNULL "charsetConverterNew" result
result' <- (wrapObject CharsetConverter) result
freeMem toCharset'
freeMem fromCharset'
return result'
) (do
freeMem toCharset'
freeMem fromCharset'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_charset_converter_get_num_fallbacks" g_charset_converter_get_num_fallbacks ::
Ptr CharsetConverter ->
IO Word32
charsetConverterGetNumFallbacks ::
(B.CallStack.HasCallStack, MonadIO m, IsCharsetConverter a) =>
a
-> m Word32
charsetConverterGetNumFallbacks :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCharsetConverter a) =>
a -> m Word32
charsetConverterGetNumFallbacks a
converter = 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
converter' <- a -> IO (Ptr CharsetConverter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
converter
result <- g_charset_converter_get_num_fallbacks converter'
touchManagedPtr converter
return result
#if defined(ENABLE_OVERLOADING)
data CharsetConverterGetNumFallbacksMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCharsetConverter a) => O.OverloadedMethod CharsetConverterGetNumFallbacksMethodInfo a signature where
overloadedMethod = charsetConverterGetNumFallbacks
instance O.OverloadedMethodInfo CharsetConverterGetNumFallbacksMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.charsetConverterGetNumFallbacks",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#v:charsetConverterGetNumFallbacks"
})
#endif
foreign import ccall "g_charset_converter_get_use_fallback" g_charset_converter_get_use_fallback ::
Ptr CharsetConverter ->
IO CInt
charsetConverterGetUseFallback ::
(B.CallStack.HasCallStack, MonadIO m, IsCharsetConverter a) =>
a
-> m Bool
charsetConverterGetUseFallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCharsetConverter a) =>
a -> m Bool
charsetConverterGetUseFallback a
converter = 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
converter' <- a -> IO (Ptr CharsetConverter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
converter
result <- g_charset_converter_get_use_fallback converter'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr converter
return result'
#if defined(ENABLE_OVERLOADING)
data CharsetConverterGetUseFallbackMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCharsetConverter a) => O.OverloadedMethod CharsetConverterGetUseFallbackMethodInfo a signature where
overloadedMethod = charsetConverterGetUseFallback
instance O.OverloadedMethodInfo CharsetConverterGetUseFallbackMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.charsetConverterGetUseFallback",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#v:charsetConverterGetUseFallback"
})
#endif
foreign import ccall "g_charset_converter_set_use_fallback" g_charset_converter_set_use_fallback ::
Ptr CharsetConverter ->
CInt ->
IO ()
charsetConverterSetUseFallback ::
(B.CallStack.HasCallStack, MonadIO m, IsCharsetConverter a) =>
a
-> Bool
-> m ()
charsetConverterSetUseFallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCharsetConverter a) =>
a -> Bool -> m ()
charsetConverterSetUseFallback a
converter Bool
useFallback = 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
converter' <- a -> IO (Ptr CharsetConverter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
converter
let useFallback' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
useFallback
g_charset_converter_set_use_fallback converter' useFallback'
touchManagedPtr converter
return ()
#if defined(ENABLE_OVERLOADING)
data CharsetConverterSetUseFallbackMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsCharsetConverter a) => O.OverloadedMethod CharsetConverterSetUseFallbackMethodInfo a signature where
overloadedMethod = charsetConverterSetUseFallback
instance O.OverloadedMethodInfo CharsetConverterSetUseFallbackMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.CharsetConverter.charsetConverterSetUseFallback",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-CharsetConverter.html#v:charsetConverterSetUseFallback"
})
#endif