billiob pushed a commit to branch master.

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

commit ab35c9b7ddf5fd2692bd434c949bd681f0fe41b6
Author: Boris Faure <[email protected]>
Date:   Tue Jun 23 12:48:27 2020 +0200

    mv utils.{c,h} theme.{c,h}
---
 src/bin/config.c             | 28 +---------------------------
 src/bin/gravatar.c           |  2 +-
 src/bin/main.c               |  2 +-
 src/bin/media.c              |  2 +-
 src/bin/meson.build          |  6 +++---
 src/bin/miniview.c           |  2 +-
 src/bin/options_behavior.c   |  2 +-
 src/bin/options_elm.c        |  2 +-
 src/bin/options_font.c       |  2 +-
 src/bin/options_keys.c       |  2 +-
 src/bin/options_theme.c      |  2 +-
 src/bin/options_themepv.c    |  2 +-
 src/bin/sel.c                |  2 +-
 src/bin/termcmd.c            |  2 +-
 src/bin/termio.c             |  2 +-
 src/bin/termiolink.c         |  2 +-
 src/bin/termptyesc.c         |  2 +-
 src/bin/{utils.c => theme.c} | 30 +++++++++++++++++++++++++++++-
 src/bin/{utils.h => theme.h} |  0
 src/bin/tytest_common.c      |  6 ++++++
 src/bin/win.c                |  2 +-
 21 files changed, 55 insertions(+), 47 deletions(-)

diff --git a/src/bin/config.c b/src/bin/config.c
index b270b24..8be96c2 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -5,7 +5,7 @@
 #include "config.h"
 #include "main.h"
 #include "col.h"
-#include "utils.h"
+#include "theme.h"
 
 #define CONF_VER 25
 #define CONFIG_KEY "config"
@@ -899,29 +899,3 @@ config_del(Config *config)
    free(config);
 }
 
-const char *
-config_theme_path_get(const Config *config)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
-
-   if (strchr(config->theme, '/'))
-     return config->theme;
-
-   return theme_path_get(config->theme);
-}
-
-const char *
-config_theme_path_default_get(const Config *config)
-{
-   static char path[PATH_MAX] = "";
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
-
-   if (path[0]) return path;
-
-   snprintf(path, sizeof(path), "%s/themes/default.edj",
-            elm_app_data_dir_get());
-   return path;
-}
diff --git a/src/bin/gravatar.c b/src/bin/gravatar.c
index fbcf57a..1aee690 100644
--- a/src/bin/gravatar.c
+++ b/src/bin/gravatar.c
@@ -7,7 +7,7 @@
 #include "termio.h"
 #include "media.h"
 #include "md5.h"
-#include "utils.h"
+#include "theme.h"
 
 /* specific log domain to help debug the gravatar module */
 int _gravatar_log_dom = -1;
diff --git a/src/bin/main.c b/src/bin/main.c
index 8c3d5fb..917e50b 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -13,7 +13,7 @@
 #include "config.h"
 #include "controls.h"
 #include "media.h"
-#include "utils.h"
+#include "theme.h"
 #include "ipc.h"
 #include "sel.h"
 #include "miniview.h"
diff --git a/src/bin/media.c b/src/bin/media.c
index 3004077..84e8bb7 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -8,7 +8,7 @@
 #include <unistd.h>
 #include "media.h"
 #include "config.h"
-#include "utils.h"
+#include "theme.h"
 #include "termiolink.h"
 
 typedef struct _Media Media;
diff --git a/src/bin/meson.build b/src/bin/meson.build
index ef8158d..f2d3899 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -34,7 +34,7 @@ terminology_sources = ['private.h',
                        'md5.c', 'md5.h',
                        'utf8.c', 'utf8.h',
                        'win.c', 'win.h',
-                       'utils.c', 'utils.h',
+                       'theme.c', 'theme.h',
                        'extns.c', 'extns.h',
                        'gravatar.c', 'gravatar.h',
                        'tty_keys.h',
@@ -59,8 +59,8 @@ tyfuzz_sources = ['termptyesc.c', 'termptyesc.h',
                   'config.c', 'config.h',
                   'col.c', 'col.h',
                   'sb.c', 'sb.h',
+                  'theme.h',
                   'utf8.c', 'utf8.h',
-                  'utils.c', 'utils.h',
                   'tytest_common.c', 'tytest_common.h',
                   'tyfuzz.c']
 tytest_sources = ['termptyesc.c', 'termptyesc.h',
@@ -76,7 +76,7 @@ tytest_sources = ['termptyesc.c', 'termptyesc.h',
                   'col.c', 'col.h',
                   'sb.c', 'sb.h',
                   'utf8.c', 'utf8.h',
-                  'utils.c', 'utils.h',
+                  'theme.h',
                   'md5.c', 'md5.h',
                   'unit_tests.h',
                   'tytest_common.c', 'tytest_common.h',
diff --git a/src/bin/miniview.c b/src/bin/miniview.c
index 6d5f4f7..4ac49d1 100644
--- a/src/bin/miniview.c
+++ b/src/bin/miniview.c
@@ -10,7 +10,7 @@
 #include "termio.h"
 #include "termiointernals.h"
 #include "miniview.h"
-#include "utils.h"
+#include "theme.h"
 #include "main.h"
 #include "backlog.h"
 
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index cd52a33..8d91f65 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -11,7 +11,7 @@
 #include "options.h"
 #include "options_behavior.h"
 #include "main.h"
-#include "utils.h"
+#include "theme.h"
 
 typedef struct _Behavior_Ctx {
      Config *config;
diff --git a/src/bin/options_elm.c b/src/bin/options_elm.c
index eba1c0c..0ff1d09 100644
--- a/src/bin/options_elm.c
+++ b/src/bin/options_elm.c
@@ -3,7 +3,7 @@
 #include <Elementary.h>
 #include "options.h"
 #include "options_elm.h"
-#include "utils.h"
+#include "theme.h"
 
 static char *_elementary_config = NULL;
 static void
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index 696c3ef..58f0716 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -6,7 +6,7 @@
 #include "termio.h"
 #include "options.h"
 #include "options_font.h"
-#include "utils.h"
+#include "theme.h"
 
 #define TEST_STRING "oislOIS.015!|,"
 #define FONT_MIN 5
diff --git a/src/bin/options_keys.c b/src/bin/options_keys.c
index 47f088f..673f75b 100644
--- a/src/bin/options_keys.c
+++ b/src/bin/options_keys.c
@@ -7,7 +7,7 @@
 #include "options.h"
 #include "options_keys.h"
 #include "keyin.h"
-#include "utils.h"
+#include "theme.h"
 
 typedef struct _Keys_Ctx {
      Config *config;
diff --git a/src/bin/options_theme.c b/src/bin/options_theme.c
index 32ced92..2fa02d4 100644
--- a/src/bin/options_theme.c
+++ b/src/bin/options_theme.c
@@ -8,7 +8,7 @@
 #include "options.h"
 #include "options_theme.h"
 #include "options_themepv.h"
-#include "utils.h"
+#include "theme.h"
 #include "main.h"
 
 typedef struct _Theme_Ctx
diff --git a/src/bin/options_themepv.c b/src/bin/options_themepv.c
index e84e2cb..58618a1 100644
--- a/src/bin/options_themepv.c
+++ b/src/bin/options_themepv.c
@@ -6,7 +6,7 @@
 #include "termpty.h"
 #include "options.h"
 #include "options_themepv.h"
-#include "utils.h"
+#include "theme.h"
 #include "main.h"
 #include "col.h"
 
diff --git a/src/bin/sel.c b/src/bin/sel.c
index 46a0470..da54a8f 100644
--- a/src/bin/sel.c
+++ b/src/bin/sel.c
@@ -5,7 +5,7 @@
 #include <unistd.h>
 #include "sel.h"
 #include "config.h"
-#include "utils.h"
+#include "theme.h"
 #include "win.h"
 #include "term_container.h"
 
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index e038bfc..70ff939 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -7,7 +7,7 @@
 #include "config.h"
 #include "controls.h"
 #include "media.h"
-#include "utils.h"
+#include "theme.h"
 #include "termcmd.h"
 
 static Eina_Bool
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 64c4f57..b07fda3 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -14,7 +14,7 @@
 #include "col.h"
 #include "keyin.h"
 #include "config.h"
-#include "utils.h"
+#include "theme.h"
 #include "media.h"
 #include "miniview.h"
 #include "gravatar.h"
diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c
index d9bc384..69f2f35 100644
--- a/src/bin/termiolink.c
+++ b/src/bin/termiolink.c
@@ -11,7 +11,7 @@
 #include "termio.h"
 #include "sb.h"
 #include "utf8.h"
-#include "utils.h"
+#include "theme.h"
 #else
 #include <assert.h>
 #include <math.h>
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index a196f41..7197956 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -9,7 +9,7 @@
 #include "termptyesc.h"
 #include "termptyops.h"
 #include "termptyext.h"
-#include "utils.h"
+#include "theme.h"
 #if defined(BINARY_TYTEST)
 #include "tytest.h"
 #endif
diff --git a/src/bin/utils.c b/src/bin/theme.c
similarity index 88%
rename from src/bin/utils.c
rename to src/bin/theme.c
index e0d3896..0f9e4f2 100644
--- a/src/bin/utils.c
+++ b/src/bin/theme.c
@@ -1,5 +1,6 @@
 #include "private.h"
-#include "utils.h"
+#include "theme.h"
+#include "config.h"
 #include <unistd.h>
 #include <pwd.h>
 
@@ -25,6 +26,33 @@ theme_path_get(const char *name)
    return path1;
 }
 
+const char *
+config_theme_path_get(const Config *config)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
+
+   if (strchr(config->theme, '/'))
+     return config->theme;
+
+   return theme_path_get(config->theme);
+}
+
+const char *
+config_theme_path_default_get(const Config *config)
+{
+   static char path[PATH_MAX] = "";
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
+
+   if (path[0]) return path;
+
+   snprintf(path, sizeof(path), "%s/themes/default.edj",
+            elm_app_data_dir_get());
+   return path;
+}
+
 Eina_Bool
 theme_apply(Evas_Object *edje, const Config *config, const char *group)
 {
diff --git a/src/bin/utils.h b/src/bin/theme.h
similarity index 100%
rename from src/bin/utils.h
rename to src/bin/theme.h
diff --git a/src/bin/tytest_common.c b/src/bin/tytest_common.c
index 6cbfa91..fa4e1cb 100644
--- a/src/bin/tytest_common.c
+++ b/src/bin/tytest_common.c
@@ -306,6 +306,12 @@ termio_color_class_set(Evas_Object *termio EINA_UNUSED, 
const char *key,
    return -1;
 }
 
+Eina_Bool
+homedir_get(char *buf, size_t size)
+{
+   return eina_strlcpy(buf, "/home/foo", size) < size;
+}
+
 void
 termio_reset_main_colors(Evas_Object *termio EINA_UNUSED)
 {
diff --git a/src/bin/win.c b/src/bin/win.c
index f1368b4..235eaa8 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -13,7 +13,7 @@
 #include "gravatar.h"
 #include "media.h"
 #include "termio.h"
-#include "utils.h"
+#include "theme.h"
 #include "sel.h"
 #include "controls.h"
 #include "keyin.h"

-- 


Reply via email to