Mirror of the Gio main repository

Gio - https://gioui.org

Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly (experimental).

Installation, examples, documentation

Go to gioui.org.

builds.sr.ht status

Issues

File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/[email protected]. For general discussion, use the mailing list: ~eliasnaur/[email protected].

Contributing

Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.

See the contribution guide for more details.

An official GitHub mirror is available.

Owner
Gio
Mirrors of the Gio repositories
Gio
Comments
  • gesture,widget: Text selection in Editor widgets

    gesture,widget: Text selection in Editor widgets

    • [x] Click-and-drag to select text.
    • [x] Cut/Copy selected text via Shortcut-X/C
    • [x] Paste text via Shortcut-V
    • [x] Paste overwrites selected text
    • [x] Typing overwrites selected text
    • [x] A "select all" hotkey, Shortcut-A
    • [x] Selection via keyboard via Shift-Arrows
    • [ ] Touch support
    • [x] Double-click selects a word
    • [ ] Triple-click selects a line
    • [x] Shift-click selects from the caret to the clicked position, or adjusts the current selection.
  • internal/cmd/convertshaders: add Windows comp shader compilation

    internal/cmd/convertshaders: add Windows comp shader compilation

    Hi, I started looking into implementing comp shaders for Windows and hit a few errors with the shaders that I'm not sure how to solve.

    error X3663: thread sync operation found in varying flow control, consider reformulating your algorithm so all threads will hit the sync simultaneously:

    backdrop.comp (and few others):

    void main() {
        if (mem_error != NO_ERROR) { // <---
            return;
        }
        ...
        barrier(); // <---
    

    error X3000: syntax error: unexpected token 'vector':

    struct TileSeg {
        vec2 origin;
        vec2 vector; // <--- it looks like "vector" is a reserved word.
        float y_edge;
        TileSegRef next;
    

    generate: Z:\Temp\shader-convert292189591\kernel4.comp(1000,17-25): error X3708: continue cannot be used in a switch

    case Cmd_Jump:
        cmd_ref = CmdRef(Cmd_Jump_read(cmd_alloc, cmd_ref).new_ref);
        cmd_alloc.offset = cmd_ref.offset;
        continue; // <---
    

    error X4026: thread sync operation must be in non-varying flow control, due to a potential race condition this sync is illegal, consider adding a sync after reading any values controlling shader execution at this point

    MallocResult alloc_clip_buf(uint link) {
        if (gl_LocalInvocationID.x == 0 && gl_LocalInvocationID.y == 0) {
            MallocResult m = malloc(CLIP_BUF_SIZE * 4);
            if (!m.failed) {
                write_mem(m.alloc, (m.alloc.offset >> 2) + CLIP_LINK_OFFSET, link);
            }
            sh_clip_alloc = m;
        }
        barrier(); // <---
        return sh_clip_alloc;
    }
    
  • layout: add Fit for widget scaling

    layout: add Fit for widget scaling

    Currently adds three different variants Contain, Cover, ScaleDown and Fill. These behave similarly to object-fit.

    This can be combined with other layouts. A common example could be:

    return layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
    	return layout.Cover.Layout(gtx, image.Layout)
    })
    
  • app/internal/window,cmd/gogio: fix golint issues and sort imports using goimports

    app/internal/window,cmd/gogio: fix golint issues and sort imports using goimports

    Golint issues:

    app/internal/window/os_wayland.go:1448:12: gioui.org/io/system.StageEvent composite literal uses unkeyed fields
    app/internal/window/os_x11.go:183:12: gioui.org/io/system.StageEvent composite literal uses unkeyed fields
    

    Goimports command:

    find gio/ -type f -name '*.go' | xargs -I '{}' goimports -w '{}'
    

    Note: This PR is intended to assess the Gio Sourcehut/GitHub integration. It contains no functional code changes, only stylistic.

    Preferably, Gio would be able to employ similar collaboration synchronization tools as those employed by the official Go project, which would enable automatically creating Sourcehut patches for corresponding GitHub PRs made to the Gio mirror repository.

    Thusly, consider this PR not as a suggestion for code change to Gio, it may very well be ignored and closed. Consider it instead a test of the integration bridge between the Sourcehut Gio repository and the GitHub Gio mirror repository.

    Cheers, Robin

  • app/internal/window: [wasm] fix animation framerate

    app/internal/window: [wasm] fix animation framerate

    Before this change, Gio could spawn multiple w.requestAnimationFrame.Invoke, which generates multiples w.draw, faster than the monitor refresh-rate.

    This patch aims to call w.requestAnimationFrame.Invoke everyframe, but it will only draw (w.draw) when animating.

  • app: add configurable appid for wayland

    app: add configurable appid for wayland

    Currently building Gio apps on Wayland will show status bar Unknown window as active.

    Screenshot from 2022-12-06 20-31-10

    This pr adds appID = "" default: filepath.Base(os.Args[0]) resulting Gio apps to show with that default appID using -X gioui.org/app.appID=org.gioui.app will result

    image

    By creating simple .desktop entry ~/.local/share/applications/org.gioui.app.desktop

    [Desktop Entry]
    Version=1.0
    Encoding=UTF-8
    Type=Application
    Name=Gio
    GenericName=Gio application
    Exec=gio %F
    Terminal=false
    

    image

    this would allow setting it also with -X gioui.org/app.appID=%s from gioui/gio-cmd since it would be fine to share -appid flag i guess.

  • app: [iOS] add ViewController on ViewEvent

    app: [iOS] add ViewController on ViewEvent

    New "ViewController" field on ViewEvent, which contain UIViewController for iOS. That is necessary to open custom UIViewController on top of Gio.

  • internal/gl: [js] adds cache to GetInteger/GetFloat and bind functions

    internal/gl: [js] adds cache to GetInteger/GetFloat and bind functions

    In the beginning of each frame, multiple calls to GetInteger/GetFloat is performed, taking around ~2ms out of ~8ms.

    Now, those data are cache at first usage, avoiding calls to JS. It saves around ~2ms out of ~8ms.

    Due to syscall/js usage of TextEncoder, which is slow on Chrome, a new cache was created, to bind function and use Invoke instead. It saves around ~1ms out of ~8ms.

    In total, this patch improves the performance from ~8ms to ~5ms. It still slower than https://github.com/gioui/gio/pull/4.

  • app: [android] fix insets

    app: [android] fix insets

    Previously, the Inset could be report wrongly when the bottom inset is smaller than the top. Now, it uses image.Rectangle directly, to bypass image.Rect checks.

    Signed-off-by: Inkeliz [email protected]

  • app: [windows] fix keyboard focus

    app: [windows] fix keyboard focus

    On Windows, it's required to SetFocus to receive keyboard events. Previously, Gio doesn't set focus on the current window. In some edge cases, it prevents Gio from getting keyboard events.

    That is more noticeable when spawning children's windows or parent windows. In such a case, the child window can steal keyboard focus, and Gio will never recover it. Now, it will retrieve the focus when using key.FocusOp.

    Signed-off-by: Inkeliz [email protected]

  • cmd/gogio: [android] allow custom signature-key

    cmd/gogio: [android] allow custom signature-key

    That change makes possible to provide custom PKCS#12/JavaKeystore using -key and the password with -pass. Also, it's possible to use PKCS#8 key along with X509 certificate, using -key and -cert.

    By default the gogio will use the debug.keystore, if no key is provided.

  • Let the custom title bar support windows11 quick layout

    Let the custom title bar support windows11 quick layout

    Use DWM to disable the title bar, so that the window has the default window style, support windows 11 fast layout arrangement

    https://user-images.githubusercontent.com/5478237/210163060-46233da4-dba0-46fd-84db-5f94283f4b9c.mp4

  • Add ArrowsNavigation option

    Add ArrowsNavigation option

    Directional navigation with arrow keys/dpad was only enabled on mobile targets (Android, iOS) with no way to enable it for desktop.

    This change adds a new Option for it, which is useful for game UIs and other apps that allow faster keyboard navigation.

    Signed-off-by: Denys Smirnov [email protected]

  • app,io/key: Add key code for key.Event

    app,io/key: Add key code for key.Event

    Add non-portable key code to the key.Event type. This allows users to handle platform-specific key codes in the application code. Backends will now always generate input events, even for keys with no well-known names. Previously backends only generated events for keys they recognized.

    Signed-off-by: Denys Smirnov [email protected]

  • Export Undo/Redo functions

    Export Undo/Redo functions

    Export Undo/Redo functions Editor.History is available to save/restore modification history

    Fixes: https://todo.sr.ht/~eliasnaur/gio/438 Signed-off-by: Fabien Jansem [email protected]

[mirror] Go on Mobile
[mirror] Go on Mobile

Go support for Mobile devices The Go mobile repository holds packages and build tools for using Go on mobile platforms. Package documentation as a sta

Jan 3, 2023
Tools for the Gio project, most notably gogio for packaging Gio programs

Gio Tools Tools for the Gio project, most notably gogio for packaging Gio programs. Issues File bugs and TODOs through the issue tracker or send an em

Oct 5, 2022
Mirror - Mirror is command line tool for mirroring a web page
Mirror - Mirror is command line tool for mirroring a web page

mirror mirror is command line tool for mirroring a web page. Caution Do not abus

May 29, 2022
NFGateway main project repository
NFGateway main project repository

NFGateway NFGateway is the main module of the Network Function over Serverless System (NFoS System). The NFoS System is the result of the M.S. Thesis

Nov 28, 2021
Lagoon - Simple Linux package repository mirror

Lagoon - Simple Linux package repository mirror A lagoon is a shallow stretch of water separated from the sea by a reef or sandbank. Lagoon can be use

Aug 17, 2022
Example programs for the Gio project.

Gio Examples Example programs for the Gio project. Issues File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/[email protected].

Dec 20, 2022
Tutorials for Gio, the GUI framwork in Go.
Tutorials for Gio, the GUI framwork in Go.

#go, #golang, #gui, #gioui You want a Gui. Of course you do. Did you know that Go has a great GUI library called Gio? In a 10-part tutorial we will st

Dec 28, 2022
MdEdit is a Vi-like markdown editor built using Gio

MdEdit MdEdit is a Vi-like markdown editor built using Gio. It is extremely early stage software. The Vi editor lacks most functionality and might be

Jun 29, 2022
go routine control, abstraction of the Main and some useful Executors.如果你不会管理Goroutine的话,用它
go routine control, abstraction of the Main and some useful Executors.如果你不会管理Goroutine的话,用它

routine Routine Architecture Quick Start package main import ( "log" "context" "github.com/x-mod/routine" ) func main(){ if err := routine.Main

Dec 6, 2022
Maintain a lower-bitrate copy of a music library in sync with the main copy.

msync Maintain a lower-bitrate copy of your music library, in sync with the main copy.

Mar 6, 2022
The mec platform for service register/discovery/subscribe and other functions.roject main repo.

EdgeGallery MEP project Introduction Edgegallery MEP is an open source implementation of MEC platform according to ETSI MEC 003 [1] and 011 [2] docume

Nov 15, 2022
This is a "simple" game server. Main functionalities are matching and establishing a connection between players
This is a

Game Server This is a "simple" game server. Main functionalities are matching and establishing a connection between players How to Run? run the server

Aug 28, 2022
Bell is the simplest event system written in Go (Golang) which is based on the execution of handlers independent of the main channel.

Bell Bell is the simplest event system written in Go (Golang) which is based on the execution of handlers independent of the main channel. Written in

Nov 17, 2022
The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the processor

server-pubsub The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the p

Dec 3, 2021
go-to64 analyzes Golang main package to convert int/uint to int64/uint64.

go-to64 About go-to64 analyzes Golang main package to convert int/uint to int64/uint64. This is an experiment tool, so be very careful. In a 32-bit en

Oct 31, 2021
This is my first golang project. The main reason for its existence is the need for practice. I will be studying golang while writing this project

My first GoLang project Project Aim The goal of this project is to develop the most simple golang bot to learn how to work with this programming langu

Jan 7, 2022
The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library.

dnstap-parse The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library. The output is supposed to mimic

Nov 14, 2021
RBTI Golang Server uses PostgreSQL and for its main database and uses Elasticsearch

RBTI Golang Server This server is used for my thesis project, it uses PostgreSQL and for its main database and uses Elasticsearch for faster query spe

Jan 17, 2022
DanaConfig is a static configuration extractor implemented in Golang for the main component of DanaBot
DanaConfig is a static configuration extractor implemented in Golang for the main component of DanaBot

DanaConfig is a static configuration extractor implemented in Golang for the main component of DanaBot (targeting Microsoft Windows). By de

Mar 7, 2022
Simple example of creating an `LD_PRELOAD` library in Go that hooks LibC's main function.

LD_PRELOAD in Go Simple example of creating an LD_PRELOAD library in Go that hooks LibC's main function. Code hooks __libc_start_main to run before th

Nov 9, 2022