Renamed badge API functions

This commit is contained in:
GamesTrap 2023-03-08 01:00:21 +01:00
parent 121fe73e93
commit 367a50e82d
No known key found for this signature in database
GPG Key ID: 31DFD452434ECDA3
21 changed files with 49 additions and 47 deletions

View File

@ -3395,10 +3395,12 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i
*/ */
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, int progressState, double value); GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, int progressState, double value);
//Use count = 0 to disable overlay/badge icon //TODO Documentation
GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* window, int count); //Use count = 0 to disable badge icon
GLFWAPI void glfwSetWindowBadge(GLFWwindow* window, int count);
GLFWAPI void glfwSetWindowTaskbarBadgeString(GLFWwindow* window, const char* string); //TODO Documentation
GLFWAPI void glfwSetWindowBadgeString(GLFWwindow* window, const char* string);
/*! @brief Retrieves the position of the content area of the specified window. /*! @brief Retrieves the position of the content area of the specified window.
* *

View File

@ -529,8 +529,8 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleCocoa, _glfwSetWindowTitleCocoa,
_glfwSetWindowIconCocoa, _glfwSetWindowIconCocoa,
_glfwSetWindowTaskbarProgressCocoa, _glfwSetWindowTaskbarProgressCocoa,
_glfwSetWindowTaskbarBadgeCocoa, _glfwSetWindowBadgeCocoa,
_glfwSetWindowTaskbarBadgeStringCocoa, _glfwSetWindowBadgeStringCocoa,
_glfwGetWindowPosCocoa, _glfwGetWindowPosCocoa,
_glfwSetWindowPosCocoa, _glfwSetWindowPosCocoa,
_glfwGetWindowSizeCocoa, _glfwGetWindowSizeCocoa,

View File

@ -231,8 +231,8 @@ void _glfwDestroyWindowCocoa(_GLFWwindow* window);
void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title); void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState, double value); void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count); void _glfwSetWindowBadgeCocoa(_GLFWwindow* window, int count);
void _glfwSetWindowTaskbarBadgeStringCocoa(_GLFWwindow* window, const char* string); void _glfwSetWindowBadgeStringCocoa(_GLFWwindow* window, const char* string);
void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos); void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos);
void _glfwSetWindowPosCocoa(_GLFWwindow* window, int xpos, int ypos); void _glfwSetWindowPosCocoa(_GLFWwindow* window, int xpos, int ypos);
void _glfwGetWindowSizeCocoa(_GLFWwindow* window, int* width, int* height); void _glfwGetWindowSizeCocoa(_GLFWwindow* window, int* width, int* height);

View File

@ -1167,7 +1167,7 @@ void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState,
window->ns.dockProgressIndicator.value = value; window->ns.dockProgressIndicator.value = value;
} }
void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count) void _glfwSetWindowBadgeCocoa(_GLFWwindow* window, int count)
{ {
if (window != NULL) if (window != NULL)
{ {
@ -1192,7 +1192,7 @@ void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count)
[NSApp dockTile].badgeLabel = string; [NSApp dockTile].badgeLabel = string;
} }
void _glfwSetWindowTaskbarBadgeStringCocoa(_GLFWwindow* window, const char* string) void _glfwSetWindowBadgeStringCocoa(_GLFWwindow* window, const char* string)
{ {
if (window != NULL) if (window != NULL)
{ {

View File

@ -707,8 +707,8 @@ struct _GLFWplatform
void (*setWindowTitle)(_GLFWwindow*,const char*); void (*setWindowTitle)(_GLFWwindow*,const char*);
void (*setWindowIcon)(_GLFWwindow*,int,const GLFWimage*); void (*setWindowIcon)(_GLFWwindow*,int,const GLFWimage*);
void (*setWindowTaskbarProgress)(_GLFWwindow*,const int,double); void (*setWindowTaskbarProgress)(_GLFWwindow*,const int,double);
void (*setWindowTaskbarBadge)(_GLFWwindow*,int); void (*setWindowBadge)(_GLFWwindow*,int);
void (*setWindowTaskbarBadgeString)(_GLFWwindow*,const char* string); void (*setWindowBadgeString)(_GLFWwindow*,const char* string);
void (*getWindowPos)(_GLFWwindow*,int*,int*); void (*getWindowPos)(_GLFWwindow*,int*,int*);
void (*setWindowPos)(_GLFWwindow*,int,int); void (*setWindowPos)(_GLFWwindow*,int,int);
void (*getWindowSize)(_GLFWwindow*,int*,int*); void (*getWindowSize)(_GLFWwindow*,int*,int*);

View File

@ -74,8 +74,8 @@ GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleNull, _glfwSetWindowTitleNull,
_glfwSetWindowIconNull, _glfwSetWindowIconNull,
_glfwSetWindowTaskbarProgressNull, _glfwSetWindowTaskbarProgressNull,
_glfwSetWindowTaskbarBadgeNull, _glfwSetWindowBadgeNull,
_glfwSetWindowTaskbarBadgeStringNull, _glfwSetWindowBadgeStringNull,
_glfwGetWindowPosNull, _glfwGetWindowPosNull,
_glfwSetWindowPosNull, _glfwSetWindowPosNull,
_glfwGetWindowSizeNull, _glfwGetWindowSizeNull,

View File

@ -90,8 +90,8 @@ void _glfwDestroyWindowNull(_GLFWwindow* window);
void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title); void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, double value); void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count); void _glfwSetWindowBadgeNull(_GLFWwindow* window, int count);
void _glfwSetWindowTaskbarBadgeStringNull(_GLFWwindow* window, const char* string); void _glfwSetWindowBadgeStringNull(_GLFWwindow* window, const char* string);
void _glfwSetWindowMonitorNull(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); void _glfwSetWindowMonitorNull(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos); void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos);
void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos); void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos);

View File

@ -191,11 +191,11 @@ void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, d
{ {
} }
void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count) void _glfwSetWindowBadgeNull(_GLFWwindow* window, int count)
{ {
} }
void _glfwSetWindowTaskbarBadgeStringNull(_GLFWwindow* window, const char* string) void _glfwSetWindowBadgeStringNull(_GLFWwindow* window, const char* string)
{ {
} }

View File

@ -221,7 +221,7 @@ void _glfwUpdateTaskbarProgressDBusPOSIX(dbus_bool_t progressVisible, double pro
dbus_message_unref(msg); dbus_message_unref(msg);
} }
void _glfwUpdateTaskbarBadgeDBusPOSIX(dbus_bool_t badgeVisible, int badgeCount) void _glfwUpdateBadgeDBusPOSIX(dbus_bool_t badgeVisible, int badgeCount)
{ {
if(!_glfw.dbus.handle || !_glfw.dbus.connection) if(!_glfw.dbus.handle || !_glfw.dbus.connection)
return; return;

View File

@ -131,4 +131,4 @@ typedef struct _GLFWDBusPOSIX
void _glfwInitDBusPOSIX(void); void _glfwInitDBusPOSIX(void);
void _glfwTerminateDBusPOSIX(void); void _glfwTerminateDBusPOSIX(void);
void _glfwUpdateTaskbarProgressDBusPOSIX(dbus_bool_t progressVisible, double progressValue); void _glfwUpdateTaskbarProgressDBusPOSIX(dbus_bool_t progressVisible, double progressValue);
void _glfwUpdateTaskbarBadgeDBusPOSIX(dbus_bool_t badgeVisible, int badgeCount); void _glfwUpdateBadgeDBusPOSIX(dbus_bool_t badgeVisible, int badgeCount);

View File

@ -639,8 +639,8 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleWin32, _glfwSetWindowTitleWin32,
_glfwSetWindowIconWin32, _glfwSetWindowIconWin32,
_glfwSetWindowTaskbarProgressWin32, _glfwSetWindowTaskbarProgressWin32,
_glfwSetWindowTaskbarBadgeWin32, _glfwSetWindowBadgeWin32,
_glfwSetWindowTaskbarBadgeStringWin32, _glfwSetWindowBadgeStringWin32,
_glfwGetWindowPosWin32, _glfwGetWindowPosWin32,
_glfwSetWindowPosWin32, _glfwSetWindowPosWin32,
_glfwGetWindowSizeWin32, _glfwGetWindowSizeWin32,

View File

@ -619,8 +619,8 @@ void _glfwDestroyWindowWin32(_GLFWwindow* window);
void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title); void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, int progressState, double value); void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count); void _glfwSetWindowBadgeWin32(_GLFWwindow* window, int count);
void _glfwSetWindowTaskbarBadgeStringWin32(_GLFWwindow* window, const char* string); void _glfwSetWindowBadgeStringWin32(_GLFWwindow* window, const char* string);
void _glfwGetWindowPosWin32(_GLFWwindow* window, int* xpos, int* ypos); void _glfwGetWindowPosWin32(_GLFWwindow* window, int* xpos, int* ypos);
void _glfwSetWindowPosWin32(_GLFWwindow* window, int xpos, int ypos); void _glfwSetWindowPosWin32(_GLFWwindow* window, int xpos, int ypos);
void _glfwGetWindowSizeWin32(_GLFWwindow* window, int* width, int* height); void _glfwGetWindowSizeWin32(_GLFWwindow* window, int* width, int* height);

View File

@ -2020,7 +2020,7 @@ static HICON GenerateGenericBadgeIcon(HWND hWnd)
return hIcon; return hIcon;
} }
void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count) void _glfwSetWindowBadgeWin32(_GLFWwindow* window, int count)
{ {
HRESULT res = S_OK; HRESULT res = S_OK;
HICON icon = NULL; HICON icon = NULL;
@ -2083,7 +2083,7 @@ void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count)
} }
} }
void _glfwSetWindowTaskbarBadgeStringWin32(_GLFWwindow* window, const char* string) void _glfwSetWindowBadgeStringWin32(_GLFWwindow* window, const char* string)
{ {
_glfwInputError(GLFW_FEATURE_UNAVAILABLE, _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
"Win32: Unable to set a string badge. Only integer badges are supported"); "Win32: Unable to set a string badge. Only integer badges are supported");

View File

@ -583,7 +583,7 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, int progressState,
_glfw.platform.setWindowTaskbarProgress(window, progressState, value); _glfw.platform.setWindowTaskbarProgress(window, progressState, value);
} }
GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* handle, int count) GLFWAPI void glfwSetWindowBadge(GLFWwindow* handle, int count)
{ {
_GLFWwindow* window = (_GLFWwindow*)handle; _GLFWwindow* window = (_GLFWwindow*)handle;
@ -595,16 +595,16 @@ GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* handle, int count)
return; return;
} }
_glfw.platform.setWindowTaskbarBadge(window, count); _glfw.platform.setWindowBadge(window, count);
} }
GLFWAPI void glfwSetWindowTaskbarBadgeString(GLFWwindow* handle, const char* string) GLFWAPI void glfwSetWindowBadgeString(GLFWwindow* handle, const char* string)
{ {
_GLFWwindow* window = (_GLFWwindow*)handle; _GLFWwindow* window = (_GLFWwindow*)handle;
_GLFW_REQUIRE_INIT(); _GLFW_REQUIRE_INIT();
_glfw.platform.setWindowTaskbarBadgeString(window, string); _glfw.platform.setWindowBadgeString(window, string);
} }
GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos) GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)

View File

@ -420,8 +420,8 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleWayland, _glfwSetWindowTitleWayland,
_glfwSetWindowIconWayland, _glfwSetWindowIconWayland,
_glfwSetWindowTaskbarProgressWayland, _glfwSetWindowTaskbarProgressWayland,
_glfwSetWindowTaskbarBadgeWayland, _glfwSetWindowBadgeWayland,
_glfwSetWindowTaskbarBadgeStringWayland, _glfwSetWindowBadgeStringWayland,
_glfwGetWindowPosWayland, _glfwGetWindowPosWayland,
_glfwSetWindowPosWayland, _glfwSetWindowPosWayland,
_glfwGetWindowSizeWayland, _glfwGetWindowSizeWayland,

View File

@ -447,8 +447,8 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window);
void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title); void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, int progressState, double value); void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count); void _glfwSetWindowBadgeWayland(_GLFWwindow* window, int count);
void _glfwSetWindowTaskbarBadgeStringWayland(_GLFWwindow* window, const char* string); void _glfwSetWindowBadgeStringWayland(_GLFWwindow* window, const char* string);
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos); void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos);
void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos); void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos);
void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height); void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height);

View File

@ -1911,7 +1911,7 @@ void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int progres
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value); _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value);
} }
void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count) void _glfwSetWindowBadgeWayland(_GLFWwindow* window, int count)
{ {
if (window != NULL) if (window != NULL)
{ {
@ -1919,13 +1919,13 @@ void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count)
"Wayland: Cannot set a badge for a window. Pass NULL to set the application's shared badge."); "Wayland: Cannot set a badge for a window. Pass NULL to set the application's shared badge.");
return; return;
} }
const dbus_bool_t badgeVisible = (count > 0); const dbus_bool_t badgeVisible = (count > 0);
_glfwUpdateTaskbarBadgeDBusPOSIX(badgeVisible, count); _glfwUpdateBadgeDBusPOSIX(badgeVisible, count);
} }
void _glfwSetWindowTaskbarBadgeStringWayland(_GLFWwindow* window, const char* string) void _glfwSetWindowBadgeStringWayland(_GLFWwindow* window, const char* string)
{ {
_glfwInputError(GLFW_FEATURE_UNAVAILABLE, _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
"Wayland: Unable to set a string badge. Only integer badges are supported."); "Wayland: Unable to set a string badge. Only integer badges are supported.");

View File

@ -1210,8 +1210,8 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleX11, _glfwSetWindowTitleX11,
_glfwSetWindowIconX11, _glfwSetWindowIconX11,
_glfwSetWindowTaskbarProgressX11, _glfwSetWindowTaskbarProgressX11,
_glfwSetWindowTaskbarBadgeX11, _glfwSetWindowBadgeX11,
_glfwSetWindowTaskbarBadgeStringX11, _glfwSetWindowBadgeStringX11,
_glfwGetWindowPosX11, _glfwGetWindowPosX11,
_glfwSetWindowPosX11, _glfwSetWindowPosX11,
_glfwGetWindowSizeX11, _glfwGetWindowSizeX11,

View File

@ -906,8 +906,8 @@ void _glfwDestroyWindowX11(_GLFWwindow* window);
void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title); void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, double value); void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeX11(_GLFWwindow* window, int count); void _glfwSetWindowBadgeX11(_GLFWwindow* window, int count);
void _glfwSetWindowTaskbarBadgeStringX11(_GLFWwindow* window, const char* string); void _glfwSetWindowBadgeStringX11(_GLFWwindow* window, const char* string);
void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos); void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos);
void _glfwSetWindowPosX11(_GLFWwindow* window, int xpos, int ypos); void _glfwSetWindowPosX11(_GLFWwindow* window, int xpos, int ypos);
void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height); void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height);

View File

@ -2161,7 +2161,7 @@ void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, do
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value); _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value);
} }
void _glfwSetWindowTaskbarBadgeX11(_GLFWwindow* window, int count) void _glfwSetWindowBadgeX11(_GLFWwindow* window, int count)
{ {
if (window != NULL) if (window != NULL)
{ {
@ -2172,10 +2172,10 @@ void _glfwSetWindowTaskbarBadgeX11(_GLFWwindow* window, int count)
const dbus_bool_t badgeVisible = (count > 0); const dbus_bool_t badgeVisible = (count > 0);
_glfwUpdateTaskbarBadgeDBusPOSIX(badgeVisible, count); _glfwUpdateBadgeDBusPOSIX(badgeVisible, count);
} }
void _glfwSetWindowTaskbarBadgeStringX11(_GLFWwindow* window, const char* string) void _glfwSetWindowBadgeStringX11(_GLFWwindow* window, const char* string)
{ {
_glfwInputError(GLFW_FEATURE_UNAVAILABLE, _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
"X11: Unable to set a string badge. Only integer badges are supported."); "X11: Unable to set a string badge. Only integer badges are supported.");

View File

@ -441,7 +441,7 @@ int main(int argc, char** argv)
nk_layout_row_dynamic(nk, 30, 1); nk_layout_row_dynamic(nk, 30, 1);
nk_label(nk, "Taskbar Badge", NK_TEXT_CENTERED); nk_label(nk, "Badge", NK_TEXT_CENTERED);
static int badgeCount = 0; static int badgeCount = 0;
nk_layout_row_begin(nk, NK_DYNAMIC, 30, 3); nk_layout_row_begin(nk, NK_DYNAMIC, 30, 3);
@ -450,8 +450,8 @@ int main(int argc, char** argv)
nk_layout_row_push(nk, 2.f / 3.f); nk_layout_row_push(nk, 2.f / 3.f);
if (nk_slider_int(nk, 0, &badgeCount, 10000, 1)) if (nk_slider_int(nk, 0, &badgeCount, 10000, 1))
{ {
glfwSetWindowTaskbarBadge(window, badgeCount); glfwSetWindowBadge(window, badgeCount);
glfwSetWindowTaskbarBadge(NULL, badgeCount); glfwSetWindowBadge(NULL, badgeCount);
} }
nk_layout_row_end(nk); nk_layout_row_end(nk);
} }