3#include <monort/mono_pod_wrapper.h>
4#include <hpp/small_vector.hpp>
6#include <monopp/mono_field_invoker.h>
7#include <monopp/mono_domain.h>
8#include <monopp/mono_assembly.h>
16template <
typename T,
size_t StaticCapacity>
17struct mono_converter<hpp::small_vector<T, StaticCapacity>>
24 return mono_array<T>(obj).get_internal_ptr();
33 return mono_array<T>(mono_object(obj)).template to_vector<native_type>();
63namespace managed_interface
72auto converter::convert(
const math::vec2& v) ->
vector2;
75auto converter::convert(
const vector2& v) -> math::vec2;
84auto converter::convert(
const math::vec3& v) ->
vector3;
87auto converter::convert(
const vector3& v) -> math::vec3;
97auto converter::convert(
const math::vec4& v) ->
vector4;
99auto converter::convert(
const vector4& v) -> math::vec4;
109auto converter::convert(
const math::quat& q) ->
quaternion;
111auto converter::convert(
const quaternion& q) -> math::quat;
132auto converter::convert(
const math::bbox& v) -> bbox;
134auto converter::convert(
const bbox& v) ->
math::bbox;
246struct mono_converter<managed_interface::ui_event_base>
251 static auto create_instance(
const std::string& namespace_name,
const std::string& type_name) -> mono::mono_object
255 auto type = app_assembly.get_type(namespace_name, type_name);
256 return type.new_instance();
260 mono::set_field_value(instance,
"nativePtr", obj.
native_ptr);
265 mono::set_field_value(instance,
"phase", obj.
phase);
266 mono::set_field_value(instance,
"eventType", obj.
event_type);
270 mono::get_field_value(
object,
"nativePtr", data.
native_ptr);
275 mono::get_field_value(
object,
"phase", data.
phase);
276 mono::get_field_value(
object,
"eventType", data.
event_type);
281 auto instance = create_instance(
"Unravel.Core",
"UIEventBase");
282 to_mono_base(obj, instance);
284 return instance.get_internal_ptr();
289 mono::mono_object
object(obj);
291 from_mono_base(
object, data);
299struct mono_converter<managed_interface::ui_pointer_event> : mono_converter<managed_interface::ui_event_base>
306 auto instance = create_instance(
"Unravel.Core",
"UIPointerEvent");
309 to_mono_base(obj, instance);
312 mono::set_field_value(instance,
"x", obj.x);
313 mono::set_field_value(instance,
"y", obj.y);
314 mono::set_field_value(instance,
"button", obj.button);
315 mono::set_field_value(instance,
"ctrlKey", obj.ctrl_key);
316 mono::set_field_value(instance,
"shiftKey", obj.shift_key);
317 mono::set_field_value(instance,
"altKey", obj.alt_key);
318 mono::set_field_value(instance,
"metaKey", obj.meta_key);
319 mono::set_field_value(instance,
"deltaX", obj.delta_x);
320 mono::set_field_value(instance,
"deltaY", obj.delta_y);
322 return instance.get_internal_ptr();
328 mono::mono_object
object(obj);
331 from_mono_base(
object, data);
333 mono::get_field_value(
object,
"x", data.
x);
334 mono::get_field_value(
object,
"y", data.
y);
335 mono::get_field_value(
object,
"button", data.
button);
336 mono::get_field_value(
object,
"ctrlKey", data.
ctrl_key);
337 mono::get_field_value(
object,
"shiftKey", data.
shift_key);
338 mono::get_field_value(
object,
"altKey", data.
alt_key);
339 mono::get_field_value(
object,
"metaKey", data.
meta_key);
340 mono::get_field_value(
object,
"deltaX", data.
delta_x);
341 mono::get_field_value(
object,
"deltaY", data.
delta_y);
348struct mono_converter<managed_interface::ui_key_event> : mono_converter<managed_interface::ui_event_base>
355 auto instance = create_instance(
"Unravel.Core",
"UIKeyEvent");
358 to_mono_base(obj, instance);
361 mono::set_field_value(instance,
"keyCode", obj.key_code);
362 mono::set_field_value(instance,
"ctrlKey", obj.ctrl_key);
363 mono::set_field_value(instance,
"shiftKey", obj.shift_key);
364 mono::set_field_value(instance,
"altKey", obj.alt_key);
365 mono::set_field_value(instance,
"metaKey", obj.meta_key);
367 return instance.get_internal_ptr();
373 mono::mono_object
object(obj);
376 from_mono_base(
object, data);
378 mono::get_field_value(
object,
"keyCode", data.
key_code);
379 mono::get_field_value(
object,
"ctrlKey", data.
ctrl_key);
380 mono::get_field_value(
object,
"shiftKey", data.
shift_key);
381 mono::get_field_value(
object,
"altKey", data.
alt_key);
382 mono::get_field_value(
object,
"metaKey", data.
meta_key);
389struct mono_converter<managed_interface::ui_textinput_event> : mono_converter<managed_interface::ui_event_base>
396 auto instance = create_instance(
"Unravel.Core",
"UITextInputEvent");
399 to_mono_base(obj, instance);
402 mono::set_field_value(instance,
"text", obj.text);
403 mono::set_field_value(instance,
"ctrlKey", obj.ctrl_key);
404 mono::set_field_value(instance,
"shiftKey", obj.shift_key);
405 mono::set_field_value(instance,
"altKey", obj.alt_key);
406 mono::set_field_value(instance,
"metaKey", obj.meta_key);
408 return instance.get_internal_ptr();
414 mono::mono_object
object(obj);
417 from_mono_base(
object, data);
419 mono::get_field_value(
object,
"text", data.
text);
420 mono::get_field_value(
object,
"ctrlKey", data.
ctrl_key);
421 mono::get_field_value(
object,
"shiftKey", data.
shift_key);
422 mono::get_field_value(
object,
"altKey", data.
alt_key);
423 mono::get_field_value(
object,
"metaKey", data.
meta_key);
430struct mono_converter<managed_interface::ui_slider_event> : mono_converter<managed_interface::ui_event_base>
437 auto instance = create_instance(
"Unravel.Core",
"UISliderEvent");
440 to_mono_base(obj, instance);
443 mono::set_field_value(instance,
"value", obj.value);
444 mono::set_field_value(instance,
"minValue", obj.min_value);
445 mono::set_field_value(instance,
"maxValue", obj.max_value);
446 mono::set_field_value(instance,
"step", obj.step);
448 return instance.get_internal_ptr();
454 mono::mono_object
object(obj);
457 from_mono_base(
object, data);
459 mono::get_field_value(
object,
"value", data.
value);
460 mono::get_field_value(
object,
"minValue", data.
min_value);
461 mono::get_field_value(
object,
"maxValue", data.
max_value);
462 mono::get_field_value(
object,
"step", data.
step);
469struct mono_converter<managed_interface::ui_change_event> : mono_converter<managed_interface::ui_event_base>
476 auto instance = create_instance(
"Unravel.Core",
"UIChangeEvent");
479 to_mono_base(obj, instance);
482 mono::set_field_value(instance,
"value", obj.value);
484 return instance.get_internal_ptr();
490 mono::mono_object
object(obj);
493 from_mono_base(
object, data);
495 mono::get_field_value(
object,
"value", data.
value);
const btCollisionObject * object
register_basic_mono_converter_for_pod(math::vec2, managed_interface::vector2)
Storage for box vector values and wraps up common functionality.
std::string current_element_id
std::intptr_t current_element_ptr
std::string target_element_id
std::intptr_t target_element_ptr
MonoObject * managed_type
hpp::small_vector< T, StaticCapacity > native_type
static auto to_mono(const native_type &obj) -> managed_type
static auto from_mono(const managed_type &obj) -> native_type
static auto to_mono(const native_type &obj) -> managed_type
MonoObject * managed_type
static auto from_mono(const managed_type &obj) -> native_type
MonoObject * managed_type
static auto to_mono(const native_type &obj) -> managed_type
static auto create_instance(const std::string &namespace_name, const std::string &type_name) -> mono::mono_object
static void to_mono_base(const native_type &obj, mono::mono_object &instance)
static auto from_mono(const managed_type &obj) -> native_type
static void from_mono_base(const mono::mono_object &object, native_type &data)
MonoObject * managed_type
static auto to_mono(const native_type &obj) -> managed_type
static auto from_mono(const managed_type &obj) -> native_type
MonoObject * managed_type
static auto from_mono(const managed_type &obj) -> native_type
static auto to_mono(const native_type &obj) -> managed_type
MonoObject * managed_type
static auto to_mono(const native_type &obj) -> managed_type
static auto from_mono(const managed_type &obj) -> native_type
static auto to_mono(const native_type &obj) -> managed_type
MonoObject * managed_type
static auto from_mono(const managed_type &obj) -> native_type
static auto context() -> rtti::context &