本文整理汇总了C++中xcb_free_pixmap函数的典型用法代码示例。如果您正苦于以下问题:C++ xcb_free_pixmap函数的具体用法?C++ xcb_free_pixmap怎么用?C++ xcb_free_pixmap使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xcb_free_pixmap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xcbosd_resize
void xcbosd_resize(xcbosd *osd, int width, int height)
{
assert (osd);
assert (width);
assert (height);
lprintf("resize old:%dx%d new:%dx%d\n", osd->width, osd->height, width, height );
osd->width = width;
osd->height = height;
xcb_free_pixmap(osd->connection, osd->bitmap);
switch(osd->mode) {
case XCBOSD_SHAPED: {
unsigned int window_config[] = { osd->width, osd->height };
xcb_configure_window(osd->connection, osd->u.shaped.window, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, window_config);
xcb_free_pixmap(osd->connection, osd->u.shaped.mask_bitmap);
osd->u.shaped.mask_bitmap = xcb_generate_id(osd->connection);
xcb_create_pixmap(osd->connection, 1, osd->u.shaped.mask_bitmap, osd->u.shaped.window, osd->width, osd->height);
osd->bitmap = xcb_generate_id(osd->connection);
xcb_create_pixmap(osd->connection, osd->depth, osd->bitmap, osd->u.shaped.window, osd->width, osd->height);
break;
}
case XCBOSD_COLORKEY:
osd->bitmap = xcb_generate_id(osd->connection);
xcb_create_pixmap(osd->connection, osd->depth, osd->bitmap, osd->window, osd->width, osd->height);
break;
}
osd->clean = UNDEFINED;
xcbosd_clear(osd);
}
示例2: xcb_free_pixmap
x_client_icon::~x_client_icon(void)
{
m_c.detach(XCB_PROPERTY_NOTIFY, this);
xcb_free_pixmap(m_c(), m_net_wm_icon);
xcb_free_pixmap(m_c(), m_wm_hints_icon);
xcb_free_pixmap(m_c(), m_default_icon);
}
示例3: foreach
//______________________________________________
void ShadowHelper::reset( void )
{
#if OXYGEN_HAVE_X11
if( _helper.isX11() )
{
// round pixmaps
foreach( const quint32& value, _pixmaps ) xcb_free_pixmap( _helper.connection(), value );
foreach( const quint32& value, _dockPixmaps ) xcb_free_pixmap( _helper.connection(), value );
}
示例4: DeleteBuffers
static void DeleteBuffers(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
xcb_connection_t *conn = sys->conn;
xcb_render_free_picture(conn, sys->picture.scale);
xcb_render_free_picture(conn, sys->picture.crop);
xcb_free_pixmap(conn, sys->drawable.scale);
xcb_free_pixmap(conn, sys->drawable.crop);
}
示例5: xcb_generate_id
void X11WindowedBackend::createCursor(const QImage &img, const QPoint &hotspot)
{
const xcb_pixmap_t pix = xcb_generate_id(m_connection);
const xcb_gcontext_t gc = xcb_generate_id(m_connection);
const xcb_cursor_t cid = xcb_generate_id(m_connection);
xcb_create_pixmap(m_connection, 32, pix, m_screen->root, img.width(), img.height());
xcb_create_gc(m_connection, gc, pix, 0, nullptr);
xcb_put_image(m_connection, XCB_IMAGE_FORMAT_Z_PIXMAP, pix, gc, img.width(), img.height(), 0, 0, 0, 32, img.byteCount(), img.constBits());
XRenderPicture pic(pix, 32);
xcb_render_create_cursor(m_connection, cid, pic, hotspot.x(), hotspot.y());
for (auto it = m_windows.constBegin(); it != m_windows.constEnd(); ++it) {
xcb_change_window_attributes(m_connection, (*it).window, XCB_CW_CURSOR, &cid);
}
xcb_free_pixmap(m_connection, pix);
xcb_free_gc(m_connection, gc);
if (m_cursor) {
xcb_free_cursor(m_connection, m_cursor);
}
m_cursor = cid;
xcb_flush(m_connection);
markCursorAsRendered();
}
示例6: dri2_destroy_surface
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
(void) drv;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
if (dri2_dpy->dri2) {
xcb_dri2_destroy_drawable (dri2_dpy->conn, dri2_surf->drawable);
} else {
assert(dri2_dpy->swrast);
swrastDestroyDrawable(dri2_dpy, dri2_surf);
}
if (surf->Type == EGL_PBUFFER_BIT)
xcb_free_pixmap (dri2_dpy->conn, dri2_surf->drawable);
free(surf);
return EGL_TRUE;
}
示例7: drawin_update_drawing
static void
drawin_update_drawing(drawin_t *w)
{
/* If this drawin isn't visible, we don't need an up-to-date cairo surface
* for it. (drawin_map() will later make sure we are called again) */
if(!w->visible)
return;
/* Clean up old stuff */
if(w->surface)
{
/* In case lua still got a reference to the surface, it still won't be
* able to do anything with it because we finish it. */
cairo_surface_finish(w->surface);
cairo_surface_destroy(w->surface);
}
if(w->pixmap)
xcb_free_pixmap(globalconf.connection, w->pixmap);
/* Create a pixmap */
xcb_screen_t *s = globalconf.screen;
w->pixmap = xcb_generate_id(globalconf.connection);
xcb_create_pixmap(globalconf.connection, globalconf.default_depth, w->pixmap, s->root,
w->geometry.width, w->geometry.height);
/* and create a surface for that pixmap */
w->surface = cairo_xcb_surface_create(globalconf.connection,
w->pixmap, globalconf.visual,
w->geometry.width, w->geometry.height);
/* Make sure the pixmap doesn't contain garbage by filling it with black */
cairo_t *cr = cairo_create(w->surface);
cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
cairo_paint(cr);
cairo_destroy(cr);
}
示例8: _cairo_boilerplate_xcb_cleanup
static void
_cairo_boilerplate_xcb_cleanup (void *closure)
{
xcb_target_closure_t *xtc = closure;
cairo_status_t status;
cairo_surface_finish (xtc->surface);
if (xtc->is_pixmap)
xcb_free_pixmap (xtc->c, xtc->drawable);
else
xcb_destroy_window (xtc->c, xtc->drawable);
cairo_surface_destroy (xtc->surface);
cairo_device_finish (xtc->device);
cairo_device_destroy (xtc->device);
/* First synchronize with the X server to make sure there are no more errors
* in-flight which we would miss otherwise */
_cairo_boilerplate_xcb_sync_server (xtc);
status = _cairo_boilerplate_xcb_handle_errors (xtc);
assert (status == CAIRO_STATUS_SUCCESS);
xcb_disconnect (xtc->c);
free (xtc);
}
示例9: _destroy_similar
static void _destroy_similar (void *closure)
{
struct similar *similar = closure;
xcb_free_pixmap (similar->connection, similar->pixmap);
free (similar);
}
示例10: drawin_wipe
static void
drawin_wipe(drawin_t *w)
{
/* The drawin must already be unmapped, else it
* couldn't be garbage collected -> no unmap needed */
p_delete(&w->cursor);
if(w->surface)
{
/* Make sure that cairo knows that this surface can't be unused anymore.
* This is needed since lua could still have a reference to it. */
cairo_surface_finish(w->surface);
cairo_surface_destroy(w->surface);
w->surface = NULL;
}
if(w->window)
{
/* Activate BMA */
client_ignore_enterleave_events();
/* Make sure we don't accidentally kill the systray window */
drawin_systray_kickout(w);
xcb_destroy_window(globalconf.connection, w->window);
/* Deactivate BMA */
client_restore_enterleave_events();
w->window = XCB_NONE;
}
if(w->pixmap)
{
xcb_free_pixmap(globalconf.connection, w->pixmap);
w->pixmap = XCB_NONE;
}
}
示例11: _cairo_xcb_connection_free_pixmap
void
_cairo_xcb_connection_free_pixmap (cairo_xcb_connection_t *connection,
xcb_pixmap_t pixmap)
{
xcb_free_pixmap (connection->xcb_connection, pixmap);
_cairo_xcb_connection_put_xid (connection, pixmap);
}
示例12: redraw_screen
/*
* Calls draw_image on a new pixmap and swaps that with the current pixmap
*
*/
void redraw_screen(void) {
/* avoid drawing if monitor state is not on */
if (dpms_capable) {
xcb_dpms_info_reply_t *dpms_info =
xcb_dpms_info_reply(conn,xcb_dpms_info(conn), NULL);
if (dpms_info) {
/* monitor is off when DPMS state is enabled and power level is not
* DPMS_MODE_ON */
uint8_t monitor_off = dpms_info->state
&& dpms_info->power_level != XCB_DPMS_DPMS_MODE_ON;
free(dpms_info);
if (monitor_off)
return;
}
}
xcb_pixmap_t bg_pixmap = draw_image(last_resolution);
xcb_change_window_attributes(conn, win, XCB_CW_BACK_PIXMAP, (uint32_t[1]){ bg_pixmap });
/* XXX: Possible optimization: Only update the area in the middle of the
* screen instead of the whole screen. */
xcb_clear_area(conn, 0, win, 0, 0, last_resolution[0], last_resolution[1]);
xcb_free_pixmap(conn, bg_pixmap);
xcb_flush(conn);
}
示例13: xcbosd_destroy
void xcbosd_destroy(xcbosd *osd)
{
assert (osd);
xcb_free_gc(osd->connection, osd->gc);
xcb_free_pixmap(osd->connection, osd->bitmap);
xcb_free_colormap(osd->connection, osd->cmap);
if(osd->mode==XCBOSD_SHAPED) {
xcb_free_gc(osd->connection, osd->u.shaped.mask_gc);
xcb_free_gc(osd->connection, osd->u.shaped.mask_gc_back);
xcb_free_pixmap(osd->connection, osd->u.shaped.mask_bitmap);
xcb_destroy_window(osd->connection, osd->u.shaped.window);
}
free (osd);
}
示例14: _cairo_boilerplate_xcb_cleanup
void
_cairo_boilerplate_xcb_cleanup (void *closure)
{
xcb_target_closure_t *xtc = closure;
xcb_free_pixmap (xtc->c, xtc->pixmap);
xcb_disconnect (xtc->c);
free (xtc);
}
示例15: _xcwm_window_composite_pixmap_release
static void
_xcwm_window_composite_pixmap_release(xcwm_window_t *window)
{
if (window->composite_pixmap_id)
{
xcb_free_pixmap(window->context->conn, window->composite_pixmap_id);
window->composite_pixmap_id = 0;
}
}