Merge in from 0.6.1 release branch

This commit is contained in:
Andy Williams 2018-05-15 16:01:01 +01:00
commit 83b616446c
25 changed files with 211 additions and 499 deletions

16
NEWS
View File

@ -1,5 +1,5 @@
=======
Edi 0.8
Edi 0.7
=======
Features:
@ -7,10 +7,13 @@ Features:
* Added theme support and new themes.
* Added editor translucency option.
Bug fixes:
=======
Edi 0.7
=======
*
---------
Edi 0.6.1
---------
Features:
@ -18,10 +21,15 @@ Features:
* Added split-view option for editors.
* Updated project wizard and added new project templates.
* Include EFL examples in project wizard.
* Add support for Go projects.
* Improved debugging support.
* Added edi_scm helper command.
* Replace all in project.
Bug fixes:
* overall stability of the SCM git integration
=======
Edi 0.6
=======

View File

@ -11,7 +11,7 @@ and in creating apps based on the EFL suite.
meson
ninja
EFL from git master (>= 1.20.99)
EFL latest release (>= 1.20.7)
libclang-dev (or llvm-clang-devel)
## Installation

View File

@ -6,11 +6,13 @@ skeleton_names = ['eflproject', 'eflproject_python']
foreach skeleton_name : skeleton_names
custom_target('skeleton ' + skeleton_name,
command : [tar, 'zcf', '@OUTPUT@', '-C', '../data/extra/templates/skeletons', skeleton_name],
input : 'skeletons' + '/' + skeleton_name,
output : skeleton_name + '.tar.gz',
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'edi', 'templates'),
install : true,
command : [tar, 'zcf', '@OUTPUT@', '-C',
join_paths(meson.source_root(), 'data', 'extra', 'templates', 'skeletons'),
skeleton_name],
input : join_paths('skeletons', skeleton_name),
output : skeleton_name + '.tar.gz',
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'edi', 'templates'),
install : true,
)
endforeach

View File

@ -2,4 +2,3 @@ subdir('desktop')
subdir('images')
subdir('extra/templates')
subdir('extra/examples')
subdir('themes')

View File

@ -1,23 +0,0 @@
edje_cc = find_program('edje_cc')
cmd = [ edje_cc,
'-id', join_paths(meson.source_root(), 'data' , 'themes'),
'@INPUT@', '@OUTPUT@'
]
theme_names = ['white', 'solarized', 'solarized_dark']
foreach theme_name : theme_names
custom_target('theme ' + theme_name,
input : theme_name + '.edc',
output : theme_name + '.edj',
command: cmd,
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'edi', 'themes'),
install: true,
)
out = join_paths(get_option('prefix'), get_option('datadir'), 'edi', 'themes', theme_name + '.edj')
meson.add_install_script('../../scripts/world_read.sh', out)
endforeach

View File

@ -1,64 +0,0 @@
data {
item: "title" "Solarized";
}
collections {
/* simple layout to pack our scrolling content into an elm_layout */
group { name: "elm/code/layout/default";
data {
item: "font.name" "Mono";
item: "font.size" "10";
}
parts {
part { name: "elm.swallow.content"; type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.0;
fixed: 0 1;
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
}
}
}
}
color_classes {
color_class { name: "elm/code/status/default"; color: 253 246 227 255; }
color_class { name: "elm/code/status/current"; color: 238 232 213 255; }
color_class { name: "elm/code/status/ignored"; color: 36 36 36 255; }
color_class { name: "elm/code/status/note"; color: 221 119 17 255; }
color_class { name: "elm/code/status/warning"; color: 221 119 17 255; }
color_class { name: "elm/code/status/error"; color: 204 17 17 255; }
color_class { name: "elm/code/status/fatal"; color: 204 17 17 255; }
color_class { name: "elm/code/status/added"; color: 36 96 36 255; }
color_class { name: "elm/code/status/removed"; color: 96 36 36 255; }
color_class { name: "elm/code/status/changed"; color: 36 36 96 255; }
color_class { name: "elm/code/status/passed"; color: 54 96 54 255; }
color_class { name: "elm/code/status/failed"; color: 96 54 54 255; }
color_class { name: "elm/code/status/todo"; color: 211 54 130 255; }
color_class { name: "elm/code/token/default"; color: 88 110 117 255; }
color_class { name: "elm/code/token/comment"; color: 147 161 161 255; }
color_class { name: "elm/code/token/string"; color: 42 161 152 255; }
color_class { name: "elm/code/token/number"; color: 42 161 152 255; }
color_class { name: "elm/code/token/brace"; color: 101 123 131 255; }
color_class { name: "elm/code/token/type"; color: 181 137 0 255; }
color_class { name: "elm/code/token/class"; color: 255 255 255 255; }
color_class { name: "elm/code/token/function"; color: 255 255 255 255; }
color_class { name: "elm/code/token/param"; color: 133 153 0 255; }
color_class { name: "elm/code/token/keyword"; color: 133 153 0 255; }
color_class { name: "elm/code/token/preprocessor"; color: 203 75 22 255; }
color_class { name: "elm/code/token/added"; color: 54 255 54 255; }
color_class { name: "elm/code/token/removed"; color: 255 54 54 255; }
color_class { name: "elm/code/token/changed"; color: 54 54 255 255; }
color_class { name: "elm/code/token/match"; color: 187 187 51 255; }
color_class { name: "elm/code/widget/color/selection"; color: 133 153 0 255; }
color_class { name: "elm/code/widget/color/gutter/bg"; color: 238 232 213 255; }
color_class { name: "elm/code/widget/color/gutter/fg"; color: 147 161 161 255; }
color_class { name: "elm/code/widget/color/gutter/scope/bg"; color: 54 54 54 255; }
color_class { name: "elm/code/widget/color/whitespace"; color: 50 50 50 127; }
}
}

View File

@ -1,65 +0,0 @@
data {
item: "title" "Solarized Dark";
}
collections {
/* simple layout to pack our scrolling content into an elm_layout */
group { name: "elm/code/layout/default";
data {
item: "font.name" "Mono";
item: "font.size" "10";
}
parts {
part { name: "elm.swallow.content"; type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.0;
fixed: 0 1;
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
}
}
}
}
color_classes {
color_class { name: "elm/code/status/default"; color: 0 43 54 255; }
color_class { name: "elm/code/status/current"; color: 7 54 66 255; }
color_class { name: "elm/code/status/ignored"; color: 36 36 36 255; }
color_class { name: "elm/code/status/note"; color: 221 119 17 255; }
color_class { name: "elm/code/status/warning"; color: 221 119 17 255; }
color_class { name: "elm/code/status/error"; color: 204 17 17 255; }
color_class { name: "elm/code/status/fatal"; color: 204 17 17 255; }
color_class { name: "elm/code/status/added"; color: 36 96 36 255; }
color_class { name: "elm/code/status/removed"; color: 96 36 36 255; }
color_class { name: "elm/code/status/changed"; color: 36 36 96 255; }
color_class { name: "elm/code/status/passed"; color: 54 96 54 255; }
color_class { name: "elm/code/status/failed"; color: 96 54 54 255; }
color_class { name: "elm/code/status/todo"; color: 211 54 130 255; }
color_class { name: "elm/code/token/default"; color: 147 161 161 255; }
color_class { name: "elm/code/token/comment"; color: 88 110 117 255; }
color_class { name: "elm/code/token/string"; color: 42 161 152 255; }
color_class { name: "elm/code/token/number"; color: 42 161 152 255; }
color_class { name: "elm/code/token/brace"; color: 131 148 150 255; }
color_class { name: "elm/code/token/type"; color: 181 137 0 255; }
color_class { name: "elm/code/token/class"; color: 255 255 255 255; }
color_class { name: "elm/code/token/function"; color: 255 255 255 255; }
color_class { name: "elm/code/token/param"; color: 181 137 0 255; }
color_class { name: "elm/code/token/keyword"; color: 181 137 0 255; }
color_class { name: "elm/code/token/preprocessor"; color: 203 75 22 255; }
color_class { name: "elm/code/token/added"; color: 54 255 54 255; }
color_class { name: "elm/code/token/removed"; color: 255 54 54 255; }
color_class { name: "elm/code/token/changed"; color: 54 54 255 255; }
color_class { name: "elm/code/token/match"; color: 187 187 51 255; }
color_class { name: "elm/code/widget/color/selection"; color: 38 139 210 255; }
color_class { name: "elm/code/widget/color/gutter/bg"; color: 7 54 66 255; }
color_class { name: "elm/code/widget/color/gutter/fg"; color: 88 110 117 255; }
color_class { name: "elm/code/widget/color/gutter/scope/bg"; color: 54 54 54 255; }
color_class { name: "elm/code/widget/color/whitespace"; color: 50 50 50 127; }
}
}

View File

@ -1,64 +0,0 @@
data {
item: "title" "Black on White";
}
collections {
/* simple layout to pack our scrolling content into an elm_layout */
group { name: "elm/code/layout/default";
data {
item: "font.name" "Mono";
item: "font.size" "10";
}
parts {
part { name: "elm.swallow.content"; type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.0;
fixed: 0 1;
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
}
}
}
}
color_classes {
color_class { name: "elm/code/status/default"; color: 255 255 255 255; }
color_class { name: "elm/code/status/current"; color: 211 211 211 255; }
color_class { name: "elm/code/status/ignored"; color: 0 0 0 255; }
color_class { name: "elm/code/status/note"; color: 0 0 0 255; }
color_class { name: "elm/code/status/warning"; color: 0 0 0 255; }
color_class { name: "elm/code/status/error"; color: 0 0 0 255; }
color_class { name: "elm/code/status/fatal"; color: 0 0 0 255; }
color_class { name: "elm/code/status/added"; color: 0 0 0 255; }
color_class { name: "elm/code/status/removed"; color: 0 0 0 255; }
color_class { name: "elm/code/status/changed"; color: 0 0 0 255; }
color_class { name: "elm/code/status/passed"; color: 0 0 0 255; }
color_class { name: "elm/code/status/failed"; color: 0 0 0 255; }
color_class { name: "elm/code/status/todo"; color: 0 0 0 255; }
color_class { name: "elm/code/token/default"; color: 0 0 0 255; }
color_class { name: "elm/code/token/comment"; color: 0 0 0 255; }
color_class { name: "elm/code/token/string"; color: 0 0 0 255; }
color_class { name: "elm/code/token/number"; color: 0 0 0 255; }
color_class { name: "elm/code/token/brace"; color: 0 0 0 255; }
color_class { name: "elm/code/token/type"; color: 0 0 0 255; }
color_class { name: "elm/code/token/class"; color: 0 0 0 255; }
color_class { name: "elm/code/token/function"; color: 0 0 0 255; }
color_class { name: "elm/code/token/param"; color: 0 0 0 255; }
color_class { name: "elm/code/token/keyword"; color: 0 0 0 255; }
color_class { name: "elm/code/token/preprocessor"; color: 0 0 0 255; }
color_class { name: "elm/code/token/added"; color: 0 0 0 255; }
color_class { name: "elm/code/token/removed"; color: 0 0 0 255; }
color_class { name: "elm/code/token/changed"; color: 0 0 0 255; }
color_class { name: "elm/code/token/match"; color: 0 0 0 255; }
color_class { name: "elm/code/widget/color/selection"; color: 169 169 169 255; }
color_class { name: "elm/code/widget/color/gutter/bg"; color: 211 211 211 255; }
color_class { name: "elm/code/widget/color/gutter/fg"; color: 21 21 21 255; }
color_class { name: "elm/code/widget/color/gutter/scope/bg"; color: 255 255 255 255; }
color_class { name: "elm/code/widget/color/whitespace"; color: 255 255 255 255; }
}
}

View File

@ -1,6 +1,6 @@
project(
'edi', 'c',
version : '0.7.99',
version : '0.6.99',
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.39.0')

View File

@ -473,6 +473,7 @@ void
_edi_project_config_load()
{
Eina_Bool save = EINA_FALSE;
Edi_Build_Provider *provider;
_edi_project_config = _edi_config_domain_load(_edi_project_config_dir_get(), EDI_PROJECT_CONFIG_NAME, _edi_proj_cfg_edd);
if (_edi_project_config)
@ -526,7 +527,11 @@ _edi_project_config_load()
IFPCFGEND;
IFPCFG(0x0003);
_edi_project_config->gui.tab_inserts_spaces = EINA_TRUE;
provider = edi_build_provider_for_project_get();
if (provider && !strcmp("go", provider->id))
_edi_project_config->gui.tab_inserts_spaces = EINA_FALSE;
else
_edi_project_config->gui.tab_inserts_spaces = EINA_TRUE;
IFPCFGEND;
IFPCFG(0x0004);

View File

@ -16,7 +16,6 @@
#include "edi_consolepanel.h"
#include "mainview/edi_mainview.h"
#include "edi_theme.h"
#include "edi_config.h"
#include "edi_private.h"
@ -153,6 +152,25 @@ void edi_consolepanel_clear()
_edi_test_count = _edi_test_pass = _edi_test_fail = 0;
}
static void
_edi_test_output_suite(int count, int pass, int fail)
{
char *line;
const char *format = _("Total pass %d (%d%%), fail %d)");
int linemax, percent;
linemax = strlen(format) - 6 + 30;
line = malloc(sizeof(char) * linemax);
percent = 0;
if (count > 0)
percent = (int) ((pass / (double) count) * 100);
snprintf(line, linemax, format, pass, percent, fail);
elm_code_file_line_append(_edi_test_code->file, line, strlen(line), (fail > 0) ? _EDI_SUITE_FAILED : _EDI_SUITE_PASSED);
free(line);
}
static Eina_Bool
_exe_data(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info)
{
@ -179,23 +197,15 @@ _exe_error(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info)
return ECORE_CALLBACK_RENEW;
}
static void
_edi_test_output_suite(int count, int pass, int fail)
static Eina_Bool
_exe_done(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info EINA_UNUSED)
{
char *line;
const char *format = _("Total pass %d (%d%%), fail %d)");
int linemax, percent;
if (_edi_test_count == 0)
return ECORE_CALLBACK_RENEW;
linemax = strlen(format) - 6 + 30;
line = malloc(sizeof(char) * linemax);
percent = 0;
if (count > 0)
percent = (int) ((pass / (double) count) * 100);
snprintf(line, linemax, format, pass, percent, fail);
elm_code_file_line_append(_edi_test_code->file, line, strlen(line), (fail > 0) ? _EDI_SUITE_FAILED : _EDI_SUITE_PASSED);
free(line);
_edi_test_output_suite(_edi_test_count, _edi_test_pass, _edi_test_fail);
_edi_test_count = 0;
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
@ -311,6 +321,23 @@ static void _edi_test_line_callback(const char *content)
{
_edi_test_line_parse_suite(content + 6);
}
else if (!strncmp(content, "=== RUN", 7))
{
edi_testpanel_show();
_edi_test_count++;
}
else if (!strncmp(content, "--- PASS:", 9))
{
_edi_test_pass++;
elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_PASSED);
}
else if (!strncmp(content, "--- FAIL:", 9))
{
_edi_test_fail++;
elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_FAILED);
}
}
static Eina_Bool
@ -322,13 +349,11 @@ _edi_consolepanel_config_changed(void *data EINA_UNUSED, int type EINA_UNUSED, v
EINA_LIST_FOREACH(_edi_console_code->widgets, item, widget)
{
elm_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
}
EINA_LIST_FOREACH(_edi_test_code->widgets, item, widget)
{
elm_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
}
return ECORE_CALLBACK_RENEW;
@ -351,7 +376,6 @@ void edi_consolepanel_add(Evas_Object *parent)
widget = elm_code_widget_add(parent, code);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _edi_consolepanel_line_cb, NULL);
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _edi_consolepanel_clicked_cb, code);
@ -365,6 +389,7 @@ void edi_consolepanel_add(Evas_Object *parent)
ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _exe_data, NULL);
ecore_event_handler_add(ECORE_EXE_EVENT_ERROR, _exe_error, NULL);
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _exe_done, NULL);
ecore_event_handler_add(EDI_EVENT_CONFIG_CHANGED, _edi_consolepanel_config_changed, NULL);
}
@ -385,7 +410,6 @@ void edi_testpanel_add(Evas_Object *parent)
widget = elm_code_widget_add(parent, code);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _edi_testpanel_line_cb, NULL);
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _edi_consolepanel_clicked_cb, code);

View File

@ -7,7 +7,6 @@
#include <Elementary.h>
#include "edi_debug.h"
#include "edi_theme.h"
#include "edi_debugpanel.h"
#include "edi_config.h"
@ -37,7 +36,6 @@ static Eina_Bool
_edi_debugpanel_config_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
elm_code_widget_font_set(_info_widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(_info_widget, _edi_project_config->gui.theme);
return ECORE_CALLBACK_RENEW;
}
@ -334,7 +332,6 @@ void edi_debugpanel_add(Evas_Object *parent)
code = elm_code_create();
widget = elm_code_widget_add(parent, code);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(_info_widget, _edi_project_config->gui.theme);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _edi_debugpanel_line_cb, NULL);
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

View File

@ -7,7 +7,6 @@
#include <Elementary.h>
#include "edi_logpanel.h"
#include "edi_theme.h"
#include "edi_config.h"
#include "edi_private.h"
@ -18,13 +17,18 @@ static Evas_Object *_info_widget;
static Elm_Code *_elm_code;
static Eina_Bool
_edi_logpanel_ignore(Eina_Log_Level level, const char *fnc)
_edi_logpanel_ignore(Eina_Log_Level level, const char *domain, const char *fnc)
{
if (level <= EINA_LOG_LEVEL_DBG)
return !strncmp(fnc, "_eo_", 4) || !strncmp(fnc, "_evas_", 6) ||
{
if (!strncmp(domain, "eo", 2))
return EINA_TRUE;
if (!strncmp(fnc, "_eo_", 4) || !strncmp(fnc, "_evas_", 6) ||
!strncmp(fnc, "_ecore_", 7) || !strncmp(fnc, "_edje_", 6) ||
!strncmp(fnc, "_elm_", 5) || !strncmp(fnc, "_drm_", 5) ||
!strncmp(fnc, "_eina_", 6);
!strncmp(fnc, "_eina_", 6))
return EINA_TRUE;
}
return !strncmp(fnc, "_evas_object_smart_need_recalculate_set", strlen(fnc));
}
@ -39,7 +43,7 @@ _edi_logpanel_print_cb(const Eina_Log_Domain *domain, Eina_Log_Level level,
if (_edi_log_dom == -1) return;
if (_edi_logpanel_ignore(level, fnc))
if (_edi_logpanel_ignore(level, domain->domain_str, fnc))
return;
printed = snprintf(buffer, buffer_len, "%s:%s:%s (%d): ",
@ -68,7 +72,6 @@ static Eina_Bool
_edi_logpanel_config_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
elm_code_widget_font_set(_info_widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(_info_widget, _edi_project_config->gui.theme);
return ECORE_CALLBACK_RENEW;
}
@ -87,7 +90,6 @@ void edi_logpanel_add(Evas_Object *parent)
code = elm_code_create();
widget = elm_code_widget_add(parent, code);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _edi_logpanel_line_cb, NULL);

View File

@ -8,12 +8,10 @@
#include <Ecore_Getopt.h>
#include <Elementary.h>
#include <Efl_Ui.h>
#include <Eio.h>
#include "Edi.h"
#include "edi_config.h"
#include "edi_theme.h"
#include "edi_filepanel.h"
#include "edi_file.h"
#include "edi_logpanel.h"
@ -1372,7 +1370,6 @@ static Eina_Bool
_edi_config_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
_edi_toolbar_set_visible(!_edi_project_config->gui.toolbar_hidden);
edi_theme_window_alpha_set();
return ECORE_CALLBACK_RENEW;
}
@ -1521,8 +1518,6 @@ edi_open(const char *inputpath)
elm_win_resize_object_add(win, hbx);
evas_object_show(hbx);
edi_theme_window_alpha_set();
tb = edi_toolbar_setup(hbx);
elm_box_pack_start(hbx, tb);
_edi_toolbar = tb;

View File

@ -9,7 +9,6 @@
#include <string.h>
#include "edi_file.h"
#include "edi_searchpanel.h"
#include "edi_theme.h"
#include "edi_config.h"
#include "mainview/edi_mainview.h"
@ -26,7 +25,6 @@ static Eina_Bool
_edi_searchpanel_config_changed_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
elm_code_widget_font_set(_info_widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(_info_widget, _edi_project_config->gui.theme);
return ECORE_CALLBACK_RENEW;
}
@ -243,7 +241,6 @@ edi_searchpanel_add(Evas_Object *parent)
code = elm_code_create();
widget = elm_code_widget_add(parent, code);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _edi_searchpanel_line_clicked_cb, NULL);
@ -274,7 +271,6 @@ static Eina_Bool
_edi_taskspanel_config_changed_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
elm_code_widget_font_set(_tasks_widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_set(_tasks_widget, _edi_project_config->gui.theme);
return ECORE_CALLBACK_RENEW;
}
@ -322,7 +318,6 @@ edi_taskspanel_add(Evas_Object *parent)
code = elm_code_create();
widget = elm_code_widget_add(parent, code);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
elm_obj_code_widget_gravity_set(widget, 0.0, 1.0);
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _edi_taskspanel_line_cb, NULL);

View File

@ -1,73 +0,0 @@
#ifndef __EDI_THEME_H__
#define __EDI_THEME_H__
#include <Eina.h>
#include <Evas.h>
typedef struct _Edi_Theme {
char *name;
char *path;
char *title;
} Edi_Theme;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @file
* @brief These routines used for managing Edi theme actions.
*/
/**
* @brief Theme management functions.
* @defgroup Theme
*
* @{
*
* Management of theming actions.
*
*/
/**
* Set the Edi theme by name on an Elm_Code_Widget.
*
* @param obj The Elm_Code_Widget object to apply the theme to.
* @param name The name of the theme to apply.
*
* @ingroup Theme
*/
void edi_theme_elm_code_set(Evas_Object *obj, const char *name);
/**
* Get a list of all themes available.
*
* @return a list of all available themes as Edi_Theme instances.
*
* @ingroup Theme
*/
Eina_List *edi_theme_themes_get(void);
/**
* Get theme obj by its name.
*
* @return the theme obj matching the name.
*
* @ingroup Theme
*/
Edi_Theme *edi_theme_theme_by_name(const char *name);
void edi_theme_window_alpha_set(void);
void edi_theme_elm_code_alpha_set(Evas_Object *obj);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif

View File

@ -13,7 +13,6 @@
#include "edi_content.h"
#include "edi_filepanel.h"
#include "edi_config.h"
#include "edi_theme.h"
#include "language/edi_language_provider.h"
@ -1203,8 +1202,6 @@ _edi_editor_config_changed(void *data, int type EINA_UNUSED, void *event EINA_UN
code->config.trim_whitespace = _edi_config->trim_whitespace;
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_alpha_set(widget);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
elm_obj_code_widget_show_whitespace_set(widget, _edi_project_config->gui.show_whitespace);
elm_obj_code_widget_tab_inserts_spaces_set(widget, _edi_project_config->gui.tab_inserts_spaces);
elm_obj_code_widget_line_width_marker_set(widget, _edi_project_config->gui.width_marker);
@ -1360,8 +1357,6 @@ edi_editor_add(Evas_Object *parent, Edi_Mainview_Item *item)
elm_code_widget_line_numbers_set(widget, EINA_TRUE);
_edi_editor_config_changed(widget, 0, NULL);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
editor = calloc(1, sizeof(*editor));
editor->entry = widget;
editor->mimetype = item->mimetype;

View File

@ -16,7 +16,6 @@
#include "edi_content_provider.h"
#include "edi_searchpanel.h"
#include "edi_file.h"
#include "edi_theme.h"
#include "edi_private.h"
#include "edi_config.h"
@ -291,8 +290,6 @@ _edi_mainview_split_config_changed_cb(void *data, int type EINA_UNUSED, void *ev
Elm_Code_Widget *widget = data;
elm_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
edi_theme_elm_code_alpha_set(widget);
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
return ECORE_CALLBACK_RENEW;
}

View File

@ -23,8 +23,6 @@ src = files([
'edi_private.h',
'edi_searchpanel.c',
'edi_searchpanel.h',
'edi_theme.c',
'edi_theme.h',
])
bin_dir = include_directories('.')

View File

@ -9,7 +9,6 @@
#include "edi_screens.h"
#include "edi_config.h"
#include "edi_debug.h"
#include "edi_theme.h"
#include "edi_private.h"
@ -146,74 +145,11 @@ _edi_settings_font_preview_add(Evas_Object *parent, const char *font_name, int f
return widget;
}
static void
_edi_settings_display_theme_pressed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
{
Edi_Theme *theme;
const char *text = elm_object_item_text_get(event_info);
theme = elm_object_item_data_get(event_info);
if (_edi_project_config->gui.theme)
eina_stringshare_del(_edi_project_config->gui.theme);
_edi_project_config->gui.theme = eina_stringshare_add(theme->name);
_edi_project_config_save();
elm_object_text_set(obj, text);
elm_combobox_hover_end(obj);
}
static char *
_edi_settings_display_theme_text_get_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
{
Edi_Theme *current;
current = data;
return strdup(current->title);
}
static void
_edi_settings_display_translucent_state_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event EINA_UNUSED)
{
Evas_Object *slider, *check;
int state;
check = obj;
slider = data;
state = elm_check_state_get(check);
_edi_project_config->gui.translucent = state;
_edi_project_config_save();
elm_object_disabled_set(slider, !state);
}
static void
_edi_settings_display_alpha_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
_edi_project_config->gui.alpha = elm_slider_value_get(obj);
_edi_project_config_save();
}
static char *
_edi_settings_display_alpha_format(double value)
{
return (char*)eina_stringshare_printf("%1.0f%%", (value/255)*100);
}
static Evas_Object *
_edi_settings_display_create(Evas_Object *parent)
{
Evas_Object *container, *box, *frame, *label, *spinner, *check, *button, *preview;
Evas_Object *table, *combobox, *slider;
Elm_Genlist_Item_Class *itc;
Edi_Theme *theme;
Eina_List *themes, *l;
Evas_Object *table;
container = elm_box_add(parent);
evas_object_size_hint_weight_set(container, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@ -249,82 +185,6 @@ _edi_settings_display_create(Evas_Object *parent)
elm_object_focus_set(button, EINA_TRUE);
label = elm_label_add(table);
elm_object_text_set(label, _("Color theme"));
evas_object_size_hint_align_set(label, EVAS_HINT_EXPAND, 0.5);
elm_table_pack(table, label, 0, 1, 1, 1);
evas_object_show(label);
// START OF THEME SELECTOR
combobox = elm_combobox_add(table);
evas_object_size_hint_weight_set(combobox, 0.75, 0.0);
evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(combobox);
evas_object_smart_callback_add(combobox, "item,pressed",
_edi_settings_display_theme_pressed_cb, NULL);
if (!_edi_project_config->gui.theme)
elm_object_text_set(combobox, edi_theme_theme_by_name("default")->title);
else
elm_object_text_set(combobox, edi_theme_theme_by_name(_edi_project_config->gui.theme)->title);
elm_table_pack(table, combobox, 1, 1, 1, 1);
itc = elm_genlist_item_class_new();
itc->item_style = "default";
itc->func.text_get = _edi_settings_display_theme_text_get_cb;
themes = edi_theme_themes_get();
EINA_LIST_FOREACH(themes, l, theme)
{
elm_genlist_item_append(combobox, itc, theme, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
}
elm_genlist_realized_items_update(combobox);
elm_genlist_item_class_free(itc);
// END OF THEME SELECTOR
// START OF ALPHA SELECTOR
label = elm_label_add(table);
elm_object_text_set(label, _("Translucent"));
evas_object_size_hint_align_set(label, EVAS_HINT_EXPAND, 0.5);
elm_table_pack(table, label, 0, 2, 1, 1);
evas_object_show(label);
slider = elm_slider_add(table);
check = elm_check_add(box);
elm_check_state_set(check, _edi_project_config->gui.translucent);
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(table, check, 1, 2, 1, 1);
evas_object_show(check);
evas_object_smart_callback_add(check, "changed",
_edi_settings_display_translucent_state_cb, slider);
label = elm_label_add(table);
elm_object_text_set(label, _("Alpha"));
evas_object_size_hint_align_set(label, EVAS_HINT_EXPAND, 0.5);
elm_table_pack(table, label, 0, 3, 1, 1);
evas_object_show(label);
elm_object_disabled_set(slider, !_edi_project_config->gui.translucent);
evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_slider_min_max_set(slider, 0, 255);
elm_slider_value_set(slider, _edi_project_config->gui.alpha);
elm_slider_span_size_set(slider, 255);
elm_slider_step_set(slider, 0.01);
elm_slider_units_format_function_set(slider, _edi_settings_display_alpha_format,
(void(*)(char*))eina_stringshare_del);
elm_slider_indicator_format_function_set(slider, _edi_settings_display_alpha_format,
(void(*)(char*))eina_stringshare_del);
elm_table_pack(table, slider, 1, 3, 1, 1);
evas_object_show(slider);
evas_object_smart_callback_add(slider, "slider,drag,stop", _edi_settings_display_alpha_changed_cb, NULL);
evas_object_smart_callback_add(slider, "delay,changed", _edi_settings_display_alpha_changed_cb, NULL);
label = elm_label_add(table);
elm_object_text_set(label, _("Hide Toolbar"));
evas_object_size_hint_align_set(label, EVAS_HINT_EXPAND, 0.5);

View File

@ -12,6 +12,7 @@ extern Edi_Build_Provider _edi_build_provider_cmake;
extern Edi_Build_Provider _edi_build_provider_cargo;
extern Edi_Build_Provider _edi_build_provider_python;
extern Edi_Build_Provider _edi_build_provider_meson;
extern Edi_Build_Provider _edi_build_provider_go;
EAPI Edi_Build_Provider *edi_build_provider_for_project_get()
{
@ -31,6 +32,8 @@ EAPI Edi_Build_Provider *edi_build_provider_for_project_path_get(const char *pat
return &_edi_build_provider_python;
if (_edi_build_provider_meson.path_supported_is(path))
return &_edi_build_provider_meson;
if (_edi_build_provider_go.path_supported_is(path))
return &_edi_build_provider_go;
if (_edi_build_provider_make.path_supported_is(path))
return &_edi_build_provider_make;
@ -49,6 +52,8 @@ EAPI Edi_Build_Provider *edi_build_provider_for_id_get(const char *id)
return &_edi_build_provider_python;
if (!strcmp("meson", id))
return &_edi_build_provider_meson;
if (!strcmp("go", id))
return &_edi_build_provider_go;
return NULL;
}

View File

@ -0,0 +1,109 @@
#ifdef HAVE_CONFIG
# include "config.h"
#endif
#include <unistd.h>
#include <Ecore.h>
#include <Ecore_File.h>
#include "Edi.h"
#include "edi_private.h"
static Eina_Bool
_go_project_supported(const char *path)
{
Eina_List *files, *l;
const char *name;
files = ecore_file_ls(path);
EINA_LIST_FOREACH(files, l, name)
{
if (strlen(name) < 4)
continue;
if (strstr(name, ".go"))
return EINA_TRUE;
}
return EINA_FALSE;
}
static Eina_Bool
_go_file_hidden_is(const char *file)
{
if (!file || strlen(file) == 0)
return EINA_FALSE;
if (!strcmp(ecore_file_file_get(file), "_obj") || !strcmp(ecore_file_file_get(file), "target") ||
eina_str_has_extension(file, ".so"))
return EINA_TRUE;
return EINA_FALSE;
}
static Eina_Bool
_go_project_runnable_is(const char *path EINA_UNUSED)
{
if (!path || !path[0])
return EINA_FALSE;
return EINA_TRUE;
}
static void
_go_build(void)
{
if (chdir(edi_project_get()) == 0)
edi_exe_notify("edi_build", "go build");
}
static void
_go_test(void)
{
if (chdir(edi_project_get()) == 0)
edi_exe_notify("edi_test", "go test -v ./...");
}
static void
_go_run(const char *path EINA_UNUSED, const char *args EINA_UNUSED)
{
char *full_cmd;
int full_len;
if (!path) return;
if (chdir(edi_project_get()) !=0)
ERR("Could not chdir");
full_len = strlen(path) + 8;
if (args)
full_len += strlen(args);
full_cmd = malloc(sizeof(char) * (full_len + 1));
snprintf(full_cmd, full_len + 1, "go run %s %s", path, args?args:"");
ecore_exe_pipe_run(full_cmd, ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |
ECORE_EXE_PIPE_WRITE | ECORE_EXE_USE_SH, NULL);
free(full_cmd);
}
static void
_go_clean(void)
{
if (chdir(edi_project_get()) == 0)
edi_exe_notify("edi_clean", "go clean");
}
Edi_Build_Provider _edi_build_provider_go =
{
"go",
_go_project_supported,
_go_file_hidden_is,
_go_project_runnable_is,
_go_build,
_go_test,
_go_run,
_go_clean
};

View File

@ -150,9 +150,9 @@ _make_run(const char *path, const char *args)
return;
}
full_len = strlen(path) + strlen(path);
full_len = strlen(path) + strlen(args) + 1;
full_cmd = malloc(sizeof(char) * (full_len + 1));
snprintf(full_cmd, full_len + 2, "%s %s", path, args);
snprintf(full_cmd, full_len + 1, "%s %s", path, args);
ecore_exe_pipe_run(full_cmd, ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |

View File

@ -194,6 +194,7 @@ _edi_create_filter_file_done(void *data, int type EINA_UNUSED, void *event EINA_
Edi_Create *create;
Ecore_Event_Handler *handler;
Eina_Strbuf *command;
char *escaped;
create = (Edi_Create *)data;
@ -210,15 +211,23 @@ _edi_create_filter_file_done(void *data, int type EINA_UNUSED, void *event EINA_
command = eina_strbuf_new();
eina_strbuf_append(command, "sh -c 'git init && git add .");
eina_strbuf_append(command, "sh -c \"git init && git add .");
if (create->user && strlen(create->user))
eina_strbuf_append_printf(command, " && git config user.name \"%s\"", create->user);
{
escaped = ecore_file_escape_name(create->user);
eina_strbuf_append_printf(command, " && git config user.name %s", escaped);
free(escaped);
}
if (create->email && strlen(create->email))
eina_strbuf_append_printf(command, " && git config user.email \"%s\"", create->email);
{
escaped = ecore_file_escape_name(create->email);
eina_strbuf_append_printf(command, " && git config user.email %s", escaped);
free(escaped);
}
eina_strbuf_append(command, " ' ");
eina_strbuf_append(command, " \" ");
ecore_exe_run(eina_strbuf_string_get(command), data);

View File

@ -8,6 +8,7 @@ src = files([
'edi_build_provider_make.c',
'edi_build_provider_meson.c',
'edi_build_provider_python.c',
'edi_build_provider_go.c',
'edi_builder.c',
'edi_builder.h',
'edi_create.c',