{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gtk.Objects.EventBox
    ( 

-- * Exported types
    EventBox(..)                            ,
    EventBoxK                               ,
    toEventBox                              ,
    noEventBox                              ,


 -- * Methods
-- ** eventBoxGetAboveChild
    eventBoxGetAboveChild                   ,


-- ** eventBoxGetVisibleWindow
    eventBoxGetVisibleWindow                ,


-- ** eventBoxNew
    eventBoxNew                             ,


-- ** eventBoxSetAboveChild
    eventBoxSetAboveChild                   ,


-- ** eventBoxSetVisibleWindow
    eventBoxSetVisibleWindow                ,




 -- * Properties
-- ** AboveChild
    EventBoxAboveChildPropertyInfo          ,
    constructEventBoxAboveChild             ,
    getEventBoxAboveChild                   ,
    setEventBoxAboveChild                   ,


-- ** VisibleWindow
    EventBoxVisibleWindowPropertyInfo       ,
    constructEventBoxVisibleWindow          ,
    getEventBoxVisibleWindow                ,
    setEventBoxVisibleWindow                ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.Atk as Atk
import qualified GI.GObject as GObject

newtype EventBox = EventBox (ForeignPtr EventBox)
foreign import ccall "gtk_event_box_get_type"
    c_gtk_event_box_get_type :: IO GType

type instance ParentTypes EventBox = EventBoxParentTypes
type EventBoxParentTypes = '[Bin, Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable]

instance GObject EventBox where
    gobjectIsInitiallyUnowned _ = True
    gobjectType _ = c_gtk_event_box_get_type
    

class GObject o => EventBoxK o
instance (GObject o, IsDescendantOf EventBox o) => EventBoxK o

toEventBox :: EventBoxK o => o -> IO EventBox
toEventBox = unsafeCastTo EventBox

noEventBox :: Maybe EventBox
noEventBox = Nothing

-- VVV Prop "above-child"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]

getEventBoxAboveChild :: (MonadIO m, EventBoxK o) => o -> m Bool
getEventBoxAboveChild obj = liftIO $ getObjectPropertyBool obj "above-child"

setEventBoxAboveChild :: (MonadIO m, EventBoxK o) => o -> Bool -> m ()
setEventBoxAboveChild obj val = liftIO $ setObjectPropertyBool obj "above-child" val

constructEventBoxAboveChild :: Bool -> IO ([Char], GValue)
constructEventBoxAboveChild val = constructObjectPropertyBool "above-child" val

data EventBoxAboveChildPropertyInfo
instance AttrInfo EventBoxAboveChildPropertyInfo where
    type AttrAllowedOps EventBoxAboveChildPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EventBoxAboveChildPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EventBoxAboveChildPropertyInfo = EventBoxK
    type AttrGetType EventBoxAboveChildPropertyInfo = Bool
    type AttrLabel EventBoxAboveChildPropertyInfo = "EventBox::above-child"
    attrGet _ = getEventBoxAboveChild
    attrSet _ = setEventBoxAboveChild
    attrConstruct _ = constructEventBoxAboveChild

-- VVV Prop "visible-window"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]

getEventBoxVisibleWindow :: (MonadIO m, EventBoxK o) => o -> m Bool
getEventBoxVisibleWindow obj = liftIO $ getObjectPropertyBool obj "visible-window"

setEventBoxVisibleWindow :: (MonadIO m, EventBoxK o) => o -> Bool -> m ()
setEventBoxVisibleWindow obj val = liftIO $ setObjectPropertyBool obj "visible-window" val

constructEventBoxVisibleWindow :: Bool -> IO ([Char], GValue)
constructEventBoxVisibleWindow val = constructObjectPropertyBool "visible-window" val

data EventBoxVisibleWindowPropertyInfo
instance AttrInfo EventBoxVisibleWindowPropertyInfo where
    type AttrAllowedOps EventBoxVisibleWindowPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EventBoxVisibleWindowPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EventBoxVisibleWindowPropertyInfo = EventBoxK
    type AttrGetType EventBoxVisibleWindowPropertyInfo = Bool
    type AttrLabel EventBoxVisibleWindowPropertyInfo = "EventBox::visible-window"
    attrGet _ = getEventBoxVisibleWindow
    attrSet _ = setEventBoxVisibleWindow
    attrConstruct _ = constructEventBoxVisibleWindow

type instance AttributeList EventBox = EventBoxAttributeList
type EventBoxAttributeList = ('[ '("above-child", EventBoxAboveChildPropertyInfo), '("app-paintable", WidgetAppPaintablePropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("visible-window", EventBoxVisibleWindowPropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])

type instance SignalList EventBox = EventBoxSignalList
type EventBoxSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("add", ContainerAddSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("check-resize", ContainerCheckResizeSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("remove", ContainerRemoveSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("set-focus-child", ContainerSetFocusChildSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method EventBox::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- hInArgs : []
-- returnType : TInterface "Gtk" "EventBox"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_box_new" gtk_event_box_new :: 
    IO (Ptr EventBox)


eventBoxNew ::
    (MonadIO m) =>
    m EventBox
eventBoxNew  = liftIO $ do
    result <- gtk_event_box_new
    checkUnexpectedReturnNULL "gtk_event_box_new" result
    result' <- (newObject EventBox) result
    return result'

-- method EventBox::get_above_child
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_box_get_above_child" gtk_event_box_get_above_child :: 
    Ptr EventBox ->                         -- _obj : TInterface "Gtk" "EventBox"
    IO CInt


eventBoxGetAboveChild ::
    (MonadIO m, EventBoxK a) =>
    a ->                                    -- _obj
    m Bool
eventBoxGetAboveChild _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_event_box_get_above_child _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method EventBox::get_visible_window
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_box_get_visible_window" gtk_event_box_get_visible_window :: 
    Ptr EventBox ->                         -- _obj : TInterface "Gtk" "EventBox"
    IO CInt


eventBoxGetVisibleWindow ::
    (MonadIO m, EventBoxK a) =>
    a ->                                    -- _obj
    m Bool
eventBoxGetVisibleWindow _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_event_box_get_visible_window _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method EventBox::set_above_child
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "above_child", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "above_child", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_box_set_above_child" gtk_event_box_set_above_child :: 
    Ptr EventBox ->                         -- _obj : TInterface "Gtk" "EventBox"
    CInt ->                                 -- above_child : TBasicType TBoolean
    IO ()


eventBoxSetAboveChild ::
    (MonadIO m, EventBoxK a) =>
    a ->                                    -- _obj
    Bool ->                                 -- above_child
    m ()
eventBoxSetAboveChild _obj above_child = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let above_child' = (fromIntegral . fromEnum) above_child
    gtk_event_box_set_above_child _obj' above_child'
    touchManagedPtr _obj
    return ()

-- method EventBox::set_visible_window
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "visible_window", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "EventBox", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "visible_window", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_box_set_visible_window" gtk_event_box_set_visible_window :: 
    Ptr EventBox ->                         -- _obj : TInterface "Gtk" "EventBox"
    CInt ->                                 -- visible_window : TBasicType TBoolean
    IO ()


eventBoxSetVisibleWindow ::
    (MonadIO m, EventBoxK a) =>
    a ->                                    -- _obj
    Bool ->                                 -- visible_window
    m ()
eventBoxSetVisibleWindow _obj visible_window = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let visible_window' = (fromIntegral . fromEnum) visible_window
    gtk_event_box_set_visible_window _obj' visible_window'
    touchManagedPtr _obj
    return ()