{"id":13835906,"url":"https://github.com/linebender/glazier","last_synced_at":"2025-04-06T17:12:02.334Z","repository":{"id":61930597,"uuid":"546940097","full_name":"linebender/glazier","owner":"linebender","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-14T23:14:50.000Z","size":2234,"stargazers_count":207,"open_issues_count":33,"forks_count":32,"subscribers_count":24,"default_branch":"main","last_synced_at":"2024-05-02T04:10:36.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linebender.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2022-10-06T22:36:51.000Z","updated_at":"2024-04-30T15:19:08.000Z","dependencies_parsed_at":"2023-11-23T14:29:02.027Z","dependency_job_id":"a5849013-2bff-45a3-8622-b89a707d5d74","html_url":"https://github.com/linebender/glazier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linebender%2Fglazier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linebender%2Fglazier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linebender%2Fglazier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linebender%2Fglazier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linebender","download_url":"https://codeload.github.com/linebender/glazier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517915,"owners_count":20951719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:00:22.355Z","updated_at":"2025-04-06T17:12:02.317Z","avatar_url":"https://github.com/linebender.png","language":"Rust","funding_links":[],"categories":["Other"],"sub_categories":["Rust 2D renderer"],"readme":"\u003e [!Important]\n\u003e Linebender no longer uses Glazier, and so this project is no longer supported.\n\u003e\n\u003e You should prefer to use [winit](https://crates.io/crates/winit) instead.\n\n\u003cdiv align=\"center\"\u003e\n\n# glazier\n\n[![Xi Zulip](https://img.shields.io/badge/Xi%20Zulip-%23glazier-blue?logo=Zulip)](https://xi.zulipchat.com/#narrow/stream/351333-glazier)\n[![dependency status](https://deps.rs/repo/github/linebender/glazier/status.svg)](https://deps.rs/repo/github/linebender/glazier)\n[![Apache 2.0](https://img.shields.io/badge/license-Apache-blue.svg)](#license)\n[![Build Status](https://github.com/linebender/glazier/actions/workflows/ci.yml/badge.svg)](https://github.com/linebender/glazier/actions)\n\u003c!-- [![Crates.io](https://img.shields.io/crates/v/glazier.svg)](https://crates.io/crates/glazier) --\u003e\n\u003c!-- [![Docs](https://docs.rs/glazier/badge.svg)](https://docs.rs/glazier) --\u003e\n\n\u003c/div\u003e\n\n\u003e [!Caution]\n\u003e This README content has not been validated recently.\n\u003e\n\u003e Glazier is no longer supported, and should not be used.\n\u003e\n\u003e This repository is made available for reference purposes.\n\u003e\n\u003e Feel free to use the [#glazier channel](https://xi.zulipchat.com/#narrow/stream/351333-glazier) if reusing code from Glazier.\n\u003e Some of the text input handling code is more complete than the equivalent in winit, and so might be useful for reference.\n\nGlazier is an operating system integration layer infrastructure layer intended for\nhigh quality GUI toolkits in Rust. It is agnostic to the choice of drawing, so the\nclient must provide that, but the goal is to abstract over most of the other\nintegration points with the underlying operating system.\n\nPrimary platforms are Windows, macOS, and Linux. Web is a secondary platform.\nOther ports may happen if they are contributed.\n\nThis library is currently work in progress and should be considered experimental.\nContributions are welcome, see [CONTRIBUTING](./CONTRIBUTING.md) for more details.\n\n## Community\n\n[![Xi Zulip](https://img.shields.io/badge/Xi%20Zulip-%23glazier-blue?logo=Zulip)](https://xi.zulipchat.com/#narrow/stream/351333-glazier)\n\nDiscussion of Xilem development happens in the [Xi Zulip](https://xi.zulipchat.com/), specifically the [#glazier stream](https://xi.zulipchat.com/#narrow/stream/351333-glazier). All public content can be read without logging in\n\n## Scope\n\nThe following tasks are in scope. Mostly they are implemented, but as always\nthere is more refinement to be done.\n\n* Window creation, including subwindows (useful for context menus and the like).\n\n* System menus. These are especially important on macOS.\n\n* Keyboard events.\n\n* Input Method Editor. On macOS, correct handling of dead keys is through the\nIME, and an application built on Glazier is expected to handle IME.\n\n* Mouse and pointer (touch and pen) events. Mouse events are currently supported, pointers\nare a hoped-for feature.\n\n* Cursors (mouse pointer indicator on the screen), including custom images.\n\n* Providing DPI scaling information to the application.\n\n* Clipboard.\n\n* File dialog.\n\nThe general philosophy is that a task is in scope if it requires deep integration\nwith the platform and is not easy to separate out as a separate library that layers\non top of Glazier.\n\n## Hooks provided\n\nGlazier does not provide drawing primitives and is intended to be agnostic to\nthe drawing infrastructure. It uses [raw-window-handle] to provide an attachment\npoint for the drawing code, a widely used abstraction in the Rust ecosystem. A\ntop priority will be integrating with the [wgpu](https://github.com/gfx-rs/wgpu)\necosystem. In addition, we would gladly accept integration work to make [Piet]\nrun on top of Glazier, but this is not a core priority.\n\nWe hope to integrate with [AccessKit] for accessibility.\n\nWhile Glazier currently has primitive support for scheduling repaint cycles,\nultimately we would like to support [frame pacing]. Doing the actual decision\nof when to repaint is probably out of scope, but providing portable infrastructure\n([CVDisplayLink] on macOS, presentation statistics, scheduling based on high resolution\ntimers) is in scope.\n\n## Out of scope\n\nWe have no solution to interfacing with the system compositor. This is necessary\nto handle embedded video content properly, and is also a good way to stitch\ntogether other embedded content such as web views.\n\nLike drawing, most font and text issues are out of scope. Localization and\ninternationalization are expected to be handled by the layer above, though platform\nhooks would be in scope (for example, querying the locale preference).\n\nGlazier does not provide a solution for packaging and distribution of applications.\nWork on this is needed, and we would gladly cooperate with such efforts.\n\n## Design\n\nThe code in Glazier can be divided into roughly two categories: the\nplatform agnostic code and types, which are exposed directly, and the\nplatform-specific implementations of these types, which live in per-backend\ndirectories in `src/backend`. The backend-specific code for the current\nbackend is reexported as `glazier::backend`.\n\nGlazier does not generally expose backend types directly. Instead, we\nexpose wrapper structs that define the common interface, and then call\ncorresponding methods on the concrete type for the current backend.\n\n## Unsafe\n\nInteracting with system APIs is inherently unsafe. One of the goals of\nGlazier is to handle almost all interaction with these APIs, exposing\na safe interface to the UI toolkit. The exception is drawing, which will\ngenerally require at least some additional unsafe code for integration.\n\n## Similar libraries\n\n* [winit]. This is by far the most commonly used window creation crate. As\ndiscussed in the links below, the scope is defined quite differently. In general,\nwinit is probably more suitable for games and game-like applications, while Glazier\nis intended to provide more of the full desktop GUI experience, including system\nmenus and support for IME.\n\n* [baseview]. Another window creation abstraction, motivated mostly by the\naudio plugin use case where the module is not in control of its own UI runloop.\n\n## Dependencies\n\nGlazier requires a recent rust toolchain to build; it does not (yet) have an\nexplicit minimum supported rust version, but the latest stable version should\nwork.\n\nOn Linux and BSD, Glazier also requires `pkg-config` and `clang`,\nand the development packages of `wayland`, `libxkbcommon` and `libxcb`, to be installed.\nSome of the examples require `vulkan-loader`.\n\nMost distributions have `pkg-config` installed by default. To install the remaining packages on Fedora, run\n```sh\nsudo dnf install clang wayland-devel libxkbcommon-x11-devel libxcb-devel vulkan-loader-devel\n```\nTo install them on Debian or Ubuntu, run\n```sh\nsudo apt-get install pkg-config clang libwayland-dev libxkbcommon-x11-dev libvulkan-dev\n```\n\n## Further reading\n\n* [Advice for the next dozen Rust GUIs](https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-guis.html)\n\n* [Rust GUI Infrastructure](http://www.cmyr.net/blog/rust-gui-infra.html)\n\n* [Text Editing Hates You Too](https://lord.io/text-editing-hates-you-too/)\n\n## License\n\nLicensed under the Apache License, Version 2.0\n([LICENSE](LICENSE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n\n## Contribution\n\nContributions are welcome by pull request. The [Rust code of conduct] applies.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\nlicensed as above, without any additional terms or conditions.\n\n[druid]: https://github.com/linebender/druid\n[winit]: https://github.com/rust-windowing/winit\n[baseview]: https://github.com/RustAudio/baseview\n[raw-window-handle]: https://github.com/rust-windowing/raw-window-handle\n[AccessKit]: https://github.com/AccessKit/accesskit\n[frame pacing]: https://raphlinus.github.io/ui/graphics/gpu/2021/10/22/swapchain-frame-pacing.html\n[CVDisplayLink]: https://developer.apple.com/documentation/corevideo/cvdisplaylink\n[Piet]: https://github.com/linebender/piet\n[rust code of conduct]: https://www.rust-lang.org/policies/code-of-conduct\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinebender%2Fglazier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinebender%2Fglazier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinebender%2Fglazier/lists"}