Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: win8/metro_driver/metro_driver_win7.cc

Issue 335463005: EOL change of the file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/metro_driver_win7.cc
diff --git a/win8/metro_driver/metro_driver_win7.cc b/win8/metro_driver/metro_driver_win7.cc
index ace0d940e6baff899ceeb50e8d63a043e5d93f10..e357fe6a073285c98b87f0b45148e712ce673289 100644
--- a/win8/metro_driver/metro_driver_win7.cc
+++ b/win8/metro_driver/metro_driver_win7.cc
@@ -143,241 +143,241 @@ class MouseEvent : public mswr::RuntimeClass<
}
// IPointerEventArgs implementation.
- virtual HRESULT STDMETHODCALLTYPE get_CurrentPoint(
- winui::Input::IPointerPoint** point) {
- return QueryInterface(winui::Input::IID_IPointerPoint,
- reinterpret_cast<void**>(point));
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_KeyModifiers(
- winsys::VirtualKeyModifiers* modifiers) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE GetIntermediatePoints(
- winfoundtn::Collections::IVector<winui::Input::PointerPoint*>** points) {
- return E_NOTIMPL;
- }
-
- // IPointerPoint implementation.
- virtual HRESULT STDMETHODCALLTYPE get_PointerDevice(
- windevs::Input::IPointerDevice** pointer_device) {
- return QueryInterface(windevs::Input::IID_IPointerDevice,
- reinterpret_cast<void**>(pointer_device));
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Position(winfoundtn::Point* position) {
- static float scale = GetModernUIScale();
- // Scale down the points here as they are scaled up on the other side.
- position->X = gfx::ToRoundedInt(CR_GET_X_LPARAM(msg_.lParam) / scale);
- position->Y = gfx::ToRoundedInt(CR_GET_Y_LPARAM(msg_.lParam) / scale);
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_PointerId(uint32* pointer_id) {
- // TODO(ananta)
- // Implement this properly.
- *pointer_id = 1;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Timestamp(uint64* timestamp) {
- *timestamp = msg_.time;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Properties(
- winui::Input::IPointerPointProperties** properties) {
- return QueryInterface(winui::Input::IID_IPointerPointProperties,
- reinterpret_cast<void**>(properties));
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_RawPosition(
- winfoundtn::Point* position) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_FrameId(uint32* frame_id) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsInContact(boolean* in_contact) {
- return E_NOTIMPL;
- }
-
- // IPointerPointProperties implementation.
- virtual HRESULT STDMETHODCALLTYPE get_PointerUpdateKind(
- winui::Input::PointerUpdateKind* update_kind) {
- // TODO(ananta)
- // There is no WM_POINTERUPDATE equivalent on Windows 7. Look into
- // equivalents.
- if (msg_.message == WM_LBUTTONDOWN) {
- *update_kind = winui::Input::PointerUpdateKind_LeftButtonPressed;
- } else if (msg_.message == WM_RBUTTONDOWN) {
- *update_kind = winui::Input::PointerUpdateKind_RightButtonPressed;
- } else if (msg_.message == WM_MBUTTONDOWN) {
- *update_kind = winui::Input::PointerUpdateKind_MiddleButtonPressed;
- } else if (msg_.message == WM_LBUTTONUP) {
- *update_kind = winui::Input::PointerUpdateKind_LeftButtonReleased;
- } else if (msg_.message == WM_RBUTTONUP) {
- *update_kind = winui::Input::PointerUpdateKind_RightButtonReleased;
- } else if (msg_.message == WM_MBUTTONUP) {
- *update_kind = winui::Input::PointerUpdateKind_MiddleButtonReleased;
- }
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsLeftButtonPressed(
- boolean* left_button_pressed) {
- *left_button_pressed = msg_.wParam & MK_LBUTTON ? true : false;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsRightButtonPressed(
- boolean* right_button_pressed) {
- *right_button_pressed = msg_.wParam & MK_RBUTTON ? true : false;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsMiddleButtonPressed(
- boolean* middle_button_pressed) {
- *middle_button_pressed = msg_.wParam & MK_MBUTTON ? true : false;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsHorizontalMouseWheel(
- boolean* is_horizontal_mouse_wheel) {
- *is_horizontal_mouse_wheel =
- (msg_.message == WM_MOUSEHWHEEL) ? true : false;
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_MouseWheelDelta(int* delta) {
- if (msg_.message == WM_MOUSEWHEEL || msg_.message == WM_MOUSEHWHEEL) {
- *delta = GET_WHEEL_DELTA_WPARAM(msg_.wParam);
- return S_OK;
- } else {
- return S_FALSE;
- }
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Pressure(float* pressure) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsInverted(boolean* inverted) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsEraser(boolean* is_eraser) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Orientation(float* orientation) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_XTilt(float* x_tilt) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_YTilt(float* y_tilt) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_Twist(float* twist) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_ContactRect(winfoundtn::Rect* rect) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_ContactRectRaw(winfoundtn::Rect* rect) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_TouchConfidence(boolean* confidence) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsPrimary(boolean* is_primary) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsInRange(boolean* is_in_range) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsCanceled(boolean* is_canceled) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsBarrelButtonPressed(
- boolean* is_barrel_button_pressed) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsXButton1Pressed(
- boolean* is_xbutton1_pressed) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsXButton2Pressed(
- boolean* is_xbutton2_pressed) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE HasUsage(uint32 usage_page,
- uint32 usage_id,
- boolean* has_usage) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE GetUsageValue(uint32 usage_page,
- uint32 usage_id,
- int32* usage_value) {
- return E_NOTIMPL;
- }
-
- // IPointerDevice implementation.
- virtual HRESULT STDMETHODCALLTYPE get_PointerDeviceType(
- windevs::Input::PointerDeviceType* device_type) {
- if (msg_.message == WM_TOUCH) {
- *device_type = windevs::Input::PointerDeviceType_Touch;
- } else {
- *device_type = windevs::Input::PointerDeviceType_Mouse;
- }
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_IsIntegrated(boolean* is_integrated) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_MaxContacts(uint32* contacts) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_PhysicalDeviceRect(
- winfoundtn::Rect* rect) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_ScreenRect(winfoundtn::Rect* rect) {
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_SupportedUsages(
- winfoundtn::Collections::IVectorView<
- windevs::Input::PointerDeviceUsage>** usages) {
- return E_NOTIMPL;
- }
-
- private:
- MSG msg_;
-
- DISALLOW_COPY_AND_ASSIGN(MouseEvent);
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentPoint(
+ winui::Input::IPointerPoint** point) {
+ return QueryInterface(winui::Input::IID_IPointerPoint,
+ reinterpret_cast<void**>(point));
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_KeyModifiers(
+ winsys::VirtualKeyModifiers* modifiers) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetIntermediatePoints(
+ winfoundtn::Collections::IVector<winui::Input::PointerPoint*>** points) {
+ return E_NOTIMPL;
+ }
+
+ // IPointerPoint implementation.
+ virtual HRESULT STDMETHODCALLTYPE get_PointerDevice(
+ windevs::Input::IPointerDevice** pointer_device) {
+ return QueryInterface(windevs::Input::IID_IPointerDevice,
+ reinterpret_cast<void**>(pointer_device));
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Position(winfoundtn::Point* position) {
+ static float scale = GetModernUIScale();
+ // Scale down the points here as they are scaled up on the other side.
+ position->X = gfx::ToRoundedInt(CR_GET_X_LPARAM(msg_.lParam) / scale);
+ position->Y = gfx::ToRoundedInt(CR_GET_Y_LPARAM(msg_.lParam) / scale);
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_PointerId(uint32* pointer_id) {
+ // TODO(ananta)
+ // Implement this properly.
+ *pointer_id = 1;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Timestamp(uint64* timestamp) {
+ *timestamp = msg_.time;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Properties(
+ winui::Input::IPointerPointProperties** properties) {
+ return QueryInterface(winui::Input::IID_IPointerPointProperties,
+ reinterpret_cast<void**>(properties));
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_RawPosition(
+ winfoundtn::Point* position) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_FrameId(uint32* frame_id) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsInContact(boolean* in_contact) {
+ return E_NOTIMPL;
+ }
+
+ // IPointerPointProperties implementation.
+ virtual HRESULT STDMETHODCALLTYPE get_PointerUpdateKind(
+ winui::Input::PointerUpdateKind* update_kind) {
+ // TODO(ananta)
+ // There is no WM_POINTERUPDATE equivalent on Windows 7. Look into
+ // equivalents.
+ if (msg_.message == WM_LBUTTONDOWN) {
+ *update_kind = winui::Input::PointerUpdateKind_LeftButtonPressed;
+ } else if (msg_.message == WM_RBUTTONDOWN) {
+ *update_kind = winui::Input::PointerUpdateKind_RightButtonPressed;
+ } else if (msg_.message == WM_MBUTTONDOWN) {
+ *update_kind = winui::Input::PointerUpdateKind_MiddleButtonPressed;
+ } else if (msg_.message == WM_LBUTTONUP) {
+ *update_kind = winui::Input::PointerUpdateKind_LeftButtonReleased;
+ } else if (msg_.message == WM_RBUTTONUP) {
+ *update_kind = winui::Input::PointerUpdateKind_RightButtonReleased;
+ } else if (msg_.message == WM_MBUTTONUP) {
+ *update_kind = winui::Input::PointerUpdateKind_MiddleButtonReleased;
+ }
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsLeftButtonPressed(
+ boolean* left_button_pressed) {
+ *left_button_pressed = msg_.wParam & MK_LBUTTON ? true : false;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsRightButtonPressed(
+ boolean* right_button_pressed) {
+ *right_button_pressed = msg_.wParam & MK_RBUTTON ? true : false;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsMiddleButtonPressed(
+ boolean* middle_button_pressed) {
+ *middle_button_pressed = msg_.wParam & MK_MBUTTON ? true : false;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsHorizontalMouseWheel(
+ boolean* is_horizontal_mouse_wheel) {
+ *is_horizontal_mouse_wheel =
+ (msg_.message == WM_MOUSEHWHEEL) ? true : false;
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_MouseWheelDelta(int* delta) {
+ if (msg_.message == WM_MOUSEWHEEL || msg_.message == WM_MOUSEHWHEEL) {
+ *delta = GET_WHEEL_DELTA_WPARAM(msg_.wParam);
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Pressure(float* pressure) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsInverted(boolean* inverted) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsEraser(boolean* is_eraser) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Orientation(float* orientation) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_XTilt(float* x_tilt) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_YTilt(float* y_tilt) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_Twist(float* twist) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_ContactRect(winfoundtn::Rect* rect) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_ContactRectRaw(winfoundtn::Rect* rect) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_TouchConfidence(boolean* confidence) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsPrimary(boolean* is_primary) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsInRange(boolean* is_in_range) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsCanceled(boolean* is_canceled) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsBarrelButtonPressed(
+ boolean* is_barrel_button_pressed) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsXButton1Pressed(
+ boolean* is_xbutton1_pressed) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsXButton2Pressed(
+ boolean* is_xbutton2_pressed) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE HasUsage(uint32 usage_page,
+ uint32 usage_id,
+ boolean* has_usage) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetUsageValue(uint32 usage_page,
+ uint32 usage_id,
+ int32* usage_value) {
+ return E_NOTIMPL;
+ }
+
+ // IPointerDevice implementation.
+ virtual HRESULT STDMETHODCALLTYPE get_PointerDeviceType(
+ windevs::Input::PointerDeviceType* device_type) {
+ if (msg_.message == WM_TOUCH) {
+ *device_type = windevs::Input::PointerDeviceType_Touch;
+ } else {
+ *device_type = windevs::Input::PointerDeviceType_Mouse;
+ }
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_IsIntegrated(boolean* is_integrated) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_MaxContacts(uint32* contacts) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_PhysicalDeviceRect(
+ winfoundtn::Rect* rect) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_ScreenRect(winfoundtn::Rect* rect) {
+ return E_NOTIMPL;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_SupportedUsages(
+ winfoundtn::Collections::IVectorView<
+ windevs::Input::PointerDeviceUsage>** usages) {
+ return E_NOTIMPL;
+ }
+
+ private:
+ MSG msg_;
+
+ DISALLOW_COPY_AND_ASSIGN(MouseEvent);
};
// This class implements the winrt interfaces needed to support keyboard
@@ -391,45 +391,45 @@ class KeyEvent : public mswr::RuntimeClass<
: msg_(msg) {}
// IKeyEventArgs implementation.
- virtual HRESULT STDMETHODCALLTYPE get_VirtualKey(
- winsys::VirtualKey* virtual_key) {
- *virtual_key = static_cast<winsys::VirtualKey>(msg_.wParam);
- return S_OK;
- }
-
- virtual HRESULT STDMETHODCALLTYPE get_KeyStatus(
- winui::Core::CorePhysicalKeyStatus* key_status) {
- // As per msdn documentation for the keyboard messages.
- key_status->RepeatCount = msg_.lParam & 0x0000FFFF;
- key_status->ScanCode = (msg_.lParam >> 16) & 0x00FF;
- key_status->IsExtendedKey = (msg_.lParam & (1 << 24));
- key_status->IsMenuKeyDown = (msg_.lParam & (1 << 29));
- key_status->WasKeyDown = (msg_.lParam & (1 << 30));
- key_status->IsKeyReleased = (msg_.lParam & (1 << 31));
- return S_OK;
- }
-
- // ICharacterReceivedEventArgs implementation.
- virtual HRESULT STDMETHODCALLTYPE get_KeyCode(uint32* key_code) {
- *key_code = msg_.wParam;
- return S_OK;
- }
-
- // IAcceleratorKeyEventArgs implementation.
- virtual HRESULT STDMETHODCALLTYPE get_EventType(
- winui::Core::CoreAcceleratorKeyEventType* event_type) {
- if (msg_.message == WM_SYSKEYDOWN) {
- *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemKeyDown;
- } else if (msg_.message == WM_SYSKEYUP) {
- *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemKeyUp;
- } else if (msg_.message == WM_SYSCHAR) {
- *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemCharacter;
- }
- return S_OK;
- }
-
- private:
- MSG msg_;
+ virtual HRESULT STDMETHODCALLTYPE get_VirtualKey(
+ winsys::VirtualKey* virtual_key) {
+ *virtual_key = static_cast<winsys::VirtualKey>(msg_.wParam);
+ return S_OK;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE get_KeyStatus(
+ winui::Core::CorePhysicalKeyStatus* key_status) {
+ // As per msdn documentation for the keyboard messages.
+ key_status->RepeatCount = msg_.lParam & 0x0000FFFF;
+ key_status->ScanCode = (msg_.lParam >> 16) & 0x00FF;
+ key_status->IsExtendedKey = (msg_.lParam & (1 << 24));
+ key_status->IsMenuKeyDown = (msg_.lParam & (1 << 29));
+ key_status->WasKeyDown = (msg_.lParam & (1 << 30));
+ key_status->IsKeyReleased = (msg_.lParam & (1 << 31));
+ return S_OK;
+ }
+
+ // ICharacterReceivedEventArgs implementation.
+ virtual HRESULT STDMETHODCALLTYPE get_KeyCode(uint32* key_code) {
+ *key_code = msg_.wParam;
+ return S_OK;
+ }
+
+ // IAcceleratorKeyEventArgs implementation.
+ virtual HRESULT STDMETHODCALLTYPE get_EventType(
+ winui::Core::CoreAcceleratorKeyEventType* event_type) {
+ if (msg_.message == WM_SYSKEYDOWN) {
+ *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemKeyDown;
+ } else if (msg_.message == WM_SYSKEYUP) {
+ *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemKeyUp;
+ } else if (msg_.message == WM_SYSCHAR) {
+ *event_type = winui::Core::CoreAcceleratorKeyEventType_SystemCharacter;
+ }
+ return S_OK;
+ }
+
+ private:
+ MSG msg_;
};
// The following classes are the emulation of the WinRT system as exposed
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698