adam-gui/vendor/fyne.io/fyne/v2/app/app_mobile_ios.go

41 lines
701 B
Go
Raw Permalink Normal View History

2024-04-29 19:13:50 +02:00
//go:build !ci && ios
// +build !ci,ios
package app
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation -framework UIKit -framework UserNotifications
#include <stdlib.h>
char *documentsPath(void);
void openURL(char *urlStr);
void sendNotification(char *title, char *content);
*/
import "C"
import (
"net/url"
"path/filepath"
"unsafe"
"fyne.io/fyne/v2"
)
func rootConfigDir() string {
root := C.documentsPath()
return filepath.Join(C.GoString(root), "fyne")
}
func (a *fyneApp) OpenURL(url *url.URL) error {
urlStr := C.CString(url.String())
C.openURL(urlStr)
C.free(unsafe.Pointer(urlStr))
return nil
}
func defaultVariant() fyne.ThemeVariant {
return systemTheme
}