mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
all: format comments with go fmt ./... using Go 1.19
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-5
@@ -6,7 +6,7 @@ functionality for running graphical user interfaces.
|
||||
|
||||
See https://gioui.org for instructions to set up and run Gio programs.
|
||||
|
||||
Windows
|
||||
# Windows
|
||||
|
||||
Create a new Window by calling NewWindow. On mobile platforms or when Gio
|
||||
is embedded in another project, NewWindow merely connects with a previously
|
||||
@@ -34,7 +34,7 @@ For example:
|
||||
A program must keep receiving events from the event channel until
|
||||
DestroyEvent is received.
|
||||
|
||||
Main
|
||||
# Main
|
||||
|
||||
The Main function must be called from a program's main function, to hand over
|
||||
control of the main thread to operating systems that need it.
|
||||
@@ -56,14 +56,13 @@ For example, to display a blank but otherwise functional window:
|
||||
app.Main()
|
||||
}
|
||||
|
||||
|
||||
Event queue
|
||||
# Event queue
|
||||
|
||||
A FrameEvent's Queue method returns an event.Queue implementation that distributes
|
||||
incoming events to the event handlers declared in the last frame.
|
||||
See the gioui.org/io/event package for more information about event handlers.
|
||||
|
||||
Permissions
|
||||
# Permissions
|
||||
|
||||
The packages under gioui.org/app/permission should be imported
|
||||
by a Gio program or by one of its dependencies to indicate that specific
|
||||
|
||||
@@ -490,7 +490,6 @@ func (w *x11Window) destroy() {
|
||||
|
||||
// atom is a wrapper around XInternAtom. Callers should cache the result
|
||||
// in order to limit round-trips to the X server.
|
||||
//
|
||||
func (w *x11Window) atom(name string, onlyIfExists bool) C.Atom {
|
||||
cname := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cname))
|
||||
@@ -504,7 +503,6 @@ func (w *x11Window) atom(name string, onlyIfExists bool) C.Atom {
|
||||
// x11EventHandler wraps static variables for the main event loop.
|
||||
// Its sole purpose is to prevent heap allocation and reduce clutter
|
||||
// in x11window.loop.
|
||||
//
|
||||
type x11EventHandler struct {
|
||||
w *x11Window
|
||||
text []byte
|
||||
@@ -512,7 +510,6 @@ type x11EventHandler struct {
|
||||
}
|
||||
|
||||
// handleEvents returns true if the window needs to be redrawn.
|
||||
//
|
||||
func (h *x11EventHandler) handleEvents() bool {
|
||||
w := h.w
|
||||
xev := h.xev
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
Package bluetooth implements permissions to access Bluetooth and Bluetooth
|
||||
Low Energy hardware, including the ability to discover and pair devices.
|
||||
|
||||
Android
|
||||
# Android
|
||||
|
||||
The following entries will be added to AndroidManifest.xml:
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
|
||||
|
||||
Note that ACCESS_FINE_LOCATION is required on Android before the Bluetooth
|
||||
device may be used.
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
/*
|
||||
Package camera implements permissions to access camera hardware.
|
||||
|
||||
Android
|
||||
# Android
|
||||
|
||||
The following entries will be added to AndroidManifest.xml:
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false"/>
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false"/>
|
||||
|
||||
CAMERA is a "dangerous" permission. See documentation for package
|
||||
gioui.org/app/permission for more information.
|
||||
|
||||
@@ -34,7 +34,7 @@ program's source code:
|
||||
_ "net"
|
||||
)
|
||||
|
||||
Android -- Dangerous Permissions
|
||||
# Android -- Dangerous Permissions
|
||||
|
||||
Certain permissions on Android are marked with a protection level of
|
||||
"dangerous". This means that, in addition to including the relevant
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
/*
|
||||
Package networkstate implements permissions to access network connectivity information.
|
||||
|
||||
Android
|
||||
# Android
|
||||
|
||||
The following entries will be added to AndroidManifest.xml:
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
*/
|
||||
package networkstate
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
Package storage implements read and write storage permissions
|
||||
on mobile devices.
|
||||
|
||||
Android
|
||||
# Android
|
||||
|
||||
The following entries will be added to AndroidManifest.xml:
|
||||
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are "dangerous" permissions.
|
||||
See documentation for package gioui.org/app/permission for more information.
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
Package wakelock implements permission to acquire locks that keep the system
|
||||
from suspending.
|
||||
|
||||
Android
|
||||
# Android
|
||||
|
||||
The following entries will be added to AndroidManifest.xml:
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
*/
|
||||
package wakelock
|
||||
|
||||
Reference in New Issue
Block a user