mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-10 14:23:31 +01:00
e8a29b1a29
The internal parser is retro compatible with old Clover revisions since r3250. This is possible because a check for the existence of any variable inside SETTING_DATA structure is performed before the call. Variables are all accessed using the label property of the Mirror class, so as a string.
51 lines
1.0 KiB
Swift
51 lines
1.0 KiB
Swift
//
|
|
// Driver.swift
|
|
// Clover
|
|
//
|
|
// Created by vector sigma on 22/10/2019.
|
|
// Copyright © 2019 CloverHackyColor. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
enum EFIkind: String {
|
|
case uefi = "UEFI"
|
|
case bios = "BIOS"
|
|
}
|
|
|
|
final class EFIDriver {
|
|
private var internalState : NSControl.StateValue = .off
|
|
var dest : String
|
|
var src : String
|
|
var kind : EFIkind
|
|
var sectionName : String
|
|
|
|
var state : NSControl.StateValue {
|
|
get {
|
|
self.itemView?.checkBox.state = self.internalState
|
|
return self.internalState
|
|
}
|
|
set {
|
|
self.internalState = newValue
|
|
self.itemView?.checkBox.state = self.internalState
|
|
}
|
|
}
|
|
|
|
var isFromClover : Bool
|
|
var itemView : CollectionViewItem? = nil
|
|
|
|
init(dest: String, src: String,
|
|
kind: EFIkind,
|
|
sectionName: String,
|
|
state: NSControl.StateValue,
|
|
isFromClover: Bool) {
|
|
self.dest = dest
|
|
self.src = src
|
|
self.kind = kind
|
|
self.sectionName = sectionName
|
|
self.isFromClover = isFromClover
|
|
self.state = state
|
|
}
|
|
}
|
|
|