summaryrefslogtreecommitdiff
path: root/src/bindings/js/eldbus_js/eldbus_js_object_mapper.cc
blob: 955ce8094892aa3226c1f6268a3dfaecdb344f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <Eldbus_Js.hh>

namespace efl { namespace eldbus { namespace js {

namespace {
      
void register_object_event_iface_added(v8::Isolate *isolate,
                                       v8::Handle<v8::Object> global,
                                       v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>(isolate,
                                           ELDBUS_OBJECT_EVENT_IFACE_ADDED));
}

void register_object_event_iface_removed(v8::Isolate *isolate,
                                         v8::Handle<v8::Object> global,
                                         v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>(isolate,
                                           ELDBUS_OBJECT_EVENT_IFACE_REMOVED));
}

void register_object_event_property_changed(v8::Isolate *isolate,
                                            v8::Handle<v8::Object> global,
                                            v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>
                (isolate, ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED));
}

void register_object_event_property_removed(v8::Isolate *isolate,
                                            v8::Handle<v8::Object> global,
                                            v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>
                (isolate, ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED));
}

void register_object_event_del(v8::Isolate *isolate,
                               v8::Handle<v8::Object> global,
                               v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>(isolate, ELDBUS_OBJECT_EVENT_DEL));
}

void register_object_event_last(v8::Isolate *isolate,
                                v8::Handle<v8::Object> global,
                                v8::Handle<v8::String> name)
{
    using v8::Integer;
    global->Set(name,
                compatibility_new<Integer>(isolate, ELDBUS_OBJECT_EVENT_LAST));
}

}

EAPI
void register_eldbus_object_mapper(v8::Isolate* isolate, v8::Handle<v8::Object> exports)
{
  register_object_event_iface_added
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_iface_added"));

  register_object_event_iface_removed
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_iface_removed"));

  register_object_event_property_changed
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_property_changed"));

  register_object_event_property_removed
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_property_removed"));

  register_object_event_del
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_del"));

  register_object_event_last
    (isolate, exports, compatibility_new<v8::String>
     (isolate, "object_event_last"));
}


} } } // namespace efl { namespace eldbus { namespace js {