Commit 73e845ee authored by Matthias Clasen's avatar Matthias Clasen

Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup and

        * gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
        gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
        gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
        gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
        gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
        Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
        and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)

        * gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
parent 65bcfc11
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)
* gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
* gtk/gtkspinbutton.c (gtk_spin_button_size_request):
Don't restrict the width of the spinbutton entry field
to 10 digits. (#58681)
......
......@@ -73,6 +73,10 @@ GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
GdkColor *transparent_color,
gchar **data);
/* Functions to create/lookup pixmaps from their native equivalents */
GdkPixmap* gdk_pixmap_foreign_new (GdkNativeWindow anid);
GdkPixmap* gdk_pixmap_lookup (GdkNativeWindow anid);
#ifndef GDK_DISABLE_DEPRECATED
#define gdk_bitmap_ref gdk_drawable_ref
#define gdk_bitmap_unref gdk_drawable_unref
......
......@@ -371,6 +371,11 @@ GdkWindowState gdk_window_get_state (GdkWindow *window);
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
/* Functions to create/lookup windows from their native equivalents */
GdkWindow* gdk_window_foreign_new (GdkNativeWindow anid);
GdkWindow* gdk_window_lookup (GdkNativeWindow anid);
/* GdkWindow */
#ifndef GDK_DISABLE_DEPRECATED
......
......@@ -12,10 +12,7 @@ extern GdkFBDisplay *gdk_display;
#define GDK_ROOT_WINDOW() gdk_root_window
#define GDK_DISPLAY() gdk_display
#define gdk_window_foreign_new(xid) gdk_window_ref(xid)
#define gdk_window_lookup(xid) ((GdkWindow*) (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) (xid))
#define gdk_font_lookup(xid) ((GdkFont*) (xid))
#define gdk_font_lookup(xid) ((GdkFont*) (xid))
typedef enum {
GDK_FB_0_DEGREES,
......
......@@ -199,3 +199,16 @@ gdk_pixmap_create_from_data (GdkWindow *window,
return pixmap;
}
GdkPixmap*
gdk_pixmap_foreign_new (GdkNativeWindow anid)
{
return (GdkPixmap*) gdk_drawable_ref (anid);
}
GdkPixmap*
gdk_pixmap_lookup (GdkNativeWindow anid)
{
return (GdkPixmap*) (anid);
}
......@@ -2229,3 +2229,16 @@ gdk_window_get_frame_extents (GdkWindow *window,
return TRUE;
}
GdkWindow*
gdk_window_foreign_new (GdkNativeWindow anid)
{
return (GdkWindow*) gdk_drawable_ref (anid);
}
GdkWindow*
gdk_window_lookup (GdkNativeWindow anid)
{
return (GdkWindow*) (anid);
}
......@@ -443,3 +443,9 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
return pixmap;
}
GdkWindow*
gdk_window_lookup (GdkNativeWindow hbm)
{
return (GdkPixmap*) gdk_win32_handle_table_lookup (hbm);
}
......@@ -361,19 +361,12 @@ GType gdk_gc_win32_get_type (void);
#define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP)
#define GDK_DISPLAY() NULL
/* Functions to create GDK pixmaps and windows from their native equivalents */
GdkPixmap *gdk_pixmap_foreign_new (GdkNativeWindow anid);
GdkWindow *gdk_window_foreign_new (GdkNativeWindow anid);
/* Return the Gdk* for a particular HANDLE */
gpointer gdk_win32_handle_table_lookup (GdkNativeWindow handle);
/* Translate from drawable to windows handle */
HWND gdk_win32_drawable_get_handle (GdkDrawable *drawable);
#define gdk_window_lookup(hwnd) (GdkWindow*) gdk_win32_handle_table_lookup (hwnd)
#define gdk_pixmap_lookup(hbm) (GdkPixmap*) gdk_win32_handle_table_lookup (hbm)
/* Return a device context to draw in a drawable, given a GDK GC,
* and a mask indicating which GC values might be used (for efficiency,
* no need to muck around with text-related stuff if we aren't going
......
......@@ -738,6 +738,12 @@ gdk_window_foreign_new (GdkNativeWindow anid)
return window;
}
GdkWindow*
gdk_window_lookup (GdkNativeWindow hwnd)
{
return (GdkWindow*) gdk_win32_handle_table_lookup (hwnd);
}
void
_gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
......
......@@ -286,13 +286,16 @@ gdk_pixmap_create_from_data (GdkWindow *window,
/**
* gdk_pixmap_foreign_new:
* @anid: an X window ID for a pixmap
* @anid: a native pixmap handle.
*
* Creates a #GdkPixmap for the Xlib pixmap ID @anid.
* If the Xlib pixmap is destroyed while creating
* the #GdkPixmap, this function returns %NULL.
*
* Return value: a new #GdkPixmap
* Wraps a native window in a #GdkPixmap.
* This may fail if the pixmap has been destroyed.
*
* For example in the X backend, a native pixmap handle is an Xlib
* <type>XID</type>.
*
* Return value: the newly-created #GdkPixmap wrapper for the
* native pixmap or %NULL if the pixmap has been destroyed.
**/
GdkPixmap*
gdk_pixmap_foreign_new (GdkNativeWindow anid)
......@@ -336,3 +339,21 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
return pixmap;
}
/**
* gdk_pixmap_lookup:
* @anid: a native pixmap handle.
*
* Looks up the #GdkPixmap that wraps the given native pixmap handle.
*
* For example in the X backend, a native pixmap handle is an Xlib
* <type>XID</type>.
*
* Return value: the #GdkWindow wrapper for the native window,
* or %NULL if there is none.
**/
GdkPixmap*
gdk_pixmap_lookup (GdkNativeWindow anid)
{
return (GdkPixmap*) gdk_xid_table_lookup (xid);
}
......@@ -628,12 +628,16 @@ gdk_window_new (GdkWindow *parent,
/**
* gdk_window_foreign_new:
* @anid: an Xlib window ID
* @anid: a native window handle.
*
* Wraps an X window ID (from Xlib) with a #GdkWindow.
* May fail if the window has been destroyed, if so returns %NULL.
* Wraps a native window in a #GdkWindow.
* This may fail if the window has been destroyed.
*
* For example in the X backend, a native window handle is an Xlib
* <type>XID</type>.
*
* Return value: the #GdkWindow wrapper for the X window
* Return value: the newly-created #GdkWindow wrapper for the
* native window or %NULL if the window has been destroyed.
**/
GdkWindow *
gdk_window_foreign_new (GdkNativeWindow anid)
......@@ -702,6 +706,24 @@ gdk_window_foreign_new (GdkNativeWindow anid)
return window;
}
/**
* gdk_window_lookup:
* @anid: a native window handle.
*
* Looks up the #GdkWindow that wraps the given native window handle.
*
* For example in the X backend, a native window handle is an Xlib
* <type>XID</type>.
*
* Return value: the #GdkWindow wrapper for the native window,
* or %NULL if there is none.
**/
GdkWindow *
gdk_window_lookup (GdkNativeWindow anid)
{
return (GdkWindow*) gdk_xid_table_lookup (anid);
}
void
_gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
......
......@@ -100,10 +100,6 @@ GdkVisual* gdkx_visual_get (VisualID xvisualid);
* is useless unless we also have the visual. */
GdkColormap* gdkx_colormap_get (Colormap xcolormap);
/* Functions to create pixmaps and windows from their X equivalents */
GdkPixmap *gdk_pixmap_foreign_new (GdkNativeWindow anid);
GdkWindow *gdk_window_foreign_new (GdkNativeWindow anid);
/* Return the Gdk* for a particular XID */
gpointer gdk_xid_table_lookup (XID xid);
......@@ -116,9 +112,6 @@ void gdk_x11_ungrab_server (void);
/* returns TRUE if we support the given WM spec feature */
gboolean gdk_net_wm_supports (GdkAtom property);
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#ifndef GDK_DISABLE_DEPRECATED
Display * gdk_x11_font_get_xdisplay (GdkFont *font);
......
......@@ -55,14 +55,6 @@
#include <string.h>
#include "gdk.h"
#if defined (GDK_WINDOWING_X11)
#include "x11/gdkx.h" /* For gdk_window_lookup() */
#elif defined (GDK_WINDOWING_WIN32)
#include "win32/gdkwin32.h" /* For gdk_window_lookup() */
#elif defined (GDK_WINDOWING_FB)
#include "linux-fb/gdkfb.h" /* For gdk_window_lookup() */
#endif
#include "gtkmain.h"
#include "gtkselection.h"
#include "gtksignal.h"
......@@ -979,14 +971,9 @@ gtk_selection_request (GtkWidget *widget,
info->num_incrs = 0;
/* Create GdkWindow structure for the requestor */
#if defined(GDK_WINDOWING_WIN32) || defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_FB)
info->requestor = gdk_window_lookup (event->requestor);
if (!info->requestor)
info->requestor = gdk_window_foreign_new (event->requestor);
#else
info->requestor = NULL;
#endif
/* Determine conversions we need to perform */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment