{-# LINE 2 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
module Graphics.UI.Gtk.Selectors.FontSelectionDialog (
FontSelectionDialog,
FontSelectionDialogClass,
castToFontSelectionDialog, gTypeFontSelectionDialog,
toFontSelectionDialog,
fontSelectionDialogNew,
fontSelectionDialogGetFontName,
fontSelectionDialogSetFontName,
fontSelectionDialogGetPreviewText,
fontSelectionDialogSetPreviewText,
fontSelectionDialogGetCancelButton,
fontSelectionDialogGetOkButton,
fontSelectionDialogGetFontSelection,
fontSelectionDialogPreviewText,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 87 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
{-# LINE 89 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
fontSelectionDialogNew :: GlibString string
=> string
-> IO FontSelectionDialog
fontSelectionDialogNew :: forall string.
GlibString string =>
string -> IO FontSelectionDialog
fontSelectionDialogNew string
title =
(ForeignPtr FontSelectionDialog -> FontSelectionDialog,
FinalizerPtr FontSelectionDialog)
-> IO (Ptr FontSelectionDialog) -> IO FontSelectionDialog
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FontSelectionDialog -> FontSelectionDialog,
FinalizerPtr FontSelectionDialog)
forall {a}.
(ForeignPtr FontSelectionDialog -> FontSelectionDialog,
FinalizerPtr a)
mkFontSelectionDialog (IO (Ptr FontSelectionDialog) -> IO FontSelectionDialog)
-> IO (Ptr FontSelectionDialog) -> IO FontSelectionDialog
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FontSelectionDialog)
-> IO (Ptr Widget) -> IO (Ptr FontSelectionDialog)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FontSelectionDialog
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FontSelectionDialog) (IO (Ptr Widget) -> IO (Ptr FontSelectionDialog))
-> IO (Ptr Widget) -> IO (Ptr FontSelectionDialog)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
title ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
titlePtr ->
CString -> IO (Ptr Widget)
gtk_font_selection_dialog_new
{-# LINE 103 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
titlePtr
fontSelectionDialogGetFontName :: (FontSelectionDialogClass self, GlibString string) => self
-> IO (Maybe string)
fontSelectionDialogGetFontName :: forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> IO (Maybe string)
fontSelectionDialogGetFontName self
self =
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO CString) -> IO CString)
-> (Ptr FontSelectionDialog -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> IO CString
gtk_font_selection_dialog_get_font_name Ptr FontSelectionDialog
argPtr1)
{-# LINE 115 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
IO CString -> (CString -> IO (Maybe string)) -> IO (Maybe string)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CString -> IO string) -> CString -> IO (Maybe string)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString
fontSelectionDialogSetFontName :: (FontSelectionDialogClass self, GlibString string) => self
-> string
-> IO Bool
fontSelectionDialogSetFontName :: forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> string -> IO Bool
fontSelectionDialogSetFontName self
self string
fontname =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO CInt) -> IO CInt
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
fontname ((CString -> IO CInt) -> IO CInt)
-> (CString -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CString
fontnamePtr ->
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) CString
arg2 -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO CInt) -> IO CInt)
-> (Ptr FontSelectionDialog -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> CString -> IO CInt
gtk_font_selection_dialog_set_font_name Ptr FontSelectionDialog
argPtr1 CString
arg2)
{-# LINE 127 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
CString
fontnamePtr
fontSelectionDialogGetPreviewText :: (FontSelectionDialogClass self, GlibString string) => self -> IO string
fontSelectionDialogGetPreviewText :: forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> IO string
fontSelectionDialogGetPreviewText self
self =
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO CString) -> IO CString)
-> (Ptr FontSelectionDialog -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> IO CString
gtk_font_selection_dialog_get_preview_text Ptr FontSelectionDialog
argPtr1)
{-# LINE 135 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString
fontSelectionDialogSetPreviewText :: (FontSelectionDialogClass self, GlibString string) => self -> string -> IO ()
fontSelectionDialogSetPreviewText :: forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> string -> IO ()
fontSelectionDialogSetPreviewText self
self string
text =
string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
text ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
textPtr ->
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) CString
arg2 -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO ()) -> IO ())
-> (Ptr FontSelectionDialog -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> CString -> IO ()
gtk_font_selection_dialog_set_preview_text Ptr FontSelectionDialog
argPtr1 CString
arg2)
{-# LINE 144 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
CString
textPtr
fontSelectionDialogGetCancelButton :: FontSelectionDialogClass self => self
-> IO Widget
fontSelectionDialogGetCancelButton :: forall self. FontSelectionDialogClass self => self -> IO Widget
fontSelectionDialogGetCancelButton self
self =
(ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> IO (Ptr Widget)
gtk_font_selection_dialog_get_cancel_button Ptr FontSelectionDialog
argPtr1)
{-# LINE 157 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
fontSelectionDialogGetOkButton :: FontSelectionDialogClass self => self
-> IO Widget
fontSelectionDialogGetOkButton :: forall self. FontSelectionDialogClass self => self -> IO Widget
fontSelectionDialogGetOkButton self
self =
(ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> IO (Ptr Widget)
gtk_font_selection_dialog_get_ok_button Ptr FontSelectionDialog
argPtr1)
{-# LINE 168 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
fontSelectionDialogGetFontSelection :: FontSelectionDialogClass self => self
-> IO FontSelection
fontSelectionDialogGetFontSelection :: forall self.
FontSelectionDialogClass self =>
self -> IO FontSelection
fontSelectionDialogGetFontSelection self
self =
(ForeignPtr FontSelection -> FontSelection,
FinalizerPtr FontSelection)
-> IO (Ptr FontSelection) -> IO FontSelection
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FontSelection -> FontSelection,
FinalizerPtr FontSelection)
forall {a}.
(ForeignPtr FontSelection -> FontSelection, FinalizerPtr a)
mkFontSelection (IO (Ptr FontSelection) -> IO FontSelection)
-> IO (Ptr FontSelection) -> IO FontSelection
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FontSelection)
-> IO (Ptr Widget) -> IO (Ptr FontSelection)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FontSelection
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FontSelection) (IO (Ptr Widget) -> IO (Ptr FontSelection))
-> IO (Ptr Widget) -> IO (Ptr FontSelection)
forall a b. (a -> b) -> a -> b
$
(\(FontSelectionDialog ForeignPtr FontSelectionDialog
arg1) -> ForeignPtr FontSelectionDialog
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FontSelectionDialog
arg1 ((Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr FontSelectionDialog -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr FontSelectionDialog
argPtr1 ->Ptr FontSelectionDialog -> IO (Ptr Widget)
gtk_font_selection_dialog_get_font_selection Ptr FontSelectionDialog
argPtr1)
{-# LINE 183 "./Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs" #-}
(toFontSelectionDialog self)
fontSelectionDialogPreviewText :: (FontSelectionDialogClass self, GlibString string) => Attr self string
fontSelectionDialogPreviewText :: forall self string.
(FontSelectionDialogClass self, GlibString string) =>
Attr self string
fontSelectionDialogPreviewText = (self -> IO string)
-> (self -> string -> IO ()) -> ReadWriteAttr self string string
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
self -> IO string
forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> IO string
fontSelectionDialogGetPreviewText
self -> string -> IO ()
forall self string.
(FontSelectionDialogClass self, GlibString string) =>
self -> string -> IO ()
fontSelectionDialogSetPreviewText
foreign import ccall unsafe "gtk_font_selection_dialog_new"
gtk_font_selection_dialog_new :: ((Ptr CChar) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_font_selection_dialog_get_font_name"
gtk_font_selection_dialog_get_font_name :: ((Ptr FontSelectionDialog) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_font_selection_dialog_set_font_name"
gtk_font_selection_dialog_set_font_name :: ((Ptr FontSelectionDialog) -> ((Ptr CChar) -> (IO CInt)))
foreign import ccall unsafe "gtk_font_selection_dialog_get_preview_text"
gtk_font_selection_dialog_get_preview_text :: ((Ptr FontSelectionDialog) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_font_selection_dialog_set_preview_text"
gtk_font_selection_dialog_set_preview_text :: ((Ptr FontSelectionDialog) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_font_selection_dialog_get_cancel_button"
gtk_font_selection_dialog_get_cancel_button :: ((Ptr FontSelectionDialog) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_font_selection_dialog_get_ok_button"
gtk_font_selection_dialog_get_ok_button :: ((Ptr FontSelectionDialog) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_font_selection_dialog_get_font_selection"
gtk_font_selection_dialog_get_font_selection :: ((Ptr FontSelectionDialog) -> (IO (Ptr Widget)))