PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches

Desktop Window Manager Events. More...

Collaboration diagram for Events:

Detailed Description

Desktop Window Manager Events.

Data Structures

struct  event_screen_info_t
 Screen Info event. More...
 
struct  event_surface_new_t
 Surface New event. More...
 
struct  event_kbd_t
 Keyboard event. More...
 
struct  event_mouse_t
 Mouse event. More...
 
struct  event_report_t
 Report event. More...
 
struct  event_global_attach_t
 Global Attach event. More...
 
struct  event_global_detach_t
 Global Detach event. More...
 
struct  event_lib_redraw_t
 Library Redraw event. More...
 
struct  event_lib_action_t
 Library Action event. More...
 
struct  event_lib_force_action_t
 Library Force Action event. More...
 
struct  event_t
 Event structure. More...
 

Macros

#define EVENT_SCREEN_INFO   0
 
#define EVENT_SURFACE_NEW   1
 
#define EVENT_KBD   2
 
#define EVENT_MOUSE   3
 
#define EVENT_TIMER   4
 
#define EVENT_CURSOR_ENTER   5
 
#define EVENT_CURSOR_LEAVE   6
 
#define EVENT_REPORT   7
 
#define EVENT_GLOBAL_ATTACH   128
 
#define EVENT_GLOBAL_DETACH   129
 
#define EVENT_GLOBAL_REPORT   130
 
#define EVENT_GLOBAL_KBD   131
 
#define EVENT_GLOBAL_MOUSE   132
 
#define DWM_MAX_EVENT   256
 
#define EVENT_LIB_INIT   256
 
#define EVENT_LIB_DEINIT   257
 
#define EVENT_LIB_REDRAW   258
 
#define EVENT_LIB_ACTION   259
 
#define EVENT_LIB_QUIT   260
 
#define EVENT_LIB_FORCE_ACTION   261
 
#define EVENT_LIB_INTERNAL_WAKE   512
 
#define EVENT_USER_START   1024
 
#define EVENT_USER_END   65535
 
#define EVENT_MAX_DATA   128
 Maximum size of event data.
 

Typedefs

typedef uint16_t event_type_t
 Event type.
 
typedef uint64_t event_bitmask_t[4]
 Event bitmask type.
 
typedef event_mouse_t event_cursor_enter_t
 Cursor Enter event.
 
typedef event_mouse_t event_cursor_leave_t
 Cursor Leave event.
 
typedef event_report_t event_global_report_t
 Global Report event.
 
typedef event_kbd_t event_global_kbd_t
 Global Keyboard event.
 
typedef event_mouse_t event_global_mouse_t
 Global Mouse event.
 

Enumerations

enum  report_flags_t {
  REPORT_NONE = 0 , REPORT_RECT = 1 << 0 , REPORT_IS_VISIBLE = 1 << 1 , REPORT_IS_FOCUSED = 1 << 2 ,
  REPORT_NAME = 1 << 3
}
 Report flags. More...
 
enum  action_type_t { ACTION_NONE = 0 , ACTION_RELEASE , ACTION_PRESS , ACTION_CANCEL }
 Action type. More...
 
enum  kbd_event_type_t { KBD_PRESS = 0 , KBD_RELEASE = 1 }
 Keyboard event type. More...
 
enum  kbd_mods_t {
  KBD_MOD_NONE = 0 , KBD_MOD_CAPS = 1 << 0 , KBD_MOD_SHIFT = 1 << 1 , KBD_MOD_CTRL = 1 << 2 ,
  KBD_MOD_ALT = 1 << 3 , KBD_MOD_SUPER = 1 << 4
}
 Keyboard modifiers type. More...
 
enum  mouse_buttons_t { MOUSE_NONE = 0 , MOUSE_LEFT = (1 << 1) , MOUSE_RIGHT = (1 << 2) , MOUSE_MIDDLE = (1 << 3) }
 Mouse buttons enum. More...
 

Macro Definition Documentation

◆ EVENT_SCREEN_INFO

#define EVENT_SCREEN_INFO   0

Definition at line 81 of file event.h.

◆ EVENT_SURFACE_NEW

#define EVENT_SURFACE_NEW   1

Definition at line 82 of file event.h.

◆ EVENT_KBD

#define EVENT_KBD   2

Definition at line 83 of file event.h.

◆ EVENT_MOUSE

#define EVENT_MOUSE   3

Definition at line 84 of file event.h.

◆ EVENT_TIMER

#define EVENT_TIMER   4

Definition at line 85 of file event.h.

◆ EVENT_CURSOR_ENTER

#define EVENT_CURSOR_ENTER   5

Definition at line 86 of file event.h.

◆ EVENT_CURSOR_LEAVE

#define EVENT_CURSOR_LEAVE   6

Definition at line 87 of file event.h.

◆ EVENT_REPORT

#define EVENT_REPORT   7

Definition at line 88 of file event.h.

◆ EVENT_GLOBAL_ATTACH

#define EVENT_GLOBAL_ATTACH   128

Definition at line 90 of file event.h.

◆ EVENT_GLOBAL_DETACH

#define EVENT_GLOBAL_DETACH   129

Definition at line 91 of file event.h.

◆ EVENT_GLOBAL_REPORT

#define EVENT_GLOBAL_REPORT   130

Definition at line 92 of file event.h.

◆ EVENT_GLOBAL_KBD

#define EVENT_GLOBAL_KBD   131

Definition at line 93 of file event.h.

◆ EVENT_GLOBAL_MOUSE

#define EVENT_GLOBAL_MOUSE   132

Definition at line 94 of file event.h.

◆ DWM_MAX_EVENT

#define DWM_MAX_EVENT   256

Definition at line 96 of file event.h.

◆ EVENT_LIB_INIT

#define EVENT_LIB_INIT   256

Definition at line 98 of file event.h.

◆ EVENT_LIB_DEINIT

#define EVENT_LIB_DEINIT   257

Definition at line 99 of file event.h.

◆ EVENT_LIB_REDRAW

#define EVENT_LIB_REDRAW   258

Definition at line 100 of file event.h.

◆ EVENT_LIB_ACTION

#define EVENT_LIB_ACTION   259

Definition at line 101 of file event.h.

◆ EVENT_LIB_QUIT

#define EVENT_LIB_QUIT   260

Definition at line 102 of file event.h.

◆ EVENT_LIB_FORCE_ACTION

#define EVENT_LIB_FORCE_ACTION   261

Definition at line 103 of file event.h.

◆ EVENT_LIB_INTERNAL_WAKE

#define EVENT_LIB_INTERNAL_WAKE   512

Definition at line 105 of file event.h.

◆ EVENT_USER_START

#define EVENT_USER_START   1024

Definition at line 107 of file event.h.

◆ EVENT_USER_END

#define EVENT_USER_END   65535

Definition at line 108 of file event.h.

◆ EVENT_MAX_DATA

#define EVENT_MAX_DATA   128

Maximum size of event data.

Definition at line 298 of file event.h.

Typedef Documentation

◆ event_type_t

Event type.

Used to identify the type of an event.

Events are divided into 4 categories:

  • Standard events (0-127): Sent by the DWM to ONLY the display or surface that the event is targeted at, sent by default.
  • Global events (128-255): Sent by the DWM to all displays, not sent by default.
  • Library events (256-511): Sent by the libpatchwork library to elements using the library, cant be subscribed to or unsubscribed from.
  • Internal Library events (512-1023): Used internally by libpatchwork, should not be used by programs.
  • User events (1024-65535): Defined by individual programs, cant be subscribed to or unsubscribed from.

    Todo:
    Global events are a security mess, when per-process namespaces stabilize we should consider if this could be done better.

Definition at line 71 of file event.h.

◆ event_bitmask_t

typedef uint64_t event_bitmask_t[4]

Event bitmask type.

Used to decide what events will be received by a display, only applicable to events sent by the DWM. By default events 0-127 inclusive are received (the first uint64_t is by default UINT64_MAX)

Definition at line 79 of file event.h.

◆ event_cursor_enter_t

Cursor Enter event.

Sent when the cursor enters a surface.

Definition at line 200 of file event.h.

◆ event_cursor_leave_t

Cursor Leave event.

Sent when the cursor leaves a surface.

Definition at line 207 of file event.h.

◆ event_global_report_t

Global Report event.

Sent when any surface's information changes.

Definition at line 245 of file event.h.

◆ event_global_kbd_t

Global Keyboard event.

Sent when a key is pressed or released regardless of which display is focused.

Definition at line 252 of file event.h.

◆ event_global_mouse_t

Global Mouse event.

Sent when the mouse is moved or a button is pressed or released regardless of which display is focused or where the cursor is.

Definition at line 260 of file event.h.

Enumeration Type Documentation

◆ report_flags_t

Report flags.

Used to specify what information changed in a report event.

Enumerator
REPORT_NONE 
REPORT_RECT 
REPORT_IS_VISIBLE 
REPORT_IS_FOCUSED 
REPORT_NAME 

Definition at line 32 of file event.h.

◆ action_type_t

Action type.

Used to specify the type of an action event.

Enumerator
ACTION_NONE 
ACTION_RELEASE 
ACTION_PRESS 
ACTION_CANCEL 

Definition at line 46 of file event.h.

◆ kbd_event_type_t

Keyboard event type.

Enumerator
KBD_PRESS 

Key press event.

KBD_RELEASE 

Key release event.

Definition at line 135 of file event.h.

◆ kbd_mods_t

enum kbd_mods_t

Keyboard modifiers type.

Enumerator
KBD_MOD_NONE 

No modifier.

KBD_MOD_CAPS 

Caps Lock modifier.

KBD_MOD_SHIFT 

Shift modifier.

KBD_MOD_CTRL 

Control modifier.

KBD_MOD_ALT 

Alt modifier.

KBD_MOD_SUPER 

Super (Windows/Command) modifier.

Definition at line 145 of file event.h.

◆ mouse_buttons_t

Mouse buttons enum.

Enumerator
MOUSE_NONE 

None.

MOUSE_LEFT 

Left mouse button.

MOUSE_RIGHT 

Right mouse button.

MOUSE_MIDDLE 

Middle mouse button.

Definition at line 172 of file event.h.