Added boilerplate glfwSetWindowTaskbarBadge()

This commit is contained in:
GamesTrap 2023-03-04 21:08:05 +01:00
parent 9f17a69a67
commit 94fb107c24
No known key found for this signature in database
GPG Key ID: 31DFD452434ECDA3
18 changed files with 52 additions and 0 deletions

View File

@ -3395,6 +3395,9 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i
*/
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, int progressState, double value);
//Use count = GLFW_DONT_CARE to disable overlay/badge icon
GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* window, int count);
/*! @brief Retrieves the position of the content area of the specified window.
*
* This function retrieves the position, in screen coordinates, of the

View File

@ -529,6 +529,7 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleCocoa,
_glfwSetWindowIconCocoa,
_glfwSetWindowTaskbarProgressCocoa,
_glfwSetWindowTaskbarBadgeCocoa,
_glfwGetWindowPosCocoa,
_glfwSetWindowPosCocoa,
_glfwGetWindowSizeCocoa,

View File

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

View File

@ -1167,6 +1167,10 @@ void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState,
window->ns.dockProgressIndicator.value = value;
}
void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count)
{
}
void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos)
{
@autoreleasepool {

View File

@ -707,6 +707,7 @@ struct _GLFWplatform
void (*setWindowTitle)(_GLFWwindow*,const char*);
void (*setWindowIcon)(_GLFWwindow*,int,const GLFWimage*);
void (*setWindowTaskbarProgress)(_GLFWwindow*,const int,double);
void (*setWindowTaskbarBadge)(_GLFWwindow*,int);
void (*getWindowPos)(_GLFWwindow*,int*,int*);
void (*setWindowPos)(_GLFWwindow*,int,int);
void (*getWindowSize)(_GLFWwindow*,int*,int*);

View File

@ -74,6 +74,7 @@ GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleNull,
_glfwSetWindowIconNull,
_glfwSetWindowTaskbarProgressNull,
_glfwSetWindowTaskbarBadgeNull,
_glfwGetWindowPosNull,
_glfwSetWindowPosNull,
_glfwGetWindowSizeNull,

View File

@ -90,6 +90,7 @@ void _glfwDestroyWindowNull(_GLFWwindow* window);
void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title);
void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images);
void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, double value);
void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count);
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 _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos);

View File

@ -191,6 +191,10 @@ void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, d
{
}
void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count)
{
}
void _glfwSetWindowMonitorNull(_GLFWwindow* window,
_GLFWmonitor* monitor,
int xpos, int ypos,

View File

@ -639,6 +639,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleWin32,
_glfwSetWindowIconWin32,
_glfwSetWindowTaskbarProgressWin32,
_glfwSetWindowTaskbarBadgeWin32,
_glfwGetWindowPosWin32,
_glfwSetWindowPosWin32,
_glfwGetWindowSizeWin32,

View File

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

View File

@ -1643,6 +1643,11 @@ void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, int progressState,
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar progress state");
}
void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count)
{
//TODO
}
void _glfwGetWindowPosWin32(_GLFWwindow* window, int* xpos, int* ypos)
{
POINT pos = { 0, 0 };

View File

@ -583,6 +583,23 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, int progressState,
_glfw.platform.setWindowTaskbarProgress(window, progressState, value);
}
GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* handle, int count)
{
_GLFWwindow* window = (_GLFWwindow*)handle;
assert(window != NULL);
_GLFW_REQUIRE_INIT();
if (count != GLFW_DONT_CARE && (count < 0 || count > 99))
{
_glfwInputError(GLFW_INVALID_VALUE, "Invalid badge count %d", count);
return;
}
_glfw.platform.setWindowTaskbarBadge(window, count);
}
GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)
{
_GLFWwindow* window = (_GLFWwindow*) handle;

View File

@ -420,6 +420,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleWayland,
_glfwSetWindowIconWayland,
_glfwSetWindowTaskbarProgressWayland,
_glfwSetWindowTaskbarBadgeWayland,
_glfwGetWindowPosWayland,
_glfwSetWindowPosWayland,
_glfwGetWindowSizeWayland,

View File

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

View File

@ -1911,6 +1911,10 @@ void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int progres
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value);
}
void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count)
{
}
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
{
// A Wayland client is not aware of its position, so just warn and leave it

View File

@ -1210,6 +1210,7 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform)
_glfwSetWindowTitleX11,
_glfwSetWindowIconX11,
_glfwSetWindowTaskbarProgressX11,
_glfwSetWindowTaskbarBadgeX11,
_glfwGetWindowPosX11,
_glfwSetWindowPosX11,
_glfwGetWindowSizeX11,

View File

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

View File

@ -2161,6 +2161,10 @@ void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, do
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value);
}
void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int count)
{
}
void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos)
{
Window dummy;