.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
EFL bindings for C++ and JS
Expertise Solutions
Felipe 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
Eina_List * raw = · · · ;
e f l : : e i n a : : l i s t <int > l i s t ( raw ) ;
f o r ( auto x : l i s t )
std : : cout << x << std : : endl ;
c a l l _ c _ f u n c t i o n ( l i s t . native_handle ( ) ) ;
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Thin wrappers
/// @ b r i e f Eo C on s t ru ct or .
///
/// Co nst ruc ts the o b j e c t from an Eo* p o i n t e r s
///
/// @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 canvas ( Eo* eo )
: e f l : : eo : : base ( eo )
{}
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Thin wrappers
e f l : : e i n a : : r a n g e _ l i s t <evas : : object >
foo () const
{
Eina_List * _tmp_ret ;
eo_do ( _eo_ptr ( ) , _tmp_ret = : : bar_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 < evas : : o b j e c t >>
( _tmp_ret ,
std : : tuple <std : : f al se _t yp e ,
std : : fa ls e_ ty pe >());
}
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Modern API and C++11
▶ Show examples
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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
template <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 : : is_pod<T>, _pod_inarray <T>
, _nonpod_inarray<T> >:: type
{
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Type Traits
template <typename C o 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
<C o n t i g u o u s I t e r a t o r >:: value >:: type * = 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
template <typename T, typename Enable = void >
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>
{};
template <>
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
<std : : s t r i n g : : c o n s t _ i t e r a t o r > : true_type
{};
template <>
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
<std : : s t r i n g : : i t e r a t o r > : true_type
{};
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
JavaScript
▶ Using V8
▶ Initial development of EINA data structures
▶ We’re looking for an API that mimics what JS
developers would expect
▶ Ideas on JS bindings
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
JavaScript
▶ Using V8
▶ Initial development of EINA data structures
▶ We’re looking for an API that mimics what JS
developers would expect
▶ Ideas on JS bindings
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
JavaScript
▶ Using V8
▶ Initial development of EINA data structures
▶ We’re looking for an API that mimics what JS
developers 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
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Ideas to build on JS and Lua bindings
▶ Portability
▶ GUI for JavaScript
▶ AppStore
▶ More ideas to create today

[E-Dev-Day 2014][5/16] C++ and JavaScript bindings for EFL and Elementary