    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Evaluates a boolean expression to determine whether to include items.

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Gtk.Objects.BoolFilter
        (

    -- * Exported types
        BoolFilter(..)                          ,
        IsBoolFilter                            ,
        toBoolFilter                            ,

     -- * 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"), [changed]("GI.Gtk.Objects.Filter#g:method:changed"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [match]("GI.Gtk.Objects.Filter#g:method:match"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [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"), [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"), [getExpression]("GI.Gtk.Objects.BoolFilter#g:method:getExpression"), [getInvert]("GI.Gtk.Objects.BoolFilter#g:method:getInvert"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getStrictness]("GI.Gtk.Objects.Filter#g:method:getStrictness").
    --
    -- ==== Setters
    -- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setExpression]("GI.Gtk.Objects.BoolFilter#g:method:setExpression"), [setInvert]("GI.Gtk.Objects.BoolFilter#g:method:setInvert"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

    #if defined(ENABLE_OVERLOADING)
        ResolveBoolFilterMethod                 ,
    #endif

    -- ** getExpression #method:getExpression#

    #if defined(ENABLE_OVERLOADING)
        BoolFilterGetExpressionMethodInfo       ,
    #endif
        boolFilterGetExpression                 ,

    -- ** getInvert #method:getInvert#

    #if defined(ENABLE_OVERLOADING)
        BoolFilterGetInvertMethodInfo           ,
    #endif
        boolFilterGetInvert                     ,

    -- ** new #method:new#

        boolFilterNew                           ,

    -- ** setExpression #method:setExpression#

    #if defined(ENABLE_OVERLOADING)
        BoolFilterSetExpressionMethodInfo       ,
    #endif
        boolFilterSetExpression                 ,

    -- ** setInvert #method:setInvert#

    #if defined(ENABLE_OVERLOADING)
        BoolFilterSetInvertMethodInfo           ,
    #endif
        boolFilterSetInvert                     ,

     -- * Properties

    -- ** expression #attr:expression#
    -- | The boolean expression to evaluate on each item.

    #if defined(ENABLE_OVERLOADING)
        BoolFilterExpressionPropertyInfo        ,
    #endif
    #if defined(ENABLE_OVERLOADING)
        boolFilterExpression                    ,
    #endif
        clearBoolFilterExpression               ,
        constructBoolFilterExpression           ,
        getBoolFilterExpression                 ,
        setBoolFilterExpression                 ,

    -- ** invert #attr:invert#
    -- | If the expression result should be inverted.

    #if defined(ENABLE_OVERLOADING)
        BoolFilterInvertPropertyInfo            ,
    #endif
    #if defined(ENABLE_OVERLOADING)
        boolFilterInvert                        ,
    #endif
        constructBoolFilterInvert               ,
        getBoolFilterInvert                     ,
        setBoolFilterInvert                     ,

        ) where

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

    import qualified Data.GI.Base.Attributes as GI.Attributes
    import qualified Data.GI.Base.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    import qualified Data.GI.Base.GClosure as B.GClosure
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GHashTable as B.GHT
    import qualified Data.GI.Base.GVariant as B.GVariant
    import qualified Data.GI.Base.GValue as B.GValue
    import qualified Data.GI.Base.GParamSpec as B.GParamSpec
    import qualified Data.GI.Base.CallStack as B.CallStack
    import qualified Data.GI.Base.Properties as B.Properties
    import qualified Data.GI.Base.Signals as B.Signals
    import qualified Control.Monad.IO.Class as MIO
    import qualified Data.Coerce as Coerce
    import qualified Data.Text as T
    import qualified Data.Kind as DK
    import qualified Data.ByteString.Char8 as B
    import qualified Data.Map as Map
    import qualified Foreign.Ptr as FP
    import qualified GHC.OverloadedLabels as OL
    import qualified GHC.Records as R
    import qualified Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)
    import qualified GI.GLib.Callbacks as GLib.Callbacks
    import qualified GI.GObject.Objects.Object as GObject.Object
    import qualified GI.Gtk.Callbacks as Gtk.Callbacks
    import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Expression as Gtk.Expression
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Filter as Gtk.Filter
    import {-# SOURCE #-} qualified GI.Gtk.Structs.ExpressionWatch as Gtk.ExpressionWatch

    #else
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Expression as Gtk.Expression
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Filter as Gtk.Filter

    #endif

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

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

    foreign import ccall "gtk_bool_filter_get_type"
        c_gtk_bool_filter_get_type :: IO B.Types.GType

    instance B.Types.TypedObject BoolFilter where
        glibType :: IO GType
    glibType = IO GType
    c_gtk_bool_filter_get_type

    instance B.Types.GObject BoolFilter

    -- | Type class for types which can be safely cast to t'BoolFilter', for instance with `toBoolFilter`.
    class (SP.GObject o, O.IsDescendantOf BoolFilter o) => IsBoolFilter o
    instance (SP.GObject o, O.IsDescendantOf BoolFilter o) => IsBoolFilter o

    instance O.HasParentTypes BoolFilter
    type instance O.ParentTypes BoolFilter = '[Gtk.Filter.Filter, GObject.Object.Object]

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

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

    #if defined(ENABLE_OVERLOADING)
    type family ResolveBoolFilterMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveBoolFilterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveBoolFilterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveBoolFilterMethod "changed" o = Gtk.Filter.FilterChangedMethodInfo
        ResolveBoolFilterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveBoolFilterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveBoolFilterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveBoolFilterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveBoolFilterMethod "match" o = Gtk.Filter.FilterMatchMethodInfo
        ResolveBoolFilterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveBoolFilterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveBoolFilterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveBoolFilterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveBoolFilterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveBoolFilterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveBoolFilterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveBoolFilterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveBoolFilterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveBoolFilterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveBoolFilterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveBoolFilterMethod "getExpression" o = BoolFilterGetExpressionMethodInfo
        ResolveBoolFilterMethod "getInvert" o = BoolFilterGetInvertMethodInfo
        ResolveBoolFilterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveBoolFilterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveBoolFilterMethod "getStrictness" o = Gtk.Filter.FilterGetStrictnessMethodInfo
        ResolveBoolFilterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveBoolFilterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
        ResolveBoolFilterMethod "setExpression" o = BoolFilterSetExpressionMethodInfo
        ResolveBoolFilterMethod "setInvert" o = BoolFilterSetInvertMethodInfo
        ResolveBoolFilterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveBoolFilterMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveBoolFilterMethod t BoolFilter, O.OverloadedMethod info BoolFilter p) => OL.IsLabel t (BoolFilter -> 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 ~ ResolveBoolFilterMethod t BoolFilter, O.OverloadedMethod info BoolFilter p, R.HasField t BoolFilter p) => R.HasField t BoolFilter p where
        getField = O.overloadedMethod @info

    #endif

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

    #endif

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

    -- | Get the value of the “@expression@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' boolFilter #expression
    -- @
    getBoolFilterExpression :: (MonadIO m, IsBoolFilter o) => o -> m (Maybe Gtk.Expression.Expression)
    getBoolFilterExpression :: forall (m :: * -> *) o.
    (MonadIO m, IsBoolFilter o) =>
    o -> m (Maybe Expression)
    getBoolFilterExpression o
    obj = IO (Maybe Expression) -> m (Maybe Expression)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (Maybe Expression) -> m (Maybe Expression))
    -> IO (Maybe Expression) -> m (Maybe Expression)
    forall a b. (a -> b) -> a -> b
    $ o -> String -> IO (Maybe Expression)
    forall a b. (GObject a, IsGValue b) => a -> String -> IO b
    B.Properties.getObjectPropertyIsGValueInstance o
    obj String
    "expression"

    -- | Set the value of the “@expression@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' boolFilter [ #expression 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setBoolFilterExpression :: (MonadIO m, IsBoolFilter o, Gtk.Expression.IsExpression a) => o -> a -> m ()
    setBoolFilterExpression :: forall (m :: * -> *) o a.
    (MonadIO m, IsBoolFilter o, IsExpression a) =>
    o -> a -> m ()
    setBoolFilterExpression o
    obj a
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        val' <- a -> IO Expression
    forall (m :: * -> *) o.
    (MonadIO m, IsExpression o) =>
    o -> m Expression
    Gtk.Expression.toExpression a
    val
        B.Properties.setObjectPropertyIsGValueInstance obj "expression" (Just val')

    -- | Construct a t'GValueConstruct' with valid value for the “@expression@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
    constructBoolFilterExpression :: (IsBoolFilter o, MIO.MonadIO m, Gtk.Expression.IsExpression a) => a -> m (GValueConstruct o)
    constructBoolFilterExpression :: forall o (m :: * -> *) a.
    (IsBoolFilter o, MonadIO m, IsExpression a) =>
    a -> m (GValueConstruct o)
    constructBoolFilterExpression a
    val = IO (GValueConstruct o) -> m (GValueConstruct o)
    forall a. IO a -> m a
    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
        val' <- a -> IO Expression
    forall (m :: * -> *) o.
    (MonadIO m, IsExpression o) =>
    o -> m Expression
    Gtk.Expression.toExpression a
    val
        MIO.liftIO $ B.Properties.constructObjectPropertyIsGValueInstance "expression" (P.Just val')

    -- | Set the value of the “@expression@” 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' #expression
    -- @
    clearBoolFilterExpression :: (MonadIO m, IsBoolFilter o) => o -> m ()
    clearBoolFilterExpression :: forall (m :: * -> *) o. (MonadIO m, IsBoolFilter o) => o -> m ()
    clearBoolFilterExpression o
    obj = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ o -> String -> Maybe Expression -> IO ()
    forall a b. (GObject a, IsGValue b) => a -> String -> b -> IO ()
    B.Properties.setObjectPropertyIsGValueInstance o
    obj String
    "expression" (Maybe Expression
    forall a. Maybe a
    Nothing :: Maybe Gtk.Expression.Expression)

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterExpressionPropertyInfo
    instance AttrInfo BoolFilterExpressionPropertyInfo where
        type AttrAllowedOps BoolFilterExpressionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
        type AttrBaseTypeConstraint BoolFilterExpressionPropertyInfo = IsBoolFilter
        type AttrSetTypeConstraint BoolFilterExpressionPropertyInfo = (~) Gtk.Expression.Expression
        type AttrTransferTypeConstraint BoolFilterExpressionPropertyInfo = (~) Gtk.Expression.Expression
        type AttrTransferType BoolFilterExpressionPropertyInfo = Gtk.Expression.Expression
        type AttrGetType BoolFilterExpressionPropertyInfo = (Maybe Gtk.Expression.Expression)
        type AttrLabel BoolFilterExpressionPropertyInfo = "expression"
        type AttrOrigin BoolFilterExpressionPropertyInfo = BoolFilter
        attrGet = getBoolFilterExpression
        attrSet = setBoolFilterExpression
        attrPut = undefined
        attrTransfer _ v = do
            return v
        attrConstruct = constructBoolFilterExpression
        attrClear = clearBoolFilterExpression
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.expression"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#g:attr:expression"
            })
    #endif

    -- VVV Prop "invert"
       -- Type: TBasicType TBoolean
       -- Flags: [PropertyReadable,PropertyWritable]
       -- Nullable: (Just False,Just False)

    -- | Get the value of the “@invert@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' boolFilter #invert
    -- @
    getBoolFilterInvert :: (MonadIO m, IsBoolFilter o) => o -> m Bool
    getBoolFilterInvert :: forall (m :: * -> *) o. (MonadIO m, IsBoolFilter o) => o -> m Bool
    getBoolFilterInvert o
    obj = IO Bool -> m Bool
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.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 String
    "invert"

    -- | Set the value of the “@invert@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' boolFilter [ #invert 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setBoolFilterInvert :: (MonadIO m, IsBoolFilter o) => o -> Bool -> m ()
    setBoolFilterInvert :: forall (m :: * -> *) o.
    (MonadIO m, IsBoolFilter o) =>
    o -> Bool -> m ()
    setBoolFilterInvert o
    obj Bool
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        o -> String -> Bool -> IO ()
    forall a. GObject a => a -> String -> Bool -> IO ()
    B.Properties.setObjectPropertyBool o
    obj String
    "invert" Bool
    val

    -- | Construct a t'GValueConstruct' with valid value for the “@invert@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
    constructBoolFilterInvert :: (IsBoolFilter o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
    constructBoolFilterInvert :: forall o (m :: * -> *).
    (IsBoolFilter o, MonadIO m) =>
    Bool -> m (GValueConstruct o)
    constructBoolFilterInvert Bool
    val = IO (GValueConstruct o) -> m (GValueConstruct o)
    forall a. IO a -> m a
    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 a. IO a -> IO a
    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 -> Bool -> IO (GValueConstruct o)
    forall o. String -> Bool -> IO (GValueConstruct o)
    B.Properties.constructObjectPropertyBool String
    "invert" Bool
    val

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterInvertPropertyInfo
    instance AttrInfo BoolFilterInvertPropertyInfo where
        type AttrAllowedOps BoolFilterInvertPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrPut]
        type AttrBaseTypeConstraint BoolFilterInvertPropertyInfo = IsBoolFilter
        type AttrSetTypeConstraint BoolFilterInvertPropertyInfo = (~) Bool
        type AttrTransferTypeConstraint BoolFilterInvertPropertyInfo = (~) Bool
        type AttrTransferType BoolFilterInvertPropertyInfo = Bool
        type AttrGetType BoolFilterInvertPropertyInfo = Bool
        type AttrLabel BoolFilterInvertPropertyInfo = "invert"
        type AttrOrigin BoolFilterInvertPropertyInfo = BoolFilter
        attrGet = getBoolFilterInvert
        attrSet = setBoolFilterInvert
        attrPut = setBoolFilterInvert
        attrTransfer _ v = do
            return v
        attrConstruct = constructBoolFilterInvert
        attrClear = undefined
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.invert"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#g:attr:invert"
            })
    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList BoolFilter
    type instance O.AttributeList BoolFilter = BoolFilterAttributeList
    type BoolFilterAttributeList = ('[ '("expression", BoolFilterExpressionPropertyInfo), '("invert", BoolFilterInvertPropertyInfo)] :: [(Symbol, DK.Type)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    boolFilterExpression :: AttrLabelProxy "expression"
    boolFilterExpression = AttrLabelProxy

    boolFilterInvert :: AttrLabelProxy "invert"
    boolFilterInvert = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    type instance O.SignalList BoolFilter = BoolFilterSignalList
    type BoolFilterSignalList = ('[ '("changed", Gtk.Filter.FilterChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

    #endif

    -- method BoolFilter::new
    -- method type : Constructor
    -- Args: [ Arg
    --           { argCName = "expression"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "Expression" }
    --           , argCType = Just "GtkExpression*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the expression to evaluate"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferEverything
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "BoolFilter" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_bool_filter_new" gtk_bool_filter_new ::
        Ptr Gtk.Expression.Expression ->        -- expression : TInterface (Name {namespace = "Gtk", name = "Expression"})
        IO (Ptr BoolFilter)

    -- | Creates a new bool filter.
    boolFilterNew ::
        (B.CallStack.HasCallStack, MonadIO m, Gtk.Expression.IsExpression a) =>
        Maybe (a)
        -- ^ /@expression@/: the expression to evaluate
        -> m BoolFilter
        -- ^ __Returns:__ a new @GtkBoolFilter@
    boolFilterNew :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsExpression a) =>
    Maybe a -> m BoolFilter
    boolFilterNew Maybe a
    expression = IO BoolFilter -> m BoolFilter
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO BoolFilter -> m BoolFilter) -> IO BoolFilter -> m BoolFilter
    forall a b. (a -> b) -> a -> b
    $ do
        maybeExpression <- case Maybe a
    expression of
            Maybe a
    Nothing -> Ptr Expression -> IO (Ptr Expression)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr Expression
    forall a. Ptr a
    FP.nullPtr
            Just a
    jExpression -> do
                jExpression' <- a -> IO (Ptr Expression)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    B.ManagedPtr.disownManagedPtr a
    jExpression
                return jExpression'
        result <- gtk_bool_filter_new maybeExpression
        checkUnexpectedReturnNULL "boolFilterNew" result
        result' <- (wrapObject BoolFilter) result
        whenJust expression touchManagedPtr
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method BoolFilter::get_expression
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "BoolFilter" }
    --           , argCType = Just "GtkBoolFilter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a bool filter" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Expression" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_bool_filter_get_expression" gtk_bool_filter_get_expression ::
        Ptr BoolFilter ->                       -- self : TInterface (Name {namespace = "Gtk", name = "BoolFilter"})
        IO (Ptr Gtk.Expression.Expression)

    -- | Gets the expression that the filter evaluates for
    -- each item.
    boolFilterGetExpression ::
        (B.CallStack.HasCallStack, MonadIO m, IsBoolFilter a) =>
        a
        -- ^ /@self@/: a bool filter
        -> m (Maybe Gtk.Expression.Expression)
        -- ^ __Returns:__ the expression
    boolFilterGetExpression :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsBoolFilter a) =>
    a -> m (Maybe Expression)
    boolFilterGetExpression a
    self = IO (Maybe Expression) -> m (Maybe Expression)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe Expression) -> m (Maybe Expression))
    -> IO (Maybe Expression) -> m (Maybe Expression)
    forall a b. (a -> b) -> a -> b
    $ do
        self' <- a -> IO (Ptr BoolFilter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        result <- gtk_bool_filter_get_expression self'
        maybeResult <- convertIfNonNull result $ \Ptr Expression
    result' -> do
            result'' <- ((ManagedPtr Expression -> Expression)
    -> Ptr Expression -> IO Expression
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    newPtr ManagedPtr Expression -> Expression
    Gtk.Expression.Expression) Ptr Expression
    result'
            return result''
        touchManagedPtr self
        return maybeResult

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterGetExpressionMethodInfo
    instance (signature ~ (m (Maybe Gtk.Expression.Expression)), MonadIO m, IsBoolFilter a) => O.OverloadedMethod BoolFilterGetExpressionMethodInfo a signature where
        overloadedMethod = boolFilterGetExpression

    instance O.OverloadedMethodInfo BoolFilterGetExpressionMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.boolFilterGetExpression",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#v:boolFilterGetExpression"
            })

    #endif

    -- method BoolFilter::get_invert
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "BoolFilter" }
    --           , argCType = Just "GtkBoolFilter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a bool filter" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_bool_filter_get_invert" gtk_bool_filter_get_invert ::
        Ptr BoolFilter ->                       -- self : TInterface (Name {namespace = "Gtk", name = "BoolFilter"})
        IO CInt

    -- | Returns whether the filter inverts the expression.
    boolFilterGetInvert ::
        (B.CallStack.HasCallStack, MonadIO m, IsBoolFilter a) =>
        a
        -- ^ /@self@/: a bool filter
        -> m Bool
        -- ^ __Returns:__ true if the filter inverts
    boolFilterGetInvert :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsBoolFilter a) =>
    a -> m Bool
    boolFilterGetInvert a
    self = IO Bool -> m Bool
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
    forall a b. (a -> b) -> a -> b
    $ do
        self' <- a -> IO (Ptr BoolFilter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        result <- gtk_bool_filter_get_invert self'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        touchManagedPtr self
        return result'

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterGetInvertMethodInfo
    instance (signature ~ (m Bool), MonadIO m, IsBoolFilter a) => O.OverloadedMethod BoolFilterGetInvertMethodInfo a signature where
        overloadedMethod = boolFilterGetInvert

    instance O.OverloadedMethodInfo BoolFilterGetInvertMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.boolFilterGetInvert",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#v:boolFilterGetInvert"
            })

    #endif

    -- method BoolFilter::set_expression
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "BoolFilter" }
    --           , argCType = Just "GtkBoolFilter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a bool filter" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "expression"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "Expression" }
    --           , argCType = Just "GtkExpression*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the expression" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_bool_filter_set_expression" gtk_bool_filter_set_expression ::
        Ptr BoolFilter ->                       -- self : TInterface (Name {namespace = "Gtk", name = "BoolFilter"})
        Ptr Gtk.Expression.Expression ->        -- expression : TInterface (Name {namespace = "Gtk", name = "Expression"})
        IO ()

    -- | Sets the expression that the filter uses to check if items
    -- should be filtered.
    --
    -- The expression must have a value type of @G_TYPE_BOOLEAN@.
    boolFilterSetExpression ::
        (B.CallStack.HasCallStack, MonadIO m, IsBoolFilter a, Gtk.Expression.IsExpression b) =>
        a
        -- ^ /@self@/: a bool filter
        -> Maybe (b)
        -- ^ /@expression@/: the expression
        -> m ()
    boolFilterSetExpression :: forall (m :: * -> *) a b.
    (HasCallStack, MonadIO m, IsBoolFilter a, IsExpression b) =>
    a -> Maybe b -> m ()
    boolFilterSetExpression a
    self Maybe b
    expression = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        self' <- a -> IO (Ptr BoolFilter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        maybeExpression <- case expression of
            Maybe b
    Nothing -> Ptr Expression -> IO (Ptr Expression)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr Expression
    forall a. Ptr a
    FP.nullPtr
            Just b
    jExpression -> do
                jExpression' <- b -> IO (Ptr Expression)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr b
    jExpression
                return jExpression'
        gtk_bool_filter_set_expression self' maybeExpression
        touchManagedPtr self
        whenJust expression touchManagedPtr
        return ()

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterSetExpressionMethodInfo
    instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsBoolFilter a, Gtk.Expression.IsExpression b) => O.OverloadedMethod BoolFilterSetExpressionMethodInfo a signature where
        overloadedMethod = boolFilterSetExpression

    instance O.OverloadedMethodInfo BoolFilterSetExpressionMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.boolFilterSetExpression",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#v:boolFilterSetExpression"
            })

    #endif

    -- method BoolFilter::set_invert
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "BoolFilter" }
    --           , argCType = Just "GtkBoolFilter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a bool filter" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "invert"
    --           , argType = TBasicType TBoolean
    --           , argCType = Just "gboolean"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "true to invert" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_bool_filter_set_invert" gtk_bool_filter_set_invert ::
        Ptr BoolFilter ->                       -- self : TInterface (Name {namespace = "Gtk", name = "BoolFilter"})
        CInt ->                                 -- invert : TBasicType TBoolean
        IO ()

    -- | Sets whether the filter should invert the expression.
    boolFilterSetInvert ::
        (B.CallStack.HasCallStack, MonadIO m, IsBoolFilter a) =>
        a
        -- ^ /@self@/: a bool filter
        -> Bool
        -- ^ /@invert@/: true to invert
        -> m ()
    boolFilterSetInvert :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsBoolFilter a) =>
    a -> Bool -> m ()
    boolFilterSetInvert a
    self Bool
    invert = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        self' <- a -> IO (Ptr BoolFilter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        let invert' = (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Bool -> Int
    forall a. Enum a => a -> Int
    P.fromEnum) Bool
    invert
        gtk_bool_filter_set_invert self' invert'
        touchManagedPtr self
        return ()

    #if defined(ENABLE_OVERLOADING)
    data BoolFilterSetInvertMethodInfo
    instance (signature ~ (Bool -> m ()), MonadIO m, IsBoolFilter a) => O.OverloadedMethod BoolFilterSetInvertMethodInfo a signature where
        overloadedMethod = boolFilterSetInvert

    instance O.OverloadedMethodInfo BoolFilterSetInvertMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.BoolFilter.boolFilterSetInvert",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-BoolFilter.html#v:boolFilterSetInvert"
            })

    #endif