Changeset View
Changeset View
Standalone View
Standalone View
desktop/addons/windows-pushnotifications/_nodert_generated.cpp
Show All 21 Lines | |||||
#include <ppltasks.h> | #include <ppltasks.h> | ||||
#include "CollectionsConverter.h" | #include "CollectionsConverter.h" | ||||
#include "CollectionsWrap.h" | #include "CollectionsWrap.h" | ||||
#include "node-async.h" | #include "node-async.h" | ||||
#include "NodeRtUtils.h" | #include "NodeRtUtils.h" | ||||
#include "OpaqueWrapper.h" | #include "OpaqueWrapper.h" | ||||
#include "WrapperBase.h" | #include "WrapperBase.h" | ||||
#include "Microsoft.WindowsAppSDK.1.2.221109.1\include\WindowsAppSDK-VersionInfo.h" | |||||
#include "Microsoft.WindowsAppSDK.1.2.221109.1\include\MddBootstrap.h" | |||||
#using < Microsoft.Windows.PushNotifications.WinMD> | #using < Microsoft.Windows.PushNotifications.WinMD> | ||||
// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search | // this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search | ||||
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods | // Some of the node header files brings windows definitions with the same names as some of the WinRT methods | ||||
#undef DocumentProperties | #undef DocumentProperties | ||||
#undef GetObject | #undef GetObject | ||||
#undef CreateEvent | #undef CreateEvent | ||||
#undef FindText | #undef FindText | ||||
▲ Show 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | namespace Windows | ||||
return; | return; | ||||
} | } | ||||
PushNotificationChannel *wrapper = PushNotificationChannel::Unwrap<PushNotificationChannel>(info.This()); | PushNotificationChannel *wrapper = PushNotificationChannel::Unwrap<PushNotificationChannel>(info.This()); | ||||
try | try | ||||
{ | { | ||||
::Windows::Foundation::Uri ^ result = wrapper->_instance->Uri; | ::Windows::Foundation::Uri ^ result = wrapper->_instance->Uri; | ||||
info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result)); | info.GetReturnValue().Set(NodeRT::Utils::NewString(result->ToString()->Data())); | ||||
return; | return; | ||||
} | } | ||||
catch (Platform::Exception ^ exception) | catch (Platform::Exception ^ exception) | ||||
{ | { | ||||
NodeRT::Utils::ThrowWinRtExceptionInJs(exception); | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,214 Lines • ▼ Show 20 Lines | NAN_MODULE_INIT(init) | ||||
/* | /* | ||||
if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) { | if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) { | ||||
Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()"))); | Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()"))); | ||||
return; | return; | ||||
} | } | ||||
*/ | */ | ||||
PACKAGE_VERSION version; | |||||
version.Version = Microsoft::WindowsAppSDK::Runtime::Version::UInt64; | |||||
if (FAILED(MddBootstrapInitialize(Microsoft::WindowsAppSDK::Release::MajorMinor, Microsoft::WindowsAppSDK::Release::VersionTag, version))) | |||||
{ | |||||
throw std::exception("Error in Bootstrap initialization"); | |||||
} | |||||
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannelStatusEnum(target); | NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannelStatusEnum(target); | ||||
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannel(target); | NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationChannel(target); | ||||
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationCreateChannelResult(target); | NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationCreateChannelResult(target); | ||||
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationManager(target); | NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationManager(target); | ||||
NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationReceivedEventArgs(target); | NodeRT::Microsoft::Windows::PushNotifications::InitPushNotificationReceivedEventArgs(target); | ||||
NodeRT::Utils::RegisterNameSpace("Microsoft.Windows.PushNotifications", target); | NodeRT::Utils::RegisterNameSpace("Microsoft.Windows.PushNotifications", target); | ||||
} | } | ||||
NODE_MODULE(binding, init) | NODE_MODULE(binding, init) | ||||
No newline at end of file | No newline at end of file |