forked from enlightenment/edi
Merge branch 'master' into elm_code
Conflicts: elm_code/src/lib/elm_code_widget.c elm_code/src/lib/elm_code_widget.eo.c elm_code/src/lib/elm_code_widget.eo.h
This commit is contained in:
commit
1fab95cef1
33
NEWS
33
NEWS
|
@ -1,18 +1,21 @@
|
|||
Changes since Edi project started:
|
||||
----------------------------------
|
||||
=========
|
||||
Edi 0.0.1
|
||||
=========
|
||||
|
||||
pre-1.0 phase 2 "Code aware editor"
|
||||
- Simple build functions
|
||||
- Added a command line builder application
|
||||
- Added line numbers and line goto to the text editor
|
||||
Features:
|
||||
|
||||
* Editing and saving text files
|
||||
* Tabbed browsing of open files
|
||||
* Opening editor in a new window
|
||||
* Displaying directory for the project (directory)
|
||||
* link files out to external viewers / editors
|
||||
* No screen waste (toolbar, menu, tab are out of the way of the developer)
|
||||
* info panel with logs and useful output
|
||||
* Create new file
|
||||
|
||||
pre-1.0 phase 1 "Basic text editing"
|
||||
- Editing and saving text files
|
||||
- Tabbed browsing of open files
|
||||
- Opening editor in a new window
|
||||
- Displaying directory for the project (directory)
|
||||
- link files out to eternal viewers / editors
|
||||
- No screen waste (toolbar, menu, tab are out of the way of the developer)
|
||||
- info panel with logs and useful output
|
||||
- Create new file
|
||||
* Simple build functions
|
||||
* Search & replace in file
|
||||
* Line numbers & go to line
|
||||
* Creation of new projects from name input and skeleton project files
|
||||
* Syntax highlighting
|
||||
* Diff rendering
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
EFL_VERSION([0], [0], [1], [dev])
|
||||
EFL_VERSION([0], [0], [2], [dev])
|
||||
AC_INIT([edi], [efl_version], [enlightenment-devel@lists.sourceforge.net])
|
||||
|
||||
AC_PREREQ([2.65])
|
||||
|
|
|
@ -225,24 +225,16 @@ _elm_code_widget_fill(Elm_Code_Widget *widget)
|
|||
|
||||
static Eina_Bool
|
||||
_elm_code_widget_line_cb(void *data, Eo *obj EINA_UNUSED,
|
||||
const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
|
||||
const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Elm_Code_Widget *widget;
|
||||
Elm_Code_Line *line;
|
||||
|
||||
Evas_Textgrid_Cell *cells;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
|
||||
widget = (Elm_Code_Widget *)data;
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
line = (Elm_Code_Line *)event_info;
|
||||
|
||||
if (!_elm_code_widget_resize(widget))
|
||||
return EINA_TRUE;
|
||||
|
||||
// FIXME refresh just the row - but this resulted in undrawn areas
|
||||
// cells = evas_object_textgrid_cellrow_get(pd->grid, line->number - 1);
|
||||
// _elm_code_widget_fill_line(widget, line);
|
||||
// FIXME refresh just the row unless we have resized (by being the result of a row append)
|
||||
_elm_code_widget_fill(widget);
|
||||
|
||||
return EO_CALLBACK_CONTINUE;
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_LINE_CLICKED =
|
||||
EO_EVENT_DESCRIPTION("line,clicked", "");
|
||||
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_CURSOR_CHANGED =
|
||||
EO_EVENT_DESCRIPTION("cursor,changed", "");
|
||||
|
||||
void _elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code *code);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_code_set, EO_FUNC_CALL(code), Elm_Code *code);
|
||||
|
||||
Elm_Code * _elm_code_widget_code_get(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget_code_get, Elm_Code *, 0);
|
||||
|
||||
void _elm_code_widget_font_size_set(Eo *obj, Elm_Code_Widget_Data *pd, Evas_Font_Size font_size);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_font_size_set, EO_FUNC_CALL(font_size), Evas_Font_Size font_size);
|
||||
|
||||
Evas_Font_Size _elm_code_widget_font_size_get(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget_font_size_get, Evas_Font_Size, 0);
|
||||
|
||||
void _elm_code_widget_gravity_set(Eo *obj, Elm_Code_Widget_Data *pd, double x, double y);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_gravity_set, EO_FUNC_CALL(x, y), double x, double y);
|
||||
|
||||
void _elm_code_widget_gravity_get(Eo *obj, Elm_Code_Widget_Data *pd, double *x, double *y);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_gravity_get, EO_FUNC_CALL(x, y), double *x, double *y);
|
||||
|
||||
void _elm_code_widget_editable_set(Eo *obj, Elm_Code_Widget_Data *pd, Eina_Bool editable);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_editable_set, EO_FUNC_CALL(editable), Eina_Bool editable);
|
||||
|
||||
Eina_Bool _elm_code_widget_editable_get(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget_editable_get, Eina_Bool, 0);
|
||||
|
||||
void _elm_code_widget_line_numbers_set(Eo *obj, Elm_Code_Widget_Data *pd, Eina_Bool line_numbers);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_line_numbers_set, EO_FUNC_CALL(line_numbers), Eina_Bool line_numbers);
|
||||
|
||||
Eina_Bool _elm_code_widget_line_numbers_get(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget_line_numbers_get, Eina_Bool, 0);
|
||||
|
||||
void _elm_code_widget_cursor_position_set(Eo *obj, Elm_Code_Widget_Data *pd, unsigned int col, unsigned int line);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_cursor_position_set, EO_FUNC_CALL(col, line), unsigned int col, unsigned int line);
|
||||
|
||||
void _elm_code_widget_cursor_position_get(Eo *obj, Elm_Code_Widget_Data *pd, unsigned int *col, unsigned int *line);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget_cursor_position_get, EO_FUNC_CALL(col, line), unsigned int *col, unsigned int *line);
|
||||
|
||||
void _elm_code_widget_eo_base_constructor(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
|
||||
void _elm_code_widget_evas_object_smart_add(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
|
||||
Eina_Bool _elm_code_widget_elm_widget_focus_next_manager_is(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
|
||||
Eina_Bool _elm_code_widget_elm_widget_focus_direction_manager_is(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
|
||||
static Eo_Op_Description _elm_code_widget_op_desc[] = {
|
||||
EO_OP_FUNC_OVERRIDE(eo_constructor, _elm_code_widget_eo_base_constructor),
|
||||
EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, _elm_code_widget_evas_object_smart_add),
|
||||
EO_OP_FUNC_OVERRIDE(elm_obj_widget_focus_next_manager_is, _elm_code_widget_elm_widget_focus_next_manager_is),
|
||||
EO_OP_FUNC_OVERRIDE(elm_obj_widget_focus_direction_manager_is, _elm_code_widget_elm_widget_focus_direction_manager_is),
|
||||
EO_OP_FUNC(elm_code_widget_code_set, _elm_code_widget_code_set, "Set the underlying code object that this widget renders"),
|
||||
EO_OP_FUNC(elm_code_widget_code_get, _elm_code_widget_code_get, "Get the underlying code object we are rendering"),
|
||||
EO_OP_FUNC(elm_code_widget_font_size_set, _elm_code_widget_font_size_set, "Set the font size that this widget uses, the font will always be a system monospaced font"),
|
||||
EO_OP_FUNC(elm_code_widget_font_size_get, _elm_code_widget_font_size_get, "Get the font size currently in use"),
|
||||
EO_OP_FUNC(elm_code_widget_gravity_set, _elm_code_widget_gravity_set, "Set how this widget's scroller should respond to new lines being added."),
|
||||
EO_OP_FUNC(elm_code_widget_gravity_get, _elm_code_widget_gravity_get, "Get the current x and y gravity of the widget's scroller"),
|
||||
EO_OP_FUNC(elm_code_widget_editable_set, _elm_code_widget_editable_set, "Set whether this widget allows editing"),
|
||||
EO_OP_FUNC(elm_code_widget_editable_get, _elm_code_widget_editable_get, "Get the current editable state of this widget"),
|
||||
EO_OP_FUNC(elm_code_widget_line_numbers_set, _elm_code_widget_line_numbers_set, "Set whether line numbers should be displayed in the left gutter."),
|
||||
EO_OP_FUNC(elm_code_widget_line_numbers_get, _elm_code_widget_line_numbers_get, "Get the status of line number display for this widget."),
|
||||
EO_OP_FUNC(elm_code_widget_cursor_position_set, _elm_code_widget_cursor_position_set, "Set the current location of the text cursor."),
|
||||
EO_OP_FUNC(elm_code_widget_cursor_position_get, _elm_code_widget_cursor_position_get, "Get the current x and y position of the widget's cursor"),
|
||||
EO_OP_SENTINEL
|
||||
};
|
||||
|
||||
static const Eo_Event_Description *_elm_code_widget_event_desc[] = {
|
||||
ELM_CODE_WIDGET_EVENT_LINE_CLICKED,
|
||||
ELM_CODE_WIDGET_EVENT_CURSOR_CHANGED,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const Eo_Class_Description _elm_code_widget_class_desc = {
|
||||
EO_VERSION,
|
||||
"Elm_Code_Widget",
|
||||
EO_CLASS_TYPE_REGULAR,
|
||||
EO_CLASS_DESCRIPTION_OPS(_elm_code_widget_op_desc),
|
||||
_elm_code_widget_event_desc,
|
||||
sizeof(Elm_Code_Widget_Data),
|
||||
_elm_code_widget_class_constructor,
|
||||
NULL
|
||||
};
|
||||
|
||||
EO_DEFINE_CLASS(elm_code_widget_class_get, &_elm_code_widget_class_desc, ELM_LAYOUT_CLASS, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);
|
|
@ -1,180 +0,0 @@
|
|||
#ifndef _ELM_CODE_WIDGET_EO_H_
|
||||
#define _ELM_CODE_WIDGET_EO_H_
|
||||
|
||||
#ifndef _ELM_CODE_WIDGET_EO_CLASS_TYPE
|
||||
#define _ELM_CODE_WIDGET_EO_CLASS_TYPE
|
||||
|
||||
typedef Eo Elm_Code_Widget;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _ELM_CODE_WIDGET_EO_TYPES
|
||||
#define _ELM_CODE_WIDGET_EO_TYPES
|
||||
|
||||
|
||||
#endif
|
||||
#define ELM_CODE_WIDGET_CLASS elm_code_widget_class_get()
|
||||
|
||||
const Eo_Class *elm_code_widget_class_get(void) EINA_CONST;
|
||||
|
||||
/**
|
||||
*
|
||||
* Set the underlying code object that this widget renders
|
||||
*
|
||||
* @ingroup Data
|
||||
*
|
||||
* @param[in] code Our underlying Elm_Code object
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_code_set(Elm_Code *code);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the underlying code object we are rendering
|
||||
*
|
||||
* @ingroup Data
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Elm_Code * elm_code_widget_code_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* Set the font size that this widget uses, the font will always be a system monospaced font
|
||||
*
|
||||
* @ingroup Style
|
||||
*
|
||||
* @param[in] font_size The font size of the widgget
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_font_size_set(Evas_Font_Size font_size);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the font size currently in use
|
||||
*
|
||||
* @ingroup Style
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Evas_Font_Size elm_code_widget_font_size_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* Set how this widget's scroller should respond to new lines being added.
|
||||
*
|
||||
* An x value of 0.0 will maintain the distance from the left edge, 1.0 will ensure the rightmost edge (of the longest line) is respected
|
||||
* With 0.0 for y the view will keep it's position relative to the top whereas 1.0 will scroll downward as lines are added.
|
||||
*
|
||||
* @ingroup Layout
|
||||
*
|
||||
* @param[in] x The horizontal value of the scroller gravity - valid values are 0.0 and 1.0
|
||||
* @param[in] y The vertical gravity of the widget's scroller - valid values are 0.0 and 1.0
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_gravity_set(double x, double y);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the current x and y gravity of the widget's scroller
|
||||
*
|
||||
* @ingroup Layout
|
||||
*
|
||||
* @param[out] x The horizontal value of the scroller gravity - valid values are 0.0 and 1.0
|
||||
* @param[out] y The vertical gravity of the widget's scroller - valid values are 0.0 and 1.0
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_gravity_get(double *x, double *y);
|
||||
|
||||
/**
|
||||
*
|
||||
* Set whether this widget allows editing
|
||||
*
|
||||
* If @a editable then the widget will allow user input to manipulate
|
||||
* the underlying Elm_Code_File of this Elm_Code instance.
|
||||
* Any other Elm_Code_Widget's connected to this Elm_Code will
|
||||
* update to reflect the changes.
|
||||
*
|
||||
* @ingroup Features
|
||||
*
|
||||
* @param[in] editable The editable state of the widget
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_editable_set(Eina_Bool editable);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the current editable state of this widget
|
||||
*
|
||||
* @return EINA_TRUE if the widget is editable, EINA_FALSE otherwise.
|
||||
* If this widget is not editable the underlying Elm_Code_File could
|
||||
* still be manipulated by a different widget or the filesystem.
|
||||
*
|
||||
* @ingroup Features
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Eina_Bool elm_code_widget_editable_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* Set whether line numbers should be displayed in the left gutter.
|
||||
*
|
||||
* Passing EINA_TRUE will reserve a space for showing line numbers,
|
||||
* EINA_FALSE will turn this off.
|
||||
*
|
||||
* @ingroup Features
|
||||
*
|
||||
* @param[in] line_numbers Whether or not line numbers (or their placeholder) should be shown
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_line_numbers_set(Eina_Bool line_numbers);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the status of line number display for this widget.
|
||||
*
|
||||
* @ingroup Features
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Eina_Bool elm_code_widget_line_numbers_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* Set the current location of the text cursor.
|
||||
*
|
||||
* @ingroup Editing
|
||||
*
|
||||
* @param[in] col The horizontal position of the cursor, starting from column 1
|
||||
* @param[in] line The vertical position of the cursor - the top row is 1 an
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_cursor_position_set(unsigned int col, unsigned int line);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the current x and y position of the widget's cursor
|
||||
*
|
||||
* @ingroup Editing
|
||||
*
|
||||
* @param[out] col The horizontal position of the cursor, starting from column 1
|
||||
* @param[out] line The vertical position of the cursor - the top row is 1 an
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_cursor_position_get(unsigned int *col, unsigned int *line);
|
||||
|
||||
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_LINE_CLICKED;
|
||||
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_CURSOR_CHANGED;
|
||||
|
||||
/**
|
||||
* No description
|
||||
*/
|
||||
#define ELM_CODE_WIDGET_EVENT_LINE_CLICKED (&(_ELM_CODE_WIDGET_EVENT_LINE_CLICKED))
|
||||
|
||||
/**
|
||||
* No description
|
||||
*/
|
||||
#define ELM_CODE_WIDGET_EVENT_CURSOR_CHANGED (&(_ELM_CODE_WIDGET_EVENT_CURSOR_CHANGED))
|
||||
|
||||
#endif
|
|
@ -8,6 +8,7 @@ AM_CPPFLAGS = \
|
|||
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
|
||||
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
|
||||
-DPACKAGE_DOC_DIR=\"$(docdir)\" \
|
||||
-DVERSION=\"$(PACKAGE_VERSION)\" \
|
||||
-DLOCALEDIR=\"$(datadir)/locale\" \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
|
|
|
@ -341,25 +341,45 @@ _populate(Evas_Object *obj,
|
|||
else
|
||||
lreq->selected = NULL;
|
||||
|
||||
/* TODO: sub directory should be monitored for expand mode */
|
||||
//sd->monitor = eio_monitor_add(path);
|
||||
/* TODO: keep track of monitors so they can be cleaned */
|
||||
//sd->monitor =
|
||||
eio_monitor_add(path);
|
||||
//sd->current =
|
||||
eio_file_stat_ls(path, _ls_filter_cb, _ls_main_cb,
|
||||
_ls_done_cb, _ls_error_cb, lreq);
|
||||
}
|
||||
|
||||
|
||||
void _file_listing_updated(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
const char *dir;
|
||||
|
||||
dir = (const char *)data;
|
||||
DBG("File created in %s\n", dir);
|
||||
|
||||
elm_genlist_clear(list);
|
||||
_populate(list, dir, NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
edi_filepanel_add(Evas_Object *parent, Evas_Object *win,
|
||||
const char *path, edi_filepanel_item_clicked_cb cb)
|
||||
{
|
||||
const char *sharedpath;
|
||||
|
||||
list = elm_genlist_add(parent);
|
||||
evas_object_size_hint_min_set(list, 100, -1);
|
||||
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_show(list);
|
||||
|
||||
sharedpath = eina_stringshare_add(path);
|
||||
evas_object_event_callback_add(list, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_item_clicked_cb, NULL);
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_file_listing_updated, sharedpath);
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, (Ecore_Event_Handler_Cb)_file_listing_updated, sharedpath);
|
||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, (Ecore_Event_Handler_Cb)_file_listing_updated, sharedpath);
|
||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, (Ecore_Event_Handler_Cb)_file_listing_updated, sharedpath);
|
||||
|
||||
evas_object_smart_callback_add(list, "expand,request", _on_list_expand_req, parent);
|
||||
evas_object_smart_callback_add(list, "contract,request", _on_list_contract_req, parent);
|
||||
|
|
|
@ -40,7 +40,7 @@ edi_about_show(Evas_Object *mainwin)
|
|||
win = elm_win_add(mainwin, "about", ELM_WIN_DIALOG_BASIC);
|
||||
if (!win) return NULL;
|
||||
|
||||
elm_win_title_set(win, "About Edi");
|
||||
elm_win_title_set(win, "About Edi (" VERSION ")");
|
||||
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
|
||||
evas_object_smart_callback_add(win, "delete,request", _edi_about_exit, win);
|
||||
|
||||
|
|
Loading…
Reference in New Issue