Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
7b7d36a8
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b7d36a8
编写于
3月 17, 2021
作者:
M
Marvin Häuser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCanopy: Replace linked lists with arrays for GUI object children
上级
06991a81
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
187 addition
and
175 deletion
+187
-175
Platform/OpenCanopy/GuiApp.h
Platform/OpenCanopy/GuiApp.h
+4
-2
Platform/OpenCanopy/OcBootstrap.c
Platform/OpenCanopy/OcBootstrap.c
+4
-2
Platform/OpenCanopy/OpenCanopy.c
Platform/OpenCanopy/OpenCanopy.c
+16
-15
Platform/OpenCanopy/OpenCanopy.h
Platform/OpenCanopy/OpenCanopy.h
+6
-4
Platform/OpenCanopy/Views/BootPicker.c
Platform/OpenCanopy/Views/BootPicker.c
+154
-150
Platform/OpenCanopy/Views/BootPicker.h
Platform/OpenCanopy/Views/BootPicker.h
+3
-2
未找到文件。
Platform/OpenCanopy/GuiApp.h
浏览文件 @
7b7d36a8
...
...
@@ -107,7 +107,8 @@ EFI_STATUS
BootPickerViewInitialize
(
OUT
GUI_DRAWING_CONTEXT
*
DrawContext
,
IN
BOOT_PICKER_GUI_CONTEXT
*
GuiContext
,
IN
GUI_CURSOR_GET_IMAGE
GetCursorImage
IN
GUI_CURSOR_GET_IMAGE
GetCursorImage
,
IN
UINT8
NumBootEntries
);
VOID
...
...
@@ -116,10 +117,11 @@ BootPickerViewLateInitialize (
);
EFI_STATUS
BootPickerEntries
Add
(
BootPickerEntries
Set
(
IN
OC_PICKER_CONTEXT
*
Context
,
IN
BOOT_PICKER_GUI_CONTEXT
*
GuiContext
,
IN
OC_BOOT_ENTRY
*
Entry
,
IN
UINT8
EntryIndex
,
IN
BOOLEAN
Default
);
...
...
Platform/OpenCanopy/OcBootstrap.c
浏览文件 @
7b7d36a8
...
...
@@ -109,7 +109,8 @@ OcShowMenuByOc (
Status
=
BootPickerViewInitialize
(
&
mDrawContext
,
&
mGuiContext
,
InternalGetCursorImage
InternalGetCursorImage
,
(
UINT8
)
BootContext
->
BootEntryCount
);
if
(
EFI_ERROR
(
Status
))
{
OcShowMenuByOcLeave
();
...
...
@@ -117,10 +118,11 @@ OcShowMenuByOc (
}
for
(
Index
=
0
;
Index
<
BootContext
->
BootEntryCount
;
++
Index
)
{
Status
=
BootPickerEntries
Add
(
Status
=
BootPickerEntries
Set
(
BootContext
->
PickerContext
,
&
mGuiContext
,
BootEntries
[
Index
],
(
UINT8
)
Index
+
1
,
Index
==
BootContext
->
DefaultEntry
->
EntryIndex
-
1
);
if
(
EFI_ERROR
(
Status
))
{
...
...
Platform/OpenCanopy/OpenCanopy.c
浏览文件 @
7b7d36a8
...
...
@@ -141,7 +141,7 @@ GuiObjDrawDelegate (
{
BOOLEAN
Result
;
LIST_ENTRY
*
ChildEntry
;
UINTN
Index
;
GUI_OBJ_CHILD
*
Child
;
UINT32
ChildDrawOffsetX
;
...
...
@@ -158,12 +158,8 @@ GuiObjDrawDelegate (
ASSERT
(
Height
<=
This
->
Height
);
ASSERT
(
DrawContext
!=
NULL
);
for
(
ChildEntry
=
GetPreviousNode
(
&
This
->
Children
,
&
This
->
Children
);
!
IsNull
(
&
This
->
Children
,
ChildEntry
);
ChildEntry
=
GetPreviousNode
(
&
This
->
Children
,
ChildEntry
)
)
{
Child
=
BASE_CR
(
ChildEntry
,
GUI_OBJ_CHILD
,
Link
);
for
(
Index
=
0
;
Index
<
This
->
NumChildren
;
++
Index
)
{
Child
=
This
->
Children
[
Index
];
ChildDrawOffsetX
=
OffsetX
;
ChildDrawWidth
=
Width
;
...
...
@@ -220,8 +216,8 @@ GuiObjDelegatePtrEvent (
IN
INT64
OffsetY
)
{
UINTN
Index
;
GUI_OBJ
*
Obj
;
LIST_ENTRY
*
ChildEntry
;
GUI_OBJ_CHILD
*
Child
;
ASSERT
(
This
!=
NULL
);
...
...
@@ -229,12 +225,8 @@ GuiObjDelegatePtrEvent (
ASSERT
(
This
->
Height
>
OffsetY
);
ASSERT
(
DrawContext
!=
NULL
);
for
(
ChildEntry
=
GetFirstNode
(
&
This
->
Children
);
!
IsNull
(
&
This
->
Children
,
ChildEntry
);
ChildEntry
=
GetNextNode
(
&
This
->
Children
,
ChildEntry
)
)
{
Child
=
BASE_CR
(
ChildEntry
,
GUI_OBJ_CHILD
,
Link
);
for
(
Index
=
0
;
Index
<
This
->
NumChildren
;
++
Index
)
{
Child
=
This
->
Children
[
Index
];
if
(
OffsetX
<
Child
->
Obj
.
OffsetX
||
OffsetX
>=
Child
->
Obj
.
OffsetX
+
Child
->
Obj
.
Width
||
OffsetY
<
Child
->
Obj
.
OffsetY
...
...
@@ -937,6 +929,7 @@ GuiGetBaseCoords (
GUI_OBJ_CHILD
*
ChildObj
;
INT64
X
;
INT64
Y
;
UINT32
Index
;
ASSERT
(
This
!=
NULL
);
ASSERT
(
DrawContext
!=
NULL
);
...
...
@@ -955,7 +948,15 @@ GuiGetBaseCoords (
ChildObj
=
BASE_CR
(
Obj
,
GUI_OBJ_CHILD
,
Obj
);
Obj
=
ChildObj
->
Parent
;
ASSERT
(
Obj
!=
NULL
);
ASSERT
(
IsNodeInList
(
&
Obj
->
Children
,
&
ChildObj
->
Link
));
DEBUG_CODE_BEGIN
();
for
(
Index
=
0
;
Index
<
Obj
->
NumChildren
;
++
Index
)
{
if
(
Obj
->
Children
[
Index
]
==
ChildObj
)
{
break
;
}
}
ASSERT
(
Index
!=
Obj
->
NumChildren
);
DEBUG_CODE_END
();
}
*
BaseX
=
X
;
...
...
Platform/OpenCanopy/OpenCanopy.h
浏览文件 @
7b7d36a8
...
...
@@ -79,6 +79,8 @@ typedef struct {
GUI_ANIMATE
Animate
;
}
GUI_ANIMATION
;
typedef
struct
GUI_OBJ_CHILD_
GUI_OBJ_CHILD
;
struct
GUI_OBJ_
{
INT64
OffsetX
;
INT64
OffsetY
;
...
...
@@ -87,14 +89,14 @@ struct GUI_OBJ_ {
GUI_OBJ_DRAW
Draw
;
GUI_OBJ_PTR_EVENT
PtrEvent
;
GUI_OBJ_KEY_EVENT
KeyEvent
;
LIST_ENTRY
Children
;
UINT32
NumChildren
;
GUI_OBJ_CHILD
**
Children
;
};
typedef
struct
{
LIST_ENTRY
Link
;
struct
GUI_OBJ_CHILD_
{
GUI_OBJ
*
Parent
;
GUI_OBJ
Obj
;
}
GUI_OBJ_CHILD
;
};
typedef
struct
{
UINT32
Width
;
...
...
Platform/OpenCanopy/Views/BootPicker.c
浏览文件 @
7b7d36a8
此差异已折叠。
点击以展开。
Platform/OpenCanopy/Views/BootPicker.h
浏览文件 @
7b7d36a8
...
...
@@ -21,11 +21,12 @@ typedef struct {
GUI_IMAGE
Label
;
OC_BOOT_ENTRY
*
Context
;
BOOLEAN
CustomIcon
;
UINT8
Index
;
}
GUI_VOLUME_ENTRY
;
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
GUI_VOLUME_ENTRY
*
SelectedEntry
;
GUI_OBJ_CHILD
Hdr
;
UINT32
SelectedIndex
;
}
GUI_VOLUME_PICKER
;
#endif // BOOT_PICKER_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录