| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/window.h> |
| 18 |
#include <gtk/gtkx.h> //Necessary for the X11 Window type. |
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/window_p.h) |
| 21 |
|
| 22 |
//This file is used only on systems with the X11 backend. |
| 23 |
_INCLUDE_IN_WRAP_INIT(gdkmmconfig.h)dnl // If GDKMM_X11_BACKEND_ENABLED is defined, it's defined here. |
| 24 |
_GMMPROC_WRAP_CONDITIONALLY(ifdef GDKMM_X11_BACKEND_ENABLED) |
| 25 |
|
| 26 |
namespace Gtk |
| 27 |
{ |
| 28 |
|
| 29 |
//Note that Window (not Gtk::Window) is the (awfully named) type from the X11 header. |
| 30 |
//gtkx.h (needed to get GtkPlug and GtkSocket) pulls this in, |
| 31 |
//assuming that you will be careful when doing so. |
| 32 |
|
| 33 |
/** Toplevel for embedding into other processes. |
| 34 |
* |
| 35 |
* Together with Gtk::Socket, Gtk::Plug provides the ability to embed |
| 36 |
* widgets from one process into another process in a fashion that is |
| 37 |
* transparent to the user. One process creates a Gtk::Socket widget |
| 38 |
* and passes the ID of that widget's window to the other process, |
| 39 |
* which then creates a Gtk::Plug with that window ID. Any widgets |
| 40 |
* contained in the Gtk::Plug then will appear inside the first |
| 41 |
* application's window. |
| 42 |
* |
| 43 |
* The communication between a Gtk::Socket and a Gtk::Plug follows the |
| 44 |
* XEmbed protocol. This protocol has also been implemented in other toolkits, |
| 45 |
* e.g. Qt, allowing the same level of |
| 46 |
* integration when embedding a Qt widget |
| 47 |
* in GTK+ or vice versa. |
| 48 |
* |
| 49 |
* @note |
| 50 |
* The Gtk::Plug and Gtk::Socket widgets are only available when GTK+ and gtkmm |
| 51 |
* are compiled for the X11 platform and %GDK_WINDOWING_X11 is defined. |
| 52 |
* They can only be used on a GdkX11Display. |
| 53 |
*/ |
| 54 |
class GTKMM_API Plug : public Window |
| 55 |
{ |
| 56 |
_CLASS_GTKOBJECT(Plug, GtkPlug, GTK_PLUG, Gtk::Window, GtkWindow, , , GTKMM_API) |
| 57 |
_UNMANAGEABLE |
| 58 |
_IGNORE(gtk_plug_construct, gtk_plug_construct_for_display) |
| 59 |
public: |
| 60 |
Plug(); |
| 61 |
|
| 62 |
#m4 _CONVERSION(`Window', `::Window', `($3)') |
| 63 |
#m4 _CONVERSION(`::Window', `Window', `($3)') |
| 64 |
explicit Plug(::Window socket_id); |
| 65 |
Plug(const Glib::RefPtr<Gdk::Display>& display, ::Window socket_id); |
| 66 |
|
| 67 |
_WRAP_METHOD(::Window get_id() const, gtk_plug_get_id) |
| 68 |
|
| 69 |
_WRAP_METHOD(bool get_embedded() const, gtk_plug_get_embedded) |
| 70 |
|
| 71 |
_WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_socket_window(), gtk_plug_get_socket_window, refreturn) |
| 72 |
_WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_socket_window() const, gtk_plug_get_socket_window, refreturn, constversion) |
| 73 |
|
| 74 |
_WRAP_PROPERTY("embedded", bool) |
| 75 |
_WRAP_PROPERTY("socket-window", Glib::RefPtr<Gdk::Window>) |
| 76 |
|
| 77 |
_WRAP_SIGNAL(void embedded(), "embedded") |
| 78 |
}; |
| 79 |
|
| 80 |
} //namespace Gtk |