forked from enlightenment/edi
Refactor eo widget2 to widget - update in edi too
This commit is contained in:
parent
159c47d340
commit
50c5cb572b
|
@ -12,7 +12,7 @@
|
|||
#include "gettext.h"
|
||||
|
||||
#include <Elm_Code.h>
|
||||
#include "elm_code_widget2.eo.h"
|
||||
#include "elm_code_widget.eo.h"
|
||||
|
||||
#include "elm_code_test_private.h"
|
||||
|
||||
|
@ -48,15 +48,15 @@ static Evas_Object *
|
|||
_elm_code_test_welcome_setup(Evas_Object *parent)
|
||||
{
|
||||
Elm_Code *code;
|
||||
Elm_Code_Widget2 *widget;
|
||||
Elm_Code_Widget *widget;
|
||||
|
||||
code = elm_code_create();
|
||||
widget = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
|
||||
widget = eo_add(ELM_CODE_WIDGET_CLASS, parent);
|
||||
eo_do(widget,
|
||||
elm_code_widget2_code_set(code);
|
||||
elm_code_widget2_font_size_set(14);
|
||||
elm_code_widget2_editable_set(EINA_TRUE);
|
||||
eo_event_callback_add(ELM_CODE_WIDGET2_EVENT_LINE_CLICKED, _elm_code_test_line_cb, code));
|
||||
elm_code_widget_code_set(code);
|
||||
elm_code_widget_font_size_set(14);
|
||||
elm_code_widget_editable_set(EINA_TRUE);
|
||||
eo_event_callback_add(ELM_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_cb, code));
|
||||
|
||||
_append_line(code->file, "Hello World, Elm Code!");
|
||||
elm_code_file_line_token_add(code->file, 1, 14, 21, ELM_CODE_TOKEN_TYPE_COMMENT);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "elm_code_common.h"
|
||||
#include "elm_code_file.h"
|
||||
#include "elm_code_parse.h"
|
||||
#include "elm_code_widget2.eo.h"
|
||||
#include "elm_code_widget.eo.h"
|
||||
#include "elm_code_diff_widget.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -12,7 +12,7 @@ lib_LTLIBRARIES = libelm_code.la
|
|||
includes_HEADERS = \
|
||||
elm_code_file.h \
|
||||
elm_code_parse.h \
|
||||
elm_code_widget2.eo.h \
|
||||
elm_code_widget.eo.h \
|
||||
elm_code_diff_widget.h \
|
||||
Elm_Code.h
|
||||
includesdir = $(includedir)/edi-@VMAJ@
|
||||
|
@ -20,7 +20,7 @@ includesdir = $(includedir)/edi-@VMAJ@
|
|||
libelm_code_la_SOURCES = \
|
||||
elm_code_file.c \
|
||||
elm_code_parse.c \
|
||||
elm_code_widget2.c \
|
||||
elm_code_widget.c \
|
||||
elm_code_diff_widget.c \
|
||||
elm_code.c \
|
||||
elm_code_private.h
|
||||
|
|
|
@ -80,7 +80,7 @@ static void _elm_code_diff_widget_parse_diff(Elm_Code_File *diff, Elm_Code_File
|
|||
EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
|
||||
{
|
||||
Elm_Code *wcode1, *wcode2;
|
||||
Elm_Code_Widget2 *widget_left, *widget_right;
|
||||
Elm_Code_Widget *widget_left, *widget_right;
|
||||
Evas_Object *hbox;
|
||||
|
||||
hbox = elm_panes_add(parent);
|
||||
|
@ -91,9 +91,9 @@ EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
|
|||
|
||||
// left side of diff
|
||||
wcode1 = elm_code_create();
|
||||
widget_left = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
|
||||
widget_left = eo_add(ELM_CODE_WIDGET_CLASS, parent);
|
||||
eo_do(widget_left,
|
||||
elm_code_widget2_code_set(wcode1));
|
||||
elm_code_widget_code_set(wcode1));
|
||||
|
||||
evas_object_size_hint_weight_set(widget_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(widget_left, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -103,9 +103,9 @@ EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
|
|||
|
||||
// right side of diff
|
||||
wcode2 = elm_code_create();
|
||||
widget_right = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
|
||||
widget_right = eo_add(ELM_CODE_WIDGET_CLASS, parent);
|
||||
eo_do(widget_right,
|
||||
elm_code_widget2_code_set(wcode2));
|
||||
elm_code_widget_code_set(wcode2));
|
||||
|
||||
evas_object_size_hint_weight_set(widget_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(widget_right, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -119,11 +119,11 @@ EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
|
|||
|
||||
EAPI void elm_code_diff_widget_font_size_set(Evas_Object *widget, int size)
|
||||
{
|
||||
Elm_Code_Widget2 *child;
|
||||
Elm_Code_Widget *child;
|
||||
|
||||
child = (Elm_Code_Widget2 *) evas_object_data_get(widget, ELM_CODE_DIFF_WIDGET_LEFT);
|
||||
eo_do(child, elm_code_widget2_font_size_set(size));
|
||||
child = (Elm_Code_Widget2 *) evas_object_data_get(widget, ELM_CODE_DIFF_WIDGET_RIGHT);
|
||||
eo_do(child, elm_code_widget2_font_size_set(size));
|
||||
child = (Elm_Code_Widget *) evas_object_data_get(widget, ELM_CODE_DIFF_WIDGET_LEFT);
|
||||
eo_do(child, elm_code_widget_font_size_set(size));
|
||||
child = (Elm_Code_Widget *) evas_object_data_get(widget, ELM_CODE_DIFF_WIDGET_RIGHT);
|
||||
eo_do(child, elm_code_widget_font_size_set(size));
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <elm_widget.h>
|
||||
|
||||
#include <Elm_Code.h>
|
||||
#include "elm_code_widget2.eo.h"
|
||||
#include "elm_code_widget.eo.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -19,9 +19,9 @@ typedef struct
|
|||
Evas_Font_Size font_size;
|
||||
unsigned int cursor_line, cursor_col;
|
||||
Eina_Bool editable, focussed;
|
||||
} Elm_Code_Widget2_Data;
|
||||
} Elm_Code_Widget_Data;
|
||||
|
||||
Eina_Unicode status_icons2[] = {
|
||||
Eina_Unicode status_icons[] = {
|
||||
' ',
|
||||
'!',
|
||||
|
||||
|
@ -37,16 +37,16 @@ Eina_Unicode status_icons2[] = {
|
|||
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_eo_base_constructor(Eo *obj, Elm_Code_Widget2_Data *pd EINA_UNUSED)
|
||||
_elm_code_widget_eo_base_constructor(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED)
|
||||
{
|
||||
eo_do_super(obj, ELM_CODE_WIDGET2_CLASS, eo_constructor());
|
||||
eo_do_super(obj, ELM_CODE_WIDGET_CLASS, eo_constructor());
|
||||
|
||||
pd->cursor_line = 1;
|
||||
pd->cursor_col = 1;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_class_constructor(Eo_Class *klass EINA_UNUSED)
|
||||
_elm_code_widget_class_constructor(Eo_Class *klass EINA_UNUSED)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ _elm_code_widget_fill_line_tokens(Evas_Textgrid_Cell *cells, unsigned int count,
|
|||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget_fill_line(Elm_Code_Widget2_Data *pd, Evas_Textgrid_Cell *cells, Elm_Code_Line *line)
|
||||
_elm_code_widget_fill_line(Elm_Code_Widget_Data *pd, Evas_Textgrid_Cell *cells, Elm_Code_Line *line)
|
||||
{
|
||||
char *chr;
|
||||
unsigned int length, x;
|
||||
|
@ -113,7 +113,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget2_Data *pd, Evas_Textgrid_Cell *cells,
|
|||
length = line->length;
|
||||
evas_object_textgrid_size_get(pd->grid, &w, NULL);
|
||||
|
||||
cells[0].codepoint = status_icons2[line->status];
|
||||
cells[0].codepoint = status_icons[line->status];
|
||||
cells[0].bold = 1;
|
||||
cells[0].fg = ELM_CODE_TOKEN_TYPE_DEFAULT;
|
||||
cells[0].bg = line->status;
|
||||
|
@ -146,7 +146,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget2_Data *pd, Evas_Textgrid_Cell *cells,
|
|||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget_fill(Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_fill(Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
Elm_Code_Line *line;
|
||||
Evas_Textgrid_Cell *cells;
|
||||
|
@ -167,16 +167,16 @@ _elm_code_widget_fill(Elm_Code_Widget2_Data *pd)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_elm_code_widget2_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)
|
||||
{
|
||||
Elm_Code_Widget2_Data *widget;
|
||||
Elm_Code_Widget_Data *widget;
|
||||
Elm_Code_Line *line;
|
||||
int h;
|
||||
|
||||
Evas_Textgrid_Cell *cells;
|
||||
|
||||
widget = (Elm_Code_Widget2_Data *)data;
|
||||
widget = (Elm_Code_Widget_Data *)data;
|
||||
line = (Elm_Code_Line *)event_info;
|
||||
|
||||
evas_object_textgrid_size_get(widget->grid, NULL, &h);
|
||||
|
@ -192,37 +192,37 @@ _elm_code_widget2_line_cb(void *data, Eo *obj EINA_UNUSED,
|
|||
|
||||
|
||||
static Eina_Bool
|
||||
_elm_code_widget2_file_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
|
||||
_elm_code_widget_file_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Elm_Code_Widget2_Data *widget;
|
||||
Elm_Code_Widget_Data *widget;
|
||||
|
||||
widget = (Elm_Code_Widget2_Data *)data;
|
||||
widget = (Elm_Code_Widget_Data *)data;
|
||||
|
||||
_elm_code_widget_fill(widget);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
_elm_code_widget_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Elm_Code_Widget2_Data *widget;
|
||||
Elm_Code_Widget_Data *widget;
|
||||
|
||||
widget = (Elm_Code_Widget2_Data *)data;
|
||||
widget = (Elm_Code_Widget_Data *)data;
|
||||
|
||||
_elm_code_widget_fill(widget);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_clicked_editable_cb(Elm_Code_Widget2 *widget, Evas_Coord x, Evas_Coord y)
|
||||
_elm_code_widget_clicked_editable_cb(Elm_Code_Widget *widget, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Elm_Code_Widget2_Data *pd;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
Elm_Code_Line *line;
|
||||
int cw, ch;
|
||||
unsigned int row, col;
|
||||
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET2_CLASS);
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
|
||||
evas_object_textgrid_cell_size_get(pd->grid, &cw, &ch);
|
||||
col = ((double) x / cw) + 2;
|
||||
|
@ -245,51 +245,51 @@ _elm_code_widget2_clicked_editable_cb(Elm_Code_Widget2 *widget, Evas_Coord x, Ev
|
|||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_clicked_readonly_cb(Elm_Code_Widget2 *widget, Evas_Coord y)
|
||||
_elm_code_widget_clicked_readonly_cb(Elm_Code_Widget *widget, Evas_Coord y)
|
||||
{
|
||||
Elm_Code_Widget2_Data *pd;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
Elm_Code_Line *line;
|
||||
int ch;
|
||||
unsigned int row;
|
||||
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET2_CLASS);
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
|
||||
evas_object_textgrid_cell_size_get(pd->grid, NULL, &ch);
|
||||
row = ((double) y / ch) + 1;
|
||||
|
||||
line = elm_code_file_line_get(pd->code->file, row);
|
||||
if (line)
|
||||
eo_do(widget, eo_event_callback_call(ELM_CODE_WIDGET2_EVENT_LINE_CLICKED, line));
|
||||
eo_do(widget, eo_event_callback_call(ELM_CODE_WIDGET_EVENT_LINE_CLICKED, line));
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_clicked_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
_elm_code_widget_clicked_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Code_Widget2 *widget;
|
||||
Elm_Code_Widget2_Data *pd;
|
||||
Elm_Code_Widget *widget;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
Evas_Event_Mouse_Up *event;
|
||||
Evas_Coord x, y;
|
||||
|
||||
widget = (Elm_Code_Widget2 *)data;
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET2_CLASS);
|
||||
widget = (Elm_Code_Widget *)data;
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
event = (Evas_Event_Mouse_Up *)event_info;
|
||||
|
||||
x = event->canvas.x;
|
||||
y = event->canvas.y;
|
||||
|
||||
if (pd->editable)
|
||||
_elm_code_widget2_clicked_editable_cb(widget, x, y);
|
||||
_elm_code_widget_clicked_editable_cb(widget, x, y);
|
||||
else
|
||||
_elm_code_widget2_clicked_readonly_cb(widget, y);
|
||||
_elm_code_widget_clicked_readonly_cb(widget, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_cursor_move_up(Elm_Code_Widget2 *widget)
|
||||
_elm_code_widget_cursor_move_up(Elm_Code_Widget *widget)
|
||||
{
|
||||
Elm_Code_Widget2_Data *pd;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET2_CLASS);
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
|
||||
if (pd->cursor_line > 1)
|
||||
pd->cursor_line--;
|
||||
|
@ -298,11 +298,11 @@ _elm_code_widget2_cursor_move_up(Elm_Code_Widget2 *widget)
|
|||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_cursor_move_down(Elm_Code_Widget2 *widget)
|
||||
_elm_code_widget_cursor_move_down(Elm_Code_Widget *widget)
|
||||
{
|
||||
Elm_Code_Widget2_Data *pd;
|
||||
Elm_Code_Widget_Data *pd;
|
||||
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET2_CLASS);
|
||||
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
|
||||
|
||||
if (pd->cursor_line < elm_code_file_lines_get(pd->code->file))
|
||||
pd->cursor_line++;
|
||||
|
@ -311,27 +311,27 @@ _elm_code_widget2_cursor_move_down(Elm_Code_Widget2 *widget)
|
|||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_key_down_cb(void *data, Evas *evas EINA_UNUSED,
|
||||
_elm_code_widget_key_down_cb(void *data, Evas *evas EINA_UNUSED,
|
||||
Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Elm_Code_Widget2 *widget;
|
||||
Elm_Code_Widget *widget;
|
||||
|
||||
widget = (Elm_Code_Widget2 *)data;
|
||||
widget = (Elm_Code_Widget *)data;
|
||||
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
printf("KEY %s\n", ev->key);
|
||||
if (!(strcmp(ev->key, "Up")))
|
||||
_elm_code_widget2_cursor_move_up(widget);
|
||||
_elm_code_widget_cursor_move_up(widget);
|
||||
if (!(strcmp(ev->key, "Down")))
|
||||
_elm_code_widget2_cursor_move_down(widget);
|
||||
_elm_code_widget_cursor_move_down(widget);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_code_widget2_elm_widget_on_focus(Eo *obj, Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_elm_widget_on_focus(Eo *obj, Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
eo_do_super(obj, ELM_CODE_WIDGET2_CLASS, int_ret = elm_obj_widget_on_focus());
|
||||
eo_do_super(obj, ELM_CODE_WIDGET_CLASS, int_ret = elm_obj_widget_on_focus());
|
||||
if (!int_ret) return EINA_TRUE;
|
||||
|
||||
pd->focussed = elm_widget_focus_get(obj);
|
||||
|
@ -341,8 +341,8 @@ _elm_code_widget2_elm_widget_on_focus(Eo *obj, Elm_Code_Widget2_Data *pd)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_elm_interface_scrollable_content_pos_set(Eo *obj EINA_UNUSED,
|
||||
Elm_Code_Widget2_Data *pd EINA_UNUSED,
|
||||
_elm_code_widget_elm_interface_scrollable_content_pos_set(Eo *obj EINA_UNUSED,
|
||||
Elm_Code_Widget_Data *pd EINA_UNUSED,
|
||||
Evas_Coord x, Evas_Coord y,
|
||||
Eina_Bool sig EINA_UNUSED)
|
||||
{
|
||||
|
@ -350,46 +350,46 @@ _elm_code_widget2_elm_interface_scrollable_content_pos_set(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_font_size_set(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd, Evas_Font_Size font_size)
|
||||
_elm_code_widget_font_size_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Evas_Font_Size font_size)
|
||||
{
|
||||
evas_object_textgrid_font_set(pd->grid, "Mono", font_size * elm_config_scale_get());
|
||||
pd->font_size = font_size;
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Font_Size
|
||||
_elm_code_widget2_font_size_get(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_font_size_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
return pd->font_size;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_code_set(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd, Elm_Code *code)
|
||||
_elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED, Elm_Code *code)
|
||||
{
|
||||
pd->code = code;
|
||||
|
||||
code->widgets = eina_list_append(code->widgets, pd);
|
||||
code->widgets = eina_list_append(code->widgets, obj);
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Code *
|
||||
_elm_code_widget2_code_get(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_code_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
return pd->code;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_editable_set(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd, Eina_Bool editable)
|
||||
_elm_code_widget_editable_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Eina_Bool editable)
|
||||
{
|
||||
pd->editable = editable;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_code_widget2_editable_get(Eo *obj EINA_UNUSED, Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_editable_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
return pd->editable;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_code_widget2_setup_palette(Evas_Object *o)
|
||||
_elm_code_widget_setup_palette(Evas_Object *o)
|
||||
{
|
||||
// setup status colors
|
||||
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_DEFAULT,
|
||||
|
@ -428,11 +428,11 @@ _elm_code_widget2_setup_palette(Evas_Object *o)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_code_widget2_evas_object_smart_add(Eo *obj, Elm_Code_Widget2_Data *pd)
|
||||
_elm_code_widget_evas_object_smart_add(Eo *obj, Elm_Code_Widget_Data *pd)
|
||||
{
|
||||
Evas_Object *grid;
|
||||
|
||||
eo_do_super(obj, ELM_CODE_WIDGET2_CLASS, evas_obj_smart_add());
|
||||
eo_do_super(obj, ELM_CODE_WIDGET_CLASS, evas_obj_smart_add());
|
||||
elm_object_focus_allow_set(obj, EINA_TRUE);
|
||||
|
||||
grid = evas_object_textgrid_add(obj);
|
||||
|
@ -441,18 +441,18 @@ _elm_code_widget2_evas_object_smart_add(Eo *obj, Elm_Code_Widget2_Data *pd)
|
|||
evas_object_show(grid);
|
||||
elm_box_pack_end(obj, grid);
|
||||
pd->grid = grid;
|
||||
_elm_code_widget2_setup_palette(grid);
|
||||
_elm_code_widget_setup_palette(grid);
|
||||
|
||||
evas_object_event_callback_add(grid, EVAS_CALLBACK_RESIZE, _elm_code_widget2_resize_cb, pd);
|
||||
evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_UP, _elm_code_widget2_clicked_cb, obj);
|
||||
evas_object_event_callback_add(grid, EVAS_CALLBACK_RESIZE, _elm_code_widget_resize_cb, pd);
|
||||
evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_UP, _elm_code_widget_clicked_cb, obj);
|
||||
// FIXME find why obj is not getting key_down events
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _elm_code_widget2_key_down_cb, obj);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _elm_code_widget_key_down_cb, obj);
|
||||
|
||||
eo_do(obj,
|
||||
eo_event_callback_add(&ELM_CODE_EVENT_LINE_SET_DONE, _elm_code_widget2_line_cb, pd);
|
||||
eo_event_callback_add(&ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget2_file_cb, pd));
|
||||
eo_event_callback_add(&ELM_CODE_EVENT_LINE_SET_DONE, _elm_code_widget_line_cb, pd);
|
||||
eo_event_callback_add(&ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget_file_cb, pd));
|
||||
|
||||
_elm_code_widget2_font_size_set(obj, pd, 10);
|
||||
_elm_code_widget_font_size_set(obj, pd, 10);
|
||||
}
|
||||
|
||||
#include "elm_code_widget2.eo.c"
|
||||
#include "elm_code_widget.eo.c"
|
|
@ -1,7 +1,7 @@
|
|||
class Elm_Code_Widget2 (Elm_Box, Elm_Interface_Scrollable,
|
||||
Elm_Interface_Atspi_Text)
|
||||
class Elm_Code_Widget (Elm_Box, Elm_Interface_Scrollable,
|
||||
Elm_Interface_Atspi_Text)
|
||||
{
|
||||
eo_prefix: elm_code_widget2;
|
||||
eo_prefix: elm_code_widget;
|
||||
properties {
|
||||
code {
|
||||
set {
|
|
@ -0,0 +1,70 @@
|
|||
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_LINE_CLICKED =
|
||||
EO_EVENT_DESCRIPTION("line,clicked", "");
|
||||
|
||||
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_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_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_on_focus(Eo *obj, Elm_Code_Widget_Data *pd);
|
||||
|
||||
|
||||
void _elm_code_widget_elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Code_Widget_Data *pd, Evas_Coord x, Evas_Coord y, Eina_Bool sig);
|
||||
|
||||
|
||||
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_on_focus, _elm_code_widget_elm_widget_on_focus),
|
||||
EO_OP_FUNC_OVERRIDE(elm_interface_scrollable_content_pos_set, _elm_code_widget_elm_interface_scrollable_content_pos_set),
|
||||
EO_OP_FUNC(elm_code_widget_code_set, _elm_code_widget_code_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget_code_get, _elm_code_widget_code_get, ""),
|
||||
EO_OP_FUNC(elm_code_widget_font_size_set, _elm_code_widget_font_size_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget_font_size_get, _elm_code_widget_font_size_get, ""),
|
||||
EO_OP_FUNC(elm_code_widget_editable_set, _elm_code_widget_editable_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget_editable_get, _elm_code_widget_editable_get, ""),
|
||||
EO_OP_SENTINEL
|
||||
};
|
||||
|
||||
static const Eo_Event_Description *_elm_code_widget_event_desc[] = {
|
||||
ELM_CODE_WIDGET_EVENT_LINE_CLICKED,
|
||||
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_BOX_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);
|
|
@ -0,0 +1,78 @@
|
|||
#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;
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] code No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_code_set(Elm_Code *code);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Elm_Code * elm_code_widget_code_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] font_size No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_font_size_set(Evas_Font_Size font_size);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Evas_Font_Size elm_code_widget_font_size_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] editable No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget_editable_set(Eina_Bool editable);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Eina_Bool elm_code_widget_editable_get(void);
|
||||
|
||||
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET_EVENT_LINE_CLICKED;
|
||||
|
||||
/**
|
||||
* No description
|
||||
*/
|
||||
#define ELM_CODE_WIDGET_EVENT_LINE_CLICKED (&(_ELM_CODE_WIDGET_EVENT_LINE_CLICKED))
|
||||
|
||||
#endif
|
|
@ -1,70 +0,0 @@
|
|||
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_LINE_CLICKED =
|
||||
EO_EVENT_DESCRIPTION("line,clicked", "");
|
||||
|
||||
void _elm_code_widget2_code_set(Eo *obj, Elm_Code_Widget2_Data *pd, Elm_Code *code);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget2_code_set, EO_FUNC_CALL(code), Elm_Code *code);
|
||||
|
||||
Elm_Code * _elm_code_widget2_code_get(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget2_code_get, Elm_Code *, 0);
|
||||
|
||||
void _elm_code_widget2_font_size_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Font_Size font_size);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget2_font_size_set, EO_FUNC_CALL(font_size), Evas_Font_Size font_size);
|
||||
|
||||
Evas_Font_Size _elm_code_widget2_font_size_get(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget2_font_size_get, Evas_Font_Size, 0);
|
||||
|
||||
void _elm_code_widget2_editable_set(Eo *obj, Elm_Code_Widget2_Data *pd, Eina_Bool editable);
|
||||
|
||||
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget2_editable_set, EO_FUNC_CALL(editable), Eina_Bool editable);
|
||||
|
||||
Eina_Bool _elm_code_widget2_editable_get(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
EOAPI EO_FUNC_BODY(elm_code_widget2_editable_get, Eina_Bool, 0);
|
||||
|
||||
void _elm_code_widget2_eo_base_constructor(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
|
||||
void _elm_code_widget2_evas_object_smart_add(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
|
||||
Eina_Bool _elm_code_widget2_elm_widget_on_focus(Eo *obj, Elm_Code_Widget2_Data *pd);
|
||||
|
||||
|
||||
void _elm_code_widget2_elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Coord x, Evas_Coord y, Eina_Bool sig);
|
||||
|
||||
|
||||
static Eo_Op_Description _elm_code_widget2_op_desc[] = {
|
||||
EO_OP_FUNC_OVERRIDE(eo_constructor, _elm_code_widget2_eo_base_constructor),
|
||||
EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, _elm_code_widget2_evas_object_smart_add),
|
||||
EO_OP_FUNC_OVERRIDE(elm_obj_widget_on_focus, _elm_code_widget2_elm_widget_on_focus),
|
||||
EO_OP_FUNC_OVERRIDE(elm_interface_scrollable_content_pos_set, _elm_code_widget2_elm_interface_scrollable_content_pos_set),
|
||||
EO_OP_FUNC(elm_code_widget2_code_set, _elm_code_widget2_code_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget2_code_get, _elm_code_widget2_code_get, ""),
|
||||
EO_OP_FUNC(elm_code_widget2_font_size_set, _elm_code_widget2_font_size_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget2_font_size_get, _elm_code_widget2_font_size_get, ""),
|
||||
EO_OP_FUNC(elm_code_widget2_editable_set, _elm_code_widget2_editable_set, ""),
|
||||
EO_OP_FUNC(elm_code_widget2_editable_get, _elm_code_widget2_editable_get, ""),
|
||||
EO_OP_SENTINEL
|
||||
};
|
||||
|
||||
static const Eo_Event_Description *_elm_code_widget2_event_desc[] = {
|
||||
ELM_CODE_WIDGET2_EVENT_LINE_CLICKED,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const Eo_Class_Description _elm_code_widget2_class_desc = {
|
||||
EO_VERSION,
|
||||
"Elm_Code_Widget2",
|
||||
EO_CLASS_TYPE_REGULAR,
|
||||
EO_CLASS_DESCRIPTION_OPS(_elm_code_widget2_op_desc),
|
||||
_elm_code_widget2_event_desc,
|
||||
sizeof(Elm_Code_Widget2_Data),
|
||||
_elm_code_widget2_class_constructor,
|
||||
NULL
|
||||
};
|
||||
|
||||
EO_DEFINE_CLASS(elm_code_widget2_class_get, &_elm_code_widget2_class_desc, ELM_BOX_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);
|
|
@ -1,78 +0,0 @@
|
|||
#ifndef _ELM_CODE_WIDGET2_EO_H_
|
||||
#define _ELM_CODE_WIDGET2_EO_H_
|
||||
|
||||
#ifndef _ELM_CODE_WIDGET2_EO_CLASS_TYPE
|
||||
#define _ELM_CODE_WIDGET2_EO_CLASS_TYPE
|
||||
|
||||
typedef Eo Elm_Code_Widget2;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _ELM_CODE_WIDGET2_EO_TYPES
|
||||
#define _ELM_CODE_WIDGET2_EO_TYPES
|
||||
|
||||
|
||||
#endif
|
||||
#define ELM_CODE_WIDGET2_CLASS elm_code_widget2_class_get()
|
||||
|
||||
const Eo_Class *elm_code_widget2_class_get(void) EINA_CONST;
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] code No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget2_code_set(Elm_Code *code);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Elm_Code * elm_code_widget2_code_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] font_size No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget2_font_size_set(Evas_Font_Size font_size);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Evas_Font_Size elm_code_widget2_font_size_get(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
* @param[in] editable No description supplied.
|
||||
*
|
||||
*/
|
||||
EOAPI void elm_code_widget2_editable_set(Eina_Bool editable);
|
||||
|
||||
/**
|
||||
*
|
||||
* No description supplied.
|
||||
*
|
||||
*
|
||||
*/
|
||||
EOAPI Eina_Bool elm_code_widget2_editable_get(void);
|
||||
|
||||
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_LINE_CLICKED;
|
||||
|
||||
/**
|
||||
* No description
|
||||
*/
|
||||
#define ELM_CODE_WIDGET2_EVENT_LINE_CLICKED (&(_ELM_CODE_WIDGET2_EVENT_LINE_CLICKED))
|
||||
|
||||
#endif
|
|
@ -3,6 +3,6 @@ cd `dirname $0`
|
|||
|
||||
INCLUDE="-I /usr/local/share/eolian/include/eo-1 -I /usr/local/share/eolian/include/elementary-1 -I /usr/local/share/eolian/include/evas-1 -I /usr/local/share/eolian/include/efl-1"
|
||||
|
||||
eolian_gen $INCLUDE --gh --eo -o elm_code_widget2.eo.h elm_code_widget2.eo
|
||||
eolian_gen $INCLUDE --gc --eo -o elm_code_widget2.eo.c elm_code_widget2.eo
|
||||
eolian_gen $INCLUDE --gi --eo -o elm_code_widget2.c elm_code_widget2.eo
|
||||
eolian_gen $INCLUDE --gh --eo -o elm_code_widget.eo.h elm_code_widget.eo
|
||||
eolian_gen $INCLUDE --gc --eo -o elm_code_widget.eo.c elm_code_widget.eo
|
||||
eolian_gen $INCLUDE --gi --eo -o elm_code_widget.c elm_code_widget.eo
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "elm_code_suite.h"
|
||||
|
||||
#include "elm_code_widget2.c"
|
||||
#include "elm_code_widget.c"
|
||||
|
||||
static void _assert_cell_type(Evas_Textgrid_Cell cell, Elm_Code_Token_Type type, int id)
|
||||
{
|
||||
|
|
|
@ -336,15 +336,15 @@ EAPI void edi_consolepanel_add(Evas_Object *parent)
|
|||
EAPI void edi_testpanel_add(Evas_Object *parent)
|
||||
{
|
||||
Elm_Code *code;
|
||||
Elm_Code_Widget2 *widget;
|
||||
Elm_Code_Widget *widget;
|
||||
|
||||
code = elm_code_create();
|
||||
_edi_test_code = code;
|
||||
|
||||
widget = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
|
||||
widget = eo_add(ELM_CODE_WIDGET_CLASS, parent);
|
||||
eo_do(widget,
|
||||
elm_code_widget2_code_set(code);
|
||||
elm_code_widget2_font_size_set(_edi_cfg->font.size));
|
||||
elm_code_widget_code_set(code);
|
||||
elm_code_widget_font_size_set(_edi_cfg->font.size));
|
||||
|
||||
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
|
|
@ -40,14 +40,14 @@ static void _print_cb(const Eina_Log_Domain *domain,
|
|||
|
||||
EAPI void edi_logpanel_add(Evas_Object *parent)
|
||||
{
|
||||
Elm_Code_Widget2 *widget;
|
||||
Elm_Code_Widget *widget;
|
||||
Elm_Code *code;
|
||||
|
||||
code = elm_code_create();
|
||||
widget = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
|
||||
widget = eo_add(ELM_CODE_WIDGET_CLASS, parent);
|
||||
eo_do(widget,
|
||||
elm_code_widget2_code_set(code);
|
||||
elm_code_widget2_font_size_set(_edi_cfg->font.size));
|
||||
elm_code_widget_code_set(code);
|
||||
elm_code_widget_font_size_set(_edi_cfg->font.size));
|
||||
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_show(widget);
|
||||
|
|
Loading…
Reference in New Issue