2015-04-04 10:17:01 -07:00
|
|
|
#ifndef ELM_CODE_WIDGET_PRIVATE_H
|
|
|
|
# define ELM_CODE_WIDGET_PRIVATE_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure holding the info about a selected region.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int start_line, end_line;
|
|
|
|
unsigned int start_col, end_col;
|
|
|
|
} Elm_Code_Widget_Selection_Data;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Elm_Code *code;
|
2016-03-29 19:58:39 -07:00
|
|
|
Eina_List *grids;
|
|
|
|
unsigned int col_count;
|
|
|
|
Evas_Object *scroller, *gridbox;
|
2015-04-04 10:17:01 -07:00
|
|
|
|
2015-05-24 10:39:57 -07:00
|
|
|
const char *font_name;
|
2015-04-04 10:17:01 -07:00
|
|
|
Evas_Font_Size font_size;
|
|
|
|
double gravity_x, gravity_y;
|
|
|
|
|
|
|
|
unsigned int cursor_line, cursor_col;
|
2016-12-09 07:53:38 -08:00
|
|
|
Evas_Object *cursor_rect;
|
|
|
|
|
2015-04-04 10:17:01 -07:00
|
|
|
Eina_Bool editable, focussed;
|
|
|
|
Eina_Bool show_line_numbers;
|
|
|
|
unsigned int line_width_marker, tabstop;
|
2016-02-08 16:32:16 -08:00
|
|
|
Eina_Bool show_whitespace, tab_inserts_spaces;
|
2015-04-04 10:17:01 -07:00
|
|
|
|
|
|
|
Elm_Code_Widget_Selection_Data *selection;
|
2016-02-21 10:11:33 -08:00
|
|
|
|
|
|
|
/* Undo stack */
|
|
|
|
Eina_List *undo_stack;
|
|
|
|
Eina_List *undo_stack_ptr;
|
2016-09-11 10:47:05 -07:00
|
|
|
|
|
|
|
Evas_Object *hoversel;
|
2015-04-04 10:17:01 -07:00
|
|
|
} Elm_Code_Widget_Data;
|
|
|
|
|
2016-02-21 10:11:33 -08:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-02-21 15:46:10 -08:00
|
|
|
char *content;
|
2016-02-21 10:11:33 -08:00
|
|
|
unsigned int length;
|
|
|
|
unsigned int start_line, start_col, end_line, end_col;
|
|
|
|
|
|
|
|
Eina_Bool insert : 1; /**< True if the change is an insertion */
|
|
|
|
} Elm_Code_Widget_Change_Info;
|
|
|
|
|
2015-04-04 10:17:01 -07:00
|
|
|
/* Private widget methods */
|
|
|
|
|
2016-03-29 19:58:39 -07:00
|
|
|
void _elm_code_widget_cell_size_get(Elm_Code_Widget *widget, Evas_Coord *width, Evas_Coord *height);
|
|
|
|
|
2017-05-03 00:17:06 -07:00
|
|
|
void _elm_code_widget_text_at_cursor_insert_no_undo(Elm_Code_Widget *widget, const char *text, unsigned int length);
|
2016-02-21 10:11:33 -08:00
|
|
|
|
|
|
|
void _elm_code_widget_newline(Elm_Code_Widget *widget);
|
|
|
|
|
2016-02-21 15:46:10 -08:00
|
|
|
void _elm_code_widget_backspace(Elm_Code_Widget *widget);
|
|
|
|
|
|
|
|
void _elm_code_widget_delete(Elm_Code_Widget *widget);
|
|
|
|
|
2015-04-04 10:17:01 -07:00
|
|
|
void _elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text);
|
|
|
|
|
2015-09-16 04:32:25 -07:00
|
|
|
EAPI Elm_Code_Widget_Selection_Data *elm_code_widget_selection_normalized_get(Evas_Object *widget);
|
2015-04-04 10:17:01 -07:00
|
|
|
|
2017-05-03 00:17:06 -07:00
|
|
|
void _elm_code_widget_selection_delete_no_undo(Elm_Code_Widget *widget);
|
|
|
|
|
2016-02-21 10:11:33 -08:00
|
|
|
void _elm_code_widget_undo_change_add(Evas_Object *widget, Elm_Code_Widget_Change_Info *info);
|
|
|
|
|
2017-02-01 01:08:14 -08:00
|
|
|
void _elm_code_widget_change_selection_add(Evas_Object *widget);
|
|
|
|
|
2015-04-04 10:17:01 -07:00
|
|
|
#endif
|