]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkwindow.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gdk / gdkwindow.h
index 84fc1e8588415ae789eb337b51081a9eb1a9aa70..d2ee972cbbb32693f7490f85b960d3910bbf0cea 100644 (file)
@@ -12,9 +12,7 @@
  * 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/>.
  */
 
 /*
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
+#ifndef __GDK_WINDOW_H__
+#define __GDK_WINDOW_H__
+
 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
 #error "Only <gdk/gdk.h> can be included directly."
 #endif
 
-#ifndef __GDK_WINDOW_H__
-#define __GDK_WINDOW_H__
-
-#include <gdk/gdkdrawable.h>
+#include <gdk/gdkversionmacros.h>
 #include <gdk/gdktypes.h>
 #include <gdk/gdkevents.h>
+#include <gdk/gdkframeclock.h>
 
 G_BEGIN_DECLS
 
 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
  *
@@ -55,9 +53,9 @@ typedef struct _GdkWindowRedirect    GdkWindowRedirect;
  */
 typedef enum
 {
-  GDK_INPUT_OUTPUT,
-  GDK_INPUT_ONLY
-} GdkWindowClass;
+  GDK_INPUT_OUTPUT, /*< nick=input-output >*/
+  GDK_INPUT_ONLY    /*< nick=input-only >*/
+} GdkWindowWindowClass;
 
 /**
  * GdkWindowType:
@@ -319,6 +317,22 @@ typedef enum
   GDK_WINDOW_EDGE_SOUTH_EAST  
 } GdkWindowEdge;
 
+/**
+ * GdkFullscreenMode:
+ * @GDK_FULLSCREEN_ON_CURRENT_MONITOR: Fullscreen on current monitor only.
+ * @GDK_FULLSCREEN_ON_ALL_MONITORS: Span across all monitors when fullscreen.
+ *
+ * Indicates which monitor (in a multi-head setup) a window should span over
+ * when in fullscreen mode.
+ *
+ * Since: 3.8
+ **/
+typedef enum
+{
+  GDK_FULLSCREEN_ON_CURRENT_MONITOR,
+  GDK_FULLSCREEN_ON_ALL_MONITORS
+} GdkFullscreenMode;
+
 /**
  * GdkWindowAttr:
  * @title: title of the window (for toplevel windows)
@@ -346,7 +360,7 @@ struct _GdkWindowAttr
   gint x, y;
   gint width;
   gint height;
-  GdkWindowClass wclass;
+  GdkWindowWindowClass wclass;
   GdkVisual *visual;
   GdkWindowType window_type;
   GdkCursor *cursor;
@@ -447,53 +461,53 @@ struct _GdkGeometry
   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 _GdkWindowClass GdkWindowClass;
 
-typedef struct _GdkWindowObject GdkWindowObject;
-typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
-
-#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);
@@ -505,6 +519,7 @@ 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 */
@@ -615,18 +630,7 @@ GdkWindowState gdk_window_get_state (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 */
 
@@ -649,7 +653,10 @@ void gdk_window_set_urgency_hint      (GdkWindow *window,
 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);
@@ -666,8 +673,11 @@ void          gdk_window_set_startup_id    (GdkWindow     *window,
                                            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_background_rgba (GdkWindow     *window,
+                                              const GdkRGBA *rgba);
 void         gdk_window_set_background_pattern (GdkWindow       *window,
                                                  cairo_pattern_t *pattern);
 cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow     *window);
@@ -686,8 +696,7 @@ void              gdk_window_get_geometry    (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,
@@ -719,10 +728,11 @@ void          gdk_window_get_frame_extents (GdkWindow     *window,
                                             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,
@@ -746,6 +756,12 @@ void          gdk_window_set_device_events (GdkWindow    *window,
 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, 
@@ -774,6 +790,12 @@ void          gdk_window_unstick         (GdkWindow       *window);
 void          gdk_window_maximize        (GdkWindow       *window);
 void          gdk_window_unmaximize      (GdkWindow       *window);
 void          gdk_window_fullscreen      (GdkWindow       *window);
+GDK_AVAILABLE_IN_3_8
+void          gdk_window_set_fullscreen_mode (GdkWindow   *window,
+                                          GdkFullscreenMode mode);
+GDK_AVAILABLE_IN_3_8
+GdkFullscreenMode
+              gdk_window_get_fullscreen_mode (GdkWindow   *window);
 void          gdk_window_unfullscreen    (GdkWindow       *window);
 void          gdk_window_set_keep_above  (GdkWindow       *window,
                                           gboolean         setting);
@@ -783,17 +805,36 @@ void          gdk_window_set_opacity     (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,
@@ -802,11 +843,26 @@ 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);
@@ -828,13 +884,11 @@ void       gdk_window_constrain_size      (GdkGeometry  *geometry,
                                            gint         *new_width,
                                            gint         *new_height);
 
+GDK_DEPRECATED_IN_3_8
 void gdk_window_enable_synchronized_configure (GdkWindow *window);
+GDK_DEPRECATED_IN_3_8
 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 */
@@ -850,6 +904,10 @@ void       gdk_window_set_support_multidevice (GdkWindow *window,
                                                gboolean   support_multidevice);
 gboolean   gdk_window_get_support_multidevice (GdkWindow *window);
 
+/* Frame clock */
+GDK_AVAILABLE_IN_3_8
+GdkFrameClock* gdk_window_get_frame_clock      (GdkWindow     *window);
+
 G_END_DECLS
 
 #endif /* __GDK_WINDOW_H__ */