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

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

#include "../include/ui_backend.h"
#include <notcurses/notcurses.h>
Include dependency graph for ui_notcurses_compat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct notcurses * ui_notcurses_get_nc ()
 Return the raw struct notcurses* for the NotCurses session.
struct ncplane * ui_notcurses_surface_get_plane (const UiSurface *s, ss_t w)
 Return the raw struct ncplane* underlying a surface.

Detailed Description

Non-portable escape hatch for the NotCurses backend.

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

Definition in file ui_notcurses_compat.h.

Function Documentation

◆ ui_notcurses_get_nc()

struct notcurses * ui_notcurses_get_nc ( )

Return the raw struct notcurses* for the NotCurses session.

Parameters
uiThe UiRuntime returned by ui_init().
Returns
The NotCurses context pointer, or NULL if ui is NULL.

Return the raw struct notcurses* for the NotCurses session.

Returns
A pointer to the Notcurses context, or NULL if the UI is not initialized.

This function retrieves the pointer to the Notcurses context associated with the UI. If the UI is not initialized, it returns NULL.

Definition at line 1523 of file ui_notcurses.c.

1523 {
1524 if (!ui)
1525 return NULL;
1526 return ui->nc;
1527}
UiRuntime * ui
Definition ui_ncurses.c:39

References ui.

◆ ui_notcurses_surface_get_plane()

struct ncplane * ui_notcurses_surface_get_plane ( const UiSurface * s,
ss_t w )

Return the raw struct ncplane* underlying a surface.

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

Return the raw struct ncplane* underlying a surface.

Parameters
sPointer to the UiSurface containing the window.
wThe index of the window within the surface.
Returns
A pointer to the NcPlane associated with the specified window, or NULL if the surface is not initialized.

This function retrieves the pointer to the NcPlane associated with a specific window in a UI surface. If the surface is not initialized, it returns NULL.

Definition at line 1536 of file ui_notcurses.c.

1536 {
1537 (void)w;
1538 if (!s)
1539 return NULL;
1540 return s->mplane[w];
1541}
struct ncplane * mplane[SUB_SFC_MAX]
Definition ui_backend.h:351