{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- GtkSymbolicColor is a boxed type that represents a symbolic color.
-- It is the result of parsing a
-- [color expression][gtkcssprovider-symbolic-colors].
-- To obtain the color represented by a GtkSymbolicColor, it has to
-- be resolved with 'GI.Gtk.Structs.SymbolicColor.symbolicColorResolve', which replaces all
-- symbolic color references by the colors they refer to (in a given
-- context) and evaluates mix, shade and other expressions, resulting
-- in a t'GI.Gdk.Structs.RGBA.RGBA' value.
-- 
-- It is not normally necessary to deal directly with @/GtkSymbolicColors/@,
-- since they are mostly used behind the scenes by t'GI.Gtk.Objects.StyleContext.StyleContext' and
-- t'GI.Gtk.Objects.CssProvider.CssProvider'.
-- 
-- t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated. Symbolic colors are considered an
-- implementation detail of GTK+.

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

module GI.Gtk.Structs.SymbolicColor
    ( 

-- * Exported types
    SymbolicColor(..)                       ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [ref]("GI.Gtk.Structs.SymbolicColor#g:method:ref"), [resolve]("GI.Gtk.Structs.SymbolicColor#g:method:resolve"), [toString]("GI.Gtk.Structs.SymbolicColor#g:method:toString"), [unref]("GI.Gtk.Structs.SymbolicColor#g:method:unref").
-- 
-- ==== Getters
-- /None/.
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveSymbolicColorMethod              ,
#endif

-- ** newAlpha #method:newAlpha#

    symbolicColorNewAlpha                   ,


-- ** newLiteral #method:newLiteral#

    symbolicColorNewLiteral                 ,


-- ** newMix #method:newMix#

    symbolicColorNewMix                     ,


-- ** newName #method:newName#

    symbolicColorNewName                    ,


-- ** newShade #method:newShade#

    symbolicColorNewShade                   ,


-- ** newWin32 #method:newWin32#

    symbolicColorNewWin32                   ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    SymbolicColorRefMethodInfo              ,
#endif
    symbolicColorRef                        ,


-- ** resolve #method:resolve#

#if defined(ENABLE_OVERLOADING)
    SymbolicColorResolveMethodInfo          ,
#endif
    symbolicColorResolve                    ,


-- ** toString #method:toString#

#if defined(ENABLE_OVERLOADING)
    SymbolicColorToStringMethodInfo         ,
#endif
    symbolicColorToString                   ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    SymbolicColorUnrefMethodInfo            ,
#endif
    symbolicColorUnref                      ,




    ) where

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

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

import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleProperties as Gtk.StyleProperties

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

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

foreign import ccall "gtk_symbolic_color_get_type" c_gtk_symbolic_color_get_type :: 
    IO GType

type instance O.ParentTypes SymbolicColor = '[]
instance O.HasParentTypes SymbolicColor

instance B.Types.TypedObject SymbolicColor where
    glibType :: IO GType
glibType = IO GType
c_gtk_symbolic_color_get_type

instance B.Types.GBoxed SymbolicColor

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


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SymbolicColor
type instance O.AttributeList SymbolicColor = SymbolicColorAttributeList
type SymbolicColorAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method SymbolicColor::new_alpha
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "color"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "another #GtkSymbolicColor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "factor to apply to @color alpha"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_alpha" gtk_symbolic_color_new_alpha :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    CDouble ->                              -- factor : TBasicType TDouble
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewAlpha ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color by modifying the relative alpha
-- value of /@color@/. A factor \< 1.0 would resolve to a more
-- transparent color, while > 1.0 would resolve to a more
-- opaque color.
-- 
-- /Since: 3.0/
symbolicColorNewAlpha ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color@/: another t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
    -> Double
    -- ^ /@factor@/: factor to apply to /@color@/ alpha
    -> m SymbolicColor
    -- ^ __Returns:__ A newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewAlpha :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewAlpha SymbolicColor
color Double
factor = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
    Ptr SymbolicColor
result <- Ptr SymbolicColor -> CDouble -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_alpha Ptr SymbolicColor
color' CDouble
factor'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewAlpha" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SymbolicColor::new_literal
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "color"
--           , argType = TInterface Name { namespace = "Gdk" , name = "RGBA" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkRGBA" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_literal" gtk_symbolic_color_new_literal :: 
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewLiteral ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color pointing to a literal color.
-- 
-- /Since: 3.0/
symbolicColorNewLiteral ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gdk.RGBA.RGBA
    -- ^ /@color@/: a t'GI.Gdk.Structs.RGBA.RGBA'
    -> m SymbolicColor
    -- ^ __Returns:__ a newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewLiteral :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RGBA -> m SymbolicColor
symbolicColorNewLiteral RGBA
color = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    Ptr RGBA
color' <- RGBA -> IO (Ptr RGBA)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RGBA
color
    Ptr SymbolicColor
result <- Ptr RGBA -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_literal Ptr RGBA
color'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewLiteral" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    RGBA -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RGBA
color
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SymbolicColor::new_mix
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "color1"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "color to mix" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color2"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "another color to mix"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "mix factor" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_mix" gtk_symbolic_color_new_mix :: 
    Ptr SymbolicColor ->                    -- color1 : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    Ptr SymbolicColor ->                    -- color2 : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    CDouble ->                              -- factor : TBasicType TDouble
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewMix ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color defined as a mix of another
-- two colors. a mix factor of 0 would resolve to /@color1@/,
-- while a factor of 1 would resolve to /@color2@/.
-- 
-- /Since: 3.0/
symbolicColorNewMix ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color1@/: color to mix
    -> SymbolicColor
    -- ^ /@color2@/: another color to mix
    -> Double
    -- ^ /@factor@/: mix factor
    -> m SymbolicColor
    -- ^ __Returns:__ A newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewMix :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewMix SymbolicColor
color1 SymbolicColor
color2 Double
factor = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color1' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color1
    Ptr SymbolicColor
color2' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color2
    let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
    Ptr SymbolicColor
result <- Ptr SymbolicColor
-> Ptr SymbolicColor -> CDouble -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_mix Ptr SymbolicColor
color1' Ptr SymbolicColor
color2' CDouble
factor'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewMix" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color1
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color2
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SymbolicColor::new_name
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "color name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_name" gtk_symbolic_color_new_name :: 
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewName ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color pointing to an unresolved named
-- color. See 'GI.Gtk.Objects.StyleContext.styleContextLookupColor' and
-- 'GI.Gtk.Objects.StyleProperties.stylePropertiesLookupColor'.
-- 
-- /Since: 3.0/
symbolicColorNewName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@name@/: color name
    -> m SymbolicColor
    -- ^ __Returns:__ a newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m SymbolicColor
symbolicColorNewName Text
name = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    CString
name' <- Text -> IO CString
textToCString Text
name
    Ptr SymbolicColor
result <- CString -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_name CString
name'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewName" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SymbolicColor::new_shade
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "color"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "another #GtkSymbolicColor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "shading factor to apply to @color"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_shade" gtk_symbolic_color_new_shade :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    CDouble ->                              -- factor : TBasicType TDouble
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewShade ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color defined as a shade of
-- another color. A factor > 1.0 would resolve to
-- a brighter color, while \< 1.0 would resolve to
-- a darker color.
-- 
-- /Since: 3.0/
symbolicColorNewShade ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color@/: another t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
    -> Double
    -- ^ /@factor@/: shading factor to apply to /@color@/
    -> m SymbolicColor
    -- ^ __Returns:__ A newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewShade :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewShade SymbolicColor
color Double
factor = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
    Ptr SymbolicColor
result <- Ptr SymbolicColor -> CDouble -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_shade Ptr SymbolicColor
color' CDouble
factor'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewShade" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SymbolicColor::new_win32
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "theme_class"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The theme class to pull color from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The color id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "SymbolicColor" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_new_win32" gtk_symbolic_color_new_win32 :: 
    CString ->                              -- theme_class : TBasicType TUTF8
    Int32 ->                                -- id : TBasicType TInt
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorNewWin32 ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Creates a symbolic color based on the current win32
-- theme.
-- 
-- Note that while this call is available on all platforms
-- the actual value returned is not reliable on non-win32
-- platforms.
-- 
-- /Since: 3.4/
symbolicColorNewWin32 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@themeClass@/: The theme class to pull color from
    -> Int32
    -- ^ /@id@/: The color id
    -> m SymbolicColor
    -- ^ __Returns:__ A newly created t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
symbolicColorNewWin32 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Int32 -> m SymbolicColor
symbolicColorNewWin32 Text
themeClass Int32
id = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    CString
themeClass' <- Text -> IO CString
textToCString Text
themeClass
    Ptr SymbolicColor
result <- CString -> Int32 -> IO (Ptr SymbolicColor)
gtk_symbolic_color_new_win32 CString
themeClass' Int32
id
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorNewWin32" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
themeClass'
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "gtk_symbolic_color_ref" gtk_symbolic_color_ref :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    IO (Ptr SymbolicColor)

{-# DEPRECATED symbolicColorRef ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Increases the reference count of /@color@/
-- 
-- /Since: 3.0/
symbolicColorRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color@/: a t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
    -> m SymbolicColor
    -- ^ __Returns:__ the same /@color@/
symbolicColorRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> m SymbolicColor
symbolicColorRef SymbolicColor
color = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    Ptr SymbolicColor
result <- Ptr SymbolicColor -> IO (Ptr SymbolicColor)
gtk_symbolic_color_ref Ptr SymbolicColor
color'
    Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorRef" Ptr SymbolicColor
result
    SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor) Ptr SymbolicColor
result
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'

#if defined(ENABLE_OVERLOADING)
data SymbolicColorRefMethodInfo
instance (signature ~ (m SymbolicColor), MonadIO m) => O.OverloadedMethod SymbolicColorRefMethodInfo SymbolicColor signature where
    overloadedMethod = symbolicColorRef

instance O.OverloadedMethodInfo SymbolicColorRefMethodInfo SymbolicColor where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Structs.SymbolicColor.symbolicColorRef",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-SymbolicColor.html#v:symbolicColorRef"
        }


#endif

-- method SymbolicColor::resolve
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "color"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSymbolicColor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleProperties" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "#GtkStyleProperties to use when resolving\n   named colors, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "resolved_color"
--           , argType = TInterface Name { namespace = "Gdk" , name = "RGBA" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the resolved color"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_resolve" gtk_symbolic_color_resolve :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    Ptr Gtk.StyleProperties.StyleProperties -> -- props : TInterface (Name {namespace = "Gtk", name = "StyleProperties"})
    Ptr Gdk.RGBA.RGBA ->                    -- resolved_color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO CInt

{-# DEPRECATED symbolicColorResolve ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | If /@color@/ is resolvable, /@resolvedColor@/ will be filled in
-- with the resolved color, and 'P.True' will be returned. Generally,
-- if /@color@/ can’t be resolved, it is due to it being defined on
-- top of a named color that doesn’t exist in /@props@/.
-- 
-- When /@props@/ is 'P.Nothing', resolving of named colors will fail, so if
-- your /@color@/ is or references such a color, this function will
-- return 'P.False'.
-- 
-- /Since: 3.0/
symbolicColorResolve ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleProperties.IsStyleProperties a) =>
    SymbolicColor
    -- ^ /@color@/: a t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
    -> Maybe (a)
    -- ^ /@props@/: t'GI.Gtk.Objects.StyleProperties.StyleProperties' to use when resolving
    --    named colors, or 'P.Nothing'
    -> m ((Bool, Gdk.RGBA.RGBA))
    -- ^ __Returns:__ 'P.True' if the color has been resolved
symbolicColorResolve :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
SymbolicColor -> Maybe a -> m (Bool, RGBA)
symbolicColorResolve SymbolicColor
color Maybe a
props = IO (Bool, RGBA) -> m (Bool, RGBA)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, RGBA) -> m (Bool, RGBA))
-> IO (Bool, RGBA) -> m (Bool, RGBA)
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    Ptr StyleProperties
maybeProps <- case Maybe a
props of
        Maybe a
Nothing -> Ptr StyleProperties -> IO (Ptr StyleProperties)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleProperties
forall a. Ptr a
nullPtr
        Just a
jProps -> do
            Ptr StyleProperties
jProps' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jProps
            Ptr StyleProperties -> IO (Ptr StyleProperties)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleProperties
jProps'
    Ptr RGBA
resolvedColor <- Int -> IO (Ptr RGBA)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Gdk.RGBA.RGBA)
    CInt
result <- Ptr SymbolicColor -> Ptr StyleProperties -> Ptr RGBA -> IO CInt
gtk_symbolic_color_resolve Ptr SymbolicColor
color' Ptr StyleProperties
maybeProps Ptr RGBA
resolvedColor
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    RGBA
resolvedColor' <- ((ManagedPtr RGBA -> RGBA) -> Ptr RGBA -> IO RGBA
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RGBA -> RGBA
Gdk.RGBA.RGBA) Ptr RGBA
resolvedColor
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
props a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    (Bool, RGBA) -> IO (Bool, RGBA)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', RGBA
resolvedColor')

#if defined(ENABLE_OVERLOADING)
data SymbolicColorResolveMethodInfo
instance (signature ~ (Maybe (a) -> m ((Bool, Gdk.RGBA.RGBA))), MonadIO m, Gtk.StyleProperties.IsStyleProperties a) => O.OverloadedMethod SymbolicColorResolveMethodInfo SymbolicColor signature where
    overloadedMethod = symbolicColorResolve

instance O.OverloadedMethodInfo SymbolicColorResolveMethodInfo SymbolicColor where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Structs.SymbolicColor.symbolicColorResolve",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-SymbolicColor.html#v:symbolicColorResolve"
        }


#endif

-- method SymbolicColor::to_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "color"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "SymbolicColor" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "color to convert to a string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_symbolic_color_to_string" gtk_symbolic_color_to_string :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    IO CString

{-# DEPRECATED symbolicColorToString ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Converts the given /@color@/ to a string representation. This is useful
-- both for debugging and for serialization of strings. The format of
-- the string may change between different versions of GTK, but it is
-- guaranteed that the GTK css parser is able to read the string and
-- create the same symbolic color from it.
symbolicColorToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color@/: color to convert to a string
    -> m T.Text
    -- ^ __Returns:__ a new string representing /@color@/
symbolicColorToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> m Text
symbolicColorToString SymbolicColor
color = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    CString
result <- Ptr SymbolicColor -> IO CString
gtk_symbolic_color_to_string Ptr SymbolicColor
color'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"symbolicColorToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SymbolicColorToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod SymbolicColorToStringMethodInfo SymbolicColor signature where
    overloadedMethod = symbolicColorToString

instance O.OverloadedMethodInfo SymbolicColorToStringMethodInfo SymbolicColor where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Structs.SymbolicColor.symbolicColorToString",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-SymbolicColor.html#v:symbolicColorToString"
        }


#endif

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

foreign import ccall "gtk_symbolic_color_unref" gtk_symbolic_color_unref :: 
    Ptr SymbolicColor ->                    -- color : TInterface (Name {namespace = "Gtk", name = "SymbolicColor"})
    IO ()

{-# DEPRECATED symbolicColorUnref ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
-- | Decreases the reference count of /@color@/, freeing its memory if the
-- reference count reaches 0.
-- 
-- /Since: 3.0/
symbolicColorUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SymbolicColor
    -- ^ /@color@/: a t'GI.Gtk.Structs.SymbolicColor.SymbolicColor'
    -> m ()
symbolicColorUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SymbolicColor -> m ()
symbolicColorUnref SymbolicColor
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 SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
    Ptr SymbolicColor -> IO ()
gtk_symbolic_color_unref Ptr SymbolicColor
color'
    SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SymbolicColorUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod SymbolicColorUnrefMethodInfo SymbolicColor signature where
    overloadedMethod = symbolicColorUnref

instance O.OverloadedMethodInfo SymbolicColorUnrefMethodInfo SymbolicColor where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Structs.SymbolicColor.symbolicColorUnref",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-SymbolicColor.html#v:symbolicColorUnref"
        }


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSymbolicColorMethod (t :: Symbol) (o :: *) :: * where
    ResolveSymbolicColorMethod "ref" o = SymbolicColorRefMethodInfo
    ResolveSymbolicColorMethod "resolve" o = SymbolicColorResolveMethodInfo
    ResolveSymbolicColorMethod "toString" o = SymbolicColorToStringMethodInfo
    ResolveSymbolicColorMethod "unref" o = SymbolicColorUnrefMethodInfo
    ResolveSymbolicColorMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif