CFFI string work

This commit is contained in:
Joshua Granick
2019-03-14 13:27:54 -07:00
parent 3b9ca3a770
commit 9803ca9bf6
11 changed files with 99 additions and 23 deletions

View File

@@ -220,7 +220,11 @@ private class ClipboardEventInfo
private class DropEventInfo
{
#if hl
public var file:hl.Bytes;
#else
public var file:String;
#end
public var type:DropEventType;
public function new(type:DropEventType = null, file:String = null)
@@ -427,7 +431,11 @@ private class TextEventInfo
public var id:Int;
public var length:Int;
public var start:Int;
#if hl
public var text:hl.Bytes;
#else
public var text:String;
#end
public var type:TextEventType;
public var windowID:Int;

View File

@@ -2070,6 +2070,7 @@ class NativeOpenGLRenderContext
var result = NativeCFFI.lime_gl_get_string(name);
#if hl
var result = @:privateAccess String.fromUTF8(result);
trace (result);
#end
return result;
#else

View File

@@ -471,7 +471,11 @@ class Font
{
if (name == null)
{
#if hl
name = @:privateAccess String.fromUCS2(NativeCFFI.lime_font_get_family_name(src));
#else
name = cast NativeCFFI.lime_font_get_family_name(src);
#end
}
ascender = NativeCFFI.lime_font_get_ascender(src);