From 2ad659f77706b3bc594074be39055957c42f1250 Mon Sep 17 00:00:00 2001 From: mjk Date: Fri, 5 Mar 2021 22:15:09 +0000 Subject: [PATCH] clarify some entry points' names --- .../windows-notification/api/include/shortcutcreator.h | 2 +- plugins/windows-notification/api/include/win32.hpp | 4 ++-- plugins/windows-notification/api/src/shortcutcreator.cpp | 6 +++--- plugins/windows-notification/api/src/win32.cpp | 9 ++++----- .../src/toast_notification_builder.vala | 2 +- .../src/windows_notifications_plugin.vala | 4 ++-- plugins/windows-notification/vapi/shortcutcreator.vapi | 6 +++--- plugins/windows-notification/vapi/win32.vapi | 8 ++++---- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/plugins/windows-notification/api/include/shortcutcreator.h b/plugins/windows-notification/api/include/shortcutcreator.h index 0fdcb078..d7ba598c 100644 --- a/plugins/windows-notification/api/include/shortcutcreator.h +++ b/plugins/windows-notification/api/include/shortcutcreator.h @@ -10,7 +10,7 @@ #define NOEXCEPT #endif -EXTERN gboolean TryCreateShortcut(const gchar* aumid) NOEXCEPT; +EXTERN gboolean EnsureAumiddedShortcutExists(const gchar* aumid) NOEXCEPT; #undef EXTERN #undef NOEXCEPT diff --git a/plugins/windows-notification/api/include/win32.hpp b/plugins/windows-notification/api/include/win32.hpp index aa00121c..79d9e610 100644 --- a/plugins/windows-notification/api/include/win32.hpp +++ b/plugins/windows-notification/api/include/win32.hpp @@ -19,8 +19,8 @@ std::optional GetShortcutPath(); #define NOEXCEPT #endif -EXTERN gboolean SupportsModernNotifications() NOEXCEPT; -EXTERN gboolean SetAppModelID(const gchar* aumid) NOEXCEPT; +EXTERN gboolean IsWindows10() NOEXCEPT; +EXTERN gboolean SetProcessAumid(const gchar* aumid) NOEXCEPT; #undef EXTERN #undef NOEXCEPT diff --git a/plugins/windows-notification/api/src/shortcutcreator.cpp b/plugins/windows-notification/api/src/shortcutcreator.cpp index 49df2e3a..e7e93168 100644 --- a/plugins/windows-notification/api/src/shortcutcreator.cpp +++ b/plugins/windows-notification/api/src/shortcutcreator.cpp @@ -125,7 +125,7 @@ int32_t ValidateShortcut(const std::wstring& shortcut_path, const std::wstring& return hr; } -bool TryCreateShortcutInternal(const char *const aumid) +bool ImplEnsureAumiddedShortcutExists(const char *const aumid) { auto waumid = sview_to_wstr(aumid); if (waumid.empty()) @@ -153,8 +153,8 @@ bool TryCreateShortcutInternal(const char *const aumid) extern "C" { - gboolean TryCreateShortcut(const gchar* aumid) noexcept + gboolean EnsureAumiddedShortcutExists(const gchar* aumid) noexcept { - return g_try_invoke(TryCreateShortcutInternal, aumid); + return g_try_invoke(ImplEnsureAumiddedShortcutExists, aumid); } } diff --git a/plugins/windows-notification/api/src/win32.cpp b/plugins/windows-notification/api/src/win32.cpp index 57e99bb5..8f1051b6 100644 --- a/plugins/windows-notification/api/src/win32.cpp +++ b/plugins/windows-notification/api/src/win32.cpp @@ -29,7 +29,7 @@ std::optional GetShortcutPath() return std::nullopt; } -bool SetAppModelIDInternal(const char *const aumid) +bool ImplSetProcessAumid(const char *const aumid) { auto waumid = sview_to_wstr(aumid); if (waumid.empty()) @@ -44,7 +44,7 @@ extern "C" // Not available in mingw headers, but linking works. NTSTATUS NTAPI RtlGetVersion(PRTL_OSVERSIONINFOW); - gboolean SupportsModernNotifications() noexcept + gboolean IsWindows10() noexcept { RTL_OSVERSIONINFOW rovi = { 0 }; rovi.dwOSVersionInfoSize = sizeof(rovi); @@ -55,9 +55,8 @@ extern "C" return FALSE; } - gboolean SetAppModelID(const gchar* aumid) noexcept + gboolean SetProcessAumid(const gchar* aumid) noexcept { - return g_try_invoke(SetAppModelIDInternal, aumid); + return g_try_invoke(ImplSetProcessAumid, aumid); } } - diff --git a/plugins/windows-notification/src/toast_notification_builder.vala b/plugins/windows-notification/src/toast_notification_builder.vala index d38aca79..c8a24b51 100644 --- a/plugins/windows-notification/src/toast_notification_builder.vala +++ b/plugins/windows-notification/src/toast_notification_builder.vala @@ -12,7 +12,7 @@ namespace Dino.Plugins.WindowsNotification { } public class ToastNotificationBuilder { - private static bool _supportsModernFeatures = SupportsModernNotifications(); + private static bool _supportsModernFeatures = IsWindows10(); private Gee.List