tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=718a942bdeba55b5298eb69b22cf1a5d4c932fc9

commit 718a942bdeba55b5298eb69b22cf1a5d4c932fc9
Author: Tom Hacohen <[email protected]>
Date:   Fri Aug 22 14:33:26 2014 +0100

    Ecore con client: Add support for some eo events.
---
 src/lib/ecore_con/ecore_con.c  |  8 ++++++++
 src/lib/ecore_con/ecore_con.eo | 11 +++++++++++
 2 files changed, 19 insertions(+)

diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index aa52712..9432c67 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -1083,6 +1083,7 @@ ecore_con_event_client_add(Ecore_Con_Client *obj)
    if (cl->upgrade) ev = ECORE_CON_EVENT_CLIENT_UPGRADE;
    ecore_event_add(ev, e,
                    (Ecore_End_Cb)_ecore_con_event_client_add_free, 
cl->host_server);
+   eo_do(obj, eo_event_callback_call(ECORE_CON_EVENT_CONNECTION_UPGRADED, 
NULL));
    _ecore_con_event_count++;
 }
 
@@ -1154,6 +1155,12 @@ ecore_con_event_client_data(Ecore_Con_Client *obj, 
unsigned char *buf, int num,
    e->size = num;
    ecore_event_add(ECORE_CON_EVENT_CLIENT_DATA, e,
                    (Ecore_End_Cb)_ecore_con_event_client_data_free, 
cl->host_server);
+     {
+        Ecore_Con_Event_Data_Received event_info = { 0 };
+        event_info.data = e->data;
+        event_info.size = e->size;
+        eo_do(obj, eo_event_callback_call(ECORE_CON_EVENT_DATA_RECEIVED, 
&event_info));
+     }
    _ecore_con_event_count++;
 }
 
@@ -1194,6 +1201,7 @@ ecore_con_event_client_error(Ecore_Con_Client *obj, const 
char *error)
    cl->event_count = eina_list_append(cl->event_count, e);
    cl->host_server->event_count = 
eina_list_append(cl->host_server->event_count, e);
    ecore_event_add(ECORE_CON_EVENT_CLIENT_ERROR, e, 
(Ecore_End_Cb)_ecore_con_event_client_error_free, cl->host_server);
+   eo_do(obj, eo_event_callback_call(ECORE_CON_EVENT_CONNECTION_ERROR, 
e->error));
    _ecore_con_event_count++;
 }
 
diff --git a/src/lib/ecore_con/ecore_con.eo b/src/lib/ecore_con/ecore_con.eo
index 8fe53c3..e53ae71 100644
--- a/src/lib/ecore_con/ecore_con.eo
+++ b/src/lib/ecore_con/ecore_con.eo
@@ -163,8 +163,19 @@ abstract Ecore.Con (Eo.Base) {
       virtual.flush;
       virtual.send;
    }
+   events {
+        data,received: Ecore_Con_Event_Data_Received;
+        connection,upgraded;
+        connection,error: const(char) *;
+   }
 }
 
+/* FIXME: Should actually be a binbuf. */
+type Ecore_Con_Event_Data_Received: struct {
+    data: void *; /*@ The data thet got sent. */
+    size: int; /*@ The length of the data sent. */
+};
+
 type Ecore_Con_Dns_Cb: func void (const(char) *,
                                  const(char) *,
                                  struct sockaddr *,

-- 


Reply via email to