Enlightenment CVS committal Author : lordchaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/common Modified Files: evfs_io.c Added Files: evfs_event_helper.c Log Message: * Stage one of the event engine. Demo app now receives and displays events =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evfs_io.c 16 Aug 2005 05:44:21 -0000 1.3 +++ evfs_io.c 16 Aug 2005 07:31:39 -0000 1.4 @@ -24,20 +24,42 @@ void evfs_event_client_id_notify(evfs_client* client) { - printf("Notifying client of id %ld\n", client->id); + /*printf("Notifying client of id %ld\n", client->id);*/ evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_NOTIFY_ID,0,0,0,0,&client->id, sizeof(long))); } void evfs_write_event(evfs_client* client, evfs_event* event) { evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY,EVFS_EV_PART_TYPE,client->id,0,0,&event->type, sizeof(evfs_eventtype))); - evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY,EVFS_EV_PART_TYPE,client->id,0,0,event->data, event->data_len)); + evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY,EVFS_EV_PART_SUB_TYPE,client->id,0,0,&event->sub_type, sizeof(evfs_eventtype_sub))); + + evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY,EVFS_EV_PART_DATA,client->id,0,0,event->data, event->data_len)); + evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY,EVFS_EV_PART_END,client->id,0,0,NULL,0)); } -void evfs_read_event(evfs_connection* conn, evfs_event* event) { +int evfs_read_event(evfs_event* event, ecore_ipc_message* msg) { + switch (msg->minor) { + case EVFS_EV_PART_TYPE: + memcpy(&event->type, msg->data, sizeof(evfs_eventtype)); + break; + case EVFS_EV_PART_SUB_TYPE: + memcpy(&event->sub_type, msg->data, sizeof(evfs_eventtype_sub)); + break; + case EVFS_EV_PART_DATA: + event->data = malloc(msg->len); + event->data_len = msg->len; + memcpy(event->data, msg->data, msg->len); + break; + case EVFS_EV_PART_END: + return TRUE; + break; + } + + return FALSE; + } @@ -58,7 +80,6 @@ LOCK(&ipc_server_mutex); - printf("Writing message to client %p\n", client); ecore_ipc_client_send(client, msg->major, msg->minor, msg->ref, msg->ref_to, msg->response,msg->data, msg->len); free(msg); @@ -85,11 +106,8 @@ int i; char uri[1024]; - printf("Writing a file command..\n"); /*Write the command type structure*/ - printf("Command is %p\n", command); - printf("Connserver is %p\n", conn->server); evfs_write_ecore_ipc_server_message(conn->server, ecore_ipc_message_new(EVFS_COMMAND, EVFS_COMMAND_TYPE, 0,0,0,&command->type, sizeof(evfs_command_type))); /*Write the files*/ @@ -125,14 +143,12 @@ command->file_command.files = malloc(sizeof(evfs_filereference*)); command->file_command.files[0] = path->files[0]; - printf("Got a file: %s %s\n", command->file_command.files[0]->plugin_uri, command->file_command.files[0]->path); free(path); } else { printf("we already have %d files\n", command->file_command.num_files); /*TODO Handle multiple files*/ } - printf("This is a file reference\n"); break; ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs