Exemple #1
0
void utils_slide_insert(List_Item *item_prev)
{
    List_Item *item = calloc(1, sizeof(List_Item));

    Eina_List *l;
    List_Item *_item;
    int i_prev = -1;
    if(item_prev)
    {
        i_prev = 0;
        EINA_LIST_FOREACH(l_slides, l, _item)
        {
            if(item_prev == _item)
                break;
            else
                i_prev++;
        }
    }

    if(!item_prev)
        l_slides = eina_list_prepend(l_slides, item);
    else
        l_slides = eina_list_append_relative(l_slides, item, item_prev);

    eyelight_edit_slide_insert(eyelight_object_pres_get(pres), i_prev);

    slides_grid_append_relative(item, item_prev);
    slides_list_slide_append_relative(item, item_prev);
}
Exemple #2
0
void
etox_line_split(Etox_Line *line, Evas_Object *bit, int index)
{
	Eina_List *ll;
	Etox_Line *newline;
	Evas_Object *split = NULL;

	ll = eina_list_data_find_list(line->bits, bit);

	/*
	 * add the newline after the current one
	 */
	newline = etox_line_new(line->flags | ETOX_LINE_WRAPPED);
	newline->et = line->et;
	line->et->lines = eina_list_append_relative(line->et->lines, newline,
			line);

	/*
	 * If the bit starts on the boundary, simply move it to the next line.
	 */
	if (index > 0) {
		if (index < etox_style_length(bit)) {
			/*
 			 * FIXME: There appears to be a problem here where the widths
			 * of the split bits do not add up to the width of the original
			 * bit! It is noticeable when the first split bit ends with 
			 * a space. Is it counted in the middle of a bit, but not at
			 * the end? This causes a problem where the width of a line
			 * does not match the sum of its bits and then etox_line_wrap
			 * tries to wrap a line that does not have a bit on the edge.
			 */
			split = etox_split_bit(line, bit, index);
		}
		ll = ll->next;
	}

	/*
	 * Move the remaining bits to the new line
	 */
	while (ll) {
		/*
		 * Immediately move to the next object, as the node in the
		 * list pointed to by ll will get removed.
		 */
		bit = ll->data;
		ll = ll->next;

		etox_line_remove(line, bit);
		etox_line_append(newline, bit);
	}
}
Exemple #3
0
EAPI void
e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above)
{
   E_Layout_Item *li;
   
   li = evas_object_data_get(obj, "e_layout_data");
   if (!li) return;
   if (!eina_list_data_find(li->sd->items, above)) return;
   if (!eina_list_data_find(li->sd->items, obj)) return;
   if ((li->sd->items) && eina_list_next(li->sd->items))
     {
	li->sd->items = eina_list_remove(li->sd->items, obj);
	evas_object_stack_above(obj, above);
	li->sd->items = eina_list_append_relative(li->sd->items, obj, above);
     }
}
Exemple #4
0
static void _elm_code_file_line_insert_data(Elm_Code_File *file, const char *content, unsigned int length,
                                            unsigned int row, Eina_Bool mapped, void *data)
{
   Elm_Code_Line *line, *after;

   line = _elm_code_file_line_blank_create(file, row, data);
   if (!line) return;

   if (mapped)
     {
        line->content = content;
        line->length = length;
     }
   else
     {
        line->modified = malloc(sizeof(char)*(length+1));
        strncpy(line->modified, content, length);
        line->modified[length] = 0;
        line->length = length;
     }

   if (row == 1)
     file->lines = eina_list_prepend(file->lines, line);
   else if (row == eina_list_count(file->lines) + 1)
     file->lines = eina_list_append(file->lines, line);
   else
     {
        after = eina_list_nth(file->lines, row - 2);
        file->lines = eina_list_append_relative(file->lines, line, after);
     }

   if (file->parent)
     {
        _elm_code_parse_line(file->parent, line);
        elm_code_callback_fire(file->parent, &ELM_CODE_EVENT_LINE_LOAD_DONE, line);
     }
}