From 96494a4325284525dabd73b4e3c2d64e2f3175ea Mon Sep 17 00:00:00 2001 From: gitoby <35229100+gitoby@users.noreply.github.com> Date: Mon, 15 Apr 2019 18:38:36 +0200 Subject: [PATCH] Reference documentation, guides, FAQ, hero subheading, and more (#240) --- .../dependency_installation/linux.md | 2 +- docs/docs/getting-started/faq.md | 52 +++++++++++++++++++ docs/docs/getting-started/first_app.md | 7 +-- docs/docs/getting-started/index.md | 35 +++++++++++-- docs/docs/guides/index.md | 4 +- docs/docs/guides/ui/writing_view.md | 6 +-- docs/docs/index.md | 2 +- docs/docs/reference/foundation/application.md | 33 ++++++++---- .../reference/foundation/dispatch_queue.md | 26 +++++----- docs/docs/reference/foundation/notifier.md | 24 ++++----- docs/docs/reference/foundation/property.md | 48 ++++++++--------- .../reference/foundation/weak_callback.md | 1 - docs/docs/reference/index.md | 7 ++- docs/docs/reference/ui/button.md | 8 +-- docs/docs/reference/ui/checkbox.md | 8 +-- docs/docs/reference/ui/click_event.md | 2 +- docs/docs/reference/ui/container_view.md | 18 +++---- docs/docs/reference/ui/image_view.md | 4 +- docs/docs/reference/ui/ios/view_core.md | 30 ++++++----- docs/docs/reference/ui/label.md | 10 ++-- docs/docs/reference/ui/list_view.md | 29 +++++------ .../reference/ui/list_view_data_source.md | 22 +++----- docs/docs/reference/ui/navigation_view.md | 8 +-- docs/docs/reference/ui/scroll_view.md | 20 +++---- docs/docs/reference/ui/submit_event.md | 17 ++++++ docs/docs/reference/ui/text_field.md | 10 ++-- docs/docs/reference/ui/view_core.md | 18 +++---- docs/docs/reference/ui/view_core_factory.md | 6 +-- docs/docs/reference/ui/view_event.md | 2 +- docs/docs/reference/ui/window.md | 12 ++--- docs/docs/stylesheets/boden.css | 4 +- docs/mkdocs.yml | 6 ++- docs/theme/hero.html | 3 +- examples/reddit/src/reddit.cpp | 4 +- .../foundation/include/bdn/Application.h | 1 - framework/ui/include/bdn/ListViewDataSource.h | 1 - .../io/boden/android/NativeListAdapter.java | 1 - .../android/src/wrapper/NativeListAdapter.cpp | 16 ------ framework/ui/src/ScrollView.cpp | 6 +-- framework/ui/src/Window.cpp | 4 +- 40 files changed, 299 insertions(+), 218 deletions(-) create mode 100644 docs/docs/getting-started/faq.md delete mode 100644 docs/docs/reference/foundation/weak_callback.md create mode 100644 docs/docs/reference/ui/submit_event.md diff --git a/docs/docs/getting-started/dependency_installation/linux.md b/docs/docs/getting-started/dependency_installation/linux.md index eb7e2a47..2cf7ab1a 100644 --- a/docs/docs/getting-started/dependency_installation/linux.md +++ b/docs/docs/getting-started/dependency_installation/linux.md @@ -1,4 +1,4 @@ -# Setting up Linux for Android Builds +# Setting up Ubuntu Linux for Android Builds ## 1. Install Git, Python, CMake, OpenJDK, and qemu-kvm diff --git a/docs/docs/getting-started/faq.md b/docs/docs/getting-started/faq.md new file mode 100644 index 00000000..d219a5c4 --- /dev/null +++ b/docs/docs/getting-started/faq.md @@ -0,0 +1,52 @@ +# FAQ + +## What platforms are supported? + +Currently Boden supports iOS and Android. Desktop platforms will be supported in the future, but we cannot nail down a date yet. + +## On which platforms can I develop apps based on Boden? + +On macOS, Linux, and Windows. + +To compile, run, and deploy iOS apps, you will need a Mac. + +## What IDEs are supported? + +Xcode on macOS, Android Studio on Linux and Windows. + +Other workflows are possible, but we don't advertise them actively as they have not yet been thoroughly tested. + +## How does licensing work? + +Boden is an open-source project currently licensed under the GNU General Public License. You can choose which version of the GPL you like better (2 or 3). Copy the respective Boden license file into your derivative project's repo and you're all set. + +In the future, we will most likely offer an LGPL licensing option as an alternative for those who find the GPL too restrictive. + +Finally, there will be a commercial licensing option for everyone who cannot or does not want to comply with the GPL. + +## Where can I get support? + +We recommend joining the [Boden Google Group](https://groups.google.com/forum/#!forum/boden-cross-platform-framework). We read every post in the group and will do our best to respond to questions quickly. + +## I found an issue. What should I do? + +Please open an issue on GitHub and tell us about it. + +## Can I already build a production app with Boden? + +Most likely not yet. But we're ramping up quickly, so this might change within the next weeks and months. We aim for a Boden 1.0 release by Q1/2020 and it will most likely be possible to create a producion app earlier. + +## Are desktop platforms supported? + +Not yet. But eventually they will be supported. See below. + +## Do you plan to support desktop platforms in the future? + +Yes. Most likely we will support macOS and Windows UWP in the future, but we don't yet know exactly when desktop support will land in Boden. + +Hint: There's unofficial macOS support already, but we don't talk about that as it's not going to be stable soon and is intended for internal testing purposes only at the moment. + +## Is Boden a Commercial Project? + +Yes. While Boden is free and open source, it is commercially developed by a full-time team. Our goal is to make sophisticated app development hassle-free for you and we believe there is no better way of ensuring the necessary resources are fully committed to the framework. + diff --git a/docs/docs/getting-started/first_app.md b/docs/docs/getting-started/first_app.md index 6d2358aa..96f5f9c9 100644 --- a/docs/docs/getting-started/first_app.md +++ b/docs/docs/getting-started/first_app.md @@ -1,6 +1,6 @@ -# Your first application +# Your First Boden Application -To create your first Boden project, open up a terminal (or command prompt), change to your local `boden` directory, and execute the following commands: +To create your first Boden app, open up a terminal (or command prompt), change to your local `boden` directory, and execute the following commands: python boden.py new -n AwesomeApp cd AwesomeApp @@ -12,7 +12,8 @@ In Xcode, select the `AwesomeApp` target and then press Cmd+RCmd+R to build and run the example application, then select the `AwesomeApp` target and then press Ctrl+R on Mac or Shift+F10 on Linux/Windows to build an run the Hello World application. -> Note: On macOS and Linux you can also simply type `./boden` instead of calling `python boden.py` explicitly. If you want to build the Android version of the app on macOS, run `../boden open -p android`. +!!! note + On macOS and Linux you can also simply type `./boden` instead of calling `python boden.py` explicitly. If you want to build the Android version of the app on macOS, run `../boden open -p android`. ## Hello World diff --git a/docs/docs/getting-started/index.md b/docs/docs/getting-started/index.md index 29aae564..1bd60cd7 100644 --- a/docs/docs/getting-started/index.md +++ b/docs/docs/getting-started/index.md @@ -1,11 +1,36 @@ -You can use macOS to build both iOS and Android apps. Windows and Linux can be used to build Android apps only. This guide will help you set up your system for developing Boden apps. +# Quickstart -Which platform do you want to set up for development? +## Prerequisites -* [macOS](./setup/mac.md) -* [Windows](./setup/win.md) -* [Linux](./setup/linux.md) +On a Mac: macOS 10.14+, [Xcode 10.1+](https://developer.apple.com/xcode/), [Python 3.4+](https://www.python.org/downloads/), [CMake 3.10.2+](https://cmake.org/download/). +On Windows: Windows 10, [Python 3.4+](https://www.python.org/downloads/), [CMake 3.10.2+](https://cmake.org/download/), [Git](https://git-scm.com/download/win), [Oracle JDK 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), and [Android Studio](https://developer.android.com/studio) (with Android NDK). +On Ubuntu 18.04: `sudo apt update && sudo apt install git cmake python3-distutils openjdk-8-jdk qemu-kvm` plus [Android Studio](https://developer.android.com/studio/). +## Step 1: Clone the Boden Repo + git clone --recurse-submodules https://github.com/AshampooSystems/boden.git + +## Step 2: Generate and Open an IDE Project + + cd boden + python boden.py open + +This will bring up Xcode on macOS or Android Studio on Linux/Windows. + +If anything goes wrong, please make sure that all dependencies are installed and set up correctly. Check out our extended guides for help: + +* [Building on macOS](setup/mac) +* [Building on Windows](setup/win) +* [Building on Linux](setup/linux) + +## Step 3: Run a Boden Example Application + +In Xcode, select the `uidemo` target and hit Cmd+R. + +In Android Studio, select the `uidemo` target and hit Shift+F10. + +## Step 4: Create Your First Boden Application + +Still with us? Great! Now [learn how to create your first Boden application](first_app.md). \ No newline at end of file diff --git a/docs/docs/guides/index.md b/docs/docs/guides/index.md index 94692d74..36f7a4b1 100644 --- a/docs/docs/guides/index.md +++ b/docs/docs/guides/index.md @@ -1,3 +1 @@ -# Overview - - +# Guides Overview \ No newline at end of file diff --git a/docs/docs/guides/ui/writing_view.md b/docs/docs/guides/ui/writing_view.md index ab83208f..a9853796 100644 --- a/docs/docs/guides/ui/writing_view.md +++ b/docs/docs/guides/ui/writing_view.md @@ -471,9 +471,9 @@ namespace bdn::ios { ## Sending notifications to the View To allow the user to react the Button clicks we need a way to call functions of the View from the Core. -For this we can use a combination of a [Notifier](../../reference/foundation/notifier.md) and a [WeakCallback](../../reference/foundation/weak_callback.md). +For this we can use a combination of a [Notifier](../../reference/foundation/notifier.md) and a `WeakCallback`. -First we add the [WeakCallback](../../reference/foundation/weak_callback.md) to our Core: +First we add the `WeakCallback` to our Core: ```C++ class ExampleButtonView : public View @@ -634,7 +634,7 @@ class ExampleButtonView } ``` -And at last we connect it to the [WeakCallback](../../reference/foundation/weak_callback.md): +And at last we connect it to the `WeakCallback`: ```c++ void ExampleButtonView::bindViewCore() diff --git a/docs/docs/index.md b/docs/docs/index.md index 127dbf38..ac69b3d1 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -2,7 +2,7 @@ template: hero.html # Build real native mobile apps using modern C++17 and Boden -With Boden you can write your mobile apps in modern C++17 and compile 100% native Android and iOS apps from the same statically typed codebase. No need for scripting, no overhead introduced by additional VMs. +Write your mobile apps in modern C++17 and compile 100% native Android and iOS apps from the same statically typed codebase. No need for scripting. No overhead introduced by virtual machines. Using Boden is straight forward: ```C++ // MainViewController.cpp diff --git a/docs/docs/reference/foundation/application.md b/docs/docs/reference/foundation/application.md index 57a807fb..8ab9fc69 100644 --- a/docs/docs/reference/foundation/application.md +++ b/docs/docs/reference/foundation/application.md @@ -3,7 +3,9 @@ source: Application.h # Application -Represents the Application. Inherit from [ApplicationController](application_controller.md) to set up your application. +Represents the Application. + +To define the setup and behavior of your own app, inherit from [ApplicationController](application_controller.md). The application's entry point is defined by the `BDN_APP_INIT` macro. See [ApplicationController](application_controller.md) for an example. @@ -14,32 +16,41 @@ class Application : public std::enable_shared_from_this ``` -## Macros +## Obtaining the Global Application Instance + +* **static std::shared_ptr globalApplication()** + + Returns the global `Application` instance for the current process. -* **BDN_APP_INIT(ClassName)** +## Registering an Application Controller - Use this macro to register your main application controller +* **BDN_APP_INIT(ApplicationControllerClassName)** + + Use this macro to register your main application controller. ## Properties * **Property\> commandLineArguments** - A list of the command-line arguments + A list of command-line arguments as specified when the application was launched. * **std::shared_ptr<[DispatchQueue](dispatch_queue.md)> dispatchQueue()** - The main thread [DispatchQueue](dispatch_queue.md) + The main thread's [`DispatchQueue`](dispatch_queue.md). * **std::shared_ptr applicationController()** - The user-supplied application controller + The user-defined application controller associated with the application. ## Commandline arguments * **int argc()** + + Returns the number of command-line arguments. + * **char \*\*argv()** - Returns the raw commandline arguments + Returns the raw command-line arguments. ## Main thread @@ -59,12 +70,12 @@ class Application * **virtual void openURL(const String &url)** - Calls the operating system to open the supplied URL. + Opens the given URL in a suitable external application. Web URLs will be opened in the system's standard web browser. Application-specific URLs will open in the respective application. ## Shutdown * **void initiateExitIfPossible(int exitCode)** - Tries to shutdown the application with the supplied exit code. + Tries to shutdown the application with the given exit code. - This function does nothing on mobile operating systems that do not allow the app to exit on its own. \ No newline at end of file + Does nothing on Android. \ No newline at end of file diff --git a/docs/docs/reference/foundation/dispatch_queue.md b/docs/docs/reference/foundation/dispatch_queue.md index b03ec8db..0e79f63a 100644 --- a/docs/docs/reference/foundation/dispatch_queue.md +++ b/docs/docs/reference/foundation/dispatch_queue.md @@ -3,7 +3,7 @@ source: DispatchQueue.h # DispatchQueue -A DispatchQueue can execute arbitrary functions on a thread. +Queues and executes arbitrary functions on a thread. ## Declaration @@ -17,42 +17,42 @@ class DispatchQueue * **using Clock = std::chrono::steady_clock** * **using TimePoint = Clock::time_point** -## Constructor +## Creating a DispatchQueue Object * **DispatchQueue(bool slave = false)** - If slave is `false`, create an internal thread for the DispatchQueue. + Constructs a dispatch queue. If `slave` is `false` (the default), creates and manages a thread for the dispatch queue. If `slave` is `true`, the queue will not create a thread on its own. This is handy if there is already a thread/run loop which should be integrated with the dispatch queue. -## Enqueue +## Dispatching Methods to the Queue * **void dispatchSync([Function](#types) function)** - Dispatches a `function`on the DispatchQueue thread and waits for it to finish. + Dispatches a `function`on the dispatch queue thread and waits for it to finish. * **void dispatchAsync([Function](#types) function)** - Dispatches a `function` on the DispatchQueue thread. + Dispatches a `function` on the dispatch queue thread and returns immediately. * **template <\> void dispatchAsyncDelayed(std::chrono::duration<\> delay, [Function](#types) function)** - Dispatches a `function` to run on the DispatchQueue thread after the `delay`. + Dispatches a `function` to run on the dispatch queue thread after the `delay`. -## Timer +## Creating Timers * **template<\> createTimer(std::chrono::duration<\> interval, std::function timer)** - Creates a timer that will run `timer` repeatedly on the DispatchQueue's thread every `interval` until `timer` returns false. + Creates a timer that will run `timer` repeatedly on the dispatch queue's thread every `interval` until `timer` returns `false`. -## Processing +## Controlling the Queue's Internal Processing * **void enter()** - Only allowed if `slave` was true during construction. Starts the processing until `cancel` is called + Starts processing synchronously until `cancel` is called. Only allowed if `slave` was true during construction. * **void cancel()** - Stops processing + Stops processing as soon as possible. * **void executeSync()** - Execute a single item. \ No newline at end of file + Executes the next function scheduled on the queue and returns. \ No newline at end of file diff --git a/docs/docs/reference/foundation/notifier.md b/docs/docs/reference/foundation/notifier.md index 11c52730..4fe2c7d9 100644 --- a/docs/docs/reference/foundation/notifier.md +++ b/docs/docs/reference/foundation/notifier.md @@ -3,7 +3,7 @@ source: Notifier.h # Notifier -Represents a signal used to notify observers of events and value changes. +Notifies subscribing callback methods about an event synchronously. ## Declaration @@ -16,37 +16,37 @@ class Notifier * **using Subscription = size_t** - An ID referencing a specific subscription + An ID referencing a specific subscription. * **using Target = std::function** - The type of a callback + The type of a callback. -## Subscribe +## Subscribing to a Notifier * **Subscription subscribe(Target target)** - Adds a new subscription + Subscribes the function specified by `target` to the notifier and returns a `Subscription` value. The returned `Subscription` may be persisted by the caller to later unsubscribe from the subscription again. * **Notifier operator+=(Target target)** - Convenience function to add a new subscription + Convenience for adding a new subscription by using `operator +=`. If you need to unsubscribe the subscriber later on, use `subscribe` instead. -## Unsubscribe +## Unsubscribing from a Notifier * **void unsubscribe(Subscription subscription)** - Unsubscribe a specific subscription + Unsubscribe the given subscription. * **void unsubscribeAll()** - Removes all subscriptions + Unsubscribe all subscriptions. !!! note - It is safe and valid to unsubscribe during a notify() call + It is safe to unsubscribe during a notify() call -## Notify +## Notifying Subscribers * **void notify(*Arguments*... arguments)** - Notifies all registered subscriptions \ No newline at end of file + Notifies all subscribers. Passes the given arguments to each subscriber. \ No newline at end of file diff --git a/docs/docs/reference/foundation/property.md b/docs/docs/reference/foundation/property.md index 00637c59..5f786ffc 100644 --- a/docs/docs/reference/foundation/property.md +++ b/docs/docs/reference/foundation/property.md @@ -5,8 +5,7 @@ source: Property.h Represents a property of a class. -Properties provide a simple means for accessing, manipulating and observing arbitrary value types such as int or String via the ValType -template parameter. You may observe value changes using the onChange() method or bind two or more properties using the bind() method. +Properties provide a simple way to access and observe arbitrary value types such as `int` or `String`. You may observe value changes using the `onChange()` method or bind two or more properties using the `bind()` method. See also: [Property Guide](../../guides/foundation/properties.md) @@ -17,38 +16,34 @@ template class Property : virtual public IValueAccessor ``` -## Constructor +## Creating a Property Object * **Property()** - Default constructor, value is uninitialized + Constructs a property with a default-constructed value. * **Property(const Property &) = delete** - The copy constructor is deleted, Property cannot be copied. + `Property` instances cannot be copy-constructed. However, they can be default-constructed and then assigned using `operator =`. See the [Property Guide](../../guides/foundation/properties.md#copying) for details. * **Property(ValType value)** - Initializes the value with the given value + Initializes the property's value with the given value. * **Property(const GetterSetter &getterSetter)** - Constructs a Property instance from a GetterSetter object + Constructs a `Property` instance from a `GetterSetter` object. This can be used to define custom getter and setter methods. See the [Property Guide](../../guides/foundation/properties.md#getters-and-setters) for details. -* **Property(const Setter &setter)** +* **Property([Streaming](streaming.md) &stream)** - Constructs a Property instance with the given Setter object + Constructs a `Property` instance with the given [`Streaming`](streaming.md) object. -* **Property(Streaming &stream)** +* **template Property(const [Transform](transform.md) &transform)** - Constructs a Property instance with the given Streaming object + Constructs a `Property` instance with the given [`Transform`](transform.md) object. -* **template Property(const Transform &transform)** - Constructs a Property instance with the given Transform object - - -## Value +## Getting and Modifying the Value * **ValType get() const** @@ -60,13 +55,13 @@ class Property : virtual public IValueAccessor * **ValType operator\*() const** - Returns the property's value – intended for use with the `auto` keyword + Returns the property's value. Intended for use with the `auto` keyword. * **operator ValType() const** - Returns the property's value when casting explicitly or implicitly + Returns the property's value when casting explicitly or implicitly. -## Non-primitive value types +## Accessing Non-primitive Value Types * **template<...> const ValType operator-\>() const** * **template<...> const typename backing_t::Proxy operator-\>() const** @@ -81,22 +76,23 @@ class Property : virtual public IValueAccessor const typename backing_t::Proxy operator->() const; ``` - Provides access to members of non-primitive pointer types + Provides access to members of non-primitive pointer types. -## Binding +## Binding Properties * **void bind(Property &sourceProperty, BindMode bindMode = BindMode::bidirectional)** - Binds to the given property. Internally it adds a subscription on the `sourceProperty's onChange - notification in which it calls set() on itself. + Binds the property to the given source property. + + `bindMode` can be one of `BindMode::unidirectional` (one-way) or `BindMode::bidirectional` (two-way). If `bindMode` is set to `BindMode::unidirectional`, the property's value will be updated when the source property's value is changed. However, the source property's value will not be updated when the property's value is changed. If `bindMode` is set to `BindMode::bidirectional`, either property will be updated when the other's value is changed. This is the default behavior of `bind()`. - When `bindMode` is `BindMode::bidirectional` it also add the inverse notification to the `sourceProperty` + Property bindings work synchronously. That is, the bound property will be updated immediately on the thread the value change has been invoked on. -## Notification +## Being Notified of Changes * **auto &onChange() const** - Returns a [Notifier](notifier.md) thats called when the property value changes. + Returns a [Notifier](notifier.md) which is called when the property value changes. ## Operators diff --git a/docs/docs/reference/foundation/weak_callback.md b/docs/docs/reference/foundation/weak_callback.md deleted file mode 100644 index 63d1a1ed..00000000 --- a/docs/docs/reference/foundation/weak_callback.md +++ /dev/null @@ -1 +0,0 @@ -# WeakCallback \ No newline at end of file diff --git a/docs/docs/reference/index.md b/docs/docs/reference/index.md index c17300c1..1a8d2152 100644 --- a/docs/docs/reference/index.md +++ b/docs/docs/reference/index.md @@ -1,6 +1,11 @@ # API Reference Overview -This part of the Boden Framework documentation provides a reference for all Boden classes and types. The Boden API is organized into four principal modules: +This part of the Boden Framework documentation provides a reference to make looking up specific Boden classes and types easy. If you are interested in learning how to write apps in Boden, consider the [Getting Started](../getting-started) and [Guides](../guides) sections instead. + +!!! warning + The Boden API is work in progress and may change in the coming months. We are currently aiming at providing the first stable API by Q3/2019. [Follow us on Twitter](https://twitter.com/bodenhq) and [star/watch our repo on GitHub](https://github.com/AshampooSystems/boden) to stay in the loop! + +The Boden API is organized into four principal modules: ### Foundation diff --git a/docs/docs/reference/ui/button.md b/docs/docs/reference/ui/button.md index a38eb8ff..0e3aca81 100644 --- a/docs/docs/reference/ui/button.md +++ b/docs/docs/reference/ui/button.md @@ -25,15 +25,15 @@ button->onClick() += [](auto event) { ## Properties -* **Property label** +* **[Property](../foundation/property.md)<[String](../foundation/string.md)\> label** - The button's label + The button's label. ## Events -* **ISyncNotifier &onClick()** +* **[Notifier](../foundation/notifier.md) &onClick()** - A notifier for click events. Subscribe to this notifier if you want to be notified when the user clicks the Button. + A notifier for click events. Subscribe to this notifier if you want to be notified when the user clicks the button. ## Relationships diff --git a/docs/docs/reference/ui/checkbox.md b/docs/docs/reference/ui/checkbox.md index 802262f1..1ed986fc 100644 --- a/docs/docs/reference/ui/checkbox.md +++ b/docs/docs/reference/ui/checkbox.md @@ -28,19 +28,19 @@ checkbox->onClick() += [](auto event) { ## Properties -* **Property label** +* **[Property](../foundation/property.md)<[String](../foundation/string.md)\> label** The checkbox's label. -* **Property state** +* **[Property](../foundation/property.md)<[TriState](tri_state.md)\> state** A [TriState](tri_state.md) representing the checkbox's state. Note that Android does not support mixed state checkboxes. Checkboxes in mixed state will be displayed as off on Android. ## Events -* **ISyncNotifier &onClick()** +* **[Notifier](../foundation/notifier.md) &onClick()** - A notifier for click events. Subscribe to this notifier if you want to be notified when the user clicks the Button. + A notifier for click events. Subscribe to this notifier if you want to be notified when the user clicks the checkbox. ## Relationships diff --git a/docs/docs/reference/ui/click_event.md b/docs/docs/reference/ui/click_event.md index b0f3f204..70a79426 100644 --- a/docs/docs/reference/ui/click_event.md +++ b/docs/docs/reference/ui/click_event.md @@ -3,7 +3,7 @@ source: ClickEvent.h # ClickEvent -A click event as generated by e.g. a [Button](button.md) +A click event as generated by e.g. a [`Button`](button.md). ## Declaration diff --git a/docs/docs/reference/ui/container_view.md b/docs/docs/reference/ui/container_view.md index 8c1c6298..2303e999 100644 --- a/docs/docs/reference/ui/container_view.md +++ b/docs/docs/reference/ui/container_view.md @@ -3,7 +3,7 @@ source: ContainerView.h # ContainerView -A content-less view that can hold child views. +A view that can hold child views. ## Declaration @@ -27,25 +27,25 @@ container->addChildView(label); container->addChildView(button); ``` -## Actions +## Managing Child Views -* **void void addChildView(const std::shared_ptr &childView)** +* **void void addChildView(const std::shared_ptr<[View](view.md)\> &childView)** - Add a new child view + Adds a new child view to the container view. -* **void void removeChildView(const std::shared_ptr &childView)** +* **void void removeChildView(const std::shared_ptr<[View](view.md)\> &childView)** - Remove a specific child view + Remove a the given child view from the container view. * **void removeAllChildViews()** - Removes all child views + Removes all child views from the container view. ## Accessing children -* **void std::list> childViews() override** +* **void std::list\> childViews() override** - Returns all child views + Returns an `std::list` containg all child views of the container view. ## Relationships diff --git a/docs/docs/reference/ui/image_view.md b/docs/docs/reference/ui/image_view.md index 2d9142c6..80d290bc 100644 --- a/docs/docs/reference/ui/image_view.md +++ b/docs/docs/reference/ui/image_view.md @@ -22,9 +22,9 @@ imageView->url = 'https://via.placeholder.com/350x150'; ## Properties -* **Property url** +* **Property<[String](../foundation/string.md)\> url** - The URl of the image to be displayed. + The URL of the image to be displayed. ## Relationships diff --git a/docs/docs/reference/ui/ios/view_core.md b/docs/docs/reference/ui/ios/view_core.md index d68cc471..c62d0469 100644 --- a/docs/docs/reference/ui/ios/view_core.md +++ b/docs/docs/reference/ui/ios/view_core.md @@ -2,6 +2,8 @@ Base class for iOS view cores. +This effectively wraps `UIView` and serves as a foundation for all other iOS view cores. + ## Declaration ```c++ @@ -20,7 +22,7 @@ namespace bdn::ios { * **bool canMoveToParentView(std::shared_ptr newParentView) const override** - Always returns true. + Always returns true on iOS as `UIView`s can move to any parent view. * **virtual void addChildViewCore(const std::shared_ptr &core)** * **virtual void removeFromUISuperview()** @@ -29,45 +31,47 @@ namespace bdn::ios { * **virtual void frameChanged()** - Updates the geometry Property based on the UIView's frame + Updates the geometry Property based on the UIView's frame. * **virtual void onGeometryChanged(Rect newGeometry)** - Updates the UIView's frame to newGeometry + Updates the UIView's frame to the `Rect` given in `newGeometry`. ## Layout * **Size sizeForSpace(Size availableSpace = Size::none()) const override** - Uses UIView::systemLayoutSizeFittingSize to calculate the preferred Size of the View + Uses UIView::systemLayoutSizeFittingSize to calculate the preferred Size of the [`View`](../view.md). * **void scheduleLayout() override** - Triggers ```[_uiView setNeedsLayout]``` + Triggers the `setNeedsLayout` method of the managed `UIView`. * **virtual bool canAdjustToAvailableWidth() const** - Override to influence how sizeForSpace behaves + Override to influence how `sizeForSpace` behaves. * **virtual bool canAdjustToAvailableHeight() const** - Override to influence how sizeForSpace behaves + Override to influence how `sizeForSpace` behaves. ## Helper * **template std::shared_ptr shared_from_this()** - Returns shared_from_this but std::dynamic_pointer_cast's + Returns `shared_from_this` casted to `std::shared_ptr` using `std::dynamic_pointer_cast`. * **UIView \*uiView() const** - Returns the UIView that was passed into the constructor + Returns the `UIView` that was passed to the constructor. + +## Reporting Size Changes to the Core -## Reporting external size changes to the Core +The Boden Framework supports native layout updates from the target platform. This is especially useful in cases where native widget layouts should be reused to eliminate the need for custom non-native layout implementations, e.g. in list views (`UITableView` on iOS). -When an IOS View changes size, it needs to report the change back to the ViewCore to update its geometry Property. +When an iOS view changes its size, the framework therefore needs to be informed so it can update the view's `geometry` property. -The Base bdn::ios::ViewCore therefor expects an `UIViewWithFrameNotification`: +To accommodate for native layout updates, `ios::ViewCore` and all subclasses wrapping native `UIView`s must implement the `UIViewWithFrameNotification` protocol: ```obj-c @protocol UIViewWithFrameNotification @@ -75,7 +79,7 @@ The Base bdn::ios::ViewCore therefor expects an `UIViewWithFrameNotification`: @end ``` -ios::ViewCore Constructor will call setViewCore. The actual UIView class then needs to call back to the core when its frame changes. This is the implementation used by bdn::ios::ButtonCore: +The `ios::ViewCore` constructor will call `setViewCore` on its native `UIView` instance. The `UIView` subclass then needs to call back the core's `frameChanged` method when its frame changes. For instance, this is the implementation used by `ios::ButtonCore`: ```obj-c @interface BodenUIButton : UIButton diff --git a/docs/docs/reference/ui/label.md b/docs/docs/reference/ui/label.md index ef73314b..2ba9991a 100644 --- a/docs/docs/reference/ui/label.md +++ b/docs/docs/reference/ui/label.md @@ -3,7 +3,7 @@ source: Label.h # Label -Displays read-only text +A read-only text label. ## Declaration @@ -22,13 +22,13 @@ label->text = "Hello World"; ## Properties -* **Property text** +* **[Property](../foundation/property.md)<[String](../foundation/string.md)\> text** - The views text + The label's text. -* **Property wrap** +* **[Property](../foundation/property.md) wrap** - If true, the text will wrap if it does not fit in its width. + If true, the text will wrap if it exceeds the available width. ## Relationships diff --git a/docs/docs/reference/ui/list_view.md b/docs/docs/reference/ui/list_view.md index d9e96b5d..c12fc1cc 100644 --- a/docs/docs/reference/ui/list_view.md +++ b/docs/docs/reference/ui/list_view.md @@ -3,7 +3,9 @@ source: ListView.h # ListView -Displays Items from its model in a list. See [ListViewDataSource](list_view_data_source.md). +A view displaying items in a scrollable single-column list. + +See also: [ListViewDataSource](list_view_data_source.md). ## Declaration @@ -23,39 +25,34 @@ listView->reloadData(); ## Properties -* **Property\> dataSource** +* **[Property](../foundation/property.md)\> dataSource** - The datasource of the list + The data source of the list. -* **Property\> selectedRowIndex** +* **[Property](../foundation/property.md)\> selectedRowIndex** - The currently selected row index + The currently selected row index. -## Data +## Reloading the List's Data * **void reloadData()** - Forces the list to refresh from its datasource - -## Swipe refresh - - + Reloads the list's data from its data source. +## Enabling Swipe Refresh -* **Property enableRefresh** +* **[Property](../foundation/property.md) enableRefresh** Enables refresh on swipe down. * **void refreshDone()** - Finishes/hides the refresh animation if it was triggered by the user + Finishes/hides the refresh animation if it was triggered by the user. ## Events -* **SimpleNotifier<\> &onRefresh()** +* **[Notifier](../foundation/notifier.md)<\> &onRefresh()** Signals that the list has updated its data. diff --git a/docs/docs/reference/ui/list_view_data_source.md b/docs/docs/reference/ui/list_view_data_source.md index cfef87ac..ca0a716d 100644 --- a/docs/docs/reference/ui/list_view_data_source.md +++ b/docs/docs/reference/ui/list_view_data_source.md @@ -3,7 +3,7 @@ source: ListViewDataSource.h # ListViewDataSource -An abstract base class for a [ListView's](list_view.md) data source +An abstract base class for a [`ListView`](list_view.md)'s data source ## Declaration @@ -25,8 +25,6 @@ public: size_t numberOfRows() override { return 2; } - String labelTextForRowIndex(size_t rowIndex) override { return _data[rowIndex]; } - auto viewForRowIndex( size_t rowIndex, std::shared_ptr reusableView) override { @@ -34,7 +32,7 @@ public: if(!label) { label = std::make_shared(); } - label->text = labelTextForRowIndex(rowIndex); + label->text = _data[rowIndex];; return std::dynamic_pointer_cast(label); } @@ -46,25 +44,19 @@ listView->dataSource = std::make_shared(); listView->reloadData(); ``` -## Functions +## Implementing a Data Source * **virtual size_t numberOfRows() = 0** - Return the number of rows - -* **virtual String labelTextForRowIndex(size_t rowIndex) = 0** - - DOCFIXME: Currently unused! Remove or reimplement. - - Return the text for a row + Return the number of available rows in your data source implementation. -* **virtual std::shared_ptr viewForRowIndex(size_t rowIndex, std::shared_ptr reusableView) = 0** +* **virtual std::shared_ptr<[View](view.md)\> viewForRowIndex(size_t rowIndex, std::shared_ptr<[View](view.md)\> reusableView) = 0** - Return the view for a row + Return the item view for the given row index in your data source implementation. * **virtual float heightForRowIndex(size_t rowIndex) = 0** - Return the height of a row + Return the height of the row at the given row index in your data source implementation. \ No newline at end of file diff --git a/docs/docs/reference/ui/navigation_view.md b/docs/docs/reference/ui/navigation_view.md index 0a72d3ad..797493c4 100644 --- a/docs/docs/reference/ui/navigation_view.md +++ b/docs/docs/reference/ui/navigation_view.md @@ -3,7 +3,7 @@ source: NavigationView.h # NavigationView -A NavigationView manages a number of views where only one view is visible at a time. +Provides the user with a way to navigate between a number of different views where only one view is visible at a time. ## Declaration @@ -34,13 +34,13 @@ navigationView->pushView(firstButton, "First Page"); ## View manipulation -* **void pushView(std::shared_ptr view, String title)** +* **void pushView(std::shared_ptr<[View](view.md)\> view, [String](../foundation/string.md) title)** - Pushes the *view* with a *title* to the top of the stack. + Pushes the given view with the specified title to the top of the stack. * **void popView()** - Pops the top most View from the stack + Pops the topmost view from the stack. ## Relationships diff --git a/docs/docs/reference/ui/scroll_view.md b/docs/docs/reference/ui/scroll_view.md index 4b08c67b..bfbc7d1a 100644 --- a/docs/docs/reference/ui/scroll_view.md +++ b/docs/docs/reference/ui/scroll_view.md @@ -3,7 +3,7 @@ source: ScrollView.h # ScrollView -A Container that can scroll its content view +A container view that can scroll its content view. ## Declaration @@ -26,28 +26,28 @@ scrollView->content = image; ## Properties -* **Property\> content** +* **[Property](../foundation/property.md)\> contentView** - The view to be scrolled + The content view to be scrolled. -* **Property verticalScrollingEnabled** +* **[Property](../foundation/property.md) verticalScrollingEnabled** - If true, vertical scrolling is enabled + Whether vertical scrolling is enabled. -* **Property horizontalScrollingEnabled** +* **[Property](../foundation/property.md) horizontalScrollingEnabled** - If true, horizontal scrolling is enabled + Whether horizontal scrolling is enabled. -* **Property visibleClientRect** +* **[Property](../foundation/property.md) visibleClientRect** - The currently visible part of the content view + The currently visible part of the content view. ## Actions * **void scrollClientRectToVisible(const Rect &area)** - Scroll the view so that the *area* of the content view is visible + Scrolls the view so that the area of the content view is visible. ## Relationships diff --git a/docs/docs/reference/ui/submit_event.md b/docs/docs/reference/ui/submit_event.md new file mode 100644 index 00000000..61b08ee2 --- /dev/null +++ b/docs/docs/reference/ui/submit_event.md @@ -0,0 +1,17 @@ +path: tree/master/framework/ui/include/bdn/ +source: SubmitEvent.h + +# SubmitEvent + +A submit event as generated by a [`TextField`](text_field.md). + +## Declaration + +```C++ +class SubmitEvent : public ViewEvent +``` + +## Relationships + +Inherits from: [ViewEvent](view_event.md) + \ No newline at end of file diff --git a/docs/docs/reference/ui/text_field.md b/docs/docs/reference/ui/text_field.md index d0a3a8b9..9d3494f5 100644 --- a/docs/docs/reference/ui/text_field.md +++ b/docs/docs/reference/ui/text_field.md @@ -26,7 +26,7 @@ textField->onSubmit() += [](auto event) { ## Properties -* **Property text** +* **[Property](../foundation/property.md)<[String](../foundation/string.md)\> text** The text displayed in the text field. @@ -34,13 +34,15 @@ textField->onSubmit() += [](auto event) { * **void submit()** - Informs observers of the onSubmit() notifier about a submit event. + Informs observers of the `onSubmit()` notifier about a submit event. ## Events -* **ISyncNotifier &onSubmit()** +* **[Notifier](../foundation/notifier.md) &onSubmit()** - A notifier for submit events. Subscribe to this notifier if you want to be notified about submit events posted to the text field. Submit events are posted when the user presses the Enter key or when submit() is called programmatically. + Notifies subscribers when the Enter key is pressed by the user. + + Subscribe to this notifier if you want to be notified about submit events posted to the text field. Submit events are posted when the user presses the Enter key or when `submit()` is called programmatically. ## Relationships diff --git a/docs/docs/reference/ui/view_core.md b/docs/docs/reference/ui/view_core.md index 8a1782a9..47189854 100644 --- a/docs/docs/reference/ui/view_core.md +++ b/docs/docs/reference/ui/view_core.md @@ -1,6 +1,6 @@ # View::Core -Interface representing a platform specific "view core". Classes inheriting from `ViewCore` implement the actual user interface view logic to display user interfaces on screen. +Interface representing a platform specific "view core". Classes inheriting from `ViewCore` implement the actual user interface logic to display user interfaces on screen. ## Declaration @@ -12,23 +12,23 @@ class View { ## Properties -* **Property geometry** +* **[Property](../foundation/property.md) geometry** -* **Property visible** +* **[Property](../foundation/property.md) visible** ## Functions * **virtual void init() = 0** - Subclasses must override this method to implement initialization of platform-specific objects. + Deriving classes must override this method to implement initialization of platform-specific objects. -* **virtual Size sizeForSpace(Size availableSize = Size::none()) const** +* **virtual [Size](../foundation/size.md) sizeForSpace([Size](../foundation/size.md) availableSize = [Size](../foundation/size.md)::none()) const** - Returns the fitting size for the view in device independent pixels? (DOCFIXME) given the available size. Setting `availableSize` to `Size::none()` indicates that infinite space is available to size the view. + Returns the fitting size for the view given the available size. Setting `availableSize` to `Size::none()` indicates that infinite space is available to the view. -* **virtual bool canMoveToParentView(std::shared_ptr newParentView) const = 0** +* **virtual bool canMoveToParentView(std::shared_ptr<[View](view.md)\> newParentView) const = 0** - Returns whether the view core can move to another parent view. The default implementation returns `true`. + Returns whether the view core can move to another parent view. * **virtual void dispose() = 0** @@ -40,5 +40,5 @@ class View { * **void markDirty()** -* **virtual void setLayout(std::shared_ptr layout)** +* **virtual void setLayout(std::shared_ptr<[Layout](../layout/layout.md)\> layout)** diff --git a/docs/docs/reference/ui/view_core_factory.md b/docs/docs/reference/ui/view_core_factory.md index 943e81d1..36fd4396 100644 --- a/docs/docs/reference/ui/view_core_factory.md +++ b/docs/docs/reference/ui/view_core_factory.md @@ -14,15 +14,15 @@ class ViewCoreFactory : public bdn::Factory, std::sh ## Create -* **std::shared_ptr createViewCore(const std::type_info &viewType);** +* **std::shared_ptr<[`View::Core`](view_core.md)\> createViewCore(const std::type_info &viewType);** - Creates a new [`ViewCore`](view_core.md) object for the given view type. + Creates a new [`View::Core`](view_core.md) object for the given view type. ## Register * **template void registerCoreType();** - Register a new core type and associates it with the given view type. + Registers a new core type and associates it with the given view type. ## Context diff --git a/docs/docs/reference/ui/view_event.md b/docs/docs/reference/ui/view_event.md index 56e4cda2..fdc4fc33 100644 --- a/docs/docs/reference/ui/view_event.md +++ b/docs/docs/reference/ui/view_event.md @@ -3,7 +3,7 @@ source: ViewEvent.h # ViewEvent -Base class for UI Events +Base class for view events. ## Declaration diff --git a/docs/docs/reference/ui/window.md b/docs/docs/reference/ui/window.md index 1346b48a..02b2680b 100644 --- a/docs/docs/reference/ui/window.md +++ b/docs/docs/reference/ui/window.md @@ -22,25 +22,25 @@ window->title = "My Awesome App"; ## Properties -* **const Property contentGeometry** +* **const [Property](../foundation/property.md) contentGeometry** *(Read-only)* The "safe" area that the content view will occupy. -* **Property title** +* **[Property](../foundation/property.md)<[String](../foundation/string.md)\> title** The title of the Window. On Android this will be reflected in the Activities Toolbar. -* **Property\> contentView** +* **[Property](../foundation/property.md)\> contentView** - The content view of the window + The content view of the window. -* **Property allowedOrientations** +* **[Property](../foundation/property.md) allowedOrientations** The orientations the UI will rotate too. -* **Property currentOrientation** +* **[Property](../foundation/property.md) currentOrientation** The current orientation of the device. diff --git a/docs/docs/stylesheets/boden.css b/docs/docs/stylesheets/boden.css index 83e9a86f..11394480 100644 --- a/docs/docs/stylesheets/boden.css +++ b/docs/docs/stylesheets/boden.css @@ -98,9 +98,9 @@ button.boden-call-to-action.secondary:hover { .md-grid.boden-hero h2 { font-size: 18px; font-family: Nunito Sans; - font-weight: 900; + font-weight: 400; margin: 0; - padding-top: 1.6rem; + padding-top: 0; padding-right: 1rem; padding-left: 1rem; color: white; diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 81afd16c..e6dc508d 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -51,7 +51,9 @@ nav: - getting-started/dependency_installation/win.md - getting-started/dependency_installation/linux.md - getting-started/troubleshooting/index.md + - getting-started/faq.md - Guides: + - guides/index.md - Foundation: - guides/foundation/properties.md - guides/foundation/wrap-java-class.md @@ -64,7 +66,7 @@ nav: - guides/ui/writing_view.md - guides/ui/writing_view_modules.md - API Reference: - - Overview: 'reference/index.md' + - API Reference Overview: 'reference/index.md' - Foundation: - reference/foundation/application.md - reference/foundation/application_controller.md @@ -76,7 +78,6 @@ nav: - reference/foundation/streaming.md - reference/foundation/string.md - reference/foundation/transform.md - - reference/foundation/weak_callback.md - Layout: - reference/layout/flex_stylesheet.md - reference/layout/layout.md @@ -94,6 +95,7 @@ nav: - reference/ui/list_view_data_source.md - reference/ui/navigation_view.md - reference/ui/scroll_view.md + - reference/ui/submit_event.md - reference/ui/text_field.md - reference/ui/tri_state.md - reference/ui/view.md diff --git a/docs/theme/hero.html b/docs/theme/hero.html index eebdb489..c9a8f867 100644 --- a/docs/theme/hero.html +++ b/docs/theme/hero.html @@ -136,7 +136,8 @@
-

Boden X-Platform

+

Boden

+

Open-Source X-Platform Framework

diff --git a/examples/reddit/src/reddit.cpp b/examples/reddit/src/reddit.cpp index 2d9bf8ec..a2d5fe2d 100644 --- a/examples/reddit/src/reddit.cpp +++ b/examples/reddit/src/reddit.cpp @@ -106,8 +106,6 @@ class RedditListViewDataSource : public ListViewDataSource size_t numberOfRows() override { return _store->posts.size(); } - String labelTextForRowIndex(size_t rowIndex) override { return _store->posts.at(rowIndex)->title; } - float heightForRowIndex(size_t rowIndex) override { return 50; } std::shared_ptr viewForRowIndex(size_t rowIndex, std::shared_ptr reusableView) override @@ -121,7 +119,7 @@ class RedditListViewDataSource : public ListViewDataSource delegate->build(); } - String text = labelTextForRowIndex(rowIndex); + String text = _store->posts.at(rowIndex)->title; delegate->text = text; delegate->imageUrl = _store->posts.at(rowIndex)->thumbnailUrl; diff --git a/framework/foundation/include/bdn/Application.h b/framework/foundation/include/bdn/Application.h index 083901d1..c6bb950a 100644 --- a/framework/foundation/include/bdn/Application.h +++ b/framework/foundation/include/bdn/Application.h @@ -49,7 +49,6 @@ namespace bdn public: static std::thread::id mainThreadId() { return _mainThreadId; } static bool isMainThread() { return std::this_thread::get_id() == _mainThreadId; } - static void assertInMainThread() { assert(isMainThread()); } public: virtual void openURL(const String &url) = 0; diff --git a/framework/ui/include/bdn/ListViewDataSource.h b/framework/ui/include/bdn/ListViewDataSource.h index a247aa77..65287ced 100644 --- a/framework/ui/include/bdn/ListViewDataSource.h +++ b/framework/ui/include/bdn/ListViewDataSource.h @@ -11,7 +11,6 @@ namespace bdn virtual ~ListViewDataSource() = default; virtual size_t numberOfRows() = 0; - virtual String labelTextForRowIndex(size_t rowIndex) = 0; virtual std::shared_ptr viewForRowIndex(size_t rowIndex, std::shared_ptr reusableView) = 0; virtual float heightForRowIndex(size_t rowIndex) = 0; }; diff --git a/framework/ui/platforms/android/java/io/boden/android/NativeListAdapter.java b/framework/ui/platforms/android/java/io/boden/android/NativeListAdapter.java index 4f6336bb..9cdc6a47 100644 --- a/framework/ui/platforms/android/java/io/boden/android/NativeListAdapter.java +++ b/framework/ui/platforms/android/java/io/boden/android/NativeListAdapter.java @@ -56,7 +56,6 @@ public View getView(int position, View convertView, ViewGroup container) { } public native int nativeGetCount(View view); - public native String nativeLabelTextForRowIndex(View view, int rowIndex); public native View nativeViewForRowIndex(View view, int rowIndex, View reusableView, ViewGroup container); private View _view; diff --git a/framework/ui/platforms/android/src/wrapper/NativeListAdapter.cpp b/framework/ui/platforms/android/src/wrapper/NativeListAdapter.cpp index 9abdabef..3445722a 100644 --- a/framework/ui/platforms/android/src/wrapper/NativeListAdapter.cpp +++ b/framework/ui/platforms/android/src/wrapper/NativeListAdapter.cpp @@ -32,22 +32,6 @@ extern "C" JNIEXPORT jint JNICALL Java_io_boden_android_NativeListAdapter_native true, env); } -extern "C" JNIEXPORT jstring JNICALL Java_io_boden_android_NativeListAdapter_nativeLabelTextForRowIndex(JNIEnv *env, - jobject rawSelf, - jobject rawView, - jint rowIndex) -{ - return bdn::nonVoidPlatformEntryWrapper( - [&]() -> jstring { - if (auto dataSource = dataSourceFromRawView(rawView)) { - bdn::String labelText = dataSource->labelTextForRowIndex(rowIndex); - return env->NewStringUTF(labelText.c_str()); - } - return env->NewStringUTF(""); - }, - true, env); -} - namespace bdn::android { jobject viewForRowIndex(const std::shared_ptr &dataSource, int rowIndex, diff --git a/framework/ui/src/ScrollView.cpp b/framework/ui/src/ScrollView.cpp index 7af0cbe7..b750b1df 100644 --- a/framework/ui/src/ScrollView.cpp +++ b/framework/ui/src/ScrollView.cpp @@ -29,7 +29,7 @@ namespace bdn void ScrollView::scrollClientRectToVisible(const Rect &area) { - Application::assertInMainThread(); + assert(Application::isMainThread()); auto scrollCore = core(); scrollCore->scrollClientRectToVisible(area); @@ -37,7 +37,7 @@ namespace bdn std::list> ScrollView::childViews() { - Application::assertInMainThread(); + assert(Application::isMainThread()); if (contentView.get() != nullptr) { return {contentView.get()}; @@ -48,7 +48,7 @@ namespace bdn void ScrollView::childViewStolen(const std::shared_ptr &childView) { - Application::assertInMainThread(); + assert(Application::isMainThread()); if (childView == contentView.get()) { contentView = nullptr; diff --git a/framework/ui/src/Window.cpp b/framework/ui/src/Window.cpp index f9b7bcd7..7c388765 100644 --- a/framework/ui/src/Window.cpp +++ b/framework/ui/src/Window.cpp @@ -55,7 +55,7 @@ namespace bdn std::list> Window::childViews() { - Application::assertInMainThread(); + assert(Application::isMainThread()); if (contentView.get()) { return {contentView.get()}; } @@ -66,7 +66,7 @@ namespace bdn void Window::childViewStolen(const std::shared_ptr &childView) { - Application::assertInMainThread(); + assert(Application::isMainThread()); if (childView == contentView.get()) { contentView = nullptr;