Documentation
¶
Index ¶
- Variables
- func CFArrayGetCount(array CFRef) int
- func CFDataGetBytePtr(data CFRef) uintptr
- func CFDataGetLength(data CFRef) int
- func CFDataToSlice(data CFRef) []byte
- func CFNumberGetValue(num CFRef) (int32, error)
- func CFRelease(ref CFRef)
- func CFStringToString(ref CFRef) string
- func FuncPC(f func()) uintptr
- func ReleaseCFArray(array CFRef)
- type CFRef
- func CFArrayGetValueAtIndex(array CFRef, index int) CFRef
- func CFDictionaryGetValueIfPresent(dict CFRef, key CFString) (value CFRef, ok bool)
- func CFStringCreateExternalRepresentation(strRef CFRef) (CFRef, error)
- func IOPSCopyPowerSourcesInfo() (CFRef, error)
- func IOPSCopyPowerSourcesList(blob CFRef) (CFRef, error)
- func IOPSGetPowerSourceDescription(blob CFRef, ps CFRef) (CFRef, error)
- type CFString
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( // Power source is off-line or no longer connected. IOPSOffLineValue = "Off Line" // Power source is connected to external or AC power, and is not draining the internal battery. IOPSACPowerValue = "AC Power" // Power source is currently using the internal battery. IOPSBatteryPowerValue = "Battery Power" )
Values for key IOPSPowerSourceStateKey.
var IOPSCurrentCapacityKey = StringToCFString("Current Capacity")
var IOPSPowerSourceStateKey = StringToCFString("Power Source State")
var IOPSTimeToEmptyKey = StringToCFString("Time to Empty")
Functions ¶
func CFArrayGetCount ¶
func CFDataGetBytePtr ¶
func CFDataGetLength ¶
func CFDataToSlice ¶
func CFNumberGetValue ¶
func CFStringToString ¶
CFStringToString returns a Go string representation of the passed in CFString, or an empty string if it's invalid.
func FuncPC ¶
func FuncPC(f func()) uintptr
FuncPC returns the entry point for f. See comments in runtime/proc.go for the function of the same name.
func ReleaseCFArray ¶
func ReleaseCFArray(array CFRef)
ReleaseCFArray iterates through an array, releasing its contents, and then releases the array itself. This is necessary because we cannot, easily, set the CFArrayCallBacks argument when creating CFArrays.
Types ¶
type CFRef ¶
type CFRef uintptr
CFRef is an opaque reference to a Core Foundation object. It is a pointer, but to memory not owned by Go, so not an unsafe.Pointer.
func CFArrayGetValueAtIndex ¶
type CFString ¶
type CFString CFRef
func StringToCFString ¶
StringToCFString returns a copy of the UTF-8 contents of s as a new CFString.