{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Toplevel surfaces are sovereign windows that can be presented
-- to the user in various states (maximized, on all workspaces,
-- etc).
-- 
-- The GdkToplevelLayout struct contains information that
-- is necessary to do so, and is passed to 'GI.Gdk.Interfaces.Toplevel.toplevelPresent'.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gdk.Structs.ToplevelLayout
    ( 

-- * Exported types
    ToplevelLayout(..)                      ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [copy]("GI.Gdk.Structs.ToplevelLayout#g:method:copy"), [equal]("GI.Gdk.Structs.ToplevelLayout#g:method:equal"), [ref]("GI.Gdk.Structs.ToplevelLayout#g:method:ref"), [unref]("GI.Gdk.Structs.ToplevelLayout#g:method:unref").
-- 
-- ==== Getters
-- [getFullscreen]("GI.Gdk.Structs.ToplevelLayout#g:method:getFullscreen"), [getFullscreenMonitor]("GI.Gdk.Structs.ToplevelLayout#g:method:getFullscreenMonitor"), [getMaximized]("GI.Gdk.Structs.ToplevelLayout#g:method:getMaximized"), [getResizable]("GI.Gdk.Structs.ToplevelLayout#g:method:getResizable").
-- 
-- ==== Setters
-- [setFullscreen]("GI.Gdk.Structs.ToplevelLayout#g:method:setFullscreen"), [setMaximized]("GI.Gdk.Structs.ToplevelLayout#g:method:setMaximized"), [setResizable]("GI.Gdk.Structs.ToplevelLayout#g:method:setResizable").

#if defined(ENABLE_OVERLOADING)
    ResolveToplevelLayoutMethod             ,
#endif

-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutCopyMethodInfo            ,
#endif
    toplevelLayoutCopy                      ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutEqualMethodInfo           ,
#endif
    toplevelLayoutEqual                     ,


-- ** getFullscreen #method:getFullscreen#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutGetFullscreenMethodInfo   ,
#endif
    toplevelLayoutGetFullscreen             ,


-- ** getFullscreenMonitor #method:getFullscreenMonitor#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutGetFullscreenMonitorMethodInfo,
#endif
    toplevelLayoutGetFullscreenMonitor      ,


-- ** getMaximized #method:getMaximized#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutGetMaximizedMethodInfo    ,
#endif
    toplevelLayoutGetMaximized              ,


-- ** getResizable #method:getResizable#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutGetResizableMethodInfo    ,
#endif
    toplevelLayoutGetResizable              ,


-- ** new #method:new#

    toplevelLayoutNew                       ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutRefMethodInfo             ,
#endif
    toplevelLayoutRef                       ,


-- ** setFullscreen #method:setFullscreen#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutSetFullscreenMethodInfo   ,
#endif
    toplevelLayoutSetFullscreen             ,


-- ** setMaximized #method:setMaximized#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutSetMaximizedMethodInfo    ,
#endif
    toplevelLayoutSetMaximized              ,


-- ** setResizable #method:setResizable#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutSetResizableMethodInfo    ,
#endif
    toplevelLayoutSetResizable              ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    ToplevelLayoutUnrefMethodInfo           ,
#endif
    toplevelLayoutUnref                     ,




    ) 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.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.Text as T
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 {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor

-- | Memory-managed wrapper type.
newtype ToplevelLayout = ToplevelLayout (SP.ManagedPtr ToplevelLayout)
    deriving (ToplevelLayout -> ToplevelLayout -> Bool
(ToplevelLayout -> ToplevelLayout -> Bool)
-> (ToplevelLayout -> ToplevelLayout -> Bool) -> Eq ToplevelLayout
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ToplevelLayout -> ToplevelLayout -> Bool
$c/= :: ToplevelLayout -> ToplevelLayout -> Bool
== :: ToplevelLayout -> ToplevelLayout -> Bool
$c== :: ToplevelLayout -> ToplevelLayout -> Bool
Eq)

instance SP.ManagedPtrNewtype ToplevelLayout where
    toManagedPtr :: ToplevelLayout -> ManagedPtr ToplevelLayout
toManagedPtr (ToplevelLayout ManagedPtr ToplevelLayout
p) = ManagedPtr ToplevelLayout
p

foreign import ccall "gdk_toplevel_layout_get_type" c_gdk_toplevel_layout_get_type :: 
    IO GType

type instance O.ParentTypes ToplevelLayout = '[]
instance O.HasParentTypes ToplevelLayout

instance B.Types.TypedObject ToplevelLayout where
    glibType :: IO GType
glibType = IO GType
c_gdk_toplevel_layout_get_type

instance B.Types.GBoxed ToplevelLayout

-- | Convert 'ToplevelLayout' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe ToplevelLayout) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_toplevel_layout_get_type
    gvalueSet_ :: Ptr GValue -> Maybe ToplevelLayout -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ToplevelLayout
P.Nothing = Ptr GValue -> Ptr ToplevelLayout -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr ToplevelLayout
forall a. Ptr a
FP.nullPtr :: FP.Ptr ToplevelLayout)
    gvalueSet_ Ptr GValue
gv (P.Just ToplevelLayout
obj) = ToplevelLayout -> (Ptr ToplevelLayout -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ToplevelLayout
obj (Ptr GValue -> Ptr ToplevelLayout -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe ToplevelLayout)
gvalueGet_ Ptr GValue
gv = do
        Ptr ToplevelLayout
ptr <- Ptr GValue -> IO (Ptr ToplevelLayout)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr ToplevelLayout)
        if Ptr ToplevelLayout
ptr Ptr ToplevelLayout -> Ptr ToplevelLayout -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ToplevelLayout
forall a. Ptr a
FP.nullPtr
        then ToplevelLayout -> Maybe ToplevelLayout
forall a. a -> Maybe a
P.Just (ToplevelLayout -> Maybe ToplevelLayout)
-> IO ToplevelLayout -> IO (Maybe ToplevelLayout)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ToplevelLayout -> ToplevelLayout)
-> Ptr ToplevelLayout -> IO ToplevelLayout
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr ToplevelLayout -> ToplevelLayout
ToplevelLayout Ptr ToplevelLayout
ptr
        else Maybe ToplevelLayout -> IO (Maybe ToplevelLayout)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ToplevelLayout
forall a. Maybe a
P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ToplevelLayout
type instance O.AttributeList ToplevelLayout = ToplevelLayoutAttributeList
type ToplevelLayoutAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method ToplevelLayout::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_new" gdk_toplevel_layout_new :: 
    IO (Ptr ToplevelLayout)

-- | Create a toplevel layout description.
-- 
-- Used together with 'GI.Gdk.Interfaces.Toplevel.toplevelPresent' to describe
-- how a toplevel surface should be placed and behave on-screen.
-- 
-- The size is in ”application pixels”, not
-- ”device pixels” (see 'GI.Gdk.Objects.Surface.surfaceGetScaleFactor').
toplevelLayoutNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ToplevelLayout
    -- ^ __Returns:__ newly created instance of t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
toplevelLayoutNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ToplevelLayout
toplevelLayoutNew  = IO ToplevelLayout -> m ToplevelLayout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToplevelLayout -> m ToplevelLayout)
-> IO ToplevelLayout -> m ToplevelLayout
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
result <- IO (Ptr ToplevelLayout)
gdk_toplevel_layout_new
    Text -> Ptr ToplevelLayout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"toplevelLayoutNew" Ptr ToplevelLayout
result
    ToplevelLayout
result' <- ((ManagedPtr ToplevelLayout -> ToplevelLayout)
-> Ptr ToplevelLayout -> IO ToplevelLayout
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ToplevelLayout -> ToplevelLayout
ToplevelLayout) Ptr ToplevelLayout
result
    ToplevelLayout -> IO ToplevelLayout
forall (m :: * -> *) a. Monad m => a -> m a
return ToplevelLayout
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method ToplevelLayout::copy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_copy" gdk_toplevel_layout_copy :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO (Ptr ToplevelLayout)

-- | Create a new t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout' and copy the contents of /@layout@/ into it.
toplevelLayoutCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m ToplevelLayout
    -- ^ __Returns:__ a copy of /@layout@/.
toplevelLayoutCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m ToplevelLayout
toplevelLayoutCopy ToplevelLayout
layout = IO ToplevelLayout -> m ToplevelLayout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToplevelLayout -> m ToplevelLayout)
-> IO ToplevelLayout -> m ToplevelLayout
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr ToplevelLayout
result <- Ptr ToplevelLayout -> IO (Ptr ToplevelLayout)
gdk_toplevel_layout_copy Ptr ToplevelLayout
layout'
    Text -> Ptr ToplevelLayout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"toplevelLayoutCopy" Ptr ToplevelLayout
result
    ToplevelLayout
result' <- ((ManagedPtr ToplevelLayout -> ToplevelLayout)
-> Ptr ToplevelLayout -> IO ToplevelLayout
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ToplevelLayout -> ToplevelLayout
ToplevelLayout) Ptr ToplevelLayout
result
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    ToplevelLayout -> IO ToplevelLayout
forall (m :: * -> *) a. Monad m => a -> m a
return ToplevelLayout
result'

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutCopyMethodInfo
instance (signature ~ (m ToplevelLayout), MonadIO m) => O.OverloadedMethod ToplevelLayoutCopyMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutCopy

instance O.OverloadedMethodInfo ToplevelLayoutCopyMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutCopy",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutCopy"
        }


#endif

-- method ToplevelLayout::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "another #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_equal" gdk_toplevel_layout_equal :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    Ptr ToplevelLayout ->                   -- other : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO CInt

-- | Check whether /@layout@/ and /@other@/ has identical layout properties.
toplevelLayoutEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> ToplevelLayout
    -- ^ /@other@/: another t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@layout@/ and /@other@/ have identical layout properties,
    --     otherwise 'P.False'.
toplevelLayoutEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> ToplevelLayout -> m Bool
toplevelLayoutEqual ToplevelLayout
layout ToplevelLayout
other = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr ToplevelLayout
other' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
other
    CInt
result <- Ptr ToplevelLayout -> Ptr ToplevelLayout -> IO CInt
gdk_toplevel_layout_equal Ptr ToplevelLayout
layout' Ptr ToplevelLayout
other'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
other
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutEqualMethodInfo
instance (signature ~ (ToplevelLayout -> m Bool), MonadIO m) => O.OverloadedMethod ToplevelLayoutEqualMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutEqual

instance O.OverloadedMethodInfo ToplevelLayoutEqualMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutEqual",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutEqual"
        }


#endif

-- method ToplevelLayout::get_fullscreen
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "fullscreen"
--           , argType = TBasicType TBoolean
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "location to store whether the toplevel should be fullscreen"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_get_fullscreen" gdk_toplevel_layout_get_fullscreen :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    Ptr CInt ->                             -- fullscreen : TBasicType TBoolean
    IO CInt

-- | If the layout specifies whether to the toplevel should go fullscreen,
-- the value pointed to by /@fullscreen@/ is set to 'P.True' if it should go
-- fullscreen, or 'P.False', if it should go unfullscreen.
toplevelLayoutGetFullscreen ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m ((Bool, Bool))
    -- ^ __Returns:__ whether the /@layout@/ specifies the fullscreen state for the toplevel
toplevelLayoutGetFullscreen :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m (Bool, Bool)
toplevelLayoutGetFullscreen ToplevelLayout
layout = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr CInt
fullscreen <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    CInt
result <- Ptr ToplevelLayout -> Ptr CInt -> IO CInt
gdk_toplevel_layout_get_fullscreen Ptr ToplevelLayout
layout' Ptr CInt
fullscreen
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CInt
fullscreen' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
fullscreen
    let fullscreen'' :: Bool
fullscreen'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
fullscreen'
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
fullscreen
    (Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
fullscreen'')

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutGetFullscreenMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m) => O.OverloadedMethod ToplevelLayoutGetFullscreenMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutGetFullscreen

instance O.OverloadedMethodInfo ToplevelLayoutGetFullscreenMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutGetFullscreen",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutGetFullscreen"
        }


#endif

-- method ToplevelLayout::get_fullscreen_monitor
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Monitor" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_get_fullscreen_monitor" gdk_toplevel_layout_get_fullscreen_monitor :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO (Ptr Gdk.Monitor.Monitor)

-- | Returns the monitor that the layout is fullscreening
-- the surface on.
toplevelLayoutGetFullscreenMonitor ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m (Maybe Gdk.Monitor.Monitor)
    -- ^ __Returns:__ the monitor on which /@layout@/ fullscreens
toplevelLayoutGetFullscreenMonitor :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m (Maybe Monitor)
toplevelLayoutGetFullscreenMonitor ToplevelLayout
layout = IO (Maybe Monitor) -> m (Maybe Monitor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Monitor) -> m (Maybe Monitor))
-> IO (Maybe Monitor) -> m (Maybe Monitor)
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr Monitor
result <- Ptr ToplevelLayout -> IO (Ptr Monitor)
gdk_toplevel_layout_get_fullscreen_monitor Ptr ToplevelLayout
layout'
    Maybe Monitor
maybeResult <- Ptr Monitor -> (Ptr Monitor -> IO Monitor) -> IO (Maybe Monitor)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Monitor
result ((Ptr Monitor -> IO Monitor) -> IO (Maybe Monitor))
-> (Ptr Monitor -> IO Monitor) -> IO (Maybe Monitor)
forall a b. (a -> b) -> a -> b
$ \Ptr Monitor
result' -> do
        Monitor
result'' <- ((ManagedPtr Monitor -> Monitor) -> Ptr Monitor -> IO Monitor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Monitor -> Monitor
Gdk.Monitor.Monitor) Ptr Monitor
result'
        Monitor -> IO Monitor
forall (m :: * -> *) a. Monad m => a -> m a
return Monitor
result''
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    Maybe Monitor -> IO (Maybe Monitor)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Monitor
maybeResult

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutGetFullscreenMonitorMethodInfo
instance (signature ~ (m (Maybe Gdk.Monitor.Monitor)), MonadIO m) => O.OverloadedMethod ToplevelLayoutGetFullscreenMonitorMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutGetFullscreenMonitor

instance O.OverloadedMethodInfo ToplevelLayoutGetFullscreenMonitorMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutGetFullscreenMonitor",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutGetFullscreenMonitor"
        }


#endif

-- method ToplevelLayout::get_maximized
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "maximized"
--           , argType = TBasicType TBoolean
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "set to %TRUE if the toplevel should be maximized"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_get_maximized" gdk_toplevel_layout_get_maximized :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    Ptr CInt ->                             -- maximized : TBasicType TBoolean
    IO CInt

-- | If the layout specifies whether to the toplevel should go maximized,
-- the value pointed to by /@maximized@/ is set to 'P.True' if it should go
-- fullscreen, or 'P.False', if it should go unmaximized.
toplevelLayoutGetMaximized ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m ((Bool, Bool))
    -- ^ __Returns:__ whether the /@layout@/ specifies the maximized state for the toplevel
toplevelLayoutGetMaximized :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m (Bool, Bool)
toplevelLayoutGetMaximized ToplevelLayout
layout = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr CInt
maximized <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    CInt
result <- Ptr ToplevelLayout -> Ptr CInt -> IO CInt
gdk_toplevel_layout_get_maximized Ptr ToplevelLayout
layout' Ptr CInt
maximized
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CInt
maximized' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
maximized
    let maximized'' :: Bool
maximized'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
maximized'
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
maximized
    (Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
maximized'')

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutGetMaximizedMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m) => O.OverloadedMethod ToplevelLayoutGetMaximizedMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutGetMaximized

instance O.OverloadedMethodInfo ToplevelLayoutGetMaximizedMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutGetMaximized",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutGetMaximized"
        }


#endif

-- method ToplevelLayout::get_resizable
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_get_resizable" gdk_toplevel_layout_get_resizable :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO CInt

-- | Returns whether the layout should allow the user
-- to resize the surface.
toplevelLayoutGetResizable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the layout is resizable
toplevelLayoutGetResizable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m Bool
toplevelLayoutGetResizable ToplevelLayout
layout = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    CInt
result <- Ptr ToplevelLayout -> IO CInt
gdk_toplevel_layout_get_resizable Ptr ToplevelLayout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutGetResizableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod ToplevelLayoutGetResizableMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutGetResizable

instance O.OverloadedMethodInfo ToplevelLayoutGetResizableMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutGetResizable",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutGetResizable"
        }


#endif

-- method ToplevelLayout::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_ref" gdk_toplevel_layout_ref :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO (Ptr ToplevelLayout)

-- | Increases the reference count of /@layout@/.
toplevelLayoutRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m ToplevelLayout
    -- ^ __Returns:__ the same /@layout@/
toplevelLayoutRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m ToplevelLayout
toplevelLayoutRef ToplevelLayout
layout = IO ToplevelLayout -> m ToplevelLayout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToplevelLayout -> m ToplevelLayout)
-> IO ToplevelLayout -> m ToplevelLayout
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr ToplevelLayout
result <- Ptr ToplevelLayout -> IO (Ptr ToplevelLayout)
gdk_toplevel_layout_ref Ptr ToplevelLayout
layout'
    Text -> Ptr ToplevelLayout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"toplevelLayoutRef" Ptr ToplevelLayout
result
    ToplevelLayout
result' <- ((ManagedPtr ToplevelLayout -> ToplevelLayout)
-> Ptr ToplevelLayout -> IO ToplevelLayout
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ToplevelLayout -> ToplevelLayout
ToplevelLayout) Ptr ToplevelLayout
result
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    ToplevelLayout -> IO ToplevelLayout
forall (m :: * -> *) a. Monad m => a -> m a
return ToplevelLayout
result'

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutRefMethodInfo
instance (signature ~ (m ToplevelLayout), MonadIO m) => O.OverloadedMethod ToplevelLayoutRefMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutRef

instance O.OverloadedMethodInfo ToplevelLayoutRefMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutRef",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutRef"
        }


#endif

-- method ToplevelLayout::set_fullscreen
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "fullscreen"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE to fullscreen the surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "monitor"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Monitor" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the monitor to fullscreen on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_set_fullscreen" gdk_toplevel_layout_set_fullscreen :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    CInt ->                                 -- fullscreen : TBasicType TBoolean
    Ptr Gdk.Monitor.Monitor ->              -- monitor : TInterface (Name {namespace = "Gdk", name = "Monitor"})
    IO ()

-- | Sets whether the layout should cause the surface
-- to be fullscreen when presented.
toplevelLayoutSetFullscreen ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Monitor.IsMonitor a) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> Bool
    -- ^ /@fullscreen@/: 'P.True' to fullscreen the surface
    -> Maybe (a)
    -- ^ /@monitor@/: the monitor to fullscreen on
    -> m ()
toplevelLayoutSetFullscreen :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMonitor a) =>
ToplevelLayout -> Bool -> Maybe a -> m ()
toplevelLayoutSetFullscreen ToplevelLayout
layout Bool
fullscreen Maybe a
monitor = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    let fullscreen' :: CInt
fullscreen' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
fullscreen
    Ptr Monitor
maybeMonitor <- case Maybe a
monitor of
        Maybe a
Nothing -> Ptr Monitor -> IO (Ptr Monitor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Monitor
forall a. Ptr a
nullPtr
        Just a
jMonitor -> do
            Ptr Monitor
jMonitor' <- a -> IO (Ptr Monitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jMonitor
            Ptr Monitor -> IO (Ptr Monitor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Monitor
jMonitor'
    Ptr ToplevelLayout -> CInt -> Ptr Monitor -> IO ()
gdk_toplevel_layout_set_fullscreen Ptr ToplevelLayout
layout' CInt
fullscreen' Ptr Monitor
maybeMonitor
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
monitor a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutSetFullscreenMethodInfo
instance (signature ~ (Bool -> Maybe (a) -> m ()), MonadIO m, Gdk.Monitor.IsMonitor a) => O.OverloadedMethod ToplevelLayoutSetFullscreenMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutSetFullscreen

instance O.OverloadedMethodInfo ToplevelLayoutSetFullscreenMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutSetFullscreen",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutSetFullscreen"
        }


#endif

-- method ToplevelLayout::set_maximized
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "maximized"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE to maximize" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_set_maximized" gdk_toplevel_layout_set_maximized :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    CInt ->                                 -- maximized : TBasicType TBoolean
    IO ()

-- | Sets whether the layout should cause the surface
-- to be maximized when presented.
toplevelLayoutSetMaximized ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> Bool
    -- ^ /@maximized@/: 'P.True' to maximize
    -> m ()
toplevelLayoutSetMaximized :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> Bool -> m ()
toplevelLayoutSetMaximized ToplevelLayout
layout Bool
maximized = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    let maximized' :: CInt
maximized' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
maximized
    Ptr ToplevelLayout -> CInt -> IO ()
gdk_toplevel_layout_set_maximized Ptr ToplevelLayout
layout' CInt
maximized'
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutSetMaximizedMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod ToplevelLayoutSetMaximizedMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutSetMaximized

instance O.OverloadedMethodInfo ToplevelLayoutSetMaximizedMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutSetMaximized",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutSetMaximized"
        }


#endif

-- method ToplevelLayout::set_resizable
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "resizable"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE to allow resizing"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_set_resizable" gdk_toplevel_layout_set_resizable :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    CInt ->                                 -- resizable : TBasicType TBoolean
    IO ()

-- | Sets whether the layout should allow the user
-- to resize the surface after it has been presented.
toplevelLayoutSetResizable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> Bool
    -- ^ /@resizable@/: 'P.True' to allow resizing
    -> m ()
toplevelLayoutSetResizable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> Bool -> m ()
toplevelLayoutSetResizable ToplevelLayout
layout Bool
resizable = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    let resizable' :: CInt
resizable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
resizable
    Ptr ToplevelLayout -> CInt -> IO ()
gdk_toplevel_layout_set_resizable Ptr ToplevelLayout
layout' CInt
resizable'
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutSetResizableMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod ToplevelLayoutSetResizableMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutSetResizable

instance O.OverloadedMethodInfo ToplevelLayoutSetResizableMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutSetResizable",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutSetResizable"
        }


#endif

-- method ToplevelLayout::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ToplevelLayout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkToplevelLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_toplevel_layout_unref" gdk_toplevel_layout_unref :: 
    Ptr ToplevelLayout ->                   -- layout : TInterface (Name {namespace = "Gdk", name = "ToplevelLayout"})
    IO ()

-- | Decreases the reference count of /@layout@/.
toplevelLayoutUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ToplevelLayout
    -- ^ /@layout@/: a t'GI.Gdk.Structs.ToplevelLayout.ToplevelLayout'
    -> m ()
toplevelLayoutUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ToplevelLayout -> m ()
toplevelLayoutUnref ToplevelLayout
layout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToplevelLayout
layout' <- ToplevelLayout -> IO (Ptr ToplevelLayout)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ToplevelLayout
layout
    Ptr ToplevelLayout -> IO ()
gdk_toplevel_layout_unref Ptr ToplevelLayout
layout'
    ToplevelLayout -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ToplevelLayout
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToplevelLayoutUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ToplevelLayoutUnrefMethodInfo ToplevelLayout signature where
    overloadedMethod = toplevelLayoutUnref

instance O.OverloadedMethodInfo ToplevelLayoutUnrefMethodInfo ToplevelLayout where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gdk.Structs.ToplevelLayout.toplevelLayoutUnref",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gdk-4.0.3/docs/GI-Gdk-Structs-ToplevelLayout.html#v:toplevelLayoutUnref"
        }


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveToplevelLayoutMethod (t :: Symbol) (o :: *) :: * where
    ResolveToplevelLayoutMethod "copy" o = ToplevelLayoutCopyMethodInfo
    ResolveToplevelLayoutMethod "equal" o = ToplevelLayoutEqualMethodInfo
    ResolveToplevelLayoutMethod "ref" o = ToplevelLayoutRefMethodInfo
    ResolveToplevelLayoutMethod "unref" o = ToplevelLayoutUnrefMethodInfo
    ResolveToplevelLayoutMethod "getFullscreen" o = ToplevelLayoutGetFullscreenMethodInfo
    ResolveToplevelLayoutMethod "getFullscreenMonitor" o = ToplevelLayoutGetFullscreenMonitorMethodInfo
    ResolveToplevelLayoutMethod "getMaximized" o = ToplevelLayoutGetMaximizedMethodInfo
    ResolveToplevelLayoutMethod "getResizable" o = ToplevelLayoutGetResizableMethodInfo
    ResolveToplevelLayoutMethod "setFullscreen" o = ToplevelLayoutSetFullscreenMethodInfo
    ResolveToplevelLayoutMethod "setMaximized" o = ToplevelLayoutSetMaximizedMethodInfo
    ResolveToplevelLayoutMethod "setResizable" o = ToplevelLayoutSetResizableMethodInfo
    ResolveToplevelLayoutMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveToplevelLayoutMethod t ToplevelLayout, O.OverloadedMethod info ToplevelLayout p) => OL.IsLabel t (ToplevelLayout -> 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 ~ ResolveToplevelLayoutMethod t ToplevelLayout, O.OverloadedMethod info ToplevelLayout p, R.HasField t ToplevelLayout p) => R.HasField t ToplevelLayout p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveToplevelLayoutMethod t ToplevelLayout, O.OverloadedMethodInfo info ToplevelLayout) => OL.IsLabel t (O.MethodProxy info ToplevelLayout) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif