From bc644c2f0dca47ef440f4d4dc61f0a549853642c Mon Sep 17 00:00:00 2001 From: raster Date: Sun, 20 Jun 2010 06:32:05 +0000 Subject: [PATCH] warnings-- git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@49765 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 35 ++++++++++++++++++++++ src/lib/engines/common/evas_pipe.c | 24 +++++++-------- src/lib/engines/common/evas_pipe.h | 17 ++++++----- src/modules/engines/software_generic/evas_engine.c | 3 +- 4 files changed, 58 insertions(+), 21 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 4082bb6..bb521ec 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -102,6 +102,7 @@ struct _Evas_Object_Textblock_Format double linerelsize; int linegap; double linerelgap; + double linefill; unsigned char style; unsigned char wrap_word : 1; unsigned char wrap_char : 1; @@ -787,6 +788,7 @@ static const char *linerelsizestr = NULL; static const char *linegapstr = NULL; static const char *linerelgapstr = NULL; static const char *itemstr = NULL; +static const char *linefillstr = NULL; static void _format_command_init(void) @@ -820,6 +822,7 @@ _format_command_init(void) linegapstr = eina_stringshare_add("linegap"); linerelgapstr = eina_stringshare_add("linerelgap"); itemstr = eina_stringshare_add("item"); + linefillstr = eina_stringshare_add("linefill"); } static void @@ -854,6 +857,7 @@ _format_command_shutdown(void) eina_stringshare_del(linegapstr); eina_stringshare_del(linerelgapstr); eina_stringshare_del(itemstr); + eina_stringshare_del(linefillstr); } static void @@ -1150,6 +1154,26 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char } } } + else if (cmd == itemstr) + { + // itemstr == replacement object items in textblock - inline imges + // for example + } + else if (cmd == linefillstr) + { + char *endptr = NULL; + double val = strtod(tmp_param, &endptr); + if (endptr) + { + while (*endptr && _is_white(*endptr)) + endptr++; + if (*endptr == '%') + { + fmt->linefill = val / 100.0; + if (fmt->linefill < 0.0) fmt->linefill = 0.0; + } + } + } if (new_font) { @@ -1355,6 +1379,17 @@ _layout_format_ascent_descent_adjust(Ctxt *c, Evas_Object_Textblock_Format *fmt) c->maxdescent += ((ascent + descent) * fmt->linerelgap); if (c->maxascent < ascent) c->maxascent = ascent; if (c->maxdescent < descent) c->maxdescent = descent; + if (fmt->linefill > 0.0) + { + int dh; + + dh = c->obj->cur.geometry.h - (c->maxascent + c->maxdescent); + if (dh < 0) dh = 0; + dh = fmt->linefill * dh; + c->maxdescent += dh / 2; + c->maxascent += dh - (dh / 2); + // FIXME: set flag that says "if heigh changes - reformat" + } } } diff --git a/src/lib/engines/common/evas_pipe.c b/src/lib/engines/common/evas_pipe.c index c71d132..3b00a5c 100644 --- a/src/lib/engines/common/evas_pipe.c +++ b/src/lib/engines/common/evas_pipe.c @@ -1486,7 +1486,7 @@ evas_common_pipe_image_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thre #endif #ifdef SCALECACHE - evas_common_rgba_image_scalecache_do(op->op.image.src, + evas_common_rgba_image_scalecache_do((Image_Entry *)(op->op.image.src), dst, &(context), op->op.image.smooth, op->op.image.sx, @@ -1529,17 +1529,17 @@ evas_common_pipe_image_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thre else { #ifdef SCALECACHE - evas_common_rgba_image_scalecache_do(op->op.image.src, - dst, &(op->context), - op->op.image.smooth, - op->op.image.sx, - op->op.image.sy, - op->op.image.sw, - op->op.image.sh, - op->op.image.dx, - op->op.image.dy, - op->op.image.dw, - op->op.image.dh); + evas_common_rgba_image_scalecache_do((Image_Entry *)(op->op.image.src), + dst, &(op->context), + op->op.image.smooth, + op->op.image.sx, + op->op.image.sy, + op->op.image.sw, + op->op.image.sh, + op->op.image.dx, + op->op.image.dy, + op->op.image.dw, + op->op.image.dh); #else if (op->op.image.smooth) { diff --git a/src/lib/engines/common/evas_pipe.h b/src/lib/engines/common/evas_pipe.h index 651582c..f6609d5 100644 --- a/src/lib/engines/common/evas_pipe.h +++ b/src/lib/engines/common/evas_pipe.h @@ -9,7 +9,7 @@ typedef struct _Thinfo pthread_barrier_t *barrier; RGBA_Pipe_Thread_Info *info; #ifdef EVAS_FRAME_QUEUING - void *fq_info; + void *fq_info; #endif } Thinfo; #endif @@ -50,7 +50,7 @@ struct _Evas_FrameQ pthread_cond_t cond_done; LK(mutex); - int thread_num; + int thread_num; Thinfo thinfo[TH_MAX]; int frameq_sz; @@ -65,17 +65,17 @@ struct _Evas_Frameq_Thread_Info }; typedef struct _Evas_Frameq_Thread_Info Evas_Frameq_Thread_Info; -EAPI Evas_Surface *evas_common_frameq_new_surface (void *surface, int x, int y, int w, int h); +EAPI Evas_Surface *evas_common_frameq_new_surface(void *surface, int x, int y, int w, int h); EAPI void evas_common_frameq_add_surface(Evas_Surface *surface); EAPI void evas_common_frameq_set_frame_data(void *data, void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h), void (*fn_output_flush) (void *data), void (*fn_output_set_priv)(void *data, void *cur, void *prev)); -EAPI void evas_common_frameq_prepare_frame(); -EAPI void evas_common_frameq_ready_frame(); -EAPI void evas_common_frameq_init(); -EAPI void evas_common_frameq_flush(); -EAPI void evas_common_frameq_flush_ready (); +EAPI void evas_common_frameq_prepare_frame(void); +EAPI void evas_common_frameq_ready_frame(void); +EAPI void evas_common_frameq_init(void); +EAPI void evas_common_frameq_flush(void); +EAPI void evas_common_frameq_flush_ready(void); #endif /* image rendering pipelines... new optional system - non-immediate and @@ -94,6 +94,7 @@ EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Dra EAPI void evas_common_pipe_map4_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level); +EAPI void evas_common_pipe_flush(RGBA_Image *im); #ifdef EVAS_FRAME_QUEUING EAPI void evas_common_pipe_op_grad_flush(RGBA_Gradient *gr); diff --git a/src/modules/engines/software_generic/evas_engine.c b/src/modules/engines/software_generic/evas_engine.c index a28185e..e99ce01 100644 --- a/src/modules/engines/software_generic/evas_engine.c +++ b/src/modules/engines/software_generic/evas_engine.c @@ -775,7 +775,8 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image, #endif ) { - evas_common_rgba_image_scalecache_prepare(im, surface, context, smooth, + evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im), + surface, context, smooth, src_x, src_y, src_w, src_h, dst_x, dst_y, dst_w, dst_h); -- 2.7.4