forked from AuroraMiddleware/gtk
f409cd9b7f
Mon Jul 2 16:53:25 2001 Owen Taylor <otaylor@redhat.com> * gtk/xembed.h gtk/gtkplug.c gtk/gtksocket.c: For XEMBED embedding add a _XEMBED_INFO property to the client with version number and a "mapped" flags. Use the mapped flag instead of the racy MapRequestEvent * gtk/gtksocket.c: Clean up the gtk_socket_steal() code to reliably set things (when the child is a passive embedder participating in the XEMBED protocol) intead of just being a hack for embedding non-participating programs. Fix various bugs and race conditions. * gtk/gtksocket.[ch] gtk/gtkplug.[ch]: Make local embedding work by simply making the GtkSocket the gtk parent of the GtkPlug. Set a flag in this case and make the GtkPlug work like a normal container by overriding methods such as check_resize and "chaining past" GtkWindow to GtkBin. * gtk/gtkentry.c (gtk_entry_real_activate) gtk/gtkmain.c (gtk_propagate_event): Eliminate use of gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW). * gtk/gtkwidget.c (gtk_widget_get_toplevel, gtk_widget_get_ancestor): Explain why gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) might not give the expected result and recommend an alternative. * tests/testsocket.c tests/testsocket_child.c tests/testsocket_common.c tests/Makefile.am: Extended to test different type of adding plugs to sockets (local,active,passive), and to test mapping/unmapping the plug. * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Don't mark the window as destroyed until after we called _gdk_windowing_window_destroy(). (_gdk_windowing_window_destroy() may use GDK functions on the window.) * gdk/x11/gdkinput.c: Remove the check for finalization - devices can be finalized under some circumnstances. * gdk/x11/gdkinput-x11.c (gdk_input_device_new): Fix small problem with GDK_TYPE_DEVICE.
87 lines
2.5 KiB
C
87 lines
2.5 KiB
C
/* GTK - The GIMP Toolkit
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
/*
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
* files for a list of changes. These files are distributed with
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
*/
|
|
|
|
#ifndef __GTK_SOCKET_H__
|
|
#define __GTK_SOCKET_H__
|
|
|
|
#include <gtk/gtkcontainer.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#define GTK_TYPE_SOCKET (gtk_socket_get_type ())
|
|
#define GTK_SOCKET(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SOCKET, GtkSocket))
|
|
#define GTK_SOCKET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOCKET, GtkSocketClass))
|
|
#define GTK_IS_SOCKET(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SOCKET))
|
|
#define GTK_IS_SOCKET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOCKET))
|
|
#define GTK_SOCKET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SOCKET, GtkSocketClass))
|
|
|
|
|
|
typedef struct _GtkSocket GtkSocket;
|
|
typedef struct _GtkSocketClass GtkSocketClass;
|
|
|
|
struct _GtkSocket
|
|
{
|
|
GtkContainer container;
|
|
|
|
guint16 request_width;
|
|
guint16 request_height;
|
|
guint16 current_width;
|
|
guint16 current_height;
|
|
|
|
GdkWindow *plug_window;
|
|
GtkWidget *plug_widget;
|
|
|
|
gshort xembed_version; /* -1 == not xembed */
|
|
guint same_app : 1;
|
|
guint focus_in : 1;
|
|
guint have_size : 1;
|
|
guint need_map : 1;
|
|
guint is_mapped : 1;
|
|
|
|
GHashTable *grabbed_keys;
|
|
GtkWidget *toplevel;
|
|
};
|
|
|
|
struct _GtkSocketClass
|
|
{
|
|
GtkContainerClass parent_class;
|
|
};
|
|
|
|
|
|
GtkWidget* gtk_socket_new (void);
|
|
GtkType gtk_socket_get_type (void) G_GNUC_CONST;
|
|
void gtk_socket_steal (GtkSocket *socket,
|
|
GdkNativeWindow wid);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#endif /* __GTK_SOCKET_H__ */
|