C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
popups.c File Reference
#include "common.h"
Include dependency graph for popups.c:

Go to the source code of this file.

Functions

int popup_menu (Init *, int, char **, int, int)
int popup_form (Init *, int, char **, int, int)
int popup_pick (Init *, int, char **, int, int)
int popup_view (Init *, int, char **, int, int, int, int)

Function Documentation

◆ popup_form()

int popup_form ( Init * init,
int argc,
char ** argv,
int begy,
int begx )

Definition at line 34 of file popups.c.

34 {
35 int rc;
37 parse_opt_args(init, argc, argv);
38 Form *sav_form = init->form;
39 init->form = NULL;
40 new_form(init, init->argc, init->argv, begy, begx);
41 rc = init_form(init, init->argc, init->argv, begy, begx);
43 init->form = sav_form;
44 return rc;
45}
Init * init
Definition common.h:186
int parse_opt_args(Init *, int, char **)
Definition init.c:393
int begx
int begy
int init_form(Init *, int, char **, int, int)
Initialize form data structure and parse description file.
Definition form_engine.c:59
void zero_opt_args(Init *)
Initialize optional arguments in the Init struct to default values.
Definition init.c:408
Form * new_form(Init *, int, char **, int, int)
Create and initialize Form structure.
Definition mem.c:253
Form * destroy_form(Init *init)
Destroy Form structure.
Definition mem.c:276
Definition form.h:145

References Init::argc, Init::argv, destroy_form(), Init::form, init_form(), new_form(), parse_opt_args(), and zero_opt_args().

Referenced by enter_file_spec(), and menu_cmd_processor().

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

◆ popup_menu()

int popup_menu ( Init * init,
int argc,
char ** argv,
int begy,
int begx )

Definition at line 8 of file popups.c.

8 {
9 int rc;
11 parse_opt_args(init, argc, argv);
12 Menu *sav_menu = init->menu;
13 init->menu = NULL;
14 new_menu(init, init->argc, init->argv, begy, begx);
15 rc = menu_engine(init);
17 init->menu = sav_menu;
18 return rc;
19}
Menu * new_menu(Init *, int, char **, int, int)
Create and initialize Menu structure.
Definition mem.c:148
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Definition mem.c:169
unsigned int menu_engine(Init *)
The main loop of the menu system.
Definition menu_engine.c:37
The Menu structure is the main data structure for the menu application, containing all the informatio...
Definition menu.h:81

References Init::argc, Init::argv, destroy_menu(), Init::menu, menu_engine(), new_menu(), parse_opt_args(), and zero_opt_args().

Here is the call graph for this function:

◆ popup_pick()

int popup_pick ( Init * init,
int argc,
char ** argv,
int begy,
int begx )

Definition at line 21 of file popups.c.

21 {
22 int rc;
24 parse_opt_args(init, argc, argv);
25 Pick *sav_pick = init->pick;
26 init->pick = NULL;
27 new_pick(init, init->argc, init->argv, begy, begx);
28 rc = init_pick(init, init->argc, init->argv, begy, begx);
30 init->pick = sav_pick;
31 return rc;
32}
Pick * new_pick(Init *, int, char **, int, int)
Create and initialize Pick structure.
Definition mem.c:200
Pick * destroy_pick(Init *init)
Destroy Pick structure.
Definition mem.c:230
int init_pick(Init *, int, char **, int, int)
Initializes pick structure and opens pick input file or pipe.
Definition pick_engine.c:59
Pick data structure.
Definition pick.h:25

References Init::argc, Init::argv, destroy_pick(), init_pick(), new_pick(), parse_opt_args(), Init::pick, and zero_opt_args().

Referenced by menu_cmd_processor().

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

◆ popup_view()

int popup_view ( Init * init,
int argc,
char ** argv,
int lines,
int cols,
int begy,
int begx )

Definition at line 47 of file popups.c.

48 {
49 int rc = 0;
51 parse_opt_args(init, argc, argv);
52 View *sav_view = init->view;
53 init->view = NULL;
54 view = NULL;
55 if (!view)
57 else
58 view = init->view;
59 if (lines > 0)
60 view->lines = lines;
61 if (cols > 0)
62 view->cols = cols;
63 if (begy > 0)
64 view->begy = begy;
65 if (begx > 0)
66 view->begx = begx;
67 if (init->lines != 0 && view->lines == 0)
68 view->lines = init->lines;
69 if (view->lines == 0)
70 view->lines = LINES * 3 / 4;
71 if (view->lines > LINES - 3)
72 view->lines = LINES - 3;
73 if (init->cols != 0 && view->lines == 0)
74 view->cols = init->cols;
75 if (view->cols == 0)
76 view->cols = COLS * 3 / 4;
77 if (view->cols > COLS - 3)
78 view->cols = COLS - 3;
79 if (init->begy != 0 && view->begy == 0)
80 view->begy = init->begy;
81 if (view->begy == 0)
82 view->begy = (LINES - view->lines) / 5;
83 if (view->begy + view->lines > LINES - 2)
84 view->begy = LINES - view->lines - 2;
85 if (init->begx != 0 && view->begx == 0)
86 view->begx = init->begx;
87 if (view->begx == 0)
88 view->begx = (COLS - view->cols) / 5;
89 if (view->begx + view->cols > COLS - 1)
90 view->begx = COLS - view->cols - 1;
91 view->f_full_screen = false;
92 if (!init_view_boxwin(init, init->title)) {
93 rc = view_file(init);
94 win_del();
95 }
97 init->view = sav_view;
98 return rc;
99}
int cols
int lines
View * view
Definition mem.c:48
WINDOW * win_del()
Delete the current window and its associated box window.
Definition dwin.c:902
int init_view_boxwin(Init *, char *)
Initialize the C-Menu View in box window mode.
Definition init_view.c:123
View * destroy_view(Init *init)
Destroy View structure.
Definition mem.c:346
View * new_view(Init *)
Create and initialize View structure.
Definition mem.c:300
int view_file(Init *)
Start view.
Definition view.h:37

References Init::begx, View::begx, Init::begy, View::begy, Init::cols, View::cols, destroy_view(), View::f_full_screen, init_view_boxwin(), Init::lines, View::lines, new_view(), parse_opt_args(), Init::title, Init::view, view, view_file(), win_del(), and zero_opt_args().

Referenced by display_pick_help(), exec_objects(), form_engine(), menu_cmd_processor(), and view_display_help().

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