OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/libgtk2ui/gtk2_event_loop.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_event_loop.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <X11/X.h> | 10 #include <X11/X.h> |
11 | 11 |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "ui/gfx/x/x11_types.h" | 13 #include "ui/gfx/x/x11_types.h" |
14 | 14 |
15 namespace libgtk2ui { | 15 namespace libgtk2ui { |
16 | 16 |
17 // static | 17 // static |
18 Gtk2EventLoop* Gtk2EventLoop::GetInstance() { | 18 Gtk2EventLoop* Gtk2EventLoop::GetInstance() { |
19 return Singleton<Gtk2EventLoop>::get(); | 19 return base::Singleton<Gtk2EventLoop>::get(); |
20 } | 20 } |
21 | 21 |
22 Gtk2EventLoop::Gtk2EventLoop() { | 22 Gtk2EventLoop::Gtk2EventLoop() { |
23 gdk_event_handler_set(DispatchGdkEvent, NULL, NULL); | 23 gdk_event_handler_set(DispatchGdkEvent, NULL, NULL); |
24 } | 24 } |
25 | 25 |
26 Gtk2EventLoop::~Gtk2EventLoop() { | 26 Gtk2EventLoop::~Gtk2EventLoop() { |
27 gdk_event_handler_set(reinterpret_cast<GdkEventFunc>(gtk_main_do_event), | 27 gdk_event_handler_set(reinterpret_cast<GdkEventFunc>(gtk_main_do_event), |
28 NULL, NULL); | 28 NULL, NULL); |
29 } | 29 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 x_event.xkey.root = DefaultRootWindow(x_event.xkey.display); | 67 x_event.xkey.root = DefaultRootWindow(x_event.xkey.display); |
68 x_event.xkey.time = gdk_event_key.time; | 68 x_event.xkey.time = gdk_event_key.time; |
69 x_event.xkey.state = gdk_event_key.state; | 69 x_event.xkey.state = gdk_event_key.state; |
70 x_event.xkey.keycode = gdk_event_key.hardware_keycode; | 70 x_event.xkey.keycode = gdk_event_key.hardware_keycode; |
71 x_event.xkey.same_screen = true; | 71 x_event.xkey.same_screen = true; |
72 | 72 |
73 XPutBackEvent(x_event.xkey.display, &x_event); | 73 XPutBackEvent(x_event.xkey.display, &x_event); |
74 } | 74 } |
75 | 75 |
76 } // namespace libgtk2ui | 76 } // namespace libgtk2ui |
OLD | NEW |