{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.Tooltip
(
Tooltip(..) ,
IsTooltip ,
toTooltip ,
noTooltip ,
#if defined(ENABLE_OVERLOADING)
ResolveTooltipMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TooltipSetCustomMethodInfo ,
#endif
tooltipSetCustom ,
#if defined(ENABLE_OVERLOADING)
TooltipSetIconMethodInfo ,
#endif
tooltipSetIcon ,
#if defined(ENABLE_OVERLOADING)
TooltipSetIconFromGiconMethodInfo ,
#endif
tooltipSetIconFromGicon ,
#if defined(ENABLE_OVERLOADING)
TooltipSetIconFromIconNameMethodInfo ,
#endif
tooltipSetIconFromIconName ,
#if defined(ENABLE_OVERLOADING)
TooltipSetIconFromStockMethodInfo ,
#endif
tooltipSetIconFromStock ,
#if defined(ENABLE_OVERLOADING)
TooltipSetMarkupMethodInfo ,
#endif
tooltipSetMarkup ,
#if defined(ENABLE_OVERLOADING)
TooltipSetTextMethodInfo ,
#endif
tooltipSetText ,
#if defined(ENABLE_OVERLOADING)
TooltipSetTipAreaMethodInfo ,
#endif
tooltipSetTipArea ,
tooltipTriggerTooltipQuery ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype Tooltip = Tooltip (ManagedPtr Tooltip)
deriving (Tooltip -> Tooltip -> Bool
(Tooltip -> Tooltip -> Bool)
-> (Tooltip -> Tooltip -> Bool) -> Eq Tooltip
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tooltip -> Tooltip -> Bool
$c/= :: Tooltip -> Tooltip -> Bool
== :: Tooltip -> Tooltip -> Bool
$c== :: Tooltip -> Tooltip -> Bool
Eq)
foreign import ccall "gtk_tooltip_get_type"
c_gtk_tooltip_get_type :: IO GType
instance GObject Tooltip where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_tooltip_get_type
instance B.GValue.IsGValue Tooltip where
toGValue :: Tooltip -> IO GValue
toGValue o :: Tooltip
o = do
GType
gtype <- IO GType
c_gtk_tooltip_get_type
Tooltip -> (Ptr Tooltip -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Tooltip
o (GType
-> (GValue -> Ptr Tooltip -> IO ()) -> Ptr Tooltip -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Tooltip -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Tooltip
fromGValue gv :: GValue
gv = do
Ptr Tooltip
ptr <- GValue -> IO (Ptr Tooltip)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Tooltip)
(ManagedPtr Tooltip -> Tooltip) -> Ptr Tooltip -> IO Tooltip
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Tooltip -> Tooltip
Tooltip Ptr Tooltip
ptr
class (GObject o, O.IsDescendantOf Tooltip o) => IsTooltip o
instance (GObject o, O.IsDescendantOf Tooltip o) => IsTooltip o
instance O.HasParentTypes Tooltip
type instance O.ParentTypes Tooltip = '[GObject.Object.Object]
toTooltip :: (MonadIO m, IsTooltip o) => o -> m Tooltip
toTooltip :: o -> m Tooltip
toTooltip = IO Tooltip -> m Tooltip
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Tooltip -> m Tooltip) -> (o -> IO Tooltip) -> o -> m Tooltip
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Tooltip -> Tooltip) -> o -> IO Tooltip
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Tooltip -> Tooltip
Tooltip
noTooltip :: Maybe Tooltip
noTooltip :: Maybe Tooltip
noTooltip = Maybe Tooltip
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTooltipMethod (t :: Symbol) (o :: *) :: * where
ResolveTooltipMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTooltipMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTooltipMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTooltipMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTooltipMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTooltipMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTooltipMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTooltipMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTooltipMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTooltipMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTooltipMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTooltipMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTooltipMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTooltipMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTooltipMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTooltipMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTooltipMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTooltipMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTooltipMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTooltipMethod "setCustom" o = TooltipSetCustomMethodInfo
ResolveTooltipMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTooltipMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTooltipMethod "setIcon" o = TooltipSetIconMethodInfo
ResolveTooltipMethod "setIconFromGicon" o = TooltipSetIconFromGiconMethodInfo
ResolveTooltipMethod "setIconFromIconName" o = TooltipSetIconFromIconNameMethodInfo
ResolveTooltipMethod "setIconFromStock" o = TooltipSetIconFromStockMethodInfo
ResolveTooltipMethod "setMarkup" o = TooltipSetMarkupMethodInfo
ResolveTooltipMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTooltipMethod "setText" o = TooltipSetTextMethodInfo
ResolveTooltipMethod "setTipArea" o = TooltipSetTipAreaMethodInfo
ResolveTooltipMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTooltipMethod t Tooltip, O.MethodInfo info Tooltip p) => OL.IsLabel t (Tooltip -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Tooltip
type instance O.AttributeList Tooltip = TooltipAttributeList
type TooltipAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Tooltip = TooltipSignalList
type TooltipSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_tooltip_set_custom" gtk_tooltip_set_custom ::
Ptr Tooltip ->
Ptr Gtk.Widget.Widget ->
IO ()
tooltipSetCustom ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a, Gtk.Widget.IsWidget b) =>
a
-> Maybe (b)
-> m ()
tooltipSetCustom :: a -> Maybe b -> m ()
tooltipSetCustom tooltip :: a
tooltip customWidget :: Maybe b
customWidget = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr Widget
maybeCustomWidget <- case Maybe b
customWidget of
Nothing -> Ptr Widget -> IO (Ptr Widget)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
forall a. Ptr a
nullPtr
Just jCustomWidget :: b
jCustomWidget -> do
Ptr Widget
jCustomWidget' <- b -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCustomWidget
Ptr Widget -> IO (Ptr Widget)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
jCustomWidget'
Ptr Tooltip -> Ptr Widget -> IO ()
gtk_tooltip_set_custom Ptr Tooltip
tooltip' Ptr Widget
maybeCustomWidget
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
customWidget b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetCustomMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsTooltip a, Gtk.Widget.IsWidget b) => O.MethodInfo TooltipSetCustomMethodInfo a signature where
overloadedMethod = tooltipSetCustom
#endif
foreign import ccall "gtk_tooltip_set_icon" gtk_tooltip_set_icon ::
Ptr Tooltip ->
Ptr GdkPixbuf.Pixbuf.Pixbuf ->
IO ()
tooltipSetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a, GdkPixbuf.Pixbuf.IsPixbuf b) =>
a
-> Maybe (b)
-> m ()
tooltipSetIcon :: a -> Maybe b -> m ()
tooltipSetIcon tooltip :: a
tooltip pixbuf :: Maybe b
pixbuf = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr Pixbuf
maybePixbuf <- case Maybe b
pixbuf of
Nothing -> Ptr Pixbuf -> IO (Ptr Pixbuf)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Pixbuf
forall a. Ptr a
nullPtr
Just jPixbuf :: b
jPixbuf -> do
Ptr Pixbuf
jPixbuf' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jPixbuf
Ptr Pixbuf -> IO (Ptr Pixbuf)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Pixbuf
jPixbuf'
Ptr Tooltip -> Ptr Pixbuf -> IO ()
gtk_tooltip_set_icon Ptr Tooltip
tooltip' Ptr Pixbuf
maybePixbuf
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
pixbuf b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetIconMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsTooltip a, GdkPixbuf.Pixbuf.IsPixbuf b) => O.MethodInfo TooltipSetIconMethodInfo a signature where
overloadedMethod = tooltipSetIcon
#endif
foreign import ccall "gtk_tooltip_set_icon_from_gicon" gtk_tooltip_set_icon_from_gicon ::
Ptr Tooltip ->
Ptr Gio.Icon.Icon ->
Int32 ->
IO ()
tooltipSetIconFromGicon ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a, Gio.Icon.IsIcon b) =>
a
-> Maybe (b)
-> Int32
-> m ()
tooltipSetIconFromGicon :: a -> Maybe b -> Int32 -> m ()
tooltipSetIconFromGicon tooltip :: a
tooltip gicon :: Maybe b
gicon size :: Int32
size = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr Icon
maybeGicon <- case Maybe b
gicon of
Nothing -> Ptr Icon -> IO (Ptr Icon)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Icon
forall a. Ptr a
nullPtr
Just jGicon :: b
jGicon -> do
Ptr Icon
jGicon' <- b -> IO (Ptr Icon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jGicon
Ptr Icon -> IO (Ptr Icon)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Icon
jGicon'
Ptr Tooltip -> Ptr Icon -> Int32 -> IO ()
gtk_tooltip_set_icon_from_gicon Ptr Tooltip
tooltip' Ptr Icon
maybeGicon Int32
size
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
gicon b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetIconFromGiconMethodInfo
instance (signature ~ (Maybe (b) -> Int32 -> m ()), MonadIO m, IsTooltip a, Gio.Icon.IsIcon b) => O.MethodInfo TooltipSetIconFromGiconMethodInfo a signature where
overloadedMethod = tooltipSetIconFromGicon
#endif
foreign import ccall "gtk_tooltip_set_icon_from_icon_name" gtk_tooltip_set_icon_from_icon_name ::
Ptr Tooltip ->
CString ->
Int32 ->
IO ()
tooltipSetIconFromIconName ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a) =>
a
-> Maybe (T.Text)
-> Int32
-> m ()
tooltipSetIconFromIconName :: a -> Maybe Text -> Int32 -> m ()
tooltipSetIconFromIconName tooltip :: a
tooltip iconName :: Maybe Text
iconName size :: Int32
size = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr CChar
maybeIconName <- case Maybe Text
iconName of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jIconName :: Text
jIconName -> do
Ptr CChar
jIconName' <- Text -> IO (Ptr CChar)
textToCString Text
jIconName
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jIconName'
Ptr Tooltip -> Ptr CChar -> Int32 -> IO ()
gtk_tooltip_set_icon_from_icon_name Ptr Tooltip
tooltip' Ptr CChar
maybeIconName Int32
size
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeIconName
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetIconFromIconNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> Int32 -> m ()), MonadIO m, IsTooltip a) => O.MethodInfo TooltipSetIconFromIconNameMethodInfo a signature where
overloadedMethod = tooltipSetIconFromIconName
#endif
foreign import ccall "gtk_tooltip_set_icon_from_stock" gtk_tooltip_set_icon_from_stock ::
Ptr Tooltip ->
CString ->
Int32 ->
IO ()
{-# DEPRECATED tooltipSetIconFromStock ["(Since version 3.10)","Use 'GI.Gtk.Objects.Tooltip.tooltipSetIconFromIconName' instead."] #-}
tooltipSetIconFromStock ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a) =>
a
-> Maybe (T.Text)
-> Int32
-> m ()
tooltipSetIconFromStock :: a -> Maybe Text -> Int32 -> m ()
tooltipSetIconFromStock tooltip :: a
tooltip stockId :: Maybe Text
stockId size :: Int32
size = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr CChar
maybeStockId <- case Maybe Text
stockId of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jStockId :: Text
jStockId -> do
Ptr CChar
jStockId' <- Text -> IO (Ptr CChar)
textToCString Text
jStockId
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jStockId'
Ptr Tooltip -> Ptr CChar -> Int32 -> IO ()
gtk_tooltip_set_icon_from_stock Ptr Tooltip
tooltip' Ptr CChar
maybeStockId Int32
size
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeStockId
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetIconFromStockMethodInfo
instance (signature ~ (Maybe (T.Text) -> Int32 -> m ()), MonadIO m, IsTooltip a) => O.MethodInfo TooltipSetIconFromStockMethodInfo a signature where
overloadedMethod = tooltipSetIconFromStock
#endif
foreign import ccall "gtk_tooltip_set_markup" gtk_tooltip_set_markup ::
Ptr Tooltip ->
CString ->
IO ()
tooltipSetMarkup ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a) =>
a
-> Maybe (T.Text)
-> m ()
tooltipSetMarkup :: a -> Maybe Text -> m ()
tooltipSetMarkup tooltip :: a
tooltip markup :: Maybe Text
markup = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr CChar
maybeMarkup <- case Maybe Text
markup of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jMarkup :: Text
jMarkup -> do
Ptr CChar
jMarkup' <- Text -> IO (Ptr CChar)
textToCString Text
jMarkup
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jMarkup'
Ptr Tooltip -> Ptr CChar -> IO ()
gtk_tooltip_set_markup Ptr Tooltip
tooltip' Ptr CChar
maybeMarkup
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeMarkup
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetMarkupMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsTooltip a) => O.MethodInfo TooltipSetMarkupMethodInfo a signature where
overloadedMethod = tooltipSetMarkup
#endif
foreign import ccall "gtk_tooltip_set_text" gtk_tooltip_set_text ::
Ptr Tooltip ->
CString ->
IO ()
tooltipSetText ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a) =>
a
-> Maybe (T.Text)
-> m ()
tooltipSetText :: a -> Maybe Text -> m ()
tooltipSetText tooltip :: a
tooltip text :: Maybe Text
text = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr CChar
maybeText <- case Maybe Text
text of
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jText :: Text
jText -> do
Ptr CChar
jText' <- Text -> IO (Ptr CChar)
textToCString Text
jText
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jText'
Ptr Tooltip -> Ptr CChar -> IO ()
gtk_tooltip_set_text Ptr Tooltip
tooltip' Ptr CChar
maybeText
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeText
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetTextMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsTooltip a) => O.MethodInfo TooltipSetTextMethodInfo a signature where
overloadedMethod = tooltipSetText
#endif
foreign import ccall "gtk_tooltip_set_tip_area" gtk_tooltip_set_tip_area ::
Ptr Tooltip ->
Ptr Gdk.Rectangle.Rectangle ->
IO ()
tooltipSetTipArea ::
(B.CallStack.HasCallStack, MonadIO m, IsTooltip a) =>
a
-> Gdk.Rectangle.Rectangle
-> m ()
tooltipSetTipArea :: a -> Rectangle -> m ()
tooltipSetTipArea tooltip :: a
tooltip rect :: Rectangle
rect = 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 Tooltip
tooltip' <- a -> IO (Ptr Tooltip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
tooltip
Ptr Rectangle
rect' <- Rectangle -> IO (Ptr Rectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rectangle
rect
Ptr Tooltip -> Ptr Rectangle -> IO ()
gtk_tooltip_set_tip_area Ptr Tooltip
tooltip' Ptr Rectangle
rect'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
tooltip
Rectangle -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rectangle
rect
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TooltipSetTipAreaMethodInfo
instance (signature ~ (Gdk.Rectangle.Rectangle -> m ()), MonadIO m, IsTooltip a) => O.MethodInfo TooltipSetTipAreaMethodInfo a signature where
overloadedMethod = tooltipSetTipArea
#endif
foreign import ccall "gtk_tooltip_trigger_tooltip_query" gtk_tooltip_trigger_tooltip_query ::
Ptr Gdk.Display.Display ->
IO ()
tooltipTriggerTooltipQuery ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
a
-> m ()
tooltipTriggerTooltipQuery :: a -> m ()
tooltipTriggerTooltipQuery display :: a
display = 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 Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
Ptr Display -> IO ()
gtk_tooltip_trigger_tooltip_query Ptr Display
display'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif