mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-08 13:29:47 -05:00
Set up visuals in wayland-server
Still very much hand-wavey, but at least it's only in one place now.
This commit is contained in:
parent
b3fc757cd8
commit
c5c510ec75
6 changed files with 58 additions and 46 deletions
|
|
@ -629,3 +629,38 @@ wl_display_add_socket(struct wl_display *display, const char *name)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
WL_EXPORT int
|
||||
wl_compositor_init(struct wl_compositor *compositor,
|
||||
const struct wl_compositor_interface *interface,
|
||||
struct wl_display *display)
|
||||
{
|
||||
compositor->object.interface = &wl_compositor_interface;
|
||||
compositor->object.implementation = (void (**)(void)) interface;
|
||||
wl_display_add_object(display, &compositor->object);
|
||||
if (wl_display_add_global(display, &compositor->object, NULL))
|
||||
return -1;
|
||||
|
||||
compositor->argb_visual.object.interface = &wl_visual_interface;
|
||||
compositor->argb_visual.object.implementation = NULL;
|
||||
wl_display_add_object(display, &compositor->argb_visual.object);
|
||||
wl_display_add_global(display, &compositor->argb_visual.object, NULL);
|
||||
|
||||
compositor->premultiplied_argb_visual.object.interface =
|
||||
&wl_visual_interface;
|
||||
compositor->premultiplied_argb_visual.object.implementation = NULL;
|
||||
wl_display_add_object(display,
|
||||
&compositor->premultiplied_argb_visual.object);
|
||||
wl_display_add_global(display,
|
||||
&compositor->premultiplied_argb_visual.object,
|
||||
NULL);
|
||||
|
||||
compositor->rgb_visual.object.interface = &wl_visual_interface;
|
||||
compositor->rgb_visual.object.implementation = NULL;
|
||||
wl_display_add_object(display,
|
||||
&compositor->rgb_visual.object);
|
||||
wl_display_add_global(display,
|
||||
&compositor->rgb_visual.object, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,15 @@ void wl_client_destroy(struct wl_client *client);
|
|||
void wl_client_post_no_memory(struct wl_client *client);
|
||||
void wl_client_post_global(struct wl_client *client, struct wl_object *object);
|
||||
|
||||
struct wl_visual {
|
||||
struct wl_object object;
|
||||
};
|
||||
|
||||
struct wl_compositor {
|
||||
struct wl_object object;
|
||||
struct wl_visual argb_visual;
|
||||
struct wl_visual premultiplied_argb_visual;
|
||||
struct wl_visual rgb_visual;
|
||||
};
|
||||
|
||||
struct wl_resource {
|
||||
|
|
@ -129,10 +136,6 @@ struct wl_shell {
|
|||
struct wl_object object;
|
||||
};
|
||||
|
||||
struct wl_visual {
|
||||
struct wl_object object;
|
||||
};
|
||||
|
||||
struct wl_grab;
|
||||
struct wl_grab_interface {
|
||||
void (*motion)(struct wl_grab *grab,
|
||||
|
|
@ -224,6 +227,10 @@ wl_input_device_set_keyboard_focus(struct wl_input_device *device,
|
|||
struct wl_surface *surface,
|
||||
uint32_t time);
|
||||
|
||||
int
|
||||
wl_compositor_init(struct wl_compositor *compositor,
|
||||
const struct wl_compositor_interface *interface,
|
||||
struct wl_display *display);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue