Top Banner
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EFL bindings for C++ and JS Expertise Solutions Felipe Magno de Almeida October 11, 2014
40

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

Jul 30, 2015

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: [E-Dev-Day 2014][5/16] C++ and JavaScript bindings for EFL and Elementary

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

EFL bindings for C++ and JS

Expertise SolutionsFelipe Magno de Almeida

October 11, 2014

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Status

▶ C++ binding status▶ Stabilization phase

▶ JavaScript binding status▶ Early development

▶ EINA

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Status

▶ C++ binding status▶ Stabilization phase

▶ JavaScript binding status▶ Early development

▶ EINA

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Status

▶ C++ binding status▶ Stabilization phase

▶ JavaScript binding status▶ Early development

▶ EINA

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Status

▶ C++ binding status▶ Stabilization phase

▶ JavaScript binding status▶ Early development

▶ EINA

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Status

▶ C++ binding status▶ Stabilization phase

▶ JavaScript binding status▶ Early development

▶ EINA

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Performance

▶ Thin wrapper for C▶ Eina C++

▶ Expedite C++

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Performance

▶ Thin wrapper for C▶ Eina C++

▶ Expedite C++

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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 ( ) ) ;

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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 ){}

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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 >( ) ) ;}

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Performance

▶ Thin wrapper for C▶ Eina C++

▶ Expedite C++

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Performance

▶ Thin wrapper for C▶ Eina C++

▶ Expedite C++

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Expedite C++

▶ Comparable performance to C▶ Still a few cases to investigate

▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Expedite C++

▶ Comparable performance to C▶ Still a few cases to investigate

▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Expedite C++

▶ Comparable performance to C▶ Still a few cases to investigate

▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Expedite C++

▶ Comparable performance to C▶ Still a few cases to investigate

▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Expedite C++

▶ Comparable performance to C▶ Still a few cases to investigate

▶ Naive conversion to C++▶ Test optimizations▶ Allows us to catch performance regressions

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Modern API and C++11

▶ Show examples

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

C++

▶ Focus on performance▶ Modern API▶ Use C++11 features▶ Doesn’t depend on Boost Libraries

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Doesn’t depend on Boost

▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Doesn’t depend on Boost

▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Doesn’t depend on Boost

▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Doesn’t depend on Boost

▶ C++11▶ std :: error_code▶ Type Traits▶ Tuples

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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

{

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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 ) ){

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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

{} ;

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

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

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Ideas to build on JS and Lua bindings

▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Ideas to build on JS and Lua bindings

▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Ideas to build on JS and Lua bindings

▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today

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

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Ideas to build on JS and Lua bindings

▶ Portability▶ GUI for JavaScript▶ AppStore▶ More ideas to create today