2012-12-23 22:35:03 +00:00
|
|
|
#ifndef __BROADWAY_SERVER__
|
|
|
|
#define __BROADWAY_SERVER__
|
|
|
|
|
|
|
|
#include "broadway-protocol.h"
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <cairo.h>
|
|
|
|
|
2012-12-26 21:31:52 +00:00
|
|
|
void broadway_events_got_input (BroadwayInputMsg *message,
|
|
|
|
gint32 client_id);
|
2012-12-23 22:35:03 +00:00
|
|
|
|
|
|
|
typedef struct _BroadwayServer BroadwayServer;
|
|
|
|
typedef struct _BroadwayServerClass BroadwayServerClass;
|
|
|
|
|
|
|
|
#define BROADWAY_TYPE_SERVER (broadway_server_get_type())
|
|
|
|
#define BROADWAY_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BROADWAY_TYPE_SERVER, BroadwayServer))
|
|
|
|
#define BROADWAY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BROADWAY_TYPE_SERVER, BroadwayServerClass))
|
|
|
|
#define BROADWAY_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BROADWAY_TYPE_SERVER))
|
|
|
|
#define BROADWAY_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BROADWAY_TYPE_SERVER))
|
|
|
|
#define BROADWAY_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BROADWAY_TYPE_SERVER, BroadwayServerClass))
|
|
|
|
|
2017-11-29 18:08:37 +00:00
|
|
|
typedef struct _BroadwayNode BroadwayNode;
|
2019-03-25 13:15:49 +00:00
|
|
|
typedef struct _BroadwayTexture BroadwayTexture;
|
2017-11-29 18:08:37 +00:00
|
|
|
|
|
|
|
struct _BroadwayNode {
|
2019-03-25 13:15:49 +00:00
|
|
|
grefcount refcount;
|
2017-11-29 18:08:37 +00:00
|
|
|
guint32 type;
|
2019-03-25 13:15:49 +00:00
|
|
|
guint32 id;
|
2019-03-28 18:17:01 +00:00
|
|
|
guint32 output_id;
|
2017-11-30 09:36:30 +00:00
|
|
|
guint32 hash; /* deep hash */
|
2017-11-29 18:08:37 +00:00
|
|
|
guint32 n_children;
|
|
|
|
BroadwayNode **children;
|
2019-03-25 13:15:49 +00:00
|
|
|
guint32 texture_id;
|
2019-03-28 15:03:42 +00:00
|
|
|
|
|
|
|
/* Scratch stuff used during diff */
|
2019-03-28 18:17:01 +00:00
|
|
|
gboolean reused;
|
|
|
|
gboolean consumed;
|
2019-03-28 15:03:42 +00:00
|
|
|
|
2017-11-29 18:08:37 +00:00
|
|
|
guint32 n_data;
|
|
|
|
guint32 data[1];
|
|
|
|
};
|
2012-12-23 22:35:03 +00:00
|
|
|
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean broadway_node_equal (BroadwayNode *a,
|
|
|
|
BroadwayNode *b);
|
|
|
|
gboolean broadway_node_deep_equal (BroadwayNode *a,
|
|
|
|
BroadwayNode *b);
|
2019-03-28 18:17:01 +00:00
|
|
|
void broadway_node_mark_deep_reused (BroadwayNode *node,
|
|
|
|
gboolean reused);
|
|
|
|
void broadway_node_mark_deep_consumed (BroadwayNode *node,
|
|
|
|
gboolean consumed);
|
2019-03-28 15:03:42 +00:00
|
|
|
void broadway_node_add_to_lookup (BroadwayNode *node,
|
|
|
|
GHashTable *node_lookup);
|
2017-12-05 13:38:57 +00:00
|
|
|
BroadwayServer *broadway_server_new (char *address,
|
|
|
|
int port,
|
|
|
|
const char *ssl_cert,
|
|
|
|
const char *ssl_key,
|
|
|
|
GError **error);
|
|
|
|
BroadwayServer *broadway_server_on_unix_socket_new (char *address,
|
|
|
|
GError **error);
|
|
|
|
gboolean broadway_server_has_client (BroadwayServer *server);
|
|
|
|
void broadway_server_flush (BroadwayServer *server);
|
|
|
|
void broadway_server_sync (BroadwayServer *server);
|
|
|
|
void broadway_server_roundtrip (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id,
|
2017-12-05 13:38:57 +00:00
|
|
|
guint32 tag);
|
|
|
|
void broadway_server_get_screen_size (BroadwayServer *server,
|
|
|
|
guint32 *width,
|
2020-03-12 10:12:01 +00:00
|
|
|
guint32 *height,
|
|
|
|
guint32 *scale);
|
2017-12-05 13:38:57 +00:00
|
|
|
guint32 broadway_server_get_next_serial (BroadwayServer *server);
|
|
|
|
guint32 broadway_server_get_last_seen_time (BroadwayServer *server);
|
|
|
|
gboolean broadway_server_lookahead_event (BroadwayServer *server,
|
|
|
|
const char *types);
|
|
|
|
void broadway_server_query_mouse (BroadwayServer *server,
|
|
|
|
guint32 *surface,
|
|
|
|
gint32 *root_x,
|
|
|
|
gint32 *root_y,
|
|
|
|
guint32 *mask);
|
|
|
|
guint32 broadway_server_grab_pointer (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int client_id,
|
|
|
|
int id,
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean owner_events,
|
|
|
|
guint32 event_mask,
|
|
|
|
guint32 time_);
|
|
|
|
guint32 broadway_server_ungrab_pointer (BroadwayServer *server,
|
|
|
|
guint32 time_);
|
|
|
|
gint32 broadway_server_get_mouse_surface (BroadwayServer *server);
|
|
|
|
void broadway_server_set_show_keyboard (BroadwayServer *server,
|
|
|
|
gboolean show);
|
|
|
|
guint32 broadway_server_new_surface (BroadwayServer *server,
|
2019-03-29 10:07:04 +00:00
|
|
|
guint32 client,
|
2017-12-05 13:38:57 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
2020-03-13 13:33:07 +00:00
|
|
|
int height);
|
2017-12-05 13:38:57 +00:00
|
|
|
void broadway_server_destroy_surface (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id);
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean broadway_server_surface_show (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id);
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean broadway_server_surface_hide (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id);
|
2017-12-05 13:38:57 +00:00
|
|
|
void broadway_server_surface_raise (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id);
|
2017-12-05 13:38:57 +00:00
|
|
|
void broadway_server_surface_lower (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id);
|
2017-12-05 13:38:57 +00:00
|
|
|
void broadway_server_surface_set_transient_for (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id,
|
|
|
|
int parent);
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean broadway_server_surface_translate (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id,
|
2017-12-05 13:38:57 +00:00
|
|
|
cairo_region_t *area,
|
2020-07-24 13:54:49 +00:00
|
|
|
int dx,
|
|
|
|
int dy);
|
2017-12-05 13:38:57 +00:00
|
|
|
guint32 broadway_server_upload_texture (BroadwayServer *server,
|
|
|
|
GBytes *texture);
|
|
|
|
void broadway_server_release_texture (BroadwayServer *server,
|
|
|
|
guint32 id);
|
|
|
|
cairo_surface_t * broadway_server_create_surface (int width,
|
|
|
|
int height);
|
2019-03-25 13:15:49 +00:00
|
|
|
void broadway_server_surface_update_nodes (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id,
|
2019-03-25 13:15:49 +00:00
|
|
|
guint32 data[],
|
|
|
|
int len,
|
|
|
|
GHashTable *client_texture_map);
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean broadway_server_surface_move_resize (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int id,
|
2017-12-05 13:38:57 +00:00
|
|
|
gboolean with_move,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
void broadway_server_focus_surface (BroadwayServer *server,
|
2020-07-24 13:54:49 +00:00
|
|
|
int new_focused_surface);
|
2017-11-29 19:05:36 +00:00
|
|
|
|
2012-12-23 22:35:03 +00:00
|
|
|
|
|
|
|
#endif /* __BROADWAY_SERVER__ */
|