|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#include <AppKitAdapter.hpp>
| - adapters: |
| - adapters: |
| - adapters: | (const AppKitAdapter &) |
| - (AppKitAdapter &) adapters: | (const AppKitAdapter &) |
| - (string_view) aria: | const |
Implements aria::binding::IViewAdapter.
| - (AppKitView &) adapters: | (NSView *) | view |
Wrap a native NSView* as an IView owned by this adapter.
Every host used to hand-roll this: allocate an AppKitView, then park it in a std::vector<std::unique_ptr<AppKitView>> because BindingEngine takes IView& and does not own its views. The adapter already keeps a per-view registry for its ObjC signal bridges, so it is the natural owner.
engine.bind_text(vm.name, adapter->view_for(nameField));
Calling - view_for twice for the same NSView* returns the same AppKitView, so multiple bindings on one control share a single per-view subscription bucket in BindingEngine.
Lifetime — differs from the Qt adapter, deliberately: AppKitView retains its NSView* via ARC, so a cached view keeps the control alive and there is no "native handle died first" event to evict on. Entries therefore live until the adapter is destroyed (which fires each IView's destroy signal and releases the bindings), or until - release_view is called explicitly for a control the host is discarding early.
Passing nil is a programming error and throws std::invalid_argument.
| - (void) adapters: | (NSView *) | view |
Drop the cached AppKitView for view, if any.
Fires that view's destroy signal, so BindingEngine releases every binding wired to it, and releases the adapter's ARC reference to the control. Use this when a host tears down part of its UI while keeping the adapter alive (a closed panel, a recycled row). Calling it for an unknown view is a harmless no-op.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::string_view) | text |
Implements aria::binding::IViewAdapter.
| - (string) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::string_view)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | value |
Implements aria::binding::IViewAdapter.
| - (bool) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(bool)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (int) | value |
Implements aria::binding::IViewAdapter.
| - (int) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(int)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::int64_t) | value |
Implements aria::binding::IViewAdapter.
| - (int64_t) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::int64_t)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::uint64_t) | value |
Implements aria::binding::IViewAdapter.
| - (uint64_t) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::uint64_t)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (float) | value |
Implements aria::binding::IViewAdapter.
| - (float) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(float)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (double) | value |
Implements aria::binding::IViewAdapter.
| - (double) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(double)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | visible |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | enabled |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void()>) | cb |
Implements aria::binding::IViewAdapter.