#include "gtkalias.h"
+/**
+ * SECTION:gtkplug
+ * @Short_description: Toplevel for embedding into other processes
+ * @Title: GtkPlug
+ * @See_also: #GtkSocket
+ *
+ * Together with #GtkSocket, #GtkPlug 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 #GtkSocket widget and passes the
+ * ID of that widget's window to the other process,
+ * which then creates a #GtkPlug with that window ID.
+ * Any widgets contained in the #GtkPlug then will appear
+ * inside the first application's window.
+ *
+ * <note>
+ * The #GtkPlug and #GtkSocket widgets are currently not available
+ * on all platforms supported by GTK+.
+ * </note>
+ */
+
static void gtk_plug_get_property (GObject *object,
guint prop_id,
GValue *value,
* GtkPlug::embedded:
* @plug: the object on which the signal was emitted
*
- * Gets emitted when the plug becomes embedded in a socket
- * and when the embedding ends.
+ * Gets emitted when the plug becomes embedded in a socket.
*/
plug_signals[EMBEDDED] =
g_signal_new (I_("embedded"),
* here, but don't bother remapping -- we will get mapped
* by gtk_widget_set_parent ().
*/
- if (GTK_WIDGET_MAPPED (plug))
+ if (gtk_widget_get_mapped (GTK_WIDGET (plug)))
gtk_widget_unmap (GTK_WIDGET (plug));
_gtk_window_set_is_toplevel (GTK_WINDOW (plug), FALSE);
{
g_return_val_if_fail (GTK_IS_PLUG (plug), 0);
- if (!GTK_WIDGET_REALIZED (plug))
+ if (!gtk_widget_get_realized (GTK_WIDGET (plug)))
gtk_widget_realize (GTK_WIDGET (plug));
return _gtk_plug_windowing_get_id (plug);
g_return_if_fail (GTK_IS_PLUG (plug));
g_return_if_fail (GTK_IS_SOCKET (socket_));
- g_return_if_fail (GTK_WIDGET_REALIZED (socket_));
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (socket_)));
widget = GTK_WIDGET (plug);
g_signal_emit (plug, plug_signals[EMBEDDED], 0);
g_object_notify (G_OBJECT (plug), "embedded");
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &w, &h);
gdk_window_reparent (widget->window, plug->socket_window, -w, -h);
g_return_if_fail (GTK_IS_PLUG (plug));
g_return_if_fail (GTK_IS_SOCKET (socket_));
- g_return_if_fail (GTK_WIDGET_REALIZED (plug));
+ g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (plug)));
widget = GTK_WIDGET (plug);
g_object_ref (plug);
g_object_ref (socket_);
- widget_was_visible = GTK_WIDGET_VISIBLE (plug);
+ widget_was_visible = gtk_widget_get_visible (widget);
gdk_window_hide (widget->window);
GTK_PRIVATE_SET_FLAG (plug, GTK_IN_REPARENT);
g_object_unref (plug);
- if (widget_was_visible && GTK_WIDGET_VISIBLE (socket_))
+ if (widget_was_visible && gtk_widget_get_visible (GTK_WIDGET (socket_)))
gtk_widget_queue_resize (GTK_WIDGET (socket_));
g_object_unref (socket_);
GdkWindowAttr attributes;
gint attributes_mask;
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD; /* XXX GDK_WINDOW_PLUG ? */
attributes.title = window->title;
GtkBin *bin = GTK_BIN (widget);
GtkPlug *plug = GTK_PLUG (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+ gtk_widget_set_mapped (widget, TRUE);
if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
- !GTK_WIDGET_MAPPED (bin->child))
+ gtk_widget_get_visible (bin->child) &&
+ !gtk_widget_get_mapped (bin->child))
gtk_widget_map (bin->child);
_gtk_plug_windowing_map_toplevel (plug);
{
GtkPlug *plug = GTK_PLUG (widget);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+ gtk_widget_set_mapped (widget, FALSE);
gdk_window_hide (widget->window);
widget->allocation = *allocation;
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkAllocation child_allocation;