mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
glfwSetWindowTaskbarProgress Renamed parameter completed to value
This commit is contained in:
parent
3e7b016a00
commit
a480de9b1d
@ -3365,7 +3365,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i
|
|||||||
* @ref GLFW_TASKBAR_PROGRESS_DISABLED, @ref GLFW_TASKBAR_PROGRESS_INDETERMINATE,
|
* @ref GLFW_TASKBAR_PROGRESS_DISABLED, @ref GLFW_TASKBAR_PROGRESS_INDETERMINATE,
|
||||||
* @ref GLFW_TASKBAR_PROGRESS_NORMAL, @ref GLFW_TASKBAR_PROGRESS_ERROR
|
* @ref GLFW_TASKBAR_PROGRESS_NORMAL, @ref GLFW_TASKBAR_PROGRESS_ERROR
|
||||||
* and @ref GLFW_TASKBAR_PROGRESS_PAUSED.
|
* and @ref GLFW_TASKBAR_PROGRESS_PAUSED.
|
||||||
* @param[in] completed The amount of completed progress to set. Valid range is 0 to 100.
|
* @param[in] value The amount of completed progress to set. Valid range is 0 to 100.
|
||||||
* This is ignored if progressState is set to @ref GLFW_TASKBAR_PROGRESS_DISABLED.
|
* This is ignored if progressState is set to @ref GLFW_TASKBAR_PROGRESS_DISABLED.
|
||||||
*
|
*
|
||||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
|
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
|
||||||
@ -3391,7 +3391,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i
|
|||||||
*
|
*
|
||||||
* @ingroup window
|
* @ingroup window
|
||||||
*/
|
*/
|
||||||
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, const int progressState, int completed);
|
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, const int progressState, int value);
|
||||||
|
|
||||||
/*! @brief Retrieves the position of the content area of the specified window.
|
/*! @brief Retrieves the position of the content area of the specified window.
|
||||||
*
|
*
|
||||||
@ -6510,3 +6510,4 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _glfw3_h_ */
|
#endif /* _glfw3_h_ */
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ GLFWbool _glfwCreateWindowCocoa(_GLFWwindow* window, const _GLFWwndconfig* wndco
|
|||||||
void _glfwDestroyWindowCocoa(_GLFWwindow* window);
|
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, const int taskbarState, int completed);
|
void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int taskbarState, int value);
|
||||||
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);
|
||||||
|
@ -1032,7 +1032,7 @@ void _glfwSetWindowIconCocoa(_GLFWwindow* window,
|
|||||||
"Cocoa: Regular windows do not have icons on macOS");
|
"Cocoa: Regular windows do not have icons on macOS");
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int progressState, int completed)
|
void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int progressState, int value)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FEATURE_UNIMPLEMENTED,
|
_glfwInputError(GLFW_FEATURE_UNIMPLEMENTED,
|
||||||
"Cocoa: Window taskbar progress is not implemented");
|
"Cocoa: Window taskbar progress is not implemented");
|
||||||
|
@ -89,7 +89,7 @@ GLFWbool _glfwCreateWindowNull(_GLFWwindow* window, const _GLFWwndconfig* wndcon
|
|||||||
void _glfwDestroyWindowNull(_GLFWwindow* window);
|
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, const int taskbarState, int completed);
|
void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int taskbarState, int value);
|
||||||
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);
|
||||||
|
@ -187,7 +187,7 @@ void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* ima
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int progressState, int completed)
|
void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int progressState, int value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ GLFWbool _glfwCreateWindowWin32(_GLFWwindow* window, const _GLFWwndconfig* wndco
|
|||||||
void _glfwDestroyWindowWin32(_GLFWwindow* window);
|
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, const int taskbarState, int completed);
|
void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int taskbarState, int value);
|
||||||
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);
|
||||||
|
@ -1596,7 +1596,7 @@ void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressState, int completed)
|
void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressState, int value)
|
||||||
{
|
{
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
int32_t winProgressState = 0;
|
int32_t winProgressState = 0;
|
||||||
@ -1610,7 +1610,7 @@ void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressS
|
|||||||
if(!window->win32.TaskbarList)
|
if(!window->win32.TaskbarList)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
res = window->win32.TaskbarList->lpVtbl->SetProgressValue(window->win32.TaskbarList, window->win32.handle, completed, 100);
|
res = window->win32.TaskbarList->lpVtbl->SetProgressValue(window->win32.TaskbarList, window->win32.handle, value, 100);
|
||||||
if(res != S_OK)
|
if(res != S_OK)
|
||||||
{
|
{
|
||||||
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar progress value");
|
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar progress value");
|
||||||
|
12
src/window.c
12
src/window.c
@ -558,7 +558,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* handle,
|
|||||||
_glfw.platform.setWindowIcon(window, count, images);
|
_glfw.platform.setWindowIcon(window, count, images);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progressState, int completed)
|
GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progressState, int value)
|
||||||
{
|
{
|
||||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||||
|
|
||||||
@ -566,12 +566,7 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progress
|
|||||||
|
|
||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
if (completed < 0)
|
if (value < 0 || value > 100)
|
||||||
{
|
|
||||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid progress amount for window taskbar progress");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (completed > 100)
|
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid progress amount for window taskbar progress");
|
_glfwInputError(GLFW_INVALID_VALUE, "Invalid progress amount for window taskbar progress");
|
||||||
return;
|
return;
|
||||||
@ -585,7 +580,7 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progress
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.platform.setWindowTaskbarProgress(window, progressState, completed);
|
_glfw.platform.setWindowTaskbarProgress(window, progressState, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)
|
GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)
|
||||||
@ -1182,3 +1177,4 @@ GLFWAPI void glfwPostEmptyEvent(void)
|
|||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
_glfw.platform.postEmptyEvent();
|
_glfw.platform.postEmptyEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ GLFWbool _glfwCreateWindowWayland(_GLFWwindow* window, const _GLFWwndconfig* wnd
|
|||||||
void _glfwDestroyWindowWayland(_GLFWwindow* window);
|
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, const int taskbarState, int completed);
|
void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int value);
|
||||||
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);
|
||||||
|
@ -1902,12 +1902,12 @@ void _glfwSetWindowIconWayland(_GLFWwindow* window,
|
|||||||
"Wayland: The platform does not support setting the window icon");
|
"Wayland: The platform does not support setting the window icon");
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int completed)
|
void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int value)
|
||||||
{
|
{
|
||||||
(void)window;
|
(void)window;
|
||||||
|
|
||||||
const double progressValue = (double)completed / 100.0;
|
|
||||||
const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED);
|
const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED);
|
||||||
|
const double progressValue = (double)value / 100.0;
|
||||||
|
|
||||||
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue);
|
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue);
|
||||||
}
|
}
|
||||||
@ -2901,3 +2901,4 @@ GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // _GLFW_WAYLAND
|
#endif // _GLFW_WAYLAND
|
||||||
|
|
||||||
|
@ -905,7 +905,7 @@ GLFWbool _glfwCreateWindowX11(_GLFWwindow* window, const _GLFWwndconfig* wndconf
|
|||||||
void _glfwDestroyWindowX11(_GLFWwindow* window);
|
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, const int taskbarState, int completed);
|
void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int value);
|
||||||
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);
|
||||||
|
@ -2152,12 +2152,12 @@ void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* imag
|
|||||||
XFlush(_glfw.x11.display);
|
XFlush(_glfw.x11.display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int completed)
|
void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int value)
|
||||||
{
|
{
|
||||||
(void)window;
|
(void)window;
|
||||||
|
|
||||||
const double progressValue = (double)completed / 100.0;
|
|
||||||
const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED);
|
const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED);
|
||||||
|
const double progressValue = (double)value / 100.0;
|
||||||
|
|
||||||
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue);
|
_glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue);
|
||||||
}
|
}
|
||||||
@ -3362,3 +3362,4 @@ GLFWAPI const char* glfwGetX11SelectionString(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // _GLFW_X11
|
#endif // _GLFW_X11
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user