{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- t'GI.Gtk.Interfaces.ColorChooser.ColorChooser' is an interface that is implemented by widgets
-- for choosing colors. Depending on the situation, colors may be
-- allowed to have alpha (translucency).
-- 
-- In GTK+, the main widgets that implement this interface are
-- t'GI.Gtk.Objects.ColorChooserWidget.ColorChooserWidget', t'GI.Gtk.Objects.ColorChooserDialog.ColorChooserDialog' and t'GI.Gtk.Objects.ColorButton.ColorButton'.
-- 
-- /Since: 3.4/

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

module GI.Gtk.Interfaces.ColorChooser
    ( 

-- * Exported types
    ColorChooser(..)                        ,
    noColorChooser                          ,
    IsColorChooser                          ,
    toColorChooser                          ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveColorChooserMethod               ,
#endif


-- ** addPalette #method:addPalette#

#if defined(ENABLE_OVERLOADING)
    ColorChooserAddPaletteMethodInfo        ,
#endif
    colorChooserAddPalette                  ,


-- ** getRgba #method:getRgba#

#if defined(ENABLE_OVERLOADING)
    ColorChooserGetRgbaMethodInfo           ,
#endif
    colorChooserGetRgba                     ,


-- ** getUseAlpha #method:getUseAlpha#

#if defined(ENABLE_OVERLOADING)
    ColorChooserGetUseAlphaMethodInfo       ,
#endif
    colorChooserGetUseAlpha                 ,


-- ** setRgba #method:setRgba#

#if defined(ENABLE_OVERLOADING)
    ColorChooserSetRgbaMethodInfo           ,
#endif
    colorChooserSetRgba                     ,


-- ** setUseAlpha #method:setUseAlpha#

#if defined(ENABLE_OVERLOADING)
    ColorChooserSetUseAlphaMethodInfo       ,
#endif
    colorChooserSetUseAlpha                 ,




 -- * Properties
-- ** rgba #attr:rgba#
-- | The [rgba](#signal:rgba) property contains the currently selected color,
-- as a t'GI.Gdk.Structs.RGBA.RGBA' struct. The property can be set to change
-- the current selection programmatically.
-- 
-- /Since: 3.4/

#if defined(ENABLE_OVERLOADING)
    ColorChooserRgbaPropertyInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    colorChooserRgba                        ,
#endif
    constructColorChooserRgba               ,
    getColorChooserRgba                     ,
    setColorChooserRgba                     ,


-- ** useAlpha #attr:useAlpha#
-- | When [useAlpha](#signal:useAlpha) is 'P.True', colors may have alpha (translucency)
-- information. When it is 'P.False', the t'GI.Gdk.Structs.RGBA.RGBA' struct obtained
-- via the t'GI.Gtk.Interfaces.ColorChooser.ColorChooser':@/rgba/@ property will be forced to have
-- alpha == 1.
-- 
-- Implementations are expected to show alpha by rendering the color
-- over a non-uniform background (like a checkerboard pattern).
-- 
-- /Since: 3.4/

#if defined(ENABLE_OVERLOADING)
    ColorChooserUseAlphaPropertyInfo        ,
#endif
#if defined(ENABLE_OVERLOADING)
    colorChooserUseAlpha                    ,
#endif
    constructColorChooserUseAlpha           ,
    getColorChooserUseAlpha                 ,
    setColorChooserUseAlpha                 ,




 -- * Signals
-- ** colorActivated #signal:colorActivated#

    C_ColorChooserColorActivatedCallback    ,
    ColorChooserColorActivatedCallback      ,
#if defined(ENABLE_OVERLOADING)
    ColorChooserColorActivatedSignalInfo    ,
#endif
    afterColorChooserColorActivated         ,
    genClosure_ColorChooserColorActivated   ,
    mk_ColorChooserColorActivatedCallback   ,
    noColorChooserColorActivatedCallback    ,
    onColorChooserColorActivated            ,
    wrap_ColorChooserColorActivatedCallback ,




    ) 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.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums

-- interface ColorChooser 
-- | Memory-managed wrapper type.
newtype ColorChooser = ColorChooser (ManagedPtr ColorChooser)
    deriving (ColorChooser -> ColorChooser -> Bool
(ColorChooser -> ColorChooser -> Bool)
-> (ColorChooser -> ColorChooser -> Bool) -> Eq ColorChooser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColorChooser -> ColorChooser -> Bool
$c/= :: ColorChooser -> ColorChooser -> Bool
== :: ColorChooser -> ColorChooser -> Bool
$c== :: ColorChooser -> ColorChooser -> Bool
Eq)
-- | A convenience alias for `Nothing` :: `Maybe` `ColorChooser`.
noColorChooser :: Maybe ColorChooser
noColorChooser :: Maybe ColorChooser
noColorChooser = Maybe ColorChooser
forall a. Maybe a
Nothing

-- signal ColorChooser::color-activated
-- | Emitted when a color is activated from the color chooser.
-- This usually happens when the user clicks a color swatch,
-- or a color is selected and the user presses one of the keys
-- Space, Shift+Space, Return or Enter.
-- 
-- /Since: 3.4/
type ColorChooserColorActivatedCallback =
    Gdk.RGBA.RGBA
    -- ^ /@color@/: the color
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ColorChooserColorActivatedCallback`@.
noColorChooserColorActivatedCallback :: Maybe ColorChooserColorActivatedCallback
noColorChooserColorActivatedCallback :: Maybe ColorChooserColorActivatedCallback
noColorChooserColorActivatedCallback = Maybe ColorChooserColorActivatedCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_ColorChooserColorActivated :: MonadIO m => ColorChooserColorActivatedCallback -> m (GClosure C_ColorChooserColorActivatedCallback)
genClosure_ColorChooserColorActivated :: ColorChooserColorActivatedCallback
-> m (GClosure C_ColorChooserColorActivatedCallback)
genClosure_ColorChooserColorActivated cb :: ColorChooserColorActivatedCallback
cb = IO (GClosure C_ColorChooserColorActivatedCallback)
-> m (GClosure C_ColorChooserColorActivatedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ColorChooserColorActivatedCallback)
 -> m (GClosure C_ColorChooserColorActivatedCallback))
-> IO (GClosure C_ColorChooserColorActivatedCallback)
-> m (GClosure C_ColorChooserColorActivatedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ColorChooserColorActivatedCallback
cb' = ColorChooserColorActivatedCallback
-> C_ColorChooserColorActivatedCallback
wrap_ColorChooserColorActivatedCallback ColorChooserColorActivatedCallback
cb
    C_ColorChooserColorActivatedCallback
-> IO (FunPtr C_ColorChooserColorActivatedCallback)
mk_ColorChooserColorActivatedCallback C_ColorChooserColorActivatedCallback
cb' IO (FunPtr C_ColorChooserColorActivatedCallback)
-> (FunPtr C_ColorChooserColorActivatedCallback
    -> IO (GClosure C_ColorChooserColorActivatedCallback))
-> IO (GClosure C_ColorChooserColorActivatedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ColorChooserColorActivatedCallback
-> IO (GClosure C_ColorChooserColorActivatedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ColorChooserColorActivatedCallback` into a `C_ColorChooserColorActivatedCallback`.
wrap_ColorChooserColorActivatedCallback ::
    ColorChooserColorActivatedCallback ->
    C_ColorChooserColorActivatedCallback
wrap_ColorChooserColorActivatedCallback :: ColorChooserColorActivatedCallback
-> C_ColorChooserColorActivatedCallback
wrap_ColorChooserColorActivatedCallback _cb :: ColorChooserColorActivatedCallback
_cb _ color :: Ptr RGBA
color _ = do
    (ManagedPtr RGBA -> RGBA)
-> Ptr RGBA -> ColorChooserColorActivatedCallback -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr RGBA -> RGBA
Gdk.RGBA.RGBA Ptr RGBA
color (ColorChooserColorActivatedCallback -> IO ())
-> ColorChooserColorActivatedCallback -> IO ()
forall a b. (a -> b) -> a -> b
$ \color' :: RGBA
color' -> do
        ColorChooserColorActivatedCallback
_cb  RGBA
color'


-- | Connect a signal handler for the [colorActivated](#signal:colorActivated) 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' colorChooser #colorActivated callback
-- @
-- 
-- 
onColorChooserColorActivated :: (IsColorChooser a, MonadIO m) => a -> ColorChooserColorActivatedCallback -> m SignalHandlerId
onColorChooserColorActivated :: a -> ColorChooserColorActivatedCallback -> m SignalHandlerId
onColorChooserColorActivated obj :: a
obj cb :: ColorChooserColorActivatedCallback
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_ColorChooserColorActivatedCallback
cb' = ColorChooserColorActivatedCallback
-> C_ColorChooserColorActivatedCallback
wrap_ColorChooserColorActivatedCallback ColorChooserColorActivatedCallback
cb
    FunPtr C_ColorChooserColorActivatedCallback
cb'' <- C_ColorChooserColorActivatedCallback
-> IO (FunPtr C_ColorChooserColorActivatedCallback)
mk_ColorChooserColorActivatedCallback C_ColorChooserColorActivatedCallback
cb'
    a
-> Text
-> FunPtr C_ColorChooserColorActivatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "color-activated" FunPtr C_ColorChooserColorActivatedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [colorActivated](#signal:colorActivated) 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' colorChooser #colorActivated callback
-- @
-- 
-- 
afterColorChooserColorActivated :: (IsColorChooser a, MonadIO m) => a -> ColorChooserColorActivatedCallback -> m SignalHandlerId
afterColorChooserColorActivated :: a -> ColorChooserColorActivatedCallback -> m SignalHandlerId
afterColorChooserColorActivated obj :: a
obj cb :: ColorChooserColorActivatedCallback
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_ColorChooserColorActivatedCallback
cb' = ColorChooserColorActivatedCallback
-> C_ColorChooserColorActivatedCallback
wrap_ColorChooserColorActivatedCallback ColorChooserColorActivatedCallback
cb
    FunPtr C_ColorChooserColorActivatedCallback
cb'' <- C_ColorChooserColorActivatedCallback
-> IO (FunPtr C_ColorChooserColorActivatedCallback)
mk_ColorChooserColorActivatedCallback C_ColorChooserColorActivatedCallback
cb'
    a
-> Text
-> FunPtr C_ColorChooserColorActivatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "color-activated" FunPtr C_ColorChooserColorActivatedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ColorChooserColorActivatedSignalInfo
instance SignalInfo ColorChooserColorActivatedSignalInfo where
    type HaskellCallbackType ColorChooserColorActivatedSignalInfo = ColorChooserColorActivatedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ColorChooserColorActivatedCallback cb
        cb'' <- mk_ColorChooserColorActivatedCallback cb'
        connectSignalFunPtr obj "color-activated" cb'' connectMode detail

#endif

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

#endif

foreign import ccall "gtk_color_chooser_get_type"
    c_gtk_color_chooser_get_type :: IO GType

instance GObject ColorChooser where
    gobjectType :: IO GType
gobjectType = IO GType
c_gtk_color_chooser_get_type
    

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

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

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

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

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

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

-- | Set the value of the “@rgba@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' colorChooser [ #rgba 'Data.GI.Base.Attributes.:=' value ]
-- @
setColorChooserRgba :: (MonadIO m, IsColorChooser o) => o -> Gdk.RGBA.RGBA -> m ()
setColorChooserRgba :: o -> RGBA -> m ()
setColorChooserRgba obj :: o
obj val :: RGBA
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 RGBA -> IO ()
forall a b.
(GObject a, BoxedObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj "rgba" (RGBA -> Maybe RGBA
forall a. a -> Maybe a
Just RGBA
val)

-- | Construct a `GValueConstruct` with valid value for the “@rgba@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructColorChooserRgba :: (IsColorChooser o) => Gdk.RGBA.RGBA -> IO (GValueConstruct o)
constructColorChooserRgba :: RGBA -> IO (GValueConstruct o)
constructColorChooserRgba val :: RGBA
val = String -> Maybe RGBA -> IO (GValueConstruct o)
forall a o.
BoxedObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed "rgba" (RGBA -> Maybe RGBA
forall a. a -> Maybe a
Just RGBA
val)

#if defined(ENABLE_OVERLOADING)
data ColorChooserRgbaPropertyInfo
instance AttrInfo ColorChooserRgbaPropertyInfo where
    type AttrAllowedOps ColorChooserRgbaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint ColorChooserRgbaPropertyInfo = IsColorChooser
    type AttrSetTypeConstraint ColorChooserRgbaPropertyInfo = (~) Gdk.RGBA.RGBA
    type AttrTransferTypeConstraint ColorChooserRgbaPropertyInfo = (~) Gdk.RGBA.RGBA
    type AttrTransferType ColorChooserRgbaPropertyInfo = Gdk.RGBA.RGBA
    type AttrGetType ColorChooserRgbaPropertyInfo = (Maybe Gdk.RGBA.RGBA)
    type AttrLabel ColorChooserRgbaPropertyInfo = "rgba"
    type AttrOrigin ColorChooserRgbaPropertyInfo = ColorChooser
    attrGet = getColorChooserRgba
    attrSet = setColorChooserRgba
    attrTransfer _ v = do
        return v
    attrConstruct = constructColorChooserRgba
    attrClear = undefined
#endif

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

-- | Get the value of the “@use-alpha@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' colorChooser #useAlpha
-- @
getColorChooserUseAlpha :: (MonadIO m, IsColorChooser o) => o -> m Bool
getColorChooserUseAlpha :: o -> m Bool
getColorChooserUseAlpha 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 "use-alpha"

-- | Set the value of the “@use-alpha@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' colorChooser [ #useAlpha 'Data.GI.Base.Attributes.:=' value ]
-- @
setColorChooserUseAlpha :: (MonadIO m, IsColorChooser o) => o -> Bool -> m ()
setColorChooserUseAlpha :: o -> Bool -> m ()
setColorChooserUseAlpha obj :: o
obj val :: Bool
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 -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "use-alpha" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@use-alpha@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructColorChooserUseAlpha :: (IsColorChooser o) => Bool -> IO (GValueConstruct o)
constructColorChooserUseAlpha :: Bool -> IO (GValueConstruct o)
constructColorChooserUseAlpha val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "use-alpha" Bool
val

#if defined(ENABLE_OVERLOADING)
data ColorChooserUseAlphaPropertyInfo
instance AttrInfo ColorChooserUseAlphaPropertyInfo where
    type AttrAllowedOps ColorChooserUseAlphaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint ColorChooserUseAlphaPropertyInfo = IsColorChooser
    type AttrSetTypeConstraint ColorChooserUseAlphaPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint ColorChooserUseAlphaPropertyInfo = (~) Bool
    type AttrTransferType ColorChooserUseAlphaPropertyInfo = Bool
    type AttrGetType ColorChooserUseAlphaPropertyInfo = Bool
    type AttrLabel ColorChooserUseAlphaPropertyInfo = "use-alpha"
    type AttrOrigin ColorChooserUseAlphaPropertyInfo = ColorChooser
    attrGet = getColorChooserUseAlpha
    attrSet = setColorChooserUseAlpha
    attrTransfer _ v = do
        return v
    attrConstruct = constructColorChooserUseAlpha
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ColorChooser
type instance O.AttributeList ColorChooser = ColorChooserAttributeList
type ColorChooserAttributeList = ('[ '("rgba", ColorChooserRgbaPropertyInfo), '("useAlpha", ColorChooserUseAlphaPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
colorChooserRgba :: AttrLabelProxy "rgba"
colorChooserRgba = AttrLabelProxy

colorChooserUseAlpha :: AttrLabelProxy "useAlpha"
colorChooserUseAlpha = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveColorChooserMethod (t :: Symbol) (o :: *) :: * where
    ResolveColorChooserMethod "addPalette" o = ColorChooserAddPaletteMethodInfo
    ResolveColorChooserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveColorChooserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveColorChooserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveColorChooserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveColorChooserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveColorChooserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveColorChooserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveColorChooserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveColorChooserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveColorChooserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveColorChooserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveColorChooserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveColorChooserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveColorChooserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveColorChooserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveColorChooserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveColorChooserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveColorChooserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveColorChooserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveColorChooserMethod "getRgba" o = ColorChooserGetRgbaMethodInfo
    ResolveColorChooserMethod "getUseAlpha" o = ColorChooserGetUseAlphaMethodInfo
    ResolveColorChooserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveColorChooserMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveColorChooserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveColorChooserMethod "setRgba" o = ColorChooserSetRgbaMethodInfo
    ResolveColorChooserMethod "setUseAlpha" o = ColorChooserSetUseAlphaMethodInfo
    ResolveColorChooserMethod l o = O.MethodResolutionFailed l o

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

#endif

-- method ColorChooser::add_palette
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "chooser"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ColorChooser" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkColorChooser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "orientation"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Orientation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "%GTK_ORIENTATION_HORIZONTAL if the palette should\n    be displayed in rows, %GTK_ORIENTATION_VERTICAL for columns"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "colors_per_line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the number of colors to show in each row/column"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_colors"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the total number of elements in @colors"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "colors"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "Gdk" , name = "RGBA" })
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the colors of the palette, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_colors"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the total number of elements in @colors"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_chooser_add_palette" gtk_color_chooser_add_palette :: 
    Ptr ColorChooser ->                     -- chooser : TInterface (Name {namespace = "Gtk", name = "ColorChooser"})
    CUInt ->                                -- orientation : TInterface (Name {namespace = "Gtk", name = "Orientation"})
    Int32 ->                                -- colors_per_line : TBasicType TInt
    Int32 ->                                -- n_colors : TBasicType TInt
    Ptr Gdk.RGBA.RGBA ->                    -- colors : TCArray False (-1) 3 (TInterface (Name {namespace = "Gdk", name = "RGBA"}))
    IO ()

-- | Adds a palette to the color chooser. If /@orientation@/ is horizontal,
-- the colors are grouped in rows, with /@colorsPerLine@/ colors
-- in each row. If /@horizontal@/ is 'P.False', the colors are grouped
-- in columns instead.
-- 
-- The default color palette of t'GI.Gtk.Objects.ColorChooserWidget.ColorChooserWidget' has
-- 27 colors, organized in columns of 3 colors. The default gray
-- palette has 9 grays in a single row.
-- 
-- The layout of the color chooser widget works best when the
-- palettes have 9-10 columns.
-- 
-- Calling this function for the first time has the
-- side effect of removing the default color and gray palettes
-- from the color chooser.
-- 
-- If /@colors@/ is 'P.Nothing', removes all previously added palettes.
-- 
-- /Since: 3.4/
colorChooserAddPalette ::
    (B.CallStack.HasCallStack, MonadIO m, IsColorChooser a) =>
    a
    -- ^ /@chooser@/: a t'GI.Gtk.Interfaces.ColorChooser.ColorChooser'
    -> Gtk.Enums.Orientation
    -- ^ /@orientation@/: 'GI.Gtk.Enums.OrientationHorizontal' if the palette should
    --     be displayed in rows, 'GI.Gtk.Enums.OrientationVertical' for columns
    -> Int32
    -- ^ /@colorsPerLine@/: the number of colors to show in each row\/column
    -> Maybe ([Gdk.RGBA.RGBA])
    -- ^ /@colors@/: the colors of the palette, or 'P.Nothing'
    -> m ()
colorChooserAddPalette :: a -> Orientation -> Int32 -> Maybe [RGBA] -> m ()
colorChooserAddPalette chooser :: a
chooser orientation :: Orientation
orientation colorsPerLine :: Int32
colorsPerLine colors :: Maybe [RGBA]
colors = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let nColors :: Int32
nColors = case Maybe [RGBA]
colors of
            Nothing -> 0
            Just jColors :: [RGBA]
jColors -> Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [RGBA] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [RGBA]
jColors
    Ptr ColorChooser
chooser' <- a -> IO (Ptr ColorChooser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
chooser
    let orientation' :: CUInt
orientation' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Orientation -> Int) -> Orientation -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Orientation -> Int
forall a. Enum a => a -> Int
fromEnum) Orientation
orientation
    Ptr RGBA
maybeColors <- case Maybe [RGBA]
colors of
        Nothing -> Ptr RGBA -> IO (Ptr RGBA)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RGBA
forall a. Ptr a
nullPtr
        Just jColors :: [RGBA]
jColors -> do
            [Ptr RGBA]
jColors' <- (RGBA -> IO (Ptr RGBA)) -> [RGBA] -> IO [Ptr RGBA]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RGBA -> IO (Ptr RGBA)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [RGBA]
jColors
            Ptr RGBA
jColors'' <- Int -> [Ptr RGBA] -> IO (Ptr RGBA)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray 32 [Ptr RGBA]
jColors'
            Ptr RGBA -> IO (Ptr RGBA)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RGBA
jColors''
    Ptr ColorChooser -> CUInt -> Int32 -> Int32 -> Ptr RGBA -> IO ()
gtk_color_chooser_add_palette Ptr ColorChooser
chooser' CUInt
orientation' Int32
colorsPerLine Int32
nColors Ptr RGBA
maybeColors
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
chooser
    Maybe [RGBA] -> ([RGBA] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [RGBA]
colors (ColorChooserColorActivatedCallback -> [RGBA] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ ColorChooserColorActivatedCallback
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
    Ptr RGBA -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr RGBA
maybeColors
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ColorChooserAddPaletteMethodInfo
instance (signature ~ (Gtk.Enums.Orientation -> Int32 -> Maybe ([Gdk.RGBA.RGBA]) -> m ()), MonadIO m, IsColorChooser a) => O.MethodInfo ColorChooserAddPaletteMethodInfo a signature where
    overloadedMethod = colorChooserAddPalette

#endif

-- method ColorChooser::get_rgba
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "chooser"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ColorChooser" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkColorChooser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color"
--           , argType = TInterface Name { namespace = "Gdk" , name = "RGBA" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkRGBA to fill in with the current color"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_chooser_get_rgba" gtk_color_chooser_get_rgba :: 
    Ptr ColorChooser ->                     -- chooser : TInterface (Name {namespace = "Gtk", name = "ColorChooser"})
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO ()

-- | Gets the currently-selected color.
-- 
-- /Since: 3.4/
colorChooserGetRgba ::
    (B.CallStack.HasCallStack, MonadIO m, IsColorChooser a) =>
    a
    -- ^ /@chooser@/: a t'GI.Gtk.Interfaces.ColorChooser.ColorChooser'
    -> m (Gdk.RGBA.RGBA)
colorChooserGetRgba :: a -> m RGBA
colorChooserGetRgba chooser :: a
chooser = IO RGBA -> m RGBA
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RGBA -> m RGBA) -> IO RGBA -> m RGBA
forall a b. (a -> b) -> a -> b
$ do
    Ptr ColorChooser
chooser' <- a -> IO (Ptr ColorChooser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
chooser
    Ptr RGBA
color <- Int -> IO (Ptr RGBA)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    Ptr ColorChooser -> Ptr RGBA -> IO ()
gtk_color_chooser_get_rgba Ptr ColorChooser
chooser' Ptr RGBA
color
    RGBA
color' <- ((ManagedPtr RGBA -> RGBA) -> Ptr RGBA -> IO RGBA
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RGBA -> RGBA
Gdk.RGBA.RGBA) Ptr RGBA
color
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
chooser
    RGBA -> IO RGBA
forall (m :: * -> *) a. Monad m => a -> m a
return RGBA
color'

#if defined(ENABLE_OVERLOADING)
data ColorChooserGetRgbaMethodInfo
instance (signature ~ (m (Gdk.RGBA.RGBA)), MonadIO m, IsColorChooser a) => O.MethodInfo ColorChooserGetRgbaMethodInfo a signature where
    overloadedMethod = colorChooserGetRgba

#endif

-- method ColorChooser::get_use_alpha
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "chooser"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ColorChooser" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkColorChooser" , 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 "gtk_color_chooser_get_use_alpha" gtk_color_chooser_get_use_alpha :: 
    Ptr ColorChooser ->                     -- chooser : TInterface (Name {namespace = "Gtk", name = "ColorChooser"})
    IO CInt

-- | Returns whether the color chooser shows the alpha channel.
-- 
-- /Since: 3.4/
colorChooserGetUseAlpha ::
    (B.CallStack.HasCallStack, MonadIO m, IsColorChooser a) =>
    a
    -- ^ /@chooser@/: a t'GI.Gtk.Interfaces.ColorChooser.ColorChooser'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the color chooser uses the alpha channel,
    --     'P.False' if not
colorChooserGetUseAlpha :: a -> m Bool
colorChooserGetUseAlpha chooser :: a
chooser = 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 ColorChooser
chooser' <- a -> IO (Ptr ColorChooser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
chooser
    CInt
result <- Ptr ColorChooser -> IO CInt
gtk_color_chooser_get_use_alpha Ptr ColorChooser
chooser'
    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
chooser
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ColorChooserGetUseAlphaMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsColorChooser a) => O.MethodInfo ColorChooserGetUseAlphaMethodInfo a signature where
    overloadedMethod = colorChooserGetUseAlpha

#endif

-- method ColorChooser::set_rgba
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "chooser"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ColorChooser" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkColorChooser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color"
--           , argType = TInterface Name { namespace = "Gdk" , name = "RGBA" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new color" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_chooser_set_rgba" gtk_color_chooser_set_rgba :: 
    Ptr ColorChooser ->                     -- chooser : TInterface (Name {namespace = "Gtk", name = "ColorChooser"})
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO ()

-- | Sets the color.
-- 
-- /Since: 3.4/
colorChooserSetRgba ::
    (B.CallStack.HasCallStack, MonadIO m, IsColorChooser a) =>
    a
    -- ^ /@chooser@/: a t'GI.Gtk.Interfaces.ColorChooser.ColorChooser'
    -> Gdk.RGBA.RGBA
    -- ^ /@color@/: the new color
    -> m ()
colorChooserSetRgba :: a -> RGBA -> m ()
colorChooserSetRgba chooser :: a
chooser color :: RGBA
color = 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 ColorChooser
chooser' <- a -> IO (Ptr ColorChooser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
chooser
    Ptr RGBA
color' <- RGBA -> IO (Ptr RGBA)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RGBA
color
    Ptr ColorChooser -> Ptr RGBA -> IO ()
gtk_color_chooser_set_rgba Ptr ColorChooser
chooser' Ptr RGBA
color'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
chooser
    ColorChooserColorActivatedCallback
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RGBA
color
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ColorChooserSetRgbaMethodInfo
instance (signature ~ (Gdk.RGBA.RGBA -> m ()), MonadIO m, IsColorChooser a) => O.MethodInfo ColorChooserSetRgbaMethodInfo a signature where
    overloadedMethod = colorChooserSetRgba

#endif

-- method ColorChooser::set_use_alpha
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "chooser"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ColorChooser" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkColorChooser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "use_alpha"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "%TRUE if color chooser should use alpha channel, %FALSE if not"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_chooser_set_use_alpha" gtk_color_chooser_set_use_alpha :: 
    Ptr ColorChooser ->                     -- chooser : TInterface (Name {namespace = "Gtk", name = "ColorChooser"})
    CInt ->                                 -- use_alpha : TBasicType TBoolean
    IO ()

-- | Sets whether or not the color chooser should use the alpha channel.
-- 
-- /Since: 3.4/
colorChooserSetUseAlpha ::
    (B.CallStack.HasCallStack, MonadIO m, IsColorChooser a) =>
    a
    -- ^ /@chooser@/: a t'GI.Gtk.Interfaces.ColorChooser.ColorChooser'
    -> Bool
    -- ^ /@useAlpha@/: 'P.True' if color chooser should use alpha channel, 'P.False' if not
    -> m ()
colorChooserSetUseAlpha :: a -> Bool -> m ()
colorChooserSetUseAlpha chooser :: a
chooser useAlpha :: Bool
useAlpha = 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 ColorChooser
chooser' <- a -> IO (Ptr ColorChooser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
chooser
    let useAlpha' :: CInt
useAlpha' = (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
useAlpha
    Ptr ColorChooser -> CInt -> IO ()
gtk_color_chooser_set_use_alpha Ptr ColorChooser
chooser' CInt
useAlpha'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
chooser
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ColorChooserSetUseAlphaMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsColorChooser a) => O.MethodInfo ColorChooserSetUseAlphaMethodInfo a signature where
    overloadedMethod = colorChooserSetUseAlpha

#endif