summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-08-15 12:31:05 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-10-25 12:23:34 -0200
commit508edf78c6be3165ef56e968e41e1cc875471024 (patch)
tree7f80b99e67ec94af28c046bd2612e6e85517fe5a /src/bindings
parent4f52588b3ce86e3bef7041d76d07eda58c41c79d (diff)
efl_js: Update after eo/efl api changes
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/js/efl_js/efl_js.cc9
-rw-r--r--src/bindings/js/eina_js/eina_js_compatibility.hh8
-rw-r--r--src/bindings/js/eina_js/eina_js_get_value_from_c.hh8
-rw-r--r--src/bindings/js/eo_js/eo_js_construct_from_eo.hh4
-rw-r--r--src/bindings/js/eo_js/eo_js_constructor.hh14
-rw-r--r--src/bindings/js/eo_js/eo_js_event.hh2
6 files changed, 20 insertions, 25 deletions
diff --git a/src/bindings/js/efl_js/efl_js.cc b/src/bindings/js/efl_js/efl_js.cc
index a4b28d8..093380f 100644
--- a/src/bindings/js/efl_js/efl_js.cc
+++ b/src/bindings/js/efl_js/efl_js.cc
@@ -72,6 +72,7 @@ EAPI void register_ecore_audio_out_pulse(v8::Handle<v8::Object> global, v8::Isol
72EAPI void register_ecore_audio_out_sndfile(v8::Handle<v8::Object> global, v8::Isolate* isolate); 72EAPI void register_ecore_audio_out_sndfile(v8::Handle<v8::Object> global, v8::Isolate* isolate);
73 73
74namespace efl { 74namespace efl {
75EAPI void register_object(v8::Handle<v8::Object> global, v8::Isolate* isolate);
75EAPI void register_animator(v8::Handle<v8::Object> global, v8::Isolate* isolate); 76EAPI void register_animator(v8::Handle<v8::Object> global, v8::Isolate* isolate);
76EAPI void register_container(v8::Handle<v8::Object> global, v8::Isolate* isolate); 77EAPI void register_container(v8::Handle<v8::Object> global, v8::Isolate* isolate);
77EAPI void register_control(v8::Handle<v8::Object> global, v8::Isolate* isolate); 78EAPI void register_control(v8::Handle<v8::Object> global, v8::Isolate* isolate);
@@ -95,11 +96,6 @@ namespace efl { namespace ui { namespace win {
95EAPI void register_standard(v8::Handle<v8::Object> global, v8::Isolate* isolate); 96EAPI void register_standard(v8::Handle<v8::Object> global, v8::Isolate* isolate);
96}}} 97}}}
97 98
98namespace eo {
99EAPI void register_abstract_class(v8::Handle<v8::Object> global, v8::Isolate* isolate);
100EAPI void register_base(v8::Handle<v8::Object> global, v8::Isolate* isolate);
101}
102
103namespace efl { namespace canvas { 99namespace efl { namespace canvas {
104EAPI void register_rectangle(v8::Handle<v8::Object> global, v8::Isolate* isolate); 100EAPI void register_rectangle(v8::Handle<v8::Object> global, v8::Isolate* isolate);
105}} 101}}
@@ -314,8 +310,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
314 efl::register_player(exports, v8::Isolate::GetCurrent()); 310 efl::register_player(exports, v8::Isolate::GetCurrent());
315 efl::register_text(exports, v8::Isolate::GetCurrent()); 311 efl::register_text(exports, v8::Isolate::GetCurrent());
316 // efl::register_text_properties(exports, v8::Isolate::GetCurrent()); 312 // efl::register_text_properties(exports, v8::Isolate::GetCurrent());
317 // eo::register_abstract_class(exports, v8::Isolate::GetCurrent()); 313 efl::register_object(exports, v8::Isolate::GetCurrent());
318 eo::register_base(exports, v8::Isolate::GetCurrent());
319#if 1 314#if 1
320 // evas::register_box(exports, v8::Isolate::GetCurrent()); 315 // evas::register_box(exports, v8::Isolate::GetCurrent());
321 // evas::register_canvas(exports, v8::Isolate::GetCurrent()); 316 // evas::register_canvas(exports, v8::Isolate::GetCurrent());
diff --git a/src/bindings/js/eina_js/eina_js_compatibility.hh b/src/bindings/js/eina_js/eina_js_compatibility.hh
index 48cebc5..7b5c920 100644
--- a/src/bindings/js/eina_js/eina_js_compatibility.hh
+++ b/src/bindings/js/eina_js/eina_js_compatibility.hh
@@ -158,14 +158,14 @@ T container_wrap(T&& v)
158inline ::efl::eo::concrete container_wrap(Eo* v) 158inline ::efl::eo::concrete container_wrap(Eo* v)
159{ 159{
160 if(v) 160 if(v)
161 eo_ref(v); 161 efl_ref(v);
162 return ::efl::eo::concrete{v}; 162 return ::efl::eo::concrete{v};
163} 163}
164 164
165inline ::efl::eo::concrete container_wrap(Eo const* v) 165inline ::efl::eo::concrete container_wrap(Eo const* v)
166{ 166{
167 if (v) 167 if (v)
168 eo_ref(v); 168 efl_ref(v);
169 return ::efl::eo::concrete{const_cast<Eo*>(v)}; 169 return ::efl::eo::concrete{const_cast<Eo*>(v)};
170} 170}
171 171
@@ -929,8 +929,8 @@ compatibility_return_type cast_function(compatibility_callback_info_type args)
929 char* class_name = *str; 929 char* class_name = *str;
930 930
931 auto ctor = ::efl::eina::js::get_class_constructor(class_name); 931 auto ctor = ::efl::eina::js::get_class_constructor(class_name);
932 auto obj = new_v8_external_instance(ctor, ::eo_ref(eo), isolate); 932 auto obj = new_v8_external_instance(ctor, ::efl_ref(eo), isolate);
933 efl::eina::js::make_weak(isolate, obj, [eo]{ ::eo_unref(eo); }); 933 efl::eina::js::make_weak(isolate, obj, [eo]{ ::efl_unref(eo); });
934 return compatibility_return(obj, args); 934 return compatibility_return(obj, args);
935 } 935 }
936 else 936 else
diff --git a/src/bindings/js/eina_js/eina_js_get_value_from_c.hh b/src/bindings/js/eina_js/eina_js_get_value_from_c.hh
index 4b1ad44..4d71229 100644
--- a/src/bindings/js/eina_js/eina_js_get_value_from_c.hh
+++ b/src/bindings/js/eina_js/eina_js_get_value_from_c.hh
@@ -143,8 +143,8 @@ inline v8::Local<v8::Value>
143get_value_from_c(Eo* v, v8::Isolate* isolate, const char* class_name) 143get_value_from_c(Eo* v, v8::Isolate* isolate, const char* class_name)
144{ 144{
145 auto ctor = ::efl::eina::js::get_class_constructor(class_name); 145 auto ctor = ::efl::eina::js::get_class_constructor(class_name);
146 auto obj = new_v8_external_instance(ctor, ::eo_ref(v), isolate); 146 auto obj = new_v8_external_instance(ctor, ::efl_ref(v), isolate);
147 efl::eina::js::make_weak(isolate, obj, [v]{ ::eo_unref(v); }); 147 efl::eina::js::make_weak(isolate, obj, [v]{ ::efl_unref(v); });
148 return obj; 148 return obj;
149} 149}
150 150
@@ -153,8 +153,8 @@ get_value_from_c(const Eo* v, v8::Isolate* isolate, const char* class_name)
153{ 153{
154 // TODO: implement const objects? 154 // TODO: implement const objects?
155 auto ctor = ::efl::eina::js::get_class_constructor(class_name); 155 auto ctor = ::efl::eina::js::get_class_constructor(class_name);
156 auto obj = new_v8_external_instance(ctor, ::eo_ref(v), isolate); 156 auto obj = new_v8_external_instance(ctor, ::efl_ref(v), isolate);
157 efl::eina::js::make_weak(isolate, obj, [v]{ ::eo_unref(v); }); 157 efl::eina::js::make_weak(isolate, obj, [v]{ ::efl_unref(v); });
158 return obj; 158 return obj;
159} 159}
160 160
diff --git a/src/bindings/js/eo_js/eo_js_construct_from_eo.hh b/src/bindings/js/eo_js/eo_js_construct_from_eo.hh
index 8008d16..df3274e 100644
--- a/src/bindings/js/eo_js/eo_js_construct_from_eo.hh
+++ b/src/bindings/js/eo_js/eo_js_construct_from_eo.hh
@@ -20,8 +20,8 @@ inline eina::js::compatibility_return_type construct_from_eo(eina::js::compatibi
20 { 20 {
21 Eo* eo = static_cast<Eo*>(v8::External::Cast(*args[0])->Value()); 21 Eo* eo = static_cast<Eo*>(v8::External::Cast(*args[0])->Value());
22 args.This()->SetInternalField(0, args[0]); 22 args.This()->SetInternalField(0, args[0]);
23 ::eo_ref(eo); 23 ::efl_ref(eo);
24 efl::eina::js::make_weak(args.GetIsolate(), args.This(), [eo] { eo_unref(eo); }); 24 efl::eina::js::make_weak(args.GetIsolate(), args.This(), [eo] { efl_unref(eo); });
25 return eina::js::compatibility_return(); 25 return eina::js::compatibility_return();
26 } 26 }
27 else 27 else
diff --git a/src/bindings/js/eo_js/eo_js_constructor.hh b/src/bindings/js/eo_js/eo_js_constructor.hh
index 497f626..191eb9d 100644
--- a/src/bindings/js/eo_js/eo_js_constructor.hh
+++ b/src/bindings/js/eo_js/eo_js_constructor.hh
@@ -89,10 +89,10 @@ struct constructor_caller
89 template <typename T, std::size_t... I> 89 template <typename T, std::size_t... I>
90 void aux(T function, eina::index_sequence<I...>) const 90 void aux(T function, eina::index_sequence<I...>) const
91 { 91 {
92 function(obj_eo_self, get_value<T, I>((*args)[I + *current], args->GetIsolate())...); 92 function(obj_efl_self, get_value<T, I>((*args)[I + *current], args->GetIsolate())...);
93 } 93 }
94 94
95 Eo* obj_eo_self; 95 Eo* obj_efl_self;
96 int* current; 96 int* current;
97 eina::js::compatibility_callback_info_pointer args; 97 eina::js::compatibility_callback_info_pointer args;
98 }; 98 };
@@ -106,10 +106,10 @@ struct constructor_caller
106 { 106 {
107 Eo* parent = eina::js::get_value_from_javascript 107 Eo* parent = eina::js::get_value_from_javascript
108 (args[0], args.GetIsolate(), "", eina::js::value_tag<Eo*>()); 108 (args[0], args.GetIsolate(), "", eina::js::value_tag<Eo*>());
109 Eo* eo = eo_add 109 Eo* eo = efl_add
110 (klass 110 (klass
111 , parent 111 , parent
112 , eina::_mpl::for_each(constructors, call{eo_self, &current_index, &args}) 112 , eina::_mpl::for_each(constructors, call{efl_self, &current_index, &args})
113 ); 113 );
114 if (!eo) 114 if (!eo)
115 throw std::logic_error("Failed to create object."); 115 throw std::logic_error("Failed to create object.");
@@ -118,7 +118,7 @@ struct constructor_caller
118 efl::eina::js::make_weak(args.GetIsolate(), self 118 efl::eina::js::make_weak(args.GetIsolate(), self
119 , [eo] 119 , [eo]
120 { 120 {
121 eo_unref(eo); 121 efl_unref(eo);
122 }); 122 });
123 } 123 }
124 catch(std::logic_error const& error) 124 catch(std::logic_error const& error)
@@ -137,12 +137,12 @@ struct constructor_caller
137 return eina::js::compatibility_return(); 137 return eina::js::compatibility_return();
138 } 138 }
139 139
140 Eo_Class const* klass; 140 Efl_Class const* klass;
141 std::tuple<F...> constructors; 141 std::tuple<F...> constructors;
142}; 142};
143 143
144template <typename... F> 144template <typename... F>
145v8::Handle<v8::Value> constructor_data(v8::Isolate* isolate, Eo_Class const* klass, F... f) 145v8::Handle<v8::Value> constructor_data(v8::Isolate* isolate, Efl_Class const* klass, F... f)
146{ 146{
147 return eina::js::compatibility_new<v8::External> 147 return eina::js::compatibility_new<v8::External>
148 (isolate 148 (isolate
diff --git a/src/bindings/js/eo_js/eo_js_event.hh b/src/bindings/js/eo_js/eo_js_event.hh
index 45d023e..2488125 100644
--- a/src/bindings/js/eo_js/eo_js_event.hh
+++ b/src/bindings/js/eo_js/eo_js_event.hh
@@ -97,7 +97,7 @@ inline eina::js::compatibility_return_type on_event(eina::js::compatibility_call
97 97
98 event_callback_information* i = new event_callback_information 98 event_callback_information* i = new event_callback_information
99 {event, {isolate, eina::js::compatibility_cast<v8::Function>(f)}}; 99 {event, {isolate, eina::js::compatibility_cast<v8::Function>(f)}};
100 eo_event_callback_add(eo, event->event, event->event_callback, i); 100 efl_event_callback_add(eo, event->event, event->event_callback, i);
101 efl::eina::js::make_weak(isolate, self, [i]{ delete i; }); 101 efl::eina::js::make_weak(isolate, self, [i]{ delete i; });
102 } 102 }
103 else 103 else