Macros#
Writing platform dependent code#
AUI provides a set of AUI_PLATFORM_*
and AUI_COMPILER_*
definitions for platform and compiler checking to use in
both CMake and C++.
Platform checks#
Platform | C++ | CMake | Platform specific dir(s) |
---|---|---|---|
[Windows (operating system)](windows.md) | src/Platform/win32 src/platform/win32 | ||
[Linux (-based desktop OSes)](linux.md) | src/Platform/linux src/platform/linux | ||
[macOS (operating system)](macos.md) | src/Platform/macos src/platform/macos | ||
[Android (operating system)](android.md) | src/Platform/android src/platform/android | ||
[iOS (operating system)](ios.md) (both iPhone and iPad) | src/Platform/ios src/platform/ios | ||
Apple([macOS](macos.md), [iOS](ios.md)) | src/Platform/apple src/platform/apple | ||
Unix([Linux](linux.md), [Android](android.md), [macOS](macos.md), [iOS](ios.md)) | src/Platform/unix src/platform/unix | ||
[Emscripten (WebAssembly)](emscripten.md) | src/Platform/emscripten src/platform/emscripten |
Platform specific sources#
With AUI, the platform dependent code can be placed in src/Platform/<PLATFORM_NAME>
or src/platform/<PLATFORM_NAME>
dirs, where <PLATFORM_NAME>
is one of the supported platforms (see the table above).
Note
Both cases (Platform and platform) were added to honor projects with various directory naming agreements.
Compiler checks#
Compiler | C++ | CMake |
---|---|---|
MSVC | ||
GCC (including MinGW) | ||
CLANG |
Other#
AUI_MODULE_NAME
Target name exposed by aui_module and aui_executable.
AUI_CMAKE_PROJECT_VERSION
${CMAKE_PROJECT_VERSION}
exposed by aui_module and aui_executable.
CMAKE_PROJECT_VERSION
is typically defined by project
CMake command:
API_\<module name\>
dllexport
(on Windows) or visibility
(on other platforms) policy for the symbol.
class API_AUI_VIEWS AView ... { // defined in aui.views module
...
};
Json fields definition.
Json entry of the same C++ and JSON field name.
Asserts that the passed condition evaluates to true.
Asserts that the passed condition evaluates to true. Adds extra message string.
Always triggers assertion fail.
Asserts that the macro invocation has been performed in the UI thread.
Asserts that the macro invocation has not been performed in the UI thread.
Stops program execution in attached debugger as if a breakpoint were set.
ranged-for-loop style wrapped for AForEachUI.
Defers execution of the next block to the end of current block (RAII scope).
Executes following function call or {} block once per program execution
emits the specified signal in context of specified object.
Emits a signal of a foreign object.
Application entry point.
Make a bitfield-style enum class.
Defines all enum values for AEnumerate.
Defines getClassName and other useful methods required for Java class definition.
Defines nonstatic method C++ -> Java.
Defines static method C++ -> Java.
Performs multiple operations on a single object without repeating its name (in place) This function can be used as an operator on object.
Marks the variable as being used.
Forbids object from being optimized out by compiler.
Performs multiple operations on a single object without repeating its name.
Expands and concatenates the arguments. Constructed macros reevaluate.
Returns a comma. Given a variadic number of arguments.
Returns comma if _i != 0
. Requires _i
to be between 0 and 15.
Returns empty. Given a variadic number of arguments.
Expands to _Macro(0, _Data, e1) _Macro(1, _Data, e2) ... _Macro(K -1, _Data, eK) as many of AUI_INTERNAL_NARG0 _Tuple.
Similar to AUI_PP_IF but takes _Then and _Else in parentheses.
Returns 1 if the expansion of arguments has an unprotected comma.Otherwise returns 0.
Returns the first argument.
Returns the only argument.
Evaluates to _Then if _Cond is 1 and _Else if _Cond is 0.
Increments the argument, requires the argument to be between 0 and 15.
Expands to 1 if the first argument starts with something in parentheses, otherwise to 0.
If the arguments after expansion have no tokens, evaluates to 1
. Otherwise evaluates to 0
.
Expands to 1 is there is only one argument and it is enclosed in parentheses.
Evaluates to the number of arguments after expansion.
Evaluates to the number of arguments after expansion. Identifies 'empty' as 0.
Remove the parens, requires AUI_PP_IS_ENCLOSED_PARENS(args) => 1.
Expands to _Macro(0, _Data, ) _Macro(1, _Data, ) ... _Macro(K - 1, _Data, )
Expands and stringifies the only argument.
Returns the tail. A variadic list of all arguments minus the first
Calls CAT(_Macro, NARG(VA_ARGS))(VA_ARGS)
Passes some variable and type of the variable separated by comma. It's convenient to use with the connect function (see examples).
Executes following {} block asynchronously in the global thread pool. Unlike
AUI_THREADPOOL_X, does now allow to set lambda's capture. Lambda's capture is [=]
.
Executes following {} block asynchronously in the global thread pool. Unlike AUI_THREADPOOL, allows to set lambda's capture but you should always specify lambda's capture.
Executes lambda on main thread.
Executes lambda on main thread. Allows to determine lambda's capture.
Allows to define a style to the view right in place.
emits the specified signal in context of this
object.
Passes the current class and type of the current class separated by comma. It's convenient to use with the connect function:
A signal declaration.