X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawitem.c;h=7e1980e24589f791a2a2c78a3c65d50849cb914f;hb=e6542e856d40b763fd1b7e6ae72e689318148fcc;hp=f7dd664bd0784329bbc5713e009cb238e94720b7;hpb=f16a5569e0071a47d2f658225045e8c75de1a7c6;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c index f7dd664b..7e1980e2 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c @@ -94,6 +94,10 @@ * Author : Mathieu Desnoyers, October 2003 */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -104,6 +108,7 @@ #include #include +#include #include "drawitem.h" @@ -111,16 +116,14 @@ #define MAX_PATH_LEN 256 /* drawing hook functions */ -__inline gboolean draw_text( void *hook_data, void *call_data) +gboolean draw_text( void *hook_data, void *call_data) { PropertiesText *properties = (PropertiesText*)hook_data; DrawContext *draw_context = (DrawContext*)call_data; PangoContext *context; PangoLayout *layout; - PangoAttribute *attribute; PangoFontDescription *font_desc;// = pango_font_description_new(); - gint font_size; PangoRectangle ink_rect; layout = draw_context->pango_layout; @@ -160,7 +163,7 @@ __inline gboolean draw_text( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -185,14 +188,14 @@ __inline gboolean draw_text( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) + if(unlikely(enough_space)) gdk_draw_layout_with_colors(draw_context->drawable, draw_context->gc, x, @@ -206,7 +209,7 @@ __inline gboolean draw_text( void *hook_data, void *call_data) /* To speed up the process, search in already loaded icons list first. Only * load it if not present. */ -__inline gboolean draw_icon( void *hook_data, void *call_data) +gboolean draw_icon( void *hook_data, void *call_data) { PropertiesIcon *properties = (PropertiesIcon*)hook_data; DrawContext *draw_context = (DrawContext*)call_data; @@ -220,7 +223,7 @@ __inline gboolean draw_icon( void *hook_data, void *call_data) g_assert(lttv_iattribute_find_by_path(attributes, icon_name, LTTV_POINTER, &value)); - if(*(value.v_pointer) == NULL) + if(unlikely(*(value.v_pointer) == NULL)) { *(value.v_pointer) = icon_info = g_new(IconStruct,1); @@ -258,7 +261,7 @@ __inline gboolean draw_icon( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -283,14 +286,14 @@ __inline gboolean draw_icon( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) { + if(unlikely(enough_space)) { gdk_gc_set_clip_mask(draw_context->gc, icon_info->mask); gdk_gc_set_clip_origin( @@ -311,7 +314,7 @@ __inline gboolean draw_icon( void *hook_data, void *call_data) return 0; } -__inline gboolean draw_line( void *hook_data, void *call_data) +gboolean draw_line( void *hook_data, void *call_data) { PropertiesLine *properties = (PropertiesLine*)hook_data; DrawContext *draw_context = (DrawContext*)call_data; @@ -357,7 +360,7 @@ __inline gboolean draw_line( void *hook_data, void *call_data) return 0; } -__inline gboolean draw_arc( void *hook_data, void *call_data) +gboolean draw_arc( void *hook_data, void *call_data) { PropertiesArc *properties = (PropertiesArc*)hook_data; DrawContext *draw_context = (DrawContext*)call_data; @@ -391,7 +394,7 @@ __inline gboolean draw_arc( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -416,14 +419,14 @@ __inline gboolean draw_arc( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) + if(unlikely(enough_space)) gdk_draw_arc(draw_context->drawable, draw_context->gc, properties->filled, x, @@ -433,7 +436,7 @@ __inline gboolean draw_arc( void *hook_data, void *call_data) return 0; } -__inline gboolean draw_bg( void *hook_data, void *call_data) +gboolean draw_bg( void *hook_data, void *call_data) { PropertiesBG *properties = (PropertiesBG*)hook_data; DrawContext *draw_context = (DrawContext*)call_data;