* 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
#ifndef __GDK_WINDOW_H__
#define __GDK_WINDOW_H__
-#include <gdk/gdkdrawable.h>
+#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
typedef struct _GdkGeometry GdkGeometry;
typedef struct _GdkWindowAttr GdkWindowAttr;
-typedef struct _GdkPointerHooks GdkPointerHooks;
typedef struct _GdkWindowRedirect GdkWindowRedirect;
/**
- * GdkWindowClass:
+ * GdkWindowWindowClass:
* @GDK_INPUT_OUTPUT: window for graphics and events
* @GDK_INPUT_ONLY: window for events only
*
*/
typedef enum
{
- GDK_INPUT_OUTPUT,
- GDK_INPUT_ONLY
-} GdkWindowClass;
+ GDK_INPUT_OUTPUT, /*< nick=input-output >*/
+ GDK_INPUT_ONLY /*< nick=input-only >*/
+} GdkWindowWindowClass;
/**
* GdkWindowType:
* @GDK_WA_X: Honor the X coordinate field
* @GDK_WA_Y: Honor the Y coordinate field
* @GDK_WA_CURSOR: Honor the cursor field
- * @GDK_WA_COLORMAP: Honor the colormap field
* @GDK_WA_VISUAL: Honor the visual field
* @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
* @GDK_WA_NOREDIR: Honor the override_redirect field
GDK_WA_X = 1 << 2,
GDK_WA_Y = 1 << 3,
GDK_WA_CURSOR = 1 << 4,
- GDK_WA_COLORMAP = 1 << 5,
- GDK_WA_VISUAL = 1 << 6,
- GDK_WA_WMCLASS = 1 << 7,
- GDK_WA_NOREDIR = 1 << 8,
- GDK_WA_TYPE_HINT = 1 << 9
+ GDK_WA_VISUAL = 1 << 5,
+ GDK_WA_WMCLASS = 1 << 6,
+ GDK_WA_NOREDIR = 1 << 7,
+ GDK_WA_TYPE_HINT = 1 << 8
} GdkWindowAttributesType;
/* Size restriction enumeration.
* @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
* window that receives events)
* @visual: #GdkVisual for window
- * @colormap: #GdkColormap for window
* @window_type: type of window
* @cursor: cursor for the window (see gdk_window_set_cursor())
* @wmclass_name: don't use (see gtk_window_set_wmclass())
gint x, y;
gint width;
gint height;
- GdkWindowClass wclass;
+ GdkWindowWindowClass wclass;
GdkVisual *visual;
- GdkColormap *colormap;
GdkWindowType window_type;
GdkCursor *cursor;
gchar *wmclass_name;
GdkGravity win_gravity;
};
-/**
- * GdkPointerHooks:
- * @get_pointer: Obtains the current pointer position and modifier state.
- * The position is given in coordinates relative to the window containing
- * the pointer, which is returned in @window.
- * @window_at_pointer: Obtains the window underneath the mouse pointer,
- * returning the location of that window in @win_x, @win_y. Returns %NULL
- * if the window under the mouse pointer is not known to GDK (for example,
- * belongs to another application).
- *
- * A table of pointers to functions for getting quantities related to
- * the current pointer position. GDK has one global table of this type,
- * which can be set using gdk_set_pointer_hooks().
- *
- * This is only useful for such low-level tools as an event recorder.
- * Applications should never have any reason to use this facility
- */
-struct _GdkPointerHooks
-{
- GdkWindow* (*get_pointer) (GdkWindow *window,
- gint *x,
- gint *y,
- GdkModifierType *mask);
- GdkWindow* (*window_at_pointer) (GdkScreen *screen, /* unused */
- gint *win_x,
- gint *win_y);
-};
-
-typedef struct _GdkWindowObject GdkWindowObject;
-typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
+typedef struct _GdkWindowClass GdkWindowClass;
-#define GDK_TYPE_WINDOW (gdk_window_object_get_type ())
+#define GDK_TYPE_WINDOW (gdk_window_get_type ())
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
-#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
+#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
-#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
+#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
-struct _GdkWindowObjectClass
+struct _GdkWindowClass
{
- GdkDrawableClass parent_class;
+ GObjectClass parent_class;
+
+ GdkWindow * (* pick_embedded_child) (GdkWindow *window,
+ gdouble x,
+ gdouble y);
+
+ /* the following 3 signals will only be emitted by offscreen windows */
+ void (* to_embedder) (GdkWindow *window,
+ gdouble offscreen_x,
+ gdouble offscreen_y,
+ gdouble *embedder_x,
+ gdouble *embedder_y);
+ void (* from_embedder) (GdkWindow *window,
+ gdouble embedder_x,
+ gdouble embedder_y,
+ gdouble *offscreen_x,
+ gdouble *offscreen_y);
+ cairo_surface_t * (* create_surface) (GdkWindow *window,
+ gint width,
+ gint height);
+
+ /* Padding for future expansion */
+ void (*_gdk_reserved1) (void);
+ void (*_gdk_reserved2) (void);
+ void (*_gdk_reserved3) (void);
+ void (*_gdk_reserved4) (void);
+ void (*_gdk_reserved5) (void);
+ void (*_gdk_reserved6) (void);
+ void (*_gdk_reserved7) (void);
+ void (*_gdk_reserved8) (void);
};
/* Windows
*/
-GType gdk_window_object_get_type (void) G_GNUC_CONST;
+GType gdk_window_get_type (void) G_GNUC_CONST;
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
gboolean gdk_window_is_destroyed (GdkWindow *window);
+GdkVisual * gdk_window_get_visual (GdkWindow *window);
+GdkScreen * gdk_window_get_screen (GdkWindow *window);
+GdkDisplay * gdk_window_get_display (GdkWindow *window);
#ifndef GDK_MULTIDEVICE_SAFE
+GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position)
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
#endif /* GDK_MULTIDEVICE_SAFE */
GdkWindow *new_parent,
gint x,
gint y);
-void gdk_window_clear (GdkWindow *window);
-void gdk_window_clear_area (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height);
-void gdk_window_clear_area_e (GdkWindow *window,
- gint x,
- gint y,
- gint width,
- gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
void gdk_window_restack (GdkWindow *window,
* window gravity on all children.
*/
gboolean gdk_window_set_static_gravities (GdkWindow *window,
- gboolean use_static);
-
-/* Functions to create/lookup windows from their native equivalents */
-#ifndef GDK_MULTIHEAD_SAFE
-GdkWindow* gdk_window_foreign_new (GdkNativeWindow anid);
-GdkWindow* gdk_window_lookup (GdkNativeWindow anid);
-#endif
-GdkWindow *gdk_window_foreign_new_for_display (GdkDisplay *display,
- GdkNativeWindow anid);
-GdkWindow* gdk_window_lookup_for_display (GdkDisplay *display,
- GdkNativeWindow anid);
-
+ gboolean use_static);
/* GdkWindow */
void gdk_window_set_geometry_hints (GdkWindow *window,
const GdkGeometry *geometry,
GdkWindowHints geom_mask);
-void gdk_set_sm_client_id (const gchar *sm_client_id);
+
+cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
+cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
+
void gdk_window_begin_paint_rect (GdkWindow *window,
const GdkRectangle *rectangle);
const gchar *startup_id);
void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent);
+GDK_DEPRECATED_IN_3_4_FOR(gdk_window_set_background_rgba)
void gdk_window_set_background (GdkWindow *window,
const GdkColor *color);
-void gdk_window_set_back_pixmap (GdkWindow *window,
- GdkPixmap *pixmap,
- gboolean parent_relative);
+void gdk_window_set_background_rgba (GdkWindow *window,
+ GdkRGBA *rgba);
+void gdk_window_set_background_pattern (GdkWindow *window,
+ cairo_pattern_t *pattern);
cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow *window);
void gdk_window_set_cursor (GdkWindow *window,
gint *x,
gint *y,
gint *width,
- gint *height,
- gint *depth);
+ gint *height);
+int gdk_window_get_width (GdkWindow *window);
+int gdk_window_get_height (GdkWindow *window);
void gdk_window_get_position (GdkWindow *window,
gint *x,
gint *y);
GdkRectangle *rect);
#ifndef GDK_MULTIDEVICE_SAFE
-GdkWindow* gdk_window_get_pointer (GdkWindow *window,
- gint *x,
- gint *y,
- GdkModifierType *mask);
+GDK_DEPRECATED_IN_3_0_FOR(gdk_window_get_device_position)
+GdkWindow * gdk_window_get_pointer (GdkWindow *window,
+ gint *x,
+ gint *y,
+ GdkModifierType *mask);
#endif /* GDK_MULTIDEVICE_SAFE */
GdkWindow * gdk_window_get_device_position (GdkWindow *window,
GdkDevice *device,
GdkEventMask gdk_window_get_device_events (GdkWindow *window,
GdkDevice *device);
+void gdk_window_set_source_events (GdkWindow *window,
+ GdkInputSource source,
+ GdkEventMask event_mask);
+GdkEventMask gdk_window_get_source_events (GdkWindow *window,
+ GdkInputSource source);
+
void gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs);
void gdk_window_set_icon_name (GdkWindow *window,
gdouble opacity);
void gdk_window_register_dnd (GdkWindow *window);
-void gdk_window_begin_resize_drag (GdkWindow *window,
- GdkWindowEdge edge,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
-void gdk_window_begin_move_drag (GdkWindow *window,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
+GdkDragProtocol
+ gdk_window_get_drag_protocol(GdkWindow *window,
+ GdkWindow **target);
+
+void gdk_window_begin_resize_drag (GdkWindow *window,
+ GdkWindowEdge edge,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp);
+GDK_AVAILABLE_IN_3_4
+void gdk_window_begin_resize_drag_for_device (GdkWindow *window,
+ GdkWindowEdge edge,
+ GdkDevice *device,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp);
+void gdk_window_begin_move_drag (GdkWindow *window,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp);
+GDK_AVAILABLE_IN_3_4
+void gdk_window_begin_move_drag_for_device (GdkWindow *window,
+ GdkDevice *device,
+ gint button,
+ gint root_x,
+ gint root_y,
+ guint32 timestamp);
/* Interface for dirty-region queueing */
void gdk_window_invalidate_rect (GdkWindow *window,
void gdk_window_invalidate_region (GdkWindow *window,
const cairo_region_t *region,
gboolean invalidate_children);
-void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
- const cairo_region_t *region,
- gboolean (*child_func) (GdkWindow *, gpointer),
- gpointer user_data);
-cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
+
+/**
+ * GdkWindowChildFunc:
+ * @window: a #GdkWindow
+ * @user_data: user data
+ *
+ * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
+ * It gets called for each child of the window to determine whether to
+ * recursively invalidate it or now.
+ *
+ * Returns: %TRUE to invalidate @window recursively
+ */
+typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window,
+ gpointer user_data);
+
+void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
+ const cairo_region_t *region,
+ GdkWindowChildFunc child_func,
+ gpointer user_data);
+cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
void gdk_window_freeze_updates (GdkWindow *window);
void gdk_window_thaw_updates (GdkWindow *window);
gint *new_width,
gint *new_height);
-void gdk_window_get_internal_paint_info (GdkWindow *window,
- GdkDrawable **real_drawable,
- gint *x_offset,
- gint *y_offset);
-
void gdk_window_enable_synchronized_configure (GdkWindow *window);
void gdk_window_configure_finished (GdkWindow *window);
-#if !defined (GDK_MULTIHEAD_SAFE) && !defined (GDK_MULTIDEVICE_SAFE)
-GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
-#endif /* !GDK_MULTIHEAD_SAFE && !GDK_MULTIDEVICE_SAFE */
-
GdkWindow *gdk_get_default_root_window (void);
/* Offscreen redirection */
-GdkPixmap *gdk_offscreen_window_get_pixmap (GdkWindow *window);
+cairo_surface_t *
+ gdk_offscreen_window_get_surface (GdkWindow *window);
void gdk_offscreen_window_set_embedder (GdkWindow *window,
GdkWindow *embedder);
GdkWindow *gdk_offscreen_window_get_embedder (GdkWindow *window);
void gdk_window_geometry_changed (GdkWindow *window);
-void gdk_window_redirect_to_drawable (GdkWindow *window,
- GdkDrawable *drawable,
- gint src_x,
- gint src_y,
- gint dest_x,
- gint dest_y,
- gint width,
- gint height);
-void gdk_window_remove_redirection (GdkWindow *window);
-
/* Multidevice support */
void gdk_window_set_support_multidevice (GdkWindow *window,
gboolean support_multidevice);