From 23c86b12fa7151e0942d1c0d12e926816e25cd72 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 14:46:01 +0200 Subject: Adding upstream version 4.8.0. Signed-off-by: Daniel Baumann --- HACKING | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 HACKING (limited to 'HACKING') diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..b78d40f --- /dev/null +++ b/HACKING @@ -0,0 +1,39 @@ +WIP notes on hacking the Screen source. + +* Screen commands are handled by the DoAction function in process.c. + The local variable nr is set to an integer value representing the + command to be evaluated; for every command `foo', there is an + integer value RC_FOO for use as nr's value to represent it. Find + the matching case label to follow procesing of the command. + + The RC_FOO values are defined in comm.h, which is automatically + generated by comm.sh, based on the names of the commands + themselves (found in comm.c). + +* The current display is held in the global variable "display". + Variable names like D_foo are shorthands for display->d_foo (where d_foo + is a member of "struct display"). + +* Names like D_IS, D_TI, D_SG usually refer to the values of various + termcap features of the current display. These are found in term.h, + which is automatically generated from term.c by term.sh. + +* The main input-reading function for handling user input from a display, + is disp_readev_fn in display.c. This also handles automatic transformation + of mouse-tracking codes from display coordinates to screen-window + coordinates, and decodes characters from the display's encoding, passing + it on to the foreground input processor. + + Input is passed through ProcessInput in process.c to handle + keybindings (specified by bindkey and such), and then processed by + layer-specific input-processing functions, which you'll find in + instances of struct LayFuncs. For instance, keystrokes are processed + by: + + normal windows: WinPrGocess + window in copy-mode: MarkProcess + window list: WListProcess + command input line: InpProcess + +* Handling string escapes (in hardstatus and the like), such as %w or + %{= bw}, is done in screen.c, MakeWinMsgEv(). -- cgit v1.2.3