{-# 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.Gtk.Objects.ShortcutTrigger.ShortcutTrigger' that triggers when a specific keyval
-- and (optionally) modifiers are pressed.

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

module GI.Gtk.Objects.KeyvalTrigger
    ( 

-- * Exported types
    KeyvalTrigger(..)                       ,
    IsKeyvalTrigger                         ,
    toKeyvalTrigger                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [compare]("GI.Gtk.Objects.ShortcutTrigger#g:method:compare"), [equal]("GI.Gtk.Objects.ShortcutTrigger#g:method:equal"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hash]("GI.Gtk.Objects.ShortcutTrigger#g:method:hash"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [print]("GI.Gtk.Objects.ShortcutTrigger#g:method:print"), [printLabel]("GI.Gtk.Objects.ShortcutTrigger#g:method:printLabel"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [toLabel]("GI.Gtk.Objects.ShortcutTrigger#g:method:toLabel"), [toString]("GI.Gtk.Objects.ShortcutTrigger#g:method:toString"), [trigger]("GI.Gtk.Objects.ShortcutTrigger#g:method:trigger"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getKeyval]("GI.Gtk.Objects.KeyvalTrigger#g:method:getKeyval"), [getModifiers]("GI.Gtk.Objects.KeyvalTrigger#g:method:getModifiers"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveKeyvalTriggerMethod              ,
#endif

-- ** getKeyval #method:getKeyval#

#if defined(ENABLE_OVERLOADING)
    KeyvalTriggerGetKeyvalMethodInfo        ,
#endif
    keyvalTriggerGetKeyval                  ,


-- ** getModifiers #method:getModifiers#

#if defined(ENABLE_OVERLOADING)
    KeyvalTriggerGetModifiersMethodInfo     ,
#endif
    keyvalTriggerGetModifiers               ,


-- ** new #method:new#

    keyvalTriggerNew                        ,




 -- * Properties


-- ** keyval #attr:keyval#
-- | The key value for the trigger.

#if defined(ENABLE_OVERLOADING)
    KeyvalTriggerKeyvalPropertyInfo         ,
#endif
    constructKeyvalTriggerKeyval            ,
    getKeyvalTriggerKeyval                  ,
#if defined(ENABLE_OVERLOADING)
    keyvalTriggerKeyval                     ,
#endif


-- ** modifiers #attr:modifiers#
-- | The key modifiers for the trigger.

#if defined(ENABLE_OVERLOADING)
    KeyvalTriggerModifiersPropertyInfo      ,
#endif
    constructKeyvalTriggerModifiers         ,
    getKeyvalTriggerModifiers               ,
#if defined(ENABLE_OVERLOADING)
    keyvalTriggerModifiers                  ,
#endif




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Objects.ShortcutTrigger as Gtk.ShortcutTrigger

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

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

foreign import ccall "gtk_keyval_trigger_get_type"
    c_gtk_keyval_trigger_get_type :: IO B.Types.GType

instance B.Types.TypedObject KeyvalTrigger where
    glibType :: IO GType
glibType = IO GType
c_gtk_keyval_trigger_get_type

instance B.Types.GObject KeyvalTrigger

-- | Type class for types which can be safely cast to `KeyvalTrigger`, for instance with `toKeyvalTrigger`.
class (SP.GObject o, O.IsDescendantOf KeyvalTrigger o) => IsKeyvalTrigger o
instance (SP.GObject o, O.IsDescendantOf KeyvalTrigger o) => IsKeyvalTrigger o

instance O.HasParentTypes KeyvalTrigger
type instance O.ParentTypes KeyvalTrigger = '[Gtk.ShortcutTrigger.ShortcutTrigger, GObject.Object.Object]

-- | Cast to `KeyvalTrigger`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toKeyvalTrigger :: (MIO.MonadIO m, IsKeyvalTrigger o) => o -> m KeyvalTrigger
toKeyvalTrigger :: forall (m :: * -> *) o.
(MonadIO m, IsKeyvalTrigger o) =>
o -> m KeyvalTrigger
toKeyvalTrigger = IO KeyvalTrigger -> m KeyvalTrigger
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO KeyvalTrigger -> m KeyvalTrigger)
-> (o -> IO KeyvalTrigger) -> o -> m KeyvalTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr KeyvalTrigger -> KeyvalTrigger)
-> o -> IO KeyvalTrigger
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr KeyvalTrigger -> KeyvalTrigger
KeyvalTrigger

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

#if defined(ENABLE_OVERLOADING)
type family ResolveKeyvalTriggerMethod (t :: Symbol) (o :: *) :: * where
    ResolveKeyvalTriggerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveKeyvalTriggerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveKeyvalTriggerMethod "compare" o = Gtk.ShortcutTrigger.ShortcutTriggerCompareMethodInfo
    ResolveKeyvalTriggerMethod "equal" o = Gtk.ShortcutTrigger.ShortcutTriggerEqualMethodInfo
    ResolveKeyvalTriggerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveKeyvalTriggerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveKeyvalTriggerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveKeyvalTriggerMethod "hash" o = Gtk.ShortcutTrigger.ShortcutTriggerHashMethodInfo
    ResolveKeyvalTriggerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveKeyvalTriggerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveKeyvalTriggerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveKeyvalTriggerMethod "print" o = Gtk.ShortcutTrigger.ShortcutTriggerPrintMethodInfo
    ResolveKeyvalTriggerMethod "printLabel" o = Gtk.ShortcutTrigger.ShortcutTriggerPrintLabelMethodInfo
    ResolveKeyvalTriggerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveKeyvalTriggerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveKeyvalTriggerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveKeyvalTriggerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveKeyvalTriggerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveKeyvalTriggerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveKeyvalTriggerMethod "toLabel" o = Gtk.ShortcutTrigger.ShortcutTriggerToLabelMethodInfo
    ResolveKeyvalTriggerMethod "toString" o = Gtk.ShortcutTrigger.ShortcutTriggerToStringMethodInfo
    ResolveKeyvalTriggerMethod "trigger" o = Gtk.ShortcutTrigger.ShortcutTriggerTriggerMethodInfo
    ResolveKeyvalTriggerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveKeyvalTriggerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveKeyvalTriggerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveKeyvalTriggerMethod "getKeyval" o = KeyvalTriggerGetKeyvalMethodInfo
    ResolveKeyvalTriggerMethod "getModifiers" o = KeyvalTriggerGetModifiersMethodInfo
    ResolveKeyvalTriggerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveKeyvalTriggerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveKeyvalTriggerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveKeyvalTriggerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveKeyvalTriggerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveKeyvalTriggerMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveKeyvalTriggerMethod t KeyvalTrigger, O.OverloadedMethod info KeyvalTrigger p, R.HasField t KeyvalTrigger p) => R.HasField t KeyvalTrigger p where
    getField = O.overloadedMethod @info

#endif

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

#endif

-- VVV Prop "keyval"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

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

-- | Construct a `GValueConstruct` with valid value for the “@keyval@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructKeyvalTriggerKeyval :: (IsKeyvalTrigger o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructKeyvalTriggerKeyval :: forall o (m :: * -> *).
(IsKeyvalTrigger o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructKeyvalTriggerKeyval Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"keyval" Word32
val

#if defined(ENABLE_OVERLOADING)
data KeyvalTriggerKeyvalPropertyInfo
instance AttrInfo KeyvalTriggerKeyvalPropertyInfo where
    type AttrAllowedOps KeyvalTriggerKeyvalPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint KeyvalTriggerKeyvalPropertyInfo = IsKeyvalTrigger
    type AttrSetTypeConstraint KeyvalTriggerKeyvalPropertyInfo = (~) Word32
    type AttrTransferTypeConstraint KeyvalTriggerKeyvalPropertyInfo = (~) Word32
    type AttrTransferType KeyvalTriggerKeyvalPropertyInfo = Word32
    type AttrGetType KeyvalTriggerKeyvalPropertyInfo = Word32
    type AttrLabel KeyvalTriggerKeyvalPropertyInfo = "keyval"
    type AttrOrigin KeyvalTriggerKeyvalPropertyInfo = KeyvalTrigger
    attrGet = getKeyvalTriggerKeyval
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructKeyvalTriggerKeyval
    attrClear = undefined
#endif

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

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

-- | Construct a `GValueConstruct` with valid value for the “@modifiers@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructKeyvalTriggerModifiers :: (IsKeyvalTrigger o, MIO.MonadIO m) => [Gdk.Flags.ModifierType] -> m (GValueConstruct o)
constructKeyvalTriggerModifiers :: forall o (m :: * -> *).
(IsKeyvalTrigger o, MonadIO m) =>
[ModifierType] -> m (GValueConstruct o)
constructKeyvalTriggerModifiers [ModifierType]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [ModifierType] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"modifiers" [ModifierType]
val

#if defined(ENABLE_OVERLOADING)
data KeyvalTriggerModifiersPropertyInfo
instance AttrInfo KeyvalTriggerModifiersPropertyInfo where
    type AttrAllowedOps KeyvalTriggerModifiersPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint KeyvalTriggerModifiersPropertyInfo = IsKeyvalTrigger
    type AttrSetTypeConstraint KeyvalTriggerModifiersPropertyInfo = (~) [Gdk.Flags.ModifierType]
    type AttrTransferTypeConstraint KeyvalTriggerModifiersPropertyInfo = (~) [Gdk.Flags.ModifierType]
    type AttrTransferType KeyvalTriggerModifiersPropertyInfo = [Gdk.Flags.ModifierType]
    type AttrGetType KeyvalTriggerModifiersPropertyInfo = [Gdk.Flags.ModifierType]
    type AttrLabel KeyvalTriggerModifiersPropertyInfo = "modifiers"
    type AttrOrigin KeyvalTriggerModifiersPropertyInfo = KeyvalTrigger
    attrGet = getKeyvalTriggerModifiers
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructKeyvalTriggerModifiers
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList KeyvalTrigger
type instance O.AttributeList KeyvalTrigger = KeyvalTriggerAttributeList
type KeyvalTriggerAttributeList = ('[ '("keyval", KeyvalTriggerKeyvalPropertyInfo), '("modifiers", KeyvalTriggerModifiersPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
keyvalTriggerKeyval :: AttrLabelProxy "keyval"
keyvalTriggerKeyval = AttrLabelProxy

keyvalTriggerModifiers :: AttrLabelProxy "modifiers"
keyvalTriggerModifiers = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList KeyvalTrigger = KeyvalTriggerSignalList
type KeyvalTriggerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method KeyvalTrigger::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "keyval"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The keyval to trigger for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifiers"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the modifiers that need to be present"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "KeyvalTrigger" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_keyval_trigger_new" gtk_keyval_trigger_new :: 
    Word32 ->                               -- keyval : TBasicType TUInt
    CUInt ->                                -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO (Ptr KeyvalTrigger)

-- | Creates a t'GI.Gtk.Objects.ShortcutTrigger.ShortcutTrigger' that will trigger whenever
-- the key with the given /@keyval@/ and /@modifiers@/ is pressed.
keyvalTriggerNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@keyval@/: The keyval to trigger for
    -> [Gdk.Flags.ModifierType]
    -- ^ /@modifiers@/: the modifiers that need to be present
    -> m KeyvalTrigger
    -- ^ __Returns:__ A new t'GI.Gtk.Objects.ShortcutTrigger.ShortcutTrigger'
keyvalTriggerNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> [ModifierType] -> m KeyvalTrigger
keyvalTriggerNew Word32
keyval [ModifierType]
modifiers = IO KeyvalTrigger -> m KeyvalTrigger
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyvalTrigger -> m KeyvalTrigger)
-> IO KeyvalTrigger -> m KeyvalTrigger
forall a b. (a -> b) -> a -> b
$ do
    let modifiers' :: CUInt
modifiers' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
modifiers
    Ptr KeyvalTrigger
result <- Word32 -> CUInt -> IO (Ptr KeyvalTrigger)
gtk_keyval_trigger_new Word32
keyval CUInt
modifiers'
    Text -> Ptr KeyvalTrigger -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"keyvalTriggerNew" Ptr KeyvalTrigger
result
    KeyvalTrigger
result' <- ((ManagedPtr KeyvalTrigger -> KeyvalTrigger)
-> Ptr KeyvalTrigger -> IO KeyvalTrigger
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr KeyvalTrigger -> KeyvalTrigger
KeyvalTrigger) Ptr KeyvalTrigger
result
    KeyvalTrigger -> IO KeyvalTrigger
forall (m :: * -> *) a. Monad m => a -> m a
return KeyvalTrigger
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method KeyvalTrigger::get_keyval
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "KeyvalTrigger" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a keyval #GtkShortcutTrigger"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_keyval_trigger_get_keyval" gtk_keyval_trigger_get_keyval :: 
    Ptr KeyvalTrigger ->                    -- self : TInterface (Name {namespace = "Gtk", name = "KeyvalTrigger"})
    IO Word32

-- | Gets the keyval that must be pressed to succeed
-- triggering /@self@/.
keyvalTriggerGetKeyval ::
    (B.CallStack.HasCallStack, MonadIO m, IsKeyvalTrigger a) =>
    a
    -- ^ /@self@/: a keyval t'GI.Gtk.Objects.ShortcutTrigger.ShortcutTrigger'
    -> m Word32
    -- ^ __Returns:__ the keyval
keyvalTriggerGetKeyval :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeyvalTrigger a) =>
a -> m Word32
keyvalTriggerGetKeyval a
self = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr KeyvalTrigger
self' <- a -> IO (Ptr KeyvalTrigger)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Word32
result <- Ptr KeyvalTrigger -> IO Word32
gtk_keyval_trigger_get_keyval Ptr KeyvalTrigger
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data KeyvalTriggerGetKeyvalMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsKeyvalTrigger a) => O.OverloadedMethod KeyvalTriggerGetKeyvalMethodInfo a signature where
    overloadedMethod = keyvalTriggerGetKeyval

instance O.OverloadedMethodInfo KeyvalTriggerGetKeyvalMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.KeyvalTrigger.keyvalTriggerGetKeyval",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-KeyvalTrigger.html#v:keyvalTriggerGetKeyval"
        }


#endif

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

foreign import ccall "gtk_keyval_trigger_get_modifiers" gtk_keyval_trigger_get_modifiers :: 
    Ptr KeyvalTrigger ->                    -- self : TInterface (Name {namespace = "Gtk", name = "KeyvalTrigger"})
    IO CUInt

-- | Gets the modifiers that must be present to succeed
-- triggering /@self@/.
keyvalTriggerGetModifiers ::
    (B.CallStack.HasCallStack, MonadIO m, IsKeyvalTrigger a) =>
    a
    -- ^ /@self@/: a keyval t'GI.Gtk.Objects.ShortcutTrigger.ShortcutTrigger'
    -> m [Gdk.Flags.ModifierType]
    -- ^ __Returns:__ the modifiers
keyvalTriggerGetModifiers :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeyvalTrigger a) =>
a -> m [ModifierType]
keyvalTriggerGetModifiers a
self = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
    Ptr KeyvalTrigger
self' <- a -> IO (Ptr KeyvalTrigger)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CUInt
result <- Ptr KeyvalTrigger -> IO CUInt
gtk_keyval_trigger_get_modifiers Ptr KeyvalTrigger
self'
    let result' :: [ModifierType]
result' = CUInt -> [ModifierType]
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
self
    [ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
result'

#if defined(ENABLE_OVERLOADING)
data KeyvalTriggerGetModifiersMethodInfo
instance (signature ~ (m [Gdk.Flags.ModifierType]), MonadIO m, IsKeyvalTrigger a) => O.OverloadedMethod KeyvalTriggerGetModifiersMethodInfo a signature where
    overloadedMethod = keyvalTriggerGetModifiers

instance O.OverloadedMethodInfo KeyvalTriggerGetModifiersMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.KeyvalTrigger.keyvalTriggerGetModifiers",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-KeyvalTrigger.html#v:keyvalTriggerGetModifiers"
        }


#endif