summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/config.c30
-rw-r--r--src/bin/controls.c2
-rw-r--r--src/bin/main.c2
-rw-r--r--src/bin/main.h2
-rw-r--r--src/bin/termio.c7
-rw-r--r--src/bin/termiointernals.c124
-rw-r--r--src/bin/termpty.h8
-rw-r--r--src/bin/termptyesc.c8
-rw-r--r--src/bin/termptyops.c2
-rw-r--r--src/bin/win.c119
10 files changed, 194 insertions, 110 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 52ff2d2..97e10a9 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -216,6 +216,7 @@ config_save(Config *config)
216 char buf[PATH_MAX], buf2[PATH_MAX]; 216 char buf[PATH_MAX], buf2[PATH_MAX];
217 const char *cfgdir; 217 const char *cfgdir;
218 int ok; 218 int ok;
219 Eet_Error err;
219 220
220 EINA_SAFETY_ON_NULL_RETURN(config); 221 EINA_SAFETY_ON_NULL_RETURN(config);
221 222
@@ -236,11 +237,28 @@ config_save(Config *config)
236 snprintf(buf, sizeof(buf), "%s/terminology/config/standard/base.cfg.tmp", cfgdir); 237 snprintf(buf, sizeof(buf), "%s/terminology/config/standard/base.cfg.tmp", cfgdir);
237 snprintf(buf2, sizeof(buf2), "%s/terminology/config/standard/base.cfg", cfgdir); 238 snprintf(buf2, sizeof(buf2), "%s/terminology/config/standard/base.cfg", cfgdir);
238 ef = eet_open(buf, EET_FILE_MODE_WRITE); 239 ef = eet_open(buf, EET_FILE_MODE_WRITE);
239 if (ef) 240 if (!ef)
241 {
242 ERR("error opening file '%s' for writing", buf);
243 return;
244 }
245 ok = eet_data_write(ef, edd_base, CONFIG_KEY, config, 1);
246 if (!ok)
240 { 247 {
241 ok = eet_data_write(ef, edd_base, CONFIG_KEY, config, 1);
242 eet_close(ef); 248 eet_close(ef);
243 if (ok) ecore_file_mv(buf, buf2); 249 ERR("error writing to file '%s'", buf);
250 return;
251 }
252 err = eet_close(ef);
253 if (err != EET_ERROR_NONE)
254 {
255 ERR("error #%d closing file '%s'", err, buf);
256 return;
257 }
258 if (!ecore_file_mv(buf, buf2))
259 {
260 ERR("error moving file '%s' to '%s'", buf, buf2);
261 return;
244 } 262 }
245 main_config_sync(config); 263 main_config_sync(config);
246} 264}
@@ -718,10 +736,12 @@ config_load(void)
718 if (config->version < CONF_VER) 736 if (config->version < CONF_VER)
719 { 737 {
720 // currently no upgrade path so reset config. 738 // currently no upgrade path so reset config.
739 ERR("config is from a newer Terminology, discard it");
721 config_del(config); 740 config_del(config);
722 config = NULL; 741 config = config_new();
742 config->temporary = EINA_TRUE;
723 } 743 }
724 /* do no thing in case the config is from a newer 744 /* do nothing in case the config is from a newer
725 * terminology, we don't want to remove it. */ 745 * terminology, we don't want to remove it. */
726 } 746 }
727 } 747 }
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 279fea3..255eb6b 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -101,7 +101,7 @@ _cb_ct_new(void *data,
101 void *_event EINA_UNUSED) 101 void *_event EINA_UNUSED)
102{ 102{
103 Controls_Ctx *ctx = data; 103 Controls_Ctx *ctx = data;
104 main_new(ctx->win, ctx->term); 104 main_new(ctx->term);
105} 105}
106 106
107static void 107static void
diff --git a/src/bin/main.c b/src/bin/main.c
index 4aabc07..9bcd88b 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -111,7 +111,7 @@ _configure_instance(Ipc_Instance *inst)
111 config->temporary = EINA_TRUE; 111 config->temporary = EINA_TRUE;
112 } 112 }
113 113
114 if (inst->login_shell) 114 if (inst->login_shell != 0xff)
115 { 115 {
116 inst->config->login_shell = inst->login_shell; 116 inst->config->login_shell = inst->login_shell;
117 inst->config->temporary = EINA_TRUE; 117 inst->config->temporary = EINA_TRUE;
diff --git a/src/bin/main.h b/src/bin/main.h
index 1a961d4..e870b32 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -4,7 +4,7 @@
4#include "config.h" 4#include "config.h"
5 5
6Config * main_config_get(void); 6Config * main_config_get(void);
7void main_new(Evas_Object *win, Evas_Object *term); 7void main_new(Evas_Object *term);
8void main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir); 8void main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir);
9void main_split_h(Evas_Object *win, Evas_Object *term, const char *cmd); 9void main_split_h(Evas_Object *win, Evas_Object *term, const char *cmd);
10void main_split_v(Evas_Object *win, Evas_Object *term, const char *cmd); 10void main_split_v(Evas_Object *win, Evas_Object *term, const char *cmd);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index dea782e..f366cb5 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1043,8 +1043,7 @@ _getsel_cb(void *data,
1043 int prev_i = i; 1043 int prev_i = i;
1044 g = eina_unicode_utf8_next_get(s, &i); 1044 g = eina_unicode_utf8_next_get(s, &i);
1045 /* Skip escape codes as a security measure */ 1045 /* Skip escape codes as a security measure */
1046 if ((g < '\n') || 1046 if (! ((g == '\t') || (g == '\n') || (g >= ' ')))
1047 ((g > '\n') && (g < ' ')))
1048 { 1047 {
1049 continue; 1048 continue;
1050 } 1049 }
@@ -1074,9 +1073,9 @@ _getsel_cb(void *data,
1074 const char *fmt = "UNKNOWN"; 1073 const char *fmt = "UNKNOWN";
1075 switch (ev->format) 1074 switch (ev->format)
1076 { 1075 {
1077 case ELM_SEL_FORMAT_TARGETS: fmt = "TARGETS"; break; /* shouldn't happen */ 1076 case ELM_SEL_FORMAT_TARGETS: fmt = "TARGETS"; break;
1078 case ELM_SEL_FORMAT_NONE: fmt = "NONE"; break; 1077 case ELM_SEL_FORMAT_NONE: fmt = "NONE"; break;
1079 case ELM_SEL_FORMAT_TEXT: fmt = "TEXT"; break; 1078 case ELM_SEL_FORMAT_TEXT: fmt = "TEXT"; break; /* shouldn't happen */
1080 case ELM_SEL_FORMAT_MARKUP: fmt = "MARKUP"; break; 1079 case ELM_SEL_FORMAT_MARKUP: fmt = "MARKUP"; break;
1081 case ELM_SEL_FORMAT_IMAGE: fmt = "IMAGE"; break; 1080 case ELM_SEL_FORMAT_IMAGE: fmt = "IMAGE"; break;
1082 case ELM_SEL_FORMAT_VCARD: fmt = "VCARD"; break; 1081 case ELM_SEL_FORMAT_VCARD: fmt = "VCARD"; break;
diff --git a/src/bin/termiointernals.c b/src/bin/termiointernals.c
index 555c27a..598c724 100644
--- a/src/bin/termiointernals.c
+++ b/src/bin/termiointernals.c
@@ -21,6 +21,16 @@ termio_selection_get(Termio *sd,
21{ 21{
22 int x, y; 22 int x, y;
23 23
24#define SB_ADD(STR, LEN) do { \
25 if (ty_sb_add(sb, STR, LEN) < 0) \
26 goto err; \
27} while (0)
28
29#define RTRIM() do { \
30 if (rtrim) \
31 ty_sb_spaces_rtrim(sb); \
32} while (0)
33
24 termpty_backlog_lock(); 34 termpty_backlog_lock();
25 for (y = c1y; y <= c2y; y++) 35 for (y = c1y; y <= c2y; y++)
26 { 36 {
@@ -33,51 +43,91 @@ termio_selection_get(Termio *sd,
33 cells = termpty_cellrow_get(sd->pty, y, &w); 43 cells = termpty_cellrow_get(sd->pty, y, &w);
34 if (!cells || !w) 44 if (!cells || !w)
35 { 45 {
36 if (ty_sb_add(sb, "\n", 1) < 0) goto err; 46 SB_ADD("\n", 1);
37 continue; 47 continue;
38 } 48 }
39 if (w > sd->grid.w) w = sd->grid.w; 49
50 /* Define how much needs to be read on that line */
51 if (w > sd->grid.w)
52 w = sd->grid.w;
40 if (y == c1y && c1x >= w) 53 if (y == c1y && c1x >= w)
41 { 54 {
42 if (rtrim) 55 RTRIM();
43 ty_sb_spaces_rtrim(sb); 56 SB_ADD("\n", 1);
44 if (ty_sb_add(sb, "\n", 1) < 0) goto err;
45 continue; 57 continue;
46 } 58 }
47 start_x = c1x; 59 start_x = c1x;
48 end_x = (c2x >= w) ? w - 1 : c2x; 60 end_x = (c2x >= w) ? w - 1 : c2x;
49 if (c1y != c2y) 61 if (c1y != c2y)
50 { 62 {
51 if (y == c1y) end_x = w - 1; 63 if (y == c1y)
52 else if (y == c2y) start_x = 0; 64 end_x = w - 1;
65 else if (y == c2y)
66 start_x = 0;
53 else 67 else
54 { 68 {
55 start_x = 0; 69 start_x = 0;
56 end_x = w - 1; 70 end_x = w - 1;
57 } 71 }
58 } 72 }
73
59 for (x = start_x; x <= end_x; x++) 74 for (x = start_x; x <= end_x; x++)
60 { 75 {
61 if ((cells[x].codepoint == 0) && (cells[x].att.dblwidth)) 76 if ((cells[x].codepoint == 0) && (cells[x].att.dblwidth))
62 { 77 {
63 if (x < end_x) x++; 78 if (x < end_x)
64 else break; 79 x++;
80 else
81 break;
82 }
83 if (x >= w)
84 break;
85 if (cells[x].att.tab_inserted)
86 {
87 /* There was a tab inserted.
88 * Only output it if there were spaces/empty cells "bellow"
89 */
90 Eina_Bool is_tab = EINA_TRUE;
91 while ((is_tab) && (x < end_x))
92 {
93 if (((cells[x].codepoint == 0) ||
94 (cells[x].att.invisible == 1) ||
95 (cells[x].codepoint == ' ')))
96 {
97 x++;
98 }
99 else
100 {
101 is_tab = EINA_FALSE;
102 }
103 if (cells[x].att.tab_last)
104 {
105 SB_ADD("\t", 1);
106 if (is_tab)
107 {
108 x++;
109 is_tab = EINA_FALSE;
110 }
111 break;
112 }
113 }
65 } 114 }
66 if (x >= w) break;
67 if (cells[x].att.newline) 115 if (cells[x].att.newline)
68 { 116 {
69 last0 = -1; 117 last0 = -1;
70 if ((y != c2y) || (x != end_x)) 118 if ((y != c2y) || (x != end_x))
71 { 119 {
72 if (rtrim) 120 RTRIM();
73 ty_sb_spaces_rtrim(sb); 121 SB_ADD("\n", 1);
74 if (ty_sb_add(sb, "\n", 1) < 0) goto err;
75 } 122 }
76 break; 123 break;
77 } 124 }
78 else if (cells[x].codepoint == 0) 125 else if (cells[x].codepoint == 0)
79 { 126 {
80 if (last0 < 0) last0 = x; 127 /* empty cell, track it to know whether to replace with
128 * spaces */
129 if (last0 < 0)
130 last0 = x;
81 } 131 }
82 else 132 else
83 { 133 {
@@ -90,27 +140,28 @@ termio_selection_get(Termio *sd,
90 last0 = -1; 140 last0 = -1;
91 while (v >= 0) 141 while (v >= 0)
92 { 142 {
93 if (ty_sb_add(sb, " ", 1) < 0) goto err; 143 SB_ADD(" ", 1);
94 v--; 144 v--;
95 } 145 }
96 } 146 }
97 txtlen = codepoint_to_utf8(cells[x].codepoint, txt); 147 txtlen = codepoint_to_utf8(cells[x].codepoint, txt);
98 if (txtlen > 0) 148 if (txtlen > 0)
99 if (ty_sb_add(sb, txt, txtlen) < 0) goto err; 149 SB_ADD(txt, txtlen);
100 if ((x == (w - 1)) && 150 if ((x == (w - 1)) &&
101 ((x != c2x) || (y != c2y))) 151 ((x != c2x) || (y != c2y)))
102 { 152 {
103 if (!cells[x].att.autowrapped) 153 if (!cells[x].att.autowrapped)
104 { 154 {
105 if (rtrim) 155 RTRIM();
106 ty_sb_spaces_rtrim(sb); 156 SB_ADD("\n", 1);
107 if (ty_sb_add(sb, "\n", 1) < 0) goto err;
108 } 157 }
109 } 158 }
110 } 159 }
111 } 160 }
112 if (last0 >= 0) 161 if (last0 >= 0)
113 { 162 {
163 /* line stop by empty cell, need to know whether to insert spaces
164 * or just go to next line */
114 if (y == c2y) 165 if (y == c2y)
115 { 166 {
116 Eina_Bool have_more = EINA_FALSE; 167 Eina_Bool have_more = EINA_FALSE;
@@ -120,8 +171,10 @@ termio_selection_get(Termio *sd,
120 if ((cells[x].codepoint == 0) && 171 if ((cells[x].codepoint == 0) &&
121 (cells[x].att.dblwidth)) 172 (cells[x].att.dblwidth))
122 { 173 {
123 if (x < (w - 1)) x++; 174 if (x < (w - 1))
124 else break; 175 x++;
176 else
177 break;
125 } 178 }
126 if (((cells[x].codepoint != 0) && 179 if (((cells[x].codepoint != 0) &&
127 (cells[x].codepoint != ' ')) || 180 (cells[x].codepoint != ' ')) ||
@@ -133,9 +186,8 @@ termio_selection_get(Termio *sd,
133 } 186 }
134 if (!have_more) 187 if (!have_more)
135 { 188 {
136 if (rtrim) 189 RTRIM();
137 ty_sb_spaces_rtrim(sb); 190 SB_ADD("\n", 1);
138 if (ty_sb_add(sb, "\n", 1) < 0) goto err;
139 } 191 }
140 else 192 else
141 { 193 {
@@ -144,31 +196,34 @@ termio_selection_get(Termio *sd,
144 if ((cells[x].codepoint == 0) && 196 if ((cells[x].codepoint == 0) &&
145 (cells[x].att.dblwidth)) 197 (cells[x].att.dblwidth))
146 { 198 {
147 if (x < (w - 1)) x++; 199 if (x < (w - 1))
148 else break; 200 x++;
201 else
202 break;
149 } 203 }
150 if (x >= w) break; 204 if (x >= w)
151 if (ty_sb_add(sb, " ", 1) < 0) goto err; 205 break;
206 SB_ADD(" ", 1);
152 } 207 }
153 } 208 }
154 } 209 }
155 else 210 else
156 { 211 {
157 if (rtrim) 212 RTRIM();
158 ty_sb_spaces_rtrim(sb); 213 SB_ADD("\n", 1);
159 if (ty_sb_add(sb, "\n", 1) < 0) goto err;
160 } 214 }
161 } 215 }
162 } 216 }
163 termpty_backlog_unlock(); 217 termpty_backlog_unlock();
164 218
165 if (rtrim) 219 RTRIM();
166 ty_sb_spaces_rtrim(sb);
167 220
168 return; 221 return;
169 222
170err: 223err:
171 ty_sb_free(sb); 224 ty_sb_free(sb);
225#undef SB_ADD
226#undef RTRIM
172} 227}
173 228
174 229
@@ -1305,8 +1360,6 @@ _selection_newline_extend_fix(Termio *sd)
1305 termpty_backlog_unlock(); 1360 termpty_backlog_unlock();
1306} 1361}
1307 1362
1308/* }}} */
1309
1310void 1363void
1311termio_selection_dbl_fix(Termio *sd) 1364termio_selection_dbl_fix(Termio *sd)
1312{ 1365{
@@ -1393,6 +1446,7 @@ termio_selection_dbl_fix(Termio *sd)
1393 sd->pty->selection.end.y = end_y; 1446 sd->pty->selection.end.y = end_y;
1394} 1447}
1395 1448
1449/* }}} */
1396 1450
1397static void 1451static void
1398_handle_mouse_down_single_click(Termio *sd, 1452_handle_mouse_down_single_click(Termio *sd,
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index ef07cb9..ca1605c 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -81,12 +81,14 @@ struct _Termatt
81 unsigned short fraktur : 1; 81 unsigned short fraktur : 1;
82 unsigned short framed : 1; 82 unsigned short framed : 1;
83 unsigned short encircled : 1; 83 unsigned short encircled : 1;
84 unsigned short overlined : 1; 84 unsigned short overlined : 1; // TODO: support it
85 unsigned short tab_inserted : 1;
86 unsigned short tab_last : 1;
85#if defined(SUPPORT_80_132_COLUMNS) 87#if defined(SUPPORT_80_132_COLUMNS)
86 unsigned short is_80_132_mode_allowed : 1; 88 unsigned short is_80_132_mode_allowed : 1;
87 unsigned short bit_padding : 11; 89 unsigned short bit_padding : 9;
88#else 90#else
89 unsigned short bit_padding : 12; 91 unsigned short bit_padding : 10;
90#endif 92#endif
91 uint16_t link_id; 93 uint16_t link_id;
92}; 94};
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index a92b4db..25da608 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -207,6 +207,8 @@ _cursor_to_start_of_line(Termpty *ty)
207static void 207static void
208_handle_cursor_control(Termpty *ty, const Eina_Unicode *cc) 208_handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
209{ 209{
210 Termcell *cell;
211
210 switch (*cc) 212 switch (*cc)
211 { 213 {
212 case 0x07: // BEL '\a' (bell) 214 case 0x07: // BEL '\a' (bell)
@@ -220,7 +222,11 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
220 return; 222 return;
221 case 0x09: // HT '\t' (horizontal tab) 223 case 0x09: // HT '\t' (horizontal tab)
222 DBG("->HT"); 224 DBG("->HT");
225 cell = &(TERMPTY_SCREEN(ty, ty->cursor_state.cx, ty->cursor_state.cy));
226 cell->att.tab_inserted = 1;
223 _tab_forward(ty, 1); 227 _tab_forward(ty, 1);
228 cell = &(TERMPTY_SCREEN(ty, ty->cursor_state.cx -1, ty->cursor_state.cy));
229 cell->att.tab_last = 1;
224 return; 230 return;
225 case 0x0a: // LF '\n' (new line) 231 case 0x0a: // LF '\n' (new line)
226 case 0x0b: // VT '\v' (vertical tab) 232 case 0x0b: // VT '\v' (vertical tab)
@@ -3412,7 +3418,7 @@ _eina_unicode_to_hex(Eina_Unicode u)
3412 return -1; 3418 return -1;
3413} 3419}
3414 3420
3415#if defined(__OpenBSD__) 3421#if !defined(HAVE_STRCHRNUL)
3416char * 3422char *
3417strchrnul(const char *s, int c) 3423strchrnul(const char *s, int c)
3418{ 3424{
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index dfc7558..27c4399 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -427,6 +427,8 @@ termpty_reset_att(Termatt *att)
427 att->framed = 0; 427 att->framed = 0;
428 att->encircled = 0; 428 att->encircled = 0;
429 att->overlined = 0; 429 att->overlined = 0;
430 att->tab_inserted = 0;
431 att->tab_last = 0;
430} 432}
431 433
432void 434void
diff --git a/src/bin/win.c b/src/bin/win.c
index f7ef9bc..56d44a8 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -91,7 +91,6 @@ struct _Term
91 Evas_Object *sendfile_request; 91 Evas_Object *sendfile_request;
92 Evas_Object *sendfile_progress; 92 Evas_Object *sendfile_progress;
93 Evas_Object *sendfile_progress_bar; 93 Evas_Object *sendfile_progress_bar;
94 Evas_Object *tabcount_spacer;
95 Evas_Object *tab_spacer; 94 Evas_Object *tab_spacer;
96 Evas_Object *tab_region_base; 95 Evas_Object *tab_region_base;
97 Evas_Object *tab_region_bg; 96 Evas_Object *tab_region_bg;
@@ -2899,7 +2898,7 @@ _tabbar_fill(Tabs *tabs)
2899 edje_object_part_swallow(term->bg, "terminology.tabl.content", o); 2898 edje_object_part_swallow(term->bg, "terminology.tabl.content", o);
2900 evas_object_show(o); 2899 evas_object_show(o);
2901 } 2900 }
2902 //if (i < (n - 1)) 2901 if (i < (n - 1))
2903 { 2902 {
2904 term->tabbar.r.box = o = elm_box_add(tabs->tc.wn->win); 2903 term->tabbar.r.box = o = elm_box_add(tabs->tc.wn->win);
2905 elm_box_horizontal_set(o, EINA_TRUE); 2904 elm_box_horizontal_set(o, EINA_TRUE);
@@ -2925,7 +2924,6 @@ _tabbar_fill(Tabs *tabs)
2925 edje_object_part_text_set(o, "terminology.title", 2924 edje_object_part_text_set(o, "terminology.title",
2926 tab_item->tc->title); 2925 tab_item->tc->title);
2927 edje_object_size_min_calc(o, &w, &h); 2926 edje_object_size_min_calc(o, &w, &h);
2928 ERR("back: w:%d h:%d", w, h);
2929 evas_object_size_hint_min_set(o, w, h); 2927 evas_object_size_hint_min_set(o, w, h);
2930 assert(i != j); 2928 assert(i != j);
2931 if (j < i) 2929 if (j < i)
@@ -3354,11 +3352,13 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3354 next_term = next_solo->term; 3352 next_term = next_solo->term;
3355 config = next_term->config; 3353 config = next_term->config;
3356 3354
3357 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology"); 3355 edje_object_signal_emit(term->bg, "tab_btn,off", "terminology");
3358 if (next_term->tabcount_spacer && !config->show_tabs) 3356 evas_object_del(term->tab_spacer);
3357 term->tab_spacer = NULL;
3358 if (next_term->tab_spacer && !config->show_tabs)
3359 { 3359 {
3360 evas_object_del(next_term->tabcount_spacer); 3360 evas_object_del(next_term->tab_spacer);
3361 next_term->tabcount_spacer = NULL; 3361 next_term->tab_spacer = NULL;
3362 } 3362 }
3363 if (config->show_tabs) 3363 if (config->show_tabs)
3364 _solo_title_show(next_child); 3364 _solo_title_show(next_child);
@@ -3564,10 +3564,10 @@ _tabs_swallow(Term_Container *tc, Term_Container *orig,
3564 solo = (Solo*)orig; 3564 solo = (Solo*)orig;
3565 term = solo->term; 3565 term = solo->term;
3566 edje_object_signal_emit(term->bg, "tabcount,off", "terminology"); 3566 edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
3567 if (term->tabcount_spacer) 3567 if (term->tab_spacer)
3568 { 3568 {
3569 evas_object_del(term->tabcount_spacer); 3569 evas_object_del(term->tab_spacer);
3570 term->tabcount_spacer = NULL; 3570 term->tab_spacer = NULL;
3571 } 3571 }
3572 3572
3573 o = orig->get_evas_object(orig); 3573 o = orig->get_evas_object(orig);
@@ -3669,8 +3669,7 @@ _cb_close(void *data,
3669} 3669}
3670 3670
3671void 3671void
3672main_new(Evas_Object *_win EINA_UNUSED, 3672main_new(Evas_Object *term)
3673 Evas_Object *term)
3674{ 3673{
3675 Term *tm; 3674 Term *tm;
3676 3675
@@ -3874,56 +3873,47 @@ _tabs_refresh(Tabs *tabs)
3874 3873
3875 _tabbar_clear(term); 3874 _tabbar_clear(term);
3876 3875
3877 if (!term->tabcount_spacer) 3876 if (!term->tab_spacer)
3878 { 3877 {
3879 term->tabcount_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg)); 3878 term->tab_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg));
3880 evas_object_color_set(term->tabcount_spacer, 0, 0, 0, 0); 3879 evas_object_color_set(term->tab_spacer, 0, 0, 0, 0);
3881 } 3880 }
3882 elm_coords_finger_size_adjust(1, &w, 1, &h); 3881 elm_coords_finger_size_adjust(1, &w, 1, &h);
3883 evas_object_size_hint_min_set(term->tabcount_spacer, w, h); 3882 evas_object_size_hint_min_set(term->tab_spacer, w, h);
3884 edje_object_part_swallow(term->bg, "terminology.tabcount.control",
3885 term->tabcount_spacer);
3886 edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
3887 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
3888 // this is all below just for tab bar at the top 3883 // this is all below just for tab bar at the top
3889 if (term->config->show_tabs) 3884 if (term->config->show_tabs)
3890 { 3885 {
3891 double v1, v2; 3886 double v1, v2;
3892 3887
3888 edje_object_part_swallow(term->bg, "terminology.tab_btn",
3889 term->tab_spacer);
3890
3893 v1 = (double)(i-1) / (double)n; 3891 v1 = (double)(i-1) / (double)n;
3894 v2 = (double)i / (double)n; 3892 v2 = (double)i / (double)n;
3895 edje_object_signal_emit(term->bg, "tabcount,off", "terminology"); 3893 edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
3896 elm_coords_finger_size_adjust(1, &w, 1, &h);
3897 3894
3898 if (!term->tab_spacer) 3895 edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer);
3899 { 3896 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
3900 term->tab_spacer = evas_object_rectangle_add( 3897 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3901 evas_object_evas_get(term->bg)); 3898 edje_object_part_text_set(term->bg, "terminology.tab.title",
3902 evas_object_color_set(term->tab_spacer, 0, 0, 0, 0); 3899 solo->tc.title);
3903 evas_object_size_hint_min_set(term->tab_spacer, w, h); 3900 edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
3904 edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer); 3901 edje_object_signal_emit(term->bg, "tab_btn,on", "terminology");
3905 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
3906 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3907 edje_object_part_text_set(term->bg, "terminology.tab.title",
3908 solo->tc.title);
3909 edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
3910 }
3911 else
3912 {
3913 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
3914 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3915 }
3916 _tabbar_fill(tabs); 3902 _tabbar_fill(tabs);
3917 } 3903 }
3918 else 3904 else
3919 { 3905 {
3906 edje_object_part_swallow(term->bg, "terminology.tabcount.control",
3907 term->tab_spacer);
3908 edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
3909 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
3920 edje_object_signal_emit(term->bg, "tabcount,on", "terminology"); 3910 edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
3921 _tabbar_clear(term); 3911 _tabbar_clear(term);
3912 if (missed > 0)
3913 edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
3914 else
3915 edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
3922 } 3916 }
3923 if (missed > 0)
3924 edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
3925 else
3926 edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
3927 edje_object_message_signal_process(term->bg); 3917 edje_object_message_signal_process(term->bg);
3928} 3918}
3929 3919
@@ -5187,15 +5177,25 @@ _cb_command(void *data,
5187} 5177}
5188 5178
5189static void 5179static void
5190_cb_tabcount_go(void *data, 5180_cb_tab_go(void *data,
5191 Evas_Object *_obj EINA_UNUSED, 5181 Evas_Object *_obj EINA_UNUSED,
5192 const char *_sig EINA_UNUSED, 5182 const char *_sig EINA_UNUSED,
5193 const char *_src EINA_UNUSED) 5183 const char *_src EINA_UNUSED)
5194{ 5184{
5195 _cb_select(data, NULL, NULL); 5185 _cb_select(data, NULL, NULL);
5196} 5186}
5197 5187
5198static void 5188static void
5189_cb_tab_new(void *data,
5190 Evas_Object *_obj EINA_UNUSED,
5191 const char *_sig EINA_UNUSED,
5192 const char *_src EINA_UNUSED)
5193{
5194 Term *term = data;
5195 main_new(term->termio);
5196}
5197
5198static void
5199_cb_prev(void *data, 5199_cb_prev(void *data,
5200 Evas_Object *_obj EINA_UNUSED, 5200 Evas_Object *_obj EINA_UNUSED,
5201 void *_event EINA_UNUSED) 5201 void *_event EINA_UNUSED)
@@ -5662,16 +5662,16 @@ _term_free(Term *term)
5662 5662
5663 _term_tabregion_free(term); 5663 _term_tabregion_free(term);
5664 5664
5665 if (term->tabcount_spacer) 5665 if (term->tab_spacer)
5666 { 5666 {
5667 evas_object_del(term->tabcount_spacer); 5667 evas_object_del(term->tab_spacer);
5668 term->tabcount_spacer = NULL; 5668 term->tab_spacer = NULL;
5669 } 5669 }
5670 free(term); 5670 free(term);
5671} 5671}
5672 5672
5673static void 5673static void
5674_cb_tabcount_prev(void *data, 5674_cb_tab_prev(void *data,
5675 Evas_Object *_obj EINA_UNUSED, 5675 Evas_Object *_obj EINA_UNUSED,
5676 const char *_sig EINA_UNUSED, 5676 const char *_sig EINA_UNUSED,
5677 const char *_src EINA_UNUSED) 5677 const char *_src EINA_UNUSED)
@@ -5680,7 +5680,7 @@ _cb_tabcount_prev(void *data,
5680} 5680}
5681 5681
5682static void 5682static void
5683_cb_tabcount_next(void *data, 5683_cb_tab_next(void *data,
5684 Evas_Object *_obj EINA_UNUSED, 5684 Evas_Object *_obj EINA_UNUSED,
5685 const char *_sig EINA_UNUSED, 5685 const char *_sig EINA_UNUSED,
5686 const char *_src EINA_UNUSED) 5686 const char *_src EINA_UNUSED)
@@ -5698,12 +5698,14 @@ _term_bg_config(Term *term)
5698 termio_theme_set(term->termio, term->bg); 5698 termio_theme_set(term->termio, term->bg);
5699 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology", 5699 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
5700 _cb_popmedia_done, term); 5700 _cb_popmedia_done, term);
5701 edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology", 5701 edje_object_signal_callback_add(term->bg, "tab,go", "terminology",
5702 _cb_tabcount_go, term); 5702 _cb_tab_go, term);
5703 edje_object_signal_callback_add(term->bg, "tabcount,prev", "terminology", 5703 edje_object_signal_callback_add(term->bg, "tab,new", "terminology",
5704 _cb_tabcount_prev, term); 5704 _cb_tab_new, term);
5705 edje_object_signal_callback_add(term->bg, "tabcount,next", "terminology", 5705 edje_object_signal_callback_add(term->bg, "tab,prev", "terminology",
5706 _cb_tabcount_next, term); 5706 _cb_tab_prev, term);
5707 edje_object_signal_callback_add(term->bg, "tab,next", "terminology",
5708 _cb_tab_next, term);
5707 edje_object_signal_callback_add(term->bg, "tab,close", "terminology", 5709 edje_object_signal_callback_add(term->bg, "tab,close", "terminology",
5708 _cb_tab_close, term); 5710 _cb_tab_close, term);
5709 edje_object_signal_callback_add(term->bg, "tab,title", "terminology", 5711 edje_object_signal_callback_add(term->bg, "tab,title", "terminology",
@@ -5790,7 +5792,6 @@ _cb_tabregion_change(void *data,
5790 5792
5791 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 5793 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
5792 evas_object_size_hint_min_set(term->tab_region_base, w, h); 5794 evas_object_size_hint_min_set(term->tab_region_base, w, h);
5793 ERR("tab region %d %d", w ,h);
5794 elm_layout_content_set(term->base, "terminology.tabregion", 5795 elm_layout_content_set(term->base, "terminology.tabregion",
5795 term->tab_region_base); 5796 term->tab_region_base);
5796} 5797}