2020-07-31 00:22:18 +02:00
|
|
|
#ifndef _SEATD_CLIENT_H
|
|
|
|
#define _SEATD_CLIENT_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "connection.h"
|
2020-08-03 02:12:47 +02:00
|
|
|
#include "linked_list.h"
|
2020-07-31 00:22:18 +02:00
|
|
|
#include "list.h"
|
|
|
|
|
|
|
|
struct server;
|
|
|
|
|
|
|
|
struct client {
|
|
|
|
struct server *server;
|
|
|
|
struct event_source_fd *event_source;
|
|
|
|
struct connection connection;
|
|
|
|
|
|
|
|
pid_t pid;
|
|
|
|
uid_t uid;
|
|
|
|
gid_t gid;
|
|
|
|
|
|
|
|
struct seat *seat;
|
|
|
|
int seat_vt;
|
2020-08-02 21:40:32 +02:00
|
|
|
bool pending_disable;
|
2020-07-31 00:22:18 +02:00
|
|
|
|
2020-08-03 02:12:47 +02:00
|
|
|
struct linked_list devices;
|
2020-07-31 00:22:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct client *client_create(struct server *server, int client_fd);
|
|
|
|
void client_kill(struct client *client);
|
|
|
|
void client_destroy(struct client *client);
|
|
|
|
|
|
|
|
int client_handle_connection(int fd, uint32_t mask, void *data);
|
2020-08-03 00:56:10 +02:00
|
|
|
int client_get_session(const struct client *client);
|
|
|
|
int client_send_enable_seat(struct client *client);
|
|
|
|
int client_send_disable_seat(struct client *client);
|
2020-07-31 00:22:18 +02:00
|
|
|
|
|
|
|
#endif
|