OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Common.c
Go to the documentation of this file.
1#include <Base.h>
2
3#include <Protocol/OcAudio.h>
4
5#include <Library/DebugLib.h>
6
7#include "../OpenCanopy.h"
8#include "../GuiApp.h"
9
10#include <Library/BaseLib.h>
11#include <Library/UefiRuntimeServicesTableLib.h>
12#include <Library/ResetSystemLib.h>
13
14#include "Common.h"
15
16//
17// FIXME: Create BootPickerView struct with background colour/image info.
18//
19GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetX;
20GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetY;
21
22GLOBAL_REMOVE_IF_UNREFERENCED GUI_INTERPOLATION mCommonIntroOpacityInterpol = {
24 0,
25 25,
26 0,
27 0xFF,
28 0
29};
30
31STATIC UINT8 mCommonFocusState = 0;
32
33STATIC GUI_OBJ **mCommonFocusList = NULL;
34STATIC UINT8 mNumCommonFocusList = 0;
35
36VOID
38 IN CONST GUI_IMAGE *Image,
39 IN UINT8 Opacity,
40 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
41 IN INT64 ParentBaseX,
42 IN INT64 ParentBaseY,
43 IN INT64 ChildBaseX,
44 IN INT64 ChildBaseY,
45 IN UINT32 OffsetX,
46 IN UINT32 OffsetY,
47 IN UINT32 Width,
48 IN UINT32 Height
49 )
50{
51 BOOLEAN Result;
52
53 ASSERT (Image != NULL);
54 ASSERT (DrawContext != NULL);
55
56 Result = GuiClipChildBounds (
57 ChildBaseX,
58 Image->Width,
59 &OffsetX,
60 &Width
61 );
62 if (Result) {
63 Result = GuiClipChildBounds (
64 ChildBaseY,
65 Image->Height,
66 &OffsetY,
67 &Height
68 );
69 if (Result) {
70 ASSERT (Image->Width > OffsetX);
71 ASSERT (Image->Height > OffsetY);
72 ASSERT (Image->Buffer != NULL);
73
75 Image,
76 Opacity,
77 DrawContext,
78 ParentBaseX + ChildBaseX,
79 ParentBaseY + ChildBaseY,
80 OffsetX,
81 OffsetY,
82 Width,
83 Height
84 );
85 }
86 }
87}
88
89BOOLEAN
91 IN CONST GUI_IMAGE *Image,
92 IN INT64 OffsetX,
93 IN INT64 OffsetY
94 )
95{
96 ASSERT (Image != NULL);
97 ASSERT (Image->Buffer != NULL);
98
99 if ( (OffsetX < 0) || (OffsetX >= Image->Width)
100 || (OffsetY < 0) || (OffsetY >= Image->Height))
101 {
102 return FALSE;
103 }
104
105 return Image->Buffer[(UINT32)OffsetY * Image->Width + (UINT32)OffsetX].Reserved > 0;
106}
107
108GUI_OBJ *
110 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
111 IN BOOT_PICKER_GUI_CONTEXT *Context,
112 IN CONST GUI_KEY_EVENT *KeyEvent
113 )
114{
115 UINT8 CommonFocusState;
116 GUI_OBJ *FocusChangedObj;
117
118 if (KeyEvent->OcKeyCode == OC_INPUT_SWITCH_FOCUS) {
119 if (mNumCommonFocusList > 1) {
122 DrawContext,
123 FALSE
124 );
125
126 if ((KeyEvent->OcModifiers & OC_MODIFIERS_REVERSE_SWITCH_FOCUS) == 0) {
127 CommonFocusState = mCommonFocusState + 1;
128 if (CommonFocusState == mNumCommonFocusList) {
129 CommonFocusState = 0;
130 }
131 } else {
132 CommonFocusState = mCommonFocusState - 1;
133 if (CommonFocusState == MAX_UINT8) {
134 CommonFocusState = mNumCommonFocusList - 1;
135 }
136 }
137
138 mCommonFocusState = CommonFocusState;
139
140 mCommonFocusList[CommonFocusState]->Focus (
141 mCommonFocusList[CommonFocusState],
142 DrawContext,
143 TRUE
144 );
145
146 FocusChangedObj = mCommonFocusList[CommonFocusState];
147 } else {
148 FocusChangedObj = NULL;
149 }
150 } else {
153 DrawContext,
154 Context,
155 KeyEvent
156 );
157
158 FocusChangedObj = NULL;
159 }
160
161 return FocusChangedObj;
162}
163
164VOID
166 IN OUT GUI_DRAWING_CONTEXT *DrawContext
167 )
168{
169 if (mCommonFocusState == 0) {
170 return;
171 }
172
175 DrawContext,
176 FALSE
177 );
178
180
183 DrawContext,
184 TRUE
185 );
186}
187
188VOID
190 IN OUT GUI_OBJ *This,
191 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
192 IN BOOT_PICKER_GUI_CONTEXT *Context,
193 IN INT64 BaseX,
194 IN INT64 BaseY,
195 IN UINT32 OffsetX,
196 IN UINT32 OffsetY,
197 IN UINT32 Width,
198 IN UINT32 Height,
199 IN UINT8 Opacity
200 )
201{
202 ASSERT (This != NULL);
203 ASSERT (DrawContext != NULL);
204 ASSERT (Context != NULL);
205
206 ASSERT (BaseX == 0);
207 ASSERT (BaseY == 0);
208
210 &Context->BackgroundColor.Pixel,
211 DrawContext,
212 OffsetX,
213 OffsetY,
214 Width,
215 Height
216 );
217
218 if (DrawContext->GuiContext->Background.Buffer != NULL) {
220 &DrawContext->GuiContext->Background,
221 0xFF,
222 DrawContext,
223 0,
224 0,
227 OffsetX,
228 OffsetY,
229 Width,
230 Height
231 );
232 }
233
235 This,
236 DrawContext,
237 Context,
238 0,
239 0,
240 OffsetX,
241 OffsetY,
242 Width,
243 Height,
244 Opacity
245 );
246}
247
248GUI_OBJ *
250 IN OUT GUI_OBJ *This,
251 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
252 IN BOOT_PICKER_GUI_CONTEXT *Context,
253 IN INT64 BaseX,
254 IN INT64 BaseY,
255 IN CONST GUI_PTR_EVENT *Event
256 )
257{
258 InternalResetFocus (DrawContext);
259 return GuiObjDelegatePtrEvent (This, DrawContext, Context, BaseX, BaseY, Event);
260}
261
262VOID
264 IN OUT GUI_OBJ *This,
265 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
266 IN BOOT_PICKER_GUI_CONTEXT *Context,
267 IN INT64 BaseX,
268 IN INT64 BaseY,
269 IN UINT32 OffsetX,
270 IN UINT32 OffsetY,
271 IN UINT32 Width,
272 IN UINT32 Height,
273 IN UINT8 Opacity
274 )
275{
276 CONST GUI_OBJ_CLICKABLE *Clickable;
277 CONST GUI_IMAGE *ButtonImage;
278
279 ASSERT (This != NULL);
280 ASSERT (DrawContext != NULL);
281 ASSERT (Context != NULL);
282 //
283 // There should be no children.
284 //
285 ASSERT (This->NumChildren == 0);
286
287 Clickable = BASE_CR (This, GUI_OBJ_CLICKABLE, Hdr.Obj);
288 ButtonImage = &Context->Icons[Clickable->ImageId][Clickable->ImageState];
289 ASSERT (ButtonImage != NULL);
290
291 ASSERT (ButtonImage->Width == This->Width);
292 ASSERT (ButtonImage->Height == This->Height);
293 ASSERT (ButtonImage->Buffer != NULL);
294
296 ButtonImage,
297 Opacity,
298 DrawContext,
299 BaseX,
300 BaseY,
301 OffsetX,
302 OffsetY,
303 Width,
304 Height
305 );
306}
307
308UINT8
310 IN OUT GUI_OBJ *This,
311 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
312 IN BOOT_PICKER_GUI_CONTEXT *Context,
313 IN INT64 BaseX,
314 IN INT64 BaseY,
315 IN CONST GUI_PTR_EVENT *Event
316 )
317{
318 UINT8 Return;
319
320 GUI_OBJ_CLICKABLE *Clickable;
321 CONST GUI_IMAGE *ButtonImage;
322 UINT8 ImageState;
323
324 BOOLEAN IsHit;
325
326 ASSERT (This != NULL);
327 ASSERT (DrawContext != NULL);
328 ASSERT (Context != NULL);
329 //
330 // There should be no children.
331 //
332 ASSERT (This->NumChildren == 0);
333 //
334 // Ignore double-clicks.
335 //
336 if (Event->Type == GuiPointerPrimaryDoubleClick) {
337 return 1;
338 }
339
340 Clickable = BASE_CR (This, GUI_OBJ_CLICKABLE, Hdr.Obj);
341 ImageState = ICON_TYPE_BASE;
342 ButtonImage = &Context->Icons[Clickable->ImageId][ImageState];
343
344 Return = CommonPtrNotHit;
345
346 IsHit = GuiClickableIsHit (
347 ButtonImage,
348 Event->Pos.Pos.X - BaseX,
349 Event->Pos.Pos.Y - BaseY
350 );
351 if (IsHit) {
352 if (Event->Type == GuiPointerPrimaryUp) {
353 Return = CommonPtrAction;
354 } else {
355 ImageState = ICON_TYPE_HELD;
356 Return = CommonPtrHit;
357 }
358 }
359
360 if (Clickable->ImageState != ImageState) {
361 Clickable->ImageState = ImageState;
362 //
363 // The view is constructed such that the selector is always fully visible.
364 //
365 ASSERT (BaseX >= 0);
366 ASSERT (BaseY >= 0);
367 ASSERT (BaseX + This->Width <= DrawContext->Screen.Width);
368 ASSERT (BaseY + This->Height <= DrawContext->Screen.Height);
369 GuiRequestDraw ((UINT32)BaseX, (UINT32)BaseY, This->Width, This->Height);
370 }
371
372 return Return;
373}
374
375VOID
377 IN OUT GUI_OBJ *This,
378 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
379 IN BOOT_PICKER_GUI_CONTEXT *Context,
380 IN INT64 BaseX,
381 IN INT64 BaseY,
382 IN UINT32 OffsetX,
383 IN UINT32 OffsetY,
384 IN UINT32 Width,
385 IN UINT32 Height,
386 IN UINT8 Opacity
387 )
388{
389 ASSERT (This != NULL);
390 ASSERT (DrawContext != NULL);
391 ASSERT (Context != NULL);
392
394 &Context->Icons[ICON_BUTTON_FOCUS][ICON_TYPE_BASE],
395 Opacity,
396 DrawContext,
397 BaseX,
398 BaseY,
399 ((INT32)This->Width - (INT32)Context->Icons[ICON_BUTTON_FOCUS][ICON_TYPE_BASE].Width) / 2,
400 ((INT32)This->Height - (INT32)Context->Icons[ICON_BUTTON_FOCUS][ICON_TYPE_BASE].Height) / 2,
401 OffsetX,
402 OffsetY,
403 Width,
404 Height
405 );
406 //
407 // There should be no children.
408 //
409 ASSERT (This->NumChildren == 0);
410}
411
412VOID
414 IN OUT GUI_OBJ *This,
415 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
416 IN BOOT_PICKER_GUI_CONTEXT *Context,
417 IN CONST GUI_KEY_EVENT *KeyEvent
418 )
419{
420 if ( (KeyEvent->OcKeyCode == OC_INPUT_CONTINUE)
421 || (KeyEvent->OcKeyCode == OC_INPUT_TYPING_CONFIRM))
422 {
423 if (Context->PickerContext->PickerAudioAssist) {
424 Context->PickerContext->PlayAudioFile (
425 Context->PickerContext,
428 TRUE
429 );
430 }
431
432 ResetShutdown ();
433 }
434}
435
436GUI_OBJ *
438 IN OUT GUI_OBJ *This,
439 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
440 IN BOOT_PICKER_GUI_CONTEXT *Context,
441 IN INT64 BaseX,
442 IN INT64 BaseY,
443 IN CONST GUI_PTR_EVENT *Event
444 )
445{
446 UINT8 Result;
447
449 This,
450 DrawContext,
451 Context,
452 BaseX,
453 BaseY,
454 Event
455 );
456 switch (Result) {
457 case CommonPtrNotHit:
458 {
459 return NULL;
460 }
461
462 case CommonPtrAction:
463 {
464 ResetShutdown ();
465 //
466 // Falthrough to 'hit' case.
467 //
468 }
469
470 case CommonPtrHit:
471 {
472 break;
473 }
474 }
475
476 return This;
477}
478
479VOID
481 IN OUT GUI_OBJ *This,
482 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
483 IN BOOT_PICKER_GUI_CONTEXT *Context,
484 IN CONST GUI_KEY_EVENT *KeyEvent
485 )
486{
487 if ( (KeyEvent->OcKeyCode == OC_INPUT_CONTINUE)
488 || (KeyEvent->OcKeyCode == OC_INPUT_TYPING_CONFIRM))
489 {
490 if (Context->PickerContext->PickerAudioAssist) {
491 Context->PickerContext->PlayAudioFile (
492 Context->PickerContext,
495 TRUE
496 );
497 }
498
499 ResetWarm ();
500 }
501}
502
503GUI_OBJ *
505 IN OUT GUI_OBJ *This,
506 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
507 IN BOOT_PICKER_GUI_CONTEXT *Context,
508 IN INT64 BaseX,
509 IN INT64 BaseY,
510 IN CONST GUI_PTR_EVENT *Event
511 )
512{
513 UINT8 Result;
514
516 This,
517 DrawContext,
518 Context,
519 BaseX,
520 BaseY,
521 Event
522 );
523 switch (Result) {
524 case CommonPtrNotHit:
525 {
526 return NULL;
527 }
528
529 case CommonPtrAction:
530 {
531 ResetWarm ();
532 //
533 // Falthrough to 'hit' case.
534 //
535 }
536
537 case CommonPtrHit:
538 {
539 break;
540 }
541 }
542
543 return This;
544}
545
547
553
554VOID
556 IN CONST GUI_OBJ *This,
557 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
558 IN BOOLEAN Focus
559 )
560{
561 if (!Focus) {
563 } else {
565
567 DrawContext,
572 );
573
574 mCommonFocus.Obj.OffsetX = This->OffsetX + ((INT32)This->Width - (INT32)mCommonFocus.Obj.Width) / 2;
575 mCommonFocus.Obj.OffsetY = This->OffsetY + ((INT32)This->Height - (INT32)mCommonFocus.Obj.Height) / 2;
576
577 DrawContext->GuiContext->AudioPlaybackTimeout = 0;
578
579 if (This == &mCommonShutDown.Hdr.Obj) {
580 DrawContext->GuiContext->VoAction = CanopyVoFocusShutDown;
581 } else {
582 ASSERT (This == &mCommonRestart.Hdr.Obj);
583 DrawContext->GuiContext->VoAction = CanopyVoFocusRestart;
584 }
585 }
586
588 DrawContext,
593 );
594}
595
596GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonFocus = {
597 {
598 0, 0, 0, 0, 0xFF,
600 NULL,
602 NULL,
603 0,
604 NULL
605 },
607};
608
609GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart = {
610 {
611 {
612 0, 0, 0, 0, 0xFF,
617 0,
618 NULL
619 },
621 },
622 0,
623 0
624};
625
626GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown = {
627 {
628 {
629 0, 0, 0, 0, 0xFF,
634 0,
635 NULL
636 },
638 },
639 0,
640 0
641};
642
643GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer = {
644 {
645 0, 0, 0, 0, 0,
647 NULL,
649 NULL,
652 },
653 NULL
654};
655
656VOID
658 IN OUT GUI_DRAWING_CONTEXT *DrawContext,
659 IN BOOT_PICKER_GUI_CONTEXT *GuiContext,
660 IN CONST GUI_VIEW_CONTEXT *ViewContext
661 )
662{
663 CONST GUI_IMAGE *FocusImage;
664 CONST GUI_IMAGE *RestartImage;
665 CONST GUI_IMAGE *ShutDownImage;
666 UINT32 RestartWidth;
667 UINT32 RestartHeight;
668 UINT32 ShutDownWidth;
669 UINT32 ShutDownHeight;
670
671 ASSERT (GuiContext != NULL);
672
674 mCommonFocusList = ViewContext->FocusList;
675 mNumCommonFocusList = ViewContext->NumFocusList;
676
677 GuiViewInitialize (DrawContext, GuiContext, ViewContext);
678
680 (INT64)DrawContext->Screen.Width - GuiContext->Background.Width,
681 2,
682 NULL
683 );
685 (INT64)DrawContext->Screen.Height - GuiContext->Background.Height,
686 2,
687 NULL
688 );
689
690 FocusImage = &GuiContext->Icons[ICON_BUTTON_FOCUS][ICON_TYPE_BASE];
691 RestartImage = &GuiContext->Icons[ICON_RESTART][ICON_TYPE_BASE];
692 ShutDownImage = &GuiContext->Icons[ICON_SHUT_DOWN][ICON_TYPE_BASE];
693
696 mCommonFocus.Obj.Width = FocusImage->Width;
697 mCommonFocus.Obj.Height = FocusImage->Height;
698
699 RestartWidth = MAX (RestartImage->Width, FocusImage->Width);
700 RestartHeight = MAX (RestartImage->Height, FocusImage->Height);
701 ShutDownWidth = MAX (ShutDownImage->Width, FocusImage->Width);
702 ShutDownHeight = MAX (ShutDownImage->Height, FocusImage->Height);
703
704 if ((GuiContext->PickerContext->PickerAttributes & OC_ATTR_USE_REVERSED_UI) == 0) {
705 mCommonRestart.Hdr.Obj.OffsetX = ShutDownWidth + BOOT_ACTION_BUTTON_SPACE * GuiContext->Scale + (RestartWidth - RestartImage->Width) / 2;
706 } else {
707 mCommonRestart.Hdr.Obj.OffsetX = (RestartWidth - RestartImage->Width) / 2;
708 }
709
710 mCommonRestart.Hdr.Obj.OffsetY = (RestartHeight - RestartImage->Height) / 2;
711 mCommonRestart.Hdr.Obj.Width = RestartImage->Width;
712 mCommonRestart.Hdr.Obj.Height = RestartImage->Height;
715
716 if ((GuiContext->PickerContext->PickerAttributes & OC_ATTR_USE_REVERSED_UI) == 0) {
717 mCommonShutDown.Hdr.Obj.OffsetX = (ShutDownWidth - ShutDownImage->Width) / 2;
718 } else {
719 mCommonShutDown.Hdr.Obj.OffsetX = RestartWidth + BOOT_ACTION_BUTTON_SPACE * GuiContext->Scale + (ShutDownWidth - ShutDownImage->Width) / 2;
720 }
721
722 mCommonShutDown.Hdr.Obj.OffsetY = (ShutDownHeight - ShutDownImage->Height) / 2;
723 mCommonShutDown.Hdr.Obj.Width = ShutDownImage->Width;
724 mCommonShutDown.Hdr.Obj.Height = ShutDownImage->Height;
727
728 mCommonActionButtonsContainer.Obj.Width = RestartWidth + ShutDownWidth + BOOT_ACTION_BUTTON_SPACE * GuiContext->Scale;
729 mCommonActionButtonsContainer.Obj.Height = MAX (RestartHeight, ShutDownHeight);
732}
#define ARRAY_SIZE(Array)
Definition AppleMacEfi.h:34
SMBIOS_STRUCTURE Hdr
Definition AppleSmBios.h:51
#define APPLE_VOICE_OVER_AUDIO_FILE_BEEP
GUI_OBJ * InternalCommonViewPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:249
VOID InternalCommonSimpleButtonFocusDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:376
GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetX
Definition Common.c:19
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown
Definition Common.c:626
VOID InternalResetFocus(IN OUT GUI_DRAWING_CONTEXT *DrawContext)
Definition Common.c:165
VOID CommonViewInitialize(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN CONST GUI_VIEW_CONTEXT *ViewContext)
Definition Common.c:657
VOID InternalCommonViewDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:189
STATIC GUI_OBJ_CHILD * mCommonActionButtonsContainerChildren[]
Definition Common.c:548
VOID InternalCommonSimpleButtonDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:263
VOID InternalCommonRestartKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Common.c:480
STATIC UINT8 mCommonFocusState
Definition Common.c:31
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart
Definition Common.c:609
STATIC UINT8 mNumCommonFocusList
Definition Common.c:34
STATIC GUI_OBJ ** mCommonFocusList
Definition Common.c:33
GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetY
Definition Common.c:20
GLOBAL_REMOVE_IF_UNREFERENCED GUI_INTERPOLATION mCommonIntroOpacityInterpol
Definition Common.c:22
VOID GuiDrawChildImage(IN CONST GUI_IMAGE *Image, IN UINT8 Opacity, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 ParentBaseX, IN INT64 ParentBaseY, IN INT64 ChildBaseX, IN INT64 ChildBaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height)
Definition Common.c:37
GUI_OBJ * InternalCommonRestartPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:504
UINT8 InternalCommonSimpleButtonPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:309
BOOLEAN GuiClickableIsHit(IN CONST GUI_IMAGE *Image, IN INT64 OffsetX, IN INT64 OffsetY)
Definition Common.c:90
GUI_OBJ * InternalCommonShutDownPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:437
VOID InternalCommonActionButtonFocus(IN CONST GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOLEAN Focus)
Definition Common.c:555
GUI_OBJ * InternalFocusKeyHandler(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Common.c:109
GUI_OBJ_CHILD mCommonFocus
Definition Common.c:596
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer
Definition Common.c:643
VOID InternalCommonShutDownKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Common.c:413
@ CommonPtrHit
Definition Common.h:89
@ CommonPtrAction
Definition Common.h:88
@ CommonPtrNotHit
Definition Common.h:87
@ ICON_TYPE_BASE
Definition GuiApp.h:103
@ ICON_TYPE_HELD
Definition GuiApp.h:105
@ CanopyVoFocusRestart
Definition GuiApp.h:113
@ CanopyVoFocusShutDown
Definition GuiApp.h:112
#define BOOT_ACTION_BUTTON_SPACE
Definition GuiApp.h:45
@ ICON_BUTTON_FOCUS
Definition GuiApp.h:83
@ ICON_RESTART
Definition GuiApp.h:82
@ ICON_SHUT_DOWN
Definition GuiApp.h:81
#define OC_VOICE_OVER_AUDIO_BASE_TYPE_APPLE
Definition OcAudio.h:37
#define OC_ATTR_USE_REVERSED_UI
#define OC_INPUT_TYPING_CONFIRM
Confirm input while typing (press enter)
#define OC_MODIFIERS_REVERSE_SWITCH_FOCUS
#define OC_INPUT_CONTINUE
Continue (press enter)
#define OC_INPUT_SWITCH_FOCUS
Switch UI focus (tab and shift+tab)
VOID EFIAPI ResetWarm(VOID)
VOID EFIAPI ResetShutdown(VOID)
VOID GuiDrawToBuffer(IN CONST GUI_IMAGE *Image, IN UINT8 Opacity, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height)
Definition OpenCanopy.c:354
VOID GuiRequestDraw(IN UINT32 PosX, IN UINT32 PosY, IN UINT32 Width, IN UINT32 Height)
Definition OpenCanopy.c:475
VOID GuiDrawToBufferFill(IN CONST EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Colour, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN UINT32 PosX, IN UINT32 PosY, IN UINT32 Width, IN UINT32 Height)
Definition OpenCanopy.c:276
BOOLEAN GuiClipChildBounds(IN INT64 ChildOffset, IN UINT32 ChildLength, IN OUT UINT32 *ReqOffset, IN OUT UINT32 *ReqLength)
Definition OpenCanopy.c:73
VOID GuiRequestDrawCrop(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 X, IN INT64 Y, IN UINT32 Width, IN UINT32 Height)
Definition OpenCanopy.c:570
GUI_OBJ * GuiObjDelegatePtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition OpenCanopy.c:226
VOID GuiViewInitialize(OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN CONST GUI_VIEW_CONTEXT *ViewContext)
Definition OpenCanopy.c:943
VOID GuiObjDrawDelegate(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition OpenCanopy.c:137
@ GuiPointerPrimaryUp
Definition OpenCanopy.h:23
@ GuiPointerPrimaryDoubleClick
Definition OpenCanopy.h:24
@ GuiInterpolTypeSmooth
Definition OpenCanopy.h:349
INT64 EFIAPI DivS64x64Remainder(IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder OPTIONAL)
Definition UserMath.c:42
#define ASSERT(x)
Definition coder.h:55
#define MAX(a, b)
Definition coder.h:59
UINT8 ImageState
Definition Common.h:9
GUI_OBJ_CHILD Hdr
Definition Common.h:7
UINT8 ImageId
Definition Common.h:8
INT64 OffsetX
Definition OpenCanopy.h:108
UINT32 NumChildren
Definition OpenCanopy.h:117
UINT32 Height
Definition OpenCanopy.h:111
INT64 OffsetY
Definition OpenCanopy.h:109
GUI_OBJ_FOCUS Focus
Definition OpenCanopy.h:116
UINT32 Width
Definition OpenCanopy.h:110
GUI_OBJ_KEY_EVENT KeyEvent
Definition OpenCanopy.h:114