跳转到内容

std.os.uefi.protocol.hii_popup

标准库Zig 0.17.1官方原文
源码std/os/uefi/protocol/hii_popup.zig

第 1 行

std.os.uefi.protocol.hii_popup.cc

别名

第 6 行

别名目标 std.os.uefi.cc

std.os.uefi.protocol.hii_popup.Guid

别名

第 3 行

别名目标 std.os.uefi.Guid

std.os.uefi.protocol.hii_popup.hii

别名

第 5 行

别名目标 std.os.uefi.hii

std.os.uefi.protocol.hii_popup.HiiPopup

容器

第 9 行

显示弹出窗口

字段

revision: u64
_create_popup: *const fn (*const HiiPopup, PopupStyle, PopupType, hii.Handle, u16, ?*PopupSelection) callconv(cc) Status

std.os.uefi.protocol.hii_popup.HiiPopup.createPopup

函数

第 19 行

显示弹出窗口。

pub fn createPopup( self: *const HiiPopup, style: PopupStyle, popup_type: PopupType, handle: hii.Handle, msg: u16, ) CreatePopupError!PopupSelection

参数

self: *const HiiPopup
style: PopupStyle
popup_type: PopupType
handle: hii.Handle
msg: u16

错误

InvalidParameter
OutOfResources
Unexpected UnexpectedError

std.os.uefi.protocol.hii_popup.HiiPopup.CreatePopupError

错误集合

第 13 行

错误

InvalidParameter
OutOfResources
Unexpected UnexpectedError

std.os.uefi.protocol.hii_popup.HiiPopup.guid

常量

第 35 行

std.os.uefi.protocol.hii_popup.HiiPopup.PopupSelection

容器

第 57 行

字段

ok
cancel
yes
no

std.os.uefi.protocol.hii_popup.HiiPopup.PopupStyle

容器

第 44 行

字段

info
warning
@"error"

std.os.uefi.protocol.hii_popup.HiiPopup.PopupType

容器

第 50 行

字段

ok
cancel
yes_no
yes_no_cancel

std.os.uefi.protocol.hii_popup.Status

别名

第 4 行

别名目标 std.os.uefi.Status

std.os.uefi.protocol.hii_popup.std

别名

第 1 行

别名目标 std

std.os.uefi.protocol.hii_popup.uefi

别名

第 2 行

别名目标 std.os.uefi

源码

std/os/uefi/protocol/hii_popup.zig

const std = @import("std");
const uefi = std.os.uefi;
const Guid = uefi.Guid;
const Status = uefi.Status;
const hii = uefi.hii;
const cc = uefi.cc;

/// 显示弹出窗口
pub const HiiPopup = extern struct {
    revision: u64,
    _create_popup: *const fn (*const HiiPopup, PopupStyle, PopupType, hii.Handle, u16, ?*PopupSelection) callconv(cc) Status,

    pub const CreatePopupError = uefi.UnexpectedError || error{
        InvalidParameter,
        OutOfResources,
    };

    /// 显示弹出窗口。
    pub fn createPopup(
        self: *const HiiPopup,
        style: PopupStyle,
        popup_type: PopupType,
        handle: hii.Handle,
        msg: u16,
    ) CreatePopupError!PopupSelection {
        var res: PopupSelection = undefined;
        switch (self._create_popup(self, style, popup_type, handle, msg, &res)) {
            .success => return res,
            .invalid_parameter => return error.InvalidParameter,
            .out_of_resources => return error.OutOfResources,
            else => |status| return uefi.unexpectedStatus(status),
        }
    }

    pub const guid align(8) = Guid{
        .time_low = 0x4311edc0,
        .time_mid = 0x6054,
        .time_high_and_version = 0x46d4,
        .clock_seq_high_and_reserved = 0x9e,
        .clock_seq_low = 0x40,
        .node = [_]u8{ 0x89, 0x3e, 0xa9, 0x52, 0xfc, 0xcc },
    };

    pub const PopupStyle = enum(u32) {
        info,
        warning,
        @"error",
    };

    pub const PopupType = enum(u32) {
        ok,
        cancel,
        yes_no,
        yes_no_cancel,
    };

    pub const PopupSelection = enum(u32) {
        ok,
        cancel,
        yes,
        no,
    };
};