raster pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=870d592139b5e4d962154799183bbb46931e5924

commit 870d592139b5e4d962154799183bbb46931e5924
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Wed Jan 22 20:31:37 2014 +0900

    set EMOTION_ENGINE to tyls (and ethumb etc.) can use it inside shell
    
    this should fix T291
---
 src/bin/termio.c  | 19 ++++++++++++++++---
 src/bin/termpty.c |  8 +++++++-
 src/bin/termpty.h |  2 +-
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index dbd686e..44b697c 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -4430,7 +4430,16 @@ termio_add(Evas_Object *parent, Config *config, const 
char *cmd, Eina_Bool login
    Evas *e;
    Evas_Object *obj, *g;
    Termio *sd;
-
+   char *modules[] =
+     {
+        NULL,
+        "gstreamer",
+        "xine",
+        "vlc",
+        "gstreamer1"
+     };
+   char *mod = NULL;
+   
    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
    e = evas_object_evas_get(parent);
    if (!e) return NULL;
@@ -4440,6 +4449,10 @@ termio_add(Evas_Object *parent, Config *config, const 
char *cmd, Eina_Bool login
    sd = evas_object_smart_data_get(obj);
    EINA_SAFETY_ON_NULL_RETURN_VAL(sd, obj);
 
+   if ((config->vidmod >= 0) &&
+       (config->vidmod < (int)EINA_C_ARRAY_LENGTH(modules)))
+     mod = modules[config->vidmod];
+
    termio_config_set(obj, config);
 
    sd->glayer = g = elm_gesture_layer_add(parent);
@@ -4470,9 +4483,9 @@ termio_add(Evas_Object *parent, Config *config, const 
char *cmd, Eina_Bool login
                        _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);
+                         config->xterm_256color, config->erase_is_del, mod);
    if (!sd->pty)
      {
         ERR("Cannot allocate termpty");
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 5b6b394..d7899eb 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -272,7 +272,7 @@ _limit_coord(Termpty *ty, Termstate *state)
 Termpty *
 termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
             int w, int h, int backscroll, Eina_Bool xterm_256color,
-            Eina_Bool erase_is_del)
+            Eina_Bool erase_is_del, const char *emotion_mod)
 {
    Termpty *ty;
    const char *pty;
@@ -369,6 +369,7 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const 
char *cd,
         const char *args[4] = {NULL, NULL, NULL, NULL};
         Eina_Bool needs_shell;
         int i;
+        char buf[256];
 
         if (cd)
           {
@@ -443,6 +444,11 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const 
char *cd,
              putenv("TERM=xterm");
           }
         putenv("XTERM_256_COLORS=1");
+        if (emotion_mod)
+          {
+             snprintf(buf, sizeof(buf), "EMOTION_ENGINE=%s", emotion_mod);
+             putenv(buf);
+          }
         if (!login_shell)
           execvp(args[0], (char *const *)args);
         else
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index e818186..31fa456 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -208,7 +208,7 @@ void       termpty_shutdown(void);
 
 Termpty   *termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
                       int w, int h, int backscroll, Eina_Bool xterm_256color,
-                      Eina_Bool erase_is_del);
+                      Eina_Bool erase_is_del, const char *emotion_mod);
 void       termpty_free(Termpty *ty);
 void       termpty_cellcomp_freeze(Termpty *ty);
 void       termpty_cellcomp_thaw(Termpty *ty);

-- 


Reply via email to