{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.SymbolicColor
(
SymbolicColor(..) ,
noSymbolicColor ,
#if defined(ENABLE_OVERLOADING)
ResolveSymbolicColorMethod ,
#endif
symbolicColorNewAlpha ,
symbolicColorNewLiteral ,
symbolicColorNewMix ,
symbolicColorNewName ,
symbolicColorNewShade ,
symbolicColorNewWin32 ,
#if defined(ENABLE_OVERLOADING)
SymbolicColorRefMethodInfo ,
#endif
symbolicColorRef ,
#if defined(ENABLE_OVERLOADING)
SymbolicColorResolveMethodInfo ,
#endif
symbolicColorResolve ,
#if defined(ENABLE_OVERLOADING)
SymbolicColorToStringMethodInfo ,
#endif
symbolicColorToString ,
#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.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.Gdk.Structs.RGBA as Gdk.RGBA
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleProperties as Gtk.StyleProperties
newtype SymbolicColor = SymbolicColor (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)
foreign import ccall "gtk_symbolic_color_get_type" c_gtk_symbolic_color_get_type ::
IO GType
instance BoxedObject SymbolicColor where
boxedType :: SymbolicColor -> IO GType
boxedType _ = IO GType
c_gtk_symbolic_color_get_type
instance B.GValue.IsGValue SymbolicColor where
toGValue :: SymbolicColor -> IO GValue
toGValue o :: SymbolicColor
o = do
GType
gtype <- IO GType
c_gtk_symbolic_color_get_type
SymbolicColor -> (Ptr SymbolicColor -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SymbolicColor
o (GType
-> (GValue -> Ptr SymbolicColor -> IO ())
-> Ptr SymbolicColor
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr SymbolicColor -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO SymbolicColor
fromGValue gv :: GValue
gv = do
Ptr SymbolicColor
ptr <- GValue -> IO (Ptr SymbolicColor)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr SymbolicColor)
(ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr SymbolicColor -> SymbolicColor
SymbolicColor Ptr SymbolicColor
ptr
noSymbolicColor :: Maybe SymbolicColor
noSymbolicColor :: Maybe SymbolicColor
noSymbolicColor = Maybe SymbolicColor
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SymbolicColor
type instance O.AttributeList SymbolicColor = SymbolicColorAttributeList
type SymbolicColorAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_symbolic_color_new_alpha" gtk_symbolic_color_new_alpha ::
Ptr SymbolicColor ->
CDouble ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewAlpha ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewAlpha ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> Double
-> m SymbolicColor
symbolicColorNewAlpha :: SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewAlpha color :: SymbolicColor
color factor :: 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 "symbolicColorNewAlpha" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_new_literal" gtk_symbolic_color_new_literal ::
Ptr Gdk.RGBA.RGBA ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewLiteral ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewLiteral ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gdk.RGBA.RGBA
-> m SymbolicColor
symbolicColorNewLiteral :: RGBA -> m SymbolicColor
symbolicColorNewLiteral color :: 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 "symbolicColorNewLiteral" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_new_mix" gtk_symbolic_color_new_mix ::
Ptr SymbolicColor ->
Ptr SymbolicColor ->
CDouble ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewMix ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewMix ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> SymbolicColor
-> Double
-> m SymbolicColor
symbolicColorNewMix :: SymbolicColor -> SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewMix color1 :: SymbolicColor
color1 color2 :: SymbolicColor
color2 factor :: 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 "symbolicColorNewMix" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_new_name" gtk_symbolic_color_new_name ::
CString ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewName ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewName ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m SymbolicColor
symbolicColorNewName :: Text -> m SymbolicColor
symbolicColorNewName name :: 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 "symbolicColorNewName" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_new_shade" gtk_symbolic_color_new_shade ::
Ptr SymbolicColor ->
CDouble ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewShade ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewShade ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> Double
-> m SymbolicColor
symbolicColorNewShade :: SymbolicColor -> Double -> m SymbolicColor
symbolicColorNewShade color :: SymbolicColor
color factor :: 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 "symbolicColorNewShade" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_new_win32" gtk_symbolic_color_new_win32 ::
CString ->
Int32 ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorNewWin32 ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorNewWin32 ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Int32
-> m SymbolicColor
symbolicColorNewWin32 :: Text -> Int32 -> m SymbolicColor
symbolicColorNewWin32 themeClass :: Text
themeClass id :: 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 "symbolicColorNewWin32" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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
foreign import ccall "gtk_symbolic_color_ref" gtk_symbolic_color_ref ::
Ptr SymbolicColor ->
IO (Ptr SymbolicColor)
{-# DEPRECATED symbolicColorRef ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> m SymbolicColor
symbolicColorRef :: SymbolicColor -> m SymbolicColor
symbolicColorRef color :: 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 "symbolicColorRef" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject 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.MethodInfo SymbolicColorRefMethodInfo SymbolicColor signature where
overloadedMethod = symbolicColorRef
#endif
foreign import ccall "gtk_symbolic_color_resolve" gtk_symbolic_color_resolve ::
Ptr SymbolicColor ->
Ptr Gtk.StyleProperties.StyleProperties ->
Ptr Gdk.RGBA.RGBA ->
IO CInt
{-# DEPRECATED symbolicColorResolve ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorResolve ::
(B.CallStack.HasCallStack, MonadIO m, Gtk.StyleProperties.IsStyleProperties a) =>
SymbolicColor
-> Maybe (a)
-> m ((Bool, Gdk.RGBA.RGBA))
symbolicColorResolve :: SymbolicColor -> Maybe a -> m (Bool, RGBA)
symbolicColorResolve color :: SymbolicColor
color props :: 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
Nothing -> Ptr StyleProperties -> IO (Ptr StyleProperties)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleProperties
forall a. Ptr a
nullPtr
Just jProps :: 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. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 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
/= 0) CInt
result
RGBA
resolvedColor' <- ((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
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.MethodInfo SymbolicColorResolveMethodInfo SymbolicColor signature where
overloadedMethod = symbolicColorResolve
#endif
foreign import ccall "gtk_symbolic_color_to_string" gtk_symbolic_color_to_string ::
Ptr SymbolicColor ->
IO CString
{-# DEPRECATED symbolicColorToString ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> m T.Text
symbolicColorToString :: SymbolicColor -> m Text
symbolicColorToString color :: 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 "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.MethodInfo SymbolicColorToStringMethodInfo SymbolicColor signature where
overloadedMethod = symbolicColorToString
#endif
foreign import ccall "gtk_symbolic_color_unref" gtk_symbolic_color_unref ::
Ptr SymbolicColor ->
IO ()
{-# DEPRECATED symbolicColorUnref ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
symbolicColorUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
SymbolicColor
-> m ()
symbolicColorUnref :: SymbolicColor -> m ()
symbolicColorUnref color :: 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.MethodInfo SymbolicColorUnrefMethodInfo SymbolicColor signature where
overloadedMethod = 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.MethodInfo 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
#endif