module GI.Gtk.Objects.Frame
(
Frame(..) ,
FrameK ,
toFrame ,
noFrame ,
frameGetLabel ,
frameGetLabelAlign ,
frameGetLabelWidget ,
frameGetShadowType ,
frameNew ,
frameSetLabel ,
frameSetLabelAlign ,
frameSetLabelWidget ,
frameSetShadowType ,
FrameLabelPropertyInfo ,
constructFrameLabel ,
getFrameLabel ,
setFrameLabel ,
FrameLabelWidgetPropertyInfo ,
constructFrameLabelWidget ,
getFrameLabelWidget ,
setFrameLabelWidget ,
FrameLabelXalignPropertyInfo ,
constructFrameLabelXalign ,
getFrameLabelXalign ,
setFrameLabelXalign ,
FrameLabelYalignPropertyInfo ,
constructFrameLabelYalign ,
getFrameLabelYalign ,
setFrameLabelYalign ,
FrameShadowTypePropertyInfo ,
constructFrameShadowType ,
getFrameShadowType ,
setFrameShadowType ,
) 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
newtype Frame = Frame (ForeignPtr Frame)
foreign import ccall "gtk_frame_get_type"
c_gtk_frame_get_type :: IO GType
type instance ParentTypes Frame = FrameParentTypes
type FrameParentTypes = '[Bin, Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable]
instance GObject Frame where
gobjectIsInitiallyUnowned _ = True
gobjectType _ = c_gtk_frame_get_type
class GObject o => FrameK o
instance (GObject o, IsDescendantOf Frame o) => FrameK o
toFrame :: FrameK o => o -> IO Frame
toFrame = unsafeCastTo Frame
noFrame :: Maybe Frame
noFrame = Nothing
getFrameLabel :: (MonadIO m, FrameK o) => o -> m T.Text
getFrameLabel obj = liftIO $ getObjectPropertyString obj "label"
setFrameLabel :: (MonadIO m, FrameK o) => o -> T.Text -> m ()
setFrameLabel obj val = liftIO $ setObjectPropertyString obj "label" val
constructFrameLabel :: T.Text -> IO ([Char], GValue)
constructFrameLabel val = constructObjectPropertyString "label" val
data FrameLabelPropertyInfo
instance AttrInfo FrameLabelPropertyInfo where
type AttrAllowedOps FrameLabelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FrameLabelPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint FrameLabelPropertyInfo = FrameK
type AttrGetType FrameLabelPropertyInfo = T.Text
type AttrLabel FrameLabelPropertyInfo = "Frame::label"
attrGet _ = getFrameLabel
attrSet _ = setFrameLabel
attrConstruct _ = constructFrameLabel
getFrameLabelWidget :: (MonadIO m, FrameK o) => o -> m Widget
getFrameLabelWidget obj = liftIO $ getObjectPropertyObject obj "label-widget" Widget
setFrameLabelWidget :: (MonadIO m, FrameK o, WidgetK a) => o -> a -> m ()
setFrameLabelWidget obj val = liftIO $ setObjectPropertyObject obj "label-widget" val
constructFrameLabelWidget :: (WidgetK a) => a -> IO ([Char], GValue)
constructFrameLabelWidget val = constructObjectPropertyObject "label-widget" val
data FrameLabelWidgetPropertyInfo
instance AttrInfo FrameLabelWidgetPropertyInfo where
type AttrAllowedOps FrameLabelWidgetPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FrameLabelWidgetPropertyInfo = WidgetK
type AttrBaseTypeConstraint FrameLabelWidgetPropertyInfo = FrameK
type AttrGetType FrameLabelWidgetPropertyInfo = Widget
type AttrLabel FrameLabelWidgetPropertyInfo = "Frame::label-widget"
attrGet _ = getFrameLabelWidget
attrSet _ = setFrameLabelWidget
attrConstruct _ = constructFrameLabelWidget
getFrameLabelXalign :: (MonadIO m, FrameK o) => o -> m Float
getFrameLabelXalign obj = liftIO $ getObjectPropertyFloat obj "label-xalign"
setFrameLabelXalign :: (MonadIO m, FrameK o) => o -> Float -> m ()
setFrameLabelXalign obj val = liftIO $ setObjectPropertyFloat obj "label-xalign" val
constructFrameLabelXalign :: Float -> IO ([Char], GValue)
constructFrameLabelXalign val = constructObjectPropertyFloat "label-xalign" val
data FrameLabelXalignPropertyInfo
instance AttrInfo FrameLabelXalignPropertyInfo where
type AttrAllowedOps FrameLabelXalignPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FrameLabelXalignPropertyInfo = (~) Float
type AttrBaseTypeConstraint FrameLabelXalignPropertyInfo = FrameK
type AttrGetType FrameLabelXalignPropertyInfo = Float
type AttrLabel FrameLabelXalignPropertyInfo = "Frame::label-xalign"
attrGet _ = getFrameLabelXalign
attrSet _ = setFrameLabelXalign
attrConstruct _ = constructFrameLabelXalign
getFrameLabelYalign :: (MonadIO m, FrameK o) => o -> m Float
getFrameLabelYalign obj = liftIO $ getObjectPropertyFloat obj "label-yalign"
setFrameLabelYalign :: (MonadIO m, FrameK o) => o -> Float -> m ()
setFrameLabelYalign obj val = liftIO $ setObjectPropertyFloat obj "label-yalign" val
constructFrameLabelYalign :: Float -> IO ([Char], GValue)
constructFrameLabelYalign val = constructObjectPropertyFloat "label-yalign" val
data FrameLabelYalignPropertyInfo
instance AttrInfo FrameLabelYalignPropertyInfo where
type AttrAllowedOps FrameLabelYalignPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FrameLabelYalignPropertyInfo = (~) Float
type AttrBaseTypeConstraint FrameLabelYalignPropertyInfo = FrameK
type AttrGetType FrameLabelYalignPropertyInfo = Float
type AttrLabel FrameLabelYalignPropertyInfo = "Frame::label-yalign"
attrGet _ = getFrameLabelYalign
attrSet _ = setFrameLabelYalign
attrConstruct _ = constructFrameLabelYalign
getFrameShadowType :: (MonadIO m, FrameK o) => o -> m ShadowType
getFrameShadowType obj = liftIO $ getObjectPropertyEnum obj "shadow-type"
setFrameShadowType :: (MonadIO m, FrameK o) => o -> ShadowType -> m ()
setFrameShadowType obj val = liftIO $ setObjectPropertyEnum obj "shadow-type" val
constructFrameShadowType :: ShadowType -> IO ([Char], GValue)
constructFrameShadowType val = constructObjectPropertyEnum "shadow-type" val
data FrameShadowTypePropertyInfo
instance AttrInfo FrameShadowTypePropertyInfo where
type AttrAllowedOps FrameShadowTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FrameShadowTypePropertyInfo = (~) ShadowType
type AttrBaseTypeConstraint FrameShadowTypePropertyInfo = FrameK
type AttrGetType FrameShadowTypePropertyInfo = ShadowType
type AttrLabel FrameShadowTypePropertyInfo = "Frame::shadow-type"
attrGet _ = getFrameShadowType
attrSet _ = setFrameShadowType
attrConstruct _ = constructFrameShadowType
type instance AttributeList Frame = FrameAttributeList
type FrameAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("label", FrameLabelPropertyInfo), '("label-widget", FrameLabelWidgetPropertyInfo), '("label-xalign", FrameLabelXalignPropertyInfo), '("label-yalign", FrameLabelYalignPropertyInfo), '("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), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("shadow-type", FrameShadowTypePropertyInfo), '("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 Frame = FrameSignalList
type FrameSignalList = ('[ '("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_frame_new" gtk_frame_new ::
CString ->
IO (Ptr Frame)
frameNew ::
(MonadIO m) =>
Maybe (T.Text) ->
m Frame
frameNew label = liftIO $ do
maybeLabel <- case label of
Nothing -> return nullPtr
Just jLabel -> do
jLabel' <- textToCString jLabel
return jLabel'
result <- gtk_frame_new maybeLabel
checkUnexpectedReturnNULL "gtk_frame_new" result
result' <- (newObject Frame) result
freeMem maybeLabel
return result'
foreign import ccall "gtk_frame_get_label" gtk_frame_get_label ::
Ptr Frame ->
IO CString
frameGetLabel ::
(MonadIO m, FrameK a) =>
a ->
m T.Text
frameGetLabel _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_frame_get_label _obj'
checkUnexpectedReturnNULL "gtk_frame_get_label" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_frame_get_label_align" gtk_frame_get_label_align ::
Ptr Frame ->
Ptr CFloat ->
Ptr CFloat ->
IO ()
frameGetLabelAlign ::
(MonadIO m, FrameK a) =>
a ->
m (Float,Float)
frameGetLabelAlign _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
xalign <- allocMem :: IO (Ptr CFloat)
yalign <- allocMem :: IO (Ptr CFloat)
gtk_frame_get_label_align _obj' xalign yalign
xalign' <- peek xalign
let xalign'' = realToFrac xalign'
yalign' <- peek yalign
let yalign'' = realToFrac yalign'
touchManagedPtr _obj
freeMem xalign
freeMem yalign
return (xalign'', yalign'')
foreign import ccall "gtk_frame_get_label_widget" gtk_frame_get_label_widget ::
Ptr Frame ->
IO (Ptr Widget)
frameGetLabelWidget ::
(MonadIO m, FrameK a) =>
a ->
m Widget
frameGetLabelWidget _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_frame_get_label_widget _obj'
checkUnexpectedReturnNULL "gtk_frame_get_label_widget" result
result' <- (newObject Widget) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_frame_get_shadow_type" gtk_frame_get_shadow_type ::
Ptr Frame ->
IO CUInt
frameGetShadowType ::
(MonadIO m, FrameK a) =>
a ->
m ShadowType
frameGetShadowType _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_frame_get_shadow_type _obj'
let result' = (toEnum . fromIntegral) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_frame_set_label" gtk_frame_set_label ::
Ptr Frame ->
CString ->
IO ()
frameSetLabel ::
(MonadIO m, FrameK a) =>
a ->
Maybe (T.Text) ->
m ()
frameSetLabel _obj label = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeLabel <- case label of
Nothing -> return nullPtr
Just jLabel -> do
jLabel' <- textToCString jLabel
return jLabel'
gtk_frame_set_label _obj' maybeLabel
touchManagedPtr _obj
freeMem maybeLabel
return ()
foreign import ccall "gtk_frame_set_label_align" gtk_frame_set_label_align ::
Ptr Frame ->
CFloat ->
CFloat ->
IO ()
frameSetLabelAlign ::
(MonadIO m, FrameK a) =>
a ->
Float ->
Float ->
m ()
frameSetLabelAlign _obj xalign yalign = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let xalign' = realToFrac xalign
let yalign' = realToFrac yalign
gtk_frame_set_label_align _obj' xalign' yalign'
touchManagedPtr _obj
return ()
foreign import ccall "gtk_frame_set_label_widget" gtk_frame_set_label_widget ::
Ptr Frame ->
Ptr Widget ->
IO ()
frameSetLabelWidget ::
(MonadIO m, FrameK a, WidgetK b) =>
a ->
Maybe (b) ->
m ()
frameSetLabelWidget _obj label_widget = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeLabel_widget <- case label_widget of
Nothing -> return nullPtr
Just jLabel_widget -> do
let jLabel_widget' = unsafeManagedPtrCastPtr jLabel_widget
return jLabel_widget'
gtk_frame_set_label_widget _obj' maybeLabel_widget
touchManagedPtr _obj
whenJust label_widget touchManagedPtr
return ()
foreign import ccall "gtk_frame_set_shadow_type" gtk_frame_set_shadow_type ::
Ptr Frame ->
CUInt ->
IO ()
frameSetShadowType ::
(MonadIO m, FrameK a) =>
a ->
ShadowType ->
m ()
frameSetShadowType _obj type_ = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let type_' = (fromIntegral . fromEnum) type_
gtk_frame_set_shadow_type _obj' type_'
touchManagedPtr _obj
return ()