OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GFX_GTK_PRESERVE_WINDOW_H_ | 5 #ifndef GFX_GTK_PRESERVE_WINDOW_H_ |
6 #define GFX_GTK_PRESERVE_WINDOW_H_ | 6 #define GFX_GTK_PRESERVE_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gdk/gdk.h> | 9 #include "ui/gfx/gtk_preserve_window.h" |
10 #include <gtk/gtk.h> | 10 // TODO(sail): remove this file once all includes have been updated. |
11 | |
12 // GtkFixed creates an X window when realized and destroys an X window | |
13 // when unrealized. GtkPreserveWindow allows overrides this | |
14 // behaviour. When preserve is set (via gtk_preserve_window_set_preserve), | |
15 // the X window is only destroyed when the widget is destroyed. | |
16 | |
17 G_BEGIN_DECLS | |
18 | |
19 #define GTK_TYPE_PRESERVE_WINDOW \ | |
20 (gtk_preserve_window_get_type()) | |
21 #define GTK_PRESERVE_WINDOW(obj) \ | |
22 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_PERSERVE_WINDOW, \ | |
23 GtkPreserveWindow)) | |
24 #define GTK_PRESERVE_WINDOW_CLASS(klass) \ | |
25 (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_PRESERVE_WINDOW, \ | |
26 GtkPreserveWindowClass)) | |
27 #define GTK_IS_PRESERVE_WINDOW(obj) \ | |
28 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_PRESERVE_WINDOW)) | |
29 #define GTK_IS_PRESERVE_WINDOW_CLASS(klass) \ | |
30 (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_PRESERVE_WINDOW)) | |
31 #define GTK_PRESERVE_WINDOW_GET_CLASS(obj) \ | |
32 (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_PRESERVE_WINDOW, \ | |
33 GtkPreserveWindowClass)) | |
34 | |
35 typedef struct _GtkPreserveWindow GtkPreserveWindow; | |
36 typedef struct _GtkPreserveWindowClass GtkPreserveWindowClass; | |
37 | |
38 struct _GtkPreserveWindow { | |
39 // Parent class. | |
40 GtkFixed fixed; | |
41 }; | |
42 | |
43 struct _GtkPreserveWindowClass { | |
44 GtkFixedClass parent_class; | |
45 }; | |
46 | |
47 GType gtk_preserve_window_get_type() G_GNUC_CONST; | |
48 GtkWidget* gtk_preserve_window_new(); | |
49 | |
50 // Whether or not we should preserve associated windows as the widget | |
51 // is realized or unrealized. | |
52 gboolean gtk_preserve_window_get_preserve(GtkPreserveWindow* widget); | |
53 void gtk_preserve_window_set_preserve(GtkPreserveWindow* widget, | |
54 gboolean value); | |
55 | |
56 // Whether or not someone else will gdk_window_resize the GdkWindow associated | |
57 // with this widget (needed by the GPU process to synchronize resizing | |
58 // with swapped between front and back buffer). | |
59 void gtk_preserve_window_delegate_resize(GtkPreserveWindow* widget, | |
60 gboolean delegate); | |
61 | |
62 G_END_DECLS | |
63 | 11 |
64 #endif // GFX_GTK_PRESERVE_WINDOW_H_ | 12 #endif // GFX_GTK_PRESERVE_WINDOW_H_ |
OLD | NEW |