fix up artiifacts in tab selector zoom.

fix up video./audio restart in sel by not duplicating (instead add 1 edje obj
level in between and include bg with term. may affect other themes).
devs/lucas/wip
Carsten Haitzler 11 years ago
parent cf088606b2
commit 5444820f19
  1. 2
      .gitignore
  2. 408
      data/themes/default.edc
  3. 3
      src/bin/col.c
  4. 158
      src/bin/main.c
  5. 88
      src/bin/sel.c

2
.gitignore vendored

@ -57,3 +57,5 @@
/src/bin/tyq
/src/bin/*_generated.c
/src/bin/*_generated.h
/man/Makefile
/man/Makefile.in

@ -2,46 +2,10 @@ collections {
//////////////////////////////////////////////////////////////////////////////
//// the background and general container for the terminal
group { name: "terminology/background";
images {
image: "bg_bevel.png" COMP;
image: "bg_shine.png" COMP;
image: "bg_glint.png" COMP;
image: "bg_glow_in.png" COMP;
image: "bg_shadow.png" COMP;
image: "bg_led_glow.png" COMP;
image: "bg_led_base.png" COMP;
image: "bg_led.png" COMP;
image: "bg_led_strobe.png" COMP;
image: "pm_shadow.png" COMP;
image: "pm_overlay.png" COMP;
image: "pm_fill.png" COMP;
}
group { name: "terminology/core";
parts {
////////////////////////////////////////////////////////////////////
// background handling
part { name: "shadow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "bg_shadow.png";
fill.smooth: 0;
visible: 0;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "base"; type: RECT;
mouse_events: 1;
description { state: "default" 0.0;
color: 32 32 32 255;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "fade"; type: RECT;
description { state: "default" 0.0;
}
@ -50,6 +14,16 @@ collections {
color: 255 255 255 128;
}
}
program {
signal: "translucent,on"; source: "terminology";
action: STATE_SET "translucent" 0.0;
target: "fade";
}
program {
signal: "translucent,off"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "fade";
}
part { name: "terminology.background"; type: SWALLOW;
clip_to: "fade";
description { state: "default" 0.0;
@ -67,49 +41,28 @@ collections {
inherit: "default" 0.0;
}
}
program { name: "trans_on";
signal: "translucent,on";
source: "terminology";
action: STATE_SET "translucent" 0.0;
target: "base";
target: "shadow";
target: "fade";
}
program { name: "trans_off";
signal: "translucent,off";
source: "terminology";
action: STATE_SET "default" 0.0;
target: "base";
target: "shadow";
target: "fade";
}
program { name: "media_off";
signal: "media,off";
source: "terminology";
program {
signal: "media,off"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "terminology.background";
}
program { name: "media_img";
signal: "media,image";
source: "terminology";
program {
signal: "media,image"; source: "terminology";
action: STATE_SET "image" 0.0;
target: "terminology.background";
}
program { name: "media_scale";
signal: "media,scale";
source: "terminology";
program {
signal: "media,scale"; source: "terminology";
action: STATE_SET "scale" 0.0;
target: "terminology.background";
}
program { name: "media_edje";
signal: "media,edje";
source: "terminology";
program {
signal: "media,edje"; source: "terminology";
action: STATE_SET "edje" 0.0;
target: "terminology.background";
}
program { name: "media_mov";
signal: "media,movie";
source: "terminology";
program {
signal: "media,movie"; source: "terminology";
action: STATE_SET "movie" 0.0;
target: "terminology.background";
}
@ -122,6 +75,70 @@ collections {
rel2.offset: -2 -2;
}
}
}
}
//// the background and general container for the terminal
group { name: "terminology/background";
images {
image: "bg_bevel.png" COMP;
image: "bg_shine.png" COMP;
image: "bg_glint.png" COMP;
image: "bg_glow_in.png" COMP;
image: "bg_shadow.png" COMP;
image: "bg_led_glow.png" COMP;
image: "bg_led_base.png" COMP;
image: "bg_led.png" COMP;
image: "bg_led_strobe.png" COMP;
image: "pm_shadow.png" COMP;
image: "pm_overlay.png" COMP;
image: "pm_fill.png" COMP;
}
parts {
////////////////////////////////////////////////////////////////////
// background handling
part { name: "shadow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "bg_shadow.png";
fill.smooth: 0;
visible: 0;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "base"; type: RECT;
mouse_events: 1;
description { state: "default" 0.0;
color: 32 32 32 255;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
////////////////////////////////////////////////////////////////////
// actual text grid for chars, cursors, selectiond etc. goes here
// and has a background layered behind it inside the swallowed
// child edje
part { name: "terminology.content"; type: SWALLOW;
description { state: "default" 0.0;
}
}
program {
signal: "translucent,on"; source: "terminology";
action: STATE_SET "translucent" 0.0;
target: "base";
target: "shadow";
}
program {
signal: "translucent,off"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "base";
target: "shadow";
}
////////////////////////////////////////////////////////////////////
// overlayed prettiness
@ -197,28 +214,26 @@ collections {
color: 255 255 255 255;
}
}
program { name: "focus_in";
signal: "focus,in";
source: "terminology";
program {
signal: "focus,in"; source: "terminology";
action: STATE_SET "focused" 0.0;
target: "glint";
target: "glow";
target: "shine";
after: "focus_in2";
}
program { name: "focus_out";
signal: "focus,out";
source: "terminology";
action: STATE_SET "default" 0.0;
target: "glint";
target: "glow";
target: "shine";
}
program { name: "focus_in2";
action: STATE_SET "focused2" 0.0;
transition: DECELERATE 0.5;
target: "glow";
}
program {
signal: "focus,out"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "glint";
target: "glow";
target: "shine";
}
////////////////////////////////////////////////////////////////////
// visual bell - spinning red siren light
@ -308,9 +323,8 @@ collections {
map.rotation.z: 684.0;
}
}
program { name: "bell0";
signal: "bell";
source: "terminology";
program {
signal: "bell"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "bell_base";
target: "bell";
@ -380,12 +394,8 @@ collections {
mouse_events: 0;
description { state: "default" 0.0;
fixed: 1 1;
rel1 {
to: "terminology.popmedia";
}
rel2 {
to: "terminology.popmedia";
}
rel1.to: "terminology.popmedia";
rel2.to: "terminology.popmedia";
image.normal: "pm_shadow.png";
image.border: 64 64 64 64;
image.border_scale_by: 0.1;
@ -544,9 +554,8 @@ collections {
visible: 1;
}
}
program { name: "popmedia_dismiss";
signal: "mouse,clicked,*";
source: "popmedia_dismiss";
program {
signal: "mouse,clicked,*"; source: "popmedia_dismiss";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.5;
target: "terminology.popmedia";
@ -564,9 +573,8 @@ collections {
program { name: "popmedia_dismiss2";
action: SIGNAL_EMIT "popmedia,done" "terminology";
}
program { name: "popmedia_off";
signal: "popmedia,off";
source: "terminology";
program {
signal: "popmedia,off"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.2;
target: "terminology.popmedia";
@ -581,37 +589,32 @@ collections {
target: "popmedia_shine";
after: "popmedia_dismiss2";
}
program { name: "popmedia_img";
signal: "popmedia,image";
source: "terminology";
program {
signal: "popmedia,image"; source: "terminology";
action: STATE_SET "image" 0.0;
transition: DECELERATE 0.2;
target: "terminology.popmedia";
}
program { name: "popmedia_scale";
signal: "popmedia,scale";
source: "terminology";
program {
signal: "popmedia,scale"; source: "terminology";
action: STATE_SET "scale" 0.0;
transition: DECELERATE 0.2;
target: "terminology.popmedia";
}
program { name: "popmedia_edje";
signal: "popmedia,edje";
source: "terminology";
program {
signal: "popmedia,edje"; source: "terminology";
action: STATE_SET "edje" 0.0;
transition: DECELERATE 0.2;
target: "terminology.popmedia";
}
program { name: "popmedia_mov";
signal: "popmedia,movie";
source: "terminology";
program {
signal: "popmedia,movie"; source: "terminology";
action: STATE_SET "movie" 0.0;
transition: DECELERATE 0.2;
target: "terminology.popmedia";
}
program { name: "popmedia_img2";
signal: "popmedia,image";
source: "terminology";
program {
signal: "popmedia,image"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.2;
target: "popmedia_clip";
@ -624,9 +627,8 @@ collections {
target: "popmedia_glintclip";
target: "popmedia_shine";
}
program { name: "popmedia_scale2";
signal: "popmedia,scale";
source: "terminology";
program {
signal: "popmedia,scale"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.2;
target: "popmedia_clip";
@ -639,9 +641,8 @@ collections {
target: "popmedia_glintclip";
target: "popmedia_shine";
}
program { name: "popmedia_edje2";
signal: "popmedia,edje";
source: "terminology";
program {
signal: "popmedia,edje"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.2;
target: "popmedia_clip";
@ -654,9 +655,8 @@ collections {
target: "popmedia_glintclip";
target: "popmedia_shine";
}
program { name: "popmedia_mov2";
signal: "popmedia,movie";
source: "terminology";
program {
signal: "popmedia,movie"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.2;
target: "popmedia_clip";
@ -722,23 +722,20 @@ collections {
align: 0.5 1.0;
}
}
program { name: "cmdshow0";
signal: "cmdbox,show";
source: "terminology";
program {
signal: "cmdbox,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.4;
target: "cmdclip";
}
program { name: "cmdshow";
signal: "cmdbox,show";
source: "terminology";
program {
signal: "cmdbox,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: SPRING 0.4 0.5 4;
target: "terminology.cmdbox";
}
program { name: "cmdhide";
signal: "cmdbox,hide";
source: "terminology";
program {
signal: "cmdbox,hide"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: ACCELERATE 0.5;
target: "terminology.cmdbox";
@ -766,16 +763,14 @@ collections {
rel2.relative: 1.0 1.0;
}
}
program { name: "ab_show";
signal: "about,show";
source: "terminology";
program {
signal: "about,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: SPRING 1.2 2.0 6;
target: "terminology.about";
}
program { name: "ab_hide";
signal: "about,hide";
source: "terminology";
program {
signal: "about,hide"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.6;
target: "terminology.about";
@ -821,16 +816,14 @@ collections {
}
}
}
program { name: "opdt_show";
signal: "optdetails,show";
source: "terminology";
program {
signal: "optdetails,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.4;
target: "terminology.optdetails";
}
program { name: "opdt_hide";
signal: "optdetails,hide";
source: "terminology";
program {
signal: "optdetails,hide"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.2;
target: "terminology.optdetails";
@ -867,16 +860,14 @@ collections {
}
}
}
program { name: "op_show";
signal: "options,show";
source: "terminology";
program {
signal: "options,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.4;
target: "terminology.options";
}
program { name: "op_hide";
signal: "options,hide";
source: "terminology";
program {
signal: "options,hide"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.6;
target: "terminology.options";
@ -911,16 +902,14 @@ collections {
}
}
}
program { name: "ct_show";
signal: "controls,show";
source: "terminology";
program {
signal: "controls,show"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.3;
target: "terminology.controls";
}
program { name: "ct_hide";
signal: "controls,hide";
source: "terminology";
program {
signal: "controls,hide"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.5;
target: "terminology.controls";
@ -1881,9 +1870,8 @@ target: "0.clip"; target: "1.clip"; target: "2.clip"; target: "3.clip"; target:
color: OUTCOL2;
}
}
program { name: "bottomfull";
signal: "mode,bottomfull";
source: "terminology";
program {
signal: "mode,bottomfull"; source: "terminology";
action: STATE_SET "bottomfull" 0.0;
TARGETS;
}
@ -1926,8 +1914,7 @@ target: "4.top"; \
target: "4.bottom"
program { name: "selpulse";
signal: "show";
source: "";
signal: "show"; source: "";
action: STATE_SET "pulse" 0.0;
transition: SINUSOIDAL 0.5;
SELPULSE;
@ -2056,8 +2043,7 @@ target: "4.bottom"
color: 0 0 0 0;
}
program { name: "bottom_right.blink";
signal: "mouse,in";
source: "zone.bottom_right";
signal: "mouse,in"; source: "zone.bottom_right";
action: STATE_SET "fading" 0.0;
target: "cursor_blink.bottom_right";
after: "bottom_right.fade";
@ -2069,8 +2055,7 @@ target: "4.bottom"
after: "bottom_right.blink";
}
program { name: "bottom_right.stop";
signal: "mouse,out";
source: "zone.bottom_right";
signal: "mouse,out"; source: "zone.bottom_right";
action: STATE_SET "default" 0.0;
target: "cursor_blink.bottom_right";
}
@ -2176,16 +2161,14 @@ target: "4.bottom"
}
}
programs {
program { name: "focus_in_noblink";
signal: "focus,in,noblink";
source: "terminology";
program {
signal: "focus,in,noblink"; source: "terminology";
action: STATE_SET "focused" 0.0;
target: "glow";
target: "outline";
}
program { name: "focus_in";
signal: "focus,in";
source: "terminology";
signal: "focus,in"; source: "terminology";
action: STATE_SET "focused" 0.0;
target: "glow";
target: "outline";
@ -2218,9 +2201,8 @@ target: "4.bottom"
transition: DECELERATE 0.4;
target: "pulse";
}
program { name: "focus_out";
signal: "focus,out";
source: "terminology";
program {
signal: "focus,out"; source: "terminology";
action: ACTION_STOP;
target: "focus_in";
target: "focus2";
@ -2234,9 +2216,8 @@ target: "4.bottom"
target: "glow";
target: "outline";
}
program { name: "key";
signal: "key,down";
source: "terminology";
program {
signal: "key,down"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "key";
after: "key2";
@ -2417,24 +2398,6 @@ target: "4.bottom"
rel2.to: "terminology.content";
}
}
part { name: "terminology.background"; type: SWALLOW;
description { state: "default" 0.0;
rel1.to: "terminology.content";
rel2.to: "terminology.content";
}
description { state: "image" 0.0;
inherit: "default" 0.0;
}
description { state: "scale" 0.0;
inherit: "default" 0.0;
}
description { state: "edje" 0.0;
inherit: "default" 0.0;
}
description { state: "movie" 0.0;
inherit: "default" 0.0;
}
}
part { name: "terminology.content"; type: SWALLOW;
clip_to: "clip";
description { state: "default" 0.0;
@ -2563,6 +2526,7 @@ target: "4.bottom"
}
}
}
//////////////////////////////////////////////////////////////////////////////
//// an object overlayd on text that is a link
group { name: "terminology/link";
@ -2649,8 +2613,7 @@ target: "4.bottom"
}
programs {
program { name: "show";
signal: "show";
source: "";
signal: "show"; source: "";
action: STATE_SET "out" 0.0;
transition: LINEAR 0.3;
target: "l";
@ -2768,16 +2731,14 @@ target: "4.bottom"
}
}
programs {
program { name: "busy";
signal: "busy";
source: "terminology";
program {
signal: "busy"; source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.5;
target: "fade";
}
program { name: "spin1";
signal: "busy";
source: "terminology";
signal: "busy"; source: "terminology";
action: STATE_SET "spin" 0.0;
transition: LINEAR 0.5;
target: "knob_spinner";
@ -2793,9 +2754,8 @@ target: "4.bottom"
// source: "terminology";
// action: STATE_SET "default" 0.0;
// }
program { name: "done";
signal: "done";
source: "terminology";
program {
signal: "done"; source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 1.5;
target: "fade";
@ -2937,58 +2897,49 @@ target: "4.bottom"
}
}
programs {
program { name: "media_mouse_in";
signal: "mouse,in";
source: "media_bg";
program {
signal: "mouse,in"; source: "media_bg";
action: STATE_SET "expanded" 0.0;
transition: SINUSOIDAL 0.4 CURRENT;
target: "media_bg";
}
program { name: "media_mouse_out";
signal: "mouse,out";
source: "media_bg";
program {
signal: "mouse,out"; source: "media_bg";
action: STATE_SET "default" 0.0;
transition: SINUSOIDAL 0.4 CURRENT;
target: "media_bg";
}
program { name: "media_pause_click";
signal: "mouse,up,*";
source: "play";
program {
signal: "mouse,up,*"; source: "play";
filter: "play" "default";
action: SIGNAL_EMIT "pause" "";
}
program { name: "media_play_click";
signal: "mouse,up,1";
source: "play";
program {
signal: "mouse,up,1"; source: "play";
filter: "play" "paused";
action: SIGNAL_EMIT "play" "";
}
program { name: "media_stop_click";
signal: "mouse,up,1";
source: "stop";
program {
signal: "mouse,up,1"; source: "stop";
action: SIGNAL_EMIT "stop" "";
}
program { name: "media_signal_pause";
signal: "pause,set";
source: "terminology";
program {
signal: "pause,set"; source: "terminology";
action: STATE_SET "paused" 0.0;
target: "play";
}
program { name: "media_signal_play";
signal: "play,set";
source: "terminology";
program {
signal: "play,set"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "play";
}
program { name: "media_signal_mute";
signal: "mute,set";
source: "terminology";
program {
signal: "mute,set"; source: "terminology";
action: STATE_SET "muted" 0.0;
target: "terminology.voldrag";
}
program { name: "media_signal_unmute";
signal: "mute,unset";
source: "terminology";
program {
signal: "mute,unset"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "terminology.voldrag";
}
@ -3084,9 +3035,8 @@ target: "4.bottom"
}
}
programs {
program { name: "begin";
signal: "begin";
source: "terminology";
program {
signal: "begin"; source: "terminology";
action: ACTION_STOP;
target: "show";
target: "show2";

@ -394,7 +394,8 @@ static const Color colors256[256] =
{ 0xee, 0xee, 0xee, 0xff },
};
void colors_term_init(Evas_Object *textgrid, Evas_Object *bg)
void
colors_term_init(Evas_Object *textgrid, Evas_Object *bg)
{
int c, n;
int r, g, b, a;

@ -48,6 +48,7 @@ struct _Term
Win *wn;
Config *config;
Evas_Object *bg;
Evas_Object *base;
Evas_Object *term;
Evas_Object *media;
Evas_Object *popmedia;
@ -464,12 +465,14 @@ _term_focus(Term *term)
{
term2->focused = EINA_FALSE;
edje_object_signal_emit(term2->bg, "focus,out", "terminology");
edje_object_signal_emit(term2->base, "focus,out", "terminology");
elm_object_focus_set(term2->term, EINA_FALSE);
}
}
}
term->focused = EINA_TRUE;
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
if (term->wn->cmdbox) elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
elm_object_focus_set(term->term, EINA_TRUE);
elm_win_title_set(term->wn->win, termio_title_get(term->term));
@ -612,6 +615,7 @@ _cb_focus_in(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
else
{
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_TRUE);
}
}
@ -628,6 +632,7 @@ _cb_focus_out(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
term = main_win_focused_term_get(wn);
if (!term) return;
edje_object_signal_emit(term->bg, "focus,out", "terminology");
edje_object_signal_emit(term->base, "focus,out", "terminology");
if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE);
elm_cache_all_flush();
}
@ -796,7 +801,8 @@ _cb_size_hint(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event __UN
evas_object_size_hint_min_get(obj, &mw, &mh);
evas_object_size_hint_request_get(obj, &rw, &rh);
edje_object_size_min_calc(term->base, &w, &h);
evas_object_size_hint_min_set(term->base, w, h);
edje_object_size_min_calc(term->bg, &w, &h);
evas_object_size_hint_min_set(term->bg, w, h);
term->step_x = mw;
@ -849,7 +855,10 @@ _cb_bell(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
if (!config) return;
if (!config->disable_visual_bell)
edje_object_signal_emit(term->bg, "bell", "terminology");
{
edje_object_signal_emit(term->bg, "bell", "terminology");
edje_object_signal_emit(term->base, "bell", "terminology");
}
if (config->urg_bell)
{
if (!term->wn->focused) elm_win_urgent_set(term->wn->win, EINA_TRUE);
@ -1074,9 +1083,9 @@ _sel_restore(Split *sp)
#if (EVAS_VERSION_MAJOR > 1) || (EVAS_VERSION_MINOR >= 8)
evas_object_image_source_visible_set(tm->sel, EINA_TRUE);
#endif
edje_object_part_swallow(tm->bg, "terminology.content", tm->term);
edje_object_part_swallow(tm->bg, "terminology.content", tm->base);
tm->unswallowed = EINA_FALSE;
evas_object_show(tm->term);
evas_object_show(tm->base);
tm->sel = NULL;
}
}
@ -1142,17 +1151,26 @@ _sel_go(Split *sp, Term *term)
sp->sel = sel_add(sp->wn->win);
EINA_LIST_FOREACH(sp->terms, l, tm)
{
edje_object_part_unswallow(tm->bg, tm->term);
evas_object_lower(tm->term);
evas_object_move(tm->term, -9999, -9999);
evas_object_show(tm->term);
evas_object_clip_unset(tm->term);
Evas_Object *img;
Evas_Coord w, h;
edje_object_part_unswallow(tm->bg, tm->base);
evas_object_lower(tm->base);
evas_object_move(tm->base, -9999, -9999);
evas_object_show(tm->base);
evas_object_clip_unset(tm->base);
#if (EVAS_VERSION_MAJOR > 1) || (EVAS_VERSION_MINOR >= 8)
evas_object_image_source_visible_set(tm->sel, EINA_FALSE);
#endif
tm->unswallowed = EINA_TRUE;
img = evas_object_image_filled_add(evas_object_evas_get(sp->wn->win));
evas_object_image_source_set(img, tm->base);
evas_object_geometry_get(tm->base, NULL, NULL, &w, &h);
evas_object_resize(img, w, h);
evas_object_data_set(img, "termio", tm->term);
tm->sel = img;
tm->sel = termio_mirror_add(tm->term);
sel_entry_add(sp->sel, tm->sel, (tm == sp->term), tm->config);
}
edje_object_part_swallow(sp->sel_bg, "terminology.content", sp->sel);
@ -1449,9 +1467,15 @@ static void
_win_trans(Win *wn, Term *term, Eina_Bool trans)
{
if (term->config->translucent)
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
{
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
edje_object_signal_emit(term->base, "translucent,on", "terminology");
}
else
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
{
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
edje_object_signal_emit(term->base, "translucent,off", "terminology");
}
if (trans)
{
elm_win_alpha_set(wn->win, EINA_TRUE);
@ -1507,7 +1531,11 @@ _cb_media_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
if (term->term) config = termio_config_get(term->term);
term->media = NULL;
if (term->bg) edje_object_signal_emit(term->bg, "media,off", "terminology");
if (term->bg)
{
edje_object_signal_emit(term->bg, "media,off", "terminology");
edje_object_signal_emit(term->base, "media,off", "terminology");
}
if (!config) return;
if (config->temporary)
eina_stringshare_replace(&(config->background), NULL);
@ -1533,17 +1561,29 @@ _term_media_update(Term *term, const Config *config)
MEDIA_BG, &type);
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
_cb_media_del, term);
edje_object_part_swallow(term->bg, "terminology.background", o);
edje_object_part_swallow(term->base, "terminology.background", o);
evas_object_show(o);
term->mediatype = type;
if (type == TYPE_IMG)
edje_object_signal_emit(term->bg, "media,image", "terminology");
{
edje_object_signal_emit(term->bg, "media,image", "terminology");
edje_object_signal_emit(term->base, "media,image", "terminology");
}
else if (type == TYPE_SCALE)
edje_object_signal_emit(term->bg, "media,scale", "terminology");
{
edje_object_signal_emit(term->bg, "media,scale", "terminology");
edje_object_signal_emit(term->base, "media,scale", "terminology");
}
else if (type == TYPE_EDJE)
edje_object_signal_emit(term->bg, "media,edje", "terminology");
{
edje_object_signal_emit(term->bg, "media,edje", "terminology");
edje_object_signal_emit(term->base, "media,edje", "terminology");
}
else if (type == TYPE_MOV)
edje_object_signal_emit(term->bg, "media,movie", "terminology");
{
edje_object_signal_emit(term->bg, "media,movie", "terminology");
edje_object_signal_emit(term->base, "media,movie", "terminology");
}
}
else
{
@ -1553,6 +1593,7 @@ _term_media_update(Term *term, const Config *config)
EVAS_CALLBACK_DEL,
_cb_media_del);
edje_object_signal_emit(term->bg, "media,off", "terminology");
edje_object_signal_emit(term->base, "media,off", "terminology");
evas_object_del(term->media);
term->media = NULL;
}
@ -1747,6 +1788,8 @@ main_term_free(Term *term)
term->popmedia = NULL;
evas_object_del(term->term);
term->term = NULL;
evas_object_del(term->base);
term->base = NULL;
evas_object_del(term->bg);
term->bg = NULL;
if (term->config) config_del(term->config);
@ -1759,25 +1802,39 @@ main_term_bg_redo(Term *term)
{
Evas_Object *o;
evas_object_del(term->base);
evas_object_del(term->bg);
term->base = o = edje_object_add(evas_object_evas_get(term->wn->win));
theme_apply(o, term->config, "terminology/core");
theme_auto_reload_enable(o);
evas_object_show(o);
term->bg = o = edje_object_add(evas_object_evas_get(term->wn->win));
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
theme_apply(o, term->config, "terminology/background");
if (term->config->translucent)
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
else
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
theme_auto_reload_enable(o);
evas_object_show(o);
edje_object_signal_callback_add(o, "popmedia,done", "terminology",
if (term->config->translucent)
{
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
edje_object_signal_emit(term->base, "translucent,on", "terminology");
}
else
{
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
edje_object_signal_emit(term->base, "translucent,off", "terminology");
}
edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
_cb_popmedia_done, term);
termio_theme_set(term->term, term->bg);
edje_object_part_swallow(term->bg, "terminology.content", term->term);
edje_object_part_swallow(term->base, "terminology.content", term->term);
edje_object_part_swallow(term->bg, "terminology.content", term->base);
if (term->popmedia)
{
edje_object_part_swallow(term->bg, "terminology.popmedia", term->popmedia);
@ -1792,20 +1849,33 @@ main_term_bg_redo(Term *term)
}
if (term->media)
{
edje_object_part_swallow(term->bg, "terminology.background", term->media);
edje_object_part_swallow(term->base, "terminology.background", term->media);
if (term->mediatype == TYPE_IMG)
edje_object_signal_emit(term->bg, "media,image", "terminology");
{
edje_object_signal_emit(term->bg, "media,image", "terminology");
edje_object_signal_emit(term->base, "media,image", "terminology");
}
else if (term->mediatype == TYPE_SCALE)
edje_object_signal_emit(term->bg, "media,scale", "terminology");
{
edje_object_signal_emit(term->bg, "media,scale", "terminology");
edje_object_signal_emit(term->base, "media,scale", "terminology");
}
else if (term->mediatype == TYPE_EDJE)
edje_object_signal_emit(term->bg, "media,edje", "terminology");
{
edje_object_signal_emit(term->bg, "media,edje", "terminology");
edje_object_signal_emit(term->base, "media,edje", "terminology");
}
else if (term->mediatype == TYPE_MOV)
edje_object_signal_emit(term->bg, "media,movie", "terminology");
{
edje_object_signal_emit(term->bg, "media,movie", "terminology");
edje_object_signal_emit(term->base, "media,movie", "terminology");
}
}
if ((term->focused) && (term->wn->focused))
{
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
if (term->wn->cmdbox)
elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
elm_object_focus_set(term->term, EINA_TRUE);
@ -1831,6 +1901,12 @@ main_term_new(Win *wn, Config *config, const char *cmd,
term->hold = hold;
term->config = config;
term->base = o = edje_object_add(evas_object_evas_get(term->wn->win));
theme_apply(o, term->config, "terminology/core");
theme_auto_reload_enable(o);
evas_object_show(o);
term->bg = o = edje_object_add(evas_object_evas_get(wn->win));
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
@ -1842,15 +1918,21 @@ main_term_new(Win *wn, Config *config, const char *cmd,
return NULL;
}
if (term->config->translucent)
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
else
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
theme_auto_reload_enable(o);
evas_object_show(o);
edje_object_signal_callback_add(o, "popmedia,done", "terminology",
if (term->config->translucent)
{
edje_object_signal_emit(term->bg, "translucent,on", "terminology");
edje_object_signal_emit(term->base, "translucent,on", "terminology");
}
else
{
edje_object_signal_emit(term->bg, "translucent,off", "terminology");
edje_object_signal_emit(term->base, "translucent,off", "terminology");
}
edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
_cb_popmedia_done, term);
term->term = o = termio_add(wn->win, config, cmd, login_shell, cd,
@ -1863,7 +1945,8 @@ main_term_new(Win *wn, Config *config, const char *cmd,
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_cb_size_hint, term);
edje_object_part_swallow(term->bg, "terminology.content", o);
edje_object_part_swallow(term->base, "terminology.content", o);
edje_object_part_swallow(term->bg, "terminology.content", term->base);
evas_object_smart_callback_add(o, "options", _cb_options, term);
evas_object_smart_callback_add(o, "change", _cb_change, term);
evas_object_smart_callback_add(o, "exited", _cb_exited, term);
@ -1891,6 +1974,7 @@ main_term_new(Win *wn, Config *config, const char *cmd,
{
term->focused = EINA_TRUE;
// edje_object_signal_emit(term->bg, "focus,in", "terminology");
// edje_object_signal_emit(term->base, "focus,in", "terminology");
}
wn->terms = eina_list_append(wn->terms, term);

@ -7,7 +7,6 @@
#include "config.h"
#include "utils.h"
#include "termio.h"
#include "media.h"
typedef struct _Sel Sel;
typedef struct _Entry Entry;
@ -35,14 +34,16 @@ struct _Sel
Eina_Bool exit_me : 1;
Eina_Bool exit_on_sel : 1;
Eina_Bool exit_now : 1;
Eina_Bool pending_sel : 1;
};
struct _Entry
{
Evas_Object *obj, *bg, *media, *termio;
Evas_Object *obj, *bg, *termio;
Eina_Bool selected : 1;
Eina_Bool selected_before : 1;
Eina_Bool selected_orig : 1;
Eina_Bool was_selected : 1;
};
static Evas_Smart *_smart = NULL;
@ -184,6 +185,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
evas_object_smart_callback_call(data, "ending", NULL);
sel_zoom(data, 1.0);
}
// XXX: handle up/down
}
static void
@ -210,10 +212,21 @@ _layout(Evas_Object *obj)
sd->px0 = (x * w);
sd->py0 = (y * h);
}
if (en->selected)
if ((sd->exit_on_sel) && (!sd->exit_now))
{
sd->px1 = (x * w);
sd->py1 = (y * h);
if (en->selected_before)
{
sd->px1 = (x * w);
sd->py1 = (y * h);
}
}
else
{
if (en->selected)
{
sd->px1 = (x * w);
sd->py1 = (y * h);
}
}
x++;
if (x >= iw)
@ -239,11 +252,11 @@ _layout(Evas_Object *obj)
else py = py - ((py * (oh - h)) / (hh - h));
}
x = y = 0;
EINA_LIST_FOREACH(sd->items, l, en)
{
evas_object_move(en->bg, ox + (x * w) - px, oy + (y * h) - py);
evas_object_resize(en->bg, w, h);
evas_object_show(en->obj);
evas_object_show(en->bg);
x++;
if (x >= iw)
@ -252,6 +265,17 @@ _layout(Evas_Object *obj)
y++;
}
}
if ((sd->w > 0) && (sd->h > 0) && (sd->pending_sel))
{
sd->pending_sel = EINA_FALSE;
EINA_LIST_FOREACH(sd->items, l, en)
{
if ((!en->was_selected) && (en->selected))
edje_object_signal_emit(en->bg, "selected", "terminology");
else if ((en->was_selected) && (!en->selected))
edje_object_signal_emit(en->bg, "unselected", "terminology");
}
}
}
static Eina_Bool
@ -349,13 +373,6 @@ _bell_cb(void *data, Evas_Object *obj __UNUSED__, void *info __UNUSED__)
edje_object_signal_emit(en->bg, "bell", "terminology");
}
static void
_media_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *info __UNUSED__)
{
Entry *en = data;
en->media = NULL;
}
static void
_entry_termio_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *info __UNUSED__)
{
@ -430,7 +447,6 @@ _smart_del(Evas_Object *obj)
if (en->obj) evas_object_event_callback_del_full
(en->obj, EVAS_CALLBACK_DEL, _entry_del_cb, en);
if (en->obj) evas_object_del(en->obj);
if (en->media) evas_object_del(en->media);
evas_object_del(en->bg);
free(en);
}
@ -478,7 +494,7 @@ _smart_init(void)
evas_object_smart_clipped_smart_set(&_parent_sc);
sc = _parent_sc;
sc.name = "media";
sc.name = "sel";
sc.version = EVAS_SMART_CLASS_VERSION;
sc.add = _smart_add;
sc.del = _smart_del;
@ -539,31 +555,12 @@ sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Config *
edje_object_part_swallow(en->bg, "terminology.content", en->obj);
evas_object_show(en->obj);
if (config->background)
{
Evas_Object *o;
int type = 0;
en->media = o = media_add(obj,
config->background, config,
MEDIA_BG, &type);
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
_media_del_cb, en);
edje_object_part_swallow(en->bg, "terminology.background", o);
evas_object_show(o);
if (type == TYPE_IMG)
edje_object_signal_emit(en->bg, "media,image", "terminology");
else if (type == TYPE_SCALE)
edje_object_signal_emit(en->bg, "media,scale", "terminology");
else if (type == TYPE_EDJE)
edje_object_signal_emit(en->bg, "media,edje", "terminology");
else if (type == TYPE_MOV)
edje_object_signal_emit(en->bg, "media,movie", "terminology");
}
evas_object_stack_below(en->bg, sd->o_event);
if (en->selected)
edje_object_signal_emit(en->bg, "selected,start", "terminology");
{
edje_object_signal_emit(en->bg, "selected,start", "terminology");
edje_object_message_signal_process(en->bg);
}
sd->interp = 1.0;
en->termio = evas_object_data_get(en->obj, "termio");
if (en->termio)
@ -608,19 +605,30 @@ sel_entry_selected_set(Evas_Object *obj, Evas_Object *entry, Eina_Bool keep_befo
Eina_List *l;
Entry *en;
if (!sd) return;
EINA_LIST_FOREACH(sd->items, l, en)
{
if (en->obj == entry)
{
edje_object_signal_emit(en->bg, "selected", "terminology");
if ((sd->w > 0) && (sd->h > 0))
edje_object_signal_emit(en->bg, "selected", "terminology");
else
sd->pending_sel = EINA_TRUE;
evas_object_stack_below(en->bg, sd->o_event);
en->was_selected = EINA_FALSE;
en->selected = EINA_TRUE;
}
else if (en->obj != entry)
{
if (en->selected)
{
edje_object_signal_emit(en->bg, "unselected", "terminology");
if ((sd->w > 0) && (sd->h > 0))
edje_object_signal_emit(en->bg, "unselected", "terminology");
else
{
en->was_selected = EINA_TRUE;
sd->pending_sel = EINA_TRUE;
}
en->selected = EINA_FALSE;
}
}

Loading…
Cancel
Save