TITANIUM_FUNCTION(DependencyObject, SetValue)
		{
			auto context = get_context();
			if (arguments.size() == 2) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_dp = static_cast<JSObject>(_0);
 
			auto wrapper_dp = object_dp.GetPrivate<Windows::UI::Xaml::DependencyProperty>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto dp = wrapper_dp->unwrapWindows_UI_Xaml_DependencyProperty();

				auto _1 = arguments.at(1);
			TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
			auto object_value = static_cast<JSObject>(_1);
 
			auto wrapper_value = object_value.GetPrivate<Platform::Object>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto value = wrapper_value->unwrapPlatform_Object();

				unwrap()->SetValue(dp, value);
				return context.CreateUndefined(); 
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched DependencyObject::SetValue with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(Canvas, SetZIndex)
		{
			auto context = get_context();
			if (arguments.size() == 2) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_element = static_cast<JSObject>(_0);
 
			auto wrapper_element = object_element.GetPrivate<Windows::UI::Xaml::UIElement>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto element = wrapper_element->unwrapWindows_UI_Xaml_UIElement();

				auto _1 = arguments.at(1); 
			TITANIUM_ASSERT_AND_THROW(_1.IsNumber(), "Expected Number");
			auto value = static_cast<int32_t>(_1);

				::Windows::UI::Xaml::Controls::Canvas::SetZIndex(element, value);
				return context.CreateUndefined(); 
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched Canvas::SetZIndex with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
	JSValue GlobalObject::requireModule(const JSObject& parent, const std::string& moduleId)
	{
		TITANIUM_GLOBALOBJECT_LOCK_GUARD;

		const auto js_context = parent.get_context();

		// check if we have special module such as ti.map
		if (requiredBuiltinModuleExists(js_context, moduleId)) {
			return requireBuiltinModule(js_context, moduleId);
		}

		// check if we have native module
		if (requiredNativeModuleExists(js_context, moduleId)) {
			return requireNativeModule(js_context, moduleId);
		}

		auto module_path = requestResolveModule(parent, moduleId);
		if (module_path.empty()) {
			// Fall back to assuming equivalent of "/" + moduleId?
			module_path = requestResolveModule(parent, "/" + moduleId);
			if (module_path.empty()) {
				detail::ThrowRuntimeError("require", "Could not load module " + moduleId);
			}
		}

		// check if we have already loaded the module
		if (module_cache__.find(module_path) != module_cache__.end()) {
			return module_cache__.at(module_path);
		}

		const auto module_js = readRequiredModule(parent, module_path);

		if (module_js.empty()) {
			detail::ThrowRuntimeError("require", "Could not load module " + moduleId);
		}

		try {
			JSValue result = js_context.CreateUndefined();
			if (boost::ends_with(module_path, ".json")){
				result = js_context.CreateValueFromJSON(module_js);
			} else if (js_context.JSCheckScriptSyntax(module_js, moduleId)) {
				const std::vector<JSValue> args = { js_context.CreateString(moduleId), js_context.CreateString(module_js) };
				result = require_function__(args, js_context.get_global_object());
			} else {
				detail::ThrowRuntimeError("require", "Could not load module "+moduleId);
			}
			if (!result.IsObject()) {
				TITANIUM_LOG_WARN("GlobalObject::require: module '", moduleId, "' replaced 'exports' with a non-object: ", to_string(result));
			}
			// cache it so that we can reuse it
			module_cache__.insert({module_path, result});
			return result;
		} catch (const std::exception& exception) {
			detail::ThrowRuntimeError("require", "Error while require("+moduleId+") "+static_cast<std::string>(exception.what()));
		} catch (...) {
			detail::ThrowRuntimeError("require", "Unknown error while require("+moduleId+")");
		}
		return js_context.CreateUndefined();
	}
		TITANIUM_FUNCTION(CoreDispatcher, StopProcessEvents)
		{
			auto context = get_context();
			if (arguments.size() == 0) {
				unwrap()->StopProcessEvents();
				return context.CreateUndefined(); 
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched CoreDispatcher::StopProcessEvents with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(CoreDispatcher, RunIdleAsync)
		{
			auto context = get_context();
			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_agileCallback = static_cast<JSObject>(_0);
 
			auto wrapper_agileCallback = object_agileCallback.GetPrivate<Windows::UI::Core::IdleDispatchedHandler>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto agileCallback = wrapper_agileCallback->unwrapWindows_UI_Core_IdleDispatchedHandler();

				auto method_result = unwrap()->RunIdleAsync(agileCallback);

			auto result = context.CreateObject(JSExport<Windows::Foundation::IAsyncAction>::Class());
			auto result_wrapper = result.GetPrivate<Windows::Foundation::IAsyncAction>();
			result_wrapper->wrap(method_result);

				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched CoreDispatcher::RunIdleAsync with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(File, write)
		{
			const auto js_context = this_object.get_context();

			if (arguments.size() < 1) {
				return js_context.CreateUndefined();
			}

			const auto _0 = arguments.at(0);

			const auto _1 = arguments.size() < 2 ? js_context.CreateBoolean(false) : arguments.at(1);
			TITANIUM_ASSERT(_1.IsBoolean());
			const auto append = static_cast<bool>(_1);

			if (_0.IsString()) {
				return js_context.CreateBoolean(write(static_cast<std::string>(arguments.at(0)), append));
			} else if (_0.IsObject()) {
				const auto js_object = static_cast<JSObject>(_0);
				const auto blob = js_object.GetPrivate<Titanium::Blob>();
				const auto file = js_object.GetPrivate<File>();
				if (blob != nullptr) {
					return js_context.CreateBoolean(write(blob, append));
				} else if (file != nullptr) {
					return js_context.CreateBoolean(write(file, append));
				}
			}
			return js_context.CreateNull();
		}
		TITANIUM_FUNCTION(CoreDispatcher, ProcessEvents)
		{
			auto context = get_context();
			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsNumber(), "Expected Number");
			auto options = static_cast<::Windows::UI::Core::CoreProcessEventsOption>(static_cast<int32_t>(_0)); // TODO Look up enum in metadata to know what type it's value is? 

				unwrap()->ProcessEvents(options);
				return context.CreateUndefined(); 
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched CoreDispatcher::ProcessEvents with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(CoreDispatcher, ShouldYield)
		{
			auto context = get_context();
			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsNumber(), "Expected Number");
			auto priority = static_cast<::Windows::UI::Core::CoreDispatcherPriority>(static_cast<int32_t>(_0)); // TODO Look up enum in metadata to know what type it's value is? 

				auto method_result = unwrap()->ShouldYield(priority);
 
			auto result = context.CreateBoolean(method_result); 

				return result;
			}

			if (arguments.size() == 0) {
				auto method_result = unwrap()->ShouldYield();
 
			auto result = context.CreateBoolean(method_result); 

				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched CoreDispatcher::ShouldYield with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
	TITANIUM_FUNCTION(API, trace)
	{
		JOIN_ARGUMENT_STRINGS(message, 0);

		const auto js_context = this_object.get_context();
		GetStaticObject(js_context).GetPrivate<API>()->trace(message.str());
		return js_context.CreateUndefined();
	}
Beispiel #10
0
	TITANIUM_FUNCTION(API, trace)
	{
		ENSURE_STRING_AT_INDEX(message, 0);
		
		const auto js_context = this_object.get_context();
		GetStaticObject(js_context).GetPrivate<API>()->trace(message);
		return js_context.CreateUndefined();
	}
TITANIUM_FUNCTION(Properties, removeProperty)
{
    ENSURE_STRING_AT_INDEX(property, 0);

    const auto js_context = this_object.get_context();
    const auto object_ptr = GetStaticObject(js_context).GetPrivate<Properties>();

    object_ptr->removeProperty(property);
    return js_context.CreateUndefined();
}
TITANIUM_FUNCTION(Properties, setString)
{
    ENSURE_STRING_AT_INDEX(property, 0);
    ENSURE_STRING_AT_INDEX(value, 1);

    const auto js_context = this_object.get_context();
    const auto object_ptr = GetStaticObject(js_context).GetPrivate<Properties>();

    object_ptr->setString(property, value);
    return js_context.CreateUndefined();
}
TITANIUM_FUNCTION(Properties, setList)
{
    ENSURE_STRING_AT_INDEX(property, 0);
    ENSURE_ARRAY_AT_INDEX(array, 1);

    const auto js_context = this_object.get_context();
    const auto object_ptr = GetStaticObject(js_context).GetPrivate<Properties>();

    object_ptr->setList(property, array);
    return js_context.CreateUndefined();
}
	TITANIUM_FUNCTION(API, log)
	{
		const auto js_context = this_object.get_context();
		if (arguments.size() == 1) {
			ENSURE_STRING_AT_INDEX(message, 0);
			GetStaticObject(js_context).GetPrivate<API>()->log("info", message);
		} else if (arguments.size() == 2) {
			ENSURE_ARGUMENT_INDEX(1);
			ENSURE_STRING_AT_INDEX(level, 0);
			JOIN_ARGUMENT_STRINGS(message, 1);
			GetStaticObject(js_context).GetPrivate<API>()->log(level, message.str());
		}

		return js_context.CreateUndefined();
	}
		TITANIUM_FUNCTION(File, open)
		{
			auto js_context = this_object.get_context();
			if (arguments.size() == 0) {
				return js_context.CreateUndefined();
			}
			const auto _0 = arguments.at(0);
			TITANIUM_ASSERT(_0.IsNumber());

			const auto result = open(Constants::to_MODE(static_cast<std::underlying_type<MODE>::type>(_0)));
			if (result != nullptr) {
				return result->get_object();
			} else {
				return js_context.CreateNull();
			}
		}
		TITANIUM_FUNCTION(File, append)
		{
			const auto js_context = this_object.get_context();

			if (arguments.size() == 0) {
				return js_context.CreateUndefined();
			}
			auto _0 = arguments.at(0);

			if (_0.IsString()) {
				return js_context.CreateBoolean(append(static_cast<std::string>(arguments.at(0))));
			} else if (_0.IsObject()) {
				const auto js_object = static_cast<JSObject>(_0);
				const auto blob = js_object.GetPrivate<Titanium::Blob>();
				const auto file = js_object.GetPrivate<File>();
				if (blob != nullptr) {
					return js_context.CreateBoolean(append(blob));
				} else if (file != nullptr) {
					return js_context.CreateBoolean(append(file));
				}
			}
			return js_context.CreateNull();
		}
		TITANIUM_FUNCTION(GeneralTransform, TransformBounds)
		{
			auto context = get_context();
			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_rect = static_cast<JSObject>(_0);
			::Windows::Foundation::Rect rect;
			// Assign fields explicitly since we didn't use a constructor

			auto object_rect_X = object_rect.GetProperty("X"); 
			TITANIUM_ASSERT_AND_THROW(object_rect_X.IsNumber(), "Expected Number");
			auto object_rect_X_ = static_cast<float>(static_cast<double>(object_rect_X));

			rect.X = object_rect_X_;

			auto object_rect_Y = object_rect.GetProperty("Y"); 
			TITANIUM_ASSERT_AND_THROW(object_rect_Y.IsNumber(), "Expected Number");
			auto object_rect_Y_ = static_cast<float>(static_cast<double>(object_rect_Y));

			rect.Y = object_rect_Y_;

			auto object_rect_Width = object_rect.GetProperty("Width"); 
			TITANIUM_ASSERT_AND_THROW(object_rect_Width.IsNumber(), "Expected Number");
			auto object_rect_Width_ = static_cast<float>(static_cast<double>(object_rect_Width));

			rect.Width = object_rect_Width_;

			auto object_rect_Height = object_rect.GetProperty("Height"); 
			TITANIUM_ASSERT_AND_THROW(object_rect_Height.IsNumber(), "Expected Number");
			auto object_rect_Height_ = static_cast<float>(static_cast<double>(object_rect_Height));

			rect.Height = object_rect_Height_;

				auto method_result = unwrap()->TransformBounds(rect);

			auto result = context.CreateObject();


			auto method_result_X_ = context.CreateNumber(static_cast<double>(method_result.X));

			result.SetProperty("X", method_result_X_);



			auto method_result_Y_ = context.CreateNumber(static_cast<double>(method_result.Y));

			result.SetProperty("Y", method_result_Y_);



			auto method_result_Width_ = context.CreateNumber(static_cast<double>(method_result.Width));

			result.SetProperty("Width", method_result_Width_);



			auto method_result_Height_ = context.CreateNumber(static_cast<double>(method_result.Height));

			result.SetProperty("Height", method_result_Height_);

				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched GeneralTransform::TransformBounds with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(DependencyProperty, RegisterAttached)
		{
			auto context = get_context();
			if (arguments.size() == 4) {
				auto _0 = arguments.at(0); 
			TITANIUM_ASSERT_AND_THROW(_0.IsString(), "Expected String");
			auto name = TitaniumWindows::Utility::ConvertUTF8String(static_cast<std::string>(_0));

				auto _1 = arguments.at(1);
			TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
			auto object_propertyType = static_cast<JSObject>(_1);
			::Windows::UI::Xaml::Interop::TypeName propertyType;
			// Assign fields explicitly since we didn't use a constructor

			auto object_propertyType_Name = object_propertyType.GetProperty("Name"); 
			TITANIUM_ASSERT_AND_THROW(object_propertyType_Name.IsString(), "Expected String");
			auto object_propertyType_Name_ = TitaniumWindows::Utility::ConvertUTF8String(static_cast<std::string>(object_propertyType_Name));

			propertyType.Name = object_propertyType_Name_;

			auto object_propertyType_Kind = object_propertyType.GetProperty("Kind");
			TITANIUM_ASSERT_AND_THROW(object_propertyType_Kind.IsNumber(), "Expected Number");
			auto object_propertyType_Kind_ = static_cast<::Windows::UI::Xaml::Interop::TypeKind>(static_cast<int32_t>(object_propertyType_Kind)); // TODO Look up enum in metadata to know what type it's value is? 

			propertyType.Kind = object_propertyType_Kind_;

				auto _2 = arguments.at(2);
			TITANIUM_ASSERT_AND_THROW(_2.IsObject(), "Expected Object");
			auto object_ownerType = static_cast<JSObject>(_2);
			::Windows::UI::Xaml::Interop::TypeName ownerType;
			// Assign fields explicitly since we didn't use a constructor

			auto object_ownerType_Name = object_ownerType.GetProperty("Name"); 
			TITANIUM_ASSERT_AND_THROW(object_ownerType_Name.IsString(), "Expected String");
			auto object_ownerType_Name_ = TitaniumWindows::Utility::ConvertUTF8String(static_cast<std::string>(object_ownerType_Name));

			ownerType.Name = object_ownerType_Name_;

			auto object_ownerType_Kind = object_ownerType.GetProperty("Kind");
			TITANIUM_ASSERT_AND_THROW(object_ownerType_Kind.IsNumber(), "Expected Number");
			auto object_ownerType_Kind_ = static_cast<::Windows::UI::Xaml::Interop::TypeKind>(static_cast<int32_t>(object_ownerType_Kind)); // TODO Look up enum in metadata to know what type it's value is? 

			ownerType.Kind = object_ownerType_Kind_;

				auto _3 = arguments.at(3);
			TITANIUM_ASSERT_AND_THROW(_3.IsObject(), "Expected Object");
			auto object_defaultMetadata = static_cast<JSObject>(_3);
 
			auto wrapper_defaultMetadata = object_defaultMetadata.GetPrivate<Windows::UI::Xaml::PropertyMetadata>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto defaultMetadata = wrapper_defaultMetadata->unwrapWindows_UI_Xaml_PropertyMetadata();

				auto method_result = ::Windows::UI::Xaml::DependencyProperty::RegisterAttached(name, propertyType, ownerType, defaultMetadata);

			auto result = context.CreateObject(JSExport<Windows::UI::Xaml::DependencyProperty>::Class());
			auto result_wrapper = result.GetPrivate<Windows::UI::Xaml::DependencyProperty>();
			result_wrapper->wrap(method_result);

				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched DependencyProperty::RegisterAttached with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(PropertyMetadata, Create)
		{
			auto context = get_context();
			if (arguments.size() == 2) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_createDefaultValueCallback = static_cast<JSObject>(_0);
 
			auto wrapper_createDefaultValueCallback = object_createDefaultValueCallback.GetPrivate<Windows::UI::Xaml::CreateDefaultValueCallback>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto createDefaultValueCallback = wrapper_createDefaultValueCallback->unwrapWindows_UI_Xaml_CreateDefaultValueCallback();

				auto _1 = arguments.at(1);
			TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
			auto object_propertyChangedCallback = static_cast<JSObject>(_1);
 
			auto wrapper_propertyChangedCallback = object_propertyChangedCallback.GetPrivate<Windows::UI::Xaml::PropertyChangedCallback>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto propertyChangedCallback = wrapper_propertyChangedCallback->unwrapWindows_UI_Xaml_PropertyChangedCallback();

				auto method_result = ::Windows::UI::Xaml::PropertyMetadata::Create(createDefaultValueCallback, propertyChangedCallback);

			auto result = context.CreateObject(JSExport<Windows::UI::Xaml::PropertyMetadata>::Class());
			auto result_wrapper = result.GetPrivate<Windows::UI::Xaml::PropertyMetadata>();
			result_wrapper->wrap(method_result);

				return result;
			}

			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_createDefaultValueCallback = static_cast<JSObject>(_0);
 
			auto wrapper_createDefaultValueCallback = object_createDefaultValueCallback.GetPrivate<Windows::UI::Xaml::CreateDefaultValueCallback>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto createDefaultValueCallback = wrapper_createDefaultValueCallback->unwrapWindows_UI_Xaml_CreateDefaultValueCallback();

				auto method_result = ::Windows::UI::Xaml::PropertyMetadata::Create(createDefaultValueCallback);

			auto result = context.CreateObject(JSExport<Windows::UI::Xaml::PropertyMetadata>::Class());
			auto result_wrapper = result.GetPrivate<Windows::UI::Xaml::PropertyMetadata>();
			result_wrapper->wrap(method_result);

				return result;
			}

			if (arguments.size() == 2) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_defaultValue = static_cast<JSObject>(_0);
 
			auto wrapper_defaultValue = object_defaultValue.GetPrivate<Platform::Object>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto defaultValue = wrapper_defaultValue->unwrapPlatform_Object();

				auto _1 = arguments.at(1);
			TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
			auto object_propertyChangedCallback = static_cast<JSObject>(_1);
 
			auto wrapper_propertyChangedCallback = object_propertyChangedCallback.GetPrivate<Windows::UI::Xaml::PropertyChangedCallback>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto propertyChangedCallback = wrapper_propertyChangedCallback->unwrapWindows_UI_Xaml_PropertyChangedCallback();

				auto method_result = ::Windows::UI::Xaml::PropertyMetadata::Create(defaultValue, propertyChangedCallback);

			auto result = context.CreateObject(JSExport<Windows::UI::Xaml::PropertyMetadata>::Class());
			auto result_wrapper = result.GetPrivate<Windows::UI::Xaml::PropertyMetadata>();
			result_wrapper->wrap(method_result);

				return result;
			}

			if (arguments.size() == 1) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_defaultValue = static_cast<JSObject>(_0);
 
			auto wrapper_defaultValue = object_defaultValue.GetPrivate<Platform::Object>();
			// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
			// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
			auto defaultValue = wrapper_defaultValue->unwrapPlatform_Object();

				auto method_result = ::Windows::UI::Xaml::PropertyMetadata::Create(defaultValue);

			auto result = context.CreateObject(JSExport<Windows::UI::Xaml::PropertyMetadata>::Class());
			auto result_wrapper = result.GetPrivate<Windows::UI::Xaml::PropertyMetadata>();
			result_wrapper->wrap(method_result);

				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched PropertyMetadata::Create with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}
		TITANIUM_FUNCTION(GeneralTransform, TryTransform)
		{
			auto context = get_context();
			if (arguments.size() == 2) {
				auto _0 = arguments.at(0);
			TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
			auto object_inPoint = static_cast<JSObject>(_0);
			::Windows::Foundation::Point inPoint;
			// Assign fields explicitly since we didn't use a constructor

			auto object_inPoint_X = object_inPoint.GetProperty("X"); 
			TITANIUM_ASSERT_AND_THROW(object_inPoint_X.IsNumber(), "Expected Number");
			auto object_inPoint_X_ = static_cast<float>(static_cast<double>(object_inPoint_X));

			inPoint.X = object_inPoint_X_;

			auto object_inPoint_Y = object_inPoint.GetProperty("Y"); 
			TITANIUM_ASSERT_AND_THROW(object_inPoint_Y.IsNumber(), "Expected Number");
			auto object_inPoint_Y_ = static_cast<float>(static_cast<double>(object_inPoint_Y));

			inPoint.Y = object_inPoint_Y_;

				auto _1 = arguments.at(1);
			TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
			auto object_outPoint = static_cast<JSObject>(_1);
			::Windows::Foundation::Point outPoint;
			// Assign fields explicitly since we didn't use a constructor

			auto object_outPoint_X = object_outPoint.GetProperty("X"); 
			TITANIUM_ASSERT_AND_THROW(object_outPoint_X.IsNumber(), "Expected Number");
			auto object_outPoint_X_ = static_cast<float>(static_cast<double>(object_outPoint_X));

			outPoint.X = object_outPoint_X_;

			auto object_outPoint_Y = object_outPoint.GetProperty("Y"); 
			TITANIUM_ASSERT_AND_THROW(object_outPoint_Y.IsNumber(), "Expected Number");
			auto object_outPoint_Y_ = static_cast<float>(static_cast<double>(object_outPoint_Y));

			outPoint.Y = object_outPoint_Y_;

				auto method_result = unwrap()->TryTransform(inPoint, &outPoint);
 
			auto result = context.CreateBoolean(method_result); 



			auto out_1 = context.CreateObject();


			auto outPoint_X_ = context.CreateNumber(static_cast<double>(outPoint.X));

			out_1.SetProperty("X", outPoint_X_);



			auto outPoint_Y_ = context.CreateNumber(static_cast<double>(outPoint.Y));

			out_1.SetProperty("Y", outPoint_Y_);

				_1 = out_1;
				return result;
			}

			// Catch-all if no arg count matches!
			TITANIUM_LOG_DEBUG("No method signature matched GeneralTransform::TryTransform with # of args: ", arguments.size());
			return context.CreateUndefined(); 
		}