]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkplug.c
Modify the gettext translation domain for the gtk3 rename
[~andy/gtk] / gtk / gtkplug.c
index 62afd58473f217ee9f071409b18cffaabe41ffd7..52d2b925f9582ddcbf2fda10c1e275be10017e50 100644 (file)
 
 #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,
@@ -171,8 +192,7 @@ gtk_plug_class_init (GtkPlugClass *class)
    * 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"),
@@ -217,7 +237,7 @@ gtk_plug_set_is_child (GtkPlug  *plug,
        * 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);
@@ -257,7 +277,7 @@ gtk_plug_get_id (GtkPlug *plug)
 {
   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);
@@ -315,7 +335,7 @@ _gtk_plug_add_to_socket (GtkPlug   *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);
 
@@ -329,7 +349,7 @@ _gtk_plug_add_to_socket (GtkPlug   *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);
@@ -383,7 +403,7 @@ _gtk_plug_remove_from_socket (GtkPlug   *plug,
 
   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);
 
@@ -393,7 +413,7 @@ _gtk_plug_remove_from_socket (GtkPlug   *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);
@@ -429,7 +449,7 @@ _gtk_plug_remove_from_socket (GtkPlug   *plug,
 
   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_);
@@ -587,7 +607,7 @@ gtk_plug_realize (GtkWidget *widget)
   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;
@@ -688,11 +708,11 @@ gtk_plug_map (GtkWidget *widget)
       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);
@@ -712,7 +732,7 @@ gtk_plug_unmap (GtkWidget *widget)
     {
       GtkPlug *plug = GTK_PLUG (widget);
 
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+      gtk_widget_set_mapped (widget, FALSE);
 
       gdk_window_hide (widget->window);
 
@@ -738,12 +758,12 @@ gtk_plug_size_allocate (GtkWidget     *widget,
 
       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;