static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); } else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) { d->fshell = wl_registry_bind(registry, id, &zwp_fullscreen_shell_v1_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "ivi_application") == 0) { d->ivi_application = wl_registry_bind(registry, id, &ivi_application_interface, 1); } }
void NativeStateWayland::registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t /*version*/) { NativeStateWayland *that = static_cast<NativeStateWayland *>(data); if (strcmp(interface, "wl_compositor") == 0) { that->display_->compositor = static_cast<struct wl_compositor *>( wl_registry_bind(registry, id, &wl_compositor_interface, 1)); } else if (strcmp(interface, "wl_shell") == 0) { that->display_->shell = static_cast<struct wl_shell *>( wl_registry_bind(registry, id, &wl_shell_interface, 1)); } else if (strcmp(interface, "wl_output") == 0) { struct my_output *my_output = new struct my_output(); memset(my_output, 0, sizeof(*my_output)); my_output->output = static_cast<struct wl_output *>( wl_registry_bind(registry, id, &wl_output_interface, 2)); that->display_->outputs.push_back(my_output); wl_output_add_listener(my_output->output, &output_listener_, my_output); wl_display_roundtrip(that->display_->display); } }
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { if (strcmp(interface, "wl_compositor") == 0) { GLWin.wl_compositor = (wl_compositor *) wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { GLWin.wl_shell = (wl_shell *)wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { GLWin.wl_seat = (wl_seat *)wl_registry_bind(registry, name, &wl_seat_interface, 1); wl_seat_add_listener(GLWin.wl_seat, &seat_listener, 0); } else if (strcmp(interface, "wl_shm") == 0) { GLWin.wl_shm = (wl_shm *)wl_registry_bind(registry, name, &wl_shm_interface, 1); GLWin.wl_cursor_theme = (wl_cursor_theme *)wl_cursor_theme_load(nullptr, 32, GLWin.wl_shm); GLWin.wl_cursor = (wl_cursor *) wl_cursor_theme_get_cursor(GLWin.wl_cursor_theme, "left_ptr"); } }
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct wayland_compositor *c = data; if (strcmp(interface, "wl_compositor") == 0) { c->parent.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_output") == 0) { c->parent.output = wl_registry_bind(registry, name, &wl_output_interface, 1); wl_output_add_listener(c->parent.output, &output_listener, c); } else if (strcmp(interface, "wl_shell") == 0) { c->parent.shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { display_add_seat(c, name); } else if (strcmp(interface, "wl_shm") == 0) { c->parent.shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); } }
/* Registry callbacks. */ static void registry_handle_global(void *data, struct wl_registry *reg, uint32_t id, const char *interface, uint32_t version) { struct wl_output *output = NULL; gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data; (void)version; if (string_is_equal_fast(interface, "wl_compositor", 13)) wl->compositor = (struct wl_compositor*)wl_registry_bind(reg, id, &wl_compositor_interface, 3); else if (string_is_equal_fast(interface, "wl_output", 9)) { output = (struct wl_output*)wl_registry_bind(reg, id, &wl_output_interface, 2); wl_output_add_listener(output, &output_listener, wl); wl_display_roundtrip(wl->input.dpy); } else if (string_is_equal_fast(interface, "wl_shell", 8)) wl->shell = (struct wl_shell*) wl_registry_bind(reg, id, &wl_shell_interface, 1); else if (string_is_equal_fast(interface, "wl_shm", 6)) wl->shm = (struct wl_shm*)wl_registry_bind(reg, id, &wl_shm_interface, 1); else if (string_is_equal_fast(interface, "wl_seat", 7)) { wl->seat = (struct wl_seat*)wl_registry_bind(reg, id, &wl_seat_interface, 4); wl_seat_add_listener(wl->seat, &seat_listener, wl); } }
static void registryHandleGlobal(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { if (strcmp(interface, "wl_compositor") == 0) { _glfw.wl.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { _glfw.wl.shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { _glfw.wl.shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_output") == 0) { _glfwAddOutput(name, version); } else if (strcmp(interface, "wl_seat") == 0) { if (!_glfw.wl.seat) { _glfw.wl.seat = wl_registry_bind(registry, name, &wl_seat_interface, 1); wl_seat_add_listener(_glfw.wl.seat, &seatListener, NULL); } } }
static void handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *display = data; struct input *input; struct output *output; if (strcmp(interface, "wl_compositor") == 0) { display->compositor = wl_registry_bind(display->registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { input = calloc(1, sizeof *input); input->seat = wl_registry_bind(display->registry, id, &wl_seat_interface, 1); input->pointer_focus = NULL; input->keyboard_focus = NULL; wl_seat_add_listener(input->seat, &seat_listener, input); display->input = input; } else if (strcmp(interface, "wl_output") == 0) { output = malloc(sizeof *output); output->output = wl_registry_bind(display->registry, id, &wl_output_interface, 1); wl_output_add_listener(output->output, &output_listener, output); display->output = output; fprintf(stderr, "test-client: created output global %p\n", display->output); } }
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, name, &xdg_shell_interface, 1); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); } else if (strcmp(interface, "wl_seat") == 0) { d->seat = wl_registry_bind(registry, name, &wl_seat_interface, 1); wl_seat_add_listener(d->seat, &seat_listener, d); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); d->cursor_theme = wl_cursor_theme_load(NULL, 32, d->shm); d->default_cursor = wl_cursor_theme_get_cursor(d->cursor_theme, "left_ptr"); } }
static void display_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { SDL_VideoData *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(d->registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_output") == 0) { Wayland_add_display(d, id); } else if (strcmp(interface, "wl_seat") == 0) { Wayland_display_add_input(d, id); } else if (strcmp(interface, "wl_shell") == 0) { d->shell = wl_registry_bind(d->registry, id, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); d->cursor_theme = WAYLAND_wl_cursor_theme_load(NULL, 32, d->shm); #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH } else if (strcmp(interface, "qt_touch_extension") == 0) { Wayland_touch_create(d, id); } else if (strcmp(interface, "qt_surface_extension") == 0) { d->surface_extension = wl_registry_bind(registry, id, &qt_surface_extension_interface, 1); } else if (strcmp(interface, "qt_windowmanager") == 0) { d->windowmanager = wl_registry_bind(registry, id, &qt_windowmanager_interface, 1); qt_windowmanager_add_listener(d->windowmanager, &windowmanager_listener, d); #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ } }
static void registry_handle_global (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { GstGLWindowWaylandEGL *window_egl = data; struct display *d = &window_egl->display; GST_TRACE_OBJECT (window_egl, "registry_handle_global with registry %p, " "interface %s, version %u", registry, interface, version); if (g_strcmp0 (interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind (registry, name, &wl_compositor_interface, 1); } else if (g_strcmp0 (interface, "wl_shell") == 0) { d->shell = wl_registry_bind (registry, name, &wl_shell_interface, 1); } else if (g_strcmp0 (interface, "wl_seat") == 0) { d->seat = wl_registry_bind (registry, name, &wl_seat_interface, 1); wl_seat_add_listener (d->seat, &seat_listener, window_egl); } else if (g_strcmp0 (interface, "wl_shm") == 0) { d->shm = wl_registry_bind (registry, name, &wl_shm_interface, 1); d->cursor_theme = wl_cursor_theme_load (NULL, 32, d->shm); d->default_cursor = wl_cursor_theme_get_cursor (d->cursor_theme, "left_ptr"); } }
static void registry_handle_global(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version) { WLContextStruct* p_wlCtx = (WLContextStruct*)data; int ans_strcmp = 0; do { ans_strcmp = strcmp(interface, "wl_compositor"); if (0 == ans_strcmp) { p_wlCtx->wlCompositor = (struct wl_compositor*)wl_registry_bind(registry, name, &wl_compositor_interface, 1); break; } ans_strcmp = strcmp(interface, "wl_shm"); if (0 == ans_strcmp) { p_wlCtx->wlShm = wl_registry_bind(registry, name, &wl_shm_interface, 1); wl_shm_add_listener(p_wlCtx->wlShm, &shm_listenter, p_wlCtx); break; } ans_strcmp = strcmp(interface, "serverinfo"); if (0 == ans_strcmp) { p_wlCtx->wlExtServerinfo = (struct serverinfo*)wl_registry_bind(registry, name, &serverinfo_interface, 1); serverinfo_add_listener(p_wlCtx->wlExtServerinfo, &serverinfo_listener_list, data); serverinfo_get_connection_id(p_wlCtx->wlExtServerinfo); } } while(0); }
/*static*/ void Client::bind_wfits(void *data, wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { Client *client = static_cast<Client*>(data); if (std::string(interface) == "wfits_input") { client->wfits_input_ = static_cast<wfits_input*>( wl_registry_bind( registry, id, &wfits_input_interface, version ) ); } else if (std::string(interface) == "wfits_query") { client->wfits_query_ = static_cast<wfits_query*>( wl_registry_bind( registry, id, &wfits_query_interface, version ) ); } else if (std::string(interface) == "wfits_manip") { client->wfits_manip_ = static_cast<wfits_manip*>( wl_registry_bind( registry, id, &wfits_manip_interface, version ) ); } }
static void registry_handle_global (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct desktop *d = data; if (!strcmp (interface, "desktop_shell")) { d->shell = wl_registry_bind (registry, name, &desktop_shell_interface, 3); desktop_shell_add_listener (d->shell, &listener, d); } else if (!strcmp (interface, "wl_output")) { /* TODO: create multiple outputs */ d->output = wl_registry_bind (registry, name, &wl_output_interface, 1); } else if (!strcmp (interface, "shell_helper")) { d->helper = wl_registry_bind (registry, name, &shell_helper_interface, 1); } }
// listeners static void registry_add_object (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { if (!strcmp(interface,"wl_compositor")) { compositor = wl_registry_bind (registry, name, &wl_compositor_interface, 0); } else if (!strcmp(interface,"wl_shell")) { shell = wl_registry_bind (registry, name, &wl_shell_interface, 0); } }
void MockClient::handleGlobal(uint32_t id, const QByteArray &interface) { if (interface == "wl_compositor") { compositor = static_cast<wl_compositor *>(wl_registry_bind(registry, id, &wl_compositor_interface, 1)); } else if (interface == "wl_output") { output = static_cast<wl_output *>(wl_registry_bind(registry, id, &wl_output_interface, 1)); wl_output_add_listener(output, &outputListener, this); } else if (interface == "wl_shm") { shm = static_cast<wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface, 1)); } }
static void wl_registry_handle_global(void* data, struct wl_registry* registry, uint32_t id, const char *interface, uint32_t version) { struct display* display = data; if (strcmp(interface, "wl_compositor") == 0) display->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); else if (strcmp(interface, "wl_shell") == 0) display->shell = wl_registry_bind(registry, id, &wl_shell_interface, 1); else if (strcmp(interface, "wl_shm") == 0) display->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); }
static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { printf("Got a registry event for %s id %d\n", interface, id); if (strcmp(interface, "wl_compositor") == 0) { compositor = (wl_compositor *) wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { shell = (wl_shell *) wl_registry_bind(registry, id, &wl_shell_interface, 1); } }
/* Registry callbacks. */ static void registry_handle_global(void *data, struct wl_registry *reg, uint32_t id, const char *interface, uint32_t version) { gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data; (void)version; if (!strcmp(interface, "wl_compositor")) wl->compositor = (struct wl_compositor*)wl_registry_bind(reg, id, &wl_compositor_interface, 1); else if (!strcmp(interface, "wl_shell")) wl->shell = (struct wl_shell*)wl_registry_bind(reg, id, &wl_shell_interface, 1); }
static void _eventd_nd_wl_registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { EventdNdBackendContext *self = data; if ( g_strcmp0(interface, "wl_compositor") == 0 ) { self->global_names[EVENTD_ND_WL_GLOBAL_COMPOSITOR] = name; self->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, MIN(version, WL_COMPOSITOR_INTERFACE_VERSION)); } else if ( g_strcmp0(interface, "zww_notification_area_v1") == 0 ) { self->global_names[EVENTD_ND_WL_GLOBAL_NOTIFICATION_DAEMON] = name; self->notification_area = wl_registry_bind(registry, name, &zww_notification_area_v1_interface, WW_NOTIFICATION_AREA_INTERFACE_VERSION); zww_notification_area_v1_add_listener(self->notification_area, &_eventd_nd_wl_notification_area_listener, self); } else if ( g_strcmp0(interface, "wl_shm") == 0 ) { self->global_names[EVENTD_ND_WL_GLOBAL_SHM] = name; self->shm = wl_registry_bind(registry, name, &wl_shm_interface, MIN(version, WL_SHM_INTERFACE_VERSION)); wl_shm_add_listener(self->shm, &_eventd_nd_wl_shm_listener, self); } else if ( g_strcmp0(interface, "wl_seat") == 0 ) { EventdNdWlSeat *seat = g_slice_new0(EventdNdWlSeat); seat->context = self; seat->global_name = name; seat->seat = wl_registry_bind(registry, name, &wl_seat_interface, MIN(version, WL_SEAT_INTERFACE_VERSION)); seat->link = self->seats = g_slist_prepend(self->seats, seat); wl_seat_add_listener(seat->seat, &_eventd_nd_wl_seat_listener, seat); } if ( ( self->cursor.theme == NULL ) && ( self->compositor != NULL ) && ( self->shm != NULL ) ) { self->cursor.theme = wl_cursor_theme_load(self->cursor.theme_name, 32, self->shm); if ( self->cursor.theme != NULL ) { const gchar * const *cname = (const gchar * const *) self->cursor.name; for ( cname = ( cname != NULL ) ? cname : _eventd_nd_cursor_names ; ( self->cursor.cursor == NULL ) && ( *cname != NULL ) ; ++cname ) self->cursor.cursor = wl_cursor_theme_get_cursor(self->cursor.theme, *cname); if ( self->cursor.cursor == NULL ) { wl_cursor_theme_destroy(self->cursor.theme); self->cursor.theme = NULL; } else self->cursor.surface = wl_compositor_create_surface(self->compositor); } } }
static void wl_global (void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version) { struct WaylandEGLContext *wl = (struct WaylandEGLContext *) data; if (!strcmp (interface, "wl_compositor")) wl->compositor = (struct wl_compositor *) wl_registry_bind (wl_registry, name, &wl_compositor_interface, 3); else if (!strcmp (interface, "wl_subcompositor")) wl->subcompositor = (struct wl_subcompositor *) wl_registry_bind (wl_registry, name, &wl_subcompositor_interface, 1); }
static void handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct client *client = data; struct input *input; struct output *output; struct test *test; struct global *global; global = xzalloc(sizeof *global); global->name = id; global->interface = strdup(interface); assert(interface); global->version = version; wl_list_insert(client->global_list.prev, &global->link); if (strcmp(interface, "wl_compositor") == 0) { client->wl_compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { input = xzalloc(sizeof *input); input->wl_seat = wl_registry_bind(registry, id, &wl_seat_interface, 1); wl_seat_add_listener(input->wl_seat, &seat_listener, input); client->input = input; } else if (strcmp(interface, "wl_shm") == 0) { client->wl_shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(client->wl_shm, &shm_listener, client); } else if (strcmp(interface, "wl_output") == 0) { output = xzalloc(sizeof *output); output->wl_output = wl_registry_bind(registry, id, &wl_output_interface, 1); wl_output_add_listener(output->wl_output, &output_listener, output); client->output = output; } else if (strcmp(interface, "wl_test") == 0) { test = xzalloc(sizeof *test); test->wl_test = wl_registry_bind(registry, id, &wl_test_interface, 1); wl_test_add_listener(test->wl_test, &test_listener, test); client->test = test; } }
static void displayHandleGlobal(void *_data, struct wl_registry *_registry, uint32_t _id, const char *_interface, uint32_t _version) { struct ContextData *d = (struct ContextData*) _data; if (strcmp(_interface, "wl_compositor") == 0) { d->compositor = (struct wl_compositor *) wl_registry_bind(_registry, _id, &wl_compositor_interface, 1); } else if (strcmp(_interface, "wl_shell") == 0) { d->shell = (struct wl_shell *) wl_registry_bind(_registry, _id, &wl_shell_interface, 1); } else if (strcmp(_interface, "wl_shell_surface") == 0) { d->shell_surface = (struct wl_shell_surface *) wl_registry_bind(_registry, _id, &wl_shell_surface_interface, 1); wl_shell_surface_add_listener(d->shell_surface, &shellSurfaceListener, d); } else if (strcmp(_interface, "wl_seat") == 0) { d->seat = (struct wl_seat *) wl_registry_bind(_registry, _id, &wl_seat_interface, 1); wl_seat_add_listener(d->seat, &seatListener, d); } }
inline void WaylandEventQueue::RegistryHandler(struct wl_registry *registry, uint32_t id, const char *interface) { if (StringIsEqual(interface, "wl_compositor")) compositor = (wl_compositor *) wl_registry_bind(registry, id, &wl_compositor_interface, 1); else if (StringIsEqual(interface, "wl_seat")) { seat = (wl_seat *)wl_registry_bind(registry, id, &wl_seat_interface, 1); wl_seat_add_listener(seat, &seat_listener, this); } else if (StringIsEqual(interface, "wl_shell")) shell = (wl_shell *)wl_registry_bind(registry, id, &wl_shell_interface, 1); }
//call wl_registry_add_listener on this static void register_globals(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct registry *reg = (struct registry *)data; if (strcmp(interface, wl_compositor_interface.name) == 0) reg->compositor = (struct wl_compositor *)wl_registry_bind(registry, id, &wl_compositor_interface, version); else if (strcmp(interface, wl_shm_interface.name) == 0) reg->shm = (struct wl_shm *)wl_registry_bind(registry, id, &wl_shm_interface, version); //register client specific code if (reg->registre) reg->registre(registry, id, interface, version); }
static Ecore_IMF_Context * im_module_create() { Ecore_IMF_Context *ctx = NULL; WaylandIMContext *ctxd = NULL; if (!text_input_manager) { Ecore_Wl_Global *global; struct wl_registry *registry; Eina_Inlist *globals; if (!(registry = ecore_wl_registry_get())) return NULL; if (!(globals = ecore_wl_globals_get())) return NULL; EINA_INLIST_FOREACH(globals, global) { if (!strcmp(global->interface, "wl_text_input_manager")) { text_input_manager = wl_registry_bind(registry, global->id, &wl_text_input_manager_interface, 1); EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "bound wl_text_input_manager interface"); break; } } }
void _glfwAddOutputWayland(uint32_t name, uint32_t version) { _GLFWmonitor *monitor; struct wl_output *output; if (version < 2) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Unsupported output interface version"); return; } // The actual name of this output will be set in the geometry handler. monitor = _glfwAllocMonitor(NULL, 0, 0); output = wl_registry_bind(_glfw.wl.registry, name, &wl_output_interface, 2); if (!output) { _glfwFreeMonitor(monitor); return; } monitor->wl.scale = 1; monitor->wl.output = output; monitor->wl.name = name; wl_output_add_listener(output, &outputListener, monitor); }
static void registry_handle_global (void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp (interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind (registry, id, &wl_compositor_interface, 1); } else if (strcmp (interface, "wl_shell") == 0) { d->shell = wl_registry_bind (registry, id, &wl_shell_interface, 1); } else if (strcmp (interface, "wl_shm") == 0) { d->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1); wl_shm_add_listener (d->shm, &shm_listenter, d); } }
QT_USE_NAMESPACE QWaylandSurfaceExtension::QWaylandSurfaceExtension(QWaylandDisplay *display, uint32_t id) { m_surface_extension = static_cast<struct wl_surface_extension *>( wl_registry_bind(display->wl_registry(), id, &wl_surface_extension_interface, 1)); }
static void registry_handle_global( void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct cursor_viewer *viewer = data; if (strcmp(interface, "wl_compositor") == 0) viewer->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); else if (strcmp(interface, "wl_shell") == 0) viewer->shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); else if (strcmp(interface, "wl_shm") == 0) viewer->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); }
void nsRetrievalContextWayland::InitSeat(wl_registry *registry, uint32_t id, uint32_t version, void *data) { mSeat = (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface, 1); wl_seat_add_listener(mSeat, &seat_listener, data); }