// Class: openfl.display.Application

var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this

$global.Object.defineProperty(exports, "__esModule", {value: true});

var __map_reserved = {};

// Imports

var $hxClasses = require("./../../hxClasses_stub").default;
var $import = require("./../../import_stub").default;
var $extend = require("./../../extend_stub").default;
function lime_app_Application() {return require("./../../lime/app/Application");}
function openfl__$internal_Lib() {return require("./../../openfl/_internal/Lib");}
function openfl_display_MovieClip() {return require("./../../openfl/display/MovieClip");}
function openfl_display_LoaderInfo() {return require("./../../openfl/display/LoaderInfo");}
function Reflect() {return require("./../../Reflect");}
function openfl_display_Window() {return require("./../../openfl/display/Window");}

// Constructor

var Application = function() {
	(lime_app_Application().default).call(this);
	if((openfl__$internal_Lib().default).application == null) {
		(openfl__$internal_Lib().default).application = this;
	}
}

// Meta

Application.__name__ = ["openfl","display","Application"];
Application.__super__ = (lime_app_Application().default);
Application.prototype = $extend((lime_app_Application().default).prototype, {
	create: function(config) {
		this.config = config;
		this.backend.create(config);
		if((openfl__$internal_Lib().default).current == null) {
			(openfl__$internal_Lib().default).current = new (openfl_display_MovieClip().default)();
		}
		(openfl__$internal_Lib().default).current.__loaderInfo = (openfl_display_LoaderInfo().default).create(null);
		(openfl__$internal_Lib().default).current.__loaderInfo.content = (openfl__$internal_Lib().default).current;
		if(config != null) {
			if((Reflect().default).hasField(config,"fps")) {
				this.set_frameRate(config.fps);
			}
			if((Reflect().default).hasField(config,"windows")) {
				var _g = 0;
				var _g1 = config.windows;
				while(_g < _g1.length) {
					var windowConfig = _g1[_g];
					++_g;
					var $window = new (openfl_display_Window().default)(windowConfig);
					this.createWindow($window);
					break;
				}
			}
			if(this.get_preloader() == null || this.get_preloader().complete) {
				this.onPreloadComplete();
			}
		}
	}
});
Application.prototype.__class__ = $hxClasses["openfl.display.Application"] = Application;

// Init



// Statics




// Export

exports.default = Application;