{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) -} module GI.Gtk.Objects.ButtonBox ( -- * Exported types ButtonBox(..) , ButtonBoxK , toButtonBox , noButtonBox , -- * Methods -- ** buttonBoxGetChildNonHomogeneous buttonBoxGetChildNonHomogeneous , -- ** buttonBoxGetChildSecondary buttonBoxGetChildSecondary , -- ** buttonBoxGetLayout buttonBoxGetLayout , -- ** buttonBoxNew buttonBoxNew , -- ** buttonBoxSetChildNonHomogeneous buttonBoxSetChildNonHomogeneous , -- ** buttonBoxSetChildSecondary buttonBoxSetChildSecondary , -- ** buttonBoxSetLayout buttonBoxSetLayout , -- * Properties -- ** LayoutStyle ButtonBoxLayoutStylePropertyInfo , constructButtonBoxLayoutStyle , getButtonBoxLayoutStyle , setButtonBoxLayoutStyle , ) 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 ButtonBox = ButtonBox (ForeignPtr ButtonBox) foreign import ccall "gtk_button_box_get_type" c_gtk_button_box_get_type :: IO GType type instance ParentTypes ButtonBox = ButtonBoxParentTypes type ButtonBoxParentTypes = '[Box, Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable, Orientable] instance GObject ButtonBox where gobjectIsInitiallyUnowned _ = True gobjectType _ = c_gtk_button_box_get_type class GObject o => ButtonBoxK o instance (GObject o, IsDescendantOf ButtonBox o) => ButtonBoxK o toButtonBox :: ButtonBoxK o => o -> IO ButtonBox toButtonBox = unsafeCastTo ButtonBox noButtonBox :: Maybe ButtonBox noButtonBox = Nothing -- VVV Prop "layout-style" -- Type: TInterface "Gtk" "ButtonBoxStyle" -- Flags: [PropertyReadable,PropertyWritable] getButtonBoxLayoutStyle :: (MonadIO m, ButtonBoxK o) => o -> m ButtonBoxStyle getButtonBoxLayoutStyle obj = liftIO $ getObjectPropertyEnum obj "layout-style" setButtonBoxLayoutStyle :: (MonadIO m, ButtonBoxK o) => o -> ButtonBoxStyle -> m () setButtonBoxLayoutStyle obj val = liftIO $ setObjectPropertyEnum obj "layout-style" val constructButtonBoxLayoutStyle :: ButtonBoxStyle -> IO ([Char], GValue) constructButtonBoxLayoutStyle val = constructObjectPropertyEnum "layout-style" val data ButtonBoxLayoutStylePropertyInfo instance AttrInfo ButtonBoxLayoutStylePropertyInfo where type AttrAllowedOps ButtonBoxLayoutStylePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint ButtonBoxLayoutStylePropertyInfo = (~) ButtonBoxStyle type AttrBaseTypeConstraint ButtonBoxLayoutStylePropertyInfo = ButtonBoxK type AttrGetType ButtonBoxLayoutStylePropertyInfo = ButtonBoxStyle type AttrLabel ButtonBoxLayoutStylePropertyInfo = "ButtonBox::layout-style" attrGet _ = getButtonBoxLayoutStyle attrSet _ = setButtonBoxLayoutStyle attrConstruct _ = constructButtonBoxLayoutStyle type instance AttributeList ButtonBox = ButtonBoxAttributeList type ButtonBoxAttributeList = ('[ '("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), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("homogeneous", BoxHomogeneousPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("layout-style", ButtonBoxLayoutStylePropertyInfo), '("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), '("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 ButtonBox = ButtonBoxSignalList type ButtonBoxSignalList = ('[ '("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, *)]) -- method ButtonBox::new -- method type : Constructor -- Args : [Arg {argName = "orientation", argType = TInterface "Gtk" "Orientation", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "orientation", argType = TInterface "Gtk" "Orientation", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Gtk" "ButtonBox" -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_new" gtk_button_box_new :: CUInt -> -- orientation : TInterface "Gtk" "Orientation" IO (Ptr ButtonBox) buttonBoxNew :: (MonadIO m) => Orientation -> -- orientation m ButtonBox buttonBoxNew orientation = liftIO $ do let orientation' = (fromIntegral . fromEnum) orientation result <- gtk_button_box_new orientation' checkUnexpectedReturnNULL "gtk_button_box_new" result result' <- (newObject ButtonBox) result return result' -- method ButtonBox::get_child_non_homogeneous -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_get_child_non_homogeneous" gtk_button_box_get_child_non_homogeneous :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" Ptr Widget -> -- child : TInterface "Gtk" "Widget" IO CInt buttonBoxGetChildNonHomogeneous :: (MonadIO m, ButtonBoxK a, WidgetK b) => a -> -- _obj b -> -- child m Bool buttonBoxGetChildNonHomogeneous _obj child = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let child' = unsafeManagedPtrCastPtr child result <- gtk_button_box_get_child_non_homogeneous _obj' child' let result' = (/= 0) result touchManagedPtr _obj touchManagedPtr child return result' -- method ButtonBox::get_child_secondary -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_get_child_secondary" gtk_button_box_get_child_secondary :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" Ptr Widget -> -- child : TInterface "Gtk" "Widget" IO CInt buttonBoxGetChildSecondary :: (MonadIO m, ButtonBoxK a, WidgetK b) => a -> -- _obj b -> -- child m Bool buttonBoxGetChildSecondary _obj child = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let child' = unsafeManagedPtrCastPtr child result <- gtk_button_box_get_child_secondary _obj' child' let result' = (/= 0) result touchManagedPtr _obj touchManagedPtr child return result' -- method ButtonBox::get_layout -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Gtk" "ButtonBoxStyle" -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_get_layout" gtk_button_box_get_layout :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" IO CUInt buttonBoxGetLayout :: (MonadIO m, ButtonBoxK a) => a -> -- _obj m ButtonBoxStyle buttonBoxGetLayout _obj = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj result <- gtk_button_box_get_layout _obj' let result' = (toEnum . fromIntegral) result touchManagedPtr _obj return result' -- method ButtonBox::set_child_non_homogeneous -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "non_homogeneous", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "non_homogeneous", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_set_child_non_homogeneous" gtk_button_box_set_child_non_homogeneous :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" Ptr Widget -> -- child : TInterface "Gtk" "Widget" CInt -> -- non_homogeneous : TBasicType TBoolean IO () buttonBoxSetChildNonHomogeneous :: (MonadIO m, ButtonBoxK a, WidgetK b) => a -> -- _obj b -> -- child Bool -> -- non_homogeneous m () buttonBoxSetChildNonHomogeneous _obj child non_homogeneous = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let child' = unsafeManagedPtrCastPtr child let non_homogeneous' = (fromIntegral . fromEnum) non_homogeneous gtk_button_box_set_child_non_homogeneous _obj' child' non_homogeneous' touchManagedPtr _obj touchManagedPtr child return () -- method ButtonBox::set_child_secondary -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "is_secondary", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "Gtk" "Widget", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "is_secondary", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_set_child_secondary" gtk_button_box_set_child_secondary :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" Ptr Widget -> -- child : TInterface "Gtk" "Widget" CInt -> -- is_secondary : TBasicType TBoolean IO () buttonBoxSetChildSecondary :: (MonadIO m, ButtonBoxK a, WidgetK b) => a -> -- _obj b -> -- child Bool -> -- is_secondary m () buttonBoxSetChildSecondary _obj child is_secondary = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let child' = unsafeManagedPtrCastPtr child let is_secondary' = (fromIntegral . fromEnum) is_secondary gtk_button_box_set_child_secondary _obj' child' is_secondary' touchManagedPtr _obj touchManagedPtr child return () -- method ButtonBox::set_layout -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "layout_style", argType = TInterface "Gtk" "ButtonBoxStyle", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ButtonBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "layout_style", argType = TInterface "Gtk" "ButtonBoxStyle", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gtk_button_box_set_layout" gtk_button_box_set_layout :: Ptr ButtonBox -> -- _obj : TInterface "Gtk" "ButtonBox" CUInt -> -- layout_style : TInterface "Gtk" "ButtonBoxStyle" IO () buttonBoxSetLayout :: (MonadIO m, ButtonBoxK a) => a -> -- _obj ButtonBoxStyle -> -- layout_style m () buttonBoxSetLayout _obj layout_style = liftIO $ do let _obj' = unsafeManagedPtrCastPtr _obj let layout_style' = (fromIntegral . fromEnum) layout_style gtk_button_box_set_layout _obj' layout_style' touchManagedPtr _obj return ()