[gtk+/gtk-2-22] [gdk] Add gdk_window_has_native() function



commit 6de36e580ba8acec2fdfc35c17435851fcad06cc
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Jul 1 02:39:39 2010 +0200

    [gdk] Add gdk_window_has_native() function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622677

 docs/reference/gdk/gdk-sections.txt |    1 +
 gdk/gdk.symbols                     |    1 +
 gdk/gdkwindow.c                     |   23 +++++++++++++++++++++++
 gdk/gdkwindow.h                     |    1 +
 4 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk-sections.txt
index 1aa7bb6..b8e8710 100644
--- a/docs/reference/gdk/gdk-sections.txt
+++ b/docs/reference/gdk/gdk-sections.txt
@@ -674,6 +674,7 @@ gdk_window_move_resize
 gdk_window_scroll
 gdk_window_move_region
 gdk_window_flush
+gdk_window_has_native
 gdk_window_ensure_native
 gdk_window_reparent
 gdk_window_clear
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index d97ef35..e328855 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -727,6 +727,7 @@ gdk_window_get_toplevels
 gdk_window_get_update_area
 gdk_window_get_user_data
 gdk_window_get_window_type
+gdk_window_has_native
 gdk_window_invalidate_maybe_recurse
 gdk_window_invalidate_rect
 gdk_window_invalidate_region
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index a1c2acc..73416fd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2262,6 +2262,29 @@ from_embedder (GdkWindowObject *window,
 }
 
 /**
+ * gdk_window_has_native:
+ * @window: a #GdkWindow
+ *
+ * Checks whether the window has a native window or not. Note that
+ * you can use gdk_window_ensure_native() if a native window is needed.
+ *
+ * Returns: %TRUE if the %window has a native window, %FALSE otherwise.
+ *
+ * Since: 2.22
+ */
+gboolean
+gdk_window_has_native (GdkWindow *window)
+{
+  GdkWindowObject *w;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
+
+  w = GDK_WINDOW_OBJECT (window);
+
+  return w->parent == NULL || w->parent->impl != w->impl;
+}
+
+/**
  * gdk_window_get_position:
  * @window: a #GdkWindow
  * @x: X coordinate of window
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 73dc5aa..4fa75d9 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -480,6 +480,7 @@ GdkWindow*    gdk_window_lookup_for_display (GdkDisplay      *display,
 
 /* GdkWindow */
 
+gboolean      gdk_window_has_native      (GdkWindow       *window);
 #ifndef GDK_DISABLE_DEPRECATED
 void	      gdk_window_set_hints	 (GdkWindow	  *window,
 					  gint		   x,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]