g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data);
g_info("%p, %p, %p", update_time_window_hook, Control_Flow_Data, Control_Flow_Data->Parent_Window);
+ if(GTK_IS_WIDGET(Control_Flow_Data->Scrolled_Window_VC))
+ g_info("widget still exists");
+
/* Process List is removed with it's widget */
//ProcessList_destroy(Control_Flow_Data->Process_List);
if(Control_Flow_Data->Parent_Window != NULL)
#define MAX_PATH_LEN 256
-/* The DrawContext keeps information about the current drawing position and
- * the previous one, so we can use both to draw lines.
- *
- * over : position for drawing over the middle line.
- * middle : middle line position.
- * under : position for drawing under the middle line.
- *
- * the modify_* are used to take into account that we should go forward
- * when we draw a text, an arc or an icon, while it's unneeded when we
- * draw a line or background.
- *
- */
-struct _DrawContext {
- GdkDrawable *drawable;
- GdkGC *gc;
-
-
- DrawInfo *Current;
- DrawInfo *Previous;
-};
-
-struct _DrawInfo {
- ItemInfo *over;
- ItemInfo *middle;
- ItemInfo *under;
-
- ItemInfo *modify_over;
- ItemInfo *modify_middle;
- ItemInfo *modify_under;
-};
-
-/* 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 _ItemInfo {
- gint x, y;
- LttvTraceState *ts;
- LttvTracefileState *tfs;
-};
-
-/*
- * Structure used to keep information about icons.
- */
-struct _IconStruct {
- GdkPixmap *pixmap;
- GdkBitmap *mask;
-};
-
-
-/*
- * The Item element is only used so the DrawOperation is modifiable by users.
- * During drawing, only the Hook is needed.
- */
-struct _DrawOperation {
- DrawableItems Item;
- LttvHooks *Hook;
-};
-
-/*
- * We define here each items that can be drawn, together with their
- * associated priority. Many item types can have the same priority,
- * it's only used for quicksorting the operations when we add a new one
- * to the array of operations to perform. Lower priorities are executed
- * first. So, for example, we may want to give background color a value
- * of 10 while a line would have 20, so the background color, which
- * is in fact a rectangle, does not hide the line.
- */
-
-static int Items_Priorities[] = {
- 50, /* ITEM_TEXT */
- 40, /* ITEM_ICON */
- 20, /* ITEM_LINE */
- 30, /* ITEM_POINT */
- 10 /* ITEM_BACKGROUND */
-};
-
-/*
- * Here are the different structures describing each item type that can be
- * drawn. They contain the information necessary to draw the item : not the
- * position (this is provided by the DrawContext), but the text, icon name,
- * line width, color; all the properties of the specific items.
- */
-
-struct _PropertiesText {
- GdkColor *foreground;
- GdkColor *background;
- gint size;
- gchar *Text;
- RelPos position;
-};
-
-
-struct _PropertiesIcon {
- gchar *icon_name;
- gint width;
- gint height;
- RelPos position;
-};
-
-struct _PropertiesLine {
- GdkColor *color;
- gint line_width;
- GdkLineStyle style;
- RelPos position;
-};
-
-struct _PropertiesArc {
- GdkColor *color;
- gint size; /* We force circle by width = height */
- gboolean filled;
- RelPos position;
-};
-
-struct _PropertiesBG {
- GdkColor *color;
-};
-
-
/* Drawing hook functions */
gboolean draw_text( void *hook_data, void *call_data)
{
LttvAttributeValue value;
gchar icon_name[MAX_PATH_LEN] = "icons/";
IconStruct *icon_info;
-
+
strcat(icon_name, Properties->icon_name);
g_assert(lttv_iattribute_find_by_path(attributes, icon_name,
} RelPos;
+/* The DrawContext keeps information about the current drawing position and
+ * the previous one, so we can use both to draw lines.
+ *
+ * over : position for drawing over the middle line.
+ * middle : middle line position.
+ * under : position for drawing under the middle line.
+ *
+ * the modify_* are used to take into account that we should go forward
+ * when we draw a text, an arc or an icon, while it's unneeded when we
+ * draw a line or background.
+ *
+ */
+struct _DrawContext {
+ GdkDrawable *drawable;
+ GdkGC *gc;
+
+
+ DrawInfo *Current;
+ DrawInfo *Previous;
+};
+
+struct _DrawInfo {
+ ItemInfo *over;
+ ItemInfo *middle;
+ ItemInfo *under;
+
+ ItemInfo *modify_over;
+ ItemInfo *modify_middle;
+ ItemInfo *modify_under;
+};
+
+/* 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 _ItemInfo {
+ gint x, y;
+ LttvTraceState *ts;
+ LttvTracefileState *tfs;
+};
+
+/*
+ * Structure used to keep information about icons.
+ */
+struct _IconStruct {
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+};
+
+
+/*
+ * The Item element is only used so the DrawOperation is modifiable by users.
+ * During drawing, only the Hook is needed.
+ */
+struct _DrawOperation {
+ DrawableItems Item;
+ LttvHooks *Hook;
+};
+
+/*
+ * We define here each items that can be drawn, together with their
+ * associated priority. Many item types can have the same priority,
+ * it's only used for quicksorting the operations when we add a new one
+ * to the array of operations to perform. Lower priorities are executed
+ * first. So, for example, we may want to give background color a value
+ * of 10 while a line would have 20, so the background color, which
+ * is in fact a rectangle, does not hide the line.
+ */
+
+static int Items_Priorities[] = {
+ 50, /* ITEM_TEXT */
+ 40, /* ITEM_ICON */
+ 20, /* ITEM_LINE */
+ 30, /* ITEM_POINT */
+ 10 /* ITEM_BACKGROUND */
+};
+
+/*
+ * Here are the different structures describing each item type that can be
+ * drawn. They contain the information necessary to draw the item : not the
+ * position (this is provided by the DrawContext), but the text, icon name,
+ * line width, color; all the properties of the specific items.
+ */
+
+struct _PropertiesText {
+ GdkColor *foreground;
+ GdkColor *background;
+ gint size;
+ gchar *Text;
+ RelPos position;
+};
+
+
+struct _PropertiesIcon {
+ gchar *icon_name;
+ gint width;
+ gint height;
+ RelPos position;
+};
+
+struct _PropertiesLine {
+ GdkColor *color;
+ gint line_width;
+ GdkLineStyle style;
+ RelPos position;
+};
+
+struct _PropertiesArc {
+ GdkColor *color;
+ gint size; /* We force circle by width = height */
+ gboolean filled;
+ RelPos position;
+};
+
+struct _PropertiesBG {
+ GdkColor *color;
+};
+
+
+
void draw_item( GdkDrawable *drawable,
gint x,
gint y,
};
-//struct _Drawing_t {
-// GtkWidget *Drawing_Area_V;
-// GdkPixmap *Pixmap;
-// ControlFlowData *Control_Flow_Data;
-
-// gint height, width, depth;
-
-//};
-
/* Function responsible for updating the exposed area.
* It must call processTrace() to ask for this update.
*/
gint width,
gint height)
{
+
+// start from pixel to time(x)
+// end from pixel to time (x + width)
+
+// LttvTracesetContext * tsc = get_traceset_context(event_viewer_data->mw);
+
if(width < 0) return ;
if(height < 0) return ;
guicontrolflow_get_process_list(Drawing->Control_Flow_Data),
Drawing, *Pixmap, x, y, width, height);
+ // Let's call processTrace() !!
+
+
+ //lttv_process_traceset_seek_time(tsc, start);
+ //lttv_traceset_context_add_hooks(
+ //lttv_process_traceset
+ //lttv_traceset_context_remove_hooks
}
/* Callbacks */
// widget->allocation.height -
// Drawing->height);
-
if (Drawing->Pixmap)
#include <gtk/gtk.h>
#include <ltt/ltt.h>
#include "CFV.h"
+#include "Draw_Item.h"
/* This part of the viewer does :
* Draw horizontal lines, getting graphic context as arg.
typedef struct _Drawing_t Drawing_t;
-
-//FIXME : TEMPORARILY PLACED HERE FOR GC !!
struct _Drawing_t {
GtkWidget *Drawing_Area_V;
GdkPixmap *Pixmap;
};
-
Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data);
void drawing_destroy(Drawing_t *Drawing);
#define MAX_PATH_LEN 256
//FIXME : remove this include when tests finished.
-#include "Draw_Item.h"
#include <string.h>
-struct _DrawContext {
- GdkDrawable *drawable;
- GdkGC *gc;
-
-
- DrawInfo *Current;
- DrawInfo *Previous;
-};
-
-struct _DrawInfo {
- ItemInfo *over;
- ItemInfo *middle;
- ItemInfo *under;
-
- ItemInfo *modify_over;
- ItemInfo *modify_middle;
- ItemInfo *modify_under;
-};
-
-/* 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 _ItemInfo {
- gint x, y;
- LttvTraceState *ts;
- LttvTracefileState *tfs;
-};
-
-
-
-struct _PropertiesIcon {
- gchar *icon_name;
- gint width;
- gint height;
- RelPos position;
-};
-
-
-
void test_draw_item(Drawing_t *Drawing,
GdkPixmap *Pixmap)
{
properties_icon.width = -1;
properties_icon.height = -1;
properties_icon.position = OVER;
-
draw_icon(&properties_icon, &draw_context);
+ g_free(properties_icon.icon_name);
}
}
Drawing_t *Drawing,
GdkPixmap *Pixmap,
gint x, gint y, // y not used here?
- gint width,
+ gint width,
gint height) // height won't be used here ?
{
int i,j;
gint Font_Size;
//icon
- GdkBitmap *mask = g_new(GdkBitmap, 1);
- GdkPixmap *icon_pixmap = g_new(GdkPixmap, 1);
- GdkGC * gc = gdk_gc_new(Pixmap);
-
+ //GdkBitmap *mask = g_new(GdkBitmap, 1);
+ //GdkPixmap *icon_pixmap = g_new(GdkPixmap, 1);
+ GdkGC * gc;
// rectangle
GdkColor color = { 0, 0xffff, 0x0000, 0x0000 };
+ //gc = gdk_gc_new(Pixmap);
/* Sent text data */
- layout = gtk_widget_create_pango_layout(Drawing->Drawing_Area_V,
- NULL);
- context = pango_layout_get_context(layout);
- FontDesc = pango_context_get_font_description(context);
- Font_Size = pango_font_description_get_size(FontDesc);
- pango_font_description_set_size(FontDesc, Font_Size-3*PANGO_SCALE);
+ //layout = gtk_widget_create_pango_layout(Drawing->Drawing_Area_V,
+ // NULL);
+ //context = pango_layout_get_context(layout);
+ //FontDesc = pango_context_get_font_description(context);
+ //Font_Size = pango_font_description_get_size(FontDesc);
+ //pango_font_description_set_size(FontDesc, Font_Size-3*PANGO_SCALE);
y+(height/2), x + width, y+(height/2),
Drawing->Drawing_Area_V->style->black_gc);
- pango_layout_set_text(layout, "Test", -1);
- gdk_draw_layout(Pixmap, Drawing->Drawing_Area_V->style->black_gc,
- 0, y+height, layout);
+ //pango_layout_set_text(layout, "Test", -1);
+ //gdk_draw_layout(Pixmap, Drawing->Drawing_Area_V->style->black_gc,
+ // 0, y+height, layout);
birth.tv_sec = 14000;
birth.tv_nsec = 55500;
&height);
/* Draw rectangle (background color) */
- gdk_gc_copy(gc, Drawing->Drawing_Area_V->style->black_gc);
- gdk_gc_set_rgb_fg_color(gc, &color);
- gdk_draw_rectangle(Pixmap, gc,
- TRUE,
- x, y, width, height);
+ //gdk_gc_copy(gc, Drawing->Drawing_Area_V->style->black_gc);
+ //gdk_gc_set_rgb_fg_color(gc, &color);
+ //gdk_draw_rectangle(Pixmap, gc,
+ // TRUE,
+ // x, y, width, height);
drawing_draw_line(
Drawing, Pixmap, x,
// }
// }
-
+
test_draw_item(Drawing,Pixmap);
//gdk_gc_set_clip_origin(Drawing->Drawing_Area_V->style->black_gc, 0, 0);
- pango_font_description_set_size(FontDesc, Font_Size);
- g_free(gc);
- g_free(layout);
- //g_free(context);
+ //pango_font_description_set_size(FontDesc, Font_Size);
+ //g_object_unref(layout);
+ //g_object_unref(gc);
}
void send_test_process(ProcessList *Process_List, Drawing_t *Drawing)
{
gint height;
GtkTreeViewColumn *Column = gtk_tree_view_get_column(TreeView, 0);
- GList *Render_List = gtk_tree_view_column_get_cell_renderers(Column);
- GtkCellRenderer *Renderer = g_list_first(Render_List)->data;
+ //GList *Render_List = gtk_tree_view_column_get_cell_renderers(Column);
+ //GtkCellRenderer *Renderer = g_list_first(Render_List)->data;
+ //g_list_free(Render_List);
gtk_tree_view_column_cell_get_size(Column, NULL, NULL, NULL, NULL, &height);
//g_critical("cell 0 height : %u",height);
ProcessInfo Process_Info;
gint *path_indices;
GtkTreeRowReference *got_RowRef;
+ GtkTreePath *tree_path;
Process_Info.pid = pid;
Process_Info.birth = *birth;
Process_List->Process_Hash,
&Process_Info))
{
- path_indices = gtk_tree_path_get_indices (
- gtk_tree_row_reference_get_path(
- (GtkTreeRowReference*)got_RowRef)
- );
+ tree_path = gtk_tree_row_reference_get_path(
+ (GtkTreeRowReference*)got_RowRef);
+ path_indices = gtk_tree_path_get_indices (tree_path);
+ gtk_tree_path_free(tree_path);
*height = get_cell_height(
GTK_TREE_VIEW(Process_List->Process_List_VC));