Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
bindings1.cpp File Reference
#include <string>
#include "experimental/tskit/bindings/bindings.h"

Go to the source code of this file.

Functions

 EMSCRIPTEN_BINDINGS (Core)
 

Function Documentation

◆ EMSCRIPTEN_BINDINGS()

EMSCRIPTEN_BINDINGS ( Core  )

This function does a public thing.

Parameters
inputan ice cream flavor

The Something class is quite something. See SkSomething.h for more.

Returns a Something with the provided name.

Parameters
name

Returns the associated name.

The AnotherClass class is another class.

Returns a Something with the provided name.

Parameters
name
thing- will be used, I promise.

Returns the associated thing.

The number of columns that the frobulator needs. @type @optional number

The object associated with the frobulator. @type AnotherClass

@type string

@type boolean

This function does another public thing.

Parameters
inputan ice cream flavor

@type boolean

This is the flag which is a lot of fun. It is used in a variety of ways. #funwithflags @type number

Definition at line 13 of file bindings1.cpp.

13 {
14 TS_PRIVATE_EXPORT("_privateFunction2(x: number, y: number): number")
15 function("_privateFunction2", optional_override([](int x, int y)->size_t {
16 return x * y;
17 }));
18
19 /**
20 * This function does a public thing.
21 * @param input an ice cream flavor
22 */
23 TS_EXPORT("publicFunction2(input: string): void")
24 function("publicFunction2", optional_override([](std::string s)->void {
25 printf("Hello %s\n", s.c_str());
26 }));
27
28 /**
29 * The Something class is quite something. See SkSomething.h for more.
30 */
31 class_<Something>("Something")
32 /**
33 * Returns a Something with the provided name.
34 * @param name
35 */
36 TS_EXPORT("new(name: string): Something")
37 .constructor<std::string>()
38 /**
39 * Returns the associated name.
40 */
41 TS_EXPORT("getName(): string")
42 .function("getName", &Something::getName)
43 TS_PRIVATE_EXPORT("_setName(name: string): void")
44 .function("_setName", &Something::setName);
45
46 /**
47 * The AnotherClass class is another class.
48 */
49 class_<AnotherClass>("AnotherClass")
50 TS_EXPORT("new(): AnotherClass")
51 .constructor<>()
52 /**
53 * Returns a Something with the provided name.
54 * @param name
55 * @param thing - will be used, I promise.
56 */
57 TS_EXPORT("new(name: string, thing: Something): AnotherClass")
58 .constructor<std::string,Something>()
59 /**
60 * Returns the associated thing.
61 */
62 TS_EXPORT("get(): Something")
63 .function("get", &AnotherClass::get);
64
65 value_object<SomeValueObject>("SomeValueObject")
66 /**
67 The number of columns that the frobulator needs.
68 @type @optional number
69 */
70 .field("columns", &SomeValueObject::columns)
71 /**
72 * The object associated with the frobulator.
73 * @type AnotherClass
74 */
75 .field("object", &SomeValueObject::object)
76 /** @type string*/
77 .field("name", &SomeValueObject::slot)
78 /**
79 * @type boolean
80 */
81 .field("isInteger", &SomeValueObject::isInteger);
82
83 TS_PRIVATE_EXPORT("_privateFunction1(ptr: number): number;")
84 function("_privateFunction1", &SkCanvas::whatever);
85
86 /**
87 * This function does another public thing.
88 * @param input an ice cream flavor
89 */
90 TS_EXPORT("publicFunction1(): boolean;")
91 function("publicFunction1", &SkCanvas::blerg);
92
93 /**
94 * @type boolean
95 */
96 constant("hasBird", true);
97 /**
98 * This is the flag which is a lot of fun.
99 * It is used in a variety of ways.
100 * #funwithflags
101 * @type number
102 */
103 constant("SOME_FLAG", 0x2);
104
105#ifdef SK_EXTRA_FEATURE
106 /**
107 * This is set if the extra feature is compiled in.
108 * @type @optional string
109 */
110 constant("optionalConst", "foo");
111#endif
112}
#define TS_PRIVATE_EXPORT(ts_code)
Definition bindings.h:44
#define TS_EXPORT(ts_code)
Definition bindings.h:45
struct MyStruct s
Dart_NativeFunction function
Definition fuchsia.cc:51
const char * name
Definition fuchsia.cc:50
double y
double x
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
Definition ref_ptr.h:256