libei  1.2.0
A library for Emulated Input
liboeffis.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2022 Red Hat, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #pragma once
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <stdbool.h>
32 #include <stdint.h>
33 #include <stddef.h>
34 
66 struct oeffis;
67 
72 struct oeffis *
73 oeffis_new(void *user_data);
74 
81 struct oeffis *
82 oeffis_ref(struct oeffis *oeffis);
83 
96 struct oeffis *
97 oeffis_unref(struct oeffis *oeffis);
98 
104 void
105 oeffis_set_user_data(struct oeffis *oeffis, void *user_data);
106 
111 void *
113 
120 int
121 oeffis_get_fd(struct oeffis *oeffis);
122 
138 int
140 
150 };
151 
187 void
188 oeffis_create_session(struct oeffis *oeffis, uint32_t devices);
189 
194 void
195 oeffis_create_session_on_bus(struct oeffis *oeffis, const char *busname, uint32_t devices);
196 
202 };
203 
212 void
213 oeffis_dispatch(struct oeffis *oeffis);
214 
225 
230 const char *
232 
237 #ifdef __cplusplus
238 }
239 #endif
oeffis_event_type
Definition: liboeffis.h:197
The main context to interact with liboeffis.
void oeffis_create_session_on_bus(struct oeffis *oeffis, const char *busname, uint32_t devices)
See oeffis_create_session() but this function allows to specify the busname to connect to...
int oeffis_get_eis_fd(struct oeffis *oeffis)
Get a dup() of the file descriptor.
Definition: liboeffis.h:149
struct oeffis * oeffis_new(void *user_data)
Create a new oeffis context.
void * oeffis_get_user_data(struct oeffis *oeffis)
Return the custom data pointer for this context.
The session was closed by the compositor or portal.
Definition: liboeffis.h:200
The RemoteDesktop session was created and an eis fd is available.
Definition: liboeffis.h:199
Definition: liboeffis.h:146
void oeffis_dispatch(struct oeffis *oeffis)
Process pending events.
Definition: liboeffis.h:147
enum oeffis_event_type oeffis_get_event(struct oeffis *oeffis)
Return the next available event, if any.
void oeffis_create_session(struct oeffis *oeffis, uint32_t devices)
Connect this oeffis instance to a RemoteDesktop session with the given device mask selected...
struct oeffis * oeffis_ref(struct oeffis *oeffis)
Increase the refcount of this struct by one.
int oeffis_get_fd(struct oeffis *oeffis)
liboeffis keeps a single file descriptor for all events.
oeffis_device
The bitmask of devices to request.
Definition: liboeffis.h:145
const char * oeffis_get_error_message(struct oeffis *oeffis)
If the session was OEFFIS_EVENT_DISCONNECTED, return the error message that caused the disconnection...
We were disconnected from the Bus due to an error.
Definition: liboeffis.h:201
No event currently available.
Definition: liboeffis.h:198
void oeffis_set_user_data(struct oeffis *oeffis, void *user_data)
Set a custom data pointer for this context.
struct oeffis * oeffis_unref(struct oeffis *oeffis)
Decrease the refcount of this struct by one.
Definition: liboeffis.h:148