<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bridge :: Scapix Language Bridge</title><link>/bridge/index.html</link><description>github: scapix Automatic, on the fly bindings directly from C++ headers to:
Java Objective-C Swift Python JavaScript (WebAssembly) C#</description><generator>Hugo</generator><language>en-us</language><atom:link href="/bridge/index.xml" rel="self" type="application/rss+xml"/><item><title>Introduction</title><link>/bridge/introduction/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/introduction/index.html</guid><description>Introduction to Scapix Language Bridge</description></item><item><title>Examples</title><link>/bridge/examples/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/examples/index.html</guid><description>Minimal example: tiny_bridge git clone https://github.com/scapix-com/tiny_bridge cd tiny_bridge cmake -B build -DSCAPIX_BRIDGE=java Minimal example (ObjC/Swift): scapix_example_objc git clone https://github.com/scapix-com/scapix_example_objc cd scapix_example_objc/cpplib ./cmake_generate.sh Extended example (all languages): example1 git clone https://github.com/scapix-com/example1 cd example1 ./buils.sh &lt;preset&gt;</description></item><item><title>Tutorial</title><link>/bridge/tutorial/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/tutorial/index.html</guid><description>Step by step instructions on building and running example1 project.
C#</description></item><item><title>CMake Integration</title><link>/bridge/cmake_integration/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/cmake_integration/index.html</guid><description>Integrating Scapix into CMake project</description></item><item><title>Optional Integration</title><link>/bridge/optional_integration/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/optional_integration/index.html</guid><description>Optionally integrate Scapix into your project</description></item><item><title>Types</title><link>/bridge/types/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/types/index.html</guid><description>Scapix generates bindings for functions with supported parameter types and return type. Functions with unsupported types in parameters or return value are ignored.
Portable types:
classes derived from scapix::bridge::object void bool std::int8_t std::int16_t std::int32_t std::int64_t std::uint8_t std::uint16_t std::uint32_t std::uint64_t float double std::shared_ptr&lt;T&gt; std::string (always in UTF-8 encoding) std::vector&lt;T&gt; std::map&lt;K,V&gt; std::set&lt;K&gt; std::unordered_map&lt;K,V&gt; std::unordered_set&lt;K&gt; std::function&lt;F&gt; enum (as underlying integer type) struct (all non-static data members are public) Non-portable types:
char signed char short int long long long unsigned char unsigned short unsigned int unsigned long unsigned long long Supported types may be nested arbitrarily. Classes derived from scapix::bridge::object are bridged by reference and supported in Scapix bindings only when passed as std::shared_ptr&lt;type&gt;. All other types are bridged by copy. Supported type may be passed or returned by value (Type), by const reference (const Type&amp;) or by rvalue reference (Type&amp;&amp;). Non-const lvalue reference (Type&amp;) is intentionally unsupported. struct should be defined in the same header where it is used as a parameter or return value (this limitation will be lifted in a future version). Use callbacks to call bridged language from C++ Type mappings:</description></item><item><title>Callbacks</title><link>/bridge/callbacks/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/callbacks/index.html</guid><description>There are two ways to call from C++ to bridged languages:
Use std::function&lt;&gt; parameter to send callback routine to C++ Implement C++ interface in bridged language (override C++ virtual functions) Overriding C++ virtual functions is currently supported by Python and JavaScript bridge, support for other languages coming soon.</description></item><item><title>Bridge Object</title><link>/bridge/bridge_object/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/bridge_object/index.html</guid><description>Any C++ class in cross-platform part of your project can be automatically bridged to other languages to expose it to UI code written in ObjC, Swift or Java. Just derive your class from scapix::bridge::object:
#include &lt;scapix/bridge/object.h&gt; class user_info : public scapix::bridge::object&lt;user_info&gt; { public: //... }; The lifetime of scapix::bridge::object should always be managed by std::shared_ptr / std::weak_ptr
void create() { auto u1 = std::make_shared&lt;user_info&gt;(); // Ok auto u2 = std::shared_ptr(new user_info); // Ok user_info u3; // Wrong!!! } If you need the functionality of std::enable_shared_from_this, you can derive your classes from both scapix::bridge::object and std::enable_shared_from_this:</description></item><item><title>Project Layout</title><link>/bridge/project_layout/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/project_layout/index.html</guid><description>Suggested project layout</description></item><item><title>Motivation</title><link>/bridge/motivation/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/motivation/index.html</guid><description>Comparison to existing solutions</description></item><item><title>Requirements</title><link>/bridge/requirements/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/requirements/index.html</guid><description>Supported host platforms macOS arm64 (Apple silicon) macOS x86_64 Windows x64 Linux x86_64 (Ubuntu 22.04 x86_64 or compatible) Tools Git CMake C++20 compiler (Clang, GCC, MSVC, etc.) Python (only for Python bridge) Emscripten SDK (only for JavaScript bridge)</description></item><item><title>Known issues</title><link>/bridge/known_issues/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/bridge/known_issues/index.html</guid><description>Android Studio build sometimes fails after updating Scapix version, etc. Use Android Studio menu command: Build / Refresh Linked C++ Projects
Build errors on Windows caused by 260 characters path limitation For example, you may receive error The CXX compiler identification is unknown when building Python bridge on Windows. To fix this, enable Windows long path support available starting from Windows 10 version 1607 (released in July 2016):</description></item></channel></rss>