OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "views/widget/native_widget_gtk.h" | 5 #include "views/widget/native_widget_gtk.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 <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
10 #include <X11/Xatom.h> | 10 #include <X11/Xatom.h> |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "ui/base/dragdrop/os_exchange_data.h" | 21 #include "ui/base/dragdrop/os_exchange_data.h" |
22 #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h" | 22 #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h" |
23 #include "ui/base/gtk/gtk_windowing.h" | 23 #include "ui/base/gtk/gtk_windowing.h" |
24 #include "ui/base/gtk/scoped_handle_gtk.h" | 24 #include "ui/base/gtk/scoped_handle_gtk.h" |
25 #include "ui/base/x/x11_util.h" | 25 #include "ui/base/x/x11_util.h" |
26 #include "ui/gfx/canvas_skia_paint.h" | 26 #include "ui/gfx/canvas_skia_paint.h" |
27 #include "ui/gfx/path.h" | 27 #include "ui/gfx/path.h" |
28 #include "views/views_delegate.h" | 28 #include "views/views_delegate.h" |
29 #include "views/controls/textfield/native_textfield_views.h" | 29 #include "views/controls/textfield/native_textfield_views.h" |
30 #include "views/focus/view_storage.h" | 30 #include "views/focus/view_storage.h" |
31 #include "views/ime/input_method_gtk.h" | |
31 #include "views/widget/drop_target_gtk.h" | 32 #include "views/widget/drop_target_gtk.h" |
32 #include "views/widget/gtk_views_fixed.h" | 33 #include "views/widget/gtk_views_fixed.h" |
33 #include "views/widget/gtk_views_window.h" | 34 #include "views/widget/gtk_views_window.h" |
34 #include "views/widget/tooltip_manager_gtk.h" | 35 #include "views/widget/tooltip_manager_gtk.h" |
35 #include "views/widget/widget_delegate.h" | 36 #include "views/widget/widget_delegate.h" |
36 #include "views/window/native_window_gtk.h" | 37 #include "views/window/native_window_gtk.h" |
37 | 38 |
38 #if defined(TOUCH_UI) | 39 #if defined(TOUCH_UI) |
39 #if defined(HAVE_XINPUT2) | 40 #if defined(HAVE_XINPUT2) |
40 #include <gdk/gdkx.h> | 41 #include <gdk/gdkx.h> |
41 | 42 |
42 #include "ui/gfx/gtk_util.h" | 43 #include "ui/gfx/gtk_util.h" |
43 #include "views/touchui/touch_factory.h" | 44 #include "views/touchui/touch_factory.h" |
44 #endif | 45 #endif |
45 #endif | 46 #endif |
46 | 47 |
47 #if defined(HAVE_IBUS) | 48 #if defined(HAVE_IBUS) |
48 #include "views/ime/input_method_ibus.h" | 49 #include "views/ime/input_method_ibus.h" |
49 #else | |
50 #include "views/ime/input_method_gtk.h" | |
51 #endif | 50 #endif |
52 | 51 |
53 using ui::OSExchangeData; | 52 using ui::OSExchangeData; |
54 using ui::OSExchangeDataProviderGtk; | 53 using ui::OSExchangeDataProviderGtk; |
55 using ui::ActiveWindowWatcherX; | 54 using ui::ActiveWindowWatcherX; |
56 | 55 |
57 namespace views { | 56 namespace views { |
58 | 57 |
59 namespace { | 58 namespace { |
60 | 59 |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
616 | 615 |
617 // Creates input method for toplevel widget after calling | 616 // Creates input method for toplevel widget after calling |
618 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is | 617 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is |
619 // already created at this point. | 618 // already created at this point. |
620 // TODO(suzhe): Always enable input method when we start to use | 619 // TODO(suzhe): Always enable input method when we start to use |
621 // RenderWidgetHostViewViews in normal ChromeOS. | 620 // RenderWidgetHostViewViews in normal ChromeOS. |
622 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) { | 621 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) { |
623 #if defined(HAVE_IBUS) | 622 #if defined(HAVE_IBUS) |
624 input_method_.reset(InputMethodIBus::IsInputMethodIBusEnabled() ? | 623 input_method_.reset(InputMethodIBus::IsInputMethodIBusEnabled() ? |
625 static_cast<InputMethod*>(new InputMethodIBus(this)) : | 624 static_cast<InputMethod*>(new InputMethodIBus(this)) : |
626 static_cast<InputMethod*>(new InputMethodGtk(this))); | 625 static_cast<InputMethod*>(new InputMethodGtk(this))); |
sadrul
2011/05/24 17:15:48
The GTK IM can be used optionally even when ibus i
| |
627 #else | 626 #else |
628 input_method_.reset(new InputMethodGtk(this)); | 627 input_method_.reset(new InputMethodGtk(this)); |
629 #endif | 628 #endif |
630 input_method_->Init(GetWidget()); | 629 input_method_->Init(GetWidget()); |
631 } | 630 } |
632 | 631 |
633 if (opacity_ != 255) | 632 if (opacity_ != 255) |
634 SetOpacity(opacity_); | 633 SetOpacity(opacity_); |
635 | 634 |
636 // Make sure we receive our motion events. | 635 // Make sure we receive our motion events. |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1806 | 1805 |
1807 // And now, notify them that they have a brand new parent. | 1806 // And now, notify them that they have a brand new parent. |
1808 for (NativeWidgets::iterator it = widgets.begin(); | 1807 for (NativeWidgets::iterator it = widgets.begin(); |
1809 it != widgets.end(); ++it) { | 1808 it != widgets.end(); ++it) { |
1810 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1809 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
1811 new_parent); | 1810 new_parent); |
1812 } | 1811 } |
1813 } | 1812 } |
1814 | 1813 |
1815 } // namespace views | 1814 } // namespace views |
OLD | NEW |