forked from enlightenment/efl
that win32 shape set func has been deprecated since before ecore 1.0 -
it should have never been used, so remove. cruft. and no- no chlog as it isnt something that should affect a user SVN revision: 68366
This commit is contained in:
parent
4e5b9877dd
commit
355b3341b3
|
@ -471,11 +471,6 @@ EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
|||
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||
Eina_Bool on);
|
||||
|
||||
EINA_DEPRECATED EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
||||
unsigned short width,
|
||||
unsigned short height,
|
||||
unsigned char *mask);
|
||||
|
||||
EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
|
||||
Ecore_Win32_Cursor *cursor);
|
||||
|
||||
|
|
|
@ -755,140 +755,6 @@ ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
|
|||
if (step_height) *step_height = window->step_height;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
||||
unsigned short width,
|
||||
unsigned short height,
|
||||
unsigned char *mask)
|
||||
{
|
||||
HRGN rgn;
|
||||
int x;
|
||||
int y;
|
||||
OSVERSIONINFO version_info;
|
||||
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
if (!mask)
|
||||
{
|
||||
window->shape.enabled = 0;
|
||||
if (window->shape.layered != 0)
|
||||
{
|
||||
window->shape.layered = 0;
|
||||
#if defined(WS_EX_LAYERED)
|
||||
SetLastError(0);
|
||||
if (!SetWindowLongPtr(window->window, GWL_EXSTYLE,
|
||||
GetWindowLong(window->window, GWL_EXSTYLE) & (~WS_EX_LAYERED)) &&
|
||||
(GetLastError() != 0))
|
||||
{
|
||||
ERR("SetWindowLongPtr() failed");
|
||||
return;
|
||||
}
|
||||
if (!RedrawWindow(window->window, NULL, NULL,
|
||||
RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN))
|
||||
{
|
||||
ERR("RedrawWindow() failed");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if (!SetWindowRgn(window->window, NULL, TRUE))
|
||||
{
|
||||
ERR("SetWindowRgn() failed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
return;
|
||||
|
||||
window->shape.enabled = 1;
|
||||
|
||||
if (width != window->shape.width || height != window->shape.height)
|
||||
{
|
||||
window->shape.width = width;
|
||||
window->shape.height = height;
|
||||
if (window->shape.mask)
|
||||
{
|
||||
free(window->shape.mask);
|
||||
window->shape.mask = NULL;
|
||||
}
|
||||
window->shape.mask = malloc(width * height);
|
||||
}
|
||||
memcpy(window->shape.mask, mask, width * height);
|
||||
|
||||
window->shape.layered = 0;
|
||||
|
||||
#if defined(WS_EX_LAYERED)
|
||||
version_info.dwOSVersionInfoSize = sizeof(version_info);
|
||||
if (GetVersionEx(&version_info) == TRUE && version_info.dwMajorVersion == 5)
|
||||
{
|
||||
SetLastError(0);
|
||||
if (!SetWindowLongPtr(window->window, GWL_EXSTYLE,
|
||||
GetWindowLong(window->window, GWL_EXSTYLE) | WS_EX_LAYERED) &&
|
||||
(GetLastError() != 0))
|
||||
{
|
||||
ERR("SetWindowLongPtr() failed");
|
||||
return;
|
||||
}
|
||||
window->shape.layered = 1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(rgn = CreateRectRgn(0, 0, 0, 0)))
|
||||
{
|
||||
ERR("CreateRectRgn() failed");
|
||||
return;
|
||||
}
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
HRGN rgnLine;
|
||||
|
||||
if (!(rgnLine = CreateRectRgn(0, 0, 0, 0)))
|
||||
{
|
||||
ERR("CreateRectRgn() failed");
|
||||
return;
|
||||
}
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
if (mask[y * width + x] > 0)
|
||||
{
|
||||
HRGN rgnDot;
|
||||
|
||||
if (!(rgnDot = CreateRectRgn(x, y, x + 1, y + 1)))
|
||||
{
|
||||
ERR("CreateRectRgn() failed");
|
||||
return;
|
||||
}
|
||||
if (CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR) == ERROR)
|
||||
{
|
||||
ERR("CombineRgn() has not created a new region");
|
||||
}
|
||||
if (!DeleteObject(rgnDot))
|
||||
{
|
||||
ERR("DeleteObject() failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CombineRgn(rgn, rgn, rgnLine, RGN_OR) == ERROR)
|
||||
{
|
||||
ERR("CombineRgn() has not created a new region");
|
||||
}
|
||||
if (!DeleteObject(rgnLine))
|
||||
{
|
||||
ERR("DeleteObject() failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!SetWindowRgn(window->window, rgn, TRUE))
|
||||
{
|
||||
ERR("SetWindowRgn() failed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show the given window.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue