OLD | NEW |
(Empty) | |
| 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 #pragma once |
| 8 |
| 9 #include <gdk/gdk.h> |
| 10 #include <gtk/gtk.h> |
| 11 |
| 12 // GtkInputEventBox is like GtkEventBox, but with the following differences: |
| 13 // 1. Only supports input (like gtk_event_box_set_visible_window(foo, FALSE). |
| 14 // 2. Provides a method to get the GdkWindow (gtk_input_event_box_get_window). |
| 15 // (The GdkWindow created by GtkEventBox cannot be retrieved unless you use it |
| 16 // in visible mode.) |
| 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_ |
OLD | NEW |