{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A t'GI.Gdk.Objects.Surface.Surface' is a (usually) rectangular region on the screen.
-- It’s a low-level object, used to implement high-level objects such as
-- @/GtkWidget/@ and @/GtkWindow/@ on the GTK level. A @/GtkWindow/@ is a toplevel
-- surface, the thing a user might think of as a “window” with a titlebar
-- and so on; a @/GtkWindow/@ may contain many sub-GdkSurfaces.

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

module GI.Gdk.Objects.Surface
    ( 

-- * Exported types
    Surface(..)                             ,
    IsSurface                               ,
    toSurface                               ,
    noSurface                               ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveSurfaceMethod                    ,
#endif


-- ** beep #method:beep#

#if defined(ENABLE_OVERLOADING)
    SurfaceBeepMethodInfo                   ,
#endif
    surfaceBeep                             ,


-- ** beginMoveDrag #method:beginMoveDrag#

#if defined(ENABLE_OVERLOADING)
    SurfaceBeginMoveDragMethodInfo          ,
#endif
    surfaceBeginMoveDrag                    ,


-- ** beginMoveDragForDevice #method:beginMoveDragForDevice#

#if defined(ENABLE_OVERLOADING)
    SurfaceBeginMoveDragForDeviceMethodInfo ,
#endif
    surfaceBeginMoveDragForDevice           ,


-- ** beginResizeDrag #method:beginResizeDrag#

#if defined(ENABLE_OVERLOADING)
    SurfaceBeginResizeDragMethodInfo        ,
#endif
    surfaceBeginResizeDrag                  ,


-- ** beginResizeDragForDevice #method:beginResizeDragForDevice#

#if defined(ENABLE_OVERLOADING)
    SurfaceBeginResizeDragForDeviceMethodInfo,
#endif
    surfaceBeginResizeDragForDevice         ,


-- ** constrainSize #method:constrainSize#

    surfaceConstrainSize                    ,


-- ** coordsFromParent #method:coordsFromParent#

#if defined(ENABLE_OVERLOADING)
    SurfaceCoordsFromParentMethodInfo       ,
#endif
    surfaceCoordsFromParent                 ,


-- ** coordsToParent #method:coordsToParent#

#if defined(ENABLE_OVERLOADING)
    SurfaceCoordsToParentMethodInfo         ,
#endif
    surfaceCoordsToParent                   ,


-- ** createCairoContext #method:createCairoContext#

#if defined(ENABLE_OVERLOADING)
    SurfaceCreateCairoContextMethodInfo     ,
#endif
    surfaceCreateCairoContext               ,


-- ** createGlContext #method:createGlContext#

#if defined(ENABLE_OVERLOADING)
    SurfaceCreateGlContextMethodInfo        ,
#endif
    surfaceCreateGlContext                  ,


-- ** createSimilarSurface #method:createSimilarSurface#

#if defined(ENABLE_OVERLOADING)
    SurfaceCreateSimilarSurfaceMethodInfo   ,
#endif
    surfaceCreateSimilarSurface             ,


-- ** createVulkanContext #method:createVulkanContext#

#if defined(ENABLE_OVERLOADING)
    SurfaceCreateVulkanContextMethodInfo    ,
#endif
    surfaceCreateVulkanContext              ,


-- ** deiconify #method:deiconify#

#if defined(ENABLE_OVERLOADING)
    SurfaceDeiconifyMethodInfo              ,
#endif
    surfaceDeiconify                        ,


-- ** destroy #method:destroy#

#if defined(ENABLE_OVERLOADING)
    SurfaceDestroyMethodInfo                ,
#endif
    surfaceDestroy                          ,


-- ** focus #method:focus#

#if defined(ENABLE_OVERLOADING)
    SurfaceFocusMethodInfo                  ,
#endif
    surfaceFocus                            ,


-- ** freezeUpdates #method:freezeUpdates#

#if defined(ENABLE_OVERLOADING)
    SurfaceFreezeUpdatesMethodInfo          ,
#endif
    surfaceFreezeUpdates                    ,


-- ** fullscreen #method:fullscreen#

#if defined(ENABLE_OVERLOADING)
    SurfaceFullscreenMethodInfo             ,
#endif
    surfaceFullscreen                       ,


-- ** fullscreenOnMonitor #method:fullscreenOnMonitor#

#if defined(ENABLE_OVERLOADING)
    SurfaceFullscreenOnMonitorMethodInfo    ,
#endif
    surfaceFullscreenOnMonitor              ,


-- ** getAcceptFocus #method:getAcceptFocus#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetAcceptFocusMethodInfo         ,
#endif
    surfaceGetAcceptFocus                   ,


-- ** getChildren #method:getChildren#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetChildrenMethodInfo            ,
#endif
    surfaceGetChildren                      ,


-- ** getCursor #method:getCursor#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetCursorMethodInfo              ,
#endif
    surfaceGetCursor                        ,


-- ** getDecorations #method:getDecorations#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetDecorationsMethodInfo         ,
#endif
    surfaceGetDecorations                   ,


-- ** getDeviceCursor #method:getDeviceCursor#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetDeviceCursorMethodInfo        ,
#endif
    surfaceGetDeviceCursor                  ,


-- ** getDevicePosition #method:getDevicePosition#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetDevicePositionMethodInfo      ,
#endif
    surfaceGetDevicePosition                ,


-- ** getDisplay #method:getDisplay#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetDisplayMethodInfo             ,
#endif
    surfaceGetDisplay                       ,


-- ** getFocusOnMap #method:getFocusOnMap#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetFocusOnMapMethodInfo          ,
#endif
    surfaceGetFocusOnMap                    ,


-- ** getFrameClock #method:getFrameClock#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetFrameClockMethodInfo          ,
#endif
    surfaceGetFrameClock                    ,


-- ** getFrameExtents #method:getFrameExtents#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetFrameExtentsMethodInfo        ,
#endif
    surfaceGetFrameExtents                  ,


-- ** getFullscreenMode #method:getFullscreenMode#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetFullscreenModeMethodInfo      ,
#endif
    surfaceGetFullscreenMode                ,


-- ** getGeometry #method:getGeometry#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetGeometryMethodInfo            ,
#endif
    surfaceGetGeometry                      ,


-- ** getHeight #method:getHeight#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetHeightMethodInfo              ,
#endif
    surfaceGetHeight                        ,


-- ** getModalHint #method:getModalHint#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetModalHintMethodInfo           ,
#endif
    surfaceGetModalHint                     ,


-- ** getOrigin #method:getOrigin#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetOriginMethodInfo              ,
#endif
    surfaceGetOrigin                        ,


-- ** getParent #method:getParent#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetParentMethodInfo              ,
#endif
    surfaceGetParent                        ,


-- ** getPassThrough #method:getPassThrough#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetPassThroughMethodInfo         ,
#endif
    surfaceGetPassThrough                   ,


-- ** getPosition #method:getPosition#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetPositionMethodInfo            ,
#endif
    surfaceGetPosition                      ,


-- ** getRootCoords #method:getRootCoords#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetRootCoordsMethodInfo          ,
#endif
    surfaceGetRootCoords                    ,


-- ** getRootOrigin #method:getRootOrigin#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetRootOriginMethodInfo          ,
#endif
    surfaceGetRootOrigin                    ,


-- ** getScaleFactor #method:getScaleFactor#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetScaleFactorMethodInfo         ,
#endif
    surfaceGetScaleFactor                   ,


-- ** getState #method:getState#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetStateMethodInfo               ,
#endif
    surfaceGetState                         ,


-- ** getSupportMultidevice #method:getSupportMultidevice#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetSupportMultideviceMethodInfo  ,
#endif
    surfaceGetSupportMultidevice            ,


-- ** getSurfaceType #method:getSurfaceType#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetSurfaceTypeMethodInfo         ,
#endif
    surfaceGetSurfaceType                   ,


-- ** getToplevel #method:getToplevel#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetToplevelMethodInfo            ,
#endif
    surfaceGetToplevel                      ,


-- ** getTypeHint #method:getTypeHint#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetTypeHintMethodInfo            ,
#endif
    surfaceGetTypeHint                      ,


-- ** getWidth #method:getWidth#

#if defined(ENABLE_OVERLOADING)
    SurfaceGetWidthMethodInfo               ,
#endif
    surfaceGetWidth                         ,


-- ** hasNative #method:hasNative#

#if defined(ENABLE_OVERLOADING)
    SurfaceHasNativeMethodInfo              ,
#endif
    surfaceHasNative                        ,


-- ** hide #method:hide#

#if defined(ENABLE_OVERLOADING)
    SurfaceHideMethodInfo                   ,
#endif
    surfaceHide                             ,


-- ** iconify #method:iconify#

#if defined(ENABLE_OVERLOADING)
    SurfaceIconifyMethodInfo                ,
#endif
    surfaceIconify                          ,


-- ** inputShapeCombineRegion #method:inputShapeCombineRegion#

#if defined(ENABLE_OVERLOADING)
    SurfaceInputShapeCombineRegionMethodInfo,
#endif
    surfaceInputShapeCombineRegion          ,


-- ** isDestroyed #method:isDestroyed#

#if defined(ENABLE_OVERLOADING)
    SurfaceIsDestroyedMethodInfo            ,
#endif
    surfaceIsDestroyed                      ,


-- ** isInputOnly #method:isInputOnly#

#if defined(ENABLE_OVERLOADING)
    SurfaceIsInputOnlyMethodInfo            ,
#endif
    surfaceIsInputOnly                      ,


-- ** isViewable #method:isViewable#

#if defined(ENABLE_OVERLOADING)
    SurfaceIsViewableMethodInfo             ,
#endif
    surfaceIsViewable                       ,


-- ** isVisible #method:isVisible#

#if defined(ENABLE_OVERLOADING)
    SurfaceIsVisibleMethodInfo              ,
#endif
    surfaceIsVisible                        ,


-- ** lower #method:lower#

#if defined(ENABLE_OVERLOADING)
    SurfaceLowerMethodInfo                  ,
#endif
    surfaceLower                            ,


-- ** maximize #method:maximize#

#if defined(ENABLE_OVERLOADING)
    SurfaceMaximizeMethodInfo               ,
#endif
    surfaceMaximize                         ,


-- ** mergeChildInputShapes #method:mergeChildInputShapes#

#if defined(ENABLE_OVERLOADING)
    SurfaceMergeChildInputShapesMethodInfo  ,
#endif
    surfaceMergeChildInputShapes            ,


-- ** move #method:move#

#if defined(ENABLE_OVERLOADING)
    SurfaceMoveMethodInfo                   ,
#endif
    surfaceMove                             ,


-- ** moveResize #method:moveResize#

#if defined(ENABLE_OVERLOADING)
    SurfaceMoveResizeMethodInfo             ,
#endif
    surfaceMoveResize                       ,


-- ** moveToRect #method:moveToRect#

#if defined(ENABLE_OVERLOADING)
    SurfaceMoveToRectMethodInfo             ,
#endif
    surfaceMoveToRect                       ,


-- ** newChild #method:newChild#

    surfaceNewChild                         ,


-- ** newPopup #method:newPopup#

    surfaceNewPopup                         ,


-- ** newTemp #method:newTemp#

    surfaceNewTemp                          ,


-- ** newToplevel #method:newToplevel#

    surfaceNewToplevel                      ,


-- ** peekChildren #method:peekChildren#

#if defined(ENABLE_OVERLOADING)
    SurfacePeekChildrenMethodInfo           ,
#endif
    surfacePeekChildren                     ,


-- ** queueExpose #method:queueExpose#

#if defined(ENABLE_OVERLOADING)
    SurfaceQueueExposeMethodInfo            ,
#endif
    surfaceQueueExpose                      ,


-- ** raise #method:raise#

#if defined(ENABLE_OVERLOADING)
    SurfaceRaiseMethodInfo                  ,
#endif
    surfaceRaise                            ,


-- ** registerDnd #method:registerDnd#

#if defined(ENABLE_OVERLOADING)
    SurfaceRegisterDndMethodInfo            ,
#endif
    surfaceRegisterDnd                      ,


-- ** resize #method:resize#

#if defined(ENABLE_OVERLOADING)
    SurfaceResizeMethodInfo                 ,
#endif
    surfaceResize                           ,


-- ** restack #method:restack#

#if defined(ENABLE_OVERLOADING)
    SurfaceRestackMethodInfo                ,
#endif
    surfaceRestack                          ,


-- ** setAcceptFocus #method:setAcceptFocus#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetAcceptFocusMethodInfo         ,
#endif
    surfaceSetAcceptFocus                   ,


-- ** setChildInputShapes #method:setChildInputShapes#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetChildInputShapesMethodInfo    ,
#endif
    surfaceSetChildInputShapes              ,


-- ** setCursor #method:setCursor#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetCursorMethodInfo              ,
#endif
    surfaceSetCursor                        ,


-- ** setDecorations #method:setDecorations#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetDecorationsMethodInfo         ,
#endif
    surfaceSetDecorations                   ,


-- ** setDeviceCursor #method:setDeviceCursor#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetDeviceCursorMethodInfo        ,
#endif
    surfaceSetDeviceCursor                  ,


-- ** setFocusOnMap #method:setFocusOnMap#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetFocusOnMapMethodInfo          ,
#endif
    surfaceSetFocusOnMap                    ,


-- ** setFullscreenMode #method:setFullscreenMode#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetFullscreenModeMethodInfo      ,
#endif
    surfaceSetFullscreenMode                ,


-- ** setFunctions #method:setFunctions#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetFunctionsMethodInfo           ,
#endif
    surfaceSetFunctions                     ,


-- ** setGeometryHints #method:setGeometryHints#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetGeometryHintsMethodInfo       ,
#endif
    surfaceSetGeometryHints                 ,


-- ** setIconList #method:setIconList#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetIconListMethodInfo            ,
#endif
    surfaceSetIconList                      ,


-- ** setIconName #method:setIconName#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetIconNameMethodInfo            ,
#endif
    surfaceSetIconName                      ,


-- ** setKeepAbove #method:setKeepAbove#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetKeepAboveMethodInfo           ,
#endif
    surfaceSetKeepAbove                     ,


-- ** setKeepBelow #method:setKeepBelow#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetKeepBelowMethodInfo           ,
#endif
    surfaceSetKeepBelow                     ,


-- ** setModalHint #method:setModalHint#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetModalHintMethodInfo           ,
#endif
    surfaceSetModalHint                     ,


-- ** setOpacity #method:setOpacity#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetOpacityMethodInfo             ,
#endif
    surfaceSetOpacity                       ,


-- ** setOpaqueRegion #method:setOpaqueRegion#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetOpaqueRegionMethodInfo        ,
#endif
    surfaceSetOpaqueRegion                  ,


-- ** setPassThrough #method:setPassThrough#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetPassThroughMethodInfo         ,
#endif
    surfaceSetPassThrough                   ,


-- ** setShadowWidth #method:setShadowWidth#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetShadowWidthMethodInfo         ,
#endif
    surfaceSetShadowWidth                   ,


-- ** setStartupId #method:setStartupId#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetStartupIdMethodInfo           ,
#endif
    surfaceSetStartupId                     ,


-- ** setSupportMultidevice #method:setSupportMultidevice#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetSupportMultideviceMethodInfo  ,
#endif
    surfaceSetSupportMultidevice            ,


-- ** setTitle #method:setTitle#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetTitleMethodInfo               ,
#endif
    surfaceSetTitle                         ,


-- ** setTransientFor #method:setTransientFor#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetTransientForMethodInfo        ,
#endif
    surfaceSetTransientFor                  ,


-- ** setTypeHint #method:setTypeHint#

#if defined(ENABLE_OVERLOADING)
    SurfaceSetTypeHintMethodInfo            ,
#endif
    surfaceSetTypeHint                      ,


-- ** show #method:show#

#if defined(ENABLE_OVERLOADING)
    SurfaceShowMethodInfo                   ,
#endif
    surfaceShow                             ,


-- ** showUnraised #method:showUnraised#

#if defined(ENABLE_OVERLOADING)
    SurfaceShowUnraisedMethodInfo           ,
#endif
    surfaceShowUnraised                     ,


-- ** showWindowMenu #method:showWindowMenu#

#if defined(ENABLE_OVERLOADING)
    SurfaceShowWindowMenuMethodInfo         ,
#endif
    surfaceShowWindowMenu                   ,


-- ** stick #method:stick#

#if defined(ENABLE_OVERLOADING)
    SurfaceStickMethodInfo                  ,
#endif
    surfaceStick                            ,


-- ** thawUpdates #method:thawUpdates#

#if defined(ENABLE_OVERLOADING)
    SurfaceThawUpdatesMethodInfo            ,
#endif
    surfaceThawUpdates                      ,


-- ** unfullscreen #method:unfullscreen#

#if defined(ENABLE_OVERLOADING)
    SurfaceUnfullscreenMethodInfo           ,
#endif
    surfaceUnfullscreen                     ,


-- ** unmaximize #method:unmaximize#

#if defined(ENABLE_OVERLOADING)
    SurfaceUnmaximizeMethodInfo             ,
#endif
    surfaceUnmaximize                       ,


-- ** unstick #method:unstick#

#if defined(ENABLE_OVERLOADING)
    SurfaceUnstickMethodInfo                ,
#endif
    surfaceUnstick                          ,




 -- * Properties
-- ** cursor #attr:cursor#
-- | The mouse pointer for a t'GI.Gdk.Objects.Surface.Surface'. See 'GI.Gdk.Objects.Surface.surfaceSetCursor' and
-- 'GI.Gdk.Objects.Surface.surfaceGetCursor' for details.

#if defined(ENABLE_OVERLOADING)
    SurfaceCursorPropertyInfo               ,
#endif
    clearSurfaceCursor                      ,
    constructSurfaceCursor                  ,
    getSurfaceCursor                        ,
    setSurfaceCursor                        ,
#if defined(ENABLE_OVERLOADING)
    surfaceCursor                           ,
#endif


-- ** display #attr:display#
-- | The t'GI.Gdk.Objects.Display.Display' connection of the surface. See 'GI.Gdk.Objects.Surface.surfaceGetDisplay'
-- for details.

#if defined(ENABLE_OVERLOADING)
    SurfaceDisplayPropertyInfo              ,
#endif
    constructSurfaceDisplay                 ,
    getSurfaceDisplay                       ,
#if defined(ENABLE_OVERLOADING)
    surfaceDisplay                          ,
#endif


-- ** frameClock #attr:frameClock#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SurfaceFrameClockPropertyInfo           ,
#endif
    constructSurfaceFrameClock              ,
    getSurfaceFrameClock                    ,
#if defined(ENABLE_OVERLOADING)
    surfaceFrameClock                       ,
#endif


-- ** mapped #attr:mapped#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SurfaceMappedPropertyInfo               ,
#endif
    getSurfaceMapped                        ,
#if defined(ENABLE_OVERLOADING)
    surfaceMapped                           ,
#endif


-- ** state #attr:state#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SurfaceStatePropertyInfo                ,
#endif
    getSurfaceState                         ,
#if defined(ENABLE_OVERLOADING)
    surfaceState                            ,
#endif




 -- * Signals
-- ** event #signal:event#

    C_SurfaceEventCallback                  ,
    SurfaceEventCallback                    ,
#if defined(ENABLE_OVERLOADING)
    SurfaceEventSignalInfo                  ,
#endif
    afterSurfaceEvent                       ,
    genClosure_SurfaceEvent                 ,
    mk_SurfaceEventCallback                 ,
    noSurfaceEventCallback                  ,
    onSurfaceEvent                          ,
    wrap_SurfaceEventCallback               ,


-- ** movedToRect #signal:movedToRect#

    C_SurfaceMovedToRectCallback            ,
    SurfaceMovedToRectCallback              ,
#if defined(ENABLE_OVERLOADING)
    SurfaceMovedToRectSignalInfo            ,
#endif
    afterSurfaceMovedToRect                 ,
    genClosure_SurfaceMovedToRect           ,
    mk_SurfaceMovedToRectCallback           ,
    noSurfaceMovedToRectCallback            ,
    onSurfaceMovedToRect                    ,
    wrap_SurfaceMovedToRectCallback         ,


-- ** render #signal:render#

    C_SurfaceRenderCallback                 ,
    SurfaceRenderCallback                   ,
#if defined(ENABLE_OVERLOADING)
    SurfaceRenderSignalInfo                 ,
#endif
    afterSurfaceRender                      ,
    genClosure_SurfaceRender                ,
    mk_SurfaceRenderCallback                ,
    noSurfaceRenderCallback                 ,
    onSurfaceRender                         ,
    wrap_SurfaceRenderCallback              ,


-- ** sizeChanged #signal:sizeChanged#

    C_SurfaceSizeChangedCallback            ,
    SurfaceSizeChangedCallback              ,
#if defined(ENABLE_OVERLOADING)
    SurfaceSizeChangedSignalInfo            ,
#endif
    afterSurfaceSizeChanged                 ,
    genClosure_SurfaceSizeChanged           ,
    mk_SurfaceSizeChangedCallback           ,
    noSurfaceSizeChangedCallback            ,
    onSurfaceSizeChanged                    ,
    wrap_SurfaceSizeChangedCallback         ,




    ) 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.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.Cairo.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import {-# SOURCE #-} qualified GI.Gdk.Objects.GLContext as Gdk.GLContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
import {-# SOURCE #-} qualified GI.Gdk.Structs.Geometry as Gdk.Geometry
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle

-- | Memory-managed wrapper type.
newtype Surface = Surface (ManagedPtr Surface)
    deriving (Surface -> Surface -> Bool
(Surface -> Surface -> Bool)
-> (Surface -> Surface -> Bool) -> Eq Surface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Surface -> Surface -> Bool
$c/= :: Surface -> Surface -> Bool
== :: Surface -> Surface -> Bool
$c== :: Surface -> Surface -> Bool
Eq)
foreign import ccall "gdk_surface_get_type"
    c_gdk_surface_get_type :: IO GType

instance GObject Surface where
    gobjectType :: IO GType
gobjectType = IO GType
c_gdk_surface_get_type
    

-- | Convert 'Surface' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Surface where
    toGValue :: Surface -> IO GValue
toGValue o :: Surface
o = do
        GType
gtype <- IO GType
c_gdk_surface_get_type
        Surface -> (Ptr Surface -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Surface
o (GType
-> (GValue -> Ptr Surface -> IO ()) -> Ptr Surface -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Surface -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO Surface
fromGValue gv :: GValue
gv = do
        Ptr Surface
ptr <- GValue -> IO (Ptr Surface)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Surface)
        (ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Surface -> Surface
Surface Ptr Surface
ptr
        
    

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

instance O.HasParentTypes Surface
type instance O.ParentTypes Surface = '[GObject.Object.Object]

-- | Cast to `Surface`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toSurface :: (MonadIO m, IsSurface o) => o -> m Surface
toSurface :: o -> m Surface
toSurface = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> (o -> IO Surface) -> o -> m Surface
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Surface -> Surface) -> o -> IO Surface
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Surface -> Surface
Surface

-- | A convenience alias for `Nothing` :: `Maybe` `Surface`.
noSurface :: Maybe Surface
noSurface :: Maybe Surface
noSurface = Maybe Surface
forall a. Maybe a
Nothing

#if defined(ENABLE_OVERLOADING)
type family ResolveSurfaceMethod (t :: Symbol) (o :: *) :: * where
    ResolveSurfaceMethod "beep" o = SurfaceBeepMethodInfo
    ResolveSurfaceMethod "beginMoveDrag" o = SurfaceBeginMoveDragMethodInfo
    ResolveSurfaceMethod "beginMoveDragForDevice" o = SurfaceBeginMoveDragForDeviceMethodInfo
    ResolveSurfaceMethod "beginResizeDrag" o = SurfaceBeginResizeDragMethodInfo
    ResolveSurfaceMethod "beginResizeDragForDevice" o = SurfaceBeginResizeDragForDeviceMethodInfo
    ResolveSurfaceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSurfaceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSurfaceMethod "coordsFromParent" o = SurfaceCoordsFromParentMethodInfo
    ResolveSurfaceMethod "coordsToParent" o = SurfaceCoordsToParentMethodInfo
    ResolveSurfaceMethod "createCairoContext" o = SurfaceCreateCairoContextMethodInfo
    ResolveSurfaceMethod "createGlContext" o = SurfaceCreateGlContextMethodInfo
    ResolveSurfaceMethod "createSimilarSurface" o = SurfaceCreateSimilarSurfaceMethodInfo
    ResolveSurfaceMethod "createVulkanContext" o = SurfaceCreateVulkanContextMethodInfo
    ResolveSurfaceMethod "deiconify" o = SurfaceDeiconifyMethodInfo
    ResolveSurfaceMethod "destroy" o = SurfaceDestroyMethodInfo
    ResolveSurfaceMethod "focus" o = SurfaceFocusMethodInfo
    ResolveSurfaceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSurfaceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSurfaceMethod "freezeUpdates" o = SurfaceFreezeUpdatesMethodInfo
    ResolveSurfaceMethod "fullscreen" o = SurfaceFullscreenMethodInfo
    ResolveSurfaceMethod "fullscreenOnMonitor" o = SurfaceFullscreenOnMonitorMethodInfo
    ResolveSurfaceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSurfaceMethod "hasNative" o = SurfaceHasNativeMethodInfo
    ResolveSurfaceMethod "hide" o = SurfaceHideMethodInfo
    ResolveSurfaceMethod "iconify" o = SurfaceIconifyMethodInfo
    ResolveSurfaceMethod "inputShapeCombineRegion" o = SurfaceInputShapeCombineRegionMethodInfo
    ResolveSurfaceMethod "isDestroyed" o = SurfaceIsDestroyedMethodInfo
    ResolveSurfaceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSurfaceMethod "isInputOnly" o = SurfaceIsInputOnlyMethodInfo
    ResolveSurfaceMethod "isViewable" o = SurfaceIsViewableMethodInfo
    ResolveSurfaceMethod "isVisible" o = SurfaceIsVisibleMethodInfo
    ResolveSurfaceMethod "lower" o = SurfaceLowerMethodInfo
    ResolveSurfaceMethod "maximize" o = SurfaceMaximizeMethodInfo
    ResolveSurfaceMethod "mergeChildInputShapes" o = SurfaceMergeChildInputShapesMethodInfo
    ResolveSurfaceMethod "move" o = SurfaceMoveMethodInfo
    ResolveSurfaceMethod "moveResize" o = SurfaceMoveResizeMethodInfo
    ResolveSurfaceMethod "moveToRect" o = SurfaceMoveToRectMethodInfo
    ResolveSurfaceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSurfaceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSurfaceMethod "peekChildren" o = SurfacePeekChildrenMethodInfo
    ResolveSurfaceMethod "queueExpose" o = SurfaceQueueExposeMethodInfo
    ResolveSurfaceMethod "raise" o = SurfaceRaiseMethodInfo
    ResolveSurfaceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSurfaceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSurfaceMethod "registerDnd" o = SurfaceRegisterDndMethodInfo
    ResolveSurfaceMethod "resize" o = SurfaceResizeMethodInfo
    ResolveSurfaceMethod "restack" o = SurfaceRestackMethodInfo
    ResolveSurfaceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSurfaceMethod "show" o = SurfaceShowMethodInfo
    ResolveSurfaceMethod "showUnraised" o = SurfaceShowUnraisedMethodInfo
    ResolveSurfaceMethod "showWindowMenu" o = SurfaceShowWindowMenuMethodInfo
    ResolveSurfaceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSurfaceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSurfaceMethod "stick" o = SurfaceStickMethodInfo
    ResolveSurfaceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSurfaceMethod "thawUpdates" o = SurfaceThawUpdatesMethodInfo
    ResolveSurfaceMethod "unfullscreen" o = SurfaceUnfullscreenMethodInfo
    ResolveSurfaceMethod "unmaximize" o = SurfaceUnmaximizeMethodInfo
    ResolveSurfaceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSurfaceMethod "unstick" o = SurfaceUnstickMethodInfo
    ResolveSurfaceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSurfaceMethod "getAcceptFocus" o = SurfaceGetAcceptFocusMethodInfo
    ResolveSurfaceMethod "getChildren" o = SurfaceGetChildrenMethodInfo
    ResolveSurfaceMethod "getCursor" o = SurfaceGetCursorMethodInfo
    ResolveSurfaceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSurfaceMethod "getDecorations" o = SurfaceGetDecorationsMethodInfo
    ResolveSurfaceMethod "getDeviceCursor" o = SurfaceGetDeviceCursorMethodInfo
    ResolveSurfaceMethod "getDevicePosition" o = SurfaceGetDevicePositionMethodInfo
    ResolveSurfaceMethod "getDisplay" o = SurfaceGetDisplayMethodInfo
    ResolveSurfaceMethod "getFocusOnMap" o = SurfaceGetFocusOnMapMethodInfo
    ResolveSurfaceMethod "getFrameClock" o = SurfaceGetFrameClockMethodInfo
    ResolveSurfaceMethod "getFrameExtents" o = SurfaceGetFrameExtentsMethodInfo
    ResolveSurfaceMethod "getFullscreenMode" o = SurfaceGetFullscreenModeMethodInfo
    ResolveSurfaceMethod "getGeometry" o = SurfaceGetGeometryMethodInfo
    ResolveSurfaceMethod "getHeight" o = SurfaceGetHeightMethodInfo
    ResolveSurfaceMethod "getModalHint" o = SurfaceGetModalHintMethodInfo
    ResolveSurfaceMethod "getOrigin" o = SurfaceGetOriginMethodInfo
    ResolveSurfaceMethod "getParent" o = SurfaceGetParentMethodInfo
    ResolveSurfaceMethod "getPassThrough" o = SurfaceGetPassThroughMethodInfo
    ResolveSurfaceMethod "getPosition" o = SurfaceGetPositionMethodInfo
    ResolveSurfaceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSurfaceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSurfaceMethod "getRootCoords" o = SurfaceGetRootCoordsMethodInfo
    ResolveSurfaceMethod "getRootOrigin" o = SurfaceGetRootOriginMethodInfo
    ResolveSurfaceMethod "getScaleFactor" o = SurfaceGetScaleFactorMethodInfo
    ResolveSurfaceMethod "getState" o = SurfaceGetStateMethodInfo
    ResolveSurfaceMethod "getSupportMultidevice" o = SurfaceGetSupportMultideviceMethodInfo
    ResolveSurfaceMethod "getSurfaceType" o = SurfaceGetSurfaceTypeMethodInfo
    ResolveSurfaceMethod "getToplevel" o = SurfaceGetToplevelMethodInfo
    ResolveSurfaceMethod "getTypeHint" o = SurfaceGetTypeHintMethodInfo
    ResolveSurfaceMethod "getWidth" o = SurfaceGetWidthMethodInfo
    ResolveSurfaceMethod "setAcceptFocus" o = SurfaceSetAcceptFocusMethodInfo
    ResolveSurfaceMethod "setChildInputShapes" o = SurfaceSetChildInputShapesMethodInfo
    ResolveSurfaceMethod "setCursor" o = SurfaceSetCursorMethodInfo
    ResolveSurfaceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSurfaceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSurfaceMethod "setDecorations" o = SurfaceSetDecorationsMethodInfo
    ResolveSurfaceMethod "setDeviceCursor" o = SurfaceSetDeviceCursorMethodInfo
    ResolveSurfaceMethod "setFocusOnMap" o = SurfaceSetFocusOnMapMethodInfo
    ResolveSurfaceMethod "setFullscreenMode" o = SurfaceSetFullscreenModeMethodInfo
    ResolveSurfaceMethod "setFunctions" o = SurfaceSetFunctionsMethodInfo
    ResolveSurfaceMethod "setGeometryHints" o = SurfaceSetGeometryHintsMethodInfo
    ResolveSurfaceMethod "setIconList" o = SurfaceSetIconListMethodInfo
    ResolveSurfaceMethod "setIconName" o = SurfaceSetIconNameMethodInfo
    ResolveSurfaceMethod "setKeepAbove" o = SurfaceSetKeepAboveMethodInfo
    ResolveSurfaceMethod "setKeepBelow" o = SurfaceSetKeepBelowMethodInfo
    ResolveSurfaceMethod "setModalHint" o = SurfaceSetModalHintMethodInfo
    ResolveSurfaceMethod "setOpacity" o = SurfaceSetOpacityMethodInfo
    ResolveSurfaceMethod "setOpaqueRegion" o = SurfaceSetOpaqueRegionMethodInfo
    ResolveSurfaceMethod "setPassThrough" o = SurfaceSetPassThroughMethodInfo
    ResolveSurfaceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSurfaceMethod "setShadowWidth" o = SurfaceSetShadowWidthMethodInfo
    ResolveSurfaceMethod "setStartupId" o = SurfaceSetStartupIdMethodInfo
    ResolveSurfaceMethod "setSupportMultidevice" o = SurfaceSetSupportMultideviceMethodInfo
    ResolveSurfaceMethod "setTitle" o = SurfaceSetTitleMethodInfo
    ResolveSurfaceMethod "setTransientFor" o = SurfaceSetTransientForMethodInfo
    ResolveSurfaceMethod "setTypeHint" o = SurfaceSetTypeHintMethodInfo
    ResolveSurfaceMethod l o = O.MethodResolutionFailed l o

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

#endif

-- signal Surface::event
-- | Emitted when GDK receives an input event for /@surface@/.
type SurfaceEventCallback =
    Gdk.Event.Event
    -- ^ /@event@/: an input event
    -> IO Bool
    -- ^ __Returns:__ 'P.True' to indicate that the event has been handled

-- | A convenience synonym for @`Nothing` :: `Maybe` `SurfaceEventCallback`@.
noSurfaceEventCallback :: Maybe SurfaceEventCallback
noSurfaceEventCallback :: Maybe SurfaceEventCallback
noSurfaceEventCallback = Maybe SurfaceEventCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_SurfaceEvent :: MonadIO m => SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback)
genClosure_SurfaceEvent :: SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback)
genClosure_SurfaceEvent cb :: SurfaceEventCallback
cb = IO (GClosure C_SurfaceEventCallback)
-> m (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceEventCallback)
 -> m (GClosure C_SurfaceEventCallback))
-> IO (GClosure C_SurfaceEventCallback)
-> m (GClosure C_SurfaceEventCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
    C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb' IO (FunPtr C_SurfaceEventCallback)
-> (FunPtr C_SurfaceEventCallback
    -> IO (GClosure C_SurfaceEventCallback))
-> IO (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceEventCallback
-> IO (GClosure C_SurfaceEventCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SurfaceEventCallback` into a `C_SurfaceEventCallback`.
wrap_SurfaceEventCallback ::
    SurfaceEventCallback ->
    C_SurfaceEventCallback
wrap_SurfaceEventCallback :: SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback _cb :: SurfaceEventCallback
_cb _ event :: Ptr Event
event _ = do
    Event
event' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Event -> Event
Gdk.Event.Event) Ptr Event
event
    Bool
result <- SurfaceEventCallback
_cb  Event
event'
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- | Connect a signal handler for the [event](#signal:event) 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' surface #event callback
-- @
-- 
-- 
onSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
onSurfaceEvent :: a -> SurfaceEventCallback -> m SignalHandlerId
onSurfaceEvent obj :: a
obj cb :: SurfaceEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
    FunPtr C_SurfaceEventCallback
cb'' <- C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "event" FunPtr C_SurfaceEventCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [event](#signal:event) 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' surface #event callback
-- @
-- 
-- 
afterSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
afterSurfaceEvent :: a -> SurfaceEventCallback -> m SignalHandlerId
afterSurfaceEvent obj :: a
obj cb :: SurfaceEventCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceEventCallback
cb' = SurfaceEventCallback -> C_SurfaceEventCallback
wrap_SurfaceEventCallback SurfaceEventCallback
cb
    FunPtr C_SurfaceEventCallback
cb'' <- C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
mk_SurfaceEventCallback C_SurfaceEventCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceEventCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "event" FunPtr C_SurfaceEventCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SurfaceEventSignalInfo
instance SignalInfo SurfaceEventSignalInfo where
    type HaskellCallbackType SurfaceEventSignalInfo = SurfaceEventCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SurfaceEventCallback cb
        cb'' <- mk_SurfaceEventCallback cb'
        connectSignalFunPtr obj "event" cb'' connectMode detail

#endif

-- signal Surface::moved-to-rect
-- | Emitted when the position of /@surface@/ is finalized after being moved to a
-- destination rectangle.
-- 
-- /@surface@/ might be flipped over the destination rectangle in order to keep
-- it on-screen, in which case /@flippedX@/ and /@flippedY@/ will be set to 'P.True'
-- accordingly.
-- 
-- /@flippedRect@/ is the ideal position of /@surface@/ after any possible
-- flipping, but before any possible sliding. /@finalRect@/ is /@flippedRect@/,
-- but possibly translated in the case that flipping is still ineffective in
-- keeping /@surface@/ on-screen.
type SurfaceMovedToRectCallback =
    Ptr ()
    -- ^ /@flippedRect@/: the position of /@surface@/ after any possible
    --                flipping or 'P.Nothing' if the backend can\'t obtain it
    -> Ptr ()
    -- ^ /@finalRect@/: the final position of /@surface@/ or 'P.Nothing' if the
    --              backend can\'t obtain it
    -> Bool
    -- ^ /@flippedX@/: 'P.True' if the anchors were flipped horizontally
    -> Bool
    -- ^ /@flippedY@/: 'P.True' if the anchors were flipped vertically
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SurfaceMovedToRectCallback`@.
noSurfaceMovedToRectCallback :: Maybe SurfaceMovedToRectCallback
noSurfaceMovedToRectCallback :: Maybe SurfaceMovedToRectCallback
noSurfaceMovedToRectCallback = Maybe SurfaceMovedToRectCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_SurfaceMovedToRect :: MonadIO m => SurfaceMovedToRectCallback -> m (GClosure C_SurfaceMovedToRectCallback)
genClosure_SurfaceMovedToRect :: SurfaceMovedToRectCallback
-> m (GClosure C_SurfaceMovedToRectCallback)
genClosure_SurfaceMovedToRect cb :: SurfaceMovedToRectCallback
cb = IO (GClosure C_SurfaceMovedToRectCallback)
-> m (GClosure C_SurfaceMovedToRectCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceMovedToRectCallback)
 -> m (GClosure C_SurfaceMovedToRectCallback))
-> IO (GClosure C_SurfaceMovedToRectCallback)
-> m (GClosure C_SurfaceMovedToRectCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceMovedToRectCallback
cb' = SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback
wrap_SurfaceMovedToRectCallback SurfaceMovedToRectCallback
cb
    C_SurfaceMovedToRectCallback
-> IO (FunPtr C_SurfaceMovedToRectCallback)
mk_SurfaceMovedToRectCallback C_SurfaceMovedToRectCallback
cb' IO (FunPtr C_SurfaceMovedToRectCallback)
-> (FunPtr C_SurfaceMovedToRectCallback
    -> IO (GClosure C_SurfaceMovedToRectCallback))
-> IO (GClosure C_SurfaceMovedToRectCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceMovedToRectCallback
-> IO (GClosure C_SurfaceMovedToRectCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SurfaceMovedToRectCallback` into a `C_SurfaceMovedToRectCallback`.
wrap_SurfaceMovedToRectCallback ::
    SurfaceMovedToRectCallback ->
    C_SurfaceMovedToRectCallback
wrap_SurfaceMovedToRectCallback :: SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback
wrap_SurfaceMovedToRectCallback _cb :: SurfaceMovedToRectCallback
_cb _ flippedRect :: Ptr ()
flippedRect finalRect :: Ptr ()
finalRect flippedX :: CInt
flippedX flippedY :: CInt
flippedY _ = do
    let flippedX' :: Bool
flippedX' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
flippedX
    let flippedY' :: Bool
flippedY' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
flippedY
    SurfaceMovedToRectCallback
_cb  Ptr ()
flippedRect Ptr ()
finalRect Bool
flippedX' Bool
flippedY'


-- | Connect a signal handler for the [movedToRect](#signal:movedToRect) 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' surface #movedToRect callback
-- @
-- 
-- 
onSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId
onSurfaceMovedToRect :: a -> SurfaceMovedToRectCallback -> m SignalHandlerId
onSurfaceMovedToRect obj :: a
obj cb :: SurfaceMovedToRectCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceMovedToRectCallback
cb' = SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback
wrap_SurfaceMovedToRectCallback SurfaceMovedToRectCallback
cb
    FunPtr C_SurfaceMovedToRectCallback
cb'' <- C_SurfaceMovedToRectCallback
-> IO (FunPtr C_SurfaceMovedToRectCallback)
mk_SurfaceMovedToRectCallback C_SurfaceMovedToRectCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceMovedToRectCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "moved-to-rect" FunPtr C_SurfaceMovedToRectCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [movedToRect](#signal:movedToRect) 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' surface #movedToRect callback
-- @
-- 
-- 
afterSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId
afterSurfaceMovedToRect :: a -> SurfaceMovedToRectCallback -> m SignalHandlerId
afterSurfaceMovedToRect obj :: a
obj cb :: SurfaceMovedToRectCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceMovedToRectCallback
cb' = SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback
wrap_SurfaceMovedToRectCallback SurfaceMovedToRectCallback
cb
    FunPtr C_SurfaceMovedToRectCallback
cb'' <- C_SurfaceMovedToRectCallback
-> IO (FunPtr C_SurfaceMovedToRectCallback)
mk_SurfaceMovedToRectCallback C_SurfaceMovedToRectCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceMovedToRectCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "moved-to-rect" FunPtr C_SurfaceMovedToRectCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SurfaceMovedToRectSignalInfo
instance SignalInfo SurfaceMovedToRectSignalInfo where
    type HaskellCallbackType SurfaceMovedToRectSignalInfo = SurfaceMovedToRectCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SurfaceMovedToRectCallback cb
        cb'' <- mk_SurfaceMovedToRectCallback cb'
        connectSignalFunPtr obj "moved-to-rect" cb'' connectMode detail

#endif

-- signal Surface::render
-- | Emitted when part of the surface needs to be redrawn.
type SurfaceRenderCallback =
    Cairo.Region.Region
    -- ^ /@region@/: the region that needs to be redrawn
    -> IO Bool
    -- ^ __Returns:__ 'P.True' to indicate that the signal has been handled

-- | A convenience synonym for @`Nothing` :: `Maybe` `SurfaceRenderCallback`@.
noSurfaceRenderCallback :: Maybe SurfaceRenderCallback
noSurfaceRenderCallback :: Maybe SurfaceRenderCallback
noSurfaceRenderCallback = Maybe SurfaceRenderCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_SurfaceRender :: MonadIO m => SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback)
genClosure_SurfaceRender :: SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback)
genClosure_SurfaceRender cb :: SurfaceRenderCallback
cb = IO (GClosure C_SurfaceRenderCallback)
-> m (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceRenderCallback)
 -> m (GClosure C_SurfaceRenderCallback))
-> IO (GClosure C_SurfaceRenderCallback)
-> m (GClosure C_SurfaceRenderCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
    C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb' IO (FunPtr C_SurfaceRenderCallback)
-> (FunPtr C_SurfaceRenderCallback
    -> IO (GClosure C_SurfaceRenderCallback))
-> IO (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceRenderCallback
-> IO (GClosure C_SurfaceRenderCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SurfaceRenderCallback` into a `C_SurfaceRenderCallback`.
wrap_SurfaceRenderCallback ::
    SurfaceRenderCallback ->
    C_SurfaceRenderCallback
wrap_SurfaceRenderCallback :: SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback _cb :: SurfaceRenderCallback
_cb _ region :: Ptr Region
region _ = do
    (ManagedPtr Region -> Region)
-> Ptr Region -> (Region -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Region -> Region
Cairo.Region.Region Ptr Region
region ((Region -> IO CInt) -> IO CInt) -> (Region -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \region' :: Region
region' -> do
        Bool
result <- SurfaceRenderCallback
_cb  Region
region'
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- | Connect a signal handler for the [render](#signal:render) 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' surface #render callback
-- @
-- 
-- 
onSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
onSurfaceRender :: a -> SurfaceRenderCallback -> m SignalHandlerId
onSurfaceRender obj :: a
obj cb :: SurfaceRenderCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
    FunPtr C_SurfaceRenderCallback
cb'' <- C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceRenderCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "render" FunPtr C_SurfaceRenderCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [render](#signal:render) 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' surface #render callback
-- @
-- 
-- 
afterSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
afterSurfaceRender :: a -> SurfaceRenderCallback -> m SignalHandlerId
afterSurfaceRender obj :: a
obj cb :: SurfaceRenderCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceRenderCallback
cb' = SurfaceRenderCallback -> C_SurfaceRenderCallback
wrap_SurfaceRenderCallback SurfaceRenderCallback
cb
    FunPtr C_SurfaceRenderCallback
cb'' <- C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
mk_SurfaceRenderCallback C_SurfaceRenderCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceRenderCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "render" FunPtr C_SurfaceRenderCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SurfaceRenderSignalInfo
instance SignalInfo SurfaceRenderSignalInfo where
    type HaskellCallbackType SurfaceRenderSignalInfo = SurfaceRenderCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SurfaceRenderCallback cb
        cb'' <- mk_SurfaceRenderCallback cb'
        connectSignalFunPtr obj "render" cb'' connectMode detail

#endif

-- signal Surface::size-changed
-- | Emitted when the size of /@surface@/ is changed.
type SurfaceSizeChangedCallback =
    Int32
    -- ^ /@width@/: the new width
    -> Int32
    -- ^ /@height@/: the new height
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `SurfaceSizeChangedCallback`@.
noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback
noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback
noSurfaceSizeChangedCallback = Maybe SurfaceSizeChangedCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_SurfaceSizeChanged :: MonadIO m => SurfaceSizeChangedCallback -> m (GClosure C_SurfaceSizeChangedCallback)
genClosure_SurfaceSizeChanged :: SurfaceSizeChangedCallback
-> m (GClosure C_SurfaceSizeChangedCallback)
genClosure_SurfaceSizeChanged cb :: SurfaceSizeChangedCallback
cb = IO (GClosure C_SurfaceSizeChangedCallback)
-> m (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SurfaceSizeChangedCallback)
 -> m (GClosure C_SurfaceSizeChangedCallback))
-> IO (GClosure C_SurfaceSizeChangedCallback)
-> m (GClosure C_SurfaceSizeChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
    C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb' IO (FunPtr C_SurfaceSizeChangedCallback)
-> (FunPtr C_SurfaceSizeChangedCallback
    -> IO (GClosure C_SurfaceSizeChangedCallback))
-> IO (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SurfaceSizeChangedCallback
-> IO (GClosure C_SurfaceSizeChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `SurfaceSizeChangedCallback` into a `C_SurfaceSizeChangedCallback`.
wrap_SurfaceSizeChangedCallback ::
    SurfaceSizeChangedCallback ->
    C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback :: SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback _cb :: SurfaceSizeChangedCallback
_cb _ width :: Int32
width height :: Int32
height _ = do
    SurfaceSizeChangedCallback
_cb  Int32
width Int32
height


-- | Connect a signal handler for the [sizeChanged](#signal:sizeChanged) 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' surface #sizeChanged callback
-- @
-- 
-- 
onSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
onSurfaceSizeChanged :: a -> SurfaceSizeChangedCallback -> m SignalHandlerId
onSurfaceSizeChanged obj :: a
obj cb :: SurfaceSizeChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
    FunPtr C_SurfaceSizeChangedCallback
cb'' <- C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceSizeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "size-changed" FunPtr C_SurfaceSizeChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [sizeChanged](#signal:sizeChanged) 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' surface #sizeChanged callback
-- @
-- 
-- 
afterSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
afterSurfaceSizeChanged :: a -> SurfaceSizeChangedCallback -> m SignalHandlerId
afterSurfaceSizeChanged obj :: a
obj cb :: SurfaceSizeChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_SurfaceSizeChangedCallback
cb' = SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
wrap_SurfaceSizeChangedCallback SurfaceSizeChangedCallback
cb
    FunPtr C_SurfaceSizeChangedCallback
cb'' <- C_SurfaceSizeChangedCallback
-> IO (FunPtr C_SurfaceSizeChangedCallback)
mk_SurfaceSizeChangedCallback C_SurfaceSizeChangedCallback
cb'
    a
-> Text
-> FunPtr C_SurfaceSizeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "size-changed" FunPtr C_SurfaceSizeChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SurfaceSizeChangedSignalInfo
instance SignalInfo SurfaceSizeChangedSignalInfo where
    type HaskellCallbackType SurfaceSizeChangedSignalInfo = SurfaceSizeChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SurfaceSizeChangedCallback cb
        cb'' <- mk_SurfaceSizeChangedCallback cb'
        connectSignalFunPtr obj "size-changed" cb'' connectMode detail

#endif

-- VVV Prop "cursor"
   -- Type: TInterface (Name {namespace = "Gdk", name = "Cursor"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

-- | Get the value of the “@cursor@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' surface #cursor
-- @
getSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m (Maybe Gdk.Cursor.Cursor)
getSurfaceCursor :: o -> m (Maybe Cursor)
getSurfaceCursor obj :: o
obj = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Cursor -> Cursor) -> IO (Maybe Cursor)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "cursor" ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor

-- | Set the value of the “@cursor@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' surface [ #cursor 'Data.GI.Base.Attributes.:=' value ]
-- @
setSurfaceCursor :: (MonadIO m, IsSurface o, Gdk.Cursor.IsCursor a) => o -> a -> m ()
setSurfaceCursor :: o -> a -> m ()
setSurfaceCursor obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "cursor" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@cursor@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSurfaceCursor :: (IsSurface o, Gdk.Cursor.IsCursor a) => a -> IO (GValueConstruct o)
constructSurfaceCursor :: a -> IO (GValueConstruct o)
constructSurfaceCursor val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "cursor" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Set the value of the “@cursor@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #cursor
-- @
clearSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m ()
clearSurfaceCursor :: o -> m ()
clearSurfaceCursor obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Cursor -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "cursor" (Maybe Cursor
forall a. Maybe a
Nothing :: Maybe Gdk.Cursor.Cursor)

#if defined(ENABLE_OVERLOADING)
data SurfaceCursorPropertyInfo
instance AttrInfo SurfaceCursorPropertyInfo where
    type AttrAllowedOps SurfaceCursorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SurfaceCursorPropertyInfo = IsSurface
    type AttrSetTypeConstraint SurfaceCursorPropertyInfo = Gdk.Cursor.IsCursor
    type AttrTransferTypeConstraint SurfaceCursorPropertyInfo = Gdk.Cursor.IsCursor
    type AttrTransferType SurfaceCursorPropertyInfo = Gdk.Cursor.Cursor
    type AttrGetType SurfaceCursorPropertyInfo = (Maybe Gdk.Cursor.Cursor)
    type AttrLabel SurfaceCursorPropertyInfo = "cursor"
    type AttrOrigin SurfaceCursorPropertyInfo = Surface
    attrGet = getSurfaceCursor
    attrSet = setSurfaceCursor
    attrTransfer _ v = do
        unsafeCastTo Gdk.Cursor.Cursor v
    attrConstruct = constructSurfaceCursor
    attrClear = clearSurfaceCursor
#endif

-- VVV Prop "display"
   -- Type: TInterface (Name {namespace = "Gdk", name = "Display"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@display@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' surface #display
-- @
getSurfaceDisplay :: (MonadIO m, IsSurface o) => o -> m Gdk.Display.Display
getSurfaceDisplay :: o -> m Display
getSurfaceDisplay obj :: o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getSurfaceDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO Display
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "display" ManagedPtr Display -> Display
Gdk.Display.Display

-- | Construct a `GValueConstruct` with valid value for the “@display@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSurfaceDisplay :: (IsSurface o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructSurfaceDisplay :: a -> IO (GValueConstruct o)
constructSurfaceDisplay val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "display" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

#if defined(ENABLE_OVERLOADING)
data SurfaceDisplayPropertyInfo
instance AttrInfo SurfaceDisplayPropertyInfo where
    type AttrAllowedOps SurfaceDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SurfaceDisplayPropertyInfo = IsSurface
    type AttrSetTypeConstraint SurfaceDisplayPropertyInfo = Gdk.Display.IsDisplay
    type AttrTransferTypeConstraint SurfaceDisplayPropertyInfo = Gdk.Display.IsDisplay
    type AttrTransferType SurfaceDisplayPropertyInfo = Gdk.Display.Display
    type AttrGetType SurfaceDisplayPropertyInfo = Gdk.Display.Display
    type AttrLabel SurfaceDisplayPropertyInfo = "display"
    type AttrOrigin SurfaceDisplayPropertyInfo = Surface
    attrGet = getSurfaceDisplay
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Gdk.Display.Display v
    attrConstruct = constructSurfaceDisplay
    attrClear = undefined
#endif

-- VVV Prop "frame-clock"
   -- Type: TInterface (Name {namespace = "Gdk", name = "FrameClock"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@frame-clock@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' surface #frameClock
-- @
getSurfaceFrameClock :: (MonadIO m, IsSurface o) => o -> m Gdk.FrameClock.FrameClock
getSurfaceFrameClock :: o -> m FrameClock
getSurfaceFrameClock obj :: o
obj = IO FrameClock -> m FrameClock
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FrameClock -> m FrameClock) -> IO FrameClock -> m FrameClock
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe FrameClock) -> IO FrameClock
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getSurfaceFrameClock" (IO (Maybe FrameClock) -> IO FrameClock)
-> IO (Maybe FrameClock) -> IO FrameClock
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr FrameClock -> FrameClock)
-> IO (Maybe FrameClock)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "frame-clock" ManagedPtr FrameClock -> FrameClock
Gdk.FrameClock.FrameClock

-- | Construct a `GValueConstruct` with valid value for the “@frame-clock@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSurfaceFrameClock :: (IsSurface o, Gdk.FrameClock.IsFrameClock a) => a -> IO (GValueConstruct o)
constructSurfaceFrameClock :: a -> IO (GValueConstruct o)
constructSurfaceFrameClock val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "frame-clock" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

#if defined(ENABLE_OVERLOADING)
data SurfaceFrameClockPropertyInfo
instance AttrInfo SurfaceFrameClockPropertyInfo where
    type AttrAllowedOps SurfaceFrameClockPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SurfaceFrameClockPropertyInfo = IsSurface
    type AttrSetTypeConstraint SurfaceFrameClockPropertyInfo = Gdk.FrameClock.IsFrameClock
    type AttrTransferTypeConstraint SurfaceFrameClockPropertyInfo = Gdk.FrameClock.IsFrameClock
    type AttrTransferType SurfaceFrameClockPropertyInfo = Gdk.FrameClock.FrameClock
    type AttrGetType SurfaceFrameClockPropertyInfo = Gdk.FrameClock.FrameClock
    type AttrLabel SurfaceFrameClockPropertyInfo = "frame-clock"
    type AttrOrigin SurfaceFrameClockPropertyInfo = Surface
    attrGet = getSurfaceFrameClock
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Gdk.FrameClock.FrameClock v
    attrConstruct = constructSurfaceFrameClock
    attrClear = undefined
#endif

-- VVV Prop "mapped"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@mapped@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' surface #mapped
-- @
getSurfaceMapped :: (MonadIO m, IsSurface o) => o -> m Bool
getSurfaceMapped :: o -> m Bool
getSurfaceMapped obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "mapped"

#if defined(ENABLE_OVERLOADING)
data SurfaceMappedPropertyInfo
instance AttrInfo SurfaceMappedPropertyInfo where
    type AttrAllowedOps SurfaceMappedPropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint SurfaceMappedPropertyInfo = IsSurface
    type AttrSetTypeConstraint SurfaceMappedPropertyInfo = (~) ()
    type AttrTransferTypeConstraint SurfaceMappedPropertyInfo = (~) ()
    type AttrTransferType SurfaceMappedPropertyInfo = ()
    type AttrGetType SurfaceMappedPropertyInfo = Bool
    type AttrLabel SurfaceMappedPropertyInfo = "mapped"
    type AttrOrigin SurfaceMappedPropertyInfo = Surface
    attrGet = getSurfaceMapped
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

-- VVV Prop "state"
   -- Type: TInterface (Name {namespace = "Gdk", name = "SurfaceState"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@state@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' surface #state
-- @
getSurfaceState :: (MonadIO m, IsSurface o) => o -> m [Gdk.Flags.SurfaceState]
getSurfaceState :: o -> m [SurfaceState]
getSurfaceState obj :: o
obj = IO [SurfaceState] -> m [SurfaceState]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SurfaceState] -> m [SurfaceState])
-> IO [SurfaceState] -> m [SurfaceState]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [SurfaceState]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "state"

#if defined(ENABLE_OVERLOADING)
data SurfaceStatePropertyInfo
instance AttrInfo SurfaceStatePropertyInfo where
    type AttrAllowedOps SurfaceStatePropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint SurfaceStatePropertyInfo = IsSurface
    type AttrSetTypeConstraint SurfaceStatePropertyInfo = (~) ()
    type AttrTransferTypeConstraint SurfaceStatePropertyInfo = (~) ()
    type AttrTransferType SurfaceStatePropertyInfo = ()
    type AttrGetType SurfaceStatePropertyInfo = [Gdk.Flags.SurfaceState]
    type AttrLabel SurfaceStatePropertyInfo = "state"
    type AttrOrigin SurfaceStatePropertyInfo = Surface
    attrGet = getSurfaceState
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Surface
type instance O.AttributeList Surface = SurfaceAttributeList
type SurfaceAttributeList = ('[ '("cursor", SurfaceCursorPropertyInfo), '("display", SurfaceDisplayPropertyInfo), '("frameClock", SurfaceFrameClockPropertyInfo), '("mapped", SurfaceMappedPropertyInfo), '("state", SurfaceStatePropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
surfaceCursor :: AttrLabelProxy "cursor"
surfaceCursor = AttrLabelProxy

surfaceDisplay :: AttrLabelProxy "display"
surfaceDisplay = AttrLabelProxy

surfaceFrameClock :: AttrLabelProxy "frameClock"
surfaceFrameClock = AttrLabelProxy

surfaceMapped :: AttrLabelProxy "mapped"
surfaceMapped = AttrLabelProxy

surfaceState :: AttrLabelProxy "state"
surfaceState = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Surface = SurfaceSignalList
type SurfaceSignalList = ('[ '("event", SurfaceEventSignalInfo), '("movedToRect", SurfaceMovedToRectSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("render", SurfaceRenderSignalInfo), '("sizeChanged", SurfaceSizeChangedSignalInfo)] :: [(Symbol, *)])

#endif

-- method Surface::new_child
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "parent"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the parent surface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "position"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Rectangle" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "placement of the surface inside @parent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_new_child" gdk_surface_new_child :: 
    Ptr Surface ->                          -- parent : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Rectangle.Rectangle ->          -- position : TInterface (Name {namespace = "Gdk", name = "Rectangle"})
    IO (Ptr Surface)

-- | Creates a new client-side child surface.
surfaceNewChild ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@parent@/: the parent surface
    -> Gdk.Rectangle.Rectangle
    -- ^ /@position@/: placement of the surface inside /@parent@/
    -> m Surface
    -- ^ __Returns:__ the new t'GI.Gdk.Objects.Surface.Surface'
surfaceNewChild :: a -> Rectangle -> m Surface
surfaceNewChild parent :: a
parent position :: Rectangle
position = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
parent' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
parent
    Ptr Rectangle
position' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
position
    Ptr Surface
result <- Ptr Surface -> Ptr Rectangle -> IO (Ptr Surface)
gdk_surface_new_child Ptr Surface
parent' Ptr Rectangle
position'
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceNewChild" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
parent
    Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
position
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Surface::new_popup
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the display to create the surface on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "position"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Rectangle" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "position of the surface on screen"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_new_popup" gdk_surface_new_popup :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Ptr Gdk.Rectangle.Rectangle ->          -- position : TInterface (Name {namespace = "Gdk", name = "Rectangle"})
    IO (Ptr Surface)

-- | Creates a new toplevel popup surface. The surface will bypass surface
-- management.
surfaceNewPopup ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    a
    -- ^ /@display@/: the display to create the surface on
    -> Gdk.Rectangle.Rectangle
    -- ^ /@position@/: position of the surface on screen
    -> m Surface
    -- ^ __Returns:__ the new t'GI.Gdk.Objects.Surface.Surface'
surfaceNewPopup :: a -> Rectangle -> m Surface
surfaceNewPopup display :: a
display position :: Rectangle
position = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr Rectangle
position' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
position
    Ptr Surface
result <- Ptr Display -> Ptr Rectangle -> IO (Ptr Surface)
gdk_surface_new_popup Ptr Display
display' Ptr Rectangle
position'
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceNewPopup" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
position
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Surface::new_temp
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the display to create the surface on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_new_temp" gdk_surface_new_temp :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    IO (Ptr Surface)

-- | Creates a new toplevel temporary surface. The surface will be
-- situated off-screen and not handle output.
-- 
-- You most likely do not want to use this function.
surfaceNewTemp ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    a
    -- ^ /@display@/: the display to create the surface on
    -> m Surface
    -- ^ __Returns:__ the new t'GI.Gdk.Objects.Surface.Surface'
surfaceNewTemp :: a -> m Surface
surfaceNewTemp display :: a
display = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr Surface
result <- Ptr Display -> IO (Ptr Surface)
gdk_surface_new_temp Ptr Display
display'
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceNewTemp" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Surface::new_toplevel
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the display to create the surface on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "width of new surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "height of new surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_new_toplevel" gdk_surface_new_toplevel :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO (Ptr Surface)

-- | Creates a new toplevel surface. The surface will be managed by the surface
-- manager.
surfaceNewToplevel ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    a
    -- ^ /@display@/: the display to create the surface on
    -> Int32
    -- ^ /@width@/: width of new surface
    -> Int32
    -- ^ /@height@/: height of new surface
    -> m Surface
    -- ^ __Returns:__ the new t'GI.Gdk.Objects.Surface.Surface'
surfaceNewToplevel :: a -> Int32 -> Int32 -> m Surface
surfaceNewToplevel display :: a
display width :: Int32
width height :: Int32
height = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr Surface
result <- Ptr Display -> Int32 -> Int32 -> IO (Ptr Surface)
gdk_surface_new_toplevel Ptr Display
display' Int32
width Int32
height
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceNewToplevel" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "gdk_surface_beep" gdk_surface_beep :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Emits a short beep associated to /@surface@/ in the appropriate
-- display, if supported. Otherwise, emits a short beep on
-- the display just as 'GI.Gdk.Objects.Display.displayBeep'.
surfaceBeep ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceBeep :: a -> m ()
surfaceBeep surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_beep Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceBeepMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceBeepMethodInfo a signature where
    overloadedMethod = surfaceBeep

#endif

-- method Surface::begin_move_drag
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "button"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the button being used to drag, or 0 for a keyboard-initiated drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface X coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface Y coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "timestamp of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_begin_move_drag" gdk_surface_begin_move_drag :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- button : TBasicType TInt
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | Begins a surface move operation (for a toplevel surface).
-- 
-- This function assumes that the drag is controlled by the
-- client pointer device, use 'GI.Gdk.Objects.Surface.surfaceBeginMoveDragForDevice'
-- to begin a drag with a different device.
surfaceBeginMoveDrag ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@button@/: the button being used to drag, or 0 for a keyboard-initiated drag
    -> Int32
    -- ^ /@x@/: surface X coordinate of mouse click that began the drag
    -> Int32
    -- ^ /@y@/: surface Y coordinate of mouse click that began the drag
    -> Word32
    -- ^ /@timestamp@/: timestamp of mouse click that began the drag
    -> m ()
surfaceBeginMoveDrag :: a -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
surfaceBeginMoveDrag surface :: a
surface button :: Int32
button x :: Int32
x y :: Int32
y timestamp :: Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> Int32 -> Int32 -> Int32 -> Word32 -> IO ()
gdk_surface_begin_move_drag Ptr Surface
surface' Int32
button Int32
x Int32
y Word32
timestamp
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceBeginMoveDragMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Word32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceBeginMoveDragMethodInfo a signature where
    overloadedMethod = surfaceBeginMoveDrag

#endif

-- method Surface::begin_move_drag_for_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the device used for the operation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "button"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the button being used to drag, or 0 for a keyboard-initiated drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface X coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface Y coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "timestamp of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_begin_move_drag_for_device" gdk_surface_begin_move_drag_for_device :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    Int32 ->                                -- button : TBasicType TInt
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | Begins a surface move operation (for a toplevel surface).
surfaceBeginMoveDragForDevice ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> b
    -- ^ /@device@/: the device used for the operation
    -> Int32
    -- ^ /@button@/: the button being used to drag, or 0 for a keyboard-initiated drag
    -> Int32
    -- ^ /@x@/: surface X coordinate of mouse click that began the drag
    -> Int32
    -- ^ /@y@/: surface Y coordinate of mouse click that began the drag
    -> Word32
    -- ^ /@timestamp@/: timestamp of mouse click that began the drag
    -> m ()
surfaceBeginMoveDragForDevice :: a -> b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
surfaceBeginMoveDragForDevice surface :: a
surface device :: b
device button :: Int32
button x :: Int32
x y :: Int32
y timestamp :: Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
    Ptr Surface
-> Ptr Device -> Int32 -> Int32 -> Int32 -> Word32 -> IO ()
gdk_surface_begin_move_drag_for_device Ptr Surface
surface' Ptr Device
device' Int32
button Int32
x Int32
y Word32
timestamp
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceBeginMoveDragForDeviceMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceBeginMoveDragForDeviceMethodInfo a signature where
    overloadedMethod = surfaceBeginMoveDragForDevice

#endif

-- method Surface::begin_resize_drag
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "SurfaceEdge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the edge or corner from which the drag is started"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "button"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the button being used to drag, or 0 for a keyboard-initiated drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface X coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface Y coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "timestamp of mouse click that began the drag (use gdk_event_get_time())"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_begin_resize_drag" gdk_surface_begin_resize_drag :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "Gdk", name = "SurfaceEdge"})
    Int32 ->                                -- button : TBasicType TInt
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | Begins a surface resize operation (for a toplevel surface).
-- 
-- This function assumes that the drag is controlled by the
-- client pointer device, use 'GI.Gdk.Objects.Surface.surfaceBeginResizeDragForDevice'
-- to begin a drag with a different device.
surfaceBeginResizeDrag ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Gdk.Enums.SurfaceEdge
    -- ^ /@edge@/: the edge or corner from which the drag is started
    -> Int32
    -- ^ /@button@/: the button being used to drag, or 0 for a keyboard-initiated drag
    -> Int32
    -- ^ /@x@/: surface X coordinate of mouse click that began the drag
    -> Int32
    -- ^ /@y@/: surface Y coordinate of mouse click that began the drag
    -> Word32
    -- ^ /@timestamp@/: timestamp of mouse click that began the drag (use 'GI.Gdk.Objects.Event.eventGetTime')
    -> m ()
surfaceBeginResizeDrag :: a -> SurfaceEdge -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
surfaceBeginResizeDrag surface :: a
surface edge :: SurfaceEdge
edge button :: Int32
button x :: Int32
x y :: Int32
y timestamp :: Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SurfaceEdge -> Int) -> SurfaceEdge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SurfaceEdge -> Int
forall a. Enum a => a -> Int
fromEnum) SurfaceEdge
edge
    Ptr Surface -> CUInt -> Int32 -> Int32 -> Int32 -> Word32 -> IO ()
gdk_surface_begin_resize_drag Ptr Surface
surface' CUInt
edge' Int32
button Int32
x Int32
y Word32
timestamp
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceBeginResizeDragMethodInfo
instance (signature ~ (Gdk.Enums.SurfaceEdge -> Int32 -> Int32 -> Int32 -> Word32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceBeginResizeDragMethodInfo a signature where
    overloadedMethod = surfaceBeginResizeDrag

#endif

-- method Surface::begin_resize_drag_for_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "edge"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "SurfaceEdge" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the edge or corner from which the drag is started"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the device used for the operation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "button"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the button being used to drag, or 0 for a keyboard-initiated drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface X coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "surface Y coordinate of mouse click that began the drag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "timestamp of mouse click that began the drag (use gdk_event_get_time())"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_begin_resize_drag_for_device" gdk_surface_begin_resize_drag_for_device :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- edge : TInterface (Name {namespace = "Gdk", name = "SurfaceEdge"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    Int32 ->                                -- button : TBasicType TInt
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | Begins a surface resize operation (for a toplevel surface).
-- You might use this function to implement a “window resize grip,”
surfaceBeginResizeDragForDevice ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Gdk.Enums.SurfaceEdge
    -- ^ /@edge@/: the edge or corner from which the drag is started
    -> b
    -- ^ /@device@/: the device used for the operation
    -> Int32
    -- ^ /@button@/: the button being used to drag, or 0 for a keyboard-initiated drag
    -> Int32
    -- ^ /@x@/: surface X coordinate of mouse click that began the drag
    -> Int32
    -- ^ /@y@/: surface Y coordinate of mouse click that began the drag
    -> Word32
    -- ^ /@timestamp@/: timestamp of mouse click that began the drag (use 'GI.Gdk.Objects.Event.eventGetTime')
    -> m ()
surfaceBeginResizeDragForDevice :: a -> SurfaceEdge -> b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
surfaceBeginResizeDragForDevice surface :: a
surface edge :: SurfaceEdge
edge device :: b
device button :: Int32
button x :: Int32
x y :: Int32
y timestamp :: Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let edge' :: CUInt
edge' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SurfaceEdge -> Int) -> SurfaceEdge -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SurfaceEdge -> Int
forall a. Enum a => a -> Int
fromEnum) SurfaceEdge
edge
    Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
    Ptr Surface
-> CUInt
-> Ptr Device
-> Int32
-> Int32
-> Int32
-> Word32
-> IO ()
gdk_surface_begin_resize_drag_for_device Ptr Surface
surface' CUInt
edge' Ptr Device
device' Int32
button Int32
x Int32
y Word32
timestamp
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceBeginResizeDragForDeviceMethodInfo
instance (signature ~ (Gdk.Enums.SurfaceEdge -> b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceBeginResizeDragForDeviceMethodInfo a signature where
    overloadedMethod = surfaceBeginResizeDragForDevice

#endif

-- method Surface::coords_from_parent
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a child surface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "X coordinate in parent\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Y coordinate in parent\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for X coordinate in child\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for Y coordinate in child\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_coords_from_parent" gdk_surface_coords_from_parent :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CDouble ->                              -- parent_x : TBasicType TDouble
    CDouble ->                              -- parent_y : TBasicType TDouble
    Ptr CDouble ->                          -- x : TBasicType TDouble
    Ptr CDouble ->                          -- y : TBasicType TDouble
    IO ()

-- | Transforms surface coordinates from a parent surface to a child
-- surface.
-- 
-- Calling this function is equivalent to subtracting the return
-- values of 'GI.Gdk.Objects.Surface.surfaceGetPosition' from the parent coordinates.
-- 
-- See also: 'GI.Gdk.Objects.Surface.surfaceCoordsToParent'
surfaceCoordsFromParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a child surface
    -> Double
    -- ^ /@parentX@/: X coordinate in parent’s coordinate system
    -> Double
    -- ^ /@parentY@/: Y coordinate in parent’s coordinate system
    -> m ((Double, Double))
surfaceCoordsFromParent :: a -> Double -> Double -> m (Double, Double)
surfaceCoordsFromParent surface :: a
surface parentX :: Double
parentX parentY :: Double
parentY = IO (Double, Double) -> m (Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Double, Double) -> m (Double, Double))
-> IO (Double, Double) -> m (Double, Double)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let parentX' :: CDouble
parentX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
parentX
    let parentY' :: CDouble
parentY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
parentY
    Ptr CDouble
x <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr CDouble
y <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr Surface
-> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO ()
gdk_surface_coords_from_parent Ptr Surface
surface' CDouble
parentX' CDouble
parentY' Ptr CDouble
x Ptr CDouble
y
    CDouble
x' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
x
    let x'' :: Double
x'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x'
    CDouble
y' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
y
    let y'' :: Double
y'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
x
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
y
    (Double, Double) -> IO (Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x'', Double
y'')

#if defined(ENABLE_OVERLOADING)
data SurfaceCoordsFromParentMethodInfo
instance (signature ~ (Double -> Double -> m ((Double, Double))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCoordsFromParentMethodInfo a signature where
    overloadedMethod = surfaceCoordsFromParent

#endif

-- method Surface::coords_to_parent
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a child surface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate in child\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate in child\8217s coordinate system"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_x"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for X coordinate\nin parent\8217s coordinate system, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "parent_y"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for Y coordinate\nin parent\8217s coordinate system, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_coords_to_parent" gdk_surface_coords_to_parent :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    Ptr CDouble ->                          -- parent_x : TBasicType TDouble
    Ptr CDouble ->                          -- parent_y : TBasicType TDouble
    IO ()

-- | Transforms surface coordinates from a child surface to its parent
-- surface. Calling this function is equivalent to adding the return
-- values of 'GI.Gdk.Objects.Surface.surfaceGetPosition' to the child coordinates.
-- 
-- See also: 'GI.Gdk.Objects.Surface.surfaceCoordsFromParent'
surfaceCoordsToParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a child surface
    -> Double
    -- ^ /@x@/: X coordinate in child’s coordinate system
    -> Double
    -- ^ /@y@/: Y coordinate in child’s coordinate system
    -> m ((Double, Double))
surfaceCoordsToParent :: a -> Double -> Double -> m (Double, Double)
surfaceCoordsToParent surface :: a
surface x :: Double
x y :: Double
y = IO (Double, Double) -> m (Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Double, Double) -> m (Double, Double))
-> IO (Double, Double) -> m (Double, Double)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    Ptr CDouble
parentX <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr CDouble
parentY <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr Surface
-> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO ()
gdk_surface_coords_to_parent Ptr Surface
surface' CDouble
x' CDouble
y' Ptr CDouble
parentX Ptr CDouble
parentY
    CDouble
parentX' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
parentX
    let parentX'' :: Double
parentX'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
parentX'
    CDouble
parentY' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
parentY
    let parentY'' :: Double
parentY'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
parentY'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
parentX
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
parentY
    (Double, Double) -> IO (Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
parentX'', Double
parentY'')

#if defined(ENABLE_OVERLOADING)
data SurfaceCoordsToParentMethodInfo
instance (signature ~ (Double -> Double -> m ((Double, Double))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCoordsToParentMethodInfo a signature where
    overloadedMethod = surfaceCoordsToParent

#endif

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

foreign import ccall "gdk_surface_create_cairo_context" gdk_surface_create_cairo_context :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Gdk.CairoContext.CairoContext)

-- | Creates a new t'GI.Gdk.Objects.CairoContext.CairoContext' for rendering on /@surface@/.
surfaceCreateCairoContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.CairoContext.CairoContext
    -- ^ __Returns:__ the newly created t'GI.Gdk.Objects.CairoContext.CairoContext'
surfaceCreateCairoContext :: a -> m CairoContext
surfaceCreateCairoContext surface :: a
surface = IO CairoContext -> m CairoContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CairoContext -> m CairoContext)
-> IO CairoContext -> m CairoContext
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr CairoContext
result <- Ptr Surface -> IO (Ptr CairoContext)
gdk_surface_create_cairo_context Ptr Surface
surface'
    Text -> Ptr CairoContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceCreateCairoContext" Ptr CairoContext
result
    CairoContext
result' <- ((ManagedPtr CairoContext -> CairoContext)
-> Ptr CairoContext -> IO CairoContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr CairoContext -> CairoContext
Gdk.CairoContext.CairoContext) Ptr CairoContext
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    CairoContext -> IO CairoContext
forall (m :: * -> *) a. Monad m => a -> m a
return CairoContext
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceCreateCairoContextMethodInfo
instance (signature ~ (m Gdk.CairoContext.CairoContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateCairoContextMethodInfo a signature where
    overloadedMethod = surfaceCreateCairoContext

#endif

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

foreign import ccall "gdk_surface_create_gl_context" gdk_surface_create_gl_context :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gdk.GLContext.GLContext)

-- | Creates a new t'GI.Gdk.Objects.GLContext.GLContext' matching the
-- framebuffer format to the visual of the t'GI.Gdk.Objects.Surface.Surface'. The context
-- is disconnected from any particular surface or surface.
-- 
-- If the creation of the t'GI.Gdk.Objects.GLContext.GLContext' failed, /@error@/ will be set.
-- 
-- Before using the returned t'GI.Gdk.Objects.GLContext.GLContext', you will need to
-- call 'GI.Gdk.Objects.GLContext.gLContextMakeCurrent' or 'GI.Gdk.Objects.GLContext.gLContextRealize'.
surfaceCreateGlContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.GLContext.GLContext
    -- ^ __Returns:__ the newly created t'GI.Gdk.Objects.GLContext.GLContext', or
    -- 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
surfaceCreateGlContext :: a -> m GLContext
surfaceCreateGlContext surface :: a
surface = IO GLContext -> m GLContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GLContext -> m GLContext) -> IO GLContext -> m GLContext
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    IO GLContext -> IO () -> IO GLContext
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr GLContext
result <- (Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext))
-> (Ptr (Ptr GError) -> IO (Ptr GLContext)) -> IO (Ptr GLContext)
forall a b. (a -> b) -> a -> b
$ Ptr Surface -> Ptr (Ptr GError) -> IO (Ptr GLContext)
gdk_surface_create_gl_context Ptr Surface
surface'
        Text -> Ptr GLContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceCreateGlContext" Ptr GLContext
result
        GLContext
result' <- ((ManagedPtr GLContext -> GLContext)
-> Ptr GLContext -> IO GLContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr GLContext -> GLContext
Gdk.GLContext.GLContext) Ptr GLContext
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
        GLContext -> IO GLContext
forall (m :: * -> *) a. Monad m => a -> m a
return GLContext
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SurfaceCreateGlContextMethodInfo
instance (signature ~ (m Gdk.GLContext.GLContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateGlContextMethodInfo a signature where
    overloadedMethod = surfaceCreateGlContext

#endif

-- method Surface::create_similar_surface
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "surface to make new surface similar to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "content"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Content" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the content for the new surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "width of the new surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "height of the new surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "cairo" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_create_similar_surface" gdk_surface_create_similar_surface :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- content : TInterface (Name {namespace = "cairo", name = "Content"})
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO (Ptr Cairo.Surface.Surface)

-- | Create a new surface that is as compatible as possible with the
-- given /@surface@/. For example the new surface will have the same
-- fallback resolution and font options as /@surface@/. Generally, the new
-- surface will also use the same backend as /@surface@/, unless that is
-- not possible for some reason. The type of the returned surface may
-- be examined with @/cairo_surface_get_type()/@.
-- 
-- Initially the surface contents are all 0 (transparent if contents
-- have transparency, black otherwise.)
surfaceCreateSimilarSurface ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: surface to make new surface similar to
    -> Cairo.Enums.Content
    -- ^ /@content@/: the content for the new surface
    -> Int32
    -- ^ /@width@/: width of the new surface
    -> Int32
    -- ^ /@height@/: height of the new surface
    -> m Cairo.Surface.Surface
    -- ^ __Returns:__ a pointer to the newly allocated surface. The caller
    -- owns the surface and should call @/cairo_surface_destroy()/@ when done
    -- with it.
    -- 
    -- This function always returns a valid pointer, but it will return a
    -- pointer to a “nil” surface if /@other@/ is already in an error state
    -- or any other error occurs.
surfaceCreateSimilarSurface :: a -> Content -> Int32 -> Int32 -> m Surface
surfaceCreateSimilarSurface surface :: a
surface content :: Content
content width :: Int32
width height :: Int32
height = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let content' :: CUInt
content' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Content -> Int) -> Content -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Content -> Int
forall a. Enum a => a -> Int
fromEnum) Content
content
    Ptr Surface
result <- Ptr Surface -> CUInt -> Int32 -> Int32 -> IO (Ptr Surface)
gdk_surface_create_similar_surface Ptr Surface
surface' CUInt
content' Int32
width Int32
height
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceCreateSimilarSurface" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Surface -> Surface
Cairo.Surface.Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceCreateSimilarSurfaceMethodInfo
instance (signature ~ (Cairo.Enums.Content -> Int32 -> Int32 -> m Cairo.Surface.Surface), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateSimilarSurfaceMethodInfo a signature where
    overloadedMethod = surfaceCreateSimilarSurface

#endif

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

foreign import ccall "gdk_surface_create_vulkan_context" gdk_surface_create_vulkan_context :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gdk.VulkanContext.VulkanContext)

-- | Creates a new t'GI.Gdk.Objects.VulkanContext.VulkanContext' for rendering on /@surface@/.
-- 
-- If the creation of the t'GI.Gdk.Objects.VulkanContext.VulkanContext' failed, /@error@/ will be set.
surfaceCreateVulkanContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.VulkanContext.VulkanContext
    -- ^ __Returns:__ the newly created t'GI.Gdk.Objects.VulkanContext.VulkanContext', or
    -- 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
surfaceCreateVulkanContext :: a -> m VulkanContext
surfaceCreateVulkanContext surface :: a
surface = IO VulkanContext -> m VulkanContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VulkanContext -> m VulkanContext)
-> IO VulkanContext -> m VulkanContext
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    IO VulkanContext -> IO () -> IO VulkanContext
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr VulkanContext
result <- (Ptr (Ptr GError) -> IO (Ptr VulkanContext))
-> IO (Ptr VulkanContext)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr VulkanContext))
 -> IO (Ptr VulkanContext))
-> (Ptr (Ptr GError) -> IO (Ptr VulkanContext))
-> IO (Ptr VulkanContext)
forall a b. (a -> b) -> a -> b
$ Ptr Surface -> Ptr (Ptr GError) -> IO (Ptr VulkanContext)
gdk_surface_create_vulkan_context Ptr Surface
surface'
        Text -> Ptr VulkanContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceCreateVulkanContext" Ptr VulkanContext
result
        VulkanContext
result' <- ((ManagedPtr VulkanContext -> VulkanContext)
-> Ptr VulkanContext -> IO VulkanContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr VulkanContext -> VulkanContext
Gdk.VulkanContext.VulkanContext) Ptr VulkanContext
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
        VulkanContext -> IO VulkanContext
forall (m :: * -> *) a. Monad m => a -> m a
return VulkanContext
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SurfaceCreateVulkanContextMethodInfo
instance (signature ~ (m Gdk.VulkanContext.VulkanContext), MonadIO m, IsSurface a) => O.MethodInfo SurfaceCreateVulkanContextMethodInfo a signature where
    overloadedMethod = surfaceCreateVulkanContext

#endif

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

foreign import ccall "gdk_surface_deiconify" gdk_surface_deiconify :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Attempt to deiconify (unminimize) /@surface@/. On X11 the window manager may
-- choose to ignore the request to deiconify. When using GTK,
-- use @/gtk_window_deiconify()/@ instead of the t'GI.Gdk.Objects.Surface.Surface' variant. Or better yet,
-- you probably want to use @/gtk_window_present_with_time()/@, which raises the surface, focuses it,
-- unminimizes it, and puts it on the current desktop.
surfaceDeiconify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceDeiconify :: a -> m ()
surfaceDeiconify surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_deiconify Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceDeiconifyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceDeiconifyMethodInfo a signature where
    overloadedMethod = surfaceDeiconify

#endif

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

foreign import ccall "gdk_surface_destroy" gdk_surface_destroy :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Destroys the window system resources associated with /@surface@/ and decrements /@surface@/\'s
-- reference count. The window system resources for all children of /@surface@/ are also
-- destroyed, but the children’s reference counts are not decremented.
-- 
-- Note that a surface will not be destroyed automatically when its reference count
-- reaches zero. You must call this function yourself before that happens.
surfaceDestroy ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceDestroy :: a -> m ()
surfaceDestroy surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_destroy Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceDestroyMethodInfo a signature where
    overloadedMethod = surfaceDestroy

#endif

-- method Surface::focus
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "timestamp of the event triggering the surface focus"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_focus" gdk_surface_focus :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | Sets keyboard focus to /@surface@/. In most cases, @/gtk_window_present_with_time()/@
-- should be used on a @/GtkWindow/@, rather than calling this function.
surfaceFocus ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Word32
    -- ^ /@timestamp@/: timestamp of the event triggering the surface focus
    -> m ()
surfaceFocus :: a -> Word32 -> m ()
surfaceFocus surface :: a
surface timestamp :: Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> Word32 -> IO ()
gdk_surface_focus Ptr Surface
surface' Word32
timestamp
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceFocusMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceFocusMethodInfo a signature where
    overloadedMethod = surfaceFocus

#endif

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

foreign import ccall "gdk_surface_freeze_updates" gdk_surface_freeze_updates :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Temporarily freezes a surface such that it won’t receive expose
-- events.  The surface will begin receiving expose events again when
-- 'GI.Gdk.Objects.Surface.surfaceThawUpdates' is called. If 'GI.Gdk.Objects.Surface.surfaceFreezeUpdates'
-- has been called more than once, 'GI.Gdk.Objects.Surface.surfaceThawUpdates' must be called
-- an equal number of times to begin processing exposes.
surfaceFreezeUpdates ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceFreezeUpdates :: a -> m ()
surfaceFreezeUpdates surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_freeze_updates Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceFreezeUpdatesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceFreezeUpdatesMethodInfo a signature where
    overloadedMethod = surfaceFreezeUpdates

#endif

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

foreign import ccall "gdk_surface_fullscreen" gdk_surface_fullscreen :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Moves the surface into fullscreen mode. This means the
-- surface covers the entire screen and is above any panels
-- or task bars.
-- 
-- If the surface was already fullscreen, then this function does nothing.
-- 
-- On X11, asks the window manager to put /@surface@/ in a fullscreen
-- state, if the window manager supports this operation. Not all
-- window managers support this, and some deliberately ignore it or
-- don’t have a concept of “fullscreen”; so you can’t rely on the
-- fullscreenification actually happening. But it will happen with
-- most standard window managers, and GDK makes a best effort to get
-- it to happen.
surfaceFullscreen ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceFullscreen :: a -> m ()
surfaceFullscreen surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_fullscreen Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceFullscreenMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceFullscreenMethodInfo a signature where
    overloadedMethod = surfaceFullscreen

#endif

-- method Surface::fullscreen_on_monitor
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , 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 "Which monitor to display fullscreen on."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_fullscreen_on_monitor" gdk_surface_fullscreen_on_monitor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Monitor.Monitor ->              -- monitor : TInterface (Name {namespace = "Gdk", name = "Monitor"})
    IO ()

-- | Moves the surface into fullscreen mode on the given monitor. This means
-- the surface covers the entire screen and is above any panels or task bars.
-- 
-- If the surface was already fullscreen, then this function does nothing.
surfaceFullscreenOnMonitor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Monitor.IsMonitor b) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> b
    -- ^ /@monitor@/: Which monitor to display fullscreen on.
    -> m ()
surfaceFullscreenOnMonitor :: a -> b -> m ()
surfaceFullscreenOnMonitor surface :: a
surface monitor :: b
monitor = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Monitor
monitor' <- b -> IO (Ptr Monitor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
monitor
    Ptr Surface -> Ptr Monitor -> IO ()
gdk_surface_fullscreen_on_monitor Ptr Surface
surface' Ptr Monitor
monitor'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
monitor
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceFullscreenOnMonitorMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSurface a, Gdk.Monitor.IsMonitor b) => O.MethodInfo SurfaceFullscreenOnMonitorMethodInfo a signature where
    overloadedMethod = surfaceFullscreenOnMonitor

#endif

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

foreign import ccall "gdk_surface_get_accept_focus" gdk_surface_get_accept_focus :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Determines whether or not the desktop environment shuld be hinted that
-- the surface does not want to receive input focus.
surfaceGetAcceptFocus ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'.
    -> m Bool
    -- ^ __Returns:__ whether or not the surface should receive input focus.
surfaceGetAcceptFocus :: a -> m Bool
surfaceGetAcceptFocus surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_accept_focus Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetAcceptFocusMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetAcceptFocusMethodInfo a signature where
    overloadedMethod = surfaceGetAcceptFocus

#endif

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

foreign import ccall "gdk_surface_get_children" gdk_surface_get_children :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr (GList (Ptr Surface)))

-- | Gets the list of children of /@surface@/ known to GDK.
-- This function only returns children created via GDK,
-- so for example it’s useless when used with the root window;
-- it only returns surfaces an application created itself.
-- 
-- The returned list must be freed, but the elements in the
-- list need not be.
surfaceGetChildren ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m [Surface]
    -- ^ __Returns:__ 
    --     list of child surfaces inside /@surface@/
surfaceGetChildren :: a -> m [Surface]
surfaceGetChildren surface :: a
surface = IO [Surface] -> m [Surface]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Surface] -> m [Surface]) -> IO [Surface] -> m [Surface]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr (GList (Ptr Surface))
result <- Ptr Surface -> IO (Ptr (GList (Ptr Surface)))
gdk_surface_get_children Ptr Surface
surface'
    [Ptr Surface]
result' <- Ptr (GList (Ptr Surface)) -> IO [Ptr Surface]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Surface))
result
    [Surface]
result'' <- (Ptr Surface -> IO Surface) -> [Ptr Surface] -> IO [Surface]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Surface) [Ptr Surface]
result'
    Ptr (GList (Ptr Surface)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Surface))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    [Surface] -> IO [Surface]
forall (m :: * -> *) a. Monad m => a -> m a
return [Surface]
result''

#if defined(ENABLE_OVERLOADING)
data SurfaceGetChildrenMethodInfo
instance (signature ~ (m [Surface]), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetChildrenMethodInfo a signature where
    overloadedMethod = surfaceGetChildren

#endif

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

foreign import ccall "gdk_surface_get_cursor" gdk_surface_get_cursor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Gdk.Cursor.Cursor)

-- | Retrieves a t'GI.Gdk.Objects.Cursor.Cursor' pointer for the cursor currently set on the
-- specified t'GI.Gdk.Objects.Surface.Surface', or 'P.Nothing'.  If the return value is 'P.Nothing' then
-- there is no custom cursor set on the specified surface, and it is
-- using the cursor for its parent surface.
surfaceGetCursor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m (Maybe Gdk.Cursor.Cursor)
    -- ^ __Returns:__ a t'GI.Gdk.Objects.Cursor.Cursor', or 'P.Nothing'. The
    --   returned object is owned by the t'GI.Gdk.Objects.Surface.Surface' and should not be
    --   unreferenced directly. Use 'GI.Gdk.Objects.Surface.surfaceSetCursor' to unset the
    --   cursor of the surface
surfaceGetCursor :: a -> m (Maybe Cursor)
surfaceGetCursor surface :: a
surface = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Cursor
result <- Ptr Surface -> IO (Ptr Cursor)
gdk_surface_get_cursor Ptr Surface
surface'
    Maybe Cursor
maybeResult <- Ptr Cursor -> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Cursor
result ((Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor))
-> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Cursor
result' -> do
        Cursor
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor) Ptr Cursor
result'
        Cursor -> IO Cursor
forall (m :: * -> *) a. Monad m => a -> m a
return Cursor
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Maybe Cursor -> IO (Maybe Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cursor
maybeResult

#if defined(ENABLE_OVERLOADING)
data SurfaceGetCursorMethodInfo
instance (signature ~ (m (Maybe Gdk.Cursor.Cursor)), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetCursorMethodInfo a signature where
    overloadedMethod = surfaceGetCursor

#endif

-- method Surface::get_decorations
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The toplevel #GdkSurface to get the decorations from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "decorations"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "WMDecoration" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The surface decorations will be written here"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_decorations" gdk_surface_get_decorations :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr CUInt ->                            -- decorations : TInterface (Name {namespace = "Gdk", name = "WMDecoration"})
    IO CInt

-- | Returns the decorations set on the GdkSurface with
-- 'GI.Gdk.Objects.Surface.surfaceSetDecorations'.
surfaceGetDecorations ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: The toplevel t'GI.Gdk.Objects.Surface.Surface' to get the decorations from
    -> m ((Bool, [Gdk.Flags.WMDecoration]))
    -- ^ __Returns:__ 'P.True' if the surface has decorations set, 'P.False' otherwise.
surfaceGetDecorations :: a -> m (Bool, [WMDecoration])
surfaceGetDecorations surface :: a
surface = IO (Bool, [WMDecoration]) -> m (Bool, [WMDecoration])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [WMDecoration]) -> m (Bool, [WMDecoration]))
-> IO (Bool, [WMDecoration]) -> m (Bool, [WMDecoration])
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr CUInt
decorations <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    CInt
result <- Ptr Surface -> Ptr CUInt -> IO CInt
gdk_surface_get_decorations Ptr Surface
surface' Ptr CUInt
decorations
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    CUInt
decorations' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
decorations
    let decorations'' :: [WMDecoration]
decorations'' = CUInt -> [WMDecoration]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
decorations'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
decorations
    (Bool, [WMDecoration]) -> IO (Bool, [WMDecoration])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [WMDecoration]
decorations'')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetDecorationsMethodInfo
instance (signature ~ (m ((Bool, [Gdk.Flags.WMDecoration]))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetDecorationsMethodInfo a signature where
    overloadedMethod = surfaceGetDecorations

#endif

-- method Surface::get_device_cursor
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a master, pointer #GdkDevice."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Cursor" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_device_cursor" gdk_surface_get_device_cursor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    IO (Ptr Gdk.Cursor.Cursor)

-- | Retrieves a t'GI.Gdk.Objects.Cursor.Cursor' pointer for the /@device@/ currently set on the
-- specified t'GI.Gdk.Objects.Surface.Surface', or 'P.Nothing'.  If the return value is 'P.Nothing' then
-- there is no custom cursor set on the specified surface, and it is
-- using the cursor for its parent surface.
surfaceGetDeviceCursor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'.
    -> b
    -- ^ /@device@/: a master, pointer t'GI.Gdk.Objects.Device.Device'.
    -> m (Maybe Gdk.Cursor.Cursor)
    -- ^ __Returns:__ a t'GI.Gdk.Objects.Cursor.Cursor', or 'P.Nothing'. The
    --   returned object is owned by the t'GI.Gdk.Objects.Surface.Surface' and should not be
    --   unreferenced directly. Use 'GI.Gdk.Objects.Surface.surfaceSetCursor' to unset the
    --   cursor of the surface
surfaceGetDeviceCursor :: a -> b -> m (Maybe Cursor)
surfaceGetDeviceCursor surface :: a
surface device :: b
device = IO (Maybe Cursor) -> m (Maybe Cursor)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
    Ptr Cursor
result <- Ptr Surface -> Ptr Device -> IO (Ptr Cursor)
gdk_surface_get_device_cursor Ptr Surface
surface' Ptr Device
device'
    Maybe Cursor
maybeResult <- Ptr Cursor -> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Cursor
result ((Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor))
-> (Ptr Cursor -> IO Cursor) -> IO (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Cursor
result' -> do
        Cursor
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Cursor -> Cursor
Gdk.Cursor.Cursor) Ptr Cursor
result'
        Cursor -> IO Cursor
forall (m :: * -> *) a. Monad m => a -> m a
return Cursor
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
    Maybe Cursor -> IO (Maybe Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cursor
maybeResult

#if defined(ENABLE_OVERLOADING)
data SurfaceGetDeviceCursorMethodInfo
instance (signature ~ (b -> m (Maybe Gdk.Cursor.Cursor)), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceGetDeviceCursorMethodInfo a signature where
    overloadedMethod = surfaceGetDeviceCursor

#endif

-- method Surface::get_device_position
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "pointer #GdkDevice to query to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the X coordinate of @device, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the Y coordinate of @device, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "mask"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the modifier mask, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Surface" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_device_position" gdk_surface_get_device_position :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    Ptr CDouble ->                          -- x : TBasicType TDouble
    Ptr CDouble ->                          -- y : TBasicType TDouble
    Ptr CUInt ->                            -- mask : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO (Ptr Surface)

-- | Obtains the current device position in doubles and modifier state.
-- The position is given in coordinates relative to the upper left
-- corner of /@surface@/.
surfaceGetDevicePosition ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'.
    -> b
    -- ^ /@device@/: pointer t'GI.Gdk.Objects.Device.Device' to query to.
    -> m ((Maybe Surface, Double, Double, [Gdk.Flags.ModifierType]))
    -- ^ __Returns:__ The surface underneath /@device@/
    -- (as with 'GI.Gdk.Objects.Device.deviceGetSurfaceAtPosition'), or 'P.Nothing' if the
    -- surface is not known to GDK.
surfaceGetDevicePosition :: a -> b -> m (Maybe Surface, Double, Double, [ModifierType])
surfaceGetDevicePosition surface :: a
surface device :: b
device = IO (Maybe Surface, Double, Double, [ModifierType])
-> m (Maybe Surface, Double, Double, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface, Double, Double, [ModifierType])
 -> m (Maybe Surface, Double, Double, [ModifierType]))
-> IO (Maybe Surface, Double, Double, [ModifierType])
-> m (Maybe Surface, Double, Double, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
    Ptr CDouble
x <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr CDouble
y <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    Ptr CUInt
mask <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    Ptr Surface
result <- Ptr Surface
-> Ptr Device
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CUInt
-> IO (Ptr Surface)
gdk_surface_get_device_position Ptr Surface
surface' Ptr Device
device' Ptr CDouble
x Ptr CDouble
y Ptr CUInt
mask
    Maybe Surface
maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Surface
result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface))
-> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Surface
result' -> do
        Surface
result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result'
        Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result''
    CDouble
x' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
x
    let x'' :: Double
x'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x'
    CDouble
y' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
y
    let y'' :: Double
y'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y'
    CUInt
mask' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
mask
    let mask'' :: [ModifierType]
mask'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
mask'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
x
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
y
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
mask
    (Maybe Surface, Double, Double, [ModifierType])
-> IO (Maybe Surface, Double, Double, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Surface
maybeResult, Double
x'', Double
y'', [ModifierType]
mask'')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetDevicePositionMethodInfo
instance (signature ~ (b -> m ((Maybe Surface, Double, Double, [Gdk.Flags.ModifierType]))), MonadIO m, IsSurface a, Gdk.Device.IsDevice b) => O.MethodInfo SurfaceGetDevicePositionMethodInfo a signature where
    overloadedMethod = surfaceGetDevicePosition

#endif

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

foreign import ccall "gdk_surface_get_display" gdk_surface_get_display :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Gdk.Display.Display)

-- | Gets the t'GI.Gdk.Objects.Display.Display' associated with a t'GI.Gdk.Objects.Surface.Surface'.
surfaceGetDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.Display.Display
    -- ^ __Returns:__ the t'GI.Gdk.Objects.Display.Display' associated with /@surface@/
surfaceGetDisplay :: a -> m Display
surfaceGetDisplay surface :: a
surface = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Display
result <- Ptr Surface -> IO (Ptr Display)
gdk_surface_get_display Ptr Surface
surface'
    Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceGetDisplay" Ptr Display
result
    Display
result' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetDisplayMethodInfo a signature where
    overloadedMethod = surfaceGetDisplay

#endif

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

foreign import ccall "gdk_surface_get_focus_on_map" gdk_surface_get_focus_on_map :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Determines whether or not the desktop environment should be hinted that the
-- surface does not want to receive input focus when it is mapped.
surfaceGetFocusOnMap ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'.
    -> m Bool
    -- ^ __Returns:__ whether or not the surface wants to receive input focus when
    -- it is mapped.
surfaceGetFocusOnMap :: a -> m Bool
surfaceGetFocusOnMap surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_focus_on_map Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetFocusOnMapMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetFocusOnMapMethodInfo a signature where
    overloadedMethod = surfaceGetFocusOnMap

#endif

-- method Surface::get_frame_clock
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "surface to get frame clock for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "FrameClock" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_frame_clock" gdk_surface_get_frame_clock :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Gdk.FrameClock.FrameClock)

-- | Gets the frame clock for the surface. The frame clock for a surface
-- never changes unless the surface is reparented to a new toplevel
-- surface.
surfaceGetFrameClock ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: surface to get frame clock for
    -> m Gdk.FrameClock.FrameClock
    -- ^ __Returns:__ the frame clock
surfaceGetFrameClock :: a -> m FrameClock
surfaceGetFrameClock surface :: a
surface = IO FrameClock -> m FrameClock
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FrameClock -> m FrameClock) -> IO FrameClock -> m FrameClock
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr FrameClock
result <- Ptr Surface -> IO (Ptr FrameClock)
gdk_surface_get_frame_clock Ptr Surface
surface'
    Text -> Ptr FrameClock -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceGetFrameClock" Ptr FrameClock
result
    FrameClock
result' <- ((ManagedPtr FrameClock -> FrameClock)
-> Ptr FrameClock -> IO FrameClock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FrameClock -> FrameClock
Gdk.FrameClock.FrameClock) Ptr FrameClock
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    FrameClock -> IO FrameClock
forall (m :: * -> *) a. Monad m => a -> m a
return FrameClock
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetFrameClockMethodInfo
instance (signature ~ (m Gdk.FrameClock.FrameClock), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetFrameClockMethodInfo a signature where
    overloadedMethod = surfaceGetFrameClock

#endif

-- method Surface::get_frame_extents
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "rectangle to fill with bounding box of the surface frame"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_frame_extents" gdk_surface_get_frame_extents :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Rectangle.Rectangle ->          -- rect : TInterface (Name {namespace = "Gdk", name = "Rectangle"})
    IO ()

-- | Obtains the bounding box of the surface, including window manager
-- titlebar\/borders if any. The frame position is given in root window
-- coordinates. To get the position of the surface itself (rather than
-- the frame) in root window coordinates, use 'GI.Gdk.Objects.Surface.surfaceGetOrigin'.
surfaceGetFrameExtents ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m (Gdk.Rectangle.Rectangle)
surfaceGetFrameExtents :: a -> m Rectangle
surfaceGetFrameExtents surface :: a
surface = IO Rectangle -> m Rectangle
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rectangle -> m Rectangle) -> IO Rectangle -> m Rectangle
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Rectangle
rect <- Int -> IO (Ptr Rectangle)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 16 :: IO (Ptr Gdk.Rectangle.Rectangle)
    Ptr Surface -> Ptr Rectangle -> IO ()
gdk_surface_get_frame_extents Ptr Surface
surface' Ptr Rectangle
rect
    Rectangle
rect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Rectangle -> Rectangle
Gdk.Rectangle.Rectangle) Ptr Rectangle
rect
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Rectangle -> IO Rectangle
forall (m :: * -> *) a. Monad m => a -> m a
return Rectangle
rect'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetFrameExtentsMethodInfo
instance (signature ~ (m (Gdk.Rectangle.Rectangle)), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetFrameExtentsMethodInfo a signature where
    overloadedMethod = surfaceGetFrameExtents

#endif

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

foreign import ccall "gdk_surface_get_fullscreen_mode" gdk_surface_get_fullscreen_mode :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CUInt

-- | Obtains the t'GI.Gdk.Enums.FullscreenMode' of the /@surface@/.
surfaceGetFullscreenMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.Enums.FullscreenMode
    -- ^ __Returns:__ The t'GI.Gdk.Enums.FullscreenMode' applied to the surface when fullscreen.
surfaceGetFullscreenMode :: a -> m FullscreenMode
surfaceGetFullscreenMode surface :: a
surface = IO FullscreenMode -> m FullscreenMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FullscreenMode -> m FullscreenMode)
-> IO FullscreenMode -> m FullscreenMode
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CUInt
result <- Ptr Surface -> IO CUInt
gdk_surface_get_fullscreen_mode Ptr Surface
surface'
    let result' :: FullscreenMode
result' = (Int -> FullscreenMode
forall a. Enum a => Int -> a
toEnum (Int -> FullscreenMode)
-> (CUInt -> Int) -> CUInt -> FullscreenMode
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
surface
    FullscreenMode -> IO FullscreenMode
forall (m :: * -> *) a. Monad m => a -> m a
return FullscreenMode
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetFullscreenModeMethodInfo
instance (signature ~ (m Gdk.Enums.FullscreenMode), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetFullscreenModeMethodInfo a signature where
    overloadedMethod = surfaceGetFullscreenMode

#endif

-- method Surface::get_geometry
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for X coordinate of surface (relative to its parent)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for Y coordinate of surface (relative to its parent)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for width of surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for height of surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_geometry" gdk_surface_get_geometry :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Int32 ->                            -- x : TBasicType TInt
    Ptr Int32 ->                            -- y : TBasicType TInt
    Ptr Int32 ->                            -- width : TBasicType TInt
    Ptr Int32 ->                            -- height : TBasicType TInt
    IO ()

-- | Any of the return location arguments to this function may be 'P.Nothing',
-- if you aren’t interested in getting the value of that field.
-- 
-- The X and Y coordinates returned are relative to the parent surface
-- of /@surface@/, which for toplevels usually means relative to the
-- surface decorations (titlebar, etc.) rather than relative to the
-- root window (screen-size background window).
-- 
-- On the X11 platform, the geometry is obtained from the X server,
-- so reflects the latest position of /@surface@/; this may be out-of-sync
-- with the position of /@surface@/ delivered in the most-recently-processed
-- t'GI.Gdk.Structs.EventConfigure.EventConfigure'. 'GI.Gdk.Objects.Surface.surfaceGetPosition' in contrast gets the
-- position from the most recent configure event.
-- 
-- Note: If /@surface@/ is not a toplevel, it is much better
-- to call 'GI.Gdk.Objects.Surface.surfaceGetPosition', 'GI.Gdk.Objects.Surface.surfaceGetWidth' and
-- 'GI.Gdk.Objects.Surface.surfaceGetHeight' instead, because it avoids the roundtrip to
-- the X server and because these functions support the full 32-bit
-- coordinate space, whereas 'GI.Gdk.Objects.Surface.surfaceGetGeometry' is restricted to
-- the 16-bit coordinates of X11.
surfaceGetGeometry ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ((Int32, Int32, Int32, Int32))
surfaceGetGeometry :: a -> m (Int32, Int32, Int32, Int32)
surfaceGetGeometry surface :: a
surface = IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32))
-> IO (Int32, Int32, Int32, Int32)
-> m (Int32, Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Surface
-> Ptr Int32 -> Ptr Int32 -> Ptr Int32 -> Ptr Int32 -> IO ()
gdk_surface_get_geometry Ptr Surface
surface' Ptr Int32
x Ptr Int32
y Ptr Int32
width Ptr Int32
height
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
    Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
    (Int32, Int32, Int32, Int32) -> IO (Int32, Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y', Int32
width', Int32
height')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetGeometryMethodInfo
instance (signature ~ (m ((Int32, Int32, Int32, Int32))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetGeometryMethodInfo a signature where
    overloadedMethod = surfaceGetGeometry

#endif

-- method Surface::get_height
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , 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 "gdk_surface_get_height" gdk_surface_get_height :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO Int32

-- | Returns the height of the given /@surface@/.
-- 
-- On the X11 platform the returned size is the size reported in the
-- most-recently-processed configure event, rather than the current
-- size on the X server.
surfaceGetHeight ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Int32
    -- ^ __Returns:__ The height of /@surface@/
surfaceGetHeight :: a -> m Int32
surfaceGetHeight surface :: a
surface = IO Int32 -> m Int32
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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_height Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data SurfaceGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetHeightMethodInfo a signature where
    overloadedMethod = surfaceGetHeight

#endif

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

foreign import ccall "gdk_surface_get_modal_hint" gdk_surface_get_modal_hint :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Determines whether or not the window manager is hinted that /@surface@/
-- has modal behaviour.
surfaceGetModalHint ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: A toplevel t'GI.Gdk.Objects.Surface.Surface'.
    -> m Bool
    -- ^ __Returns:__ whether or not the surface has the modal hint set.
surfaceGetModalHint :: a -> m Bool
surfaceGetModalHint surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_modal_hint Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetModalHintMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetModalHintMethodInfo a signature where
    overloadedMethod = surfaceGetModalHint

#endif

-- method Surface::get_origin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for X coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for Y coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_origin" gdk_surface_get_origin :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Int32 ->                            -- x : TBasicType TInt
    Ptr Int32 ->                            -- y : TBasicType TInt
    IO Int32

-- | Obtains the position of a surface in root window coordinates.
-- (Compare with 'GI.Gdk.Objects.Surface.surfaceGetPosition' and
-- 'GI.Gdk.Objects.Surface.surfaceGetGeometry' which return the position of a surface
-- relative to its parent surface.)
surfaceGetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ not meaningful, ignore
surfaceGetOrigin :: a -> m (Int32, Int32, Int32)
surfaceGetOrigin surface :: a
surface = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32))
-> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Int32
result <- Ptr Surface -> Ptr Int32 -> Ptr Int32 -> IO Int32
gdk_surface_get_origin Ptr Surface
surface' Ptr Int32
x Ptr Int32
y
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    (Int32, Int32, Int32) -> IO (Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Int32
x', Int32
y')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetOriginMethodInfo
instance (signature ~ (m ((Int32, Int32, Int32))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetOriginMethodInfo a signature where
    overloadedMethod = surfaceGetOrigin

#endif

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

foreign import ccall "gdk_surface_get_parent" gdk_surface_get_parent :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Surface)

-- | Obtains the parent of /@surface@/, as known to GDK. Does not query the
-- X server; thus this returns the parent as passed to @/gdk_surface_new()/@,
-- not the actual parent. This should never matter unless you’re using
-- Xlib calls mixed with GDK calls on the X11 platform. It may also
-- matter for toplevel windows, because the window manager may choose
-- to reparent them.
surfaceGetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Surface
    -- ^ __Returns:__ parent of /@surface@/
surfaceGetParent :: a -> m Surface
surfaceGetParent surface :: a
surface = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface
result <- Ptr Surface -> IO (Ptr Surface)
gdk_surface_get_parent Ptr Surface
surface'
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceGetParent" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetParentMethodInfo
instance (signature ~ (m Surface), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetParentMethodInfo a signature where
    overloadedMethod = surfaceGetParent

#endif

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

foreign import ccall "gdk_surface_get_pass_through" gdk_surface_get_pass_through :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Returns whether input to the surface is passed through to the surface
-- below.
-- 
-- See 'GI.Gdk.Objects.Surface.surfaceSetPassThrough' for details
surfaceGetPassThrough ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
surfaceGetPassThrough :: a -> m Bool
surfaceGetPassThrough surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_pass_through Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetPassThroughMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetPassThroughMethodInfo a signature where
    overloadedMethod = surfaceGetPassThrough

#endif

-- method Surface::get_position
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate of surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate of surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_position" gdk_surface_get_position :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Int32 ->                            -- x : TBasicType TInt
    Ptr Int32 ->                            -- y : TBasicType TInt
    IO ()

-- | Obtains the position of the surface as reported in the
-- most-recently-processed t'GI.Gdk.Structs.EventConfigure.EventConfigure'. Contrast with
-- 'GI.Gdk.Objects.Surface.surfaceGetGeometry' which queries the X server for the
-- current surface position, regardless of which events have been
-- received or processed.
-- 
-- The position coordinates are relative to the surface’s parent surface.
surfaceGetPosition ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ((Int32, Int32))
surfaceGetPosition :: a -> m (Int32, Int32)
surfaceGetPosition surface :: a
surface = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Surface -> Ptr Int32 -> Ptr Int32 -> IO ()
gdk_surface_get_position Ptr Surface
surface' Ptr Int32
x Ptr Int32
y
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetPositionMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetPositionMethodInfo a signature where
    overloadedMethod = surfaceGetPosition

#endif

-- method Surface::get_root_coords
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate in surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate in surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "root_x"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for X coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "root_y"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for Y coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_root_coords" gdk_surface_get_root_coords :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Ptr Int32 ->                            -- root_x : TBasicType TInt
    Ptr Int32 ->                            -- root_y : TBasicType TInt
    IO ()

-- | Obtains the position of a surface position in root
-- window coordinates. This is similar to
-- 'GI.Gdk.Objects.Surface.surfaceGetOrigin' but allows you to pass
-- in any position in the surface, not just the origin.
surfaceGetRootCoords ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@x@/: X coordinate in surface
    -> Int32
    -- ^ /@y@/: Y coordinate in surface
    -> m ((Int32, Int32))
surfaceGetRootCoords :: a -> Int32 -> Int32 -> m (Int32, Int32)
surfaceGetRootCoords surface :: a
surface x :: Int32
x y :: Int32
y = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Int32
rootX <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
rootY <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Surface -> Int32 -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO ()
gdk_surface_get_root_coords Ptr Surface
surface' Int32
x Int32
y Ptr Int32
rootX Ptr Int32
rootY
    Int32
rootX' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
rootX
    Int32
rootY' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
rootY
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
rootX
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
rootY
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
rootX', Int32
rootY')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetRootCoordsMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ((Int32, Int32))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetRootCoordsMethodInfo a signature where
    overloadedMethod = surfaceGetRootCoords

#endif

-- method Surface::get_root_origin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for X position of surface frame"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for Y position of surface frame"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_root_origin" gdk_surface_get_root_origin :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Int32 ->                            -- x : TBasicType TInt
    Ptr Int32 ->                            -- y : TBasicType TInt
    IO ()

-- | Obtains the top-left corner of the window manager frame in root
-- surface coordinates.
surfaceGetRootOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ((Int32, Int32))
surfaceGetRootOrigin :: a -> m (Int32, Int32)
surfaceGetRootOrigin surface :: a
surface = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Surface -> Ptr Int32 -> Ptr Int32 -> IO ()
gdk_surface_get_root_origin Ptr Surface
surface' Ptr Int32
x Ptr Int32
y
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y')

#if defined(ENABLE_OVERLOADING)
data SurfaceGetRootOriginMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetRootOriginMethodInfo a signature where
    overloadedMethod = surfaceGetRootOrigin

#endif

-- method Surface::get_scale_factor
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "surface to get scale factor for"
--                 , 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 "gdk_surface_get_scale_factor" gdk_surface_get_scale_factor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO Int32

-- | Returns the internal scale factor that maps from surface coordiantes
-- to the actual device pixels. On traditional systems this is 1, but
-- on very high density outputs this can be a higher value (often 2).
-- 
-- A higher value means that drawing is automatically scaled up to
-- a higher resolution, so any code doing drawing will automatically look
-- nicer. However, if you are supplying pixel-based data the scale
-- value can be used to determine whether to use a pixel resource
-- with higher resolution data.
-- 
-- The scale of a surface may change during runtime, if this happens
-- a configure event will be sent to the toplevel surface.
surfaceGetScaleFactor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: surface to get scale factor for
    -> m Int32
    -- ^ __Returns:__ the scale factor
surfaceGetScaleFactor :: a -> m Int32
surfaceGetScaleFactor surface :: a
surface = IO Int32 -> m Int32
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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_scale_factor Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data SurfaceGetScaleFactorMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetScaleFactorMethodInfo a signature where
    overloadedMethod = surfaceGetScaleFactor

#endif

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

foreign import ccall "gdk_surface_get_state" gdk_surface_get_state :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CUInt

-- | Gets the bitwise OR of the currently active surface state flags,
-- from the t'GI.Gdk.Flags.SurfaceState' enumeration.
surfaceGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m [Gdk.Flags.SurfaceState]
    -- ^ __Returns:__ surface state bitfield
surfaceGetState :: a -> m [SurfaceState]
surfaceGetState surface :: a
surface = IO [SurfaceState] -> m [SurfaceState]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SurfaceState] -> m [SurfaceState])
-> IO [SurfaceState] -> m [SurfaceState]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CUInt
result <- Ptr Surface -> IO CUInt
gdk_surface_get_state Ptr Surface
surface'
    let result' :: [SurfaceState]
result' = CUInt -> [SurfaceState]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    [SurfaceState] -> IO [SurfaceState]
forall (m :: * -> *) a. Monad m => a -> m a
return [SurfaceState]
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetStateMethodInfo
instance (signature ~ (m [Gdk.Flags.SurfaceState]), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetStateMethodInfo a signature where
    overloadedMethod = surfaceGetState

#endif

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

foreign import ccall "gdk_surface_get_support_multidevice" gdk_surface_get_support_multidevice :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Returns 'P.True' if the surface is aware of the existence of multiple
-- devices.
surfaceGetSupportMultidevice ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the surface handles multidevice features.
surfaceGetSupportMultidevice :: a -> m Bool
surfaceGetSupportMultidevice surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_get_support_multidevice Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetSupportMultideviceMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetSupportMultideviceMethodInfo a signature where
    overloadedMethod = surfaceGetSupportMultidevice

#endif

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

foreign import ccall "gdk_surface_get_surface_type" gdk_surface_get_surface_type :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CUInt

-- | Gets the type of the surface. See t'GI.Gdk.Enums.SurfaceType'.
surfaceGetSurfaceType ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.Enums.SurfaceType
    -- ^ __Returns:__ type of surface
surfaceGetSurfaceType :: a -> m SurfaceType
surfaceGetSurfaceType surface :: a
surface = IO SurfaceType -> m SurfaceType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SurfaceType -> m SurfaceType)
-> IO SurfaceType -> m SurfaceType
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CUInt
result <- Ptr Surface -> IO CUInt
gdk_surface_get_surface_type Ptr Surface
surface'
    let result' :: SurfaceType
result' = (Int -> SurfaceType
forall a. Enum a => Int -> a
toEnum (Int -> SurfaceType) -> (CUInt -> Int) -> CUInt -> SurfaceType
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
surface
    SurfaceType -> IO SurfaceType
forall (m :: * -> *) a. Monad m => a -> m a
return SurfaceType
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetSurfaceTypeMethodInfo
instance (signature ~ (m Gdk.Enums.SurfaceType), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetSurfaceTypeMethodInfo a signature where
    overloadedMethod = surfaceGetSurfaceType

#endif

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

foreign import ccall "gdk_surface_get_toplevel" gdk_surface_get_toplevel :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr Surface)

-- | Gets the toplevel surface that’s an ancestor of /@surface@/.
-- 
-- Any surface type but 'GI.Gdk.Enums.SurfaceTypeChild' is considered a
-- toplevel surface, as is a 'GI.Gdk.Enums.SurfaceTypeChild' surface that
-- has a root surface as parent.
surfaceGetToplevel ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Surface
    -- ^ __Returns:__ the toplevel surface containing /@surface@/
surfaceGetToplevel :: a -> m Surface
surfaceGetToplevel surface :: a
surface = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface
result <- Ptr Surface -> IO (Ptr Surface)
gdk_surface_get_toplevel Ptr Surface
surface'
    Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "surfaceGetToplevel" Ptr Surface
result
    Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Surface) Ptr Surface
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetToplevelMethodInfo
instance (signature ~ (m Surface), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetToplevelMethodInfo a signature where
    overloadedMethod = surfaceGetToplevel

#endif

-- method Surface::get_type_hint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "SurfaceTypeHint" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_get_type_hint" gdk_surface_get_type_hint :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CUInt

-- | This function returns the type hint set for a surface.
surfaceGetTypeHint ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: A toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m Gdk.Enums.SurfaceTypeHint
    -- ^ __Returns:__ The type hint set for /@surface@/
surfaceGetTypeHint :: a -> m SurfaceTypeHint
surfaceGetTypeHint surface :: a
surface = IO SurfaceTypeHint -> m SurfaceTypeHint
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SurfaceTypeHint -> m SurfaceTypeHint)
-> IO SurfaceTypeHint -> m SurfaceTypeHint
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CUInt
result <- Ptr Surface -> IO CUInt
gdk_surface_get_type_hint Ptr Surface
surface'
    let result' :: SurfaceTypeHint
result' = (Int -> SurfaceTypeHint
forall a. Enum a => Int -> a
toEnum (Int -> SurfaceTypeHint)
-> (CUInt -> Int) -> CUInt -> SurfaceTypeHint
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
surface
    SurfaceTypeHint -> IO SurfaceTypeHint
forall (m :: * -> *) a. Monad m => a -> m a
return SurfaceTypeHint
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceGetTypeHintMethodInfo
instance (signature ~ (m Gdk.Enums.SurfaceTypeHint), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetTypeHintMethodInfo a signature where
    overloadedMethod = surfaceGetTypeHint

#endif

-- method Surface::get_width
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , 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 "gdk_surface_get_width" gdk_surface_get_width :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO Int32

-- | Returns the width of the given /@surface@/.
-- 
-- On the X11 platform the returned size is the size reported in the
-- most-recently-processed configure event, rather than the current
-- size on the X server.
surfaceGetWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Int32
    -- ^ __Returns:__ The width of /@surface@/
surfaceGetWidth :: a -> m Int32
surfaceGetWidth surface :: a
surface = IO Int32 -> m Int32
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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Int32
result <- Ptr Surface -> IO Int32
gdk_surface_get_width Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data SurfaceGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSurface a) => O.MethodInfo SurfaceGetWidthMethodInfo a signature where
    overloadedMethod = surfaceGetWidth

#endif

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

foreign import ccall "gdk_surface_has_native" gdk_surface_has_native :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Checks whether the surface has a native surface or not.
surfaceHasNative ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the /@surface@/ has a native surface, 'P.False' otherwise.
surfaceHasNative :: a -> m Bool
surfaceHasNative surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_has_native Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceHasNativeMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceHasNativeMethodInfo a signature where
    overloadedMethod = surfaceHasNative

#endif

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

foreign import ccall "gdk_surface_hide" gdk_surface_hide :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | For toplevel surfaces, withdraws them, so they will no longer be
-- known to the window manager; for all surfaces, unmaps them, so
-- they won’t be displayed. Normally done automatically as
-- part of @/gtk_widget_hide()/@.
surfaceHide ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceHide :: a -> m ()
surfaceHide surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_hide Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceHideMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceHideMethodInfo a signature where
    overloadedMethod = surfaceHide

#endif

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

foreign import ccall "gdk_surface_iconify" gdk_surface_iconify :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Asks to iconify (minimize) /@surface@/. The window manager may choose
-- to ignore the request, but normally will honor it. Using
-- @/gtk_window_iconify()/@ is preferred, if you have a @/GtkWindow/@ widget.
-- 
-- This function only makes sense when /@surface@/ is a toplevel surface.
surfaceIconify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceIconify :: a -> m ()
surfaceIconify surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_iconify Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceIconifyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIconifyMethodInfo a signature where
    overloadedMethod = surfaceIconify

#endif

-- method Surface::input_shape_combine_region
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shape_region"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Region" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "region of surface to be non-transparent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "offset_x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "X position of @shape_region in @surface coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "offset_y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Y position of @shape_region in @surface coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_input_shape_combine_region" gdk_surface_input_shape_combine_region :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Cairo.Region.Region ->              -- shape_region : TInterface (Name {namespace = "cairo", name = "Region"})
    Int32 ->                                -- offset_x : TBasicType TInt
    Int32 ->                                -- offset_y : TBasicType TInt
    IO ()

-- | Like @/gdk_surface_shape_combine_region()/@, but the shape applies
-- only to event handling. Mouse events which happen while
-- the pointer position corresponds to an unset bit in the
-- mask will be passed on the surface below /@surface@/.
-- 
-- An input shape is typically used with RGBA surfaces.
-- The alpha channel of the surface defines which pixels are
-- invisible and allows for nicely antialiased borders,
-- and the input shape controls where the surface is
-- “clickable”.
-- 
-- On the X11 platform, this requires version 1.1 of the
-- shape extension.
-- 
-- On the Win32 platform, this functionality is not present and the
-- function does nothing.
surfaceInputShapeCombineRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Cairo.Region.Region
    -- ^ /@shapeRegion@/: region of surface to be non-transparent
    -> Int32
    -- ^ /@offsetX@/: X position of /@shapeRegion@/ in /@surface@/ coordinates
    -> Int32
    -- ^ /@offsetY@/: Y position of /@shapeRegion@/ in /@surface@/ coordinates
    -> m ()
surfaceInputShapeCombineRegion :: a -> Region -> Int32 -> Int32 -> m ()
surfaceInputShapeCombineRegion surface :: a
surface shapeRegion :: Region
shapeRegion offsetX :: Int32
offsetX offsetY :: Int32
offsetY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Region
shapeRegion' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
shapeRegion
    Ptr Surface -> Ptr Region -> SurfaceSizeChangedCallback
gdk_surface_input_shape_combine_region Ptr Surface
surface' Ptr Region
shapeRegion' Int32
offsetX Int32
offsetY
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Region -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Region
shapeRegion
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceInputShapeCombineRegionMethodInfo
instance (signature ~ (Cairo.Region.Region -> Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceInputShapeCombineRegionMethodInfo a signature where
    overloadedMethod = surfaceInputShapeCombineRegion

#endif

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

foreign import ccall "gdk_surface_is_destroyed" gdk_surface_is_destroyed :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Check to see if a surface is destroyed..
surfaceIsDestroyed ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the surface is destroyed
surfaceIsDestroyed :: a -> m Bool
surfaceIsDestroyed surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_is_destroyed Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceIsDestroyedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIsDestroyedMethodInfo a signature where
    overloadedMethod = surfaceIsDestroyed

#endif

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

foreign import ccall "gdk_surface_is_input_only" gdk_surface_is_input_only :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Determines whether or not the surface is an input only surface.
surfaceIsInputOnly ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@surface@/ is input only
surfaceIsInputOnly :: a -> m Bool
surfaceIsInputOnly surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_is_input_only Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceIsInputOnlyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIsInputOnlyMethodInfo a signature where
    overloadedMethod = surfaceIsInputOnly

#endif

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

foreign import ccall "gdk_surface_is_viewable" gdk_surface_is_viewable :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Check if the surface and all ancestors of the surface are
-- mapped. (This is not necessarily \"viewable\" in the X sense, since
-- we only check as far as we have GDK surface parents, not to the root
-- surface.)
surfaceIsViewable ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the surface is viewable
surfaceIsViewable :: a -> m Bool
surfaceIsViewable surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_is_viewable Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceIsViewableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIsViewableMethodInfo a signature where
    overloadedMethod = surfaceIsViewable

#endif

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

foreign import ccall "gdk_surface_is_visible" gdk_surface_is_visible :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO CInt

-- | Checks whether the surface has been mapped (with 'GI.Gdk.Objects.Surface.surfaceShow' or
-- 'GI.Gdk.Objects.Surface.surfaceShowUnraised').
surfaceIsVisible ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the surface is mapped
surfaceIsVisible :: a -> m Bool
surfaceIsVisible surface :: a
surface = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    CInt
result <- Ptr Surface -> IO CInt
gdk_surface_is_visible Ptr Surface
surface'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceIsVisibleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSurface a) => O.MethodInfo SurfaceIsVisibleMethodInfo a signature where
    overloadedMethod = surfaceIsVisible

#endif

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

foreign import ccall "gdk_surface_lower" gdk_surface_lower :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Lowers /@surface@/ to the bottom of the Z-order (stacking order), so that
-- other surfaces with the same parent surface appear above /@surface@/.
-- This is true whether or not the other surfaces are visible.
-- 
-- If /@surface@/ is a toplevel, the window manager may choose to deny the
-- request to move the surface in the Z-order, 'GI.Gdk.Objects.Surface.surfaceLower' only
-- requests the restack, does not guarantee it.
-- 
-- Note that 'GI.Gdk.Objects.Surface.surfaceShow' raises the surface again, so don’t call this
-- function before 'GI.Gdk.Objects.Surface.surfaceShow'. (Try 'GI.Gdk.Objects.Surface.surfaceShowUnraised'.)
surfaceLower ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceLower :: a -> m ()
surfaceLower surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_lower Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceLowerMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceLowerMethodInfo a signature where
    overloadedMethod = surfaceLower

#endif

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

foreign import ccall "gdk_surface_maximize" gdk_surface_maximize :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Maximizes the surface. If the surface was already maximized, then
-- this function does nothing.
-- 
-- On X11, asks the window manager to maximize /@surface@/, if the window
-- manager supports this operation. Not all window managers support
-- this, and some deliberately ignore it or don’t have a concept of
-- “maximized”; so you can’t rely on the maximization actually
-- happening. But it will happen with most standard window managers,
-- and GDK makes a best effort to get it to happen.
-- 
-- On Windows, reliably maximizes the surface.
surfaceMaximize ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceMaximize :: a -> m ()
surfaceMaximize surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_maximize Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceMaximizeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceMaximizeMethodInfo a signature where
    overloadedMethod = surfaceMaximize

#endif

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

foreign import ccall "gdk_surface_merge_child_input_shapes" gdk_surface_merge_child_input_shapes :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Merges the input shape masks for any child surfaces into the
-- input shape mask for /@surface@/. i.e. the union of all input masks
-- for /@surface@/ and its children will become the new input mask
-- for /@surface@/. See 'GI.Gdk.Objects.Surface.surfaceInputShapeCombineRegion'.
-- 
-- This function is distinct from 'GI.Gdk.Objects.Surface.surfaceSetChildInputShapes'
-- because it includes /@surface@/’s input shape mask in the set of
-- shapes to be merged.
surfaceMergeChildInputShapes ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceMergeChildInputShapes :: a -> m ()
surfaceMergeChildInputShapes surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_merge_child_input_shapes Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceMergeChildInputShapesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceMergeChildInputShapesMethodInfo a signature where
    overloadedMethod = surfaceMergeChildInputShapes

#endif

-- method Surface::move
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate relative to surface\8217s parent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate relative to surface\8217s parent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_move" gdk_surface_move :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    IO ()

-- | Repositions a surface relative to its parent surface.
-- For toplevel surfaces, window managers may ignore or modify the move;
-- you should probably use @/gtk_window_move()/@ on a @/GtkWindow/@ widget
-- anyway, instead of using GDK functions. For child surfaces,
-- the move will reliably succeed.
-- 
-- If you’re also planning to resize the surface, use 'GI.Gdk.Objects.Surface.surfaceMoveResize'
-- to both move and resize simultaneously, for a nicer visual effect.
surfaceMove ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@x@/: X coordinate relative to surface’s parent
    -> Int32
    -- ^ /@y@/: Y coordinate relative to surface’s parent
    -> m ()
surfaceMove :: a -> Int32 -> Int32 -> m ()
surfaceMove surface :: a
surface x :: Int32
x y :: Int32
y = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> SurfaceSizeChangedCallback
gdk_surface_move Ptr Surface
surface' Int32
x Int32
y
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceMoveMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceMoveMethodInfo a signature where
    overloadedMethod = surfaceMove

#endif

-- method Surface::move_resize
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "new X position relative to surface\8217s parent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "new Y position relative to surface\8217s parent"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_move_resize" gdk_surface_move_resize :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

-- | Equivalent to calling 'GI.Gdk.Objects.Surface.surfaceMove' and 'GI.Gdk.Objects.Surface.surfaceResize',
-- except that both operations are performed at once, avoiding strange
-- visual effects. (i.e. the user may be able to see the surface first
-- move, then resize, if you don’t use 'GI.Gdk.Objects.Surface.surfaceMoveResize'.)
surfaceMoveResize ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@x@/: new X position relative to surface’s parent
    -> Int32
    -- ^ /@y@/: new Y position relative to surface’s parent
    -> Int32
    -- ^ /@width@/: new width
    -> Int32
    -- ^ /@height@/: new height
    -> m ()
surfaceMoveResize :: a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
surfaceMoveResize surface :: a
surface x :: Int32
x y :: Int32
y width :: Int32
width height :: Int32
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> Int32 -> Int32 -> SurfaceSizeChangedCallback
gdk_surface_move_resize Ptr Surface
surface' Int32
x Int32
y Int32
width Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceMoveResizeMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceMoveResizeMethodInfo a signature where
    overloadedMethod = surfaceMoveResize

#endif

-- method Surface::move_to_rect
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GdkSurface to move"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Rectangle" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the destination #GdkRectangle to align @surface with"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect_anchor"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Gravity" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the point on @rect to align with @surface's anchor point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "surface_anchor"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Gravity" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the point on @surface to align with @rect's anchor point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "anchor_hints"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "AnchorHints" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "positioning hints to use when limited on space"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect_anchor_dx"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "horizontal offset to shift @surface, i.e. @rect's anchor\n                 point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rect_anchor_dy"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "vertical offset to shift @surface, i.e. @rect's anchor point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_move_to_rect" gdk_surface_move_to_rect :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Rectangle.Rectangle ->          -- rect : TInterface (Name {namespace = "Gdk", name = "Rectangle"})
    CUInt ->                                -- rect_anchor : TInterface (Name {namespace = "Gdk", name = "Gravity"})
    CUInt ->                                -- surface_anchor : TInterface (Name {namespace = "Gdk", name = "Gravity"})
    CUInt ->                                -- anchor_hints : TInterface (Name {namespace = "Gdk", name = "AnchorHints"})
    Int32 ->                                -- rect_anchor_dx : TBasicType TInt
    Int32 ->                                -- rect_anchor_dy : TBasicType TInt
    IO ()

-- | Moves /@surface@/ to /@rect@/, aligning their anchor points.
-- 
-- /@rect@/ is relative to the top-left corner of the surface that /@surface@/ is
-- transient for. /@rectAnchor@/ and /@surfaceAnchor@/ determine anchor points on
-- /@rect@/ and /@surface@/ to pin together. /@rect@/\'s anchor point can optionally be
-- offset by /@rectAnchorDx@/ and /@rectAnchorDy@/, which is equivalent to
-- offsetting the position of /@surface@/.
-- 
-- /@anchorHints@/ determines how /@surface@/ will be moved if the anchor points cause
-- it to move off-screen. For example, 'GI.Gdk.Flags.AnchorHintsFlipX' will replace
-- 'GI.Gdk.Enums.GravityNorthWest' with 'GI.Gdk.Enums.GravityNorthEast' and vice versa if
-- /@surface@/ extends beyond the left or right edges of the monitor.
-- 
-- Connect to the [movedToRect]("GI.Gdk.Objects.Surface#signal:movedToRect") signal to find out how it was
-- actually positioned.
surfaceMoveToRect ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: the t'GI.Gdk.Objects.Surface.Surface' to move
    -> Gdk.Rectangle.Rectangle
    -- ^ /@rect@/: the destination t'GI.Gdk.Structs.Rectangle.Rectangle' to align /@surface@/ with
    -> Gdk.Enums.Gravity
    -- ^ /@rectAnchor@/: the point on /@rect@/ to align with /@surface@/\'s anchor point
    -> Gdk.Enums.Gravity
    -- ^ /@surfaceAnchor@/: the point on /@surface@/ to align with /@rect@/\'s anchor point
    -> [Gdk.Flags.AnchorHints]
    -- ^ /@anchorHints@/: positioning hints to use when limited on space
    -> Int32
    -- ^ /@rectAnchorDx@/: horizontal offset to shift /@surface@/, i.e. /@rect@/\'s anchor
    --                  point
    -> Int32
    -- ^ /@rectAnchorDy@/: vertical offset to shift /@surface@/, i.e. /@rect@/\'s anchor point
    -> m ()
surfaceMoveToRect :: a
-> Rectangle
-> Gravity
-> Gravity
-> [AnchorHints]
-> Int32
-> Int32
-> m ()
surfaceMoveToRect surface :: a
surface rect :: Rectangle
rect rectAnchor :: Gravity
rectAnchor surfaceAnchor :: Gravity
surfaceAnchor anchorHints :: [AnchorHints]
anchorHints rectAnchorDx :: Int32
rectAnchorDx rectAnchorDy :: Int32
rectAnchorDy = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Rectangle
rect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
rect
    let rectAnchor' :: CUInt
rectAnchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
rectAnchor
    let surfaceAnchor' :: CUInt
surfaceAnchor' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Gravity -> Int) -> Gravity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Gravity -> Int
forall a. Enum a => a -> Int
fromEnum) Gravity
surfaceAnchor
    let anchorHints' :: CUInt
anchorHints' = [AnchorHints] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [AnchorHints]
anchorHints
    Ptr Surface
-> Ptr Rectangle
-> CUInt
-> CUInt
-> CUInt
-> SurfaceSizeChangedCallback
gdk_surface_move_to_rect Ptr Surface
surface' Ptr Rectangle
rect' CUInt
rectAnchor' CUInt
surfaceAnchor' CUInt
anchorHints' Int32
rectAnchorDx Int32
rectAnchorDy
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
rect
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceMoveToRectMethodInfo
instance (signature ~ (Gdk.Rectangle.Rectangle -> Gdk.Enums.Gravity -> Gdk.Enums.Gravity -> [Gdk.Flags.AnchorHints] -> Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceMoveToRectMethodInfo a signature where
    overloadedMethod = surfaceMoveToRect

#endif

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

foreign import ccall "gdk_surface_peek_children" gdk_surface_peek_children :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO (Ptr (GList (Ptr Surface)))

-- | Like 'GI.Gdk.Objects.Surface.surfaceGetChildren', but does not copy the list of
-- children, so the list does not need to be freed.
surfacePeekChildren ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m [Surface]
    -- ^ __Returns:__ 
    --     a reference to the list of child surfaces in /@surface@/
surfacePeekChildren :: a -> m [Surface]
surfacePeekChildren surface :: a
surface = IO [Surface] -> m [Surface]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Surface] -> m [Surface]) -> IO [Surface] -> m [Surface]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr (GList (Ptr Surface))
result <- Ptr Surface -> IO (Ptr (GList (Ptr Surface)))
gdk_surface_peek_children Ptr Surface
surface'
    [Ptr Surface]
result' <- Ptr (GList (Ptr Surface)) -> IO [Ptr Surface]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Surface))
result
    [Surface]
result'' <- (Ptr Surface -> IO Surface) -> [Ptr Surface] -> IO [Surface]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Surface) [Ptr Surface]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    [Surface] -> IO [Surface]
forall (m :: * -> *) a. Monad m => a -> m a
return [Surface]
result''

#if defined(ENABLE_OVERLOADING)
data SurfacePeekChildrenMethodInfo
instance (signature ~ (m [Surface]), MonadIO m, IsSurface a) => O.MethodInfo SurfacePeekChildrenMethodInfo a signature where
    overloadedMethod = surfacePeekChildren

#endif

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

foreign import ccall "gdk_surface_queue_expose" gdk_surface_queue_expose :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Forces an expose event for /@surface@/ to be scheduled.
-- 
-- If the invalid area of /@surface@/ is empty, an expose event will
-- still be emitted. Its invalid region will be empty.
-- 
-- This function is useful for implementations that track invalid
-- regions on their own.
surfaceQueueExpose ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceQueueExpose :: a -> m ()
surfaceQueueExpose surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_queue_expose Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceQueueExposeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceQueueExposeMethodInfo a signature where
    overloadedMethod = surfaceQueueExpose

#endif

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

foreign import ccall "gdk_surface_raise" gdk_surface_raise :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Raises /@surface@/ to the top of the Z-order (stacking order), so that
-- other surfaces with the same parent surface appear below /@surface@/.
-- This is true whether or not the surfaces are visible.
-- 
-- If /@surface@/ is a toplevel, the window manager may choose to deny the
-- request to move the surface in the Z-order, 'GI.Gdk.Objects.Surface.surfaceRaise' only
-- requests the restack, does not guarantee it.
surfaceRaise ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceRaise :: a -> m ()
surfaceRaise surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_raise Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceRaiseMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceRaiseMethodInfo a signature where
    overloadedMethod = surfaceRaise

#endif

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

foreign import ccall "gdk_surface_register_dnd" gdk_surface_register_dnd :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Registers a surface as a potential drop destination.
surfaceRegisterDnd ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'.
    -> m ()
surfaceRegisterDnd :: a -> m ()
surfaceRegisterDnd surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_register_dnd Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceRegisterDndMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceRegisterDndMethodInfo a signature where
    overloadedMethod = surfaceRegisterDnd

#endif

-- method Surface::resize
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new width of the surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new height of the surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_resize" gdk_surface_resize :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

-- | Resizes /@surface@/; for toplevel surfaces, asks the window manager to resize
-- the surface. The window manager may not allow the resize. When using GTK,
-- use @/gtk_window_resize()/@ instead of this low-level GDK function.
-- 
-- Surfaces may not be resized below 1x1.
-- 
-- If you’re also planning to move the surface, use 'GI.Gdk.Objects.Surface.surfaceMoveResize'
-- to both move and resize simultaneously, for a nicer visual effect.
surfaceResize ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@width@/: new width of the surface
    -> Int32
    -- ^ /@height@/: new height of the surface
    -> m ()
surfaceResize :: a -> Int32 -> Int32 -> m ()
surfaceResize surface :: a
surface width :: Int32
width height :: Int32
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> SurfaceSizeChangedCallback
gdk_surface_resize Ptr Surface
surface' Int32
width Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceResizeMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceResizeMethodInfo a signature where
    overloadedMethod = surfaceResize

#endif

-- method Surface::restack
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sibling"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GdkSurface that is a sibling of @surface, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "above"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a boolean" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_restack" gdk_surface_restack :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Surface ->                          -- sibling : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- above : TBasicType TBoolean
    IO ()

-- | Changes the position of  /@surface@/ in the Z-order (stacking order), so that
-- it is above /@sibling@/ (if /@above@/ is 'P.True') or below /@sibling@/ (if /@above@/ is
-- 'P.False').
-- 
-- If /@sibling@/ is 'P.Nothing', then this either raises (if /@above@/ is 'P.True') or
-- lowers the surface.
-- 
-- If /@surface@/ is a toplevel, the window manager may choose to deny the
-- request to move the surface in the Z-order, 'GI.Gdk.Objects.Surface.surfaceRestack' only
-- requests the restack, does not guarantee it.
surfaceRestack ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, IsSurface b) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Maybe (b)
    -- ^ /@sibling@/: a t'GI.Gdk.Objects.Surface.Surface' that is a sibling of /@surface@/, or 'P.Nothing'
    -> Bool
    -- ^ /@above@/: a boolean
    -> m ()
surfaceRestack :: a -> Maybe b -> Bool -> m ()
surfaceRestack surface :: a
surface sibling :: Maybe b
sibling above :: Bool
above = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface
maybeSibling <- case Maybe b
sibling of
        Nothing -> Ptr Surface -> IO (Ptr Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Surface
forall a. Ptr a
nullPtr
        Just jSibling :: b
jSibling -> do
            Ptr Surface
jSibling' <- b -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSibling
            Ptr Surface -> IO (Ptr Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Surface
jSibling'
    let above' :: CInt
above' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
above
    Ptr Surface -> Ptr Surface -> CInt -> IO ()
gdk_surface_restack Ptr Surface
surface' Ptr Surface
maybeSibling CInt
above'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
sibling b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceRestackMethodInfo
instance (signature ~ (Maybe (b) -> Bool -> m ()), MonadIO m, IsSurface a, IsSurface b) => O.MethodInfo SurfaceRestackMethodInfo a signature where
    overloadedMethod = surfaceRestack

#endif

-- method Surface::set_accept_focus
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accept_focus"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE if the surface should receive input focus"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_accept_focus" gdk_surface_set_accept_focus :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- accept_focus : TBasicType TBoolean
    IO ()

-- | Setting /@acceptFocus@/ to 'P.False' hints the desktop environment that the
-- surface doesn’t want to receive input focus.
-- 
-- On X, it is the responsibility of the window manager to interpret this
-- hint. ICCCM-compliant window manager usually respect it.
surfaceSetAcceptFocus ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@acceptFocus@/: 'P.True' if the surface should receive input focus
    -> m ()
surfaceSetAcceptFocus :: a -> Bool -> m ()
surfaceSetAcceptFocus surface :: a
surface acceptFocus :: Bool
acceptFocus = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let acceptFocus' :: CInt
acceptFocus' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
acceptFocus
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_accept_focus Ptr Surface
surface' CInt
acceptFocus'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetAcceptFocusMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetAcceptFocusMethodInfo a signature where
    overloadedMethod = surfaceSetAcceptFocus

#endif

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

foreign import ccall "gdk_surface_set_child_input_shapes" gdk_surface_set_child_input_shapes :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Sets the input shape mask of /@surface@/ to the union of input shape masks
-- for all children of /@surface@/, ignoring the input shape mask of /@surface@/
-- itself. Contrast with 'GI.Gdk.Objects.Surface.surfaceMergeChildInputShapes' which includes
-- the input shape mask of /@surface@/ in the masks to be merged.
surfaceSetChildInputShapes ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceSetChildInputShapes :: a -> m ()
surfaceSetChildInputShapes surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_set_child_input_shapes Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetChildInputShapesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetChildInputShapesMethodInfo a signature where
    overloadedMethod = surfaceSetChildInputShapes

#endif

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

foreign import ccall "gdk_surface_set_cursor" gdk_surface_set_cursor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Cursor.Cursor ->                -- cursor : TInterface (Name {namespace = "Gdk", name = "Cursor"})
    IO ()

-- | Sets the default mouse pointer for a t'GI.Gdk.Objects.Surface.Surface'.
-- 
-- Note that /@cursor@/ must be for the same display as /@surface@/.
-- 
-- Use 'GI.Gdk.Objects.Cursor.cursorNewFromName' or 'GI.Gdk.Objects.Cursor.cursorNewFromTexture' to
-- create the cursor. To make the cursor invisible, use @/GDK_BLANK_CURSOR/@.
-- Passing 'P.Nothing' for the /@cursor@/ argument to 'GI.Gdk.Objects.Surface.surfaceSetCursor' means
-- that /@surface@/ will use the cursor of its parent surface. Most surfaces
-- should use this default.
surfaceSetCursor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Cursor.IsCursor b) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Maybe (b)
    -- ^ /@cursor@/: a cursor
    -> m ()
surfaceSetCursor :: a -> Maybe b -> m ()
surfaceSetCursor surface :: a
surface cursor :: Maybe b
cursor = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Cursor
maybeCursor <- case Maybe b
cursor of
        Nothing -> Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
forall a. Ptr a
nullPtr
        Just jCursor :: b
jCursor -> do
            Ptr Cursor
jCursor' <- b -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCursor
            Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
jCursor'
    Ptr Surface -> Ptr Cursor -> IO ()
gdk_surface_set_cursor Ptr Surface
surface' Ptr Cursor
maybeCursor
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cursor b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetCursorMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSurface a, Gdk.Cursor.IsCursor b) => O.MethodInfo SurfaceSetCursorMethodInfo a signature where
    overloadedMethod = surfaceSetCursor

#endif

-- method Surface::set_decorations
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "decorations"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "WMDecoration" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "decoration hint mask"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_decorations" gdk_surface_set_decorations :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- decorations : TInterface (Name {namespace = "Gdk", name = "WMDecoration"})
    IO ()

-- | “Decorations” are the features the window manager adds to a toplevel t'GI.Gdk.Objects.Surface.Surface'.
-- This function sets the traditional Motif window manager hints that tell the
-- window manager which decorations you would like your surface to have.
-- Usually you should use @/gtk_window_set_decorated()/@ on a @/GtkWindow/@ instead of
-- using the GDK function directly.
-- 
-- The /@decorations@/ argument is the logical OR of the fields in
-- the t'GI.Gdk.Flags.WMDecoration' enumeration. If @/GDK_DECOR_ALL/@ is included in the
-- mask, the other bits indicate which decorations should be turned off.
-- If @/GDK_DECOR_ALL/@ is not included, then the other bits indicate
-- which decorations should be turned on.
-- 
-- Most window managers honor a decorations hint of 0 to disable all decorations,
-- but very few honor all possible combinations of bits.
surfaceSetDecorations ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> [Gdk.Flags.WMDecoration]
    -- ^ /@decorations@/: decoration hint mask
    -> m ()
surfaceSetDecorations :: a -> [WMDecoration] -> m ()
surfaceSetDecorations surface :: a
surface decorations :: [WMDecoration]
decorations = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let decorations' :: CUInt
decorations' = [WMDecoration] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [WMDecoration]
decorations
    Ptr Surface -> CUInt -> IO ()
gdk_surface_set_decorations Ptr Surface
surface' CUInt
decorations'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetDecorationsMethodInfo
instance (signature ~ ([Gdk.Flags.WMDecoration] -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetDecorationsMethodInfo a signature where
    overloadedMethod = surfaceSetDecorations

#endif

-- method Surface::set_device_cursor
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a master, pointer #GdkDevice"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cursor"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Cursor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkCursor" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_device_cursor" gdk_surface_set_device_cursor :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    Ptr Gdk.Cursor.Cursor ->                -- cursor : TInterface (Name {namespace = "Gdk", name = "Cursor"})
    IO ()

-- | Sets a specific t'GI.Gdk.Objects.Cursor.Cursor' for a given device when it gets inside /@surface@/.
-- Use @/gdk_cursor_new_fromm_name()/@ or 'GI.Gdk.Objects.Cursor.cursorNewFromTexture' to create
-- the cursor. To make the cursor invisible, use @/GDK_BLANK_CURSOR/@. Passing
-- 'P.Nothing' for the /@cursor@/ argument to 'GI.Gdk.Objects.Surface.surfaceSetCursor' means that
-- /@surface@/ will use the cursor of its parent surface. Most surfaces should
-- use this default.
surfaceSetDeviceCursor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Device.IsDevice b, Gdk.Cursor.IsCursor c) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> b
    -- ^ /@device@/: a master, pointer t'GI.Gdk.Objects.Device.Device'
    -> c
    -- ^ /@cursor@/: a t'GI.Gdk.Objects.Cursor.Cursor'
    -> m ()
surfaceSetDeviceCursor :: a -> b -> c -> m ()
surfaceSetDeviceCursor surface :: a
surface device :: b
device cursor :: c
cursor = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
    Ptr Cursor
cursor' <- c -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
cursor
    Ptr Surface -> Ptr Device -> Ptr Cursor -> IO ()
gdk_surface_set_device_cursor Ptr Surface
surface' Ptr Device
device' Ptr Cursor
cursor'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
cursor
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetDeviceCursorMethodInfo
instance (signature ~ (b -> c -> m ()), MonadIO m, IsSurface a, Gdk.Device.IsDevice b, Gdk.Cursor.IsCursor c) => O.MethodInfo SurfaceSetDeviceCursorMethodInfo a signature where
    overloadedMethod = surfaceSetDeviceCursor

#endif

-- method Surface::set_focus_on_map
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "focus_on_map"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE if the surface should receive input focus when mapped"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_focus_on_map" gdk_surface_set_focus_on_map :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- focus_on_map : TBasicType TBoolean
    IO ()

-- | Setting /@focusOnMap@/ to 'P.False' hints the desktop environment that the
-- surface doesn’t want to receive input focus when it is mapped.
-- focus_on_map should be turned off for surfaces that aren’t triggered
-- interactively (such as popups from network activity).
-- 
-- On X, it is the responsibility of the window manager to interpret
-- this hint. Window managers following the freedesktop.org window
-- manager extension specification should respect it.
surfaceSetFocusOnMap ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@focusOnMap@/: 'P.True' if the surface should receive input focus when mapped
    -> m ()
surfaceSetFocusOnMap :: a -> Bool -> m ()
surfaceSetFocusOnMap surface :: a
surface focusOnMap :: Bool
focusOnMap = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let focusOnMap' :: CInt
focusOnMap' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
focusOnMap
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_focus_on_map Ptr Surface
surface' CInt
focusOnMap'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetFocusOnMapMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetFocusOnMapMethodInfo a signature where
    overloadedMethod = surfaceSetFocusOnMap

#endif

-- method Surface::set_fullscreen_mode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "FullscreenMode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "fullscreen mode" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_fullscreen_mode" gdk_surface_set_fullscreen_mode :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "Gdk", name = "FullscreenMode"})
    IO ()

-- | Specifies whether the /@surface@/ should span over all monitors (in a multi-head
-- setup) or only the current monitor when in fullscreen mode.
-- 
-- The /@mode@/ argument is from the t'GI.Gdk.Enums.FullscreenMode' enumeration.
-- If @/GDK_FULLSCREEN_ON_ALL_MONITORS/@ is specified, the fullscreen /@surface@/ will
-- span over all monitors of the display.
-- 
-- On X11, searches through the list of monitors display the ones
-- which delimit the 4 edges of the entire display and will ask the window
-- manager to span the /@surface@/ over these monitors.
-- 
-- If the XINERAMA extension is not available or not usable, this function
-- has no effect.
-- 
-- Not all window managers support this, so you can’t rely on the fullscreen
-- surface to span over the multiple monitors when @/GDK_FULLSCREEN_ON_ALL_MONITORS/@
-- is specified.
surfaceSetFullscreenMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Gdk.Enums.FullscreenMode
    -- ^ /@mode@/: fullscreen mode
    -> m ()
surfaceSetFullscreenMode :: a -> FullscreenMode -> m ()
surfaceSetFullscreenMode surface :: a
surface mode :: FullscreenMode
mode = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (FullscreenMode -> Int) -> FullscreenMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FullscreenMode -> Int
forall a. Enum a => a -> Int
fromEnum) FullscreenMode
mode
    Ptr Surface -> CUInt -> IO ()
gdk_surface_set_fullscreen_mode Ptr Surface
surface' CUInt
mode'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetFullscreenModeMethodInfo
instance (signature ~ (Gdk.Enums.FullscreenMode -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetFullscreenModeMethodInfo a signature where
    overloadedMethod = surfaceSetFullscreenMode

#endif

-- method Surface::set_functions
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "functions"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "WMFunction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "bitmask of operations to allow on @surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_functions" gdk_surface_set_functions :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- functions : TInterface (Name {namespace = "Gdk", name = "WMFunction"})
    IO ()

-- | Sets hints about the window management functions to make available
-- via buttons on the window frame.
-- 
-- On the X backend, this function sets the traditional Motif window
-- manager hint for this purpose. However, few window managers do
-- anything reliable or interesting with this hint. Many ignore it
-- entirely.
-- 
-- The /@functions@/ argument is the logical OR of values from the
-- t'GI.Gdk.Flags.WMFunction' enumeration. If the bitmask includes @/GDK_FUNC_ALL/@,
-- then the other bits indicate which functions to disable; if
-- it doesn’t include @/GDK_FUNC_ALL/@, it indicates which functions to
-- enable.
surfaceSetFunctions ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> [Gdk.Flags.WMFunction]
    -- ^ /@functions@/: bitmask of operations to allow on /@surface@/
    -> m ()
surfaceSetFunctions :: a -> [WMFunction] -> m ()
surfaceSetFunctions surface :: a
surface functions :: [WMFunction]
functions = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let functions' :: CUInt
functions' = [WMFunction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [WMFunction]
functions
    Ptr Surface -> CUInt -> IO ()
gdk_surface_set_functions Ptr Surface
surface' CUInt
functions'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetFunctionsMethodInfo
instance (signature ~ ([Gdk.Flags.WMFunction] -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetFunctionsMethodInfo a signature where
    overloadedMethod = surfaceSetFunctions

#endif

-- method Surface::set_geometry_hints
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "geometry"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Geometry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "geometry hints" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "geom_mask"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "SurfaceHints" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "bitmask indicating fields of @geometry to pay attention to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_geometry_hints" gdk_surface_set_geometry_hints :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Geometry.Geometry ->            -- geometry : TInterface (Name {namespace = "Gdk", name = "Geometry"})
    CUInt ->                                -- geom_mask : TInterface (Name {namespace = "Gdk", name = "SurfaceHints"})
    IO ()

-- | Sets the geometry hints for /@surface@/. Hints flagged in /@geomMask@/
-- are set, hints not flagged in /@geomMask@/ are unset.
-- To unset all hints, use a /@geomMask@/ of 0 and a /@geometry@/ of 'P.Nothing'.
-- 
-- This function provides hints to the surfaceing system about
-- acceptable sizes for a toplevel surface. The purpose of
-- this is to constrain user resizing, but the windowing system
-- will typically  (but is not required to) also constrain the
-- current size of the surface to the provided values and
-- constrain programatic resizing via 'GI.Gdk.Objects.Surface.surfaceResize' or
-- 'GI.Gdk.Objects.Surface.surfaceMoveResize'.
-- 
-- Note that on X11, this effect has no effect on surfaces
-- of type 'GI.Gdk.Enums.SurfaceTypeTemp' since these surfaces are not resizable
-- by the user.
-- 
-- Since you can’t count on the windowing system doing the
-- constraints for programmatic resizes, you should generally
-- call 'GI.Gdk.Objects.Surface.surfaceConstrainSize' yourself to determine
-- appropriate sizes.
surfaceSetGeometryHints ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Gdk.Geometry.Geometry
    -- ^ /@geometry@/: geometry hints
    -> [Gdk.Flags.SurfaceHints]
    -- ^ /@geomMask@/: bitmask indicating fields of /@geometry@/ to pay attention to
    -> m ()
surfaceSetGeometryHints :: a -> Geometry -> [SurfaceHints] -> m ()
surfaceSetGeometryHints surface :: a
surface geometry :: Geometry
geometry geomMask :: [SurfaceHints]
geomMask = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Geometry
geometry' <- Geometry -> IO (Ptr Geometry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Geometry
geometry
    let geomMask' :: CUInt
geomMask' = [SurfaceHints] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SurfaceHints]
geomMask
    Ptr Surface -> Ptr Geometry -> CUInt -> IO ()
gdk_surface_set_geometry_hints Ptr Surface
surface' Ptr Geometry
geometry' CUInt
geomMask'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Geometry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Geometry
geometry
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetGeometryHintsMethodInfo
instance (signature ~ (Gdk.Geometry.Geometry -> [Gdk.Flags.SurfaceHints] -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetGeometryHintsMethodInfo a signature where
    overloadedMethod = surfaceSetGeometryHints

#endif

-- method Surface::set_icon_list
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #GdkSurface toplevel surface to set the icon of."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "surfaces"
--           , argType =
--               TGList (TInterface Name { namespace = "Gdk" , name = "Texture" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "\n    A list of image surfaces, of different sizes."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_icon_list" gdk_surface_set_icon_list :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr (GList (Ptr Gdk.Texture.Texture)) -> -- surfaces : TGList (TInterface (Name {namespace = "Gdk", name = "Texture"}))
    IO ()

-- | Sets a list of icons for the surface. One of these will be used
-- to represent the surface when it has been iconified. The icon is
-- usually shown in an icon box or some sort of task bar. Which icon
-- size is shown depends on the window manager. The window manager
-- can scale the icon  but setting several size icons can give better
-- image quality since the window manager may only need to scale the
-- icon by a small amount or not at all.
-- 
-- Note that some platforms don\'t support surface icons.
surfaceSetIconList ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Texture.IsTexture b) =>
    a
    -- ^ /@surface@/: The t'GI.Gdk.Objects.Surface.Surface' toplevel surface to set the icon of.
    -> [b]
    -- ^ /@surfaces@/: 
    --     A list of image surfaces, of different sizes.
    -> m ()
surfaceSetIconList :: a -> [b] -> m ()
surfaceSetIconList surface :: a
surface surfaces :: [b]
surfaces = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    [Ptr Texture]
surfaces' <- (b -> IO (Ptr Texture)) -> [b] -> IO [Ptr Texture]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM b -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [b]
surfaces
    Ptr (GList (Ptr Texture))
surfaces'' <- [Ptr Texture] -> IO (Ptr (GList (Ptr Texture)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr Texture]
surfaces'
    Ptr Surface -> Ptr (GList (Ptr Texture)) -> IO ()
gdk_surface_set_icon_list Ptr Surface
surface' Ptr (GList (Ptr Texture))
surfaces''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    (b -> IO ()) -> [b] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [b]
surfaces
    Ptr (GList (Ptr Texture)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Texture))
surfaces''
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetIconListMethodInfo
instance (signature ~ ([b] -> m ()), MonadIO m, IsSurface a, Gdk.Texture.IsTexture b) => O.MethodInfo SurfaceSetIconListMethodInfo a signature where
    overloadedMethod = surfaceSetIconList

#endif

-- method Surface::set_icon_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of surface while iconified (minimized)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_icon_name" gdk_surface_set_icon_name :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CString ->                              -- name : TBasicType TUTF8
    IO ()

-- | Surfaces may have a name used while minimized, distinct from the
-- name they display in their titlebar. Most of the time this is a bad
-- idea from a user interface standpoint. But you can set such a name
-- with this function, if you like.
-- 
-- After calling this with a non-'P.Nothing' /@name@/, calls to 'GI.Gdk.Objects.Surface.surfaceSetTitle'
-- will not update the icon title.
-- 
-- Using 'P.Nothing' for /@name@/ unsets the icon title; further calls to
-- 'GI.Gdk.Objects.Surface.surfaceSetTitle' will again update the icon title as well.
-- 
-- Note that some platforms don\'t support surface icons.
surfaceSetIconName ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Maybe (T.Text)
    -- ^ /@name@/: name of surface while iconified (minimized)
    -> m ()
surfaceSetIconName :: a -> Maybe Text -> m ()
surfaceSetIconName surface :: a
surface name :: Maybe Text
name = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr CChar
maybeName <- case Maybe Text
name of
        Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just jName :: Text
jName -> do
            Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
    Ptr Surface -> Ptr CChar -> IO ()
gdk_surface_set_icon_name Ptr Surface
surface' Ptr CChar
maybeName
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetIconNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetIconNameMethodInfo a signature where
    overloadedMethod = surfaceSetIconName

#endif

-- method Surface::set_keep_above
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "setting"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether to keep @surface above other surfaces"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_keep_above" gdk_surface_set_keep_above :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- setting : TBasicType TBoolean
    IO ()

-- | Set if /@surface@/ must be kept above other surfaces. If the
-- surface was already above, then this function does nothing.
-- 
-- On X11, asks the window manager to keep /@surface@/ above, if the window
-- manager supports this operation. Not all window managers support
-- this, and some deliberately ignore it or don’t have a concept of
-- “keep above”; so you can’t rely on the surface being kept above.
-- But it will happen with most standard window managers,
-- and GDK makes a best effort to get it to happen.
surfaceSetKeepAbove ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@setting@/: whether to keep /@surface@/ above other surfaces
    -> m ()
surfaceSetKeepAbove :: a -> Bool -> m ()
surfaceSetKeepAbove surface :: a
surface setting :: Bool
setting = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let setting' :: CInt
setting' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
setting
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_keep_above Ptr Surface
surface' CInt
setting'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetKeepAboveMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetKeepAboveMethodInfo a signature where
    overloadedMethod = surfaceSetKeepAbove

#endif

-- method Surface::set_keep_below
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "setting"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether to keep @surface below other surfaces"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_keep_below" gdk_surface_set_keep_below :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- setting : TBasicType TBoolean
    IO ()

-- | Set if /@surface@/ must be kept below other surfaces. If the
-- surface was already below, then this function does nothing.
-- 
-- On X11, asks the window manager to keep /@surface@/ below, if the window
-- manager supports this operation. Not all window managers support
-- this, and some deliberately ignore it or don’t have a concept of
-- “keep below”; so you can’t rely on the surface being kept below.
-- But it will happen with most standard window managers,
-- and GDK makes a best effort to get it to happen.
surfaceSetKeepBelow ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@setting@/: whether to keep /@surface@/ below other surfaces
    -> m ()
surfaceSetKeepBelow :: a -> Bool -> m ()
surfaceSetKeepBelow surface :: a
surface setting :: Bool
setting = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let setting' :: CInt
setting' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
setting
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_keep_below Ptr Surface
surface' CInt
setting'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetKeepBelowMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetKeepBelowMethodInfo a signature where
    overloadedMethod = surfaceSetKeepBelow

#endif

-- method Surface::set_modal_hint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modal"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE if the surface is modal, %FALSE otherwise."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_modal_hint" gdk_surface_set_modal_hint :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- modal : TBasicType TBoolean
    IO ()

-- | The application can use this hint to tell the window manager
-- that a certain surface has modal behaviour. The window manager
-- can use this information to handle modal surfaces in a special
-- way.
-- 
-- You should only use this on surfaces for which you have
-- previously called 'GI.Gdk.Objects.Surface.surfaceSetTransientFor'
surfaceSetModalHint ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: A toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@modal@/: 'P.True' if the surface is modal, 'P.False' otherwise.
    -> m ()
surfaceSetModalHint :: a -> Bool -> m ()
surfaceSetModalHint surface :: a
surface modal :: Bool
modal = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let modal' :: CInt
modal' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
modal
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_modal_hint Ptr Surface
surface' CInt
modal'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetModalHintMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetModalHintMethodInfo a signature where
    overloadedMethod = surfaceSetModalHint

#endif

-- method Surface::set_opacity
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a top-level or non-native #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "opacity"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "opacity" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_opacity" gdk_surface_set_opacity :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CDouble ->                              -- opacity : TBasicType TDouble
    IO ()

-- | Set /@surface@/ to render as partially transparent,
-- with opacity 0 being fully transparent and 1 fully opaque. (Values
-- of the opacity parameter are clamped to the [0,1] range.)
-- 
-- For toplevel surfaces this depends on support from the windowing system
-- that may not always be there. For instance, On X11, this works only on
-- X screens with a compositing manager running. On Wayland, there is no
-- per-surface opacity value that the compositor would apply. Instead, use
-- @gdk_surface_set_opaque_region (surface, NULL)@ to tell the compositor
-- that the entire surface is (potentially) non-opaque, and draw your content
-- with alpha, or use @/gtk_widget_set_opacity()/@ to set an overall opacity
-- for your widgets.
-- 
-- Support for non-toplevel surfaces was added in 3.8.
surfaceSetOpacity ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a top-level or non-native t'GI.Gdk.Objects.Surface.Surface'
    -> Double
    -- ^ /@opacity@/: opacity
    -> m ()
surfaceSetOpacity :: a -> Double -> m ()
surfaceSetOpacity surface :: a
surface opacity :: Double
opacity = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let opacity' :: CDouble
opacity' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
opacity
    Ptr Surface -> CDouble -> IO ()
gdk_surface_set_opacity Ptr Surface
surface' CDouble
opacity'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetOpacityMethodInfo
instance (signature ~ (Double -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetOpacityMethodInfo a signature where
    overloadedMethod = surfaceSetOpacity

#endif

-- method Surface::set_opaque_region
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a top-level or non-native #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "region"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Region" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a region, or %NULL" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_opaque_region" gdk_surface_set_opaque_region :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Cairo.Region.Region ->              -- region : TInterface (Name {namespace = "cairo", name = "Region"})
    IO ()

-- | For optimisation purposes, compositing window managers may
-- like to not draw obscured regions of surfaces, or turn off blending
-- during for these regions. With RGB windows with no transparency,
-- this is just the shape of the window, but with ARGB32 windows, the
-- compositor does not know what regions of the window are transparent
-- or not.
-- 
-- This function only works for toplevel surfaces.
-- 
-- GTK will update this property automatically if
-- the /@surface@/ background is opaque, as we know where the opaque regions
-- are. If your surface background is not opaque, please update this
-- property in your @/GtkWidget::style-updated/@ handler.
surfaceSetOpaqueRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a top-level or non-native t'GI.Gdk.Objects.Surface.Surface'
    -> Maybe (Cairo.Region.Region)
    -- ^ /@region@/: a region, or 'P.Nothing'
    -> m ()
surfaceSetOpaqueRegion :: a -> Maybe Region -> m ()
surfaceSetOpaqueRegion surface :: a
surface region :: Maybe Region
region = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Region
maybeRegion <- case Maybe Region
region of
        Nothing -> Ptr Region -> IO (Ptr Region)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Region
forall a. Ptr a
nullPtr
        Just jRegion :: Region
jRegion -> do
            Ptr Region
jRegion' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
jRegion
            Ptr Region -> IO (Ptr Region)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Region
jRegion'
    Ptr Surface -> Ptr Region -> IO ()
gdk_surface_set_opaque_region Ptr Surface
surface' Ptr Region
maybeRegion
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Maybe Region -> (Region -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Region
region Region -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetOpaqueRegionMethodInfo
instance (signature ~ (Maybe (Cairo.Region.Region) -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetOpaqueRegionMethodInfo a signature where
    overloadedMethod = surfaceSetOpaqueRegion

#endif

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

foreign import ccall "gdk_surface_set_pass_through" gdk_surface_set_pass_through :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- pass_through : TBasicType TBoolean
    IO ()

-- | Sets whether input to the surface is passed through to the surface
-- below.
-- 
-- The default value of this is 'P.False', which means that pointer
-- events that happen inside the surface are send first to the surface,
-- but if the event is not selected by the event mask then the event
-- is sent to the parent surface, and so on up the hierarchy.
-- 
-- If /@passThrough@/ is 'P.True' then such pointer events happen as if the
-- surface wasn\'t there at all, and thus will be sent first to any
-- surfaces below /@surface@/. This is useful if the surface is used in a
-- transparent fashion. In the terminology of the web this would be called
-- \"pointer-events: none\".
-- 
-- Note that a surface with /@passThrough@/ 'P.True' can still have a subsurface
-- without pass through, so you can get events on a subset of a surface. And in
-- that cases you would get the in-between related events such as the pointer
-- enter\/leave events on its way to the destination surface.
surfaceSetPassThrough ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Bool
    -- ^ /@passThrough@/: a boolean
    -> m ()
surfaceSetPassThrough :: a -> Bool -> m ()
surfaceSetPassThrough surface :: a
surface passThrough :: Bool
passThrough = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let passThrough' :: CInt
passThrough' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
passThrough
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_pass_through Ptr Surface
surface' CInt
passThrough'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetPassThroughMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetPassThroughMethodInfo a signature where
    overloadedMethod = surfaceSetPassThrough

#endif

-- method Surface::set_shadow_width
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "left"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The left extent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "right"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The right extent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "top"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The top extent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bottom"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The bottom extent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_shadow_width" gdk_surface_set_shadow_width :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Int32 ->                                -- left : TBasicType TInt
    Int32 ->                                -- right : TBasicType TInt
    Int32 ->                                -- top : TBasicType TInt
    Int32 ->                                -- bottom : TBasicType TInt
    IO ()

-- | Newer GTK windows using client-side decorations use extra geometry
-- around their frames for effects like shadows and invisible borders.
-- Window managers that want to maximize windows or snap to edges need
-- to know where the extents of the actual frame lie, so that users
-- don’t feel like windows are snapping against random invisible edges.
-- 
-- Note that this property is automatically updated by GTK, so this
-- function should only be used by applications which do not use GTK
-- to create toplevel surfaces.
surfaceSetShadowWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> Int32
    -- ^ /@left@/: The left extent
    -> Int32
    -- ^ /@right@/: The right extent
    -> Int32
    -- ^ /@top@/: The top extent
    -> Int32
    -- ^ /@bottom@/: The bottom extent
    -> m ()
surfaceSetShadowWidth :: a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
surfaceSetShadowWidth surface :: a
surface left :: Int32
left right :: Int32
right top :: Int32
top bottom :: Int32
bottom = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> Int32 -> Int32 -> SurfaceSizeChangedCallback
gdk_surface_set_shadow_width Ptr Surface
surface' Int32
left Int32
right Int32
top Int32
bottom
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetShadowWidthMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetShadowWidthMethodInfo a signature where
    overloadedMethod = surfaceSetShadowWidth

#endif

-- method Surface::set_startup_id
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "startup_id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string with startup-notification identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_startup_id" gdk_surface_set_startup_id :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CString ->                              -- startup_id : TBasicType TUTF8
    IO ()

-- | When using GTK, typically you should use @/gtk_window_set_startup_id()/@
-- instead of this low-level function.
surfaceSetStartupId ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> T.Text
    -- ^ /@startupId@/: a string with startup-notification identifier
    -> m ()
surfaceSetStartupId :: a -> Text -> m ()
surfaceSetStartupId surface :: a
surface startupId :: Text
startupId = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr CChar
startupId' <- Text -> IO (Ptr CChar)
textToCString Text
startupId
    Ptr Surface -> Ptr CChar -> IO ()
gdk_surface_set_startup_id Ptr Surface
surface' Ptr CChar
startupId'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
startupId'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetStartupIdMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetStartupIdMethodInfo a signature where
    overloadedMethod = surfaceSetStartupId

#endif

-- method Surface::set_support_multidevice
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "support_multidevice"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE to enable multidevice support in @surface."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_support_multidevice" gdk_surface_set_support_multidevice :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CInt ->                                 -- support_multidevice : TBasicType TBoolean
    IO ()

-- | This function will enable multidevice features in /@surface@/.
-- 
-- Multidevice aware surfaces will need to handle properly multiple,
-- per device enter\/leave events, device grabs and grab ownerships.
surfaceSetSupportMultidevice ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'.
    -> Bool
    -- ^ /@supportMultidevice@/: 'P.True' to enable multidevice support in /@surface@/.
    -> m ()
surfaceSetSupportMultidevice :: a -> Bool -> m ()
surfaceSetSupportMultidevice surface :: a
surface supportMultidevice :: Bool
supportMultidevice = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let supportMultidevice' :: CInt
supportMultidevice' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
supportMultidevice
    Ptr Surface -> CInt -> IO ()
gdk_surface_set_support_multidevice Ptr Surface
surface' CInt
supportMultidevice'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetSupportMultideviceMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetSupportMultideviceMethodInfo a signature where
    overloadedMethod = surfaceSetSupportMultidevice

#endif

-- method Surface::set_title
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "title"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "title of @surface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_title" gdk_surface_set_title :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CString ->                              -- title : TBasicType TUTF8
    IO ()

-- | Sets the title of a toplevel surface, to be displayed in the titlebar.
-- If you haven’t explicitly set the icon name for the surface
-- (using 'GI.Gdk.Objects.Surface.surfaceSetIconName'), the icon name will be set to
-- /@title@/ as well. /@title@/ must be in UTF-8 encoding (as with all
-- user-readable strings in GDK and GTK). /@title@/ may not be 'P.Nothing'.
surfaceSetTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> T.Text
    -- ^ /@title@/: title of /@surface@/
    -> m ()
surfaceSetTitle :: a -> Text -> m ()
surfaceSetTitle surface :: a
surface title :: Text
title = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr CChar
title' <- Text -> IO (Ptr CChar)
textToCString Text
title
    Ptr Surface -> Ptr CChar -> IO ()
gdk_surface_set_title Ptr Surface
surface' Ptr CChar
title'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
title'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetTitleMethodInfo a signature where
    overloadedMethod = surfaceSetTitle

#endif

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

foreign import ccall "gdk_surface_set_transient_for" gdk_surface_set_transient_for :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Surface ->                          -- parent : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Indicates to the window manager that /@surface@/ is a transient dialog
-- associated with the application surface /@parent@/. This allows the
-- window manager to do things like center /@surface@/ on /@parent@/ and
-- keep /@surface@/ above /@parent@/.
-- 
-- See @/gtk_window_set_transient_for()/@ if you’re using @/GtkWindow/@ or
-- @/GtkDialog/@.
surfaceSetTransientFor ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, IsSurface b) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> b
    -- ^ /@parent@/: another toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceSetTransientFor :: a -> b -> m ()
surfaceSetTransientFor surface :: a
surface parent :: b
parent = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface
parent' <- b -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
parent
    Ptr Surface -> Ptr Surface -> IO ()
gdk_surface_set_transient_for Ptr Surface
surface' Ptr Surface
parent'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
parent
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetTransientForMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSurface a, IsSurface b) => O.MethodInfo SurfaceSetTransientForMethodInfo a signature where
    overloadedMethod = surfaceSetTransientFor

#endif

-- method Surface::set_type_hint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A toplevel #GdkSurface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hint"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "SurfaceTypeHint" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A hint of the function this surface will have"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_set_type_hint" gdk_surface_set_type_hint :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    CUInt ->                                -- hint : TInterface (Name {namespace = "Gdk", name = "SurfaceTypeHint"})
    IO ()

-- | The application can use this call to provide a hint to the surface
-- manager about the functionality of a surface. The window manager
-- can use this information when determining the decoration and behaviour
-- of the surface.
-- 
-- The hint must be set before the surface is mapped.
surfaceSetTypeHint ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: A toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> Gdk.Enums.SurfaceTypeHint
    -- ^ /@hint@/: A hint of the function this surface will have
    -> m ()
surfaceSetTypeHint :: a -> SurfaceTypeHint -> m ()
surfaceSetTypeHint surface :: a
surface hint :: SurfaceTypeHint
hint = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    let hint' :: CUInt
hint' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SurfaceTypeHint -> Int) -> SurfaceTypeHint -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SurfaceTypeHint -> Int
forall a. Enum a => a -> Int
fromEnum) SurfaceTypeHint
hint
    Ptr Surface -> CUInt -> IO ()
gdk_surface_set_type_hint Ptr Surface
surface' CUInt
hint'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceSetTypeHintMethodInfo
instance (signature ~ (Gdk.Enums.SurfaceTypeHint -> m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceSetTypeHintMethodInfo a signature where
    overloadedMethod = surfaceSetTypeHint

#endif

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

foreign import ccall "gdk_surface_show" gdk_surface_show :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Like 'GI.Gdk.Objects.Surface.surfaceShowUnraised', but also raises the surface to the
-- top of the surface stack (moves the surface to the front of the
-- Z-order).
-- 
-- This function maps a surface so it’s visible onscreen. Its opposite
-- is 'GI.Gdk.Objects.Surface.surfaceHide'.
-- 
-- When implementing a @/GtkWidget/@, you should call this function on the widget\'s
-- t'GI.Gdk.Objects.Surface.Surface' as part of the “map” method.
surfaceShow ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceShow :: a -> m ()
surfaceShow surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_show Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceShowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceShowMethodInfo a signature where
    overloadedMethod = surfaceShow

#endif

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

foreign import ccall "gdk_surface_show_unraised" gdk_surface_show_unraised :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Shows a t'GI.Gdk.Objects.Surface.Surface' onscreen, but does not modify its stacking
-- order. In contrast, 'GI.Gdk.Objects.Surface.surfaceShow' will raise the surface
-- to the top of the surface stack.
-- 
-- On the X11 platform, in Xlib terms, this function calls
-- @/XMapWindow()/@ (it also updates some internal GDK state, which means
-- that you can’t really use @/XMapWindow()/@ directly on a GDK surface).
surfaceShowUnraised ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceShowUnraised :: a -> m ()
surfaceShowUnraised surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_show_unraised Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceShowUnraisedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceShowUnraisedMethodInfo a signature where
    overloadedMethod = surfaceShowUnraised

#endif

-- method Surface::show_window_menu
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "surface"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Surface" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkSurface" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent to show the menu for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_show_window_menu" gdk_surface_show_window_menu :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    Ptr Gdk.Event.Event ->                  -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO CInt

-- | Asks the windowing system to show the window menu. The window menu
-- is the menu shown when right-clicking the titlebar on traditional
-- windows managed by the window manager. This is useful for windows
-- using client-side decorations, activating it with a right-click
-- on the window decorations.
surfaceShowWindowMenu ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a, Gdk.Event.IsEvent b) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> b
    -- ^ /@event@/: a @/GdkEvent/@ to show the menu for
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the window menu was shown and 'P.False' otherwise.
surfaceShowWindowMenu :: a -> b -> m Bool
surfaceShowWindowMenu surface :: a
surface event :: b
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Event
event' <- b -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
event
    CInt
result <- Ptr Surface -> Ptr Event -> IO CInt
gdk_surface_show_window_menu Ptr Surface
surface' Ptr Event
event'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
event
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SurfaceShowWindowMenuMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsSurface a, Gdk.Event.IsEvent b) => O.MethodInfo SurfaceShowWindowMenuMethodInfo a signature where
    overloadedMethod = surfaceShowWindowMenu

#endif

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

foreign import ccall "gdk_surface_stick" gdk_surface_stick :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | “Pins” a surface such that it’s on all workspaces and does not scroll
-- with viewports, for window managers that have scrollable viewports.
-- (When using @/GtkWindow/@, @/gtk_window_stick()/@ may be more useful.)
-- 
-- On the X11 platform, this function depends on window manager
-- support, so may have no effect with many window managers. However,
-- GDK will do the best it can to convince the window manager to stick
-- the surface. For window managers that don’t support this operation,
-- there’s nothing you can do to force it to happen.
surfaceStick ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceStick :: a -> m ()
surfaceStick surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_stick Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceStickMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceStickMethodInfo a signature where
    overloadedMethod = surfaceStick

#endif

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

foreign import ccall "gdk_surface_thaw_updates" gdk_surface_thaw_updates :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Thaws a surface frozen with 'GI.Gdk.Objects.Surface.surfaceFreezeUpdates'.
surfaceThawUpdates ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceThawUpdates :: a -> m ()
surfaceThawUpdates surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_thaw_updates Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceThawUpdatesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceThawUpdatesMethodInfo a signature where
    overloadedMethod = surfaceThawUpdates

#endif

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

foreign import ccall "gdk_surface_unfullscreen" gdk_surface_unfullscreen :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Moves the surface out of fullscreen mode. If the surface was not
-- fullscreen, does nothing.
-- 
-- On X11, asks the window manager to move /@surface@/ out of the fullscreen
-- state, if the window manager supports this operation. Not all
-- window managers support this, and some deliberately ignore it or
-- don’t have a concept of “fullscreen”; so you can’t rely on the
-- unfullscreenification actually happening. But it will happen with
-- most standard window managers, and GDK makes a best effort to get
-- it to happen.
surfaceUnfullscreen ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceUnfullscreen :: a -> m ()
surfaceUnfullscreen surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_unfullscreen Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceUnfullscreenMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceUnfullscreenMethodInfo a signature where
    overloadedMethod = surfaceUnfullscreen

#endif

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

foreign import ccall "gdk_surface_unmaximize" gdk_surface_unmaximize :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Unmaximizes the surface. If the surface wasn’t maximized, then this
-- function does nothing.
-- 
-- On X11, asks the window manager to unmaximize /@surface@/, if the
-- window manager supports this operation. Not all window managers
-- support this, and some deliberately ignore it or don’t have a
-- concept of “maximized”; so you can’t rely on the unmaximization
-- actually happening. But it will happen with most standard window
-- managers, and GDK makes a best effort to get it to happen.
-- 
-- On Windows, reliably unmaximizes the surface.
surfaceUnmaximize ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceUnmaximize :: a -> m ()
surfaceUnmaximize surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_unmaximize Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceUnmaximizeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceUnmaximizeMethodInfo a signature where
    overloadedMethod = surfaceUnmaximize

#endif

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

foreign import ccall "gdk_surface_unstick" gdk_surface_unstick :: 
    Ptr Surface ->                          -- surface : TInterface (Name {namespace = "Gdk", name = "Surface"})
    IO ()

-- | Reverse operation for 'GI.Gdk.Objects.Surface.surfaceStick'; see 'GI.Gdk.Objects.Surface.surfaceStick',
-- and @/gtk_window_unstick()/@.
surfaceUnstick ::
    (B.CallStack.HasCallStack, MonadIO m, IsSurface a) =>
    a
    -- ^ /@surface@/: a toplevel t'GI.Gdk.Objects.Surface.Surface'
    -> m ()
surfaceUnstick :: a -> m ()
surfaceUnstick surface :: a
surface = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
    Ptr Surface -> IO ()
gdk_surface_unstick Ptr Surface
surface'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
surface
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SurfaceUnstickMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSurface a) => O.MethodInfo SurfaceUnstickMethodInfo a signature where
    overloadedMethod = surfaceUnstick

#endif

-- method Surface::constrain_size
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "geometry"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Geometry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkGeometry structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "SurfaceHints" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a mask indicating what portions of @geometry are set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "desired width of surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "desired height of the surface"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_width"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store resulting width"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "new_height"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store resulting height"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_surface_constrain_size" gdk_surface_constrain_size :: 
    Ptr Gdk.Geometry.Geometry ->            -- geometry : TInterface (Name {namespace = "Gdk", name = "Geometry"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gdk", name = "SurfaceHints"})
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    Ptr Int32 ->                            -- new_width : TBasicType TInt
    Ptr Int32 ->                            -- new_height : TBasicType TInt
    IO ()

-- | Constrains a desired width and height according to a
-- set of geometry hints (such as minimum and maximum size).
surfaceConstrainSize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gdk.Geometry.Geometry
    -- ^ /@geometry@/: a t'GI.Gdk.Structs.Geometry.Geometry' structure
    -> [Gdk.Flags.SurfaceHints]
    -- ^ /@flags@/: a mask indicating what portions of /@geometry@/ are set
    -> Int32
    -- ^ /@width@/: desired width of surface
    -> Int32
    -- ^ /@height@/: desired height of the surface
    -> m ((Int32, Int32))
surfaceConstrainSize :: Geometry -> [SurfaceHints] -> Int32 -> Int32 -> m (Int32, Int32)
surfaceConstrainSize geometry :: Geometry
geometry flags :: [SurfaceHints]
flags width :: Int32
width height :: Int32
height = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Geometry
geometry' <- Geometry -> IO (Ptr Geometry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Geometry
geometry
    let flags' :: CUInt
flags' = [SurfaceHints] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SurfaceHints]
flags
    Ptr Int32
newWidth <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
newHeight <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Geometry
-> CUInt -> Int32 -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO ()
gdk_surface_constrain_size Ptr Geometry
geometry' CUInt
flags' Int32
width Int32
height Ptr Int32
newWidth Ptr Int32
newHeight
    Int32
newWidth' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
newWidth
    Int32
newHeight' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
newHeight
    Geometry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Geometry
geometry
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
newWidth
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
newHeight
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
newWidth', Int32
newHeight')

#if defined(ENABLE_OVERLOADING)
#endif