-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

module GI.GtkLayerShell.Functions
    ( 

 -- * Methods


-- ** autoExclusiveZoneEnable #method:autoExclusiveZoneEnable#

    autoExclusiveZoneEnable                 ,


-- ** autoExclusiveZoneIsEnabled #method:autoExclusiveZoneIsEnabled#

    autoExclusiveZoneIsEnabled              ,


-- ** getAnchor #method:getAnchor#

    getAnchor                               ,


-- ** getExclusiveZone #method:getExclusiveZone#

    getExclusiveZone                        ,


-- ** getKeyboardInteractivity #method:getKeyboardInteractivity#

    getKeyboardInteractivity                ,


-- ** getKeyboardMode #method:getKeyboardMode#

    getKeyboardMode                         ,


-- ** getLayer #method:getLayer#

    getLayer                                ,


-- ** getMajorVersion #method:getMajorVersion#

    getMajorVersion                         ,


-- ** getMargin #method:getMargin#

    getMargin                               ,


-- ** getMicroVersion #method:getMicroVersion#

    getMicroVersion                         ,


-- ** getMinorVersion #method:getMinorVersion#

    getMinorVersion                         ,


-- ** getMonitor #method:getMonitor#

    getMonitor                              ,


-- ** getNamespace #method:getNamespace#

    getNamespace                            ,


-- ** getProtocolVersion #method:getProtocolVersion#

    getProtocolVersion                      ,


-- ** getZwlrLayerSurfaceV1 #method:getZwlrLayerSurfaceV1#

    getZwlrLayerSurfaceV1                   ,


-- ** initForWindow #method:initForWindow#

    initForWindow                           ,


-- ** isLayerWindow #method:isLayerWindow#

    isLayerWindow                           ,


-- ** isSupported #method:isSupported#

    isSupported                             ,


-- ** setAnchor #method:setAnchor#

    setAnchor                               ,


-- ** setExclusiveZone #method:setExclusiveZone#

    setExclusiveZone                        ,


-- ** setKeyboardInteractivity #method:setKeyboardInteractivity#

    setKeyboardInteractivity                ,


-- ** setKeyboardMode #method:setKeyboardMode#

    setKeyboardMode                         ,


-- ** setLayer #method:setLayer#

    setLayer                                ,


-- ** setMargin #method:setMargin#

    setMargin                               ,


-- ** setMonitor #method:setMonitor#

    setMonitor                              ,


-- ** setNamespace #method:setNamespace#

    setNamespace                            ,




    ) 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 GI.Gdk.Objects.Monitor as Gdk.Monitor
import qualified GI.Gtk.Objects.Window as Gtk.Window
import {-# SOURCE #-} qualified GI.GtkLayerShell.Enums as GtkLayerShell.Enums

-- function set_namespace
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name_space"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The namespace of this layer surface."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_namespace" gtk_layer_set_namespace :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CString ->                              -- name_space : TBasicType TUTF8
    IO ()

-- | Set the \"namespace\" of the surface.
-- 
-- No one is quite sure what this is for, but it probably should be something generic
-- (\"panel\", \"osk\", etc). The /@nameSpace@/ string is copied, and caller maintians
-- ownership of original. If the window is currently mapped, it will get remapped so
-- the change can take effect.
-- 
-- Default is \"gtk-layer-shell\" (which will be used if set to 'P.Nothing')
setNamespace ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> T.Text
    -- ^ /@nameSpace@/: The namespace of this layer surface.
    -> m ()
setNamespace :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Text -> m ()
setNamespace a
window Text
nameSpace = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CString
nameSpace' <- Text -> IO CString
textToCString Text
nameSpace
    Ptr Window -> CString -> IO ()
gtk_layer_set_namespace Ptr Window
window' CString
nameSpace'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
nameSpace'
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_monitor
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer 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 = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The output this layer surface will be placed on (%NULL to let the compositor decide)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_monitor" gtk_layer_set_monitor :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    Ptr Gdk.Monitor.Monitor ->              -- monitor : TInterface (Name {namespace = "Gdk", name = "Monitor"})
    IO ()

-- | Set the output for the window to be placed on, or 'P.Nothing' to let the compositor choose.
-- If the window is currently mapped, it will get remapped so the change can take effect.
-- 
-- Default is 'P.Nothing'
setMonitor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a, Gdk.Monitor.IsMonitor b) =>
    a
    -- ^ /@window@/: A layer surface.
    -> b
    -- ^ /@monitor@/: The output this layer surface will be placed on ('P.Nothing' to let the compositor decide).
    -> m ()
setMonitor :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsWindow a, IsMonitor b) =>
a -> b -> m ()
setMonitor a
window b
monitor = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr Monitor
monitor' <- b -> IO (Ptr Monitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
monitor
    Ptr Window -> Ptr Monitor -> IO ()
gtk_layer_set_monitor Ptr Window
window' Ptr Monitor
monitor'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
monitor
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_margin
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "GtkLayerShell" , name = "Edge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #GtkLayerShellEdge for which to set the margin."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "margin_size"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The margin for @edge to be set."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_margin" gtk_layer_set_margin :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "GtkLayerShell", name = "Edge"})
    Int32 ->                                -- margin_size : TBasicType TInt
    IO ()

-- | Set the margin for a specific /@edge@/ of a /@window@/. Effects both surface\'s distance from
-- the edge and its exclusive zone size (if auto exclusive zone enabled).
-- 
-- Default is 0 for each t'GI.GtkLayerShell.Enums.Edge'
setMargin ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.Edge
    -- ^ /@edge@/: The t'GI.GtkLayerShell.Enums.Edge' for which to set the margin.
    -> Int32
    -- ^ /@marginSize@/: The margin for /@edge@/ to be set.
    -> m ()
setMargin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Edge -> Int32 -> m ()
setMargin a
window Edge
edge Int32
marginSize = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Edge -> Int) -> Edge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Edge -> Int
forall a. Enum a => a -> Int
fromEnum) Edge
edge
    Ptr Window -> CUInt -> Int32 -> IO ()
gtk_layer_set_margin Ptr Window
window' CUInt
edge' Int32
marginSize
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_layer
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layer"
--           , argType =
--               TInterface Name { namespace = "GtkLayerShell" , name = "Layer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The layer on which this surface appears."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_layer" gtk_layer_set_layer :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- layer : TInterface (Name {namespace = "GtkLayerShell", name = "Layer"})
    IO ()

-- | Set the \"layer\" on which the surface appears (controls if it is over top of or below other surfaces). The layer may
-- be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an
-- older version the /@window@/ is remapped so the change can take effect.
-- 
-- Default is 'GI.GtkLayerShell.Enums.LayerTop'
setLayer ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.Layer
    -- ^ /@layer@/: The layer on which this surface appears.
    -> m ()
setLayer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Layer -> m ()
setLayer a
window Layer
layer = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let layer' :: CUInt
layer' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Layer -> Int) -> Layer -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Layer -> Int
forall a. Enum a => a -> Int
fromEnum) Layer
layer
    Ptr Window -> CUInt -> IO ()
gtk_layer_set_layer Ptr Window
window' CUInt
layer'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_keyboard_mode
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkLayerShell" , name = "KeyboardMode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The type of keyboard interactivity requested."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_keyboard_mode" gtk_layer_set_keyboard_mode :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "GtkLayerShell", name = "KeyboardMode"})
    IO ()

-- | Sets if\/when /@window@/ should receive keyboard events from the compositor, see
-- GtkLayerShellKeyboardMode for details.
-- 
-- Default is 'GI.GtkLayerShell.Enums.KeyboardModeNone'
-- 
-- /Since: 0.6/
setKeyboardMode ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.KeyboardMode
    -- ^ /@mode@/: The type of keyboard interactivity requested.
    -> m ()
setKeyboardMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> KeyboardMode -> m ()
setKeyboardMode a
window KeyboardMode
mode = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (KeyboardMode -> Int) -> KeyboardMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KeyboardMode -> Int
forall a. Enum a => a -> Int
fromEnum) KeyboardMode
mode
    Ptr Window -> CUInt -> IO ()
gtk_layer_set_keyboard_mode Ptr Window
window' CUInt
mode'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_keyboard_interactivity
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "interactivity"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Whether the layer surface should receive keyboard events."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_keyboard_interactivity" gtk_layer_set_keyboard_interactivity :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CInt ->                                 -- interactivity : TBasicType TBoolean
    IO ()

{-# DEPRECATED setKeyboardInteractivity ["(Since version 0.6)","Use gtk_layer_set_keyboard_mode () instead."] #-}
-- | Whether the /@window@/ should receive keyboard events from the compositor.
-- 
-- Default is 'P.False'
setKeyboardInteractivity ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> Bool
    -- ^ /@interactivity@/: Whether the layer surface should receive keyboard events.
    -> m ()
setKeyboardInteractivity :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Bool -> m ()
setKeyboardInteractivity a
window Bool
interactivity = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let interactivity' :: CInt
interactivity' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
interactivity
    Ptr Window -> CInt -> IO ()
gtk_layer_set_keyboard_interactivity Ptr Window
window' CInt
interactivity'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_exclusive_zone
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "exclusive_zone"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The size of the exclusive zone."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_exclusive_zone" gtk_layer_set_exclusive_zone :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    Int32 ->                                -- exclusive_zone : TBasicType TInt
    IO ()

-- | Has no effect unless the surface is anchored to an edge. Requests that the compositor
-- does not place other surfaces within the given exclusive zone of the anchored edge.
-- For example, a panel can request to not be covered by maximized windows. See
-- wlr-layer-shell-unstable-v1.xml for details.
-- 
-- Default is 0
setExclusiveZone ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> Int32
    -- ^ /@exclusiveZone@/: The size of the exclusive zone.
    -> m ()
setExclusiveZone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Int32 -> m ()
setExclusiveZone a
window Int32
exclusiveZone = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr Window -> Int32 -> IO ()
gtk_layer_set_exclusive_zone Ptr Window
window' Int32
exclusiveZone
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_anchor
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "GtkLayerShell" , name = "Edge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A #GtkLayerShellEdge this layer suface may be anchored to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "anchor_to_edge"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Whether or not to anchor this layer surface to @edge."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_set_anchor" gtk_layer_set_anchor :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "GtkLayerShell", name = "Edge"})
    CInt ->                                 -- anchor_to_edge : TBasicType TBoolean
    IO ()

-- | Set whether /@window@/ should be anchored to /@edge@/.
-- 
-- * If two perpendicular edges are anchored, the surface with be anchored to that corner
-- * If two opposite edges are anchored, the window will be stretched across the screen in that direction
-- 
-- 
-- Default is 'P.False' for each t'GI.GtkLayerShell.Enums.Edge'
setAnchor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.Edge
    -- ^ /@edge@/: A t'GI.GtkLayerShell.Enums.Edge' this layer suface may be anchored to.
    -> Bool
    -- ^ /@anchorToEdge@/: Whether or not to anchor this layer surface to /@edge@/.
    -> m ()
setAnchor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Edge -> Bool -> m ()
setAnchor a
window Edge
edge Bool
anchorToEdge = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Edge -> Int) -> Edge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Edge -> Int
forall a. Enum a => a -> Int
fromEnum) Edge
edge
    let anchorToEdge' :: CInt
anchorToEdge' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
anchorToEdge
    Ptr Window -> CUInt -> CInt -> IO ()
gtk_layer_set_anchor Ptr Window
window' CUInt
edge' CInt
anchorToEdge'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function is_supported
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_is_supported" gtk_layer_is_supported :: 
    IO CInt

-- | May block for a Wayland roundtrip the first time it\'s called.
-- 
-- /Since: 0.5/
isSupported ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    -- ^ __Returns:__ 'P.True' if the platform is Wayland and Wayland compositor supports the
    -- zwlr_layer_shell_v1 protocol.
isSupported :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Bool
isSupported  = IO Bool -> m Bool
forall a. IO a -> m a
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
    CInt
result <- IO CInt
gtk_layer_is_supported
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function is_layer_window
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A #GtkWindow that may or may not have a layer surface."
--                 , 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 "gtk_layer_is_layer_window" gtk_layer_is_layer_window :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CInt

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
isLayerWindow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A t'GI.Gtk.Objects.Window.Window' that may or may not have a layer surface.
    -> m Bool
    -- ^ __Returns:__ if /@window@/ has been initialized as a layer surface.
isLayerWindow :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Bool
isLayerWindow a
window = IO Bool -> m Bool
forall a. IO a -> m a
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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CInt
result <- Ptr Window -> IO CInt
gtk_layer_is_layer_window Ptr Window
window'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function init_for_window
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A #GtkWindow to be turned into a layer surface."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_init_for_window" gtk_layer_init_for_window :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO ()

-- | Set the /@window@/ up to be a layer surface once it is mapped. this must be called before
-- the /@window@/ is realized.
initForWindow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A t'GI.Gtk.Objects.Window.Window' to be turned into a layer surface.
    -> m ()
initForWindow :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m ()
initForWindow a
window = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr Window -> IO ()
gtk_layer_init_for_window Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function get_zwlr_layer_surface_v1
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_zwlr_layer_surface_v1" gtk_layer_get_zwlr_layer_surface_v1 :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO (Ptr ())

-- | /No description available in the introspection data./
-- 
-- /Since: 0.4/
getZwlrLayerSurfaceV1 ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m (Ptr ())
    -- ^ __Returns:__ The underlying layer surface Wayland object
getZwlrLayerSurfaceV1 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m (Ptr ())
getZwlrLayerSurfaceV1 a
window = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr ()
result <- Ptr Window -> IO (Ptr ())
gtk_layer_get_zwlr_layer_surface_v1 Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Ptr () -> IO (Ptr ())
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result


-- function get_protocol_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_protocol_version" gtk_layer_get_protocol_version :: 
    IO Word32

-- | May block for a Wayland roundtrip the first time it\'s called.
-- 
-- /Since: 0.6/
getProtocolVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ version of the zwlr_layer_shell_v1 protocol supported by the
    -- compositor or 0 if the protocol is not supported.
getProtocolVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getProtocolVersion  = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_layer_get_protocol_version
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_namespace
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_namespace" gtk_layer_get_namespace :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CString

-- | NOTE: this function does not return ownership of the string. Do not free the returned string.
-- Future calls into the library may invalidate the returned string.
-- 
-- /Since: 0.5/
getNamespace ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m T.Text
    -- ^ __Returns:__ a reference to the namespace property. If namespace is unset, returns the
    -- default namespace (\"gtk-layer-shell\"). Never returns 'P.Nothing'.
getNamespace :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Text
getNamespace a
window = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CString
result <- Ptr Window -> IO CString
gtk_layer_get_namespace Ptr Window
window'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getNamespace" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function get_monitor
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , 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 "gtk_layer_get_monitor" gtk_layer_get_monitor :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO (Ptr Gdk.Monitor.Monitor)

-- | NOTE: To get which monitor the surface is actually on, use
-- 'GI.Gdk.Objects.Display.displayGetMonitorAtWindow'.
-- 
-- /Since: 0.5/
getMonitor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m Gdk.Monitor.Monitor
    -- ^ __Returns:__ the monitor this surface will\/has requested to be on, can be 'P.Nothing'.
getMonitor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Monitor
getMonitor a
window = IO Monitor -> m Monitor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Monitor -> m Monitor) -> IO Monitor -> m Monitor
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr Monitor
result <- Ptr Window -> IO (Ptr Monitor)
gtk_layer_get_monitor Ptr Window
window'
    Text -> Ptr Monitor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getMonitor" Ptr Monitor
result
    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
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Monitor -> IO Monitor
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Monitor
result'


-- function get_minor_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_minor_version" gtk_layer_get_minor_version :: 
    IO Word32

-- | /No description available in the introspection data./
-- 
-- /Since: 0.4/
getMinorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the minor version number of the GTK Layer Shell library
getMinorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMinorVersion  = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_layer_get_minor_version
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_micro_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_micro_version" gtk_layer_get_micro_version :: 
    IO Word32

-- | /No description available in the introspection data./
-- 
-- /Since: 0.4/
getMicroVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the micro\/patch version number of the GTK Layer Shell library
getMicroVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMicroVersion  = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_layer_get_micro_version
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_margin
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "GtkLayerShell" , name = "Edge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_margin" gtk_layer_get_margin :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "GtkLayerShell", name = "Edge"})
    IO Int32

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
getMargin ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.Edge
    -> m Int32
    -- ^ __Returns:__ the size of the margin for the given edge.
getMargin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Edge -> m Int32
getMargin a
window Edge
edge = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Edge -> Int) -> Edge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Edge -> Int
forall a. Enum a => a -> Int
fromEnum) Edge
edge
    Int32
result <- Ptr Window -> CUInt -> IO Int32
gtk_layer_get_margin Ptr Window
window' CUInt
edge'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function get_major_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_major_version" gtk_layer_get_major_version :: 
    IO Word32

-- | /No description available in the introspection data./
-- 
-- /Since: 0.4/
getMajorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the major version number of the GTK Layer Shell library
getMajorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMajorVersion  = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_layer_get_major_version
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_layer
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GtkLayerShell" , name = "Layer" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_layer" gtk_layer_get_layer :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CUInt

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
getLayer ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m GtkLayerShell.Enums.Layer
    -- ^ __Returns:__ the current layer.
getLayer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Layer
getLayer a
window = IO Layer -> m Layer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Layer -> m Layer) -> IO Layer -> m Layer
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CUInt
result <- Ptr Window -> IO CUInt
gtk_layer_get_layer Ptr Window
window'
    let result' :: Layer
result' = (Int -> Layer
forall a. Enum a => Int -> a
toEnum (Int -> Layer) -> (CUInt -> Int) -> CUInt -> Layer
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
window
    Layer -> IO Layer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Layer
result'


-- function get_keyboard_mode
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GtkLayerShell" , name = "KeyboardMode" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_keyboard_mode" gtk_layer_get_keyboard_mode :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CUInt

-- | /No description available in the introspection data./
-- 
-- /Since: 0.6/
getKeyboardMode ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m GtkLayerShell.Enums.KeyboardMode
    -- ^ __Returns:__ current keyboard interactivity mode for /@window@/.
getKeyboardMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m KeyboardMode
getKeyboardMode a
window = IO KeyboardMode -> m KeyboardMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyboardMode -> m KeyboardMode)
-> IO KeyboardMode -> m KeyboardMode
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CUInt
result <- Ptr Window -> IO CUInt
gtk_layer_get_keyboard_mode Ptr Window
window'
    let result' :: KeyboardMode
result' = (Int -> KeyboardMode
forall a. Enum a => Int -> a
toEnum (Int -> KeyboardMode) -> (CUInt -> Int) -> CUInt -> KeyboardMode
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
window
    KeyboardMode -> IO KeyboardMode
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return KeyboardMode
result'


-- function get_keyboard_interactivity
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , 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 "gtk_layer_get_keyboard_interactivity" gtk_layer_get_keyboard_interactivity :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CInt

{-# DEPRECATED getKeyboardInteractivity ["(Since version 0.6)","Use gtk_layer_get_keyboard_mode () instead."] #-}
-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
getKeyboardInteractivity ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m Bool
    -- ^ __Returns:__ if keybaord interactivity is enabled
getKeyboardInteractivity :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Bool
getKeyboardInteractivity a
window = IO Bool -> m Bool
forall a. IO a -> m a
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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CInt
result <- Ptr Window -> IO CInt
gtk_layer_get_keyboard_interactivity Ptr Window
window'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function get_exclusive_zone
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_get_exclusive_zone" gtk_layer_get_exclusive_zone :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO Int32

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
getExclusiveZone ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m Int32
    -- ^ __Returns:__ the window\'s exclusive zone (which may have been set manually or automatically)
getExclusiveZone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Int32
getExclusiveZone a
window = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Int32
result <- Ptr Window -> IO Int32
gtk_layer_get_exclusive_zone Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function get_anchor
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "GtkLayerShell" , name = "Edge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 "gtk_layer_get_anchor" gtk_layer_get_anchor :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "GtkLayerShell", name = "Edge"})
    IO CInt

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
getAnchor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> GtkLayerShell.Enums.Edge
    -> m Bool
    -- ^ __Returns:__ if this surface is anchored to the given edge.
getAnchor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> Edge -> m Bool
getAnchor a
window Edge
edge = IO Bool -> m Bool
forall a. IO a -> m a
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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Edge -> Int) -> Edge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Edge -> Int
forall a. Enum a => a -> Int
fromEnum) Edge
edge
    CInt
result <- Ptr Window -> CUInt -> IO CInt
gtk_layer_get_anchor Ptr Window
window' CUInt
edge'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function auto_exclusive_zone_is_enabled
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , 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 "gtk_layer_auto_exclusive_zone_is_enabled" gtk_layer_auto_exclusive_zone_is_enabled :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO CInt

-- | /No description available in the introspection data./
-- 
-- /Since: 0.5/
autoExclusiveZoneIsEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m Bool
    -- ^ __Returns:__ if the surface\'s exclusive zone is set to change based on the window\'s size
autoExclusiveZoneIsEnabled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m Bool
autoExclusiveZoneIsEnabled a
window = IO Bool -> m Bool
forall a. IO a -> m a
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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    CInt
result <- Ptr Window -> IO CInt
gtk_layer_auto_exclusive_zone_is_enabled Ptr Window
window'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function auto_exclusive_zone_enable
-- Args: [ Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A layer surface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_layer_auto_exclusive_zone_enable" gtk_layer_auto_exclusive_zone_enable :: 
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO ()

-- | When auto exclusive zone is enabled, exclusive zone is automatically set to the
-- size of the /@window@/ + relevant margin. To disable auto exclusive zone, just set the
-- exclusive zone to 0 or any other fixed value.
-- 
-- NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored
-- edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol
autoExclusiveZoneEnable ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    a
    -- ^ /@window@/: A layer surface.
    -> m ()
autoExclusiveZoneEnable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWindow a) =>
a -> m ()
autoExclusiveZoneEnable a
window = 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 Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
    Ptr Window -> IO ()
gtk_layer_auto_exclusive_zone_enable Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()