Allow to query client-side cursor support

Add a function nvnc_client_supports_cursor() to enable the API user to
make an informed decision whether nvnc_set_cursor() can be expected to
make the client draw the cursor, or whether it has to be rendered into
the framebuffer.
pull/69/head
Philipp Zabel 2022-07-28 12:34:24 +02:00 committed by Andri Yngvason
parent d18cc4fc57
commit affd7f3f6d
2 changed files with 11 additions and 0 deletions

View File

@ -128,6 +128,7 @@ void nvnc_set_userdata(void* self, void* userdata, nvnc_cleanup_fn);
void* nvnc_get_userdata(const void* self);
struct nvnc* nvnc_client_get_server(const struct nvnc_client* client);
bool nvnc_client_supports_cursor(const struct nvnc_client* client);
void nvnc_set_name(struct nvnc* self, const char* name);

View File

@ -1569,6 +1569,16 @@ struct nvnc* nvnc_client_get_server(const struct nvnc_client* client)
return client->server;
}
EXPORT
bool nvnc_client_supports_cursor(const struct nvnc_client* client)
{
for (size_t i = 0; i < client->n_encodings; ++i) {
if (client->encodings[i] == RFB_ENCODING_CURSOR)
return true;
}
return false;
}
EXPORT
void nvnc_set_name(struct nvnc* self, const char* name)
{