X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawitem.h;h=28fdc1832f1b7fdc2a804e86c08aa4c1a043f133;hb=94fe07f4f00135c1d5fab2e304b620c8be570121;hp=9f3420522df5d1a2a1ee3623ad6f4edc02ea75f2;hpb=88feb618dc79481733516a77f285bb6514bb1d17;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h index 9f342052..28fdc183 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h @@ -1,3 +1,22 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2003-2004 Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + + #ifndef _DRAW_ITEM_H #define _DRAW_ITEM_H @@ -23,10 +42,13 @@ enum _DrawableItems { ITEM_TEXT, ITEM_ICON, ITEM_LINE, ITEM_POINT, ITEM_BACKGROUND }; +typedef enum _RelPosX { + POS_START, POS_END +} RelPosX; -typedef enum _RelPos { +typedef enum _RelPosY { OVER, MIDDLE, UNDER -} RelPos; +} RelPosY; /* The DrawContext keeps information about the current drawing position and @@ -40,6 +62,8 @@ typedef enum _RelPos { * when we draw a text, an arc or an icon, while it's unneeded when we * draw a line or background. * + * The modify_* positions are altered by the draw item functions. + * */ @@ -48,41 +72,36 @@ struct _DrawContext { GdkGC *gc; PangoLayout *pango_layout; - DrawInfo *current; - DrawInfo *previous; + struct { + struct { + gint x; + struct { + gint over; + gint middle; + gint under; + } offset; + } start; + + struct { + gint x; + struct { + gint over; + gint middle; + gint under; + } offset; + } end; + + struct { + gint over; + gint middle; + gint under; + } y; + + } drawinfo; }; -/* LttvExecutionState is accessible through the LttvTracefileState. Is has - * a pointer to the LttvProcessState which points to the top of stack - * execution state : LttvExecutionState *state. - * - * LttvExecutionState contains (useful here): - * LttvExecutionMode t, - * LttvExecutionSubmode n, - * LttvProcessStatus s - * - * - * LttvTraceState will be used in the case we need the string of the - * different processes, eventtype_names, syscall_names, trap_names, irq_names. - * - * LttvTracefileState also gives the cpu_name and, as it herits from - * LttvTracefileContext, it gives the LttEvent structure, which is needed - * to get facility name and event name. - */ -struct _DrawInfo { - ItemInfo *over; - ItemInfo *middle; - ItemInfo *under; - - ItemInfo *modify_over; - ItemInfo *modify_middle; - ItemInfo *modify_under; - LttvProcessStatus status; -}; -struct _ItemInfo { - gint x, y; -}; + /* * Structure used to keep information about icons. @@ -101,7 +120,7 @@ struct _DrawOperation { DrawableItems item; LttvHooks *hook; }; - +#if 0 /* * We define here each items that can be drawn, together with their * associated priority. Many item types can have the same priority, @@ -119,6 +138,7 @@ static int Items_Priorities[] = { 30, /* ITEM_POINT */ 10 /* ITEM_BACKGROUND */ }; +#endif //0 /* * Here are the different structures describing each item type that can be @@ -130,9 +150,12 @@ static int Items_Priorities[] = { struct _PropertiesText { GdkColor *foreground; GdkColor *background; - gint size; - gchar *text; - RelPos position; + gint size; + gchar *text; + struct { + RelPosX x; + RelPosY y; + } position; }; @@ -140,21 +163,27 @@ struct _PropertiesIcon { gchar *icon_name; gint width; gint height; - RelPos position; + struct { + RelPosX x; + RelPosY y; + } position; }; struct _PropertiesLine { - GdkColor *color; + GdkColor color; gint line_width; GdkLineStyle style; - RelPos position; + RelPosY y; }; struct _PropertiesArc { GdkColor *color; gint size; /* We force circle by width = height */ gboolean filled; - RelPos position; + struct { + RelPosX x; + RelPosY y; + } position; }; struct _PropertiesBG { @@ -190,6 +219,8 @@ void draw_item( GdkDrawable *drawable, * process_states/ "name associated with LTTV_STATE_SYSCALL" */ + +#if 0 /* * The add_operation has to do a quick sort by priority to keep the operations * in the right order. @@ -231,42 +262,7 @@ void list_operations( LttvIAttribute *attributes, */ void exec_operations( LttvIAttribute *attributes, gchar *pathname); - - -/* - * Functions to create Properties structures. - */ - -PropertiesText *properties_text_create( - GdkColor *foreground, - GdkColor *background, - gint size, - gchar *text, - RelPos position); - -PropertiesIcon *properties_icon_create( - gchar *icon_name, - gint width, - gint height, - RelPos position); - -PropertiesLine *properties_line_create( - GdkColor *color, - gint line_width, - GdkLineStyle style, - RelPos position); - -PropertiesArc *properties_arc_create( - GdkColor *color, - gint size, - gboolean filled, - RelPos position); - -PropertiesBG *properties_bg_create( - GdkColor *color); - - - +#endif //0 /* * Here follow the prototypes of the hook functions used to draw the