1 /*++ @file 2 3 Copyright (c) 2006, Tristan Gingold. All rights reserved.<BR> 4 Portitions copyright (c) 2010 - 2011, Apple Inc. All rights reserved. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the 7 BSD License which accompanies this distribution. The full text of the 8 license may be found at http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 15 #ifndef _EMU_UGA_IO_H_ 16 #define _EMU_UGA_IO_H_ 17 18 #include <Protocol/SimplePointer.h> 19 #include <Protocol/SimpleTextIn.h> 20 #include <Protocol/SimpleTextInEx.h> 21 #include <Protocol/UgaDraw.h> 22 23 #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \ 24 { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } } 25 26 typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL; 27 28 typedef 29 EFI_STATUS 30 (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)( 31 EMU_GRAPHICS_WINDOW_PROTOCOL *Uga 32 ); 33 34 typedef 35 EFI_STATUS 36 (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)( 37 EMU_GRAPHICS_WINDOW_PROTOCOL *Uga, 38 UINT32 Width, 39 UINT32 Height 40 ); 41 42 typedef 43 EFI_STATUS 44 (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)( 45 EMU_GRAPHICS_WINDOW_PROTOCOL *Uga 46 ); 47 48 typedef 49 EFI_STATUS 50 (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)( 51 EMU_GRAPHICS_WINDOW_PROTOCOL *Uga, 52 EFI_KEY_DATA *key 53 ); 54 55 typedef 56 EFI_STATUS 57 (EFIAPI *EMU_GRAPHICS_WINDOWS_KEY_SET_STATE) ( 58 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows, 59 IN EFI_KEY_TOGGLE_STATE *KeyToggleState 60 ); 61 62 63 typedef 64 VOID 65 (EFIAPI *EMU_GRAPHICS_WINDOW_REGISTER_KEY_NOTIFY_CALLBACK) ( 66 IN VOID *Context, 67 IN EFI_KEY_DATA *KeyData 68 ); 69 70 typedef 71 EFI_STATUS 72 (EFIAPI *EMU_GRAPHICS_WINDOWS_REGISTER_KEY_NOTIFY) ( 73 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows, 74 IN EMU_GRAPHICS_WINDOW_REGISTER_KEY_NOTIFY_CALLBACK MakeCallBack, 75 IN EMU_GRAPHICS_WINDOW_REGISTER_KEY_NOTIFY_CALLBACK BreakCallBack, 76 IN VOID *Context 77 ); 78 79 80 typedef struct { 81 UINTN SourceX; 82 UINTN SourceY; 83 UINTN DestinationX; 84 UINTN DestinationY; 85 UINTN Width; 86 UINTN Height; 87 UINTN Delta; 88 } EMU_GRAPHICS_WINDOWS__BLT_ARGS; 89 90 typedef 91 EFI_STATUS 92 (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)( 93 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows, 94 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL, 95 IN EFI_UGA_BLT_OPERATION BltOperation, 96 IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args 97 ); 98 99 typedef 100 BOOLEAN 101 (EFIAPI *EMU_GRAPHICS_WINDOWS_IS_KEY_PRESSED) ( 102 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows, 103 IN EFI_KEY_DATA *KeyData 104 ); 105 106 typedef 107 EFI_STATUS 108 (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_POINTER)( 109 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows 110 ); 111 112 typedef 113 EFI_STATUS 114 (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_POINTER_STATE)( 115 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows, 116 EFI_SIMPLE_POINTER_STATE *state 117 ); 118 119 struct _EMU_GRAPHICS_WINDOW_PROTOCOL { 120 EMU_GRAPHICS_WINDOWS_SIZE Size; 121 EMU_GRAPHICS_WINDOWS_CHECK_KEY CheckKey; 122 EMU_GRAPHICS_WINDOWS_KEY_SET_STATE KeySetState; 123 EMU_GRAPHICS_WINDOWS_GET_KEY GetKey; 124 EMU_GRAPHICS_WINDOWS_REGISTER_KEY_NOTIFY RegisterKeyNotify; 125 EMU_GRAPHICS_WINDOWS_BLT Blt; 126 EMU_GRAPHICS_WINDOWS_IS_KEY_PRESSED IsKeyPressed; 127 EMU_GRAPHICS_WINDOWS_CHECK_POINTER CheckPointer; 128 EMU_GRAPHICS_WINDOWS_GET_POINTER_STATE GetPointerState; 129 }; 130 131 132 extern EFI_GUID gEmuGraphicsWindowProtocolGuid; 133 134 #endif 135