Ejemplo n.º 1
0
void
e_syscon_hide(void)
{
   if (!popup) return;

   if (deftimer)
     {
        ecore_timer_del(deftimer);
        deftimer = NULL;
     }
   if (do_defact) eina_stringshare_del(do_defact);
   do_defact = NULL;
   while (handlers)
     {
        ecore_event_handler_del(handlers->data);
        handlers = eina_list_remove_list(handlers, handlers);
     }
   e_popup_hide(popup);
   e_object_del(E_OBJECT(popup));
   popup = NULL;
   e_grabinput_release(input_window, input_window);
   ecore_x_window_free(input_window);
   input_window = 0;
}
Ejemplo n.º 2
0
Eina_Bool
email_pop3_list_read(Email *e, Ecore_Con_Event_Server_Data *ev)
{
   Email_List_Cb cb;
   Eina_List *next, *list = NULL;
   Email_List_Item *it;
   const char *n;
   unsigned char *data;
   int len;
   size_t size;

   if ((!e->buf) && (!email_op_ok(ev->data, ev->size)))
     {
        ERR("Error with LIST");
        cb = e->cbs->data;
        e->cbs = eina_list_remove_list(e->cbs, e->cbs);
        if (cb) cb(e, NULL);
        return EINA_TRUE;
     }
   next = e->ev ? e->ev : list;
   if (e->buf)
     {
        eina_binbuf_append_length(e->buf, ev->data, ev->size);
        data = (unsigned char*)eina_binbuf_string_get(e->buf);
        len = eina_binbuf_length_get(e->buf);
     }
   else
     {
        data = ev->data;
        len = ev->size;
     }
   for (n = (char*)memchr(data + 3, '\n', len - 3), size = len - (n - (char*)data);
        n && (size > 1);
        n = (char*)memchr(n, '\n', size - 1), size = len - (n - (char*)data))
      {
         it = calloc(1, sizeof(Email_List_Item));
         if (sscanf(++n, "%u %zu", &it->id, &it->size) != 2)
           {
              free(it);
              break;
           }
         INF("Message %u: %zu octets", it->id, it->size);
         list = eina_list_append(list, it);
      }
   if (!memcmp(n - 2, "\r\n.\r\n", 5))
     {
        cb = e->cbs->data;
        e->cbs = eina_list_remove_list(e->cbs, e->cbs);
        INF("LIST returned %u messages", eina_list_count(list));
        if (cb) cb(e, list);
        EINA_LIST_FREE(list, it)
          free(it);
        if (e->buf)
          {
             eina_binbuf_free(e->buf);
             e->buf = NULL;
          }
        return EINA_TRUE;
     }
   else if (!e->buf)
     {
        e->buf = eina_binbuf_new();
        eina_binbuf_append_length(e->buf, (unsigned char*)n, ev->size - (n - (char*)ev->data));
     }
   return EINA_FALSE;
}
Ejemplo n.º 3
0
Archivo: main.c Proyecto: Limsik/e17
int
main(int argc, char ** argv)
{
    int i, passed = 0, num_tests = 0;
    Eina_List *run = NULL;
    double total;
    char *env;

    eina_init();
    ecore_init();

    total = ecore_time_get();
    if (argc > 1)
    {
        for (i = 1; i < argc; i++)
        {
            if ((!strcmp(argv[i], "-h")) ||
                (!strcmp(argv[i], "--help")))
            {
                for (i = 0; tests[i].name; i++)
                {
                    printf("%s\n", tests[i].name);
                }
                return 1;
            }
            run = eina_list_append(run, argv[i]);
        }
    }

    environment_store();
    for (i = 0; tests[i].name; i++)
    {
        int ret;
        double start;

        /* we've been given specific tests and it isn't in the list */
        if (run && !eina_list_search_unsorted(run, EINA_COMPARE_CB(strcasecmp),
                                                        tests[i].name))
            continue;

        if (!efreet_init())
        {
            printf("Error initializing Efreet\n");
            continue;
        }

        num_tests ++;

        printf("%s:\t\t", tests[i].name);
        fflush(stdout);
        start = ecore_time_get();
        ret = tests[i].cb();
        printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"),
                                            ecore_time_get() - start);
        passed += ret;

        efreet_shutdown();
        environment_restore();
    }

    printf("\n-----------------\n");
    clearenv();
    EINA_LIST_FREE(environment, env)
        free(env);
    printf("Passed %d of %d tests.\n", passed, num_tests);

    while (run)
        run = eina_list_remove_list(run, run);

    printf("Total run: %.3f seconds\n", ecore_time_get() - total);

    ecore_shutdown();
    eina_shutdown();
    return 0;
}
Ejemplo n.º 4
0
EAPI const char *
efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size)
{
    const char *icon = NULL;
    char *data;
    Eina_List *icons  = NULL;
    const char *env = NULL;
    char *p = NULL, *pp = NULL, *ppp = NULL;
    char buf[PATH_MAX];
    const char *cache;

    EINA_SAFETY_ON_NULL_RETURN_VAL(mime, NULL);
    EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL);

    mime = eina_stringshare_add(mime);
    theme = eina_stringshare_add(theme);
    cache = efreet_mime_icon_entry_find(mime, theme, size);
    if (cache)
    {
        eina_stringshare_del(mime);
        eina_stringshare_del(theme);
        return cache;
    }

    /* Standard icon name */
    p = strdup(mime);
    pp = p;
    while (*pp)
    {
        if (*pp == '/') *pp = '-';
        pp++;
    }
    icons = eina_list_append(icons, p);

    /* Environment Based icon names */
    if ((env = efreet_desktop_environment_get()))
    {
        snprintf(buf, sizeof(buf), "%s-mime-%s", env, p);
        icons = eina_list_append(icons, strdup(buf));

        snprintf(buf, sizeof(buf), "%s-%s", env, p);
        icons = eina_list_append(icons, strdup(buf));
    }

    /* Mime prefixed icon names */
    snprintf(buf, sizeof(buf), "mime-%s", p);
    icons = eina_list_append(icons, strdup(buf));

    /* Generic icons */
    pp = strdup(p);
    while ((ppp = strrchr(pp, '-')))
    {
        *ppp = '\0';

        snprintf(buf, sizeof(buf), "%s-x-generic", pp);
        icons = eina_list_append(icons, strdup(buf));

        snprintf(buf, sizeof(buf), "%s-generic", pp);
        icons = eina_list_append(icons, strdup(buf));

        snprintf(buf, sizeof(buf), "%s", pp);
        icons = eina_list_append(icons, strdup(buf));
    }
    FREE(pp);

    /* Search for icons using list */
    icon = efreet_icon_list_find(theme, icons, size);
    while (icons)
    {
        data = eina_list_data_get(icons);
        free(data);
        icons = eina_list_remove_list(icons, icons);
    }

    efreet_mime_icon_entry_add(mime, eina_stringshare_add(icon), theme, size);

    return icon;
}
Ejemplo n.º 5
0
EAPI void
edje_object_message_signal_process(Evas_Object *obj)
{
   Eina_List *l, *ln, *tmpq = NULL;
   Edje *ed;
   Edje_Message *em;
   int gotos = 0;

   ed = _edje_fetch(obj);
   if (!ed) return;

   for (l = msgq; l; )
     {
        ln = l->next;
        em = l->data;
        if (em->edje == ed)
          {
             tmpq = eina_list_append(tmpq, em);
             msgq = eina_list_remove_list(msgq, l);
          }
        l = ln;
     }
   /* a temporary message queue */
   if (tmp_msgq)
     {
	while (tmpq)
	  {
	     tmp_msgq = eina_list_append(tmp_msgq, tmpq->data);
	     tmpq = eina_list_remove_list(tmpq, tmpq);
	  }
     }
   else
     {
	tmp_msgq = tmpq;
	tmpq = NULL;
     }

#if 0   
   while (tmp_msgq)
     {
	Edje_Message *em;

	em = tmp_msgq->data;
	tmp_msgq = eina_list_remove_list(tmp_msgq, tmp_msgq);
        if (!ed->delete_me)
          {
             ed->processing_messages++;
             _edje_message_process(em);
             _edje_message_free(em);
             ed->processing_messages--;
          }
        else
           _edje_message_free(em);
     }
#else
   tmp_msgq_processing++;
again:
   EINA_LIST_FOREACH_SAFE(tmp_msgq, l, ln, em)
     {
        if (em->edje != ed) continue;
	tmp_msgq = eina_list_remove_list(tmp_msgq, l);
        if (!ed->delete_me)
          {
             ed->processing_messages++;
             _edje_message_process(em);
             _edje_message_free(em);
             ed->processing_messages--;
          }
        else
           _edje_message_free(em);
        if (ed->processing_messages == 0)
          {
             if (ed->delete_me) _edje_del(ed);
          }
        // if some child callback in _edje_message_process called
        // edje_object_message_signal_process() or
        // edje_message_signal_process() then those will mark the restart
        // flag when they finish - it mabsicammyt means tmp_msgq and
        // any item in it has potentially become invalid - so that means l
        // and ln could be rogue pointers, so start again from the beginning
        // and skip anything that is not this object and process only what is.
        // to avoid self-feeding loops allow a max of 1024 loops.
        if (tmp_msgq_restart)
          {
             tmp_msgq_restart = 0;
             gotos++;
             if (gotos < 1024) goto again;
             else
               {
                  WRN("Edje is in a self-feeding message loop (> 1024 gotos needed in a row)");
                  goto end;
               }
          }
     }
end:
   tmp_msgq_processing--;
   if (tmp_msgq_processing == 0)
      tmp_msgq_restart = 0;
   else
      tmp_msgq_restart = 1;
#endif
}
Ejemplo n.º 6
0
EAPI int
e_modapi_shutdown (E_Module * m)
{
  mail_config->module = NULL;
  e_gadcon_provider_unregister (&_gc_class);

  if (exit_handler)
    ecore_event_handler_del (exit_handler);

  if (mail_config->config_dialog)
    e_object_del (E_OBJECT (mail_config->config_dialog));
  if (mail_config->menu)
    {
      e_menu_post_deactivate_callback_set (mail_config->menu, NULL, NULL);
      e_object_del (E_OBJECT (mail_config->menu));
      mail_config->menu = NULL;
    }
  while (mail_config->items)
    {
      Config_Item *ci;

      ci = mail_config->items->data;
      while (ci->boxes)
	{
	  Config_Box *cb;

	  cb = ci->boxes->data;
	  switch (cb->type)
	    {
	    case MAIL_TYPE_IMAP:
	      _mail_imap_del_mailbox (cb);
	      break;
	    case MAIL_TYPE_POP:
	      _mail_pop_del_mailbox (cb);
	      break;
	    case MAIL_TYPE_MDIR:
	      _mail_mdir_del_mailbox (cb);
	      break;
	    case MAIL_TYPE_MBOX:
	      _mail_mbox_del_mailbox (cb);
	      break;
	    }
	  if (cb->name)
	    eina_stringshare_del (cb->name);
	  if (cb->host)
	    eina_stringshare_del (cb->host);
	  if (cb->user)
	    eina_stringshare_del (cb->user);
	  if (cb->pass)
	    eina_stringshare_del (cb->pass);
	  if (cb->new_path)
	    eina_stringshare_del (cb->new_path);
	  if (cb->cur_path)
	    eina_stringshare_del (cb->cur_path);
	  if (cb->exec)
	    eina_stringshare_del (cb->exec);
	  ci->boxes = eina_list_remove_list (ci->boxes, ci->boxes);
	  free (cb);
	  cb = NULL;
	}
      if (ci->id)
	eina_stringshare_del (ci->id);
      mail_config->items =
	eina_list_remove_list (mail_config->items, mail_config->items);
      free (ci);
      ci = NULL;
    }
  _mail_imap_shutdown ();
  _mail_pop_shutdown ();
  _mail_mdir_shutdown ();
  _mail_mbox_shutdown ();
  free (mail_config);
  mail_config = NULL;
  E_CONFIG_DD_FREE (conf_box_edd);
  E_CONFIG_DD_FREE (conf_item_edd);
  E_CONFIG_DD_FREE (conf_edd);
  return 1;
}
Ejemplo n.º 7
0
//Scan the files stored in the list of files to scan
static void *_eclair_meta_tag_thread(void *param)
{
   Eclair *eclair = param;
   Eclair_Meta_Tag_Manager *meta_tag_manager;
   Eina_List *l, *next;
   Eclair_Media_File *current_file;

   if (!eclair)
      return NULL;

   next = NULL;
   meta_tag_manager = &eclair->meta_tag_manager;
   pthread_mutex_lock(&meta_tag_manager->meta_tag_mutex);
   for (;;)
   {
      if (meta_tag_manager->meta_tag_should_scan_files || meta_tag_manager->meta_tag_delete_thread)
         meta_tag_manager->meta_tag_should_scan_files = 0;
      else
         pthread_cond_wait(&meta_tag_manager->meta_tag_cond, &meta_tag_manager->meta_tag_mutex);
      while (meta_tag_manager->meta_tag_files_to_scan || meta_tag_manager->meta_tag_files_to_add || meta_tag_manager->meta_tag_delete_thread)
      {
         if (meta_tag_manager->meta_tag_delete_thread)
         {
            meta_tag_manager->meta_tag_files_to_scan = eina_list_free(meta_tag_manager->meta_tag_files_to_scan);
            meta_tag_manager->meta_tag_files_to_add = eina_list_free(meta_tag_manager->meta_tag_files_to_add);
            meta_tag_manager->meta_tag_delete_thread = 0;
            return NULL;
         }
         //Add the new files to the list of files to treat
         if (meta_tag_manager->meta_tag_files_to_add)
         {
            while (meta_tag_manager->meta_tag_add_state != ECLAIR_IDLE)
               usleep(10000);
            meta_tag_manager->meta_tag_add_state = ECLAIR_ADDING_FILE_TO_TREAT;
            for (l = meta_tag_manager->meta_tag_files_to_add; l; l = l->next)
               meta_tag_manager->meta_tag_files_to_scan = eina_list_append(meta_tag_manager->meta_tag_files_to_scan, l->data);
            meta_tag_manager->meta_tag_files_to_add = eina_list_free(meta_tag_manager->meta_tag_files_to_add);
            meta_tag_manager->meta_tag_add_state = ECLAIR_IDLE; 
         }
         //Treat the files in the list
         for (l = meta_tag_manager->meta_tag_files_to_scan; l || meta_tag_manager->meta_tag_delete_thread; l = next)
         {
            if (meta_tag_manager->meta_tag_delete_thread || meta_tag_manager->meta_tag_files_to_add)
               break;
            next = l->next;
            current_file = l->data;
            meta_tag_manager->meta_tag_files_to_scan = eina_list_remove_list(meta_tag_manager->meta_tag_files_to_scan, l);
            if (current_file)
            {
               if (current_file->delete_me)
               {
                  current_file->in_meta_tag_process = 0;
                  continue;
               }
               eclair_meta_tag_read(eclair, current_file);
               eclair_media_file_update(eclair, current_file);
               current_file->in_meta_tag_process = 0;
            }
         }
      }
   }
   return NULL;
}
Ejemplo n.º 8
0
Eina_Bool
data_pop(Email *e, int type __UNUSED__, Ecore_Con_Event_Server_Data *ev)
{
   char *recv;

   if (e != ecore_con_server_data_get(ev->server))
     {
        DBG("Event mismatch");
        return ECORE_CALLBACK_PASS_ON;
     }

   recv = alloca(ev->size + 1);
   memcpy(recv, ev->data, ev->size);
   recv[ev->size] = 0;
   DBG("Receiving %i bytes:\n%s", ev->size, recv);

   if (e->state < EMAIL_STATE_CONNECTED)
     {
        email_login_pop(e, ev);
        return ECORE_CALLBACK_RENEW;
     }

   if (!e->current) return ECORE_CALLBACK_RENEW;

   switch (e->current)
     {
      case EMAIL_OP_STAT:
        if (!email_pop3_stat_read(e, recv, ev->size)) return ECORE_CALLBACK_RENEW;
        break;
      case EMAIL_OP_LIST:
        if (!email_pop3_list_read(e, ev)) return ECORE_CALLBACK_RENEW;
        break;
      case EMAIL_OP_RETR:
        if (!email_pop3_retr_read(e, ev)) return ECORE_CALLBACK_RENEW;
        break;
      case EMAIL_OP_DELE:
      case EMAIL_OP_QUIT:
      {
         Ecore_Cb cb;

         cb = e->cbs->data;
         e->cbs = eina_list_remove_list(e->cbs, e->cbs);
         if (!email_op_ok(ev->data, ev->size))
           {
              if (e->current == EMAIL_OP_DELE) ERR("Error with DELE");
              else ERR("Error with QUIT");
           }
         else
           {
              if (e->current == EMAIL_OP_DELE) INF("DELE successful");
              else INF("QUIT");
           }
         if (cb) cb(e);
         if (e->current == EMAIL_OP_QUIT) ecore_con_server_del(e->svr);
         break;
      }
      default:
        break;
     }
   next_pop(e);
   return ECORE_CALLBACK_RENEW;
}
Ejemplo n.º 9
0
             EINA_LIST_FREE(sources, rp)
	       {
		  /* XXX: curr_item and pack_it don't require to be NULL since
		   * XXX: they are just used when source != NULL and type == BOX,
		   * XXX: and they're always set in this case, but GCC fails to
		   * XXX: notice that, so let's shut it up
		   */
		  Edje_Pack_Element **curr_item = NULL;
		  unsigned int item_count = 0;
		  Edje_Pack_Element *pack_it = NULL;
		  const char *source = NULL;

		  switch (rp->part->type)
		    {
		     case EDJE_PART_TYPE_GROUP:
			source = rp->part->source;
			break;
		     case EDJE_PART_TYPE_BOX:
		     case EDJE_PART_TYPE_TABLE:
			if (rp->part->items)
			  {
			     curr_item = rp->part->items;
			     item_count = rp->part->items_count;
			     if (item_count > 0)
			       {
				  pack_it = *curr_item;
				  source = pack_it->source;
				  item_count--;
				  curr_item++;
			       }
			  }
			break;
		     default:
                        /* This list should only be filled by group, box or table, nothing else. */
                        abort();
			continue;
		    }

		  while (source)
		    {
		       Eina_List *l;
		       Evas_Object *child_obj;
		       const char *group_path_entry = eina_stringshare_add(source);
		       const char *data;

		       if (!group_path)
			 {
			    group_path = eina_list_append(NULL, eina_stringshare_add(group));
			    group_path_started = 1;
			 }
		       /* make sure that this group isn't already in the tree of parents */
		       EINA_LIST_FOREACH(group_path, l, data)
			 {
			    if (data == group_path_entry)
			      {
                                 ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'",
                                     group_path_entry, rp->part->name, group, file);
                                 textblocks = eina_list_free(textblocks);
                                 externals = eina_list_free(externals);
                                 sources = eina_list_free(sources);
				 _edje_thaw(ed);
				 _edje_unblock(ed);
				 _edje_unref(ed);
				 _edje_file_del(ed);
				 eina_stringshare_del(group_path_entry);
				 if (group_path_started)
				   {
				      eina_stringshare_del(eina_list_data_get(group_path));
				      eina_list_free(group_path);
				   }
				 ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
                                 evas_event_thaw(tev);
                                 evas_event_thaw_eval(tev);
				 return 0;
			      }
			 }

		       child_obj = edje_object_add(ed->base.evas);
		       group_path = eina_list_append(group_path, group_path_entry);
		       if (rp->part->type == EDJE_PART_TYPE_GROUP)
			 {
                            _edje_real_part_swallow(rp, child_obj, EINA_FALSE);
			 }

		       if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path))
			 {
                            ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
                                rp->part->name, group_path_entry, file, source);
                            textblocks = eina_list_free(textblocks);
                            externals = eina_list_free(externals);
                            sources = eina_list_free(sources);
			    _edje_thaw(ed);
			    _edje_unblock(ed);
			    _edje_unref(ed);
			    _edje_file_del(ed);

			    if (group_path_started)
			      {
				 while (group_path)
				   {
				      eina_stringshare_del(eina_list_data_get(group_path));
				      group_path = eina_list_remove_list(group_path, group_path);
				   }
			      }
			    ed->load_error = edje_object_load_error_get(child_obj);
                            evas_object_del(child_obj);
                            evas_event_thaw(tev);
                            evas_event_thaw_eval(tev);
			    return 0;
			 }

		       group_path = eina_list_remove(group_path, group_path_entry);
		       eina_stringshare_del(group_path_entry);

                       edje_object_propagate_callback_add(child_obj,
                                                          _cb_signal_repeat,
                                                          obj);
		       if (rp->part->type == EDJE_PART_TYPE_GROUP)
			 {
                            _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
                            _edje_subobj_register(ed, child_obj);
			    source = NULL;
			 }
		       else
			 {
                            pack_it->parent = rp;

			    _edje_object_pack_item_hints_set(child_obj, pack_it);
			    if (pack_it->name)
                                 evas_object_name_set(child_obj, pack_it->name);

			    if (rp->part->type == EDJE_PART_TYPE_BOX)
			      {
				 _edje_real_part_box_append(rp, child_obj);
				 evas_object_data_set(child_obj, "\377 edje.box_item", pack_it);
			      }
			    else if (rp->part->type == EDJE_PART_TYPE_TABLE)
			      {
				 _edje_real_part_table_pack(rp, child_obj, pack_it->col, pack_it->row, pack_it->colspan, pack_it->rowspan);
				 evas_object_data_set(child_obj, "\377 edje.table_item", pack_it);
			      }
                            _edje_subobj_register(ed, child_obj);
			    evas_object_show(child_obj);
			    rp->items = eina_list_append(rp->items, child_obj);

			    if (item_count > 0)
			      {
				 pack_it = *curr_item;
				 source = pack_it->source;
				 curr_item++;
				 item_count--;
			      }
			    else
			      {
				 source = NULL;
				 curr_item = NULL;
				 pack_it = NULL;
			      }
			 }
		    }
	       }
Ejemplo n.º 10
0
/* parse a message from the pipe an execute the corresponding 
 * functions. the protocol might be something like this:
 * header char[4]
 * **************
 * RIPE => rip end
 * RIPP => rip progress
 * RIPS => rip start
 * ENCE => encoder end
 * ENCP => we cant know the real
 * progress here without knowing the encoding quality.
 * ENCS => encoder start
 * 
 * S: start
 * E: end
 * body char *
 * ***********
 */
void
ex_protocol_parse(Extrackt *ex, char *msg, int length)
{
   char *oldmsg;

   oldmsg = msg;
   //printf("%d bytes of data received %s\n", length, msg);
   while(length > 0)
     {
	char *line;
	char header[5];
	char *body;
	int llength;

	line = E_STRDUP(msg);
	llength = strlen(msg);
	
	snprintf(header, sizeof(header),"%s", line);
	body = index(line,' ') + 1;
	
	/* FIXME the string received from the CDDB protocol
	 * might be incomplete (truncated) search the end of
	 * message (. the dot) if it isnt found accumulate the
	 * data
	 */
	
	/* the cddb process status */
	if(!strcmp("CDPS",header))
	  {
	     /* FIXME depending on the body set the status DONE or CANT_BE_DONE */
	     ex->cddb.status = EX_STATUS_DONE;
	  }
	/* the first query to the cddb, the match find query */
	else if(!strcmp("DBMF", header))
	  {
	     ex->cddb.pid = 0;
	     ex_cddb_response_find_parse(ex,body);
	  }
	/* the list info query */
	else if(!strcmp("DBMG", header))
	  {
	     ex->cddb.pid = 0;
	     ex_cddb_response_get_parse(ex,body);
	  }
	else if(!strcmp("RIPS", header))
	  {
	     time(&(ex->rip.start));
	     ex->rip.status = EX_STATUS_DOING;

	  }
	else if(!strcmp("RIPE", header))
	  {
	     ex->rip.status = EX_STATUS_DONE;
	     if(ex->rip.num_done + 1 != ex->rip.num_total)
	       ex->rip.num_done++;
	     else
	       {
		  ex->rip.num_done = 0;
		  ex->rip.num_total= 0;
		  //ex->rip.status = EX_STATUS_NOT_DONE;
	       }
	     ex->rip.pid = 0;
	     if(ex->encode.on)
	       ex_command_encode_append(ex, ex->rip.curr_track.number);
	     ex->rip.curr_track.number = -1;
	     ex->rip.curr_track.size = -1;
	     ex->rip.curr_track.filename = NULL;
	     ex->rip.tracks = eina_list_remove_list(ex->rip.tracks,ex->rip.tracks);
	     if(ex->rip.tracks)
	       ex_command_rip(ex);
	  }
	else if(!strcmp("RIPP", header))
	  {
	     double percent;

	     percent = atof(body);
	     ex->fe->rip_percent_update(percent);
	  }
	else if(!strcmp("ENCS", header))
	  {
	     ex->encode.status = EX_STATUS_DOING;

	  }
	else if(!strcmp("ENCE", header))
	  {
	     ex->encode.status = EX_STATUS_DONE;
	     if(ex->encode.num_done + 1 != ex->encode.num_total)
	       ex->encode.num_done++;
	     else
	       {
		  ex->encode.num_done = 0;
		  ex->encode.num_total= 0;
		  //ex->encode.status = EX_STATUS_NOT_DONE;
	       }
	     if(ex->config.encode->wav_delete)
	       ex_string_file_delete(ex->encode.curr_track.filename);
	     ex->encode.pid = 0;
	     ex->encode.curr_track.number = -1;
	     ex->encode.curr_track.size = -1;
	     ex->encode.curr_track.filename = NULL;
	     ex->encode.tracks = eina_list_remove_list(ex->encode.tracks,ex->encode.tracks);
	     if(ex->encode.tracks)
	       ex_command_encode(ex);
	  }
	else
	  {
	     /* printf("HEADER %s\n", header); */
	  }
	
	E_FREE(line);
	length = length - llength - 1; /* 1 = \n */
	msg = msg + llength + 1;
     }
}
Ejemplo n.º 11
0
static Eina_List *
_eina_rectangle_empty_space_find(Eina_List *empty, int w, int h, int *x, int *y)
{
   Eina_Rectangle *r;
   Eina_List *l;

   EINA_LIST_FOREACH(empty, l, r)
   {
      if (r->w >= w && r->h >= h)
        {
           /* Remove l from empty */
           empty = eina_list_remove_list(empty, l);
           /* Remember x and y */
           *x = r->x;
           *y = r->y;
           /* Split r in 2 rectangle if needed (only the empty one) and insert them */
           if (r->w == w)
             {
                r->y += h;
                r->h -= h;
             }
           else if (r->h == h)
             {
                r->x += w;
                r->w -= w;
             }
           else
             {
                int rx1, ry1, rw1, rh1;
                int x2, y2, w2, h2;

                rx1 = r->x + w;
                ry1 = r->y;
                rw1 = r->w - w;
                /* h1 could be h or r->h */
                x2 = r->x;
                y2 = r->y + h;
                /* w2 could be w or r->w */
                h2 = r->h - h;

                if (rw1 * r->h > h2 * r->w)
                  {
                     rh1 = r->h;
                     w2 = w;
                  }
                else
                  {
                     rh1 = h;
                     w2 = r->w;
                  }

                EINA_RECTANGLE_SET(r, rx1, ry1, rw1, rh1);
                empty = _eina_rectangle_merge_list(empty, r);

                r = eina_rectangle_new(x2, y2, w2, h2);
             }

           if (r)
             {
                empty = _eina_rectangle_merge_list(empty, r); /* Return empty */

             }

           return empty;
        }
   }

   *x = -1;
   *y = -1;
   return empty;
}