#include "Ecore.h" #include "Evas.h" #include "Ecore_Evas.h" #include "Elementary.h" #include "receiver.h" #include "sender.h" #include "msg_sender.h" int is_init = 0; double interval = 0.1; int pos_start = 0; void pause_msg_sender() { msg_stop_irc(); } void continue_msg_sender() { msg_run_irc(); } void pause_receiver() { receiver_stop_irc(); } void continue_receiver() { receiver_run_irc(); } void pause_sender() { sender_stop_irc(); } void continue_sender() { sender_run_irc(); } void continue_gui(void *data) { elm_run(); } void start_pos() { pos_start = 1; } void init_ecore_handler(char *from, char *to) { ecore_init(); if (is_init == 0) { is_init = 1; msg_main_loop(from, to); sender_main(from); receiver_main(from); } ecore_idle_exiter_add(continue_gui, NULL); ecore_idle_exiter_add(continue_msg_sender, NULL); ecore_idle_exiter_add(pause_msg_sender, NULL); ecore_idle_exiter_add(continue_gui, NULL); if (pos_start == 1) { printf("HANDLER: sender started\n"); ecore_idle_exiter_add(continue_sender, NULL); ecore_idle_exiter_add(pause_sender, NULL); } ecore_idle_exiter_add(continue_gui, NULL); if (pos_start == 1) { printf("HANDLER: receiver_started"); ecore_idle_exiter_add(continue_receiver, NULL); ecore_idle_exiter_add(pause_receiver, NULL); } ecore_idle_exiter_add(continue_gui, NULL); ecore_main_loop_begin(); } void shutdown_ecore_handler() { ecore_main_loop_quit(); ecore_shutdown(); }