C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
ui_ncurses_compat.h File Reference

Non-portable escape hatch for the NCurses backend. More...

#include "ui_backend.h"
#include <ncursesw/ncurses.h>
#include <ncursesw/panel.h>
Include dependency graph for ui_ncurses_compat.h:

Go to the source code of this file.

Functions

PANEL * ui_ncurses_surface_get_panel (const UiSurface *s, ss_t w)
 Return the raw NCurses PANEL* underlying a surface.
WINDOW * ui_ncurses_surface_get_win (const UiSurface *s, ss_t w)
 Return the raw NCurses WINDOW* underlying a surface.

Detailed Description

Non-portable escape hatch for the NCurses backend.

Warning
Including this header couples application code to the NCurses backend. Use only when NCurses-specific functionality is required and portability to other backends (e.g., NotCurses) is not needed. These functions are intentionally not declared in ui_backend.h.

Definition in file ui_ncurses_compat.h.

Function Documentation

◆ ui_ncurses_surface_get_panel()

PANEL * ui_ncurses_surface_get_panel ( const UiSurface * s,
ss_t w )

Return the raw NCurses PANEL* underlying a surface.

Parameters
sThe UiSurface to inspect.
wUiSurface window
Returns
The PANEL pointer, or NULL if s is NULL.

Return the raw NCurses PANEL* underlying a surface.

Parameters
sPointer to the UiSurface containing the window.
wThe index of the window within the surface for which to retrieve the PANEL pointer.
Returns
The PANEL pointer for the specified window, or NULL if the UiSurface is NULL.

Definition at line 1215 of file ui_ncurses.c.

1215 {
1216 if (!s)
1217 return NULL;
1218 return s->mpan[w];
1219}

◆ ui_ncurses_surface_get_win()

WINDOW * ui_ncurses_surface_get_win ( const UiSurface * s,
ss_t w )

Return the raw NCurses WINDOW* underlying a surface.

Parameters
sThe UiSurface to inspect.
Returns
The WINDOW pointer, or NULL if s is NULL.

Return the raw NCurses WINDOW* underlying a surface.

Returns
The FILE pointer for the TTY if the UI is initialized, or NULL if the UI is not initialized.

Definition at line 1204 of file ui_ncurses.c.

1204 {
1205 if (!s)
1206 return NULL;
1207 return s->mwin[w];
1208}