iPXE
SimplePointer.h
Go to the documentation of this file.
00001 /** @file
00002   Simple Pointer protocol from the UEFI 2.0 specification.
00003 
00004   Abstraction of a very simple pointer device like a mouse or trackball.
00005 
00006   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
00007   This program and the accompanying materials
00008   are licensed and made available under the terms and conditions of the BSD License
00009   which accompanies this distribution.  The full text of the license may be found at
00010   http://opensource.org/licenses/bsd-license.php
00011 
00012   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00013   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00014 
00015 **/
00016 
00017 #ifndef __SIMPLE_POINTER_H__
00018 #define __SIMPLE_POINTER_H__
00019 
00020 FILE_LICENCE ( BSD3 );
00021 
00022 #define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
00023   { \
00024     0x31878c87, 0xb75, 0x11d5, {0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
00025   }
00026 
00027 typedef struct _EFI_SIMPLE_POINTER_PROTOCOL  EFI_SIMPLE_POINTER_PROTOCOL;
00028 
00029 //
00030 // Data structures
00031 //
00032 typedef struct {
00033   ///
00034   /// The signed distance in counts that the pointer device has been moved along the x-axis.
00035   ///
00036   INT32   RelativeMovementX;
00037   ///
00038   /// The signed distance in counts that the pointer device has been moved along the y-axis.
00039   ///
00040   INT32   RelativeMovementY;
00041   ///
00042   /// The signed distance in counts that the pointer device has been moved along the z-axis.
00043   ///
00044   INT32   RelativeMovementZ;
00045   ///
00046   /// If TRUE, then the left button of the pointer device is being
00047   /// pressed. If FALSE, then the left button of the pointer device is not being pressed.
00048   ///
00049   BOOLEAN LeftButton;
00050   ///
00051   /// If TRUE, then the right button of the pointer device is being
00052   /// pressed. If FALSE, then the right button of the pointer device is not being pressed.
00053   ///
00054   BOOLEAN RightButton;
00055 } EFI_SIMPLE_POINTER_STATE;
00056 
00057 typedef struct {
00058   ///
00059   /// The resolution of the pointer device on the x-axis in counts/mm.
00060   /// If 0, then the pointer device does not support an x-axis.
00061   ///
00062   UINT64  ResolutionX;
00063   ///
00064   /// The resolution of the pointer device on the y-axis in counts/mm.
00065   /// If 0, then the pointer device does not support an x-axis.
00066   ///
00067   UINT64  ResolutionY;
00068   ///
00069   /// The resolution of the pointer device on the z-axis in counts/mm.
00070   /// If 0, then the pointer device does not support an x-axis.
00071   ///
00072   UINT64  ResolutionZ;
00073   ///
00074   /// TRUE if a left button is present on the pointer device. Otherwise FALSE.
00075   ///
00076   BOOLEAN LeftButton;
00077   ///
00078   /// TRUE if a right button is present on the pointer device. Otherwise FALSE.
00079   ///
00080   BOOLEAN RightButton;
00081 } EFI_SIMPLE_POINTER_MODE;
00082 
00083 /**
00084   Resets the pointer device hardware.
00085 
00086   @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
00087                                 instance.
00088   @param  ExtendedVerification  Indicates that the driver may perform a more exhaustive
00089                                 verification operation of the device during reset.
00090 
00091   @retval EFI_SUCCESS           The device was reset.
00092   @retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.
00093 
00094 **/
00095 typedef
00096 EFI_STATUS
00097 (EFIAPI *EFI_SIMPLE_POINTER_RESET)(
00098   IN EFI_SIMPLE_POINTER_PROTOCOL            *This,
00099   IN BOOLEAN                                ExtendedVerification
00100   );
00101 
00102 /**
00103   Retrieves the current state of a pointer device.
00104 
00105   @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
00106                                 instance.
00107   @param  State                 A pointer to the state information on the pointer device.
00108 
00109   @retval EFI_SUCCESS           The state of the pointer device was returned in State.
00110   @retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to
00111                                 GetState().
00112   @retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's
00113                                 current state.
00114 
00115 **/
00116 typedef
00117 EFI_STATUS
00118 (EFIAPI *EFI_SIMPLE_POINTER_GET_STATE)(
00119   IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
00120   IN OUT EFI_SIMPLE_POINTER_STATE         *State
00121   );
00122 
00123 ///
00124 /// The EFI_SIMPLE_POINTER_PROTOCOL provides a set of services for a pointer
00125 /// device that can use used as an input device from an application written
00126 /// to this specification. The services include the ability to reset the
00127 /// pointer device, retrieve get the state of the pointer device, and
00128 /// retrieve the capabilities of the pointer device.
00129 ///
00130 struct _EFI_SIMPLE_POINTER_PROTOCOL {
00131   EFI_SIMPLE_POINTER_RESET      Reset;
00132   EFI_SIMPLE_POINTER_GET_STATE  GetState;
00133   ///
00134   /// Event to use with WaitForEvent() to wait for input from the pointer device.
00135   ///
00136   EFI_EVENT                     WaitForInput;
00137   ///
00138   /// Pointer to EFI_SIMPLE_POINTER_MODE data.
00139   ///
00140   EFI_SIMPLE_POINTER_MODE       *Mode;
00141 };
00142 
00143 extern EFI_GUID gEfiSimplePointerProtocolGuid;
00144 
00145 #endif