1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_GFX_GTK_PRESERVE_WINDOW_H_
6 #define UI_GFX_GTK_PRESERVE_WINDOW_H_
12 #include "ui/base/ui_export.h"
14 // GtkFixed creates an X window when realized and destroys an X window
15 // when unrealized. GtkPreserveWindow allows overrides this
16 // behaviour. When preserve is set (via gtk_preserve_window_set_preserve),
17 // the X window is only destroyed when the widget is destroyed.
21 #define GTK_TYPE_PRESERVE_WINDOW \
22 (gtk_preserve_window_get_type())
23 #define GTK_PRESERVE_WINDOW(obj) \
24 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_PRESERVE_WINDOW, \
26 #define GTK_PRESERVE_WINDOW_CLASS(klass) \
27 (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_PRESERVE_WINDOW, \
28 GtkPreserveWindowClass))
29 #define GTK_IS_PRESERVE_WINDOW(obj) \
30 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_PRESERVE_WINDOW))
31 #define GTK_IS_PRESERVE_WINDOW_CLASS(klass) \
32 (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_PRESERVE_WINDOW))
33 #define GTK_PRESERVE_WINDOW_GET_CLASS(obj) \
34 (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_PRESERVE_WINDOW, \
35 GtkPreserveWindowClass))
37 typedef struct _GtkPreserveWindow GtkPreserveWindow
;
38 typedef struct _GtkPreserveWindowClass GtkPreserveWindowClass
;
40 struct _GtkPreserveWindow
{
45 struct _GtkPreserveWindowClass
{
46 GtkFixedClass parent_class
;
49 UI_EXPORT GType
gtk_preserve_window_get_type() G_GNUC_CONST
;
50 UI_EXPORT GtkWidget
* gtk_preserve_window_new();
52 // Whether or not we should preserve associated windows as the widget
53 // is realized or unrealized.
54 UI_EXPORT gboolean
gtk_preserve_window_get_preserve(GtkPreserveWindow
* widget
);
55 UI_EXPORT
void gtk_preserve_window_set_preserve(GtkPreserveWindow
* widget
,
58 // Whether or not someone else will gdk_window_resize the GdkWindow associated
59 // with this widget (needed by the GPU process to synchronize resizing
60 // with swapped between front and back buffer).
61 UI_EXPORT
void gtk_preserve_window_delegate_resize(GtkPreserveWindow
* widget
,
64 // Provide a function to return an AtkObject* when calls to get_accessible
65 // are made on this widget. The parameter |userdata| will be passed to the
67 UI_EXPORT
void gtk_preserve_window_set_accessible_factory(
68 GtkPreserveWindow
* widget
,
69 AtkObject
* (*factory
)(void* userdata
),
74 #endif // UI_GFX_GTK_PRESERVE_WINDOW_H_