module GI.Gtk.Objects.FontSelection
(
FontSelection(..) ,
FontSelectionK ,
toFontSelection ,
noFontSelection ,
fontSelectionGetFace ,
fontSelectionGetFaceList ,
fontSelectionGetFamily ,
fontSelectionGetFamilyList ,
fontSelectionGetFontName ,
fontSelectionGetPreviewEntry ,
fontSelectionGetPreviewText ,
fontSelectionGetSize ,
fontSelectionGetSizeEntry ,
fontSelectionGetSizeList ,
fontSelectionNew ,
fontSelectionSetFontName ,
fontSelectionSetPreviewText ,
FontSelectionFontNamePropertyInfo ,
constructFontSelectionFontName ,
getFontSelectionFontName ,
setFontSelectionFontName ,
FontSelectionPreviewTextPropertyInfo ,
constructFontSelectionPreviewText ,
getFontSelectionPreviewText ,
setFontSelectionPreviewText ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.Atk as Atk
import qualified GI.GObject as GObject
import qualified GI.Pango as Pango
newtype FontSelection = FontSelection (ForeignPtr FontSelection)
foreign import ccall "gtk_font_selection_get_type"
c_gtk_font_selection_get_type :: IO GType
type instance ParentTypes FontSelection = FontSelectionParentTypes
type FontSelectionParentTypes = '[Box, Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable, Orientable]
instance GObject FontSelection where
gobjectIsInitiallyUnowned _ = True
gobjectType _ = c_gtk_font_selection_get_type
class GObject o => FontSelectionK o
instance (GObject o, IsDescendantOf FontSelection o) => FontSelectionK o
toFontSelection :: FontSelectionK o => o -> IO FontSelection
toFontSelection = unsafeCastTo FontSelection
noFontSelection :: Maybe FontSelection
noFontSelection = Nothing
getFontSelectionFontName :: (MonadIO m, FontSelectionK o) => o -> m T.Text
getFontSelectionFontName obj = liftIO $ getObjectPropertyString obj "font-name"
setFontSelectionFontName :: (MonadIO m, FontSelectionK o) => o -> T.Text -> m ()
setFontSelectionFontName obj val = liftIO $ setObjectPropertyString obj "font-name" val
constructFontSelectionFontName :: T.Text -> IO ([Char], GValue)
constructFontSelectionFontName val = constructObjectPropertyString "font-name" val
data FontSelectionFontNamePropertyInfo
instance AttrInfo FontSelectionFontNamePropertyInfo where
type AttrAllowedOps FontSelectionFontNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontSelectionFontNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint FontSelectionFontNamePropertyInfo = FontSelectionK
type AttrGetType FontSelectionFontNamePropertyInfo = T.Text
type AttrLabel FontSelectionFontNamePropertyInfo = "FontSelection::font-name"
attrGet _ = getFontSelectionFontName
attrSet _ = setFontSelectionFontName
attrConstruct _ = constructFontSelectionFontName
getFontSelectionPreviewText :: (MonadIO m, FontSelectionK o) => o -> m T.Text
getFontSelectionPreviewText obj = liftIO $ getObjectPropertyString obj "preview-text"
setFontSelectionPreviewText :: (MonadIO m, FontSelectionK o) => o -> T.Text -> m ()
setFontSelectionPreviewText obj val = liftIO $ setObjectPropertyString obj "preview-text" val
constructFontSelectionPreviewText :: T.Text -> IO ([Char], GValue)
constructFontSelectionPreviewText val = constructObjectPropertyString "preview-text" val
data FontSelectionPreviewTextPropertyInfo
instance AttrInfo FontSelectionPreviewTextPropertyInfo where
type AttrAllowedOps FontSelectionPreviewTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FontSelectionPreviewTextPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint FontSelectionPreviewTextPropertyInfo = FontSelectionK
type AttrGetType FontSelectionPreviewTextPropertyInfo = T.Text
type AttrLabel FontSelectionPreviewTextPropertyInfo = "FontSelection::preview-text"
attrGet _ = getFontSelectionPreviewText
attrSet _ = setFontSelectionPreviewText
attrConstruct _ = constructFontSelectionPreviewText
type instance AttributeList FontSelection = FontSelectionAttributeList
type FontSelectionAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("baseline-position", BoxBaselinePositionPropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("font-name", FontSelectionFontNamePropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("homogeneous", BoxHomogeneousPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("orientation", OrientableOrientationPropertyInfo), '("parent", WidgetParentPropertyInfo), '("preview-text", FontSelectionPreviewTextPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("spacing", BoxSpacingPropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])
type instance SignalList FontSelection = FontSelectionSignalList
type FontSelectionSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("add", ContainerAddSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("check-resize", ContainerCheckResizeSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("remove", ContainerRemoveSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("set-focus-child", ContainerSetFocusChildSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_font_selection_new" gtk_font_selection_new ::
IO (Ptr FontSelection)
fontSelectionNew ::
(MonadIO m) =>
m FontSelection
fontSelectionNew = liftIO $ do
result <- gtk_font_selection_new
checkUnexpectedReturnNULL "gtk_font_selection_new" result
result' <- (newObject FontSelection) result
return result'
foreign import ccall "gtk_font_selection_get_face" gtk_font_selection_get_face ::
Ptr FontSelection ->
IO (Ptr Pango.FontFace)
fontSelectionGetFace ::
(MonadIO m, FontSelectionK a) =>
a ->
m Pango.FontFace
fontSelectionGetFace _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_face _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_face" result
result' <- (newObject Pango.FontFace) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_face_list" gtk_font_selection_get_face_list ::
Ptr FontSelection ->
IO (Ptr Widget)
fontSelectionGetFaceList ::
(MonadIO m, FontSelectionK a) =>
a ->
m Widget
fontSelectionGetFaceList _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_face_list _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_face_list" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_family" gtk_font_selection_get_family ::
Ptr FontSelection ->
IO (Ptr Pango.FontFamily)
fontSelectionGetFamily ::
(MonadIO m, FontSelectionK a) =>
a ->
m Pango.FontFamily
fontSelectionGetFamily _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_family _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_family" result
result' <- (newObject Pango.FontFamily) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_family_list" gtk_font_selection_get_family_list ::
Ptr FontSelection ->
IO (Ptr Widget)
fontSelectionGetFamilyList ::
(MonadIO m, FontSelectionK a) =>
a ->
m Widget
fontSelectionGetFamilyList _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_family_list _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_family_list" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_font_name" gtk_font_selection_get_font_name ::
Ptr FontSelection ->
IO CString
fontSelectionGetFontName ::
(MonadIO m, FontSelectionK a) =>
a ->
m T.Text
fontSelectionGetFontName _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_font_name _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_font_name" result
result' <- cstringToText result
freeMem result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_preview_entry" gtk_font_selection_get_preview_entry ::
Ptr FontSelection ->
IO (Ptr Widget)
fontSelectionGetPreviewEntry ::
(MonadIO m, FontSelectionK a) =>
a ->
m Widget
fontSelectionGetPreviewEntry _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_preview_entry _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_preview_entry" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_preview_text" gtk_font_selection_get_preview_text ::
Ptr FontSelection ->
IO CString
fontSelectionGetPreviewText ::
(MonadIO m, FontSelectionK a) =>
a ->
m T.Text
fontSelectionGetPreviewText _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_preview_text _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_preview_text" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_size" gtk_font_selection_get_size ::
Ptr FontSelection ->
IO Int32
fontSelectionGetSize ::
(MonadIO m, FontSelectionK a) =>
a ->
m Int32
fontSelectionGetSize _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_size _obj'
touchManagedPtr _obj
return result
foreign import ccall "gtk_font_selection_get_size_entry" gtk_font_selection_get_size_entry ::
Ptr FontSelection ->
IO (Ptr Widget)
fontSelectionGetSizeEntry ::
(MonadIO m, FontSelectionK a) =>
a ->
m Widget
fontSelectionGetSizeEntry _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_size_entry _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_size_entry" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_get_size_list" gtk_font_selection_get_size_list ::
Ptr FontSelection ->
IO (Ptr Widget)
fontSelectionGetSizeList ::
(MonadIO m, FontSelectionK a) =>
a ->
m Widget
fontSelectionGetSizeList _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_font_selection_get_size_list _obj'
checkUnexpectedReturnNULL "gtk_font_selection_get_size_list" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_font_selection_set_font_name" gtk_font_selection_set_font_name ::
Ptr FontSelection ->
CString ->
IO CInt
fontSelectionSetFontName ::
(MonadIO m, FontSelectionK a) =>
a ->
T.Text ->
m Bool
fontSelectionSetFontName _obj fontname = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
fontname' <- textToCString fontname
result <- gtk_font_selection_set_font_name _obj' fontname'
let result' = (/= 0) result
touchManagedPtr _obj
freeMem fontname'
return result'
foreign import ccall "gtk_font_selection_set_preview_text" gtk_font_selection_set_preview_text ::
Ptr FontSelection ->
CString ->
IO ()
fontSelectionSetPreviewText ::
(MonadIO m, FontSelectionK a) =>
a ->
T.Text ->
m ()
fontSelectionSetPreviewText _obj text = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
text' <- textToCString text
gtk_font_selection_set_preview_text _obj' text'
touchManagedPtr _obj
freeMem text'
return ()