Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Together with Socket
, Plug
provides the ability to embed
widgets from one process into another process in a fashion that is
transparent to the user. One process creates a Socket
widget
and passes the ID of that widget’s window to the other process,
which then creates a Plug
with that window ID. Any widgets
contained in the Plug
then will appear inside the first
application’s window.
The communication between a Socket
and a Plug
follows the
XEmbed Protocol.
This protocol has also been implemented in other toolkits, e.g. Qt,
allowing the same level of integration when embedding a Qt widget
in GTK+ or vice versa.
The Plug
and Socket
widgets are only available when GTK+
is compiled for the X11 platform and GDK_WINDOWING_X11
is defined.
They can only be used on a GdkX11Display
. To use Plug
and
Socket
, you need to include the gtk/gtkx.h
header.
- newtype Plug = Plug (ManagedPtr Plug)
- class GObject o => IsPlug o
- toPlug :: IsPlug o => o -> IO Plug
- noPlug :: Maybe Plug
- data PlugConstructMethodInfo
- plugConstruct :: (HasCallStack, MonadIO m, IsPlug a) => a -> CULong -> m ()
- data PlugConstructForDisplayMethodInfo
- plugConstructForDisplay :: (HasCallStack, MonadIO m, IsPlug a, IsDisplay b) => a -> b -> CULong -> m ()
- data PlugGetEmbeddedMethodInfo
- plugGetEmbedded :: (HasCallStack, MonadIO m, IsPlug a) => a -> m Bool
- data PlugGetIdMethodInfo
- plugGetId :: (HasCallStack, MonadIO m, IsPlug a) => a -> m CULong
- data PlugGetSocketWindowMethodInfo
- plugGetSocketWindow :: (HasCallStack, MonadIO m, IsPlug a) => a -> m (Maybe Window)
- plugNew :: (HasCallStack, MonadIO m) => CULong -> m Plug
- plugNewForDisplay :: (HasCallStack, MonadIO m, IsDisplay a) => a -> CULong -> m Plug
- data PlugEmbeddedPropertyInfo
- getPlugEmbedded :: (MonadIO m, IsPlug o) => o -> m Bool
- plugEmbedded :: AttrLabelProxy "embedded"
- data PlugSocketWindowPropertyInfo
- getPlugSocketWindow :: (MonadIO m, IsPlug o) => o -> m (Maybe Window)
- plugSocketWindow :: AttrLabelProxy "socketWindow"
- type C_PlugEmbeddedCallback = Ptr () -> Ptr () -> IO ()
- type PlugEmbeddedCallback = IO ()
- data PlugEmbeddedSignalInfo
- afterPlugEmbedded :: (GObject a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId
- genClosure_PlugEmbedded :: PlugEmbeddedCallback -> IO Closure
- mk_PlugEmbeddedCallback :: C_PlugEmbeddedCallback -> IO (FunPtr C_PlugEmbeddedCallback)
- noPlugEmbeddedCallback :: Maybe PlugEmbeddedCallback
- onPlugEmbedded :: (GObject a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId
- wrap_PlugEmbeddedCallback :: PlugEmbeddedCallback -> Ptr () -> Ptr () -> IO ()
Exported types
GObject Plug Source # | |
IsImplementorIface Plug Source # | |
IsObject Plug Source # | |
IsWindow Plug Source # | |
IsWidget Plug Source # | |
IsContainer Plug Source # | |
IsBin Plug Source # | |
IsBuildable Plug Source # | |
IsPlug Plug Source # | |
((~) * info (ResolvePlugMethod t Plug), MethodInfo * info Plug p) => IsLabel t (Plug -> p) Source # | |
((~) * info (ResolvePlugMethod t Plug), MethodInfo * info Plug p) => IsLabelProxy t (Plug -> p) Source # | |
HasAttributeList * Plug Source # | |
type AttributeList Plug Source # | |
type SignalList Plug Source # | |
Methods
construct
data PlugConstructMethodInfo Source #
((~) * signature (CULong -> m ()), MonadIO m, IsPlug a) => MethodInfo * PlugConstructMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> CULong |
|
-> m () |
constructForDisplay
data PlugConstructForDisplayMethodInfo Source #
((~) * signature (b -> CULong -> m ()), MonadIO m, IsPlug a, IsDisplay b) => MethodInfo * PlugConstructForDisplayMethodInfo a signature Source # | |
getEmbedded
data PlugGetEmbeddedMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsPlug a) => MethodInfo * PlugGetEmbeddedMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> m Bool | Returns: |
Determines whether the plug is embedded in a socket.
Since: 2.14
getId
data PlugGetIdMethodInfo Source #
((~) * signature (m CULong), MonadIO m, IsPlug a) => MethodInfo * PlugGetIdMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> m CULong | Returns: the window ID for the plug |
Gets the window ID of a Plug
widget, which can then
be used to embed this window inside another window, for
instance with socketAddId
.
getSocketWindow
data PlugGetSocketWindowMethodInfo Source #
((~) * signature (m (Maybe Window)), MonadIO m, IsPlug a) => MethodInfo * PlugGetSocketWindowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> m (Maybe Window) | Returns: the window of the socket, or |
Retrieves the socket the plug is embedded in.
Since: 2.14
new
:: (HasCallStack, MonadIO m) | |
=> CULong |
|
-> m Plug | Returns: the new |
Creates a new plug widget inside the Socket
identified
by socketId
. If socketId
is 0, the plug is left “unplugged” and
can later be plugged into a Socket
by socketAddId
.
newForDisplay
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> CULong |
|
-> m Plug | Returns: the new |
Create a new plug widget inside the Socket
identified by socket_id.
Since: 2.2
Properties
embedded
data PlugEmbeddedPropertyInfo Source #
plugEmbedded :: AttrLabelProxy "embedded" Source #
socketWindow
data PlugSocketWindowPropertyInfo Source #
plugSocketWindow :: AttrLabelProxy "socketWindow" Source #
Signals
embedded
type PlugEmbeddedCallback = IO () Source #
afterPlugEmbedded :: (GObject a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId Source #
onPlugEmbedded :: (GObject a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId Source #
wrap_PlugEmbeddedCallback :: PlugEmbeddedCallback -> Ptr () -> Ptr () -> IO () Source #