diff --git a/elm_code/lib/elm_code.c b/elm_code/lib/elm_code.c index 9ae1ade..fb40c9f 100644 --- a/elm_code/lib/elm_code.c +++ b/elm_code/lib/elm_code.c @@ -13,6 +13,8 @@ int _elm_code_lib_log_dom = -1; const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE = EO_EVENT_DESCRIPTION("line,set,done", ""); +const Eo_Event_Description ELM_CODE_EVENT_FILE_LOAD_DONE = + EO_EVENT_DESCRIPTION("file, load,done", ""); EAPI int elm_code_init(void) diff --git a/elm_code/lib/elm_code_common.h b/elm_code/lib/elm_code_common.h index 11149fe..bae3599 100644 --- a/elm_code/lib/elm_code_common.h +++ b/elm_code/lib/elm_code_common.h @@ -5,6 +5,7 @@ #include EAPI extern const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE; +EAPI extern const Eo_Event_Description ELM_CODE_EVENT_FILE_LOAD_DONE; typedef enum { ELM_CODE_STATUS_TYPE_DEFAULT = 0, diff --git a/elm_code/lib/elm_code_file.c b/elm_code/lib/elm_code_file.c index 1f5f8a8..9650b33 100644 --- a/elm_code/lib/elm_code_file.c +++ b/elm_code/lib/elm_code_file.c @@ -76,6 +76,8 @@ EAPI Elm_Code_File *elm_code_file_open(const char *path) } eina_iterator_free(it); + if (ret->parent) + elm_code_callback_fire(ret->parent, &ELM_CODE_EVENT_FILE_LOAD_DONE, ret); return ret; } diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c index ba25461..760334f 100644 --- a/elm_code/lib/elm_code_widget.c +++ b/elm_code/lib/elm_code_widget.c @@ -92,6 +92,21 @@ _elm_code_widget_line_cb(void *data EINA_UNUSED, Eo *obj, return EINA_TRUE; } + +static Eina_Bool +_elm_code_widget_file_cb(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Evas_Object *o; + Elm_Code *code; + + code = (Elm_Code *)data; + o = (Evas_Object *)obj; + + elm_code_widget_fill(o, code); + return EINA_TRUE; +} + static void _elm_code_widget_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) @@ -130,6 +145,7 @@ EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code) evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _elm_code_widget_resize_cb, code); eo_do(o,eo_event_callback_add(&ELM_CODE_EVENT_LINE_SET_DONE, _elm_code_widget_line_cb, code)); + eo_do(o,eo_event_callback_add(&ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget_file_cb, code)); code->widgets = eina_list_append(code->widgets, o); return o;