tam
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
package winapi
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -framework CoreWLAN -framework CoreLocation -framework Foundation
|
||||
#cgo LDFLAGS: -framework CoreWLAN -framework CoreLocation -framework Foundation -framework AVFoundation -framework CoreGraphics
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -12,7 +12,12 @@ typedef struct {
|
||||
} CWifiInfo;
|
||||
|
||||
void RequestLocationPermission();
|
||||
void RequestCameraAndMicPermission();
|
||||
void RequestScreenCapturePermission();
|
||||
CWifiInfo GetCurrentWifiInfo();
|
||||
int GetCameraPermissionStatus();
|
||||
int GetMicrophonePermissionStatus();
|
||||
int GetScreenCapturePermissionStatus();
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
@@ -24,6 +29,31 @@ func RequestLocationAccess() {
|
||||
C.RequestLocationPermission()
|
||||
}
|
||||
|
||||
// RequestCameraAndMicAccess requests Camera and Microphone permissions on macOS
|
||||
func RequestCameraAndMicAccess() {
|
||||
C.RequestCameraAndMicPermission()
|
||||
}
|
||||
|
||||
// RequestScreenCaptureAccess requests Screen Capture permission on macOS
|
||||
func RequestScreenCaptureAccess() {
|
||||
C.RequestScreenCapturePermission()
|
||||
}
|
||||
|
||||
// GetCameraPermission status on macOS
|
||||
func GetCameraPermission() int {
|
||||
return int(C.GetCameraPermissionStatus())
|
||||
}
|
||||
|
||||
// GetMicrophonePermission status on macOS
|
||||
func GetMicrophonePermission() int {
|
||||
return int(C.GetMicrophonePermissionStatus())
|
||||
}
|
||||
|
||||
// GetScreenCapturePermission status on macOS
|
||||
func GetScreenCapturePermission() int {
|
||||
return int(C.GetScreenCapturePermissionStatus())
|
||||
}
|
||||
|
||||
// GetWifiConnection đọc SSID và BSSID từ CoreWLAN (macOS)
|
||||
func GetWifiConnection() WifiConnection {
|
||||
info := C.GetCurrentWifiInfo()
|
||||
|
||||
Reference in New Issue
Block a user