[e-dev-day 2014][5/16] c++ and javascript bindings for efl and elementary
TRANSCRIPT
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
EFL bindings for C++ and JS
Expertise SolutionsFelipe Magno de Almeida
October 11, 2014
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Status
▶ C++ binding status▶ Stabilization phase
▶ JavaScript binding status▶ Early development
▶ EINA
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Status
▶ C++ binding status▶ Stabilization phase
▶ JavaScript binding status▶ Early development
▶ EINA
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Status
▶ C++ binding status▶ Stabilization phase
▶ JavaScript binding status▶ Early development
▶ EINA
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Status
▶ C++ binding status▶ Stabilization phase
▶ JavaScript binding status▶ Early development
▶ EINA
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Status
▶ C++ binding status▶ Stabilization phase
▶ JavaScript binding status▶ Early development
▶ EINA
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Performance
▶ Thin wrapper for C▶ Eina C++
▶ Expedite C++
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Performance
▶ Thin wrapper for C▶ Eina C++
▶ Expedite C++
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Thin wrappers
E i n a_L i s t * raw = · · · ;
e f l : : e i n a : : l i s t <i n t > l i s t ( raw ) ;f o r ( auto x : l i s t )
s t d : : cou t << x << s td : : e n d l ;
c a l l _ c_ f u n c t i o n ( l i s t . n a t i v e_h and l e ( ) ) ;
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Thin wrappers
/// @ b r i e f Eo Con s t r u c t o r .////// Con s t r u c t s the o b j e c t from an Eo* p o i n t e r s t e a l i n g i t s owne r s h i p .////// @param eo The Eo o b j e c t p o i n t e r .///e x p l i c i t c anva s ( Eo* eo )
: e f l : : eo : : ba se ( eo ){}
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Thin wrappers
e f l : : e i n a : : r a n g e_ l i s t <eva s : : o b j e c t >foo ( ) c on s t
{E i n a_L i s t * _tmp_ret ;
eo_do ( _eo_ptr ( ) , _tmp_ret = : : ba r_foo ( ) ) ;
r e t u r n e f l : : e o l i a n : : to_cxx<e f l : : e i n a : : r a n g e_ l i s t < eva s : : o b j e c t >>( _tmp_ret ,s t d : : t u p l e <s t d : : f a l s e_ t y p e ,
s t d : : f a l s e_ t y p e >( ) ) ;}
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Performance
▶ Thin wrapper for C▶ Eina C++
▶ Expedite C++
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Performance
▶ Thin wrapper for C▶ Eina C++
▶ Expedite C++
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Expedite C++
▶ Comparable performance to C▶ Still a few cases to investigate
▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Expedite C++
▶ Comparable performance to C▶ Still a few cases to investigate
▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Expedite C++
▶ Comparable performance to C▶ Still a few cases to investigate
▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Expedite C++
▶ Comparable performance to C▶ Still a few cases to investigate
▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Expedite C++
▶ Comparable performance to C▶ Still a few cases to investigate
▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
C++
▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Doesn’t depend on Boost
▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Doesn’t depend on Boost
▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Doesn’t depend on Boost
▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Doesn’t depend on Boost
▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Type Traits
t emp l a t e <typename T>c l a s s i n a r r a y: p u b l i c e i n a : : i f _<e i n a : : i s_pod<T>, _pod_inar ray<T>, _nonpod_inar ray<T> >:: t ype
{
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Type Traits
t emp l a t e <typename Co n t i g u o u s I t e r a t o r >s t r i n g s h a r e ( C o n t i g u o u s I t e r a t o r i
, C o n t i g u o u s I t e r a t o r j, typename e i n a : : e n a b l e _ i f<e i n a : : i s _ c o n t i g u o u s _ i t e r a t o r<Co n t i g u o u s I t e r a t o r >: : v a l u e >: : t yp e * = 0): _ s t r i n g ( : : e i n a_ s t r i n g s h a r e_ a d d_ l e n g t h
(&* i , j − i ) ){
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Type Traits
t emp l a t e <typename T, typename Enab l e = vo id>s t r u c t i s _ c o n t i g u o u s _ i t e r a t o r: i n d i r e c t _ i s _ c o n t i g u o u s _ i t e r a t o r <T>
{} ;t emp l a t e <>s t r u c t i s _ c o n t i g u o u s _ i t e r a t o r<s t d : : s t r i n g : : c o n s t _ i t e r a t o r > : t r u e_ t yp e
{} ;t emp l a t e <>s t r u c t i s _ c o n t i g u o u s _ i t e r a t o r<s t d : : s t r i n g : : i t e r a t o r > : t r u e_ t yp e
{} ;
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
JavaScript
▶ Using V8▶ Initial development of EINA data structures▶ We’re looking for an API that mimics what JSdevelopers would expect
▶ Ideas on JS bindings
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
JavaScript
▶ Using V8▶ Initial development of EINA data structures▶ We’re looking for an API that mimics what JSdevelopers would expect
▶ Ideas on JS bindings
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
JavaScript
▶ Using V8▶ Initial development of EINA data structures▶ We’re looking for an API that mimics what JSdevelopers would expect
▶ Ideas on JS bindings
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Ideas to build on JS and Lua bindings
▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Ideas to build on JS and Lua bindings
▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Ideas to build on JS and Lua bindings
▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today