summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/win.c60
1 files changed, 36 insertions, 24 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 09c6bc4..a71c230 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -4086,6 +4086,20 @@ _cb_media_loop(void *data,
4086} 4086}
4087 4087
4088static void 4088static void
4089_popmedia_queue_free(Term *term)
4090{
4091 struct Pop_Media *pm;
4092 if (!term->popmedia_queue)
4093 return;
4094
4095 EINA_LIST_FREE(term->popmedia_queue, pm)
4096 {
4097 eina_stringshare_del(pm->src);
4098 free(pm);
4099 }
4100}
4101
4102static void
4089_popmedia_queue_add(Term *term, const char *src, 4103_popmedia_queue_add(Term *term, const char *src,
4090 Eina_Bool from_user_interaction) 4104 Eina_Bool from_user_interaction)
4091{ 4105{
@@ -4102,6 +4116,22 @@ _popmedia_queue_add(Term *term, const char *src,
4102 _popmedia_queue_process(term); 4116 _popmedia_queue_process(term);
4103} 4117}
4104 4118
4119static void
4120_popmedia_now(Term *term, const char *src,
4121 Eina_Bool from_user_interaction)
4122{
4123 struct Pop_Media *pm;
4124
4125 /* Flush queue */
4126 EINA_LIST_FREE(term->popmedia_queue, pm)
4127 {
4128 eina_stringshare_del(pm->src);
4129 }
4130 edje_object_signal_emit(term->bg, "popmedia,off", "terminology");
4131
4132 _popmedia_queue_add(term, src, from_user_interaction);
4133}
4134
4105 4135
4106static void 4136static void
4107_popmedia_show(Term *term, const char *src, Media_Type type) 4137_popmedia_show(Term *term, const char *src, Media_Type type)
@@ -4109,21 +4139,8 @@ _popmedia_show(Term *term, const char *src, Media_Type type)
4109 Evas_Object *o; 4139 Evas_Object *o;
4110 Config *config = termio_config_get(term->termio); 4140 Config *config = termio_config_get(term->termio);
4111 4141
4142 assert(!term->popmedia);
4112 EINA_SAFETY_ON_NULL_RETURN(config); 4143 EINA_SAFETY_ON_NULL_RETURN(config);
4113 if (term->popmedia)
4114 {
4115 struct Pop_Media *pm;
4116
4117 /* Flush queue */
4118 EINA_LIST_FREE(term->popmedia_queue, pm)
4119 {
4120 eina_stringshare_del(pm->src);
4121 }
4122 /* queue new item */
4123 _popmedia_queue_add(term, src, EINA_FALSE);
4124 edje_object_signal_emit(term->bg, "popmedia,off", "terminology");
4125 return;
4126 }
4127 termio_mouseover_suspend_pushpop(term->termio, 1); 4144 termio_mouseover_suspend_pushpop(term->termio, 1);
4128 term->popmedia = o = media_add(win_evas_object_get(term->wn), 4145 term->popmedia = o = media_add(win_evas_object_get(term->wn),
4129 src, config, MEDIA_POP, type); 4146 src, config, MEDIA_POP, type);
@@ -4268,7 +4285,7 @@ error:
4268#endif 4285#endif
4269 4286
4270static void 4287static void
4271_popmedia(Term *term, const char *src, Eina_Bool from_user_interaction) 4288_popmedia_unknown(Term *term, const char *src, Eina_Bool from_user_interaction)
4272{ 4289{
4273 Media_Type type; 4290 Media_Type type;
4274 Config *config = termio_config_get(term->termio); 4291 Config *config = termio_config_get(term->termio);
@@ -4337,7 +4354,7 @@ _popmedia_queue_process(Term *term)
4337 term->popmedia_queue); 4354 term->popmedia_queue);
4338 if (!pm) 4355 if (!pm)
4339 return; 4356 return;
4340 _popmedia(term, pm->src, pm->from_user_interaction); 4357 _popmedia_unknown(term, pm->src, pm->from_user_interaction);
4341 eina_stringshare_del(pm->src); 4358 eina_stringshare_del(pm->src);
4342 free(pm); 4359 free(pm);
4343} 4360}
@@ -4359,7 +4376,7 @@ _cb_popup(void *data,
4359 } 4376 }
4360 if (!src) 4377 if (!src)
4361 return; 4378 return;
4362 _popmedia(term, src, from_user_interaction); 4379 _popmedia_unknown(term, src, from_user_interaction);
4363 if (!event) 4380 if (!event)
4364 free((void*)src); 4381 free((void*)src);
4365} 4382}
@@ -5100,7 +5117,7 @@ _cb_command(void *data,
5100 { 5117 {
5101 if (cmd[1] == 'n') // now 5118 if (cmd[1] == 'n') // now
5102 { 5119 {
5103 _popmedia(term, cmd + 2, EINA_FALSE); 5120 _popmedia_now(term, cmd + 2, EINA_FALSE);
5104 } 5121 }
5105 else if (cmd[1] == 'q') // queue it to display after current one 5122 else if (cmd[1] == 'q') // queue it to display after current one
5106 { 5123 {
@@ -5586,8 +5603,6 @@ main_config_sync(const Config *config)
5586static void 5603static void
5587_term_free(Term *term) 5604_term_free(Term *term)
5588{ 5605{
5589 const char *s;
5590
5591 if (term->sendfile_request) 5606 if (term->sendfile_request)
5592 { 5607 {
5593 evas_object_del(term->sendfile_request); 5608 evas_object_del(term->sendfile_request);
@@ -5613,10 +5628,7 @@ _term_free(Term *term)
5613 eina_stringshare_del(term->sendfile_dir); 5628 eina_stringshare_del(term->sendfile_dir);
5614 term->sendfile_dir = NULL; 5629 term->sendfile_dir = NULL;
5615 } 5630 }
5616 EINA_LIST_FREE(term->popmedia_queue, s) 5631 _popmedia_queue_free(term);
5617 {
5618 eina_stringshare_del(s);
5619 }
5620 if (term->media) 5632 if (term->media)
5621 { 5633 {
5622 evas_object_event_callback_del(term->media, 5634 evas_object_event_callback_del(term->media,