summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 01:39:11 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 01:39:11 +0000
commitb0fb03b2e0785c550e753c933a26ae15cd49d230 (patch)
treed0529c53c2a38cbb7e0a2fdd15d75a58232cfafd /win8
parent26c8862de79d12c36b2f7735ec9e51b03e201a82 (diff)
downloadchromium_src-b0fb03b2e0785c550e753c933a26ae15cd49d230.zip
chromium_src-b0fb03b2e0785c550e753c933a26ae15cd49d230.tar.gz
chromium_src-b0fb03b2e0785c550e753c933a26ae15cd49d230.tar.bz2
EOL change of the file
BUG=nome TEST=none NOTRY=true R=ananta@chromium.org Review URL: https://codereview.chromium.org/335463005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/metro_driver_win7.cc548
1 files changed, 274 insertions, 274 deletions
diff --git a/win8/metro_driver/metro_driver_win7.cc b/win8/metro_driver/metro_driver_win7.cc
index ace0d94..e357fe6 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