gi-gtk-3.0.32: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Plug

Description

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

Exported types

newtype Plug Source #

Memory-managed wrapper type.

Constructors

Plug (ManagedPtr Plug) 

Instances

Instances details
Eq Plug Source # 
Instance details

Defined in GI.Gtk.Objects.Plug

Methods

(==) :: Plug -> Plug -> Bool #

(/=) :: Plug -> Plug -> Bool #

IsGValue Plug Source #

Convert Plug to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Plug

GObject Plug Source # 
Instance details

Defined in GI.Gtk.Objects.Plug

Methods

gobjectType :: IO GType #

HasParentTypes Plug Source # 
Instance details

Defined in GI.Gtk.Objects.Plug

type ParentTypes Plug Source # 
Instance details

Defined in GI.Gtk.Objects.Plug

class (GObject o, IsDescendantOf Plug o) => IsPlug o Source #

Type class for types which can be safely cast to Plug, for instance with toPlug.

Instances

Instances details
(GObject o, IsDescendantOf Plug o) => IsPlug o Source # 
Instance details

Defined in GI.Gtk.Objects.Plug

toPlug :: (MonadIO m, IsPlug o) => o -> m Plug Source #

Cast to Plug, for types for which this is known to be safe. For general casts, use castTo.

noPlug :: Maybe Plug Source #

A convenience alias for Nothing :: Maybe Plug.

Methods

Overloaded methods

construct

plugConstruct Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlug a) 
=> a

plug: a Plug.

-> CULong

socketId: the XID of the socket’s window.

-> m () 

Finish the initialization of plug for a given Socket identified by socketId. This function will generally only be used by classes deriving from Plug.

constructForDisplay

plugConstructForDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlug a, IsDisplay b) 
=> a

plug: a Plug.

-> b

display: the Display associated with socketId’s Socket.

-> CULong

socketId: the XID of the socket’s window.

-> m () 

Finish the initialization of plug for a given Socket identified by socketId which is currently displayed on display. This function will generally only be used by classes deriving from Plug.

Since: 2.2

getEmbedded

plugGetEmbedded Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlug a) 
=> a

plug: a Plug

-> m Bool

Returns: True if the plug is embedded in a socket

Determines whether the plug is embedded in a socket.

Since: 2.14

getId

plugGetId Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlug a) 
=> a

plug: a Plug.

-> 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

plugGetSocketWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlug a) 
=> a

plug: a Plug

-> m (Maybe Window)

Returns: the window of the socket, or Nothing

Retrieves the socket the plug is embedded in.

Since: 2.14

new

plugNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> CULong

socketId: the window ID of the socket, or 0.

-> m Plug

Returns: the new Plug widget.

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

plugNewForDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the Display on which socketId is displayed

-> CULong

socketId: the XID of the socket’s window.

-> m Plug

Returns: the new Plug widget.

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

mk_PlugEmbeddedCallback :: C_PlugEmbeddedCallback -> IO (FunPtr C_PlugEmbeddedCallback) Source #

Generate a function pointer callable from C code, from a C_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