예제 #1
0
파일: exml.c 프로젝트: playya/Enlightenment
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 );
}
예제 #2
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);
		}
	}
}
예제 #3
0
파일: gui_ewl.c 프로젝트: Limsik/e17
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;
}
예제 #4
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;
}
예제 #5
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;
}
예제 #6
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);
}
예제 #7
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);
}
예제 #8
0
파일: exml.c 프로젝트: playya/Enlightenment
/**
 * Move the current xml to its next sibling, return NULL and move to parent
 * at the end of the list
 * @param   xml The xml document
 * @return  The current xml tag name or NULL
 * @ingroup EXML_Traversal_Group
 */
char *exml_next_nomove(EXML *xml)
{
	Ecore_List *p_list;
	EXML_Node *parent, *cur;

	CHECK_PARAM_POINTER_RETURN("xml", xml, NULL);

	if (xml->current) {
		cur = xml->current;
		parent = cur->parent;

		if (parent) {
			p_list = parent->children;

			ecore_list_goto( p_list, xml->current );
			ecore_list_next( p_list );
			if ((xml->current = ecore_list_current(p_list)) == NULL) {
				xml->current = cur;
				return NULL;
			}
		} else
			xml->current = NULL;
	}

	return xml->current ? xml->current->tag : NULL;
}
예제 #9
0
파일: gui_ewl.c 프로젝트: Limsik/e17
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");
}
예제 #10
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:
예제 #11
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;	
}
예제 #12
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;
}
예제 #13
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();
		}
	}
}
예제 #14
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;
}
예제 #15
0
파일: main.c 프로젝트: playya/Enlightenment
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);
	
}
예제 #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
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);
    }
  }
}
예제 #18
0
char *
EvfsFilereference_to_string(EvfsFilereference * ref)
{
   int length = 0;
   char *uri;
   Ecore_List *parent_list = ecore_list_new();
   EvfsFilereference *parent;

   ecore_list_prepend(parent_list, ref);
   length += strlen(ref->plugin_uri) + strlen("://");
   if (ref->username)
     {
        length +=
           strlen(ref->username) + strlen(ref->password) + strlen(":") +
           strlen("@");
     }
   length += strlen(ref->path);

   while ((parent = ref->parent))
     {
        ecore_list_prepend(parent_list, parent);

        length += strlen(parent->plugin_uri) + strlen("://");
        if (parent->username)
          {
             length +=
                strlen(parent->username) + strlen(parent->password) +
                strlen(":") + strlen("@");

          }

        length += strlen(parent->path);
        length += strlen("#");

     }
   length += 1;
   uri = calloc(length, sizeof(char));

   while ((parent = ecore_list_first_remove(parent_list)))
     {
        strcat(uri, parent->plugin_uri);
        strcat(uri, "://");
        if (parent->username)
          {
             strcat(uri, parent->username);
             strcat(uri, ":");
             strcat(uri, parent->password);
             strcat(uri, "@");
          }
        strcat(uri, parent->path);
        if (ecore_list_next(parent_list))
           strcat(uri, "#");
     }

   ecore_list_destroy(parent_list);

   return uri;

}
예제 #19
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");
}
예제 #20
0
파일: gui_ewl.c 프로젝트: Limsik/e17
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;
        }
    }
}
예제 #21
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);
}
예제 #22
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);
    }
}
예제 #23
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);

}
예제 #24
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 */
          }
     }

}
예제 #25
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);
}
예제 #26
0
/*It would seem a good idea to convert this to a hash - but we'd need the actual pointer to the int, or make an ecore_int_hash*/
evfs_connection *
evfs_get_connection_for_id(int id)
{
   evfs_connection *conn;

   ecore_list_first_goto(client_list);

   while ((conn = ecore_list_next(client_list)))
     {
        if (conn->id == id)
           return conn;
     }

   return NULL;

}
예제 #27
0
void
ewl_iconbox_file_paste_cb (Ewl_Widget * w, void *ev_data, void *user_data)
{
  Ecore_List *selected;
  entropy_generic_file *file;
  entropy_gui_component_instance *instance =
    ((entropy_gui_component_instance *) user_data);

  selected = entropy_core_selected_files_get (instance->core);
  ecore_list_first_goto (selected);

  while ((file = ecore_list_next (selected))) {
    entropy_plugin_filesystem_file_copy(file, ((entropy_icon_viewer *) instance->data)->current_dir,
		  instance);
  }
}
예제 #28
0
파일: file.c 프로젝트: playya/Enlightenment
void
file_project_save( Ewler_Project *p )
{
	EXML *xml;
	Ecore_List *names;
	char *name;

	xml = exml_new();

	exml_start(xml);
	exml_tag_set(xml, "project");
	exml_attribute_set(xml, "source", "ewler");
	exml_attribute_set(xml, "version", VERSION);
	
	exml_start(xml);
	exml_tag_set(xml, "name");
	exml_value_set(xml, p->name);
	exml_end(xml);

	exml_start(xml);
	exml_tag_set(xml, "path");
	exml_value_set(xml, p->path);
	exml_end(xml);

	exml_start(xml);
	exml_tag_set(xml, "files");

	names = ecore_hash_keys(p->files);

	while( (name = ecore_list_next(names)) ) {
		exml_start(xml);
		exml_tag_set(xml, "file");
		exml_attribute_set(xml, "name", name);
		exml_value_set(xml, ecore_hash_get(p->files, name));
		exml_end(xml);
	}

	ecore_list_destroy(names);

	exml_end(xml);
	exml_end(xml);

	/* maybe prepend path to this */
	exml_file_write(xml, p->filename);

	exml_destroy(xml);
}
예제 #29
0
entropy_plugin* entropy_plugin_gui_get_by_name_toolkit(char* toolkit, char* name) {
        entropy_plugin* list_item;

	Ecore_List* plugins = entropy_core_get_core()->plugin_list;

        ecore_list_first_goto(plugins);
        while ( (list_item = ecore_list_next(plugins)) ) {
		/*printf("Scanning '%s' for first\n", list_item->filename);*/
                if (list_item->toolkit && list_item->name) {
			if (!strcmp(list_item->toolkit, toolkit) && !(strcmp(list_item->name, name))) {
				return list_item;
	                }
		}
        }

	return NULL;
}
예제 #30
0
파일: gui_ewl.c 프로젝트: Limsik/e17
void
ecrin_ewl_list_fill_package (char *aiguille)
{
  Ewl_Widget *row;
  char       *key;

  if (list_rows)
    ecore_list_destroy (list_rows);

  list_rows = ecore_list_new ();

  if (!aiguille)
    aiguille = "";

  ecore_list_first_goto(sorted_keys);
  while ((key = ecore_list_next(sorted_keys)))
    {
      Ecrin_Hash_Data *data;
      
      data = ecrin_hash_data_get (key);

      if (strstr (key, aiguille))
        {
          row = ewl_tree_text_row_add (EWL_TREE (list), NULL,
                                       &data->data_name);

          ecore_list_append (list_rows, row);

          switch (data->type)
            {
            case HASH_DATA_ENUM:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _enum_display, data);
              break;
            case HASH_DATA_DEFINE:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _define_display, data);
              break;
            case HASH_DATA_FUNCTION:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _function_display, data);
              break;
            default:
              break;
            }
        }
    }

}