[EGIT] [core/enlightenment] master 01/01: e comp object - patch volume update case for propagating state signals
raster pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=147bc7a6daf5203b5d7592b74726a6bc6e926f6e commit 147bc7a6daf5203b5d7592b74726a6bc6e926f6e Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 16:16:33 2017 +0900 e comp object - patch volume update case for propagating state signals complete f161edc3f3f13feb57ea118de506c2f0e8903fae with missing update case @feature --- src/bin/e_comp_object.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 2468e689d..92a66020d 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -3489,6 +3489,43 @@ e_comp_object_frame_icon_update(Evas_Object *obj) E_FREE_FUNC(cw->frame_icon, evas_object_del); } +static void +_e_comp_object_volume_update(Evas_Object *obj) +{ + API_ENTRY; + + if (cw->ec->focused) + e_client_volume_object_emit(cw->ec, "e,state,focused", "e"); + else + e_client_volume_object_emit(cw->ec, "e,state,unfocused", "e"); + if (cw->ec->urgent) + e_client_volume_object_emit(cw->ec, "e,state,urgent", "e"); + else + e_client_volume_object_emit(cw->ec, "e,state,not_urgent", "e"); + if (cw->ec->shaded) + e_client_volume_object_emit(cw->ec, "e,state,shaded", "e"); + if (cw->ec->sticky) + e_client_volume_object_emit(cw->ec, "e,state,sticky", "e"); + if (cw->ec->hung) + e_client_volume_object_emit(cw->ec, "e,state,hung", "e"); + /* visibility must always be enabled for re_manage clients to prevent +* pop-in animations every time the user sees a persistent client again; +* applying visibility for iconic clients prevents the client from getting +* stuck as hidden +*/ + if (cw->visible || cw->ec->iconic || cw->ec->re_manage) + { +if ((cw->w > 0) && (cw->h > 0)) + e_client_volume_object_emit(cw->ec, "e,state,visible", "e"); + } + else + e_client_volume_object_emit(cw->ec, "e,state,hidden", "e"); + if (e_comp_object_frame_allowed(cw->smart_obj)) + e_client_volume_object_emit(cw->ec, "e,state,focus,enabled", "e"); + else + e_client_volume_object_emit(cw->ec, "e,state,focus,disabled", "e"); +} + E_API void e_comp_object_frame_volume_update(Evas_Object *obj) { @@ -3504,6 +3541,7 @@ e_comp_object_frame_volume_update(Evas_Object *obj) cw->frame_volume = e_client_volume_object_add(cw->ec, e_comp->evas); edje_object_part_swallow(cw->frame_object, "e.swallow.volume", cw->frame_volume); + _e_comp_object_volume_update(obj); evas_object_show(cw->frame_volume); } } --
[EGIT] [core/enlightenment] master 01/01: comp object -> propgate signals to the volume objects from the frame
raster pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=f161edc3f3f13feb57ea118de506c2f0e8903fae commit f161edc3f3f13feb57ea118de506c2f0e8903fae Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 15:41:35 2017 +0900 comp object -> propgate signals to the volume objects from the frame if frame changes (eg by focus signals) the volume object cant adapt. send signals to it too so it can adapt if it wants to. @feat --- src/bin/e_client_volume.c | 16 +++- src/bin/e_client_volume.h | 1 + src/bin/e_comp_object.c | 15 +++ src/bin/e_comp_object.h | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/bin/e_client_volume.c b/src/bin/e_client_volume.c index aea8fd648..d1a4eaa6e 100644 --- a/src/bin/e_client_volume.c +++ b/src/bin/e_client_volume.c @@ -430,7 +430,6 @@ e_client_volume_object_add(E_Client *ec, Evas *evas) edje_object_message_send(o, EDJE_MESSAGE_INT_SET, 0, msg); edje_object_signal_emit(o, "e,action,volume,change", "e"); evas_object_show(o); - } if (edje_object_part_exists(bx, "e.swallow.volume")) { @@ -464,3 +463,18 @@ e_client_volume_object_add(E_Client *ec, Evas *evas) _e_client_volume_object_del_cb, handlers); return bx; } + +E_API void +e_client_volume_object_emit(E_Client *ec, const char *sig, const char *src) +{ + Evas_Object *o; + + EINA_SAFETY_ON_NULL_RETURN(ec); + o = e_comp_object_frame_volume_get(ec->frame); + if (o) + { +edje_object_signal_emit(o, sig, src); +o = edje_object_part_swallow_get(o, "e.swallow.volume_icon"); +if (o) edje_object_signal_emit(o, sig, src); + } +} diff --git a/src/bin/e_client_volume.h b/src/bin/e_client_volume.h index 68e172b67..12ae83628 100644 --- a/src/bin/e_client_volume.h +++ b/src/bin/e_client_volume.h @@ -55,5 +55,6 @@ E_API void e_client_volume_sink_remove(E_Client *ec, E_Client_Volume_Sin E_API void e_client_volume_sink_update(E_Client_Volume_Sink *mixer); E_API void e_client_volume_display_set(E_Client *ec, int volume, Eina_Bool mute); +E_API void e_client_volume_object_emit(E_Client *ec, const char *sig, const char *src); #endif diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 2fb36f415..2468e689d 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -3700,6 +3700,7 @@ e_comp_object_signal_emit(Evas_Object *obj, const char *sig, const char *src) API_ENTRY; //INF("EMIT %p: %s %s", cw->ec, sig, src); edje_object_signal_emit(cw->shobj, sig, src); + e_client_volume_object_emit(cw->ec, sig, src); if (cw->frame_object) edje_object_signal_emit(cw->frame_object, sig, src); if (cw->frame_icon && e_icon_edje_get(cw->frame_icon)) edje_object_signal_emit(e_icon_edje_get(cw->frame_icon), sig, src); @@ -4630,3 +4631,17 @@ e_comp_object_util_autoclose(Evas_Object *obj, E_Comp_Object_Autoclose_Cb del_cb evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _e_comp_object_autoclose_show, e_comp); evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_object_autoclose_del, e_comp); } + +E_API Evas_Object * +e_comp_object_frame_icon_get(Evas_Object *obj) +{ + API_ENTRY NULL; + return cw->frame_icon; +} + +E_API Evas_Object * +e_comp_object_frame_volume_get(Evas_Object *obj) +{ + API_ENTRY NULL; + return cw->frame_volume; +} diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h index 106b4e81b..aa62ce1b1 100644 --- a/src/bin/e_comp_object.h +++ b/src/bin/e_comp_object.h @@ -94,6 +94,8 @@ E_API Eina_Bool e_comp_object_effect_stop(Evas_Object *obj, Edje_Signal_Cb end_c E_API E_Comp_Object_Mover *e_comp_object_effect_mover_add(int pri, const char *sig, E_Comp_Object_Mover_Cb provider, const void *data); E_API void e_comp_object_effect_mover_del(E_Comp_Object_Mover *prov); E_API void e_comp_object_frame_volume_update(Evas_Object *obj); +E_API Evas_Object *e_comp_object_frame_icon_get(Evas_Object *obj); +E_API Evas_Object *e_comp_object_frame_volume_get(Evas_Object *obj); #endif #endif --
[EGIT] [core/efl] master 01/02: evas: Fix make check
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a438e9382c72bfecbfe6d7630e762b2013640c14 commit a438e9382c72bfecbfe6d7630e762b2013640c14 Author: Jean-Philippe AndreDate: Tue Nov 7 14:56:00 2017 +0900 evas: Fix make check Because of this I couldn't test my previous patches properly and now realized that I also broke make check... >_< See D5419 --- src/lib/evas/common/evas_font_draw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/common/evas_font_draw.h b/src/lib/evas/common/evas_font_draw.h index d84fb6aece..2fdfc36e12 100644 --- a/src/lib/evas/common/evas_font_draw.h +++ b/src/lib/evas/common/evas_font_draw.h @@ -1,7 +1,7 @@ #ifndef _EVAS_FONT_DRAW_H #define _EVAS_FONT_DRAW_H -#include "evas_common_private.h" +#include "../include/evas_common_private.h" /* draw */ typedef Eina_Bool (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h); --
[EGIT] [core/efl] master 02/02: elm: Fix make check (code_widget)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=80b0ef75374e0cd0c9b6aa657cbf3e819065da5f commit 80b0ef75374e0cd0c9b6aa657cbf3e819065da5f Author: Jean-Philippe AndreDate: Tue Nov 7 14:59:01 2017 +0900 elm: Fix make check (code_widget) elm_code_widget is causing a lot of trouble as it's relying on internal access to elementary, without being built as part of elementary.so. Many EAPI symbols are exported that shouldn't need to be, as they are only internals of elm. --- src/lib/elementary/elm_widget.c | 3 ++- src/lib/elementary/elm_widget.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index 022f1f3aba..cf0e8fd84e 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -53,7 +53,8 @@ typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data; typedef struct _Elm_Label_DataElm_Label_Data; typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data; -Eina_Bool _elm_legacy_add = EINA_FALSE; +/* FIXME: EAPI because of elm_code_widget test case */ +EAPI Eina_Bool _elm_legacy_add = EINA_FALSE; struct _Elm_Event_Cb_Data { diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index aa5d11d123..45f5d93629 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -811,7 +811,7 @@ _elm_widget_sub_object_redirect_to_top(Evas_Object *obj, Evas_Object *sobj) /* Internal hack to mark legacy objects as such before construction. * No need for TLS: Only UI objects created in the main loop matter. */ -extern Eina_Bool _elm_legacy_add; +EAPI Eina_Bool _elm_legacy_add; #define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \ efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); }) --
[EGIT] [core/efl] master 02/04: elm: Don't do anything before construction
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6cea4993e0ea7425a1dde2b38bcdb63687a7eaad commit 6cea4993e0ea7425a1dde2b38bcdb63687a7eaad Author: Jean-Philippe AndreDate: Tue Nov 7 14:26:37 2017 +0900 elm: Don't do anything before construction Obviously ui.win is still the ugly exception. --- src/lib/elementary/efl_ui_focus_layer.c | 6 ++ src/lib/elementary/efl_ui_focus_manager_calc.c| 3 ++- src/lib/elementary/efl_ui_focus_manager_sub.c | 5 ++--- src/lib/elementary/efl_ui_internal_text_interactive.c | 3 ++- src/lib/elementary/efl_ui_text.c | 7 --- src/lib/elementary/efl_ui_text_async.eo | 2 +- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/lib/elementary/efl_ui_focus_layer.c b/src/lib/elementary/efl_ui_focus_layer.c index 9f9c9bc547..eee240523a 100644 --- a/src/lib/elementary/efl_ui_focus_layer.c +++ b/src/lib/elementary/efl_ui_focus_layer.c @@ -73,14 +73,12 @@ _efl_ui_focus_layer_elm_widget_focus_state_apply(Eo *obj EINA_UNUSED, Efl_Ui_Foc EOLIAN static Efl_Object* _efl_ui_focus_layer_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd) { + obj = efl_constructor(efl_super(obj, MY_CLASS)); pd->manager = efl_ui_widget_focus_manager_create(obj, obj); - efl_composite_attach(obj, pd->manager); - pd->enable_on_visible = EINA_TRUE; pd->cycle = EINA_TRUE; - - return efl_constructor(efl_super(obj, MY_CLASS)); + return obj; } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index 334037e0a2..4d54a95903 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -909,8 +909,9 @@ _free_node(void *data) EOLIAN static Efl_Object * _efl_ui_focus_manager_calc_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) { + obj = efl_constructor(efl_super(obj, MY_CLASS)); pd->node_hash = eina_hash_pointer_new(_free_node); - return efl_constructor(efl_super(obj, MY_CLASS)); + return obj; } EOLIAN static Efl_Object * diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c index 86fdcea6b2..e0ea26f4c2 100644 --- a/src/lib/elementary/efl_ui_focus_manager_sub.c +++ b/src/lib/elementary/efl_ui_focus_manager_sub.c @@ -192,11 +192,10 @@ EFL_CALLBACKS_ARRAY_DEFINE(self_manager, EOLIAN static Efl_Object* _efl_ui_focus_manager_sub_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd EINA_UNUSED) { + obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_event_callback_array_add(obj, self_manager(), obj); - _flush_manager(obj, pd); - - return efl_constructor(efl_super(obj, MY_CLASS)); + return obj; } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index fd38f8dd5c..002a4ddbd8 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -1312,9 +1312,10 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo EOLIAN static Efl_Object * _efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { + obj = efl_constructor(efl_super(obj, MY_CLASS)); en->select_allow = EINA_TRUE; en->editable = EINA_TRUE; - return efl_constructor(efl_super(obj, MY_CLASS)); + return obj; } EOLIAN static Efl_Object * diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 505181a9ee..c1b9bd7287 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -5397,13 +5397,6 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #include "efl_ui_text.eo.c" -EOLIAN static Eo * -_efl_ui_text_async_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) -{ - obj = efl_constructor(efl_super(obj, EFL_UI_TEXT_ASYNC_CLASS)); - return obj; -} - EOLIAN static void _efl_ui_text_async_efl_canvas_group_group_add(Eo *obj, void *_pd EINA_UNUSED) { diff --git a/src/lib/elementary/efl_ui_text_async.eo b/src/lib/elementary/efl_ui_text_async.eo index 52061e5380..0f57a8729b 100644 --- a/src/lib/elementary/efl_ui_text_async.eo +++ b/src/lib/elementary/efl_ui_text_async.eo @@ -6,6 +6,6 @@ class Efl.Ui.Text_Async (Efl.Ui.Text) ]] data: null; implements { - Efl.Object.constructor; + //Efl.Object.constructor; } } --
[EGIT] [core/efl] master 03/04: elm: Create legacy widgets with elm_legacy_add
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d39bbc149113da5d842f30d046dc04302e54275b commit d39bbc149113da5d842f30d046dc04302e54275b Author: Jean-Philippe AndreDate: Tue Nov 7 14:00:43 2017 +0900 elm: Create legacy widgets with elm_legacy_add This will be used to solve issues around style_set: if the widget is legacy or pure eo we may need to select a different style. So in the constructor we need to know whether we are legacy or eo. Note that calling style_set in finalize only is too late as we would lose information such as efl_text_set() called inside efl_add(). --- src/lib/elementary/efl_ui_bg.c| 2 +- src/lib/elementary/efl_ui_button.c| 2 +- src/lib/elementary/efl_ui_check.c | 2 +- src/lib/elementary/efl_ui_flip.c | 2 +- src/lib/elementary/efl_ui_frame.c | 2 +- src/lib/elementary/efl_ui_image.c | 2 +- src/lib/elementary/efl_ui_image_zoomable.c| 2 +- src/lib/elementary/efl_ui_layout.c| 2 +- src/lib/elementary/efl_ui_multibuttonentry.c | 2 +- src/lib/elementary/efl_ui_panes.c | 2 +- src/lib/elementary/efl_ui_progressbar.c | 2 +- src/lib/elementary/efl_ui_radio.c | 2 +- src/lib/elementary/efl_ui_slider.c| 2 +- src/lib/elementary/efl_ui_video.c | 2 +- src/lib/elementary/efl_ui_win.c | 44 ++- src/lib/elementary/elc_combobox.c | 27 src/lib/elementary/elc_ctxpopup.c | 2 +- src/lib/elementary/elc_fileselector.c | 2 +- src/lib/elementary/elc_fileselector_button.c | 2 +- src/lib/elementary/elc_fileselector_entry.c | 2 +- src/lib/elementary/elc_hoversel.c | 2 +- src/lib/elementary/elc_naviframe.c| 2 +- src/lib/elementary/elc_player.c | 2 +- src/lib/elementary/elc_popup.c| 2 +- src/lib/elementary/elm_access.c | 2 +- src/lib/elementary/elm_actionslider.c | 2 +- src/lib/elementary/elm_box.c | 2 +- src/lib/elementary/elm_bubble.c | 2 +- src/lib/elementary/elm_calendar.c | 2 +- src/lib/elementary/elm_clock.c| 2 +- src/lib/elementary/elm_code_widget.c | 3 +- src/lib/elementary/elm_colorselector.c| 17 --- src/lib/elementary/elm_conform.c | 2 +- src/lib/elementary/elm_datetime.c | 2 +- src/lib/elementary/elm_dayselector.c | 2 +- src/lib/elementary/elm_diskselector.c | 2 +- src/lib/elementary/elm_entry.c| 2 +- src/lib/elementary/elm_flipselector.c | 2 +- src/lib/elementary/elm_gengrid.c | 2 +- src/lib/elementary/elm_genlist.c | 2 +- src/lib/elementary/elm_gesture_layer.c| 2 +- src/lib/elementary/elm_glview.c | 10 +++--- src/lib/elementary/elm_grid.c | 2 +- src/lib/elementary/elm_hover.c| 2 +- src/lib/elementary/elm_icon.c | 2 +- src/lib/elementary/elm_index.c| 2 +- src/lib/elementary/elm_interface_scrollable.c | 2 +- src/lib/elementary/elm_inwin.c| 2 +- src/lib/elementary/elm_label.c| 2 +- src/lib/elementary/elm_list.c | 2 +- src/lib/elementary/elm_map.c | 2 +- src/lib/elementary/elm_mapbuf.c | 2 +- src/lib/elementary/elm_menu.c | 2 +- src/lib/elementary/elm_notify.c | 2 +- src/lib/elementary/elm_panel.c| 2 +- src/lib/elementary/elm_photo.c| 2 +- src/lib/elementary/elm_plug.c | 2 +- src/lib/elementary/elm_prefs.c| 2 +- src/lib/elementary/elm_route.c| 2 +- src/lib/elementary/elm_scroller.c | 2 +- src/lib/elementary/elm_segment_control.c | 2 +- src/lib/elementary/elm_separator.c| 2 +- src/lib/elementary/elm_slideshow.c| 2 +- src/lib/elementary/elm_spinner.c | 2 +- src/lib/elementary/elm_table.c| 2 +- src/lib/elementary/elm_thumb.c| 2 +- src/lib/elementary/elm_toolbar.c | 2 +- src/lib/elementary/elm_web2.c | 2 +- src/lib/elementary/elm_widget.c | 7 - src/lib/elementary/elm_widget.h | 12 ++-- 70 files changed, 126 insertions(+), 120 deletions(-) diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c index 7bb9e8bd9b..73dcdaeae0 100644 --- a/src/lib/elementary/efl_ui_bg.c +++ b/src/lib/elementary/efl_ui_bg.c @@ -114,7 +114,7 @@ EAPI Evas_Object * elm_bg_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return efl_add(MY_CLASS, parent,
[EGIT] [apps/ecrire] master 02/03: update po's
raster pushed a commit to branch master. http://git.enlightenment.org/apps/ecrire.git/commit/?id=cf06796639f0006c0813410a2a2331a120fd2825 commit cf06796639f0006c0813410a2a2331a120fd2825 Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 13:56:30 2017 +0900 update po's --- po/ca.po | 70 +--- po/da.po | 164 ++- po/ecrire.pot | 132 po/eo.po | 71 +--- po/es.po | 164 ++- po/fr.po | 71 +--- po/gl.po | 67 --- po/he.po | 164 ++- po/hu.po | 67 +-- po/it.po | 67 +-- po/ko_KR.po | 164 ++- po/lt.po | 64 -- po/pl.po | 171 +++-- po/pt.po | 173 +++--- po/sl.po | 46 po/sr.po | 71 +--- po/tr.po | 74 ++--- po/zh_CN.po | 160 + 18 files changed, 1071 insertions(+), 889 deletions(-) diff --git a/po/ca.po b/po/ca.po index 80870a8..02bc0a9 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,81 +6,83 @@ msgid "" msgstr "" "Project-Id-Version: enlightenment\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-12-30 11:50+0100\n" +"Report-Msgid-Bugs-To: enlightenment-de...@lists.sourceforge.net\n" +"POT-Creation-Date: 2017-11-06 16:42+0900\n" "PO-Revision-Date: 2014-05-26 22:31+\n" "Last-Translator: joancoll \n" "Language-Team: Catalan \n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2014-05-27 05:40+\n" "X-Generator: Launchpad (build 17017)\n" -#: src/bin/main.c:96 +#: src/bin/main.c:101 #, c-format msgid "%s%s - %s" msgstr "%s%s - %s" -#: src/bin/main.c:99 +#: src/bin/main.c:104 #, c-format msgid "%sUntitled %d - %s" msgstr "%sSense títol %d - %s" -#: src/bin/main.c:123 +#: src/bin/main.c:128 #, c-format msgid "Ln %d, Col %d" msgstr "Ln %d, Col %d" -#: src/bin/main.c:691 +#: src/bin/main.c:737 msgid "New" msgstr "Nou" -#: src/bin/main.c:692 +#: src/bin/main.c:738 msgid "Open" msgstr "Obre" -#: src/bin/main.c:694 src/bin/ui/alerts.c:71 +#: src/bin/main.c:740 src/bin/ui/alerts.c:64 msgid "Save" msgstr "Desa" -#: src/bin/main.c:695 +#: src/bin/main.c:741 msgid "Save As" msgstr "Anomena i desa" -#: src/bin/main.c:700 +#: src/bin/main.c:746 msgid "Undo" msgstr "Desfés" -#: src/bin/main.c:702 +#: src/bin/main.c:748 msgid "Redo" msgstr "Refés" -#: src/bin/main.c:705 +#: src/bin/main.c:751 msgid "Cut" msgstr "Retalla" -#: src/bin/main.c:707 +#: src/bin/main.c:753 msgid "Copy" msgstr "Copia" -#: src/bin/main.c:709 +#: src/bin/main.c:755 msgid "Paste" msgstr "Enganxa" -#: src/bin/main.c:712 src/bin/ui/search_dialog.c:148 -msgid "Find & Replace" -msgstr "Cerca i substitueix" +#: src/bin/main.c:758 src/bin/ui/search_dialog.c:148 +#, fuzzy +msgid "Search" +msgstr "Cerca per:" -#: src/bin/main.c:714 -msgid "Goto Line" -msgstr "Vés a la línia" +#: src/bin/main.c:760 src/bin/ui/goto_dialog.c:60 +msgid "Jump to" +msgstr "" -#: src/bin/main.c:717 +#: src/bin/main.c:763 msgid "Settings" msgstr "Paràmetres" -#: src/bin/ui/alerts.c:56 +#: src/bin/ui/alerts.c:60 msgid ""
[EGIT] [apps/ecrire] master 03/03: update ignore file
raster pushed a commit to branch master. http://git.enlightenment.org/apps/ecrire.git/commit/?id=a2980856b7d1bb960bb7612e4042e034f530da9c commit a2980856b7d1bb960bb7612e4042e034f530da9c Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 13:57:35 2017 +0900 update ignore file --- .gitignore | 5 + 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index a6f6983..4ea0ffe 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,8 @@ src/bin/Makefile src/bin/Makefile.in src/bin/ecrire stamp-h1 +*.gmo +*.cmake +CMakeCache.txt +CMakeFiles +install_manifest.txt --
[EGIT] [apps/ecrire] master 01/03: elm list needs a go once filled... so add it to the font list
raster pushed a commit to branch master. http://git.enlightenment.org/apps/ecrire.git/commit/?id=df360f74858a56d2cebd56e9294609cb59c4d697 commit df360f74858a56d2cebd56e9294609cb59c4d697 Author: Carsten Haitzler (Rasterman)Date: Mon Nov 6 16:45:57 2017 +0900 elm list needs a go once filled... so add it to the font list --- src/bin/ui/font_dialog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/ui/font_dialog.c b/src/bin/ui/font_dialog.c index c368fcf..4924bd8 100644 --- a/src/bin/ui/font_dialog.c +++ b/src/bin/ui/font_dialog.c @@ -142,6 +142,7 @@ ui_font_dialog_open(Evas_Object *parent, Ecrire_Entry *ent, const char *pfont, cur_font = tmp; } } +elm_list_go(list); EINA_LIST_FREE(flist, font) eina_stringshare_del(font); --
[EGIT] [core/efl] efl-1.20 01/01: efl ui win - make win centering work with multiple screens
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=4de4c6921422ea55caf2cc9c6227345e2607573b commit 4de4c6921422ea55caf2cc9c6227345e2607573b Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 13:52:31 2017 +0900 efl ui win - make win centering work with multiple screens this should fix T6323 @fix --- src/lib/elementary/efl_ui_win.c | 46 src/modules/ecore_evas/engines/x/ecore_evas_x.c | 96 +++-- 2 files changed, 121 insertions(+), 21 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index e608e4ee6c..824a7fdfc5 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -5585,6 +5585,52 @@ _efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v) if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v))) return; + if (!efl_gfx_visible_get(obj)) + { +// Chose to use env var so this will also translate more easily +// to wayland. yes - we can get x atoms to figure out if wm is +// enlightenment, but this works just as well. for wl we'd need +// an alternate wl specific way... this below works better IMHO +const char *s = getenv("DESKTOP"); + +if ((s) && (!strcasecmp(s, "Enlightenment"))) + { +#ifdef HAVE_ELEMENTARY_X + if (sd->x.xwin) + { + static Ecore_X_Atom state = 0; + static Ecore_X_Atom centered = 0; + + if (!centered) centered = ecore_x_atom_get +("__E_ATOM_WINDOW_STATE_CENTERED"); + if (!state) state = ecore_x_atom_get +("__E_ATOM_WINDOW_STATE"); + ecore_x_window_prop_card32_set(sd->x.xwin, state, , 1); + } +#endif +// XXX: what to do with wayland? + return; + } +// not e - fall back to manually placing on what we think the screen +// is/will be... to do this move window to where pointer is first +#ifdef HAVE_ELEMENTARY_X +if (sd->x.xwin) + { + int x = 0, y = 0; + + if (sd->req_wh) + { + win_w = sd->req_w; + win_h = sd->req_h; + } + else evas_object_geometry_get(obj, NULL, NULL, _w, _h); + ecore_x_pointer_root_xy_get(, ); + ecore_evas_move(sd->ee, x - (win_w / 2), y - (win_h / 2)); + } +#endif +// XXX: what to do with wayland? + } + ecore_evas_screen_geometry_get(sd->ee, _x, _y, _w, _h); diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c index 542b3f82e9..88779a2a7c 100644 --- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c +++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c @@ -3478,15 +3478,16 @@ _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on) } static void -_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h) +_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h) { - int outnum = 0; + int outnum = 0, i; int px = 0, py = 0, pw = 0, ph = 0; Ecore_X_Window root; Ecore_X_Randr_Output *out = NULL; Ecore_X_Randr_Crtc crtc; unsigned int val[4] = { 0 }; - + Eina_Bool found = EINA_FALSE; + if (ecore_x_window_prop_card32_get (ee->prop.window, ecore_x_atom_get("E_ZONE_GEOMETRY"), val, 4) == 4) { @@ -3496,7 +3497,7 @@ _ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int if (h) *h = (int)val[3]; return; } - + root = ecore_x_window_root_get(ee->prop.window); out = ecore_x_randr_window_outputs_get(ee->prop.window, ); if (!out) @@ -3508,25 +3509,53 @@ norandr: ecore_x_window_size_get(root, w, h); return; } - crtc = ecore_x_randr_output_crtc_get(root, out[0]); - if (!crtc) goto norandr; - ecore_x_randr_crtc_geometry_get(root, crtc, , , , ); - if ((pw == 0) || (ph == 0)) goto norandr; - if (x) *x = px; - if (y) *y = py; - if (w) *w = pw; - if (h) *h = ph; + for (i = 0; i < outnum; i++) + { +Eina_Rectangle winrect, outrect; + +crtc = ecore_x_randr_output_crtc_get(root, out[i]); +if (!crtc) continue; +ecore_x_randr_crtc_geometry_get(root, crtc, , , , ); +if ((pw == 0) || (ph == 0)) continue; +if ((i == 0) || (ecore_x_randr_primary_output_get(root) == out[i])) + { + found = EINA_TRUE; + if (x) *x = px; + if (y) *y = py; + if (w) *w = pw; + if (h) *h = ph; + } +winrect.x = ee->x + (ee->w / 2); +winrect.y = ee->y + (ee->h / 2); +
[EGIT] [core/efl] master 01/01: efl ui win - make win centering work with multiple screens
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6a47c2243e604e44461ae915476f50d00eeafdf6 commit 6a47c2243e604e44461ae915476f50d00eeafdf6 Author: Carsten Haitzler (Rasterman)Date: Tue Nov 7 13:52:31 2017 +0900 efl ui win - make win centering work with multiple screens this should fix T6323 @fix --- src/lib/elementary/efl_ui_win.c | 46 src/modules/ecore_evas/engines/x/ecore_evas_x.c | 96 +++-- 2 files changed, 121 insertions(+), 21 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 4904a13e10..87e7e9624d 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -5595,6 +5595,52 @@ _efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v) if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v))) return; + if (!efl_gfx_visible_get(obj)) + { +// Chose to use env var so this will also translate more easily +// to wayland. yes - we can get x atoms to figure out if wm is +// enlightenment, but this works just as well. for wl we'd need +// an alternate wl specific way... this below works better IMHO +const char *s = getenv("DESKTOP"); + +if ((s) && (!strcasecmp(s, "Enlightenment"))) + { +#ifdef HAVE_ELEMENTARY_X + if (sd->x.xwin) + { + static Ecore_X_Atom state = 0; + static Ecore_X_Atom centered = 0; + + if (!centered) centered = ecore_x_atom_get +("__E_ATOM_WINDOW_STATE_CENTERED"); + if (!state) state = ecore_x_atom_get +("__E_ATOM_WINDOW_STATE"); + ecore_x_window_prop_card32_set(sd->x.xwin, state, , 1); + } +#endif +// XXX: what to do with wayland? + return; + } +// not e - fall back to manually placing on what we think the screen +// is/will be... to do this move window to where pointer is first +#ifdef HAVE_ELEMENTARY_X +if (sd->x.xwin) + { + int x = 0, y = 0; + + if (sd->req_wh) + { + win_w = sd->req_w; + win_h = sd->req_h; + } + else evas_object_geometry_get(obj, NULL, NULL, _w, _h); + ecore_x_pointer_root_xy_get(, ); + ecore_evas_move(sd->ee, x - (win_w / 2), y - (win_h / 2)); + } +#endif +// XXX: what to do with wayland? + } + ecore_evas_screen_geometry_get(sd->ee, _x, _y, _w, _h); diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c index 542b3f82e9..88779a2a7c 100644 --- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c +++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c @@ -3478,15 +3478,16 @@ _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on) } static void -_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h) +_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h) { - int outnum = 0; + int outnum = 0, i; int px = 0, py = 0, pw = 0, ph = 0; Ecore_X_Window root; Ecore_X_Randr_Output *out = NULL; Ecore_X_Randr_Crtc crtc; unsigned int val[4] = { 0 }; - + Eina_Bool found = EINA_FALSE; + if (ecore_x_window_prop_card32_get (ee->prop.window, ecore_x_atom_get("E_ZONE_GEOMETRY"), val, 4) == 4) { @@ -3496,7 +3497,7 @@ _ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int if (h) *h = (int)val[3]; return; } - + root = ecore_x_window_root_get(ee->prop.window); out = ecore_x_randr_window_outputs_get(ee->prop.window, ); if (!out) @@ -3508,25 +3509,53 @@ norandr: ecore_x_window_size_get(root, w, h); return; } - crtc = ecore_x_randr_output_crtc_get(root, out[0]); - if (!crtc) goto norandr; - ecore_x_randr_crtc_geometry_get(root, crtc, , , , ); - if ((pw == 0) || (ph == 0)) goto norandr; - if (x) *x = px; - if (y) *y = py; - if (w) *w = pw; - if (h) *h = ph; + for (i = 0; i < outnum; i++) + { +Eina_Rectangle winrect, outrect; + +crtc = ecore_x_randr_output_crtc_get(root, out[i]); +if (!crtc) continue; +ecore_x_randr_crtc_geometry_get(root, crtc, , , , ); +if ((pw == 0) || (ph == 0)) continue; +if ((i == 0) || (ecore_x_randr_primary_output_get(root) == out[i])) + { + found = EINA_TRUE; + if (x) *x = px; + if (y) *y = py; + if (w) *w = pw; + if (h) *h = ph; + } +winrect.x = ee->x + (ee->w / 2); +winrect.y = ee->y + (ee->h / 2); +
[EGIT] [core/efl] master 02/16: evas_vg_cache: load svg from any file, not from defined only
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f75c92ca9e559204c20228444810e8d482986d0 commit 3f75c92ca9e559204c20228444810e8d482986d0 Author: Vitalii VorobiovDate: Tue Jan 24 14:12:29 2017 +0200 evas_vg_cache: load svg from any file, not from defined only so it doesn't only load from eet or edj only but also from those any extensions who is ACTUALLY eet, but named as, for example, like, "file_with_svg.dev" @fix --- src/lib/evas/vg/evas_vg_cache.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index aa32a6f826..57f3cefc56 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -26,6 +26,11 @@ static const struct ext_loader_s loaders[] = MATCHING(".svg.gz", "svg") }; +static const char *loaders_name[] = +{ /* in order of most likely needed */ + "eet", "svg" +}; + static Evas_Module * _find_loader_module(const char *file) { @@ -57,6 +62,7 @@ _vg_load_from_file(const char *file, const char *key) Evas_Vg_Load_Func *loader; interror = EVAS_LOAD_ERROR_GENERIC; Vg_File_Data *evg_data = NULL; + unsigned int i; em = _find_loader_module(file); if (em) @@ -64,6 +70,23 @@ _vg_load_from_file(const char *file, const char *key) loader = em->functions; evg_data = loader->file_data(file, key, ); } + else + { +for (i = 0; i < sizeof (loaders_name) / sizeof (char *); i++) + { + em = evas_module_find_type(EVAS_MODULE_TYPE_VG_LOADER, loaders_name[i]); + if (em) + { + loader = em->functions; + evg_data = loader->file_data(file, key, ); + if (evg_data) +return evg_data; + } + else + DBG("could not find module '%s'", loaders_name[i]); + } +INF("exhausted all means to load image '%s'", file); + } return evg_data; } --
[EGIT] [core/efl] master 16/16: evas_vg_load_svg: get rid of static Evas_SVG_Parsing
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ee93543799fc4ccf72a0cbf43a2c3efe5c61d6d3 commit ee93543799fc4ccf72a0cbf43a2c3efe5c61d6d3 Author: Vitalii VorobiovDate: Tue Nov 7 11:41:36 2017 +0900 evas_vg_load_svg: get rid of static Evas_SVG_Parsing Summary: Refactoring. It is good to store values from that struct in a parsing/loading context static variable is a big NO NO: 1. Ugly code design, 2. Might not work when trying to load more than one SVG file. @fix Reviewers: jpeg, smohanty Subscribers: jenkins, cedric Differential Revision: https://phab.enlightenment.org/D5399 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 400 +++-- 1 file changed, 214 insertions(+), 186 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index cec86e6eae..867d95c9df 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -13,9 +13,22 @@ static int _evas_vg_loader_svg_log_dom = -1; #endif #define INF(...) EINA_LOG_DOM_INFO(_evas_vg_loader_svg_log_dom, __VA_ARGS__) -typedef Svg_Node *(*Factory_Method)(Svg_Node *parent, const char *buf, unsigned buflen); +/* Global struct for working global cases during the parse */ +typedef struct _Evas_SVG_Parser Evas_SVG_Parser; +struct _Evas_SVG_Parser { + struct { + int x, y, width, height; + } global; + struct { + Eina_Bool x1_percent, x2_percent, y1_percent, y2_percent; + Eina_Bool fx_parsed; + Eina_Bool fy_parsed; + } gradient; -typedef Svg_Style_Gradient *(*Gradient_Factory_Method)(const char *buf, unsigned buflen); + Svg_Node *node; + Svg_Style_Gradient *style_grad; + Efl_Gfx_Gradient_Stop *grad_stop; +}; typedef struct _Evas_SVG_Loader Evas_SVG_Loader; struct _Evas_SVG_Loader @@ -24,10 +37,16 @@ struct _Evas_SVG_Loader Svg_Node *doc; Svg_Node *def; Svg_Style_Gradient *gradient; + Evas_SVG_Parser *svg_parse; int level; Eina_Bool result:1; }; + +typedef Svg_Node *(*Factory_Method)(Evas_SVG_Loader *loader, Svg_Node *parent, const char *buf, unsigned buflen); + +typedef Svg_Style_Gradient *(*Gradient_Factory_Method)(Evas_SVG_Loader *loader, const char *buf, unsigned buflen); + /* length type to recalculate %, pt, pc, mm, cm etc*/ typedef enum { SVG_PARSER_LENGTH_VERTICAL, @@ -36,19 +55,6 @@ typedef enum { SVG_PARSER_LENGTH_OTHER } SVG_Parser_Length_Type; -/* Global struct for working global cases during the parse */ -typedef struct { - struct { - int x, y, width, height; - } global; - struct { - Eina_Bool x1_percent, x2_percent, y1_percent, y2_percent; - Eina_Bool fx_parsed; - Eina_Bool fy_parsed; - } gradient; -} Evas_SVG_Parsing; -static Evas_SVG_Parsing svg_parse; - char * _skip_space(const char *str, const char *end) { @@ -94,7 +100,7 @@ _parse_number(const char **content, double *number) * is required, but for now default w3 constants would be used */ static inline double -_to_double(const char *str, SVG_Parser_Length_Type type) +_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Length_Type type) { double parsed_value = strtod(str, NULL); @@ -111,13 +117,13 @@ _to_double(const char *str, SVG_Parser_Length_Type type) else if (strstr(str, "%")) { if (type == SVG_PARSER_LENGTH_VERTICAL) - parsed_value = (parsed_value / 100.0) * svg_parse.global.height; + parsed_value = (parsed_value / 100.0) * svg_parse->global.height; else if (type == SVG_PARSER_LENGTH_HORIZONTAL) - parsed_value = (parsed_value / 100.0) * svg_parse.global.width; + parsed_value = (parsed_value / 100.0) * svg_parse->global.width; else // if other then it's radius { - double max = svg_parse.global.width; - if (max < svg_parse.global.height) max = svg_parse.global.height; + double max = svg_parse->global.width; + if (max < svg_parse->global.height) max = svg_parse->global.height; parsed_value = (parsed_value / 100.0) * max; } } @@ -131,7 +137,7 @@ _to_double(const char *str, SVG_Parser_Length_Type type) * Turn gradient variables into percentages */ static inline double -_gradient_to_double(const char *str, SVG_Parser_Length_Type type) +_gradient_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Length_Type type) { char *end = NULL; @@ -151,12 +157,12 @@ _gradient_to_double(const char *str, SVG_Parser_Length_Type type) * https://www.w3.org/TR/2015/WD-SVG2-20150915/coords.html */ if (type == SVG_PARSER_LENGTH_VERTICAL) - max = svg_parse.global.height; + max = svg_parse->global.height; else if (type == SVG_PARSER_LENGTH_HORIZONTAL) - max =
[EGIT] [core/efl] master 14/16: vg_common: property apply "objectBoundingBox" morphings to radial gradient
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d98e2323ad93e66b13841d60cbfdd17cdf8fdff2 commit d98e2323ad93e66b13841d60cbfdd17cdf8fdff2 Author: Vitalii VorobiovDate: Thu Mar 16 14:53:49 2017 +0200 vg_common: property apply "objectBoundingBox" morphings to radial gradient When objectBoundingBox flag is set up, all gradients should morphed into multiple gradients for every entity that has gradient to be applied on --- .../cairo/ector_renderer_cairo_gradient_radial.c | 21 +++- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 8 +++ src/static_libs/vg_common/vg_common.c | 63 +++--- 3 files changed, 84 insertions(+), 8 deletions(-) diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c index e970d23a15..30149e78a8 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c +++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c @@ -22,6 +22,11 @@ static void (*cairo_arc)(cairo_t *cr, static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL; static void (*cairo_pattern_set_extend)(cairo_pattern_t *pattern, cairo_extend_t extend) = NULL; +static void (*cairo_pattern_set_matrix)(cairo_t *cr, cairo_matrix_t *matrix) = NULL; +static void (*cairo_matrix_init)(cairo_matrix_t *matrix, + double xx, double yx, + double xy, double yy, + double x0, double y0) = NULL; // FIXME: as long as it is not possible to directly access the parent structure // this will be duplicated from the linear gradient renderer @@ -48,12 +53,14 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_prepare(Eo *obj, Ector_Rend } static cairo_pattern_t * -_ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED, +_ector_renderer_cairo_gradient_radial_prepare(Eo *obj, Ector_Renderer_Gradient_Radial_Data *grd, Ector_Renderer_Gradient_Data *gd, unsigned int mul_col) { + Ector_Renderer_Data *pd = efl_data_scope_get(obj, ECTOR_RENDERER_CLASS); cairo_pattern_t *pat; + cairo_matrix_t *pd_m; pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0, grd->radial.x, grd->radial.y, grd->radius); @@ -63,6 +70,16 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED, cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s)); + pd_m = malloc(sizeof (cairo_matrix_t)); + if (pd->m) + { +cairo_matrix_init(pd_m, + pd->m->xx, pd->m->yx, + pd->m->xy, pd->m->yy, + pd->m->xz, pd->m->yz); +cairo_pattern_set_matrix(pat, pd_m); + } + return pat; } @@ -148,9 +165,11 @@ _ector_renderer_cairo_gradient_radial_efl_object_finalize(Eo *obj, Ector_Rendere USE(base, cairo_pattern_destroy, NULL); USE(base, cairo_arc, NULL); USE(base, cairo_fill, NULL); + USE(base, cairo_matrix_init, NULL); USE(base, cairo_set_source, NULL); USE(base, cairo_pattern_destroy, NULL); USE(base, cairo_pattern_set_extend, NULL); + USE(base, cairo_pattern_set_matrix, NULL); USE(base, cairo_pattern_create_radial, NULL); USE(base, cairo_pattern_add_color_stop_rgba, NULL); diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 36e5d14409..1734472a3a 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -1790,6 +1790,14 @@ _create_radialGradient(const char *buf, unsigned buflen) grad->type = SVG_RADIAL_GRADIENT; grad->user_space = EINA_TRUE; grad->radial = calloc(1, sizeof(Svg_Radial_Gradient)); + /** +* Default values of gradient +*/ + grad->radial->cx = 0.5; + grad->radial->cy = 0.5; + grad->radial->fx = 0.5; + grad->radial->fy = 0.5; + grad->radial->r = 0.5; svg_parse.gradient.fx_parsed = EINA_FALSE; svg_parse.gradient.fy_parsed = EINA_FALSE; diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c index 7b33053ed0..21b9201b70 100644 --- a/src/static_libs/vg_common/vg_common.c +++ b/src/static_libs/vg_common/vg_common.c @@ -553,7 +553,10 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat Efl_Gfx_Gradient_Stop *stops, *stop; int stop_count = 0, i = 0; Eina_List *l; - Eina_Rect r = { 0, 0, 1, 1 }; + Eina_Matrix3 m; //for bbox translation + Eina_Rect r = EINA_RECT( 0, 0, 1, 1 ); + Eina_Rect grad_geom = EINA_RECT(0, 0, 0, 0); + int radius; //TODO: apply actual sizes (imporve bounds_get function?)...
[EGIT] [core/efl] master 05/16: ector: use cairo_pattern_add_color_stop_rgba in gradient_radial
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a44daaa3946d1e55435b111065e0b121848a71ce commit a44daaa3946d1e55435b111065e0b121848a71ce Author: Vitalii VorobiovDate: Tue Feb 7 17:05:02 2017 +0200 ector: use cairo_pattern_add_color_stop_rgba in gradient_radial It actually invoked SIGSEGV when trying to load SVG file with Radial Gradient @fix --- src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c index 0011968ce2..e970d23a15 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c +++ b/src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c @@ -152,6 +152,7 @@ _ector_renderer_cairo_gradient_radial_efl_object_finalize(Eo *obj, Ector_Rendere USE(base, cairo_pattern_destroy, NULL); USE(base, cairo_pattern_set_extend, NULL); USE(base, cairo_pattern_create_radial, NULL); + USE(base, cairo_pattern_add_color_stop_rgba, NULL); return obj; } --
[EGIT] [core/efl] master 11/16: svg_parse: parse linear gradient variables accroding to gradientUnits
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=405e56ac553db21f3e53d1702cc3db3863142811 commit 405e56ac553db21f3e53d1702cc3db3863142811 Author: Vitalii VorobiovDate: Fri Feb 17 17:00:01 2017 +0200 svg_parse: parse linear gradient variables accroding to gradientUnits There are difficult cases according to https://www.w3.org/TR/2000/CR-SVG-2802/pservers.html --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 137 +++-- src/static_libs/vg_common/vg_common.h | 19 +++ 2 files changed, 146 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 636b27fcb9..ff1b2d8e2d 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -42,6 +42,7 @@ typedef struct { int x, y, width, height; } global; struct { + Eina_Bool x1_percent, x2_percent, y1_percent, y2_percent; Eina_Bool fx_parsed; Eina_Bool fy_parsed; } gradient; @@ -126,6 +127,48 @@ _to_double(const char *str, SVG_Parser_Length_Type type) return parsed_value; } +/** + * Turn gradient variables into percentages + */ +static inline double +_gradient_to_double(const char *str, SVG_Parser_Length_Type type) +{ + char *end = NULL; + + double parsed_value = strtod(str, ); + double max = 1; + + /* unique case, if that is percentage, just return it */ + if (strstr(str, "%")) + { +parsed_value = parsed_value / 100.0; +return parsed_value; + } + + if (type == SVG_PARSER_LENGTH_VERTICAL) + max = svg_parse.global.height; + else if (type == SVG_PARSER_LENGTH_HORIZONTAL) + max = svg_parse.global.width; + //TODO: what about radial? + + if (strstr(str, "cm")) + parsed_value = parsed_value * 35.43307; + else if (strstr(str, "mm")) + parsed_value = parsed_value * 3.543307; + else if (strstr(str, "pt")) + parsed_value = parsed_value * 1.25; + else if (strstr(str, "pc")) + parsed_value = parsed_value * 15; + else if (strstr(str, "in")) + parsed_value = parsed_value * 90; + //TODO: implement 'em', 'ex' attributes + + /* Transform into global percentage */ + parsed_value = parsed_value / max; + + return parsed_value; +} + static inline int _to_offset(const char *str) { @@ -1046,7 +1089,7 @@ _create_path_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define CIRCLE_DEF(Name, Field, Type) \ - { #Name, sizeof (#Name), offsetof(Svg_Circle_Node, Field)} + { #Name, Type, sizeof (#Name), offsetof(Svg_Circle_Node, Field)} static const struct { const char *tag; @@ -1105,7 +1148,7 @@ _create_circle_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define ELLIPSE_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name), offsetof(Svg_Ellipse_Node, Field)} + { #Name, Type, sizeof (#Name) + sizeof (Type), offsetof(Svg_Ellipse_Node, Field)} static const struct { const char *tag; @@ -1259,7 +1302,7 @@ _create_polyline_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define RECT_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name), offsetof(Svg_Rect_Node, Field)} + { #Name, Type, sizeof (#Name) + sizeof(Type), offsetof(Svg_Rect_Node, Field)} static const struct { const char *tag; @@ -1325,7 +1368,7 @@ _create_rect_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define LINE_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name), offsetof(Svg_Line_Node, Field)} + { #Name, Type, sizeof (#Name) + sizeof (Type), offsetof(Svg_Line_Node, Field)} static const struct { const char *tag; @@ -1779,37 +1822,96 @@ _attr_parse_stops(void *data, const char *key, const char *value) static void _handle_linear_x1_attr(Svg_Linear_Gradient* linear, const char *value) { - linear->x1 = _to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + linear->x1 = _gradient_to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + if (strstr(value, "%")) + svg_parse.gradient.x1_percent = EINA_TRUE; } static void _handle_linear_y1_attr(Svg_Linear_Gradient* linear, const char *value) { - linear->y1 = _to_double(value, SVG_PARSER_LENGTH_VERTICAL); + linear->y1 = _gradient_to_double(value, SVG_PARSER_LENGTH_VERTICAL); + if (strstr(value, "%")) + svg_parse.gradient.y1_percent = EINA_TRUE; } static void _handle_linear_x2_attr(Svg_Linear_Gradient* linear, const char *value) { - linear->x2 = _to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + linear->x2 = _gradient_to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + /* checking if there are no percentage because x2 have default value +* already set in percentages (100%) */ + if (!strstr(value, "%")) + svg_parse.gradient.x2_percent = EINA_FALSE; } static void
[EGIT] [core/efl] master 06/16: vg_loaders/svg: set up default focal values for radialGradient
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=532557cabdd6fd24e62c7756c927230f24ab6b89 commit 532557cabdd6fd24e62c7756c927230f24ab6b89 Author: Vitalii VorobiovDate: Tue Feb 7 18:59:03 2017 +0200 vg_loaders/svg: set up default focal values for radialGradient Since when not specified, focal values same as center points fx = cx, fy = cy by default @fix --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 31 ++ 1 file changed, 31 insertions(+) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 7c19d75a47..4b4913b695 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -1560,28 +1560,52 @@ _parse_spread_value(const char *value) return spread; } + +/** + * Comment SVG_GRADIENT_FX_FY_PARSED + * + * if "fx" and "fy" is not specified then they are fx==cx and fy==cx + * but we should also be careful when during the parsing it would be + * something like + * so then fx is 0, but fy is 100 + * + * So we need to check if focal was parsed, if not then set up same as center + * point. + * + * It is required to set those public variables back to zero when parsing new + * gradient. + */ +static Eina_Bool fx_parsed; +static Eina_Bool fy_parsed; + static void _handle_radial_cx_attr(Svg_Radial_Gradient* radial, const char *value) { radial->cx = _to_double(value); + if (!fx_parsed) + radial->fx = radial->cx; } static void _handle_radial_cy_attr(Svg_Radial_Gradient* radial, const char *value) { radial->cy = _to_double(value); + if (!fy_parsed) + radial->fy = radial->cy; } static void _handle_radial_fx_attr(Svg_Radial_Gradient* radial, const char *value) { radial->fx = _to_double(value); + fx_parsed = EINA_TRUE; } static void _handle_radial_fy_attr(Svg_Radial_Gradient* radial, const char *value) { radial->fy = _to_double(value); + fy_parsed = EINA_TRUE; } static void @@ -1646,8 +1670,15 @@ _create_radialGradient(const char *buf, unsigned buflen) grad->type = SVG_RADIAL_GRADIENT; grad->radial = calloc(1, sizeof(Svg_Radial_Gradient)); + + /** +* Please see SVG_GRADIENT_FX_FY_PARSED comment for more info +*/ + fx_parsed = EINA_FALSE; + fy_parsed = EINA_FALSE; eina_simple_xml_attributes_parse(buf, buflen, _attr_parse_radial_gradient_node, grad); + return grad; } --
[EGIT] [core/efl] master 15/16: evas_vg_load_svg: default stop opacity color should be 255, not 0
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=66e0caccb7cfc15daf362c75f1b28689d2d2ab02 commit 66e0caccb7cfc15daf362c75f1b28689d2d2ab02 Author: Vitalii VorobiovDate: Thu Mar 16 17:55:26 2017 +0200 evas_vg_load_svg: default stop opacity color should be 255, not 0 @fix --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 ++ src/static_libs/vg_common/vg_common.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 1734472a3a..cec86e6eae 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2098,6 +2098,8 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, else if (!strcmp(tag_name, "stop")) { Efl_Gfx_Gradient_Stop *stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop)); +/* default value for opacity */ +stop->a = 255; eina_simple_xml_attributes_parse(attrs, attrs_length, _attr_parse_stops, stop); if (loader->gradient) diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c index 21b9201b70..7f54e355e9 100644 --- a/src/static_libs/vg_common/vg_common.c +++ b/src/static_libs/vg_common/vg_common.c @@ -651,7 +651,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_dat stops[i].r = stop->r; stops[i].g = stop->g; stops[i].b = stop->b; - stops[i].a = 255; + stops[i].a = stop->a; stops[i].offset = stop->offset; i++; } --
[EGIT] [core/efl] master 04/16: saver/svg: parse loaded tree data into svg XML file and save it
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=78bc406640bead45f70978a7f2d1eecfc9122909 commit 78bc406640bead45f70978a7f2d1eecfc9122909 Author: Vitalii VorobiovDate: Tue Jan 31 18:06:36 2017 +0200 saver/svg: parse loaded tree data into svg XML file and save it Just base source code which will parse all structures of svg tree into xml text to save current vector image into file @feature --- src/modules/evas/vg_savers/svg/evas_vg_save_svg.c | 142 -- 1 file changed, 132 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c index 8c11fb3d69..c44b0d536f 100644 --- a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c +++ b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c @@ -5,26 +5,148 @@ static int _evas_vg_saver_svg_log_dom = -1; #ifdef ERR # undef ERR #endif -#define ERR(...) EINA_LOG_DOM_ERR(_evas_vg_saver_eet_log_dom, __VA_ARGS__) +#define ERR(...) EINA_LOG_DOM_ERR(_evas_vg_saver_svg_log_dom, __VA_ARGS__) #ifdef INF # undef INF #endif -#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__) +#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_svg_log_dom, __VA_ARGS__) + +static void +printf_style(Svg_Style_Property *style, Eina_Strbuf *buf) +{ + if ((style->fill.paint.r) || (style->fill.paint.g) || (style->fill.paint.b)) + eina_strbuf_append_printf(buf, " fill=\"#%02X%02X%02X\" ", style->fill.paint.r, style->fill.paint.g, style->fill.paint.b); + if (style->fill.fill_rule == EFL_GFX_FILL_RULE_ODD_EVEN) + eina_strbuf_append_printf(buf, " fill-rule=\"evenodd\" "); + if (style->fill.opacity != 255) + eina_strbuf_append_printf(buf, " fill-opacity=\"%f\"", style->fill.opacity / 255.0); + if ((style->stroke.paint.r) || (style->stroke.paint.g) || (style->stroke.paint.b)) + eina_strbuf_append_printf(buf, " stroke=\"#%02X%02X%02X\" ", style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b); + if (style->stroke.width) + eina_strbuf_append_printf(buf, " stroke-width=\"%f\" ", style->stroke.width); + if (style->stroke.cap == EFL_GFX_CAP_ROUND) + eina_strbuf_append_printf(buf, " stroke-linecap=\"round\" "); + else if (style->stroke.cap == EFL_GFX_CAP_SQUARE) + eina_strbuf_append_printf(buf, " stroke-linecap=\"square\" "); +} + +static void +_svg_node_printf(Svg_Node *parent, Eina_Strbuf *buf) +{ + int i = 0; + double *points; + double last_x = 0, last_y = 0; + Efl_Gfx_Path_Command *commands; + Eina_List *l; + Svg_Node *data; + + switch (parent->type) + { + case SVG_NODE_DOC: + eina_strbuf_append_printf(buf, "\n"); + eina_strbuf_append_printf(buf, "http://www.w3.org/2000/svg\"; +" xmlns:xlink=\"http://www.w3.org/1999/xlink\;>\n", +parent->node.doc.vx, parent->node.doc.vy, +parent->node.doc.vw, parent->node.doc.vh); + EINA_LIST_FOREACH(parent->child, l, data) + { + _svg_node_printf(data, buf); + } + eina_strbuf_append_printf(buf, "\n"); + break; + case SVG_NODE_G: + eina_strbuf_append_printf(buf, " transform) + eina_strbuf_append_printf(buf, + " transform=\"matrix(%f %f %f %f %f %f)\"", + parent->transform->xx, + parent->transform->yx, + parent->transform->xy, + parent->transform->yy, + parent->transform->xz, + parent->transform->yz); + eina_strbuf_append_printf(buf, ">\n"); + EINA_LIST_FOREACH(parent->child, l, data) + { + _svg_node_printf(data, buf); + } + eina_strbuf_append_printf(buf, "\n"); + break; + case SVG_NODE_CUSTOME_COMMAND: + points = parent->node.command.points; + commands = parent->node.command.commands; + eina_strbuf_append_printf(buf, "node.command.commands_count; i++) + { + switch (commands[i]) +{ + case EFL_GFX_PATH_COMMAND_TYPE_END: +eina_strbuf_append_printf(buf, "\""); +if (parent->transform) + eina_strbuf_append_printf(buf, " transform=\"matrix(%f %f %f %f %f %f)\"", + parent->transform->xx, + parent->transform->yx, + parent->transform->xy, + parent->transform->yy, + parent->transform->xz, + parent->transform->yz); +printf_style(parent->style, buf); +
[EGIT] [core/efl] master 10/16: svg_parse: implement parse
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6139aa78d5a48166a235087ecc49942b969b09af commit 6139aa78d5a48166a235087ecc49942b969b09af Author: Vitalii VorobiovDate: Fri Feb 17 13:00:54 2017 +0200 svg_parse: implement parse Accodring to https://www.w3.org/TR/SVG/types.html#Length length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%") This is still work in progress since some of lengths should be treated differently, for example gradient lengths --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 180 + 1 file changed, 112 insertions(+), 68 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 531cb05b9c..636b27fcb9 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -28,11 +28,23 @@ struct _Evas_SVG_Loader Eina_Bool result:1; }; +/* length type to recalculate %, pt, pc, mm, cm etc*/ +typedef enum { + SVG_PARSER_LENGTH_VERTICAL, + SVG_PARSER_LENGTH_HORIZONTAL, + /* in case of, for example, radius of radial gradient */ + SVG_PARSER_LENGTH_OTHER +} SVG_Parser_Length_Type; + /* Global struct for working global cases during the parse */ typedef struct { struct { int x, y, width, height; } global; + struct { + Eina_Bool fx_parsed; + Eina_Bool fy_parsed; + } gradient; } Evas_SVG_Parsing; static Evas_SVG_Parsing svg_parse; @@ -73,10 +85,58 @@ _parse_number(const char **content, double *number) return EINA_TRUE; } +/** + * According to https://www.w3.org/TR/SVG/coords.html#Units + * + * TODO + * Since this documentation is not obvious, more clean recalculation with dpi + * is required, but for now default w3 constants would be used + */ static inline double -_to_double(const char *str) +_to_double(const char *str, SVG_Parser_Length_Type type) +{ + double parsed_value = strtod(str, NULL); + + if (strstr(str, "cm")) + parsed_value = parsed_value * 35.43307; + else if (strstr(str, "mm")) + parsed_value = parsed_value * 3.543307; + else if (strstr(str, "pt")) + parsed_value = parsed_value * 1.25; + else if (strstr(str, "pc")) + parsed_value = parsed_value * 15; + else if (strstr(str, "in")) + parsed_value = parsed_value * 90; + else if (strstr(str, "%")) + { +if (type == SVG_PARSER_LENGTH_VERTICAL) + parsed_value = (parsed_value / 100.0) * svg_parse.global.height; +else if (type == SVG_PARSER_LENGTH_HORIZONTAL) + parsed_value = (parsed_value / 100.0) * svg_parse.global.width; +else // if other then it's radius + { + double max = svg_parse.global.width; + if (max < svg_parse.global.height) max = svg_parse.global.height; + parsed_value = (parsed_value / 100.0) * max; + } + } + + //TODO: implement 'em', 'ex' attributes + + return parsed_value; +} + +static inline int +_to_offset(const char *str) { - return strtod(str, NULL); + char *end = NULL; + + double parsed_value = strtod(str, ); + + if (strstr(str, "%")) + parsed_value = parsed_value / 100.0; + + return parsed_value; } static inline int @@ -752,7 +812,7 @@ static void _handle_stroke_width_attr(Svg_Node* node, const char *value) { node->style->stroke.flags |= SVG_STROKE_FLAGS_WIDTH; - node->style->stroke.width = _to_double(value); + node->style->stroke.width = _to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); } static void @@ -985,17 +1045,18 @@ _create_path_node(Svg_Node *parent, const char *buf, unsigned buflen) return node; } -#define CIRCLE_DEF(Name, Field) \ +#define CIRCLE_DEF(Name, Field, Type) \ { #Name, sizeof (#Name), offsetof(Svg_Circle_Node, Field)} static const struct { const char *tag; + SVG_Parser_Length_Type type; int sz; size_t offset; } circle_tags[] = { - CIRCLE_DEF(cx, cx), - CIRCLE_DEF(cy, cy), - CIRCLE_DEF(r, r) + CIRCLE_DEF(cx, cx, SVG_PARSER_LENGTH_HORIZONTAL), + CIRCLE_DEF(cy, cy, SVG_PARSER_LENGTH_VERTICAL), + CIRCLE_DEF(r, r, SVG_PARSER_LENGTH_OTHER) }; /* parse the attributes for a circle element. @@ -1014,7 +1075,7 @@ _attr_parse_circle_node(void *data, const char *key, const char *value) for (i = 0; i < sizeof (circle_tags) / sizeof(circle_tags[0]); i++) if (circle_tags[i].sz - 1 == sz && !strncmp(circle_tags[i].tag, key, sz)) { - *((double*) (array + circle_tags[i].offset)) = _to_double(value); + *((double*) (array + circle_tags[i].offset)) = _to_double(value, circle_tags[i].type); return EINA_TRUE; } @@ -1043,18 +1104,19 @@ _create_circle_node(Svg_Node *parent, const char *buf, unsigned buflen) return node; } -#define ELLIPSE_DEF(Name, Field) \ - { #Name, sizeof (#Name),
[EGIT] [core/efl] master 09/16: svg_parse: save global size variable to use when gradient size recalc
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1354c1c8ab53ab10e4da195aa1ac157c65ba6bf8 commit 1354c1c8ab53ab10e4da195aa1ac157c65ba6bf8 Author: Vitalii VorobiovDate: Tue Feb 14 17:51:13 2017 +0200 svg_parse: save global size variable to use when gradient size recalc For example while userSpaceOnUse it uses not figure's x,y,w,h but entire canvas, so we need to save it publically and recalc while parsing (or after) --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 24 +++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 5f7b632144..531cb05b9c 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -28,6 +28,14 @@ struct _Evas_SVG_Loader Eina_Bool result:1; }; +/* Global struct for working global cases during the parse */ +typedef struct { + struct { + int x, y, width, height; + } global; +} Evas_SVG_Parsing; +static Evas_SVG_Parsing svg_parse; + char * _skip_space(const char *str, const char *end) { @@ -661,9 +669,19 @@ _attr_parse_svg_node(void *data, const char *key, const char *value) else if (!strcmp(key, "viewBox")) { if (_parse_number(, >vx)) - if (_parse_number(, >vy)) -if (_parse_number(, >vw)) - _parse_number(, >vh); + { + if (_parse_number(, >vy)) + { + if (_parse_number(, >vw)) +{ + _parse_number(, >vh); + svg_parse.global.height = doc->vh; +} + svg_parse.global.width = doc->vw; + } + svg_parse.global.y = doc->vy; + } +svg_parse.global.x = doc->vx; } else if (!strcmp(key, "preserveAspectRatio")) { --
[EGIT] [core/efl] master 08/16: vg_common: parse and store userSpaceOnUse (for gradient) when it is set
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fac649c7f41c148ac4750c626bf93a5fd9b4ae49 commit fac649c7f41c148ac4750c626bf93a5fd9b4ae49 Author: Vitalii VorobiovDate: Tue Feb 14 17:37:27 2017 +0200 vg_common: parse and store userSpaceOnUse (for gradient) when it is set So it can be calculated during the draw later on --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 11 ++- src/static_libs/vg_common/vg_common.c | 5 + src/static_libs/vg_common/vg_common.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 4b4913b695..5f7b632144 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -1374,6 +1374,7 @@ _clone_gradient(Svg_Style_Gradient *from) grad->id = _copy_id(from->id); grad->ref = _copy_id(from->ref); grad->spread = from->spread; + grad->user_space = from->user_space; grad->stops = _clone_grad_stops(from->stops); if (grad->type == SVG_LINEAR_GRADIENT) { @@ -1659,6 +1660,10 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value) { grad->ref = _id_from_href(value); } + else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse")) + { +grad->user_space = EINA_TRUE; + } return EINA_TRUE; } @@ -1777,6 +1782,10 @@ _attr_parse_linear_gradient_node(void *data, const char *key, const char *value) { grad->ref = _id_from_href(value); } + else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse")) + { +grad->user_space = EINA_TRUE; + } return EINA_TRUE; } @@ -2185,4 +2194,4 @@ EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_LOADER, vg_loader, svg); #ifndef EVAS_STATIC_BUILD_VG_SVG EVAS_EINA_MODULE_DEFINE(vg_loader, svg); -#endif \ No newline at end of file +#endif diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c index 4204c733f4..410588e6b7 100644 --- a/src/static_libs/vg_common/vg_common.c +++ b/src/static_libs/vg_common/vg_common.c @@ -554,6 +554,11 @@ _apply_gradient_property(Svg_Style_Gradient *g) int stop_count = 0, i = 0; Eina_List *l; + /* + if (!g->user_space) + //get bounding box + */ + if (g->type == SVG_LINEAR_GRADIENT) { grad_obj = evas_vg_gradient_linear_add(NULL); diff --git a/src/static_libs/vg_common/vg_common.h b/src/static_libs/vg_common/vg_common.h index 70c744942e..65c70a89a9 100644 --- a/src/static_libs/vg_common/vg_common.h +++ b/src/static_libs/vg_common/vg_common.h @@ -182,6 +182,7 @@ struct _Svg_Style_Gradient Eina_Stringshare *id; Eina_Stringshare *ref; Efl_Gfx_Gradient_Spread spread; + Eina_Bool user_space; Eina_List *stops; // Efl_Gfx_Gradient_Stop Svg_Radial_Gradient *radial; Svg_Linear_Gradient *linear; --
[EGIT] [core/efl] master 01/16: evas: Fix invalid header protector
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d4a3d2f5de140778539c126fff2c759c6e4e6399 commit d4a3d2f5de140778539c126fff2c759c6e4e6399 Author: Jean-Philippe AndreDate: Tue Nov 7 11:52:54 2017 +0900 evas: Fix invalid header protector clang is smart enough to warn about this. I've mentioned it multiple times... --- src/lib/evas/common/evas_font_draw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/common/evas_font_draw.h b/src/lib/evas/common/evas_font_draw.h index c0b5e8edae..d84fb6aece 100644 --- a/src/lib/evas/common/evas_font_draw.h +++ b/src/lib/evas/common/evas_font_draw.h @@ -1,5 +1,5 @@ #ifndef _EVAS_FONT_DRAW_H -#define _EVAS_FONT_DRAW_ +#define _EVAS_FONT_DRAW_H #include "evas_common_private.h" @@ -15,4 +15,4 @@ EAPI void evas_common_font_draw_do (const Cutout_Rects EAPI Eina_Bool evas_common_font_draw_prepare_cutout (Cutout_Rects **reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func); EAPI void evas_common_font_glyph_draw (RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch); -#endif /* _EVAS_FONT_DRAW_H */ \ No newline at end of file +#endif /* _EVAS_FONT_DRAW_H */ --
[EGIT] [core/efl] master 03/16: vg_savers/svg: empty (for now) module that will save svg in original file
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7d9c1256a30bdbe3680c14da77d5fadf3382b6ef commit 7d9c1256a30bdbe3680c14da77d5fadf3382b6ef Author: Vitalii VorobiovDate: Fri Jan 27 13:54:47 2017 +0200 vg_savers/svg: empty (for now) module that will save svg in original file Just as a starter to make a working background that, later on, will go through Svg_Node's and build a certain source code to be saved in SVG picture as a file --- src/Makefile_Evas.am | 25 +++- src/lib/evas/file/evas_module.c | 4 ++ src/lib/evas/vg/evas_vg_cache.c | 3 +- src/modules/evas/vg_savers/svg/evas_vg_save_svg.c | 72 +++ 4 files changed, 102 insertions(+), 2 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index d80e1c2015..e5c3dba46b 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -1607,7 +1607,7 @@ endif if BUILD_VG_LOADER_SVG if EVAS_STATIC_BUILD_VG_SVG -lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c \ +lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c modules/evas/vg_savers/svg/evas_vg_save_svg.c \ static_libs/vg_common/vg_common.c \ static_libs/vg_common/vg_common.h lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/static_libs/vg_common \ @@ -1636,6 +1636,29 @@ modules_evas_vg_loaders_svg_module_la_LIBADD = \ modules_evas_vg_loaders_svg_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ modules_evas_vg_loaders_svg_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ modules_evas_vg_loaders_svg_module_la_LIBTOOLFLAGS = --tag=disable-static + +vgsaversvgpkgdir = $(libdir)/evas/modules/vg_savers/svg/$(MODULE_ARCH) +vgsaversvgpkg_LTLIBRARIES = modules/evas/vg_savers/svg/module.la + +# Workaround for broken parallel install support in automake (relink issue) +# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328 +install_vgsaversvgpkgLTLIBRARIES = install-vgloadersvgpkgLTLIBRARIES +$(install_vgsaversvgpkgLTLIBRARIES): install-libLTLIBRARIES + +modules_evas_vg_savers_svg_module_la_SOURCES = modules/evas/vg_savers/svg/evas_vg_save_svg.c \ +static_libs/vg_common/vg_common.c \ +static_libs/vg_common/vg_common.h +modules_evas_vg_savers_svg_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ +-I$(top_srcdir)/src/lib/evas/include \ +-I$(top_srcdir)/src/static_libs/vg_common \ +@EVAS_CFLAGS@ \ +@evas_vg_saver_svg_cflags@ +modules_evas_vg_savers_svg_module_la_LIBADD = \ +@USE_EVAS_LIBS@ \ +@evas_vg_saver_svg_libs@ +modules_evas_vg_savers_svg_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ +modules_evas_vg_savers_svg_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ +modules_evas_vg_savers_svg_module_la_LIBTOOLFLAGS = --tag=disable-static endif endif diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c index 151b5b9a13..bdcd5e8500 100644 --- a/src/lib/evas/file/evas_module.c +++ b/src/lib/evas/file/evas_module.c @@ -207,6 +207,7 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tgv); #if !EVAS_MODULE_NO_VG_SAVERS EVAS_EINA_STATIC_MODULE_DEFINE(vg_saver, eet); +EVAS_EINA_STATIC_MODULE_DEFINE(vg_saver, svg); #endif #if !EVAS_MODULE_NO_IMAGE_SAVERS @@ -319,6 +320,9 @@ static const struct { #ifdef EVAS_STATIC_BUILD_VG_EET EVAS_EINA_STATIC_MODULE_USE(vg_saver, eet), #endif +#ifdef EVAS_STATIC_BUILD_VG_SVG + EVAS_EINA_STATIC_MODULE_USE(vg_saver, svg), +#endif #endif #if !EVAS_MODULE_NO_IMAGE_SAVERS #ifdef EVAS_STATIC_BUILD_EET diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index 57f3cefc56..f3e8f77289 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -102,7 +102,8 @@ struct ext_saver_s static const struct ext_saver_s savers[] = { /* map extensions to savers to use for good first-guess tries */ MATCHING(".eet", "eet"), - MATCHING(".edj", "eet") + MATCHING(".edj", "eet"), + MATCHING(".svg", "svg") }; static Evas_Module * diff --git a/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c new file mode 100644 index 00..8c11fb3d69 --- /dev/null +++ b/src/modules/evas/vg_savers/svg/evas_vg_save_svg.c @@ -0,0 +1,72 @@ +#include "vg_common.h" + +static int _evas_vg_saver_svg_log_dom = -1; + +#ifdef ERR +# undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_evas_vg_saver_eet_log_dom, __VA_ARGS__) + +#ifdef INF +# undef INF +#endif +#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_saver_eet_log_dom, __VA_ARGS__) + +int +evas_vg_save_file_svg(Vg_File_Data *evg_data, const char *file, const char *key EINA_UNUSED, int compress EINA_UNUSED) +{ + Svg_Node *root EINA_UNUSED; + Eet_File *ef; + + ef = eet_open(file, EET_FILE_MODE_WRITE); + if (!ef) + return EVAS_LOAD_ERROR_GENERIC; + + root = vg_common_create_svg_node(evg_data); + //TODO: parse root into SVG source code and
[EGIT] [core/efl] master 07/16: efl_gfx_path: fix typo in _path_bounds_get
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=73bfd4f04d6b9885bab271d16c688f97dcf626a3 commit 73bfd4f04d6b9885bab271d16c688f97dcf626a3 Author: Vitalii VorobiovDate: Mon Feb 13 16:27:55 2017 +0200 efl_gfx_path: fix typo in _path_bounds_get Wrong position was used while going through the array of points @fix --- src/lib/efl/interfaces/efl_gfx_path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c index 3501379a75..df424c1d3e 100644 --- a/src/lib/efl/interfaces/efl_gfx_path.c +++ b/src/lib/efl/interfaces/efl_gfx_path.c @@ -221,7 +221,7 @@ _efl_gfx_path_bounds_get(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd, Eina_Rect * maxx = pd->points[0]; maxy = pd->points[1]; - for (i = 1; i < pd->points_count; i += 2) + for (i = 2; i < pd->points_count; i += 2) { minx = minx < pd->points[i] ? minx : pd->points[i]; miny = miny < pd->points[i + 1] ? miny : pd->points[i + 1]; --
[EGIT] [core/efl] master 13/16: svg_parse: parse correct values for radialGradient
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6bf5d9d96ef07dcd12f5c9e7ceaa1dbcca046206 commit 6bf5d9d96ef07dcd12f5c9e7ceaa1dbcca046206 Author: Vitalii VorobiovDate: Wed Feb 22 13:02:31 2017 +0200 svg_parse: parse correct values for radialGradient Especially Radius calculation which was a huge pain to find formula within SVG documentations! --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 36 +- src/static_libs/vg_common/vg_common.c | 12 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index ff1b2d8e2d..36e5d14409 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -145,11 +145,18 @@ _gradient_to_double(const char *str, SVG_Parser_Length_Type type) return parsed_value; } + /** +* That is according to Units in here +* +* https://www.w3.org/TR/2015/WD-SVG2-20150915/coords.html +*/ if (type == SVG_PARSER_LENGTH_VERTICAL) max = svg_parse.global.height; else if (type == SVG_PARSER_LENGTH_HORIZONTAL) max = svg_parse.global.width; - //TODO: what about radial? + else if (type == SVG_PARSER_LENGTH_OTHER) + max = sqrt(pow(svg_parse.global.height, 2) + +pow(svg_parse.global.width, 2)) / sqrt(2.0); if (strstr(str, "cm")) parsed_value = parsed_value * 35.43307; @@ -169,7 +176,7 @@ _gradient_to_double(const char *str, SVG_Parser_Length_Type type) return parsed_value; } -static inline int +static inline double _to_offset(const char *str) { char *end = NULL; @@ -1148,7 +1155,7 @@ _create_circle_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define ELLIPSE_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name) + sizeof (Type), offsetof(Svg_Ellipse_Node, Field)} + { #Name, Type, sizeof (#Name), offsetof(Svg_Ellipse_Node, Field)} static const struct { const char *tag; @@ -1302,7 +1309,7 @@ _create_polyline_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define RECT_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name) + sizeof(Type), offsetof(Svg_Rect_Node, Field)} + { #Name, Type, sizeof (#Name), offsetof(Svg_Rect_Node, Field)} static const struct { const char *tag; @@ -1368,7 +1375,7 @@ _create_rect_node(Svg_Node *parent, const char *buf, unsigned buflen) } #define LINE_DEF(Name, Field, Type) \ - { #Name, Type, sizeof (#Name) + sizeof (Type), offsetof(Svg_Line_Node, Field)} + { #Name, Type, sizeof (#Name), offsetof(Svg_Line_Node, Field)} static const struct { const char *tag; @@ -1690,7 +1697,7 @@ _parse_spread_value(const char *value) static void _handle_radial_cx_attr(Svg_Radial_Gradient* radial, const char *value) { - radial->cx = _to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + radial->cx = _gradient_to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); if (!svg_parse.gradient.fx_parsed) radial->fx = radial->cx; } @@ -1698,7 +1705,7 @@ _handle_radial_cx_attr(Svg_Radial_Gradient* radial, const char *value) static void _handle_radial_cy_attr(Svg_Radial_Gradient* radial, const char *value) { - radial->cy = _to_double(value, SVG_PARSER_LENGTH_VERTICAL); + radial->cy = _gradient_to_double(value, SVG_PARSER_LENGTH_VERTICAL); if (!svg_parse.gradient.fy_parsed) radial->fy = radial->cy; } @@ -1706,24 +1713,23 @@ _handle_radial_cy_attr(Svg_Radial_Gradient* radial, const char *value) static void _handle_radial_fx_attr(Svg_Radial_Gradient* radial, const char *value) { - radial->fx = _to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); + radial->fx = _gradient_to_double(value, SVG_PARSER_LENGTH_HORIZONTAL); svg_parse.gradient.fx_parsed = EINA_TRUE; } static void _handle_radial_fy_attr(Svg_Radial_Gradient* radial, const char *value) { - radial->fy = _to_double(value, SVG_PARSER_LENGTH_VERTICAL); + radial->fy = _gradient_to_double(value, SVG_PARSER_LENGTH_VERTICAL); svg_parse.gradient.fy_parsed = EINA_TRUE; } static void _handle_radial_r_attr(Svg_Radial_Gradient* radial, const char *value) { - radial->r = _to_double(value, SVG_PARSER_LENGTH_OTHER); + radial->r = _gradient_to_double(value, SVG_PARSER_LENGTH_OTHER); } - typedef void (*Radial_Method)(Svg_Radial_Gradient *radial, const char *value); #define RADIAL_DEF(Name) \ @@ -1768,9 +1774,9 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value) { grad->ref = _id_from_href(value); } - else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse")) + else if (!strcmp(key, "gradientUnits") && !strcmp(value, "objectBoundingBox")) { -grad->user_space = EINA_TRUE; +grad->user_space = EINA_FALSE;
[EGIT] [core/efl] master 12/16: vg_common: apply related coordinates for linear gradient
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f81f031ceb799f22bd8b6ea216a9b565244af12c commit f81f031ceb799f22bd8b6ea216a9b565244af12c Author: Vitalii VorobiovDate: Tue Feb 21 17:40:15 2017 +0200 vg_common: apply related coordinates for linear gradient multiply it with object size or with view box sizes depending on gradientUnits value --- src/static_libs/vg_common/vg_common.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c index 410588e6b7..eb6c992652 100644 --- a/src/static_libs/vg_common/vg_common.c +++ b/src/static_libs/vg_common/vg_common.c @@ -547,23 +547,29 @@ vg_common_svg_node_free(Svg_Node *node) } static Efl_VG * -_apply_gradient_property(Svg_Style_Gradient *g) +_apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Vg_File_Data *vg_data) { Efl_VG *grad_obj = NULL; Efl_Gfx_Gradient_Stop *stops, *stop; int stop_count = 0, i = 0; Eina_List *l; + Eina_Rect r = { 0, 0, 1, 1 }; - /* + //TODO: apply actual sizes (imporve bounds_get function?)... + //for example with figures and paths if (!g->user_space) - //get bounding box - */ + evas_vg_node_bounds_get(vg, ); + else + { +r.w = vg_data->view_box.w; +r.h = vg_data->view_box.h; + } if (g->type == SVG_LINEAR_GRADIENT) { grad_obj = evas_vg_gradient_linear_add(NULL); -evas_vg_gradient_linear_start_set(grad_obj, g->linear->x1, g->linear->y1); -evas_vg_gradient_linear_end_set(grad_obj, g->linear->x2, g->linear->y2); +evas_vg_gradient_linear_start_set(grad_obj, g->linear->x1 * r.w + r.x, g->linear->y1 * r.h + r.y); +evas_vg_gradient_linear_end_set(grad_obj, g->linear->x2 * r.w + r.x, g->linear->y2 * r.h + r.y); } else if (g->type == SVG_RADIAL_GRADIENT) { @@ -590,7 +596,7 @@ _apply_gradient_property(Svg_Style_Gradient *g) stops[i].r = stop->r; stops[i].g = stop->g; stops[i].b = stop->b; - stops[i].a = stop->a; + stops[i].a = 255; stops[i].offset = stop->offset; i++; } @@ -602,7 +608,7 @@ _apply_gradient_property(Svg_Style_Gradient *g) // vg tree creation static void -_apply_vg_property(Svg_Node *node, Efl_VG *vg) +_apply_vg_property(Svg_Node *node, Efl_VG *vg, Vg_File_Data *vg_data) { Svg_Style_Property *style = node->style; @@ -626,7 +632,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg) else if (style->fill.paint.gradient) { // if the fill has gradient then apply. -evas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient)); +evas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient, vg, vg_data)); } else if (style->fill.paint.cur_color) { @@ -653,7 +659,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg) else if (style->stroke.paint.gradient) { // if the fill has gradient then apply. -evas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient)); +evas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient, vg, vg_data)); } else if (style->stroke.paint.url) { @@ -690,7 +696,7 @@ _add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon) } static Efl_VG * -vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent) +vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent, Vg_File_Data *vg_data) { Efl_VG *vg = NULL; Svg_Node *child; @@ -702,10 +708,10 @@ vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent) case SVG_NODE_G: { vg = evas_vg_container_add(parent); - _apply_vg_property(node, vg); + _apply_vg_property(node, vg, vg_data); EINA_LIST_FOREACH(node->child, l, child) { - vg_common_create_vg_node_helper(child, vg); + vg_common_create_vg_node_helper(child, vg, vg_data); } return vg; } @@ -751,7 +757,7 @@ vg_common_create_vg_node_helper(Svg_Node *node, Efl_VG *parent) break; } if (vg) - _apply_vg_property(node, vg); + _apply_vg_property(node, vg, vg_data); return vg; } @@ -768,7 +774,7 @@ vg_common_create_vg_node(Svg_Node *node) vg_data->view_box.w = node->node.doc.vw; vg_data->view_box.h = node->node.doc.vh; vg_data->preserve_aspect = node->node.doc.preserve_aspect; - vg_data->root = vg_common_create_vg_node_helper(node, NULL); + vg_data->root = vg_common_create_vg_node_helper(node, NULL, vg_data); return vg_data; } --
[EGIT] [core/efl] master 01/01: Remove evas internal dependency from the evas_font module
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b038d7df25f9cecaa4f0d8c1c7355e4852e5348a commit b038d7df25f9cecaa4f0d8c1c7355e4852e5348a Author: subhransu mohantyDate: Tue Nov 7 11:22:09 2017 +0900 Remove evas internal dependency from the evas_font module Summary: dev branch : devs/subhransu/font The Final goal is to move the evas_font module to ector so that both ector and evas can reuse the code. make the api simple so that sam eapi can be used by evas_textblock and ector text. This is the 1st stage to achive that gola, first remove the evas internal dependancy as much as possible before moving to ector library. Reviewers: jpeg, raster, herdsman, cedric, id213sin Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5419 --- src/Makefile_Evas.am |5 +- src/lib/evas/canvas/evas_font_dir.c| 1105 +++- src/lib/evas/canvas/evas_main.c| 135 ++- src/lib/evas/canvas/evas_object_text.c | 14 +- src/lib/evas/canvas/evas_object_textblock.c| 43 +- src/lib/evas/canvas/evas_object_textgrid.c | 54 +- src/lib/evas/canvas/evas_render.c |4 +- src/lib/evas/canvas/render2/evas_render2_old.c |2 +- src/lib/evas/common/evas_font.h| 354 +++- src/lib/evas/common/evas_font_compress.c | 173 +--- src/lib/evas/common/evas_font_draw.c | 154 +++- src/lib/evas/common/evas_font_draw.h | 18 + src/lib/evas/common/evas_font_load.c | 50 +- src/lib/evas/common/evas_font_main.c | 28 +- src/lib/evas/common/evas_font_ot.c |4 +- src/lib/evas/common/evas_font_ot.h | 11 +- src/lib/evas/common/evas_font_private.h| 44 +- src/lib/evas/common/evas_font_query.c |3 - src/lib/evas/common/evas_text_utils.c |8 +- src/lib/evas/common/evas_text_utils.h |5 +- src/lib/evas/include/evas_common_private.h | 181 +--- src/lib/evas/include/evas_private.h| 129 +-- 22 files changed, 1316 insertions(+), 1208 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 8b82e1aaed..d80e1c2015 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -493,7 +493,8 @@ lib/evas/common/language/evas_bidi_utils.h \ lib/evas/common/language/evas_language_utils.h \ lib/evas/common/language/evas_script_table.h \ lib/evas/common/evas_text_utils.h \ -lib/evas/common/evas_font_ot.h +lib/evas/common/evas_font_ot.h \ +lib/evas/common/evas_font_draw.h lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/lib/evas/canvas \ @@ -1608,7 +1609,7 @@ if BUILD_VG_LOADER_SVG if EVAS_STATIC_BUILD_VG_SVG lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c \ static_libs/vg_common/vg_common.c \ -static_libs/vg_common/vg_common.h +static_libs/vg_common/vg_common.h lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/static_libs/vg_common \ @evas_vg_loader_svg_cflags@ lib_evas_libevas_la_LIBADD += @evas_vg_loader_svg_libs@ diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index e120f682d6..cbdef108ff 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -13,8 +13,14 @@ #include #endif -#include "evas_common_private.h" -#include "evas_private.h" +#include "evas_font.h" + +/* General types - used for script type chceking */ +#define OPAQUE_TYPE(type) struct __##type { int a; }; \ + typedef struct __##type type + +OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */ +OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */ /* font dir cache */ static Eina_Hash *font_dirs = NULL; @@ -57,6 +63,70 @@ static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]); static FcConfig *fc_config = NULL; #endif +/* FIXME move these helper function to eina_file or eina_path */ +/* get the casefold feature! */ +#include +#ifndef _MSC_VER +# include +# include +#endif +int +_file_path_is_full_path(const char *path) +{ + if (!path) return 0; +#ifdef _WIN32 + if (evil_path_is_absolute(path)) return 1; +#else + if (path[0] == '/') return 1; +#endif + return 0; +} + +static DATA64 +_file_modified_time(const char *file) +{ + struct stat st; + + if (stat(file, ) < 0) return 0; + if (st.st_ctime > st.st_mtime) return (DATA64)st.st_ctime; + else return (DATA64)st.st_mtime; + return 0; +} + +Eina_List * +_file_path_list(char *path, const char *match, int match_case) +{ + Eina_File_Direct_Info *info; + Eina_Iterator *it; + Eina_List *files = NULL; + int flags; + + flags = FNM_PATHNAME; +#ifdef FNM_CASEFOLD + if (!match_case) + flags |= FNM_CASEFOLD; +#elif defined FNM_IGNORECASE + if
[EGIT] [core/efl] master 01/01: elm: Try to fix compilation (link) for OSX
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a75b3dcdfbe0760972c8b4d55a90dc6250bd1e45 commit a75b3dcdfbe0760972c8b4d55a90dc6250bd1e45 Author: Jean-Philippe AndreDate: Tue Nov 7 10:39:28 2017 +0900 elm: Try to fix compilation (link) for OSX --- src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c | 2 +- src/modules/elementary/test_map/mod.c | 1 - src/modules/elementary/web/none/elm_web_none.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c index dcb8bf7293..72884b96a7 100644 --- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c +++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c @@ -3,11 +3,11 @@ #endif #include +#include "elm_module_helper.h" #include "elm_widget.h" #include "efl_ui_clock_private.h" #include "elm_ctxpopup_item.eo.h" #include "elm_ctxpopup.eo.h" -#include "elm_module_helper.h" #define CLOCK_FIELD_COUNT 8 #define FIELD_FORMAT_LEN3 diff --git a/src/modules/elementary/test_map/mod.c b/src/modules/elementary/test_map/mod.c index fd5dcdb03e..884375a0a3 100644 --- a/src/modules/elementary/test_map/mod.c +++ b/src/modules/elementary/test_map/mod.c @@ -4,7 +4,6 @@ #include "Elementary.h" #include "elm_widget_map.h" -#include #include "elm_module_helper.h" EAPI Eina_Stringshare * diff --git a/src/modules/elementary/web/none/elm_web_none.c b/src/modules/elementary/web/none/elm_web_none.c index 91292e0bd4..acdf97c968 100644 --- a/src/modules/elementary/web/none/elm_web_none.c +++ b/src/modules/elementary/web/none/elm_web_none.c @@ -8,8 +8,8 @@ #include "elm_priv.h" #include "elm_widget_web.h" -#include "elm_web_none.eo.h" #include "elm_module_helper.h" +#include "elm_web_none.eo.h" #define MY_CLASS ELM_WEB_CLASS --
[EGIT] [core/efl] master 11/19: cxx: Fix ifdef protections in function impl
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c490392ee6f9005294bbc7ef14eb5f6b5623dfe5 commit c490392ee6f9005294bbc7ef14eb5f6b5623dfe5 Author: Jean-Philippe AndreDate: Mon Nov 6 13:37:18 2017 +0900 cxx: Fix ifdef protections in function impl Mote: for protected we should use "protected:" if that is somehow possible. --- src/lib/eolian_cxx/grammar/function_definition.hpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp index 714cb1fbda..1c7cf25a16 100644 --- a/src/lib/eolian_cxx/grammar/function_definition.hpp +++ b/src/lib/eolian_cxx/grammar/function_definition.hpp @@ -45,12 +45,12 @@ struct function_definition_generator } if(f.is_beta && - !as_generator("#ifdef " << *(string << "_") << string << "_" << string << "_BETA\n") - .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name, suffix), add_upper_case_context(ctx))) + !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n") + .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx))) return false; if(f.is_protected && - !as_generator("#ifdef " << *(string << "_") << string << "_" << string << "_PROTECTED\n") - .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name, suffix), add_upper_case_context(ctx))) + !as_generator("#ifdef " << *(string << "_") << string << "_PROTECTED\n") + .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx))) return false; if(!as_generator --
[EGIT] [core/efl] master 14/19: cxx: Fix some examples, disable or remove others
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=778c5afb3f29fe0763d875d31f6411b24cbb997d commit 778c5afb3f29fe0763d875d31f6411b24cbb997d Author: Jean-Philippe AndreDate: Mon Nov 6 14:25:22 2017 +0900 cxx: Fix some examples, disable or remove others make examples now builds all c++ examples but some of them are in fact empty skeletons. Those either need some c++ love or the final eo api to be ready (eg. menu, popup, ...). I removed some examples that don't have an exact equivalent in EO since the widget is legacy only. --- src/examples/elementary/Makefile.am| 121 +++ src/examples/elementary/box_cxx_example_02.cc | 4 +- src/examples/elementary/button_cxx_example_00.cc | 20 +- src/examples/elementary/button_cxx_example_01.cc | 365 ++--- src/examples/elementary/calendar_cxx_example_01.cc | 9 +- src/examples/elementary/calendar_cxx_example_02.cc | 6 - src/examples/elementary/calendar_cxx_example_03.cc | 9 +- src/examples/elementary/calendar_cxx_example_04.cc | 7 +- src/examples/elementary/calendar_cxx_example_05.cc | 7 +- src/examples/elementary/clock_cxx_example.cc | 5 - src/examples/elementary/glview_cxx_example_01.cc | 263 --- src/examples/elementary/hoversel_cxx_example_01.cc | 84 - src/examples/elementary/icon_cxx_example_01.cc | 14 +- src/examples/elementary/location_cxx_example_01.cc | 82 - src/examples/elementary/menu_cxx_example_01.cc | 15 +- src/examples/elementary/popup_cxx_example_01.cc| 32 -- src/examples/elementary/radio_cxx_example_01.cc| 93 +++--- src/examples/elementary/slider_cxx_example.cc | 144 src/examples/elementary/spinner_cxx_example.cc | 86 +++-- src/examples/elementary/table_cxx_example_01.cc| 56 ++-- src/examples/elementary/table_cxx_example_02.cc| 71 ++-- 21 files changed, 444 insertions(+), 1049 deletions(-) diff --git a/src/examples/elementary/Makefile.am b/src/examples/elementary/Makefile.am index 6e6b9ac4c5..2db4ea7e0b 100644 --- a/src/examples/elementary/Makefile.am +++ b/src/examples/elementary/Makefile.am @@ -107,7 +107,6 @@ genlist_example_02.c \ genlist_example_03.c \ genlist_example_04.c \ genlist_example_05.c \ -glview_example_01.c \ hover_example_01.c \ hoversel_example_01.c \ icon_example_01.c \ @@ -179,6 +178,9 @@ if HAVE_CXX11 SRCS += \ bg_cxx_example_01.cc \ bg_cxx_example_02.cc \ +box_cxx_example_02.cc \ +button_cxx_example_00.cc \ +button_cxx_example_01.cc \ calendar_cxx_example_01.cc \ calendar_cxx_example_02.cc \ calendar_cxx_example_03.cc \ @@ -186,27 +188,15 @@ calendar_cxx_example_04.cc \ calendar_cxx_example_05.cc \ clock_cxx_example.cc \ icon_cxx_example_01.cc \ -button_cxx_example_00.cc -endif -#table_cxx_example_02.cc \ -table_cxx_example_01.cc \ -spinner_cxx_example.cc \ -slider_cxx_example.cc \ -radio_cxx_example_01.cc \ -popup_cxx_example_01.cc \ menu_cxx_example_01.cc \ -location_cxx_example_01.cc \ -hoversel_cxx_example_01.cc \ -glview_cxx_example_01.cc \ -calendar_cxx_example_05.cc \ -calendar_cxx_example_04.cc \ -calendar_cxx_example_03.cc \ -calendar_cxx_example_02.cc \ -calendar_cxx_example_01.cc \ -button_cxx_example_01.cc \ -box_cxx_example_02.cc \ -bg_cxx_example_02.cc \ -bg_cxx_example_01.cc +radio_cxx_example_01.cc \ +slider_cxx_example.cc \ +spinner_cxx_example.cc \ +table_cxx_example_01.cc \ +table_cxx_example_02.cc \ +toolbar_cxx_example_01.cc \ +$(NULL) +endif EDCS = \ twitter_example_01.edc \ @@ -305,7 +295,6 @@ genlist_example_02 \ genlist_example_03 \ genlist_example_04 \ genlist_example_05 \ -glview_example_01 \ hover_example_01 \ hoversel_example_01 \ icon_example_01 \ @@ -402,6 +391,9 @@ if HAVE_CXX11 examples_PROGRAMS += \ bg_cxx_example_01 \ bg_cxx_example_02 \ +box_cxx_example_02 \ +button_cxx_example_00 \ +button_cxx_example_01 \ calendar_cxx_example_01 \ calendar_cxx_example_02 \ calendar_cxx_example_03 \ @@ -409,31 +401,14 @@ calendar_cxx_example_04 \ calendar_cxx_example_05 \ clock_cxx_example \ icon_cxx_example_01 \ +menu_cxx_example_01 \ +radio_cxx_example_01 \ +slider_cxx_example \ +spinner_cxx_example \ +table_cxx_example_01 \ +table_cxx_example_02 \ toolbar_cxx_example_01 \ -button_cxx_example_00 -# examples_PROGRAMS += \ -# table_cxx_example_02 \ -# table_cxx_example_01 \ -# spinner_cxx_example \ -# slider_cxx_example \ -# radio_cxx_example_01 \ -# popup_cxx_example_01 \ -# menu_cxx_example_01 \ -# location_cxx_example_01 \ -# icon_cxx_example_01 \ -# hoversel_cxx_example_01 \ -# glview_cxx_example_01 \ -# clock_cxx_example \ -# calendar_cxx_example_05 \ -# calendar_cxx_example_04 \ -# calendar_cxx_example_03 \ -# calendar_cxx_example_02 \ -# calendar_cxx_example_01 \ -# button_cxx_example_01 \ -# button_cxx_example_00 \ -# box_cxx_example_02 \ -# bg_cxx_example_02 \ -# bg_cxx_example_01 +$(NULL) endif
[EGIT] [core/efl] master 01/19: cxx: Place beta API declarations behind ifdef
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f64dcc521ce6709beb9355cca31a99a940c18be commit 3f64dcc521ce6709beb9355cca31a99a940c18be Author: Jean-Philippe AndreDate: Wed Nov 1 21:59:17 2017 +0900 cxx: Place beta API declarations behind ifdef NOTE: protected APIs are placed behind ifdef as well in the implementation file. This makes sense since the define is required for the C code to compile, but this isn't what @protected means. --- .../eolian_cxx/grammar/base_class_definition.hpp | 2 +- src/lib/eolian_cxx/grammar/class_definition.hpp| 2 +- .../eolian_cxx/grammar/function_declaration.hpp| 55 ++ 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/lib/eolian_cxx/grammar/base_class_definition.hpp b/src/lib/eolian_cxx/grammar/base_class_definition.hpp index bb5adde1cc..5a4a219529 100644 --- a/src/lib/eolian_cxx/grammar/base_class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/base_class_definition.hpp @@ -33,7 +33,7 @@ struct base_class_definition_generator "struct " << string << " {\n" ).generate(sink, cls.cxx_name, context)) return false; - if(!as_generator(*(scope_tab << function_declaration)) + if(!as_generator(*(scope_tab << function_declaration(get_klass_name(cls .generate(sink, cls.functions, context)) return false; // static Efl_Class const* _eo_class(); diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp index 326ef23578..15ef86d371 100644 --- a/src/lib/eolian_cxx/grammar/class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/class_definition.hpp @@ -87,7 +87,7 @@ struct class_definition_generator // << scope_tab << scope_tab << ": ::efl::eo::concrete( ::efl::eo::do_eo_add( ::efl::eo::concrete{nullptr}, f)) {}\n" ).generate(sink, attributes::make_infinite_tuple(cls.cxx_name), context)) return false; - if(!as_generator(*(scope_tab << function_declaration)) + if(!as_generator(*(scope_tab << function_declaration(get_klass_name(cls .generate(sink, cls.functions, context)) return false; // static Efl_Class const* _eo_class(); diff --git a/src/lib/eolian_cxx/grammar/function_declaration.hpp b/src/lib/eolian_cxx/grammar/function_declaration.hpp index 6e124dfd38..431b4a21da 100644 --- a/src/lib/eolian_cxx/grammar/function_declaration.hpp +++ b/src/lib/eolian_cxx/grammar/function_declaration.hpp @@ -4,6 +4,7 @@ #include "grammar/generator.hpp" #include "grammar/klass_def.hpp" +#include "grammar/string.hpp" #include "grammar/indentation.hpp" #include "grammar/list.hpp" #include "grammar/alternative.hpp" @@ -15,13 +16,43 @@ namespace efl { namespace eolian { namespace grammar { struct function_declaration_generator { - template - bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const - { -return as_generator - ("::efl::eolian::return_traits<" << grammar::type(true) << ">::type " << string << "(" << (parameter % ", ") << ") const;\n") - .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), context); - } + function_declaration_generator(attributes::klass_name const& name) + : _klass_name(name) + {} + + template + bool generate(OutputIterator sink, attributes::function_def const& f, Context const& ctx) const + { + std::string suffix; + switch(_klass_name.type) +{ +case attributes::class_type::regular: +case attributes::class_type::abstract_: + suffix = "CLASS"; + break; +case attributes::class_type::mixin: + suffix = "MIXIN"; + break; +case attributes::class_type::interface_: + suffix = "INTERFACE"; + break; +} + + if(f.is_beta && +!as_generator("#ifdef " << *(string << "_") << string << "_" << string << "_BETA\n") +.generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name, suffix), add_upper_case_context(ctx))) +return false; + if(!as_generator +("::efl::eolian::return_traits<" << grammar::type(true) << ">::type " << string << "(" << (parameter % ", ") << ") const;\n") +.generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), ctx)) +return false; + if(f.is_beta && +!as_generator("#endif\n").generate(sink, attributes::unused, ctx)) +return false; + return true; + } + + attributes::klass_name _klass_name; }; template <> @@ -31,8 +62,14 @@ namespace type_traits { template <> struct attributes_needed : std::integral_constant {}; } - -function_declaration_generator const function_declaration = {}; + +struct function_declaration_terminal +{ +
[EGIT] [core/efl] master 02/19: cxx: Instantiate objects with 2 refs
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=03b22c4d7b41c2310b4c25ed7ce8543942d638d5 commit 03b22c4d7b41c2310b4c25ed7ce8543942d638d5 Author: Jean-Philippe AndreDate: Wed Nov 1 22:01:11 2017 +0900 cxx: Instantiate objects with 2 refs This is the original meaning of efl_add_ref(). Somehow the "ref" bool was set to true in the first call, and false in the second call. --- src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 17cc390270..72c435e4d7 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -847,7 +847,7 @@ inline void do_eo_add(Eo*& object, P const& parent , typename std::enable_if< eo::is_eolian_object::value>::type* = 0) { object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE); - object = ::_efl_add_end(object, EINA_FALSE, EINA_FALSE); + object = ::_efl_add_end(object, EINA_TRUE, EINA_FALSE); } template @@ -873,7 +873,7 @@ void do_eo_add(Eo*& object, P const& parent, Efl_Class const* klass { object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE); ::efl::eolian::call_lambda(std::forward(f), proxy); - object = ::_efl_add_end(object, EINA_FALSE, EINA_FALSE); + object = ::_efl_add_end(object, EINA_TRUE, EINA_FALSE); } template --
[EGIT] [core/efl] master 10/19: cxx: Add support for operator == with objects
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=64698daeb5aa5eec5da8cd60ff18c05e2d155102 commit 64698daeb5aa5eec5da8cd60ff18c05e2d155102 Author: Jean-Philippe AndreDate: Mon Nov 6 12:26:05 2017 +0900 cxx: Add support for operator == with objects --- src/bindings/cxx/eo_cxx/eo_wref.hh | 12 1 file changed, 12 insertions(+) diff --git a/src/bindings/cxx/eo_cxx/eo_wref.hh b/src/bindings/cxx/eo_cxx/eo_wref.hh index 124b1da3b7..e28409c513 100644 --- a/src/bindings/cxx/eo_cxx/eo_wref.hh +++ b/src/bindings/cxx/eo_cxx/eo_wref.hh @@ -135,6 +135,18 @@ struct wref } #endif + template + bool operator == (U const ) const + { + return other._eo_ptr() == _eo_wref; + } + + template + friend bool operator == (U const , wref const ) + { + return other._eo_ptr() == thiz._eo_wref; + } + private: void _add() { --
[EGIT] [core/efl] master 09/19: cxx: Modify button example with wref
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d4c92b39df3662064be0c002fd6ae2e181f64b75 commit d4c92b39df3662064be0c002fd6ae2e181f64b75 Author: Jean-Philippe AndreDate: Thu Nov 2 18:42:09 2017 +0900 cxx: Modify button example with wref This is more of an experiment than anything else. @felipealmeida I would like to know what you think. Notes: - events still need a better API (event_add isn't part of the object definition...). - references are an issue, when you want to actually delete an object. --- src/examples/elementary/button_cxx_example_00.cc | 61 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc index 037a15654b..30c58d84cd 100644 --- a/src/examples/elementary/button_cxx_example_00.cc +++ b/src/examples/elementary/button_cxx_example_00.cc @@ -1,44 +1,43 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "elementary_config.h" -#endif +// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00 +#define EFL_CXX_WREF_EASY #include +#include -EAPI_MAIN int -elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) +using efl::eo::instantiate; + +static void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); - using efl::eo::instantiate; - - efl::ui::Win win(instantiate); -////win.title_set("Hello, World!"); -//win.autohide_set(true); - -//::elm::Button btn(win); -//btn.text_set("elm.text","Good-Bye, World!"); -//btn.eo_cxx::efl::Gfx::size_set(120, 30); -//btn.eo_cxx::efl::Gfx::position_set(60, 15); -//// btn.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); -//// btn.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); - // win.title_set("Hello, World!"); + auto win = efl::ui::Win(instantiate); + win.text_set("Button Example"); win.autohide_set(true); - efl::ui::Button btn(instantiate, win); - btn.text_set("Good-Bye, World!"); - btn.eo_cxx::efl::Gfx::size_set({120, 30}); - btn.eo_cxx::efl::Gfx::position_set({60, 15}); - btn.visible_set(true); + auto box = efl::ui::Box(instantiate, win); + win.content_set(box); + + auto bt = efl::ui::Button(instantiate, win); + bt.text_set("Hello world!"); + box.pack(bt); - auto on_click = std::bind([] () { elm_exit(); }); + auto wbt = bt._get_wref(); + auto cb = std::bind([wbt]() { +std::cout << wbt->text_get() << std::endl; + }); + efl::eolian::event_add(efl::ui::Clickable::clicked_event, bt, cb); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn, on_click); + auto bt2 = efl::ui::Button(instantiate, win); + bt2.text_set("Click to quit"); + box.pack(bt2); - win.eo_cxx::efl::Gfx::size_set({240, 60}); - win.visible_set(true); + auto wwin = win._get_wref(); + auto cb2 = std::bind([wwin]() { +::efl_del(wwin->_eo_ptr()); // FIXME: No proper C++ API to delete win + }); + efl::eolian::event_add(efl::ui::Clickable::clicked_event, bt2, cb2); - elm_run(); - return 0; + win.size_set({320,160}); } -ELM_MAIN() +EFL_MAIN() --
[EGIT] [core/efl] master 03/19: cxx: Fix a few examples
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9c9278cd458422b73a3016ba056c0267d3d65bfb commit 9c9278cd458422b73a3016ba056c0267d3d65bfb Author: Jean-Philippe AndreDate: Wed Nov 1 22:42:04 2017 +0900 cxx: Fix a few examples - Calendar: Some examples can't be ported. Not good. - Toolbar: Needs the new API to be completed. - Clock: Crashes at runtime. Ping @felipealmeida --- src/examples/elementary/calendar_cxx_example_01.cc | 27 --- src/examples/elementary/calendar_cxx_example_02.cc | 51 +++-- src/examples/elementary/calendar_cxx_example_03.cc | 34 ++ src/examples/elementary/calendar_cxx_example_04.cc | 35 ++ src/examples/elementary/calendar_cxx_example_05.cc | 15 +++--- src/examples/elementary/clock_cxx_example.cc | 53 +++--- src/examples/elementary/toolbar_cxx_example_01.cc | 7 ++- src/lib/elementary/efl_ui_calendar.eo | 2 - 8 files changed, 94 insertions(+), 130 deletions(-) diff --git a/src/examples/elementary/calendar_cxx_example_01.cc b/src/examples/elementary/calendar_cxx_example_01.cc index 89e0de873e..4e24fff699 100644 --- a/src/examples/elementary/calendar_cxx_example_01.cc +++ b/src/examples/elementary/calendar_cxx_example_01.cc @@ -5,27 +5,20 @@ #include -EAPI_MAIN int -elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) +using efl::eo::instantiate; + +static void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); - using efl::eo::instantiate; - - efl::ui::Win win(instantiate); - //win.title_set("Calendar Creation Example"); + auto win = efl::ui::Win(instantiate); + win.text_set("Calendar Creation Example"); win.autohide_set(true); - ::elm::Calendar cal(instantiate, win); - //cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - cal.eo_cxx::efl::Gfx::size_set({134,134}); - //win.resize_object_add(cal); - cal.visible_set(true); - - win.eo_cxx::efl::Gfx::size_set({134,134}); - win.visible_set(true); + auto cal = efl::ui::Calendar(instantiate, win); + win.content_set(cal); - elm_run(); - return 0; + win.size_set({320,320}); } -ELM_MAIN() +EFL_MAIN() diff --git a/src/examples/elementary/calendar_cxx_example_02.cc b/src/examples/elementary/calendar_cxx_example_02.cc index ebc095de2a..6027b1658d 100644 --- a/src/examples/elementary/calendar_cxx_example_02.cc +++ b/src/examples/elementary/calendar_cxx_example_02.cc @@ -6,38 +6,41 @@ #include #include -static char * -_format_month_year(struct tm *format_time) +using efl::eo::instantiate; + +// FIXME: Function callbacks need a lot of love in C++ +static void +_format_cb(void *data EINA_UNUSED, Eina_Strbuf *str, const Eina_Value value) { - char buf[32]; - if (!strftime(buf, sizeof(buf), "%b %y", format_time)) return NULL; - return strdup(buf); + if (::eina_value_type_get() != ::EINA_VALUE_TYPE_TM) + { +// FIXME: val.to_string() +char *convert = ::eina_value_to_string(); +eina_strbuf_append(str, convert); +free(convert); + } + else + { +struct tm time; +eina_value_get(, ); +eina_strbuf_append_strftime(str, "%b. %y", ); + } } -EAPI_MAIN int -elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) +static void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); - using efl::eo::instantiate; - efl::ui::Win win(instantiate); - //win.title_set("Calendar Layout Formatting Example"); + win.text_set("Calendar Layout Formatting Example"); win.autohide_set(true); - ::elm::Calendar cal(instantiate, win); - //cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - //win.resize_object_add(cal); - - cal.format_function_set(_format_month_year); - // cal.weekdays_names_set(weekdays); - - cal.eo_cxx::efl::Gfx::size_set({125,134}); - win.eo_cxx::efl::Gfx::size_set({125,134}); - cal.visible_set(true); - win.visible_set(true); + auto cal = efl::ui::Calendar(instantiate, win); + win.content_set(cal); - elm_run(); - return 0; + // FIXME: Function cb doesn't work (C++ variant) + cal.format_cb_set(_format_cb); + ::efl_ui_format_cb_set(cal._eo_ptr(), NULL, _format_cb, NULL); } -ELM_MAIN() +EFL_MAIN() diff --git a/src/examples/elementary/calendar_cxx_example_03.cc b/src/examples/elementary/calendar_cxx_example_03.cc index 672e6319f9..c780987f48 100644 --- a/src/examples/elementary/calendar_cxx_example_03.cc +++ b/src/examples/elementary/calendar_cxx_example_03.cc @@ -5,35 +5,27 @@ #include -EAPI_MAIN int -elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) +using efl::eo::instantiate; + +static void +efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { -
[EGIT] [core/efl] master 04/19: cxx: Completely rewrite box example
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0d1a2db61756cdf361d63869ab1309b7bb91f289 commit 0d1a2db61756cdf361d63869ab1309b7bb91f289 Author: Jean-Philippe AndreDate: Thu Nov 2 12:13:53 2017 +0900 cxx: Completely rewrite box example This was showing off box transitions, which don't exist in EO API. --- src/examples/elementary/box_cxx_example_02.cc | 142 +++--- 1 file changed, 14 insertions(+), 128 deletions(-) diff --git a/src/examples/elementary/box_cxx_example_02.cc b/src/examples/elementary/box_cxx_example_02.cc index bc81fcf2f0..99b257591a 100644 --- a/src/examples/elementary/box_cxx_example_02.cc +++ b/src/examples/elementary/box_cxx_example_02.cc @@ -1,142 +1,28 @@ -//Compile with: -//gcc -g box_example_02.c -o box_example_02 `pkg-config --cflags --libs elementary` +// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` box_cxx_example_02.cc -o box_cxx_example_02 #include -#include -#include -#include - -struct Transitions_Data -{ - efl::eo::wref box; - std::deque transitions; - Evas_Object_Box_Layout last_layout; -}; +using efl::eo::instantiate; static void -_test_box_transition_change(void *data) -{ - Transitions_Data *tdata = static_cast (data); - Elm_Box_Transition *layout_data; - Evas_Object_Box_Layout next_layout; - - assert (!!data); - assert (!tdata->transitions.empty()); - - if(efl::eina::optional box = tdata->box.lock()) - { -next_layout = tdata->transitions.front(); -layout_data = elm_box_transition_new(2.0, tdata->transitions.back(), - nullptr, nullptr, next_layout, nullptr, nullptr, - _test_box_transition_change, tdata); -box->layout_set(elm_box_layout_transition, layout_data, -elm_box_transition_free); -tdata->last_layout = next_layout; - -tdata->transitions.push_back(tdata->transitions[0]); -tdata->transitions.pop_front(); - } -} - -EAPI_MAIN int -elm_main(int argc, char *argv[]) +efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); - Transitions_Data tdata; - - ::elm::win::Standard win; - win.title_set("Box Transition"); + auto win = efl::ui::Win(instantiate); + win.text_set("Simple Box Example"); win.autohide_set(true); - elm::Ui::Box bigbox ( efl::eo::parent = win ); - bigbox.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - //win.resize_object_add(bigbox); - bigbox.visible_set(true); + auto box = efl::ui::Box(instantiate, win); + win.content_set(box); - elm::ui::Box buttons ( efl::eo::parent = win ); - //buttons.horizontal_set(true); - bigbox.pack_end(buttons); - buttons.visible_set(true); - - elm::Button add ( efl::eo::parent = win ); - add.text_set("elm.text", "Add"); - buttons.pack_end(add); - add.visible_set(true); - add.callback_clicked_add - (std::bind([] - { - if(efl::eina::optional box = tdata.box.lock()) - { -elm::button btn ( efl::eo::parent = *box ); -btn.text_set(nullptr, "I do nothing"); -box->pack_end(btn); -btn.visible_set(true); - } - })); - - elm::Button clear ( efl::eo::parent = win ); - clear.text_set("elm.text", "Clear"); - buttons.pack_end(clear); - clear.visible_set(true); - clear.callback_clicked_add(std::bind([] { tdata.box.lock()->clear(); })); - - elm::Box dynamic ( efl::eo::parent = win ); - dynamic.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - dynamic.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); - bigbox.pack_end(dynamic); - dynamic.visible_set(true); - - auto unpack = std::bind([] (evas::clickable_interface obj) + for (int i = 0; i < 5; i++) { - elm::Button btn = efl::eo::downcast(obj); -tdata.box.lock()->unpack(btn); -btn.position_set(0, 50); -btn.object_smart::color_set(128, 64, 0, 128); - }, std::placeholders::_1) - ; - - elm::Button bt1 ( efl::eo::parent = win ); - bt1.text_set("elm.text", "Button 1"); - bt1.callback_clicked_add(unpack); - bt1.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - bt1.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); - dynamic.pack_end(bt1); - bt1.visible_set(true); - - elm::Button bt2 ( efl::eo::parent = win ); - bt2.text_set("elm.text", "Button 2"); - bt2.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0); - bt2.size_hint_align_set(1.0, 0.5); - bt2.callback_clicked_add(unpack); - dynamic.pack_end(bt2); - bt2.visible_set(true); - - elm::Button bt3 ( efl::eo::parent = win ); - bt3.text_set("elm.text", "Button 3"); - bt3.callback_clicked_add(unpack); - dynamic.pack_end(bt3); -
[EGIT] [core/efl] master 06/19: cxx: Mark wref::lock as const
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=88e10da36b00291b399c2d9bfe5f266a44a40f6f commit 88e10da36b00291b399c2d9bfe5f266a44a40f6f Author: Jean-Philippe AndreDate: Thu Nov 2 17:59:17 2017 +0900 cxx: Mark wref::lock as const This allows passing in wref to a lambda. If we passed normal refs, we would end up with dangling references and many ERR messages. --- src/bindings/cxx/eo_cxx/eo_wref.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/cxx/eo_cxx/eo_wref.hh b/src/bindings/cxx/eo_cxx/eo_wref.hh index 048ffcaa0f..e0f9c7bf82 100644 --- a/src/bindings/cxx/eo_cxx/eo_wref.hh +++ b/src/bindings/cxx/eo_cxx/eo_wref.hh @@ -79,7 +79,7 @@ struct wref /// strong reference to the EO Object. Otherwise it returns /// an empty eina::optional. /// - eina::optional lock() + eina::optional lock() const { if(_eo_wref) // XXX eo_ref() should work on multi-threaded environments { --
[EGIT] [core/efl] master 05/19: cxx: Add nullptr constructor for weak refs
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c991b104ce23152eeab7132bee3c3ae78fef4c4 commit 8c991b104ce23152eeab7132bee3c3ae78fef4c4 Author: Jean-Philippe AndreDate: Thu Nov 2 14:26:59 2017 +0900 cxx: Add nullptr constructor for weak refs This allows constructs such as: wref_obj = obj; ... wref_obj = nullptr; --- src/bindings/cxx/eo_cxx/eo_wref.hh | 8 1 file changed, 8 insertions(+) diff --git a/src/bindings/cxx/eo_cxx/eo_wref.hh b/src/bindings/cxx/eo_cxx/eo_wref.hh index fc32e47616..048ffcaa0f 100644 --- a/src/bindings/cxx/eo_cxx/eo_wref.hh +++ b/src/bindings/cxx/eo_cxx/eo_wref.hh @@ -27,6 +27,14 @@ struct wref wref() : _eo_wref(nullptr) { } + + /// @brief Empty constructor on nullptr. + /// + /// Create a empty weak reference. + /// + wref(std::nullptr_t) : _eo_wref(nullptr) + { + } /// @brief Class constructor. /// --
[EGIT] [core/efl] master 16/19: cxx: Fix log color in eina_log.hh
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=58527a3dbb450cb4e02875b91394e601e8351594 commit 58527a3dbb450cb4e02875b91394e601e8351594 Author: Jean-Philippe AndreDate: Mon Nov 6 15:23:20 2017 +0900 cxx: Fix log color in eina_log.hh Changed from invalid "black" to arbitrary choice of green. --- src/bindings/cxx/eina_cxx/eina_log.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/cxx/eina_cxx/eina_log.hh b/src/bindings/cxx/eina_cxx/eina_log.hh index 5ec07446ea..1567485fdb 100644 --- a/src/bindings/cxx/eina_cxx/eina_log.hh +++ b/src/bindings/cxx/eina_cxx/eina_log.hh @@ -147,7 +147,7 @@ struct log_domain : _domain_base * @param name Name of the domain. * @param color Color of the domain name. */ - log_domain(char const* name, char const* color = "black") + log_domain(char const* name, char const* color = EINA_COLOR_GREEN) : _domain( (::eina_init(), ::eina_log_domain_register(name, color)) ) { } --
[EGIT] [core/efl] master 15/19: elm: Fix examples/tests using elementary_config
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ccc3efd77d82db9aef6d6c19d21ec8a5d69ca994 commit ccc3efd77d82db9aef6d6c19d21ec8a5d69ca994 Author: Jean-Philippe AndreDate: Mon Nov 6 15:12:21 2017 +0900 elm: Fix examples/tests using elementary_config elementary_config.h should not even exist. It's been hijacked as a private header for elementary, but all "real" configuration is stored in efl's main config.h now. --- src/lib/elementary/elementary_config.h | 3 +++ src/tests/elementary/elm_code_test_widget.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elementary_config.h b/src/lib/elementary/elementary_config.h index 459ebd0213..788b02530e 100644 --- a/src/lib/elementary/elementary_config.h +++ b/src/lib/elementary/elementary_config.h @@ -8,6 +8,8 @@ */ #define ELM_CONFIG_ICON_THEME_ELEMENTARY "_Elementary_Icon_Theme" + +#if defined(ELEMENTARY_BUILD) || defined(ELM_INTERNAL_API_ARGESFSDFEFC) #define ELM_WIDGET_PROTECTED #define ELM_WIDGET_BETA #define EFL_CANVAS_OBJECT_PROTECTED @@ -22,3 +24,4 @@ #define EFL_ACCESS_SELECTION_BETA #define EFL_ACCESS_TEXT_BETA #define EFL_ACCESS_VALUE_BETA +#endif diff --git a/src/tests/elementary/elm_code_test_widget.c b/src/tests/elementary/elm_code_test_widget.c index 6195b5cf45..3a5860aeb0 100644 --- a/src/tests/elementary/elm_code_test_widget.c +++ b/src/tests/elementary/elm_code_test_widget.c @@ -1,9 +1,9 @@ +#define ELM_INTERNAL_API_ARGESFSDFEFC + #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif -#define ELM_INTERNAL_API_ARGESFSDFEFC - #include "elm_suite.h" #include "Elementary.h" --
[EGIT] [core/efl] master 19/19: evas: Add some crash prevention checks
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=066f2c5cb75b940d8c972d7eeaa8e08287c65b20 commit 066f2c5cb75b940d8c972d7eeaa8e08287c65b20 Author: Jean-Philippe AndreDate: Mon Nov 6 16:36:23 2017 +0900 evas: Add some crash prevention checks This could happen if objects still have references while evas is being shut down (a bad situation). --- src/lib/evas/canvas/evas_object_main.c | 12 1 file changed, 12 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 57f8dd7bc7..bb6eee1014 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -1607,6 +1607,7 @@ EAPI void evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode) { Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); + EVAS_OBJECT_DATA_ALIVE_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) @@ -1634,6 +1635,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Ob { if (obj->delete_me) return; + + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) { @@ -1674,6 +1677,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_max_set(Eo *eo_obj, Evas_Object_Protec if (obj->delete_me) return; + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) { @@ -1737,6 +1741,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protec if (obj->delete_me) return; + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) { @@ -1772,6 +1777,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Pro if (obj->delete_me) return; + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) { @@ -1805,6 +1811,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Prot { if (obj->delete_me) return; + + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (!obj->legacy.align_set) obj->legacy.align_set = 1; if (EINA_UNLIKELY(!obj->size_hints)) @@ -1839,6 +1847,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Pro { if (obj->delete_me) return; + + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (!obj->legacy.weight_set) obj->legacy.weight_set = 1; if (EINA_UNLIKELY(!obj->size_hints)) @@ -1877,6 +1887,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Pro { if (obj->delete_me) return; + + EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); if (EINA_UNLIKELY(!obj->size_hints)) { --
[EGIT] [core/efl] master 12/19: cxx: Fix binding temporarily (efl/interfaces)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5f5325ea333a5ea6caa55ce5d7aa702ee6b689a1 commit 5f5325ea333a5ea6caa55ce5d7aa702ee6b689a1 Author: Jean-Philippe AndreDate: Mon Nov 6 14:22:33 2017 +0900 cxx: Fix binding temporarily (efl/interfaces) This uses the new cref keyword instead of inout, as the c++ code has no access to the internals of struct Efl.Text.Cursor.Cursor Something tells me cref may not be the perfect solution here (we lose information on whether this is in, out or inout). --- src/lib/efl/interfaces/efl_text_cursor.eo | 70 +++ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo index 243a2f1045..448028b1b9 100644 --- a/src/lib/efl/interfaces/efl_text_cursor.eo +++ b/src/lib/efl/interfaces/efl_text_cursor.eo @@ -43,7 +43,7 @@ interface Efl.Text.Cursor { } } @property cursor_position { -[[Cursor position]] + [[Cursor position]] set { legacy: null; } get { legacy: null; } values { @@ -94,19 +94,19 @@ interface Efl.Text.Cursor { } } cursor_new { -[[Create new cursor]] + [[Create new cursor]] legacy: null; return: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } cursor_free { -[[Free existing cursor]] + [[Free existing cursor]] legacy: null; params { cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_equal { -[[Check if two cursors are equal]] + [[Check if two cursors are equal]] legacy: null; params { @cref cur1: Efl.Text.Cursor.Cursor; [[Cursor 1 object]] @@ -115,7 +115,7 @@ interface Efl.Text.Cursor { return: bool; [[$true if cursors are equal, $false otherwise]] } cursor_compare { -[[Compare two cursors]] + [[Compare two cursors]] legacy: null; params { @cref cur1: Efl.Text.Cursor.Cursor; [[Cursor 1 object]] @@ -124,110 +124,110 @@ interface Efl.Text.Cursor { return: int; [[Difference between cursors]] } cursor_copy { -[[Copy existing cursor]] + [[Copy existing cursor]] legacy: null; params { -@out dst: Efl.Text.Cursor.Cursor; [[Destination cursor]] +/* @out */ dst: ptr(Efl.Text.Cursor.Cursor); [[Destination cursor]] @cref src: Efl.Text.Cursor.Cursor; [[Source cursor]] } } cursor_char_next { -[[Advances to the next character]] + [[Advances to the next character]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_char_prev { -[[Advances to the previous character]] + [[Advances to the previous character]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_paragraph_char_first { -[[Advances to the first character in this paragraph]] + [[Advances to the first character in this paragraph]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_paragraph_char_last { -[[Advances to the last character in this paragraph]] + [[Advances to the last character in this paragraph]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_word_start { -[[Advance to current word start]] + [[Advance to current word start]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_word_end { -[[Advance to current word end]] + [[Advance to current word end]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor; [[Cursor object]] +/* @inout */ cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } cursor_line_char_first { -[[Advance to current line first character]] + [[Advance to current line first character]] legacy: null; params { -@inout cur: Efl.Text.Cursor.Cursor;
[EGIT] [core/efl] master 17/19: cxx: (Temporary) fix for make check
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c5d618e851eb3f7bc1677238427188ef7fdb531f commit c5d618e851eb3f7bc1677238427188ef7fdb531f Author: Jean-Philippe AndreDate: Mon Nov 6 15:55:54 2017 +0900 cxx: (Temporary) fix for make check This fixes the C++ compilation tests. list is not allowed by eolian anymore, as the semantics were unclear whether a pointer to int was passed, or if the int was stuffed inside the list by casting. ptr(string) is also not allowed as it's a pointer to a pointer type. Both of the above types are strange when it comes to bindings. While C++ could probably be made to work, it's not clear we could have such types in other bindings. Those types are in fact likely not so useful, as most APIs can be designed around those restrictions. --- src/tests/eolian_cxx/complex.eo| 55 +++--- src/tests/eolian_cxx/complex_cxx.cc| 20 src/tests/eolian_cxx/eolian_cxx_test_binding.cc| 2 +- src/tests/eolian_cxx/generic.eo| 4 +- .../eolian_cxx/name1_name2_type_generation.eo | 16 --- 5 files changed, 40 insertions(+), 57 deletions(-) diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index b9442a2ef1..e4400ddb93 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo @@ -5,7 +5,7 @@ class Complex (Efl.Object) // container test inptrcont { params { - l: list; + l: list ; } } inclasscont { @@ -15,22 +15,22 @@ class Complex (Efl.Object) } incontcont { params { - l: list ; + l: list
>; } } incontcontown { params { - l: list
@owned; + l: list
> @owned; } } incontowncontown { params { - l: list
@owned; + l: list
@owned> @owned; } } incontowncont { params { - l: list
; + l: list
@owned>; } } instringcont { @@ -50,42 +50,42 @@ class Complex (Efl.Object) } inarray { params { - l: array; + l: array
; } } inarrayown { params { - l: array @owned; + l: array @owned; } } inhash { params { - l: hash ; + l: hash ; } } inhashown { params { - l: hash @owned; + l: hash @owned; } } initerator { params { - l: iterator; + l: iterator ; } } initeratorown { params { - l: iterator @owned; + l: iterator @owned; } } inaccessor { params { - l: accessor; + l: accessor ; } } inaccessorown { params { - l: accessor @owned; + l: accessor @owned; } } // out @@ -96,22 +96,22 @@ class Complex (Efl.Object) } outcontcont { params { - @out l: list ; + @out l: list
>; } } outcontcontown { params { - @out l: list
@owned; + @out l: list
> @owned; } } outcontowncontown { params { - @out l: list
@owned; + @out l: list
@owned> @owned; } } outcontowncont { params { - @out l: list
; + @out l: list
@owned>; } } outstringcont { @@ -131,52 +131,51 @@ class Complex (Efl.Object) } outarray { params { - @out l: array; + @out l: array
; } } outarrayown { params { - @out l: array @owned; + @out l: array @owned; } } outhash { params { - @out l: hash ; + @out l: hash ; } } outhashown { params { - @out l: hash @owned; + @out l: hash @owned; } } outiterator { params { - @out l: iterator; + @out l: iterator ; } } outiteratorown { params { - @out l: iterator @owned; + @out l: iterator @owned; } }
[EGIT] [core/efl] master 08/19: cxx: Add experimental "easy" way to use wref
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e7009b77a235ece2bbcba24c4fc6e2b719a2ab8d commit e7009b77a235ece2bbcba24c4fc6e2b719a2ab8d Author: Jean-Philippe AndreDate: Thu Nov 2 18:39:47 2017 +0900 cxx: Add experimental "easy" way to use wref I hid it behind ifdef for now as I'm very much unsure of what I'm doing. This whole modern C++ thing is still weird to me :) Prerequisite: #define EFL_CXX_WREF_EASY This allows constructs such as: auto wobj = obj._get_wref(); std::cout << wobj->text_get() << std::endl; --- src/bindings/cxx/eo_cxx/eo_wref.hh | 12 src/lib/eolian_cxx/grammar/class_definition.hpp | 7 +++ 2 files changed, 19 insertions(+) diff --git a/src/bindings/cxx/eo_cxx/eo_wref.hh b/src/bindings/cxx/eo_cxx/eo_wref.hh index e0f9c7bf82..124b1da3b7 100644 --- a/src/bindings/cxx/eo_cxx/eo_wref.hh +++ b/src/bindings/cxx/eo_cxx/eo_wref.hh @@ -123,6 +123,18 @@ struct wref return *this; } +#ifdef EFL_CXX_WREF_EASY + T operator->() const { + if (!_eo_wref) return T(nullptr); + return T(detail::ref(_eo_wref)); + } + + T operator*() const { + if (!_eo_wref) return T(nullptr); + return T(detail::ref(_eo_wref)); + } +#endif + private: void _add() { diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp index 320d806398..54df3301a6 100644 --- a/src/lib/eolian_cxx/grammar/class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/class_definition.hpp @@ -174,6 +174,13 @@ struct class_definition_generator "return ::efl::eo::wref<" << string << ">(*this); }\n" ).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false; + if(!as_generator("#ifdef EFL_CXX_WREF_EASY\n").generate(sink, attributes::unused, context)) return false; + if(!as_generator( scope_tab << "const " << string << "* operator->() const { return this; }\n" + ).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false; + if(!as_generator( scope_tab << string << "* operator->() { return this; }\n" + ).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false; + if(!as_generator("#endif \n").generate(sink, attributes::unused, context)) return false; + if(!as_generator( scope_tab << "::efl::eo::concrete const& _get_concrete() const { return *this; }\n" << scope_tab << "::efl::eo::concrete& _get_concrete() { return *this; }\n" ).generate(sink, attributes::unused, context)) return false; --
[EGIT] [core/efl] master 07/19: cxx: Add _get_wref() convenience to all classes
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=73ec85aeffc2eddfe81673344ed22bb21461aaa7 commit 73ec85aeffc2eddfe81673344ed22bb21461aaa7 Author: Jean-Philippe AndreDate: Thu Nov 2 18:14:59 2017 +0900 cxx: Add _get_wref() convenience to all classes This allows constructs like: auto w_obj = obj._get_wref(); auto cb = std::bind([w_obj]() { auto o = w_obj.lock(); if (!o) return; o->call(); }); event_add(..., obj, cb); Note: I don't like how those wref work. Close to c++ wref but far from EFL wref. --- src/lib/eolian_cxx/grammar/class_definition.hpp | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp index 15ef86d371..320d806398 100644 --- a/src/lib/eolian_cxx/grammar/class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/class_definition.hpp @@ -170,6 +170,10 @@ struct class_definition_generator // /// @endcond if(!as_generator(scope_tab << "/// @endcond\n").generate(sink, attributes::unused, context)) return false; + if(!as_generator( scope_tab << "::efl::eo::wref<" << string << "> _get_wref() const { " + "return ::efl::eo::wref<" << string << ">(*this); }\n" + ).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false; + if(!as_generator( scope_tab << "::efl::eo::concrete const& _get_concrete() const { return *this; }\n" << scope_tab << "::efl::eo::concrete& _get_concrete() { return *this; }\n" ).generate(sink, attributes::unused, context)) return false; --
[EGIT] [apps/terminology] master 01/01: meson: fix typo
billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=2a78d2fdcd6f3704411cae26583c2fa1768feb6b commit 2a78d2fdcd6f3704411cae26583c2fa1768feb6b Author: Boris FaureDate: Mon Nov 6 22:47:56 2017 +0100 meson: fix typo --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 88c10a3..e9d4451 100644 --- a/meson.build +++ b/meson.build @@ -111,7 +111,7 @@ endif message('Checking for ecore_con_url_head: ' + found) if cc.links(elementary_teamwork_code, dependencies: terminology_dependencies) - config_dat.set('HAVE_ELM_WIN_TEAMWORK', 1) + config_data.set('HAVE_ELM_WIN_TEAMWORK', 1) found = 'Found' else found = 'Not Found' --
[EGIT] [core/efl] master 01/01: docs: be better at a responsive layout when embedded
ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2dd1e59a4cf77d29232c8b592990eb6db9846657 commit 2dd1e59a4cf77d29232c8b592990eb6db9846657 Author: Andy WilliamsDate: Mon Nov 6 18:43:06 2017 + docs: be better at a responsive layout when embedded --- doc/e.css | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/e.css b/doc/e.css index 5ef60be835..46ae4f8579 100644 --- a/doc/e.css +++ b/doc/e.css @@ -84,7 +84,7 @@ div.qindex { } div.navpath { - width: 980px; + max-width: 980px; background-color: #606060; text-align: center; margin-left: auto; @@ -513,7 +513,7 @@ dl.reflist dd { } .directory td.entry { - width: 400px; + width: 50%; } .directory-alt { @@ -706,7 +706,7 @@ div.ingroups a { div.header, div.footer { margin-left: auto; margin-right: auto; - width: 980px; + max-width: 980px; } div.footer { @@ -723,7 +723,7 @@ div.footer span.copyright { div.contents { margin-left: auto; margin-right: auto; - width: 940px; + max-width: 940px; } #projectlogo { @@ -754,7 +754,6 @@ div.contents { #titlearea { box-shadow: 0px 3px 10px #00; - width: 780px; margin-left: auto; margin-right: auto; padding: 0px 10px 0px 10px; @@ -877,7 +876,7 @@ dl.citelist dd { padding: 5px 0px 5px 0px; text-align: center; box-shadow: 0px 3px 5px #00; - width: 980px; + max-width: 980px; z-index: 101; font-size: 9pt; } --
[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Andrew Williams
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=8bced9345713a8f4babe4b69908827ca749b8b23 commit 8bced9345713a8f4babe4b69908827ca749b8b23 Author: Andrew WilliamsDate: Mon Nov 6 10:40:21 2017 -0800 Wiki page start changed with summary [] by Andrew Williams --- pages/develop/legacy/api/c/start.txt | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pages/develop/legacy/api/c/start.txt b/pages/develop/legacy/api/c/start.txt index cb3067d8..cedf4149 100644 --- a/pages/develop/legacy/api/c/start.txt +++ b/pages/develop/legacy/api/c/start.txt @@ -1,18 +1,21 @@ -function size_to_content(iframe) { -var padded = iframe.contentWindow.document.body.scrollHeight + 45; -iframe.height = padded; -iframe.style.height = padded + 'px'; +function size_to_content(container, iframe) { +var padded = iframe.contentWindow.document.body.scrollHeight + 58; +container.height = padded; +container.style.height = padded + 'px'; } window.addEventListener('DOMContentLoaded', function(e) { var iframe = document.querySelectorAll("iframe")[0]; +var container = document.getElementById("embed-iframe"); iframe.addEventListener('load', function(e) { -size_to_content(iframe); +size_to_content(container, iframe); }, true); }, true); -{{url>/develop/legacy/api/c/embed/ noborder}} \ No newline at end of file + +{{url>/develop/legacy/api/c/embed/ 100%,100% noborder}} + \ No newline at end of file --
[EGIT] [core/efl] master 01/01: edje_pick: Fix segfault due to wrong memory free
conr2d pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7811b0e5b73fc3bd31071e1fad1c031d9b2ef138 commit 7811b0e5b73fc3bd31071e1fad1c031d9b2ef138 Author: Jeeyong UmDate: Tue Nov 7 00:34:32 2017 +0900 edje_pick: Fix segfault due to wrong memory free --- src/bin/edje/edje_pick.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bin/edje/edje_pick.c b/src/bin/edje/edje_pick.c index e6971b4c35..bc92297675 100644 --- a/src/bin/edje/edje_pick.c +++ b/src/bin/edje/edje_pick.c @@ -256,18 +256,18 @@ _edje_pick_cleanup(Eina_List *ifs, Edje_File *out_file, Edje_Pick_Status s) if (p->edf) _edje_cache_file_unref(p->edf); -free(p); - } +EINA_LIST_FREE(p->fontlist, ft) + { + Edje_Font *st = ft->f; - EINA_LIST_FREE(p->fontlist, ft) - { -Edje_Font *st = ft->f; + eina_stringshare_del(st->name); + eina_stringshare_del(st->file); + free(ft->data); + free(st); + free(ft); + } -eina_stringshare_del(st->name); -eina_stringshare_del(st->file); -free(ft->data); -free(st); -free(ft); +free(p); } switch (s) --
[EGIT] [website/www-content] master 01/01: Wiki page documentation-guide.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=852ab4d799929ad974bf65141bfac7de5d73f6e6 commit 852ab4d799929ad974bf65141bfac7de5d73f6e6 Author: Gareth HalfacreeDate: Mon Nov 6 07:45:51 2017 -0800 Wiki page documentation-guide.md changed with summary [] by Gareth Halfacree --- pages/contrib/docs/documentation-guide.md.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contrib/docs/documentation-guide.md.txt b/pages/contrib/docs/documentation-guide.md.txt index 7660f578..915736ee 100644 --- a/pages/contrib/docs/documentation-guide.md.txt +++ b/pages/contrib/docs/documentation-guide.md.txt @@ -73,7 +73,7 @@ List of URLs to pages with additional information; these can be follow-on topics The DokuWiki preface requires the page title formatted as ``~~Title: Enter Title Here~~``. This should be located at the very start of the document, between a line containing nothing but three dash characters (-) and a line containing another three dash characters. Leave a blank line after this, then begin your PHP Markdown Extra on Line 4. -A blank line should be present between headings, paragraphs, code blocks, and any other part of the document. Headings and sub-headings should be written in Title Case. +A blank line should be present between headings, paragraphs, code blocks, and any other part of the document. Headings and sub-headings should be written in Title Case, and should use the terminated form of Markdown's header format: ``## Heading ##`` rather than ``## Heading``. Do not insert hard line breaks as you reach column 80 or the edge of your text editor window; allow your text editor to wrap longer lines for ease of display, but ensure that they are saved without linebreaks before submitting a document or edit. --
[EGIT] [core/efl] master 03/03: evas-object-main: Fix potential null dereference
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=12947e01e89efc2a1e5fb4e044e798955f59af13 commit 12947e01e89efc2a1e5fb4e044e798955f59af13 Author: Chris MichaelDate: Mon Nov 6 10:17:29 2017 -0500 evas-object-main: Fix potential null dereference Coverity reports that EVAS_OBJECT_DATA_SAFE_GET returns NULL here (184 out of 188 times). As such, we should not be calling _event_animation_object_get with a null object so add a null check here. Fixes Coverity CID1381713 @fix Signed-off-by: Chris Michael --- src/lib/evas/canvas/evas_object_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index dce4954e08..57f8dd7bc7 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -2829,6 +2829,8 @@ _efl_canvas_object_event_animation_is_running(Eo *eo_obj, { Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); + if (!obj) return EINA_FALSE; + if (_event_animation_object_get(obj, desc)) return EINA_TRUE; --
[EGIT] [core/efl] master 02/03: evas-object-main: Fix null dereference
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6c76fdb8245fb6dc4226cb7b0707aa93f1d9422a commit 6c76fdb8245fb6dc4226cb7b0707aa93f1d9422a Author: Chris MichaelDate: Mon Nov 6 10:13:08 2017 -0500 evas-object-main: Fix null dereference Coverity reports that EVAS_OBJECT_DATA_SAFE_GET returns NULL here (184 out of 188 times). The _all_animation_objects_cancel function directly dereferences the obj parameter passed into it, so lets null check it before calling that function. Fixes Coverity CID1381711 @fix Signed-off-by: Chris Michael --- src/lib/evas/canvas/evas_object_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 4ed5888cd5..dce4954e08 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -2840,7 +2840,7 @@ _efl_canvas_object_event_animation_cancel(Eo *eo_obj) { Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); - _all_animation_objects_cancel(obj); + if (obj) _all_animation_objects_cancel(obj); } --
[EGIT] [core/efl] master 01/03: evas-object-main: Fix null dereference
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=04d1fe7299f73376902ec3d28e5568ed52e9b374 commit 04d1fe7299f73376902ec3d28e5568ed52e9b374 Author: Chris MichaelDate: Mon Nov 6 10:10:50 2017 -0500 evas-object-main: Fix null dereference Coverity reports that EVAS_OBJECT_DATA_SAFE_GET returns NULL here (184 out of 188 times). The _all_animation_objects_cancel function directly dereferences the obj parameter passed into it, so lets null check it before calling that function. Fixes Coverity CID1381710 @fix Signed-off-by: Chris Michael --- src/lib/evas/canvas/evas_object_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 65b1817b4a..4ed5888cd5 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -209,7 +209,7 @@ _animation_intercept_hide(void *data, Evas_Object *eo_obj) { event_anim->hide_anim_started = EINA_TRUE; -_all_animation_objects_cancel(obj); +if (obj) _all_animation_objects_cancel(obj); //Create animation object to start animation event_anim->anim_obj = efl_animation_object_create(event_anim->anim); --
[EGIT] [core/efl] master 01/01: emotion: Fix data race condition
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=01920b996ad0ab14c454e0aa9e7a876408b6ed62 commit 01920b996ad0ab14c454e0aa9e7a876408b6ed62 Author: Chris MichaelDate: Mon Nov 6 10:07:48 2017 -0500 emotion: Fix data race condition Coverity reports that we access vfmapped here without holding a lock. This patch implements eina_lock_take/release while accessing priv->vfmapped. Fixes Coverity CID1381624 @fix Signed-off-by: Chris Michael --- src/modules/emotion/gstreamer1/emotion_sink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/emotion/gstreamer1/emotion_sink.c b/src/modules/emotion/gstreamer1/emotion_sink.c index 6f2e4af49a..5816628a56 100644 --- a/src/modules/emotion/gstreamer1/emotion_sink.c +++ b/src/modules/emotion/gstreamer1/emotion_sink.c @@ -137,6 +137,7 @@ emotion_video_sink_dispose(GObject* object) sink = EMOTION_VIDEO_SINK(object); priv = sink->priv; + eina_lock_take(>m); if (priv->vfmapped) { if (priv->evas_object) @@ -166,6 +167,7 @@ emotion_video_sink_dispose(GObject* object) priv->last_buffer = NULL; } + eina_lock_release(>m); eina_lock_free(>m); eina_condition_free(>c); --
[EGIT] [core/efl] master 01/01: evas-wayland-shm: Do not dereference a potentially freed pointer
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fd79e32dbd004ebe71ef6d090fe8ad7ecfdb7b12 commit fd79e32dbd004ebe71ef6d090fe8ad7ecfdb7b12 Author: Chris MichaelDate: Mon Nov 6 10:02:35 2017 -0500 evas-wayland-shm: Do not dereference a potentially freed pointer Coverity reports that _evas_dmabuf_buffer_init function here can potentially free the surface that was passed into it. If that happens, we should not be calling the _fallback function with surface as the parameter as that will directly dereference the freed pointer. Fixes Coverity CID1381707 @fix Signed-off-by: Chris Michael --- src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c index 85ccc2a5e8..b3446b03fe 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c @@ -519,7 +519,7 @@ _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_U buf = _evas_dmabuf_buffer_init(surface, w, h); if (!buf) { - _fallback(surface, w, h); + if (surface) _fallback(surface, w, h); s->surf.dmabuf = NULL; return; } --
[EGIT] [website/www-content] master 01/01: Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=711e8c6096e45fa2b1705ec7ade11934ee8bc2da commit 711e8c6096e45fa2b1705ec7ade11934ee8bc2da Author: Gareth HalfacreeDate: Mon Nov 6 07:00:06 2017 -0800 Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/coding-conventions.md.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contrib/devs/coding-conventions.md.txt b/pages/contrib/devs/coding-conventions.md.txt index 2b35a525..07373185 100644 --- a/pages/contrib/devs/coding-conventions.md.txt +++ b/pages/contrib/devs/coding-conventions.md.txt @@ -1,5 +1,5 @@ --- -~~Title: Coding Conventions~~~ +~~Title: Coding Conventions~~ ~~NOCACHE~~ --- --
[EGIT] [website/www-content] master 01/01: Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=05fa4edaf38de28f41fcdd6235f0002fb9a5ca81 commit 05fa4edaf38de28f41fcdd6235f0002fb9a5ca81 Author: Gareth HalfacreeDate: Mon Nov 6 06:59:48 2017 -0800 Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/coding-conventions.md.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/contrib/devs/coding-conventions.md.txt b/pages/contrib/devs/coding-conventions.md.txt index 2505898f..2b35a525 100644 --- a/pages/contrib/devs/coding-conventions.md.txt +++ b/pages/contrib/devs/coding-conventions.md.txt @@ -34,8 +34,8 @@ When writing code, adhere to the following: * **Properly mark pointer ``const``** - This applies to getters or when it should not be modified, in both arguments and the return. * **Short names to indicate a narrow scope** - ``o`` for object, ``x/y/w/h`` for geometry, ``r/g/b/a`` for colors and so forth. * **Optional use of an underscore to prefix local/private symbols** -* **Single-line function forward declaration/prototype** -* **Function definition should have the return at one line then the function name starts at the next line, column 0** +* **Use a single line for a function's forward declaration or prototype** +* **Function definitions should have the return at one line then the function name starting at the next line, column 0** * **Put spaces before/after numerical operators** - e.g. ``+``, ``-``, ``/`` and ``*``. * **1 space after a comma** - e.g. ``evas_object_color_set(obj, 255, 255, 255, 255)``. --
[EGIT] [website/www-content] master 01/01: Wiki page docs changed with summary [] by Andrew Williams
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=8a2dfbec5ccbc70218a822638883dcca3d0a3282 commit 8a2dfbec5ccbc70218a822638883dcca3d0a3282 Author: Andrew WilliamsDate: Mon Nov 6 07:00:31 2017 -0800 Wiki page docs changed with summary [] by Andrew Williams --- pages/docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs.txt b/pages/docs.txt index 460d9a49..cdd6d3b7 100755 --- a/pages/docs.txt +++ b/pages/docs.txt @@ -116,7 +116,7 @@ From there you can get to know the team, how we work, and earn a place on the te === Coding === - * [[https://phab.enlightenment.org/w/ecoding/|EFL Coding Style]] + * [[/contrib/devs/coding-conventions|EFL Coding Style]] * [[/contrib/devs/git-guide|Git Practices]] --
[EGIT] [website/www-content] master 01/01: Wiki page arcanist-guide.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=0e31a0d35e689ce43290211fa811cbce6e7827e5 commit 0e31a0d35e689ce43290211fa811cbce6e7827e5 Author: Gareth HalfacreeDate: Mon Nov 6 06:54:11 2017 -0800 Wiki page arcanist-guide.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/arcanist-guide.md.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contrib/devs/arcanist-guide.md.txt b/pages/contrib/devs/arcanist-guide.md.txt index 5569164c..2a2aadb9 100644 --- a/pages/contrib/devs/arcanist-guide.md.txt +++ b/pages/contrib/devs/arcanist-guide.md.txt @@ -19,7 +19,7 @@ Arcanist requires a local installation of PHP version 5.0 or higher, the ``php-c sudo apt install php-cli php-curl php-json git ``` -You should also have read the [Coding Conventions guide](https://www.enlightenment.org/contrib/devs/coding-conventions.md) [Git Best Practices guide](git-guide.md) before submitting any patches. +You should also have read the [Coding Conventions guide](https://www.enlightenment.org/contrib/devs/coding-conventions.md) and the [Git Best Practices guide](git-guide.md) before submitting any patches. ## Installing Arcanist ## --
[EGIT] [website/www-content] master 01/01: Wiki page arcanist-guide.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=81e55bc6d75c80937868585915c715dc81b9c73b commit 81e55bc6d75c80937868585915c715dc81b9c73b Author: Gareth HalfacreeDate: Mon Nov 6 06:53:27 2017 -0800 Wiki page arcanist-guide.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/arcanist-guide.md.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/contrib/devs/arcanist-guide.md.txt b/pages/contrib/devs/arcanist-guide.md.txt index 0abe00d0..5569164c 100644 --- a/pages/contrib/devs/arcanist-guide.md.txt +++ b/pages/contrib/devs/arcanist-guide.md.txt @@ -19,7 +19,7 @@ Arcanist requires a local installation of PHP version 5.0 or higher, the ``php-c sudo apt install php-cli php-curl php-json git ``` -You should also have read the [Git Best Practices guide](git-guide.md) before submitting any patches. +You should also have read the [Coding Conventions guide](https://www.enlightenment.org/contrib/devs/coding-conventions.md) [Git Best Practices guide](git-guide.md) before submitting any patches. ## Installing Arcanist ## @@ -204,6 +204,9 @@ arc install-certificates [Arcanist User Guide](https://secure.phabricator.com/book/phabricator/article/arcanist/) :The official user guide for the Arcanist interface. +[Coding Conventions](https://www.enlightenment.org/contrib/devs/coding-conventions.md) +:Rules to which code submitted to the Enlightenment Project should adhere. + [Git Best Practices](git-guide.md) :The Enlightenment guide to best practices with git. --
[EGIT] [website/www-content] master 01/01: Wiki page git-guide.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=7b753e3e3c39eb1ef64b763d9b25ff96498b3da8 commit 7b753e3e3c39eb1ef64b763d9b25ff96498b3da8 Author: Gareth HalfacreeDate: Mon Nov 6 06:51:12 2017 -0800 Wiki page git-guide.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/git-guide.md.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contrib/devs/git-guide.md.txt b/pages/contrib/devs/git-guide.md.txt index a3597f0f..bdd1a009 100644 --- a/pages/contrib/devs/git-guide.md.txt +++ b/pages/contrib/devs/git-guide.md.txt @@ -314,5 +314,5 @@ This alias tells you what commits you're about to push and asks for confirmation [wiki.videolan.org/Git](https://wiki.videolan.org/Git) :The VideoLAN Project uses the same workflow as the Enlightenment Project. -[https://www.enlightenment.org/contrib/devs/coding-conventions.md](Coding Conventions) +[Coding Conventions](https://www.enlightenment.org/contrib/devs/coding-conventions.md) :Rules to which code submitted to the Enlightenment Project must adhere. \ No newline at end of file --
[EGIT] [website/www-content] master 01/01: Wiki page git-guide.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=bedfe65d8c80e5dd30b825db0eefffadd722920d commit bedfe65d8c80e5dd30b825db0eefffadd722920d Author: Gareth HalfacreeDate: Mon Nov 6 06:50:44 2017 -0800 Wiki page git-guide.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/git-guide.md.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/contrib/devs/git-guide.md.txt b/pages/contrib/devs/git-guide.md.txt index 0e4339aa..a3597f0f 100644 --- a/pages/contrib/devs/git-guide.md.txt +++ b/pages/contrib/devs/git-guide.md.txt @@ -17,7 +17,7 @@ You will require ``git`` to be installed. Linux distributions using the ``apt`` sudo apt install git ``` -You are also expected to already possess a working knowledge of git; for more information see the [Git User Manual](https://git-scm.com/docs/user-manual.html). +You are also expected to already possess a working knowledge of git; for more information see the [Git User Manual](https://git-scm.com/docs/user-manual.html). You should also have read the [Coding Conventions guide](https://www.enlightenment.org/contrib/devs/coding-conventions.md) before writing any code destined for submission. ## Submitting and Reviewing Patches ## @@ -312,4 +312,7 @@ This alias tells you what commits you're about to push and asks for confirmation :Peter Hutterer's guide to good commit messages. [wiki.videolan.org/Git](https://wiki.videolan.org/Git) -:The VideoLAN Project uses the same workflow as the Enlightenment Project. \ No newline at end of file +:The VideoLAN Project uses the same workflow as the Enlightenment Project. + +[https://www.enlightenment.org/contrib/devs/coding-conventions.md](Coding Conventions) +:Rules to which code submitted to the Enlightenment Project must adhere. \ No newline at end of file --
[EGIT] [website/www-content] master 01/01: Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=2894d43d179af310d96ec54dd4af7ed5f1ca6a7f commit 2894d43d179af310d96ec54dd4af7ed5f1ca6a7f Author: Gareth HalfacreeDate: Mon Nov 6 06:50:05 2017 -0800 Wiki page coding-conventions.md changed with summary [] by Gareth Halfacree --- pages/contrib/devs/coding-conventions.md.txt | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/contrib/devs/coding-conventions.md.txt b/pages/contrib/devs/coding-conventions.md.txt index 1725a56f..2505898f 100644 --- a/pages/contrib/devs/coding-conventions.md.txt +++ b/pages/contrib/devs/coding-conventions.md.txt @@ -188,14 +188,14 @@ a = ((b & c) | d) & 0x00ff00; ## Further Reading ## -* [git.enlightenment.org](https://git.enlightenment.org/) +[git.enlightenment.org](https://git.enlightenment.org/) :A web interface to the Enlightenment Foundation's git repositories. -* [Git Best Practices guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md) +[Git Best Practices guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md) :A guide to using the git version control system in the Enlightenment Project tree. -* [Patch Submission and Review guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md) +[Patch Submission and Review guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md) :A guide to creating and submitting patches through Arcanist. -* [Documentation Contribution guide](https://www.enlightenment.org/contrib/docs/documentation-guide.md) +[Documentation Contribution guide](https://www.enlightenment.org/contrib/docs/documentation-guide.md) :A guide to producing documentation for the Enlightenment Project \ No newline at end of file --
[EGIT] [website/www-content] master 01/01: Wiki page sidebar changed with summary [] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=93a7d46dc0db575e80c74e238230e883bfb79ef9 commit 93a7d46dc0db575e80c74e238230e883bfb79ef9 Author: Gareth HalfacreeDate: Mon Nov 6 06:45:02 2017 -0800 Wiki page sidebar changed with summary [] by Gareth Halfacree --- pages/contrib/sidebar.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/contrib/sidebar.txt b/pages/contrib/sidebar.txt index 3b2bfa53..ccfdb482 100644 --- a/pages/contrib/sidebar.txt +++ b/pages/contrib/sidebar.txt @@ -5,6 +5,7 @@ * [[/contrib/efl-debug]] * [[/contrib/enlightenment_debugging]] * [[/contrib/devs/ | Development [TODO introduce] ]] +* [[/contrib/devs/coding-conventions.md]] * [[/contrib/devs/git-guide.md]] * [[/contrib/devs/arcanist-guide.md | Patch Submission and Review]] * [[/contrib/docs/ | Documentation [TODO introduce] ]] --
[EGIT] [website/www-content] master 01/01: Wiki page coding-conventions.md changed with summary [created] by Gareth Halfacree
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=ec5e669c048d8bcb128db00eb7cc4225d64ec2aa commit ec5e669c048d8bcb128db00eb7cc4225d64ec2aa Author: Gareth HalfacreeDate: Mon Nov 6 06:42:08 2017 -0800 Wiki page coding-conventions.md changed with summary [created] by Gareth Halfacree --- pages/contrib/devs/coding-conventions.md.txt | 201 +++ 1 file changed, 201 insertions(+) diff --git a/pages/contrib/devs/coding-conventions.md.txt b/pages/contrib/devs/coding-conventions.md.txt new file mode 100644 index ..1725a56f --- /dev/null +++ b/pages/contrib/devs/coding-conventions.md.txt @@ -0,0 +1,201 @@ +--- +~~Title: Coding Conventions~~~ +~~NOCACHE~~ +--- + +# Coding Conventions # + +To ensure that the Enlightenment Project's code base is as approachable as possible all contributors are asked to adhere to the following conventions on style and layout. All contributed code should adhere to the following guidelines; those new to the Enlightenment Project and looking to contribute their first patches are advised to spend some time reading through the existing code first to get a further feel for the style and layout. + +## Prerequisites ## + +Before contributing code to the Enlightenment Project please familiarize yourself with the [Git Best Practices guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md) and [Patch Submission and Review guide](https://www.enlightenment.org/contrib/devs/arcanist-guide.md). You may also find the [Documentation Contribution Guide](https://www.enlightenment.org/contrib/docs/documentation-guide.md) a useful resource. + +## General Conventions ## + +When modifying or extending existing code, always maintain the existing coding style - even where the existing coding style goes against the conventions outlined in this document. If unsure, send different or sequential patches. If contributing new code, keep to the coding style of its immediate surroundings. + +When writing code, adhere to the following: + +* **No tabs** - Some older code may include tabs, but no more should be added. +* **3 space indent after braces** - Every level of brace ({) character should be followed by a three-space indent. +* **2 spaces indent after keywords** - This applies to ``if``, ``for``, ``while``, ``do``, ``switch``, ``case`` and so forth. +* **1 space indent before ``case``** - This comes after the ``switch`` brace. +* **1 space before parenthesis for keywords** - This applies to ``if``, ``for``, ``while`` and ``switch``. +* **No spaces before parenthesis for functions and macros** - This includes ``sizeof()``. +* **80 column code whenever possible** - Wrap longer lines where required. +* **Short ``if (cond) action`` are fine as single line** +* **Use parentheses for every clause or math** +* **Functions have lower case names separated by an underline** - ``like_this``, as an example. +* **Structures are declared with a leading underscore and ``typedef``ed with capitalization separated by an underline** - ``typedef struct _Like_This Like_This``, as an example. +* **Namespace code for clarity** - As ``{module}_{object}_{specializations}_{action}``. For example ``evas_object_color_get()`` makes it clear that you're getting the color of an object from the ``evas`` module. +* **The action should be the last part of function names** - ``evas_object_color_get()``, not ``evas_object_get_color()``. +* **Properly mark symbol visibility** - ``static`` when local to the file and ``EAPI`` when publicly exported. Non marked symbols tend to be exported exclusively to the containing module by means of the linker ``-fvisibility=hidden``. +* **Properly mark pointer ``const``** - This applies to getters or when it should not be modified, in both arguments and the return. +* **Short names to indicate a narrow scope** - ``o`` for object, ``x/y/w/h`` for geometry, ``r/g/b/a`` for colors and so forth. +* **Optional use of an underscore to prefix local/private symbols** +* **Single-line function forward declaration/prototype** +* **Function definition should have the return at one line then the function name starts at the next line, column 0** +* **Put spaces before/after numerical operators** - e.g. ``+``, ``-``, ``/`` and ``*``. +* **1 space after a comma** - e.g. ``evas_object_color_set(obj, 255, 255, 255, 255)``. + +## Convention Examples ## + +### If Statements ### + +Short statements can be in single line, which is good for error checking purposes: + +```c +if (!p) return; +if (!p) return -EINVAL; +``` + +Longer statements with a single operation are in separated lines without braces: + +```c +if (!module_object_initialized()) + module_object_initialize(); +``` + +Multiple statements are in separate lines with braces, and note the indentation change: + +```c +if (!module_object_initialized()) + { +
[EGIT] [core/efl] master 04/12: evas-software-ddraw: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f32c1ece7ebc834ef5fdea12a0f111f1a0a3ea63 commit f32c1ece7ebc834ef5fdea12a0f111f1a0a3ea63 Author: Chris MichaelDate: Mon Nov 6 09:15:54 2017 -0500 evas-software-ddraw: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/software_ddraw/evas_engine.c | 2 +- src/modules/evas/engines/software_ddraw/evas_engine.h | 3 --- src/modules/evas/engines/software_ddraw/evas_outbuf.c | 7 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.c b/src/modules/evas/engines/software_ddraw/evas_engine.c index f8882e8c39..44e0f725f2 100644 --- a/src/modules/evas/engines/software_ddraw/evas_engine.c +++ b/src/modules/evas/engines/software_ddraw/evas_engine.c @@ -47,7 +47,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) NULL, evas_software_ddraw_outbuf_new_region_for_update, evas_software_ddraw_outbuf_push_updated_region, - evas_software_ddraw_outbuf_free_region_for_update, + NULL, evas_software_ddraw_outbuf_idle_flush, evas_software_ddraw_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.h b/src/modules/evas/engines/software_ddraw/evas_engine.h index 8184417abb..aac482f034 100644 --- a/src/modules/evas/engines/software_ddraw/evas_engine.h +++ b/src/modules/evas/engines/software_ddraw/evas_engine.h @@ -136,9 +136,6 @@ void evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf, intw, inth); -void evas_software_ddraw_outbuf_free_region_for_update(Outbuf *buf, - RGBA_Image *update); - void evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); void evas_software_ddraw_outbuf_idle_flush(Outbuf *buf); diff --git a/src/modules/evas/engines/software_ddraw/evas_outbuf.c b/src/modules/evas/engines/software_ddraw/evas_outbuf.c index 0d5a79ae56..55fd535333 100644 --- a/src/modules/evas/engines/software_ddraw/evas_outbuf.c +++ b/src/modules/evas/engines/software_ddraw/evas_outbuf.c @@ -349,13 +349,6 @@ evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf, } void -evas_software_ddraw_outbuf_free_region_for_update(Outbuf *buf EINA_UNUSED, - RGBA_Image *update EINA_UNUSED) -{ - /* no need to do anything - they are cleaned up on flush */ -} - -void evas_software_ddraw_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode) { Eina_List *l; --
[EGIT] [core/efl] master 12/12: evas-gl-cocoa: Remove need for useless region_free function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=de1e18ef7d1c13471992035467ea099f3b97c55c commit de1e18ef7d1c13471992035467ea099f3b97c55c Author: Chris MichaelDate: Mon Nov 6 09:28:53 2017 -0500 evas-gl-cocoa: Remove need for useless region_free function Signed-off-by: Chris Michael --- src/modules/evas/engines/gl_cocoa/evas_engine.c | 2 +- src/modules/evas/engines/gl_cocoa/evas_engine.h | 1 - src/modules/evas/engines/gl_cocoa/evas_outbuf.m | 7 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c index 61430176e7..de1dacc800 100644 --- a/src/modules/evas/engines/gl_cocoa/evas_engine.c +++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c @@ -165,7 +165,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) NULL, evas_outbuf_update_region_new, evas_outbuf_update_region_push, -evas_outbuf_update_region_free, +NULL, NULL, evas_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.h b/src/modules/evas/engines/gl_cocoa/evas_engine.h index dd8919f01a..efc906aee6 100644 --- a/src/modules/evas/engines/gl_cocoa/evas_engine.h +++ b/src/modules/evas/engines/gl_cocoa/evas_engine.h @@ -97,7 +97,6 @@ void evas_outbuf_gl_context_use(Context_3D *ctx); Eina_Bool evas_outbuf_update_region_first_rect(Outbuf *ob); void *evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); -void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); Evas_Engine_GL_Context *evas_outbuf_gl_context_get(Outbuf *ob); Context_3D *evas_outbuf_gl_context_new(Outbuf *ob); diff --git a/src/modules/evas/engines/gl_cocoa/evas_outbuf.m b/src/modules/evas/engines/gl_cocoa/evas_outbuf.m index d1566ddd12..e25d1690fd 100644 --- a/src/modules/evas/engines/gl_cocoa/evas_outbuf.m +++ b/src/modules/evas/engines/gl_cocoa/evas_outbuf.m @@ -226,13 +226,6 @@ evas_outbuf_update_region_push(Outbuf *ob, glsym_evas_gl_common_context_flush(ob->gl_context); } -void -evas_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - TRC(""); - /* Nothing to do here as we don't really create an image per area */ -} - void * evas_outbuf_update_region_new(Outbuf *ob, int x, --
[EGIT] [core/efl] master 03/12: evas-eglfs: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9fa88773c76450fc88cb65648f075ad90968 commit 9fa88773c76450fc88cb65648f075ad90968 Author: Chris MichaelDate: Mon Nov 6 09:14:14 2017 -0500 evas-eglfs: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/eglfs/evas_engine.c | 2 +- src/modules/evas/engines/eglfs/evas_engine.h | 1 - src/modules/evas/engines/eglfs/evas_outbuf.c | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c index 88321d81f0..34aa22fbe5 100644 --- a/src/modules/evas/engines/eglfs/evas_engine.c +++ b/src/modules/evas/engines/eglfs/evas_engine.c @@ -709,7 +709,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) NULL, evas_outbuf_update_region_new, evas_outbuf_update_region_push, - evas_outbuf_update_region_free, + NULL, NULL, evas_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/eglfs/evas_engine.h b/src/modules/evas/engines/eglfs/evas_engine.h index 54c90fd213..e3ad5bae65 100644 --- a/src/modules/evas/engines/eglfs/evas_engine.h +++ b/src/modules/evas/engines/eglfs/evas_engine.h @@ -110,7 +110,6 @@ int evas_outbuf_rot_get(Outbuf *ob); Eina_Bool evas_outbuf_update_region_first_rect(Outbuf *ob); void *evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); -void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); Evas_Engine_GL_Context* evas_outbuf_gl_context_get(Outbuf *ob); void *evas_outbuf_egl_display_get(Outbuf *ob); diff --git a/src/modules/evas/engines/eglfs/evas_outbuf.c b/src/modules/evas/engines/eglfs/evas_outbuf.c index e922d1e1ee..ba732861ab 100644 --- a/src/modules/evas/engines/eglfs/evas_outbuf.c +++ b/src/modules/evas/engines/eglfs/evas_outbuf.c @@ -607,12 +607,6 @@ evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update EINA_UNUSED, int x } void -evas_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - /* Nothing to do here as we don't really create an image per area */ -} - -void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode) { if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) goto end; --
[EGIT] [core/efl] master 11/12: evas-gl-drm: Remove need for useless region_free function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3ae469e6486028aa4424b91d7798fbf28ed06654 commit 3ae469e6486028aa4424b91d7798fbf28ed06654 Author: Chris MichaelDate: Mon Nov 6 09:27:39 2017 -0500 evas-gl-drm: Remove need for useless region_free function Signed-off-by: Chris Michael --- src/modules/evas/engines/gl_drm/evas_engine.c | 2 +- src/modules/evas/engines/gl_drm/evas_engine.h | 1 - src/modules/evas/engines/gl_drm/evas_outbuf.c | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index 8f030a9aa1..e1a36940cc 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -941,7 +941,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) evas_outbuf_damage_region_set, evas_outbuf_update_region_new, evas_outbuf_update_region_push, - evas_outbuf_update_region_free, + NULL, NULL, evas_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h b/src/modules/evas/engines/gl_drm/evas_engine.h index c67763c5d4..3d3acf3de6 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.h +++ b/src/modules/evas/engines/gl_drm/evas_engine.h @@ -129,7 +129,6 @@ int evas_outbuf_rot_get(Outbuf *ob); Eina_Bool evas_outbuf_update_region_first_rect(Outbuf *ob); void *evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); -void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); void evas_outbuf_release_fb(void *, void *); void evas_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage); diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index 4048c16a1f..649b9b615e 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -696,12 +696,6 @@ evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update EINA_UNUSED, int x } void -evas_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - /* Nothing to do here as we don't really create an image per area */ -} - -void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode) { if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) goto end; --
[EGIT] [core/efl] master 02/12: evas-drm: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5f897542aaf4416c414b41d8d95580e35560c4b5 commit 5f897542aaf4416c414b41d8d95580e35560c4b5 Author: Chris MichaelDate: Mon Nov 6 09:13:12 2017 -0500 evas-drm: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/drm/evas_engine.c | 2 +- src/modules/evas/engines/drm/evas_engine.h | 1 - src/modules/evas/engines/drm/evas_outbuf.c | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c index 55085ce5c7..63719018ec 100644 --- a/src/modules/evas/engines/drm/evas_engine.c +++ b/src/modules/evas/engines/drm/evas_engine.c @@ -41,7 +41,7 @@ eng_output_setup(void *engine, void *einfo, unsigned int w, unsigned int h) NULL, _outbuf_update_region_new, _outbuf_update_region_push, - _outbuf_update_region_free, + NULL, NULL, _outbuf_flush, _outbuf_redraws_clear, diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h index 5faf32b8f1..c19ac4c369 100644 --- a/src/modules/evas/engines/drm/evas_engine.h +++ b/src/modules/evas/engines/drm/evas_engine.h @@ -80,7 +80,6 @@ void _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth de Render_Output_Swap_Mode _outbuf_state_get(Outbuf *ob); void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); -void _outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); void _outbuf_redraws_clear(Outbuf *ob); diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c index 987ff298e1..5e76d26424 100644 --- a/src/modules/evas/engines/drm/evas_outbuf.c +++ b/src/modules/evas/engines/drm/evas_outbuf.c @@ -485,12 +485,6 @@ _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, } void -_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - -} - -void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode) { Eina_Rectangle *r; --
[EGIT] [core/efl] master 05/12: evas-software-gdi: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5edae8b9c1942486bbdba1dfeb029b4d02854d78 commit 5edae8b9c1942486bbdba1dfeb029b4d02854d78 Author: Chris MichaelDate: Mon Nov 6 09:17:02 2017 -0500 evas-software-gdi: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/software_gdi/evas_engine.c | 2 +- src/modules/evas/engines/software_gdi/evas_engine.h | 3 --- src/modules/evas/engines/software_gdi/evas_outbuf.c | 7 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/modules/evas/engines/software_gdi/evas_engine.c b/src/modules/evas/engines/software_gdi/evas_engine.c index dc17d232cc..465607853e 100644 --- a/src/modules/evas/engines/software_gdi/evas_engine.c +++ b/src/modules/evas/engines/software_gdi/evas_engine.c @@ -51,7 +51,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) NULL, evas_software_gdi_outbuf_new_region_for_update, evas_software_gdi_outbuf_push_updated_region, - evas_software_gdi_outbuf_free_region_for_update, + NULL, evas_software_gdi_outbuf_idle_flush, evas_software_gdi_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/software_gdi/evas_engine.h b/src/modules/evas/engines/software_gdi/evas_engine.h index 08a50fce52..88d1cac214 100644 --- a/src/modules/evas/engines/software_gdi/evas_engine.h +++ b/src/modules/evas/engines/software_gdi/evas_engine.h @@ -180,9 +180,6 @@ void evas_software_gdi_outbuf_push_updated_region(Outbuf *buf, int w, int h); -void evas_software_gdi_outbuf_free_region_for_update(Outbuf *buf, - RGBA_Image *update); - void evas_software_gdi_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); void evas_software_gdi_outbuf_idle_flush(Outbuf *buf); diff --git a/src/modules/evas/engines/software_gdi/evas_outbuf.c b/src/modules/evas/engines/software_gdi/evas_outbuf.c index 5ec4443e16..68a1a3e463 100644 --- a/src/modules/evas/engines/software_gdi/evas_outbuf.c +++ b/src/modules/evas/engines/software_gdi/evas_outbuf.c @@ -547,13 +547,6 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf, } void -evas_software_gdi_outbuf_free_region_for_update(Outbuf *buf EINA_UNUSED, -RGBA_Image *update EINA_UNUSED) -{ - /* no need to do anything - they are cleaned up on flush */ -} - -void evas_software_gdi_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode) { Eina_List *l; --
[EGIT] [core/efl] master 06/12: evas-software-x11: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=31a7963196cf82be7a49dc4d914e345961dcd5c3 commit 31a7963196cf82be7a49dc4d914e345961dcd5c3 Author: Chris MichaelDate: Mon Nov 6 09:19:20 2017 -0500 evas-software-x11: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/software_x11/evas_engine.c | 4 ++-- src/modules/evas/engines/software_x11/evas_xlib_outbuf.c | 6 -- src/modules/evas/engines/software_x11/evas_xlib_outbuf.h | 3 --- src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c | 6 -- src/modules/evas/engines/software_x11/evas_xlib_swapbuf.h | 2 -- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c index 49f3683757..fcef81466d 100644 --- a/src/modules/evas/engines/software_x11/evas_engine.c +++ b/src/modules/evas/engines/software_x11/evas_engine.c @@ -103,7 +103,7 @@ _output_xlib_setup(void *engine, int w, int h, int rot, Display *disp, Drawable NULL, evas_software_xlib_outbuf_new_region_for_update, evas_software_xlib_outbuf_push_updated_region, - evas_software_xlib_outbuf_free_region_for_update, + NULL, evas_software_xlib_outbuf_idle_flush, evas_software_xlib_outbuf_flush, NULL, @@ -152,7 +152,7 @@ _output_swapbuf_setup(void *engine, int w, int h, int rot, Display *disp, Drawab NULL, evas_software_xlib_swapbuf_new_region_for_update, evas_software_xlib_swapbuf_push_updated_region, - evas_software_xlib_swapbuf_free_region_for_update, + NULL, evas_software_xlib_swapbuf_idle_flush, evas_software_xlib_swapbuf_flush, NULL, diff --git a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c index e52b6093d8..e390ca9da3 100644 --- a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c +++ b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c @@ -758,12 +758,6 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w } void -evas_software_xlib_outbuf_free_region_for_update(Outbuf *buf EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - /* no need to do anything - they are cleaned up on flush */ -} - -void evas_software_xlib_outbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED, Evas_Render_Mode render_mode EINA_UNUSED) { Eina_List *l; diff --git a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.h b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.h index 8f4ddd2948..5829b7451f 100644 --- a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.h +++ b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.h @@ -35,9 +35,6 @@ void *evas_software_xlib_outbuf_new_region_for_update (Outbuf *buf, int*cw, int*ch); -void evas_software_xlib_outbuf_free_region_for_update (Outbuf *buf, - RGBA_Image *update); - void evas_software_xlib_outbuf_flush (Outbuf *buf, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); void evas_software_xlib_outbuf_idle_flush (Outbuf *buf); diff --git a/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c b/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c index 473045cdfd..9b04a949d6 100644 --- a/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c +++ b/src/modules/evas/engines/software_x11/evas_xlib_swapbuf.c @@ -318,12 +318,6 @@ evas_software_xlib_swapbuf_new_region_for_update(Outbuf *buf, int x, int y, int } void -evas_software_xlib_swapbuf_free_region_for_update(Outbuf *buf EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - /* no need to do anything - they are cleaned up on flush */ -} - -void evas_software_xlib_swapbuf_flush(Outbuf *buf, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage EINA_UNUSED,
[EGIT] [core/efl] master 10/12: evas-gl-sdl: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85a9716c8f80da45dcdc90f6743caccee15b77fe commit 85a9716c8f80da45dcdc90f6743caccee15b77fe Author: Chris MichaelDate: Mon Nov 6 09:26:13 2017 -0500 evas-gl-sdl: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/gl_sdl/evas_engine.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c b/src/modules/evas/engines/gl_sdl/evas_engine.c index 847ecc6725..bf6ba6540c 100644 --- a/src/modules/evas/engines/gl_sdl/evas_engine.c +++ b/src/modules/evas/engines/gl_sdl/evas_engine.c @@ -50,11 +50,6 @@ _outbuf_push_updated_region(Outbuf *ob EINA_UNUSED, } static void -_outbuf_free_region_for_update(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ -} - -static void _outbuf_free(Outbuf *ob) { evas_common_font_ext_clear(); @@ -289,7 +284,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) NULL, _outbuf_new_region_for_update, _outbuf_push_updated_region, - _outbuf_free_region_for_update, + NULL, NULL, _outbuf_flush, NULL, --
[EGIT] [core/efl] master 08/12: evas-wayland-egl: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e04ad61ab40a0407cd27c6da66ef5d74e003a75d commit e04ad61ab40a0407cd27c6da66ef5d74e003a75d Author: Chris MichaelDate: Mon Nov 6 09:23:13 2017 -0500 evas-wayland-egl: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/wayland_egl/evas_engine.c | 2 +- src/modules/evas/engines/wayland_egl/evas_engine.h | 1 - src/modules/evas/engines/wayland_egl/evas_wl_main.c | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 3da159fcdd..4db2ad59db 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -584,7 +584,7 @@ eng_output_setup(void *engine, void *info, unsigned int w, unsigned int h) eng_outbuf_damage_region_set, eng_outbuf_update_region_new, eng_outbuf_update_region_push, - eng_outbuf_update_region_free, + NULL, NULL, eng_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.h b/src/modules/evas/engines/wayland_egl/evas_engine.h index bab7cad7c9..89c39fb3e4 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.h +++ b/src/modules/evas/engines/wayland_egl/evas_engine.h @@ -119,7 +119,6 @@ Render_Output_Swap_Mode eng_outbuf_swap_mode_get(Outbuf *ob); Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob); void eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage); void *eng_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); -void eng_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void eng_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); void eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index 4f1823ec1f..aed592b5d1 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -491,12 +491,6 @@ eng_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx EIN } void -eng_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - -} - -void eng_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED) { if (!_re_wincheck(ob)) return; --
[EGIT] [core/efl] master 07/12: evas-wayland-shm: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=39184e78afa97fd417ba8e63ab41f024516e7cf0 commit 39184e78afa97fd417ba8e63ab41f024516e7cf0 Author: Chris MichaelDate: Mon Nov 6 09:21:59 2017 -0500 evas-wayland-shm: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/wayland_shm/evas_engine.c | 2 +- src/modules/evas/engines/wayland_shm/evas_engine.h | 1 - src/modules/evas/engines/wayland_shm/evas_outbuf.c | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c index 30522a9187..df6d68c431 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.c +++ b/src/modules/evas/engines/wayland_shm/evas_engine.c @@ -50,7 +50,7 @@ eng_output_setup(void *engine, void *info, unsigned int w, unsigned int h) NULL, _evas_outbuf_update_region_new, _evas_outbuf_update_region_push, - _evas_outbuf_update_region_free, + NULL, _evas_outbuf_idle_flush, _evas_outbuf_flush, _evas_outbuf_redraws_clear, diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h index 6a0cd68c03..a3da8fbf75 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.h +++ b/src/modules/evas/engines/wayland_shm/evas_engine.h @@ -152,7 +152,6 @@ int _evas_outbuf_rotation_get(Outbuf *ob); void _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, Eina_Bool resize); void *_evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); -void _evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); void _evas_surface_damage(struct wl_surface *s, int compositor_version, int w, int h, Eina_Rectangle *rects, unsigned int count); void _evas_outbuf_redraws_clear(Outbuf *ob); diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c index dbc40ebf93..d5a6b7e2bc 100644 --- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c @@ -623,12 +623,6 @@ _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, in rect.w, rect.h, x + rx, y + ry, NULL); } -void -_evas_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_UNUSED) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); -} - void _evas_outbuf_redraws_clear(Outbuf *ob) { --
[EGIT] [core/efl] master 09/12: evas-gl-x11: Remove need for useless free_region function
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c8e5614830cd36ec46e0c4c9be3e8812d6a0c7f1 commit c8e5614830cd36ec46e0c4c9be3e8812d6a0c7f1 Author: Chris MichaelDate: Mon Nov 6 09:25:19 2017 -0500 evas-gl-x11: Remove need for useless free_region function Signed-off-by: Chris Michael --- src/modules/evas/engines/gl_x11/evas_engine.c | 2 +- src/modules/evas/engines/gl_x11/evas_engine.h | 1 - src/modules/evas/engines/gl_x11/evas_x_main.c | 7 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index fadfe21fdf..583e036ba2 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -1651,7 +1651,7 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h) #endif eng_outbuf_new_region_for_update, eng_outbuf_push_updated_region, - eng_outbuf_push_free_region_for_update, + NULL, eng_outbuf_idle_flush, eng_outbuf_flush, NULL, diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h index 29c8a190d6..c5cef71064 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.h +++ b/src/modules/evas/engines/gl_x11/evas_engine.h @@ -193,7 +193,6 @@ Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob); void *eng_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); -void eng_outbuf_push_free_region_for_update(Outbuf *ob, RGBA_Image *update); void eng_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); void eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c index b9d733e3ed..bd0df7c58e 100644 --- a/src/modules/evas/engines/gl_x11/evas_x_main.c +++ b/src/modules/evas/engines/gl_x11/evas_x_main.c @@ -1554,13 +1554,6 @@ eng_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update EINA_UNUSED, } void -eng_outbuf_push_free_region_for_update(Outbuf *ob EINA_UNUSED, - RGBA_Image *update EINA_UNUSED) -{ - /* Nothing to do here as we don't really create an image per area */ -} - -void eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode) { Tilebuf_Rect *rects = buffer_damage; --
[EGIT] [core/efl] master 01/12: evas-software-generic: Check for render engine function before calling
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6016ce8133eb0732eef224537e8aa6a8fd420c27 commit 6016ce8133eb0732eef224537e8aa6a8fd420c27 Author: Chris MichaelDate: Mon Nov 6 09:10:28 2017 -0500 evas-software-generic: Check for render engine function before calling In most engines which inherit from software_generic, they do not implement the outbuf_free_region_for_update function. Most engines have it as an unused function. If we simply add a check here, then we can reduce the need for having useless function in multiple engines. @fix Signed-off-by: Chris Michael --- src/modules/evas/engines/software_generic/evas_engine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 59e90b2988..356c979328 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -4260,7 +4260,8 @@ eng_output_redraws_next_update_push(void *engine EINA_UNUSED, void *data, void * evas_common_pipe_map_begin(surface); #endif /* BUILD_PIPE_RENDER */ re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); - re->outbuf_free_region_for_update(re->ob, surface); + if (re->outbuf_free_region_for_update) + re->outbuf_free_region_for_update(re->ob, surface); evas_common_cpu_end_opt(); } --
[EGIT] [website/www-content] master 01/01: Wiki page docs changed with summary [] by Andrew Williams
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=94e64a0b644025c367ddbb832c6919ede6b3784f commit 94e64a0b644025c367ddbb832c6919ede6b3784f Author: Andrew WilliamsDate: Mon Nov 6 04:42:32 2017 -0800 Wiki page docs changed with summary [] by Andrew Williams --- pages/docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs.txt b/pages/docs.txt index f6172d77..460d9a49 100755 --- a/pages/docs.txt +++ b/pages/docs.txt @@ -117,6 +117,6 @@ From there you can get to know the team, how we work, and earn a place on the te === Coding === * [[https://phab.enlightenment.org/w/ecoding/|EFL Coding Style]] - * [[https://phab.enlightenment.org/w/git_practices/|Git Practices]] + * [[/contrib/devs/git-guide|Git Practices]] --
[EGIT] [website/www-content] master 01/01: Wiki page sidebar changed with summary [] by Andrew Williams
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=ba35cae1b4199c995e37a7378be28394de1f8562 commit ba35cae1b4199c995e37a7378be28394de1f8562 Author: Andrew WilliamsDate: Mon Nov 6 04:29:36 2017 -0800 Wiki page sidebar changed with summary [] by Andrew Williams --- pages/contrib/sidebar.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/contrib/sidebar.txt b/pages/contrib/sidebar.txt index 424bf0d5..3b2bfa53 100644 --- a/pages/contrib/sidebar.txt +++ b/pages/contrib/sidebar.txt @@ -1,3 +1,5 @@ +~~NOCACHE~~ + * [[/contrib/start]] * [[/contrib/reporting_bugs]] * [[/contrib/efl-debug]] --
[EGIT] [core/enlightenment] master 01/01: improve meson build module disabling
discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=c1a3ec99403402c156af1ecc3c827ef6b8550cff commit c1a3ec99403402c156af1ecc3c827ef6b8550cff Author: Mike BlumenkrantzDate: Mon Nov 6 06:32:19 2017 -0500 improve meson build module disabling ref 61ddcb25e6075e5e6a5436dc6f981e45317c5d7d --- src/modules/meson.build | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/meson.build b/src/modules/meson.build index 01e335fc7..65f0b2fb8 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -78,6 +78,7 @@ mods = [ foreach m: mods desktop_only = false + disable = false no_icon = false cargs= '' data = [] @@ -87,13 +88,14 @@ foreach m: mods _dir_bin = join_paths(_dir, module_arch) opt = '-'.join(m.split('_')) - disable = get_option(opt) - if disable == true + if get_option(opt) == true subdir(m) + else +disable = true endif - if disable == true + if disable == false _inc2 = [] foreach i: inc --
[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [Whitespace] by Xavi Artigas
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=27eb24871775c6d9c7189a1963b64d1dce28d6fd commit 27eb24871775c6d9c7189a1963b64d1dce28d6fd Author: Xavi ArtigasDate: Mon Nov 6 00:37:13 2017 -0800 Wiki page start changed with summary [Whitespace] by Xavi Artigas --- pages/start.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/start.txt b/pages/start.txt index b7f04880..9e249ee5 100644 --- a/pages/start.txt +++ b/pages/start.txt @@ -66,7 +66,7 @@ Our DNS is kindly provided by [[https://www.easydns.com/|EasyDNS]]. Our SSL certificates are provided by [[https://www.gandi.net|Gandi.net]]. -Many of our **Enlightenment Developer Days** events have been sponsored and paid for by [[https://www.samsung.com|Samsung]]and have recently been hosted by [[https://openwide.fr|Openwide]]. +Many of our **Enlightenment Developer Days** events have been sponsored and paid for by [[https://www.samsung.com|Samsung]] and have recently been hosted by [[https://openwide.fr|Openwide]]. [[https://osuosl.org|{{:thanks-osuosl.svg|OSUOSL}}]] [[https://www.easydns.com|{{:thanks-easydns.svg|EasyDNS}}]] --