Merge branch '8.1.0-Dev' into 8.2.0-Dev
This commit is contained in:
@@ -61,6 +61,7 @@ namespace lime {
|
||||
virtual void SetTextInputEnabled (bool enable) = 0;
|
||||
virtual void SetTextInputRect (Rectangle *rect) = 0;
|
||||
virtual const char* SetTitle (const char* title) = 0;
|
||||
virtual bool SetVisible (bool visible) = 0;
|
||||
virtual void WarpMouse (int x, int y) = 0;
|
||||
|
||||
Application* currentApplication;
|
||||
|
||||
@@ -3761,6 +3761,22 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
bool lime_window_set_visible (value window, bool visible) {
|
||||
|
||||
Window* targetWindow = (Window*)val_data (window);
|
||||
return targetWindow->SetVisible (visible);
|
||||
|
||||
}
|
||||
|
||||
|
||||
HL_PRIM bool HL_NAME(hl_window_set_visible) (HL_CFFIPointer* window, bool visible) {
|
||||
|
||||
Window* targetWindow = (Window*)window->ptr;
|
||||
return targetWindow->SetVisible (visible);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void lime_window_warp_mouse (value window, int x, int y) {
|
||||
|
||||
Window* targetWindow = (Window*)val_data (window);
|
||||
@@ -3982,6 +3998,7 @@ namespace lime {
|
||||
DEFINE_PRIME2v (lime_window_set_text_input_enabled);
|
||||
DEFINE_PRIME2v (lime_window_set_text_input_rect);
|
||||
DEFINE_PRIME2 (lime_window_set_title);
|
||||
DEFINE_PRIME2 (lime_window_set_visible);
|
||||
DEFINE_PRIME3v (lime_window_warp_mouse);
|
||||
DEFINE_PRIME1 (lime_window_get_opacity);
|
||||
DEFINE_PRIME2v (lime_window_set_opacity);
|
||||
@@ -4168,6 +4185,7 @@ namespace lime {
|
||||
DEFINE_HL_PRIM (_VOID, hl_window_set_text_input_enabled, _TCFFIPOINTER _BOOL);
|
||||
DEFINE_HL_PRIM (_VOID, hl_window_set_text_input_rect, _TCFFIPOINTER _TRECTANGLE);
|
||||
DEFINE_HL_PRIM (_STRING, hl_window_set_title, _TCFFIPOINTER _STRING);
|
||||
DEFINE_HL_PRIM (_BOOL, hl_window_set_visible, _TCFFIPOINTER _BOOL);
|
||||
DEFINE_HL_PRIM (_VOID, hl_window_warp_mouse, _TCFFIPOINTER _I32 _I32);
|
||||
DEFINE_HL_PRIM (_F64, hl_window_get_opacity, _TCFFIPOINTER);
|
||||
DEFINE_HL_PRIM (_VOID, hl_window_set_opacity, _TCFFIPOINTER _F64);
|
||||
|
||||
@@ -358,6 +358,23 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
bool SDLWindow::SetVisible (bool visible) {
|
||||
|
||||
if (visible) {
|
||||
|
||||
SDL_ShowWindow (sdlWindow);
|
||||
|
||||
} else {
|
||||
|
||||
SDL_HideWindow (sdlWindow);
|
||||
|
||||
}
|
||||
|
||||
return (SDL_GetWindowFlags (sdlWindow) & SDL_WINDOW_SHOWN);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SDLWindow::ContextFlip () {
|
||||
|
||||
if (context && !sdlRenderer) {
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace lime {
|
||||
virtual void SetTextInputEnabled (bool enabled);
|
||||
virtual void SetTextInputRect (Rectangle *rect);
|
||||
virtual const char* SetTitle (const char* title);
|
||||
virtual bool SetVisible (bool visible);
|
||||
virtual void WarpMouse (int x, int y);
|
||||
SDL_Renderer* sdlRenderer;
|
||||
SDL_Texture* sdlTexture;
|
||||
|
||||
@@ -640,5 +640,10 @@ class FlashWindow
|
||||
return value;
|
||||
}
|
||||
|
||||
public function setVisible(value:Bool):Bool
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public function warpMouse(x:Int, y:Int):Void {}
|
||||
}
|
||||
|
||||
@@ -1231,6 +1231,11 @@ class HTML5Window
|
||||
return value;
|
||||
}
|
||||
|
||||
public function setVisible(value:Bool):Bool
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
private function updateSize():Void
|
||||
{
|
||||
if (!parent.__resizable) return;
|
||||
|
||||
@@ -349,6 +349,8 @@ class NativeCFFI
|
||||
|
||||
@:cffi private static function lime_window_set_title(handle:Dynamic, title:String):Dynamic;
|
||||
|
||||
@:cffi private static function lime_window_set_visible(handle:Dynamic, visible:Bool):Bool;
|
||||
|
||||
@:cffi private static function lime_window_warp_mouse(handle:Dynamic, x:Int, y:Int):Void;
|
||||
|
||||
@:cffi private static function lime_window_event_manager_register(callback:Dynamic, eventObject:Dynamic):Void;
|
||||
@@ -606,6 +608,8 @@ class NativeCFFI
|
||||
"lime_window_set_text_input_rect", "oov", false));
|
||||
private static var lime_window_set_title = new cpp.Callable<cpp.Object->String->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_window_set_title", "oso",
|
||||
false));
|
||||
private static var lime_window_set_visible = new cpp.Callable<cpp.Object->Bool->Bool>(cpp.Prime._loadPrime("lime", "lime_window_set_visible", "obb",
|
||||
false));
|
||||
private static var lime_window_warp_mouse = new cpp.Callable<cpp.Object->Int->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_window_warp_mouse",
|
||||
"oiiv", false));
|
||||
private static var lime_window_event_manager_register = new cpp.Callable<cpp.Object->cpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime",
|
||||
@@ -762,6 +766,7 @@ class NativeCFFI
|
||||
private static var lime_window_set_text_input_enabled = CFFI.load("lime", "lime_window_set_text_input_enabled", 2);
|
||||
private static var lime_window_set_text_input_rect = CFFI.load("lime", "lime_window_set_text_input_rect", 2);
|
||||
private static var lime_window_set_title = CFFI.load("lime", "lime_window_set_title", 2);
|
||||
private static var lime_window_set_visible = CFFI.load("lime", "lime_window_set_visible", 2);
|
||||
private static var lime_window_warp_mouse = CFFI.load("lime", "lime_window_warp_mouse", 3);
|
||||
private static var lime_window_event_manager_register = CFFI.load("lime", "lime_window_event_manager_register", 2);
|
||||
private static var lime_zlib_compress = CFFI.load("lime", "lime_zlib_compress", 2);
|
||||
@@ -1364,6 +1369,11 @@ class NativeCFFI
|
||||
return null;
|
||||
}
|
||||
|
||||
@:hlNative("lime", "hl_window_set_visible") private static function lime_window_set_visible(handle:CFFIPointer, visible:Bool):Bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@:hlNative("lime", "hl_window_warp_mouse") private static function lime_window_warp_mouse(handle:CFFIPointer, x:Int, y:Int):Void {}
|
||||
|
||||
@:hlNative("lime", "hl_window_get_opacity") private static function lime_window_get_opacity(handle:CFFIPointer):Float { return 0.0; }
|
||||
|
||||
@@ -679,6 +679,18 @@ class NativeWindow
|
||||
return value;
|
||||
}
|
||||
|
||||
public function setVisible(value:Bool):Bool
|
||||
{
|
||||
if (handle != null)
|
||||
{
|
||||
#if (!macro && lime_cffi)
|
||||
NativeCFFI.lime_window_set_visible(handle, value);
|
||||
#end
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public function warpMouse(x:Int, y:Int):Void
|
||||
{
|
||||
#if (!macro && lime_cffi)
|
||||
|
||||
@@ -89,6 +89,7 @@ class Window
|
||||
#end
|
||||
public var textInputEnabled(get, set):Bool;
|
||||
public var title(get, set):String;
|
||||
public var visible(get, set):Bool;
|
||||
public var width(get, set):Int;
|
||||
public var x(get, set):Int;
|
||||
public var y(get, set):Int;
|
||||
@@ -109,6 +110,7 @@ class Window
|
||||
@:noCompletion private var __resizable:Bool;
|
||||
@:noCompletion private var __scale:Float;
|
||||
@:noCompletion private var __title:String;
|
||||
@:noCompletion private var __visible:Bool;
|
||||
@:noCompletion private var __width:Int;
|
||||
@:noCompletion private var __x:Int;
|
||||
@:noCompletion private var __y:Int;
|
||||
@@ -133,6 +135,7 @@ class Window
|
||||
"scale": {get: p.get_scale},
|
||||
"textInputEnabled": {get: p.get_textInputEnabled, set: p.set_textInputEnabled},
|
||||
"title": {get: p.get_title, set: p.set_title},
|
||||
"visible": {get: p.get_visible, set: p.set_visible},
|
||||
"width": {get: p.get_width, set: p.set_width},
|
||||
"x": {get: p.get_x, set: p.set_y},
|
||||
"y": {get: p.get_x, set: p.set_y}
|
||||
@@ -153,7 +156,7 @@ class Window
|
||||
__scale = 1;
|
||||
__x = 0;
|
||||
__y = 0;
|
||||
__title = "";
|
||||
__title = Reflect.hasField(__attributes, "title") ? __attributes.title : "";
|
||||
id = -1;
|
||||
|
||||
__backend = new WindowBackend(this);
|
||||
@@ -576,6 +579,17 @@ class Window
|
||||
return __title = __backend.setTitle(value);
|
||||
}
|
||||
|
||||
@:noCompletion private inline function get_visible():Bool
|
||||
{
|
||||
return __visible;
|
||||
}
|
||||
|
||||
@:noCompletion private function set_visible(value:Bool):Bool
|
||||
{
|
||||
__visible = __backend.setVisible(value);
|
||||
return __visible;
|
||||
}
|
||||
|
||||
@:noCompletion private inline function get_width():Int
|
||||
{
|
||||
return __width;
|
||||
|
||||
@@ -90,11 +90,11 @@ import ::APP_MAIN::;
|
||||
|
||||
app.createWindow(attributes);
|
||||
::end::
|
||||
#elseif !air
|
||||
|
||||
#elseif air
|
||||
app.window.title = "::meta.title::";
|
||||
#else
|
||||
app.window.context.attributes.background = ::WIN_BACKGROUND::;
|
||||
app.window.frameRate = ::WIN_FPS::;
|
||||
|
||||
#end
|
||||
#end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user