Пример #1
0
static Ecore_List *
_list_keys_order (Ecore_List *keys)
{
  Ecore_List *l;
  char       *key;

  l = ecore_list_new ();
  ecore_list_first_goto(keys);
  while ((key = ecore_list_next(keys)))
    {
      char *str;

      ecore_list_first_goto (l);
      while ((str = ecore_list_next(l)) &&
             (strcasecmp (key, str) >= 0)) { }

      if (!str)
        ecore_list_append (l, key);
      else
        {
          ecore_list_index_goto (l, ecore_list_index (l) - 1);
          ecore_list_insert (l, key);
        }
    }

  ecore_list_destroy (keys);

  return l;
}
Пример #2
0
static void _exml_write_element(EXML_Node *node, xmlTextWriterPtr writer)
{
	EXML_Node *child;
	Ecore_List *keys;
	xmlChar *name;

	xmlTextWriterStartElement( writer, (xmlChar *) node->tag );

	keys = ecore_hash_keys( node->attributes );
	ecore_list_first_goto( keys );

	while( (name = ecore_list_next( keys )) ) {
		xmlChar *value = ecore_hash_get( node->attributes, name );
		xmlTextWriterWriteAttribute( writer, name, value );
	}

	ecore_list_destroy( keys );

	if (node->value)
		xmlTextWriterWriteString( writer, (xmlChar *) node->value );

	ecore_list_first_goto( node->children );
	
	while( (child = ecore_list_next( node->children )) )
		_exml_write_element( child, writer );

	xmlTextWriterEndElement( writer );
}
Пример #3
0
static E_Widget *
_e_widget_spinner_handle(Enhance *en, EXML_Node *node)
{
    E_Widget   *spinner;
    char       *id;
    Ecore_List *props;
    EXML_Node  *prop;
    double      value;
    double      min       = 0;
    double      max       = 0;
    double      step_inc  = 1;
    double      page_inc  = 1;
    double      page_size = 1;

    id = ecore_hash_get(node->attributes, "id");
    if(!id) return NULL;

    props = node->children;
    ecore_list_first_goto(props);
    prop = ecore_list_current(props);
    while(prop != NULL)
    {
        if(!strcmp(prop->tag, "property"))
        {
            char *name;

            name = ecore_hash_get(prop->attributes, "name");
            if(!name) {
                prop = ecore_list_next(props);
                continue;
            }

            if(!strcmp(name, "adjustment"))
            {
                if(prop->value)
                {
                    char *adj;

                    adj = strdup(prop->value);
                    sscanf(adj, "%lf %lf %lf %lf %lf %lf", &value, &min, &max,
                           &step_inc, &page_inc, &page_size);
                    E_FREE(adj);
                }
            }
        }
        prop = ecore_list_next(props);
    }

    ecore_list_first_goto(props);

    spinner = _e_widget_new(en, node, etk_spinner_new(min, max,
                            value,
                            step_inc,
                            page_inc), id);

    return spinner;
}
Пример #4
0
void
ewl_iconbox_file_copy_cb (Ewl_Widget * w, void *ev_data, void *user_data)
{
  Ecore_List *icon_list;
  gui_file *file;
  Ewl_Iconbox_Icon *list_item;
  entropy_gui_component_instance *instance =
    (entropy_gui_component_instance *) user_data;

  /*Clear the existing contents */
  entropy_core_selected_files_clear (instance->core);

  icon_list =
    ewl_iconbox_get_selection (EWL_ICONBOX
			       (((entropy_icon_viewer *) instance->data)->
				iconbox));

  ecore_list_first_goto (icon_list);
  while ((list_item = ecore_list_next (icon_list))) {
    file =
      ecore_hash_get (((entropy_icon_viewer *) instance->data)->icon_hash,
		      list_item);
    entropy_core_selected_file_add (file->file);



  }
  ecore_list_destroy (icon_list);
}
Пример #5
0
void
ewl_iconbox_background_set_file_cb (Ewl_Widget * w, void *ev, void *user_data)
{
  Ewl_Dialog_Event *e;
  entropy_gui_component_instance *instance = user_data;
  entropy_icon_viewer *viewer = instance->data;
  char* file = NULL;

  e = ev;
  if (e->response == EWL_STOCK_OPEN) {
    Ecore_List* l;
    l = ewl_filedialog_selected_files_get(EWL_FILEDIALOG(viewer->file_dialog));
    ecore_list_first_goto(l);
    file = ecore_list_current(l);
	  
    printf ("Curent directory is '%s'\n", viewer->current_dir);
    entropy_config_str_set ("iconbox_viewer", viewer->current_dir, file);
    ewl_widget_destroy (viewer->file_dialog);

  }
  else if (e->response == EWL_STOCK_CANCEL) {
    ewl_widget_destroy (viewer->file_dialog);
  }


}
/**
 * Retrieves an ecore_list of all keys in the given hash.
 * @param   hash          The given hash.
 * @return  new ecore_list on success, NULL otherwise
 * @ingroup Ecore_Data_Hash_ADT_Traverse_Group
 */
EAPI Ecore_List *
ecore_hash_keys(Ecore_Hash *hash)
{
   unsigned int i = 0;
   Ecore_List *keys;

   CHECK_PARAM_POINTER_RETURN("hash", hash, NULL);

   keys = ecore_list_new();
   while (i < ecore_prime_table[hash->size])
     {
        if (hash->buckets[i])
          {
             Ecore_Hash_Node *node;

             for (node = hash->buckets[i]; node; node = node->next)
               {
                  ecore_list_append(keys, node->key);
               }
          }

        i++;
     }
   ecore_list_first_goto(keys);

   return keys;
}
Пример #7
0
static void
_enum_display (Ewl_Widget *w, void *ev_data, void *user_data)
{
  Ecrin_Hash_Data *data;
  Ecrin_Enum      *e;
  Ecrin_Enum_Item *item;
  char             str[4096];

  data = (Ecrin_Hash_Data *)user_data;
  e = (Ecrin_Enum *)data->data;

  ewl_text_text_set (EWL_TEXT (text), data->efl_name);
  ewl_text_text_append (EWL_TEXT (text), "\n");
  ewl_text_text_append (EWL_TEXT (text), "\n");

  snprintf (str, 4096, "enum %s\n", e->name);
  ewl_text_text_append (EWL_TEXT (text), str);
  ewl_text_text_append (EWL_TEXT (text), "{\n");
  ecore_list_first_goto (e->items);
  while ((item = ecore_list_next (e->items)))
    {
      snprintf (str, 4096, "  %s", item->name);
      ewl_text_text_append (EWL_TEXT (text), str);
      if (item->value)
	snprintf (str, 4096, " = %s", item->value);
      ewl_text_text_append (EWL_TEXT (text), str);
      if (ecore_list_index (e->items) != ecore_list_count (e->items))
        ewl_text_text_append (EWL_TEXT (text), ",");
      ewl_text_text_append (EWL_TEXT (text), "\n");
    }
  ewl_text_text_append (EWL_TEXT (text), "};\n");
}
Пример #8
0
Ecore_List* entropy_plugins_type_get(int type, int subtype) {
	entropy_plugin* list_item;

	Ecore_List* plugins = entropy_core_get_core()->plugin_list;
	
	if (plugin_list) {
		ecore_list_destroy(plugin_list);
	}

	plugin_list = ecore_list_new();
	
	ecore_list_first_goto(plugins);
	while ( (list_item = ecore_list_next(plugins)) ) {
		/*printf("Scanning plugin: %s\n", list_item->filename);*/
		if (list_item->type == type && 
		   (subtype == ENTROPY_PLUGIN_SUB_TYPE_ALL || subtype == list_item->subtype)
		   && (type != ENTROPY_PLUGIN_GUI_COMPONENT || 
		(type == ENTROPY_PLUGIN_GUI_COMPONENT && 
		 !strcmp(list_item->toolkit, entropy_layout_global_toolkit_get())))) {
			ecore_list_append(plugin_list, list_item);
		}
	}
	
	return plugin_list;	
}
Пример #9
0
static void
_tree_fill (Etk_Pdf *pdf, Etk_Tree *tree, Etk_Tree_Col *col, Etk_Tree_Row *row, Ecore_List *items)
{
  Etk_Tree_Row   *prow;
  Epdf_Index_Item *item;

  if (!items)
    return;

  ecore_list_first_goto (items);
  while ((item = ecore_list_next (items))) {
    char       *buf;
    Ecore_List *c;
    int        *num;

    buf = strdup (epdf_index_item_title_get (item));
    prow = etk_tree_row_append (tree, row, col, buf, NULL);

    num = (int *)malloc (sizeof (int));
    *num = epdf_index_item_page_get (etk_pdf_pdf_document_get (pdf), item);
    etk_tree_row_data_set_full (prow, num, free);
    free (buf);
    c = epdf_index_item_children_get (item);
    if (c) {
      _tree_fill (pdf, tree, col, prow, c);
    }
  }
}
Пример #10
0
void TOCDialog(Evas *e, Evas_Object *obj,Ecore_List *list)
{
    int numchoices=ecore_list_count(list);
	char **initchoices;
    //char **values;
    initchoices=(char **)malloc(sizeof(char*)*numchoices);
    //values=(char **)malloc(sizeof(char*)*numchoices);
    ecore_list_first_goto(list);
    int i;
    for(i=0;i<numchoices;i++)
    {
        asprintf(&(initchoices[i]),"%d. %s",(i%8+1),epdf_index_item_title_get((Epdf_Index_Item *)ecore_list_next(list)));
        
    }
    
	Evas_Object *tocchoicebox=init_choicebox(e,(const char**)initchoices,NULL, numchoices, toc_choicehandler, "Table of Contents",obj,(void *)list, true);
    for(i=0;i<numchoices;i++)
    {

        free(initchoices[i]);
    }
    //free(values);
    free(initchoices);
    
    int x,y,w,h;
    evas_object_geometry_get(tocchoicebox,&x,&y,&w,&h);
    evas_object_move(tocchoicebox,(int)(((double)get_win_width()-w)/2.0),(int)(((double)get_win_height()-h)/2.0));
    

}
Пример #11
0
void
evfs_posix_monitor_remove(evfs_client * client, char *path)
{
   Ecore_List *mon_list = ecore_hash_get(posix_monitor_hash, path);
   Ecore_File_Monitor *em = NULL;

   if (!mon_list)
     {
        /*There is no one monitoring this - so this client can't be... */
        return;
     }
   else
     {
        evfs_file_monitor *mon = NULL;
        evfs_file_monitor *check_last = NULL;

        ecore_list_first_goto(mon_list);
        while ((mon = ecore_list_current(mon_list)))
          {
             if (mon->client == client)
               {
                  em = mon->em;
                  ecore_list_remove(mon_list);
                  goto final;
               }

             ecore_list_next(mon_list);
          }
        goto out;

      final:
Пример #12
0
/**
 * keystroke accelerator for project window
 */
static EWL_CALLBACK_DEFN(project_key_down)
{
	Ecore_List *selected;
	Ewl_Event_Key_Down *ev = ev_data;
	Ewl_Widget *text, *row;
	char *name;

	if( !strcmp(ev->keyname, "Delete") ) {
		selected = ewl_tree_selected_get(EWL_TREE(file_tree));

		if( ecore_list_count(selected) > 0 ) {
			ecore_list_first_goto(selected);

			while( (row = ecore_list_next(selected)) ) {
				text = ewl_tree_row_column_get(EWL_ROW(row), 0);
				name = ewl_text_text_get(EWL_TEXT(text));
				ecore_hash_remove(active_project->files, name);
				FREE(name);
				active_project->dirty = true;
			}

			project_update();
		}
	}
}
Пример #13
0
void etk_entropy_delete_dialog_cb(Etk_Object* w, void* user_data)
{
	Etk_Widget* window = NULL;
	int result = (int)user_data;
	entropy_generic_file* file;
	Ecore_List* files;
	entropy_gui_component_instance* instance;
	
	window = etk_object_data_get(ETK_OBJECT(w), "window");
	files= etk_object_data_get(ETK_OBJECT(window), "files");
	instance = etk_object_data_get(ETK_OBJECT(window), "instance");

	switch (result) {
		case ENTROPY_USER_INTERACTION_RESPONSE_YES: {
			ecore_list_first_goto(files);
			while ((file = ecore_list_first_remove(files))) {
				entropy_plugin_filesystem_file_remove(file, instance);
			}
		}
		break;

		case ENTROPY_USER_INTERACTION_RESPONSE_NO: {
		}
		break;
		
		default: break;
	}

	ecore_list_destroy(files);
	etk_object_destroy(ETK_OBJECT(window));
}
Пример #14
0
void get_theme_list() {

	char * path;
	path = malloc(sizeof(char) * PATH_MAX);
	snprintf(path, PATH_MAX, "%s/.e/e/themes", getenv("HOME"));
	
	Ecore_List *list;
	list = ecore_file_ls(path);
	
	ecore_list_first_goto(list);
	char * data;
	themes = NULL;
	while ((data = (char *)ecore_list_next(list)))
		if (strstr(data, ".edj") != NULL) {
			char * file = (char *) strdup(data);
			Etheme_Object * o;
			o = etheme_new(file);
			themes = eina_list_append(themes, o);
			free(file);
		}
	
	ecore_list_destroy(list);
	free(path);
	
}
Пример #15
0
struct object *
ai_util_planet_closest_uncolonised(struct tpe *tpe, struct object *obj){
	Ecore_List *all;
	struct object *dest, *cur;
	uint32_t oid;
	uint64_t destdist, curdist;

	all = tpe_obj_obj_list(tpe->obj);
	
	ecore_list_first_goto(all);
	dest = NULL;
	destdist = UINT64_MAX;
	while ((oid = (int)ecore_list_next(all))){
		cur = tpe_obj_obj_get_by_id(tpe,oid);
		if (cur->type != OBJTYPE_PLANET) continue;
		if (dest == NULL && cur->ai == NULL) {
			dest = cur;
			destdist = tpe_util_dist_calc2(dest,obj);
			continue;
		}
		if (cur->ai != NULL) continue;
		if (cur->owner >= 0) continue;
		curdist = tpe_util_dist_calc2(cur,obj);
		if (curdist < destdist){
			/* New target */
			destdist = curdist;
			dest = cur;
		}
	}

	return dest;
}
Пример #16
0
int entropy_notify_loop(void* data) {
	entropy_notification_engine* notify = (entropy_notification_engine*)data;
	entropy_notify_event* next;

	
	void* (*call_func)(void* arg);

	ecore_list_first_goto (notify->op_queue);
	if ( (next = ecore_list_next(notify->op_queue)) ) {
		next->processed = 1;

		
		/*printf ("*************************************** Notify loop - Processing event..\n");	*/
		/*printf("Calling function '%s'\n", next->function);*/
		call_func = dlsym(next->plugin->dl_ref, next->function);	
		next->return_struct = (*call_func)(next->data);

		/*Relock to remove next*/
		ecore_list_first_remove(notify->op_queue);

		ecore_list_append(notify->exe_queue, next);

		ecore_ipc_server_send(notify->server, ENTROPY_IPC_EVENT_CORE, 6, 0, 0, 0, NULL, 0);
	} else {
	}
		

	return 1;
}
Пример #17
0
void entropy_notify_event_expire_requestor_layout(void* requestor) 
{
	/*HACK - assume the requestor is an entropy_gui_component_instance* -
	 * safe for now - but we commit ourselves here*/

	entropy_notification_engine* engine = entropy_core_get_core()->notify;
	entropy_gui_component_instance* instance = requestor;
	entropy_gui_component_instance* layout = instance->layout_parent;
	entropy_notify_event* ev;


	ecore_list_first_goto(engine->op_queue);
	ev = ecore_list_current(engine->op_queue);
	while ( ev) {
		if (  ((entropy_gui_component_instance*)ev->requestor_data)->layout_parent == layout) {
			if (!ev->processed) {
				ecore_list_remove(engine->op_queue);
				entropy_notify_event_destroy(ev);

				printf("Removed event, unprocessed: %p\n", ev);
				
				ev = ecore_list_current(engine->op_queue);
			} else {
				printf("Left event, processed: %p\n", ev);
				
				ev = ecore_list_next(engine->op_queue);
			}
		} else {
			printf("Left event, different layout: %p\n", ev);
			
			ev = ecore_list_next(engine->op_queue);
		}
	}
}
Пример #18
0
static EXML_Node *find_node(EXML_Node *node, char *key, char *value)
{
    Ecore_List *props;
    EXML_Node  *prop;

    props = node->children;
    ecore_list_first_goto(props);
    prop = ecore_list_current(props);
    while(prop != NULL)
    {
        if(ecore_hash_get(prop->attributes, key))
        {
            if(!strcmp(ecore_hash_get(prop->attributes, key), value))
                return prop;
        }
        if(prop->children)
        {
            EXML_Node *ret;
            if((ret = find_node(prop, key, value)))
                return ret;
        }

        prop = ecore_list_next(props);
    }
    return NULL;
}
Пример #19
0
char* ewl_entropy_tip_window_tip_next() {
    char* next = ecore_list_next(tool_tips);
    if (!next) {
        ecore_list_first_goto(tool_tips);
        next = ecore_list_next(tool_tips);
    }
    return next;
}
Пример #20
0
void entropy_notification_engine_destroy_thread(entropy_notification_engine* engine) {
	/*Request a terminate*/
	engine->terminate = 1;
	entropy_notify_event* ev;
	void* clean;
	entropy_notify_event_cb_data* cb_data;

	/*Wait for thread to finish*/
	printf("Waiting for notify thread to finish..\n");
	printf("..Terminated\n");

	ecore_list_first_goto(engine->op_queue);
	while ( (ev = ecore_list_next(engine->op_queue)) ) {
		//printf("Freeing an event..\n");
	
		if (ev->cb_list) {
			ecore_list_first_goto(ev->cb_list);
			while ( (cb_data = ecore_list_next(ev->cb_list)) ) {
				entropy_free(cb_data);
			}

			ecore_list_destroy(ev->cb_list);
		}
		
		if (ev->cleanup_list) {
                        ecore_list_first_goto(ev->cleanup_list);
                        while ( (clean = ecore_list_next(ev->cleanup_list)) ) {
                                entropy_free(clean);
                        }

			ecore_list_destroy(ev->cleanup_list);
		}

	
	}

	printf("Terminating op queue...\n");
	ecore_list_destroy(engine->op_queue);
	printf("Terminating exe queue...\n");
	ecore_list_destroy(engine->exe_queue);

	/*Return*/
	printf("..Exiting thread\n");
}
Пример #21
0
void
ecrin_ewl_tree_fill_package (void)
{
  Ewl_Widget *row;
  Ewl_Widget *row_enum;
  Ewl_Widget *row_define;
  Ewl_Widget *row_function;
  char       *key;
  char       *label;

  label = "Eet";
  row = ewl_tree_text_row_add (EWL_TREE (tree), NULL,
                               &label);
  label = "Enum";
  row_enum = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row),
                                    &label);
  label = "Define";
  row_define = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row),
                                      &label);
  label = "Function";
  row_function = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row),
                                        &label);


  ecore_list_first_goto(sorted_keys);
  while ((key = ecore_list_next(sorted_keys)))
    {
      Ewl_Widget      *prow;
      Ecrin_Hash_Data *data;
      
      data = ecrin_hash_data_get (key);
      switch (data->type)
        {
        case HASH_DATA_ENUM:
          prow = ewl_tree_text_row_add (EWL_TREE (tree),
                                        EWL_ROW (row_enum),
                                        &data->data_name);
          ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _enum_display, data);
          break;
        case HASH_DATA_DEFINE:
          prow = ewl_tree_text_row_add (EWL_TREE (tree),
                                        EWL_ROW (row_define),
                                        &data->data_name);
          ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _define_display, data);
          break;
        case HASH_DATA_FUNCTION:
          prow = ewl_tree_text_row_add (EWL_TREE (tree),
                                        EWL_ROW (row_function),
                                        &data->data_name);
          ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _function_display, data);
          break;
        default:
          break;
        }
    }
}
Пример #22
0
int
posix_monitor_add(evfs_client * client, evfs_command * command)
{
   Ecore_List *mon_list =
      ecore_hash_get(posix_monitor_hash, evfs_command_first_file_get(command)->path);
   evfs_file_monitor *mon;
   evfs_file_monitor *old;

   mon = calloc(1, sizeof(evfs_file_monitor));
   mon->client = client;
   mon->monitor_path = strdup(evfs_command_first_file_get(command)->path);

   /*Check if we are already monitoring, if not, make a new list of monitors.. */
   if (!mon_list)
     {
        /*printf("No previous instance, making a new list, monitoring..\n"); */

        mon_list = ecore_list_new();
        ecore_hash_set(posix_monitor_hash, mon->monitor_path, mon_list);

        printf("Adding monitor on path '%s'\n", mon->monitor_path);
        if (!
            (mon->em =
             ecore_file_monitor_add(mon->monitor_path,
                                    &evfs_file_monitor_fam_handler,
                                    mon->monitor_path)))
          {
             fprintf(stderr, "EVFS: Error monitoring '%s'\n",
                     mon->monitor_path);
          }

        ecore_list_append(mon_list, mon);
     }
   else
     {
        if (!client_already_monitoring(client, mon_list))
          {
             /*We assume there is something already in the list.  This is probably bad a bad assumption */
             ecore_list_first_goto(mon_list);
             old = ecore_list_current(mon_list);

             /*Make sure we have the ecore ref, so the last monitor can nuke it */
             mon->em = old->em;
             ecore_list_append(mon_list, mon);
          }
        else
          {
             printf("Oi, dufus, you're already monitoring this object\n");
          }

     }

   return 0;

}
Пример #23
0
/**
 * Move the current xml to its first child if there are children
 * @param   xml The xml document
 * @return  The current xml tag name
 * @ingroup EXML_Traversal_Group
 */
char *exml_down(EXML *xml)
{
	CHECK_PARAM_POINTER_RETURN("xml", xml, NULL);

	if (exml_has_children(xml))
		xml->current = ecore_list_first_goto( xml->current->children );
	else
		return NULL;

	return xml->current ? xml->current->tag : NULL;
}
Пример #24
0
void
eke_gui_ewl_feed_change(Eke *eke, Eke_Feed *feed)
{
    Eke_Gui_Ewl_Feed *disp;
    Eke_Feed_Item *item;
    Ewl_Widget *o;

    disp = ecore_hash_get(eke->feeds, feed);
    if (!disp->tab) {
        Ewl_Widget *o;

        disp->tab = ewl_text_new(feed->title);
        ewl_widget_show(disp->tab);

        o = ewl_vbox_new();
        ewl_notebook_page_append(EWL_NOTEBOOK(eke->gui.ewl.notebook),
                                                        disp->tab, o);
        ewl_widget_show(o);

        disp->page = ewl_scrollpane_new();
        ewl_container_child_append(EWL_CONTAINER(o), disp->page);
        ewl_object_insets_set(EWL_OBJECT(disp->page), 5, 5, 5, 5);
        ewl_widget_show(disp->page);
    }
    ewl_container_reset(EWL_CONTAINER(disp->page));

    ecore_list_first_goto(feed->items);
    while ((item = ecore_list_next(feed->items)) != NULL) {
        o = ewl_text_new(NULL);
        ewl_text_wrap_set(EWL_TEXT(o), 1);
        ewl_text_style_set(EWL_TEXT(o), "soft_shadow");
        ewl_text_text_set(EWL_TEXT(o), item->title);
        ewl_container_child_append(EWL_CONTAINER(disp->page), o);
        ewl_widget_show(o);

        if (item->link) {
            o = ewl_text_new(item->link);
            ewl_text_wrap_set(EWL_TEXT(o), 1);
            ewl_container_child_append(EWL_CONTAINER(disp->page), o);
            ewl_widget_show(o);
        }

        if (item->desc) {
            o = ewl_text_new(item->desc);
            ewl_text_wrap_set(EWL_TEXT(o), 1);
            ewl_container_child_append(EWL_CONTAINER(disp->page), o);
            ewl_widget_show(o);
        }

        o = ewl_text_new(" ");
        ewl_container_child_append(EWL_CONTAINER(disp->page), o);
        ewl_widget_show(o);
    }
}
Пример #25
0
/**
 * @brief print the dns list in the standard output
 */
void exalt_dns_printf()
{
    Ecore_List* l = exalt_dns_get_list();
    char *dns;

    printf("## DNS LIST ##\n");
    ecore_list_first_goto(l);
    while (( dns=ecore_list_next(l)))
        printf("%s\n",dns);
    ecore_list_destroy(l);
}
Пример #26
0
void entropy_thumbnailer_plugin_print(Ecore_Hash* mime_register) {
	char* mime_type;
	
	Ecore_List* keys = ecore_hash_keys(mime_register);
	ecore_list_first_goto(keys);
	while ( (mime_type = ecore_list_next(keys)) ) {
		printf ("We have a handler for '%s', it is: %s\n", mime_type, 
		((entropy_plugin*)ecore_hash_get(mime_register, mime_type))->filename );

	}
	ecore_list_destroy(keys);

}
Пример #27
0
void
evfs_file_monitor_fam_handler(void *data, Ecore_File_Monitor * em,
                              Ecore_File_Event event, const char *path)
{
   Ecore_List *mon_list;
   int type;
   int filetype = EVFS_FILE_NORMAL;

   /*printf("Got an event for %s..", path); */

   switch (event)
     {
     case ECORE_FILE_EVENT_MODIFIED:
        /*printf("A modified event..\n"); */
        type = EVFS_FILE_EV_CHANGE;
        break;
     case ECORE_FILE_EVENT_CREATED_FILE:
        type = EVFS_FILE_EV_CREATE;
        /*printf("File created - '%s'\n", path); */
        break;
     case ECORE_FILE_EVENT_CREATED_DIRECTORY:
        type = EVFS_FILE_EV_CREATE;
	filetype = EVFS_FILE_DIRECTORY;
        break;
     case ECORE_FILE_EVENT_DELETED_FILE:
        type = EVFS_FILE_EV_REMOVE;
        break;

     case ECORE_FILE_EVENT_DELETED_DIRECTORY:
        type = EVFS_FILE_EV_REMOVE_DIRECTORY;
        break;

     }

   /*Looking for ppl no notify */
   mon_list = ecore_hash_get(posix_monitor_hash, (char *)data);

   if (mon_list)
     {
        evfs_file_monitor *mon;

        ecore_list_first_goto(mon_list);
        while ((mon = ecore_list_next(mon_list)))
          {
             evfs_file_monitor_event_create(mon->client, type, path, filetype, "file");  /*Find a better way to do the plugin */
             /*We should really use an EvfsFilereference here */
          }
     }

}
Пример #28
0
void
ewl_icon_local_viewer_delete_cb (Ewl_Widget * w, void *ev_data,
				 void *user_data)
{
  Ecore_List *file_list = user_data;
  const char *text = ewl_button_label_get (EWL_BUTTON (w));
  entropy_generic_file *file;
  entropy_gui_component_instance *instance;

  if (!strcmp (text, "Yes")) {
    entropy_plugin *plugin;
    void (*del_func) (entropy_generic_file * source);

    ecore_list_first_goto (file_list);

    /*As mentioned below, this is awkward,
     * but we avoid a sep. data structure here,
     * as long as we make sure this is documented
     * i.e. - this first item on this list is the plugin
     * reference */
    instance = ecore_list_next (file_list);

    plugin =
      entropy_plugins_type_get_first (ENTROPY_PLUGIN_BACKEND_FILE,
				      ENTROPY_PLUGIN_SUB_TYPE_ALL);

    /*Get the func ref */
    del_func = dlsym (plugin->dl_ref, "entropy_filesystem_file_remove");


    while ((file = ecore_list_next (file_list))) {
      printf ("Deleting '%s'\n", file->filename);

      (*del_func) (file);

    }

  }
  else {
    printf ("Selected cancel..\n");
  }



  /*Um...FIXME bad - we need to save a reference to the dialog somewhere */
  ewl_widget_destroy (w->parent->parent->parent);

  ecore_list_destroy (file_list);
}
Пример #29
0
static EWL_CALLBACK_DEFN(fg_mouse_down)
{
	Ewler_Widget *ewler_w = user_data;
	Ewl_Embed *embed;
	Ewl_Event_Mouse_Down *ev = ev_data;
	bool multi;

	if( !ewler_w->selectable ||
			widget_under_cursor )
		return;

	widget_under_cursor = true;

	ewler_w->mouse.state |= EWLER_WIDGET_MOUSE_DOWN;
	ewler_w->mouse.button = ev->button;
	ewler_w->mouse.state_x = ev->x;
	ewler_w->mouse.state_y = ev->y;

	ewler_w->corners.x = CURRENT_X(w);
	ewler_w->corners.y = CURRENT_Y(w);
	ewler_w->corners.u = CURRENT_X(w) + CURRENT_W(w);
	ewler_w->corners.v = CURRENT_Y(w) + CURRENT_H(w);

	if( ev->modifiers & (EWL_KEY_MODIFIER_CTRL | EWL_KEY_MODIFIER_SHIFT) )
		multi = true;
	else
		multi = false;

	if( ev->button == 1 && multi ) {
		form_toggle(ewler_w);
	} else if( ev->button == 1 ||
						 (!multi && !ecore_list_count(form_selected())) ) {
		Ecore_List *selected;

		selected = form_selected();
		if( selected &&
				(ecore_list_count(selected) != 1 ||
				 ecore_list_first_goto(selected) != ewler_w) ) {
			form_deselect_all();
			form_select(ewler_w);
		}
	}

	IF_FREE(ewler_w->source);

	embed = ewl_embed_widget_find(w);
	evas_event_feed_mouse_down(embed->evas, ev->button, EVAS_BUTTON_NONE,
														 0, NULL);
}
Пример #30
0
/**
 * @param window: the X window to search for on the list of ewl window's
 * @return Returns the found ewl window on success, NULL on failure.
 * @brief Find an ewl window by it's X window
 */
Ewl_Window *
ewl_window_window_find(void *window)
{
        Ewl_Window *retwin;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(window, NULL);

        ecore_list_first_goto(ewl_window_list);
        while ((retwin = ecore_list_next(ewl_window_list)))
                if (retwin->window == window)
                        DRETURN_PTR(retwin, DLEVEL_STABLE);

        DRETURN_PTR(NULL, DLEVEL_STABLE);
}