PatchworkOS
Loading...
Searching...
No Matches
client.c File Reference
#include "client.h"
#include "compositor.h"
#include "dwm.h"
#include "screen.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define __STDC_WANT_LIB_EXT1__   1
 

Functions

static surface_tclient_surface_find (client_t *client, surface_id_t id)
 
client_tclient_new (fd_t fd)
 
void client_free (client_t *client)
 
static uint64_t client_action_screen_info (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_new (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_free (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_move (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_timer_set (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_invalidate (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_focus_set (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_visible_set (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_surface_report (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_subscribe (client_t *client, const cmd_header_t *header)
 
static uint64_t client_action_unsubscribe (client_t *client, const cmd_header_t *header)
 
static uint64_t client_process_cmds (client_t *client, cmd_buffer_t *cmds)
 
uint64_t client_receive_cmds (client_t *client)
 
static uint64_t client_send_all (fd_t fd, const void *data, size_t size)
 
uint64_t client_send_event (client_t *client, surface_id_t target, event_type_t type, void *data, uint64_t size)
 

Variables

static uint64_t(* actions [])(client_t *, const cmd_header_t *)
 

Macro Definition Documentation

◆ __STDC_WANT_LIB_EXT1__

#define __STDC_WANT_LIB_EXT1__   1

Definition at line 1 of file client.c.

Function Documentation

◆ client_action_screen_info()

static uint64_t client_action_screen_info ( client_t client,
const cmd_header_t header 
)
static

◆ client_action_subscribe()

static uint64_t client_action_subscribe ( client_t client,
const cmd_header_t header 
)
static

◆ client_action_surface_focus_set()

◆ client_action_surface_free()

◆ client_action_surface_invalidate()

◆ client_action_surface_move()

◆ client_action_surface_new()

◆ client_action_surface_report()

static uint64_t client_action_surface_report ( client_t client,
const cmd_header_t header 
)
static

◆ client_action_surface_timer_set()

◆ client_action_surface_visible_set()

◆ client_action_unsubscribe()

static uint64_t client_action_unsubscribe ( client_t client,
const cmd_header_t header 
)
static

◆ client_free()

◆ client_new()

◆ client_process_cmds()

◆ client_receive_cmds()

◆ client_send_all()

static uint64_t client_send_all ( fd_t  fd,
const void *  data,
size_t  size 
)
static

Definition at line 486 of file client.c.

References data, EINTR, EPIPE, ERR, errno, perror(), and write().

Referenced by client_send_event().

◆ client_send_event()

◆ client_surface_find()

Variable Documentation

◆ actions

uint64_t(* actions[])(client_t *, const cmd_header_t *) ( client_t ,
const cmd_header_t  
)
static
Initial value:
= {
}
static uint64_t client_action_surface_timer_set(client_t *client, const cmd_header_t *header)
Definition client.c:212
static uint64_t client_action_surface_report(client_t *client, const cmd_header_t *header)
Definition client.c:314
static uint64_t client_action_surface_new(client_t *client, const cmd_header_t *header)
Definition client.c:96
static uint64_t client_action_surface_free(client_t *client, const cmd_header_t *header)
Definition client.c:151
static uint64_t client_action_surface_invalidate(client_t *client, const cmd_header_t *header)
Definition client.c:234
static uint64_t client_action_subscribe(client_t *client, const cmd_header_t *header)
Definition client.c:332
static uint64_t client_action_surface_move(client_t *client, const cmd_header_t *header)
Definition client.c:176
static uint64_t client_action_screen_info(client_t *client, const cmd_header_t *header)
Definition client.c:70
static uint64_t client_action_surface_focus_set(client_t *client, const cmd_header_t *header)
Definition client.c:266
static uint64_t client_action_unsubscribe(client_t *client, const cmd_header_t *header)
Definition client.c:351
static uint64_t client_action_surface_visible_set(client_t *client, const cmd_header_t *header)
Definition client.c:288
@ CMD_SUBSCRIBE
Definition cmd.h:33
@ CMD_UNSUBSCRIBE
Definition cmd.h:34
@ CMD_SURFACE_TIMER_SET
Definition cmd.h:28
@ CMD_SURFACE_MOVE
Definition cmd.h:27
@ CMD_SURFACE_NEW
Definition cmd.h:25
@ CMD_SURFACE_REPORT
Definition cmd.h:32
@ CMD_SURFACE_VISIBLE_SET
Definition cmd.h:31
@ CMD_SURFACE_FREE
Definition cmd.h:26
@ CMD_SURFACE_FOCUS_SET
Definition cmd.h:30
@ CMD_SURFACE_INVALIDATE
Definition cmd.h:29
@ CMD_SCREEN_INFO
Definition cmd.h:24

Definition at line 370 of file client.c.

Referenced by client_process_cmds().