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

module GI.Gtk.Objects.ColorButton
    ( 

-- * Exported types
    ColorButton(..)                         ,
    ColorButtonK                            ,
    toColorButton                           ,
    noColorButton                           ,


 -- * Methods
-- ** colorButtonGetAlpha
    colorButtonGetAlpha                     ,


-- ** colorButtonGetColor
    colorButtonGetColor                     ,


-- ** colorButtonGetTitle
    colorButtonGetTitle                     ,


-- ** colorButtonGetUseAlpha
    colorButtonGetUseAlpha                  ,


-- ** colorButtonNew
    colorButtonNew                          ,


-- ** colorButtonNewWithColor
    colorButtonNewWithColor                 ,


-- ** colorButtonNewWithRgba
    colorButtonNewWithRgba                  ,


-- ** colorButtonSetAlpha
    colorButtonSetAlpha                     ,


-- ** colorButtonSetColor
    colorButtonSetColor                     ,


-- ** colorButtonSetTitle
    colorButtonSetTitle                     ,


-- ** colorButtonSetUseAlpha
    colorButtonSetUseAlpha                  ,




 -- * Properties
-- ** Alpha
    ColorButtonAlphaPropertyInfo            ,
    constructColorButtonAlpha               ,
    getColorButtonAlpha                     ,
    setColorButtonAlpha                     ,


-- ** Color
    ColorButtonColorPropertyInfo            ,
    constructColorButtonColor               ,
    getColorButtonColor                     ,
    setColorButtonColor                     ,


-- ** Rgba
    ColorButtonRgbaPropertyInfo             ,
    constructColorButtonRgba                ,
    getColorButtonRgba                      ,
    setColorButtonRgba                      ,


-- ** Title
    ColorButtonTitlePropertyInfo            ,
    constructColorButtonTitle               ,
    getColorButtonTitle                     ,
    setColorButtonTitle                     ,


-- ** UseAlpha
    ColorButtonUseAlphaPropertyInfo         ,
    constructColorButtonUseAlpha            ,
    getColorButtonUseAlpha                  ,
    setColorButtonUseAlpha                  ,




 -- * Signals
-- ** ColorSet
    ColorButtonColorSetCallback             ,
    ColorButtonColorSetCallbackC            ,
    ColorButtonColorSetSignalInfo           ,
    afterColorButtonColorSet                ,
    colorButtonColorSetCallbackWrapper      ,
    colorButtonColorSetClosure              ,
    mkColorButtonColorSetCallback           ,
    noColorButtonColorSetCallback           ,
    onColorButtonColorSet                   ,




    ) where

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

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

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

newtype ColorButton = ColorButton (ForeignPtr ColorButton)
foreign import ccall "gtk_color_button_get_type"
    c_gtk_color_button_get_type :: IO GType

type instance ParentTypes ColorButton = ColorButtonParentTypes
type ColorButtonParentTypes = '[Button, Bin, Container, Widget, GObject.Object, Atk.ImplementorIface, Actionable, Activatable, Buildable, ColorChooser]

instance GObject ColorButton where
    gobjectIsInitiallyUnowned _ = True
    gobjectType _ = c_gtk_color_button_get_type
    

class GObject o => ColorButtonK o
instance (GObject o, IsDescendantOf ColorButton o) => ColorButtonK o

toColorButton :: ColorButtonK o => o -> IO ColorButton
toColorButton = unsafeCastTo ColorButton

noColorButton :: Maybe ColorButton
noColorButton = Nothing

-- signal ColorButton::color-set
type ColorButtonColorSetCallback =
    IO ()

noColorButtonColorSetCallback :: Maybe ColorButtonColorSetCallback
noColorButtonColorSetCallback = Nothing

type ColorButtonColorSetCallbackC =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mkColorButtonColorSetCallback :: ColorButtonColorSetCallbackC -> IO (FunPtr ColorButtonColorSetCallbackC)

colorButtonColorSetClosure :: ColorButtonColorSetCallback -> IO Closure
colorButtonColorSetClosure cb = newCClosure =<< mkColorButtonColorSetCallback wrapped
    where wrapped = colorButtonColorSetCallbackWrapper cb

colorButtonColorSetCallbackWrapper ::
    ColorButtonColorSetCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
colorButtonColorSetCallbackWrapper _cb _ _ = do
    _cb 

onColorButtonColorSet :: (GObject a, MonadIO m) => a -> ColorButtonColorSetCallback -> m SignalHandlerId
onColorButtonColorSet obj cb = liftIO $ connectColorButtonColorSet obj cb SignalConnectBefore
afterColorButtonColorSet :: (GObject a, MonadIO m) => a -> ColorButtonColorSetCallback -> m SignalHandlerId
afterColorButtonColorSet obj cb = connectColorButtonColorSet obj cb SignalConnectAfter

connectColorButtonColorSet :: (GObject a, MonadIO m) =>
                              a -> ColorButtonColorSetCallback -> SignalConnectMode -> m SignalHandlerId
connectColorButtonColorSet obj cb after = liftIO $ do
    cb' <- mkColorButtonColorSetCallback (colorButtonColorSetCallbackWrapper cb)
    connectSignalFunPtr obj "color-set" cb' after

-- VVV Prop "alpha"
   -- Type: TBasicType TUInt32
   -- Flags: [PropertyReadable,PropertyWritable]

getColorButtonAlpha :: (MonadIO m, ColorButtonK o) => o -> m Word32
getColorButtonAlpha obj = liftIO $ getObjectPropertyCUInt obj "alpha"

setColorButtonAlpha :: (MonadIO m, ColorButtonK o) => o -> Word32 -> m ()
setColorButtonAlpha obj val = liftIO $ setObjectPropertyCUInt obj "alpha" val

constructColorButtonAlpha :: Word32 -> IO ([Char], GValue)
constructColorButtonAlpha val = constructObjectPropertyCUInt "alpha" val

data ColorButtonAlphaPropertyInfo
instance AttrInfo ColorButtonAlphaPropertyInfo where
    type AttrAllowedOps ColorButtonAlphaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ColorButtonAlphaPropertyInfo = (~) Word32
    type AttrBaseTypeConstraint ColorButtonAlphaPropertyInfo = ColorButtonK
    type AttrGetType ColorButtonAlphaPropertyInfo = Word32
    type AttrLabel ColorButtonAlphaPropertyInfo = "ColorButton::alpha"
    attrGet _ = getColorButtonAlpha
    attrSet _ = setColorButtonAlpha
    attrConstruct _ = constructColorButtonAlpha

-- VVV Prop "color"
   -- Type: TInterface "Gdk" "Color"
   -- Flags: [PropertyReadable,PropertyWritable]

getColorButtonColor :: (MonadIO m, ColorButtonK o) => o -> m Gdk.Color
getColorButtonColor obj = liftIO $ getObjectPropertyBoxed obj "color" Gdk.Color

setColorButtonColor :: (MonadIO m, ColorButtonK o) => o -> Gdk.Color -> m ()
setColorButtonColor obj val = liftIO $ setObjectPropertyBoxed obj "color" val

constructColorButtonColor :: Gdk.Color -> IO ([Char], GValue)
constructColorButtonColor val = constructObjectPropertyBoxed "color" val

data ColorButtonColorPropertyInfo
instance AttrInfo ColorButtonColorPropertyInfo where
    type AttrAllowedOps ColorButtonColorPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ColorButtonColorPropertyInfo = (~) Gdk.Color
    type AttrBaseTypeConstraint ColorButtonColorPropertyInfo = ColorButtonK
    type AttrGetType ColorButtonColorPropertyInfo = Gdk.Color
    type AttrLabel ColorButtonColorPropertyInfo = "ColorButton::color"
    attrGet _ = getColorButtonColor
    attrSet _ = setColorButtonColor
    attrConstruct _ = constructColorButtonColor

-- VVV Prop "rgba"
   -- Type: TInterface "Gdk" "RGBA"
   -- Flags: [PropertyReadable,PropertyWritable]

getColorButtonRgba :: (MonadIO m, ColorButtonK o) => o -> m Gdk.RGBA
getColorButtonRgba obj = liftIO $ getObjectPropertyBoxed obj "rgba" Gdk.RGBA

setColorButtonRgba :: (MonadIO m, ColorButtonK o) => o -> Gdk.RGBA -> m ()
setColorButtonRgba obj val = liftIO $ setObjectPropertyBoxed obj "rgba" val

constructColorButtonRgba :: Gdk.RGBA -> IO ([Char], GValue)
constructColorButtonRgba val = constructObjectPropertyBoxed "rgba" val

data ColorButtonRgbaPropertyInfo
instance AttrInfo ColorButtonRgbaPropertyInfo where
    type AttrAllowedOps ColorButtonRgbaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ColorButtonRgbaPropertyInfo = (~) Gdk.RGBA
    type AttrBaseTypeConstraint ColorButtonRgbaPropertyInfo = ColorButtonK
    type AttrGetType ColorButtonRgbaPropertyInfo = Gdk.RGBA
    type AttrLabel ColorButtonRgbaPropertyInfo = "ColorButton::rgba"
    attrGet _ = getColorButtonRgba
    attrSet _ = setColorButtonRgba
    attrConstruct _ = constructColorButtonRgba

-- VVV Prop "title"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]

getColorButtonTitle :: (MonadIO m, ColorButtonK o) => o -> m T.Text
getColorButtonTitle obj = liftIO $ getObjectPropertyString obj "title"

setColorButtonTitle :: (MonadIO m, ColorButtonK o) => o -> T.Text -> m ()
setColorButtonTitle obj val = liftIO $ setObjectPropertyString obj "title" val

constructColorButtonTitle :: T.Text -> IO ([Char], GValue)
constructColorButtonTitle val = constructObjectPropertyString "title" val

data ColorButtonTitlePropertyInfo
instance AttrInfo ColorButtonTitlePropertyInfo where
    type AttrAllowedOps ColorButtonTitlePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ColorButtonTitlePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ColorButtonTitlePropertyInfo = ColorButtonK
    type AttrGetType ColorButtonTitlePropertyInfo = T.Text
    type AttrLabel ColorButtonTitlePropertyInfo = "ColorButton::title"
    attrGet _ = getColorButtonTitle
    attrSet _ = setColorButtonTitle
    attrConstruct _ = constructColorButtonTitle

-- VVV Prop "use-alpha"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]

getColorButtonUseAlpha :: (MonadIO m, ColorButtonK o) => o -> m Bool
getColorButtonUseAlpha obj = liftIO $ getObjectPropertyBool obj "use-alpha"

setColorButtonUseAlpha :: (MonadIO m, ColorButtonK o) => o -> Bool -> m ()
setColorButtonUseAlpha obj val = liftIO $ setObjectPropertyBool obj "use-alpha" val

constructColorButtonUseAlpha :: Bool -> IO ([Char], GValue)
constructColorButtonUseAlpha val = constructObjectPropertyBool "use-alpha" val

data ColorButtonUseAlphaPropertyInfo
instance AttrInfo ColorButtonUseAlphaPropertyInfo where
    type AttrAllowedOps ColorButtonUseAlphaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ColorButtonUseAlphaPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint ColorButtonUseAlphaPropertyInfo = ColorButtonK
    type AttrGetType ColorButtonUseAlphaPropertyInfo = Bool
    type AttrLabel ColorButtonUseAlphaPropertyInfo = "ColorButton::use-alpha"
    attrGet _ = getColorButtonUseAlpha
    attrSet _ = setColorButtonUseAlpha
    attrConstruct _ = constructColorButtonUseAlpha

type instance AttributeList ColorButton = ColorButtonAttributeList
type ColorButtonAttributeList = ('[ '("action-name", ActionableActionNamePropertyInfo), '("action-target", ActionableActionTargetPropertyInfo), '("alpha", ColorButtonAlphaPropertyInfo), '("always-show-image", ButtonAlwaysShowImagePropertyInfo), '("app-paintable", WidgetAppPaintablePropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("color", ColorButtonColorPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("focus-on-click", ButtonFocusOnClickPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("image", ButtonImagePropertyInfo), '("image-position", ButtonImagePositionPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("label", ButtonLabelPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("related-action", ActivatableRelatedActionPropertyInfo), '("relief", ButtonReliefPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("rgba", ColorButtonRgbaPropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("style", WidgetStylePropertyInfo), '("title", ColorButtonTitlePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("use-action-appearance", ActivatableUseActionAppearancePropertyInfo), '("use-alpha", ColorButtonUseAlphaPropertyInfo), '("use-stock", ButtonUseStockPropertyInfo), '("use-underline", ButtonUseUnderlinePropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo), '("xalign", ButtonXalignPropertyInfo), '("yalign", ButtonYalignPropertyInfo)] :: [(Symbol, *)])

data ColorButtonColorSetSignalInfo
instance SignalInfo ColorButtonColorSetSignalInfo where
    type HaskellCallbackType ColorButtonColorSetSignalInfo = ColorButtonColorSetCallback
    connectSignal _ = connectColorButtonColorSet

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

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

foreign import ccall "gtk_color_button_new" gtk_color_button_new :: 
    IO (Ptr ColorButton)


colorButtonNew ::
    (MonadIO m) =>
    m ColorButton
colorButtonNew  = liftIO $ do
    result <- gtk_color_button_new
    checkUnexpectedReturnNULL "gtk_color_button_new" result
    result' <- (newObject ColorButton) result
    return result'

-- method ColorButton::new_with_color
-- method type : Constructor
-- Args : [Arg {argName = "color", argType = TInterface "Gdk" "Color", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "color", argType = TInterface "Gdk" "Color", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "ColorButton"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_button_new_with_color" gtk_color_button_new_with_color :: 
    Ptr Gdk.Color ->                        -- color : TInterface "Gdk" "Color"
    IO (Ptr ColorButton)

{-# DEPRECATED colorButtonNewWithColor ["(Since version 3.4)","Use gtk_color_button_new_with_rgba() instead."]#-}
colorButtonNewWithColor ::
    (MonadIO m) =>
    Gdk.Color ->                            -- color
    m ColorButton
colorButtonNewWithColor color = liftIO $ do
    let color' = unsafeManagedPtrGetPtr color
    result <- gtk_color_button_new_with_color color'
    checkUnexpectedReturnNULL "gtk_color_button_new_with_color" result
    result' <- (newObject ColorButton) result
    touchManagedPtr color
    return result'

-- method ColorButton::new_with_rgba
-- method type : Constructor
-- Args : [Arg {argName = "rgba", argType = TInterface "Gdk" "RGBA", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "rgba", argType = TInterface "Gdk" "RGBA", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "ColorButton"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_button_new_with_rgba" gtk_color_button_new_with_rgba :: 
    Ptr Gdk.RGBA ->                         -- rgba : TInterface "Gdk" "RGBA"
    IO (Ptr ColorButton)


colorButtonNewWithRgba ::
    (MonadIO m) =>
    Gdk.RGBA ->                             -- rgba
    m ColorButton
colorButtonNewWithRgba rgba = liftIO $ do
    let rgba' = unsafeManagedPtrGetPtr rgba
    result <- gtk_color_button_new_with_rgba rgba'
    checkUnexpectedReturnNULL "gtk_color_button_new_with_rgba" result
    result' <- (newObject ColorButton) result
    touchManagedPtr rgba
    return result'

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

foreign import ccall "gtk_color_button_get_alpha" gtk_color_button_get_alpha :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    IO Word16

{-# DEPRECATED colorButtonGetAlpha ["(Since version 3.4)","Use gtk_color_chooser_get_rgba() instead."]#-}
colorButtonGetAlpha ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    m Word16
colorButtonGetAlpha _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_color_button_get_alpha _obj'
    touchManagedPtr _obj
    return result

-- method ColorButton::get_color
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ColorButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "color", argType = TInterface "Gdk" "Color", direction = DirectionOut, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ColorButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_color_button_get_color" gtk_color_button_get_color :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    Ptr Gdk.Color ->                        -- color : TInterface "Gdk" "Color"
    IO ()

{-# DEPRECATED colorButtonGetColor ["(Since version 3.4)","Use gtk_color_chooser_get_rgba() instead."]#-}
colorButtonGetColor ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    m (Gdk.Color)
colorButtonGetColor _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    color <- callocBoxedBytes 12 :: IO (Ptr Gdk.Color)
    gtk_color_button_get_color _obj' color
    color' <- (wrapBoxed Gdk.Color) color
    touchManagedPtr _obj
    return color'

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

foreign import ccall "gtk_color_button_get_title" gtk_color_button_get_title :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    IO CString


colorButtonGetTitle ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    m T.Text
colorButtonGetTitle _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_color_button_get_title _obj'
    checkUnexpectedReturnNULL "gtk_color_button_get_title" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "gtk_color_button_get_use_alpha" gtk_color_button_get_use_alpha :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    IO CInt

{-# DEPRECATED colorButtonGetUseAlpha ["(Since version 3.4)","Use gtk_color_chooser_get_use_alpha() instead."]#-}
colorButtonGetUseAlpha ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    m Bool
colorButtonGetUseAlpha _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_color_button_get_use_alpha _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

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

foreign import ccall "gtk_color_button_set_alpha" gtk_color_button_set_alpha :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    Word16 ->                               -- alpha : TBasicType TUInt16
    IO ()

{-# DEPRECATED colorButtonSetAlpha ["(Since version 3.4)","Use gtk_color_chooser_set_rgba() instead."]#-}
colorButtonSetAlpha ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    Word16 ->                               -- alpha
    m ()
colorButtonSetAlpha _obj alpha = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    gtk_color_button_set_alpha _obj' alpha
    touchManagedPtr _obj
    return ()

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

foreign import ccall "gtk_color_button_set_color" gtk_color_button_set_color :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    Ptr Gdk.Color ->                        -- color : TInterface "Gdk" "Color"
    IO ()

{-# DEPRECATED colorButtonSetColor ["Use gtk_color_chooser_set_rgba() instead."]#-}
colorButtonSetColor ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    Gdk.Color ->                            -- color
    m ()
colorButtonSetColor _obj color = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let color' = unsafeManagedPtrGetPtr color
    gtk_color_button_set_color _obj' color'
    touchManagedPtr _obj
    touchManagedPtr color
    return ()

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

foreign import ccall "gtk_color_button_set_title" gtk_color_button_set_title :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    CString ->                              -- title : TBasicType TUTF8
    IO ()


colorButtonSetTitle ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- title
    m ()
colorButtonSetTitle _obj title = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    title' <- textToCString title
    gtk_color_button_set_title _obj' title'
    touchManagedPtr _obj
    freeMem title'
    return ()

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

foreign import ccall "gtk_color_button_set_use_alpha" gtk_color_button_set_use_alpha :: 
    Ptr ColorButton ->                      -- _obj : TInterface "Gtk" "ColorButton"
    CInt ->                                 -- use_alpha : TBasicType TBoolean
    IO ()

{-# DEPRECATED colorButtonSetUseAlpha ["(Since version 3.4)","Use gtk_color_chooser_set_use_alpha() instead."]#-}
colorButtonSetUseAlpha ::
    (MonadIO m, ColorButtonK a) =>
    a ->                                    -- _obj
    Bool ->                                 -- use_alpha
    m ()
colorButtonSetUseAlpha _obj use_alpha = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let use_alpha' = (fromIntegral . fromEnum) use_alpha
    gtk_color_button_set_use_alpha _obj' use_alpha'
    touchManagedPtr _obj
    return ()