summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-10-20 20:06:06 +0200
committerBoris Faure <billiob@gmail.com>2019-10-20 20:06:06 +0200
commite21be6619b32bb9e22c050505ec3466870436d2e (patch)
tree7d1af270fd3dafe10dab66c243e39a410ea1ca43
parent8dcfc51f1e283c6fa6f58ca2bc0de2659c747688 (diff)
parent9b23e02b4e8b17a36009852d34fa8f762990831d (diff)
Merge branch 'multi'
-rw-r--r--src/bin/ipc.c33
-rw-r--r--src/bin/ipc.h48
-rw-r--r--src/bin/main.c870
-rw-r--r--src/bin/media.c1
-rw-r--r--src/bin/win.c6
5 files changed, 533 insertions, 425 deletions
diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index c9b9ee7..c848e4f 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -1,6 +1,7 @@
1#include "private.h" 1#include "private.h"
2 2
3#include <Ecore.h> 3#include <Ecore.h>
4#include <Ecore_Con.h>
4#include <Ecore_Ipc.h> 5#include <Ecore_Ipc.h>
5#include <Eet.h> 6#include <Eet.h>
6#include "ipc.h" 7#include "ipc.h"
@@ -93,6 +94,8 @@ ipc_init(void)
93 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 94 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
94 "name", name, EET_T_STRING); 95 "name", name, EET_T_STRING);
95 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 96 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
97 "theme", theme, EET_T_STRING);
98 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
96 "role", role, EET_T_STRING); 99 "role", role, EET_T_STRING);
97 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 100 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
98 "title", title, EET_T_STRING); 101 "title", title, EET_T_STRING);
@@ -128,6 +131,16 @@ ipc_init(void)
128 "hold", hold, EET_T_INT); 131 "hold", hold, EET_T_INT);
129 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 132 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
130 "nowm", nowm, EET_T_INT); 133 "nowm", nowm, EET_T_INT);
134 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
135 "xterm_256color", xterm_256color, EET_T_INT);
136 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
137 "active_links", active_links, EET_T_INT);
138 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
139 "video_mute", active_links, EET_T_INT);
140 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
141 "cursor_blink", active_links, EET_T_INT);
142 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
143 "visual_bell", active_links, EET_T_INT);
131} 144}
132 145
133Eina_Bool 146Eina_Bool
@@ -171,6 +184,19 @@ ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst))
171 func_new_inst = func; 184 func_new_inst = func;
172} 185}
173 186
187void
188ipc_instance_conn_free(void)
189{
190 char *hash = _ipc_hash_get();
191 char *address = ecore_con_local_path_new(EINA_FALSE,
192 hash,
193 0);
194 errno = 0;
195 unlink(address);
196 ERR("unlinking: '%s': %s", address, strerror(errno));
197 free(address);
198}
199
174Eina_Bool 200Eina_Bool
175ipc_instance_add(Ipc_Instance *inst) 201ipc_instance_add(Ipc_Instance *inst)
176{ 202{
@@ -178,7 +204,7 @@ ipc_instance_add(Ipc_Instance *inst)
178 void *data; 204 void *data;
179 char *hash = _ipc_hash_get(); 205 char *hash = _ipc_hash_get();
180 Ecore_Ipc_Server *ipcsrv; 206 Ecore_Ipc_Server *ipcsrv;
181 207
182 if (!hash) return EINA_FALSE; 208 if (!hash) return EINA_FALSE;
183 data = eet_data_descriptor_encode(new_inst_edd, inst, &size); 209 data = eet_data_descriptor_encode(new_inst_edd, inst, &size);
184 if (!data) 210 if (!data)
@@ -186,6 +212,7 @@ ipc_instance_add(Ipc_Instance *inst)
186 free(hash); 212 free(hash);
187 return EINA_FALSE; 213 return EINA_FALSE;
188 } 214 }
215
189 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL); 216 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL);
190 if (ipcsrv) 217 if (ipcsrv)
191 { 218 {
@@ -196,6 +223,10 @@ ipc_instance_add(Ipc_Instance *inst)
196 ecore_ipc_server_del(ipcsrv); 223 ecore_ipc_server_del(ipcsrv);
197 return EINA_TRUE; 224 return EINA_TRUE;
198 } 225 }
226 else
227 {
228 DBG("connect failed");
229 }
199 free(data); 230 free(data);
200 free(hash); 231 free(hash);
201 return EINA_FALSE; 232 return EINA_FALSE;
diff --git a/src/bin/ipc.h b/src/bin/ipc.h
index 4ade907..0aa4775 100644
--- a/src/bin/ipc.h
+++ b/src/bin/ipc.h
@@ -7,28 +7,33 @@ typedef struct _Ipc_Instance Ipc_Instance;
7 7
8struct _Ipc_Instance 8struct _Ipc_Instance
9{ 9{
10 const char *cmd; 10 char *cmd;
11 const char *cd; 11 char *cd;
12 const char *background; 12 char *background;
13 const char *name; 13 char *name;
14 const char *role; 14 char *theme;
15 const char *title; 15 char *role;
16 const char *icon_name; 16 char *title;
17 const char *font; 17 char *icon_name;
18 const char *startup_id; 18 char *font;
19 const char *startup_split; 19 char *startup_id;
20 char *startup_split;
20 int x, y, w, h; 21 int x, y, w, h;
21 int pos; 22 Eina_Bool pos;
22 int login_shell; 23 Eina_Bool login_shell;
23 int fullscreen; 24 Eina_Bool fullscreen;
24 int iconic; 25 Eina_Bool iconic;
25 int borderless; 26 Eina_Bool borderless;
26 int override; 27 Eina_Bool override;
27 int maximized; 28 Eina_Bool maximized;
28 int hold; 29 Eina_Bool hold;
29 int nowm; 30 Eina_Bool nowm;
30 int xterm_256color; 31 Eina_Bool xterm_256color;
31 int active_links; 32 Eina_Bool video_mute;
33 Eina_Bool active_links;
34 Eina_Bool cursor_blink;
35 Eina_Bool visual_bell;
36 Config *config;
32}; 37};
33 38
34void ipc_init(void); 39void ipc_init(void);
@@ -36,5 +41,6 @@ void ipc_shutdown(void);
36Eina_Bool ipc_serve(void); 41Eina_Bool ipc_serve(void);
37void ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst)); 42void ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst));
38Eina_Bool ipc_instance_add(Ipc_Instance *inst); 43Eina_Bool ipc_instance_add(Ipc_Instance *inst);
44void ipc_instance_conn_free(void);
39 45
40#endif 46#endif
diff --git a/src/bin/main.c b/src/bin/main.c
index b50dbbe..4aabc07 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -27,6 +27,129 @@ Eina_Bool multisense_available = EINA_TRUE;
27static Config *_main_config = NULL; 27static Config *_main_config = NULL;
28 28
29static void 29static void
30_set_instance_theme(Ipc_Instance *inst)
31{
32 char path[PATH_MAX];
33 char theme_name[PATH_MAX];
34 const char *theme_path = (const char *)&path;
35
36 if (!inst->theme)
37 return;
38
39 if (eina_str_has_suffix(inst->theme, ".edj"))
40 eina_strlcpy(theme_name, inst->theme, sizeof(theme_name));
41 else
42 snprintf(theme_name, sizeof(theme_name), "%s.edj", inst->theme);
43
44 if (strchr(theme_name, '/'))
45 eina_strlcpy(path, theme_name, sizeof(path));
46 else
47 theme_path = theme_path_get(theme_name);
48
49 eina_stringshare_replace(&(inst->config->theme), theme_path);
50 inst->config->temporary = EINA_TRUE;
51}
52
53static void
54_configure_instance(Ipc_Instance *inst)
55{
56 Config *config = inst->config;
57
58 _set_instance_theme(inst);
59
60 if (inst->background)
61 {
62 eina_stringshare_replace(&(config->background), inst->background);
63 config->temporary = EINA_TRUE;
64 }
65
66 if (inst->font)
67 {
68 char *p = strchr(inst->font, '/');
69 if (p)
70 {
71 int sz;
72 char *fname = alloca(p - inst->font + 1);
73
74 strncpy(fname, inst->font, p - inst->font);
75 fname[p - inst->font] = '\0';
76 sz = atoi(p+1);
77 if (sz > 0)
78 inst->config->font.size = sz;
79 eina_stringshare_replace(&(inst->config->font.name), fname);
80 inst->config->font.bitmap = EINA_FALSE;
81 }
82 else
83 {
84 char buf[4096], *file;
85 Eina_List *files;
86 int n = strlen(inst->font);
87 Eina_Bool found = EINA_FALSE;
88
89 snprintf(buf, sizeof(buf), "%s/fonts", elm_app_data_dir_get());
90 files = ecore_file_ls(buf);
91 EINA_LIST_FREE(files, file)
92 {
93 if (n > 0)
94 {
95 if (!strncasecmp(file, inst->font, n))
96 {
97 n = -1;
98 eina_stringshare_replace(&(inst->config->font.name), file);
99 inst->config->font.bitmap = EINA_TRUE;
100 found = EINA_TRUE;
101 }
102 }
103 free(file);
104 }
105 if (!found)
106 {
107 ERR("font '%s' not found in %s", inst->font, buf);
108 }
109 }
110 config->font_set = EINA_TRUE;
111 config->temporary = EINA_TRUE;
112 }
113
114 if (inst->login_shell)
115 {
116 inst->config->login_shell = inst->login_shell;
117 inst->config->temporary = EINA_TRUE;
118 }
119 inst->login_shell = inst->config->login_shell;
120
121 if (inst->xterm_256color)
122 {
123 inst->config->xterm_256color = EINA_TRUE;
124 inst->config->temporary = EINA_TRUE;
125 }
126 if (inst->video_mute != 0xff)
127 {
128 config->mute = inst->video_mute;
129 config->temporary = EINA_TRUE;
130 }
131 if (inst->cursor_blink != 0xff)
132 {
133 config->disable_cursor_blink = !inst->cursor_blink;
134 config->temporary = EINA_TRUE;
135 }
136 if (inst->visual_bell != 0xff)
137 {
138 config->disable_visual_bell = !inst->visual_bell;
139 config->temporary = EINA_TRUE;
140 }
141 if (inst->active_links != 0xff)
142 {
143 config->active_links = !!inst->active_links;
144 config->active_links_email = inst->config->active_links;
145 config->active_links_file = inst->config->active_links;
146 config->active_links_url = inst->config->active_links;
147 config->active_links_escape = inst->config->active_links;
148 config->temporary = EINA_TRUE;
149 }
150}
151
152static void
30_check_multisense(void) 153_check_multisense(void)
31{ 154{
32 int enabled; 155 int enabled;
@@ -70,7 +193,7 @@ main_ipc_new(Ipc_Instance *inst)
70 char buf[4096]; 193 char buf[4096];
71 194
72 snprintf(buf, sizeof(buf), "DESKTOP_STARTUP_ID=%s", inst->startup_id); 195 snprintf(buf, sizeof(buf), "DESKTOP_STARTUP_ID=%s", inst->startup_id);
73 putenv(buf); 196 putenv(strdup(buf));
74 } 197 }
75 ecore_app_args_get(&pargc, &pargv); 198 ecore_app_args_get(&pargc, &pargv);
76 nargc = 1; 199 nargc = 1;
@@ -93,7 +216,11 @@ main_ipc_new(Ipc_Instance *inst)
93 if (inst->nowm) nargc += 1; 216 if (inst->nowm) nargc += 1;
94 if (inst->xterm_256color) nargc += 1; 217 if (inst->xterm_256color) nargc += 1;
95 if (inst->active_links) nargc += 1; 218 if (inst->active_links) nargc += 1;
219 if (inst->video_mute) nargc += 1;
220 if (inst->cursor_blink) nargc += 1;
221 if (inst->visual_bell) nargc += 1;
96 if (inst->cmd) nargc += 2; 222 if (inst->cmd) nargc += 2;
223 if (inst->theme) nargc += 2;
97 224
98 nargv = calloc(nargc + 1, sizeof(char *)); 225 nargv = calloc(nargc + 1, sizeof(char *));
99 if (!nargv) return; 226 if (!nargv) return;
@@ -115,6 +242,11 @@ main_ipc_new(Ipc_Instance *inst)
115 nargv[i++] = "-n"; 242 nargv[i++] = "-n";
116 nargv[i++] = (char *)inst->name; 243 nargv[i++] = (char *)inst->name;
117 } 244 }
245 if (inst->theme)
246 {
247 nargv[i++] = "-t";
248 nargv[i++] = (char *)inst->theme;
249 }
118 if (inst->role) 250 if (inst->role)
119 { 251 {
120 nargv[i++] = "-r"; 252 nargv[i++] = "-r";
@@ -232,6 +364,19 @@ main_ipc_new(Ipc_Instance *inst)
232 nargv[i++] = "-e"; 364 nargv[i++] = "-e";
233 nargv[i++] = (char *)inst->cmd; 365 nargv[i++] = (char *)inst->cmd;
234 } 366 }
367 if (inst->video_mute)
368 {
369 nargv[i++] = "-m";
370 }
371 if (inst->cursor_blink)
372 {
373 nargv[i++] = "-c";
374 }
375 if (inst->visual_bell)
376 {
377 nargv[i++] = "-G";
378 }
379
235 380
236 ecore_app_args_set(nargc, (const char **)nargv); 381 ecore_app_args_set(nargc, (const char **)nargv);
237 wn = win_new(inst->name, inst->role, inst->title, inst->icon_name, 382 wn = win_new(inst->name, inst->role, inst->title, inst->icon_name,
@@ -247,60 +392,9 @@ main_ipc_new(Ipc_Instance *inst)
247 392
248 win = win_evas_object_get(wn); 393 win = win_evas_object_get(wn);
249 config = win_config_get(wn); 394 config = win_config_get(wn);
395 inst->config = config;
250 396
251 unsetenv("DESKTOP_STARTUP_ID"); 397 _configure_instance(inst);
252 if (inst->background)
253 {
254 eina_stringshare_replace(&(config->background), inst->background);
255 config->temporary = EINA_TRUE;
256 }
257
258 if (inst->font)
259 {
260 if (strchr(inst->font, '/'))
261 {
262 char *fname = alloca(strlen(inst->font) + 1);
263 char *p;
264
265 strcpy(fname, inst->font);
266 p = strrchr(fname, '/');
267 if (p)
268 {
269 int sz;
270
271 *p = 0;
272 p++;
273 sz = atoi(p);
274 if (sz > 0) config->font.size = sz;
275 eina_stringshare_replace(&(config->font.name), fname);
276 }
277 config->font.bitmap = 0;
278 }
279 else
280 {
281 char buf[4096], *file;
282 Eina_List *files;
283 int n = strlen(inst->font);
284
285 snprintf(buf, sizeof(buf), "%s/fonts", elm_app_data_dir_get());
286 files = ecore_file_ls(buf);
287 EINA_LIST_FREE(files, file)
288 {
289 if (n > 0)
290 {
291 if (!strncasecmp(file, inst->font, n))
292 {
293 n = -1;
294 eina_stringshare_replace(&(config->font.name), file);
295 config->font.bitmap = 1;
296 }
297 }
298 free(file);
299 }
300 }
301 config->font_set = EINA_TRUE;
302 config->temporary = EINA_TRUE;
303 }
304 398
305 if (inst->w <= 0) inst->w = 80; 399 if (inst->w <= 0) inst->w = 80;
306 if (inst->h <= 0) inst->h = 24; 400 if (inst->h <= 0) inst->h = 24;
@@ -337,6 +431,7 @@ main_ipc_new(Ipc_Instance *inst)
337 (ecore_evas_ecore_evas_get(evas_object_evas_get(win)), 1); 431 (ecore_evas_ecore_evas_get(evas_object_evas_get(win)), 1);
338 ecore_app_args_set(pargc, (const char **)pargv); 432 ecore_app_args_set(pargc, (const char **)pargv);
339 free(nargv); 433 free(nargv);
434 unsetenv("DESKTOP_STARTUP_ID");
340} 435}
341 436
342static const char *emotion_choices[] = { 437static const char *emotion_choices[] = {
@@ -468,65 +563,278 @@ _log_void(const Eina_Log_Domain *_d EINA_UNUSED,
468} 563}
469#endif 564#endif
470 565
566static void
567_start(Ipc_Instance *instance)
568{
569 Win *wn;
570 Evas_Object *win;
571 Term *term;
572 Config *config;
573
574 wn = win_new(instance->name, instance->role, instance->title,
575 instance->icon_name, instance->config,
576 instance->fullscreen, instance->iconic, instance->borderless,
577 instance->override, instance->maximized);
578 // set an env so terminal apps can detect they are in terminology :)
579 putenv("TERMINOLOGY=1");
580
581 config_del(instance->config);
582 config = NULL;
583 if (!wn)
584 {
585 CRITICAL(_("Could not create window."));
586 goto exit;
587 }
588
589 config = win_config_get(wn);
590
591 term = term_new(wn, config, instance->cmd, instance->login_shell,
592 instance->cd,
593 instance->w, instance->h, instance->hold, instance->title);
594 if (!term)
595 {
596 CRITICAL(_("Could not create terminal widget."));
597 config = NULL;
598 goto exit;
599 }
600
601 if (win_term_set(wn, term) < 0)
602 {
603 goto exit;
604 }
605
606 main_trans_update(config);
607 main_media_update(config);
608 win_sizing_handle(wn);
609 win = win_evas_object_get(wn);
610 evas_object_show(win);
611 if (instance->startup_split)
612 {
613 unsigned int i = 0;
614 Eina_List *cmds_list = NULL;
615 Term *next = term;
616
617 for (i = 0; i < strlen(instance->startup_split); i++)
618 {
619 char *cmd = NULL;
620
621 if (instance->startup_split[i] == 'v')
622 {
623 cmd = cmds_list ? cmds_list->data : NULL;
624 split_vertically(win_evas_object_get(term_win_get(next)),
625 term_termio_get(next), cmd);
626 cmds_list = eina_list_remove_list(cmds_list, cmds_list);
627 }
628 else if (instance->startup_split[i] == 'h')
629 {
630 cmd = cmds_list ? cmds_list->data : NULL;
631 split_horizontally(win_evas_object_get(term_win_get(next)),
632 term_termio_get(next), cmd);
633 cmds_list = eina_list_remove_list(cmds_list, cmds_list);
634 }
635 else if (instance->startup_split[i] == '-')
636 next = term_next_get(next);
637 else
638 {
639 CRITICAL(_("invalid argument found for option -S/--split."
640 " See --help."));
641 goto end;
642 }
643 }
644 if (cmds_list)
645 eina_list_free(cmds_list);
646 }
647 if (instance->pos)
648 {
649 int screen_w, screen_h;
650
651 elm_win_screen_size_get(win, NULL, NULL, &screen_w, &screen_h);
652 if (instance->x < 0) instance->x = screen_w + instance->x;
653 if (instance->y < 0) instance->y = screen_h + instance->y;
654 evas_object_move(win, instance->x, instance->y);
655 }
656 if (instance->nowm)
657 ecore_evas_focus_set(ecore_evas_ecore_evas_get(
658 evas_object_evas_get(win)), 1);
659
660 controls_init();
661
662 win_scale_wizard(win, term);
663
664 terminology_starting_up = EINA_FALSE;
665
666
667end:
668 return;
669exit:
670 ecore_main_loop_quit();
671}
672
673struct Instance_Add {
674 Ipc_Instance *instance;
675 char **argv;
676 Eina_Bool result;
677 Eina_Bool timedout;
678 Eina_Bool done;
679 pthread_mutex_t lock;
680};
681
682static void
683_instance_add_free(struct Instance_Add *add)
684{
685 if (!add)
686 return;
687
688 pthread_mutex_destroy(&add->lock);
689 free(add);
690}
691
692
693static void *
694_instance_sleep(void *data)
695{
696 struct Instance_Add *add = data;
697 Eina_Bool timedout = EINA_FALSE;
698
699 sleep(2);
700 pthread_mutex_lock(&add->lock);
701 if (!add->done)
702 timedout = add->timedout = EINA_TRUE;
703 pthread_mutex_unlock(&add->lock);
704 if (timedout)
705 {
706 /* ok, we waited 2 seconds without any answer,
707 * remove the unix socket and restart terminology from scratch in a
708 * better state */
709 ipc_instance_conn_free();
710 errno = 0;
711 execv(add->argv[0], add->argv);
712 ERR("execv failed on '%s': %s", add->argv[0], strerror(errno));
713 }
714 else
715 {
716 _instance_add_free(add);
717 }
718
719 return NULL;
720}
721
722static Eina_Bool
723_instance_add_waiter(Ipc_Instance *instance,
724 char **argv)
725{
726 struct Instance_Add *add;
727 Eina_Bool timedout = EINA_FALSE;
728 Eina_Bool result = EINA_TRUE;
729 pthread_t thr;
730
731 add = calloc(1, sizeof(*add));
732 if (!add)
733 return EINA_FALSE;
734
735 add->instance = instance;
736 add->argv = argv;
737 pthread_mutex_init(&add->lock, NULL);
738
739 pthread_create(&thr, NULL, &_instance_sleep, add);
740
741 /* If the unix socket is stalled, this might block */
742 result = ipc_instance_add(add->instance);
743 pthread_mutex_lock(&add->lock);
744 /* Hoora, it did not block! */
745 add->done = EINA_TRUE;
746 if (add->timedout)
747 {
748 timedout = add->timedout = EINA_TRUE;
749 result = EINA_FALSE;
750 }
751 pthread_mutex_unlock(&add->lock);
752 if (timedout)
753 _instance_add_free(add);
754
755 return result;
756}
757
758static Eina_Bool
759_start_multi(Ipc_Instance *instance,
760 char **argv)
761{
762 int remote_try = 0;
763 do
764 {
765 if (_instance_add_waiter(instance, argv))
766 {
767 goto exit;
768 }
769 /* Could not start a new window remotely,
770 * let's start our own server */
771 ipc_instance_new_func_set(main_ipc_new);
772 if (ipc_serve())
773 {
774 goto normal_start;
775 }
776 else
777 {
778 DBG("IPC server: failure");
779 }
780 remote_try++;
781 }
782 while (remote_try <= 1);
783
784normal_start:
785 _start(instance);
786 return EINA_FALSE;
787
788exit:
789 return EINA_TRUE;
790}
791
471EAPI_MAIN int 792EAPI_MAIN int
472elm_main(int argc, char **argv) 793elm_main(int argc, char **argv)
473{ 794{
474 char *cmd = NULL;
475 char *cd = NULL;
476 char *theme = NULL;
477 char *background = NULL;
478 char *geometry = NULL; 795 char *geometry = NULL;
479 char *name = NULL;
480 char *role = NULL;
481 char *title = NULL;
482 char *icon_name = NULL;
483 char *font = NULL;
484 char *startup_split = NULL;
485 char *video_module = NULL; 796 char *video_module = NULL;
486 Eina_Bool login_shell = 0xff; /* unset */
487 Eina_Bool video_mute = 0xff; /* unset */
488 Eina_Bool cursor_blink = 0xff; /* unset */
489 Eina_Bool visual_bell = 0xff; /* unset */
490 Eina_Bool active_links = 0xff; /* unset */
491 Eina_Bool fullscreen = EINA_FALSE;
492 Eina_Bool iconic = EINA_FALSE;
493 Eina_Bool borderless = EINA_FALSE;
494 Eina_Bool override = EINA_FALSE;
495 Eina_Bool maximized = EINA_FALSE;
496 Eina_Bool nowm = EINA_FALSE;
497 Eina_Bool quit_option = EINA_FALSE; 797 Eina_Bool quit_option = EINA_FALSE;
498 Eina_Bool hold = EINA_FALSE;
499 Eina_Bool single = EINA_FALSE; 798 Eina_Bool single = EINA_FALSE;
500 Eina_Bool cmd_options = EINA_FALSE; 799 Eina_Bool cmd_options = EINA_FALSE;
501 Eina_Bool xterm_256color = EINA_FALSE; 800 Ipc_Instance instance = {
801 .login_shell = 0xff, /* unset */
802 .active_links = 0xff, /* unset */
803 .video_mute = 0xff, /* unset */
804 .cursor_blink = 0xff, /* unset */
805 .visual_bell = 0xff, /* unset */
806 .startup_id = getenv("DESKTOP_STARTUP_ID"),
807 .w = 1,
808 .h = 1,
809 };
502 Ecore_Getopt_Value values[] = { 810 Ecore_Getopt_Value values[] = {
503 ECORE_GETOPT_VALUE_BOOL(cmd_options), 811 ECORE_GETOPT_VALUE_BOOL(cmd_options),
504 ECORE_GETOPT_VALUE_STR(cd), 812 ECORE_GETOPT_VALUE_STR(instance.cd),
505 ECORE_GETOPT_VALUE_STR(theme), 813 ECORE_GETOPT_VALUE_STR(instance.theme),
506 ECORE_GETOPT_VALUE_STR(background), 814 ECORE_GETOPT_VALUE_STR(instance.background),
507 ECORE_GETOPT_VALUE_STR(geometry), 815 ECORE_GETOPT_VALUE_STR(geometry),
508 ECORE_GETOPT_VALUE_STR(name), 816 ECORE_GETOPT_VALUE_STR(instance.name),
509 ECORE_GETOPT_VALUE_STR(role), 817 ECORE_GETOPT_VALUE_STR(instance.role),
510 ECORE_GETOPT_VALUE_STR(title), 818 ECORE_GETOPT_VALUE_STR(instance.title),
511 ECORE_GETOPT_VALUE_STR(icon_name), 819 ECORE_GETOPT_VALUE_STR(instance.icon_name),
512 ECORE_GETOPT_VALUE_STR(font), 820 ECORE_GETOPT_VALUE_STR(instance.font),
513 ECORE_GETOPT_VALUE_STR(startup_split), 821 ECORE_GETOPT_VALUE_STR(instance.startup_split),
514 ECORE_GETOPT_VALUE_STR(video_module), 822 ECORE_GETOPT_VALUE_STR(video_module),
515 823
516 ECORE_GETOPT_VALUE_BOOL(login_shell), 824 ECORE_GETOPT_VALUE_BOOL(instance.login_shell),
517 ECORE_GETOPT_VALUE_BOOL(video_mute), 825 ECORE_GETOPT_VALUE_BOOL(instance.video_mute),
518 ECORE_GETOPT_VALUE_BOOL(cursor_blink), 826 ECORE_GETOPT_VALUE_BOOL(instance.cursor_blink),
519 ECORE_GETOPT_VALUE_BOOL(visual_bell), 827 ECORE_GETOPT_VALUE_BOOL(instance.visual_bell),
520 ECORE_GETOPT_VALUE_BOOL(fullscreen), 828 ECORE_GETOPT_VALUE_BOOL(instance.fullscreen),
521 ECORE_GETOPT_VALUE_BOOL(iconic), 829 ECORE_GETOPT_VALUE_BOOL(instance.iconic),
522 ECORE_GETOPT_VALUE_BOOL(borderless), 830 ECORE_GETOPT_VALUE_BOOL(instance.borderless),
523 ECORE_GETOPT_VALUE_BOOL(override), 831 ECORE_GETOPT_VALUE_BOOL(instance.override),
524 ECORE_GETOPT_VALUE_BOOL(maximized), 832 ECORE_GETOPT_VALUE_BOOL(instance.maximized),
525 ECORE_GETOPT_VALUE_BOOL(nowm), 833 ECORE_GETOPT_VALUE_BOOL(instance.nowm),
526 ECORE_GETOPT_VALUE_BOOL(hold), 834 ECORE_GETOPT_VALUE_BOOL(instance.hold),
527 ECORE_GETOPT_VALUE_BOOL(single), 835 ECORE_GETOPT_VALUE_BOOL(single),
528 ECORE_GETOPT_VALUE_BOOL(xterm_256color), 836 ECORE_GETOPT_VALUE_BOOL(instance.xterm_256color),
529 ECORE_GETOPT_VALUE_BOOL(active_links), 837 ECORE_GETOPT_VALUE_BOOL(instance.active_links),
530 838
531 ECORE_GETOPT_VALUE_BOOL(quit_option), 839 ECORE_GETOPT_VALUE_BOOL(quit_option),
532 ECORE_GETOPT_VALUE_BOOL(quit_option), 840 ECORE_GETOPT_VALUE_BOOL(quit_option),
@@ -535,16 +843,8 @@ elm_main(int argc, char **argv)
535 843
536 ECORE_GETOPT_VALUE_NONE 844 ECORE_GETOPT_VALUE_NONE
537 }; 845 };
538 Win *wn;
539 Term *term;
540 Config *config = NULL;
541 Evas_Object *win;
542 int args, retval = EXIT_SUCCESS; 846 int args, retval = EXIT_SUCCESS;
543 int remote_try = 0; 847 Eina_Bool size_set = EINA_FALSE;
544 int pos_set = 0, size_set = 0;
545 int pos_x = 0, pos_y = 0;
546 int size_w = 1, size_h = 1;
547 Eina_List *cmds_list = NULL;
548 848
549 terminology_starting_up = EINA_TRUE; 849 terminology_starting_up = EINA_TRUE;
550 850
@@ -590,9 +890,12 @@ elm_main(int argc, char **argv)
590 goto end; 890 goto end;
591 } 891 }
592 892
893 ecore_con_init();
894 ecore_con_url_init();
895
593 ipc_init(); 896 ipc_init();
594 897
595 config = config_fork(_main_config); 898 instance.config = config_fork(_main_config);
596 899
597 args = ecore_getopt_parse(&options, values, argc, argv); 900 args = ecore_getopt_parse(&options, values, argc, argv);
598 if (args < 0) 901 if (args < 0)
@@ -606,6 +909,7 @@ elm_main(int argc, char **argv)
606 909
607 if (cmd_options) 910 if (cmd_options)
608 { 911 {
912 Eina_List *cmds_list = NULL;
609 int i; 913 int i;
610 914
611 if (args == argc) 915 if (args == argc)
@@ -615,11 +919,11 @@ elm_main(int argc, char **argv)
615 goto end; 919 goto end;
616 } 920 }
617 921
618 if (startup_split) 922 if (instance.startup_split)
619 { 923 {
620 for(i = args+1; i < argc; i++) 924 for(i = args+1; i < argc; i++)
621 cmds_list = eina_list_append(cmds_list, argv[i]); 925 cmds_list = eina_list_append(cmds_list, argv[i]);
622 cmd = argv[args]; 926 instance.cmd = argv[args];
623 } 927 }
624 else 928 else
625 { 929 {
@@ -631,86 +935,15 @@ elm_main(int argc, char **argv)
631 eina_strbuf_append_char(strb, ' '); 935 eina_strbuf_append_char(strb, ' ');
632 eina_strbuf_append(strb, argv[i]); 936 eina_strbuf_append(strb, argv[i]);
633 } 937 }
634 cmd = eina_strbuf_string_steal(strb); 938 instance.cmd = eina_strbuf_string_steal(strb);
635 eina_strbuf_free(strb); 939 eina_strbuf_free(strb);
636 } 940 }
637 } 941 }
638 942
639 _check_multisense(); 943 _check_multisense();
640 944
641 if (theme) 945 _configure_instance(&instance);
642 {
643 char path[PATH_MAX];
644 char theme_name[PATH_MAX];
645 const char *theme_path = (const char *)&path;
646
647 if (eina_str_has_suffix(theme, ".edj"))
648 eina_strlcpy(theme_name, theme, sizeof(theme_name));
649 else
650 snprintf(theme_name, sizeof(theme_name), "%s.edj", theme);
651
652 if (strchr(theme_name, '/'))
653 eina_strlcpy(path, theme_name, sizeof(path));
654 else
655 theme_path = theme_path_get(theme_name);
656 946
657 eina_stringshare_replace(&(config->theme), theme_path);
658 config->temporary = EINA_TRUE;
659 }
660
661 if (background)
662 {
663 eina_stringshare_replace(&(config->background), background);
664 config->temporary = EINA_TRUE;
665 }
666
667 if (font)
668 {
669 char *p = strchr(font, '/');
670 if (p)
671 {
672 int sz;
673 char *fname = alloca(p - font + 1);
674
675 strncpy(fname, font, p - font);
676 fname[p - font] = '\0';
677 sz = atoi(p+1);
678 if (sz > 0) config->font.size = sz;
679 eina_stringshare_replace(&(config->font.name), fname);
680 config->font.bitmap = 0;
681 config->font_set = 1;
682 }
683 else
684 {
685 char buf[4096], *file;
686 Eina_List *files;
687 int n = strlen(font);
688 Eina_Bool found = EINA_FALSE;
689
690 snprintf(buf, sizeof(buf), "%s/fonts", elm_app_data_dir_get());
691 files = ecore_file_ls(buf);
692 EINA_LIST_FREE(files, file)
693 {
694 if (n > 0)
695 {
696 if (!strncasecmp(file, font, n))
697 {
698 n = -1;
699 eina_stringshare_replace(&(config->font.name), file);
700 config->font.bitmap = 1;
701 config->font_set = 1;
702 found = EINA_TRUE;
703 }
704 }
705 free(file);
706 }
707 if (!found)
708 {
709 ERR("font '%s' not found in %s", font, buf);
710 }
711 }
712 config->temporary = EINA_TRUE;
713 }
714 947
715 if (video_module) 948 if (video_module)
716 { 949 {
@@ -723,270 +956,109 @@ elm_main(int argc, char **argv)
723 956
724 if (i == EINA_C_ARRAY_LENGTH(emotion_choices)) 957 if (i == EINA_C_ARRAY_LENGTH(emotion_choices))
725 i = 0; /* ecore getopt shouldn't let this happen, but... */ 958 i = 0; /* ecore getopt shouldn't let this happen, but... */
726 config->vidmod = i; 959 instance.config->vidmod = i;
727 config->temporary = EINA_TRUE; 960 instance.config->temporary = EINA_TRUE;
728 } 961 }
729 962
730 if (video_mute != 0xff)
731 {
732 config->mute = video_mute;
733 config->temporary = EINA_TRUE;
734 }
735 if (cursor_blink != 0xff)
736 {
737 config->disable_cursor_blink = !cursor_blink;
738 config->temporary = EINA_TRUE;
739 }
740 if (visual_bell != 0xff)
741 {
742 config->disable_visual_bell = !visual_bell;
743 config->temporary = EINA_TRUE;
744 }
745 if (active_links != 0xff)
746 {
747 config->active_links = !!active_links;
748 config->active_links_email = config->active_links;
749 config->active_links_file = config->active_links;
750 config->active_links_url = config->active_links;
751 config->active_links_escape = config->active_links;
752 config->temporary = EINA_TRUE;
753 }
754
755 if (xterm_256color)
756 {
757 config->xterm_256color = EINA_TRUE;
758 config->temporary = EINA_TRUE;
759 }
760 963
761 if (geometry) 964 if (geometry)
762 { 965 {
763 if (sscanf(geometry,"%ix%i+%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 966 if (sscanf(geometry,"%ix%i+%i+%i", &instance.w, &instance.h,
967 &instance.x, &instance.y) == 4)
764 { 968 {
765 pos_set = 1; 969 instance.pos = EINA_TRUE;
766 size_set = 1; 970 size_set = EINA_TRUE;
767 } 971 }
768 else if (sscanf(geometry,"%ix%i-%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 972 else if (sscanf(geometry,"%ix%i-%i+%i", &instance.w, &instance.h,
973 &instance.x, &instance.y) == 4)
769 { 974 {
770 pos_x = -pos_x; 975 instance.x = -instance.x;
771 pos_set = 1; 976 instance.pos = EINA_TRUE;
772 size_set = 1; 977 size_set = EINA_TRUE;
773 } 978 }
774 else if (sscanf(geometry,"%ix%i-%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 979 else if (sscanf(geometry,"%ix%i-%i-%i", &instance.w, &instance.h,
980 &instance.x, &instance.y) == 4)
775 { 981 {
776 pos_x = -pos_x; 982 instance.x = -instance.x;
777 pos_y = -pos_y; 983 instance.y = -instance.y;
778 pos_set = 1; 984 instance.pos = EINA_TRUE;
779 size_set = 1; 985 size_set = EINA_TRUE;
780 } 986 }
781 else if (sscanf(geometry,"%ix%i+%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 987 else if (sscanf(geometry,"%ix%i+%i-%i", &instance.w, &instance.h,
988 &instance.x, &instance.y) == 4)
782 { 989 {
783 pos_y = -pos_y; 990 instance.y = -instance.y;
784 pos_set = 1; 991 instance.pos = EINA_TRUE;
785 size_set = 1; 992 size_set = EINA_TRUE;
786 } 993 }
787 else if (sscanf(geometry,"%ix%i", &size_w, &size_h) == 2) 994 else if (sscanf(geometry,"%ix%i", &instance.w, &instance.h) == 2)
788 { 995 {
789 size_set = 1; 996 size_set = EINA_TRUE;
790 } 997 }
791 else if (sscanf(geometry,"+%i+%i", &pos_x, &pos_y) == 2) 998 else if (sscanf(geometry,"+%i+%i", &instance.x, &instance.y) == 2)
792 { 999 {
793 pos_set = 1; 1000 instance.pos = EINA_TRUE;
794 } 1001 }
795 else if (sscanf(geometry,"-%i+%i", &pos_x, &pos_y) == 2) 1002 else if (sscanf(geometry,"-%i+%i", &instance.x, &instance.y) == 2)
796 { 1003 {
797 pos_x = -pos_x; 1004 instance.x = -instance.x;
798 pos_set = 1; 1005 instance.pos = EINA_TRUE;
799 } 1006 }
800 else if (sscanf(geometry,"+%i-%i", &pos_x, &pos_y) == 2) 1007 else if (sscanf(geometry,"+%i-%i", &instance.x, &instance.y) == 2)
801 { 1008 {
802 pos_y = -pos_y; 1009 instance.y = -instance.y;
803 pos_set = 1; 1010 instance.pos = EINA_TRUE;
804 } 1011 }
805 else if (sscanf(geometry,"-%i-%i", &pos_x, &pos_y) == 2) 1012 else if (sscanf(geometry,"-%i-%i", &instance.x, &instance.y) == 2)
806 { 1013 {
807 pos_x = -pos_x; 1014 instance.x = -instance.x;
808 pos_y = -pos_y; 1015 instance.y = -instance.y;
809 pos_set = 1; 1016 instance.pos = EINA_TRUE;
810 } 1017 }
811 } 1018 }
812 1019
813 if (!size_set) 1020 if (!size_set)
814 { 1021 {
815 if (config->custom_geometry) 1022 if (instance.config->custom_geometry)
816 { 1023 {
817 size_w = config->cg_width; 1024 instance.w = instance.config->cg_width;
818 size_h = config->cg_height; 1025 instance.h = instance.config->cg_height;
819 } 1026 }
820 else 1027 else
821 { 1028 {
822 size_w = 80; 1029 instance.w = 80;
823 size_h = 24; 1030 instance.h = 24;
824 } 1031 }
825 } 1032 }
826 1033
827 if (login_shell != 0xff) 1034 elm_theme_overlay_add(NULL,
828 { 1035 config_theme_path_default_get(instance.config));
829 config->login_shell = login_shell; 1036 elm_theme_overlay_add(NULL, config_theme_path_get(instance.config));
830 config->temporary = EINA_TRUE;
831 }
832 login_shell = config->login_shell;
833
834 elm_theme_overlay_add(NULL, config_theme_path_default_get(config));
835 elm_theme_overlay_add(NULL, config_theme_path_get(config));
836 1037
837remote: 1038 if ((!single) && (instance.config->multi_instance))
838 if ((!single) && (config->multi_instance))
839 { 1039 {
840 Ipc_Instance inst;
841 char cwdbuf[4096]; 1040 char cwdbuf[4096];
842 1041
843 memset(&inst, 0, sizeof(Ipc_Instance)); 1042 if (!instance.cd)
844 1043 instance.cd = getcwd(cwdbuf, sizeof(cwdbuf));
845 inst.cmd = cmd; 1044 if (_start_multi(&instance, argv))
846 if (cd) inst.cd = cd;
847 else inst.cd = getcwd(cwdbuf, sizeof(cwdbuf));
848 inst.background = background;
849 inst.name = name;
850 inst.role = role;
851 inst.title = title;
852 inst.icon_name = icon_name;
853 inst.font = font;
854 inst.startup_id = getenv("DESKTOP_STARTUP_ID");
855 inst.x = pos_x;
856 inst.y = pos_y;
857 inst.w = size_w;
858 inst.h = size_h;
859 inst.pos = pos_set;
860 inst.login_shell = login_shell;
861 inst.fullscreen = fullscreen;
862 inst.iconic = iconic;
863 inst.borderless = borderless;
864 inst.override = override;
865 inst.maximized = maximized;
866 inst.hold = hold;
867 inst.nowm = nowm;
868 inst.startup_split = startup_split;
869 if (ipc_instance_add(&inst))
870 goto end; 1045 goto end;
871 } 1046 }
872 if ((!single) && (config->multi_instance)) 1047 else
873 {
874 ipc_instance_new_func_set(main_ipc_new);
875 if (!ipc_serve())
876 {
877 if (remote_try < 1)
878 {
879 remote_try++;
880 goto remote;
881 }
882 }
883 }
884
885 wn = win_new(name, role, title, icon_name, config,
886 fullscreen, iconic, borderless, override, maximized);
887 // set an env so terminal apps can detect they are in terminology :)
888 putenv("TERMINOLOGY=1");
889 unsetenv("DESKTOP_STARTUP_ID");
890
891 config_del(config);
892 config = NULL;
893 if (!wn)
894 {
895 CRITICAL(_("Could not create window."));
896 retval = EXIT_FAILURE;
897 goto end;
898 }
899
900 config = win_config_get(wn);
901
902 term = term_new(wn, config, cmd, login_shell, cd,
903 size_w, size_h, hold, title);
904 if (!term)
905 { 1048 {
906 CRITICAL(_("Could not create terminal widget.")); 1049 _start(&instance);
907 config = NULL;
908 retval = EXIT_FAILURE;
909 goto end;
910 }
911
912 if (win_term_set(wn, term) < 0)
913 {
914 retval = EXIT_FAILURE;
915 goto end;
916 } 1050 }
917
918 main_trans_update(config);
919 main_media_update(config);
920 win_sizing_handle(wn);
921 win = win_evas_object_get(wn);
922 evas_object_show(win);
923 if (startup_split)
924 {
925 unsigned int i = 0;
926 Term *next = term;
927
928 for (i = 0; i < strlen(startup_split); i++)
929 {
930 if (startup_split[i] == 'v')
931 {
932 cmd = cmds_list ? cmds_list->data : NULL;
933 split_vertically(win_evas_object_get(term_win_get(next)),
934 term_termio_get(next), cmd);
935 cmds_list = eina_list_remove_list(cmds_list, cmds_list);
936 }
937 else if (startup_split[i] == 'h')
938 {
939 cmd = cmds_list ? cmds_list->data : NULL;
940 split_horizontally(win_evas_object_get(term_win_get(next)),
941 term_termio_get(next), cmd);
942 cmds_list = eina_list_remove_list(cmds_list, cmds_list);
943 }
944 else if (startup_split[i] == '-')
945 next = term_next_get(next);
946 else
947 {
948 CRITICAL(_("invalid argument found for option -S/--split."
949 " See --help."));
950 goto end;
951 }
952 }
953 if (cmds_list)
954 eina_list_free(cmds_list);
955 }
956 if (pos_set)
957 {
958 int screen_w, screen_h;
959
960 elm_win_screen_size_get(win, NULL, NULL, &screen_w, &screen_h);
961 if (pos_x < 0) pos_x = screen_w + pos_x;
962 if (pos_y < 0) pos_y = screen_h + pos_y;
963 evas_object_move(win, pos_x, pos_y);
964 }
965 if (nowm)
966 ecore_evas_focus_set(ecore_evas_ecore_evas_get(
967 evas_object_evas_get(win)), 1);
968
969 ecore_con_init();
970 ecore_con_url_init();
971
972 controls_init();
973
974 win_scale_wizard(win, term);
975
976 terminology_starting_up = EINA_FALSE;
977
978 elm_run(); 1051 elm_run();
979 1052
980 ecore_con_url_shutdown(); 1053 ecore_con_url_shutdown();
981 ecore_con_shutdown(); 1054 ecore_con_shutdown();
982 1055
983 config = NULL; 1056 instance.config = NULL;
984 end: 1057 end:
985 if (!startup_split) free(cmd); 1058 if (instance.config)
986 if (config)
987 { 1059 {
988 config_del(config); 1060 config_del(instance.config);
989 config = NULL; 1061 instance.config = NULL;
990 } 1062 }
991 1063
992 ipc_shutdown(); 1064 ipc_shutdown();
diff --git a/src/bin/media.c b/src/bin/media.c
index b43eadc..28bfd2b 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -1248,7 +1248,6 @@ media_add(Evas_Object *parent, const char *src, const Config *config, int mode,
1248 if (!_smart) _smart_init(); 1248 if (!_smart) _smart_init();
1249 obj = evas_object_smart_add(e, _smart); 1249 obj = evas_object_smart_add(e, _smart);
1250 sd = evas_object_smart_data_get(obj); 1250 sd = evas_object_smart_data_get(obj);
1251 if (!sd) return obj;
1252 1251
1253 sd->src = eina_stringshare_add(src); 1252 sd->src = eina_stringshare_add(src);
1254 sd->config = config; 1253 sd->config = config;
diff --git a/src/bin/win.c b/src/bin/win.c
index b155676..05fdd34 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -3324,6 +3324,7 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3324 3324
3325 l = _tab_item_find(tabs, child); 3325 l = _tab_item_find(tabs, child);
3326 item = l->data; 3326 item = l->data;
3327 tabs->tabs = eina_list_remove_list(tabs->tabs, l);
3327 3328
3328 next = eina_list_next(l); 3329 next = eina_list_next(l);
3329 if (!next) 3330 if (!next)
@@ -3331,7 +3332,6 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3331 next_item = next->data; 3332 next_item = next->data;
3332 next_child = next_item->tc; 3333 next_child = next_item->tc;
3333 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO); 3334 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO);
3334 tabs->tabs = eina_list_remove_list(tabs->tabs, l);
3335 3335
3336 assert (child->type == TERM_CONTAINER_TYPE_SOLO); 3336 assert (child->type == TERM_CONTAINER_TYPE_SOLO);
3337 solo = (Solo*)child; 3337 solo = (Solo*)child;
@@ -6060,11 +6060,11 @@ win_font_update(Term *term)
6060void 6060void
6061windows_free(void) 6061windows_free(void)
6062{ 6062{
6063 Eina_List *l, *l_next;
6063 Win *wn; 6064 Win *wn;
6064 6065
6065 while (wins) 6066 EINA_LIST_FOREACH_SAFE(wins, l, l_next, wn)
6066 { 6067 {
6067 wn = eina_list_data_get(wins);
6068 win_free(wn); 6068 win_free(wn);
6069 } 6069 }
6070 6070