module GI.Gtk.Interfaces.FontChooser
(
FontChooser(..) ,
noFontChooser ,
IsFontChooser ,
toFontChooser ,
FontChooserGetFontMethodInfo ,
fontChooserGetFont ,
FontChooserGetFontDescMethodInfo ,
fontChooserGetFontDesc ,
FontChooserGetFontFaceMethodInfo ,
fontChooserGetFontFace ,
FontChooserGetFontFamilyMethodInfo ,
fontChooserGetFontFamily ,
FontChooserGetFontMapMethodInfo ,
fontChooserGetFontMap ,
FontChooserGetFontSizeMethodInfo ,
fontChooserGetFontSize ,
FontChooserGetPreviewTextMethodInfo ,
fontChooserGetPreviewText ,
FontChooserGetShowPreviewEntryMethodInfo,
fontChooserGetShowPreviewEntry ,
FontChooserSetFilterFuncMethodInfo ,
fontChooserSetFilterFunc ,
FontChooserSetFontMethodInfo ,
fontChooserSetFont ,
FontChooserSetFontDescMethodInfo ,
fontChooserSetFontDesc ,
FontChooserSetFontMapMethodInfo ,
fontChooserSetFontMap ,
FontChooserSetPreviewTextMethodInfo ,
fontChooserSetPreviewText ,
FontChooserSetShowPreviewEntryMethodInfo,
fontChooserSetShowPreviewEntry ,
FontChooserFontPropertyInfo ,
constructFontChooserFont ,
fontChooserFont ,
getFontChooserFont ,
setFontChooserFont ,
FontChooserFontDescPropertyInfo ,
constructFontChooserFontDesc ,
fontChooserFontDesc ,
getFontChooserFontDesc ,
setFontChooserFontDesc ,
FontChooserPreviewTextPropertyInfo ,
constructFontChooserPreviewText ,
fontChooserPreviewText ,
getFontChooserPreviewText ,
setFontChooserPreviewText ,
FontChooserShowPreviewEntryPropertyInfo ,
constructFontChooserShowPreviewEntry ,
fontChooserShowPreviewEntry ,
getFontChooserShowPreviewEntry ,
setFontChooserShowPreviewEntry ,
C_FontChooserFontActivatedCallback ,
FontChooserFontActivatedCallback ,
FontChooserFontActivatedSignalInfo ,
afterFontChooserFontActivated ,
genClosure_FontChooserFontActivated ,
mk_FontChooserFontActivatedCallback ,
noFontChooserFontActivatedCallback ,
onFontChooserFontActivated ,
wrap_FontChooserFontActivatedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import qualified GI.Pango.Objects.FontFace as Pango.FontFace
import qualified GI.Pango.Objects.FontFamily as Pango.FontFamily
import qualified GI.Pango.Objects.FontMap as Pango.FontMap
import qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
newtype FontChooser = FontChooser (ManagedPtr FontChooser)
noFontChooser :: Maybe FontChooser
noFontChooser = Nothing
type family ResolveFontChooserMethod (t :: Symbol) (o :: *) :: * where
ResolveFontChooserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFontChooserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFontChooserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFontChooserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFontChooserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFontChooserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFontChooserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFontChooserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFontChooserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFontChooserMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveFontChooserMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveFontChooserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFontChooserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFontChooserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFontChooserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFontChooserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFontChooserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFontChooserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFontChooserMethod "getFont" o = FontChooserGetFontMethodInfo
ResolveFontChooserMethod "getFontDesc" o = FontChooserGetFontDescMethodInfo
ResolveFontChooserMethod "getFontFace" o = FontChooserGetFontFaceMethodInfo
ResolveFontChooserMethod "getFontFamily" o = FontChooserGetFontFamilyMethodInfo
ResolveFontChooserMethod "getFontMap" o = FontChooserGetFontMapMethodInfo
ResolveFontChooserMethod "getFontSize" o = FontChooserGetFontSizeMethodInfo
ResolveFontChooserMethod "getPreviewText" o = FontChooserGetPreviewTextMethodInfo
ResolveFontChooserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFontChooserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFontChooserMethod "getShowPreviewEntry" o = FontChooserGetShowPreviewEntryMethodInfo
ResolveFontChooserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFontChooserMethod "setFilterFunc" o = FontChooserSetFilterFuncMethodInfo
ResolveFontChooserMethod "setFont" o = FontChooserSetFontMethodInfo
ResolveFontChooserMethod "setFontDesc" o = FontChooserSetFontDescMethodInfo
ResolveFontChooserMethod "setFontMap" o = FontChooserSetFontMapMethodInfo
ResolveFontChooserMethod "setPreviewText" o = FontChooserSetPreviewTextMethodInfo
ResolveFontChooserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFontChooserMethod "setShowPreviewEntry" o = FontChooserSetShowPreviewEntryMethodInfo
ResolveFontChooserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFontChooserMethod t FontChooser, O.MethodInfo info FontChooser p) => O.IsLabelProxy t (FontChooser -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveFontChooserMethod t FontChooser, O.MethodInfo info FontChooser p) => O.IsLabel t (FontChooser -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
type FontChooserFontActivatedCallback =
T.Text ->
IO ()
noFontChooserFontActivatedCallback :: Maybe FontChooserFontActivatedCallback
noFontChooserFontActivatedCallback = Nothing
type C_FontChooserFontActivatedCallback =
Ptr () ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_FontChooserFontActivatedCallback :: C_FontChooserFontActivatedCallback -> IO (FunPtr C_FontChooserFontActivatedCallback)
genClosure_FontChooserFontActivated :: FontChooserFontActivatedCallback -> IO Closure
genClosure_FontChooserFontActivated cb = do
let cb' = wrap_FontChooserFontActivatedCallback cb
mk_FontChooserFontActivatedCallback cb' >>= newCClosure
wrap_FontChooserFontActivatedCallback ::
FontChooserFontActivatedCallback ->
Ptr () ->
CString ->
Ptr () ->
IO ()
wrap_FontChooserFontActivatedCallback _cb _ fontname _ = do
fontname' <- cstringToText fontname
_cb fontname'
onFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
onFontChooserFontActivated obj cb = liftIO $ connectFontChooserFontActivated obj cb SignalConnectBefore
afterFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
afterFontChooserFontActivated obj cb = connectFontChooserFontActivated obj cb SignalConnectAfter
connectFontChooserFontActivated :: (GObject a, MonadIO m) =>
a -> FontChooserFontActivatedCallback -> SignalConnectMode -> m SignalHandlerId
connectFontChooserFontActivated obj cb after = liftIO $ do
let cb' = wrap_FontChooserFontActivatedCallback cb
cb'' <- mk_FontChooserFontActivatedCallback cb'
connectSignalFunPtr obj "font-activated" cb'' after
getFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> m (Maybe T.Text)
getFontChooserFont obj = liftIO $ getObjectPropertyString obj "font"
setFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> T.Text -> m ()
setFontChooserFont obj val = liftIO $ setObjectPropertyString obj "font" (Just val)
constructFontChooserFont :: (IsFontChooser o) => T.Text -> IO (GValueConstruct o)
constructFontChooserFont val = constructObjectPropertyString "font" (Just val)
data FontChooserFontPropertyInfo
instance AttrInfo FontChooserFontPropertyInfo where
type AttrAllowedOps FontChooserFontPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontChooserFontPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint FontChooserFontPropertyInfo = IsFontChooser
type AttrGetType FontChooserFontPropertyInfo = (Maybe T.Text)
type AttrLabel FontChooserFontPropertyInfo = "font"
type AttrOrigin FontChooserFontPropertyInfo = FontChooser
attrGet _ = getFontChooserFont
attrSet _ = setFontChooserFont
attrConstruct _ = constructFontChooserFont
attrClear _ = undefined
getFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Pango.FontDescription.FontDescription)
getFontChooserFontDesc obj = liftIO $ getObjectPropertyBoxed obj "font-desc" Pango.FontDescription.FontDescription
setFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> Pango.FontDescription.FontDescription -> m ()
setFontChooserFontDesc obj val = liftIO $ setObjectPropertyBoxed obj "font-desc" (Just val)
constructFontChooserFontDesc :: (IsFontChooser o) => Pango.FontDescription.FontDescription -> IO (GValueConstruct o)
constructFontChooserFontDesc val = constructObjectPropertyBoxed "font-desc" (Just val)
data FontChooserFontDescPropertyInfo
instance AttrInfo FontChooserFontDescPropertyInfo where
type AttrAllowedOps FontChooserFontDescPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontChooserFontDescPropertyInfo = (~) Pango.FontDescription.FontDescription
type AttrBaseTypeConstraint FontChooserFontDescPropertyInfo = IsFontChooser
type AttrGetType FontChooserFontDescPropertyInfo = (Maybe Pango.FontDescription.FontDescription)
type AttrLabel FontChooserFontDescPropertyInfo = "font-desc"
type AttrOrigin FontChooserFontDescPropertyInfo = FontChooser
attrGet _ = getFontChooserFontDesc
attrSet _ = setFontChooserFontDesc
attrConstruct _ = constructFontChooserFontDesc
attrClear _ = undefined
getFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> m (Maybe T.Text)
getFontChooserPreviewText obj = liftIO $ getObjectPropertyString obj "preview-text"
setFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> T.Text -> m ()
setFontChooserPreviewText obj val = liftIO $ setObjectPropertyString obj "preview-text" (Just val)
constructFontChooserPreviewText :: (IsFontChooser o) => T.Text -> IO (GValueConstruct o)
constructFontChooserPreviewText val = constructObjectPropertyString "preview-text" (Just val)
data FontChooserPreviewTextPropertyInfo
instance AttrInfo FontChooserPreviewTextPropertyInfo where
type AttrAllowedOps FontChooserPreviewTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontChooserPreviewTextPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint FontChooserPreviewTextPropertyInfo = IsFontChooser
type AttrGetType FontChooserPreviewTextPropertyInfo = (Maybe T.Text)
type AttrLabel FontChooserPreviewTextPropertyInfo = "preview-text"
type AttrOrigin FontChooserPreviewTextPropertyInfo = FontChooser
attrGet _ = getFontChooserPreviewText
attrSet _ = setFontChooserPreviewText
attrConstruct _ = constructFontChooserPreviewText
attrClear _ = undefined
getFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> m Bool
getFontChooserShowPreviewEntry obj = liftIO $ getObjectPropertyBool obj "show-preview-entry"
setFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> Bool -> m ()
setFontChooserShowPreviewEntry obj val = liftIO $ setObjectPropertyBool obj "show-preview-entry" val
constructFontChooserShowPreviewEntry :: (IsFontChooser o) => Bool -> IO (GValueConstruct o)
constructFontChooserShowPreviewEntry val = constructObjectPropertyBool "show-preview-entry" val
data FontChooserShowPreviewEntryPropertyInfo
instance AttrInfo FontChooserShowPreviewEntryPropertyInfo where
type AttrAllowedOps FontChooserShowPreviewEntryPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontChooserShowPreviewEntryPropertyInfo = (~) Bool
type AttrBaseTypeConstraint FontChooserShowPreviewEntryPropertyInfo = IsFontChooser
type AttrGetType FontChooserShowPreviewEntryPropertyInfo = Bool
type AttrLabel FontChooserShowPreviewEntryPropertyInfo = "show-preview-entry"
type AttrOrigin FontChooserShowPreviewEntryPropertyInfo = FontChooser
attrGet _ = getFontChooserShowPreviewEntry
attrSet _ = setFontChooserShowPreviewEntry
attrConstruct _ = constructFontChooserShowPreviewEntry
attrClear _ = undefined
instance O.HasAttributeList FontChooser
type instance O.AttributeList FontChooser = FontChooserAttributeList
type FontChooserAttributeList = ('[ '("font", FontChooserFontPropertyInfo), '("fontDesc", FontChooserFontDescPropertyInfo), '("previewText", FontChooserPreviewTextPropertyInfo), '("showPreviewEntry", FontChooserShowPreviewEntryPropertyInfo)] :: [(Symbol, *)])
fontChooserFont :: AttrLabelProxy "font"
fontChooserFont = AttrLabelProxy
fontChooserFontDesc :: AttrLabelProxy "fontDesc"
fontChooserFontDesc = AttrLabelProxy
fontChooserPreviewText :: AttrLabelProxy "previewText"
fontChooserPreviewText = AttrLabelProxy
fontChooserShowPreviewEntry :: AttrLabelProxy "showPreviewEntry"
fontChooserShowPreviewEntry = AttrLabelProxy
data FontChooserFontActivatedSignalInfo
instance SignalInfo FontChooserFontActivatedSignalInfo where
type HaskellCallbackType FontChooserFontActivatedSignalInfo = FontChooserFontActivatedCallback
connectSignal _ = connectFontChooserFontActivated
type instance O.SignalList FontChooser = FontChooserSignalList
type FontChooserSignalList = ('[ '("fontActivated", FontChooserFontActivatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_font_chooser_get_type"
c_gtk_font_chooser_get_type :: IO GType
instance GObject FontChooser where
gobjectType _ = c_gtk_font_chooser_get_type
class GObject o => IsFontChooser o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError FontChooser a) =>
IsFontChooser a
#endif
instance IsFontChooser FontChooser
instance GObject.Object.IsObject FontChooser
toFontChooser :: IsFontChooser o => o -> IO FontChooser
toFontChooser = unsafeCastTo FontChooser
foreign import ccall "gtk_font_chooser_get_font" gtk_font_chooser_get_font ::
Ptr FontChooser ->
IO CString
fontChooserGetFont ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m (Maybe T.Text)
fontChooserGetFont fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font fontchooser'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
freeMem result'
return result''
touchManagedPtr fontchooser
return maybeResult
data FontChooserGetFontMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontMethodInfo a signature where
overloadedMethod _ = fontChooserGetFont
foreign import ccall "gtk_font_chooser_get_font_desc" gtk_font_chooser_get_font_desc ::
Ptr FontChooser ->
IO (Ptr Pango.FontDescription.FontDescription)
fontChooserGetFontDesc ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m (Maybe Pango.FontDescription.FontDescription)
fontChooserGetFontDesc fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font_desc fontchooser'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Pango.FontDescription.FontDescription) result'
return result''
touchManagedPtr fontchooser
return maybeResult
data FontChooserGetFontDescMethodInfo
instance (signature ~ (m (Maybe Pango.FontDescription.FontDescription)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontDescMethodInfo a signature where
overloadedMethod _ = fontChooserGetFontDesc
foreign import ccall "gtk_font_chooser_get_font_face" gtk_font_chooser_get_font_face ::
Ptr FontChooser ->
IO (Ptr Pango.FontFace.FontFace)
fontChooserGetFontFace ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m (Maybe Pango.FontFace.FontFace)
fontChooserGetFontFace fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font_face fontchooser'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Pango.FontFace.FontFace) result'
return result''
touchManagedPtr fontchooser
return maybeResult
data FontChooserGetFontFaceMethodInfo
instance (signature ~ (m (Maybe Pango.FontFace.FontFace)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontFaceMethodInfo a signature where
overloadedMethod _ = fontChooserGetFontFace
foreign import ccall "gtk_font_chooser_get_font_family" gtk_font_chooser_get_font_family ::
Ptr FontChooser ->
IO (Ptr Pango.FontFamily.FontFamily)
fontChooserGetFontFamily ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m (Maybe Pango.FontFamily.FontFamily)
fontChooserGetFontFamily fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font_family fontchooser'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Pango.FontFamily.FontFamily) result'
return result''
touchManagedPtr fontchooser
return maybeResult
data FontChooserGetFontFamilyMethodInfo
instance (signature ~ (m (Maybe Pango.FontFamily.FontFamily)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontFamilyMethodInfo a signature where
overloadedMethod _ = fontChooserGetFontFamily
foreign import ccall "gtk_font_chooser_get_font_map" gtk_font_chooser_get_font_map ::
Ptr FontChooser ->
IO (Ptr Pango.FontMap.FontMap)
fontChooserGetFontMap ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m (Maybe Pango.FontMap.FontMap)
fontChooserGetFontMap fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font_map fontchooser'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapObject Pango.FontMap.FontMap) result'
return result''
touchManagedPtr fontchooser
return maybeResult
data FontChooserGetFontMapMethodInfo
instance (signature ~ (m (Maybe Pango.FontMap.FontMap)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontMapMethodInfo a signature where
overloadedMethod _ = fontChooserGetFontMap
foreign import ccall "gtk_font_chooser_get_font_size" gtk_font_chooser_get_font_size ::
Ptr FontChooser ->
IO Int32
fontChooserGetFontSize ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m Int32
fontChooserGetFontSize fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_font_size fontchooser'
touchManagedPtr fontchooser
return result
data FontChooserGetFontSizeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontSizeMethodInfo a signature where
overloadedMethod _ = fontChooserGetFontSize
foreign import ccall "gtk_font_chooser_get_preview_text" gtk_font_chooser_get_preview_text ::
Ptr FontChooser ->
IO CString
fontChooserGetPreviewText ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m T.Text
fontChooserGetPreviewText fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_preview_text fontchooser'
checkUnexpectedReturnNULL "fontChooserGetPreviewText" result
result' <- cstringToText result
freeMem result
touchManagedPtr fontchooser
return result'
data FontChooserGetPreviewTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetPreviewTextMethodInfo a signature where
overloadedMethod _ = fontChooserGetPreviewText
foreign import ccall "gtk_font_chooser_get_show_preview_entry" gtk_font_chooser_get_show_preview_entry ::
Ptr FontChooser ->
IO CInt
fontChooserGetShowPreviewEntry ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> m Bool
fontChooserGetShowPreviewEntry fontchooser = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
result <- gtk_font_chooser_get_show_preview_entry fontchooser'
let result' = (/= 0) result
touchManagedPtr fontchooser
return result'
data FontChooserGetShowPreviewEntryMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetShowPreviewEntryMethodInfo a signature where
overloadedMethod _ = fontChooserGetShowPreviewEntry
foreign import ccall "gtk_font_chooser_set_filter_func" gtk_font_chooser_set_filter_func ::
Ptr FontChooser ->
FunPtr Gtk.Callbacks.C_FontFilterFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
fontChooserSetFilterFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> Maybe (Gtk.Callbacks.FontFilterFunc)
-> m ()
fontChooserSetFilterFunc fontchooser filter = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
maybeFilter <- case filter of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jFilter -> do
jFilter' <- Gtk.Callbacks.mk_FontFilterFunc (Gtk.Callbacks.wrap_FontFilterFunc Nothing (Gtk.Callbacks.drop_closures_FontFilterFunc jFilter))
return jFilter'
let userData = castFunPtrToPtr maybeFilter
let destroy = safeFreeFunPtrPtr
gtk_font_chooser_set_filter_func fontchooser' maybeFilter userData destroy
touchManagedPtr fontchooser
return ()
data FontChooserSetFilterFuncMethodInfo
instance (signature ~ (Maybe (Gtk.Callbacks.FontFilterFunc) -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFilterFuncMethodInfo a signature where
overloadedMethod _ = fontChooserSetFilterFunc
foreign import ccall "gtk_font_chooser_set_font" gtk_font_chooser_set_font ::
Ptr FontChooser ->
CString ->
IO ()
fontChooserSetFont ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> T.Text
-> m ()
fontChooserSetFont fontchooser fontname = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
fontname' <- textToCString fontname
gtk_font_chooser_set_font fontchooser' fontname'
touchManagedPtr fontchooser
freeMem fontname'
return ()
data FontChooserSetFontMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFontMethodInfo a signature where
overloadedMethod _ = fontChooserSetFont
foreign import ccall "gtk_font_chooser_set_font_desc" gtk_font_chooser_set_font_desc ::
Ptr FontChooser ->
Ptr Pango.FontDescription.FontDescription ->
IO ()
fontChooserSetFontDesc ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> Pango.FontDescription.FontDescription
-> m ()
fontChooserSetFontDesc fontchooser fontDesc = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
fontDesc' <- unsafeManagedPtrGetPtr fontDesc
gtk_font_chooser_set_font_desc fontchooser' fontDesc'
touchManagedPtr fontchooser
touchManagedPtr fontDesc
return ()
data FontChooserSetFontDescMethodInfo
instance (signature ~ (Pango.FontDescription.FontDescription -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFontDescMethodInfo a signature where
overloadedMethod _ = fontChooserSetFontDesc
foreign import ccall "gtk_font_chooser_set_font_map" gtk_font_chooser_set_font_map ::
Ptr FontChooser ->
Ptr Pango.FontMap.FontMap ->
IO ()
fontChooserSetFontMap ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a, Pango.FontMap.IsFontMap b) =>
a
-> Maybe (b)
-> m ()
fontChooserSetFontMap fontchooser fontmap = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
maybeFontmap <- case fontmap of
Nothing -> return nullPtr
Just jFontmap -> do
jFontmap' <- unsafeManagedPtrCastPtr jFontmap
return jFontmap'
gtk_font_chooser_set_font_map fontchooser' maybeFontmap
touchManagedPtr fontchooser
whenJust fontmap touchManagedPtr
return ()
data FontChooserSetFontMapMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFontChooser a, Pango.FontMap.IsFontMap b) => O.MethodInfo FontChooserSetFontMapMethodInfo a signature where
overloadedMethod _ = fontChooserSetFontMap
foreign import ccall "gtk_font_chooser_set_preview_text" gtk_font_chooser_set_preview_text ::
Ptr FontChooser ->
CString ->
IO ()
fontChooserSetPreviewText ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> T.Text
-> m ()
fontChooserSetPreviewText fontchooser text = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
text' <- textToCString text
gtk_font_chooser_set_preview_text fontchooser' text'
touchManagedPtr fontchooser
freeMem text'
return ()
data FontChooserSetPreviewTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetPreviewTextMethodInfo a signature where
overloadedMethod _ = fontChooserSetPreviewText
foreign import ccall "gtk_font_chooser_set_show_preview_entry" gtk_font_chooser_set_show_preview_entry ::
Ptr FontChooser ->
CInt ->
IO ()
fontChooserSetShowPreviewEntry ::
(B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
a
-> Bool
-> m ()
fontChooserSetShowPreviewEntry fontchooser showPreviewEntry = liftIO $ do
fontchooser' <- unsafeManagedPtrCastPtr fontchooser
let showPreviewEntry' = (fromIntegral . fromEnum) showPreviewEntry
gtk_font_chooser_set_show_preview_entry fontchooser' showPreviewEntry'
touchManagedPtr fontchooser
return ()
data FontChooserSetShowPreviewEntryMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetShowPreviewEntryMethodInfo a signature where
overloadedMethod _ = fontChooserSetShowPreviewEntry