1 /**
2 	Based on Protocol/SimplePointer.h, original notice:
3 
4 	Simple Pointer protocol from the UEFI 2.0 specification.
5 	
6 	Abstraction of a very simple pointer device like a mouse or trackball.
7 	
8 	Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
9 	This program and the accompanying materials
10 	are licensed and made available under the terms and conditions of the BSD License
11 	which accompanies this distribution.  The full text of the license may be found at
12 	http://opensource.org/licenses/bsd-license.php
13 	
14 	THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 	WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 	
17 **/
18 module uefi.protocols.simplepointer;
19 import uefi.base;
20 import uefi.base_type;
21 
22 public:
23 extern (C):
24 enum EFI_GUID EFI_SIMPLE_POINTER_PROTOCOL_GUID = EFI_GUID(0x31878c87, 0xb75,
25         0x11d5, [0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d]);
26 alias EFI_SIMPLE_POINTER_PROTOCOL = _EFI_SIMPLE_POINTER_PROTOCOL;
27 struct EFI_SIMPLE_POINTER_STATE
28 {
29     ///
30     /// The signed distance in counts that the pointer device has been moved along the x-axis.
31     ///
32     INT32 RelativeMovementX;
33     ///
34     /// The signed distance in counts that the pointer device has been moved along the y-axis.
35     ///
36     INT32 RelativeMovementY;
37     ///
38     /// The signed distance in counts that the pointer device has been moved along the z-axis.
39     ///
40     INT32 RelativeMovementZ;
41     ///
42     /// If TRUE, then the left button of the pointer device is being
43     /// pressed. If FALSE, then the left button of the pointer device is not being pressed.
44     ///
45     BOOLEAN LeftButton;
46     ///
47     /// If TRUE, then the right button of the pointer device is being
48     /// pressed. If FALSE, then the right button of the pointer device is not being pressed.
49     ///
50     BOOLEAN RightButton;
51 }
52 
53 struct EFI_SIMPLE_POINTER_MODE
54 {
55     ///
56     /// The resolution of the pointer device on the x-axis in counts/mm.
57     /// If 0, then the pointer device does not support an x-axis.
58     ///
59     UINT64 ResolutionX;
60     ///
61     /// The resolution of the pointer device on the y-axis in counts/mm.
62     /// If 0, then the pointer device does not support an x-axis.
63     ///
64     UINT64 ResolutionY;
65     ///
66     /// The resolution of the pointer device on the z-axis in counts/mm.
67     /// If 0, then the pointer device does not support an x-axis.
68     ///
69     UINT64 ResolutionZ;
70     ///
71     /// TRUE if a left button is present on the pointer device. Otherwise FALSE.
72     ///
73     BOOLEAN LeftButton;
74     ///
75     /// TRUE if a right button is present on the pointer device. Otherwise FALSE.
76     ///
77     BOOLEAN RightButton;
78 }
79 /**
80 	Resets the pointer device hardware.
81 	
82 	@param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
83 	instance.
84 	@param  ExtendedVerification  Indicates that the driver may perform a more exhaustive
85 	verification operation of the device during reset.
86 	
87 	@retval EFI_SUCCESS           The device was reset.
88 	@retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.
89 	
90 **/
91 alias EFI_SIMPLE_POINTER_RESET = EFI_STATUS function(
92     EFI_SIMPLE_POINTER_PROTOCOL* This, BOOLEAN ExtendedVerification) @nogc nothrow;
93 /**
94 	Retrieves the current state of a pointer device.
95 	
96 	@param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
97 	instance.
98 	@param  State                 A pointer to the state information on the pointer device.
99 	
100 	@retval EFI_SUCCESS           The state of the pointer device was returned in State.
101 	@retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to
102 	GetState().
103 	@retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's
104 	current state.
105 	
106 **/
107 alias EFI_SIMPLE_POINTER_GET_STATE = EFI_STATUS function(
108     EFI_SIMPLE_POINTER_PROTOCOL* This, EFI_SIMPLE_POINTER_STATE* State) @nogc nothrow;
109 /// The EFI_SIMPLE_POINTER_PROTOCOL provides a set of services for a pointer
110 /// device that can use used as an input device from an application written
111 /// to this specification. The services include the ability to reset the
112 /// pointer device, retrieve get the state of the pointer device, and
113 /// retrieve the capabilities of the pointer device.
114 struct _EFI_SIMPLE_POINTER_PROTOCOL
115 {
116     EFI_SIMPLE_POINTER_RESET Reset;
117     EFI_SIMPLE_POINTER_GET_STATE GetState;
118     ///
119     /// Event to use with WaitForEvent() to wait for input from the pointer device.
120     ///
121     EFI_EVENT WaitForInput;
122     ///
123     /// Pointer to EFI_SIMPLE_POINTER_MODE data.
124     ///
125     EFI_SIMPLE_POINTER_MODE* Mode;
126 
127 }