PatchworkOS
Loading...
Searching...
No Matches
dwm.c File Reference
#include "dwm.h"
#include "client.h"
#include "compositor.h"
#include "kbd.h"
#include "screen.h"
#include "surface.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fb.h>
#include <sys/io.h>
#include <sys/list.h>
#include <sys/math.h>
#include <sys/proc.h>
#include <threads.h>

Go to the source code of this file.

Functions

static client_tdwm_client_accept (void)
 
static void dwm_client_disconnect (client_t *client)
 
static void dwm_send_event_to_all (surface_id_t target, event_type_t type, void *data, uint64_t size)
 
void dwm_init (void)
 
void dwm_deinit (void)
 
void dwm_report_produce (surface_t *surface, client_t *client, report_flags_t flags)
 
surface_tdwm_surface_find (surface_id_t id)
 
uint64_t dwm_attach (surface_t *surface)
 
void dwm_detach (surface_t *surface)
 
void dwm_focus_set (surface_t *surface)
 
static surface_tdwm_surface_under_point (const point_t *point)
 
static surface_tdwm_next_timer (void)
 
static void dwm_kbd_read (void)
 
static void dwm_handle_mouse_event (const mouse_event_t *mouseEvent)
 
static void dwm_mouse_read (void)
 
static void dwm_poll_ctx_update (void)
 
static void dwm_poll (void)
 
static void dwm_update (void)
 
void dwm_loop (void)
 

Variables

static char id [MAX_NAME]
 
static fd_t data
 
static fd_t kbd
 
static fd_t mouse
 
static list_t clients
 
static uint64_t clientAmount
 
static list_t windows
 
static list_t panels
 
static surface_twall
 
static surface_tcursor
 
static surface_tfullscreen
 
static surface_tprevCursorTarget
 
static surface_tfocus
 
static poll_ctx_tpollCtx
 

Function Documentation

◆ dwm_client_accept()

static client_t * dwm_client_accept ( void  )
static

Definition at line 40 of file dwm.c.

References client_new(), clientAmount, clients, close(), client_t::entry, ERR, errno, client_t::fd, list_push(), NULL, openf(), printf(), and strerror().

Referenced by dwm_update().

◆ dwm_client_disconnect()

static void dwm_client_disconnect ( client_t client)
static

Definition at line 63 of file dwm.c.

References client_free(), clientAmount, clients, client_t::entry, list_remove(), and printf().

Referenced by dwm_send_event_to_all(), and dwm_update().

◆ dwm_handle_mouse_event()

◆ dwm_kbd_read()

◆ dwm_mouse_read()

static void dwm_mouse_read ( void  )
static

◆ dwm_next_timer()

static surface_t * dwm_next_timer ( void  )
static

Definition at line 409 of file dwm.c.

References CLOCKS_NEVER, cursor, timer_t::deadline, fullscreen, LIST_FOR_EACH, NULL, panels, surface_t::timer, wall, and windows.

Referenced by dwm_poll().

◆ dwm_poll()

◆ dwm_poll_ctx_update()

static void dwm_poll_ctx_update ( void  )
static

◆ dwm_send_event_to_all()

static void dwm_send_event_to_all ( surface_id_t  target,
event_type_t  type,
void *  data,
uint64_t  size 
)
static

◆ dwm_surface_under_point()

static surface_t * dwm_surface_under_point ( const point_t point)
static

◆ dwm_update()

Variable Documentation

◆ clientAmount

uint64_t clientAmount
static

◆ clients

◆ cursor

surface_t* cursor
static

◆ data

◆ focus

surface_t* focus
static

◆ fullscreen

◆ id

◆ kbd

fd_t kbd
static

Definition at line 23 of file dwm.c.

Referenced by dwm_deinit(), dwm_init(), dwm_kbd_read(), and dwm_poll_ctx_update().

◆ mouse

fd_t mouse
static

Definition at line 24 of file dwm.c.

Referenced by dwm_deinit(), dwm_init(), dwm_mouse_read(), and dwm_poll_ctx_update().

◆ panels

◆ pollCtx

poll_ctx_t* pollCtx
static

Definition at line 38 of file dwm.c.

Referenced by dwm_deinit(), dwm_init(), dwm_poll(), dwm_poll_ctx_update(), and dwm_update().

◆ prevCursorTarget

surface_t* prevCursorTarget
static

Definition at line 34 of file dwm.c.

Referenced by dwm_detach(), dwm_handle_mouse_event(), and dwm_init().

◆ wall

◆ windows