Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/enterminus/src/bin Modified Files: term.c term.h ui.c Log Message: added cursor, still a hack, but it works =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/term.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- term.c 18 Feb 2005 21:59:04 -0000 1.10 +++ term.c 23 Feb 2005 11:25:14 -0000 1.11 @@ -1,6 +1,5 @@ #include "term.h" - void term_tcanvas_fg_color_set(Term *term, int c) { Term_TGlyph *gl; gl = &term->tcanvas->grid[term->tcanvas->cur_col + (term->tcanvas->cur_row * term->tcanvas->cols)]; @@ -202,14 +201,22 @@ term->bg = NULL; strcpy(term->font.path, DATADIR); strcpy(term->font.face, "VeraMono"); - term->font.size = 10; + term->font.size = 11; term->data_ptr = 0; term->font.width = term_font_get_width(term); term->font.height = term_font_get_height(term); - term->title = NULL; + term->title = NULL; + evas_font_path_append(term->evas, term->font.path); - ecore_timer_add(0.01, term_timers, term); - execute_command(term);//, argc, argv); + ecore_timer_add(0.01, term_timers, term); + ecore_timer_add(0.095, term_cursor_anim, term); + execute_command(term);//, argc, argv); + term->cursor.shape = evas_object_rectangle_add(term->evas); + evas_object_resize(term->cursor.shape, term->font.width, term->font.height); + evas_object_color_set(term->cursor.shape, 100,100,100,255); + evas_object_layer_set(term->cursor.shape, 5); + evas_object_show(term->cursor.shape); + term->cursor.last_reset = ecore_time_get(); term->cmd_fd.ecore = ecore_main_fd_handler_add(term->cmd_fd.sys, ECORE_FD_READ, term_tcanvas_data, term, =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/term.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- term.h 19 Feb 2005 12:18:37 -0000 1.8 +++ term.h 23 Feb 2005 11:25:14 -0000 1.9 @@ -104,6 +104,12 @@ typedef struct _Term_EGlyph Term_EGlyph; +struct _Term_Cursor { + Evas_Object *shape; + int last_reset; +}; +typedef struct _Term_Cursor Term_Cursor; + struct _Term { int term_id; pid_t pid; @@ -111,6 +117,7 @@ Term_TCanvas *tcanvas; Term_EGlyph *grid; Evas_Object *bg; + Term_Cursor cursor; Term_Font font; Evas *evas; Term_Fd cmd_fd; @@ -190,3 +197,4 @@ void term_event_title_change_free(void *data, void *ev); +int term_cursor_anim(Term *term); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/ui.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ui.c 18 Feb 2005 23:26:40 -0000 1.14 +++ ui.c 23 Feb 2005 11:25:14 -0000 1.15 @@ -124,14 +124,20 @@ //evas_object_layer_set(gl->bg,1); //evas_object_move(gl->bg, j*term->font.width, i*term->font.height); //evas_object_show(gl->bg); - tgl->changed = 0; + tgl->changed = 0; + } - if(i + term->tcanvas->scroll_region_start > (term->tcanvas->rows - 1)*term->tcanvas->scroll_size) { + if(i + term->tcanvas->scroll_region_start > (term->tcanvas->rows - 1)*term->tcanvas->scroll_size) { ig++; - } + } + i2++; term->tcanvas->changed_rows[i] = 0; - } + /* display cursor, note: this is still sort of a hack */ + evas_object_move(term->cursor.shape, + term->tcanvas->cur_col*term->font.width, + i*term->font.height); + } } /* Move cursor up n rows*/ @@ -328,3 +334,10 @@ } } + +int term_cursor_anim(Term *term) { + int a; + a = 128 + 127 * cos ((ecore_time_get () - term->cursor.last_reset) * 2); + evas_object_color_set (term->cursor.shape, 100, 100, 100, a); + return 1; +} ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs