Feature flags that clash are no fun. This reworks a few things so that
docs can properly build with all feature flags at once and note their
support.
Also adds a supported table to the README for ease of discovery.
- AutoLayout is now behind a feature flag (that is defaulted) to enable
building and running on platforms that do _not_ support AutoLayout.
- Added a frame-based Layout example for platforms that don't have
AutoLayout support.
- Fixed a bug in geometry.rs where x/y coordinates would get swapped on
conversion to `CGRect`.
- Added a README to the examples directory to aid in first time users
running examples.
- Changes internal target_os flags to be feature flags; macOS is now
appkit, and iOS/tvOS are now uikit. This enables platforms that are
not Apple-specific platforms that use frameworks to be compiled for.
- Updates the examples to handle closing/quitting better.
This is a basic implementation of the custom protocol, with built-in mimetype extraction from the content, backed by URI detection.
To make it clear, I added an example and can be run with:
```
cargo run --example webview_custom_protocol --features webview
```
- Corrects `feature` -> `target_os` checks.
- Updates the old iOS scene delegate pieces to use the new class
structure.
- Bundles in an iOS demo app.
- Blocks off most things that should not even attempt to compile for
iOS.
- Drag and drop, hidden, and so on now live on on the `Layout` trait,
which helps make the logic less of a hassle to support (these methods
are almost always guaranteed to exist on any view type, and it's
easier to just noop them on a specific view if need be).
- Begin reworking auto-drop-remove-from-superview logic by including an
`is_handle` flag on `View`; will need to extend this work to others.
- Adds a new `ObjcProperty` type, which wraps our Objective-C objects in
a Rust-backed Rc/Refcell combo. This in general makes understanding
reference counting/storage more digestable when reading through the
codebase and leans more on Rust to do its thing than the Objective-C
runtime.
- Most widgets that need to implement `Layout` now only need to provide
a slot for running a handler with the underlying node.
- Further documentation work ongoing.
- Changes trait callbacks to receive a `&str` rather than `String`.
- Fixes a bug where multiple text field types with different delegates
would not receive the right delegate type when coming from the
Objective-C side.
- Minor cleanup.
- Anchors are now enums, which help in debugging constraint issues.
- Enum types that are acceptable for constraint generation are now
matched at runtime, and provide better error messages if a constraint
can't be satisfied and crashes the app.
- `left` and `right` anchors are now supported on all widgets, fixing an
oversight from early iterations of the framework.
- Reduces `unsafe` usage by a decent amount when setting constraint
pointers for widget types.
added text_should_begin_editing(), text_did_begin_editing(), text_did_change(), text_should_end_editing() and text_did_end_editing() event handlers
for now these only take the value from the TextField and hand it over as a String
- Basic support for `AttributedString` type.
- `Debug` implementations across the board to ease debugging issues.
- Methods that take `Color` and `Font` types now accept an `AsRef` to
make implementing less of a headache.
- Cleanup of the `utils` module.
- Adds support for NSSplitViewController.
- Reworks NSMenu support to be cleaner with enum variants.
- Reworks the Foundation underpinnings to be a bit safer and more clear
in how they're used and passed around.
- Changes to docs structure for push towards v0.1.
- Examples updated to account for changes.
- Beginning to transition View types to use Rc/RefCell internally,
which should provide better guarantees about ownership on the Rust side.
This is also important for certain Objective-C side scenarios where we
may need to set an ivar after creation, which requires some level of
mutability. This may also possibly help bring down the unsafe usage,
which would be cool.
- Rewrote the Color module; this now handles system colors better, and
provides support for dynamic color creation. Supporting combinations
of dark/light/contrast is now possible with handler passed in via
`Color::dynamic`. This still has work to do in terms of some accessor
methods and such, but it works well for now. The `to_platform...`
method should be removed before v0.1.
- Added a new feature for enabling fallback color usage on older macOS
versions that don't support system colors. This may honestly never be
used, but it cost nothing to implement.
- Fixed a bug in the Autolayout wrapper where dereferencing could cause
constraints to crash at runtime.
- Support setting text color on labels.
- Support setting text color on buttons, albeit very hacky right now.
This needs to be extracted and/or cleaned up, but getting it sketched
out was important for this commit.
- Support setting a key equivalent on buttons.
- Creating a local event monitor is now possible.
- Examples updated; Calculator clone example added.
The only API breaking change in this commit from earlier commits should
be `color::rgb` needing to be `color::Color` followed by a
`Color::rgb(...)` call.