#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.SizeGroup
(
SizeGroup(..) ,
IsSizeGroup ,
toSizeGroup ,
noSizeGroup ,
#if ENABLE_OVERLOADING
SizeGroupAddWidgetMethodInfo ,
#endif
sizeGroupAddWidget ,
#if ENABLE_OVERLOADING
SizeGroupGetIgnoreHiddenMethodInfo ,
#endif
sizeGroupGetIgnoreHidden ,
#if ENABLE_OVERLOADING
SizeGroupGetModeMethodInfo ,
#endif
sizeGroupGetMode ,
#if ENABLE_OVERLOADING
SizeGroupGetWidgetsMethodInfo ,
#endif
sizeGroupGetWidgets ,
sizeGroupNew ,
#if ENABLE_OVERLOADING
SizeGroupRemoveWidgetMethodInfo ,
#endif
sizeGroupRemoveWidget ,
#if ENABLE_OVERLOADING
SizeGroupSetIgnoreHiddenMethodInfo ,
#endif
sizeGroupSetIgnoreHidden ,
#if ENABLE_OVERLOADING
SizeGroupSetModeMethodInfo ,
#endif
sizeGroupSetMode ,
#if ENABLE_OVERLOADING
SizeGroupIgnoreHiddenPropertyInfo ,
#endif
constructSizeGroupIgnoreHidden ,
getSizeGroupIgnoreHidden ,
setSizeGroupIgnoreHidden ,
#if ENABLE_OVERLOADING
sizeGroupIgnoreHidden ,
#endif
#if ENABLE_OVERLOADING
SizeGroupModePropertyInfo ,
#endif
constructSizeGroupMode ,
getSizeGroupMode ,
setSizeGroupMode ,
#if ENABLE_OVERLOADING
sizeGroupMode ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype SizeGroup = SizeGroup (ManagedPtr SizeGroup)
foreign import ccall "gtk_size_group_get_type"
c_gtk_size_group_get_type :: IO GType
instance GObject SizeGroup where
gobjectType _ = c_gtk_size_group_get_type
class GObject o => IsSizeGroup o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SizeGroup a) =>
IsSizeGroup a
#endif
instance IsSizeGroup SizeGroup
instance GObject.Object.IsObject SizeGroup
instance Gtk.Buildable.IsBuildable SizeGroup
toSizeGroup :: (MonadIO m, IsSizeGroup o) => o -> m SizeGroup
toSizeGroup = liftIO . unsafeCastTo SizeGroup
noSizeGroup :: Maybe SizeGroup
noSizeGroup = Nothing
#if ENABLE_OVERLOADING
type family ResolveSizeGroupMethod (t :: Symbol) (o :: *) :: * where
ResolveSizeGroupMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveSizeGroupMethod "addWidget" o = SizeGroupAddWidgetMethodInfo
ResolveSizeGroupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSizeGroupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSizeGroupMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveSizeGroupMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveSizeGroupMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveSizeGroupMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveSizeGroupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSizeGroupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSizeGroupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSizeGroupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSizeGroupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSizeGroupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSizeGroupMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveSizeGroupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSizeGroupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSizeGroupMethod "removeWidget" o = SizeGroupRemoveWidgetMethodInfo
ResolveSizeGroupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSizeGroupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSizeGroupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSizeGroupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSizeGroupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSizeGroupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSizeGroupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSizeGroupMethod "getIgnoreHidden" o = SizeGroupGetIgnoreHiddenMethodInfo
ResolveSizeGroupMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveSizeGroupMethod "getMode" o = SizeGroupGetModeMethodInfo
ResolveSizeGroupMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo
ResolveSizeGroupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSizeGroupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSizeGroupMethod "getWidgets" o = SizeGroupGetWidgetsMethodInfo
ResolveSizeGroupMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveSizeGroupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSizeGroupMethod "setIgnoreHidden" o = SizeGroupSetIgnoreHiddenMethodInfo
ResolveSizeGroupMethod "setMode" o = SizeGroupSetModeMethodInfo
ResolveSizeGroupMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
ResolveSizeGroupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSizeGroupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSizeGroupMethod t SizeGroup, O.MethodInfo info SizeGroup p) => O.IsLabelProxy t (SizeGroup -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSizeGroupMethod t SizeGroup, O.MethodInfo info SizeGroup p) => O.IsLabel t (SizeGroup -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getSizeGroupIgnoreHidden :: (MonadIO m, IsSizeGroup o) => o -> m Bool
getSizeGroupIgnoreHidden obj = liftIO $ getObjectPropertyBool obj "ignore-hidden"
setSizeGroupIgnoreHidden :: (MonadIO m, IsSizeGroup o) => o -> Bool -> m ()
setSizeGroupIgnoreHidden obj val = liftIO $ setObjectPropertyBool obj "ignore-hidden" val
constructSizeGroupIgnoreHidden :: (IsSizeGroup o) => Bool -> IO (GValueConstruct o)
constructSizeGroupIgnoreHidden val = constructObjectPropertyBool "ignore-hidden" val
#if ENABLE_OVERLOADING
data SizeGroupIgnoreHiddenPropertyInfo
instance AttrInfo SizeGroupIgnoreHiddenPropertyInfo where
type AttrAllowedOps SizeGroupIgnoreHiddenPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SizeGroupIgnoreHiddenPropertyInfo = (~) Bool
type AttrBaseTypeConstraint SizeGroupIgnoreHiddenPropertyInfo = IsSizeGroup
type AttrGetType SizeGroupIgnoreHiddenPropertyInfo = Bool
type AttrLabel SizeGroupIgnoreHiddenPropertyInfo = "ignore-hidden"
type AttrOrigin SizeGroupIgnoreHiddenPropertyInfo = SizeGroup
attrGet _ = getSizeGroupIgnoreHidden
attrSet _ = setSizeGroupIgnoreHidden
attrConstruct _ = constructSizeGroupIgnoreHidden
attrClear _ = undefined
#endif
getSizeGroupMode :: (MonadIO m, IsSizeGroup o) => o -> m Gtk.Enums.SizeGroupMode
getSizeGroupMode obj = liftIO $ getObjectPropertyEnum obj "mode"
setSizeGroupMode :: (MonadIO m, IsSizeGroup o) => o -> Gtk.Enums.SizeGroupMode -> m ()
setSizeGroupMode obj val = liftIO $ setObjectPropertyEnum obj "mode" val
constructSizeGroupMode :: (IsSizeGroup o) => Gtk.Enums.SizeGroupMode -> IO (GValueConstruct o)
constructSizeGroupMode val = constructObjectPropertyEnum "mode" val
#if ENABLE_OVERLOADING
data SizeGroupModePropertyInfo
instance AttrInfo SizeGroupModePropertyInfo where
type AttrAllowedOps SizeGroupModePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SizeGroupModePropertyInfo = (~) Gtk.Enums.SizeGroupMode
type AttrBaseTypeConstraint SizeGroupModePropertyInfo = IsSizeGroup
type AttrGetType SizeGroupModePropertyInfo = Gtk.Enums.SizeGroupMode
type AttrLabel SizeGroupModePropertyInfo = "mode"
type AttrOrigin SizeGroupModePropertyInfo = SizeGroup
attrGet _ = getSizeGroupMode
attrSet _ = setSizeGroupMode
attrConstruct _ = constructSizeGroupMode
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SizeGroup
type instance O.AttributeList SizeGroup = SizeGroupAttributeList
type SizeGroupAttributeList = ('[ '("ignoreHidden", SizeGroupIgnoreHiddenPropertyInfo), '("mode", SizeGroupModePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
sizeGroupIgnoreHidden :: AttrLabelProxy "ignoreHidden"
sizeGroupIgnoreHidden = AttrLabelProxy
sizeGroupMode :: AttrLabelProxy "mode"
sizeGroupMode = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList SizeGroup = SizeGroupSignalList
type SizeGroupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_size_group_new" gtk_size_group_new ::
CUInt ->
IO (Ptr SizeGroup)
sizeGroupNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gtk.Enums.SizeGroupMode
-> m SizeGroup
sizeGroupNew mode = liftIO $ do
let mode' = (fromIntegral . fromEnum) mode
result <- gtk_size_group_new mode'
checkUnexpectedReturnNULL "sizeGroupNew" result
result' <- (wrapObject SizeGroup) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_size_group_add_widget" gtk_size_group_add_widget ::
Ptr SizeGroup ->
Ptr Gtk.Widget.Widget ->
IO ()
sizeGroupAddWidget ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) =>
a
-> b
-> m ()
sizeGroupAddWidget sizeGroup widget = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
widget' <- unsafeManagedPtrCastPtr widget
gtk_size_group_add_widget sizeGroup' widget'
touchManagedPtr sizeGroup
touchManagedPtr widget
return ()
#if ENABLE_OVERLOADING
data SizeGroupAddWidgetMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => O.MethodInfo SizeGroupAddWidgetMethodInfo a signature where
overloadedMethod _ = sizeGroupAddWidget
#endif
foreign import ccall "gtk_size_group_get_ignore_hidden" gtk_size_group_get_ignore_hidden ::
Ptr SizeGroup ->
IO CInt
{-# DEPRECATED sizeGroupGetIgnoreHidden ["(Since version 3.22)","Measuring the size of hidden widgets has not worked"," reliably for a long time. In most cases, they will report a size"," of 0 nowadays, and thus, their size will not affect the other"," size group members. In effect, size groups will always operate"," as if this property was 'True'. Use a 'GI.Gtk.Objects.Stack.Stack' instead to hide"," widgets while still having their size taken into account."] #-}
sizeGroupGetIgnoreHidden ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) =>
a
-> m Bool
sizeGroupGetIgnoreHidden sizeGroup = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
result <- gtk_size_group_get_ignore_hidden sizeGroup'
let result' = (/= 0) result
touchManagedPtr sizeGroup
return result'
#if ENABLE_OVERLOADING
data SizeGroupGetIgnoreHiddenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetIgnoreHiddenMethodInfo a signature where
overloadedMethod _ = sizeGroupGetIgnoreHidden
#endif
foreign import ccall "gtk_size_group_get_mode" gtk_size_group_get_mode ::
Ptr SizeGroup ->
IO CUInt
sizeGroupGetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) =>
a
-> m Gtk.Enums.SizeGroupMode
sizeGroupGetMode sizeGroup = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
result <- gtk_size_group_get_mode sizeGroup'
let result' = (toEnum . fromIntegral) result
touchManagedPtr sizeGroup
return result'
#if ENABLE_OVERLOADING
data SizeGroupGetModeMethodInfo
instance (signature ~ (m Gtk.Enums.SizeGroupMode), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetModeMethodInfo a signature where
overloadedMethod _ = sizeGroupGetMode
#endif
foreign import ccall "gtk_size_group_get_widgets" gtk_size_group_get_widgets ::
Ptr SizeGroup ->
IO (Ptr (GSList (Ptr Gtk.Widget.Widget)))
sizeGroupGetWidgets ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) =>
a
-> m [Gtk.Widget.Widget]
sizeGroupGetWidgets sizeGroup = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
result <- gtk_size_group_get_widgets sizeGroup'
result' <- unpackGSList result
result'' <- mapM (newObject Gtk.Widget.Widget) result'
touchManagedPtr sizeGroup
return result''
#if ENABLE_OVERLOADING
data SizeGroupGetWidgetsMethodInfo
instance (signature ~ (m [Gtk.Widget.Widget]), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetWidgetsMethodInfo a signature where
overloadedMethod _ = sizeGroupGetWidgets
#endif
foreign import ccall "gtk_size_group_remove_widget" gtk_size_group_remove_widget ::
Ptr SizeGroup ->
Ptr Gtk.Widget.Widget ->
IO ()
sizeGroupRemoveWidget ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) =>
a
-> b
-> m ()
sizeGroupRemoveWidget sizeGroup widget = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
widget' <- unsafeManagedPtrCastPtr widget
gtk_size_group_remove_widget sizeGroup' widget'
touchManagedPtr sizeGroup
touchManagedPtr widget
return ()
#if ENABLE_OVERLOADING
data SizeGroupRemoveWidgetMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => O.MethodInfo SizeGroupRemoveWidgetMethodInfo a signature where
overloadedMethod _ = sizeGroupRemoveWidget
#endif
foreign import ccall "gtk_size_group_set_ignore_hidden" gtk_size_group_set_ignore_hidden ::
Ptr SizeGroup ->
CInt ->
IO ()
{-# DEPRECATED sizeGroupSetIgnoreHidden ["(Since version 3.22)","Measuring the size of hidden widgets has not worked"," reliably for a long time. In most cases, they will report a size"," of 0 nowadays, and thus, their size will not affect the other"," size group members. In effect, size groups will always operate"," as if this property was 'True'. Use a 'GI.Gtk.Objects.Stack.Stack' instead to hide"," widgets while still having their size taken into account."] #-}
sizeGroupSetIgnoreHidden ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) =>
a
-> Bool
-> m ()
sizeGroupSetIgnoreHidden sizeGroup ignoreHidden = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
let ignoreHidden' = (fromIntegral . fromEnum) ignoreHidden
gtk_size_group_set_ignore_hidden sizeGroup' ignoreHidden'
touchManagedPtr sizeGroup
return ()
#if ENABLE_OVERLOADING
data SizeGroupSetIgnoreHiddenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupSetIgnoreHiddenMethodInfo a signature where
overloadedMethod _ = sizeGroupSetIgnoreHidden
#endif
foreign import ccall "gtk_size_group_set_mode" gtk_size_group_set_mode ::
Ptr SizeGroup ->
CUInt ->
IO ()
sizeGroupSetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) =>
a
-> Gtk.Enums.SizeGroupMode
-> m ()
sizeGroupSetMode sizeGroup mode = liftIO $ do
sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup
let mode' = (fromIntegral . fromEnum) mode
gtk_size_group_set_mode sizeGroup' mode'
touchManagedPtr sizeGroup
return ()
#if ENABLE_OVERLOADING
data SizeGroupSetModeMethodInfo
instance (signature ~ (Gtk.Enums.SizeGroupMode -> m ()), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupSetModeMethodInfo a signature where
overloadedMethod _ = sizeGroupSetMode
#endif