- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / gtk / gtk_input_event_box.h
1 // Copyright (c) 2011 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.
4
5 #ifndef CHROME_BROWSER_UI_GTK_GTK_INPUT_EVENT_BOX_H_
6 #define CHROME_BROWSER_UI_GTK_GTK_INPUT_EVENT_BOX_H_
7
8 #include <gtk/gtk.h>
9
10 // GtkInputEventBox is like GtkEventBox, but with the following differences:
11 //  1. Only supports input (like gtk_event_box_set_visible_window(foo, FALSE).
12 //  2. Provides a method to get the GdkWindow (gtk_input_event_box_get_window).
13 //  (The GdkWindow created by GtkEventBox cannot be retrieved unless you use it
14 //  in visible mode.)
15 // TODO(mattm): Get rid of this class someday if Gtk adds a way to get the
16 // GtkEventBox event_window (https://bugzilla.gnome.org/show_bug.cgi?id=657380).
17
18 G_BEGIN_DECLS
19
20 #define GTK_TYPE_INPUT_EVENT_BOX                                 \
21     (gtk_input_event_box_get_type())
22 #define GTK_INPUT_EVENT_BOX(obj)                                 \
23     (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INPUT_EVENT_BOX, \
24                                 GtkInputEventBox))
25 #define GTK_INPUT_EVENT_BOX_CLASS(klass)                         \
26     (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INPUT_EVENT_BOX,  \
27                              GtkInputEventBoxClass))
28 #define GTK_IS_INPUT_EVENT_BOX(obj)                              \
29     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INPUT_EVENT_BOX))
30 #define GTK_IS_INPUT_EVENT_BOX_CLASS(klass)                      \
31     (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INPUT_EVENT_BOX))
32 #define GTK_INPUT_EVENT_BOX_GET_CLASS(obj)                       \
33     (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INPUT_EVENT_BOX,  \
34                                GtkInputEventBoxClass))
35
36 typedef struct _GtkInputEventBox GtkInputEventBox;
37 typedef struct _GtkInputEventBoxClass GtkInputEventBoxClass;
38
39 struct _GtkInputEventBox {
40   // Parent class.
41   GtkBin bin;
42 };
43
44 struct _GtkInputEventBoxClass {
45   GtkBinClass parent_class;
46 };
47
48 GType gtk_input_event_box_get_type();
49 GtkWidget* gtk_input_event_box_new();
50
51 // Get the GdkWindow |widget| uses for handling input events. Will be NULL if
52 // the widget has not been realized yet.
53 GdkWindow* gtk_input_event_box_get_window(GtkInputEventBox* widget);
54
55 G_END_DECLS
56
57 #endif  // CHROME_BROWSER_UI_GTK_GTK_INPUT_EVENT_BOX_H_