C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
Object Selection

Functions to Navigate, Select, and Perform Action on Objects. More...

Functions

int init_pick (Init *init, int argc, char **argv, int begy, int begx)
 Initializes pick structure and opens pick input file or pipe.
int read_pick_input (Init *init)
 Reads pick input from file pointer and saves objects into pick structure.
int pick_engine (Init *init)
 Initializes pick interface, calculates window size and position, and enters picker loop.
void save_object (Pick *pick, char *s)
 Saves a string as an object in the pick structure.
int picker (Init *init)
 Main loop to handle user input and interactions for pick interface.
void display_page (Pick *pick)
 Displays current page of objects in pick window.
void reverse_object (Pick *pick)
 Reverses the display of the currently selected object in pick window.
void unreverse_object (Pick *pick)
 Unreverses the display of the currently selected object in pick window.
void toggle_object (Pick *pick)
 Toggles the selection state of the currently selected object in pick window.
void deselect_object (Pick *pick)
 Deselects the currently selected object in pick window.
int output_objects (Pick *pick)
 Outputs selected objects to specified output file.
int exec_objects (Init *init)
 Executes specified command with selected objects as arguments.
int open_pick_win (Init *init)
 Initializes the pick window based on the parameters specified in the Pick structure.
void display_pick_help (Init *init)
 Displays the help screen for the pick interface using view.

Detailed Description

Functions to Navigate, Select, and Perform Action on Objects.

Function Documentation

◆ deselect_object()

void deselect_object ( Pick * pick)

Deselects the currently selected object in pick window.

like toggle, but only deselects object

Definition at line 696 of file pick_engine.c.

696 {
697 pick->x = pick->tbl_col * (pick->tbl_col_width + 1) + 1;
698 if (pick->f_selected[pick->obj_idx]) {
699 pick->select_cnt--;
700 pick->f_selected[pick->obj_idx] = false;
701 mvwaddstr(pick->win, pick->y, pick->x - 1, " ");
702 }
703}
Pick * pick
Definition mem.c:46

References Pick::f_selected, Pick::obj_idx, Pick::select_cnt, Pick::tbl_col, Pick::tbl_col_width, Pick::win, Pick::x, and Pick::y.

Referenced by pick_engine(), and picker().

Here is the caller graph for this function:

◆ display_page()

void display_page ( Pick * pick)

Displays current page of objects in pick window.

Parameters
pickPointer to Pick structure containing objects and display information
Note
Clears the pick window and displays the current page of objects based on the current table page, line, and column. Marks selected objects with an asterisk. Updates the chyron with page information at the bottom of the pick window.

Definition at line 608 of file pick_engine.c.

608 {
609 int y, col, pidx;
610 for (y = 0; y < pick->pg_lines; y++) {
611 wmove(pick->win, y, 0);
612 wclrtoeol(pick->win);
613 }
614 pidx = pick->tbl_page * pick->pg_lines * pick->tbl_cols;
615 for (col = 0; col < pick->tbl_cols; col++) {
616 pick->x = col * (pick->tbl_col_width + 1) + 1;
617 for (y = 0; y < pick->pg_lines; y++, pidx++) {
618 if (pidx < pick->obj_cnt) {
619 if (pick->f_selected[pidx])
620 mvwaddstr(pick->win, y, pick->x - 1, "*");
621 mvwaddstr_fill(pick->win, y, pick->x, pick->object[pidx],
622 pick->tbl_col_width);
623 }
624 }
625 }
626 compile_chyron(pick->chyron);
627 display_chyron(pick->win, pick->chyron, pick->pg_lines, pick->chyron->l);
628}
void display_chyron(WINDOW *win, Chyron *chyron, int line, int col)
Definition dwin.c:298
void mvwaddstr_fill(WINDOW *, int, int, char *, int)
For lines shorter than their display area, fill the rest with spaces.
Definition dwin.c:1267
void compile_chyron(Chyron *)
construct the chyron string from the chyron structure
Definition dwin.c:269

References Pick::chyron, compile_chyron(), display_chyron(), Pick::f_selected, Chyron::l, mvwaddstr_fill(), Pick::obj_cnt, Pick::object, Pick::pg_lines, Pick::tbl_col_width, Pick::tbl_cols, Pick::tbl_page, Pick::win, and Pick::x.

Referenced by pick_engine(), and picker().

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

◆ display_pick_help()

void display_pick_help ( Init * init)

Displays the help screen for the pick interface using view.

Parameters
initPointer to Init structure containing pick information
Note
Initializes the help_spec field in the Pick structure with the path to the pick help file. Then, constructs the argument list for executing popup_view with the help file as an argument. Finally, calls popup_view function to display the help screen within the pick interface.

Definition at line 953 of file pick_engine.c.

953 {
954 char tmp_str[MAXLEN];
955 eargc = 0;
956 if (pick->f_help_spec && pick->help_spec[0] != '\0')
957 strnz__cpy(tmp_str, pick->help_spec, MAXLEN - 1);
958 else {
959 strnz__cpy(tmp_str, init->mapp_help, MAXLEN - 1);
960 strnz__cat(tmp_str, "/", MAXLEN - 1);
961 strnz__cat(tmp_str, PICK_HELP_FILE, MAXLEN - 1);
962 }
963 eargv[eargc++] = strdup("view");
964 eargv[eargc++] = strdup("-N");
965 eargv[eargc++] = strdup("f");
966 eargv[eargc++] = strdup(tmp_str);
967 eargv[eargc] = nullptr;
968 init->lines = 30;
969 init->cols = 76;
970 init->begy = pick->begy + 1;
971 init->begx = pick->begx + 1;
972 strnz__cpy(init->title, "Pick Help", MAXLEN - 1);
973 popup_view(init, eargc, eargv, init->lines, init->cols, init->begy,
974 init->begx);
976 return;
977}
Init * init
Definition common.h:183
#define PICK_HELP_FILE
Definition common.h:36
int popup_view(Init *, int, char **, int, int, int, int)
instantiate a view popup window
Definition popups.c:119
int eargc
Definition futil.c:48
char * eargv[MAXARGS]
Definition futil.c:49
#define MAXLEN
Definition curskeys.c:15
void destroy_argv(int argc, char **argv)
Deallocates memory allocated for argument strings in argv.
Definition futil.c:230
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
Definition futil.c:278
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
Definition futil.c:307

References Init::begx, Pick::begx, Init::begy, Pick::begy, Init::cols, destroy_argv(), eargc, eargv, Pick::f_help_spec, Pick::help_spec, Init::lines, Init::mapp_help, pick, popup_view(), strnz__cat(), strnz__cpy(), and Init::title.

Referenced by picker().

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

◆ exec_objects()

int exec_objects ( Init * init)

Executes specified command with selected objects as arguments.

Parameters
initPointer to Init structure
Returns
0 on success, 1 on failure
Note
Parses command string and appends selected objects as arguments to the command. If command contains "%%", it is replaced with a space- separated list of selected objects. Executes the command using execvp in a child process and waits for it to finish. If the command is a pager or editor, it is executed within the pick interface using popup_view instead of execvp.
If f_append_args is true, the argument containing %% is replaced with the concatenated selected objects. If f_append_args is false, selected objects are added as separate arguments and the original command arguments remain unchanged.
eargv should be null-terminated to indicate the end of arguments for execvp
Memory allocated for arguments is freed after execution to prevent memory leaks.
If execvp fails, an error message is printed and the child process exits with failure status
The parent process waits for the child process to finish before proceeding and restores terminal settings
If the command is a pager or editor, it is executed within the pick interface using popup_view instead of execvp
The base name of the command is extracted to check if it is a pager or editor
If the command is a pager or editor, the pick interface is used to display the command output instead of executing it in a separate terminal This allows the user to view the command output without leaving the pick interface and provides a more seamless user experience.
If the command is not a pager or editor, it is executed in a separate terminal and the pick interface is restored after execution
If the command to be executed is view, an external command is not needed, instead the popup_view function can be used to display the output within the pick interface

This is the line that gets the selected objects

append arguments onto tmp_str

initialize popup_view arguments and execute popup_view to display command output within pick interface

fork failed, free eargv and return error

Child process to execute command

If execvp returns, it means execution failed, so free eargv and print error message before exiting

Definition at line 765 of file pick_engine.c.

765 {
766 int rc = -1;
767 int eargc;
768 char *eargv[MAXARGS];
769 char tmp_str[MAXLEN];
770 char title[MAXLEN];
771 char sav_arg[MAXLEN];
772 char *out_s;
773 int eargx = 0;
774 int i = 0;
775 pid_t pid = 0;
776 bool f_append_args = false;
777 // char *s1;
778
779 title[0] = '\0';
780 if (pick->cmd[0] == '\0')
781 return -1;
782 if (pick->cmd[0] == '\\' || pick->cmd[0] == '\"') {
783 size_t len = strlen(pick->cmd);
784 if (len > 1 && pick->cmd[len - 1] == '\"') {
785 memmove(pick->cmd, pick->cmd + 1, len - 2);
786 pick->cmd[len - 2] = '\0';
787 }
788 }
789 eargc = str_to_args(eargv, pick->cmd, MAXARGS - 1);
790 tmp_str[0] = '\0';
791 if (pick->f_multiple_cmd_args) {
792 for (i = 0; i < pick->obj_cnt; i++) {
793 if (pick->f_selected[i] && eargc < MAXARGS) {
794 if (tmp_str[0] != '\0')
795 strnz__cat(tmp_str, " ", MAXLEN - 1);
796 strnz__cat(tmp_str, pick->object[i], MAXLEN - 1);
797 }
798 }
799 eargv[eargc++] = strdup(tmp_str);
800 } else {
801 f_append_args = false;
802 i = 0;
803 while (i < eargc) {
805 if (strstr(eargv[i], "%%") != nullptr) {
806 tmp_str[0] = '\0';
807 f_append_args = true;
808 strnz__cpy(sav_arg, eargv[i], MAXLEN - 1);
809 eargx = i;
810 break;
811 }
812 i++;
813 }
814 for (i = 0; i < pick->obj_cnt; i++) {
816 if (pick->f_selected[i] && eargc < MAXARGS - 1) {
817 if (f_append_args == true) {
818 if (tmp_str[0] != '\0')
819 strnz__cat(tmp_str, " ", MAXLEN - 1);
820 strnz__cat(tmp_str, pick->object[i], MAXLEN - 1);
821 continue;
822 }
823 eargv[eargc++] = strdup(pick->object[i]);
824 }
825 }
826 if (f_append_args == true) {
827 if (eargv[eargx] != nullptr) {
828 free(eargv[eargx]);
829 eargv[eargx] = nullptr;
830 }
831 out_s = rep_substring(sav_arg, "%%", tmp_str);
832 if (out_s == nullptr || out_s[0] == '\0') {
833 i = 0;
834 while (i < eargc) {
835 if (eargv[i] != nullptr)
836 free(eargv[i]);
837 i++;
838 }
839 Perror("rep_substring() failed in exec_objects");
840 return 1;
841 }
842 strnz__cpy(title, out_s, MAXLEN - 1);
843 eargv[eargx] = strdup(out_s);
844 if (out_s != nullptr) {
845 free(out_s);
846 out_s = nullptr;
847 }
848 }
849 }
850 strnz__cpy(tmp_str, eargv[0], MAXLEN - 1);
851 eargv[eargc] = nullptr;
852 // s1 = tmp_str;
853 char *sp;
854 // Scan-build false positive: strtok_r modifies the input string, but
855 // tmp_str is a local array and is not used after this point, so it is safe
856 // to modify it with strtok_r
857 char *tok;
858 tok = strtok_r(tmp_str, " ", &sp);
859 strnz__cpy(sav_arg, tok, MAXLEN - 1);
860 base_name(tmp_str, sav_arg);
861 if (tmp_str[0] != '\0' &&
862 (strcmp(tmp_str, "view") == 0 || strcmp(tmp_str, "view") == 0)) {
865 init->lines = 60;
866 init->cols = 80;
867 init->begy = pick->begy + 1;
868 init->begx = pick->begx + 1;
869 if (title[0] != '\0')
870 strnz__cpy(init->title, title, MAXLEN - 1);
871 else
872 strnz__cpy(init->title, eargv[eargc], MAXLEN - 1);
873 popup_view(init, eargc, eargv, init->lines, init->cols, init->begy,
874 init->begx);
875 i = 0;
876 while (i < eargc) {
877 if (eargv[i] != nullptr)
878 free(eargv[i]);
879 i++;
880 }
881 return 0;
882 } else {
883 if ((pid = fork()) == -1) {
885 i = 0;
886 while (i < eargc) {
887 if (eargv[i] != nullptr)
888 free(eargv[i]);
889 i++;
890 }
891 Perror("fork() failed in exec_objects");
892 return (1);
893 }
894 if (pid == 0) {
896 execvp(eargv[0], eargv);
900 strnz__cpy(tmp_str, "Can't exec pick cmd: ", MAXLEN - 1);
901 strnz__cat(tmp_str, eargv[0], MAXLEN - 1);
902 Perror(tmp_str);
903 exit(EXIT_FAILURE);
904 }
905 }
906 // waitpid_with_timeout(pid, wait_timeout);
907 // action_disposition("Notification", "Command executed");
908 waitpid(pid, nullptr, 0);
909 // win_del();
913 werase(stdscr);
914 wrefresh(stdscr);
915 restore_wins();
916 return rc;
917}
#define MAXARGS
Definition cm.h:30
void restore_wins()
Restore all windows after a screen resize.
Definition dwin.c:939
int Perror(char *)
Display a simple error message window or print to stderr.
Definition dwin.c:1115
char * rep_substring(const char *, const char *, const char *)
Replace all occurrences of "tgt_s" in "org_s" with "rep_s".
Definition futil.c:1393
bool base_name(char *, char *)
Returns the base name of a file specification.
Definition futil.c:800
int str_to_args(char **, char *, int)
Converts a string into an array of argument strings.
Definition futil.c:176
bool restore_curses_tioctl()
restore_curses_tioctl() - restore curses terminal settings
Definition scriou.c:81
void sig_prog_mode()
Set up signal handlers for interrupt signals.
Definition sig.c:62

References base_name(), Init::begx, Pick::begx, Init::begy, Pick::begy, Pick::cmd, Init::cols, destroy_argv(), Pick::f_multiple_cmd_args, Pick::f_selected, Init::lines, Pick::obj_cnt, Pick::object, Perror(), pick, popup_view(), rep_substring(), restore_curses_tioctl(), restore_wins(), sig_prog_mode(), str_to_args(), strnz__cat(), strnz__cpy(), and Init::title.

Referenced by pick_engine().

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

◆ init_pick()

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

Initializes pick structure and opens pick input file or pipe.

Parameters
initPointer to Init structure
argcArgument count
argvArgument vector
begyBeginning y coordinate for pick window
begxBeginning x coordinate for pick window
Note
If provider_cmd is specified, it takes precedence over in_spec and input file arguments
provider_cmd is executed and its output is read as pick input
If provider_cmd is not specified, in_spec is used to read pick input from a file or stdin
If provider_cmd is specified, it is executed and its output is read as pick input

Spawn Child to execute provider_cmd Close read end of pipe as Child only needs to write to pipe

Connect CHILD STDOUT to write end of pipe

STDOUT attached to write end of pipe, so close pipe fd

Return to Parent Close write end of pipe as Parent only needs to read from pipe

Open a file pointer on read end of pipe

No provider_cmd specified, so read pick input from file or stdin

< Initial timeout of 200ms to check for pick input

If user cancels while waiting for pick input, kill provider_cmd child process and close pipe

If error occurs while waiting for pick input, kill provider_cmd child process and close pipe

If timeout occurs while waiting for pick input, kill provider_cmd child process and close pipe

If unexpected error occurs while waiting for pick input, kill provider_cmd child process and close pipe

Wait for provider_cmd child process to finish before proceeding

Enter pick_engine

Definition at line 59 of file pick_engine.c.

59 {
60 struct stat sb;
61 char *s_argv[MAXARGS];
62 int s_argc;
63 char tmp_str[MAXLEN];
64 int m;
65 pid_t pid = 0;
66
67 if (init->pick != nullptr)
69 Pick *pick = new_pick(init, argc, argv, begy, begx);
70 if (init->pick != pick)
71 abend(-1, "init->pick != pick\n");
72 SIO *sio = init->sio;
73 if (pick->provider_cmd[0] != '\0') {
74 s_argc = str_to_args(s_argv, pick->provider_cmd, MAXARGS - 1);
75 if (pipe(pipe_fd) == -1) {
76 Perror("pipe(pipe_fd) failed in init_pick");
77 return (1);
78 }
79 if ((pid = fork()) == -1) {
80 Perror("fork() failed in init_pick");
81 return (1);
82 }
83 if (pid == 0) {
86 close(pipe_fd[P_READ]);
88 dup2(pipe_fd[P_WRITE], STDOUT_FILENO);
89 dup2(pipe_fd[P_WRITE], STDERR_FILENO);
91 close(pipe_fd[P_WRITE]);
92 execvp(s_argv[0], s_argv);
93 m = MAXLEN - 24;
94 strnz__cpy(tmp_str, "Can't exec pick start cmd: ", m);
95 m -= strlen(s_argv[0]);
96 strnz__cat(tmp_str, s_argv[0], m);
97 Perror(tmp_str);
98 exit(EXIT_FAILURE);
99 }
102 close(pipe_fd[P_WRITE]);
104 pick->in_fp = fdopen(pipe_fd[P_READ], "rb");
105 pick->f_in_pipe = true;
106 destroy_argv(s_argc, s_argv);
107 } else {
108 if ((pick->in_spec[0] == '\0') || strcmp(pick->in_spec, "-") == 0 ||
109 strcmp(pick->in_spec, "/dev/stdin") == 0) {
110 strnz__cpy(pick->in_spec, "/dev/stdin", MAXLEN - 1);
111 pick->in_fp = fdopen(STDIN_FILENO, "rb");
112 pick->f_in_pipe = true;
113 }
114 }
115 if (!pick->f_in_pipe) {
117 if (lstat(pick->in_spec, &sb) == -1) {
118 m = MAXLEN - 29;
119 strnz__cpy(tmp_str, "Can\'t stat pick input file: ", m);
120 m -= strlen(pick->in_spec);
121 strnz__cat(tmp_str, pick->in_spec, m);
122 Perror(tmp_str);
123 return (1);
124 }
125 if (sb.st_size == 0) {
126 m = MAXLEN - 24;
127 strnz__cpy(tmp_str, "Pick input file empty: ", m);
128 m -= strlen(pick->in_spec);
129 strnz__cat(tmp_str, pick->in_spec, m);
130 Perror(tmp_str);
131 return (1);
132 }
133 if ((pick->in_fp = fopen(pick->in_spec, "rb")) == nullptr) {
134 m = MAXLEN - 29;
135 strnz__cpy(tmp_str, "Can't open pick input file: ", m);
136 m -= strlen(pick->in_spec);
137 strnz__cat(tmp_str, pick->in_spec, m);
138 Perror(tmp_str);
139 return (1);
140 }
141 }
142 /*------------------------------------------------------------*/
143 bool f_wait = false;
144 int ready;
145 fd_set read_fds;
146 struct timeval timeout;
147 Chyron *wait_chyron;
148 WINDOW *wait_win;
149 int remaining;
150 if (pick->in_fp == nullptr) {
151 Perror("No pick input available");
153 return (1);
154 }
155 int in_fd = fileno(pick->in_fp);
156 FD_ZERO(&read_fds);
157 FD_SET(in_fd, &read_fds);
158 timeout.tv_sec = 0;
159 timeout.tv_usec =
160 200000;
161 ready = select(in_fd + 1, &read_fds, nullptr, nullptr, &timeout);
162 if (ready == 0) {
163 f_wait = true;
164 remaining = wait_timeout;
165 wait_chyron = wait_mk_chyron();
166 wait_win = wait_mk_win(wait_chyron, "WAITING for PICK INPUT");
167 }
168 cmd_key = 0;
169 while (ready == 0 && remaining > 0 && cmd_key != KEY_F(9)) {
170 cmd_key = wait_continue(wait_win, wait_chyron, remaining);
171 if (cmd_key == KEY_F(9))
172 break;
173 FD_ZERO(&read_fds);
174 FD_SET(in_fd, &read_fds);
175 timeout.tv_sec = 0;
176 timeout.tv_usec = 0;
177 ready = select(in_fd + 1, &read_fds, nullptr, nullptr, &timeout);
178 remaining--;
179 }
180 if (f_wait) {
181 if (wait_chyron != nullptr)
182 wait_destroy(wait_chyron);
183 }
184 if (cmd_key == KEY_F(9)) {
185 if (pick->f_in_pipe && pid > 0) {
188 kill(pid, SIGKILL);
189 waitpid(pid, nullptr, 0);
190 close(pipe_fd[P_READ]);
191 }
192 Perror("No pick input available");
194 return (1);
195 }
196 if (ready == -1) {
197 Perror("Error waiting for pick input");
198 if (pick->f_in_pipe && pid > 0) {
201 kill(pid, SIGKILL);
202 waitpid(pid, nullptr, 0);
203 close(pipe_fd[P_READ]);
204 }
206 return (1);
207 }
208 if (ready == 0) {
209 Perror("Timeout waiting for pick input");
210 if (pick->f_in_pipe && pid > 0) {
213 kill(pid, SIGKILL);
214 waitpid(pid, nullptr, 0);
215 close(pipe_fd[P_READ]);
216 }
218 return (1);
219 }
220 if (ready == 1 && !FD_ISSET(in_fd, &read_fds)) {
221 Perror("Unexpected error waiting for pick input");
222 if (pick->f_in_pipe && pid > 0) {
225 kill(pid, SIGKILL);
226 waitpid(pid, nullptr, 0);
227 close(pipe_fd[P_READ]);
228 }
230 return (1);
231 }
232 /*------------------------------------------------------------*/
234 if (pick->f_in_pipe && pid > 0) {
237 // waitpid(pid, nullptr, 0);
238 close(pipe_fd[P_READ]);
239 dup2(sio->stdin_fd, STDIN_FILENO);
240 dup2(sio->stdout_fd, STDOUT_FILENO);
243 keypad(pick->win, true);
244 }
245 if (pick->obj_cnt == 0) {
246 Perror("No pick objects available");
248 return (1);
249 }
252 win_del();
254 return 0;
255}
#define P_READ
Definition common.h:47
#define P_WRITE
Definition common.h:48
int begx
int wait_timeout
Definition futil.c:107
int begy
int pipe_fd[2]
Definition pick_engine.c:39
unsigned int cmd_key
Definition dwin.c:118
bool waitpid_with_timeout(pid_t pid, int timeout)
Definition dwin.c:1436
SIO * sio
Definition dwin.c:78
WINDOW * win_del()
Delete the current window and its associated box window.
Definition dwin.c:898
bool wait_destroy(Chyron *)
Destroy the waiting message window and chyron.
Definition dwin.c:1208
int wait_continue(WINDOW *, Chyron *, int)
Update the waiting message with remaining time and check for user input.
Definition dwin.c:1220
WINDOW * wait_mk_win(Chyron *, char *)
Display a popup waiting message.
Definition dwin.c:1177
void abend(int, char *)
Abnormal program termination.
Definition dwin.c:1336
Chyron * wait_mk_chyron()
Create a Chyron struct for the waiting message.
Definition dwin.c:1166
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 read_pick_input(Init *)
Reads pick input from file pointer and saves objects into pick structure.
int pick_engine(Init *)
Initializes pick interface, calculates window size and position, and enters picker loop.
Definition cm.h:248
The SIO structure encapsulates various aspects of the terminal's state and configuration,...
Definition cm.h:651
Pick data structure.
Definition pick.h:25

References abend(), cmd_key, destroy_argv(), destroy_pick(), Pick::f_in_pipe, Pick::in_fp, Pick::in_spec, new_pick(), Pick::obj_cnt, Perror(), Init::pick, pick_engine(), pipe_fd, Pick::provider_cmd, read_pick_input(), restore_curses_tioctl(), sig_prog_mode(), Init::sio, SIO::stdin_fd, SIO::stdout_fd, str_to_args(), strnz__cat(), strnz__cpy(), wait_continue(), wait_destroy(), wait_mk_chyron(), wait_mk_win(), wait_timeout, waitpid_with_timeout(), Pick::win, and win_del().

Referenced by main(), and popup_pick().

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

◆ open_pick_win()

int open_pick_win ( Init * init)

Initializes the pick window based on the parameters specified in the Pick structure.

Parameters
initPointer to Init structure containing pick information
Returns
0 on success, 1 on failure
Note
Creates a new window for the pick interface using win_new function with the specified parameters from the Pick structure. If window creation fails, an error message is printed and the function returns 1. Otherwise, initializes the window and box pointers in the Pick structure, sets scrollok and keypad options for the window, and returns 0 on success.

Definition at line 928 of file pick_engine.c.

928 {
929 char tmp_str[MAXLEN];
930 pick = init->pick;
931 if (box_new(pick->win_lines, pick->win_width, pick->begy, pick->begx,
932 pick->title, true)) {
933 ssnprintf(tmp_str, MAXLEN - 1, "box_new(%d, %d, %d, %d, %s) failed",
934 pick->win_lines, pick->win_width, pick->begy, pick->begx,
935 pick->title);
936 Perror(tmp_str);
937
938 return (1);
939 }
940 pick->win = win_win[win_ptr];
941 pick->box = win_box[win_ptr];
942 scrollok(pick->win, false);
943 keypad(pick->win, true);
944 return 0;
945}
WINDOW * win_win[MAXWIN]
Definition dwin.c:115
int win_ptr
Definition dwin.c:122
WINDOW * win_box[MAXWIN]
Definition dwin.c:116
int box_new(int, int, int, int, char *, bool)
Create a new window with optional box and title.
Definition dwin.c:783
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
Definition futil.c:156

References Pick::begx, Pick::begy, Pick::box, box_new(), Perror(), Init::pick, pick, ssnprintf(), Pick::title, Pick::win, win_box, Pick::win_lines, win_ptr, Pick::win_width, and win_win.

Referenced by pick_engine().

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

◆ output_objects()

int output_objects ( Pick * pick)

Outputs selected objects to specified output file.

Parameters
pickPointer to Pick structure containing selected objects and output file information
Returns
0 on success, 1 on failure
Note
If output file cannot be opened, an error message is printed and the function returns 1. Otherwise, selected objects are written to the output file, one per line, and the file is closed before returning 0.

Definition at line 713 of file pick_engine.c.

713 {
714 char tmp_str[MAXLEN];
715 int m;
716 if ((pick->out_fp = fopen(pick->out_spec, "w")) == nullptr) {
717 m = MAXLEN - 30;
718 strnz__cpy(tmp_str, "Can't open pick output file: ", m);
719 m -= strlen(pick->in_spec);
720 strnz__cat(tmp_str, pick->out_spec, m);
721 }
722 for (pick->obj_idx = 0; pick->obj_idx < pick->obj_cnt; pick->obj_idx++) {
723 if (pick->f_selected[pick->obj_idx])
724 fprintf(stdout, "%s\n", pick->object[pick->obj_idx]);
725 }
726 fflush(stdout);
727 if (pick->out_fp != nullptr)
728 fclose(pick->out_fp);
729 return (0);
730}

References Pick::f_selected, Pick::in_spec, Pick::obj_cnt, Pick::obj_idx, Pick::object, Pick::out_fp, Pick::out_spec, strnz__cat(), and strnz__cpy().

Referenced by pick_engine().

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

◆ pick_engine()

int pick_engine ( Init * init)

Initializes pick interface, calculates window size and position, and enters picker loop.

Parameters
initPointer to Init structure containing pick information
Returns
Count of selected objects on success, -1 if user cancels
Note
Initializes key command strings for chyron display and calculates pick window size and position based on terminal size and pick parameters.
Opens pick window and displays first page of objects. Enters picker loop to handle user input and interactions. If user cancels selection, returns -1.
If user accepts selection, returns count of selected objects.

Initialize window and data structures

Initialize key command strings for chyron display

Calculate pick window size and position based on terminal size and pick parameters

Enter picker loop to handle user input and interactions

Definition at line 300 of file pick_engine.c.

300 {
302 int rc;
303 int maxy, maxx, win_maxy, win_maxx;
304 int tbl_max_cols, pg_max_objs;
306
307 getmaxyx(stdscr, maxy, maxx);
310 win_maxy = min(((maxy * 8) / 10), (maxy - pick->begy - 1));
311 win_maxx = min(((maxx * 9) / 10), (maxx - pick->begx - 1));
312 pick->tbl_col_width = max(pick->tbl_col_width, 4);
313 pick->tbl_col_width = min(pick->tbl_col_width, win_maxx - 2);
314 if (pick->obj_cnt <= win_maxy) {
315 pick->tbl_lines = pick->obj_cnt;
316 pick->tbl_cols = 1;
317 } else {
318 tbl_max_cols = (win_maxx / (pick->tbl_col_width + 1));
319 pg_max_objs = win_maxy * tbl_max_cols;
320 if (pick->obj_cnt > pg_max_objs)
321 pick->tbl_cols = tbl_max_cols;
322 else
323 pick->tbl_cols = pick->obj_cnt / win_maxy;
324 pick->tbl_lines = pick->obj_cnt / tbl_max_cols;
325 }
326 pick->tbl_pages = (pick->tbl_lines / (win_maxy - 1)) + 1;
327 pick->pg_lines = (pick->tbl_lines / pick->tbl_pages);
328 pick->win_lines = pick->pg_lines + 1;
329 pick->tbl_page = 0;
330 if (pick->begy == 0)
331 pick->begy = (LINES - pick->win_lines) / 5;
332 else if (pick->begy + pick->win_lines > LINES - 4)
333 pick->begy = LINES - pick->win_lines - 2;
334 pick->win_width = (pick->tbl_col_width + 1) * pick->tbl_cols;
335
336 pick->chyron = new_chyron();
337 set_chyron_key(pick->chyron, 1, "F1 Help", KEY_F(1));
338 set_chyron_key(pick->chyron, 9, "F9 Cancel", KEY_F(9));
339 set_chyron_key(pick->chyron, 10, "F10 Continue", KEY_F(10));
340 if (pick->tbl_pages > 1) {
341 set_chyron_key(pick->chyron, 11, "PgUp", KEY_PPAGE);
342 set_chyron_key(pick->chyron, 12, "PgDn", KEY_NPAGE);
343 }
344 set_chyron_key(pick->chyron, 13, "Toggle", 't');
345 compile_chyron(pick->chyron);
346 if (pick->chyron->l > win_maxx)
347 pick->chyron->l = strnz(pick->chyron->s, win_maxx);
348 if (pick->win_width < pick->chyron->l)
349 pick->win_width = pick->chyron->l;
350 pick->win_width = max(pick->win_width, pick->chyron->l) + 1;
351 if (pick->begx + pick->win_width > COLS - 2)
352 pick->begx = COLS - pick->win_width - 2;
353 else if (pick->begx == 0)
354 pick->begx = (COLS - pick->win_width) / 2;
355
356 rc = open_pick_win(init);
357 if (rc)
358 return (rc);
360 pick->obj_idx = 0;
361 pick->x = 1;
362 do {
365 mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED, nullptr);
366 rc = picker(init);
367 if (rc == -1)
368 break;
369 else {
370 if (pick->select_cnt > 0) {
371 if (pick->f_out_spec && pick->out_spec[0])
373 if (pick->f_cmd && pick->cmd[0])
375 }
376 }
378 } while (1);
379 destroy_chyron(pick->chyron);
380 return (rc);
381}
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:55
#define max(a, b)
max macro evaluates two expressions, returning greatest result.
Definition cm.h:48
void set_chyron_key(Chyron *, int, char *, int)
Definition dwin.c:246
Chyron * destroy_chyron(Chyron *chyron)
Destroy Chyron structure.
Definition dwin.c:199
Chyron * new_chyron()
Create and initialize Chyron structure.
Definition dwin.c:184
size_t strnz(char *, size_t)
terminates string at New Line, Carriage Return, or max_len
Definition futil.c:349
int output_objects(Pick *)
Outputs selected objects to specified output file.
void deselect_object(Pick *)
Deselects the currently selected object in pick window.
void reverse_object(Pick *)
Reverses the display of the currently selected object in pick window.
int picker(Init *)
Main loop to handle user input and interactions for pick interface.
void display_page(Pick *)
Displays current page of objects in pick window.
int open_pick_win(Init *)
Initializes the pick window based on the parameters specified in the Pick structure.
int exec_objects(Init *)
Executes specified command with selected objects as arguments.

References Pick::begx, Pick::begy, Pick::chyron, Pick::cmd, compile_chyron(), deselect_object(), destroy_chyron(), display_page(), exec_objects(), Pick::f_cmd, Pick::f_out_spec, Chyron::l, new_chyron(), Pick::obj_cnt, Pick::obj_idx, open_pick_win(), Pick::out_spec, output_objects(), Pick::pg_lines, pick, picker(), reverse_object(), Chyron::s, Pick::select_cnt, set_chyron_key(), strnz(), Pick::tbl_col_width, Pick::tbl_cols, Pick::tbl_lines, Pick::tbl_page, Pick::tbl_pages, Pick::win_lines, Pick::win_width, and Pick::x.

Referenced by init_pick().

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

◆ picker()

int picker ( Init * init)

Main loop to handle user input and interactions for pick interface.

Parameters
initPointer to Init structure
Returns
Number of selected objects or -1 if user cancels
Note
Handles user input for navigating and selecting objects in the pick interface.
Supports various key commands for navigation, selection, and accepting/canceling the selection.
Updates the display accordingly based on user interactions.
If the user cancels the selection, returns -1.
If the user accepts the selection, returns the count of selected objects.

'q', or KEY_F(9) cancel selection and exit picker

KEY_F(1) or 'H' Displays help screen for pick interface

't' or Space Toggles selection of current object

Enter or KEY_F(10) Accepts current selection and exits picker, returning count of selected objects

KEY_END Moves selection to last object in list

'l' or KEY_RIGHT Moves selection to next object in list

pick->obj_idx += pick->tbl_lines -> next column

'h' or KEY_LEFT or Backspace Moves selection to previous object in list

'j' or KEY_DOWN Moves selection to next object in list, 'k' or KEY_UP Moves selection to previous object in list

'k' or KEY_UP Moves selection to previous object in list

KEY_NPAGE or 'Ctrl+f' Moves selection to next page of objects,

KEY_PPAGE or 'Ctrl+b' Moves selection to previous page of objects

KEY_HOME Moves selection to first object in list

KEY_LL (lower left of numeric pad) Moves selection to last object in list

KEY_MOUSE Handles mouse events for selection and chyron key activation

Set cmdkey to 't' to toggle selection on mouse click

Definition at line 418 of file pick_engine.c.

418 {
419 int cmd_key;
420 int display_tbl_page;
421 bool f_no_reset_cmd_key;
422 pick = init->pick;
423 click_y = click_x = -1;
424 cmd_key = 0;
425 while (1) {
426 tcflush(tty_fd, TCIFLUSH);
427 f_no_reset_cmd_key = false;
428 if (cmd_key == 0)
429 cmd_key = xwgetch(pick->win, pick->chyron, -1);
430 switch (
431 cmd_key) {
432 case 'q':
433 case 'Q':
434 case KEY_F(9):
436 return -1;
438 case KEY_F(1):
439 case 'H':
443 break;
445 case ' ':
446 case 't':
447 case 'T':
450 if (pick->select_max > 0 && pick->select_cnt == pick->select_max)
451 return pick->select_cnt;
452 break;
455 case KEY_F(10):
456 case '\n':
457 case KEY_ENTER:
458 return pick->select_cnt;
460 case KEY_END:
461 mvwaddstr_fill(pick->win, pick->y, pick->x,
462 pick->object[pick->obj_idx], pick->tbl_col_width);
463 display_tbl_page = pick->tbl_page;
464 pick->obj_idx = pick->obj_cnt - 1;
465 pick->tbl_page = pick->obj_idx / (pick->pg_lines * pick->tbl_cols);
466 pick->tbl_line = (pick->obj_idx / pick->tbl_cols) % pick->pg_lines;
467 pick->tbl_col = pick->obj_idx % pick->tbl_cols;
468 pick->y = pick->tbl_line;
469 if (display_tbl_page != pick->tbl_page) {
471 }
473 break;
475 case 'l':
476 case KEY_RIGHT:
477 mvwaddstr_fill(pick->win, pick->y, pick->x,
478 pick->object[pick->obj_idx], pick->tbl_col_width);
480 if (pick->tbl_page * pick->pg_lines * pick->tbl_cols +
481 (pick->tbl_col + 1) * pick->pg_lines + pick->tbl_line <
482 pick->obj_cnt - 1 &&
483 pick->tbl_col < pick->tbl_cols - 1)
484 pick->tbl_col++;
485 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
486 pick->tbl_col * pick->pg_lines + pick->tbl_line;
488 break;
491 case 'h':
492 case KEY_LEFT:
493 case KEY_BACKSPACE:
494 mvwaddstr_fill(pick->win, pick->y, pick->x,
495 pick->object[pick->obj_idx], pick->tbl_col_width);
496 if (pick->tbl_col > 0)
497 pick->tbl_col--;
498 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
499 pick->tbl_col * pick->pg_lines + pick->tbl_line;
501 break;
504 case 'j':
505 case KEY_DOWN:
506 mvwaddstr_fill(pick->win, pick->y, pick->x,
507 pick->object[pick->obj_idx], pick->tbl_col_width);
508 if (pick->tbl_page * pick->pg_lines * pick->tbl_cols +
509 pick->tbl_col * pick->pg_lines + pick->tbl_line <
510 pick->obj_cnt - 1 &&
511 pick->tbl_line < pick->pg_lines - 1)
512 pick->tbl_line++;
513 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
514 pick->tbl_col * pick->pg_lines + pick->tbl_line;
516 break;
518 case 'k':
519 case KEY_UP:
520 mvwaddstr_fill(pick->win, pick->y, pick->x,
521 pick->object[pick->obj_idx], pick->tbl_col_width);
522 if (pick->tbl_line > 0)
523 pick->tbl_line--;
524 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
525 pick->tbl_col * pick->pg_lines + pick->tbl_line;
527 break;
529 case KEY_NPAGE:
530 case '\06':
531 if (pick->tbl_pages == 1)
532 break;
533 if (pick->tbl_page < pick->tbl_pages - 1) {
534 pick->tbl_page++;
535 pick->pg_line = 0;
536 pick->tbl_col = 0;
537 }
538 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
539 pick->tbl_cols * pick->pg_line + pick->tbl_col;
542 break;
545 case KEY_PPAGE:
546 case '\02':
547 if (pick->tbl_pages == 1)
548 break;
549 if (pick->tbl_page > 0)
550 pick->tbl_page--;
551 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
552 pick->tbl_cols * pick->pg_line + pick->tbl_col;
555 break;
557 case KEY_HOME:
558 pick->tbl_page = 0;
559 pick->tbl_line = 0;
560 pick->tbl_col = 0;
561 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
562 pick->tbl_cols * pick->pg_line + pick->tbl_col;
565 break;
568 case KEY_LL:
569 pick->tbl_page = pick->tbl_pages - 1;
570 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
571 pick->tbl_cols * pick->pg_line + pick->tbl_col;
574 break;
577 case KEY_MOUSE:
578 if (click_y == -1 || click_x == -1)
579 break;
581 pick->y = click_y;
582 pick->tbl_col = (click_x - 1) / (pick->tbl_col_width + 1);
583 if (pick->tbl_col < 0 || pick->tbl_col >= pick->tbl_cols)
584 break;
585 pick->obj_idx = pick->tbl_page * pick->pg_lines * pick->tbl_cols +
586 pick->tbl_col * pick->pg_lines + pick->y;
587 cmd_key =
588 't';
589 f_no_reset_cmd_key = true;
590 click_y = click_x = -1;
591 break;
592 default:
593 break;
594 }
595 if (!f_no_reset_cmd_key)
596 cmd_key = 0;
597 }
598 return 0;
599}
int tty_fd
Definition dwin.c:154
int click_x
Definition dwin.c:46
int click_y
Definition dwin.c:45
int xwgetch(WINDOW *, Chyron *, int)
Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line,...
Definition dwin.c:1364
void toggle_object(Pick *)
Toggles the selection state of the currently selected object in pick window.
void unreverse_object(Pick *)
Unreverses the display of the currently selected object in pick window.
void display_pick_help(Init *)
Displays the help screen for the pick interface using view.

References Pick::chyron, click_x, click_y, deselect_object(), display_page(), display_pick_help(), mvwaddstr_fill(), Pick::obj_cnt, Pick::obj_idx, Pick::object, Pick::pg_line, Pick::pg_lines, Init::pick, pick, reverse_object(), Pick::select_cnt, Pick::select_max, Pick::tbl_col, Pick::tbl_col_width, Pick::tbl_cols, Pick::tbl_line, Pick::tbl_page, Pick::tbl_pages, toggle_object(), tty_fd, unreverse_object(), Pick::win, Pick::x, xwgetch(), and Pick::y.

Referenced by pick_engine().

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

◆ read_pick_input()

int read_pick_input ( Init * init)

Reads pick input from file pointer and saves objects into pick structure.

Parameters
initPointer to Init structure containing pick information
Returns
0 on success, -1 if no objects were read
Note
Reads lines from pick->in_fp and saves them as objects in the pick structure using save_object function. If no objects are read, returns -1. Otherwise, sets obj_cnt to the number of objects read and resets obj_idx to 0 before returning 0.

Definition at line 265 of file pick_engine.c.

265 {
266 int i;
267
268 Pick *pick = init->pick;
269 pick->select_cnt = 0;
270 pick->obj_cnt = pick->pg_lines = pick->tbl_cols = 0;
271 pick->obj_idx = pick->tbl_page = pick->y = pick->tbl_col = pick->x = 0;
272 pick->tbl_pages = 1;
273
274 if (pick->in_fp) {
275 while (fgets(pick->in_buf, sizeof(pick->in_buf), pick->in_fp) !=
276 nullptr)
277 save_object(pick, pick->in_buf);
278 } else
279 for (i = 1; i < pick->argc; i++)
280 save_object(pick, pick->argv[i]);
281 if (pick->in_fp != nullptr)
282 fclose(pick->in_fp);
283 if (!pick->obj_idx)
284 return (-1);
285 pick->obj_cnt = pick->obj_idx;
286 pick->obj_idx = 0;
287 return 0;
288}
void save_object(Pick *, char *)
Saves a string as an object in the pick structure.

References Pick::argc, Pick::argv, Pick::in_buf, Pick::in_fp, Pick::obj_cnt, Pick::obj_idx, Pick::pg_lines, Init::pick, save_object(), Pick::select_cnt, Pick::tbl_col, Pick::tbl_cols, Pick::tbl_page, Pick::tbl_pages, Pick::x, and Pick::y.

Referenced by init_pick().

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

◆ reverse_object()

void reverse_object ( Pick * pick)

Reverses the display of the currently selected object in pick window.

Parameters
pickPointer to Pick structure containing object and display information
Note
Calculates the x coordinate for the currently selected object based on the current table column and column width. Moves the cursor to the object's position in the pick window, turns on reverse video attribute, and displays the object's text. Turns off reverse video attribute and refreshes the pick window to show the updated display. Moves the cursor back to the position before the object text for potential further interactions.

Definition at line 639 of file pick_engine.c.

639 {
640 pick->x = pick->tbl_col * (pick->tbl_col_width + 1) + 1;
641 pick->tbl_line = (pick->obj_idx / pick->tbl_cols) % pick->pg_lines;
642 pick->y = pick->tbl_line;
643 wmove(pick->win, pick->y, pick->x);
644 wattron(pick->win, WA_REVERSE);
645 mvwaddstr_fill(pick->win, pick->y, pick->x, pick->object[pick->obj_idx],
646 pick->tbl_col_width);
647 wattroff(pick->win, WA_REVERSE);
648 wmove(pick->win, pick->y, pick->x - 1);
649}

References mvwaddstr_fill(), Pick::obj_idx, Pick::object, Pick::pg_lines, Pick::tbl_col, Pick::tbl_col_width, Pick::tbl_cols, Pick::tbl_line, Pick::win, Pick::x, and Pick::y.

Referenced by pick_engine(), and picker().

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

◆ save_object()

void save_object ( Pick * pick,
char * s )

Saves a string as an object in the pick structure.

Parameters
pickPointer to Pick structure
sString to save as an object
Note
If the current object index is less than the maximum allowed, saves the string as an object in the pick structure. Updates the column width if necessary and marks the object as not selected. Increments the object index for the next object to be saved.

Definition at line 390 of file pick_engine.c.

390 {
391 int l;
392
393 if (pick->obj_idx < OBJ_MAXCNT - 1) {
394 l = strlen(s);
395 if (l > OBJ_MAXLEN - 1)
396 s[OBJ_MAXLEN - 1] = '\0';
397 pick->tbl_col_width = max(pick->tbl_col_width, l);
398 l = max(l, 1);
399 pick->object[pick->obj_idx] = (char *)calloc(l + 1, sizeof(char));
400 strnz__cpy(pick->object[pick->obj_idx], s, l);
401 pick->f_selected[pick->obj_idx] = false;
402 pick->obj_idx++;
403 }
404}
#define OBJ_MAXLEN
Definition pick.h:16
#define OBJ_MAXCNT
Definition pick.h:17

References Pick::f_selected, Pick::obj_idx, Pick::object, strnz__cpy(), and Pick::tbl_col_width.

Referenced by read_pick_input().

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

◆ toggle_object()

void toggle_object ( Pick * pick)

Toggles the selection state of the currently selected object in pick window.

Parameters
pickPointer to Pick structure containing object and selection information
Note
Calculates the x coordinate for the currently selected object based on the current table column and column width. If the object is currently selected, it is deselected by updating the selection count, marking it as not selected, and displaying a space before the object text. If the object is not currently selected, it is selected by updating the selection count, marking it as selected, and displaying an asterisk before the object text. Refreshes the pick window to show the updated display. Moves the cursor back to the position before the object text for potential further interactions.

Definition at line 681 of file pick_engine.c.

681 {
682 pick->x = pick->tbl_col * (pick->tbl_col_width + 1) + 1;
683 if (pick->f_selected[pick->obj_idx]) {
684 pick->select_cnt--;
685 pick->f_selected[pick->obj_idx] = false;
686 mvwaddstr(pick->win, pick->y, pick->x - 1, " ");
687 } else {
688 pick->select_cnt++;
689 pick->f_selected[pick->obj_idx] = true;
690 mvwaddstr(pick->win, pick->y, pick->x - 1, "*");
691 }
692}

References Pick::f_selected, Pick::obj_idx, Pick::select_cnt, Pick::tbl_col, Pick::tbl_col_width, Pick::win, Pick::x, and Pick::y.

Referenced by picker().

Here is the caller graph for this function:

◆ unreverse_object()

void unreverse_object ( Pick * pick)

Unreverses the display of the currently selected object in pick window.

Parameters
pickPointer to Pick structure containing object and display information
Note
Calculates the x coordinate for the currently selected object based on the current table column and column width. Moves the cursor to the object's position in the pick window and displays the object's text without reverse video attribute. Refreshes the pick window to show the updated display. Moves the cursor back to the position before the object text for potential further interactions.

Definition at line 661 of file pick_engine.c.

661 {
662 pick->x = pick->tbl_col * (pick->tbl_col_width + 1) + 1;
663 wmove(pick->win, pick->y, pick->x);
664 mvwaddstr_fill(pick->win, pick->y, pick->x, pick->object[pick->obj_idx],
665 pick->tbl_col_width);
666 wmove(pick->win, pick->y, pick->x - 1);
667}

References mvwaddstr_fill(), Pick::obj_idx, Pick::object, Pick::tbl_col, Pick::tbl_col_width, Pick::win, Pick::x, and Pick::y.

Referenced by picker().

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