]> Pileus Git - ~andy/gtk/blob - gdk/gdkoffscreenwindow.c
Fix missing (transfer) annotations in GDK
[~andy/gtk] / gdk / gdkoffscreenwindow.c
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2005.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #include "config.h"
28
29 #include "gdkwindow.h"
30 #include "gdkinternals.h"
31 #include "gdkwindowimpl.h"
32
33 #include <math.h>
34
35 /* LIMITATIONS:
36  *
37  * Offscreen windows can't be the child of a foreign window,
38  *   nor contain foreign windows
39  * GDK_POINTER_MOTION_HINT_MASK isn't effective
40  */
41
42 typedef struct _GdkOffscreenWindow      GdkOffscreenWindow;
43 typedef struct _GdkOffscreenWindowClass GdkOffscreenWindowClass;
44
45 struct _GdkOffscreenWindow
46 {
47   GdkDrawable parent_instance;
48
49   GdkWindow *wrapper;
50
51   cairo_surface_t *surface;
52   GdkWindow *embedder;
53 };
54
55 struct _GdkOffscreenWindowClass
56 {
57   GdkDrawableClass parent_class;
58 };
59
60 #define GDK_TYPE_OFFSCREEN_WINDOW            (gdk_offscreen_window_get_type())
61 #define GDK_OFFSCREEN_WINDOW(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindow))
62 #define GDK_IS_OFFSCREEN_WINDOW(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_OFFSCREEN_WINDOW))
63 #define GDK_OFFSCREEN_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindowClass))
64 #define GDK_IS_OFFSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_OFFSCREEN_WINDOW))
65 #define GDK_OFFSCREEN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindowClass))
66
67 static void       gdk_offscreen_window_impl_iface_init    (GdkWindowImplIface         *iface);
68 static void       gdk_offscreen_window_hide               (GdkWindow                  *window);
69
70 G_DEFINE_TYPE_WITH_CODE (GdkOffscreenWindow,
71                          gdk_offscreen_window,
72                          GDK_TYPE_DRAWABLE,
73                          G_IMPLEMENT_INTERFACE (GDK_TYPE_WINDOW_IMPL,
74                                                 gdk_offscreen_window_impl_iface_init));
75
76
77 static void
78 gdk_offscreen_window_finalize (GObject *object)
79 {
80   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (object);
81
82   if (offscreen->surface)
83     cairo_surface_destroy (offscreen->surface);
84
85   G_OBJECT_CLASS (gdk_offscreen_window_parent_class)->finalize (object);
86 }
87
88 static void
89 gdk_offscreen_window_init (GdkOffscreenWindow *window)
90 {
91 }
92
93 static void
94 gdk_offscreen_window_destroy (GdkWindow *window,
95                               gboolean   recursing,
96                               gboolean   foreign_destroy)
97 {
98   GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
99   GdkOffscreenWindow *offscreen;
100
101   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
102
103   gdk_offscreen_window_set_embedder (window, NULL);
104   
105   if (!recursing)
106     gdk_offscreen_window_hide (window);
107 }
108
109 static cairo_surface_t *
110 get_surface (GdkOffscreenWindow *offscreen)
111 {
112   if (! offscreen->surface)
113     {
114       GdkWindowObject *private = (GdkWindowObject *) offscreen->wrapper;
115
116       g_signal_emit_by_name (private, "create-surface",
117                              private->width,
118                              private->height,
119                              &offscreen->surface);
120     }
121
122   return offscreen->surface;
123 }
124
125 static gboolean
126 is_parent_of (GdkWindow *parent,
127               GdkWindow *child)
128 {
129   GdkWindow *w;
130
131   w = child;
132   while (w != NULL)
133     {
134       if (w == parent)
135         return TRUE;
136
137       w = gdk_window_get_parent (w);
138     }
139
140   return FALSE;
141 }
142
143 static cairo_surface_t *
144 gdk_offscreen_window_ref_cairo_surface (GdkDrawable *drawable)
145 {
146   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
147
148   return cairo_surface_reference (get_surface (offscreen));
149 }
150
151 cairo_surface_t *
152 _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
153                                       gint       width,
154                                       gint       height)
155 {
156   GdkWindowObject *private = (GdkWindowObject *) offscreen;
157   cairo_surface_t *similar;
158   cairo_surface_t *surface;
159   cairo_content_t  content = CAIRO_CONTENT_COLOR;
160
161   g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (private->impl), NULL);
162
163   similar = _gdk_drawable_ref_cairo_surface ((GdkWindow *)private->parent);
164
165   if (gdk_window_get_visual (offscreen) ==
166       gdk_screen_get_rgba_visual (gdk_window_get_screen (offscreen)))
167     {
168       content = CAIRO_CONTENT_COLOR_ALPHA;
169     }
170
171   surface = cairo_surface_create_similar (similar, content, width, height);
172
173   cairo_surface_destroy (similar);
174
175   return surface;
176 }
177
178 void
179 _gdk_offscreen_window_new (GdkWindow     *window,
180                            GdkWindowAttr *attributes,
181                            gint           attributes_mask)
182 {
183   GdkWindowObject *private;
184   GdkOffscreenWindow *offscreen;
185
186   g_return_if_fail (attributes != NULL);
187
188   if (attributes->wclass != GDK_INPUT_OUTPUT)
189     return; /* Can't support input only offscreens */
190
191   private = (GdkWindowObject *)window;
192
193   if (private->parent != NULL && GDK_WINDOW_DESTROYED (private->parent))
194     return;
195
196   private->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
197   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
198   offscreen->wrapper = window;
199 }
200
201 static gboolean
202 gdk_offscreen_window_reparent (GdkWindow *window,
203                                GdkWindow *new_parent,
204                                gint       x,
205                                gint       y)
206 {
207   GdkWindowObject *private = (GdkWindowObject *)window;
208   GdkWindowObject *new_parent_private = (GdkWindowObject *)new_parent;
209   GdkWindowObject *old_parent;
210   gboolean was_mapped;
211
212   if (new_parent)
213     {
214       /* No input-output children of input-only windows */
215       if (new_parent_private->input_only && !private->input_only)
216         return FALSE;
217
218       /* Don't create loops in hierarchy */
219       if (is_parent_of (window, new_parent))
220         return FALSE;
221     }
222
223   was_mapped = GDK_WINDOW_IS_MAPPED (window);
224
225   gdk_window_hide (window);
226
227   if (private->parent)
228     private->parent->children = g_list_remove (private->parent->children, window);
229
230   old_parent = private->parent;
231   private->parent = new_parent_private;
232   private->x = x;
233   private->y = y;
234
235   if (new_parent_private)
236     private->parent->children = g_list_prepend (private->parent->children, window);
237
238   _gdk_synthesize_crossing_events_for_geometry_change (window);
239   if (old_parent)
240     _gdk_synthesize_crossing_events_for_geometry_change (GDK_WINDOW (old_parent));
241
242   return was_mapped;
243 }
244
245 static void
246 from_embedder (GdkWindow *window,
247                double embedder_x, double embedder_y,
248                double *offscreen_x, double *offscreen_y)
249 {
250   GdkWindowObject *private;
251
252   private = (GdkWindowObject *)window;
253
254   g_signal_emit_by_name (private->impl_window,
255                          "from-embedder",
256                          embedder_x, embedder_y,
257                          offscreen_x, offscreen_y,
258                          NULL);
259 }
260
261 static void
262 to_embedder (GdkWindow *window,
263              double offscreen_x, double offscreen_y,
264              double *embedder_x, double *embedder_y)
265 {
266   GdkWindowObject *private;
267
268   private = (GdkWindowObject *)window;
269
270   g_signal_emit_by_name (private->impl_window,
271                          "to-embedder",
272                          offscreen_x, offscreen_y,
273                          embedder_x, embedder_y,
274                          NULL);
275 }
276
277 static gint
278 gdk_offscreen_window_get_root_coords (GdkWindow *window,
279                                       gint       x,
280                                       gint       y,
281                                       gint      *root_x,
282                                       gint      *root_y)
283 {
284   GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
285   GdkOffscreenWindow *offscreen;
286   int tmpx, tmpy;
287
288   tmpx = x;
289   tmpy = y;
290
291   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
292   if (offscreen->embedder)
293     {
294       double dx, dy;
295       to_embedder (window,
296                    x, y,
297                    &dx, &dy);
298       tmpx = floor (dx + 0.5);
299       tmpy = floor (dy + 0.5);
300       gdk_window_get_root_coords (offscreen->embedder,
301                                   tmpx, tmpy,
302                                   &tmpx, &tmpy);
303
304     }
305
306   if (root_x)
307     *root_x = tmpx;
308   if (root_y)
309     *root_y = tmpy;
310
311   return TRUE;
312 }
313
314 static gboolean
315 gdk_offscreen_window_get_device_state (GdkWindow       *window,
316                                        GdkDevice       *device,
317                                        gint            *x,
318                                        gint            *y,
319                                        GdkModifierType *mask)
320 {
321   GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
322   GdkOffscreenWindow *offscreen;
323   int tmpx, tmpy;
324   double dtmpx, dtmpy;
325   GdkModifierType tmpmask;
326
327   tmpx = 0;
328   tmpy = 0;
329   tmpmask = 0;
330
331   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
332   if (offscreen->embedder != NULL)
333     {
334       gdk_window_get_device_position (offscreen->embedder, device, &tmpx, &tmpy, &tmpmask);
335       from_embedder (window,
336                      tmpx, tmpy,
337                      &dtmpx, &dtmpy);
338       tmpx = floor (dtmpx + 0.5);
339       tmpy = floor (dtmpy + 0.5);
340     }
341
342   if (x)
343     *x = tmpx;
344   if (y)
345     *y = tmpy;
346   if (mask)
347     *mask = tmpmask;
348   return TRUE;
349 }
350
351 /**
352  * gdk_offscreen_window_get_surface:
353  * @window: a #GdkWindow
354  *
355  * Gets the offscreen surface that an offscreen window renders into.
356  * If you need to keep this around over window resizes, you need to
357  * add a reference to it.
358  *
359  * Returns: The offscreen surface, or %NULL if not offscreen
360  */
361 cairo_surface_t *
362 gdk_offscreen_window_get_surface (GdkWindow *window)
363 {
364   GdkWindowObject *private = (GdkWindowObject *)window;
365   GdkOffscreenWindow *offscreen;
366
367   g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
368
369   if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
370     return NULL;
371
372   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
373
374   return get_surface (offscreen);
375 }
376
377 static void
378 gdk_offscreen_window_raise (GdkWindow *window)
379 {
380   /* gdk_window_raise already changed the stacking order */
381   _gdk_synthesize_crossing_events_for_geometry_change (window);
382 }
383
384 static void
385 gdk_offscreen_window_lower (GdkWindow *window)
386 {
387   /* gdk_window_lower already changed the stacking order */
388   _gdk_synthesize_crossing_events_for_geometry_change (window);
389 }
390
391 static void
392 gdk_offscreen_window_move_resize_internal (GdkWindow *window,
393                                            gint       x,
394                                            gint       y,
395                                            gint       width,
396                                            gint       height,
397                                            gboolean   send_expose_events)
398 {
399   GdkWindowObject *private = (GdkWindowObject *)window;
400   GdkOffscreenWindow *offscreen;
401   gint dx, dy, dw, dh;
402
403   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
404
405   if (width < 1)
406     width = 1;
407   if (height < 1)
408     height = 1;
409
410   if (private->destroyed)
411     return;
412
413   dx = x - private->x;
414   dy = y - private->y;
415   dw = width - private->width;
416   dh = height - private->height;
417
418   private->x = x;
419   private->y = y;
420
421   if (private->width != width ||
422       private->height != height)
423     {
424       private->width = width;
425       private->height = height;
426
427       if (offscreen->surface)
428         {
429           cairo_surface_t *old_surface;
430           cairo_t *cr;
431
432           old_surface = offscreen->surface;
433           offscreen->surface = NULL;
434
435           offscreen->surface = get_surface (offscreen);
436
437           cr = cairo_create (offscreen->surface);
438           cairo_set_source_surface (cr, old_surface, 0, 0);
439           cairo_paint (cr);
440           cairo_destroy (cr);
441
442           cairo_surface_destroy (old_surface);
443         }
444     }
445
446   if (GDK_WINDOW_IS_MAPPED (private))
447     {
448       // TODO: Only invalidate new area, i.e. for larger windows
449       gdk_window_invalidate_rect (window, NULL, TRUE);
450       _gdk_synthesize_crossing_events_for_geometry_change (window);
451     }
452 }
453
454 static void
455 gdk_offscreen_window_move_resize (GdkWindow *window,
456                                   gboolean   with_move,
457                                   gint       x,
458                                   gint       y,
459                                   gint       width,
460                                   gint       height)
461 {
462   GdkWindowObject *private = (GdkWindowObject *)window;
463   GdkOffscreenWindow *offscreen;
464
465   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
466
467   if (!with_move)
468     {
469       x = private->x;
470       y = private->y;
471     }
472
473   if (width < 0)
474     width = private->width;
475
476   if (height < 0)
477     height = private->height;
478
479   gdk_offscreen_window_move_resize_internal (window, x, y,
480                                              width, height,
481                                              TRUE);
482 }
483
484 static void
485 gdk_offscreen_window_show (GdkWindow *window,
486                            gboolean already_mapped)
487 {
488   GdkWindowObject *private = (GdkWindowObject *)window;
489   GdkRectangle area = { 0, 0, private->width, private->height };
490
491   gdk_window_invalidate_rect (window, &area, FALSE);
492 }
493
494
495 static void
496 gdk_offscreen_window_hide (GdkWindow *window)
497 {
498   GdkWindowObject *private;
499   GdkOffscreenWindow *offscreen;
500   GdkDisplay *display;
501
502   g_return_if_fail (window != NULL);
503
504   private = (GdkWindowObject*) window;
505   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
506
507   /* May need to break grabs on children */
508   display = gdk_window_get_display (window);
509
510   /* TODO: This needs updating to the new grab world */
511 #if 0
512   if (display->pointer_grab.window != NULL)
513     {
514       if (is_parent_of (window, display->pointer_grab.window))
515         {
516           /* Call this ourselves, even though gdk_display_pointer_ungrab
517              does so too, since we want to pass implicit == TRUE so the
518              broken grab event is generated */
519           _gdk_display_unset_has_pointer_grab (display,
520                                                TRUE,
521                                                FALSE,
522                                                GDK_CURRENT_TIME);
523           gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME);
524         }
525     }
526 #endif
527 }
528
529 static void
530 gdk_offscreen_window_withdraw (GdkWindow *window)
531 {
532 }
533
534 static GdkEventMask
535 gdk_offscreen_window_get_events (GdkWindow *window)
536 {
537   return 0;
538 }
539
540 static void
541 gdk_offscreen_window_set_events (GdkWindow       *window,
542                                  GdkEventMask     event_mask)
543 {
544 }
545
546 static void
547 gdk_offscreen_window_set_background (GdkWindow      *window,
548                                      cairo_pattern_t *pattern)
549 {
550 }
551
552 static void
553 gdk_offscreen_window_shape_combine_region (GdkWindow       *window,
554                                            const cairo_region_t *shape_region,
555                                            gint             offset_x,
556                                            gint             offset_y)
557 {
558 }
559
560 static void
561 gdk_offscreen_window_input_shape_combine_region (GdkWindow       *window,
562                                                  const cairo_region_t *shape_region,
563                                                  gint             offset_x,
564                                                  gint             offset_y)
565 {
566 }
567
568 static gboolean
569 gdk_offscreen_window_set_static_gravities (GdkWindow *window,
570                                            gboolean   use_static)
571 {
572   return TRUE;
573 }
574
575 static void
576 gdk_offscreen_window_get_geometry (GdkWindow *window,
577                                    gint      *x,
578                                    gint      *y,
579                                    gint      *width,
580                                    gint      *height,
581                                    gint      *depth)
582 {
583   GdkWindowObject *private = (GdkWindowObject *)window;
584
585   g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
586
587   if (!GDK_WINDOW_DESTROYED (window))
588     {
589       if (x)
590         *x = private->x;
591       if (y)
592         *y = private->y;
593       if (width)
594         *width = private->width;
595       if (height)
596         *height = private->height;
597       if (depth)
598         *depth = private->depth;
599     }
600 }
601
602 static gboolean
603 gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
604                                        cairo_region_t *area)
605 {
606   return FALSE;
607 }
608
609 static void
610 gdk_offscreen_window_translate (GdkWindow      *window,
611                                 cairo_region_t *area,
612                                 gint            dx,
613                                 gint            dy)
614 {
615   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (((GdkWindowObject *) window)->impl);
616
617   if (offscreen->surface)
618     {
619       cairo_t *cr;
620
621       cr = cairo_create (offscreen->surface);
622
623       area = cairo_region_copy (area);
624
625       gdk_cairo_region (cr, area);
626       cairo_clip (cr);
627
628       /* NB: This is a self-copy and Cairo doesn't support that yet.
629        * So we do a litle trick.
630        */
631       cairo_push_group (cr);
632
633       cairo_set_source_surface (cr, offscreen->surface, dx, dy);
634       cairo_paint (cr);
635
636       cairo_pop_group_to_source (cr);
637       cairo_paint (cr);
638
639       cairo_destroy (cr);
640     }
641
642   _gdk_window_add_damage (window, area);
643 }
644
645 static cairo_surface_t *
646 gdk_offscreen_window_resize_cairo_surface (GdkWindow       *window,
647                                            cairo_surface_t *surface,
648                                            gint             width,
649                                            gint             height)
650 {
651   /* No-op.  The surface gets resized in
652    * gdk_offscreen_window_move_resize_internal().
653    */
654   return surface;
655 }
656
657 /**
658  * gdk_offscreen_window_set_embedder:
659  * @window: a #GdkWindow
660  * @embedder: the #GdkWindow that @window gets embedded in
661  *
662  * Sets @window to be embedded in @embedder.
663  *
664  * To fully embed an offscreen window, in addition to calling this
665  * function, it is also necessary to handle the #GdkWindow::pick-embedded-child
666  * signal on the @embedder and the #GdkWindow::to-embedder and
667  * #GdkWindow::from-embedder signals on @window.
668  *
669  * Since: 2.18
670  */
671 void
672 gdk_offscreen_window_set_embedder (GdkWindow     *window,
673                                    GdkWindow     *embedder)
674 {
675   GdkWindowObject *private = (GdkWindowObject *)window;
676   GdkOffscreenWindow *offscreen;
677
678   g_return_if_fail (GDK_IS_WINDOW (window));
679
680   if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
681     return;
682
683   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
684
685   if (embedder)
686     {
687       g_object_ref (embedder);
688       GDK_WINDOW_OBJECT (embedder)->num_offscreen_children++;
689     }
690
691   if (offscreen->embedder)
692     {
693       g_object_unref (offscreen->embedder);
694       GDK_WINDOW_OBJECT (offscreen->embedder)->num_offscreen_children--;
695     }
696
697   offscreen->embedder = embedder;
698 }
699
700 /**
701  * gdk_offscreen_window_get_embedder:
702  * @window: a #GdkWindow
703  *
704  * Gets the window that @window is embedded in.
705  *
706  * Returns: (transfer none): the embedding #GdkWindow, or %NULL
707  *     if @window is not an mbedded offscreen window
708  *
709  * Since: 2.18
710  */
711 GdkWindow *
712 gdk_offscreen_window_get_embedder (GdkWindow *window)
713 {
714   GdkWindowObject *private = (GdkWindowObject *)window;
715   GdkOffscreenWindow *offscreen;
716
717   g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
718
719   if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
720     return NULL;
721
722   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
723
724   return offscreen->embedder;
725 }
726
727 static void
728 gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
729 {
730   GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
731   GObjectClass *object_class = G_OBJECT_CLASS (klass);
732
733   object_class->finalize = gdk_offscreen_window_finalize;
734
735   drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
736 }
737
738 static void
739 gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface)
740 {
741   iface->show = gdk_offscreen_window_show;
742   iface->hide = gdk_offscreen_window_hide;
743   iface->withdraw = gdk_offscreen_window_withdraw;
744   iface->raise = gdk_offscreen_window_raise;
745   iface->lower = gdk_offscreen_window_lower;
746   iface->move_resize = gdk_offscreen_window_move_resize;
747   iface->set_background = gdk_offscreen_window_set_background;
748   iface->get_events = gdk_offscreen_window_get_events;
749   iface->set_events = gdk_offscreen_window_set_events;
750   iface->reparent = gdk_offscreen_window_reparent;
751   iface->get_geometry = gdk_offscreen_window_get_geometry;
752   iface->shape_combine_region = gdk_offscreen_window_shape_combine_region;
753   iface->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
754   iface->set_static_gravities = gdk_offscreen_window_set_static_gravities;
755   iface->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
756   iface->translate = gdk_offscreen_window_translate;
757   iface->get_root_coords = gdk_offscreen_window_get_root_coords;
758   iface->get_device_state = gdk_offscreen_window_get_device_state;
759   iface->destroy = gdk_offscreen_window_destroy;
760   iface->resize_cairo_surface = gdk_offscreen_window_resize_cairo_surface;
761 }