C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
init_view.c File Reference

Initialize C-Menu View Screen IO and Input. More...

#include <common.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <unistd.h>
#include <wait.h>
Include dependency graph for init_view.c:

Go to the source code of this file.

Functions

int init_view_boxwin (Init *init)
 Initialize the C-Menu View in box window mode.
int init_view_full_screen (Init *init)
 Initialize C-Menu View in full screen mode.
void view_boxwin_resize (Init *init)
 Resize the current window and its box.
void view_calc_boxwin_dimensions (Init *init)
 Calculate the dimensions and position of the box window for C-Menu View.
void view_calc_full_screen_dimensions (Init *init)
 Calculate the dimensions for full screen mode.
void view_full_screen_resize (Init *init)
 Resize the full screen view and its components.
int view_init_input (Init *init, char *file_name)
 Initialize the input for the C-Menu View.

Variables

ViewStack view_stack

Detailed Description

Initialize C-Menu View Screen IO and Input.

Author
Bill Waller Copyright (c) 2025 MIT License billx.nosp@m.wall.nosp@m.er@gm.nosp@m.ail..nosp@m.com
Date
2026-02-09

Definition in file init_view.c.

Function Documentation

◆ view_boxwin_resize()

void view_boxwin_resize ( Init * init)

Resize the current window and its box.

Parameters
initPointer to the Init structure containing view settings.

This function resizes the current window and its associated box window to the specified number of lines and columns.

Definition at line 198 of file init_view.c.

198 {
199 View *view = init->view;
201 ui_render();
202 init_view_boxwin(init);
203 ui_border_title(init->view->sfc, init->view->title);
204 // initialize_line_table(init->view);
205}
void ui_render()
Render the UI by updating panels and refreshing the display.
Definition ui_ncurses.c:884
void ui_surface_destroy(UiSurface *s)
Destroy a UiSurface, cleaning up its windows and panels.
Definition ui_ncurses.c:468
int ui_border_title(UiSurface *sfc, const char *title)
Draw a box with a title around the specified window.
Definition ui_common.c:563
View * view
Definition mem.c:38
int init_view_boxwin(Init *init)
Initialize the C-Menu View in box window mode.
Definition init_view.c:162
View * view
Definition common.h:193
Definition view.h:59
char title[MAXLEN]
Definition view.h:79
UiSurface * sfc
Definition view.h:89

References init_view_boxwin(), View::sfc, View::title, ui_border_title(), ui_render(), ui_surface_destroy(), and Init::view.

Referenced by view_cmd_processor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ view_full_screen_resize()

void view_full_screen_resize ( Init * init)

Resize the full screen view and its components.

Parameters
initPointer to the Init structure containing view settings.

This function resizes the full screen view and its components, including the command line window, line number window, and main content pad. It also recalculates the dimensions for the full screen mode and updates the scroll regions accordingly.

Definition at line 111 of file init_view.c.

111 {
112 ui_erase();
114 ui_log(INFO, _("view_full_screen_resize: lines=%d, cols=%d, ln_win_lines=%d, ln_win_cols=%d, scroll_lines=%d"), init->view->lines, init->view->cols, init->view->ln_win_lines, init->view->ln_win_cols, init->view->scroll_lines);
115 View *view = init->view;
117 ui_render();
119}
int ui_erase()
Erase the entire screen.
Definition ui_ncurses.c:591
#define _(String)
Definition amort.c:23
int init_view_full_screen(Init *init)
Initialize C-Menu View in full screen mode.
Definition init_view.c:47
void view_calc_full_screen_dimensions(Init *)
Calculate the dimensions for full screen mode.
Definition init_view.c:128
uint lines
Definition view.h:70
uint ln_win_cols
Definition view.h:180
uint scroll_lines
Definition view.h:123
uint cols
Definition view.h:71
uint ln_win_lines
Definition view.h:179

References View::cols, init_view_full_screen(), View::lines, View::ln_win_cols, View::ln_win_lines, View::scroll_lines, View::sfc, ui_erase(), ui_render(), ui_surface_destroy(), Init::view, and view_calc_full_screen_dimensions().

Referenced by view_cmd_processor().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ view_stack

ViewStack view_stack

Definition at line 32 of file init_view.c.