]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/Win/Host/WinGopScreen.c
EmulatorPkg/Win: Fix various typos
[mirror_edk2.git] / EmulatorPkg / Win / Host / WinGopScreen.c
index 0e1f1ff205aa85f4ccc33a6dab6e3730ef9e52c7..74011e225e3094f2e05a78e5db86e47c481b0ccb 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 Module Name:\r
 \r
@@ -303,7 +297,7 @@ WinNtWndSize (
   @param  X                      X location on graphics screen.\r
   @param  Y                      Y location on the graphics screen.\r
   @param  Width                  Width of BltBuffer.\r
-  @param  Height                 Hight of BltBuffer\r
+  @param  Height                 Height of BltBuffer\r
   @param  BltOperation           Operation to perform on BltBuffer and video memory\r
   @param  BltBuffer              Buffer containing data to blt into video buffer.\r
                                  This  buffer has a size of\r
@@ -317,7 +311,7 @@ WinNtWndSize (
 \r
   @retval EFI_SUCCESS            The palette is updated with PaletteArray.\r
   @retval EFI_INVALID_PARAMETER  BltOperation is not valid.\r
-  @retval EFI_DEVICE_ERROR       A hardware error occured writting to the video\r
+  @retval EFI_DEVICE_ERROR       A hardware error occurred writing to the video\r
                                  buffer.\r
 \r
 **/\r
@@ -405,6 +399,8 @@ WinNtGopThreadWindowProc (
   LPARAM                Index;\r
   EFI_INPUT_KEY         Key;\r
   BOOLEAN               AltIsPress;\r
+  INT32                 PosX;\r
+  INT32                 PosY;\r
 \r
   //\r
   // Use mTlsIndex global to get a Thread Local Storage version of Private.\r
@@ -533,6 +529,45 @@ WinNtGopThreadWindowProc (
     WinNtGopConvertParamToEfiKeyShiftState (Private, &wParam, &lParam, FALSE);\r
     return 0;\r
 \r
+  case WM_MOUSEMOVE:\r
+    PosX = GET_X_LPARAM (lParam);\r
+    PosY = GET_Y_LPARAM (lParam);\r
+\r
+    if (Private->PointerPreviousX != PosX) {\r
+      Private->PointerState.RelativeMovementX += (PosX - Private->PointerPreviousX);\r
+      Private->PointerPreviousX                = PosX;\r
+      Private->PointerStateChanged             = TRUE;\r
+    }\r
+\r
+    if (Private->PointerPreviousY != PosY) {\r
+      Private->PointerState.RelativeMovementY += (PosY - Private->PointerPreviousY);\r
+      Private->PointerPreviousY                = PosY;\r
+      Private->PointerStateChanged             = TRUE;\r
+    }\r
+\r
+    Private->PointerState.RelativeMovementZ  = 0;\r
+    return 0;\r
+\r
+  case WM_LBUTTONDOWN:\r
+    Private->PointerState.LeftButton = TRUE;\r
+    Private->PointerStateChanged     = TRUE;\r
+    return 0;\r
+\r
+  case WM_LBUTTONUP:\r
+    Private->PointerState.LeftButton = FALSE;\r
+    Private->PointerStateChanged     = TRUE;\r
+    return 0;\r
+\r
+  case WM_RBUTTONDOWN:\r
+    Private->PointerState.RightButton = TRUE;\r
+    Private->PointerStateChanged      = TRUE;\r
+    return 0;\r
+\r
+  case WM_RBUTTONUP:\r
+    Private->PointerState.RightButton = FALSE;\r
+    Private->PointerStateChanged      = TRUE;\r
+    return 0;\r
+\r
   case WM_CLOSE:\r
     //\r
     // This close message is issued by user, core is not aware of this,\r
@@ -558,11 +593,11 @@ WinNtGopThreadWindowProc (
 \r
 \r
 /**\r
-  This thread simulates the end of WinMain () aplication. Each Winow nededs\r
-  to process it's events. The messages are dispatched to\r
+  This thread simulates the end of WinMain () application. Each Window needs\r
+  to process its events. The messages are dispatched to\r
   WinNtGopThreadWindowProc ().\r
-  Be very careful sine WinNtGopThreadWinMain () and WinNtGopThreadWindowProc ()\r
-  are running in a seperate thread. We have to do this to process the events.\r
+  Be very careful since WinNtGopThreadWinMain () and WinNtGopThreadWindowProc ()\r
+  are running in a separate thread. We have to do this to process the events.\r
 \r
   @param  lpParameter            Handle of window to manage.\r
 \r
@@ -644,7 +679,7 @@ WinNtGopThreadWinMain (
                             );\r
 \r
   //\r
-  // The reset of this thread is the standard winows program. We need a sperate\r
+  // The reset of this thread is the standard windows program. We need a separate\r
   // thread since we must process the message loop to make windows act like\r
   // windows.\r
   //\r