1
0
Fork 0
Go to file
glowcoil 9fbfe18f9a
NSView lifetime fixes (#104)
* drain autorelease pools in Window::open_* methods

* fixes to NSView lifetime logic:

- in open_parented and open_blocking, release NSView after adding
  it as a subview of the parent
- in open_blocking, don't call autorelease on NSWindow. previously
  it was a no-op, but now that we are actually draining our
  autorelease pools, it ends up prematurely releasing the window.

* fixes to NSView cleanup logic:

- Move retainCount check to before calling [super release].
  If [super release] happens first, then in the final call to
  release, [super release] deallocates the object and the call to
  retainCount results in a segfault.

- Move objc_disposeClassPair to dealloc. Previously we were
  calling it when retainCount == 1, but that's exactly when
  dealloc is called, so this is cleaner. Also, we need to call
  objc_disposeClassPair after [super dealloc].

NOTE: The circular-reference-breaking logic in release is
definitely broken. It's easy to thwart it by e.g. creating a
wgpu surface at some point after build() or dropping one at some
point before drop(). Need to come up with a better solution.
2021-11-07 16:57:12 -06:00
.github/workflows Build examples too in CI 2021-07-16 01:10:29 +02:00
examples Support passing back some events to the platform (#90) 2021-02-09 14:47:31 -06:00
src NSView lifetime fixes (#104) 2021-11-07 16:57:12 -06:00
.gitignore Add Windows initial code 2020-05-25 21:35:03 +02:00
.rustfmt.toml fix some rustfmt annoyances 2020-09-11 22:29:29 +02:00
Cargo.toml macOS: use CFRunLoopTimer, improve view release logic (#84) 2020-12-27 20:44:23 -06:00
LICENSE-APACHE Add license statement and files (dual MIT or Apache 2.0) 2020-11-12 21:52:49 +01:00
LICENSE-MIT Add license statement and files (dual MIT or Apache 2.0) 2020-11-12 21:52:49 +01:00
README.md update readme feature table 2020-12-19 17:48:14 -06:00

baseview

A low-level windowing system geared towards making audio plugin UIs.

baseview abstracts the platform-specific windowing APIs (winapi, cocoa, xcb) into a platform-independent API, but otherwise gets out of your way so you can write plugin UIs.

Interested in learning more about the project? Join us on discord, channel #plugin-gui.

Roadmap

Below is a proposed list of milestones (roughly in-order) and their status. Subject to change at any time.

Feature Windows Mac OS Linux
Spawns a window, no parent ✔️ ✔️ ✔️
Cross-platform API for window spawning ✔️ ✔️ ✔️
Can find DPI scale factor ✔️ ✔️
Basic event handling (mouse, keyboard) ✔️ ✔️ ✔️
Parent window support ✔️ ✔️ ✔️

Prerequisites

Linux

Install dependencies, e.g.,

sudo apt-get install libx11-dev libxcursor-dev libxcb-dri2-0-dev libxcb-icccm4-dev libx11-xcb-dev

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Baseview by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.