{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.LayoutManager
(
LayoutManager(..) ,
IsLayoutManager ,
toLayoutManager ,
#if defined(ENABLE_OVERLOADING)
ResolveLayoutManagerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
LayoutManagerAllocateMethodInfo ,
#endif
layoutManagerAllocate ,
#if defined(ENABLE_OVERLOADING)
LayoutManagerGetLayoutChildMethodInfo ,
#endif
layoutManagerGetLayoutChild ,
#if defined(ENABLE_OVERLOADING)
LayoutManagerGetRequestModeMethodInfo ,
#endif
layoutManagerGetRequestMode ,
#if defined(ENABLE_OVERLOADING)
LayoutManagerGetWidgetMethodInfo ,
#endif
layoutManagerGetWidget ,
#if defined(ENABLE_OVERLOADING)
LayoutManagerLayoutChangedMethodInfo ,
#endif
layoutManagerLayoutChanged ,
#if defined(ENABLE_OVERLOADING)
LayoutManagerMeasureMethodInfo ,
#endif
layoutManagerMeasure ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import qualified GI.Gdk.Objects.Clipboard as Gdk.Clipboard
import qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import qualified GI.Gdk.Objects.Device as Gdk.Device
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.Event as Gdk.Event
import qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import qualified GI.Gdk.Objects.Surface as Gdk.Surface
import qualified GI.Gdk.Objects.Texture as Gdk.Texture
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gio.Interfaces.ActionGroup as Gio.ActionGroup
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Graphene.Structs.Matrix as Graphene.Matrix
import qualified GI.Graphene.Structs.Point as Graphene.Point
import qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import qualified GI.Graphene.Structs.Rect as Graphene.Rect
import qualified GI.Graphene.Structs.Size as Graphene.Size
import qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4
import qualified GI.Gsk.Enums as Gsk.Enums
import qualified GI.Gsk.Objects.GLShader as Gsk.GLShader
import qualified GI.Gsk.Objects.RenderNode as Gsk.RenderNode
import qualified GI.Gsk.Objects.Renderer as Gsk.Renderer
import qualified GI.Gsk.Structs.ColorStop as Gsk.ColorStop
import qualified GI.Gsk.Structs.Path as Gsk.Path
import qualified GI.Gsk.Structs.RoundedRect as Gsk.RoundedRect
import qualified GI.Gsk.Structs.Shadow as Gsk.Shadow
import qualified GI.Gsk.Structs.Stroke as Gsk.Stroke
import qualified GI.Gsk.Structs.Transform as Gsk.Transform
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Accessible as Gtk.Accessible
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.ConstraintTarget as Gtk.ConstraintTarget
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Native as Gtk.Native
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Root as Gtk.Root
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.StyleProvider as Gtk.StyleProvider
import {-# SOURCE #-} qualified GI.Gtk.Objects.ATContext as Gtk.ATContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.EventController as Gtk.EventController
import {-# SOURCE #-} qualified GI.Gtk.Objects.LayoutChild as Gtk.LayoutChild
import {-# SOURCE #-} qualified GI.Gtk.Objects.Settings as Gtk.Settings
import {-# SOURCE #-} qualified GI.Gtk.Objects.Snapshot as Gtk.Snapshot
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.Tooltip as Gtk.Tooltip
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Structs.Border as Gtk.Border
import {-# SOURCE #-} qualified GI.Gtk.Structs.Requisition as Gtk.Requisition
import qualified GI.Pango.Enums as Pango.Enums
import qualified GI.Pango.Objects.Context as Pango.Context
import qualified GI.Pango.Objects.FontMap as Pango.FontMap
import qualified GI.Pango.Objects.Layout as Pango.Layout
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Objects.LayoutChild as Gtk.LayoutChild
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
#endif
newtype LayoutManager = LayoutManager (SP.ManagedPtr LayoutManager)
deriving (LayoutManager -> LayoutManager -> Bool
(LayoutManager -> LayoutManager -> Bool)
-> (LayoutManager -> LayoutManager -> Bool) -> Eq LayoutManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LayoutManager -> LayoutManager -> Bool
== :: LayoutManager -> LayoutManager -> Bool
$c/= :: LayoutManager -> LayoutManager -> Bool
/= :: LayoutManager -> LayoutManager -> Bool
Eq)
instance SP.ManagedPtrNewtype LayoutManager where
toManagedPtr :: LayoutManager -> ManagedPtr LayoutManager
toManagedPtr (LayoutManager ManagedPtr LayoutManager
p) = ManagedPtr LayoutManager
p
foreign import ccall "gtk_layout_manager_get_type"
c_gtk_layout_manager_get_type :: IO B.Types.GType
instance B.Types.TypedObject LayoutManager where
glibType :: IO GType
glibType = IO GType
c_gtk_layout_manager_get_type
instance B.Types.GObject LayoutManager
class (SP.GObject o, O.IsDescendantOf LayoutManager o) => IsLayoutManager o
instance (SP.GObject o, O.IsDescendantOf LayoutManager o) => IsLayoutManager o
instance O.HasParentTypes LayoutManager
type instance O.ParentTypes LayoutManager = '[GObject.Object.Object]
toLayoutManager :: (MIO.MonadIO m, IsLayoutManager o) => o -> m LayoutManager
toLayoutManager :: forall (m :: * -> *) o.
(MonadIO m, IsLayoutManager o) =>
o -> m LayoutManager
toLayoutManager = IO LayoutManager -> m LayoutManager
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO LayoutManager -> m LayoutManager)
-> (o -> IO LayoutManager) -> o -> m LayoutManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr LayoutManager -> LayoutManager)
-> o -> IO LayoutManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr LayoutManager -> LayoutManager
LayoutManager
instance B.GValue.IsGValue (Maybe LayoutManager) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_layout_manager_get_type
gvalueSet_ :: Ptr GValue -> Maybe LayoutManager -> IO ()
gvalueSet_ Ptr GValue
gv Maybe LayoutManager
P.Nothing = Ptr GValue -> Ptr LayoutManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr LayoutManager
forall a. Ptr a
FP.nullPtr :: FP.Ptr LayoutManager)
gvalueSet_ Ptr GValue
gv (P.Just LayoutManager
obj) = LayoutManager -> (Ptr LayoutManager -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr LayoutManager
obj (Ptr GValue -> Ptr LayoutManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe LayoutManager)
gvalueGet_ Ptr GValue
gv = do
Ptr LayoutManager
ptr <- Ptr GValue -> IO (Ptr LayoutManager)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr LayoutManager)
if Ptr LayoutManager
ptr Ptr LayoutManager -> Ptr LayoutManager -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr LayoutManager
forall a. Ptr a
FP.nullPtr
then LayoutManager -> Maybe LayoutManager
forall a. a -> Maybe a
P.Just (LayoutManager -> Maybe LayoutManager)
-> IO LayoutManager -> IO (Maybe LayoutManager)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr LayoutManager -> LayoutManager)
-> Ptr LayoutManager -> IO LayoutManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr LayoutManager -> LayoutManager
LayoutManager Ptr LayoutManager
ptr
else Maybe LayoutManager -> IO (Maybe LayoutManager)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LayoutManager
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveLayoutManagerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveLayoutManagerMethod "allocate" o = LayoutManagerAllocateMethodInfo
ResolveLayoutManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveLayoutManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveLayoutManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveLayoutManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveLayoutManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveLayoutManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveLayoutManagerMethod "layoutChanged" o = LayoutManagerLayoutChangedMethodInfo
ResolveLayoutManagerMethod "measure" o = LayoutManagerMeasureMethodInfo
ResolveLayoutManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveLayoutManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveLayoutManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveLayoutManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveLayoutManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveLayoutManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveLayoutManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveLayoutManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveLayoutManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveLayoutManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveLayoutManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveLayoutManagerMethod "getLayoutChild" o = LayoutManagerGetLayoutChildMethodInfo
ResolveLayoutManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveLayoutManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveLayoutManagerMethod "getRequestMode" o = LayoutManagerGetRequestModeMethodInfo
ResolveLayoutManagerMethod "getWidget" o = LayoutManagerGetWidgetMethodInfo
ResolveLayoutManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveLayoutManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveLayoutManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveLayoutManagerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveLayoutManagerMethod t LayoutManager, O.OverloadedMethod info LayoutManager p) => OL.IsLabel t (LayoutManager -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveLayoutManagerMethod t LayoutManager, O.OverloadedMethod info LayoutManager p, R.HasField t LayoutManager p) => R.HasField t LayoutManager p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveLayoutManagerMethod t LayoutManager, O.OverloadedMethodInfo info LayoutManager) => OL.IsLabel t (O.MethodProxy info LayoutManager) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList LayoutManager
type instance O.AttributeList LayoutManager = LayoutManagerAttributeList
type LayoutManagerAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList LayoutManager = LayoutManagerSignalList
type LayoutManagerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_layout_manager_allocate" gtk_layout_manager_allocate ::
Ptr LayoutManager ->
Ptr Gtk.Widget.Widget ->
Int32 ->
Int32 ->
Int32 ->
IO ()
layoutManagerAllocate ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) =>
a
-> b
-> Int32
-> Int32
-> Int32
-> m ()
layoutManagerAllocate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsLayoutManager a, IsWidget b) =>
a -> b -> Int32 -> Int32 -> Int32 -> m ()
layoutManagerAllocate a
manager b
widget Int32
width Int32
height Int32
baseline = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr Widget
widget' <- b -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
widget
Ptr LayoutManager -> Ptr Widget -> Int32 -> Int32 -> Int32 -> IO ()
gtk_layout_manager_allocate Ptr LayoutManager
manager' Ptr Widget
widget' Int32
width Int32
height Int32
baseline
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
widget
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data LayoutManagerAllocateMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) => O.OverloadedMethod LayoutManagerAllocateMethodInfo a signature where
overloadedMethod = layoutManagerAllocate
instance O.OverloadedMethodInfo LayoutManagerAllocateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerAllocate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerAllocate"
})
#endif
foreign import ccall "gtk_layout_manager_get_layout_child" gtk_layout_manager_get_layout_child ::
Ptr LayoutManager ->
Ptr Gtk.Widget.Widget ->
IO (Ptr Gtk.LayoutChild.LayoutChild)
layoutManagerGetLayoutChild ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) =>
a
-> b
-> m Gtk.LayoutChild.LayoutChild
layoutManagerGetLayoutChild :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsLayoutManager a, IsWidget b) =>
a -> b -> m LayoutChild
layoutManagerGetLayoutChild a
manager b
child = IO LayoutChild -> m LayoutChild
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutChild -> m LayoutChild)
-> IO LayoutChild -> m LayoutChild
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr Widget
child' <- b -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
child
Ptr LayoutChild
result <- Ptr LayoutManager -> Ptr Widget -> IO (Ptr LayoutChild)
gtk_layout_manager_get_layout_child Ptr LayoutManager
manager' Ptr Widget
child'
Text -> Ptr LayoutChild -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutManagerGetLayoutChild" Ptr LayoutChild
result
LayoutChild
result' <- ((ManagedPtr LayoutChild -> LayoutChild)
-> Ptr LayoutChild -> IO LayoutChild
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr LayoutChild -> LayoutChild
Gtk.LayoutChild.LayoutChild) Ptr LayoutChild
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
child
LayoutChild -> IO LayoutChild
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return LayoutChild
result'
#if defined(ENABLE_OVERLOADING)
data LayoutManagerGetLayoutChildMethodInfo
instance (signature ~ (b -> m Gtk.LayoutChild.LayoutChild), MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) => O.OverloadedMethod LayoutManagerGetLayoutChildMethodInfo a signature where
overloadedMethod = layoutManagerGetLayoutChild
instance O.OverloadedMethodInfo LayoutManagerGetLayoutChildMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerGetLayoutChild",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerGetLayoutChild"
})
#endif
foreign import ccall "gtk_layout_manager_get_request_mode" gtk_layout_manager_get_request_mode ::
Ptr LayoutManager ->
IO CUInt
layoutManagerGetRequestMode ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a) =>
a
-> m Gtk.Enums.SizeRequestMode
layoutManagerGetRequestMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayoutManager a) =>
a -> m SizeRequestMode
layoutManagerGetRequestMode a
manager = IO SizeRequestMode -> m SizeRequestMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SizeRequestMode -> m SizeRequestMode)
-> IO SizeRequestMode -> m SizeRequestMode
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CUInt
result <- Ptr LayoutManager -> IO CUInt
gtk_layout_manager_get_request_mode Ptr LayoutManager
manager'
let result' :: SizeRequestMode
result' = (Int -> SizeRequestMode
forall a. Enum a => Int -> a
toEnum (Int -> SizeRequestMode)
-> (CUInt -> Int) -> CUInt -> SizeRequestMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
SizeRequestMode -> IO SizeRequestMode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SizeRequestMode
result'
#if defined(ENABLE_OVERLOADING)
data LayoutManagerGetRequestModeMethodInfo
instance (signature ~ (m Gtk.Enums.SizeRequestMode), MonadIO m, IsLayoutManager a) => O.OverloadedMethod LayoutManagerGetRequestModeMethodInfo a signature where
overloadedMethod = layoutManagerGetRequestMode
instance O.OverloadedMethodInfo LayoutManagerGetRequestModeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerGetRequestMode",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerGetRequestMode"
})
#endif
foreign import ccall "gtk_layout_manager_get_widget" gtk_layout_manager_get_widget ::
Ptr LayoutManager ->
IO (Ptr Gtk.Widget.Widget)
layoutManagerGetWidget ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a) =>
a
-> m (Maybe Gtk.Widget.Widget)
layoutManagerGetWidget :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayoutManager a) =>
a -> m (Maybe Widget)
layoutManagerGetWidget a
manager = IO (Maybe Widget) -> m (Maybe Widget)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Widget) -> m (Maybe Widget))
-> IO (Maybe Widget) -> m (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr Widget
result <- Ptr LayoutManager -> IO (Ptr Widget)
gtk_layout_manager_get_widget Ptr LayoutManager
manager'
Maybe Widget
maybeResult <- Ptr Widget -> (Ptr Widget -> IO Widget) -> IO (Maybe Widget)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Widget
result ((Ptr Widget -> IO Widget) -> IO (Maybe Widget))
-> (Ptr Widget -> IO Widget) -> IO (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
result' -> do
Widget
result'' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Widget -> Widget
Gtk.Widget.Widget) Ptr Widget
result'
Widget -> IO Widget
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Widget
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
Maybe Widget -> IO (Maybe Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Widget
maybeResult
#if defined(ENABLE_OVERLOADING)
data LayoutManagerGetWidgetMethodInfo
instance (signature ~ (m (Maybe Gtk.Widget.Widget)), MonadIO m, IsLayoutManager a) => O.OverloadedMethod LayoutManagerGetWidgetMethodInfo a signature where
overloadedMethod = layoutManagerGetWidget
instance O.OverloadedMethodInfo LayoutManagerGetWidgetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerGetWidget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerGetWidget"
})
#endif
foreign import ccall "gtk_layout_manager_layout_changed" gtk_layout_manager_layout_changed ::
Ptr LayoutManager ->
IO ()
layoutManagerLayoutChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a) =>
a
-> m ()
layoutManagerLayoutChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayoutManager a) =>
a -> m ()
layoutManagerLayoutChanged a
manager = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr LayoutManager -> IO ()
gtk_layout_manager_layout_changed Ptr LayoutManager
manager'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data LayoutManagerLayoutChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsLayoutManager a) => O.OverloadedMethod LayoutManagerLayoutChangedMethodInfo a signature where
overloadedMethod = layoutManagerLayoutChanged
instance O.OverloadedMethodInfo LayoutManagerLayoutChangedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerLayoutChanged",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerLayoutChanged"
})
#endif
foreign import ccall "gtk_layout_manager_measure" gtk_layout_manager_measure ::
Ptr LayoutManager ->
Ptr Gtk.Widget.Widget ->
CUInt ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
layoutManagerMeasure ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) =>
a
-> b
-> Gtk.Enums.Orientation
-> Int32
-> m ((Int32, Int32, Int32, Int32))
layoutManagerMeasure :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsLayoutManager a, IsWidget b) =>
a -> b -> Orientation -> Int32 -> m (Int32, Int32, Int32, Int32)
layoutManagerMeasure a
manager b
widget Orientation
orientation Int32
forSize = IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32))
-> IO (Int32, Int32, Int32, Int32)
-> m (Int32, Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutManager
manager' <- a -> IO (Ptr LayoutManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr Widget
widget' <- b -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
widget
let orientation' :: CUInt
orientation' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Orientation -> Int) -> Orientation -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Orientation -> Int
forall a. Enum a => a -> Int
fromEnum) Orientation
orientation
Ptr Int32
minimum <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
natural <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
minimumBaseline <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
naturalBaseline <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr LayoutManager
-> Ptr Widget
-> CUInt
-> Int32
-> Ptr Int32
-> Ptr Int32
-> Ptr Int32
-> Ptr Int32
-> IO ()
gtk_layout_manager_measure Ptr LayoutManager
manager' Ptr Widget
widget' CUInt
orientation' Int32
forSize Ptr Int32
minimum Ptr Int32
natural Ptr Int32
minimumBaseline Ptr Int32
naturalBaseline
Int32
minimum' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
minimum
Int32
natural' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
natural
Int32
minimumBaseline' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
minimumBaseline
Int32
naturalBaseline' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
naturalBaseline
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
widget
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
minimum
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
natural
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
minimumBaseline
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
naturalBaseline
(Int32, Int32, Int32, Int32) -> IO (Int32, Int32, Int32, Int32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
minimum', Int32
natural', Int32
minimumBaseline', Int32
naturalBaseline')
#if defined(ENABLE_OVERLOADING)
data LayoutManagerMeasureMethodInfo
instance (signature ~ (b -> Gtk.Enums.Orientation -> Int32 -> m ((Int32, Int32, Int32, Int32))), MonadIO m, IsLayoutManager a, Gtk.Widget.IsWidget b) => O.OverloadedMethod LayoutManagerMeasureMethodInfo a signature where
overloadedMethod = layoutManagerMeasure
instance O.OverloadedMethodInfo LayoutManagerMeasureMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.LayoutManager.layoutManagerMeasure",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-LayoutManager.html#v:layoutManagerMeasure"
})
#endif