1 /* GDK - The GIMP Drawing Kit
2 * gdkdisplay-broadway.c
4 * Copyright 2001 Sun Microsystems Inc.
5 * Copyright (C) 2004 Nokia Corporation
7 * Erwann Chenede <erwann.chenede@sun.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
27 #include "gdkdisplay-broadway.h"
29 #include "gdkdisplay.h"
30 #include "gdkeventsource.h"
31 #include "gdkscreen.h"
32 #include "gdkscreen-broadway.h"
33 #include "gdkinternals.h"
34 #include "gdkdeviceprivate.h"
35 #include "gdkdevicemanager-broadway.h"
38 #include <glib/gprintf.h>
44 static void gdk_broadway_display_dispose (GObject *object);
45 static void gdk_broadway_display_finalize (GObject *object);
47 G_DEFINE_TYPE (GdkBroadwayDisplay, gdk_broadway_display, GDK_TYPE_DISPLAY)
50 gdk_broadway_display_init (GdkBroadwayDisplay *display)
52 _gdk_broadway_display_manager_add_display (gdk_display_manager_get (),
53 GDK_DISPLAY_OBJECT (display));
54 display->id_ht = g_hash_table_new (NULL, NULL);
58 gdk_event_init (GdkDisplay *display)
60 GdkBroadwayDisplay *broadway_display;
62 broadway_display = GDK_BROADWAY_DISPLAY (display);
63 broadway_display->event_source = _gdk_broadway_event_source_new (display);
64 broadway_display->saved_serial = 1;
68 gdk_broadway_display_init_input (GdkDisplay *display)
70 GdkBroadwayDisplay *broadway_display;
71 GdkDeviceManager *device_manager;
75 broadway_display = GDK_BROADWAY_DISPLAY (display);
76 device_manager = gdk_display_get_device_manager (display);
78 /* For backwards compatibility, just add
79 * floating devices that are not keyboards.
81 list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);
83 for (l = list; l; l = l->next)
87 if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
90 broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
91 g_object_ref (l->data));
96 /* Now set "core" pointer to the first
97 * master device that is a pointer.
99 list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
101 for (l = list; l; l = l->next)
105 if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
108 display->core_pointer = device;
112 /* Add the core pointer to the devices list */
113 broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
114 g_object_ref (display->core_pointer));
119 typedef struct HttpRequest {
121 GSocketConnection *connection;
122 GDataInputStream *data;
127 http_request_free (HttpRequest *request)
129 g_object_unref (request->connection);
130 g_object_unref (request->data);
131 g_string_free (request->request, TRUE);
135 struct BroadwayInput {
137 GSocketConnection *connection;
143 broadway_input_free (BroadwayInput *input)
145 g_object_unref (input->connection);
146 g_byte_array_free (input->buffer, FALSE);
147 g_source_destroy (input->source);
152 process_input_messages (GdkBroadwayDisplay *broadway_display)
154 BroadwayInputMsg *message;
156 while (broadway_display->input_messages)
158 message = broadway_display->input_messages->data;
159 broadway_display->input_messages =
160 g_list_delete_link (broadway_display->input_messages,
161 broadway_display->input_messages);
163 _gdk_broadway_events_got_input (GDK_DISPLAY (broadway_display), message);
169 parse_pointer_data (char *p, BroadwayInputPointerMsg *data)
171 data->id = strtol (p, &p, 10);
173 data->root_x = strtol (p, &p, 10);
175 data->root_y = strtol (p, &p, 10);
177 data->win_x = strtol (p, &p, 10);
179 data->win_y = strtol (p, &p, 10);
181 data->state = strtol (p, &p, 10);
187 parse_input_message (BroadwayInput *input, const char *message)
189 GdkBroadwayDisplay *broadway_display;
190 BroadwayInputMsg msg;
193 broadway_display = GDK_BROADWAY_DISPLAY (input->display);
196 msg.base.type = *p++;
197 msg.base.serial = (guint32)strtol (p, &p, 10);
199 msg.base.time = strtol(p, &p, 10);
202 switch (msg.base.type) {
203 case 'e': /* Enter */
204 case 'l': /* Leave */
205 p = parse_pointer_data (p, &msg.pointer);
207 msg.crossing.mode = strtol(p, &p, 10);
210 case 'm': /* Mouse move */
211 p = parse_pointer_data (p, &msg.pointer);
216 p = parse_pointer_data (p, &msg.pointer);
218 msg.button.button = strtol(p, &p, 10);
222 p = parse_pointer_data (p, &msg.pointer);
224 msg.scroll.dir = strtol(p, &p, 10);
229 msg.key.key = strtol(p, &p, 10);
234 msg.grab_reply.res = strtol(p, &p, 10);
238 msg.query_reply.root_x = strtol(p, &p, 10);
240 msg.query_reply.root_y = strtol(p, &p, 10);
242 msg.query_reply.win_x = strtol(p, &p, 10);
244 msg.query_reply.win_y = strtol(p, &p, 10);
246 msg.query_reply.window_with_mouse = strtol(p, &p, 10);
250 g_printerr ("Unknown input command %s\n", message);
254 broadway_display->input_messages = g_list_append (broadway_display->input_messages, g_memdup (&msg, sizeof (msg)));
259 parse_input (BroadwayInput *input)
261 GdkBroadwayDisplay *broadway_display;
265 broadway_display = GDK_BROADWAY_DISPLAY (input->display);
267 buf = (char *)input->buffer->data;
268 len = input->buffer->len;
275 broadway_display->input = NULL;
276 broadway_input_free (input);
280 while ((ptr = memchr (buf, 0xff, len)) != NULL)
285 parse_input_message (input, buf + 1);
290 if (len > 0 && buf[0] != 0)
292 broadway_display->input = NULL;
293 broadway_input_free (input);
298 g_byte_array_remove_range (input->buffer, 0, buf - (char *)input->buffer->data);
302 input_data_cb (GObject *stream,
303 BroadwayInput *input)
305 GdkBroadwayDisplay *broadway_display;
311 broadway_display = GDK_BROADWAY_DISPLAY (input->display);
312 in = g_io_stream_get_input_stream (G_IO_STREAM (input->connection));
315 res = g_pollable_input_stream_read_nonblocking (G_POLLABLE_INPUT_STREAM (in),
316 buffer, sizeof (buffer), NULL, &error);
321 g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
323 g_error_free (error);
327 broadway_display->input = NULL;
328 broadway_input_free (input);
331 g_print ("input error %s", error->message);
332 g_error_free (error);
337 g_byte_array_append (input->buffer, buffer, res);
340 process_input_messages (broadway_display);
346 process_input_idle_cb (GdkBroadwayDisplay *display)
348 process_input_messages (display);
352 /* Note: This may be called while handling a message (i.e. sorta recursively) */
354 _gdk_broadway_display_block_for_input (GdkDisplay *display, char op,
355 guint32 serial, gboolean remove_message)
357 GdkBroadwayDisplay *broadway_display;
358 BroadwayInputMsg *message;
359 gboolean queued_idle;
362 BroadwayInput *input;
368 gdk_display_flush (display);
370 broadway_display = GDK_BROADWAY_DISPLAY (display);
371 if (broadway_display->input == NULL)
374 input = broadway_display->input;
377 /* Check for existing reply in queue */
379 for (l = broadway_display->input_messages; l != NULL; l = l->next)
383 if (message->base.type == op)
385 if (message->base.serial == serial)
388 broadway_display->input_messages =
389 g_list_delete_link (broadway_display->input_messages, l);
395 /* Not found, read more, blocking */
397 in = g_io_stream_get_input_stream (G_IO_STREAM (input->connection));
398 res = g_input_stream_read (in, buffer, sizeof (buffer), NULL, NULL);
401 g_byte_array_append (input->buffer, buffer, res);
405 /* Since we're parsing input but not processing the resulting messages
406 we might not get a readable callback on the stream, so queue an idle to
407 process the messages */
411 g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)process_input_idle_cb, display, NULL);
419 set_fd_blocking (int fd)
423 if ((arg = fcntl (fd, F_GETFL, NULL)) < 0)
426 arg = arg & ~O_NONBLOCK;
428 fcntl (fd, F_SETFL, arg);
432 parse_line (char *line, char *key)
436 if (!g_str_has_prefix (line, key))
438 p = line + strlen (key);
442 /* Skip optional initial space */
448 send_error (HttpRequest *request,
454 res = g_strdup_printf ("HTTP/1.0 %d %s\r\n\r\n"
455 "<html><head><title>%d %s</title></head>"
456 "<body>%s</body></html>",
460 /* TODO: This should really be async */
461 g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
462 res, strlen (res), NULL, NULL, NULL);
464 http_request_free (request);
468 start_input (HttpRequest *request)
472 int num_key1, num_key2;
476 guint8 challenge[16];
481 GdkBroadwayDisplay *broadway_display;
482 BroadwayInput *input;
483 const void *data_buffer;
484 gsize data_buffer_size;
487 broadway_display = GDK_BROADWAY_DISPLAY (request->display);
489 if (broadway_display->input != NULL)
491 send_error (request, 409, "Input already handled");
495 lines = g_strsplit (request->request->str, "\n", 0);
503 for (i = 0; lines[i] != NULL; i++)
505 if ((p = parse_line (lines[i], "Sec-WebSocket-Key1")))
510 if (g_ascii_isdigit (*p))
511 key1 = key1 * 10 + g_ascii_digit_value (*p);
520 else if ((p = parse_line (lines[i], "Sec-WebSocket-Key2")))
525 if (g_ascii_isdigit (*p))
526 key2 = key2 * 10 + g_ascii_digit_value (*p);
535 else if ((p = parse_line (lines[i], "Origin")))
539 else if ((p = parse_line (lines[i], "Host")))
545 if (num_key1 != 1 || num_key2 != 1 || origin == NULL || host == NULL)
548 send_error (request, 400, "Bad websocket request");
552 challenge[0] = (key1 >> 24) & 0xff;
553 challenge[1] = (key1 >> 16) & 0xff;
554 challenge[2] = (key1 >> 8) & 0xff;
555 challenge[3] = (key1 >> 0) & 0xff;
556 challenge[4] = (key2 >> 24) & 0xff;
557 challenge[5] = (key2 >> 16) & 0xff;
558 challenge[6] = (key2 >> 8) & 0xff;
559 challenge[7] = (key2 >> 0) & 0xff;
561 if (!g_input_stream_read_all (G_INPUT_STREAM (request->data), challenge+8, 8, NULL, NULL, NULL))
564 send_error (request, 400, "Bad websocket request");
568 checksum = g_checksum_new (G_CHECKSUM_MD5);
569 g_checksum_update (checksum, challenge, 16);
571 g_checksum_get_digest (checksum, challenge, &len);
572 g_checksum_free (checksum);
574 res = g_strdup_printf ("HTTP/1.1 101 WebSocket Protocol Handshake\r\n"
575 "Upgrade: WebSocket\r\n"
576 "Connection: Upgrade\r\n"
577 "Sec-WebSocket-Origin: %s\r\n"
578 "Sec-WebSocket-Location: ws://%s/input\r\n"
579 "Sec-WebSocket-Protocol: broadway\r\n"
583 g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
584 res, strlen (res), NULL, NULL, NULL);
586 g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
587 challenge, 16, NULL, NULL, NULL);
589 input = g_new0 (BroadwayInput, 1);
591 input->display = request->display;
592 input->connection = g_object_ref (request->connection);
594 data_buffer = g_buffered_input_stream_peek_buffer (G_BUFFERED_INPUT_STREAM (request->data), &data_buffer_size);
595 input->buffer = g_byte_array_sized_new (data_buffer_size);
596 g_byte_array_append (input->buffer, data_buffer, data_buffer_size);
598 broadway_display->input = input;
600 /* This will free and close the data input stream, but we got all the buffered content already */
601 http_request_free (request);
603 in = g_io_stream_get_input_stream (G_IO_STREAM (input->connection));
604 input->source = g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM (in), NULL);
605 g_source_set_callback (input->source, (GSourceFunc)input_data_cb, input, NULL);
606 g_source_attach (input->source, NULL);
608 /* Process any data in the pipe already */
610 process_input_messages (broadway_display);
616 start_output (HttpRequest *request)
619 GdkBroadwayDisplay *broadway_display;
622 socket = g_socket_connection_get_socket (request->connection);
624 broadway_display = GDK_BROADWAY_DISPLAY (request->display);
625 fd = g_socket_get_fd (socket);
626 set_fd_blocking (fd);
627 /* We dup this because otherwise it'll be closed with the request SocketConnection */
629 if (broadway_display->output)
631 broadway_display->saved_serial = broadway_output_get_next_serial (broadway_display->output);
632 broadway_output_free (broadway_display->output);
635 broadway_display->output = broadway_output_new (dup(fd), broadway_display->saved_serial);
636 _gdk_broadway_resync_windows ();
637 http_request_free (request);
641 send_data (HttpRequest *request,
642 const char *mimetype,
643 const char *data, gsize len)
647 res = g_strdup_printf ("HTTP/1.0 200 OK\r\n"
648 "Content-Type: %s\r\n"
649 "Content-Length: %"G_GSIZE_FORMAT"\r\n"
652 /* TODO: This should really be async */
653 g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
654 res, strlen (res), NULL, NULL, NULL);
656 g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
657 data, len, NULL, NULL, NULL);
658 http_request_free (request);
661 #include "clienthtml.h"
662 #include "broadwayjs.h"
665 got_request (HttpRequest *request)
667 char *start, *escaped, *tmp, *version;
669 if (!g_str_has_prefix (request->request->str, "GET "))
671 send_error (request, 501, "Only GET implemented");
675 start = request->request->str + 4; /* Skip "GET " */
677 while (*start == ' ')
680 for (tmp = start; *tmp != 0 && *tmp != ' ' && *tmp != '\n'; tmp++)
682 escaped = g_strndup (start, tmp - start);
687 while (*start == ' ')
689 for (tmp = start; *tmp != 0 && *tmp != ' ' && *tmp != '\n'; tmp++)
691 version = g_strndup (start, tmp - start);
694 if (strcmp (escaped, "/client.html") == 0 || strcmp (escaped, "/") == 0)
695 send_data (request, "text/html", client_html, G_N_ELEMENTS(client_html) - 1);
696 else if (strcmp (escaped, "/broadway.js") == 0)
697 send_data (request, "text/javascript", broadway_js, G_N_ELEMENTS(broadway_js) - 1);
698 else if (strcmp (escaped, "/output") == 0)
699 start_output (request);
700 else if (strcmp (escaped, "/input") == 0)
701 start_input (request);
703 send_error (request, 404, "File not found");
707 got_http_request_line (GInputStream *stream,
708 GAsyncResult *result,
709 HttpRequest *request)
713 line = g_data_input_stream_read_line_finish (G_DATA_INPUT_STREAM (stream), result, NULL, NULL);
716 http_request_free (request);
717 g_printerr ("Error reading request lines\n");
720 if (strlen (line) == 0)
721 got_request (request);
724 /* Protect against overflow in request length */
725 if (request->request->len > 1024 * 5)
727 send_error (request, 400, "Request to long");
731 g_string_append_printf (request->request, "%s\n", line);
732 g_data_input_stream_read_line_async (request->data, 0, NULL,
733 (GAsyncReadyCallback)got_http_request_line, request);
740 handle_incoming_connection (GSocketService *service,
741 GSocketConnection *connection,
742 GObject *source_object)
744 HttpRequest *request;
747 request = g_new0 (HttpRequest, 1);
748 request->connection = g_object_ref (connection);
749 request->display = (GdkDisplay *) source_object;
750 request->request = g_string_new ("");
752 in = g_io_stream_get_input_stream (G_IO_STREAM (connection));
754 request->data = g_data_input_stream_new (in);
755 g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (request->data), FALSE);
756 /* Be tolerant of input */
757 g_data_input_stream_set_newline_type (request->data, G_DATA_STREAM_NEWLINE_TYPE_ANY);
759 g_data_input_stream_read_line_async (request->data, 0, NULL,
760 (GAsyncReadyCallback)got_http_request_line, request);
765 _gdk_broadway_display_open (const gchar *display_name)
768 GdkBroadwayDisplay *broadway_display;
772 display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
773 broadway_display = GDK_BROADWAY_DISPLAY (display);
775 broadway_display->output = NULL;
777 /* initialize the display's screens */
778 broadway_display->screens = g_new (GdkScreen *, 1);
779 broadway_display->screens[0] = _gdk_broadway_screen_new (display, 0);
781 /* We need to initialize events after we have the screen
782 * structures in places
784 _gdk_broadway_screen_events_init (broadway_display->screens[0]);
786 /*set the default screen */
787 broadway_display->default_screen = broadway_display->screens[0];
789 display->device_manager = _gdk_broadway_device_manager_new (display);
791 gdk_event_init (display);
793 gdk_broadway_display_init_input (display);
794 _gdk_broadway_display_init_dnd (display);
796 _gdk_broadway_screen_setup (broadway_display->screens[0]);
798 if (display_name == NULL)
799 display_name = g_getenv ("BROADWAY_DISPLAY");
802 if (display_name != NULL)
803 port = strtol(display_name, NULL, 10);
807 broadway_display->service = g_socket_service_new ();
808 if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (broadway_display->service),
813 g_printerr ("Unable to listen to port %d: %s\n", 8080, error->message);
814 g_error_free (error);
817 g_signal_connect (broadway_display->service, "incoming", G_CALLBACK (handle_incoming_connection), NULL);
819 g_signal_emit_by_name (display, "opened");
820 g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
826 static G_CONST_RETURN gchar *
827 gdk_broadway_display_get_name (GdkDisplay *display)
829 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
831 return (gchar *) "Broadway";
835 gdk_broadway_display_get_n_screens (GdkDisplay *display)
837 g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
843 gdk_broadway_display_get_screen (GdkDisplay *display,
846 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
847 g_return_val_if_fail (screen_num == 0, NULL);
849 return GDK_BROADWAY_DISPLAY (display)->screens[screen_num];
853 gdk_broadway_display_get_default_screen (GdkDisplay *display)
855 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
857 return GDK_BROADWAY_DISPLAY (display)->default_screen;
861 gdk_broadway_display_beep (GdkDisplay *display)
863 g_return_if_fail (GDK_IS_DISPLAY (display));
867 gdk_broadway_display_sync (GdkDisplay *display)
869 g_return_if_fail (GDK_IS_DISPLAY (display));
874 gdk_broadway_display_flush (GdkDisplay *display)
876 GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (display);
878 g_return_if_fail (GDK_IS_DISPLAY (display));
880 if (broadway_display->output &&
881 !broadway_output_flush (broadway_display->output))
883 broadway_display->saved_serial = broadway_output_get_next_serial (broadway_display->output);
884 broadway_output_free (broadway_display->output);
885 broadway_display->output = NULL;
890 gdk_broadway_display_has_pending (GdkDisplay *display)
896 gdk_broadway_display_get_default_group (GdkDisplay *display)
898 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
904 gdk_broadway_display_dispose (GObject *object)
906 GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
908 _gdk_broadway_display_manager_remove_display (gdk_display_manager_get (),
909 GDK_DISPLAY_OBJECT (object));
911 g_list_foreach (broadway_display->input_devices, (GFunc) g_object_run_dispose, NULL);
913 _gdk_screen_close (broadway_display->screens[0]);
915 if (broadway_display->event_source)
917 g_source_destroy (broadway_display->event_source);
918 g_source_unref (broadway_display->event_source);
919 broadway_display->event_source = NULL;
922 G_OBJECT_CLASS (gdk_broadway_display_parent_class)->dispose (object);
926 gdk_broadway_display_finalize (GObject *object)
928 GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
931 if (broadway_display->keymap)
932 g_object_unref (broadway_display->keymap);
934 _gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
937 g_hash_table_destroy (broadway_display->atom_from_virtual);
938 g_hash_table_destroy (broadway_display->atom_to_virtual);
940 /* input GdkDevice list */
941 g_list_foreach (broadway_display->input_devices, (GFunc) g_object_unref, NULL);
942 g_list_free (broadway_display->input_devices);
943 /* Free all GdkScreens */
944 g_object_unref (broadway_display->screens[0]);
945 g_free (broadway_display->screens);
947 G_OBJECT_CLASS (gdk_broadway_display_parent_class)->finalize (object);
951 _gdk_broadway_display_make_default (GdkDisplay *display)
956 gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
957 const gchar *startup_id)
962 gdk_broadway_display_supports_selection_notification (GdkDisplay *display)
968 gdk_broadway_display_request_selection_notification (GdkDisplay *display,
976 gdk_broadway_display_supports_clipboard_persistence (GdkDisplay *display)
982 gdk_broadway_display_store_clipboard (GdkDisplay *display,
983 GdkWindow *clipboard_window,
985 const GdkAtom *targets,
991 gdk_broadway_display_supports_shapes (GdkDisplay *display)
997 gdk_broadway_display_supports_input_shapes (GdkDisplay *display)
1003 gdk_broadway_display_supports_composite (GdkDisplay *display)
1009 gdk_broadway_display_list_devices (GdkDisplay *display)
1011 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
1013 return GDK_BROADWAY_DISPLAY (display)->input_devices;
1017 gdk_broadway_display_get_next_serial (GdkDisplay *display)
1019 GdkBroadwayDisplay *broadway_display;
1020 broadway_display = GDK_BROADWAY_DISPLAY (display);
1021 if (broadway_display->output)
1022 return broadway_output_get_next_serial (broadway_display->output);
1023 return broadway_display->saved_serial;
1028 gdk_broadway_display_event_data_copy (GdkDisplay *display,
1029 const GdkEvent *src,
1035 gdk_broadway_display_event_data_free (GdkDisplay *display,
1041 gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
1043 GObjectClass *object_class = G_OBJECT_CLASS (class);
1044 GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
1046 object_class->dispose = gdk_broadway_display_dispose;
1047 object_class->finalize = gdk_broadway_display_finalize;
1049 display_class->window_type = GDK_TYPE_BROADWAY_WINDOW;
1051 display_class->get_name = gdk_broadway_display_get_name;
1052 display_class->get_n_screens = gdk_broadway_display_get_n_screens;
1053 display_class->get_screen = gdk_broadway_display_get_screen;
1054 display_class->get_default_screen = gdk_broadway_display_get_default_screen;
1055 display_class->beep = gdk_broadway_display_beep;
1056 display_class->sync = gdk_broadway_display_sync;
1057 display_class->flush = gdk_broadway_display_flush;
1058 display_class->has_pending = gdk_broadway_display_has_pending;
1059 display_class->queue_events = _gdk_broadway_display_queue_events;
1060 display_class->get_default_group = gdk_broadway_display_get_default_group;
1061 display_class->supports_selection_notification = gdk_broadway_display_supports_selection_notification;
1062 display_class->request_selection_notification = gdk_broadway_display_request_selection_notification;
1063 display_class->supports_clipboard_persistence = gdk_broadway_display_supports_clipboard_persistence;
1064 display_class->store_clipboard = gdk_broadway_display_store_clipboard;
1065 display_class->supports_shapes = gdk_broadway_display_supports_shapes;
1066 display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes;
1067 display_class->supports_composite = gdk_broadway_display_supports_composite;
1068 display_class->list_devices = gdk_broadway_display_list_devices;
1069 display_class->get_cursor_for_type = _gdk_broadway_display_get_cursor_for_type;
1070 display_class->get_cursor_for_name = _gdk_broadway_display_get_cursor_for_name;
1071 display_class->get_cursor_for_pixbuf = _gdk_broadway_display_get_cursor_for_pixbuf;
1072 display_class->get_default_cursor_size = _gdk_broadway_display_get_default_cursor_size;
1073 display_class->get_maximal_cursor_size = _gdk_broadway_display_get_maximal_cursor_size;
1074 display_class->supports_cursor_alpha = _gdk_broadway_display_supports_cursor_alpha;
1075 display_class->supports_cursor_color = _gdk_broadway_display_supports_cursor_color;
1077 display_class->before_process_all_updates = _gdk_broadway_display_before_process_all_updates;
1078 display_class->after_process_all_updates = _gdk_broadway_display_after_process_all_updates;
1079 display_class->get_next_serial = gdk_broadway_display_get_next_serial;
1080 display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
1081 display_class->event_data_copy = gdk_broadway_display_event_data_copy;
1082 display_class->event_data_free = gdk_broadway_display_event_data_free;
1083 display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
1084 display_class->get_keymap = _gdk_broadway_display_get_keymap;
1085 display_class->get_selection_owner = _gdk_broadway_display_get_selection_owner;
1086 display_class->set_selection_owner = _gdk_broadway_display_set_selection_owner;
1087 display_class->send_selection_notify = _gdk_broadway_display_send_selection_notify;
1088 display_class->get_selection_property = _gdk_broadway_display_get_selection_property;
1089 display_class->convert_selection = _gdk_broadway_display_convert_selection;
1090 display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list;
1091 display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target;