forked from enlightenment/efl
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
2b64f2fd1b
|
@ -225,24 +225,16 @@ _elm_code_widget_fill(Elm_Code_Widget *widget)
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_elm_code_widget_line_cb(void *data, Eo *obj EINA_UNUSED,
|
_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_Widget *widget;
|
||||||
Elm_Code_Line *line;
|
|
||||||
|
|
||||||
Evas_Textgrid_Cell *cells;
|
|
||||||
Elm_Code_Widget_Data *pd;
|
|
||||||
|
|
||||||
widget = (Elm_Code_Widget *)data;
|
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))
|
if (!_elm_code_widget_resize(widget))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
// FIXME refresh just the row - but this resulted in undrawn areas
|
// FIXME refresh just the row unless we have resized (by being the result of a row append)
|
||||||
// cells = evas_object_textgrid_cellrow_get(pd->grid, line->number - 1);
|
|
||||||
// _elm_code_widget_fill_line(widget, line);
|
|
||||||
_elm_code_widget_fill(widget);
|
_elm_code_widget_fill(widget);
|
||||||
|
|
||||||
return EO_CALLBACK_CONTINUE;
|
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
|
|
Loading…
Reference in New Issue