1 #ifndef EL__OSDEP_NEWWIN_H
2 #define EL__OSDEP_NEWWIN_H
3 
4 #include "terminal/terminal.h"
5 
6 /* {struct open_in_new} and @open_in_new is used for setting up menues
7  * of how new windows can be opened. */
8 struct open_in_new {
9 	enum term_env_type env;	/* The term->environment the entry covers */
10 	unsigned char *command;	/* The default command for openning a window */
11 	unsigned char *text;	/* The menu text */
12 };
13 
14 /* The table containing all the possible environment types */
15 extern const struct open_in_new open_in_new[];
16 
17 /* Iterator for the @open_in_new table over a terminal environment bitmap. */
18 #define foreach_open_in_new(i, term_env) \
19 	for ((i) = 0; open_in_new[(i)].env; (i)++) \
20 		if (((term_env) & open_in_new[(i)].env))
21 
22 /* Returns the number of possible ways to open new windows using the
23  * environment of @term. */
24 int can_open_in_new(struct terminal *term);
25 
26 /* Opens a new window with the executable @exe_name under the given terminal
27  * @environment and passing the arguments in the string @param.
28  *
29  * For the ENV_XWIN environment, @exe_name being 'elinks' and @param empty the
30  * window will be opened using: 'xterm -e elinks' */
31 void open_new_window(struct terminal *term, unsigned char *exe_name,
32 		     enum term_env_type environment, unsigned char *param);
33 
34 #endif
35