mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-08 04:44:27 +00:00
vt: add bell effect callback and move types into Effects
Add GHOSTTY_TERMINAL_OPT_BELL so C consumers can receive bell notifications during VT processing. The bell trampoline follows the same pattern as write_pty. Move the C function pointer typedefs (WritePtyFn, BellFn) into the Effects struct namespace to keep callback types co-located with their storage and trampolines.
This commit is contained in:
@@ -154,6 +154,19 @@ typedef void (*GhosttyTerminalWritePtyFn)(GhosttyTerminal terminal,
|
||||
const uint8_t* data,
|
||||
size_t len);
|
||||
|
||||
/**
|
||||
* Callback function type for bell.
|
||||
*
|
||||
* Called when the terminal receives a BEL character (0x07).
|
||||
*
|
||||
* @param terminal The terminal handle
|
||||
* @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
|
||||
*
|
||||
* @ingroup terminal
|
||||
*/
|
||||
typedef void (*GhosttyTerminalBellFn)(GhosttyTerminal terminal,
|
||||
void* userdata);
|
||||
|
||||
/**
|
||||
* Terminal option identifiers.
|
||||
*
|
||||
@@ -178,6 +191,14 @@ typedef enum {
|
||||
* Input type: GhosttyTerminalWritePtyFn*
|
||||
*/
|
||||
GHOSTTY_TERMINAL_OPT_WRITE_PTY = 1,
|
||||
|
||||
/**
|
||||
* Callback invoked when the terminal receives a BEL character
|
||||
* (0x07). Set to NULL to ignore bell events.
|
||||
*
|
||||
* Input type: GhosttyTerminalBellFn*
|
||||
*/
|
||||
GHOSTTY_TERMINAL_OPT_BELL = 2,
|
||||
} GhosttyTerminalOption;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user