{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

'GI.Atk.Interfaces.Window.Window' should be implemented by the UI elements that represent
a top-level window, such as the main window of an application or
dialog.
-}

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

module GI.Atk.Interfaces.Window
    (

-- * Exported types
    Window(..)                              ,
    noWindow                                ,
    IsWindow                                ,
    toWindow                                ,


 -- * Signals
-- ** activate #signal:activate#

    C_WindowActivateCallback                ,
    WindowActivateCallback                  ,
#if ENABLE_OVERLOADING
    WindowActivateSignalInfo                ,
#endif
    afterWindowActivate                     ,
    genClosure_WindowActivate               ,
    mk_WindowActivateCallback               ,
    noWindowActivateCallback                ,
    onWindowActivate                        ,
    wrap_WindowActivateCallback             ,


-- ** create #signal:create#

    C_WindowCreateCallback                  ,
    WindowCreateCallback                    ,
#if ENABLE_OVERLOADING
    WindowCreateSignalInfo                  ,
#endif
    afterWindowCreate                       ,
    genClosure_WindowCreate                 ,
    mk_WindowCreateCallback                 ,
    noWindowCreateCallback                  ,
    onWindowCreate                          ,
    wrap_WindowCreateCallback               ,


-- ** deactivate #signal:deactivate#

    C_WindowDeactivateCallback              ,
    WindowDeactivateCallback                ,
#if ENABLE_OVERLOADING
    WindowDeactivateSignalInfo              ,
#endif
    afterWindowDeactivate                   ,
    genClosure_WindowDeactivate             ,
    mk_WindowDeactivateCallback             ,
    noWindowDeactivateCallback              ,
    onWindowDeactivate                      ,
    wrap_WindowDeactivateCallback           ,


-- ** destroy #signal:destroy#

    C_WindowDestroyCallback                 ,
    WindowDestroyCallback                   ,
#if ENABLE_OVERLOADING
    WindowDestroySignalInfo                 ,
#endif
    afterWindowDestroy                      ,
    genClosure_WindowDestroy                ,
    mk_WindowDestroyCallback                ,
    noWindowDestroyCallback                 ,
    onWindowDestroy                         ,
    wrap_WindowDestroyCallback              ,


-- ** maximize #signal:maximize#

    C_WindowMaximizeCallback                ,
    WindowMaximizeCallback                  ,
#if ENABLE_OVERLOADING
    WindowMaximizeSignalInfo                ,
#endif
    afterWindowMaximize                     ,
    genClosure_WindowMaximize               ,
    mk_WindowMaximizeCallback               ,
    noWindowMaximizeCallback                ,
    onWindowMaximize                        ,
    wrap_WindowMaximizeCallback             ,


-- ** minimize #signal:minimize#

    C_WindowMinimizeCallback                ,
    WindowMinimizeCallback                  ,
#if ENABLE_OVERLOADING
    WindowMinimizeSignalInfo                ,
#endif
    afterWindowMinimize                     ,
    genClosure_WindowMinimize               ,
    mk_WindowMinimizeCallback               ,
    noWindowMinimizeCallback                ,
    onWindowMinimize                        ,
    wrap_WindowMinimizeCallback             ,


-- ** move #signal:move#

    C_WindowMoveCallback                    ,
    WindowMoveCallback                      ,
#if ENABLE_OVERLOADING
    WindowMoveSignalInfo                    ,
#endif
    afterWindowMove                         ,
    genClosure_WindowMove                   ,
    mk_WindowMoveCallback                   ,
    noWindowMoveCallback                    ,
    onWindowMove                            ,
    wrap_WindowMoveCallback                 ,


-- ** resize #signal:resize#

    C_WindowResizeCallback                  ,
    WindowResizeCallback                    ,
#if ENABLE_OVERLOADING
    WindowResizeSignalInfo                  ,
#endif
    afterWindowResize                       ,
    genClosure_WindowResize                 ,
    mk_WindowResizeCallback                 ,
    noWindowResizeCallback                  ,
    onWindowResize                          ,
    wrap_WindowResizeCallback               ,


-- ** restore #signal:restore#

    C_WindowRestoreCallback                 ,
    WindowRestoreCallback                   ,
#if ENABLE_OVERLOADING
    WindowRestoreSignalInfo                 ,
#endif
    afterWindowRestore                      ,
    genClosure_WindowRestore                ,
    mk_WindowRestoreCallback                ,
    noWindowRestoreCallback                 ,
    onWindowRestore                         ,
    wrap_WindowRestoreCallback              ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.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.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 {-# SOURCE #-} qualified GI.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object

-- interface Window 
-- | Memory-managed wrapper type.
newtype Window = Window (ManagedPtr Window)
-- | A convenience alias for `Nothing` :: `Maybe` `Window`.
noWindow :: Maybe Window
noWindow = Nothing

-- signal Window::activate
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/activate/@ is emitted when a window
becomes the active window of the application or session.

/Since: 2.2/
-}
type WindowActivateCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowActivateCallback`@.
noWindowActivateCallback :: Maybe WindowActivateCallback
noWindowActivateCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowActivateCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowActivateCallback`.
foreign import ccall "wrapper"
    mk_WindowActivateCallback :: C_WindowActivateCallback -> IO (FunPtr C_WindowActivateCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowActivate :: MonadIO m => WindowActivateCallback -> m (GClosure C_WindowActivateCallback)
genClosure_WindowActivate cb = liftIO $ do
    let cb' = wrap_WindowActivateCallback cb
    mk_WindowActivateCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowActivateCallback` into a `C_WindowActivateCallback`.
wrap_WindowActivateCallback ::
    WindowActivateCallback ->
    C_WindowActivateCallback
wrap_WindowActivateCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@activate@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #activate callback
@
-}
onWindowActivate :: (IsWindow a, MonadIO m) => a -> WindowActivateCallback -> m SignalHandlerId
onWindowActivate obj cb = liftIO $ do
    let cb' = wrap_WindowActivateCallback cb
    cb'' <- mk_WindowActivateCallback cb'
    connectSignalFunPtr obj "activate" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@activate@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #activate callback
@
-}
afterWindowActivate :: (IsWindow a, MonadIO m) => a -> WindowActivateCallback -> m SignalHandlerId
afterWindowActivate obj cb = liftIO $ do
    let cb' = wrap_WindowActivateCallback cb
    cb'' <- mk_WindowActivateCallback cb'
    connectSignalFunPtr obj "activate" cb'' SignalConnectAfter


-- signal Window::create
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/create/@ is emitted when a new window
is created.

/Since: 2.2/
-}
type WindowCreateCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowCreateCallback`@.
noWindowCreateCallback :: Maybe WindowCreateCallback
noWindowCreateCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowCreateCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowCreateCallback`.
foreign import ccall "wrapper"
    mk_WindowCreateCallback :: C_WindowCreateCallback -> IO (FunPtr C_WindowCreateCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowCreate :: MonadIO m => WindowCreateCallback -> m (GClosure C_WindowCreateCallback)
genClosure_WindowCreate cb = liftIO $ do
    let cb' = wrap_WindowCreateCallback cb
    mk_WindowCreateCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowCreateCallback` into a `C_WindowCreateCallback`.
wrap_WindowCreateCallback ::
    WindowCreateCallback ->
    C_WindowCreateCallback
wrap_WindowCreateCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@create@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #create callback
@
-}
onWindowCreate :: (IsWindow a, MonadIO m) => a -> WindowCreateCallback -> m SignalHandlerId
onWindowCreate obj cb = liftIO $ do
    let cb' = wrap_WindowCreateCallback cb
    cb'' <- mk_WindowCreateCallback cb'
    connectSignalFunPtr obj "create" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@create@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #create callback
@
-}
afterWindowCreate :: (IsWindow a, MonadIO m) => a -> WindowCreateCallback -> m SignalHandlerId
afterWindowCreate obj cb = liftIO $ do
    let cb' = wrap_WindowCreateCallback cb
    cb'' <- mk_WindowCreateCallback cb'
    connectSignalFunPtr obj "create" cb'' SignalConnectAfter


-- signal Window::deactivate
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/deactivate/@ is emitted when a window is
no longer the active window of the application or session.

/Since: 2.2/
-}
type WindowDeactivateCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowDeactivateCallback`@.
noWindowDeactivateCallback :: Maybe WindowDeactivateCallback
noWindowDeactivateCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowDeactivateCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowDeactivateCallback`.
foreign import ccall "wrapper"
    mk_WindowDeactivateCallback :: C_WindowDeactivateCallback -> IO (FunPtr C_WindowDeactivateCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowDeactivate :: MonadIO m => WindowDeactivateCallback -> m (GClosure C_WindowDeactivateCallback)
genClosure_WindowDeactivate cb = liftIO $ do
    let cb' = wrap_WindowDeactivateCallback cb
    mk_WindowDeactivateCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowDeactivateCallback` into a `C_WindowDeactivateCallback`.
wrap_WindowDeactivateCallback ::
    WindowDeactivateCallback ->
    C_WindowDeactivateCallback
wrap_WindowDeactivateCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@deactivate@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #deactivate callback
@
-}
onWindowDeactivate :: (IsWindow a, MonadIO m) => a -> WindowDeactivateCallback -> m SignalHandlerId
onWindowDeactivate obj cb = liftIO $ do
    let cb' = wrap_WindowDeactivateCallback cb
    cb'' <- mk_WindowDeactivateCallback cb'
    connectSignalFunPtr obj "deactivate" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@deactivate@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #deactivate callback
@
-}
afterWindowDeactivate :: (IsWindow a, MonadIO m) => a -> WindowDeactivateCallback -> m SignalHandlerId
afterWindowDeactivate obj cb = liftIO $ do
    let cb' = wrap_WindowDeactivateCallback cb
    cb'' <- mk_WindowDeactivateCallback cb'
    connectSignalFunPtr obj "deactivate" cb'' SignalConnectAfter


-- signal Window::destroy
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/destroy/@ is emitted when a window is
destroyed.

/Since: 2.2/
-}
type WindowDestroyCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowDestroyCallback`@.
noWindowDestroyCallback :: Maybe WindowDestroyCallback
noWindowDestroyCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowDestroyCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowDestroyCallback`.
foreign import ccall "wrapper"
    mk_WindowDestroyCallback :: C_WindowDestroyCallback -> IO (FunPtr C_WindowDestroyCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowDestroy :: MonadIO m => WindowDestroyCallback -> m (GClosure C_WindowDestroyCallback)
genClosure_WindowDestroy cb = liftIO $ do
    let cb' = wrap_WindowDestroyCallback cb
    mk_WindowDestroyCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowDestroyCallback` into a `C_WindowDestroyCallback`.
wrap_WindowDestroyCallback ::
    WindowDestroyCallback ->
    C_WindowDestroyCallback
wrap_WindowDestroyCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@destroy@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #destroy callback
@
-}
onWindowDestroy :: (IsWindow a, MonadIO m) => a -> WindowDestroyCallback -> m SignalHandlerId
onWindowDestroy obj cb = liftIO $ do
    let cb' = wrap_WindowDestroyCallback cb
    cb'' <- mk_WindowDestroyCallback cb'
    connectSignalFunPtr obj "destroy" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@destroy@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #destroy callback
@
-}
afterWindowDestroy :: (IsWindow a, MonadIO m) => a -> WindowDestroyCallback -> m SignalHandlerId
afterWindowDestroy obj cb = liftIO $ do
    let cb' = wrap_WindowDestroyCallback cb
    cb'' <- mk_WindowDestroyCallback cb'
    connectSignalFunPtr obj "destroy" cb'' SignalConnectAfter


-- signal Window::maximize
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/maximize/@ is emitted when a window
is maximized.

/Since: 2.2/
-}
type WindowMaximizeCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowMaximizeCallback`@.
noWindowMaximizeCallback :: Maybe WindowMaximizeCallback
noWindowMaximizeCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowMaximizeCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowMaximizeCallback`.
foreign import ccall "wrapper"
    mk_WindowMaximizeCallback :: C_WindowMaximizeCallback -> IO (FunPtr C_WindowMaximizeCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowMaximize :: MonadIO m => WindowMaximizeCallback -> m (GClosure C_WindowMaximizeCallback)
genClosure_WindowMaximize cb = liftIO $ do
    let cb' = wrap_WindowMaximizeCallback cb
    mk_WindowMaximizeCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowMaximizeCallback` into a `C_WindowMaximizeCallback`.
wrap_WindowMaximizeCallback ::
    WindowMaximizeCallback ->
    C_WindowMaximizeCallback
wrap_WindowMaximizeCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@maximize@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #maximize callback
@
-}
onWindowMaximize :: (IsWindow a, MonadIO m) => a -> WindowMaximizeCallback -> m SignalHandlerId
onWindowMaximize obj cb = liftIO $ do
    let cb' = wrap_WindowMaximizeCallback cb
    cb'' <- mk_WindowMaximizeCallback cb'
    connectSignalFunPtr obj "maximize" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@maximize@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #maximize callback
@
-}
afterWindowMaximize :: (IsWindow a, MonadIO m) => a -> WindowMaximizeCallback -> m SignalHandlerId
afterWindowMaximize obj cb = liftIO $ do
    let cb' = wrap_WindowMaximizeCallback cb
    cb'' <- mk_WindowMaximizeCallback cb'
    connectSignalFunPtr obj "maximize" cb'' SignalConnectAfter


-- signal Window::minimize
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/minimize/@ is emitted when a window
is minimized.

/Since: 2.2/
-}
type WindowMinimizeCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowMinimizeCallback`@.
noWindowMinimizeCallback :: Maybe WindowMinimizeCallback
noWindowMinimizeCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowMinimizeCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowMinimizeCallback`.
foreign import ccall "wrapper"
    mk_WindowMinimizeCallback :: C_WindowMinimizeCallback -> IO (FunPtr C_WindowMinimizeCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowMinimize :: MonadIO m => WindowMinimizeCallback -> m (GClosure C_WindowMinimizeCallback)
genClosure_WindowMinimize cb = liftIO $ do
    let cb' = wrap_WindowMinimizeCallback cb
    mk_WindowMinimizeCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowMinimizeCallback` into a `C_WindowMinimizeCallback`.
wrap_WindowMinimizeCallback ::
    WindowMinimizeCallback ->
    C_WindowMinimizeCallback
wrap_WindowMinimizeCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@minimize@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #minimize callback
@
-}
onWindowMinimize :: (IsWindow a, MonadIO m) => a -> WindowMinimizeCallback -> m SignalHandlerId
onWindowMinimize obj cb = liftIO $ do
    let cb' = wrap_WindowMinimizeCallback cb
    cb'' <- mk_WindowMinimizeCallback cb'
    connectSignalFunPtr obj "minimize" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@minimize@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #minimize callback
@
-}
afterWindowMinimize :: (IsWindow a, MonadIO m) => a -> WindowMinimizeCallback -> m SignalHandlerId
afterWindowMinimize obj cb = liftIO $ do
    let cb' = wrap_WindowMinimizeCallback cb
    cb'' <- mk_WindowMinimizeCallback cb'
    connectSignalFunPtr obj "minimize" cb'' SignalConnectAfter


-- signal Window::move
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/move/@ is emitted when a window
is moved.

/Since: 2.2/
-}
type WindowMoveCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowMoveCallback`@.
noWindowMoveCallback :: Maybe WindowMoveCallback
noWindowMoveCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowMoveCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowMoveCallback`.
foreign import ccall "wrapper"
    mk_WindowMoveCallback :: C_WindowMoveCallback -> IO (FunPtr C_WindowMoveCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowMove :: MonadIO m => WindowMoveCallback -> m (GClosure C_WindowMoveCallback)
genClosure_WindowMove cb = liftIO $ do
    let cb' = wrap_WindowMoveCallback cb
    mk_WindowMoveCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowMoveCallback` into a `C_WindowMoveCallback`.
wrap_WindowMoveCallback ::
    WindowMoveCallback ->
    C_WindowMoveCallback
wrap_WindowMoveCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@move@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #move callback
@
-}
onWindowMove :: (IsWindow a, MonadIO m) => a -> WindowMoveCallback -> m SignalHandlerId
onWindowMove obj cb = liftIO $ do
    let cb' = wrap_WindowMoveCallback cb
    cb'' <- mk_WindowMoveCallback cb'
    connectSignalFunPtr obj "move" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@move@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #move callback
@
-}
afterWindowMove :: (IsWindow a, MonadIO m) => a -> WindowMoveCallback -> m SignalHandlerId
afterWindowMove obj cb = liftIO $ do
    let cb' = wrap_WindowMoveCallback cb
    cb'' <- mk_WindowMoveCallback cb'
    connectSignalFunPtr obj "move" cb'' SignalConnectAfter


-- signal Window::resize
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/resize/@ is emitted when a window
is resized.

/Since: 2.2/
-}
type WindowResizeCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowResizeCallback`@.
noWindowResizeCallback :: Maybe WindowResizeCallback
noWindowResizeCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowResizeCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowResizeCallback`.
foreign import ccall "wrapper"
    mk_WindowResizeCallback :: C_WindowResizeCallback -> IO (FunPtr C_WindowResizeCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowResize :: MonadIO m => WindowResizeCallback -> m (GClosure C_WindowResizeCallback)
genClosure_WindowResize cb = liftIO $ do
    let cb' = wrap_WindowResizeCallback cb
    mk_WindowResizeCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowResizeCallback` into a `C_WindowResizeCallback`.
wrap_WindowResizeCallback ::
    WindowResizeCallback ->
    C_WindowResizeCallback
wrap_WindowResizeCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@resize@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #resize callback
@
-}
onWindowResize :: (IsWindow a, MonadIO m) => a -> WindowResizeCallback -> m SignalHandlerId
onWindowResize obj cb = liftIO $ do
    let cb' = wrap_WindowResizeCallback cb
    cb'' <- mk_WindowResizeCallback cb'
    connectSignalFunPtr obj "resize" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@resize@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #resize callback
@
-}
afterWindowResize :: (IsWindow a, MonadIO m) => a -> WindowResizeCallback -> m SignalHandlerId
afterWindowResize obj cb = liftIO $ do
    let cb' = wrap_WindowResizeCallback cb
    cb'' <- mk_WindowResizeCallback cb'
    connectSignalFunPtr obj "resize" cb'' SignalConnectAfter


-- signal Window::restore
{- |
The signal 'GI.Atk.Interfaces.Window.Window'::@/restore/@ is emitted when a window
is restored.

/Since: 2.2/
-}
type WindowRestoreCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `WindowRestoreCallback`@.
noWindowRestoreCallback :: Maybe WindowRestoreCallback
noWindowRestoreCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_WindowRestoreCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_WindowRestoreCallback`.
foreign import ccall "wrapper"
    mk_WindowRestoreCallback :: C_WindowRestoreCallback -> IO (FunPtr C_WindowRestoreCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_WindowRestore :: MonadIO m => WindowRestoreCallback -> m (GClosure C_WindowRestoreCallback)
genClosure_WindowRestore cb = liftIO $ do
    let cb' = wrap_WindowRestoreCallback cb
    mk_WindowRestoreCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `WindowRestoreCallback` into a `C_WindowRestoreCallback`.
wrap_WindowRestoreCallback ::
    WindowRestoreCallback ->
    C_WindowRestoreCallback
wrap_WindowRestoreCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@restore@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' window #restore callback
@
-}
onWindowRestore :: (IsWindow a, MonadIO m) => a -> WindowRestoreCallback -> m SignalHandlerId
onWindowRestore obj cb = liftIO $ do
    let cb' = wrap_WindowRestoreCallback cb
    cb'' <- mk_WindowRestoreCallback cb'
    connectSignalFunPtr obj "restore" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@restore@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' window #restore callback
@
-}
afterWindowRestore :: (IsWindow a, MonadIO m) => a -> WindowRestoreCallback -> m SignalHandlerId
afterWindowRestore obj cb = liftIO $ do
    let cb' = wrap_WindowRestoreCallback cb
    cb'' <- mk_WindowRestoreCallback cb'
    connectSignalFunPtr obj "restore" cb'' SignalConnectAfter


#if ENABLE_OVERLOADING
data WindowActivateSignalInfo
instance SignalInfo WindowActivateSignalInfo where
    type HaskellCallbackType WindowActivateSignalInfo = WindowActivateCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowActivateCallback cb
        cb'' <- mk_WindowActivateCallback cb'
        connectSignalFunPtr obj "activate" cb'' connectMode

data WindowCreateSignalInfo
instance SignalInfo WindowCreateSignalInfo where
    type HaskellCallbackType WindowCreateSignalInfo = WindowCreateCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowCreateCallback cb
        cb'' <- mk_WindowCreateCallback cb'
        connectSignalFunPtr obj "create" cb'' connectMode

data WindowDeactivateSignalInfo
instance SignalInfo WindowDeactivateSignalInfo where
    type HaskellCallbackType WindowDeactivateSignalInfo = WindowDeactivateCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowDeactivateCallback cb
        cb'' <- mk_WindowDeactivateCallback cb'
        connectSignalFunPtr obj "deactivate" cb'' connectMode

data WindowDestroySignalInfo
instance SignalInfo WindowDestroySignalInfo where
    type HaskellCallbackType WindowDestroySignalInfo = WindowDestroyCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowDestroyCallback cb
        cb'' <- mk_WindowDestroyCallback cb'
        connectSignalFunPtr obj "destroy" cb'' connectMode

data WindowMaximizeSignalInfo
instance SignalInfo WindowMaximizeSignalInfo where
    type HaskellCallbackType WindowMaximizeSignalInfo = WindowMaximizeCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowMaximizeCallback cb
        cb'' <- mk_WindowMaximizeCallback cb'
        connectSignalFunPtr obj "maximize" cb'' connectMode

data WindowMinimizeSignalInfo
instance SignalInfo WindowMinimizeSignalInfo where
    type HaskellCallbackType WindowMinimizeSignalInfo = WindowMinimizeCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowMinimizeCallback cb
        cb'' <- mk_WindowMinimizeCallback cb'
        connectSignalFunPtr obj "minimize" cb'' connectMode

data WindowMoveSignalInfo
instance SignalInfo WindowMoveSignalInfo where
    type HaskellCallbackType WindowMoveSignalInfo = WindowMoveCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowMoveCallback cb
        cb'' <- mk_WindowMoveCallback cb'
        connectSignalFunPtr obj "move" cb'' connectMode

data WindowResizeSignalInfo
instance SignalInfo WindowResizeSignalInfo where
    type HaskellCallbackType WindowResizeSignalInfo = WindowResizeCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowResizeCallback cb
        cb'' <- mk_WindowResizeCallback cb'
        connectSignalFunPtr obj "resize" cb'' connectMode

data WindowRestoreSignalInfo
instance SignalInfo WindowRestoreSignalInfo where
    type HaskellCallbackType WindowRestoreSignalInfo = WindowRestoreCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_WindowRestoreCallback cb
        cb'' <- mk_WindowRestoreCallback cb'
        connectSignalFunPtr obj "restore" cb'' connectMode

type instance O.SignalList Window = WindowSignalList
type WindowSignalList = ('[ '("activate", WindowActivateSignalInfo), '("activeDescendantChanged", Atk.Object.ObjectActiveDescendantChangedSignalInfo), '("childrenChanged", Atk.Object.ObjectChildrenChangedSignalInfo), '("create", WindowCreateSignalInfo), '("deactivate", WindowDeactivateSignalInfo), '("destroy", WindowDestroySignalInfo), '("focusEvent", Atk.Object.ObjectFocusEventSignalInfo), '("maximize", WindowMaximizeSignalInfo), '("minimize", WindowMinimizeSignalInfo), '("move", WindowMoveSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("propertyChange", Atk.Object.ObjectPropertyChangeSignalInfo), '("resize", WindowResizeSignalInfo), '("restore", WindowRestoreSignalInfo), '("stateChange", Atk.Object.ObjectStateChangeSignalInfo), '("visibleDataChanged", Atk.Object.ObjectVisibleDataChangedSignalInfo)] :: [(Symbol, *)])

#endif

foreign import ccall "atk_window_get_type"
    c_atk_window_get_type :: IO GType

instance GObject Window where
    gobjectType = c_atk_window_get_type


-- | Type class for types which can be safely cast to `Window`, for instance with `toWindow`.
class (GObject o, O.IsDescendantOf Window o) => IsWindow o
instance (GObject o, O.IsDescendantOf Window o) => IsWindow o

instance O.HasParentTypes Window
type instance O.ParentTypes Window = '[GObject.Object.Object, Atk.Object.Object]

-- | Cast to `Window`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toWindow :: (MonadIO m, IsWindow o) => o -> m Window
toWindow = liftIO . unsafeCastTo Window

#if ENABLE_OVERLOADING
instance O.HasAttributeList Window
type instance O.AttributeList Window = WindowAttributeList
type WindowAttributeList = ('[ '("accessibleComponentLayer", Atk.Object.ObjectAccessibleComponentLayerPropertyInfo), '("accessibleComponentMdiZorder", Atk.Object.ObjectAccessibleComponentMdiZorderPropertyInfo), '("accessibleDescription", Atk.Object.ObjectAccessibleDescriptionPropertyInfo), '("accessibleHypertextNlinks", Atk.Object.ObjectAccessibleHypertextNlinksPropertyInfo), '("accessibleName", Atk.Object.ObjectAccessibleNamePropertyInfo), '("accessibleParent", Atk.Object.ObjectAccessibleParentPropertyInfo), '("accessibleRole", Atk.Object.ObjectAccessibleRolePropertyInfo), '("accessibleTableCaption", Atk.Object.ObjectAccessibleTableCaptionPropertyInfo), '("accessibleTableCaptionObject", Atk.Object.ObjectAccessibleTableCaptionObjectPropertyInfo), '("accessibleTableColumnDescription", Atk.Object.ObjectAccessibleTableColumnDescriptionPropertyInfo), '("accessibleTableColumnHeader", Atk.Object.ObjectAccessibleTableColumnHeaderPropertyInfo), '("accessibleTableRowDescription", Atk.Object.ObjectAccessibleTableRowDescriptionPropertyInfo), '("accessibleTableRowHeader", Atk.Object.ObjectAccessibleTableRowHeaderPropertyInfo), '("accessibleTableSummary", Atk.Object.ObjectAccessibleTableSummaryPropertyInfo), '("accessibleValue", Atk.Object.ObjectAccessibleValuePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type family ResolveWindowMethod (t :: Symbol) (o :: *) :: * where
    ResolveWindowMethod "addRelationship" o = Atk.Object.ObjectAddRelationshipMethodInfo
    ResolveWindowMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWindowMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWindowMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWindowMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWindowMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveWindowMethod "initialize" o = Atk.Object.ObjectInitializeMethodInfo
    ResolveWindowMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWindowMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWindowMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWindowMethod "notifyStateChange" o = Atk.Object.ObjectNotifyStateChangeMethodInfo
    ResolveWindowMethod "peekParent" o = Atk.Object.ObjectPeekParentMethodInfo
    ResolveWindowMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWindowMethod "refAccessibleChild" o = Atk.Object.ObjectRefAccessibleChildMethodInfo
    ResolveWindowMethod "refRelationSet" o = Atk.Object.ObjectRefRelationSetMethodInfo
    ResolveWindowMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWindowMethod "refStateSet" o = Atk.Object.ObjectRefStateSetMethodInfo
    ResolveWindowMethod "removePropertyChangeHandler" o = Atk.Object.ObjectRemovePropertyChangeHandlerMethodInfo
    ResolveWindowMethod "removeRelationship" o = Atk.Object.ObjectRemoveRelationshipMethodInfo
    ResolveWindowMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWindowMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWindowMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWindowMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWindowMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWindowMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWindowMethod "getAttributes" o = Atk.Object.ObjectGetAttributesMethodInfo
    ResolveWindowMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWindowMethod "getDescription" o = Atk.Object.ObjectGetDescriptionMethodInfo
    ResolveWindowMethod "getIndexInParent" o = Atk.Object.ObjectGetIndexInParentMethodInfo
    ResolveWindowMethod "getLayer" o = Atk.Object.ObjectGetLayerMethodInfo
    ResolveWindowMethod "getMdiZorder" o = Atk.Object.ObjectGetMdiZorderMethodInfo
    ResolveWindowMethod "getNAccessibleChildren" o = Atk.Object.ObjectGetNAccessibleChildrenMethodInfo
    ResolveWindowMethod "getName" o = Atk.Object.ObjectGetNameMethodInfo
    ResolveWindowMethod "getObjectLocale" o = Atk.Object.ObjectGetObjectLocaleMethodInfo
    ResolveWindowMethod "getParent" o = Atk.Object.ObjectGetParentMethodInfo
    ResolveWindowMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWindowMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWindowMethod "getRole" o = Atk.Object.ObjectGetRoleMethodInfo
    ResolveWindowMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWindowMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveWindowMethod "setDescription" o = Atk.Object.ObjectSetDescriptionMethodInfo
    ResolveWindowMethod "setName" o = Atk.Object.ObjectSetNameMethodInfo
    ResolveWindowMethod "setParent" o = Atk.Object.ObjectSetParentMethodInfo
    ResolveWindowMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWindowMethod "setRole" o = Atk.Object.ObjectSetRoleMethodInfo
    ResolveWindowMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveWindowMethod t Window, O.MethodInfo info Window p) => OL.IsLabel t (Window -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif