Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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 # | |
GObject Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
ManagedPtrNewtype Plug Source # | |
Defined in GI.Gtk.Objects.Plug toManagedPtr :: Plug -> ManagedPtr Plug | |
TypedObject Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
HasParentTypes Plug Source # | |
Defined in GI.Gtk.Objects.Plug | |
IsGValue (Maybe Plug) Source # | Convert |
Defined in GI.Gtk.Objects.Plug gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Plug -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Plug) | |
type ParentTypes Plug Source # | |
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
Click to display all available methods, including inherited ones
Methods
activate, activateDefault, activateFocus, activateKey, add, addAccelGroup, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonic, addMnemonicLabel, addTickCallback, beginMoveDrag, beginResizeDrag, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, close, computeExpand, construct, constructChild, constructForDisplay, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, deiconify, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasGroup, hasRcStyle, hasScreen, hasToplevelFocus, hasVisibleFocus, hide, hideOnDelete, iconify, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isActive, isAncestor, isComposited, isDrawable, isFloating, isFocus, isMaximized, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, maximize, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, move, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parseGeometry, parserFinished, path, present, presentWithTime, propagateDraw, propagateKeyEvent, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelGroup, removeAccelerator, removeMnemonic, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, reshowWithInitialSize, resize, resizeChildren, resizeGripIsVisible, resizeToGeometry, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, stick, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, unstick, watchClosure.
Getters
getAcceptFocus, getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getApplication, getAttachedTo, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDecorated, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEmbedded, getEvents, getFocus, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusOnMap, getFocusVadjustment, getFocusVisible, getFontMap, getFontOptions, getFrameClock, getGravity, getGroup, getHalign, getHasResizeGrip, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getHideTitlebarWhenMaximized, getIcon, getIconList, getIconName, getId, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMnemonicModifier, getMnemonicsVisible, getModal, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPosition, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizable, getResizeGripArea, getResizeMode, getRole, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSize, getSizeRequest, getSkipPagerHint, getSkipTaskbarHint, getSocketWindow, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getTransientFor, getTypeHint, getUrgencyHint, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow, getWindowType.
Setters
setAccelPath, setAcceptFocus, setAllocation, setAppPaintable, setApplication, setAttachedTo, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDecorated, setDefault, setDefaultGeometry, setDefaultSize, setDeletable, setDestroyWithParent, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocus, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusOnMap, setFocusVadjustment, setFocusVisible, setFontMap, setFontOptions, setGeometryHints, setGravity, setHalign, setHasResizeGrip, setHasTooltip, setHasUserRefCount, setHasWindow, setHexpand, setHexpandSet, setHideTitlebarWhenMaximized, setIcon, setIconFromFile, setIconList, setIconName, setKeepAbove, setKeepBelow, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setMnemonicModifier, setMnemonicsVisible, setModal, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setPosition, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizable, setResizeMode, setRole, setScreen, setSensitive, setSizeRequest, setSkipPagerHint, setSkipTaskbarHint, setStartupId, setState, setStateFlags, setStyle, setSupportMultidevice, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTooltipWindow, setTransientFor, setTypeHint, setUrgencyHint, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow, setWmclass.
construct
:: (HasCallStack, MonadIO m, IsPlug a) | |
=> a |
|
-> CULong |
|
-> m () |
constructForDisplay
plugConstructForDisplay Source #
:: (HasCallStack, MonadIO m, IsPlug a, IsDisplay b) | |
=> a |
|
-> b | |
-> CULong |
|
-> m () |
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