| 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 #ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 5 #ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
| 6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #if defined(OS_LINUX) | 11 #if defined(OS_LINUX) |
| 12 #include <gdk/gdk.h> | 12 #include <gdk/gdk.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include <set> | 15 #include <set> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
| 19 #include "views/views_api.h" | 19 #include "views/views_export.h" |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 | 22 |
| 23 #if defined(TOUCH_UI) | 23 #if defined(TOUCH_UI) |
| 24 // Dispatch an XEvent to the RootView. Return true if the event was dispatched | 24 // Dispatch an XEvent to the RootView. Return true if the event was dispatched |
| 25 // and handled, false otherwise. | 25 // and handled, false otherwise. |
| 26 bool VIEWS_API DispatchXEvent(XEvent* xevent); | 26 bool VIEWS_EXPORT DispatchXEvent(XEvent* xevent); |
| 27 | 27 |
| 28 // Keep a list of touch devices so that it is possible to determine if a pointer | 28 // Keep a list of touch devices so that it is possible to determine if a pointer |
| 29 // event is a touch-event or a mouse-event. | 29 // event is a touch-event or a mouse-event. |
| 30 void VIEWS_API SetTouchDeviceList(std::vector<unsigned int>& devices); | 30 void VIEWS_EXPORT SetTouchDeviceList(std::vector<unsigned int>& devices); |
| 31 #endif // TOUCH_UI | 31 #endif // TOUCH_UI |
| 32 | 32 |
| 33 // This class delegates the key messages to the associated FocusManager class | 33 // This class delegates the key messages to the associated FocusManager class |
| 34 // for the window that is receiving these messages for accelerator processing. | 34 // for the window that is receiving these messages for accelerator processing. |
| 35 class VIEWS_API AcceleratorHandler : public MessageLoop::Dispatcher { | 35 class VIEWS_EXPORT AcceleratorHandler : public MessageLoop::Dispatcher { |
| 36 public: | 36 public: |
| 37 AcceleratorHandler(); | 37 AcceleratorHandler(); |
| 38 | 38 |
| 39 // Dispatcher method. This returns true if an accelerator was processed by the | 39 // Dispatcher method. This returns true if an accelerator was processed by the |
| 40 // focus manager | 40 // focus manager |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 virtual bool Dispatch(const MSG& msg); | 42 virtual bool Dispatch(const MSG& msg); |
| 43 #elif defined(TOUCH_UI) | 43 #elif defined(TOUCH_UI) |
| 44 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch(XEvent* xev); | 44 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch(XEvent* xev); |
| 45 #else | 45 #else |
| 46 virtual bool Dispatch(GdkEvent* event); | 46 virtual bool Dispatch(GdkEvent* event); |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 51 // The keys currently pressed and consumed by the FocusManager. | 51 // The keys currently pressed and consumed by the FocusManager. |
| 52 std::set<WPARAM> pressed_keys_; | 52 std::set<WPARAM> pressed_keys_; |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); | 55 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace views | 58 } // namespace views |
| 59 | 59 |
| 60 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 60 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
| OLD | NEW |