New upstream version 24.0.1+dfsg1

This commit is contained in:
Sebastian Ramacher 2019-09-22 23:19:10 +02:00
parent b14f9eae6d
commit 5a730d6ec3
842 changed files with 42245 additions and 33385 deletions

View file

@ -26,26 +26,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* size or by creating a new texture if the size is different
*/
static void xcb_xcursor_create(xcb_xcursor_t *data,
xcb_xfixes_get_cursor_image_reply_t *xc)
xcb_xfixes_get_cursor_image_reply_t *xc)
{
uint32_t *pixels = xcb_xfixes_get_cursor_image_cursor_image(xc);
if (!pixels)
return;
if (data->tex && data->last_height == xc->width &&
data->last_width == xc->height) {
gs_texture_set_image(data->tex, (const uint8_t *) pixels,
xc->width * sizeof(uint32_t), false);
data->last_width == xc->height) {
gs_texture_set_image(data->tex, (const uint8_t *)pixels,
xc->width * sizeof(uint32_t), false);
} else {
if (data->tex)
gs_texture_destroy(data->tex);
data->tex = gs_texture_create(xc->width, xc->height,
GS_BGRA, 1, (const uint8_t **) &pixels, GS_DYNAMIC);
data->tex = gs_texture_create(xc->width, xc->height, GS_BGRA, 1,
(const uint8_t **)&pixels,
GS_DYNAMIC);
}
data->last_serial = xc->cursor_serial;
data->last_width = xc->width;
data->last_width = xc->width;
data->last_height = xc->height;
}
@ -58,8 +59,8 @@ xcb_xcursor_t *xcb_xcursor_init(xcb_connection_t *xcb)
xcb_xfixes_query_version_cookie_t xfix_c;
xfix_c = xcb_xfixes_query_version_unchecked(xcb,
XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MINOR_VERSION);
xfix_c = xcb_xfixes_query_version_unchecked(
xcb, XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MINOR_VERSION);
free(xcb_xfixes_query_version_reply(xcb, xfix_c, NULL));
return data;
@ -73,7 +74,7 @@ void xcb_xcursor_destroy(xcb_xcursor_t *data)
}
void xcb_xcursor_update(xcb_xcursor_t *data,
xcb_xfixes_get_cursor_image_reply_t *xc)
xcb_xfixes_get_cursor_image_reply_t *xc)
{
if (!data || !xc)
return;
@ -81,8 +82,8 @@ void xcb_xcursor_update(xcb_xcursor_t *data,
if (!data->tex || data->last_serial != xc->cursor_serial)
xcb_xcursor_create(data, xc);
data->x = xc->x - data->x_org;
data->y = xc->y - data->y_org;
data->x = xc->x - data->x_org;
data->y = xc->y - data->y_org;
data->x_render = data->x - xc->xhot;
data->y_render = data->y - xc->yhot;
}
@ -92,7 +93,7 @@ void xcb_xcursor_render(xcb_xcursor_t *data)
if (!data->tex)
return;
gs_effect_t *effect = gs_get_effect();
gs_effect_t *effect = gs_get_effect();
gs_eparam_t *image = gs_effect_get_param_by_name(effect, "image");
gs_effect_set_texture(image, data->tex);
@ -109,9 +110,8 @@ void xcb_xcursor_render(xcb_xcursor_t *data)
gs_blend_state_pop();
}
void xcb_xcursor_offset(xcb_xcursor_t* data, const int x_org, const int y_org)
void xcb_xcursor_offset(xcb_xcursor_t *data, const int x_org, const int y_org)
{
data->x_org = x_org;
data->y_org = y_org;
}