From dad9e0db58856f1ce392fe1899710c766d7aacc4 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 13 Mar 2018 18:58:41 +0100 Subject: [PATCH] remove compatibility #ifs to work with EFL < 1.16 --- data/themes/default.edc | 36 ------------------------------------ data/themes/mild.edc | 10 ---------- src/bin/media.c | 19 +------------------ src/bin/termio.c | 15 ++------------- src/bin/termpty.c | 6 ------ src/bin/termptyesc.c | 8 +------- src/bin/tyfuzz.c | 6 ------ src/bin/win.c | 11 ++--------- 8 files changed, 6 insertions(+), 105 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 715f9315..89fc7bc2 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -1212,12 +1212,10 @@ collections { target: "shine_unfocused"; target: "shine_focused"; after: "focus_in2"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) sequence { action: STATE_SET "custom" 0.0; target: "shine_focused"; } -#endif } program { signal: "focused,set"; source: "terminology"; @@ -1225,7 +1223,6 @@ collections { target: "glint"; target: "shine_focused"; target: "shine_unfocused"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) sequence { action: STATE_SET "focused2" 0.0; target: "glow"; @@ -1234,7 +1231,6 @@ collections { action: STATE_SET "custom" 0.0; target: "shine_focused"; } -#endif } program { name: "focus_in2"; action: STATE_SET "focused2" 0.0; @@ -1248,7 +1244,6 @@ collections { target: "glow"; target: "shine_focused"; target: "shine_unfocused"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) sequence { action: STATE_SET "focused2" 0.0; target: "glow"; @@ -1257,7 +1252,6 @@ collections { action: STATE_SET "custom" 0.0; target: "shine_unfocused"; } -#endif } //////////////////////////////////////////////////////////////////// @@ -1578,11 +1572,7 @@ collections { } program { signal: "bell,ring"; source: "terminology"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "bell" 1.0 ALERT; -#else - action: PLAY_SAMPLE "bell" 1.0; -#endif } program { signal: "bell"; source: "terminology"; @@ -3583,51 +3573,25 @@ target: "0.clip"; target: "1.clip"; target: "2.clip"; target: "3.clip"; target: program { signal: "key,down"; source: "terminology"; script { -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 8) new buf[32]; snprintf(buf, 31, "key-down%i", (rand() % 5) + 1); run_program(get_program_id(buf)); -#else - run_program(PROGRAM:"key-down4"); // chosen by a fair dice roll - // guaranteed to be random. - // http://xkcd.com/221/ -#endif } } program { name: "key-down1"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "key-tap1" 1.0 INPUT; -#else - action: PLAY_SAMPLE "key-tap1" 1.0; -#endif } program { name: "key-down2"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "key-tap2" 1.0 INPUT; -#else - action: PLAY_SAMPLE "key-tap2" 1.0; -#endif } program { name: "key-down3"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "key-tap3" 1.0 INPUT; -#else - action: PLAY_SAMPLE "key-tap3" 1.0; -#endif } program { name: "key-down4"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "key-tap4" 1.0 INPUT; -#else - action: PLAY_SAMPLE "key-tap4" 1.0; -#endif } program { name: "key-down5"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "key-tap5" 1.0 INPUT; -#else - action: PLAY_SAMPLE "key-tap5" 1.0; -#endif } program { signal: "key,down"; source: "terminology"; diff --git a/data/themes/mild.edc b/data/themes/mild.edc index bf3a6726..4a51c4bb 100644 --- a/data/themes/mild.edc +++ b/data/themes/mild.edc @@ -217,11 +217,7 @@ collections { } program { signal: "bell,ring"; source: "terminology"; -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 9) action: PLAY_SAMPLE "bell" 1.0 ALERT; -#else - action: PLAY_SAMPLE "bell" 1.0; -#endif } program { signal: "bell"; @@ -1658,15 +1654,9 @@ collections { program { signal: "key,down"; source: "terminology"; script { -#if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 8) new buf[32]; snprintf(buf, 31, "key-down%i", (rand() % 5) + 1); run_program(get_program_id(buf)); -#else - run_program(PROGRAM:"key-down4"); // chosen by a fair dice roll - // guaranteed to be random. - // http://xkcd.com/221/ -#endif } } program { name: "key-down1"; diff --git a/src/bin/media.c b/src/bin/media.c index e1af48bf..29381a08 100644 --- a/src/bin/media.c +++ b/src/bin/media.c @@ -1351,25 +1351,8 @@ media_add(Evas_Object *parent, const char *src, const Config *config, int mode, } #endif -#if (ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 13) if (!sd->url) - { - Efreet_Uri *uri; - const char *file_path = eina_stringshare_printf("file://%s", sd->src); - uri = efreet_uri_decode(file_path); - eina_stringshare_del(file_path); - if (!uri) - { - ERR("can not decode '%s'", sd->src); - goto err; - } - sd->realf = uri->path; - eina_stringshare_ref(sd->realf); - efreet_uri_free(uri); - } -#else - if (!sd->url) sd->realf = eina_stringshare_add(sd->src); -#endif + sd->realf = eina_stringshare_add(sd->src); if ((mode & MEDIA_SIZE_MASK) == MEDIA_THUMB) { diff --git a/src/bin/termio.c b/src/bin/termio.c index 36067511..cc280286 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -1092,7 +1092,6 @@ _cb_link_up(void *data, } } -#if !((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) static void _cb_link_drag_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y, Elm_Xdnd_Action action) { @@ -1148,16 +1147,12 @@ _cb_link_icon_new(void *data, Evas_Object *par, Evas_Coord *xoff, Evas_Coord *yo *yoff = 0; return icon; } -#endif static void _cb_link_move(void *data, Evas *_e EINA_UNUSED, - Evas_Object *obj -#if ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) - EINA_UNUSED -#endif - , void *event) + Evas_Object *obj, + void *event) { Evas_Event_Mouse_Move *ev = event; Termio *sd = evas_object_smart_data_get(data); @@ -1174,7 +1169,6 @@ _cb_link_move(void *data, { sd->link.down.down = EINA_FALSE; sd->link.down.dnd = EINA_TRUE; -#if !((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) DBG("dnd start %s %i %i", sd->link.string, evas_key_modifier_is_set(ev->modifiers, "Control"), evas_key_modifier_is_set(ev->modifiers, "Shift")); @@ -1194,7 +1188,6 @@ _cb_link_move(void *data, _cb_link_drag_done, data); sd->link.down.dndobj = obj; sd->link.down.dndobjdel = EINA_FALSE; -#endif } } @@ -5916,7 +5909,6 @@ _smart_pty_command(void *data) evas_object_smart_callback_call(obj, "command", (void *)ty->cur_cmd); } -#if !((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) static void _smart_cb_drag_enter(void *_data EINA_UNUSED, Evas_Object *_o EINA_UNUSED) { @@ -5993,7 +5985,6 @@ _smart_cb_drop(void *data, termpty_write(sd->pty, ev->data, ev->len); return EINA_TRUE; } -#endif /* }}} */ @@ -6053,14 +6044,12 @@ termio_add(Evas_Object *win, Config *config, ELM_GESTURE_STATE_ABORT, _smart_cb_gest_zoom_abort, obj); -#if !((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) elm_drop_target_add(sd->event, ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_IMAGE, _smart_cb_drag_enter, obj, _smart_cb_drag_leave, obj, _smart_cb_drag_pos, obj, _smart_cb_drop, obj); -#endif sd->pty = termpty_new(cmd, login_shell, cd, w, h, config->scrollback, config->xterm_256color, config->erase_is_del, mod, diff --git a/src/bin/termpty.c b/src/bin/termpty.c index e8576769..a3e5f58c 100644 --- a/src/bin/termpty.c +++ b/src/bin/termpty.c @@ -300,15 +300,9 @@ _fd_read_do(Termpty *ty, Ecore_Fd_Handler *fd_handler, Eina_Bool false_on_empty) if (buf[i]) { -#if (EINA_VERSION_MAJOR > 1) || (EINA_VERSION_MINOR >= 8) g = eina_unicode_utf8_next_get(buf, &i); if ((0xdc80 <= g) && (g <= 0xdcff) && (len - prev_i) <= (int)sizeof(ty->oldbuf)) -#else - i = evas_string_char_next_get(buf, i, &g); - if (i < 0 && - (len - prev_i) <= (int)sizeof(ty->oldbuf)) -#endif { for (k = 0; (k < (int)sizeof(ty->oldbuf)) && diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 3cc4e204..63aabe15 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -1748,13 +1748,8 @@ _handle_xterm_50_command(Termpty *ty, static void _handle_xterm_777_command(Termpty *_ty EINA_UNUSED, - char *s -#if ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)) - EINA_UNUSED -#endif - , int _len EINA_UNUSED) + char *s, int _len EINA_UNUSED) { -#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 8) char *cmd_end = NULL, *title = NULL, *title_end = NULL, @@ -1790,7 +1785,6 @@ _handle_xterm_777_command(Termpty *_ty EINA_UNUSED, NULL, NULL); *cmd_end = ';'; *title_end = ';'; -#endif } static int diff --git a/src/bin/tyfuzz.c b/src/bin/tyfuzz.c index 311ed2b0..b0e817e6 100644 --- a/src/bin/tyfuzz.c +++ b/src/bin/tyfuzz.c @@ -138,15 +138,9 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED) if (buf[i]) { -#if (EINA_VERSION_MAJOR > 1) || (EINA_VERSION_MINOR >= 8) g = eina_unicode_utf8_next_get(buf, &i); if ((0xdc80 <= g) && (g <= 0xdcff) && (len - prev_i) <= (int)sizeof(ty.oldbuf)) -#else - i = evas_string_char_next_get(buf, i, &g); - if (i < 0 && - (len - prev_i) <= (int)sizeof(ty.oldbuf)) -#endif { for (k = 0; (k < (int)sizeof(ty.oldbuf)) && diff --git a/src/bin/win.c b/src/bin/win.c index 0223fcb9..919cd2be 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -58,13 +58,8 @@ int _win_log_dom = -1; #define INF(...) EINA_LOG_DOM_INFO(_win_log_dom, __VA_ARGS__) #define DBG(...) EINA_LOG_DOM_DBG(_win_log_dom, __VA_ARGS__) -#if (ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8) - #define PANES_TOP "left" - #define PANES_BOTTOM "right" -#else - #define PANES_TOP "top" - #define PANES_BOTTOM "bottom" -#endif +#define PANES_TOP "top" +#define PANES_BOTTOM "bottom" /* {{{ Structs */ @@ -2689,9 +2684,7 @@ _tabs_restore(Tabs *tabs) { if (term->unswallowed) { -#if (EVAS_VERSION_MAJOR > 1) || (EVAS_VERSION_MINOR >= 8) evas_object_image_source_visible_set(term->sel, EINA_TRUE); -#endif edje_object_part_swallow(term->bg, "terminology.content", term->base); term->unswallowed = EINA_FALSE; evas_object_show(term->base);