module GI.Gtk.Objects.Layout
(
Layout(..) ,
LayoutK ,
toLayout ,
noLayout ,
layoutGetBinWindow ,
layoutGetHadjustment ,
layoutGetSize ,
layoutGetVadjustment ,
layoutMove ,
layoutNew ,
layoutPut ,
layoutSetHadjustment ,
layoutSetSize ,
layoutSetVadjustment ,
LayoutHeightPropertyInfo ,
constructLayoutHeight ,
getLayoutHeight ,
setLayoutHeight ,
LayoutWidthPropertyInfo ,
constructLayoutWidth ,
getLayoutWidth ,
setLayoutWidth ,
) 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.Gdk as Gdk
newtype Layout = Layout (ForeignPtr Layout)
foreign import ccall "gtk_layout_get_type"
c_gtk_layout_get_type :: IO GType
type instance ParentTypes Layout = LayoutParentTypes
type LayoutParentTypes = '[Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable, Scrollable]
instance GObject Layout where
gobjectIsInitiallyUnowned _ = True
gobjectType _ = c_gtk_layout_get_type
class GObject o => LayoutK o
instance (GObject o, IsDescendantOf Layout o) => LayoutK o
toLayout :: LayoutK o => o -> IO Layout
toLayout = unsafeCastTo Layout
noLayout :: Maybe Layout
noLayout = Nothing
getLayoutHeight :: (MonadIO m, LayoutK o) => o -> m Word32
getLayoutHeight obj = liftIO $ getObjectPropertyCUInt obj "height"
setLayoutHeight :: (MonadIO m, LayoutK o) => o -> Word32 -> m ()
setLayoutHeight obj val = liftIO $ setObjectPropertyCUInt obj "height" val
constructLayoutHeight :: Word32 -> IO ([Char], GValue)
constructLayoutHeight val = constructObjectPropertyCUInt "height" val
data LayoutHeightPropertyInfo
instance AttrInfo LayoutHeightPropertyInfo where
type AttrAllowedOps LayoutHeightPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint LayoutHeightPropertyInfo = (~) Word32
type AttrBaseTypeConstraint LayoutHeightPropertyInfo = LayoutK
type AttrGetType LayoutHeightPropertyInfo = Word32
type AttrLabel LayoutHeightPropertyInfo = "Layout::height"
attrGet _ = getLayoutHeight
attrSet _ = setLayoutHeight
attrConstruct _ = constructLayoutHeight
getLayoutWidth :: (MonadIO m, LayoutK o) => o -> m Word32
getLayoutWidth obj = liftIO $ getObjectPropertyCUInt obj "width"
setLayoutWidth :: (MonadIO m, LayoutK o) => o -> Word32 -> m ()
setLayoutWidth obj val = liftIO $ setObjectPropertyCUInt obj "width" val
constructLayoutWidth :: Word32 -> IO ([Char], GValue)
constructLayoutWidth val = constructObjectPropertyCUInt "width" val
data LayoutWidthPropertyInfo
instance AttrInfo LayoutWidthPropertyInfo where
type AttrAllowedOps LayoutWidthPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint LayoutWidthPropertyInfo = (~) Word32
type AttrBaseTypeConstraint LayoutWidthPropertyInfo = LayoutK
type AttrGetType LayoutWidthPropertyInfo = Word32
type AttrLabel LayoutWidthPropertyInfo = "Layout::width"
attrGet _ = getLayoutWidth
attrSet _ = setLayoutWidth
attrConstruct _ = constructLayoutWidth
type instance AttributeList Layout = LayoutAttributeList
type LayoutAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("hadjustment", ScrollableHadjustmentPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height", LayoutHeightPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("hscroll-policy", ScrollableHscrollPolicyPropertyInfo), '("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), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("vadjustment", ScrollableVadjustmentPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("vscroll-policy", ScrollableVscrollPolicyPropertyInfo), '("width", LayoutWidthPropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])
type instance SignalList Layout = LayoutSignalList
type LayoutSignalList = ('[ '("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_layout_new" gtk_layout_new ::
Ptr Adjustment ->
Ptr Adjustment ->
IO (Ptr Layout)
layoutNew ::
(MonadIO m, AdjustmentK a, AdjustmentK b) =>
Maybe (a) ->
Maybe (b) ->
m Layout
layoutNew hadjustment vadjustment = liftIO $ do
maybeHadjustment <- case hadjustment of
Nothing -> return nullPtr
Just jHadjustment -> do
let jHadjustment' = unsafeManagedPtrCastPtr jHadjustment
return jHadjustment'
maybeVadjustment <- case vadjustment of
Nothing -> return nullPtr
Just jVadjustment -> do
let jVadjustment' = unsafeManagedPtrCastPtr jVadjustment
return jVadjustment'
result <- gtk_layout_new maybeHadjustment maybeVadjustment
checkUnexpectedReturnNULL "gtk_layout_new" result
result' <- (newObject Layout) result
whenJust hadjustment touchManagedPtr
whenJust vadjustment touchManagedPtr
return result'
foreign import ccall "gtk_layout_get_bin_window" gtk_layout_get_bin_window ::
Ptr Layout ->
IO (Ptr Gdk.Window)
layoutGetBinWindow ::
(MonadIO m, LayoutK a) =>
a ->
m Gdk.Window
layoutGetBinWindow _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_layout_get_bin_window _obj'
checkUnexpectedReturnNULL "gtk_layout_get_bin_window" result
result' <- (newObject Gdk.Window) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_layout_get_hadjustment" gtk_layout_get_hadjustment ::
Ptr Layout ->
IO (Ptr Adjustment)
layoutGetHadjustment ::
(MonadIO m, LayoutK a) =>
a ->
m Adjustment
layoutGetHadjustment _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_layout_get_hadjustment _obj'
checkUnexpectedReturnNULL "gtk_layout_get_hadjustment" result
result' <- (newObject Adjustment) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_layout_get_size" gtk_layout_get_size ::
Ptr Layout ->
Ptr Word32 ->
Ptr Word32 ->
IO ()
layoutGetSize ::
(MonadIO m, LayoutK a) =>
a ->
m (Word32,Word32)
layoutGetSize _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
width <- allocMem :: IO (Ptr Word32)
height <- allocMem :: IO (Ptr Word32)
gtk_layout_get_size _obj' width height
width' <- peek width
height' <- peek height
touchManagedPtr _obj
freeMem width
freeMem height
return (width', height')
foreign import ccall "gtk_layout_get_vadjustment" gtk_layout_get_vadjustment ::
Ptr Layout ->
IO (Ptr Adjustment)
layoutGetVadjustment ::
(MonadIO m, LayoutK a) =>
a ->
m Adjustment
layoutGetVadjustment _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_layout_get_vadjustment _obj'
checkUnexpectedReturnNULL "gtk_layout_get_vadjustment" result
result' <- (newObject Adjustment) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_layout_move" gtk_layout_move ::
Ptr Layout ->
Ptr Widget ->
Int32 ->
Int32 ->
IO ()
layoutMove ::
(MonadIO m, LayoutK a, WidgetK b) =>
a ->
b ->
Int32 ->
Int32 ->
m ()
layoutMove _obj child_widget x y = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let child_widget' = unsafeManagedPtrCastPtr child_widget
gtk_layout_move _obj' child_widget' x y
touchManagedPtr _obj
touchManagedPtr child_widget
return ()
foreign import ccall "gtk_layout_put" gtk_layout_put ::
Ptr Layout ->
Ptr Widget ->
Int32 ->
Int32 ->
IO ()
layoutPut ::
(MonadIO m, LayoutK a, WidgetK b) =>
a ->
b ->
Int32 ->
Int32 ->
m ()
layoutPut _obj child_widget x y = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let child_widget' = unsafeManagedPtrCastPtr child_widget
gtk_layout_put _obj' child_widget' x y
touchManagedPtr _obj
touchManagedPtr child_widget
return ()
foreign import ccall "gtk_layout_set_hadjustment" gtk_layout_set_hadjustment ::
Ptr Layout ->
Ptr Adjustment ->
IO ()
layoutSetHadjustment ::
(MonadIO m, LayoutK a, AdjustmentK b) =>
a ->
Maybe (b) ->
m ()
layoutSetHadjustment _obj adjustment = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeAdjustment <- case adjustment of
Nothing -> return nullPtr
Just jAdjustment -> do
let jAdjustment' = unsafeManagedPtrCastPtr jAdjustment
return jAdjustment'
gtk_layout_set_hadjustment _obj' maybeAdjustment
touchManagedPtr _obj
whenJust adjustment touchManagedPtr
return ()
foreign import ccall "gtk_layout_set_size" gtk_layout_set_size ::
Ptr Layout ->
Word32 ->
Word32 ->
IO ()
layoutSetSize ::
(MonadIO m, LayoutK a) =>
a ->
Word32 ->
Word32 ->
m ()
layoutSetSize _obj width height = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
gtk_layout_set_size _obj' width height
touchManagedPtr _obj
return ()
foreign import ccall "gtk_layout_set_vadjustment" gtk_layout_set_vadjustment ::
Ptr Layout ->
Ptr Adjustment ->
IO ()
layoutSetVadjustment ::
(MonadIO m, LayoutK a, AdjustmentK b) =>
a ->
Maybe (b) ->
m ()
layoutSetVadjustment _obj adjustment = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeAdjustment <- case adjustment of
Nothing -> return nullPtr
Just jAdjustment -> do
let jAdjustment' = unsafeManagedPtrCastPtr jAdjustment
return jAdjustment'
gtk_layout_set_vadjustment _obj' maybeAdjustment
touchManagedPtr _obj
whenJust adjustment touchManagedPtr
return ()