All pastes #164467 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-08 17:26 UTC
rendered paste body
static void
ewl_text_tree_node_walk(Ewl_Text *t, Ewl_Text_Tree *tree, unsigned int char_pos)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("tree", tree);
        DCHECK_PARAM_PTR("t", t);
        DCHECK_TYPE("t", t, EWL_TEXT_TYPE);

        /* if we have a context we have something to say */
        if (tree->tx)
        {
                char *fmt, *ptr, tmp;
                unsigned int byte_pos;
                Evas_Textblock_Cursor *cursor;

                fmt = ewl_text_format_get(tree->tx);

                /* we don't free this cursor as it is actually const
                 * Evas_Textblock_Cursor * and i'm casting it...  */
                cursor = (Evas_Textblock_Cursor *)evas_object_textblock_cursor_get(t->textblock);
                evas_textblock_cursor_format_append(cursor, fmt);
                FREE(fmt);

                ewl_text_char_to_byte(t, char_pos, 0, &byte_pos, NULL);

                ptr = t->text + byte_pos;
                tmp = *(ptr + tree->length.bytes);
                *(ptr + tree->length.bytes) = '\0';
printf("%s\n", ptr);
        
                ewl_text_plaintext_parse(t->textblock, ptr);
                *(ptr + tree->length.bytes) = tmp;
        }
        else if (tree->children)
        {
                Ewl_Text_Tree *child;

printf("%d\n", ecore_list_nodes(tree->children));

                ecore_list_goto_first(tree->children);
                while ((child = ecore_list_next(tree->children)))
                {
ewl_text_tree_dump(child, " ---- ");
                        ewl_text_tree_node_walk(t, child, char_pos);
                        char_pos += child->length.chars;
                } 
        }

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}