[EGIT] [core/efl] master 01/01: eolian: do not check alias/struct/enum base for builtin types

2015-05-12 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=44d37bb368d6b1a78169caa4517f3fdb79dc47d3

commit 44d37bb368d6b1a78169caa4517f3fdb79dc47d3
Author: Daniel Kolesa d.kol...@osg.samsung.com
Date:   Tue May 12 17:23:42 2015 +0100

eolian: do not check alias/struct/enum base for builtin types
---
 src/lib/eolian/database_type_api.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/lib/eolian/database_type_api.c 
b/src/lib/eolian/database_type_api.c
index 28ed9e5..5c301f2 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -4,6 +4,7 @@
 
 #include Eina.h
 #include eolian_database.h
+#include eo_lexer.h
 
 EAPI const Eolian_Type *
 eolian_type_alias_get_by_name(const char *name)
@@ -233,15 +234,20 @@ eolian_type_base_type_get(const Eolian_Type *tp)
  {
 /* for regular types, try looking up if it belongs to a struct,
  * enum or an alias... otherwise return NULL
+ * but first check for builtins
  */
-   Eolian_Type *rtp;
-   rtp = eina_hash_find(_aliases, tp-full_name);
-   if (rtp) return rtp;
-   rtp = eina_hash_find(_structs, tp-full_name);
-   if (rtp) return rtp;
-   rtp = eina_hash_find(_enums, tp-full_name);
-   if (rtp) return rtp;
-   return NULL;
+int  kw = eo_lexer_keyword_str_to_id(tp-full_name);
+if (!kw || kw  KW_byte || kw  KW_list)
+  {
+ Eolian_Type *rtp;
+ rtp = eina_hash_find(_aliases, tp-full_name);
+ if (rtp) return rtp;
+ rtp = eina_hash_find(_structs, tp-full_name);
+ if (rtp) return rtp;
+ rtp = eina_hash_find(_enums, tp-full_name);
+ if (rtp) return rtp;
+  }
+return NULL;
  }
return tp-base_type;
 }

-- 




[EGIT] [core/efl] master 01/01: eolian: remove unused variables

2015-05-12 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=96d16eabb4f76632aa6891f5f6ce20d08cb38779

commit 96d16eabb4f76632aa6891f5f6ce20d08cb38779
Author: Daniel Kolesa d.kol...@osg.samsung.com
Date:   Tue May 12 17:07:26 2015 +0100

eolian: remove unused variables
---
 src/lib/eolian/eo_parser.c| 1 -
 src/tests/eolian/eolian_parsing.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index e256c7e..a646526 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -668,7 +668,6 @@ parse_type_void(Eo_Lexer *ls)
 {
Eolian_Type *def;
const char *ctype;
-   const char *sname = NULL;
Eina_Strbuf *buf;
int line = ls-line_number, col = ls-column;
switch (ls-t.kw)
diff --git a/src/tests/eolian/eolian_parsing.c 
b/src/tests/eolian/eolian_parsing.c
index 182272b..c94248d 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -677,7 +677,7 @@ END_TEST
 START_TEST(eolian_struct)
 {
const Eolian_Struct_Type_Field *field = NULL;
-   const Eolian_Type *atype = NULL, *type = NULL, *ftype = NULL;
+   const Eolian_Type *type = NULL, *ftype = NULL;
const Eolian_Class *class;
const char *type_name;
const char *file;

-- 




[EGIT] [core/enlightenment] master 01/01: e_comp_wl: fix segfault in case parent's surface is destroyed before subsurface is destroyed

2015-05-12 Thread Boram Park
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=7a078ba99bd911c766462f005fccc28997541331

commit 7a078ba99bd911c766462f005fccc28997541331
Author: Boram Park boram1288.p...@samsung.com
Date:   Tue May 12 14:43:00 2015 -0400

e_comp_wl: fix segfault in case parent's surface is destroyed before 
subsurface is destroyed

Summary:
A parent surface can be destroyed. In this case, 
ec-comp_data-sub.data-parent has
a wrong address which has already destroyed. Then, it occurs segmentation 
fault.
To avoid segfault, ec-comp_data-sub.data-parent should be NULL when a 
parent surface
is destroyed.

Signed-off-by: Boram Park boram1288.p...@samsung.com

Test Plan: Run attached test program(subsurface)

Reviewers: gwanglim, cedric, devilhorns, zmike

Reviewed By: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2484
---
 src/bin/e_comp_wl.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 84236f3..6004b72 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -2027,6 +2027,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client 
*ec)
 {
/* Eina_Rectangle *dmg; */
struct wl_resource *cb;
+   E_Client *subc;
 
/* make sure this is a wayland client */
if (e_pixmap_type_get(ec-pixmap) != E_PIXMAP_TYPE_WL) return;
@@ -2041,6 +2042,10 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, 
E_Client *ec)
 e_pixmap_parent_window_set(ec-pixmap, 0);
  }
 
+   /* remove sub list */
+   EINA_LIST_FREE(ec-comp_data-sub.list, subc)
+ subc-comp_data-sub.data-parent = NULL;
+
if ((ec-parent)  (ec-parent-modal == ec))
  {
 ec-parent-lock_close = EINA_FALSE;

-- 




[EGIT] [core/efl] master 01/05: ecore-drm: Fix issue of edid parsing not ignoring string

2015-05-12 Thread Christopher Michael
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=956eb9318beeec16396e7daf94ce88935db3a901

commit 956eb9318beeec16396e7daf94ce88935db3a901
Author: Chris Michael cp.mich...@samsung.com
Date:   Tue May 12 11:51:01 2015 -0400

ecore-drm: Fix issue of edid parsing not ignoring string

Summary: When we are parsing the edid string, if the string is random
junk, then we need to ignore it. Prior to this commit, we were not
setting the returned text properly.

@fix

Signed-off-by: Chris Michael cp.mich...@samsung.com
---
 src/lib/ecore_drm/ecore_drm_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index a76a8ec..0d4ace3 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -100,7 +100,7 @@ _ecore_drm_output_edid_parse_string(const uint8_t *data, 
char text[])
   }
  }
 
-   if (rep  4) text[i] = '\0';
+   if (rep  4) text[0] = '\0';
 }
 
 static int 

-- 




[EGIT] [core/efl] master 02/03: Evas GL common: Add very basic GL calls tracing method

2015-05-12 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=748e6ad1b9f3345250a727178eed5e1ca3e9444a

commit 748e6ad1b9f3345250a727178eed5e1ca3e9444a
Author: Jean-Philippe Andre jp.an...@samsung.com
Date:   Wed May 13 10:17:12 2015 +0900

Evas GL common: Add very basic GL calls tracing method

Rewrap the GL calls to print them out. The arguments are not
interpreted. See the GL_ERRORS #define.
---
 .../evas/engines/gl_common/evas_gl_common.h| 126 +
 .../evas/engines/gl_common/evas_gl_context.c   |  45 ++--
 .../evas/engines/gl_common/evas_gl_shader.c|   8 +-
 .../evas/engines/gl_common/evas_gl_texture.c   |  25 ++--
 4 files changed, 123 insertions(+), 81 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index adc2ba2..1875624 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -966,7 +966,10 @@ void evas_gl_preload_target_unregister(Evas_GL_Texture 
*tex, Eo *target);
 
 void pt_unref(Evas_GL_Texture_Pool *pt);
 
+// Enable GL errors logging
 //#define GL_ERRORS 1
+// Enable very basic GL calls logging (requires GL_ERRORS)
+//#define GL_ERRORS_TRACE 1
 
 #ifdef GL_ERRORS
 #include dlfcn.h
@@ -985,56 +988,79 @@ __evas_gl_errdyn(int err, const char *file, const char 
*func, int line, const ch
}
 /* Redefine common gl funcs */
 # ifndef GL_ERRORS_NODEF
-#  define glActiveTexture(...) do { glActiveTexture(__VA_ARGS__); 
GLERRV(glActiveTexture); } while(0)
-#  define glBindAttribLocation(...) do { glBindAttribLocation(__VA_ARGS__); 
GLERRV(glBindAttribLocation); } while(0)
-#  define glBindBuffer(...) do { glBindBuffer(__VA_ARGS__); 
GLERRV(glBindBuffer); } while(0)
-#  define glBindTexture(...) do { glBindTexture(__VA_ARGS__); 
GLERRV(glBindTexture); } while(0)
-#  define glBlendFunc(...) do { glBlendFunc(__VA_ARGS__); 
GLERRV(glBlendFunc); } while(0)
-#  define glBufferData(...) do { glBufferData(__VA_ARGS__); 
GLERRV(glBufferData); } while(0)
-#  define glCompressedTexSubImage2D(...) do { 
glCompressedTexSubImage2D(__VA_ARGS__); GLERRV(glCompressedTexSubImage2D); } 
while(0)
-#  define glDeleteBuffers(...) do { glDeleteBuffers(__VA_ARGS__); 
GLERRV(glDeleteBuffers); } while(0)
-#  define glDepthMask(...) do { glDepthMask(__VA_ARGS__); 
GLERRV(glDepthMask); } while(0)
-#  define glDisable(...) do { glDisable(__VA_ARGS__); GLERRV(glDisable); } 
while(0)
-#  define glDisableVertexAttribArray(...) do { 
glDisableVertexAttribArray(__VA_ARGS__); GLERRV(glDisableVertexAttribArray); 
} while(0)
-#  define glDrawArrays(...) do { glDrawArrays(__VA_ARGS__); 
GLERRV(glDrawArrays); } while(0)
-#  define glEnable(...) do { glEnable(__VA_ARGS__); GLERRV(glEnable); } 
while(0)
-#  define glEnableVertexAttribArray(...) do { 
glEnableVertexAttribArray(__VA_ARGS__); GLERRV(glEnableVertexAttribArray); } 
while(0)
-#  define glGenBuffers(...) do { glGenBuffers(__VA_ARGS__); 
GLERRV(glGenBuffers); } while(0)
-#  define glGetFloatv(...) do { glGetFloatv(__VA_ARGS__); 
GLERRV(glGetFloatv); } while(0)
-#  define glGetIntegerv(...) do { glGetIntegerv(__VA_ARGS__); 
GLERRV(glGetIntegerv); } while(0)
-#  define glGetUniformLocation(...) ({ GLint _x = 
glGetUniformLocation(__VA_ARGS__); GLERRV(glGetUniformLocation); _x; })
-#  define glHint(...) do { glHint(__VA_ARGS__); GLERRV(glHint); } while(0)
-#  define glReadPixels(...) do { glReadPixels(__VA_ARGS__); 
GLERRV(glReadPixels); } while(0)
-#  define glScissor(...) do { glScissor(__VA_ARGS__); GLERRV(glScissor); } 
while(0)
-#  define glGenFramebuffers(...) do { glGenFramebuffers(__VA_ARGS__); 
GLERRV(glGenFramebuffers); } while(0)
-#  define glBindFramebuffer(...) do { glBindFramebuffer(__VA_ARGS__); 
GLERRV(glBindFramebuffer); } while(0)
-#  define glEndTiling(...) do { glEndTiling(__VA_ARGS__); 
GLERRV(glEndTiling); } while(0)
-#  define glGetProgramBinary(...) do { glGetProgramBinary(__VA_ARGS__); 
GLERRV(glGetProgramBinary); } while(0)
-#  define glMapBuffer(...) ({ void *_x = glMapBuffer(__VA_ARGS__); 
GLERRV(glMapBuffer); _x; })
-#  define glStartTiling(...) do { glStartTiling(__VA_ARGS__); 
GLERRV(glStartTiling); } while(0)
-#  define glUnmapBuffer(...) do { glUnmapBuffer(__VA_ARGS__); 
GLERRV(glUnmapBuffer); } while(0)
-#  define glTexParameterf(...) do { glTexParameterf(__VA_ARGS__); 
GLERRV(glTexParameterf); } while(0)
-#  define glTexParameteri(...) do { glTexParameteri(__VA_ARGS__); 
GLERRV(glTexParameteri); } while(0)
-#  define glTexSubImage2D(...) do { glTexSubImage2D(__VA_ARGS__); 
GLERRV(glTexSubImage2D); } while(0)
-#  define glUniform1f(...) do { glUniform1f(__VA_ARGS__); 
GLERRV(glUniform1f); } while(0)
-#  define glUniform1i(...) do { glUniform1i(__VA_ARGS__); 
GLERRV(glUniform1i); } while(0)
-#  define glUniform2fv(...) do { glUniform2fv(__VA_ARGS__); 
GLERRV(glUniform2fv); } while(0)
-#  define 

[EGIT] [core/efl] master 03/03: Evas filters: Fix glReadPixels usage for EGL

2015-05-12 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7a614c80f3022c4da06bd299d25bc6433caab00a

commit 7a614c80f3022c4da06bd299d25bc6433caab00a
Author: Jean-Philippe Andre jp.an...@samsung.com
Date:   Wed May 13 10:16:17 2015 +0900

Evas filters: Fix glReadPixels usage for EGL

EGL might very well not support RGBA read mode, so we
need to check for it first.

Also remove some error logs (see previous commit), and useless
initialization of the Evas GL engine.

@fix
---
 src/modules/evas/engines/gl_generic/evas_engine.c | 37 ---
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index 04f26a1..eed3e2c 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -621,7 +621,6 @@ _rotate_image_data(void *data, void *img)
evas_common_draw_context_free(dc);
 
glsym_glBindFramebuffer(GL_FRAMEBUFFER, im2-tex-pt-fb);
-   GLERRV(glsym_glBindFramebuffer);
 
// Rely on Evas_GL_Image infrastructure to allocate pixels
im2-im = (RGBA_Image 
*)evas_cache_image_empty(evas_common_image_cache_get());
@@ -652,7 +651,6 @@ _rotate_image_data(void *data, void *img)
  }
 
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
-   GLERRV(glsym_glBindFramebuffer);
 
return im2;
 }
@@ -725,7 +723,6 @@ eng_image_data_get(void *data, void *image, int to_write, 
DATA32 **image_data, i
 if (!im-tex-pt-dyn.data)
   {
  if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- GLERRV(secsym_eglMapImageSEC);
  return im;
   }
 im-tex-pt-dyn.checked_out++;
@@ -1600,12 +1597,10 @@ eng_gl_get_pixels_post(void *data EINA_UNUSED)
 }
 
 static Eina_Bool
-eng_gl_surface_lock(void *data, void *surface)
+eng_gl_surface_lock(void *data EINA_UNUSED, void *surface)
 {
-   Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
 
-   EVGLINIT(re, EINA_FALSE);
if (!im-tex || !im-tex-pt)
  {
 ERR(Can not lock image that is not a surface!);
@@ -1618,27 +1613,25 @@ eng_gl_surface_lock(void *data, void *surface)
 }
 
 static Eina_Bool
-eng_gl_surface_unlock(void *data, void *surface)
+eng_gl_surface_unlock(void *data EINA_UNUSED, void *surface)
 {
-   Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
 
-   EVGLINIT(re, EINA_FALSE);
im-locked = EINA_FALSE;
return EINA_TRUE;
 }
 
 static Eina_Bool
-eng_gl_surface_read_pixels(void *data, void *surface,
+eng_gl_surface_read_pixels(void *data EINA_UNUSED, void *surface,
int x, int y, int w, int h,
Evas_Colorspace cspace, void *pixels)
 {
-   Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
+   GLint fmt = GL_BGRA;
+   int done = 0;
 
EINA_SAFETY_ON_NULL_RETURN_VAL(pixels, EINA_FALSE);
 
-   EVGLINIT(re, EINA_FALSE);
if (!im-locked)
  {
 // For now, this is useless, but let's force clients to lock :)
@@ -1657,10 +1650,20 @@ eng_gl_surface_read_pixels(void *data, void *surface,
 */
 
glsym_glBindFramebuffer(GL_FRAMEBUFFER, im-tex-pt-fb);
-   GLERRV(glsym_glBindFramebuffer);
-   if (im-tex-pt-format == GL_BGRA)
- glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
-   else
+   glPixelStorei(GL_PACK_ALIGNMENT, 4);
+
+   // With GLX we will try to read BGRA even if the driver reports RGBA
+#if defined(GL_GLES)  defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT)
+   glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, fmt);
+#endif
+
+   if ((im-tex-pt-format == GL_BGRA)  (fmt == GL_BGRA))
+ {
+glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
+done = (glGetError() == GL_NO_ERROR);
+ }
+
+   if (!done)
  {
 DATA32 *ptr = pixels;
 int k;
@@ -1674,8 +1677,8 @@ eng_gl_surface_read_pixels(void *data, void *surface,
| ((v  0x00FF)  16);
   }
  }
+
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
-   GLERRV(glsym_glBindFramebuffer);
 
return EINA_TRUE;
 }

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-12 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=253322e9058a4b3ea4bee53a32345af7f6bd0911

commit 253322e9058a4b3ea4bee53a32345af7f6bd0911
Author: Raster ras...@rasterman.com
Date:   Tue May 12 04:03:23 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index cd41d8e..2886999 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -194,6 +194,8 @@ make_sandwich(enum filling *fillings, int num_fillings)
 
 sandwich = malloc(sizeof(struct sandwich));
 if (!sandwich) return NULL;
+get_bread_top((sandwich-top));
+get_bread_bottom((sandwich-bottom));
 sandwich-fillings = malloc(sizeof(enum filling) * num_fillings);
 if (!sandwich-fillings)
   {
@@ -211,11 +213,19 @@ I may call the function as follows:
 
 code c
 struct sandwich *sandwich;
-struct filling my_fillings[3] = {FILLING_HAM, CHEESE, BUTTER};
+struct filling my_fillings[3] = {FILLING_HAM, FILLING_CHEESE, FILLING_BUTTER};
 
 sandwich = make_sandwich(my_fillings, 3);
 /code
 
+You will notice we used little markers such at * to indicate the variable is a 
//POINTER// to that type of variable. This also is used for return types of 
functions. This level of indirection (to return something that points to the 
the real thing) is very common, because it is very efficient (returning only 4 
or 8 bytes of data) and keeping the original data exactly where it is without 
needing any copies. It means we can modify the same object from many locations 
by passing around a poin [...]
+
+We also use the  operator to get the pointer //TO// that element in 
memory. This is a great way of passing in please do something to THIS THING 
HERE that i have. In the above case, we call an imaginary function that we 
haven't specified above to get a bread slice and place it into the top and 
bottom elements of the sandwich.
+
+So back to functions, They exist mostly to hide complexity. Many simple things 
you will see are actually rather complex, and are many detailed steps to get it 
right. Functions encapsulate this and hide it at a higher level. They are 
basically ways of summarizing this bit of code here with a defined set of 
input parameters (0 or more) and a return value (or no return) when the 
function is done. When a function is called, execution waits for it to finish 
before resuming in the current scope.
+
+In C (and on a machine) everything lives in memory somewhere, and so functions 
can even have pointers. This is a very useful mechanism to say call this thing 
here, when this other things happens. What this thing here is can be 
modified at runtime to point to any function you like. These are often referred 
to as Callbacks. See below for more details on these.
+
  Types 
  Arithmetic 
  Logic 

-- 




[EGIT] [core/efl] master 01/01: Eina log: Fix previous commit (ERR CRI - bt)

2015-05-12 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=22ef03cd5332cb5687b6398fb696292e3d0f7ae7

commit 22ef03cd5332cb5687b6398fb696292e3d0f7ae7
Author: Jean-Philippe Andre jp.an...@samsung.com
Date:   Tue May 12 19:34:55 2015 +0900

Eina log: Fix previous commit (ERR  CRI - bt)

This was a  comparison, not =
I don't totally agree on taking the bts for each error... just try
to cat a binary file in terminology and have fun.
---
 src/lib/eina/eina_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c
index a9eb9aa..6fc9626 100644
--- a/src/lib/eina/eina_log.c
+++ b/src/lib/eina/eina_log.c
@@ -121,7 +121,7 @@ static Eina_Bool _disable_timing = EINA_TRUE;
 static int _abort_level_on_critical = EINA_LOG_LEVEL_CRITICAL;
 
 #ifdef EINA_LOG_BACKTRACE
-static int _backtrace_level = 1; // CRI  ERR by default
+static int _backtrace_level = 2; // CRI  ERR by default
 #endif
 
 static Eina_Bool _threads_enabled = EINA_FALSE;

-- 




[EGIT] [core/efl] master 01/01: Eina log: Enable backtrace only for CRI and ERR by default

2015-05-12 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=65b53f4a3737196a9caf100e06ccebfa0aed8e87

commit 65b53f4a3737196a9caf100e06ccebfa0aed8e87
Author: Jean-Philippe Andre jp.an...@samsung.com
Date:   Tue May 12 19:00:57 2015 +0900

Eina log: Enable backtrace only for CRI and ERR by default

Using EINA_LOG_LEVEL=4 for standard debugging has now become
absolutely horrible (and slow!). Backtraces may make sense in
case of ERR and CRI messages, but are just pollution for other
levels.

WRN could be argued over but the old env variable is still there
so just use it if you want backtraces:

$ export EINA_LOG_BACKTRACE=2
---
 src/lib/eina/eina_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c
index 5f458f0..a9eb9aa 100644
--- a/src/lib/eina/eina_log.c
+++ b/src/lib/eina/eina_log.c
@@ -121,7 +121,7 @@ static Eina_Bool _disable_timing = EINA_TRUE;
 static int _abort_level_on_critical = EINA_LOG_LEVEL_CRITICAL;
 
 #ifdef EINA_LOG_BACKTRACE
-static int _backtrace_level = 999;
+static int _backtrace_level = 1; // CRI  ERR by default
 #endif
 
 static Eina_Bool _threads_enabled = EINA_FALSE;

-- 




[EGIT] [core/efl] master 01/02: ecore-drm: Add API function to test if an output can go on a given crtc

2015-05-12 Thread Christopher Michael
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8a3441dfe9f2c59586498b41cc87fc26288b7d06

commit 8a3441dfe9f2c59586498b41cc87fc26288b7d06
Author: Chris Michael cp.mich...@samsung.com
Date:   Mon May 11 12:37:24 2015 -0400

ecore-drm: Add API function to test if an output can go on a given crtc

Summary: This adds a new API function to test if a given
Ecore_Drm_Output can be used on a given crtc. This is needed for DRM
RandR support

@feature

Signed-off-by: Chris Michael cp.mich...@samsung.com
---
 src/lib/ecore_drm/Ecore_Drm.h| 16 +
 src/lib/ecore_drm/ecore_drm_output.c | 64 
 2 files changed, 80 insertions(+)

diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index 481da42..f468b56 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -906,6 +906,22 @@ EAPI void ecore_drm_output_crtc_size_get(Ecore_Drm_Output 
*output, int *width, i
  */
 EAPI Ecore_Drm_Output *ecore_drm_device_output_name_find(Ecore_Drm_Device 
*dev, const char *name);
 
+/**
+ * Get if an Ecore_Drm_Output can be used on a given crtc
+ *
+ * This function will loop the possible crtcs of an encoder to determine if
+ * a given output can be assigned to a given crtc
+ *
+ * @param output The Ecore_Drm_Output to test if can be used on crtc
+ * @param crtc The crtc to test an Ecore_Drm_Output against
+ *
+ * @return EINA_TRUE if the output can be assigned to given crtc, EINA_FALSE 
otherwise
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.15
+ */
+EAPI Eina_Bool ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, 
unsigned int crtc);
+
 # ifdef __cplusplus
 }
 # endif
diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index 2596538..a76a8ec 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -1291,3 +1291,67 @@ ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, 
int *width, int *height
if (width) *width = output-crtc-width;
if (height) *height = output-crtc-height;
 }
+
+EAPI Eina_Bool
+ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsigned int crtc)
+{
+   Ecore_Drm_Device *dev;
+   drmModeRes *res;
+   drmModeConnector *conn;
+   drmModeEncoder *enc;
+   int i, j;
+   unsigned int p;
+   Eina_Bool ret = EINA_FALSE;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output-dev, EINA_FALSE);
+
+   dev = output-dev;
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(dev-drm.fd  0, EINA_FALSE);
+
+   /* get the resources */
+   if (!(res = drmModeGetResources(dev-drm.fd)))
+ {
+ERR(Could not get resources for drm card: %m);
+return EINA_FALSE;
+ }
+
+   for (i = 0; i  res-count_connectors; i++)
+ {
+/* get the connector */
+if (!(conn = drmModeGetConnector(dev-drm.fd, res-connectors[i])))
+  continue;
+
+for (j = 0; j  conn-count_encoders; j++)
+  {
+ /* get the encoder on this connector */
+ if (!(enc = drmModeGetEncoder(dev-drm.fd, conn-encoders[j])))
+   {
+  WRN(Failed to get encoder: %m);
+  continue;
+   }
+
+ /* get the encoder for given crtc */
+ if (enc-crtc_id != crtc) goto next;
+
+ p = enc-possible_crtcs;
+
+ /* Does the CRTC match the list of possible CRTCs from the 
encoder? */
+ if (p  (1  output-crtc_id))
+   ret = EINA_TRUE;
+
+next:
+ drmModeFreeEncoder(enc);
+ if (ret) break;
+  }
+
+/* free the connector */
+drmModeFreeConnector(conn);
+if (ret) break;
+ }
+
+   /* free resources */
+   drmModeFreeResources(res);
+
+   return ret;
+}

-- 




[EGIT] [core/efl] master 01/01: eolian: fix wrong enum tests

2015-05-12 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6e7ab244f7609f4655e683c2df829a9e9e461d60

commit 6e7ab244f7609f4655e683c2df829a9e9e461d60
Author: Daniel Kolesa d.kol...@osg.samsung.com
Date:   Tue May 12 14:37:16 2015 +0100

eolian: fix wrong enum tests
---
 src/tests/eolian/data/enum.eo | 6 +++---
 src/tests/eolian/eolian_parsing.c | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/tests/eolian/data/enum.eo b/src/tests/eolian/data/enum.eo
index 43592f7..f326e47 100644
--- a/src/tests/eolian/data/enum.eo
+++ b/src/tests/eolian/data/enum.eo
@@ -9,13 +9,13 @@ enum Bar {
 foo = enum Foo.baz
 }
 
-type Baz: enum _Baz {
+enum Baz {
 flag1 = 1  0,
 flag2 = 1  1,
 flag3 = 1  2
-};
+}
 
-const Bah: int = Baz.flag1;
+const Bah: int = enum Baz.flag1;
 
 class Enum {
 methods {
diff --git a/src/tests/eolian/eolian_parsing.c 
b/src/tests/eolian/eolian_parsing.c
index 99113ef..fddc183 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -886,8 +886,7 @@ START_TEST(eolian_enum)
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 15);
 
-   fail_if(!(type = eolian_type_alias_get_by_name(Baz)));
-   fail_if(!(type = eolian_type_base_type_get(type)));
+   fail_if(!(type = eolian_type_enum_get_by_name(Baz)));
 
fail_if(!(field = eolian_type_enum_field_get(type, flag1)));
fail_if(!(exp = eolian_type_enum_field_value_get(field)));

-- 




[EGIT] [core/efl] master 01/01: ecore-wayland: Input grab_count is unsigned int, no need for comparison 0

2015-05-12 Thread Christopher Michael
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d278cd5f49c4677e53d2e224486c4c182a731d95

commit d278cd5f49c4677e53d2e224486c4c182a731d95
Author: Chris Michael cp.mich...@samsung.com
Date:   Tue May 12 09:14:26 2015 -0400

ecore-wayland: Input grab_count is unsigned int, no need for comparison  0

Summary: As input-grab_count is an unsigned int there is no need for
the  0 comparison as that will always return false

@fix

Signed-off-by: Chris Michael cp.mich...@samsung.com
---
 src/lib/ecore_wayland/ecore_wl_input.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_input.c 
b/src/lib/ecore_wayland/ecore_wl_input.c
index 294121f..61c32b4 100755
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -601,9 +601,8 @@ _ecore_wl_input_cb_pointer_button(void *data, struct 
wl_pointer *pointer EINA_UN
 0, button, timestamp);
 
 input-grab_count--;
-if (input-grab_count  0)
-input-grab_count = 0;
-if ((input-grab)  (input-grab_button == button)  (!state)  
(!input-grab_count))
+if ((input-grab)  (input-grab_button == button)  
+(!state)  (!input-grab_count))
   ecore_wl_input_ungrab(input);
  }
 
@@ -1110,9 +1109,8 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch 
*touch EINA_UNUSED, unsi
 
_ecore_wl_input_mouse_up_send(input, input-touch_focus, id, BTN_LEFT, 
timestamp);
input-grab_count--;
-   if (input-grab_count  0)
- input-grab_count = 0;
-   if ((input-grab)  (input-grab_button == BTN_LEFT)  
(!input-grab_count))
+   if ((input-grab)  (input-grab_button == BTN_LEFT)  
+   (!input-grab_count))
  ecore_wl_input_ungrab(input);
 }
 

-- 




[EGIT] [core/elementary] master 02/02: atspi: add component interface to elm_widget_item objects.

2015-05-12 Thread Lukasz Stanislawski
stanluk pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=fb4608d9dae9123f451dd1ebc4c10c2b2c996884

commit fb4608d9dae9123f451dd1ebc4c10c2b2c996884
Author: Lukasz Stanislawski l.stanisl...@samsung.com
Date:   Tue May 12 15:30:52 2015 +0200

atspi: add component interface to elm_widget_item objects.
---
 src/lib/elm_widget.c   | 56 ++
 src/lib/elm_widget_item.eo |  8 ++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 4bb2a59..1763bc5 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -5702,5 +5702,61 @@ 
_elm_widget_elm_interface_atspi_accessible_relation_set_get(Eo *obj, Elm_Widget_
return list;
 }
 
+EOLIAN static void
+_elm_widget_item_elm_interface_atspi_component_extents_get(Eo *obj 
EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords, int 
*x, int *y, int *w, int *h)
+{
+   int ee_x, ee_y;
+
+   if (!sd-view)
+ {
+if (x) *x = -1;
+if (y) *y = -1;
+if (w) *w = -1;
+if (h) *h = -1;
+return;
+ }
+
+   evas_object_geometry_get(sd-view, x, y, w, h);
+   if (screen_coords)
+ {
+Ecore_Evas *ee = 
ecore_evas_ecore_evas_get(evas_object_evas_get(sd-view));
+if (!ee) return;
+ecore_evas_geometry_get(ee, ee_x, ee_y, NULL, NULL);
+if (x) *x += ee_x;
+if (y) *y += ee_y;
+ }
+}
+
+EOLIAN static Eina_Bool
+_elm_widget_item_elm_interface_atspi_component_extents_set(Eo *obj 
EINA_UNUSED, Elm_Widget_Item_Data *sd EINA_UNUSED, Eina_Bool screen_coords 
EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h 
EINA_UNUSED)
+{
+   return EINA_FALSE;
+}
+
+EOLIAN static int
+_elm_widget_item_elm_interface_atspi_component_layer_get(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *sd EINA_UNUSED)
+{
+   if (!sd-view)
+ return -1;
+   return evas_object_layer_get(sd-view);
+}
+
+EOLIAN static Eina_Bool
+_elm_widget_item_elm_interface_atspi_component_focus_grab(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *_pd EINA_UNUSED)
+{
+   elm_object_item_focus_set(obj, EINA_TRUE);
+   return elm_object_item_focus_get(obj);
+}
+
+EOLIAN static double
+_elm_widget_item_elm_interface_atspi_component_alpha_get(Eo *obj EINA_UNUSED, 
Elm_Widget_Item_Data *sd EINA_UNUSED)
+{
+   int alpha;
+
+   if (!sd-view) return -1.0;
+   evas_object_color_get(sd-view, NULL, NULL, NULL, alpha);
+   return (double)alpha / 255.0;
+}
+
 #include elm_widget_item.eo.c
 #include elm_widget.eo.c
diff --git a/src/lib/elm_widget_item.eo b/src/lib/elm_widget_item.eo
index c40ce28..771edac 100644
--- a/src/lib/elm_widget_item.eo
+++ b/src/lib/elm_widget_item.eo
@@ -1,4 +1,5 @@
-class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible)
+class Elm.Widget_Item(Eo.Base, Elm_Interface_Atspi_Accessible,
+  Elm_Interface_Atspi_Component)
 {
   eo_prefix: elm_wdg_item;
   legacy_prefix: elm_object_item;
@@ -729,5 +730,10 @@ class Elm.Widget_Item(Eo.Base, 
Elm_Interface_Atspi_Accessible)
Elm_Interface_Atspi_Accessible.role.set;
Elm_Interface_Atspi_Accessible.state_set.get;
Elm_Interface_Atspi_Accessible.parent.get;
+   Elm_Interface_Atspi_Component.extents.get;
+   Elm_Interface_Atspi_Component.extents.set;
+   Elm_Interface_Atspi_Component.alpha.get;
+   Elm_Interface_Atspi_Component.layer.get;
+   Elm_Interface_Atspi_Component.focus_grab;
   }
 }

-- 




[EGIT] [core/efl] master 01/01: eolian: update eolian_type_base_type_get for REGULAR types

2015-05-12 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5f32c178e94a9f932d4628cb6d98cd939235bc40

commit 5f32c178e94a9f932d4628cb6d98cd939235bc40
Author: Daniel Kolesa d.kol...@osg.samsung.com
Date:   Tue May 12 14:27:02 2015 +0100

eolian: update eolian_type_base_type_get for REGULAR types
---
 src/lib/eolian/Eolian.h|  5 -
 src/lib/eolian/database_type_api.c | 18 +-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 77b26b0..af2d575 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -1619,7 +1619,10 @@ EAPI Eina_Stringshare *eolian_type_description_get(const 
Eolian_Type *tp);
 EAPI Eina_Stringshare *eolian_type_file_get(const Eolian_Type *tp);
 
 /*
- * @brief Get the base type of a pointer or alias type.
+ * @brief Get the base type of a pointer, alias or regular type.
+ *
+ * For pointers and aliases, it's a simple lookup. For regular types, it
+ * tries to look up alias, struct and enum in that order.
  *
  * @param[in] tp the type.
  * @return the base type when @c tp is a pointer or alias, NULL otherwise.
diff --git a/src/lib/eolian/database_type_api.c 
b/src/lib/eolian/database_type_api.c
index b755471..8f95590 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -204,7 +204,23 @@ eolian_type_base_type_get(const Eolian_Type *tp)
Eolian_Type_Type tpt;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
tpt = eolian_type_type_get(tp);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(tpt == EOLIAN_TYPE_POINTER || tpt == 
EOLIAN_TYPE_ALIAS, NULL);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(tpt == EOLIAN_TYPE_POINTER
+|| tpt == EOLIAN_TYPE_ALIAS
+|| tpt == EOLIAN_TYPE_REGULAR, NULL);
+   if (tpt == EOLIAN_TYPE_REGULAR)
+ {
+/* for regular types, try looking up if it belongs to a struct,
+ * enum or an alias... otherwise return NULL
+ */
+   Eolian_Type *rtp;
+   rtp = eina_hash_find(_aliases, tp-full_name);
+   if (rtp) return rtp;
+   rtp = eina_hash_find(_structs, tp-full_name);
+   if (rtp) return rtp;
+   rtp = eina_hash_find(_enums, tp-full_name);
+   if (rtp) return rtp;
+   return NULL;
+ }
return tp-base_type;
 }
 

-- 




[EGIT] [core/efl] master 01/01: eolian: butts

2015-05-12 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ed58165b501d24aee0cffebe464208cdf850ecda

commit ed58165b501d24aee0cffebe464208cdf850ecda
Author: Daniel Kolesa d.kol...@osg.samsung.com
Date:   Tue May 12 16:15:29 2015 +0100

eolian: butts
---
 src/bin/eolian/eo_generator.c   |   4 +-
 src/bin/eolian/types_generator.c|   6 +--
 src/bindings/luajit/eolian.lua  |  22 +++-
 src/lib/ecore_con/ecore_con_base.eo |   4 +-
 src/lib/eolian/Eolian.h |   3 --
 src/lib/eolian/database_expr.c  |  52 ++
 src/lib/eolian/database_expr_api.c  |  11 ++--
 src/lib/eolian/database_type.c  |  19 +--
 src/lib/eolian/database_validate.c  |  30 +--
 src/lib/eolian/eo_parser.c  | 103 +++-
 src/tests/eolian/data/enum.eo   |   4 +-
 src/tests/eolian/data/free_func.eo  |   8 ---
 src/tests/eolian/data/struct.eo |  14 +
 src/tests/eolian/data/struct_ref.c  |  24 +++--
 src/tests/eolian/eolian_parsing.c   |  25 ++---
 15 files changed, 50 insertions(+), 279 deletions(-)

diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 617de5f..738f32a 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -468,7 +468,7 @@ eo_bind_func_generate(const Eolian_Class *class, const 
Eolian_Function *funcid,
  eina_strbuf_append_printf(params_init,
   if (%s) *%s = %s;,
pname, pname, val_str);
- if (eolian_expression_type_get(dflt_value) == 
EOLIAN_EXPR_ENUM)
+ if (eolian_expression_type_get(dflt_value) == 
EOLIAN_EXPR_NAME)
{
   Eina_Stringshare *string = 
eolian_expression_serialize(dflt_value);
   eina_strbuf_append_printf(params_init,  
/* %s */, string);
@@ -586,7 +586,7 @@ eo_bind_func_generate(const Eolian_Class *class, const 
Eolian_Function *funcid,
  eina_strbuf_append_printf(eo_func_decl, , %s%s, %s,
ret_const ? const  : , rettype,
val_str?val_str:0);
- if (val_str  eolian_expression_type_get(default_ret_val) == 
EOLIAN_EXPR_ENUM)
+ if (val_str  eolian_expression_type_get(default_ret_val) == 
EOLIAN_EXPR_NAME)
{
   Eina_Stringshare *string = 
eolian_expression_serialize(default_ret_val);
   eina_strbuf_append_printf(eo_func_decl,  /* %s */, string);
diff --git a/src/bin/eolian/types_generator.c b/src/bin/eolian/types_generator.c
index 15bf535..abe926b 100644
--- a/src/bin/eolian/types_generator.c
+++ b/src/bin/eolian/types_generator.c
@@ -91,8 +91,7 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, 
Eina_Bool full)
free(name);
break;
 }
-  eina_strbuf_append_printf(buf, struct%s%s {\n, name? :, 
name?name:);
-  free(name);
+  eina_strbuf_append_printf(buf, typedef struct\n{\n);
   Eina_Iterator *members = eolian_type_struct_fields_get(tp);
   EINA_ITERATOR_FOREACH(members, member)
 {
@@ -106,7 +105,8 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, 
Eina_Bool full)
eina_strbuf_append(buf, \n);
 }
   eina_iterator_free(members);
-  eina_strbuf_append(buf, });
+  eina_strbuf_append_printf(buf, } %s, name);
+  free(name);
   break;
}
   case EOLIAN_TYPE_ENUM:
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 9868170..21c73d7 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -61,8 +61,6 @@ ffi.cdef [[
 EOLIAN_TYPE_UNKNOWN_TYPE,
 EOLIAN_TYPE_VOID,
 EOLIAN_TYPE_REGULAR,
-EOLIAN_TYPE_REGULAR_STRUCT,
-EOLIAN_TYPE_REGULAR_ENUM,
 EOLIAN_TYPE_COMPLEX,
 EOLIAN_TYPE_POINTER,
 EOLIAN_TYPE_FUNCTION,
@@ -88,7 +86,6 @@ ffi.cdef [[
 EOLIAN_EXPR_NULL,
 EOLIAN_EXPR_BOOL,
 EOLIAN_EXPR_NAME,
-EOLIAN_EXPR_ENUM,
 EOLIAN_EXPR_UNARY,
 EOLIAN_EXPR_BINARY
 } Eolian_Expression_Type;
@@ -431,16 +428,14 @@ M.type_type = {
 UNKNOWN= 0,
 VOID   = 1,
 REGULAR= 2,
-REGULAR_STRUCT = 3,
-REGULAR_ENUM   = 4,
-COMPLEX= 5,
-POINTER= 6,
-FUNCTION   = 7,
-STRUCT = 8,
-STRUCT_OPAQUE  = 9,
-ENUM   = 10,
-ALIAS  = 11,
-CLASS  = 12
+COMPLEX= 3,
+POINTER= 4,
+FUNCTION   = 5,
+STRUCT = 6,
+STRUCT_OPAQUE  = 7,
+ENUM   = 8,
+ALIAS   

[EGIT] [core/efl] master 01/01: eolian_cxx: Fix @beta on generated bindings for C++

2015-05-12 Thread Vitor Sousa
tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2c48b3212a326758bfdbbe2f6bd6f292dcc1cd33

commit 2c48b3212a326758bfdbbe2f6bd6f292dcc1cd33
Author: Vitor Sousa vitorsousasi...@gmail.com
Date:   Tue May 12 11:45:16 2015 -0300

eolian_cxx: Fix @beta on generated bindings for C++
---
 src/bin/eolian_cxx/convert.cc  |   3 +
 src/bin/eolian_cxx/eolian_wrappers.hh  |   7 ++
 src/lib/eolian_cxx/eo_types.hh |   2 +
 .../grammar/eo_class_scope_guard_generator.hh  |   4 +
 .../grammar/inheritance_base_generator.hh  | 100 ++---
 5 files changed, 63 insertions(+), 53 deletions(-)

diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index 4d03c8f..4f92b97 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -142,6 +142,7 @@ _convert_property_set_to_function(Eolian_Class const klass,
  {
efl::eolian::eo_function::regular_,
function_scope(prop_),
+   function_is_beta(prop_),
function_name(prop_) + _set,
function_impl(prop_) + _set,
function_return_type(prop_, eolian_cxx::setter),
@@ -170,6 +171,7 @@ _convert_property_get_to_function(Eolian_Class const klass,
  {
efl::eolian::eo_function::regular_,
function_scope(prop_),
+   function_is_beta(prop_),
function_name(prop_) + _get,
function_impl(prop_) + _get,
function_return_type(prop_, eolian_cxx::getter),
@@ -218,6 +220,7 @@ _convert_function(Eolian_Class const klass, 
Eolian_Function const func)
return {
  function_type(func),
  function_scope(func),
+ function_is_beta(func),
  function_name(func),
  function_impl(func),
  function_return_type(func),
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh 
b/src/bin/eolian_cxx/eolian_wrappers.hh
index 5b6579e..0dd9890 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -204,6 +204,12 @@ function_is_constructor(Eolian_Class const cls, 
Eolian_Function const func)
return ::eolian_function_is_constructor(func, cls);
 }
 
+inline bool
+function_is_beta(Eolian_Function const func)
+{
+   return ::eolian_function_is_beta(func);
+}
+
 inline efl::eolian::eolian_scope
 function_scope(Eolian_Function const func)
 {
@@ -403,6 +409,7 @@ event_create(Eolian_Class const klass, const Eolian_Event 
*event_)
 std::transform(name_.begin(), name_.end(), name_.begin(),
[](int c) { return c != ',' ? c : '_'; });
 event.scope = eolian_scope_cxx(::eolian_event_scope_get(event_));
+event.is_beta = (::eolian_event_is_beta(event_) != EINA_FALSE);
 event.name = normalize_spaces(name_);
 event.eo_name = safe_upper
   (find_replace(class_full_name(klass), ., _) + _EVENT_ + 
event.name);
diff --git a/src/lib/eolian_cxx/eo_types.hh b/src/lib/eolian_cxx/eo_types.hh
index 843c2fa..431ba05 100644
--- a/src/lib/eolian_cxx/eo_types.hh
+++ b/src/lib/eolian_cxx/eo_types.hh
@@ -285,6 +285,7 @@ struct eo_function
  };
eo_function_type type;
eolian_scope scope;
+   bool is_beta;
std::string name;
std::string impl;
eolian_type_instance ret;
@@ -297,6 +298,7 @@ struct eo_event
eo_event() : scope(eolian_scope::public_) {}
   
eolian_scope scope;
+   bool is_beta;
std::string name;
std::string eo_name;
//parameters_container_type params; // XXX desirable.
diff --git a/src/lib/eolian_cxx/grammar/eo_class_scope_guard_generator.hh 
b/src/lib/eolian_cxx/grammar/eo_class_scope_guard_generator.hh
index 9d545c3..5915c38 100644
--- a/src/lib/eolian_cxx/grammar/eo_class_scope_guard_generator.hh
+++ b/src/lib/eolian_cxx/grammar/eo_class_scope_guard_generator.hh
@@ -29,6 +29,8 @@ operator(std::ostream out, _scope_guard_headT const x)
assert(x._e.scope != eolian_scope::private_);
if (x._e.scope == eolian_scope::protected_)
  out  #ifdef   name_upper(x._cls)  _PROTECTED  endl;
+   if (x._e.is_beta)
+ out  #ifdef   name_upper(x._cls)  _BETA  endl;
return out;
 }
 
@@ -53,6 +55,8 @@ operator(std::ostream out, _scope_guard_tailT const x)
 {
if (x._e.scope == eolian_scope::protected_)
  out  #endif  endl;
+   if (x._e.is_beta)
+ out  #endif  endl;
return out;
 }
 
diff --git a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh 
b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
index e134729..ed993f0 100644
--- a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
+++ b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
@@ -31,26 +31,27 @@ struct inheritance_operation
 {
eo_class const _cls;
eo_function const _func;
-   functions_container_type::size_type _idx;
-   inheritance_operation(eo_class const cls, eo_function const func, 
functions_container_type::size_type idx)
- : _cls(cls), _func(func), _idx(idx)
+   inheritance_operation(eo_class const cls,