Exemple #1
0
static void
_add(Efm_Monitor *mon, const char *file)
{
   const char *path;
   const char *filename;
   Efm_File *ef;
   Efm_Monitor_Data *pd;
   Eina_Bool result;
   Eina_Bool dir;
   path = eina_stringshare_add(file);

   ef = eo_add(EFM_FILE_CLASS, mon, result = efm_file_obj_generate(path));

   if (!ef)
     return;

   if (!result)
     {
       ERR("Creation of %s failed, this is ... strange", file);
       eo_del(ef);
       return;
     }

   pd = eo_data_scope_get(mon, EFM_MONITOR_CLASS);

   if (pd->config.only_folder && eo_do_ret(ef, dir, efm_file_obj_is_type(EFM_FILE_TYPE_DIRECTORY)))
     return;

   if (!pd->config.hidden_files && eo_do_ret(ef, filename, efm_file_obj_filename_get())[0] == '.')
     return;

   eina_hash_add(pd->file_icons, path, ef);
   eo_do(mon, eo_event_callback_call(EFM_MONITOR_EVENT_FILE_ADD, ef);
               MARK_POPULATED);
 }
Exemple #2
0
void
app_server_term_del(Evas_Object *term)
{
   Elm_App_Server_View *view;
   const char *id = NULL;

   view = evas_object_data_del(term, "app_view");
   if (!view)
     return;

   eo_do(view, id = elm_app_server_view_id_get());
   terminology_item_term_entries_del(views_eet, id);

   eo_del(view);
}
Exemple #3
0
 EINA_LIST_FREE(video_objs, o)
   {
      emotion_object_last_position_save(o);
      eo_del(o);
   }
Exemple #4
0
static Eina_Bool
_ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh)
{
   Ecore_Con_Server *obj = data;
   Ecore_Con_Server_Data *svr = eo_data_scope_get(obj, ECORE_CON_SERVER_CLASS);
   Ecore_Win32_Handler *handler_read;
   Ecore_Win32_Handler *handler_peek;

   if (!svr->pipe)
     return ECORE_CALLBACK_CANCEL;

   if (svr->delete_me)
     return ECORE_CALLBACK_CANCEL;

   if ((svr->client_limit >= 0) && (!svr->reject_excess_clients) &&
       (svr->client_count >= (unsigned int)svr->client_limit))
     return ECORE_CALLBACK_CANCEL;

   Ecore_Con_Client *cl_obj = eo_add(ECORE_CON_CLIENT_CLASS, NULL);
   Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS);
   if (!cl)
     {
        ERR("allocation failed");
        return ECORE_CALLBACK_CANCEL;
     }

   cl->host_server = obj;

   svr->event_read = CreateEvent(NULL, TRUE, FALSE, NULL);
   if (!svr->event_read)
     {
        ERR("Can not create event read");
        goto free_cl;
     }

   handler_read = ecore_main_win32_handler_add(svr->event_read,
                                               _ecore_con_local_win32_server_read_client_handler,
                                               obj);
   if (!handler_read)
     {
        ERR("Can not create handler read");
        goto close_event_read;
     }

   svr->event_peek = CreateEvent(NULL, TRUE, FALSE, NULL);
   if (!svr->event_peek)
     {
        ERR("Can not create event peek");
        goto del_handler_read;
     }

   handler_peek = ecore_main_win32_handler_add(svr->event_peek,
                                               _ecore_con_local_win32_server_peek_client_handler,
                                               obj);
   if (!handler_peek)
     {
        ERR("Can not create handler peek");
        goto close_event_peek;
     }

   svr->read_stopped = EINA_TRUE;
   svr->thread_read = (HANDLE)_beginthreadex(NULL, 0, _ecore_con_local_win32_server_read_client_thread, cl, CREATE_SUSPENDED, NULL);
   if (!svr->thread_read)
     {
        ERR("Can not launch thread");
        goto del_handler_peek;
     }

   svr->clients = eina_list_append(svr->clients, obj);
   svr->client_count++;

   if (!cl->delete_me)
     ecore_con_event_client_add(obj);

   ecore_main_win32_handler_del(wh);

   ResumeThread(svr->thread_read);
   return ECORE_CALLBACK_DONE;

del_handler_peek:
   ecore_main_win32_handler_del(handler_peek);
close_event_peek:
   CloseHandle(svr->event_peek);
del_handler_read:
   ecore_main_win32_handler_del(handler_read);
close_event_read:
   CloseHandle(svr->event_read);
free_cl:
   eo_del(cl_obj);

   return ECORE_CALLBACK_CANCEL;
}