HiiDatabase.h revision 842f5579c7e2a313f56c576e4c5150f7f4793079
1/** @file 2 The file provides Database manager for HII-related data 3 structures. 4 5 Copyright (c) 2006 - 2007, Intel Corporation 6 All rights reserved. This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 14**/ 15 16#ifndef __HII_DATABASE_H__ 17#define __HII_DATABASE_H__ 18 19#define EFI_HII_DATABASE_PROTOCOL_GUID \ 20 { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } } 21 22 23typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL; 24 25// 26// ConfigurationS of HII. 27// 28#define GLYPH_WIDTH 8 29#define GLYPH_HEIGHT 19 30 31/** 32 33 Each package starts with a header, as defined above, which 34 indicates the size and type of the package. When added to a 35 pointer pointing to the start of the header, Length points at 36 the next package. The package lists form a package list when 37 concatenated together and terminated with an 38 EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The 39 type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII 40 packages, whose contents are determined by the Guid. The range 41 of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 42 through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system 43 firmware implementers. 44 45 @param Length The size of the package in bytes. 46 47 @param Type The package type. See EFI_HII_PACKAGE_TYPE_x, 48 below. 49 50 @param Data The package data, the format of which is 51 determined by Type. 52 53**/ 54typedef struct { 55 UINT32 Length:24; 56 UINT32 Type:8; 57 // UINT8 Data[...]; 58} EFI_HII_PACKAGE_HEADER; 59 60// 61// EFI_HII_PACKAGE_TYPE_x. 62// 63#define EFI_HII_PACKAGE_TYPE_ALL 0x00 64#define EFI_HII_PACKAGE_TYPE_GUID 0x01 65#define EFI_HII_PACKAGE_FORM_CONFIG 0x02 66#define EFI_HII_PACKAGE_FORM_APP 0x03 67#define EFI_HII_PACKAGE_STRINGS 0x04 68#define EFI_HII_PACKAGE_FONTS 0x05 69#define EFI_HII_PACKAGE_IMAGES 0x06 70#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 71#define EFI_HII_PACKAGE_DEVICE_PATH 0x08 72#define EFI_HII_PACKAGE_END 0x09 73#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0 74#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF 75 76 77/** 78 79 This header uniquely identifies the package list.and is placed 80 in front of a list of packages. Package lists with the same 81 PackageListGuid value should contain the same data set. Updated 82 versions should have updated GUIDs. 83 84 @param PackageListGuid The unique identifier applied to the 85 list of packages which follows. 86 87 88 @param PackageLength The size of the package list (in 89 bytes), including the header. 90 91**/ 92typedef struct { 93 EFI_GUID PackageListGuid; 94 UINT32 PackagLength; 95} EFI_HII_PACKAGE_LIST_HEADER; 96 97/** 98 99 The fonts must be presented in Unicode sort order. That is, 100 the primary sort key is the UnicodeWeight and the secondary 101 sort key is the SurrogateWeight. It is up to developers who 102 manage fonts to choose efficient mechanisms for accessing 103 fonts. The contiguous presentation can easily be used because 104 narrow and wide glyphs are not intermixed, so a binary search 105 is possible (hence the requirement that the glyphs be sorted 106 by weight). 107 108 @param Header The header contains a Length and Type field. 109 In the case of a font package, the type will 110 be EFI_HII_PACKAGE_SIMPLE_FONTS and the length 111 will be the total size of the font package 112 including the size of the narrow and wide 113 glyphs. See EFI_HII_PACKAGE_HEADER. 114 115 @param NumberOfNarrowGlyphs The number of NarrowGlyphs that 116 are included in the font package. 117 118 @param NumberOfWideGlyphs The number of WideGlyphs that are 119 included in the font package. 120 121 @param NarrowGlyphs An array of EFI_NARROW_GLYPH entries. 122 The number of entries is specified by 123 NumberOfNarrowGlyphs. 124 125 @param WideGlyphs An array of EFI_WIDE_GLYPH entries. The 126 number of entries is specified by 127 NumberOfWideGlyphs. To calculate the 128 offset of WideGlyphs, use the offset of 129 NarrowGlyphs and add the size of 130 EFI_NARROW_GLYPH multiplied by the 131 NumberOfNarrowGlyphs. 132 133*/ 134typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR { 135 EFI_HII_PACKAGE_HEADER Header; 136 UINT16 NumberOfNarrowGlyphs; 137 UINT16 NumberOfWideGlyphs; 138 // EFI_NARROW_GLYPH NarrowGlyphs[]; 139 // EFI_WIDE_GLYPH WideGlyphs[]; 140} EFI_HII_SIMPLE_FONT_PACKAGE_HDR; 141 142// 143// Contents of EFI_NARROW_GLYPH.Attributes 144// 145#define EFI_GLYPH_NON_SPACING 0x01 146#define EFI_GLYPH_WIDE 0x02 147 148/** 149 150 Glyphs are represented by two structures, one each for the two 151 sizes of glyphs. The narrow glyph (EFI_NARROW_GLYPH) is the 152 normal glyph used for text display. 153 154 @param UnicodeWeight The Unicode representation of the glyph. 155 The term weight is the technical term 156 for a character value. 157 158 @param Attributes The data element containing the glyph 159 definitions; see Related Definitions 160 below. 161 162 @param GlyphCol1 The column major glyph representation of the 163 character. Bits with values of one 164 indicate that the corresponding pixel is to 165 be on when normally displayed; those with 166 zero are off. 167 168**/ 169typedef struct { 170 CHAR16 UnicodeWeight; 171 UINT8 Attributes; 172 UINT8 GlyphCol1[19]; 173} EFI_NARROW_GLYPH; 174 175/** 176 177 Glyphs are represented via the two structures, one each for the 178 two sizes of glyphs. The wide glyph (EFI_WIDE_GLYPH) is large 179 enough to display logographic characters. 180 181 @param UnicodeWeight The Unicode representation of the glyph. 182 The term weight is the technical term 183 for a character value. 184 185 @param Attributes The data element containing the glyph 186 definitions; see Related Definitions in 187 EFI_NARROW_GLYPH for attribute values. 188 189 @param GlyphCol1, GlyphCol2 The column major glyph 190 representation of the character. 191 Bits with values of one indicate 192 that the corresponding pixel is 193 to be on when normally 194 displayed; those with zero are 195 off. 196 197 @param Pad Ensures that sizeof(EFI_WIDE_GLYPH) is twice the 198 sizeof(EFI_NARROW_GLYPH). The contents of Pad must 199 bezero. 200 201 202**/ 203typedef struct { 204 CHAR16 UnicodeWeight; 205 UINT8 Attributes; 206 UINT8 GlyphCol1[GLYPH_HEIGHT]; 207 UINT8 GlyphCol2[GLYPH_HEIGHT]; 208 UINT8 Pad[3]; 209} EFI_WIDE_GLYPH; 210 211 212// 213// EFI_HII_FONT_STYLE 214// 215typedef UINT32 EFI_HII_FONT_STYLE; 216#define EFI_HII_FONT_STYLE_BOLD 0x00000001 217#define EFI_HII_FONT_STYLE_ITALIC 0x00000002 218#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000 219#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000 220#define EFI_HII_FONT_STYLE_SHADOW 0x00040000 221#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000 222#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000 223 224// 225// EFI_HII_GLYPH_BLOCK.BlockType 226// 227#define EFI_HII_GIBT_END 0x00 228#define EFI_HII_GIBT_GLYPH 0x10 229#define EFI_HII_GIBT_GLYPHS 0x11 230#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12 231#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13 232#define EFI_HII_GIBT_DUPLICATE 0x20 233#define EFI_HII_GIBT_SKIP2 0x21 234#define EFI_HII_GIBT_SKIP1 0x22 235#define EFI_HII_GIBT_DEFAULTS 0x23 236#define EFI_HII_GIBT_EXT1 0x30 237#define EFI_HII_GIBT_EXT2 0x31 238#define EFI_HII_GIBT_EXT4 0x32 239 240/** 241 242 EFI_HII_GIBT_END block is found. When processing the glyph 243 blocks, each block refers to the current character value 244 (CharValueCurrent), which is initially set to one (1). Glyph 245 blocks of an unknown type should be skipped. If they cannot be 246 skipped, then processing halts. 247 248**/ 249typedef struct _EFI_HII_GLYPH_BLOCK { 250 UINT8 BlockType; 251 UINT8 BlockBody[1]; 252} EFI_HII_GLYPH_BLOCK; 253 254 255/** 256 257 @param Width Width of the character or character cell, in 258 pixels. For fixed-pitch fonts, this is the same 259 as the advance. 260 261 @param Height Height of the character or character cell, in 262 pixels. 263 264 @param OffsetX Offset to the horizontal edge of the character 265 cell. 266 267 @param OffsetY Offset to the vertical edge of the character 268 cell. 269 270 @param AdvanceX Number of pixels to advance to the right 271 when moving from the origin of the current 272 glyph to the origin of the next glyph. 273 274**/ 275typedef struct _EFI_HII_GLYPH_INFO { 276 UINT16 Width; 277 UINT16 Height; 278 INT16 OffsetX; 279 INT16 OffsetY; 280 INT16 AdvanceX; 281} EFI_HII_GLYPH_INFO; 282 283 284/** 285 286 Changes the default cell information used for subsequent 287 EFI_HII_GIBT_GLYPH_DEFAULT and EFI_HII_GIBT_GLYPHS_DEFAULT glyph 288 blocks. The cell information described by Cell remains in effect 289 until the next EFI_HII_GIBT_DEFAULTS is found. Prior to the 290 first EFI_HII_GIBT_DEFAULTS block, the cell information in the 291 fixed header are used. 292 293 @param Header Standard glyph block header, where 294 Header.BlockType = EFI_HII_GIBT_DEFAULTS. 295 296 @param Cell The new default cell information which will be 297 applied to all subsequent GLYPH_DEFAULT and 298 GLYPHS_DEFAULT blocks. 299 300**/ 301typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK { 302 EFI_HII_GLYPH_BLOCK Header; 303 EFI_HII_GLYPH_INFO Cell; 304} EFI_HII_GIBT_DEFAULTS_BLOCK; 305 306 307/** 308 309 Indicates that the glyph with character value CharValueCurrent 310 has the same glyph as a previously defined character value and 311 increments CharValueCurrent by one. 312 313 @param Header Standard glyph block header, where 314 Header.BlockType = EFI_HII_GIBT_DUPLICATE. 315 316 @param CharValue The previously defined character value with 317 the exact same glyph. 318 319**/ 320typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK { 321 EFI_HII_GLYPH_BLOCK Header; 322 CHAR16 CharValue; 323} EFI_HII_GIBT_DUPLICATE_BLOCK; 324 325 326/** 327 328 Any glyphs with a character value greater than or equal to 329 CharValueCurrent are empty. 330 331 @param Header Standard glyph block header, where 332 Header.BlockType = EFI_HII_GIBT_END. 333 334**/ 335typedef struct _EFI_GLYPH_GIBT_END_BLOCK { 336 EFI_HII_GLYPH_BLOCK Header; 337} EFI_GLYPH_GIBT_END_BLOCK; 338 339/** 340 341 These are reserved for future expansion, with length bytes 342 included so that they can be easily skipped. 343 344 @param Header Standard glyph block header, where 345 Header.BlockType = EFI_HII_GIBT_EXT1, 346 EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. 347 348 @param Length Size of the glyph block, in bytes. 349 350**/ 351typedef struct _EFI_HII_GIBT_EXT1_BLOCK { 352 EFI_HII_GLYPH_BLOCK Header; 353 UINT8 BlockType2; 354 UINT8 Length; 355} EFI_HII_GIBT_EXT1_BLOCK; 356 357 358/** 359 360 These are reserved for future expansion, with length bytes 361 included so that they can be easily skipped. 362 363 @param Header Standard glyph block header, where 364 Header.BlockType = EFI_HII_GIBT_EXT1, 365 EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. 366 367 @param Length Size of the glyph block, in bytes. 368 369**/ 370typedef struct _EFI_HII_GIBT_EXT2_BLOCK { 371 EFI_HII_GLYPH_BLOCK Header; 372 UINT8 BlockType2; 373 UINT16 Length; 374} EFI_HII_GIBT_EXT2_BLOCK; 375 376/** 377 378 These are reserved for future expansion, with length bytes 379 included so that they can be easily skipped. 380 381 @param Header Standard glyph block header, where 382 Header.BlockType = EFI_HII_GIBT_EXT1, 383 EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. 384 385 @param Length Size of the glyph block, in bytes. 386 387**/ 388typedef struct _EFI_HII_GIBT_EXT4_BLOCK { 389 EFI_HII_GLYPH_BLOCK Header; 390 UINT8 BlockType2; 391 UINT32 Length; 392} EFI_HII_GIBT_EXT4_BLOCK; 393 394 395/** 396 397 This block provides the bitmap for the character with the value 398 CharValueCurrent and increments CharValueCurrent by one. Each 399 glyph contains a glyph width and height, a drawing offset, 400 number of pixels to advance after drawing and then the encoded 401 bitmap. 402 403 @param Header Standard glyph block header, where 404 Header.BlockType = EFI_HII_GIBT_GLYPH. 405 406 @param Cell Contains the width and height of the encoded 407 bitmap (Cell.Width and Cell.Height), the number 408 of pixels (signed) right of the character cell 409 origin where the left edge of the bitmap should 410 be placed (Cell.OffsetX), the number of pixels 411 above the character cell origin where the top 412 edge of the bitmap should be placed 413 (Cell.OffsetY) and the number of pixels (signed) 414 to move right to find the origin for the next 415 charactercell (Cell.AdvanceX). 416 417 @param GlyphCount The number of glyph bitmaps. 418 419 @param BitmapData The bitmap data specifies a series of 420 pixels, one bit per pixel, left-to-right, 421 top-tobottom. Each glyph bitmap only 422 encodes the portion of the bitmap enclosed 423 by its character-bounding box, but the 424 entire glyph is padded out to the nearest 425 byte. The number of bytes per bitmap can 426 be calculated as: ((Cell.Width + 7)/8) * 427 Cell.Height. 428 429 430**/ 431typedef struct _EFI_HII_GIBT_GLYPH_BLOCK { 432 EFI_HII_GLYPH_BLOCK Header; 433 EFI_HII_GLYPH_INFO Cell; 434 UINT16 GlyphCount; 435 UINT8 BitmapData[1]; 436} EFI_HII_GIBT_GLYPH_BLOCK; 437 438/** 439 440 Provides the bitmaps for the characters with the values 441 CharValueCurrent through CharValueCurrent + Count -1 and 442 increments CharValueCurrent by Count. These glyphs have 443 identical cell information and the encoded bitmaps are exactly 444 the same number of byes. 445 446 @param Header Standard glyph block header, where 447 Header.BlockType = EFI_HII_GIBT_GLYPHS. 448 449 @param Cell Contains the width and height of the encoded 450 bitmap (Cell.Width and Cell.Height), the 451 number of pixels (signed) right of the 452 character cell origin where the left edge of 453 the bitmap should be placed (Cell.OffsetX), 454 the number of pixels above the character cell 455 origin where the top edge of the bitmap should 456 be placed (Cell.OffsetY) and the number of 457 pixels(signed) to move right to find the 458 origin for the next character cell 459 (Cell.AdvanceX). 460 461 @param BitmapData The bitmap data specifies a series of 462 pixels, one bit per pixel, left-to-right, 463 top-tobottom, for each glyph. Each glyph 464 bitmap only encodes the portion of the 465 bitmap enclosed by its character-bounding 466 box. The number of bytes per bitmap can be 467 calculated as: ((Cell.Width + 7)/8) * 468 Cell.Height. 469 470**/ 471typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK { 472 EFI_HII_GLYPH_BLOCK Header; 473 EFI_HII_GLYPH_INFO Cell; 474 UINT8 BitmapData[1]; 475} EFI_HII_GIBT_GLYPHS_BLOCK; 476 477/** 478 479 Provides the bitmap for the character with the value 480 CharValueCurrent and increments CharValueCurrent by 1. This 481 glyph uses the default cell information. The default cell 482 information is found in the font header or the most recently 483 processed EFI_HII_GIBT_DEFAULTS. 484 485 @param Header Standard glyph block header, where 486 Header.BlockType = EFI_HII_GIBT_GLYPH_DEFAULT. 487 488 @param BitmapData The bitmap data specifies a series of 489 pixels, one bit per pixel, left-to-right, 490 top-tobottom. Each glyph bitmap only 491 encodes the portion of the bitmap enclosed 492 by its character-bounding box. The number 493 of bytes per bitmap can be calculated as: 494 ((Global.Cell.Width + 7)/8) * 495 Global.Cell.Height. 496 497**/ 498typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK { 499 EFI_HII_GLYPH_BLOCK Header; 500 UINT8 BitmapData[1]; 501} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK; 502 503 504 505 506/** 507 508 Provides the bitmaps for the characters with the values 509 CharValueCurrent through CharValueCurrent + Count -1 and 510 increments CharValueCurrent by Count. These glyphs use the 511 default cell information and the encoded bitmaps have exactly 512 the same number of byes. 513 514 @param Header Standard glyph block header, where 515 Header.BlockType = 516 EFI_HII_GIBT_GLYPHS_DEFAULT. 517 518 @param Count Number of glyphs in the glyph block. 519 520 @param BitmapData The bitmap data specifies a series of 521 pixels, one bit per pixel, left-to-right, 522 top-tobottom, for each glyph. Each glyph 523 bitmap only encodes the portion of the 524 bitmap enclosed by its character-bounding 525 box. The number of bytes per bitmap can be 526 calculated as: ((Global.Cell.Width + 7)/8) 527 Global.Cell.Height. 528 529**/ 530typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK { 531 EFI_HII_GLYPH_BLOCK Header; 532 UINT16 Count; 533 UINT8 BitmapData[1]; 534} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK; 535 536/** 537 538 Increments the current character value CharValueCurrent by the 539 number specified. 540 541 @param Header Standard glyph block header, where BlockType = 542 EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2. 543 544 @param SkipCount The unsigned 8- or 16-bit value to add to 545 CharValueCurrent. 546 547**/ 548typedef struct _EFI_HII_GIBT_SKIP2_BLOCK { 549 EFI_HII_GLYPH_BLOCK Header; 550 UINT16 SkipCount; 551} EFI_HII_GIBT_SKIP2_BLOCK; 552 553 554/** 555 556 Increments the current character value CharValueCurrent by the 557 number specified. 558 559 @param Header Standard glyph block header, where BlockType = 560 EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2. 561 562 @param SkipCount The unsigned 8- or 16-bit value to add to 563 CharValueCurrent. 564 565**/ 566typedef struct _EFI_HII_GIBT_SKIP1_BLOCK { 567 EFI_HII_GLYPH_BLOCK Header; 568 UINT8 SkipCount; 569} EFI_HII_GIBT_SKIP1_BLOCK; 570 571 572/** 573 574 This package is created by NewPackageList() when the package 575 list is first added to the HII database by locating the 576 EFI_DEVICE_PATH_PROTOCOL attached to the driver handle passed in 577 to that function. 578 579**/ 580typedef EFI_DEVICE_PATH_PROTOCOL EFI_HII_DEVICE_PATH_PACKAGE_HDR; 581 582 583/** 584 585 This is a free-form package type designed to allow extensibility 586 by allowing the format to be specified using Guid. 587 588 @param Guid Identifier which describes the remaining data 589 within the package. 590 591**/ 592typedef struct _EFI_HII_GUID_PACKAGE_HDR { 593 EFI_GUID Guid; 594} EFI_HII_GUID_PACKAGE_HDR; 595 596 597/** 598 599 The Strings package record describes the mapping between string 600 identifiers and the actual text of the strings themselves. The 601 package consists of three parts: a fixed header, the string 602 information and the font information. 603 604 @param Header The standard package header, where Header.Type 605 = EFI_HII_PACKAGE_STRINGS. 606 607 @param HdrSize Size of this header. 608 609 @param StringInfoOffset Offset, relative to the start of 610 this header, of the string information. 611 612 @param LanguageWindow Specifies the default values placed in 613 the static and dynamic windows before 614 processing each SCSU-encoded strings. 615 616 617 @param LanguageName String identifier within the current 618 string package of the full name of the 619 language specified by Language. Language 620 Language of the strings, as specified by 621 RFC 3066. 622 623**/ 624typedef struct _EFI_HII_STRING_PACKAGE_HDR { 625 EFI_HII_PACKAGE_HEADER Header; 626 UINT32 HdrSize; 627 UINT32 StringInfoOffset; 628 CHAR16 LanguageWindow[16]; 629 EFI_STRING_ID LanguageName; 630 CHAR8 Language[1]; 631} EFI_HII_STRING_PACKAGE_HDR; 632 633 634 635/** 636 637 The fixed header consists of a standard record header and then 638 the character values in this section, the flags (including the 639 encoding method) and the offsets of the glyph information, the 640 glyph bitmaps and the character map. 641 642 @param Header The standard package header, where Header.Size 643 EFI_HII_PACKAGE_FONTS. 644 645 @param HdrSize Size of this header. 646 647 @param GlyphInfoOffset The offset, relative to the start of 648 this header, of a series of 649 variable-length glyph blocks, each 650 describing information about the 651 bitmap associated with a glyph. 652 653 @param Cell This contains the measurement of the widest and 654 tallest characters in the font (Cell.Width and 655 Cell.Height). It also contains the offset to the 656 horizontal and vertical origin point of the 657 character cell (Cell.OffsetX and Cell.OffsetY). 658 Finally, it contains the default AdvanceX. The 659 individual glyph's OffsetX and OffsetY value is 660 added to this position to determine where to 661 draw the top-left pixel of the character's 662 glyph. The character glyph's AdvanceX is added 663 to this position to determine the origin point 664 for the next character. 665 666 @param FontStyle The design style of the font, 1 bit per 667 style. See EFI_HII_FONT_STYLE. 668 669 @param FontFamily The null-terminated string with the name 670 of the font family to which the font 671 belongs. 672 673**/ 674typedef struct _EFI_HII_FONT_PACKAGE_HDR { 675 EFI_HII_PACKAGE_HEADER Header; 676 UINT32 HdrSize; 677 UINT32 GlyphBlockOffset; 678 EFI_HII_GLYPH_INFO Cell; 679 EFI_HII_FONT_STYLE FontStyle; 680 CHAR16 FontFamily[1]; 681} EFI_HII_FONT_PACKAGE_HDR; 682 683 684// 685// EFI_HII_STRING_BLOCK.BlockType 686// 687#define FI_HII_SIBT_END 0x00 688#define EFI_HII_SIBT_STRING_SCSU 0x10 689#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11 690#define EFI_HII_SIBT_STRINGS_SCSU 0x12 691#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13 692#define EFI_HII_SIBT_STRING_UCS2 0x14 693#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15 694#define EFI_HII_SIBT_STRINGS_UCS2 0x16 695#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17 696#define EFI_HII_SIBT_DUPLICATE 0x20 697#define EFI_HII_SIBT_SKIP2 0x21 698#define EFI_HII_SIBT_SKIP1 0x22 699#define EFI_HII_SIBT_EXT1 0x30 700#define EFI_HII_SIBT_EXT2 0x31 701#define EFI_HII_SIBT_EXT4 0x32 702#define EFI_HII_SIBT_FONT 0x40 703 704/** 705 706 String blocks specify the text and font for the current string 707 identifier and increment to the next string identifier. 708**/ 709typedef struct { 710 UINT8 BlockType; 711 UINT8 BlockBody[1]; 712} EFI_HII_STRING_BLOCK; 713 714 715/** 716 717 Indicates that the string with string identifier 718 StringIdCurrent is the same as a previously defined string and 719 increments StringIdCurrent by one. 720 721 @param Header Standard string block header, where 722 Header.BlockType = EFI_HII_SIBT_DUPLICATE. 723 724 @param StringId The string identifier of a previously 725 defined string with the exact same string 726 text. Description 727 728 729**/ 730typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK { 731 EFI_HII_STRING_BLOCK Header; 732 EFI_STRING_ID StringId; 733} EFI_HII_SIBT_DUPLICATE_BLOCK; 734 735/** 736 737 Any strings with a string identifier greater than or equal to 738 StringIdCurrent are empty. 739 740 @param Header Standard string block header, where 741 Header.BlockType = EFI_HII_SIBT_END. 742 743**/ 744typedef struct _EFI_HII_SIBT_END_BLOCK { 745 EFI_HII_STRING_BLOCK Header; 746} EFI_HII_SIBT_END_BLOCK; 747 748 749/** 750 751 These are reserved for future expansion, with length bytes 752 included so that they can be easily skip 753 754 @param Header Standard string block header, where 755 Header.BlockType = EFI_HII_SIBT_EXT1, 756 EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. 757 758 @param Length Size of the string block, in bytes. 759 760**/ 761typedef struct _EFI_HII_SIBT_EXT1_BLOCK { 762 EFI_HII_STRING_BLOCK Header; 763 UINT8 BlockType2; 764 UINT8 Length; 765} EFI_HII_SIBT_EXT1_BLOCK; 766 767/** 768 769 These are reserved for future expansion, with length bytes 770 included so that they can be easily skip 771 772 @param Header Standard string block header, where 773 Header.BlockType = EFI_HII_SIBT_EXT1, 774 EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. 775 776 @param Length Size of the string block, in bytes. 777 778**/ 779typedef struct _EFI_HII_SIBT_EXT2_BLOCK { 780 EFI_HII_STRING_BLOCK Header; 781 UINT8 BlockType2; 782 UINT16 Length; 783} EFI_HII_SIBT_EXT2_BLOCK; 784 785/** 786 787 These are reserved for future expansion, with length bytes 788 included so that they can be easily skip 789 790 @param Header Standard string block header, where 791 Header.BlockType = EFI_HII_SIBT_EXT1, 792 EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. 793 794 @param Length Size of the string block, in bytes. 795 796**/ 797typedef struct _EFI_HII_SIBT_EXT4_BLOCK { 798 EFI_HII_STRING_BLOCK Header; 799 UINT8 BlockType2; 800 UINT32 Length; 801} EFI_HII_SIBT_EXT4_BLOCK; 802 803/** 804 805 Associates a font identifier FontId with a font name FontName, 806 size FontSize and style FontStyle. This font identifier may be 807 used with the string blocks. The font identifier 0 is the 808 default font for those string blocks which do not specify a font 809 identifier. 810 811 @param Header Standard extended header, where 812 Header.BlockType = EFI_HII_SIBT_FONT. 813 814 @param FontId Font identifier, which must be unique within 815 the font package. 816 817 @param FontSize Character cell size, in pixels, of the font. 818 819 @param FontStyle Font style. 820 821 @param FontName Null-terminated font family name. 822 823**/ 824typedef struct _EFI_HII_SIBT_FONT_BLOCK { 825 EFI_HII_SIBT_EXT2_BLOCK Header; 826 UINT8 FontId; 827 UINT16 FontSize; 828 EFI_HII_FONT_STYLE FontStyle; 829 CHAR16 FontName[1]; 830} EFI_HII_SIBT_FONT_BLOCK; 831 832/** 833 834 Increments the current string identifier StringIdCurrent by the 835 number specified. 836 837 @param Header Standard string block header, where 838 Header.BlockType = EFI_HII_SIBT_SKIP1. 839 840 @param SkipCount The unsigned 8-bit value to add to 841 StringIdCurrent. 842 843**/ 844typedef struct _EFI_HII_SIBT_SKIP1_BLOCK { 845 EFI_HII_STRING_BLOCK Header; 846 UINT8 SkipCount; 847} EFI_HII_SIBT_SKIP1_BLOCK; 848 849/** 850 851 Increments the current string identifier StringIdCurrent by 852 the number specified. 853 854 @param Header Standard string block header, where 855 Header.BlockType = EFI_HII_SIBT_SKIP2. 856 857 @param SkipCount The unsigned 16-bit value to add to 858 StringIdCurrent. 859 860**/ 861typedef struct _EFI_HII_SIBT_SKIP2_BLOCK { 862 EFI_HII_STRING_BLOCK Header; 863 UINT16 SkipCount; 864} EFI_HII_SIBT_SKIP2_BLOCK; 865 866/** 867 868 This string block provides the SCSU-encoded text for the string 869 in the default font with string identifier StringIdCurrent and 870 increments StringIdCurrent by one. 871 872 @param Header Standard header where Header.BlockType = 873 EFI_HII_SIBT_STRING_SCSU. 874 875 @param StringText The string text is a null-terminated 876 string, which is assigned to the string 877 identifier StringIdCurrent. 878 879**/ 880typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK { 881 EFI_HII_STRING_BLOCK Header; 882 UINT8 StringText[1]; 883} EFI_HII_SIBT_STRING_SCSU_BLOCK; 884 885 886/** 887 888 This string block provides the SCSU-encoded text for the string 889 in the font specified by FontIdentifier with string identifier 890 StringIdCurrent and increments StringIdCurrent by one. 891 892 @param Header Standard string block header, where 893 Header.BlockType = EFI_HII_SIBT_STRING_SCSU_FONT. 894 895 @param FontIdentifier The identifier of the font to be used 896 as the starting font for the entire 897 string. The identifier must either be 898 0 for the default font or an 899 identifier previously specified by an 900 EFI_HII_SIBT_FONT block. Any string 901 characters that deviates from this 902 font family, size or style must 903 provide an explicit control character. 904 905 @param StringText The string text is a null-terminated 906 encoded string, which is assigned to the 907 string identifier StringIdCurrent. 908 909 910**/ 911typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK { 912 EFI_HII_STRING_BLOCK Header; 913 UINT8 FontIdentifier; 914 UINT8 StringText[1]; 915} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK; 916 917 918/** 919 920 This string block provides the SCSU-encoded text for StringCount 921 strings which have the default font and which have sequential 922 string identifiers. The strings are assigned the identifiers, 923 starting with StringIdCurrent and continuing through 924 StringIdCurrent + StringCount ??C 1. StringIdCurrent is 925 incremented by StringCount. 926 927 @param Header Standard header where Header.BlockType = 928 EFI_HII_SIBT_STRINGS_SCSU. 929 930 @param StringCount Number of strings in StringText. 931 932 @param StringText The strings, where each string is a 933 null-terminated encoded string. 934 935**/ 936typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK { 937 EFI_HII_STRING_BLOCK Header; 938 UINT16 StringCount; 939 UINT8 StringText[1]; 940} EFI_HII_SIBT_STRINGS_SCSU_BLOCK; 941 942 943/** 944 945 This string block provides the SCSU-encoded text for StringCount 946 strings which have the font specified by FontIdentifier and 947 which have sequential string identifiers. The strings are 948 assigned the identifiers, starting with StringIdCurrent and 949 continuing through StringIdCurrent + StringCount ??C 1. 950 StringIdCurrent is incremented by StringCount. 951 952 @param Header Standard header where Header.BlockType = 953 EFI_HII_SIBT_STRINGS_SCSU_FONT. 954 955 @param StringCount Number of strings in StringText. 956 957 @param FontIdentifier The identifier of the font to be used 958 as the starting font for the entire 959 string. The identifier must either be 960 0 for the default font or an 961 identifier previously specified by an 962 EFI_HII_SIBT_FONT block. Any string 963 characters that deviates from this 964 font family, size or style must 965 provide an explicit control character. 966 967 @param StringText The strings, where each string is a 968 null-terminated encoded string. 969 970**/ 971typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK { 972 EFI_HII_STRING_BLOCK Header; 973 UINT16 StringCount; 974 UINT8 FontIdentifier; 975 UINT8 StringText[1]; 976} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK; 977 978 979/** 980 981 This string block provides the UCS-2 encoded text for the string 982 in the default font with string identifier StringIdCurrent and 983 increments StringIdCurrent by one. 984 985 @param Header Standard header where Header.BlockType = 986 EFI_HII_SIBT_STRING_UCS2. 987 988 @param StringText The string text is a null-terminated UCS-2 989 string, which is assigned to the string 990 identifier StringIdCurrent. 991 992**/ 993typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK { 994 EFI_HII_STRING_BLOCK Header; 995 CHAR16 StringText[1]; 996} EFI_HII_SIBT_STRING_UCS2_BLOCK; 997 998 999/** 1000 1001 This string block provides the UCS-2 encoded text for the string 1002 in the font specified by FontIdentifier with string identifier 1003 StringIdCurrent and increments StringIdCurrent by one 1004 1005 @param Header Standard header where Header.BlockType = 1006 EFI_HII_SIBT_STRING_UCS2_FONT. 1007 1008 @param FontIdentifier The identifier of the font to be used 1009 as the starting font for the entire 1010 string. The identifier must either be 1011 0 for the default font or an 1012 identifier previously specified by an 1013 EFI_HII_SIBT_FONT block. Any string 1014 characters that deviates from this 1015 font family, size or style must 1016 provide an explicit control character. 1017 1018 @param StringText The string text is a null-terminated UCS-2 1019 string, which is assigned to the string 1020 identifier StringIdCurrent. 1021 1022**/ 1023typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK { 1024 EFI_HII_STRING_BLOCK Header; 1025 UINT8 FontIdentifier; 1026 CHAR16 StringText[1]; 1027} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK; 1028 1029 1030/** 1031 1032 This string block provides the UCS-2 encoded text for the 1033 strings in the default font with string identifiers 1034 StringIdCurrent to StringIdCurrent + StringCount - 1 and 1035 increments StringIdCurrent by StringCount. 1036 1037 @param Header Standard header where Header.BlockType = 1038 EFI_HII_SIBT_STRINGS_UCS2. 1039 1040 @param StringCount Number of strings in StringText. 1041 1042 @param StringText The string text is a series of 1043 null-terminated UCS-2 strings, which are 1044 assigned to the string identifiers 1045 StringIdCurrent.to StringIdCurrent + 1046 StringCount - 1. 1047 1048**/ 1049typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK { 1050 EFI_HII_STRING_BLOCK Header; 1051 UINT16 StringCount; 1052 CHAR16 StringText[1]; 1053} EFI_HII_SIBT_STRINGS_UCS2_BLOCK; 1054 1055 1056/** 1057 1058 The fixed header consists of a standard record header and the 1059 offsets of the image and palette information. 1060 1061 @param Header Standard package header, where Header.Type = 1062 EFI_HII_PACKAGE_IMAGES. ImageInfoOffset 1063 Offset, relative to this header, of the image 1064 information. If this is zero, then there are 1065 no images in the package. 1066 1067 @param PaletteInfoOffset Offset, relative to this header, of 1068 the palette information. If this is 1069 zero, then there are no palettes in 1070 the image package. 1071 1072**/ 1073typedef struct _EFI_HII_IMAGE_PACKAGE_HDR { 1074 EFI_HII_PACKAGE_HEADER Header; 1075 UINT32 ImageInfoOffset; 1076 UINT32 PaletteInfoOffset; 1077} EFI_HII_IMAGE_PACKAGE_HDR; 1078 1079 1080// 1081// EFI_HII_IMAGE_BLOCK 1082// 1083typedef struct _EFI_HII_IMAGE_BLOCK { 1084 UINT8 BlockType; 1085 UINT8 BlockBody[1]; 1086} EFI_HII_IMAGE_BLOCK; 1087 1088// 1089// EFI_HII_IMAGE_BLOCK.BlockType. 1090// 1091#define EFI_HII_IIBT_END 0x00 1092#define EFI_HII_IIBT_IMAGE_1BIT 0x10 1093#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11 1094#define EFI_HII_IIBT_IMAGE_4BIT 0x12 1095#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13 1096#define EFI_HII_IIBT_IMAGE_8BIT 0x14 1097#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15 1098#define EFI_HII_IIBT_IMAGE_24BIT 0x16 1099#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17 1100#define EFI_HII_IIBT_IMAGE_JPEG 0x18 1101#define EFI_HII_IIBT_DUPLICATE 0x20 1102#define EFI_HII_IIBT_SKIP2 0x21 1103#define EFI_HII_IIBT_SKIP1 0x22 1104#define EFI_HII_IIBT_EXT1 0x30 1105#define EFI_HII_IIBT_EXT2 0x31 1106#define EFI_HII_IIBT_EXT4 0x32 1107 1108 1109/** 1110 1111 Any images with an image identifier greater than or equal to 1112 ImageIdCurrent are empty. 1113 1114 @param Header Standard image block header, where 1115 Header.BlockType = EFI_HII_IIBT_END. 1116 1117**/ 1118typedef struct _EFI_HII_IIBT_END_BLOCK { 1119 EFI_HII_IMAGE_BLOCK Header; 1120} EFI_HII_IIBT_END_BLOCK; 1121 1122 1123/** 1124 1125 Future extensions for image records which need a length-byte 1126 length use this prefix. 1127 1128 @param Header Standard image block header, where 1129 Header.BlockType = EFI_HII_IIBT_EXT1, 1130 EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. 1131 1132 @param Length Size of the image block, in bytes, including 1133 the image block header. 1134 1135**/ 1136typedef struct _EFI_HII_IIBT_EXT1_BLOCK { 1137 EFI_HII_IMAGE_BLOCK Header; 1138 UINT8 BlockType2; 1139 UINT8 Length; 1140} EFI_HII_IIBT_EXT1_BLOCK; 1141 1142/** 1143 1144 Future extensions for image records which need a length-byte 1145 length use this prefix. 1146 1147 @param Header Standard image block header, where 1148 Header.BlockType = EFI_HII_IIBT_EXT1, 1149 EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. 1150 1151 @param Length Size of the image block, in bytes, including 1152 the image block header. 1153 1154**/ 1155typedef struct _EFI_HII_IIBT_EXT2_BLOCK { 1156 EFI_HII_IMAGE_BLOCK Header; 1157 UINT8 BlockType2; 1158 UINT16 Length; 1159} EFI_HII_IIBT_EXT2_BLOCK; 1160 1161/** 1162 1163 Future extensions for image records which need a length-byte 1164 length use this prefix. 1165 1166 @param Header Standard image block header, where 1167 Header.BlockType = EFI_HII_IIBT_EXT1, 1168 EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. 1169 1170 @param Length Size of the image block, in bytes, including 1171 the image block header. 1172 1173**/ 1174typedef struct _EFI_HII_IIBT_EXT4_BLOCK { 1175 EFI_HII_IMAGE_BLOCK Header; 1176 UINT8 BlockType2; 1177 UINT32 Length; 1178} EFI_HII_IIBT_EXT4_BL0CK; 1179 1180// 1181// EFI_HII_IIBT_IMAGE_1BIT_BASE 1182// 1183typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE { 1184 UINT16 Width; 1185 UINT16 Height; 1186 // UINT8 Data[...]; 1187} EFI_HII_IIBT_IMAGE_1BIT_BASE; 1188 1189/** 1190 1191 This record assigns the 1-bit-per-pixel bitmap data to the 1192 ImageIdCurrent identifier and increment ImageIdCurrent by one. 1193 The data in the EFI_HII_IMAGE_1BIT_TRANS structure is exactly 1194 the same as the EFI_HII_IMAGE_1BIT structure, the difference is 1195 how the data is treated. The bitmap pixel value 0 is the 1196 transparency value and will not be written to the 1197 screen. The bitmap pixel value 1 will be translated to the color 1198 specified by Palette. 1199 1200 @param Header Standard image header, where Header.BlockType 1201 = EFI_HII_IIBT_IMAGE_1BIT_TRANS. 1202 1203 @param PaletteIndex Index of the palette in the palette 1204 information. 1205 1206 @param Bitmap The bitmap specifies a series of pixels, one 1207 bit per pixel, left-to-right, top-to-bottom, 1208 and is padded out to the nearest byte. The 1209 number of bytes per bitmap can be calculated 1210 as: ((Width + 7)/8) * Height. 1211 1212**/ 1213typedef struct _EFI_HII_IBIT_IMAGE_1BIT_BLOCK { 1214 EFI_HII_IMAGE_BLOCK Header; 1215 UINT8 PaletteIndex; 1216 EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; 1217} EFI_HII_IIBT_IMAGE_1BIT_BLOCK; 1218 1219typedef EFI_HII_IIBT_IMAGE_1BIT_BLOCK EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK; 1220 1221 1222// 1223// EFI_HII_RGB_PIXEL 1224// 1225typedef struct _EFI_HII_RGB_PIXEL { 1226 UINT8 b; 1227 UINT8 g; 1228 UINT8 r; 1229} EFI_HII_RGB_PIXEL; 1230 1231// 1232// FI_HII_IIBT_IMAGE_24BIT_BASE 1233// 1234typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE { 1235 UINT16 Width; 1236 UINT16 Height; 1237 // EFI_HII_RGB_PIXEL Bitmap[...]; 1238} EFI_HII_IIBT_IMAGE_24BIT_BASE; 1239 1240/** 1241 1242 This record assigns the 24-bit-per-pixel bitmap data to the 1243 ImageIdCurrent identifier and increment ImageIdCurrent by one. 1244 The image's upper left hand corner pixel is composed of the 1245 first three bitmap bytes. The first byte is the pixel????s blue 1246 component value, the next byte is the pixel????s green component 1247 value, and the third byte is the pixel's red component value 1248 (B,G,R). Each color component value can vary from 0x00 (color 1249 off) to 0xFF (color full on), allowing 16.8 millions colors that 1250 can be specified. 1251 1252 @param Header Standard image header, where Header.BlockType 1253 = EFI_HII_IIBT_IMAGE_24BIT. Bitmap The bitmap 1254 specifies a series of pixels, 24 bits per 1255 pixel, left-to-right, top-to-bottom. The 1256 number of bytes per bitmap can be calculated 1257 as: (Width * 3) * Height. 1258 1259 @param Type See EFI_HII_RGB_PIXEL definition. 1260 1261**/ 1262typedef struct { 1263 EFI_HII_IMAGE_BLOCK Header; 1264 EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; 1265} EFI_HII_IIBT_IMAGE_24BIT_BLOCK; 1266 1267typedef EFI_HII_IIBT_IMAGE_24BIT_BLOCK EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK; 1268 1269 1270 1271// 1272// EFI_HII_IIBT_IMAGE_4BIT_BASE 1273// 1274typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE { 1275 UINT16 Width; 1276 UINT16 Height; 1277 // UINT8 Data[...]; 1278} EFI_HII_IIBT_IMAGE_4BIT_BASE; 1279 1280/** 1281 1282 This record assigns the 4-bit-per-pixel bitmap data to the 1283 ImageIdCurrent identifier using the specified palette and 1284 increment ImageIdCurrent by one. The image????s upper left hand 1285 corner pixel is the most significant nibble of the first bitmap 1286 byte. 1287 1288 @param Header Standard image header, where Header.BlockType 1289 = EFI_HII_IIBT_IMAGE_4BIT. 1290 1291 @param PaletteIndex Index of the palette in the palette 1292 information. 1293 1294 @param Bitmap The bitmap specifies a series of pixels, four 1295 bits per pixel, left-to-right, top-to-bottom, 1296 and is padded out to the nearest byte. The 1297 number of bytes per bitmap can be calculated 1298 as: ((Width + 1)/2) Height. 1299 1300**/ 1301typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK { 1302 EFI_HII_IMAGE_BLOCK Header; 1303 UINT8 PaletteIndex; 1304 EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; 1305} EFI_HII_IIBT_IMAGE_4BIT_BLOCK; 1306 1307typedef EFI_HII_IIBT_IMAGE_4BIT_BLOCK EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK; 1308 1309 1310 1311// 1312// EFI_HII_IIBT_IMAGE_8BIT_BASE 1313// 1314typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE { 1315 UINT16 Width; 1316 UINT16 Height; 1317 // UINT8 Data[...]; 1318} EFI_HII_IIBT_IMAGE_8BIT_BASE; 1319 1320/** 1321 1322 This record assigns the 8-bit-per-pixel bitmap data to the 1323 ImageIdCurrent identifier using the specified palette and 1324 increment ImageIdCurrent by one. The image????s upper left hand 1325 corner pixel is the first bitmap byte. 1326 1327 @param Header Standard image header, where Header.BlockType 1328 = EFI_HII_IIBT_IMAGE_8BIT. 1329 1330 @param PaletteIndex Index of the palette in the palette 1331 information. 1332 1333 @param Bitmap The bitmap specifies a series of pixels, eight 1334 bits per pixel, left-to-right, top-to-bottom. 1335 The number of bytes per bitmap can be 1336 calculated as: Width * Height. 1337 1338**/ 1339typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE { 1340 EFI_HII_IMAGE_BLOCK Header; 1341 UINT8 PaletteIndex; 1342 EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; 1343} EFI_HII_IIBT_IMAGE_8BIT_PALETTE; 1344 1345typedef EFI_HII_IIBT_IMAGE_8BIT_PALETTE EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK; 1346 1347 1348/** 1349 1350 Indicates that the image with image ID ImageValueCurrent has the 1351 same image as a previously defined image ID and increments 1352 ImageValueCurrent by one 1353 1354 @param Header Standard image header, where Header.BlockType 1355 = EFI_HII_IIBT_DUPLICATE. 1356 1357 @param ImageId The previously defined image ID with the exact 1358 same image. 1359 1360 1361**/ 1362typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK { 1363 EFI_HII_IMAGE_BLOCK Header; 1364 EFI_IMAGE_ID ImageId; 1365} EFI_HII_IIBT_DUPLICATE_BLOCK; 1366 1367 1368/** 1369 1370 This record assigns the JPEG image data to the ImageIdCurrent 1371 identifier and increment ImageIdCurrent by one. The JPEG decoder 1372 is only required to cover the basic JPEG encoding types, which 1373 are produced by standard available paint packages (for example: 1374 MSPaint under Windows from Microsoft). This would include JPEG 1375 encoding of high (1:1:1) and medium (4:1:1) quality with only 1376 three components (R,G,B) ??C no support for the special gray 1377 component encoding. 1378 1379 @param Header Standard image header, where Header.BlockType 1380 = EFI_HII_IIBT_IMAGE_JPEG. 1381 1382 @param Size Specifies the size of the JPEG encoded data. 1383 1384 @param Data JPEG encoded data with ????JFIF???? signature at 1385 offset 6 in the data block. The JPEG encoded 1386 data, specifies type of encoding and final size 1387 of true-color image. 1388 1389**/ 1390typedef struct _EFI_HII_IIBT_JPEG { 1391 EFI_HII_IMAGE_BLOCK Header; 1392 UINT32 Size; 1393 //UINT8 Data[ �� ]; 1394} EFI_HII_IIBT_JPEG; 1395 1396 1397/** 1398 1399 Increments the current image ID ImageIdCurrent by the number 1400 specified. 1401 1402 @param Header Standard image header, where Header.BlockType 1403 = EFI_HII_IIBT_SKIP1. 1404 1405 @param SkipCount The unsigned 8-bit value to add to 1406 ImageIdCurrent. 1407 1408**/ 1409typedef struct _EFI_HII_IIBT_SKIP1_BLOCK { 1410 EFI_HII_IMAGE_BLOCK Header; 1411 UINT8 SkipCount; 1412} EFI_HII_IIBT_SKIP1_BLOCK; 1413 1414/** 1415 1416 Increments the current image ID ImageIdCurrent by the number 1417 specified. 1418 1419 @param Header Standard image header, where Header.BlockType 1420 = EFI_HII_IIBT_SKIP2. 1421 1422 @param SkipCount The unsigned 16-bit value to add to 1423 ImageIdCurrent. 1424 1425**/ 1426typedef struct _EFI_HII_IIBT_SKIP2_BLOCK { 1427 EFI_HII_IMAGE_BLOCK Header; 1428 UINT16 SkipCount; 1429} EFI_HII_IIBT_SKIP2_BLOCK; 1430 1431 1432/** 1433 1434 This fixed header is followed by zero or more variable-length 1435 palette information records. The structures are assigned a 1436 number 1 to n. 1437 1438 @param PaletteCount Number of palettes. 1439 1440**/ 1441typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER { 1442 UINT16 PaletteCount; 1443} EFI_HII_IMAGE_PALETTE_INFO_HEADER; 1444 1445/** 1446 1447 Each palette information record is an array of 24-bit color 1448 structures. The first entry (PaletteValue[0]) corresponds to 1449 color 0 in the source image; the second entry (PaletteValue[1]) 1450 corresponds to color 1, etc. Each palette entry is a three byte 1451 entry, with the first byte equal to the blue component of the 1452 color, followed by green, and finally red (B,G,R). Each color 1453 component value can vary from 0x00 (color off) to 0xFF (color 1454 full on), allowing 16.8 millions colors that can be specified. 1455 1456 @param PaletteSize Size of the palette information. 1457 1458 @param PaletteValue Array of color values. 1459 1460**/ 1461typedef struct _EFI_HII_IMAGE_PALETTE_INFO { 1462 UINT16 PaletteSize; 1463 // EFI_HII_RGB_PIXEL PaletteValue[...]; 1464} EFI_HII_IMAGE_PALETTE_INFO; 1465 1466 1467 1468// 1469// EFI_HII_DATABASE_NOTIFY_TYPE 1470// 1471typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE; 1472#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001 1473#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002 1474#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004 1475#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008 1476/** 1477 1478 Functions which are registered to receive notification of 1479 database events have this prototype. The actual event is encoded 1480 in NotifyType. The following table describes how PackageType, 1481 PackageGuid, Handle, and Package are used for each of the 1482 notification types. 1483 1484 @param PackageType Package type of the notification. 1485 1486 @param PackageGuid If PackageType is 1487 EFI_HII_PACKAGE_TYPE_GUID, then this is 1488 the pointer to the GUID from the Guid 1489 field of EFI_HII_PACKAGE_GUID_HEADER. 1490 Otherwise, it must be NULL. 1491 1492 @param Package Points to the package referred to by the 1493 notification Handle The handle of the package 1494 list which contains the specified package. 1495 1496 @param NotifyType The type of change concerning the 1497 database. See 1498 EFI_HII_DATABASE_NOTIFY_TYPE. 1499 1500**/ 1501typedef 1502EFI_STATUS 1503(EFIAPI *EFI_HII_DATABASE_NOTIFY) ( 1504 IN CONST UINT8 PackageType, 1505 IN CONST EFI_GUID *PackageGuid, 1506 IN CONST EFI_HII_PACKAGE_HEADER *Package, 1507 IN CONST EFI_HII_HANDLE Handle, 1508 IN CONST EFI_HII_DATABASE_NOTIFY_TYPE NotifyType 1509); 1510 1511/** 1512 1513 This function adds the packages in the package list to the 1514 database and returns a handle. If there is a 1515 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then 1516 this function will create a package of type 1517 EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. For 1518 each package in the package list, registered functions with the 1519 notification type NEW_PACK and having the same package type will 1520 be called. For each call to NewPackageList(), there should be a 1521 corresponding call to 1522 EFI_HII_DATABASE_PROTOCOL.RemovePackageList(). 1523 1524 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1525 instance. 1526 1527 @param PackageList A pointer to an 1528 EFI_HII_PACKAGE_LIST_HEADER structure. 1529 1530 @param DriverHandle Associate the package list with this EFI 1531 handle Handle A pointer to the 1532 EFI_HII_HANDLE instance. 1533 1534 @retval EFI_SUCCESS The package list associated with the 1535 Handle was added to the HII database. 1536 1537 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary 1538 resources for the new database 1539 contents. 1540 1541 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle 1542 is NULL. 1543 1544**/ 1545typedef 1546EFI_STATUS 1547(EFIAPI *EFI_HII_NEW_PACK) ( 1548 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1549 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, 1550 IN CONST EFI_HANDLE DriverHandle, 1551 OUT EFI_HII_HANDLE *Handle 1552); 1553 1554 1555/** 1556 1557 This function removes the package list that is associated with a 1558 handle Handle from the HII database. Before removing the 1559 package, any registered functions with the notification type 1560 REMOVE_PACK and the same package type will be called. For each 1561 call to EFI_HII_DATABASE_PROTOCOL.NewPackageList(), there should 1562 be a corresponding call to RemovePackageList. 1563 1564 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1565 instance. 1566 1567 @param Handle The handle that was registered to the data 1568 that is requested for removal. 1569 1570 @retval EFI_SUCCESS The data associated with the Handle was 1571 removed from the HII database. 1572 1573 @retval EFI_INVALID_PARAMETER The Handle was not valid. 1574 1575**/ 1576typedef 1577EFI_STATUS 1578(EFIAPI *EFI_HII_REMOVE_PACK) ( 1579 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1580 IN CONST EFI_HII_HANDLE Handle 1581); 1582 1583 1584/** 1585 1586 This function updates the existing package list (which has the 1587 specified Handle) in the HII databases, using the new package 1588 list specified by PackageList. The update process has the 1589 following steps: Collect all the package types in the package 1590 list specified by PackageList. A package type consists of the 1591 Type field of EFI_HII_PACKAGE_HEADER and, if the Type is 1592 EFI_HII_PACKAGE_TYPE_GUID, the Guid field, as defined in 1593 EFI_HII_PACKAGE_GUID_HEADER. Iterate through the packages within 1594 the existing package list in the HII database specified by 1595 Handle. If a package??s type matches one of the types collected 1596 in step 1, then perform the following steps: 1597 - Call any functions registered with the notification type 1598 REMOVE_PACK. 1599 - Remove the package from the package list and the HII 1600 database. 1601 Add all of the packages within the new package list specified 1602 by PackageList, using the following steps: 1603 - Add the package to the package list and the HII database. 1604 - Call any functions registered with the notification type 1605 ADD_PACK. 1606 1607 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1608 instance. 1609 1610 @param Handle The handle that was registered to the data 1611 that is requested for removal. 1612 1613 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST 1614 package. 1615 1616 @retval EFI_SUCCESS The HII database was successfully 1617 updated. 1618 1619 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory 1620 for the updated database. 1621 1622 @retval EFI_INVALID_PARAMETER The Handle was not valid. 1623 1624**/ 1625typedef 1626EFI_STATUS 1627(EFIAPI *EFI_HII_UPDATE_PACK) ( 1628 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1629 IN CONST EFI_HII_HANDLE Handle, 1630 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList 1631); 1632 1633 1634/** 1635 1636 This function returns a list of the package handles of the 1637 specified type that are currently active in the database. The 1638 pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package 1639 handles to be listed. 1640 1641 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1642 instance. 1643 1644 @param PackageType Specifies the package type of the packages 1645 to list or EFI_HII_PACKAGE_TYPE_ALL for 1646 all packages to be listed. 1647 1648 @param PackageGuid If PackageType is 1649 EFI_HII_PACKAGE_TYPE_GUID, then this is 1650 the pointer to the GUID which must match 1651 the Guid field of 1652 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it 1653 must be NULL. 1654 1655 @param HandleBufferLength On input, a pointer to the length 1656 of the handle buffer. On output, 1657 the length of the handle buffer 1658 that is required for the handles 1659 found. 1660 1661 @param Handle An array of EFI_HII_HANDLE instances returned. 1662 1663 1664 @retval EFI_SUCCESS Handle was updated successfully. 1665 1666 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter 1667 indicates that Handle is too 1668 small to support the number of 1669 handles. HandleBufferLength is 1670 updated with a value that will 1671 enable the data to fit. 1672 1673 1674**/ 1675typedef 1676EFI_STATUS 1677(EFIAPI *EFI_HII_LIST_PACKS) ( 1678 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1679 IN CONST UINT8 PackageType, 1680 IN CONST EFI_GUID *PackageGuid, 1681 IN OUT UINTN *HandleBufferLength, 1682 OUT EFI_HII_HANDLE *Handle 1683); 1684 1685 1686 1687 1688 1689 1690/** 1691 1692 This function will export one or all package lists in the 1693 database to a buffer. For each package list exported, this 1694 function will call functions registered with EXPORT_PACK and 1695 then copy the package list to the buffer. The registered 1696 functions may call EFI_HII_DATABASE_PROTOCOL.UpdatePackageList() 1697 to modify the package list before it is copied to the buffer. If 1698 the specified BufferSize is too small, then the status 1699 EFI_OUT_OF_RESOURCES will be returned and the actual package 1700 size will be returned in BufferSize. 1701 1702 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1703 instance. 1704 1705 @param Handle An EFI_HII_HANDLE that corresponds to the 1706 desired package list in the HII database to 1707 export or NULL to indicate all package lists 1708 should be exported. 1709 1710 @param BufferSize On input, a pointer to the length of the 1711 buffer. On output, the length of the 1712 buffer that is required for the exported 1713 data. 1714 1715 @param Buffer A pointer to a buffer that will contain the 1716 results of the export function. 1717 1718 1719 @retval EFI_SUCCESS Package exported. 1720 1721 @retval EFI_OUT_OF_RESOURCES BufferSize is too small to hold 1722 the package. 1723 1724**/ 1725typedef 1726EFI_STATUS 1727(EFIAPI *EFI_HII_EXPORT_PACKS) ( 1728 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1729 IN CONST EFI_HII_HANDLE Handle, 1730 IN OUT UINTN *BufferSize, 1731 OUT EFI_HII_PACKAGE_HEADER *Buffer 1732); 1733 1734 1735/** 1736 1737 1738 This function registers a function which will be called when 1739 specified actions related to packages of the specified type 1740 occur in the HII database. By registering a function, other 1741 HII-related drivers are notified when specific package types 1742 are added, removed or updated in the HII database. Each driver 1743 or application which registers a notification should use 1744 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before 1745 exiting. 1746 1747 1748 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1749 instance. 1750 1751 @param PackageType The package type. See 1752 EFI_HII_PACKAGE_TYPE_x in EFI_HII_PACKAGE_HEADER. 1753 1754 @param PackageGuid If PackageType is 1755 EFI_HII_PACKAGE_TYPE_GUID, then this is 1756 the pointer to the GUID which must match 1757 the Guid field of 1758 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it 1759 must be NULL. 1760 1761 @param PackageNotifyFn Points to the function to be called 1762 when the event specified by 1763 NotificationType occurs. See 1764 EFI_HII_DATABASE_NOTIFY. 1765 1766 @param NotifyType Describes the types of notification which 1767 this function will be receiving. See 1768 EFI_HII_DATABASE_NOTIFY_TYPE for more a 1769 list of types. 1770 1771 @param NotifyHandle Points to the unique handle assigned to 1772 the registered notification. Can be used 1773 in 1774 EFI_HII_DATABASE_PROTOCOL.UnregisterPack 1775 to stop notifications. 1776 1777 1778 @retval EFI_SUCCESS Notification registered successfully. 1779 1780 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary 1781 data structures. 1782 1783 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when 1784 PackageType is not 1785 EFI_HII_PACKAGE_TYPE_GUID. 1786 1787**/ 1788typedef 1789EFI_STATUS 1790(EFIAPI *EFI_HII_REGISTER_NOTIFY) ( 1791 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1792 IN CONST UINT8 PackageType, 1793 IN CONST EFI_GUID *PackageGuid, 1794 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, 1795 IN CONST EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, 1796 OUT EFI_HANDLE *NotifyHandle 1797); 1798 1799 1800/** 1801 1802 Removes the specified HII database package-related notification. 1803 1804 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 1805 instance. 1806 1807 @param NotificationHandle The handle of the notification 1808 function being unregistered. 1809 1810 @retval EFI_SUCCESS Unregister the notification 1811 Successsfully 1812 1813 @retval EFI_INVALID_PARAMETER The Handle is invalid. 1814 1815**/ 1816typedef 1817EFI_STATUS 1818(EFIAPI *EFI_HII_UNREGISTER_NOTIFY) ( 1819 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 1820 IN CONST EFI_HANDLE NotificationHandle 1821); 1822 1823 1824/** 1825 1826 @param Header The general pack header which defines both the 1827 type of pack and the length of the entire 1828 pack. 1829 1830 @param LayoutCount The number of keyboard layouts contained 1831 in the entire keyboard pack. 1832 1833 @param Layout An array of LayoutCount number of keyboard 1834 layouts. 1835 1836**/ 1837typedef struct { 1838 EFI_HII_PACKAGE_HEADER Header; 1839 UINT16 LayoutCount; 1840 // EFI_HII_KEYBOARD_LAYOUT Layout[...]; 1841} EFI_HII_KEYBOARD_PACK; 1842 1843/** 1844 1845 @param LayoutLength The length of the current keyboard 1846 layout. 1847 1848 @param Guid The unique ID associated with this keyboard 1849 layout. 1850 1851 @param LayoutDescriptorString An offset location (0 is the 1852 beginning of the 1853 EFI_KEYBOARD_LAYOUT instance) 1854 of the string which describes 1855 this keyboard layout. The data 1856 that is being referenced is in 1857 EFI_DESCRIPTION_STRING_BUNDLE 1858 format. 1859 1860 @param DescriptorCount The number of Descriptor entries in 1861 this layout. 1862 1863 @param Descriptors An array of key descriptors. 1864 1865**/ 1866typedef struct { 1867 UINT16 LayoutLength; 1868 EFI_GUID Guid; 1869 RELOFST LayoutDescriptorString; 1870 UINT8 DescriptorCount; 1871 // EFI_KEY_DESCRIPTOR Descriptors[...]; 1872} EFI_HII_KEYBOARD_LAYOUT; 1873 1874 1875/** 1876 1877 @param Language The language to associate with 1878 DescriptionString. 1879 1880 @param Space A space (U-0x0020) character to force as a 1881 separator between the Language field and the 1882 formal description string. 1883 1884 @param DescriptionString A null-terminated description 1885 string. 1886 1887**/ 1888typedef struct { 1889 CHAR16 Language[3]; 1890 CHAR16 Space; 1891 CHAR16 DescriptionString[1]; 1892} EFI_DESCRIPTION_STRING; 1893 1894/** 1895 1896 @param DescriptionCount The number of description strings. 1897 1898 @param DescriptionString An array of language-specific 1899 description strings. 1900 1901**/ 1902typedef struct { 1903 UINT16 DescriptionCount; 1904 // EFI_DESCRIPTION_STRING DescriptionString[]; 1905} EFI_DESCRIPTION_STRING_BUNDLE; 1906 1907/** 1908 1909 See the figure below for which key corresponds to the values in 1910 the enumeration above. For example, EfiKeyLCtrl corresponds to 1911 the left control key in the lower-left corner of the keyboard, 1912 EfiKeyFour corresponds to the 4 key on the numeric keypad, and 1913 EfiKeySLck corresponds to the Scroll Lock key in the upper-right 1914 corner of the keyboard. 1915 1916**/ 1917typedef enum { 1918 EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar, 1919 EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow, 1920 EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero, 1921 EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0, 1922 EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6, 1923 EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRshift, 1924 EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree, 1925 EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4, 1926 EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9, 1927 EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive, 1928 EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2, 1929 EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8, 1930 EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13, 1931 EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight, 1932 EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3, 1933 EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9, 1934 EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace, 1935 EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash, 1936 EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2, 1937 EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8, 1938 EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint, 1939 EfiKeySLck, EfiKeyPause 1940} EFI_KEY; 1941 1942/** 1943 1944 @param Key Used to describe a physical key on a keyboard. 1945 1946 @param Unicode Unicode value for the Key. 1947 1948 @param ShiftedUnicode Unicode value for the key with the 1949 shift key being held down. 1950 1951 @param AltGrUnicode Unicode value for the key with the 1952 Alt-GR being held down. 1953 1954 @param ShiftedAltGrUnicode Unicode value for the key with the 1955 Alt-GR and shift keys being held down. 1956 1957 @param Modifier Modifier keys are defined to allow for 1958 special functionality that is not 1959 necessarily accomplished by a printable 1960 character. Many of these modifier keys are 1961 flags to toggle certain state bits on and 1962 off inside of a keyboard driver. 1963 1964**/ 1965typedef struct { 1966 EFI_KEY Key; 1967 CHAR16 Unicode; 1968 CHAR16 ShiftedUnicode; 1969 CHAR16 AltGrUnicode; 1970 CHAR16 ShiftedAltGrUnicode; 1971 UINT16 Modifier; 1972} EFI_KEY_DESCRIPTOR; 1973 1974 1975// 1976// Modifier values 1977// 1978#define EFI_NULL_MODIFIER 0x0000 1979#define EFI_LEFT_CONTROL_MODIFIER 0x0001 1980#define EFI_RIGHT_CONTROL_MODIFIER 0x0002 1981#define EFI_LEFT_ALT_MODIFIER 0x0003 1982#define EFI_RIGHT_ALT_MODIFIER 0x0004 1983#define EFI_ALT_GR_MODIFIER 0x0005 1984#define EFI_INSERT_MODIFIER 0x0006 1985#define EFI_DELETE_MODIFIER 0x0007 1986#define EFI_PAGE_DOWN_MODIFIER 0x0008 1987#define EFI_PAGE_UP_MODIFIER 0x0009 1988#define EFI_HOME_MODIFIER 0x000A 1989#define EFI_END_MODIFIER 0x000B 1990#define EFI_LEFT_SHIFT_MODIFIER 0x000C 1991#define EFI_RIGHT_SHIFT_MODIFIER 0x000D 1992#define EFI_CAPS_LOCK_MODIFIER 0x000E 1993#define EFI_NUM_LOCK _MODIFIER 0x000F 1994#define EFI_LEFT_ARROW_MODIFIER 0x0010 1995#define EFI_RIGHT_ARROW_MODIFIER 0x0011 1996#define EFI_DOWN_ARROW_MODIFIER 0x0012 1997#define EFI_UP_ARROW_MODIFIER 0X0013 1998#define EFI_NS_KEY_MODIFIER 0x0014 1999#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015 2000#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016 2001#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017 2002#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018 2003#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019 2004#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A 2005#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B 2006#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C 2007#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D 2008#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E 2009#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F 2010#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020 2011#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021 2012// 2013// Keys that have multiple control functions based on modifier 2014// settings are handled in the keyboard driver implementation. 2015// For instance PRINT_KEY might have a modifier held down and 2016// is still a nonprinting character, but might have an alternate 2017// control function like SYSREQUEST 2018// 2019#define EFI_PRINT_MODIFIER 0x0022 2020#define EFI_SYS_REQUEST_MODIFIER 0x0023 2021#define EFI_SCROLL_LOCK_MODIFIER 0x0024 2022#define EFI_PAUSE_MODIFIER 0x0025 2023#define EFI_BREAK_MODIFIER 0x0026 2024 2025 2026 2027/** 2028 2029 This routine retrieves an array of GUID values for each keyboard 2030 layout that was previously registered in the system. 2031 2032 @param This A pointer to the EFI_HII_PROTOCOL instance. 2033 2034 @param KeyGuidBufferLength On input, a pointer to the length 2035 of the keyboard GUID buffer. On 2036 output, the length of the handle 2037 buffer that is required for the 2038 handles found. KeyGuidBuffer An 2039 array of keyboard layout GUID 2040 instances returned. 2041 2042 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully. 2043 2044 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength 2045 parameter indicates that 2046 KeyGuidBuffer is too small to 2047 support the number of GUIDs. 2048 KeyGuidBufferLength is updated 2049 with a value that will enable 2050 the data to fit. 2051 2052**/ 2053typedef 2054EFI_STATUS 2055(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) ( 2056 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 2057 IN OUT UINT16 *KeyGuidBufferLength, 2058 OUT EFI_GUID *KeyGuidBuffer 2059); 2060 2061 2062/** 2063 2064 This routine retrieves the requested keyboard layout. The layout 2065 is a physical description of the keys on a keyboard and the 2066 character(s) that are associated with a particular set of key 2067 strokes. 2068 2069 @param This A pointer to the EFI_HII_PROTOCOL instance. 2070 2071 @param KeyGuid A pointer to the unique ID associated with a 2072 given keyboard layout. If KeyGuid is NULL then 2073 the current layout will be retrieved. 2074 2075 @param KeyboardLayout A pointer to a buffer containing the 2076 retrieved keyboard layout. below. 2077 2078 @retval EFI_SUCCESS The keyboard layout was retrieved 2079 successfully. 2080 2081 @retval EFI_NOT_FOUND The requested keyboard layout was not 2082 found. 2083 2084**/ 2085typedef 2086EFI_STATUS 2087(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) ( 2088 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 2089 IN CONST EFI_GUID *KeyGuid, 2090 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout 2091); 2092 2093/** 2094 2095 This routine sets the default keyboard layout to the one 2096 referenced by KeyGuid. When this routine is called, an event 2097 will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID 2098 group type. This is so that agents which are sensitive to the 2099 current keyboard layout being changed can be notified of this 2100 change. 2101 2102 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 2103 instance. 2104 2105 @param KeyGuid A pointer to the unique ID associated with a 2106 given keyboard layout. 2107 2108 2109 @retval EFI_SUCCESS The current keyboard layout was 2110 successfully set. 2111 2112 @retval EFI_NOT_FOUND The referenced keyboard layout was not 2113 found, so action was taken. 2114 2115**/ 2116typedef 2117EFI_STATUS 2118(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) ( 2119 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 2120 IN CONST EFI_GUID *KeyGuid 2121); 2122 2123/** 2124 2125 Return the EFI handle associated with a package list. 2126 2127 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL 2128 instance. 2129 2130 @param PackageListHandle An EFI_HII_HANDLE that corresponds 2131 to the desired package list in the 2132 HIIdatabase. 2133 2134 @param DriverHandle On return, contains the EFI_HANDLE which 2135 was registered with the package list in 2136 NewPackageList(). 2137 2138 @retval EFI_SUCCESS The DriverHandle was returned 2139 successfully. 2140 2141 @retval EFI_INVALID_PARAMETER The PackageListHandle was not 2142 valid. 2143 2144**/ 2145typedef 2146EFI_STATUS 2147(EFIAPI *EFI_HII_GET_PACK_HANDLE) ( 2148 IN CONST EFI_HII_DATABASE_PROTOCOL *This, 2149 IN CONST EFI_HII_HANDLE PackageListHandle, 2150 OUT EFI_HANDLE *DriverHandle 2151); 2152 2153/** 2154 2155 @param NewPackageList Add a new package list to the HII 2156 database. 2157 2158 @param RemovePackageList Remove a package list from the HII 2159 database. 2160 2161 @param UpdatePackageList Update a package list in the HII 2162 database. 2163 2164 @param ListPackageLists List the handles of the package 2165 lists within the HII database. 2166 2167 @param ExportPackageLists Export package lists from the HII 2168 database. 2169 2170 @param RegisterPackageNotify Register notification when 2171 packages of a certain type are 2172 installed. 2173 2174 @param UnregisterPackageNotify Unregister notification of 2175 packages. 2176 2177 @param FindKeyboardLayouts Retrieves a list of the keyboard 2178 layouts in the system. 2179 2180 @param GetKeyboardLayout Allows a program to extract the 2181 current keyboard layout. See the 2182 GetKeyboardLayout() function 2183 description. 2184 2185 @param SetKeyboardLayout Changes the current keyboard layout. 2186 See the SetKeyboardLayout() function 2187 2188 2189**/ 2190struct _EFI_HII_DATABASE_PROTOCOL { 2191 EFI_HII_NEW_PACK NewPackageList; 2192 EFI_HII_REMOVE_PACK RemovePackageList; 2193 EFI_HII_UPDATE_PACK UpdatePackageList; 2194 EFI_HII_LIST_PACKS ListPackageLists; 2195 EFI_HII_EXPORT_PACKS ExportPackageLists; 2196 EFI_HII_REGISTER_NOTIFY RegisterPackageNotify; 2197 EFI_HII_UNREGISTER_NOTIFY UnregisterPackageNotify; 2198 EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; 2199 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; 2200 EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; 2201 EFI_HII_GET_PACK_HANDLE GetPackageHandle; 2202}; 2203 2204extern EFI_GUID gEfiHiiDatabaseProtocolGuid; 2205 2206#endif 2207 2208