Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
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.
Synopsis
- newtype Plug = Plug (ManagedPtr Plug)
- class (GObject o, IsDescendantOf Plug o) => IsPlug o
- toPlug :: (MonadIO m, IsPlug o) => o -> m Plug
- plugConstruct :: (HasCallStack, MonadIO m, IsPlug a) => a -> CULong -> m ()
- plugConstructForDisplay :: (HasCallStack, MonadIO m, IsPlug a, IsDisplay b) => a -> b -> CULong -> m ()
- plugGetEmbedded :: (HasCallStack, MonadIO m, IsPlug a) => a -> m Bool
- plugGetId :: (HasCallStack, MonadIO m, IsPlug a) => a -> m CULong
- 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
- getPlugEmbedded :: (MonadIO m, IsPlug o) => o -> m Bool
- getPlugSocketWindow :: (MonadIO m, IsPlug o) => o -> m (Maybe Window)
- type C_PlugEmbeddedCallback = Ptr () -> Ptr () -> IO ()
- type PlugEmbeddedCallback = IO ()
- afterPlugEmbedded :: (IsPlug a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId
- genClosure_PlugEmbedded :: MonadIO m => PlugEmbeddedCallback -> m (GClosure C_PlugEmbeddedCallback)
- mk_PlugEmbeddedCallback :: C_PlugEmbeddedCallback -> IO (FunPtr C_PlugEmbeddedCallback)
- noPlugEmbeddedCallback :: Maybe PlugEmbeddedCallback
- onPlugEmbedded :: (IsPlug a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId
- wrap_PlugEmbeddedCallback :: PlugEmbeddedCallback -> C_PlugEmbeddedCallback
Exported types
Memory-managed wrapper type.
Instances
Eq Plug Source # | |
IsGValue Plug Source # | Convert |
ManagedPtrNewtype Plug Source # | |
Defined in GI.Gtk.Objects.Plug toManagedPtr :: Plug -> ManagedPtr Plug # | |
TypedObject Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
GObject Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
HasParentTypes Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
type ParentTypes Plug Source # | |
Defined in GI.Gtk.Objects.Plug |
class (GObject o, IsDescendantOf Plug o) => IsPlug o Source #
Instances
(GObject o, IsDescendantOf Plug o) => IsPlug o Source # | |
Defined in GI.Gtk.Objects.Plug |
Methods
Overloaded methods
construct
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> CULong |
|
-> m () |
constructForDisplay
getEmbedded
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> m Bool | Returns: |
Determines whether the plug is embedded in a socket.
Since: 2.14
getId
:: (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
:: (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
True
if the plug is embedded in a socket.
Since: 2.12
getPlugEmbedded :: (MonadIO m, IsPlug o) => o -> m Bool Source #
Get the value of the “embedded
” property.
When overloading is enabled, this is equivalent to
get
plug #embedded
socketWindow
The window of the socket the plug is embedded in.
Since: 2.14
getPlugSocketWindow :: (MonadIO m, IsPlug o) => o -> m (Maybe Window) Source #
Get the value of the “socket-window
” property.
When overloading is enabled, this is equivalent to
get
plug #socketWindow
Signals
embedded
type C_PlugEmbeddedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PlugEmbeddedCallback = IO () Source #
Gets emitted when the plug becomes embedded in a socket.
afterPlugEmbedded :: (IsPlug a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId Source #
Connect a signal handler for the embedded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
plug #embedded callback
genClosure_PlugEmbedded :: MonadIO m => PlugEmbeddedCallback -> m (GClosure C_PlugEmbeddedCallback) Source #
Wrap the callback into a GClosure
.
mk_PlugEmbeddedCallback :: C_PlugEmbeddedCallback -> IO (FunPtr C_PlugEmbeddedCallback) Source #
Generate a function pointer callable from C code, from a C_PlugEmbeddedCallback
.
noPlugEmbeddedCallback :: Maybe PlugEmbeddedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PlugEmbeddedCallback
onPlugEmbedded :: (IsPlug a, MonadIO m) => a -> PlugEmbeddedCallback -> m SignalHandlerId Source #
Connect a signal handler for the embedded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
plug #embedded callback