mv utils.{c,h} theme.{c,h}

This commit is contained in:
Boris Faure 2020-06-23 12:48:27 +02:00
parent a6828665dc
commit ab35c9b7dd
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
21 changed files with 55 additions and 47 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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"

View File

@ -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;

View File

@ -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',

View File

@ -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"

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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>

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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"