这篇教程C++ wl_resource_destroy函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wl_resource_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ wl_resource_destroy函数的具体用法?C++ wl_resource_destroy怎么用?C++ wl_resource_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wl_resource_destroy函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: buffer_destroystatic voidbuffer_destroy(struct wl_client *client, struct wl_resource *resource){#ifdef HAS_WAYLAND_0_85 wl_resource_destroy(resource, 0);#else wl_resource_destroy(resource);#endif}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:9,
示例2: wl_resource_set_destructorXdgBaseSurface::~XdgBaseSurface(){ if (m_resource && wl_resource_get_client(m_resource)) { wl_resource_set_destructor(m_resource, nullptr); wl_resource_destroy(m_resource); }}
开发者ID:amon-ra,项目名称:nuclear,代码行数:7,
示例3: cogland_surface_freestatic voidcogland_surface_free (CoglandSurface *surface){ CoglandCompositor *compositor = surface->compositor; CoglandFrameCallback *cb, *next; wl_signal_emit (&surface->destroy_signal, &surface->resource); compositor->surfaces = g_list_remove (compositor->surfaces, surface); cogland_buffer_reference (&surface->buffer_ref, NULL); if (surface->texture) cogl_object_unref (surface->texture); if (surface->pending.buffer) wl_list_remove (&surface->pending.buffer_destroy_listener.link); wl_list_for_each_safe (cb, next, &surface->pending.frame_callback_list, link) wl_resource_destroy (cb->resource); g_slice_free (CoglandSurface, surface); cogland_queue_redraw (compositor);}
开发者ID:3v1n0,项目名称:cogl,代码行数:25,
示例4: wl_resource_destroyRelativePointerInterface::Private::~Private(){ if (resource) { wl_resource_destroy(resource); resource = nullptr; }}
开发者ID:KDE,项目名称:kwayland,代码行数:7,
示例5: shoot void shoot(wl_resource *resource) { if (!wl_shm_buffer_get(resource)) { failed(); return; } wl_shm_buffer *shm = wl_shm_buffer_get(resource); int width = wl_shm_buffer_get_width(shm); int height = wl_shm_buffer_get_height(shm); int stride = wl_shm_buffer_get_stride(shm); QSize size = m_surface->contentSize(); if (stride != size.width() * 4 || height != size.height()) { failed(); return; } wl_shm_buffer_begin_access(shm); void *data = wl_shm_buffer_get_data(shm); m_surface->copyContent(data, stride * height, QRect(0, 0, width, height)); wl_shm_buffer_end_access(shm); orbital_surface_screenshot_send_done(m_resource); wl_resource_destroy(m_resource); delete this; }
开发者ID:giucam,项目名称:orbital,代码行数:29,
示例6: data_device_finalizevoid data_device_finalize(struct data_device * data_device){ struct wl_resource * resource, * tmp; wl_list_for_each_safe(resource, tmp, &data_device->resources, link) wl_resource_destroy(resource);}
开发者ID:jezze,项目名称:swc,代码行数:7,
示例7: wl_resource_post_errorvoid InputMethod::input_method_bind_resource(Resource *resource){ if (m_resource) { wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "interface object already bound"); wl_resource_destroy(resource->handle); return; } m_resource = resource;}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:10,
示例8: drm_buffer_destroystatic voiddrm_buffer_destroy(struct wl_client *client, struct wl_resource *resource){ trace(TRACE_DRM, "");/* * struct drm_buffer = return wl_resource_get_user_data(resource); struct wl_drm_buffer *buffer; */ wl_resource_destroy(resource);}
开发者ID:daurnimator,项目名称:arcan,代码行数:11,
示例9: meta_wayland_compositor_paint_finishedvoidmeta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor){ while (!wl_list_empty (&compositor->frame_callbacks)) { MetaWaylandFrameCallback *callback = wl_container_of (compositor->frame_callbacks.next, callback, link); wl_callback_send_done (callback->resource, get_time ()); wl_resource_destroy (callback->resource); }}
开发者ID:wolfv,项目名称:mutter,代码行数:12,
示例10: shell_handle_surface_destroystatic voidshell_handle_surface_destroy (struct wl_listener *listener, struct wl_resource *resource, uint32_t time){ CoglandShellSurface *shell_surface = container_of (listener, CoglandShellSurface, surface_destroy_listener); shell_surface->surface->has_shell_surface = FALSE; shell_surface->surface = NULL; wl_resource_destroy (&shell_surface->resource, time);}
开发者ID:recrack,项目名称:cogl-android,代码行数:13,
示例11: create_bufferstatic void create_buffer(struct wl_client * client, struct wl_resource * resource, uint32_t id, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format){ struct pool * pool = wl_resource_get_user_data(resource); struct pool_reference * reference; struct wld_buffer * buffer; struct wl_resource * buffer_resource; union wld_object object; if (offset > pool->size || offset < 0) { wl_resource_post_error(resource, WL_SHM_ERROR_INVALID_STRIDE, "offset is too big or negative"); return; } object.ptr = (void *)((uintptr_t) pool->data + offset); buffer = wld_import_buffer(swc.shm->context, WLD_OBJECT_DATA, object, width, height, format_shm_to_wld(format), stride); if (!buffer) goto error0; buffer_resource = wayland_buffer_create_resource (client, wl_resource_get_version(resource), id, buffer); if (!buffer_resource) goto error1; if (!(reference = malloc(sizeof *reference))) goto error2; reference->pool = pool; reference->destructor.destroy = &handle_buffer_destroy; wld_buffer_add_destructor(buffer, &reference->destructor); ++pool->references; return; error2: wl_resource_destroy(buffer_resource); error1: wld_buffer_unreference(buffer); error0: wl_resource_post_no_memory(resource);}
开发者ID:Kinokoio,项目名称:swc,代码行数:49,
示例12: shell_handle_surface_destroystatic voidshell_handle_surface_destroy (struct wl_listener *listener, void *data){ CoglandShellSurface *shell_surface = wl_container_of (listener, shell_surface, surface_destroy_listener); shell_surface->surface->has_shell_surface = FALSE; shell_surface->surface = NULL; if (shell_surface->resource) wl_resource_destroy (shell_surface->resource); else destroy_shell_surface (shell_surface);}
开发者ID:3v1n0,项目名称:cogl,代码行数:15,
示例13: paint_cbstatic CoglBoolpaint_cb (void *user_data){ CoglandCompositor *compositor = user_data; GList *l; for (l = compositor->outputs; l; l = l->next) { CoglandOutput *output = l->data; CoglFramebuffer *fb = output->onscreen; GList *l2; cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1); cogl_primitive_draw (compositor->triangle, fb, compositor->triangle_pipeline); for (l2 = compositor->surfaces; l2; l2 = l2->next) { CoglandSurface *surface = l2->data; if (surface->texture) { CoglTexture2D *texture = surface->texture; CoglPipeline *pipeline = cogl_pipeline_new (compositor->cogl_context); cogl_pipeline_set_layer_texture (pipeline, 0, texture); cogl_framebuffer_draw_rectangle (fb, pipeline, -1, 1, 1, -1); cogl_object_unref (pipeline); } } cogl_onscreen_swap_buffers (COGL_ONSCREEN (fb)); } while (!wl_list_empty (&compositor->frame_callbacks)) { CoglandFrameCallback *callback = wl_container_of (compositor->frame_callbacks.next, callback, link); wl_callback_send_done (callback->resource, get_time ()); wl_resource_destroy (callback->resource); } compositor->redraw_idle = 0; return G_SOURCE_REMOVE;}
开发者ID:3v1n0,项目名称:cogl,代码行数:47,
示例14: paint_cbstatic CoglBoolpaint_cb (void *user_data){ CoglandCompositor *compositor = user_data; GList *l; for (l = compositor->outputs; l; l = l->next) { CoglandOutput *output = l->data; CoglFramebuffer *fb = COGL_FRAMEBUFFER (output->onscreen); GList *l2; cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1); cogl_framebuffer_draw_primitive (fb, compositor->triangle_pipeline, compositor->triangle); for (l2 = compositor->surfaces; l2; l2 = l2->next) { CoglandSurface *surface = l2->data; if (surface->buffer) { CoglTexture2D *texture = surface->buffer->texture; CoglPipeline *pipeline = cogl_pipeline_new (compositor->cogl_context); cogl_pipeline_set_layer_texture (pipeline, 0, COGL_TEXTURE (texture)); cogl_framebuffer_draw_rectangle (fb, pipeline, -1, 1, 1, -1); cogl_object_unref (pipeline); } } cogl_onscreen_swap_buffers (COGL_ONSCREEN (fb)); } while (!g_queue_is_empty (&compositor->frame_callbacks)) { CoglandFrameCallback *callback = g_queue_peek_head (&compositor->frame_callbacks); wl_resource_post_event (&callback->resource, WL_CALLBACK_DONE, get_time ()); wl_resource_destroy (&callback->resource, 0); } return TRUE;}
开发者ID:recrack,项目名称:cogl-android,代码行数:47,
示例15: m_authorizerRestrictedGlobal::RestrictedGlobal(Compositor *c, const wl_interface *i, uint32_t v) : m_authorizer(c->authorizer()) , m_interface(i){ m_global = wl_global_create(c->m_display, i, v, this, [](wl_client *client, void *data, uint32_t version, uint32_t id) { RestrictedGlobal *_this = static_cast<RestrictedGlobal *>(data); if (_this->m_authorizer->isClientTrusted(_this->m_interface->name, client)) { _this->bind(client, version, id); } else { wl_resource *resource = wl_resource_create(client, _this->m_interface, version, id); wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "permission to bind the global interface '%s' denied", _this->m_interface->name); wl_resource_destroy(resource); } }); m_authorizer->addRestrictedInterface(i->name);}
开发者ID:giucam,项目名称:orbital,代码行数:18,
示例16: done static void done(void *data, weston_screenshooter_outcome outcome) { Screenshot *ss = static_cast<Screenshot *>(data); switch (outcome) { case WESTON_SCREENSHOOTER_SUCCESS: orbital_screenshot_send_done(ss->resource); break; case WESTON_SCREENSHOOTER_NO_MEMORY: wl_resource_post_no_memory(ss->resource); break; case WESTON_SCREENSHOOTER_BAD_BUFFER: orbital_screenshot_send_failed(ss->resource); break; } wl_resource_destroy(ss->resource); delete ss; }
开发者ID:giucam,项目名称:orbital,代码行数:19,
示例17: create_poolstatic void create_pool(struct wl_client * client, struct wl_resource * resource, uint32_t id, int32_t fd, int32_t size){ struct pool * pool; if (!(pool = malloc(sizeof *pool))) { wl_resource_post_no_memory(resource); return; } pool->resource = wl_resource_create(client, &wl_shm_pool_interface, wl_resource_get_version(resource), id); if (!pool->resource) { wl_resource_post_no_memory(resource); goto error0; } wl_resource_set_implementation(pool->resource, &shm_pool_implementation, pool, &destroy_pool_resource); pool->data = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (pool->data == MAP_FAILED) { wl_resource_post_error(resource, WL_SHM_ERROR_INVALID_FD, "mmap failed: %s", strerror(errno)); goto error1; } pool->size = size; pool->references = 1; return; error1: wl_resource_destroy(pool->resource); error0: free(pool);}
开发者ID:C0DEHERO,项目名称:swc,代码行数:42,
示例18: wlb_keyboard_destroyWL_EXPORT voidwlb_keyboard_destroy(struct wlb_keyboard *keyboard){ struct wl_resource *resource, *rnext; wl_resource_for_each_safe(resource, rnext, &keyboard->resource_list) wl_resource_destroy(resource); if (keyboard->focus) wl_list_remove(&keyboard->surface_destroy_listener.link); keyboard->seat->keyboard = NULL; if (keyboard->keymap.data) { munmap(keyboard->keymap.data, keyboard->keymap.size); close(keyboard->keymap.fd); } free(keyboard);}
开发者ID:jekstrand,项目名称:libwlb,代码行数:20,
示例19: server_wlegl_get_server_buffer_handlestatic voidserver_wlegl_get_server_buffer_handle(wl_client *client, wl_resource *res, uint32_t id, int32_t width, int32_t height, int32_t format, int32_t usage){ if (width == 0 || height == 0) { wl_resource_post_error(res, 0, "invalid buffer size: %u,%u/n", width, height); return; } server_wlegl *wlegl = server_wlegl_from(res); wl_resource *resource = wl_resource_create(client, &android_wlegl_server_buffer_handle_interface, wl_resource_get_version(res), id); buffer_handle_t _handle; int _stride; usage |= GRALLOC_USAGE_HW_COMPOSER; int r = hybris_gralloc_allocate(width, height, format, usage, &_handle, (uint32_t*)&_stride); if (r) { HYBRIS_ERROR_LOG(SERVER_WLEGL, "failed to allocate buffer/n"); } server_wlegl_buffer *buffer = server_wlegl_buffer_create_server(client, width, height, _stride, format, usage, _handle, wlegl); struct wl_array ints; int *ints_data; wl_array_init(&ints); ints_data = (int*) wl_array_add(&ints, _handle->numInts * sizeof(int)); memcpy(ints_data, _handle->data + _handle->numFds, _handle->numInts * sizeof(int)); android_wlegl_server_buffer_handle_send_buffer_ints(resource, &ints); wl_array_release(&ints); for (int i = 0; i < _handle->numFds; i++) { android_wlegl_server_buffer_handle_send_buffer_fd(resource, _handle->data[i]); } android_wlegl_server_buffer_handle_send_buffer(resource, buffer->resource, format, _stride); wl_resource_destroy(resource);}
开发者ID:Tofee,项目名称:libhybris,代码行数:39,
示例20: xdg_popup_newstruct xdg_popup *xdg_popup_new(struct wl_client *client, uint32_t version, uint32_t id, struct surface *surface, struct surface *parent_surface, int32_t x, int32_t y){ struct xdg_popup *popup; struct compositor_view *parent = compositor_view(parent_surface->view); if (!parent) goto error0; popup = malloc(sizeof *popup); if (!popup) goto error0; popup->resource = wl_resource_create(client, &xdg_popup_interface, version, id); if (!popup->resource) goto error1; popup->surface_destroy_listener.notify = &handle_surface_destroy; wl_resource_add_destroy_listener(surface->resource, &popup->surface_destroy_listener); wl_resource_set_implementation(popup->resource, &xdg_popup_implementation, popup, &destroy_popup); if (!(popup->view = compositor_create_view(surface))) goto error2; view_move(&popup->view->base, parent->base.geometry.x + x, parent->base.geometry.y + y); compositor_view_set_parent(popup->view, parent); return popup;error2: wl_resource_destroy(popup->resource);error1: free(popup);error0: return NULL;}
开发者ID:N8Fear,项目名称:swc,代码行数:39,
示例21: destroystatic void destroy(struct wl_client * client, struct wl_resource * resource){ wl_resource_destroy(resource);}
开发者ID:C0DEHERO,项目名称:swc,代码行数:4,
示例22: wl_resource_destroyvoid Region::region_destroy(Resource *resource){ wl_resource_destroy(resource->handle);}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:4,
示例23: Q_Dvoid QWaylandSurface::destroySurfaceByForce(){ Q_D(QWaylandSurface); wl_resource *surface_resource = d->surface->resource()->handle; wl_resource_destroy(surface_resource);}
开发者ID:kvahlman,项目名称:qtwayland,代码行数:6,
示例24: cogland_region_destroystatic voidcogland_region_destroy (struct wl_client *client, struct wl_resource *resource){ wl_resource_destroy (resource);}
开发者ID:3v1n0,项目名称:cogl,代码行数:6,
示例25: wl_resource_destroyvoid QWaylandTouchPrivate::touch_release(Resource *resource){ wl_resource_destroy(resource->handle);}
开发者ID:greenisland,项目名称:greenisland,代码行数:4,
示例26: cogland_surface_destroystatic voidcogland_surface_destroy (struct wl_client *wayland_client, struct wl_resource *wayland_resource){ wl_resource_destroy (wayland_resource);}
开发者ID:3v1n0,项目名称:cogl,代码行数:6,
示例27: data_offer_destroystatic voiddata_offer_destroy(struct wl_client *client, struct wl_resource *resource){ wl_resource_destroy(resource, 0);}
开发者ID:ageric,项目名称:wayland,代码行数:5,
示例28: data_device_releasestatic voiddata_device_release(struct wl_client *client, struct wl_resource *resource){ wl_resource_destroy(resource);}
开发者ID:mvollmer,项目名称:mutter,代码行数:5,
示例29: wl_resource_destroyvoid ClipboardManager::destroy(wl_client *client, wl_resource *res){ wl_resource_destroy(res);}
开发者ID:giucam,项目名称:orbital,代码行数:4,
示例30: runner_destroy_handlerstatic voidrunner_destroy_handler(struct wl_client *client, struct wl_resource *resource){ wl_resource_destroy(resource);}
开发者ID:dtoartist,项目名称:weston,代码行数:5,
注:本文中的wl_resource_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wl_resource_get_user_data函数代码示例 C++ wl_registry_bind函数代码示例 |