{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Interfaces.StyleProvider
(
StyleProvider(..) ,
IsStyleProvider ,
toStyleProvider ,
#if defined(ENABLE_OVERLOADING)
ResolveStyleProviderMethod ,
#endif
C_StyleProviderGtkPrivateChangedCallback,
StyleProviderGtkPrivateChangedCallback ,
#if defined(ENABLE_OVERLOADING)
StyleProviderGtkPrivateChangedSignalInfo,
#endif
afterStyleProviderGtkPrivateChanged ,
genClosure_StyleProviderGtkPrivateChanged,
mk_StyleProviderGtkPrivateChangedCallback,
noStyleProviderGtkPrivateChangedCallback,
onStyleProviderGtkPrivateChanged ,
wrap_StyleProviderGtkPrivateChangedCallback,
) 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.GObject.Objects.Object as GObject.Object
newtype StyleProvider = StyleProvider (SP.ManagedPtr StyleProvider)
deriving (StyleProvider -> StyleProvider -> Bool
(StyleProvider -> StyleProvider -> Bool)
-> (StyleProvider -> StyleProvider -> Bool) -> Eq StyleProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StyleProvider -> StyleProvider -> Bool
$c/= :: StyleProvider -> StyleProvider -> Bool
== :: StyleProvider -> StyleProvider -> Bool
$c== :: StyleProvider -> StyleProvider -> Bool
Eq)
instance SP.ManagedPtrNewtype StyleProvider where
toManagedPtr :: StyleProvider -> ManagedPtr StyleProvider
toManagedPtr (StyleProvider ManagedPtr StyleProvider
p) = ManagedPtr StyleProvider
p
foreign import ccall "gtk_style_provider_get_type"
c_gtk_style_provider_get_type :: IO B.Types.GType
instance B.Types.TypedObject StyleProvider where
glibType :: IO GType
glibType = IO GType
c_gtk_style_provider_get_type
instance B.Types.GObject StyleProvider
class (SP.GObject o, O.IsDescendantOf StyleProvider o) => IsStyleProvider o
instance (SP.GObject o, O.IsDescendantOf StyleProvider o) => IsStyleProvider o
instance O.HasParentTypes StyleProvider
type instance O.ParentTypes StyleProvider = '[GObject.Object.Object]
toStyleProvider :: (MIO.MonadIO m, IsStyleProvider o) => o -> m StyleProvider
toStyleProvider :: forall (m :: * -> *) o.
(MonadIO m, IsStyleProvider o) =>
o -> m StyleProvider
toStyleProvider = IO StyleProvider -> m StyleProvider
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO StyleProvider -> m StyleProvider)
-> (o -> IO StyleProvider) -> o -> m StyleProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr StyleProvider -> StyleProvider)
-> o -> IO StyleProvider
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr StyleProvider -> StyleProvider
StyleProvider
instance B.GValue.IsGValue (Maybe StyleProvider) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_style_provider_get_type
gvalueSet_ :: Ptr GValue -> Maybe StyleProvider -> IO ()
gvalueSet_ Ptr GValue
gv Maybe StyleProvider
P.Nothing = Ptr GValue -> Ptr StyleProvider -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr StyleProvider
forall a. Ptr a
FP.nullPtr :: FP.Ptr StyleProvider)
gvalueSet_ Ptr GValue
gv (P.Just StyleProvider
obj) = StyleProvider -> (Ptr StyleProvider -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StyleProvider
obj (Ptr GValue -> Ptr StyleProvider -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe StyleProvider)
gvalueGet_ Ptr GValue
gv = do
Ptr StyleProvider
ptr <- Ptr GValue -> IO (Ptr StyleProvider)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr StyleProvider)
if Ptr StyleProvider
ptr Ptr StyleProvider -> Ptr StyleProvider -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr StyleProvider
forall a. Ptr a
FP.nullPtr
then StyleProvider -> Maybe StyleProvider
forall a. a -> Maybe a
P.Just (StyleProvider -> Maybe StyleProvider)
-> IO StyleProvider -> IO (Maybe StyleProvider)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr StyleProvider -> StyleProvider)
-> Ptr StyleProvider -> IO StyleProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr StyleProvider -> StyleProvider
StyleProvider Ptr StyleProvider
ptr
else Maybe StyleProvider -> IO (Maybe StyleProvider)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe StyleProvider
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StyleProvider
type instance O.AttributeList StyleProvider = StyleProviderAttributeList
type StyleProviderAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveStyleProviderMethod (t :: Symbol) (o :: *) :: * where
ResolveStyleProviderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveStyleProviderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveStyleProviderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveStyleProviderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveStyleProviderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveStyleProviderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveStyleProviderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveStyleProviderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveStyleProviderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveStyleProviderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveStyleProviderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveStyleProviderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveStyleProviderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveStyleProviderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveStyleProviderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveStyleProviderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveStyleProviderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveStyleProviderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveStyleProviderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveStyleProviderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveStyleProviderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveStyleProviderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveStyleProviderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStyleProviderMethod t StyleProvider, O.OverloadedMethod info StyleProvider p) => OL.IsLabel t (StyleProvider -> 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 ~ ResolveStyleProviderMethod t StyleProvider, O.OverloadedMethod info StyleProvider p, R.HasField t StyleProvider p) => R.HasField t StyleProvider p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveStyleProviderMethod t StyleProvider, O.OverloadedMethodInfo info StyleProvider) => OL.IsLabel t (O.MethodProxy info StyleProvider) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type StyleProviderGtkPrivateChangedCallback =
IO ()
noStyleProviderGtkPrivateChangedCallback :: Maybe StyleProviderGtkPrivateChangedCallback
noStyleProviderGtkPrivateChangedCallback :: Maybe (IO ())
noStyleProviderGtkPrivateChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_StyleProviderGtkPrivateChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_StyleProviderGtkPrivateChangedCallback :: C_StyleProviderGtkPrivateChangedCallback -> IO (FunPtr C_StyleProviderGtkPrivateChangedCallback)
genClosure_StyleProviderGtkPrivateChanged :: MonadIO m => StyleProviderGtkPrivateChangedCallback -> m (GClosure C_StyleProviderGtkPrivateChangedCallback)
genClosure_StyleProviderGtkPrivateChanged :: forall (m :: * -> *).
MonadIO m =>
IO () -> m (GClosure C_StyleProviderGtkPrivateChangedCallback)
genClosure_StyleProviderGtkPrivateChanged IO ()
cb = IO (GClosure C_StyleProviderGtkPrivateChangedCallback)
-> m (GClosure C_StyleProviderGtkPrivateChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StyleProviderGtkPrivateChangedCallback)
-> m (GClosure C_StyleProviderGtkPrivateChangedCallback))
-> IO (GClosure C_StyleProviderGtkPrivateChangedCallback)
-> m (GClosure C_StyleProviderGtkPrivateChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_StyleProviderGtkPrivateChangedCallback
cb' = IO () -> C_StyleProviderGtkPrivateChangedCallback
wrap_StyleProviderGtkPrivateChangedCallback IO ()
cb
C_StyleProviderGtkPrivateChangedCallback
-> IO (FunPtr C_StyleProviderGtkPrivateChangedCallback)
mk_StyleProviderGtkPrivateChangedCallback C_StyleProviderGtkPrivateChangedCallback
cb' IO (FunPtr C_StyleProviderGtkPrivateChangedCallback)
-> (FunPtr C_StyleProviderGtkPrivateChangedCallback
-> IO (GClosure C_StyleProviderGtkPrivateChangedCallback))
-> IO (GClosure C_StyleProviderGtkPrivateChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StyleProviderGtkPrivateChangedCallback
-> IO (GClosure C_StyleProviderGtkPrivateChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_StyleProviderGtkPrivateChangedCallback ::
StyleProviderGtkPrivateChangedCallback ->
C_StyleProviderGtkPrivateChangedCallback
wrap_StyleProviderGtkPrivateChangedCallback :: IO () -> C_StyleProviderGtkPrivateChangedCallback
wrap_StyleProviderGtkPrivateChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onStyleProviderGtkPrivateChanged :: (IsStyleProvider a, MonadIO m) => a -> StyleProviderGtkPrivateChangedCallback -> m SignalHandlerId
onStyleProviderGtkPrivateChanged :: forall a (m :: * -> *).
(IsStyleProvider a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
onStyleProviderGtkPrivateChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_StyleProviderGtkPrivateChangedCallback
cb' = IO () -> C_StyleProviderGtkPrivateChangedCallback
wrap_StyleProviderGtkPrivateChangedCallback IO ()
cb
FunPtr C_StyleProviderGtkPrivateChangedCallback
cb'' <- C_StyleProviderGtkPrivateChangedCallback
-> IO (FunPtr C_StyleProviderGtkPrivateChangedCallback)
mk_StyleProviderGtkPrivateChangedCallback C_StyleProviderGtkPrivateChangedCallback
cb'
a
-> Text
-> FunPtr C_StyleProviderGtkPrivateChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"gtk-private-changed" FunPtr C_StyleProviderGtkPrivateChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterStyleProviderGtkPrivateChanged :: (IsStyleProvider a, MonadIO m) => a -> StyleProviderGtkPrivateChangedCallback -> m SignalHandlerId
afterStyleProviderGtkPrivateChanged :: forall a (m :: * -> *).
(IsStyleProvider a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
afterStyleProviderGtkPrivateChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_StyleProviderGtkPrivateChangedCallback
cb' = IO () -> C_StyleProviderGtkPrivateChangedCallback
wrap_StyleProviderGtkPrivateChangedCallback IO ()
cb
FunPtr C_StyleProviderGtkPrivateChangedCallback
cb'' <- C_StyleProviderGtkPrivateChangedCallback
-> IO (FunPtr C_StyleProviderGtkPrivateChangedCallback)
mk_StyleProviderGtkPrivateChangedCallback C_StyleProviderGtkPrivateChangedCallback
cb'
a
-> Text
-> FunPtr C_StyleProviderGtkPrivateChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"gtk-private-changed" FunPtr C_StyleProviderGtkPrivateChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data StyleProviderGtkPrivateChangedSignalInfo
instance SignalInfo StyleProviderGtkPrivateChangedSignalInfo where
type HaskellCallbackType StyleProviderGtkPrivateChangedSignalInfo = StyleProviderGtkPrivateChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_StyleProviderGtkPrivateChangedCallback cb
cb'' <- mk_StyleProviderGtkPrivateChangedCallback cb'
connectSignalFunPtr obj "gtk-private-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList StyleProvider = StyleProviderSignalList
type StyleProviderSignalList = ('[ '("gtkPrivateChanged", StyleProviderGtkPrivateChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif