diff --git a/lime/_backend/native/NativeApplication.hx b/lime/_backend/native/NativeApplication.hx
index f59212c37..b88b704f4 100644
--- a/lime/_backend/native/NativeApplication.hx
+++ b/lime/_backend/native/NativeApplication.hx
@@ -741,7 +741,7 @@ class NativeApplication {
}
-private class ApplicationEventInfo {
+/*private*/ class ApplicationEventInfo {
public var deltaTime:Int;
@@ -774,7 +774,7 @@ private class ApplicationEventInfo {
}
-private class ClipboardEventInfo {
+/*private*/ class ClipboardEventInfo {
public var type:ClipboardEventType;
@@ -804,7 +804,7 @@ private class ClipboardEventInfo {
}
-private class DropEventInfo {
+/*private*/ class DropEventInfo {
public var file:String;
@@ -836,7 +836,7 @@ private class DropEventInfo {
}
-private class GamepadEventInfo {
+/*private*/ class GamepadEventInfo {
public var axis:Int;
@@ -878,7 +878,7 @@ private class GamepadEventInfo {
}
-private class JoystickEventInfo {
+/*private*/ class JoystickEventInfo {
public var id:Int;
@@ -924,7 +924,7 @@ private class JoystickEventInfo {
}
-private class KeyEventInfo {
+/*private*/ class KeyEventInfo {
public var keyCode:Int;
@@ -961,7 +961,7 @@ private class KeyEventInfo {
}
-private class MouseEventInfo {
+/*private*/ class MouseEventInfo {
public var button:Int;
@@ -1007,7 +1007,7 @@ private class MouseEventInfo {
}
-private class RenderEventInfo {
+/*private*/ class RenderEventInfo {
public var context:RenderContext;
@@ -1041,7 +1041,7 @@ private class RenderEventInfo {
}
-private class SensorEventInfo {
+/*private*/ class SensorEventInfo {
public var id:Int;
@@ -1079,7 +1079,7 @@ private class SensorEventInfo {
}
-private class TextEventInfo {
+/*private*/ class TextEventInfo {
public var id:Int;
@@ -1119,7 +1119,7 @@ private class TextEventInfo {
}
-private class TouchEventInfo {
+/*private*/ class TouchEventInfo {
public var device:Int;
@@ -1165,7 +1165,7 @@ private class TouchEventInfo {
}
-private class WindowEventInfo {
+/*private*/ class WindowEventInfo {
public var height:Int;
diff --git a/lime/_backend/native/NativeCFFI.hx b/lime/_backend/native/NativeCFFI.hx
index 71f5b0a02..6501e1165 100644
--- a/lime/_backend/native/NativeCFFI.hx
+++ b/lime/_backend/native/NativeCFFI.hx
@@ -13,6 +13,10 @@ import lime.media.openal.ALAuxiliaryEffectSlot;
import lime.system.CFFIPointer;
import lime.utils.DataPointer;
+#if hl
+import lime._backend.native.NativeApplication;
+#end
+
#if cpp
import cpp.Float32;
#else
@@ -188,7 +192,7 @@ class NativeCFFI {
#if hl
@:hlNative("lime", "lime_application_create") private static function lime_application_create ():CFFIPointer { return null; }
- @:cffi private static function lime_application_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_application_event_manager_register") private static function lime_application_event_manager_register (callback:Void->Void, eventObject:ApplicationEventInfo):Void {}
@:hlNative("lime", "lime_application_exec") private static function lime_application_exec (handle:CFFIPointer):Int { return 0; }
@:hlNative("lime", "lime_application_init") private static function lime_application_init (handle:CFFIPointer):Void {}
@:hlNative("lime", "lime_application_quit") private static function lime_application_quit (handle:CFFIPointer):Int { return 0; }
@@ -200,13 +204,13 @@ class NativeCFFI {
@:cffi private static function lime_bytes_get_data_pointer_offset (data:Dynamic, offset:Int):Float;
@:cffi private static function lime_bytes_read_file (path:String, bytes:Dynamic):Dynamic;
@:cffi private static function lime_cffi_get_native_pointer (ptr:Dynamic):Float;
- @:cffi private static function lime_clipboard_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_clipboard_event_manager_register") private static function lime_clipboard_event_manager_register (callback:Void->Void, eventObject:ClipboardEventInfo):Void {}
@:cffi private static function lime_clipboard_get_text ():Dynamic;
@:cffi private static function lime_clipboard_set_text (text:String):Void;
@:cffi private static function lime_data_pointer_offset (dataPointer:DataPointer, offset:Int):Float;
@:cffi private static function lime_deflate_compress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_deflate_decompress (data:Dynamic, bytes:Dynamic):Dynamic;
- @:cffi private static function lime_drop_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_drop_event_manager_register") private static function lime_drop_event_manager_register (callback:Void->Void, eventObject:DropEventInfo):Void {}
@:cffi private static function lime_file_dialog_open_directory (title:String, filter:String, defaultPath:String):Dynamic;
@:cffi private static function lime_file_dialog_open_file (title:String, filter:String, defaultPath:String):Dynamic;
@:cffi private static function lime_file_dialog_open_files (title:String, filter:String, defaultPath:String):Dynamic;
@@ -234,7 +238,7 @@ class NativeCFFI {
@:cffi private static function lime_gamepad_add_mappings (mappings:Dynamic):Void;
@:cffi private static function lime_gamepad_get_device_guid (id:Int):Dynamic;
@:cffi private static function lime_gamepad_get_device_name (id:Int):Dynamic;
- @:cffi private static function lime_gamepad_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_gamepad_event_manager_register") private static function lime_gamepad_event_manager_register (callback:Void->Void, eventObject:GamepadEventInfo):Void {}
@:cffi private static function lime_gzip_compress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_gzip_decompress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_haptic_vibrate (period:Int, duration:Int):Void;
@@ -259,12 +263,12 @@ class NativeCFFI {
@:cffi private static function lime_joystick_get_num_buttons (id:Int):Int;
@:cffi private static function lime_joystick_get_num_hats (id:Int):Int;
@:cffi private static function lime_joystick_get_num_trackballs (id:Int):Int;
- @:cffi private static function lime_joystick_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_joystick_event_manager_register") private static function lime_joystick_event_manager_register (callback:Void->Void, eventObject:JoystickEventInfo):Void {}
@:cffi private static function lime_jpeg_decode_bytes (data:Dynamic, decodeData:Bool, buffer:Dynamic):Dynamic;
@:cffi private static function lime_jpeg_decode_file (path:String, decodeData:Bool, buffer:Dynamic):Dynamic;
@:cffi private static function lime_key_code_from_scan_code (scanCode:Float32):Float32;
@:cffi private static function lime_key_code_to_scan_code (keyCode:Float32):Float32;
- @:cffi private static function lime_key_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_key_event_manager_register") private static function lime_key_event_manager_register (callback:Void->Void, eventObject:KeyEventInfo):Void {}
@:cffi private static function lime_lzma_compress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_lzma_decompress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_mouse_hide ():Void;
@@ -272,21 +276,21 @@ class NativeCFFI {
@:cffi private static function lime_mouse_set_lock (lock:Bool):Void;
@:cffi private static function lime_mouse_show ():Void;
@:cffi private static function lime_mouse_warp (x:Int, y:Int, window:Dynamic):Void;
- @:cffi private static function lime_mouse_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_mouse_event_manager_register") private static function lime_mouse_event_manager_register (callback:Void->Void, eventObject:MouseEventInfo):Void {}
@:cffi private static function lime_neko_execute (module:String):Void;
@:cffi private static function lime_png_decode_bytes (data:Dynamic, decodeData:Bool, buffer:Dynamic):Dynamic;
@:cffi private static function lime_png_decode_file (path:String, decodeData:Bool, buffer:Dynamic):Dynamic;
- @:cffi private static function lime_renderer_create (window:Dynamic):Dynamic;
- @:cffi private static function lime_renderer_flip (handle:Dynamic):Void;
- @:cffi private static function lime_renderer_get_context (handle:Dynamic):Float;
- @:cffi private static function lime_renderer_get_scale (handle:Dynamic):Float;
- @:cffi private static function lime_renderer_get_type (handle:Dynamic):Dynamic;
- @:cffi private static function lime_renderer_lock (handle:Dynamic):Dynamic;
- @:cffi private static function lime_renderer_make_current (handle:Dynamic):Void;
- @:cffi private static function lime_renderer_read_pixels (handle:Dynamic, rect:Dynamic, imageBuffer:Dynamic):Dynamic;
- @:cffi private static function lime_renderer_unlock (handle:Dynamic):Void;
- @:cffi private static function lime_render_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
- @:cffi private static function lime_sensor_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_renderer_create") private static function lime_renderer_create (window:CFFIPointer):CFFIPointer { return null; }
+ @:hlNative("lime", "lime_renderer_flip") private static function lime_renderer_flip (handle:CFFIPointer):Void {}
+ @:hlNative("lime", "lime_renderer_get_context") private static function lime_renderer_get_context (handle:CFFIPointer):Float { return 0; }
+ @:hlNative("lime", "lime_renderer_get_scale") private static function lime_renderer_get_scale (handle:CFFIPointer):Float { return 0; }
+ @:hlNative("lime", "lime_renderer_get_type") private static function lime_renderer_get_type (handle:CFFIPointer):hl.Bytes { return null; }
+ @:hlNative("lime", "lime_renderer_lock") private static function lime_renderer_lock (handle:CFFIPointer):Dynamic { return null; }
+ @:hlNative("lime", "lime_renderer_make_current") private static function lime_renderer_make_current (handle:CFFIPointer):Void {}
+ @:hlNative("lime", "lime_renderer_read_pixels") private static function lime_renderer_read_pixels (handle:CFFIPointer, rect:Rectangle, imageBuffer:ImageBuffer):Dynamic { return null; }
+ @:hlNative("lime", "lime_renderer_unlock") private static function lime_renderer_unlock (handle:CFFIPointer):Void {}
+ @:hlNative("lime", "lime_render_event_manager_register") private static function lime_render_event_manager_register (callback:Void->Void, eventObject:RenderEventInfo):Void {}
+ @:hlNative("lime", "lime_sensor_event_manager_register") private static function lime_sensor_event_manager_register (callback:Void->Void, eventObject:SensorEventInfo):Void {}
@:cffi private static function lime_system_get_allow_screen_timeout ():Bool;
@:cffi private static function lime_system_set_allow_screen_timeout (value:Bool):Bool;
@:cffi private static function lime_system_get_device_model ():Dynamic;
@@ -301,13 +305,13 @@ class NativeCFFI {
@:cffi private static function lime_system_get_timer ():Float;
@:cffi private static function lime_system_open_file (path:String):Void;
@:cffi private static function lime_system_open_url (url:String, target:String):Void;
- @:cffi private static function lime_text_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_text_event_manager_register") private static function lime_text_event_manager_register (callback:Void->Void, eventObject:TextEventInfo):Void {}
@:cffi private static function lime_text_layout_create (direction:Int, script:String, language:String):Dynamic;
@:cffi private static function lime_text_layout_position (textHandle:Dynamic, fontHandle:Dynamic, size:Int, textString:String, data:Dynamic):Dynamic;
@:cffi private static function lime_text_layout_set_direction (textHandle:Dynamic, direction:Int):Void;
@:cffi private static function lime_text_layout_set_language (textHandle:Dynamic, language:String):Void;
@:cffi private static function lime_text_layout_set_script (textHandle:Dynamic, script:String):Void;
- @:cffi private static function lime_touch_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_touch_event_manager_register") private static function lime_touch_event_manager_register (callback:Void->Void, eventObject:TouchEventInfo):Void {}
@:cffi private static function lime_window_alert (handle:Dynamic, message:String, title:String):Void;
@:cffi private static function lime_window_close (handle:Dynamic):Void;
@:cffi private static function lime_window_create (application:Dynamic, width:Int, height:Int, flags:Int, title:String):Dynamic;
@@ -331,7 +335,7 @@ class NativeCFFI {
@:cffi private static function lime_window_set_minimized (handle:Dynamic, minimized:Bool):Bool;
@:cffi private static function lime_window_set_resizable (handle:Dynamic, resizable:Bool):Bool;
@:cffi private static function lime_window_set_title (handle:Dynamic, title:String):Dynamic;
- @:cffi private static function lime_window_event_manager_register (callback:Dynamic, eventObject:Dynamic):Void;
+ @:hlNative("lime", "lime_window_event_manager_register") private static function lime_window_event_manager_register (callback:Void->Void, eventObject:WindowEventInfo):Void {}
@:cffi private static function lime_zlib_compress (data:Dynamic, bytes:Dynamic):Dynamic;
@:cffi private static function lime_zlib_decompress (data:Dynamic, bytes:Dynamic):Dynamic;
#end
@@ -468,6 +472,7 @@ class NativeCFFI {
#end
#if (lime_cffi && !macro && lime_cairo)
+ #if !hl
@:cffi private static function lime_cairo_arc (handle:CFFIPointer, xc:Float, yc:Float, radius:Float, angle1:Float, angle2:Float):Void;
@:cffi private static function lime_cairo_arc_negative (handle:CFFIPointer, xc:Float, yc:Float, radius:Float, angle1:Float, angle2:Float):Void;
@:cffi private static function lime_cairo_clip (handle:CFFIPointer):Void;
@@ -587,6 +592,127 @@ class NativeCFFI {
@:cffi private static function lime_cairo_surface_flush (surface:CFFIPointer):Void;
#end
+ #if hl
+ @:cffi private static function lime_cairo_arc (handle:CFFIPointer, xc:Float, yc:Float, radius:Float, angle1:Float, angle2:Float):Void;
+ @:cffi private static function lime_cairo_arc_negative (handle:CFFIPointer, xc:Float, yc:Float, radius:Float, angle1:Float, angle2:Float):Void;
+ @:cffi private static function lime_cairo_clip (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_clip_preserve (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_clip_extents (handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float):Void;
+ @:cffi private static function lime_cairo_close_path (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_copy_page (handle:CFFIPointer):Void;
+ @:hlNative("lime", "lime_cairo_create") private static function lime_cairo_create (handle:CFFIPointer):CFFIPointer { return null; }
+ @:cffi private static function lime_cairo_curve_to (handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float):Void;
+ @:cffi private static function lime_cairo_fill (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_fill_extents (handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float):Void;
+ @:cffi private static function lime_cairo_fill_preserve (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_get_antialias (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_current_point (handle:CFFIPointer):Dynamic;
+ @:cffi private static function lime_cairo_get_dash (handle:CFFIPointer):Dynamic;
+ @:cffi private static function lime_cairo_get_dash_count (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_fill_rule (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_font_face (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_get_font_options (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_get_group_target (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_get_line_cap (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_line_join (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_line_width (handle:CFFIPointer):Float;
+ @:cffi private static function lime_cairo_get_matrix (handle:CFFIPointer):Dynamic;
+ @:cffi private static function lime_cairo_get_miter_limit (handle:CFFIPointer):Float;
+ @:cffi private static function lime_cairo_get_operator (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_get_source (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_get_target (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_get_tolerance (handle:CFFIPointer):Float;
+ @:cffi private static function lime_cairo_has_current_point (handle:CFFIPointer):Bool;
+ @:cffi private static function lime_cairo_identity_matrix (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_in_clip (handle:CFFIPointer, x:Float, y:Float):Bool;
+ @:cffi private static function lime_cairo_in_fill (handle:CFFIPointer, x:Float, y:Float):Bool;
+ @:cffi private static function lime_cairo_in_stroke (handle:CFFIPointer, x:Float, y:Float):Bool;
+ @:cffi private static function lime_cairo_line_to (handle:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_mask (handle:CFFIPointer, pattern:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_mask_surface (handle:CFFIPointer, surface:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_move_to (handle:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_new_path (handle:CFFIPointer):Void;
+ @:hlNative("lime", "lime_cairo_paint") private static function lime_cairo_paint (handle:CFFIPointer):Void {}
+ @:cffi private static function lime_cairo_paint_with_alpha (handle:CFFIPointer, alpha:Float):Void;
+ @:cffi private static function lime_cairo_pop_group (handle:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_pop_group_to_source (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_push_group (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_push_group_with_content (handle:CFFIPointer, content:Int):Void;
+ @:cffi private static function lime_cairo_rectangle (handle:CFFIPointer, x:Float, y:Float, width:Float, height:Float):Void;
+ @:cffi private static function lime_cairo_rel_curve_to (handle:CFFIPointer, dx1:Float, dy1:Float, dx2:Float, dy2:Float, dx3:Float, dy3:Float):Void;
+ @:cffi private static function lime_cairo_rel_line_to (handle:CFFIPointer, dx:Float, dy:Float):Void;
+ @:cffi private static function lime_cairo_rel_move_to (handle:CFFIPointer, dx:Float, dy:Float):Void;
+ @:cffi private static function lime_cairo_reset_clip (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_restore (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_rotate (handle:CFFIPointer, amount:Float):Void;
+ @:cffi private static function lime_cairo_save (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_scale (handle:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_set_antialias (handle:CFFIPointer, cap:Int):Void;
+ @:cffi private static function lime_cairo_set_dash (handle:CFFIPointer, dash:Dynamic):Void;
+ @:cffi private static function lime_cairo_set_fill_rule (handle:CFFIPointer, cap:Int):Void;
+ @:cffi private static function lime_cairo_set_font_face (handle:CFFIPointer, face:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_set_font_options (handle:CFFIPointer, options:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_set_font_size (handle:CFFIPointer, size:Float):Void;
+ @:cffi private static function lime_cairo_set_line_cap (handle:CFFIPointer, cap:Int):Void;
+ @:cffi private static function lime_cairo_set_line_join (handle:CFFIPointer, join:Int):Void;
+ @:cffi private static function lime_cairo_set_line_width (handle:CFFIPointer, width:Float):Void;
+ @:cffi private static function lime_cairo_set_matrix (handle:CFFIPointer, a:Float, b:Float, c:Float, d:Float, tx:Float, ty:Float):Void;
+ //@:cffi private static function lime_cairo_set_matrix (handle:CFFIPointer, matrix:Dynamic):Void;
+ @:cffi private static function lime_cairo_set_miter_limit (handle:CFFIPointer, miterLimit:Float):Void;
+ @:cffi private static function lime_cairo_set_operator (handle:CFFIPointer, op:Int):Void;
+ @:cffi private static function lime_cairo_set_source (handle:CFFIPointer, pattern:CFFIPointer):Void;
+ @:hlNative("lime", "lime_cairo_set_source_rgb") private static function lime_cairo_set_source_rgb (handle:CFFIPointer, r:Float, g:Float, b:Float):Void {}
+ @:cffi private static function lime_cairo_set_source_rgba (handle:CFFIPointer, r:Float, g:Float, b:Float, a:Float):Void;
+ @:cffi private static function lime_cairo_set_source_surface (handle:CFFIPointer, surface:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_set_tolerance (handle:CFFIPointer, tolerance:Float):Void;
+ @:cffi private static function lime_cairo_show_glyphs (handle:CFFIPointer, glyphs:Dynamic):Void;
+ @:cffi private static function lime_cairo_show_page (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_show_text (handle:CFFIPointer, text:String):Void;
+ @:cffi private static function lime_cairo_status (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_stroke (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_stroke_extents (handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float):Void;
+ @:cffi private static function lime_cairo_stroke_preserve (handle:CFFIPointer):Void;
+ @:cffi private static function lime_cairo_text_path (handle:CFFIPointer, text:String):Void;
+ @:cffi private static function lime_cairo_transform (handle:CFFIPointer, matrix:Dynamic):Void;
+ @:cffi private static function lime_cairo_translate (handle:CFFIPointer, x:Float, y:Float):Void;
+ @:cffi private static function lime_cairo_version ():Int;
+ @:cffi private static function lime_cairo_version_string ():String;
+ @:cffi private static function lime_cairo_font_face_status (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_font_options_create ():CFFIPointer;
+ @:cffi private static function lime_cairo_font_options_get_antialias (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_font_options_get_hint_metrics (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_font_options_get_hint_style (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_font_options_get_subpixel_order (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_font_options_set_antialias (handle:CFFIPointer, v:Int):Void;
+ @:cffi private static function lime_cairo_font_options_set_hint_metrics (handle:CFFIPointer, v:Int):Void;
+ @:cffi private static function lime_cairo_font_options_set_hint_style (handle:CFFIPointer, v:Int):Void;
+ @:cffi private static function lime_cairo_font_options_set_subpixel_order (handle:CFFIPointer, v:Int):Void;
+ @:cffi private static function lime_cairo_ft_font_face_create (face:CFFIPointer, flags:Int):CFFIPointer;
+ @:cffi private static function lime_cairo_image_surface_create (format:Int, width:Int, height:Int):CFFIPointer;
+ @:hlNative("lime", "lime_cairo_image_surface_create_for_data") private static function lime_cairo_image_surface_create_for_data (data:DataPointer, format:Int, width:Int, height:Int, stride:Int):CFFIPointer { return null; }
+ @:cffi private static function lime_cairo_image_surface_get_data (handle:CFFIPointer):DataPointer;
+ @:cffi private static function lime_cairo_image_surface_get_format (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_image_surface_get_height (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_image_surface_get_stride (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_image_surface_get_width (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_pattern_add_color_stop_rgb (handle:CFFIPointer, offset:Float, red:Float, green:Float, blue:Float):Void;
+ @:cffi private static function lime_cairo_pattern_add_color_stop_rgba (handle:CFFIPointer, offset:Float, red:Float, green:Float, blue:Float, alpha:Float):Void;
+ @:cffi private static function lime_cairo_pattern_create_for_surface (surface:CFFIPointer):CFFIPointer;
+ @:cffi private static function lime_cairo_pattern_create_linear (x0:Float, y0:Float, x1:Float, y1:Float):CFFIPointer;
+ @:cffi private static function lime_cairo_pattern_create_radial (cx0:Float, cy0:Float, radius0:Float, cx1:Float, cy1:Float, radius1:Float):CFFIPointer;
+ @:cffi private static function lime_cairo_pattern_create_rgb (r:Float, g:Float, b:Float):CFFIPointer;
+ @:cffi private static function lime_cairo_pattern_create_rgba (r:Float, g:Float, b:Float, a:Float):CFFIPointer;
+ @:cffi private static function lime_cairo_pattern_get_color_stop_count (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_pattern_get_extend (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_pattern_get_filter (handle:CFFIPointer):Int;
+ @:cffi private static function lime_cairo_pattern_get_matrix (handle:CFFIPointer):Dynamic;
+ @:cffi private static function lime_cairo_pattern_set_extend (handle:CFFIPointer, extend:Int):Void;
+ @:cffi private static function lime_cairo_pattern_set_filter (handle:CFFIPointer, filter:Int):Void;
+ @:cffi private static function lime_cairo_pattern_set_matrix (handle:CFFIPointer, matrix:Dynamic):Void;
+ @:hlNative("lime", "lime_cairo_surface_flush") private static function lime_cairo_surface_flush (surface:CFFIPointer):Void {}
+ #end
+ #end
+
#if (lime_cffi && !macro && lime_curl)
@:cffi private static function lime_curl_getdate (date:String, now:Float):Float;
@:cffi private static function lime_curl_global_cleanup ():Void;
diff --git a/project/Build.xml b/project/Build.xml
index ea73796ca..aeb0b8657 100644
--- a/project/Build.xml
+++ b/project/Build.xml
@@ -296,6 +296,7 @@
+
diff --git a/project/include/app/ApplicationEvent.h b/project/include/app/ApplicationEvent.h
index 57eeaf122..32b49b36e 100644
--- a/project/include/app/ApplicationEvent.h
+++ b/project/include/app/ApplicationEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -30,8 +31,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
ApplicationEvent ();
diff --git a/project/include/graphics/RenderEvent.h b/project/include/graphics/RenderEvent.h
index 70591bdab..ca1a2566d 100644
--- a/project/include/graphics/RenderEvent.h
+++ b/project/include/graphics/RenderEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -30,8 +31,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
RenderEvent ();
diff --git a/project/include/graphics/Renderer.h b/project/include/graphics/Renderer.h
index c964e8086..f7199fd04 100644
--- a/project/include/graphics/Renderer.h
+++ b/project/include/graphics/Renderer.h
@@ -21,7 +21,7 @@ namespace lime {
virtual void Flip () = 0;
virtual void* GetContext () = 0;
virtual double GetScale () = 0;
- virtual value Lock () = 0;
+ virtual void* Lock (bool useCFFIValue) = 0;
virtual void MakeCurrent () = 0;
virtual void ReadPixels (ImageBuffer *buffer, Rectangle *rect) = 0;
virtual const char* Type () = 0;
diff --git a/project/include/system/ClipboardEvent.h b/project/include/system/ClipboardEvent.h
index 531356218..91664b4da 100644
--- a/project/include/system/ClipboardEvent.h
+++ b/project/include/system/ClipboardEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -28,8 +29,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
ClipboardEvent ();
diff --git a/project/include/system/SensorEvent.h b/project/include/system/SensorEvent.h
index 602612d4c..a92cefaa1 100644
--- a/project/include/system/SensorEvent.h
+++ b/project/include/system/SensorEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -32,8 +33,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
SensorEvent ();
diff --git a/project/include/system/ValuePointer.h b/project/include/system/ValuePointer.h
new file mode 100644
index 000000000..f52312426
--- /dev/null
+++ b/project/include/system/ValuePointer.h
@@ -0,0 +1,47 @@
+#ifndef LIME_SYSTEM_VALUE_POINTER_H
+#define LIME_SYSTEM_VALUE_POINTER_H
+
+
+#include
+#include
+
+
+namespace lime {
+
+
+ class ValuePointer {
+
+
+ public:
+
+ ValuePointer (vobj* handle);
+ ValuePointer (vdynamic* handle);
+ ValuePointer (vclosure* handle);
+ ValuePointer (value handle);
+ ~ValuePointer ();
+
+ void* Call ();
+ void* Call (void* arg0);
+ void* Call (void* arg0, void* arg1);
+ void* Call (void* arg0, void* arg1, void* arg2);
+ void* Call (void* arg0, void* arg1, void* arg2, void* arg3);
+ void* Call (void* arg0, void* arg1, void* arg2, void* arg3, void* arg4);
+ void* Get () const;
+ bool IsCFFIValue ();
+ bool IsHLValue ();
+ void Set (vobj* handle);
+ void Set (value handle);
+
+ private:
+
+ gcroot cffiRoot;
+ value* cffiValue;
+ vobj* hlValue;
+
+ };
+
+
+}
+
+
+#endif
\ No newline at end of file
diff --git a/project/include/ui/DropEvent.h b/project/include/ui/DropEvent.h
index 3fcaa629a..0b044e453 100644
--- a/project/include/ui/DropEvent.h
+++ b/project/include/ui/DropEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -29,8 +30,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
DropEvent ();
diff --git a/project/include/ui/GamepadEvent.h b/project/include/ui/GamepadEvent.h
index 82979fcc8..a83cde5f4 100644
--- a/project/include/ui/GamepadEvent.h
+++ b/project/include/ui/GamepadEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -36,8 +37,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
GamepadEvent ();
diff --git a/project/include/ui/JoystickEvent.h b/project/include/ui/JoystickEvent.h
index acd60576c..d6a8ab534 100644
--- a/project/include/ui/JoystickEvent.h
+++ b/project/include/ui/JoystickEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
namespace lime {
@@ -39,8 +40,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
JoystickEvent ();
diff --git a/project/include/ui/KeyEvent.h b/project/include/ui/KeyEvent.h
index 7ea7b96cc..b3d892285 100644
--- a/project/include/ui/KeyEvent.h
+++ b/project/include/ui/KeyEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
@@ -33,8 +34,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
KeyEvent ();
diff --git a/project/include/ui/MouseEvent.h b/project/include/ui/MouseEvent.h
index 097405d20..f182912fc 100644
--- a/project/include/ui/MouseEvent.h
+++ b/project/include/ui/MouseEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
@@ -38,8 +39,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
MouseEvent ();
diff --git a/project/include/ui/TextEvent.h b/project/include/ui/TextEvent.h
index 4a55dc1c7..8ff496248 100644
--- a/project/include/ui/TextEvent.h
+++ b/project/include/ui/TextEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
@@ -35,8 +36,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
TextEvent ();
diff --git a/project/include/ui/TouchEvent.h b/project/include/ui/TouchEvent.h
index 6374f2889..1a8bb9e57 100644
--- a/project/include/ui/TouchEvent.h
+++ b/project/include/ui/TouchEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
@@ -38,8 +39,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
TouchEvent ();
diff --git a/project/include/ui/WindowEvent.h b/project/include/ui/WindowEvent.h
index 77fd552bb..02862b9e2 100644
--- a/project/include/ui/WindowEvent.h
+++ b/project/include/ui/WindowEvent.h
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
@@ -45,8 +46,8 @@ namespace lime {
public:
- static AutoGCRoot* callback;
- static AutoGCRoot* eventObject;
+ static ValuePointer* callback;
+ static ValuePointer* eventObject;
WindowEvent ();
diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp
index ef793732e..632fcb3bd 100644
--- a/project/src/ExternalInterface.cpp
+++ b/project/src/ExternalInterface.cpp
@@ -182,7 +182,6 @@ namespace lime {
value lime_application_create () {
Application* application = CreateApplication ();
- // Application::callback = new ValuePointer (callback);
return CFFIPointer (application, gc_application);
}
@@ -191,7 +190,6 @@ namespace lime {
HL_PRIM HL_CFFIPointer* hl_lime_application_create () {
Application* application = CreateApplication ();
- // Application::callback = new ValuePointer (callback);
return HLCFFIPointer (application, (hl_finalizer)hl_gc_application);
}
@@ -199,16 +197,16 @@ namespace lime {
void lime_application_event_manager_register (value callback, value eventObject) {
- ApplicationEvent::callback = new AutoGCRoot (callback);
- ApplicationEvent::eventObject = new AutoGCRoot (eventObject);
+ ApplicationEvent::callback = new ValuePointer (callback);
+ ApplicationEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_application_event_manager_register (vclosure* callback, HL_ApplicationEvent* eventObject) {
- // ApplicationEvent::callback = new AutoGCRoot (callback);
- // ApplicationEvent::eventObject = new AutoGCRoot (eventObject);
+ ApplicationEvent::callback = new ValuePointer (callback);
+ ApplicationEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -488,16 +486,16 @@ namespace lime {
void lime_clipboard_event_manager_register (value callback, value eventObject) {
- ClipboardEvent::callback = new AutoGCRoot (callback);
- ClipboardEvent::eventObject = new AutoGCRoot (eventObject);
+ ClipboardEvent::callback = new ValuePointer (callback);
+ ClipboardEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_clipboard_event_manager_register (vclosure* callback, HL_ClipboardEvent* eventObject) {
- // ClipboardEvent::callback = new AutoGCRoot (callback);
- // ClipboardEvent::eventObject = new AutoGCRoot (eventObject);
+ ClipboardEvent::callback = new ValuePointer (callback);
+ ClipboardEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -634,16 +632,16 @@ namespace lime {
void lime_drop_event_manager_register (value callback, value eventObject) {
- DropEvent::callback = new AutoGCRoot (callback);
- DropEvent::eventObject = new AutoGCRoot (eventObject);
+ DropEvent::callback = new ValuePointer (callback);
+ DropEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_drop_event_manager_register (vclosure* callback, HL_DropEvent* eventObject) {
- // DropEvent::callback = new AutoGCRoot (callback);
- // DropEvent::eventObject = new AutoGCRoot (eventObject);
+ DropEvent::callback = new ValuePointer (callback);
+ DropEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -1536,16 +1534,16 @@ namespace lime {
void lime_gamepad_event_manager_register (value callback, value eventObject) {
- GamepadEvent::callback = new AutoGCRoot (callback);
- GamepadEvent::eventObject = new AutoGCRoot (eventObject);
+ GamepadEvent::callback = new ValuePointer (callback);
+ GamepadEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_gamepad_event_manager_register (vclosure* callback, HL_GamepadEvent* eventObject) {
- // GamepadEvent::callback = new AutoGCRoot (callback);
- // GamepadEvent::eventObject = new AutoGCRoot (eventObject);
+ GamepadEvent::callback = new ValuePointer (callback);
+ GamepadEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -2214,16 +2212,16 @@ namespace lime {
void lime_joystick_event_manager_register (value callback, value eventObject) {
- JoystickEvent::callback = new AutoGCRoot (callback);
- JoystickEvent::eventObject = new AutoGCRoot (eventObject);
+ JoystickEvent::callback = new ValuePointer (callback);
+ JoystickEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_joystick_event_manager_register (vclosure* callback, HL_JoystickEvent* eventObject) {
- // JoystickEvent::callback = new AutoGCRoot (callback);
- // JoystickEvent::eventObject = new AutoGCRoot (eventObject);
+ JoystickEvent::callback = new ValuePointer (callback);
+ JoystickEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -2420,16 +2418,16 @@ namespace lime {
void lime_key_event_manager_register (value callback, value eventObject) {
- KeyEvent::callback = new AutoGCRoot (callback);
- KeyEvent::eventObject = new AutoGCRoot (eventObject);
+ KeyEvent::callback = new ValuePointer (callback);
+ KeyEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_key_event_manager_register (vclosure* callback, HL_KeyEvent* eventObject) {
- // KeyEvent::callback = new AutoGCRoot (callback);
- // KeyEvent::eventObject = new AutoGCRoot (eventObject);
+ KeyEvent::callback = new ValuePointer (callback);
+ KeyEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -2541,16 +2539,16 @@ namespace lime {
void lime_mouse_event_manager_register (value callback, value eventObject) {
- MouseEvent::callback = new AutoGCRoot (callback);
- MouseEvent::eventObject = new AutoGCRoot (eventObject);
+ MouseEvent::callback = new ValuePointer (callback);
+ MouseEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_mouse_event_manager_register (vclosure* callback, HL_MouseEvent* eventObject) {
- // MouseEvent::callback = new AutoGCRoot (callback);
- // MouseEvent::eventObject = new AutoGCRoot (eventObject);
+ MouseEvent::callback = new ValuePointer (callback);
+ MouseEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -2726,16 +2724,16 @@ namespace lime {
void lime_render_event_manager_register (value callback, value eventObject) {
- RenderEvent::callback = new AutoGCRoot (callback);
- RenderEvent::eventObject = new AutoGCRoot (eventObject);
+ RenderEvent::callback = new ValuePointer (callback);
+ RenderEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_render_event_manager_register (vclosure* callback, HL_RenderEvent* eventObject) {
- // RenderEvent::callback = new AutoGCRoot (callback);
- // RenderEvent::eventObject = new AutoGCRoot (eventObject);
+ RenderEvent::callback = new ValuePointer (callback);
+ RenderEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -2821,15 +2819,14 @@ namespace lime {
value lime_renderer_lock (value renderer) {
- return ((Renderer*)val_data (renderer))->Lock ();
+ return (value)((Renderer*)val_data (renderer))->Lock (true);
}
HL_PRIM vdynamic* hl_lime_renderer_lock (HL_CFFIPointer* renderer) {
- // return ((Renderer*)renderer->ptr)->Lock ();
- return 0;
+ return (vdynamic*)((Renderer*)renderer->ptr)->Lock (false);
}
@@ -2907,16 +2904,16 @@ namespace lime {
void lime_sensor_event_manager_register (value callback, value eventObject) {
- SensorEvent::callback = new AutoGCRoot (callback);
- SensorEvent::eventObject = new AutoGCRoot (eventObject);
+ SensorEvent::callback = new ValuePointer (callback);
+ SensorEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_sensor_event_manager_register (vclosure* callback, HL_SensorEvent* eventObject) {
- // SensorEvent::callback = new AutoGCRoot (callback);
- // SensorEvent::eventObject = new AutoGCRoot (eventObject);
+ SensorEvent::callback = new ValuePointer (callback);
+ SensorEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -3342,16 +3339,16 @@ namespace lime {
void lime_text_event_manager_register (value callback, value eventObject) {
- TextEvent::callback = new AutoGCRoot (callback);
- TextEvent::eventObject = new AutoGCRoot (eventObject);
+ TextEvent::callback = new ValuePointer (callback);
+ TextEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_text_event_manager_register (vclosure* callback, HL_TextEvent* eventObject) {
- // TextEvent::callback = new AutoGCRoot (callback);
- // TextEvent::eventObject = new AutoGCRoot (eventObject);
+ TextEvent::callback = new ValuePointer (callback);
+ TextEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -3484,16 +3481,16 @@ namespace lime {
void lime_touch_event_manager_register (value callback, value eventObject) {
- TouchEvent::callback = new AutoGCRoot (callback);
- TouchEvent::eventObject = new AutoGCRoot (eventObject);
+ TouchEvent::callback = new ValuePointer (callback);
+ TouchEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_touch_event_manager_register (vclosure* callback, HL_TouchEvent* eventObject) {
- // TouchEvent::callback = new AutoGCRoot (callback);
- // TouchEvent::eventObject = new AutoGCRoot (eventObject);
+ TouchEvent::callback = new ValuePointer (callback);
+ TouchEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -3548,16 +3545,16 @@ namespace lime {
void lime_window_event_manager_register (value callback, value eventObject) {
- WindowEvent::callback = new AutoGCRoot (callback);
- WindowEvent::eventObject = new AutoGCRoot (eventObject);
+ WindowEvent::callback = new ValuePointer (callback);
+ WindowEvent::eventObject = new ValuePointer (eventObject);
}
HL_PRIM void hl_lime_window_event_manager_register (vclosure* callback, HL_WindowEvent* eventObject) {
- // WindowEvent::callback = new AutoGCRoot (callback);
- // WindowEvent::eventObject = new AutoGCRoot (eventObject);
+ WindowEvent::callback = new ValuePointer (callback);
+ WindowEvent::eventObject = new ValuePointer ((vobj*)eventObject);
}
@@ -4152,52 +4149,183 @@ namespace lime {
#define _ENUM "?"
- // #define TCFFIPOINTER _ABSTRACT (HL_CFFIPointer)
- #define TCFFIPOINTER _DYN
- #define TBYTES _OBJ (_I32 _BYTES)
- #define TARRAYBUFFER TBYTES
- #define TARRAYBUFFERVIEW _OBJ (_I32 TARRAYBUFFER _I32 _I32 _I32 _I32)
- #define TIMAGEBUFFER _OBJ (_I32 TARRAYBUFFERVIEW _I32 _I32 _BOOL _BOOL _I32 _DYN _DYN _DYN _DYN _DYN _DYN)
- #define TRECTANGLE _OBJ (_F64 _F64 _F64 _F64)
- #define TIMAGE _OBJ (TIMAGEBUFFER _BOOL _I32 _I32 _I32 TRECTANGLE _ENUM _I32 _I32 _F64 _F64)
- // #define TNATIVE_APPLICATION _ABSTRACT (Application)
+ // #define _TCFFIPOINTER _ABSTRACT (HL_CFFIPointer)
+ #define _TAPPLICATION_EVENT _OBJ (_I32 _I32)
+ #define _TARRAYBUFFER _TBYTES
+ #define _TBYTES _OBJ (_I32 _BYTES)
+ #define _TCFFIPOINTER _DYN
+ #define _TCLIPBOARD_EVENT _OBJ (_I32)
+ #define _TDROP_EVENT _OBJ (_STRING _I32)
+ #define _TGAMEPAD_EVENT _OBJ (_I32 _I32 _I32 _I32 _F64)
+ #define _TJOYSTICK_EVENT _OBJ (_I32 _I32 _I32 _I32 _F64 _F64)
+ #define _TKEY_EVENT _OBJ (_I32 _I32 _I32 _I32)
+ #define _TMOUSE_EVENT _OBJ (_I32 _F64 _F64 _I32 _I32 _F64 _F64)
+ #define _TRECTANGLE _OBJ (_F64 _F64 _F64 _F64)
+ #define _TRENDER_EVENT _OBJ (_ENUM _I32)
+ #define _TSENSOR_EVENT _OBJ (_I32 _F64 _F64 _F64 _I32)
+ #define _TTEXT_EVENT _OBJ (_I32 _I32 _I32 _STRING _I32 _I32)
+ #define _TTOUCH_EVENT _OBJ (_I32 _F64 _F64 _I32 _F64 _I32 _F64 _F64)
+ #define _TWINDOW_EVENT _OBJ (_I32 _I32 _I32 _I32 _I32 _I32)
- DEFINE_HL_PRIM (TCFFIPOINTER, lime_application_create, _NO_ARG);
- // DEFINE_PRIME2v (lime_application_event_manager_register);
- DEFINE_HL_PRIM (_I32, lime_application_exec, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_application_init, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_application_quit, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_application_set_frame_rate, TCFFIPOINTER _F64);
- DEFINE_HL_PRIM (_BOOL, lime_application_update, TCFFIPOINTER);
+ #define _TARRAYBUFFERVIEW _OBJ (_I32 _TARRAYBUFFER _I32 _I32 _I32 _I32)
+ #define _TIMAGEBUFFER _OBJ (_I32 _TARRAYBUFFERVIEW _I32 _I32 _BOOL _BOOL _I32 _DYN _DYN _DYN _DYN _DYN _DYN)
+ #define _TIMAGE _OBJ (_TIMAGEBUFFER _BOOL _I32 _I32 _I32 _TRECTANGLE _ENUM _I32 _I32 _F64 _F64)
+
+
+ DEFINE_HL_PRIM (_TCFFIPOINTER, lime_application_create, _NO_ARG);
+ DEFINE_HL_PRIM (_VOID, lime_application_event_manager_register, _FUN(_VOID, _NO_ARG) _TAPPLICATION_EVENT);
+ DEFINE_HL_PRIM (_I32, lime_application_exec, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_application_init, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_application_quit, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_application_set_frame_rate, _TCFFIPOINTER _F64);
+ DEFINE_HL_PRIM (_BOOL, lime_application_update, _TCFFIPOINTER);
+ // DEFINE_PRIME2 (lime_audio_load);
+ // DEFINE_PRIME2 (lime_bytes_from_data_pointer);
+ // DEFINE_PRIME1 (lime_bytes_get_data_pointer);
+ // DEFINE_PRIME2 (lime_bytes_get_data_pointer_offset);
+ // DEFINE_PRIME2 (lime_bytes_read_file);
+ // DEFINE_PRIME1 (lime_cffi_get_native_pointer);
+ // DEFINE_PRIME1 (lime_cffi_set_finalizer);
+ DEFINE_HL_PRIM (_VOID, lime_clipboard_event_manager_register, _FUN(_VOID, _NO_ARG) _TCLIPBOARD_EVENT);
+ // DEFINE_PRIME0 (lime_clipboard_get_text);
+ // DEFINE_PRIME1v (lime_clipboard_set_text);
+ // DEFINE_PRIME2 (lime_data_pointer_offset);
+ // DEFINE_PRIME2 (lime_deflate_compress);
+ // DEFINE_PRIME2 (lime_deflate_decompress);
+ DEFINE_HL_PRIM (_VOID, lime_drop_event_manager_register, _FUN(_VOID, _NO_ARG) _TDROP_EVENT);
+ // DEFINE_PRIME3 (lime_file_dialog_open_directory);
+ // DEFINE_PRIME3 (lime_file_dialog_open_file);
+ // DEFINE_PRIME3 (lime_file_dialog_open_files);
+ // DEFINE_PRIME3 (lime_file_dialog_save_file);
+ // DEFINE_PRIME1 (lime_file_watcher_create);
+ // DEFINE_PRIME3 (lime_file_watcher_add_directory);
+ // DEFINE_PRIME2v (lime_file_watcher_remove_directory);
+ // DEFINE_PRIME1v (lime_file_watcher_update);
+ // DEFINE_PRIME1 (lime_font_get_ascender);
+ // DEFINE_PRIME1 (lime_font_get_descender);
+ // DEFINE_PRIME1 (lime_font_get_family_name);
+ // DEFINE_PRIME2 (lime_font_get_glyph_index);
+ // DEFINE_PRIME2 (lime_font_get_glyph_indices);
+ // DEFINE_PRIME2 (lime_font_get_glyph_metrics);
+ // DEFINE_PRIME1 (lime_font_get_height);
+ // DEFINE_PRIME1 (lime_font_get_num_glyphs);
+ // DEFINE_PRIME1 (lime_font_get_underline_position);
+ // DEFINE_PRIME1 (lime_font_get_underline_thickness);
+ // DEFINE_PRIME1 (lime_font_get_units_per_em);
+ // DEFINE_PRIME1 (lime_font_load);
+ // DEFINE_PRIME2 (lime_font_outline_decompose);
+ // DEFINE_PRIME3 (lime_font_render_glyph);
+ // DEFINE_PRIME3 (lime_font_render_glyphs);
+ // DEFINE_PRIME2v (lime_font_set_size);
DEFINE_HL_PRIM (_VOID, lime_gamepad_add_mappings, _DYN);
- DEFINE_HL_PRIM (_VOID, lime_image_data_util_fill_rect, TIMAGE TRECTANGLE _I32 _I32);
- DEFINE_HL_PRIM (TCFFIPOINTER, lime_renderer_create, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_renderer_flip, TCFFIPOINTER);
- DEFINE_HL_PRIM (_F64, lime_renderer_get_context, TCFFIPOINTER);
- DEFINE_HL_PRIM (_F64, lime_renderer_get_scale, TCFFIPOINTER);
- DEFINE_HL_PRIM (_BYTES, lime_renderer_get_type, TCFFIPOINTER);
- DEFINE_HL_PRIM (_DYN, lime_renderer_lock, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_renderer_make_current, TCFFIPOINTER);
- DEFINE_HL_PRIM (_DYN, lime_renderer_read_pixels, TCFFIPOINTER TRECTANGLE TIMAGEBUFFER);
- DEFINE_HL_PRIM (_VOID, lime_renderer_unlock, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_window_alert, TCFFIPOINTER _BYTES _BYTES);
- DEFINE_HL_PRIM (_VOID, lime_window_close, TCFFIPOINTER);
- DEFINE_HL_PRIM (TCFFIPOINTER, lime_window_create, TCFFIPOINTER _I32 _I32 _I32 _STRING);
- // DEFINE_PRIME2v (_VOID, lime_window_event_manager_register, TCFFIPOINTER );
- DEFINE_HL_PRIM (_VOID, lime_window_focus, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_display, TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_gamepad_event_manager_register, _FUN(_VOID, _NO_ARG) _TGAMEPAD_EVENT);
+ // DEFINE_PRIME1 (lime_gamepad_get_device_guid);
+ // DEFINE_PRIME1 (lime_gamepad_get_device_name);
+ // DEFINE_PRIME2 (lime_gzip_compress);
+ // DEFINE_PRIME2 (lime_gzip_decompress);
+ // DEFINE_PRIME2v (lime_haptic_vibrate);
+ // DEFINE_PRIME3v (lime_image_data_util_color_transform);
+ // DEFINE_PRIME6v (lime_image_data_util_copy_channel);
+ // DEFINE_PRIME7v (lime_image_data_util_copy_pixels);
+ DEFINE_HL_PRIM (_VOID, lime_image_data_util_fill_rect, _TIMAGE _TRECTANGLE _I32 _I32);
+ // DEFINE_PRIME5v (lime_image_data_util_flood_fill);
+ // DEFINE_PRIME4v (lime_image_data_util_get_pixels);
+ // DEFINE_PRIME8v (lime_image_data_util_merge);
+ // DEFINE_PRIME1v (lime_image_data_util_multiply_alpha);
+ // DEFINE_PRIME4v (lime_image_data_util_resize);
+ // DEFINE_PRIME2v (lime_image_data_util_set_format);
+ // DEFINE_PRIME6v (lime_image_data_util_set_pixels);
+ // DEFINE_PRIME12 (lime_image_data_util_threshold);
+ // DEFINE_PRIME1v (lime_image_data_util_unmultiply_alpha);
+ // DEFINE_PRIME4 (lime_image_encode);
+ // DEFINE_PRIME2 (lime_image_load);
+ // DEFINE_PRIME0 (lime_jni_getenv);
+ DEFINE_HL_PRIM (_VOID, lime_joystick_event_manager_register, _FUN(_VOID, _NO_ARG) _TJOYSTICK_EVENT);
+ // DEFINE_PRIME1 (lime_joystick_get_device_guid);
+ // DEFINE_PRIME1 (lime_joystick_get_device_name);
+ // DEFINE_PRIME1 (lime_joystick_get_num_axes);
+ // DEFINE_PRIME1 (lime_joystick_get_num_buttons);
+ // DEFINE_PRIME1 (lime_joystick_get_num_hats);
+ // DEFINE_PRIME1 (lime_joystick_get_num_trackballs);
+ // DEFINE_PRIME3 (lime_jpeg_decode_bytes);
+ // DEFINE_PRIME3 (lime_jpeg_decode_file);
+ // DEFINE_PRIME1 (lime_key_code_from_scan_code);
+ // DEFINE_PRIME1 (lime_key_code_to_scan_code);
+ DEFINE_HL_PRIM (_VOID, lime_key_event_manager_register, _FUN (_VOID, _NO_ARG) _TKEY_EVENT);
+ // DEFINE_PRIME0 (lime_locale_get_system_locale);
+ // DEFINE_PRIME2 (lime_lzma_compress);
+ // DEFINE_PRIME2 (lime_lzma_decompress);
+ DEFINE_HL_PRIM (_VOID, lime_mouse_event_manager_register, _FUN (_VOID, _NO_ARG) _TMOUSE_EVENT);
+ // DEFINE_PRIME0v (lime_mouse_hide);
+ // DEFINE_PRIME1v (lime_mouse_set_cursor);
+ // DEFINE_PRIME1v (lime_mouse_set_lock);
+ // DEFINE_PRIME0v (lime_mouse_show);
+ // DEFINE_PRIME3v (lime_mouse_warp);
+ // DEFINE_PRIME1v (lime_neko_execute);
+ // DEFINE_PRIME3 (lime_png_decode_bytes);
+ // DEFINE_PRIME3 (lime_png_decode_file);
+ DEFINE_HL_PRIM (_TCFFIPOINTER, lime_renderer_create, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_renderer_flip, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_F64, lime_renderer_get_context, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_F64, lime_renderer_get_scale, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_BYTES, lime_renderer_get_type, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_DYN, lime_renderer_lock, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_renderer_make_current, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_DYN, lime_renderer_read_pixels, _TCFFIPOINTER _TRECTANGLE _TIMAGEBUFFER);
+ DEFINE_HL_PRIM (_VOID, lime_renderer_unlock, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_render_event_manager_register, _FUN (_VOID, _NO_ARG) _TRENDER_EVENT);
+ DEFINE_HL_PRIM (_VOID, lime_sensor_event_manager_register, _FUN (_VOID, _NO_ARG) _TSENSOR_EVENT);
+ // DEFINE_PRIME2v (lime_render_event_manager_register);
+ // DEFINE_PRIME2v (lime_sensor_event_manager_register);
+ // DEFINE_PRIME0 (lime_system_get_allow_screen_timeout);
+ // DEFINE_PRIME0 (lime_system_get_device_model);
+ // DEFINE_PRIME0 (lime_system_get_device_vendor);
+ // DEFINE_PRIME3 (lime_system_get_directory);
+ // DEFINE_PRIME1 (lime_system_get_display);
+ // DEFINE_PRIME0 (lime_system_get_ios_tablet);
+ // DEFINE_PRIME0 (lime_system_get_num_displays);
+ // DEFINE_PRIME0 (lime_system_get_platform_label);
+ // DEFINE_PRIME0 (lime_system_get_platform_name);
+ // DEFINE_PRIME0 (lime_system_get_platform_version);
+ // DEFINE_PRIME0 (lime_system_get_timer);
+ // DEFINE_PRIME1 (lime_system_get_windows_console_mode);
+ // DEFINE_PRIME1v (lime_system_open_file);
+ // DEFINE_PRIME2v (lime_system_open_url);
+ // DEFINE_PRIME1 (lime_system_set_allow_screen_timeout);
+ // DEFINE_PRIME2 (lime_system_set_windows_console_mode);
+ DEFINE_HL_PRIM (_VOID, lime_text_event_manager_register, _FUN (_VOID, _NO_ARG) _TTEXT_EVENT);
+ // DEFINE_PRIME3 (lime_text_layout_create);
+ // DEFINE_PRIME5 (lime_text_layout_position);
+ // DEFINE_PRIME2v (lime_text_layout_set_direction);
+ // DEFINE_PRIME2v (lime_text_layout_set_language);
+ // DEFINE_PRIME2v (lime_text_layout_set_script);
+ DEFINE_HL_PRIM (_VOID, lime_touch_event_manager_register, _FUN (_VOID, _NO_ARG) _TTOUCH_EVENT);
+ DEFINE_HL_PRIM (_VOID, lime_window_alert, _TCFFIPOINTER _BYTES _BYTES);
+ DEFINE_HL_PRIM (_VOID, lime_window_close, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_TCFFIPOINTER, lime_window_create, _TCFFIPOINTER _I32 _I32 _I32 _STRING);
+ DEFINE_HL_PRIM (_VOID, lime_window_event_manager_register, _FUN (_VOID, _NO_ARG) _TWINDOW_EVENT);
+ DEFINE_HL_PRIM (_VOID, lime_window_focus, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_display, _TCFFIPOINTER);
// DEFINE_PRIME1 (lime_window_get_display_mode);
- DEFINE_HL_PRIM (_BOOL, lime_window_get_enable_text_events, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_height, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_id, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_width, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_x, TCFFIPOINTER);
- DEFINE_HL_PRIM (_I32, lime_window_get_y, TCFFIPOINTER);
- DEFINE_HL_PRIM (_VOID, lime_window_move, TCFFIPOINTER _I32);
- DEFINE_HL_PRIM (_VOID, lime_window_resize, TCFFIPOINTER _I32);
- DEFINE_HL_PRIM (_BOOL, lime_window_set_borderless, TCFFIPOINTER _BOOL);
- // DEFINE_PRIME2 (lime_window_set_display_mode, TCFFIPOINTER );
- DEFINE_HL_PRIM (_VOID, lime_window_set_enable_text_events, TCFFIPOINTER _BOOL);
+ DEFINE_HL_PRIM (_BOOL, lime_window_get_enable_text_events, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_height, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_id, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_width, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_x, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_I32, lime_window_get_y, _TCFFIPOINTER);
+ DEFINE_HL_PRIM (_VOID, lime_window_move, _TCFFIPOINTER _I32);
+ DEFINE_HL_PRIM (_VOID, lime_window_resize, _TCFFIPOINTER _I32);
+ DEFINE_HL_PRIM (_BOOL, lime_window_set_borderless, _TCFFIPOINTER _BOOL);
+ // DEFINE_PRIME2 (lime_window_set_display_mode, _TCFFIPOINTER );
+ DEFINE_HL_PRIM (_VOID, lime_window_set_enable_text_events, _TCFFIPOINTER _BOOL);
+ // DEFINE_PRIME2 (lime_window_set_fullscreen);
+ // DEFINE_PRIME2v (lime_window_set_icon);
+ // DEFINE_PRIME2 (lime_window_set_maximized);
+ // DEFINE_PRIME2 (lime_window_set_minimized);
+ // DEFINE_PRIME2 (lime_window_set_resizable);
+ // DEFINE_PRIME2 (lime_window_set_title);
+ // DEFINE_PRIME2 (lime_zlib_compress);
+ // DEFINE_PRIME2 (lime_zlib_decompress);
}
diff --git a/project/src/app/ApplicationEvent.cpp b/project/src/app/ApplicationEvent.cpp
index 1eacd0dd4..200b9049e 100644
--- a/project/src/app/ApplicationEvent.cpp
+++ b/project/src/app/ApplicationEvent.cpp
@@ -5,8 +5,8 @@
namespace lime {
- AutoGCRoot* ApplicationEvent::callback = 0;
- AutoGCRoot* ApplicationEvent::eventObject = 0;
+ ValuePointer* ApplicationEvent::callback = 0;
+ ValuePointer* ApplicationEvent::eventObject = 0;
static int id_deltaTime;
static int id_type;
@@ -25,20 +25,31 @@ namespace lime {
if (ApplicationEvent::callback) {
- if (!init) {
+ if (ApplicationEvent::eventObject->IsCFFIValue ()) {
- id_deltaTime = val_id ("deltaTime");
- id_type = val_id ("type");
- init = true;
+ if (!init) {
+
+ id_deltaTime = val_id ("deltaTime");
+ id_type = val_id ("type");
+ init = true;
+
+ }
+
+ value object = (value)ApplicationEvent::eventObject->Get ();
+
+ alloc_field (object, id_deltaTime, alloc_int (event->deltaTime));
+ alloc_field (object, id_type, alloc_int (event->type));
+
+ } else {
+
+ HL_ApplicationEvent* eventObject = (HL_ApplicationEvent*)ApplicationEvent::eventObject->Get ();
+
+ eventObject->deltaTime = event->deltaTime;
+ eventObject->type = event->type;
}
- value object = (ApplicationEvent::eventObject ? ApplicationEvent::eventObject->get () : alloc_empty_object ());
-
- alloc_field (object, id_deltaTime, alloc_int (event->deltaTime));
- alloc_field (object, id_type, alloc_int (event->type));
-
- val_call0 (ApplicationEvent::callback->get ());
+ ApplicationEvent::callback->Call ();
}
diff --git a/project/src/backend/sdl/SDLApplication.cpp b/project/src/backend/sdl/SDLApplication.cpp
index 35a0e739d..2d8090c5d 100644
--- a/project/src/backend/sdl/SDLApplication.cpp
+++ b/project/src/backend/sdl/SDLApplication.cpp
@@ -17,7 +17,6 @@ namespace lime {
AutoGCRoot* Application::callback = 0;
SDLApplication* SDLApplication::currentApplication = 0;
-
const int analogAxisDeadZone = 1000;
std::map > gamepadsAxisMap;
bool inBackground = false;
diff --git a/project/src/backend/sdl/SDLRenderer.cpp b/project/src/backend/sdl/SDLRenderer.cpp
index 47351b37d..5a9bd6d54 100644
--- a/project/src/backend/sdl/SDLRenderer.cpp
+++ b/project/src/backend/sdl/SDLRenderer.cpp
@@ -191,7 +191,7 @@ namespace lime {
}
- value SDLRenderer::Lock () {
+ void* SDLRenderer::Lock (bool useCFFIValue) {
if (sdlRenderer) {
@@ -212,25 +212,52 @@ namespace lime {
}
- value result = alloc_empty_object ();
-
void *pixels;
int pitch;
- if (SDL_LockTexture (sdlTexture, NULL, &pixels, &pitch) == 0) {
+ if (useCFFIValue) {
- alloc_field (result, val_id ("width"), alloc_int (width));
- alloc_field (result, val_id ("height"), alloc_int (height));
- alloc_field (result, val_id ("pixels"), alloc_float ((uintptr_t)pixels));
- alloc_field (result, val_id ("pitch"), alloc_int (pitch));
+ value result = alloc_empty_object ();
+
+ if (SDL_LockTexture (sdlTexture, NULL, &pixels, &pitch) == 0) {
+
+ alloc_field (result, val_id ("width"), alloc_int (width));
+ alloc_field (result, val_id ("height"), alloc_int (height));
+ alloc_field (result, val_id ("pixels"), alloc_float ((uintptr_t)pixels));
+ alloc_field (result, val_id ("pitch"), alloc_int (pitch));
+
+ }
+
+ return result;
+
+ } else {
+
+ vdynamic* result = (vdynamic*)hl_alloc_dynobj ();
+
+ if (SDL_LockTexture (sdlTexture, NULL, &pixels, &pitch) == 0) {
+
+ hl_dyn_seti (result, hl_hash_utf8 ("width"), &hlt_i32, width);
+ hl_dyn_seti (result, hl_hash_utf8 ("height"), &hlt_i32, height);
+ hl_dyn_setd (result, hl_hash_utf8 ("pixels"), (uintptr_t)pixels);
+ hl_dyn_seti (result, hl_hash_utf8 ("pitch"), &hlt_i32, pitch);
+
+ }
+
+ return result;
}
- return result;
-
} else {
- return alloc_null ();
+ if (useCFFIValue) {
+
+ return alloc_null ();
+
+ } else {
+
+ return 0;
+
+ }
}
diff --git a/project/src/backend/sdl/SDLRenderer.h b/project/src/backend/sdl/SDLRenderer.h
index 735bdc916..b94dbd459 100644
--- a/project/src/backend/sdl/SDLRenderer.h
+++ b/project/src/backend/sdl/SDLRenderer.h
@@ -19,7 +19,7 @@ namespace lime {
virtual void Flip ();
virtual void* GetContext ();
virtual double GetScale ();
- virtual value Lock ();
+ virtual void* Lock (bool useCFFIValue);
virtual void MakeCurrent ();
virtual void ReadPixels (ImageBuffer *buffer, Rectangle *rect);
virtual const char* Type ();
diff --git a/project/src/graphics/RenderEvent.cpp b/project/src/graphics/RenderEvent.cpp
index 37d42a59a..2658ae9fc 100644
--- a/project/src/graphics/RenderEvent.cpp
+++ b/project/src/graphics/RenderEvent.cpp
@@ -5,11 +5,11 @@
namespace lime {
- AutoGCRoot* RenderEvent::callback = 0;
- AutoGCRoot* RenderEvent::eventObject = 0;
+ ValuePointer* RenderEvent::callback = 0;
+ ValuePointer* RenderEvent::eventObject = 0;
- //static int id_type;
- //static bool init = false;
+ static int id_type;
+ static bool init = false;
RenderEvent::RenderEvent () {
@@ -23,17 +23,27 @@ namespace lime {
if (RenderEvent::callback) {
- //if (!init) {
+ if (RenderEvent::eventObject->IsCFFIValue ()) {
- //id_type = val_id ("type");
+ if (!init) {
+
+ id_type = val_id ("type");
+
+ }
- //}
+ value object = (value)RenderEvent::eventObject->Get ();
+
+ alloc_field (object, id_type, alloc_int (event->type));
+
+ } else {
+
+ HL_RenderEvent* eventObject = (HL_RenderEvent*)RenderEvent::eventObject->Get ();
+
+ eventObject->type = event->type;
+
+ }
- value object = (RenderEvent::eventObject ? RenderEvent::eventObject->get () : alloc_empty_object ());
-
- //alloc_field (object, id_type, alloc_int (event->type));
-
- val_call0 (RenderEvent::callback->get ());
+ RenderEvent::callback->Call ();
}
diff --git a/project/src/graphics/cairo/CairoBindings.cpp b/project/src/graphics/cairo/CairoBindings.cpp
index 65e6445f2..f14f68887 100644
--- a/project/src/graphics/cairo/CairoBindings.cpp
+++ b/project/src/graphics/cairo/CairoBindings.cpp
@@ -1,3 +1,6 @@
+#define HL_NAME(n) hl_##n
+#include
+
#include
#include
#include