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 CHROME_COMMON_GTK_UTIL_H_ | 5 #ifndef CHROME_COMMON_GTK_UTIL_H_ |
6 #define CHROME_COMMON_GTK_UTIL_H_ | 6 #define CHROME_COMMON_GTK_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gfx/point.h" | 11 #include "base/gfx/point.h" |
12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
13 #include "chrome/common/x11_util.h" | 13 #include "chrome/common/x11_util.h" |
14 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
15 | 15 |
16 typedef struct _GtkWidget GtkWidget; | 16 typedef struct _GtkWidget GtkWidget; |
17 | 17 |
18 namespace event_utils { | 18 namespace event_utils { |
19 | 19 |
20 // Translates event flags into what kind of disposition they represent. | 20 // Translates event flags into what kind of disposition they represent. |
21 // For example, a middle click would mean to open a background tab. | 21 // For example, a middle click would mean to open a background tab. |
22 // event_flags are the state in the GdkEvent structure. | 22 // event_flags are the state in the GdkEvent structure. |
23 WindowOpenDisposition DispositionFromEventFlags(guint state); | 23 WindowOpenDisposition DispositionFromEventFlags(guint state); |
24 | 24 |
| 25 // Get the timestamp (milliseconds) out of a GdkEvent. |
| 26 // Returns 0 if the event has no timestamp. |
| 27 guint32 GetGdkEventTime(GdkEvent* event); |
| 28 |
25 } // namespace event_utils | 29 } // namespace event_utils |
26 | 30 |
27 namespace gtk_util { | 31 namespace gtk_util { |
28 | 32 |
29 // Constants relating to the layout of dialog windows: | 33 // Constants relating to the layout of dialog windows: |
30 // (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en) | 34 // (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en) |
31 | 35 |
32 // Spacing between controls of the same group. | 36 // Spacing between controls of the same group. |
33 const int kControlSpacing = 6; | 37 const int kControlSpacing = 6; |
34 | 38 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Returns the mirrored x value for |bounds| if the layout is RTL; otherwise, | 104 // Returns the mirrored x value for |bounds| if the layout is RTL; otherwise, |
101 // the original value is returned unchanged. | 105 // the original value is returned unchanged. |
102 int MirroredLeftPointForRect(GtkWidget* widget, const gfx::Rect& bounds); | 106 int MirroredLeftPointForRect(GtkWidget* widget, const gfx::Rect& bounds); |
103 | 107 |
104 // Returns true if the pointer is currently inside the widget. | 108 // Returns true if the pointer is currently inside the widget. |
105 bool WidgetContainsCursor(GtkWidget* widget); | 109 bool WidgetContainsCursor(GtkWidget* widget); |
106 | 110 |
107 } // namespace gtk_util | 111 } // namespace gtk_util |
108 | 112 |
109 #endif // CHROME_COMMON_GTK_UTIL_H_ | 113 #endif // CHROME_COMMON_GTK_UTIL_H_ |
OLD | NEW |