package beluga.core;
import haxe.xml.Fast;

/**
 * ...
 * @author Masadow
 */
class Trigger
{
	public var action(default, null) : String;

	private var routes : Array<CallbackTrigger>;

	public function new(trigger : Fast)
	{
		//Retrieve trigger event
		action = trigger.att.name;

		//Get all callback
		routes = new Array<CallbackTrigger>();
		for (route in trigger.nodes.route) {
			routes.push(new CallbackTrigger(route.att.resolve("class"), route.att.method, route.att.access == "static"));
		}
	}

	public function trigger(params : Dynamic = {}) {
		for (route in routes) {
			route.call(params);
		}
	}

}

private class CallbackTrigger {

	private var clazz : String;
	private var method : String;
	private var isStatic : Bool;

	public function new(clazz : String, method : String, isStatic : Bool) {
		this.clazz = clazz;
		this.method = method;
		this.isStatic = isStatic;
	}

	//Support static call only
	public function call() {
		if (isStatic) {
			var classType = Type.resolveClass(clazz);
			Reflect.callMethod(classType, method, []);
		}
//		trace(clazz);
	}
}

Add params in call method

package beluga.core;
import haxe.xml.Fast;

/**
 * ...
 * @author Masadow
 */
class Trigger
{
	public var action(default, null) : String;

	private var routes : Array<CallbackTrigger>;

	public function new(trigger : Fast)
	{
		//Retrieve trigger event
		action = trigger.att.name;

		//Get all callback
		routes = new Array<CallbackTrigger>();
		for (route in trigger.nodes.route) {
			routes.push(new CallbackTrigger(route.att.resolve("class"), route.att.method, route.att.access == "static"));
		}
	}

	public function trigger(params : Dynamic = {}) {
		for (route in routes) {
			route.call(params);
		}
	}

}

private class CallbackTrigger {

	private var clazz : String;
	private var method : String;
	private var isStatic : Bool;

	public function new(clazz : String, method : String, isStatic : Bool) {
		this.clazz = clazz;
		this.method = method;
		this.isStatic = isStatic;
	}

	//Support static call only
	public function call(params : Dynamic = {}) {
		if (isStatic) {
			var classType = Type.resolveClass(clazz);

			Reflect.callMethod(classType, method, [params]);
		}
	}
}


package ufront.web.result;

import dtx.DOMCollection;
import thx.error.NullArgument;
import ufront.web.context.ActionContext;
import dtx.widget.Widget;
import dtx.IDetoxLayout;
using Detox;

/** Represents a class that is used to send JSON-formatted content to the response. */
class DetoxResult<W:DOMCollection> extends ActionResult
{
	public var content : W;
	public var title : Null<String>;
	public var layout : Null<IDetoxLayout>;

	public function new( content:W, ?title:String, ?layout:IDetoxLayout ) {
		NullArgument.throwIfNull(content);
		this.content = content;
		this.title = title;
		this.layout = layout;
	}

	override function executeResult( actionContext:ActionContext ) {
		NullArgument.throwIfNull(actionContext);

		// If layout is null, get a default one...
		if (layout==null) layout = getDefaultLayout();

		layout.contentContainer.empty().append( content );
		if (title!=null) layout.title = title;

		actionContext.response.contentType = "text/html";
		actionContext.response.write( '<!DOCTYPE html>' + layout.document.html() );
	}

	// TODO: move somewhere else?
	public static var defaultLayout:IDetoxLayout;
	static function getDefaultLayout() {
		if (defaultLayout==null) defaultLayout = new DefaultDetoxLayout();
		return defaultLayout;
	}

}

Update to DetoxLayout to keep up with detox library

package ufront.web.result;

import dtx.DOMCollection;
import thx.error.NullArgument;
import ufront.web.context.ActionContext;
import dtx.widget.Widget;
import dtx.layout.IDetoxLayout;
using Detox;

/** Represents a class that is used to send JSON-formatted content to the response. */
class DetoxResult<W:DOMCollection> extends ActionResult
{
	public var content : W;
	public var title : Null<String>;
	public var layout : Null<IDetoxLayout>;

	public function new( content:W, ?title:String, ?layout:IDetoxLayout ) {
		NullArgument.throwIfNull(content);
		this.content = content;
		this.title = title;
		this.layout = layout;
	}

	override function executeResult( actionContext:ActionContext ) {
		NullArgument.throwIfNull(actionContext);

		// If layout is null, get a default one...
		if (layout==null) layout = getDefaultLayout();

		layout.contentContainer.empty().append( content );
		if (title!=null) layout.title = title;

		actionContext.response.contentType = "text/html";
		actionContext.response.write( '<!DOCTYPE html>' + layout.document.html() );
	}

	// TODO: move somewhere else?
	public static var defaultLayout:IDetoxLayout;
	static function getDefaultLayout() {
		if (defaultLayout==null) defaultLayout = new DefaultDetoxLayout();
		return defaultLayout;
	}

}


package qx.ui.core;

extern class Widget extends LayoutItem
{
    public function setVisibility(v:String):Void;
    public function setDecorator(v:String):Void;

    public function setAppearance(v:String):String;
    public function updateAppearance():Void;

    public function show():Void;
    public function hide():Void;
    public function isVisible():Bool;

    public function focus():Void;
    public function blur():Void;
}

Add theming methods to Qooxdoo bindings.

package qx.ui.core;

extern class Widget extends LayoutItem
{
    public function setVisibility(v:String):Void;

    public function getDecorator():Dynamic;
    public function setDecorator(v:Dynamic):Void;
    public function resetDecorator():Void;

    public function getAppearance():String;
    public function setAppearance(v:String):String;
    public function updateAppearance():Void;

    public function getBackgroundColor():Dynamic;
    public function setBackgroundColor(value:Dynamic):Void;

    public function syncWidget():Void;

    public function show():Void;
    public function hide():Void;
    public function isVisible():Bool;

    public function focus():Void;
    public function blur():Void;
}


package ue4hx.internal.buf;

class CppWriter extends BaseWriter {

  public function new(path) {
    super(path);
  }

  override private function getContents(module:String):String {
    var bufContents = this.buf.toString();
    if (bufContents == '')
      return null;
    var cpp = new HelperBuf() <<
      '#include <$module.h>\n#include "Engine.h"\n';
    getIncludes(cpp);

    // unfortunately there's no clean way to deal with deprecated functions for now; there's no
    // way to detect them through UHT, so for now we'll just disable them
    cpp << '#ifdef __clang__\n#pragma clang diagnostic push\n' +
      '#pragma clang diagnostic ignored "-Wdeprecated-declarations"\n' +
      '#endif\n';

    cpp << '\n' <<
      bufContents;

    cpp << '#ifdef __clang__\n#pragma clang diagnostic pop\n' +
      '#endif\n';

    return cpp.toString();
  }
}

Disable deprecation warnings on msvc as well

package ue4hx.internal.buf;

class CppWriter extends BaseWriter {

  public function new(path) {
    super(path);
  }

  override private function getContents(module:String):String {
    var bufContents = this.buf.toString();
    if (bufContents == '')
      return null;
    var cpp = new HelperBuf() <<
      '#include <$module.h>\n#include "Engine.h"\n';
    getIncludes(cpp);

    // unfortunately there's no clean way to deal with deprecated functions for now; there's no
    // way to detect them through UHT, so for now we'll just disable them
    cpp << '#ifdef __clang__\n#pragma clang diagnostic push\n' +
      '#pragma clang diagnostic ignored "-Wdeprecated-declarations"\n' +
      '#endif\n';
    cpp << '#ifdef _MSVC_VER\n#pragma warning( disable : 4996 )\n#endif\n';

    cpp << '\n' <<
      bufContents;

    cpp << '#ifdef __clang__\n#pragma clang diagnostic pop\n' +
      '#endif\n';
    cpp << '#ifdef _MSVC_VER\n#pragma warning( default : 4996 )\n#endif\n';

    return cpp.toString();
  }
}


package jive;

import org.aswing.AsWingManager;
import openfl.Lib;

class Jive {
	public static function init() {
		AsWingManager.initAsStandard(Lib.current, false);
	}

	public static var useMobileTheme(get, null): Bool;
	private static function get_useMobileTheme(): Bool {
		#if (jive_pseudo_mobile || ios || android)
		return true;
		#else
		return false;
		#end
	}

	public static var dpi(get, null): Float;
	private static function get_dpi(): Float {
		return lime.system.System.getDisplay(0).dpi;
	}

	public static var scale(get, null): Float;
	private static function get_scale(): Float {
		#if jive_pseudo_mobile
		return 1.0;
		#elseif mobile
		return dpi / 163;
		#else
		return dpi / 123;
		#end
	}

	public static function toPixelSize(v: Int): Int {
		return Std.int(v * scale);
	}

	public static var atom(get, null): Int;
	private static function get_atom(): Int {
		return Std.int(15 * scale);
	}
}

Throw exception if display is called bu not inited

package jive;

import org.aswing.AsWingManager;
import openfl.Lib;

class Jive {
	public static function init() {
		AsWingManager.initAsStandard(Lib.current, false);
	}

	public static var useMobileTheme(get, null): Bool;
	private static function get_useMobileTheme(): Bool {
		#if (jive_pseudo_mobile || ios || android)
		return true;
		#else
		return false;
		#end
	}

	public static var dpi(get, null): Float;
	private static function get_dpi(): Float {
		var display = lime.system.System.getDisplay(0);
		if (null == display) {
			throw "Jive.dpi is called before putting the app on a display.";
		}
		return display.dpi;
	}

	public static var scale(get, null): Float;
	private static function get_scale(): Float {
		#if jive_pseudo_mobile
		return 1.0;
		#elseif mobile
		return dpi / 163;
		#else
		return dpi / 123;
		#end
	}

	public static function toPixelSize(v: Int): Int {
		return Std.int(v * scale);
	}

	public static var atom(get, null): Int;
	private static function get_atom(): Int {
		return Std.int(15 * scale);
	}
}


package unreal;

@:hasEquals
extern class FPrimaryAssetType_Extra {
	@:uname(".ctor") public static function create(InName:FName):FPrimaryAssetType;

	@:thisConst
	public function ToString() : FString;

  @:expr(return ToString().toString())
  public function toString():String;
}

Update to latest perforce change

package unreal;

@:hasEquals
extern class FPrimaryAssetType_Extra {
	@:uname(".ctor") public static function create(InName:FName):FPrimaryAssetType;

	@:thisConst
	public function ToString() : FString;

	@:thisConst
	public function IsValid():Bool;

  @:expr(return ToString().toString())
  public function toString():String;
}


package unreal.onlinesubsystem;

import unreal.*;

@:glueCppIncludes("OnlineSubsystem.h") @:umodule("OnlineSubsystem")
@:uname("IOnlineSubsystem")
@:noCopy
@:uextern extern class IOnlineSubsystem {
  public static function Get(subsystemName:FName) : unreal.PPtr<IOnlineSubsystem>;

  public function GetAchievementsInterface() : unreal.TThreadSafeSharedPtr<IOnlineAchievements>;
  public function GetLeaderboardsInterface() : unreal.TThreadSafeSharedPtr<IOnlineLeaderboards>;
  public function GetIdentityInterface() : unreal.TThreadSafeSharedPtr<IOnlineIdentity>;
  public function GetInstanceName() : FName;
}

Support for pulling language from Steam

package unreal.onlinesubsystem;

import unreal.*;

@:glueCppIncludes("OnlineSubsystem.h") @:umodule("OnlineSubsystem")
@:uname("IOnlineSubsystem")
@:noCopy
@:uextern extern class IOnlineSubsystem {
  public static function Get(subsystemName:FName) : unreal.PPtr<IOnlineSubsystem>;

  public function GetAchievementsInterface() : unreal.TThreadSafeSharedPtr<IOnlineAchievements>;
  public function GetLeaderboardsInterface() : unreal.TThreadSafeSharedPtr<IOnlineLeaderboards>;
  public function GetIdentityInterface() : unreal.TThreadSafeSharedPtr<IOnlineIdentity>;
  public function GetInstanceName() : FName;

  public function GetLanguage() : FString;
}


package npm;

import npm.forever.ForeverOptions;

@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
  function new(scriptPath : String, ?options : ForeverOptions);

  function on(event : String, callback : ?Dynamic -> Void): Void;

  function start() : Void;
}

Change forever callback to haxe.Constraints.Function

package npm;

import haxe.Constraints.Function;
import npm.forever.ForeverOptions;

@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
  function new(scriptPath : String, ?options : ForeverOptions);

  function on(event : String, callback : Function): Void;

  function start() : Void;
}


package lime;

import haxe.PosInfos;
import lime.utils.Log;

#if macro
import haxe.macro.Compiler;
import haxe.macro.Context;
#end

#if !lime_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end

class Lib {

	@:noCompletion private static var __sentWarnings = new Map<String, Bool> ();

	#if macro
	public static function extraParams ():Void {

		if (!Context.defined ("tools")) {

			if (!Context.defined ("flash") && (!Context.defined ("js") || Context.defined ("nodejs"))) {

				Compiler.define ("lime-cffi");
				Compiler.define ("native");
				Compiler.define ("lime-curl");
				Compiler.define ("lime-vorbis");

			}

		}

	}
	#end

	public static function notImplemented (api:String, ?posInfo:PosInfos):Void {

		if (!__sentWarnings.exists (api)) {

			__sentWarnings.set (api, true);

			Log.warn (api + " is not implemented", posInfo);

		}

	}

}

Add support for -Dnocffi for tools to force no use of NDLLs

package lime;

import haxe.PosInfos;
import lime.utils.Log;

#if macro
import haxe.macro.Compiler;
import haxe.macro.Context;
#end

#if !lime_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end

class Lib {

	@:noCompletion private static var __sentWarnings = new Map<String, Bool> ();

	#if macro
	public static function extraParams ():Void {

		if (!Context.defined ("tools") && !Context.defined ("nocffi")) {

			if (!Context.defined ("flash") && (!Context.defined ("js") || Context.defined ("nodejs"))) {

				Compiler.define ("lime-cffi");
				Compiler.define ("native");
				Compiler.define ("lime-curl");
				Compiler.define ("lime-vorbis");

			}

		}

	}
	#end

	public static function notImplemented (api:String, ?posInfo:PosInfos):Void {

		if (!__sentWarnings.exists (api)) {

			__sentWarnings.set (api, true);

			Log.warn (api + " is not implemented", posInfo);

		}

	}

}


package jive;

import org.aswing.geom.IntDimension;
import org.aswing.geom.IntRectangle;
import format.SVG;

class Svg extends org.aswing.Component {

    public var generateContent:Void -> String;

    /**
    * The content property is ignored if the generateContent function is set.
    **/
    public var content(get, set):String;
    private var _content:String;

    private function get_content():String { return _content; }

    private function set_content(v:String):String {
        _content = v;
        repaint();
        return v;
    }

    public function new() {
        super();
    }

    override private function paint(b:IntRectangle): Void {
        super.paint(b);

        //Draw transparent rectangle to prevent glitches during animations
        graphics.beginFill(0, 0);
        graphics.drawRect(b.x, b.y, b.width, b.height);
        graphics.endFill();

        if (null != generateContent) _content = generateContent();
        new SVG(content).render(graphics);
    }

    override public function getPreferredSize(): IntDimension {
        if (null != generateContent) _content = generateContent();
        var data = new SVG(content).data;
        return new IntDimension(Std.int(data.width), Std.int(data.height));
    }
}

Load the SVG from the assets

package jive;

import openfl.utils.Assets;
import org.aswing.geom.IntDimension;
import org.aswing.geom.IntRectangle;
import format.SVG;

class Svg extends org.aswing.Component {

    public var generateContent:Void -> String;

    /**
    * The content property is ignored if the generateContent function is set.
    **/
    public var content(get, set):String;
    private var _content:String;

    private function get_content():String { return _content; }

    private function set_content(v:String):String {
        _content = v;
        repaint();
        return v;
    }

    public var asset(default, set): String;
    private function set_asset(v: String): String {
        asset = v;
        repaint();
        return v;
    }

    public function new() {
        super();
    }

    override private function paint(b:IntRectangle): Void {
        super.paint(b);

        //Draw transparent rectangle to prevent glitches during animations
        graphics.beginFill(0, 0);
        graphics.drawRect(b.x, b.y, b.width, b.height);
        graphics.endFill();

        updateContent();

        new SVG(content).render(graphics, 0, 0, preferredSize.width, preferredSize.height);
    }
    override public function countPreferredSize(): IntDimension {
        updateContent();
        var data = new SVG(content).data;
        return new IntDimension(Std.int(data.width), Std.int(data.height));
    }

    private function updateContent() {
        if (null != generateContent) _content = generateContent();
        if (null == content && asset != null) {
            _content = Assets.getText(asset);
        }
    }
}


package unreal;

extern class UEngine_Extra {
  /**
    Gets all local players associated with the engine.
    This function should only be used in rare cases where no UWorld* is available to get a player list associated with the world.
    E.g, - use GetFirstLocalPlayerController(UWorld *InWorld) when possible!
   */
  public function GetAllLocalPlayerControllers(PlayerList:PRef<TArray<APlayerController>>) : Void;

  public function OnTravelFailure() : FOnTravelFailure;

  public var TravelFailureEvent : FOnTravelFailure;
  /**
    Global UEngine
   **/
  @:uname("GEngine")
  @:global static var GEngine : UEngine;

  @:thisConst
  public function UseSound() : Bool;

  /**
   * Returns the current netmode
   * @param   NetDriverName    Name of the net driver to get mode for
   * @return current netmode
   *
   * Note: if there is no valid net driver, returns NM_StandAlone
   */
  @:thisConst
  public function GetNetMode(World:Const<UWorld>) : ENetMode;
}

Fix OnTravelFailure return type - should return a reference

package unreal;

extern class UEngine_Extra {
  /**
    Gets all local players associated with the engine.
    This function should only be used in rare cases where no UWorld* is available to get a player list associated with the world.
    E.g, - use GetFirstLocalPlayerController(UWorld *InWorld) when possible!
   */
  public function GetAllLocalPlayerControllers(PlayerList:PRef<TArray<APlayerController>>) : Void;

  public function OnTravelFailure() : PRef<FOnTravelFailure>;

  public var TravelFailureEvent : FOnTravelFailure;
  /**
    Global UEngine
   **/
  @:uname("GEngine")
  @:global static var GEngine : UEngine;

  @:thisConst
  public function UseSound() : Bool;

  /**
   * Returns the current netmode
   * @param   NetDriverName    Name of the net driver to get mode for
   * @return current netmode
   *
   * Note: if there is no valid net driver, returns NM_StandAlone
   */
  @:thisConst
  public function GetNetMode(World:Const<UWorld>) : ENetMode;
}


package unreal;

extern class UPlayerInput_Extra {

  /**
    This player's version of Action Mappings
   **/
  public var ActionMappings : TArray<FInputActionKeyMapping>;

  /**
    This player's version of Axis Mappings
   **/
  public var AxisMappings : TArray<FInputAxisKeyMapping>;

  /**
    Clear the current cached key maps and rebuild from the source arrays.
   **/
  public function ForceRebuildingKeyMaps(?bRestoreDefaults:Bool = false) : Void;

  /**
    Returns whether an Axis Mapping is inverted
   **/
  public function GetInvertAxis(AxisName : FName) : Bool;

	/** Add a player specific action mapping. */
  public function AddActionMapping(KeyMapping : Const<PRef<FInputActionKeyMapping>>) : Void;

	/** Remove a player specific action mapping. */
	public function RemoveActionMapping(KeyMappingconst : Const<PRef<FInputActionKeyMapping>>) : Void;

	/** Add a player specific axis mapping. */
	public function AddAxisMapping(KeyMapping : Const<PRef<FInputAxisKeyMapping>>) : Void;

	/** Remove a player specific axis mapping. */
	public function RemoveAxisMapping(KeyMapping : Const<PRef<FInputAxisKeyMapping>>) : Void;
}

Update to latest perforce change

package unreal;

extern class UPlayerInput_Extra {

  /**
    This player's version of Action Mappings
   **/
  public var ActionMappings : TArray<FInputActionKeyMapping>;

  /**
    This player's version of Axis Mappings
   **/
  public var AxisMappings : TArray<FInputAxisKeyMapping>;

  /**
    Clear the current cached key maps and rebuild from the source arrays.
   **/
  public function ForceRebuildingKeyMaps(?bRestoreDefaults:Bool = false) : Void;

  /** Gets the axis properties for a given AxisKey.  Returns if true if AxisKey was found in the AxisConfig array. */
  public function GetAxisProperties(AxisKey:unreal.inputcore.FKey, AxisProperties:PRef<FInputAxisProperties>) : Bool;

  /** Gets the axis properties for a given AxisKey.  Returns if true if AxisKey was found in the AxisConfig array. */
  public function SetAxisProperties(AxisKey:unreal.inputcore.FKey, AxisProperties:Const<PRef<FInputAxisProperties>>) : Void;

  /**
    Returns whether an Axis Mapping is inverted
   **/
  public function GetInvertAxis(AxisName : FName) : Bool;

	/** Add a player specific action mapping. */
  public function AddActionMapping(KeyMapping : Const<PRef<FInputActionKeyMapping>>) : Void;

	/** Remove a player specific action mapping. */
	public function RemoveActionMapping(KeyMappingconst : Const<PRef<FInputActionKeyMapping>>) : Void;

	/** Add a player specific axis mapping. */
	public function AddAxisMapping(KeyMapping : Const<PRef<FInputAxisKeyMapping>>) : Void;

	/** Remove a player specific axis mapping. */
	public function RemoveAxisMapping(KeyMapping : Const<PRef<FInputAxisKeyMapping>>) : Void;
}


package unreal;

@:glueCppIncludes("Containers/UnrealString.h")
@:uname("FString")
@:ustruct
@:uextern extern class FStringImpl {
  @:uname('.ctor') static function create(text:TCharStar):FStringImpl;
  @:uname('new') static function createNew(text:TCharStar):POwnedPtr<FStringImpl>;
  function op_Dereference() : TCharStar;

  @:thisConst function IsEmpty() : Bool;
  @:thisConst function ToBool() : Bool;

  function Empty(slack:Int32) : Void;

  function Len() : Int32;

  function Append(text:Const<PRef<FString>>):PRef<FString>;
  @:uname("Append") function AppendText(text:TCharStar, count:Int32):PRef<FString>;

  function InsertAt(index:Int32, chars:Const<PRef<FString>>):Void;

  function Compare(Other:Const<PRef<FString>>, SearchCase:ESearchCase) : Int32;

  function ToLowerInline():Void;
  function ToUpperInline():Void;
  @:expr(return op_Dereference()) public function toString():String;
}

Update to latest perforce change

package unreal;

@:glueCppIncludes("Containers/UnrealString.h")
@:uname("FString")
@:ustruct
@:uextern extern class FStringImpl {
  @:uname('.ctor') static function create(text:TCharStar):FStringImpl;
  @:uname('new') static function createNew(text:TCharStar):POwnedPtr<FStringImpl>;
  function op_Dereference() : TCharStar;

  @:thisConst function IsEmpty() : Bool;
  @:thisConst function ToBool() : Bool;

  function Empty(slack:Int32) : Void;

  function Len() : Int32;

  function Append(text:Const<PRef<FString>>):PRef<FString>;
  @:uname("Append") function AppendText(text:TCharStar, count:Int32):PRef<FString>;

  function InsertAt(index:Int32, chars:Const<PRef<FString>>):Void;

  function Compare(Other:Const<PRef<FString>>, SearchCase:ESearchCase) : Int32;

  function RemoveFromStart(str:Const<PRef<FString>>, SearchCase:ESearchCase) : Bool;

  function ToLowerInline():Void;
  function ToUpperInline():Void;
  @:expr(return op_Dereference()) public function toString():String;
}


package unreal;

extern class UInputSettings_Extra {
  function SaveKeyMappings() : Void;
  function AddActionMapping(KeyMapping:Const<PRef<FInputActionKeyMapping>>) : Void;
  function AddAxisMapping(KeyMapping:Const<PRef<FInputAxisKeyMapping>>) : Void;
}

Update to latest perforce change

package unreal;

extern class UInputSettings_Extra {
}


package travix.commands;

import tink.cli.Rest;

class PythonCommand extends Command {

  public function install() {

  }

  public function buildAndRun(rest:Rest<String>) {
    build('python', ['-python', 'bin/python/tests.py'].concat(rest), function () {
      if (tryToRun('python3', ['--version']).match(Failure(_, _))) {
        installPackage('python3');
      }
      exec('python3', ['bin/python/tests.py']);
    });
  }
}

Fix installation of Python 3 on OSX via brew

package travix.commands;

import tink.cli.Rest;

class PythonCommand extends Command {

  public function install() {

  }

  public function buildAndRun(rest:Rest<String>) {
    build('python', ['-python', 'bin/python/tests.py'].concat(rest), function () {
      if (tryToRun('python3', ['--version']).match(Failure(_, _))) {

        // fix for https://github.com/back2dos/travix/issues/83
        if (Sys.systemName() == 'Mac' && tryToRun('python', ['--version']).match(Success(_))) {
          // https://stackoverflow.com/questions/49672642/trying-to-install-python3-using-brew
          exec('brew', ['upgrade', "python"]);
        } else {
          installPackage('python3');
        }
      }
      exec('python3', ['bin/python/tests.py']);
    });
  }
}


package unreal.rhi;

@:glueCppIncludes("RHIResources.h", "DynamicRHI.h")
@:noCopy
@:noEquals
@:umodule("RHI")
@:uextern extern class FDynamicRHI {
  @:global static function RHIGetAvailableResolutions(Resolutions:PRef<TArray<FScreenResolutionRHI>>, bIgnoreRefreshRate:Bool) : Bool;
}

Update to latest perforce change

package unreal.rhi;

@:glueCppIncludes("RHI.h", "RHIResources.h", "DynamicRHI.h")
@:noCopy
@:noEquals
@:umodule("RHI")
@:uextern extern class FDynamicRHI {
  @:global static function RHIGetAvailableResolutions(Resolutions:PRef<TArray<FScreenResolutionRHI>>, bIgnoreRefreshRate:Bool) : Bool;
}


//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform;

import haxe.Json;

import flambe.util.Assert;

/** Handles communication with the Catapult server run by `flambe serve`, for live reloading. */
class CatapultClient
{
    private function new ()
    {
        _loaders = [];
    }

    public function add (loader :BasicAssetPackLoader)
    {
#if flambe_enable_catapult
        // Only care about packs loaded from the assets directory
        if (loader.manifest.relativeBasePath == "assets") {
            _loaders.push(loader);
        }
#end
    }

    public function remove (loader :BasicAssetPackLoader)
    {
        _loaders.remove(loader);
    }

    private function onError (cause :String)
    {
        Log.warn("Unable to connect to Catapult", ["cause", cause]);
    }

    private function onMessage (message :String)
    {
        var message = Json.parse(message);
        switch (message.type) {
        case "file_changed":
            var url = message.name + "?v=" + message.md5;
            for (loader in _loaders) {
                loader.reload(url);
            }
        case "restart":
            onRestart();
        }
    }

    private function onRestart ()
    {
        Assert.fail(); // See subclasses
    }

    private var _loaders :Array<BasicAssetPackLoader>;
}

Enable asset reloading by default.

//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform;

import haxe.Json;

import flambe.util.Assert;

/** Handles communication with the Catapult server run by `flambe serve`, for live reloading. */
class CatapultClient
{
    private function new ()
    {
        _loaders = [];
    }

    public function add (loader :BasicAssetPackLoader)
    {
#if !flambe_disable_reloading
        // Only care about packs loaded from the assets directory
        if (loader.manifest.relativeBasePath == "assets") {
            _loaders.push(loader);
        }
#end
    }

    public function remove (loader :BasicAssetPackLoader)
    {
        _loaders.remove(loader);
    }

    private function onError (cause :String)
    {
        Log.warn("Unable to connect to Catapult", ["cause", cause]);
    }

    private function onMessage (message :String)
    {
        var message = Json.parse(message);
        switch (message.type) {
        case "file_changed":
            var url = message.name + "?v=" + message.md5;
            for (loader in _loaders) {
                loader.reload(url);
            }
        case "restart":
            onRestart();
        }
    }

    private function onRestart ()
    {
        Assert.fail(); // See subclasses
    }

    private var _loaders :Array<BasicAssetPackLoader>;
}


//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.util;

/**
 * Simple runtime assertions. A failed assertion throws an error, which should NOT be caught and
 * handled. Assertions are stripped from release builds, unless the -D flambe_keep_asserts compiler
 * flag is used.
 */
class Assert
{
#if (debug || flambe_keep_asserts)
    /**
     * Asserts that a condition is true.
     * @param message If this assertion fails, the message to include in the thrown error.
     */
    public static function that (condition :Bool, ?message :String)
    {
        if (!condition) {
            fail(message);
        }
    }

    /**
     * Immediately fails an assertion. Same as Assert.that(false)
     * @param message The message to include in the thrown error.
     */
    public static function fail (?message :String)
    {
        throw "Assertion failed" + (message != null ? ": " + message : "");
    }

#else
    // In release builds, assertions are stripped out
    inline public static function that (condition :Bool, ?message :String) {}
    inline public static function fail (?message :String) {}
#end
}

Allow formatted parameters in assert messages too.

//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.util;

using flambe.util.Strings;

/**
 * Simple runtime assertions. A failed assertion throws an error, which should NOT be caught and
 * handled. Assertions are stripped from release builds, unless the -D flambe_keep_asserts compiler
 * flag is used.
 */
class Assert
{
#if (debug || flambe_keep_asserts)
    /**
     * Asserts that a condition is true.
     * @param message If this assertion fails, the message to include in the thrown error.
     * @param params Optional parameters to be included with the message, see Strings.addParams.
     */
    public static function that (condition :Bool, ?message :String, ?params :Array<Dynamic>)
    {
        if (!condition) {
            fail(message, params);
        }
    }

    /**
     * Immediately fails an assertion. Same as Assert.that(false).
     * @param message The message to include in the thrown error.
     * @param params Optional parameters to be included with the message, see Strings.addParams.
     */
    public static function fail (?message :String, ?params :Array<Dynamic>)
    {
        var error = "Assertion failed!";
        if (message != null) {
            error += " " + message;
        }
        if (params != null) {
            error = error.addParams(params);
        }
        throw error;
    }

#else
    // In release builds, assertions are stripped out
    inline public static function that (condition :Bool, ?message :String, ?params :Array<Dynamic>) {}
    inline public static function fail (?message :String, ?params :Array<Dynamic>) {}
#end
}


package coconut.ui;

import tink.state.Observable;

using tink.CoreApi;

@:autoBuild(coconut.ui.macros.ViewBuilder.build())
@:observable
class View extends Renderer implements Renderable {

  @:noCompletion var __coco__cache = new coconut.ui.tools.ViewCache();

  @:keep public var viewId(default, null):Int = idCounter++; static var idCounter = 0;

  public function new(render:Void->coconut.ui.RenderResult, ?pos:haxe.PosInfos) {
    var last:Option<RenderResult> = None;
    super(Observable.auto(function () return {
      if (!shouldViewUpdate() && last != None) {
        last.force();
      }
      else {
        var res = __coco__cache.cached(render);
        last = Some(res);
        res;
      }
    }));
  }

  @:noCompletion function shouldViewUpdate():Bool return true;

  @:noCompletion inline public function getRenderResult():RenderResult
    return this;
}

Remove some unused debug information.

package coconut.ui;

import tink.state.Observable;

using tink.CoreApi;

@:autoBuild(coconut.ui.macros.ViewBuilder.build())
@:observable
class View extends Renderer implements Renderable {

  @:noCompletion var __coco__cache = new coconut.ui.tools.ViewCache();

  @:keep public var viewId(default, null):Int = idCounter++; static var idCounter = 0;

  public function new(render:Void->coconut.ui.RenderResult) {
    var last:Option<RenderResult> = None;
    super(Observable.auto(function () return {
      if (!shouldViewUpdate() && last != None) {
        last.force();
      }
      else {
        var res = __coco__cache.cached(render);
        last = Some(res);
        res;
      }
    }));
  }

  @:noCompletion function shouldViewUpdate():Bool return true;

  @:noCompletion inline public function getRenderResult():RenderResult
    return this;
}


package ufront.web;

import ufront.web.context.ActionContext;

/**
	A simple base controller class.
	It's main function is an autobuild macro, which will be used to provide some helpers in future.
	It also has an empty constructor and a `context:ActionContext` property.  See below for details.
**/
// @:autoBuild()
@:keep
class Controller
{
	/**
		The Action Context.
		This is not set automatically, it is up to the DispatchModule or similar to pass the context to the controller.
		This has a setter that you can override if you want to perform any initialisation logic when the context is set.
	**/
	@:isVar
	public var context(default,set):Null<ActionContext>;
	function set_context(v) return context=v;

	/**
		Empty constructor.
		Included so that you don't need to manually specify a constructor in your controller when you don't need it.
	**/
	public function new() {}

	/**
		A default toString() to aid in debugging.  Just prints the current class name.
	**/
	public function toString() {
		return Type.getClassName( Type.getClass(this) );
	}
}

Use injection to get context. Use traces on contexts

package ufront.web;

import haxe.PosInfos;
import ufront.web.context.ActionContext;

/**
	A simple base controller class.
	It's main function is an autobuild macro, which will be used to provide some helpers in future.
	It also has an empty constructor and a `context:ActionContext` property.  See below for details.
**/
// @:autoBuild()
@:keep
class Controller
{
	/**
		The Action Context.

		This is usually injected by `ufront.web.DispatchModule`.
	**/
	@inject public var context:ActionContext;

	/**
		Empty constructor.
		Included so that you don't need to manually specify a constructor in your controller when you don't need it.
	**/
	public function new() {}

	/**
		A default toString() to aid in debugging.  Just prints the current class name.
	**/
	public function toString() {
		return Type.getClassName( Type.getClass(this) );
	}

	/**
		A shortcut to `HttpContext.ufTrace`
	**/
	public inline function ufTrace( msg:Dynamic, ?pos:PosInfos ) {
		context.httpContext.ufTrace( msg, pos );
	}

	/**
		A shortcut to `HttpContext.ufLog`
	**/
	public inline function ufLog( msg:Dynamic, ?pos:PosInfos ) {
		context.httpContext.ufLog( msg, pos );
	}

	/**
		A shortcut to `HttpContext.ufWarn`
	**/
	public inline function ufWarn( msg:Dynamic, ?pos:PosInfos ) {
		context.httpContext.ufWarn( msg, pos );
	}

	/**
		A shortcut to `HttpContext.ufError`
	**/
	public inline function ufError( msg:Dynamic, ?pos:PosInfos ) {
		context.httpContext.ufError( msg, pos );
	}
}


//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform.html;

import flambe.platform.Stage;
import flambe.util.Signal0;

class HtmlStage
    implements Stage
{
    public var width (getWidth, null) :Int;
    public var height (getHeight, null) :Int;

    public var resize (default, null) :Signal0;

    public function new (canvas :Dynamic)
    {
        _canvas = canvas;
        _canvas.addEventListener("resize", function (_) {
            resize.emit();
        }, false);
    }

    public function getWidth () :Int
    {
        return _canvas.width;
    }

    public function getHeight () :Int
    {
        return _canvas.height;
    }

    public function lockOrientation (orient :Orientation)
    {
        // Nothing until mobile browsers support it
    }

    private var _canvas :Dynamic;
}

Fix resize events in html.

//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform.html;

import js.Lib;

import flambe.platform.Stage;
import flambe.util.Signal0;

class HtmlStage
    implements Stage
{
    public var width (getWidth, null) :Int;
    public var height (getHeight, null) :Int;

    public var resize (default, null) :Signal0;

    public function new (canvas :Dynamic)
    {
        _canvas = canvas;
        resize = new Signal0();

        (untyped Lib.window).addEventListener("resize", function (event) {
            resize.emit();
        }, false);
    }

    public function getWidth () :Int
    {
        return _canvas.width;
    }

    public function getHeight () :Int
    {
        return _canvas.height;
    }

    public function lockOrientation (orient :Orientation)
    {
        // Nothing until mobile browsers support it
    }

    private var _canvas :Dynamic;
}


package unreal;

@:glueCppIncludes("HttpModule.h")
@:uextern @:noCopy @:noEquals extern class FHttpModule
{
  static function Get() : PRef<FHttpModule>;

  function CreateRequest() : TSharedRef<IHttpRequest>;

  @:thisConst
  function IsHttpEnabled() : Bool;

  function GetHttpManager() : PRef<FHttpManager>;
}

Update to latest perforce change

package unreal;

@:glueCppIncludes("HttpModule.h")
@:umodule("HTTP")
@:uextern @:noCopy @:noEquals extern class FHttpModule
{
  static function Get() : PRef<FHttpModule>;

  function CreateRequest() : TSharedRef<IHttpRequest>;

  @:thisConst
  function IsHttpEnabled() : Bool;

  function GetHttpManager() : PRef<FHttpManager>;
}


package unreal;

extern class FQuat_Extra {
  @:uname('.ctor') public static function create() : FQuat;
  @:uname('new') public static function createNew() : POwnedPtr<FQuat>;
  @:uname('.ctor') public static function createFromRotator(rotator:Const<PRef<FRotator>>) : FQuat;
  @:uname('new') public static function createNewFromRotator(rotator:Const<PRef<FRotator>>) : POwnedPtr<FQuat>;

  public static var Identity(default, never):FQuat;

	/**
	 * Checks whether another Quaternion is equal to this, within specified tolerance.
	 *
	 * @param Q The other Quaternion.
	 * @param Tolerance Error tolerance for comparison with other Quaternion.
	 * @return true if two Quaternions are equal, within specified tolerance, otherwise false.
	 */
  @:thisConst
  public function Equals(R:Const<PRef<FQuat>>, Tolerance:Float32=1e-4) : Bool;

  /** Convert a Quaternion into floating-point Euler angles (in degrees). */
	@:thisConst
  public function Euler() : FVector;

  /** Get the up direction (Z axis) after it has been rotated by this Quaternion. */
  @:thisConst
	public function GetUpVector() : FVector;
}

Update to latest perforce change

package unreal;

extern class FQuat_Extra {
  @:uname('.ctor') public static function create() : FQuat;
  @:uname('new') public static function createNew() : POwnedPtr<FQuat>;
  @:uname('.ctor') public static function createFromRotator(rotator:Const<PRef<FRotator>>) : FQuat;
  @:uname('new') public static function createNewFromRotator(rotator:Const<PRef<FRotator>>) : POwnedPtr<FQuat>;

  public static var Identity(default, never):FQuat;

	/**
	 * Checks whether another Quaternion is equal to this, within specified tolerance.
	 *
	 * @param Q The other Quaternion.
	 * @param Tolerance Error tolerance for comparison with other Quaternion.
	 * @return true if two Quaternions are equal, within specified tolerance, otherwise false.
	 */
  @:thisConst
  public function Equals(R:Const<PRef<FQuat>>, Tolerance:Float32=1e-4) : Bool;

  /** Convert a Quaternion into floating-point Euler angles (in degrees). */
	@:thisConst
  public function Euler() : FVector;

  /** Get the forward direction (X axis) after it has been rotated by this Quaternion. */
  @:thisConst
  public function GetForwardVector() : FVector;

  /** Get the right direction (Y axis) after it has been rotated by this Quaternion. */
  @:thisConst
  public function GetRightVector() : FVector;

  /** Get the up direction (Z axis) after it has been rotated by this Quaternion. */
  @:thisConst
  public function GetUpVector() : FVector;
}


package thx;

import utest.Assert;

class TestMaps {
  public function new() { }

  public function testTuples() {
    var map = [
      "key1" => 1,
      "key2" => 2
    ];

    var tuples = Maps.tuples(map);
    tuples.sort(function(a, b) return Strings.compare(a._0, b._0));

    Assert.equals(2, tuples.length);
    Assert.equals(tuples[0]._0, "key1");
    Assert.equals(tuples[0]._1, 1);
    Assert.equals(tuples[1]._0, "key2");
    Assert.equals(tuples[1]._1, 2);
  }

  public function testValues() {
    var map = [
      "key1" => 1,
      "key2" => 2,
      "key3" => 3
    ];
    var values = Maps.values(map);
    Assert.same([1, 2, 3], values);
  }
}

Fix test by sorting values array (because key order is not determinate)

package thx;

import utest.Assert;
using thx.Arrays;
using thx.Maps;

class TestMaps {
  public function new() { }

  public function testTuples() {
    var map = [
      "key1" => 1,
      "key2" => 2
    ];

    var tuples = map.tuples();
    tuples.sort(function(a, b) return Strings.compare(a._0, b._0));

    Assert.equals(2, tuples.length);
    Assert.equals(tuples[0]._0, "key1");
    Assert.equals(tuples[0]._1, 1);
    Assert.equals(tuples[1]._0, "key2");
    Assert.equals(tuples[1]._1, 2);
  }

  public function testValues() {
    var map = [
      "key1" => 1,
      "key2" => 2,
      "key3" => 3
    ];
    var values = map.values().order(Ints.compare);
    Assert.same([1, 2, 3], values);
  }
}


package unreal;

extern class FVector2D_Extra {
  @:uname('.ctor') public static function createWithValues(x:Float32, y:Float32):FVector2D;
  @:uname('new') public static function createNewWithValues(x:Float32, y:Float32):POwnedPtr<FVector2D>;
  @:uname('.ctor') public static function copyCreate(InVector2D:Const<PRef<FVector2D>>) : FVector2D;

  public var X:Float32;
  public var Y:Float32;

  @:expr public static var ZeroVector (get,never) : Const<FVector2D>;

  @:expr public static var UnitVector (get,never) : Const<FVector2D>;

  @:expr({
    return createWithValues(0,0);
  }) private static function get_ZeroVector() : Const<FVector2D>;

  @:expr({
    return createWithValues(1,1);
  }) private static function get_UnitVector() : Const<FVector2D>;

  @:thisConst
  public function Equals(V:Const<PRef<FVector2D>>, Tolerance:Float32=1e-4) : Bool;
}

Update to latest perforce change

package unreal;

extern class FVector2D_Extra {
  @:uname('.ctor') public static function createWithValues(x:Float32, y:Float32):FVector2D;
  @:uname('new') public static function createNewWithValues(x:Float32, y:Float32):POwnedPtr<FVector2D>;
  @:uname('.ctor') public static function copyCreate(InVector2D:Const<PRef<FVector2D>>) : FVector2D;

  public var X:Float32;
  public var Y:Float32;

  @:expr public static var ZeroVector (get,never) : Const<FVector2D>;

  @:expr public static var UnitVector (get,never) : Const<FVector2D>;

  @:expr({
    return createWithValues(0,0);
  }) private static function get_ZeroVector() : Const<FVector2D>;

  @:expr({
    return createWithValues(1,1);
  }) private static function get_UnitVector() : Const<FVector2D>;

  @:thisConst
  public function Equals(V:Const<PRef<FVector2D>>, Tolerance:Float32=1e-4) : Bool;

  @:op(A+B)
  @:expr(return createWithValues(X + b.X, Y + b.Y))
  public function _add(b:FVector2D):FVector2D;

  @:op(A*B)
  @:commutative
  @:expr(return createWithValues(X * b.X, Y * b.Y))
  public function _mul(b:FVector2D):FVector2D;

  @:op(A-B)
  @:expr(return createWithValues(X - b.X, Y - b.Y))
  public function _sub(b:FVector2D):FVector2D;

  @:op(A==B)
  @:expr(return X == b.X && Y == b.Y)
  public function _eq(b:FVector2D):Bool;
}


package tink.state.internal;

abstract Revision(Float) {//TODO: use Int64 where it's faster and perhaps plain Int on python
  static var counter = .0;
  static public final ZERO = new Revision();
  public inline function new()
    this = counter++;
  @:op(a < b) static function lt(a:Revision, b:Revision):Bool;
  @:op(a <= b) static function lte(a:Revision, b:Revision):Bool;
  @:op(a > b) static function gt(a:Revision, b:Revision):Bool;
  @:op(a >= b) static function gte(a:Revision, b:Revision):Bool;
  @:op(a == b) static function eq(a:Revision, b:Revision):Bool;
  @:op(a != b) static function neq(a:Revision, b:Revision):Bool;
  @:op(a * b) static inline function join(a:Revision, b:Revision):Revision
    return if (a > b) a else b;
}

Work around odd initialization order.

package tink.state.internal;

abstract Revision(Float) {//TODO: use Int64 where it's faster and perhaps plain Int on python
  static var counter:Float;
  static public final ZERO = new Revision();
  public function new() {
    if (Math.isNaN(counter)) counter = .0;// seems to be a problem in initialization order
    this = counter++;
  }
  @:op(a < b) static function lt(a:Revision, b:Revision):Bool;
  @:op(a <= b) static function lte(a:Revision, b:Revision):Bool;
  @:op(a > b) static function gt(a:Revision, b:Revision):Bool;
  @:op(a >= b) static function gte(a:Revision, b:Revision):Bool;
  @:op(a == b) static function eq(a:Revision, b:Revision):Bool;
  @:op(a != b) static function neq(a:Revision, b:Revision):Bool;
  @:op(a * b) static inline function join(a:Revision, b:Revision):Revision
    return if (a > b) a else b;
}


package js.npm.mongoose;

import js.npm.mongoose.*;
import js.support.Callback;

extern class Mongoose
implements npm.Package.RequireNamespace<"mongoose","^4.0.0"> {
	public function new() : Void;
	public var connection (default,null) : Connection;
	public var connections (default,null) : Array<Connection>;
	public var version (default, null) : String;
	public var readyState (default, null) : Int;

	public function disconnect(cb : Callback0) : Void;
	public function createConnection( url : String ) : Connection;
	public function connect( url : String , ?fn : js.support.Callback0 ) : Mongoose;
	public function model<T,M:Model.TModel<T>>( name : String , ?schema : Schema<T> , ?collectionName : String , ?skipInit : Bool ) : Model.TModels<T,M>;
	public function plugin( fn : Dynamic , ?options : {} ) : Mongoose;
	public function modelNames () : Array<String>;
}

Add method overload for connect()

package js.npm.mongoose;

import js.npm.mongoose.*;
import js.support.Callback;

extern class Mongoose
implements npm.Package.RequireNamespace<"mongoose","^4.0.0"> {
	public function new() : Void;
	public var connection (default,null) : Connection;
	public var connections (default,null) : Array<Connection>;
	public var version (default, null) : String;
	public var readyState (default, null) : Int;

	public function disconnect(cb : Callback0) : Void;
	public function createConnection( url : String ) : Connection;

	@:overload(function( url : String , options:{}, ?fn : js.support.Callback0 ) : Mongoose {})
	public function connect( url : String , ?fn : js.support.Callback0 ) : Mongoose;
	public function model<T,M:Model.TModel<T>>( name : String , ?schema : Schema<T> , ?collectionName : String , ?skipInit : Bool ) : Model.TModels<T,M>;
	public function plugin( fn : Dynamic , ?options : {} ) : Mongoose;
	public function modelNames () : Array<String>;
}


package data;

import echo.GenericView;
import echo.System;

/**
 * ...
 * @author octocake1
 */
class RoomSystem extends System {

	static public var LOG:Array<String> = [];

	var names = new GenericView<{ name:Name }>();
	var namesAndGreetings = new GenericView<{ name:Name, greeting:Greeting }>();

	override public function onactivate() {
		names.onAdd.add(function(_) {
			LOG.push('${names.name.val} enter the room');
		} );
		names.onRemove.add(function(_) {
			LOG.push('${names.name.val} leave the room');
		} );
	}

	override public function update(dt:Float) {
		for (ng in namesAndGreetings) {
			for (n in names) {
				if (ng.name != n.name) LOG.push('${ng.name.val} say ${ng.greeting.val} to ${n.name.val}');
			}
		}
	}

	override public function ondeactivate() {
		names.onAdd.removeAll();
		names.onRemove.removeAll();
	}

}

Test fix for ViewData functional

package data;

import echo.GenericView;
import echo.System;

/**
 * ...
 * @author octocake1
 */
class RoomSystem extends System {

	static public var LOG:Array<String> = [];

	var names = new GenericView<{ name:Name }>();
	var namesAndGreetings = new GenericView<{ name:Name, greeting:Greeting }>();

	override public function onactivate() {
		names.onAdd.add(function(id) {
			var val = echo.getComponent(id, Name).val;
			LOG.push('${val} enter the room');
		} );
		names.onRemove.add(function(id) {
			var val = echo.getComponent(id, Name).val;
			LOG.push('${val} leave the room');
		} );
	}

	override public function update(dt:Float) {
		for (ng in namesAndGreetings) {
			for (n in names) {
				if (ng.name != n.name) LOG.push('${ng.name.val} say ${ng.greeting.val} to ${n.name.val}');
			}
		}
	}

	override public function ondeactivate() {
		names.onAdd.removeAll();
		names.onRemove.removeAll();
	}

}


package cncta.ui.chat;

class ChatRoster extends qx.ui.container.Scroll
{
    private var nicklist:qx.ui.container.Composite;
    private var nickmap:Hash<qx.ui.basic.Label>;

    public function new()
    {
        var layout = new qx.ui.layout.VBox();
        this.nicklist = new qx.ui.container.Composite(layout);
        this.nickmap = new Hash();

        super(this.nicklist);
    }

    public function add_member(ident:String, nick:String)
    {
        if (this.nickmap.exists(ident))
            return;

        var text = "" + nick + "";
        var label = new qx.ui.basic.Label(text);
        label.set({rich: true});
        this.nickmap.set(ident, label);
        this.nicklist.add(label);
    }

    public function remove_member(ident:String)
    {
        var label = this.nickmap.get(ident);
        if (label != null) {
            this.nicklist.remove(label);
            this.nickmap.remove(ident);
        }
    }
}

Change roster nick colors to yellow.


package unreal;

extern class UParticleSystemComponent_Extra {
  public function DeactivateSystem() : Void;
  public var bAutoDestroy:Bool;
}

Update to latest perforce change

package unreal;

extern class UParticleSystemComponent_Extra {
  public function DeactivateSystem() : Void;

  /**
   *	Retrieve the Float parameter value for the given name.
   *
   *	@param	InName		Name of the parameter
   *	@param	OutFloat	The value of the parameter found
   *
   *	@return	true		Parameter was found - OutFloat is valid
   *			false		Parameter was not found - OutFloat is invalid
   */
  public function GetFloatParameter(InName:Const<FName>, OutFloat:Ref<Float32>) : Bool;
  public var bAutoDestroy:Bool;
}


#if macro
import haxe.macro.Expr;
#end

class UserScript
{
    @:macro public static function extract_meta(uscls:String, file:String):Expr
    {
        haxe.macro.Context.onGenerate(function (types) {
            for (type in types) {
                switch (type) {
                    case TInst(c, _):
                        var cls = c.get();
                        if (cls.name == uscls) {
                            var meta = cls.meta.get();
                            var usheader = macro.UserScript.generate_meta(meta);
                            usheader += "\n#CODE_HERE#\n";

                            var outfile = neko.io.File.write(file, false);
                            outfile.writeString(usheader);
                            outfile.close();
                        }
                    default:
                }
            }
        });

        var ret = EConst(CType("Void"));
        return {expr: ret, pos:haxe.macro.Context.currentPos()};
    }

#if macro
    public static function generate(infile:String, outfile:String)
    {
        var script = new macro.UserScript(outfile);
        script.from_infile(infile);
        script.write(outfile);
    }
#end
}

Remove userscript metadata from generated code.

#if macro
import haxe.macro.Expr;
#end

class UserScript
{
    @:macro public static function extract_meta(uscls:String, file:String):Expr
    {
        haxe.macro.Context.onGenerate(function (types) {
            for (type in types) {
                switch (type) {
                    case TInst(c, _):
                        var cls = c.get();
                        if (cls.name == uscls) {
                            var meta = cls.meta.get();
                            var usheader = macro.UserScript.generate_meta(meta);
                            usheader += "\n#CODE_HERE#\n";

                            // remove all metadata
                            for (m in meta) {
                                cls.meta.remove(m.name);
                            }

                            var outfile = neko.io.File.write(file, false);
                            outfile.writeString(usheader);
                            outfile.close();
                        }
                    default:
                }
            }
        });

        var ret = EConst(CType("Void"));
        return {expr: ret, pos:haxe.macro.Context.currentPos()};
    }

#if macro
    public static function generate(infile:String, outfile:String)
    {
        var script = new macro.UserScript(outfile);
        script.from_infile(infile);
        script.write(outfile);
    }
#end
}


class Test {
  public function demo(func:String -> Void):Void {
  }

  public function main() {
    var out = 10;

    this.demo(function(v) {
      <error descr="Can't assign String to Int">out = v</error>;
    });
  }
}

Update unit test for passing function literals to expect a better error message.

class Test {
  public function demo(func:String -> Void):Void {
  }

  public function main() {
    var out = 10;

    this.demo(<error descr="Can't assign Int -> Int to String -> Void">function(v) {
      out = v;
    }</error>);
  }
}


package unreal;

@:glueCppIncludes("Containers/UnrealString.h")
@:uname("FString")
@:ustruct
@:uextern extern class FStringImpl {
  @:uname('.ctor') static function create(text:TCharStar):FStringImpl;
  @:uname('new') static function createNew(text:TCharStar):POwnedPtr<FStringImpl>;
  function op_Dereference() : TCharStar;

  @:thisConst function IsEmpty() : Bool;
  @:thisConst function ToBool() : Bool;

  function Empty(slack:Int32) : Void;

  function Len() : Int32;

  function Append(text:Const<PRef<FString>>):PRef<FString>;
  @:uname("Append") function AppendText(text:TCharStar, count:Int32):PRef<FString>;

  function InsertAt(index:Int32, chars:Const<PRef<FString>>):Void;

  function ToLowerInline():Void;
  function ToUpperInline():Void;
  @:expr(return op_Dereference()) public function toString():String;
}

Update to latest perforce change

package unreal;

@:glueCppIncludes("Containers/UnrealString.h")
@:uname("FString")
@:ustruct
@:uextern extern class FStringImpl {
  @:uname('.ctor') static function create(text:TCharStar):FStringImpl;
  @:uname('new') static function createNew(text:TCharStar):POwnedPtr<FStringImpl>;
  function op_Dereference() : TCharStar;

  @:thisConst function IsEmpty() : Bool;
  @:thisConst function ToBool() : Bool;

  function Empty(slack:Int32) : Void;

  function Len() : Int32;

  function Append(text:Const<PRef<FString>>):PRef<FString>;
  @:uname("Append") function AppendText(text:TCharStar, count:Int32):PRef<FString>;

  function InsertAt(index:Int32, chars:Const<PRef<FString>>):Void;

  function Compare(Other:Const<PRef<FString>>, SearchCase:ESearchCase) : Int32;

  function ToLowerInline():Void;
  function ToUpperInline():Void;
  @:expr(return op_Dereference()) public function toString():String;
}


package flixel.system.frontEnds;

import flixel.FlxG;

class SoundFrontEndTest
{
	@Test // #1511
	function testPlayInvalidSoundPathNoCrash()
	{
		FlxG.sound.play("assets/invalid");
	}

	@Test // #1511
	function testPlayMusicInvalidSoundPathNoCrash()
	{
		FlxG.sound.playMusic("assets/invalid");
	}

	@Test // #1511
	function testLoadInvalidSoundPathNoCrash()
	{
		FlxG.sound.load("assets/invalid").play();
	}
}

Fix unit test compilation with FLX_NO_SOUND_SYSTEM

package flixel.system.frontEnds;

import flixel.FlxG;

class SoundFrontEndTest
{
	#if FLX_SOUND_SYSTEM
	@Test // #1511
	function testPlayInvalidSoundPathNoCrash()
	{
		FlxG.sound.play("assets/invalid");
	}

	@Test // #1511
	function testPlayMusicInvalidSoundPathNoCrash()
	{
		FlxG.sound.playMusic("assets/invalid");
	}

	@Test // #1511
	function testLoadInvalidSoundPathNoCrash()
	{
		FlxG.sound.load("assets/invalid").play();
	}
	#end
}


package installers;

import haxe.io.Path;
import sys.io.Process;
import neko.Lib;

class CPPInstaller extends DesktopInstaller {

	override function getVM ():String {

		return "cpp";

	}

	override function copyResultTo (path:String) {

		var debugString:String = (debug ? "-debug" : "");
		var extension:String = (targetName=="windows") ? ".exe" : "";

		copyIfNewer (getBuildDir() + "/ApplicationMain" + debugString + extension, path);

	}

	override function generateContext ():Void {

		if (targetName == "windows") {

			if (!defines.exists ("SHOW_CONSOLE") && (!debug || defines.exists ("HIDE_CONSOLE"))) {

				defines.set ("no_console", "1");
				Sys.putEnv ("no_console", "1");

			}

			if (Sys.environment ().exists ("VS110COMNTOOLS")) {

				Lib.println ("Warning: Visual Studio 2012 is not supported. Trying Visual Studio 2010...");
				Sys.putEnv ("VS110COMNTOOLS", Sys.getEnv ("VS100COMNTOOLS"));

			}

		}

		super.generateContext ();

		context.CPP_DIR = getBuildDir ();
		context.HXML_PATH = NME + "/tools/command-line/cpp/hxml/" + (debug ? "debug" : "release") + ".hxml";

	}

}

Use Clang by default for OS X applications. Xcode 4.4 has broken symlink for g++

package installers;

import haxe.io.Path;
import sys.io.Process;
import neko.Lib;

class CPPInstaller extends DesktopInstaller {

	override function getVM ():String {

		return "cpp";

	}

	override function copyResultTo (path:String) {

		var debugString:String = (debug ? "-debug" : "");
		var extension:String = (targetName=="windows") ? ".exe" : "";

		copyIfNewer (getBuildDir() + "/ApplicationMain" + debugString + extension, path);

	}

	override function generateContext ():Void {

		if (targetName == "windows") {

			if (!defines.exists ("SHOW_CONSOLE") && (!debug || defines.exists ("HIDE_CONSOLE"))) {

				defines.set ("no_console", "1");
				Sys.putEnv ("no_console", "1");

			}

			if (Sys.environment ().exists ("VS110COMNTOOLS")) {

				Lib.println ("Warning: Visual Studio 2012 is not supported. Trying Visual Studio 2010...");
				Sys.putEnv ("VS110COMNTOOLS", Sys.getEnv ("VS100COMNTOOLS"));

			}

		} else if (targetName == "mac") {

			Sys.putEnv ("HXCPP_CLANG", "1");

		}

		super.generateContext ();

		context.CPP_DIR = getBuildDir ();
		context.HXML_PATH = NME + "/tools/command-line/cpp/hxml/" + (debug ? "debug" : "release") + ".hxml";

	}

}


package travix.commands;

using StringTools;

class CsCommand extends Command {

  override function execute() {

    if (!Travix.isWindows)
      if (tryToRun('mono', ['--version']).match(Failure(_, _))) {
        if(Travix.isLinux) {
          aptGet('mono-devel');
          aptGet('mono-mcs');
        } else {
          aptGet('mono');
        }
      }

    var main = Travix.getMainClassLocalName();

    installLib('hxcs');

    build(['-cs', 'bin/cs/'], function () {

      if (Travix.isWindows)
        exec('bin\\cs\\bin\\$main.exe');
      else
        exec('mono', ['bin/cs/bin/$main.exe']);
    });
  }
}

Install newer mono version on Linux.

package travix.commands;

class CsCommand extends Command {

  override function execute() {

    if (Travix.isMac) {

      aptGet('mono');

    } else if (Travix.isLinux) {

      // http://www.mono-project.com/download/#download-lin
      exec('eval', ['sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF']);
      switch tryToRun('lsb_release', ['-cs']) {
        case Success('precise\n'):
          exec('eval', ['echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list']);
        case Success('trusty\n'):
          exec('eval', ['echo "deb http://download.mono-project.com/repo/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/mono-official.list']);
        case Success('xenial\n'):
          exec('eval', ['echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list']);
        default:
      }
      exec('eval', ['sudo apt-get update']);

      aptGet('mono-devel');
      aptGet('mono-mcs');

      // print the effective mono version
      exec('mono', ['-V']);
    }

    var main = Travix.getMainClassLocalName();

    installLib('hxcs');

    build(['-cs', 'bin/cs/'], function () {
      if (Travix.isWindows)
        exec('bin\\cs\\bin\\$main.exe');
      else
        exec('mono', ['bin/cs/bin/$main.exe']);
    });
  }
}


package unihx.pvt.editor;
import unityengine.*;
import unityeditor.*;

@:nativeGen @:native("HaxeBuild") class HaxeBuild extends EditorWindow
{
	@:meta(UnityEditor.MenuItem("Window/Haxe Build Properties"))
	static function init()
	{
		var window:HaxeBuild = ScriptableObject.CreateInstance();
		window.Show();
	}

	function OnGUI()
	{
		HxInspector.HxmlOnGUI(Globals.chain.hxml);
	}
}

Add shortcut for build properties; Only add a single window

package unihx.pvt.editor;
import unityengine.*;
import unityeditor.*;

@:nativeGen class HaxeBuild extends EditorWindow
{
	@:meta(UnityEditor.MenuItem("Window/Haxe Build Properties %&h"))
	static function init()
	{
		var window:HaxeBuild = cast EditorWindow.GetWindow( cs.Lib.toNativeType(HaxeBuild), false, "build.hxml", true );
	}

	function OnGUI()
	{
		HxInspector.HxmlOnGUI(Globals.chain.hxml);
	}
}


//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.server;

import flambe.util.Logger;

class SystemLogHander
    implements LogHandler
{
    public function new (syslog :Dynamic, tag :String)
    {
        _syslog = syslog;
        _syslog.init(tag, 0, syslog.LOG_LOCAL0);
    }

    public function log (level :LogLevel, message :String)
    {
        var sysLevel = switch (level) {
            case Info: _syslog.LOG_INFO;
            case Warn: _syslog.LOG_WARNING;
            case Error: _syslog.LOG_ERR;
        };
        _syslog.log(sysLevel, message);
    }

    private var _syslog :Dynamic;
}

Include the PID in server logging.

//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.server;

import flambe.util.Logger;

class SystemLogHander
    implements LogHandler
{
    public function new (syslog :Dynamic, tag :String)
    {
        _syslog = syslog;
        _syslog.init(tag, syslog.LOG_PID, syslog.LOG_LOCAL0);
    }

    public function log (level :LogLevel, message :String)
    {
        var sysLevel = switch (level) {
            case Info: _syslog.LOG_INFO;
            case Warn: _syslog.LOG_WARNING;
            case Error: _syslog.LOG_ERR;
        };
        _syslog.log(sysLevel, message);
    }

    private var _syslog :Dynamic;
}


package nme.app;

@:nativeProperty
class EventName
{
   public static inline var KEY_DOWN = "keyDown";
   public static inline var KEY_UP = "keyUp";
   public static inline var MOUSE_MOVE = "mouseMove";
   public static inline var MOUSE_DOWN = "mouseDown";
   public static inline var MOUSE_UP = "mouseUp";
   public static inline var CLICK = "click";

   public static inline var TOUCH_BEGIN = "touchBegin";
   public static inline var TOUCH_MOVE = "touchMove";
   public static inline var TOUCH_END = "touchEnd";
   public static inline var TOUCH_TAP = "touchTap";

   public static inline var AXIS_MOVE = "axisMove";
   public static inline var BALL_MOVE = "ballMove";
   public static inline var HAT_MOVE = "hatMove";
   public static inline var BUTTON_DOWN = "downMove";
   public static inline var BUTTON_UP = "upMove";
}

Fix event names for joystick

package nme.app;

@:nativeProperty
class EventName
{
   public static inline var KEY_DOWN = "keyDown";
   public static inline var KEY_UP = "keyUp";
   public static inline var MOUSE_MOVE = "mouseMove";
   public static inline var MOUSE_DOWN = "mouseDown";
   public static inline var MOUSE_UP = "mouseUp";
   public static inline var CLICK = "click";

   public static inline var TOUCH_BEGIN = "touchBegin";
   public static inline var TOUCH_MOVE = "touchMove";
   public static inline var TOUCH_END = "touchEnd";
   public static inline var TOUCH_TAP = "touchTap";

   public static inline var AXIS_MOVE = "axisMove";
   public static inline var BALL_MOVE = "ballMove";
   public static inline var HAT_MOVE = "hatMove";
   public static inline var BUTTON_DOWN = "buttonDown";
   public static inline var BUTTON_UP = "buttonUp";
   public static inline var DEVICE_ADDED = "deviceAdded";
   public static inline var DEVICE_REMOVED = "deviceRemoved";
}


package unreal;

extern class AVolume_Extra {

  /** @returns true if a sphere/point (with optional radius CheckRadius) overlaps this volume */
  public function EncompassesPoint(point:FVector, sphereRadius:Float32, OutDistanceToPoint:Ptr<Float32>) : Bool;
}

Update to latest perforce change

package unreal;

extern class AVolume_Extra {

  /** @returns true if a sphere/point (with optional radius CheckRadius) overlaps this volume */
  public function EncompassesPoint(point:FVector, sphereRadius:Float32, OutDistanceToPoint:Ptr<Float32>) : Bool;

	/** @returns the coarse bounds of this volume */
  @:thisConst
	public function GetBounds() : FBoxSphereBounds;
}


package unreal;

extern class UProjectileMovementComponent_Extra
{
	function HasStoppedSimulation() : Bool;
}

Update to latest perforce change

package unreal;

extern class UProjectileMovementComponent_Extra
{
	function HasStoppedSimulation() : Bool;

	/** Compute the distance we should move in the given time, at a given a velocity. */
	@:thisConst
	private function ComputeMoveDelta(InVelocity:PRef<Const<FVector>>, DeltaTime:Float32) : FVector;
}


package luxe.components.physics.nape;

#if nape

import nape.geom.Vec2;
import nape.phys.Body;
import nape.phys.BodyType;
import nape.shape.Polygon;

import luxe.Vector;
import luxe.components.physics.nape.NapeBody;

typedef PolygonColliderOptions = {

    > NapeBodyOptions,

        /** the x position of the circle */
    var x : Float;
        /** the y position of the circle */
    var y : Float;
        /** The local vertices of the polygon */
    var polygon : Array<Vector>;

} //PolygonColliderOptions

class PolygonCollider extends NapeBody {

    var options : PolygonColliderOptions;

    public function new(_options : PolygonColliderOptions) : Void {

        options = _options;

        super(options);

    } //new

    override function onadded() {

        super.onadded();

            var verts = [];
            for(point in options.polygon) {
                verts.push( new Vec2(point.x, point.y) );
            }

            body.shapes.add(new Polygon(verts, options.material, options.filter));
            body.position.setxy(options.x, options.y);

        post_add();

    } //onadded

} //PolygonCollider

#end //nape

Align body after creating polygon collider

package luxe.components.physics.nape;

#if nape

import nape.geom.Vec2;
import nape.phys.Body;
import nape.phys.BodyType;
import nape.shape.Polygon;

import luxe.Vector;
import luxe.components.physics.nape.NapeBody;

typedef PolygonColliderOptions = {

    > NapeBodyOptions,

        /** the x position of the circle */
    var x : Float;
        /** the y position of the circle */
    var y : Float;
        /** The local vertices of the polygon */
    var polygon : Array<Vector>;

} //PolygonColliderOptions

class PolygonCollider extends NapeBody {

    var options : PolygonColliderOptions;

    public function new(_options : PolygonColliderOptions) : Void {

        options = _options;

        super(options);

    } //new

    override function onadded() {

        super.onadded();

            var verts = [];
            for(point in options.polygon) {
                verts.push( new Vec2(point.x, point.y) );
            }

            body.shapes.add(new Polygon(verts, options.material, options.filter));
            body.position.setxy(options.x, options.y);
            body.align();

        post_add();

    } //onadded

} //PolygonCollider

#end //nape


package lime.tools.helpers;

import lime.project.HXProject;

class DeploymentHelper {

	public static function deploy (project:HXProject, targetFlags:Map <String, String>, targetDirectory:String, targetName:String) {

		var name = project.meta.title + " (" + project.meta.version + " build " + project.meta.buildNumber + ") (" + targetName + ").zip";
		var targetPath = PathHelper.combine (targetDirectory, name);

		ZipHelper.compress (PathHelper.combine (targetDirectory, "bin"), targetPath);

		if (targetFlags.exists ("gdrive")) {

			var parent = targetFlags.get ("parent");

			if (parent != null && parent != "") {

				ProcessHelper.runCommand ("", "drive", [ "upload", "-f", targetPath, "-p", parent ]);

			} else {

				ProcessHelper.runCommand ("", "drive", [ "upload", "-f", targetPath ]);

			}

		}

	}

}

Add "config" option for deployment helper

package lime.tools.helpers;

import lime.project.HXProject;

class DeploymentHelper {

	public static function deploy (project:HXProject, targetFlags:Map <String, String>, targetDirectory:String, targetName:String) {

		var name = project.meta.title + " (" + project.meta.version + " build " + project.meta.buildNumber + ") (" + targetName + ").zip";
		var targetPath = PathHelper.combine (targetDirectory, name);

		ZipHelper.compress (PathHelper.combine (targetDirectory, "bin"), targetPath);

		if (targetFlags.exists ("gdrive")) {

			var parent = targetFlags.get ("parent");

			var args = ["upload" , "-f" , targetPath];

			if (targetFlags.exists("config")) {

				args.push("--config");
				args.push(targetFlags.get("config"));

			}

			if (parent != null && parent != "") {

				args.push("-p");
				args.push(parent);

			}

			ProcessHelper.runCommand("","drive",args);

		}

	}

}


package vshaxe;

/**
	@since 2.13.0
**/
typedef HaxeInstallationProvider = {
	/**
		Called when vshaxe selects the provider for providing the Haxe installation.

		@param provideInstallation A callback that should be cached by the provider, and called whenever the Haxe installation changes.
									Should only be called when necessary.
	**/
	function activate(provideInstallation:HaxeInstallation->Void):Void;

	/**
		Called when this Haxe installation provider is no longer active, for instance because the user has chosen to use
		another provider.

		*Note:* a deactivated provider can be activated again!
	**/
	function deactivate():Void;

	/**
		Optionally resolves classpaths to libraries for the Haxe Dependencies view,
		or `null` if the classpath does not belong to a library.
	**/
	var ?resolveLibrary:(classpath:String) -> Null<Library>;

	/**
		Optionally lists available libraries for HXML `--library` completion.
	**/
	var ?listLibraries:() -> Array<{name:String}>;
}

Add `@since` to doc comment

package vshaxe;

/**
	@since 2.13.0
**/
typedef HaxeInstallationProvider = {
	/**
		Called when vshaxe selects the provider for providing the Haxe installation.

		@param provideInstallation A callback that should be cached by the provider, and called whenever the Haxe installation changes.
									Should only be called when necessary.
	**/
	function activate(provideInstallation:HaxeInstallation->Void):Void;

	/**
		Called when this Haxe installation provider is no longer active, for instance because the user has chosen to use
		another provider.

		*Note:* a deactivated provider can be activated again!
	**/
	function deactivate():Void;

	/**
		Optionally resolves classpaths to libraries for the Haxe Dependencies view,
		or `null` if the classpath does not belong to a library.
	**/
	var ?resolveLibrary:(classpath:String) -> Null<Library>;

	/**
		Optionally lists available libraries for HXML `--library` completion.

		@since 2.21.0
	**/
	var ?listLibraries:() -> Array<{name:String}>;
}


package unreal.umg;

import unreal.slatecore.*;

extern class UScrollBox_Extra {
	public function GetViewFraction() : Float32;
}

Update to latest perforce change

package unreal.umg;

import unreal.slatecore.*;

extern class UScrollBox_Extra {
	public function GetViewFraction() : Float32;

	public function GetWidgetScrollOffset(WidgetToFind : UWidget, @:opt("IntoView") ScrollDestination : unreal.slate.EDescendantScrollDestination) : Float32;
}


package unreal.umg;

import unreal.slatecore.*;
import unreal.umg.*;

@:glueCppIncludes("UserWidget.h", "Animation/UMGSequencePlayer.h")
extern class UUMGSequencePlayer_Extra {

	public function GetAnimation() : UWidgetAnimation;

	public function Pause() : Void;

	public function Stop() : Void;

	#if proletariat
	public function Skip() : Void;
	#end

	public function Reverse() : Void;

	public function SetNumLoopsToPlay(InNumLoopsToPlay:Int32) : Void;

	public function SetPlaybackSpeed(PlaybackSpeed:Float32) : Void;
}

Update to latest perforce change

package unreal.umg;

import unreal.moviescene.EMovieScenePlayerStatus;
import unreal.slatecore.*;
import unreal.umg.*;

@:glueCppIncludes("UserWidget.h", "Animation/UMGSequencePlayer.h")
extern class UUMGSequencePlayer_Extra {

	public function GetAnimation() : UWidgetAnimation;

	public function Play(StartAtTime:Float32, InNumLoopsToPlay:Int32, InPlayMode:EUMGSequencePlayMode, InPlaybackSpeed:Float32) : Void;

	public function PlayTo(StartAtTime:Float32, EndAtTime:Float32, InNumLoopsToPlay:Int32, InPlayMode:EUMGSequencePlayMode, InPlaybackSpeed:Float32) : Void;

	public function Pause() : Void;

	public function Stop() : Void;

	#if proletariat
	public function Skip() : Void;
	#end

	public function Reverse() : Void;

	public function SetNumLoopsToPlay(InNumLoopsToPlay:Int32) : Void;

	public function SetPlaybackSpeed(PlaybackSpeed:Float32) : Void;

	public function GetPlaybackStatus() : EMovieScenePlayerStatus;

	public function IsPlayingForward() : Bool;
}


package cncta.ui;

class ChatWindow extends cncta.inject.ui.CustomWindow
{
    private var view:cncta.ui.chat.ChatView;
    private var input:cncta.ui.chat.ChatInput;

    public function new()
    {
        super("Chat");

        this.setLayout(new qx.ui.layout.VBox());

        this.set({
            allowMaximize: true,
            allowMinimize: false,
            showMaximize: true,
            showMinimize: false,
            showStatusbar: false,
            resizable: true,
            movable: true,
            alwaysOnTop: false,
            showClose: true,
        });

        this.view = new cncta.ui.chat.ChatView();
        this.input = new cncta.ui.chat.ChatInput();

        this.add(this.view);
        this.add(this.input);

        this.input.on_send = this.message_input;
    }

    private inline function message_input(text:String)
    {
        this.on_send(text);
    }

    public dynamic function on_send(text:String):Void {}

    public inline function add_message(nick:String, text:String)
    {
        this.view.add_message(nick, text);
    }
}

Bring to front and center chat win on appearance.

package cncta.ui;

class ChatWindow extends cncta.inject.ui.CustomWindow
{
    private var view:cncta.ui.chat.ChatView;
    private var input:cncta.ui.chat.ChatInput;

    public function new()
    {
        super("Chat");

        this.setLayout(new qx.ui.layout.VBox());

        this.set({
            allowMaximize: true,
            allowMinimize: false,
            showMaximize: true,
            showMinimize: false,
            showStatusbar: false,
            resizable: true,
            movable: true,
            alwaysOnTop: false,
            showClose: true,
        });

        this.view = new cncta.ui.chat.ChatView();
        this.input = new cncta.ui.chat.ChatInput();

        this.add(this.view);
        this.add(this.input);

        this.input.on_send = this.message_input;

        this.addListener("appear", this.on_appear);
    }

    private function on_appear()
    {
        this.centerPosition();
        this.bringToFront();
    }

    private inline function message_input(text:String)
    {
        this.on_send(text);
    }

    public dynamic function on_send(text:String):Void {}

    public inline function add_message(nick:String, text:String)
    {
        this.view.add_message(nick, text);
    }
}


package unreal.assetregistry;

@:noCopy
@:noEquals
@:glueCppIncludes("IAssetRegistry.h")
@:uextern extern class IAssetRegistry {
}

Update to latest perforce change

package unreal.assetregistry;

@:noCopy
@:noEquals
@:glueCppIncludes("IAssetRegistry.h")
@:uextern extern interface IAssetRegistry {
}


//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform;

import flambe.util.Signal1;
import flambe.util.SignalConnection;
import flambe.util.Value;

/** An internal Signal1 with extra frills. */
class HeavySignal1<A> extends Signal1<A>
{
    /**
     * A watchable value, for detecting when the first listener was connected, or the last
     * connection was disposed.
     */
    public var hasListenersValue (default, null) :Value<Bool>;

    public function new (?listener :Listener1<A>)
    {
        super(listener);
        hasListenersValue = new Value<Bool>(hasListeners());
    }

    override public function connect (listener :Listener1<A>, prioritize :Bool = false) :SignalConnection
    {
        var connection = super.connect(listener, prioritize);
        hasListenersValue._ = hasListeners();
        return connection;
    }

    override public function _internal_disconnect (conn :SignalConnection)
    {
        super._internal_disconnect(conn);
        hasListenersValue._ = hasListeners();
    }
}

Update hasListenersValue after an emit.

//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.platform;

import flambe.util.Signal1;
import flambe.util.SignalConnection;
import flambe.util.Value;

/** An internal Signal1 with extra frills. */
class HeavySignal1<A> extends Signal1<A>
{
    /**
     * A watchable value, for detecting when the first listener was connected, or the last
     * connection was disposed.
     */
    public var hasListenersValue (default, null) :Value<Bool>;

    public function new (?listener :Listener1<A>)
    {
        super(listener);
        hasListenersValue = new Value<Bool>(hasListeners());
    }

    override public function connect (listener :Listener1<A>, prioritize :Bool = false) :SignalConnection
    {
        var connection = super.connect(listener, prioritize);
        hasListenersValue._ = hasListeners();
        return connection;
    }

    override public function _internal_disconnect (conn :SignalConnection)
    {
        super._internal_disconnect(conn);
        hasListenersValue._ = hasListeners();
    }

    override private function didEmit (head :SignalConnection)
    {
        super.didEmit(head);
        hasListenersValue._ = hasListeners();
    }
}


package thx.fp;

import thx.Tuple;
import thx.fp.State.*;
using thx.Functions;

import utest.Assert;

class TestState {
  public function new() {}

  public function testMap() {
    var s: State<String, Int> = pure(1).map.fn(_ + 1);
    Assert.same(new Tuple("a", 2), s("a"));
  }

  public function testFlatMap() {
    var s: State<String, Int> = pure(1);

    var f: Int -> State<String, Int> = function(i: Int) {
      return s.modify.fn(_ + "b").map.fn(_ + i);
    }

    Assert.same(new Tuple("ab", 2), (s >>= f)("a"));
  }
}

Fix removal of operator overload.

package thx.fp;

import thx.Tuple;
import thx.fp.State.*;
using thx.Functions;

import utest.Assert;

class TestState {
  public function new() {}

  public function testMap() {
    var s: State<String, Int> = pure(1).map.fn(_ + 1);
    Assert.same(new Tuple("a", 2), s("a"));
  }

  public function testFlatMap() {
    var s: State<String, Int> = pure(1);

    var f: Int -> State<String, Int> = function(i: Int) {
      return s.modify.fn(_ + "b").map.fn(_ + i);
    }

    Assert.same(new Tuple("ab", 2), (s.flatMap(f))("a"));
  }
}


package cpp;

@:coreType @:structAccess @:include("cpp/Pointer.h")
extern class Function<T>
{
   public function new(d:Dynamic);

   // Actually a function pointer, but can be called using haxe notation
	public var call(default,null):T;

   public static function getProcAddress<T>(inModule:String, inFunction:String) : Function<T>;
   public static function fromStaticFunction<T>(inStaticFunction:T) : Function<T>;

	public function lt(inOther:Function<T>):Bool;
	public function leq(inOther:Function<T>):Bool;
	public function gt(inOther:Function<T>):Bool;
	public function geq(inOther:Function<T>):Bool;

}

Mark cpp.Funciton class as no_simplification

package cpp;

@:coreType @:structAccess @:include("cpp/Pointer.h")
@:analyzer(no_simplification)
extern class Function<T>
{
   public function new(d:Dynamic);

   // Actually a function pointer, but can be called using haxe notation
	public var call(default,null):T;

   public static function getProcAddress<T>(inModule:String, inFunction:String) : Function<T>;
   public static function fromStaticFunction<T>(inStaticFunction:T) : Function<T>;

	public function lt(inOther:Function<T>):Bool;
	public function leq(inOther:Function<T>):Bool;
	public function gt(inOther:Function<T>):Bool;
	public function geq(inOther:Function<T>):Bool;

}


package unreal;

#if PLATFORM_SWITCH
@:glueCppIncludes("Switch/SwitchPlatformMisc.h")
@:noEquals @:noCopy @:uextern extern class FSwitchPlatformMisc {
  #if proletariat
  static function ShowErrorDialog(category:Int32, number:Int32):Void;
  #end
}
#end

Update to latest perforce change

package unreal;

#if PLATFORM_SWITCH
@:glueCppIncludes("Switch/SwitchPlatformMisc.h")
@:noEquals @:noCopy @:uextern extern class FSwitchPlatformMisc {
  #if proletariat
  static function ShowErrorDialog(category:Int32, number:Int32):Void;
  static function IsNifmAvailable():Bool;
  #end
}
#end


/*
 * Copyright (C)2005-2012 Haxe Foundation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */
package java.internal;

@:native('haxe.lang.IEquatable')
@:keep
interface IEquatable
{

	public function equals(to:Dynamic):Bool;

}

Allow classes to implement their own equals without HxObject

/*
 * Copyright (C)2005-2012 Haxe Foundation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */
package java.internal;

@:native('haxe.lang.IEquatable')
@:keep
@:nativeGen
interface IEquatable
{

	public function equals(to:Dynamic):Bool;

}


class GetReady implements IUserScriptTemplate
{
    public function new()
    {
    }

    private function make_loader(code:String)
    {
        var out = "";

        out += "(function(){";
        out +=     "inject__ = document.createElement('script');";
        out +=     "inject__.type = 'text/javascript';";
        out +=     "inject__.appendChild(document.createTextNode(";
        out +=         code;
        out +=     "));";
        out +=     "document.getElementsByTagName('head')[0].";
        out +=         "appendChild(inject__);";
        out += "})();";

        return out;
    }

    public function generate(code:String):String
    {
        return this.make_loader(code);
    }
}

Implement preliminary watch for webfrontend.

class GetReady implements IUserScriptTemplate
{
    public function new()
    {
    }

    private function get_watcher_on(teststr:String, code:String)
    {
        var out = "";

        out += "(function() {";
        out += "var wtimer__;";
        out += "function watch_timer__(){";
        out +=     "if(" + teststr + "){";
        out +=         this.make_loader(code);
        out +=         "window.clearInterval(wtimer__);";
        out +=     "}";
        out += "}";
        out += "var wtimer__ = window.setInterval(watch_timer__, 1000);";
        out += "})();";

        return out;
    }

    private function make_loader(code:String)
    {
        var out = "";

        out += "(function(){";
        out +=     "inject__ = document.createElement('script');";
        out +=     "inject__.type = 'text/javascript';";
        out +=     "inject__.appendChild(document.createTextNode(";
        out +=         code;
        out +=     "));";
        out +=     "document.getElementsByTagName('head')[0].";
        out +=         "appendChild(inject__);";
        out += "})();";

        return out;
    }

    public function generate(code:String):String
    {
        return this.get_watcher_on("typeof(webfrontend) == 'object'", code);
    }
}


package unreal.slatecore;

extern class FSlateColor_Extra {
  @:uname(".ctor") static function create(color:Const<PRef<FLinearColor>>):FSlateColor;
  @:uname("new") static function createNew(color:Const<PRef<FLinearColor>>):POwnedPtr<FSlateColor>;
}

Update to latest perforce change

package unreal.slatecore;

extern class FSlateColor_Extra {
  @:uname(".ctor") static function create(color:Const<PRef<FLinearColor>>):FSlateColor;
  @:uname("new") static function createNew(color:Const<PRef<FLinearColor>>):POwnedPtr<FSlateColor>;

  public function GetSpecifiedColor() : Const<FLinearColor>;
}


package coconut.ui.macros;

#if !macro
  #error
#end
import haxe.macro.*;
import tink.hxx.*;
using tink.MacroApi;
using tink.CoreApi;

class HXX {

  static public var defaults(default, never) = new tink.priority.Queue<Lazy<Array<Named<Tag>>>>();

  static public var generator = new Generator(function ()
    return [for (group in defaults) for (tag in group.get()) tag]
  );
  static public function parse(e:Expr) {
    var ctx = generator.createContext();
    return ctx.generateRoot(
      Parser.parseRoot(e, {
        defaultExtension: 'hxx',
        noControlStructures: false,
        defaultSwitchTarget: macro __data__,
        isVoid: ctx.isVoid,
        fragment: Context.definedValue('hxx_fragment'),
        treatNested: function (children) return ctx.generateRoot.bind(children).bounce(),
      })
    );
  }
}

Update to match latest hxx.

package coconut.ui.macros;

#if !macro
  #error
#end
import haxe.macro.*;
import tink.hxx.*;
using tink.MacroApi;
using tink.CoreApi;

class HXX {

  static public var defaults(default, never) = new tink.priority.Queue<Lazy<Array<Named<Expr.Position->Tag>>>>();

  static public var generator = new Generator(function ()
    return [for (group in defaults) for (tag in group.get()) tag]
  );
  static public function parse(e:Expr) {
    var ctx = generator.createContext();
    return ctx.generateRoot(
      Parser.parseRoot(e, {
        defaultExtension: 'hxx',
        noControlStructures: false,
        defaultSwitchTarget: macro __data__,
        isVoid: ctx.isVoid,
        fragment: Context.definedValue('hxx_fragment'),
        treatNested: function (children) return ctx.generateRoot.bind(children).bounce(),
      })
    );
  }
}


package tinx.node.io;

import tinx.node.events.Emitter;

typedef NativeIn = {>Emitter,
	var readable(default, null):Bool;
	function pause():Void;
	function resume():Void;
	function destroy():Void;
}

Add setEncoding from native API.

package tinx.node.io;

import tinx.node.events.Emitter;

typedef NativeIn = {>Emitter,
	var readable(default, null):Bool;
	function setEncoding(encoding:String):Void;
	function pause():Void;
	function resume():Void;
	function destroy():Void;
}


package lime.tools.helpers;

import haxe.io.Path;
import lime.project.Architecture;
import lime.project.Haxelib;
import lime.project.HXProject;
import lime.project.Platform;

class NodeJSHelper {

	public static function run (project:HXProject, modulePath:String, args:Array<String> = null):Void {

		/*var suffix = switch (PlatformHelper.hostPlatform) {

			case Platform.WINDOWS: "-windows.exe";
			case Platform.MAC: "-mac";
			case Platform.LINUX: "-linux";
			default: return;

		}

		if (suffix == "-linux") {

			if (PlatformHelper.hostArchitecture == Architecture.X86) {

				suffix += "32";

			} else {

				suffix += "64";

			}

		}

		var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates") ].concat (project.templatePaths);
		var node = PathHelper.findTemplate (templatePaths, "bin/node/node" + suffix);

		if (PlatformHelper.hostPlatform != Platform.WINDOWS) {

			Sys.command ("chmod", [ "+x", node ]);

		}

		if (args == null) {

			args = [];

		}*/

		args.unshift (Path.withoutDirectory (modulePath));

		//ProcessHelper.runCommand (Path.directory (modulePath), node, args);
		ProcessHelper.runCommand (Path.directory (modulePath), "iojs", args);

	}

}

Use "node" instead of "iojs"

package lime.tools.helpers;

import haxe.io.Path;
import lime.project.Architecture;
import lime.project.Haxelib;
import lime.project.HXProject;
import lime.project.Platform;

class NodeJSHelper {

	public static function run (project:HXProject, modulePath:String, args:Array<String> = null):Void {

		/*var suffix = switch (PlatformHelper.hostPlatform) {

			case Platform.WINDOWS: "-windows.exe";
			case Platform.MAC: "-mac";
			case Platform.LINUX: "-linux";
			default: return;

		}

		if (suffix == "-linux") {

			if (PlatformHelper.hostArchitecture == Architecture.X86) {

				suffix += "32";

			} else {

				suffix += "64";

			}

		}

		var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates") ].concat (project.templatePaths);
		var node = PathHelper.findTemplate (templatePaths, "bin/node/node" + suffix);

		if (PlatformHelper.hostPlatform != Platform.WINDOWS) {

			Sys.command ("chmod", [ "+x", node ]);

		}

		if (args == null) {

			args = [];

		}*/

		args.unshift (Path.withoutDirectory (modulePath));

		ProcessHelper.runCommand (Path.directory (modulePath), "node", args);

	}

}


package js.npm.passport;

typedef Profile = {
	provider : String,
	id : String,
	displayName : String,
	name : {
		familyName : String,
		givenName : String,
		middleName : String
	},
	email : Array<{
		value : String,
		type : String
	}>,
	photos : Array<{
		value : String
	}>
}

Allow multiple concurrent authentication strategies

package js.npm.passport;

typedef Profile = {
	provider : String,
	id : String,
	displayName : String,
	name : {
		familyName : String,
		givenName : String,
		middleName : String
	},
	emails : Array<{
		value : String,
		type : String
	}>,
	photos : Array<{
		value : String
	}>
}


class ApplicationDocument extends ::APP_MAIN::
{
   public function new()
   {
      #if nme
      var added:nme.display.DisplayObject = null;
      ApplicationMain.setAndroidViewHaxeObject(this);
      if (Std.is(this, nme.display.DisplayObject))
      {
         added = cast this;
         nme.Lib.current.addChild(added);
      }
      #end

      super();

      #if nme
      if (added!=null && added.stage!=null)
         added.dispatchEvent(new nme.events.Event(nme.events.Event.ADDED_TO_STAGE, false, false));
      #end
   }
}

Send 'ADDED' event too at startup

class ApplicationDocument extends ::APP_MAIN::
{
   public function new()
   {
      #if nme
      var added:nme.display.DisplayObject = null;
      ApplicationMain.setAndroidViewHaxeObject(this);
      if (Std.is(this, nme.display.DisplayObject))
      {
         added = cast this;
         nme.Lib.current.addChild(added);
      }
      #end

      super();

      #if nme
      if (added!=null && added.stage!=null)
      {
         added.dispatchEvent(new nme.events.Event(nme.events.Event.ADDED_TO_STAGE, false, false));
         added.dispatchEvent(new nme.events.Event(nme.events.Event.ADDED, false, false));
      }
      #end
   }
}


package cncta.ui.chat;

class ChatLine extends qx.ui.container.Composite
{
    public inline var is_me(default, set_is_me):Bool;
    private var nicklabel:qx.ui.basic.Label;

    public function new(date:Date, nick:String, text:String)
    {
        super(new qx.ui.layout.HBox(5));

        var time = DateTools.format(date, "%H:%M:%S");

        var bbtext = cncta.inject.Util.convertBBCode(text, true, "#ff9900");

        var timelabel = new cncta.ui.ColorLabel("#00ff00", "[" + time + "]");
        timelabel.set({selectable: true});
        this.add(timelabel);

        this.nicklabel = new qx.ui.basic.Label(nick + ":");
        this.nicklabel.set({selectable: true});
        this.is_me = false;
        this.add(this.nicklabel);

        var textlabel = new cncta.ui.ColorLabel("#ffffff", bbtext);

        textlabel.set({
            rich: true,
            wrap: true,
            selectable: true,
            allowGrowY: true,
        });

        this.add(textlabel, {flex: 1});
    }

    private inline function set_is_me(v:Bool)
    {
        this.nicklabel.set({
            textColor: (v ? "#ff5050" : "#66ffff")
        });
        return is_me = v;
    }
}

Allow word wrapping in chat line text.

package cncta.ui.chat;

class ChatLine extends qx.ui.container.Composite
{
    public inline var is_me(default, set_is_me):Bool;
    private var nicklabel:qx.ui.basic.Label;

    public function new(date:Date, nick:String, text:String)
    {
        super(new qx.ui.layout.HBox(5));

        var time = DateTools.format(date, "%H:%M:%S");

        var bbtext = cncta.inject.Util.convertBBCode(text, true, "#ff9900");

        var timelabel = new cncta.ui.ColorLabel("#00ff00", "[" + time + "]");
        timelabel.set({selectable: true});
        this.add(timelabel);

        this.nicklabel = new qx.ui.basic.Label(nick + ":");
        this.nicklabel.set({selectable: true});
        this.is_me = false;
        this.add(this.nicklabel);

        var style = "white-space:pre-wrap;word-wrap:break-word";
        var wrapped = "" + bbtext + "";
        var textlabel = new cncta.ui.ColorLabel("#ffffff", wrapped);

        textlabel.set({
            rich: true,
            wrap: true,
            selectable: true,
            allowGrowY: true,
        });

        this.add(textlabel, {flex: 1});
    }

    private inline function set_is_me(v:Bool)
    {
        this.nicklabel.set({
            textColor: (v ? "#ff5050" : "#66ffff")
        });
        return is_me = v;
    }
}