MainWindow *mw;
ProcessList *process_list;
- Drawing_t *Drawing;
+ Drawing_t *drawing;
GtkWidget *h_paned;
ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ;
- /* Create the Drawing */
- control_flow_data->Drawing = drawing_construct(control_flow_data);
+ /* Create the drawing */
+ control_flow_data->drawing = drawing_construct(control_flow_data);
drawing_widget =
- drawing_get_widget(control_flow_data->Drawing);
+ drawing_get_widget(control_flow_data->drawing);
control_flow_data->number_of_process = 0;
control_flow_data->h_paned);
/* Set the size of the drawing area */
- //Drawing_Resize(Drawing, h, w);
+ //drawing_Resize(drawing, h, w);
/* Get trace statistics */
//control_flow_data->Trace_Statistics = get_trace_statistics(Trace);
control_flow_data);
//WARNING : The widget must be
- //inserted in the main window before the Drawing area
+ //inserted in the main window before the drawing area
//can be configured (and this must happend bedore sending
//data)
#define MAX_PATH_LEN 256
-/* Drawing hook functions */
+/* drawing hook functions */
gboolean draw_text( void *hook_data, void *call_data)
{
PropertiesText *Properties = (PropertiesText*)hook_data;
#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
/*****************************************************************************
- * Drawing functions *
+ * drawing functions *
*****************************************************************************/
//FIXME Colors will need to be dynamic. Graphic context part not done so far.
* Note : this function cannot clear the background, because it may
* erase drawing already present (SAFETY).
*/
-void drawing_data_request(Drawing_t *Drawing,
+void drawing_data_request(Drawing_t *drawing,
GdkPixmap **pixmap,
gint x, gint y,
gint width,
ControlFlowData *control_flow_data =
(ControlFlowData*)g_object_get_data(
G_OBJECT(
- Drawing->drawing_area),
+ drawing->drawing_area),
"control_flow_data");
LttTime start, end;
g_critical("x is : %i, x+width is : %i", x, x+width);
- convert_pixels_to_time(Drawing->drawing_area->allocation.width, x,
+ convert_pixels_to_time(drawing->drawing_area->allocation.width, x,
&control_flow_data->time_window.start_time,
&window_end,
&start);
- convert_pixels_to_time(Drawing->drawing_area->allocation.width, x + width,
+ convert_pixels_to_time(drawing->drawing_area->allocation.width, x + width,
&control_flow_data->time_window.start_time,
&window_end,
&end);
get_traceset_context(control_flow_data->mw);
//send_test_process(
- //guicontrolflow_get_process_list(Drawing->control_flow_data),
- //Drawing);
+ //guicontrolflow_get_process_list(drawing->control_flow_data),
+ //drawing);
//send_test_drawing(
- //guicontrolflow_get_process_list(Drawing->control_flow_data),
- //Drawing, *pixmap, x, y, width, height);
+ //guicontrolflow_get_process_list(drawing->control_flow_data),
+ //drawing, *pixmap, x, y, width, height);
// Let's call processTrace() !!
EventRequest event_request; // Variable freed at the end of the function.
configure_event( GtkWidget *widget, GdkEventConfigure *event,
gpointer user_data)
{
- Drawing_t *Drawing = (Drawing_t*)user_data;
+ Drawing_t *drawing = (Drawing_t*)user_data;
/* First, get the new time interval of the main window */
* has updated the time interval before this configure gets
* executed.
*/
- get_time_window(Drawing->control_flow_data->mw,
- &Drawing->control_flow_data->time_window);
+ get_time_window(drawing->control_flow_data->mw,
+ &drawing->control_flow_data->time_window);
/* New pixmap, size of the configure event */
//GdkPixmap *pixmap = gdk_pixmap_new(widget->window,
g_critical("New draw size : %i by %i",widget->allocation.width, widget->allocation.height);
- if (Drawing->pixmap)
- gdk_pixmap_unref(Drawing->pixmap);
+ if (drawing->pixmap)
+ gdk_pixmap_unref(drawing->pixmap);
/* If no old pixmap present */
- //if(Drawing->pixmap == NULL)
+ //if(drawing->pixmap == NULL)
{
- Drawing->pixmap = gdk_pixmap_new(
+ drawing->pixmap = gdk_pixmap_new(
widget->window,
widget->allocation.width + SAFETY,
widget->allocation.height + SAFETY,
//ProcessList_get_height
- // (GuiControlFlow_get_process_list(Drawing->control_flow_data)),
+ // (GuiControlFlow_get_process_list(drawing->control_flow_data)),
-1);
- Drawing->width = widget->allocation.width;
- Drawing->height = widget->allocation.height;
+ drawing->width = widget->allocation.width;
+ drawing->height = widget->allocation.height;
// Clear the image
- gdk_draw_rectangle (Drawing->pixmap,
+ gdk_draw_rectangle (drawing->pixmap,
widget->style->white_gc,
TRUE,
0, 0,
/* Initial data request */
// Do not need to ask for data of 1 pixel : not synchronized with
// main window time at this moment.
- drawing_data_request(Drawing, &Drawing->pixmap, 0, 0,
+ drawing_data_request(drawing, &drawing->pixmap, 0, 0,
widget->allocation.width,
widget->allocation.height);
- Drawing->width = widget->allocation.width;
- Drawing->height = widget->allocation.height;
+ drawing->width = widget->allocation.width;
+ drawing->height = widget->allocation.height;
return TRUE;
/* Copy old data to new pixmap */
gdk_draw_drawable (pixmap,
widget->style->white_gc,
- Drawing->pixmap,
+ drawing->pixmap,
0, 0,
0, 0,
-1, -1);
- if (Drawing->pixmap)
- gdk_pixmap_unref(Drawing->pixmap);
+ if (drawing->pixmap)
+ gdk_pixmap_unref(drawing->pixmap);
- Drawing->pixmap = pixmap;
+ drawing->pixmap = pixmap;
// Clear the bottom part of the image (SAFETY)
gdk_draw_rectangle (pixmap,
widget->style->white_gc,
TRUE,
- 0, Drawing->height+SAFETY,
- Drawing->width+SAFETY, // do not overlap
- (widget->allocation.height) - Drawing->height);
+ 0, drawing->height+SAFETY,
+ drawing->width+SAFETY, // do not overlap
+ (widget->allocation.height) - drawing->height);
// Clear the right part of the image (SAFETY)
gdk_draw_rectangle (pixmap,
widget->style->white_gc,
TRUE,
- Drawing->width+SAFETY, 0,
- (widget->allocation.width) - Drawing->width, // do not overlap
- Drawing->height+SAFETY);
+ drawing->width+SAFETY, 0,
+ (widget->allocation.width) - drawing->width, // do not overlap
+ drawing->height+SAFETY);
/* Clear the backgound for data request, but not SAFETY */
gdk_draw_rectangle (pixmap,
- Drawing->drawing_area->style->white_gc,
+ drawing->drawing_area->style->white_gc,
TRUE,
- Drawing->width + SAFETY, 0,
- widget->allocation.width - Drawing->width, // do not overlap
+ drawing->width + SAFETY, 0,
+ widget->allocation.width - drawing->width, // do not overlap
widget->allocation.height+SAFETY);
/* Request data for missing space */
g_info("missing data request");
- drawing_data_request(Drawing, &pixmap, Drawing->width, 0,
- widget->allocation.width - Drawing->width,
+ drawing_data_request(drawing, &pixmap, drawing->width, 0,
+ widget->allocation.width - drawing->width,
widget->allocation.height);
- Drawing->width = widget->allocation.width;
- Drawing->height = widget->allocation.height;
+ drawing->width = widget->allocation.width;
+ drawing->height = widget->allocation.height;
return TRUE;
#endif //NOTUSE
static gboolean
expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data )
{
- Drawing_t *Drawing = (Drawing_t*)user_data;
+ Drawing_t *drawing = (Drawing_t*)user_data;
ControlFlowData *control_flow_data =
(ControlFlowData*)g_object_get_data(
G_OBJECT(widget),
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
- Drawing->pixmap,
+ drawing->pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
if(x >= event->area.x && x <= event->area.x+event->area.width)
{
- GdkGC *gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ GdkGC *gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(gc, widget->style->black_gc);
drawing_draw_line(NULL, widget->window,
(ControlFlowData*)g_object_get_data(
G_OBJECT(widget),
"control_flow_data");
- Drawing_t *Drawing = control_flow_data->Drawing;
+ Drawing_t *drawing = control_flow_data->drawing;
g_critical("click");
Drawing_t *drawing_construct(ControlFlowData *control_flow_data)
{
- Drawing_t *Drawing = g_new(Drawing_t, 1);
+ Drawing_t *drawing = g_new(Drawing_t, 1);
- Drawing->drawing_area = gtk_drawing_area_new ();
- Drawing->control_flow_data = control_flow_data;
+ drawing->drawing_area = gtk_drawing_area_new ();
+ drawing->control_flow_data = control_flow_data;
- Drawing->pango_layout =
- gtk_widget_create_pango_layout(Drawing->drawing_area, NULL);
+ drawing->pango_layout =
+ gtk_widget_create_pango_layout(drawing->drawing_area, NULL);
- //gtk_widget_set_size_request(Drawing->drawing_area->window, 50, 50);
+ //gtk_widget_set_size_request(drawing->drawing_area->window, 50, 50);
g_object_set_data_full(
- G_OBJECT(Drawing->drawing_area),
- "Link_Drawing_Data",
- Drawing,
+ G_OBJECT(drawing->drawing_area),
+ "Link_drawing_Data",
+ drawing,
(GDestroyNotify)drawing_destroy);
- //gtk_widget_modify_bg( Drawing->drawing_area,
+ //gtk_widget_modify_bg( drawing->drawing_area,
// GTK_STATE_NORMAL,
// &CF_Colors[BLACK]);
- //gdk_window_get_geometry(Drawing->drawing_area->window,
+ //gdk_window_get_geometry(drawing->drawing_area->window,
// NULL, NULL,
- // &(Drawing->width),
- // &(Drawing->height),
+ // &(drawing->width),
+ // &(drawing->height),
// -1);
- //Drawing->pixmap = gdk_pixmap_new(
- // Drawing->drawing_area->window,
- // Drawing->width,
- // Drawing->height,
- // Drawing->depth);
+ //drawing->pixmap = gdk_pixmap_new(
+ // drawing->drawing_area->window,
+ // drawing->width,
+ // drawing->height,
+ // drawing->depth);
- Drawing->pixmap = NULL;
+ drawing->pixmap = NULL;
-// Drawing->pixmap = gdk_pixmap_new(Drawing->drawing_area->window,
-// Drawing->drawing_area->allocation.width,
-// Drawing->drawing_area->allocation.height,
+// drawing->pixmap = gdk_pixmap_new(drawing->drawing_area->window,
+// drawing->drawing_area->allocation.width,
+// drawing->drawing_area->allocation.height,
// -1);
- gtk_widget_add_events(Drawing->drawing_area, GDK_BUTTON_PRESS_MASK);
+ gtk_widget_add_events(drawing->drawing_area, GDK_BUTTON_PRESS_MASK);
- g_signal_connect (G_OBJECT(Drawing->drawing_area),
+ g_signal_connect (G_OBJECT(drawing->drawing_area),
"configure_event",
G_CALLBACK (configure_event),
- (gpointer)Drawing);
+ (gpointer)drawing);
- g_signal_connect (G_OBJECT(Drawing->drawing_area),
+ g_signal_connect (G_OBJECT(drawing->drawing_area),
"expose_event",
G_CALLBACK (expose_event),
- (gpointer)Drawing);
+ (gpointer)drawing);
- g_signal_connect (G_OBJECT(Drawing->drawing_area),
+ g_signal_connect (G_OBJECT(drawing->drawing_area),
"button-press-event",
G_CALLBACK (button_press_event),
- (gpointer)Drawing);
+ (gpointer)drawing);
- return Drawing;
+ return drawing;
}
-void drawing_destroy(Drawing_t *Drawing)
+void drawing_destroy(Drawing_t *drawing)
{
// Do not unref here, Drawing_t destroyed by it's widget.
- //g_object_unref( G_OBJECT(Drawing->drawing_area));
+ //g_object_unref( G_OBJECT(drawing->drawing_area));
- g_free(Drawing->pango_layout);
- g_free(Drawing);
+ g_free(drawing->pango_layout);
+ g_free(drawing);
}
-GtkWidget *drawing_get_widget(Drawing_t *Drawing)
+GtkWidget *drawing_get_widget(Drawing_t *drawing)
{
- return Drawing->drawing_area;
+ return drawing->drawing_area;
}
/* convert_pixels_to_time
}
-void drawing_refresh ( Drawing_t *Drawing,
+void drawing_refresh ( Drawing_t *drawing,
guint x, guint y,
guint width, guint height)
{
GdkRectangle update_rect;
gdk_draw_drawable(
- Drawing->drawing_area->window,
- Drawing->drawing_area->
- style->fg_gc[GTK_WIDGET_STATE (Drawing->drawing_area)],
- GDK_DRAWABLE(Drawing->pixmap),
+ drawing->drawing_area->window,
+ drawing->drawing_area->
+ style->fg_gc[GTK_WIDGET_STATE (drawing->drawing_area)],
+ GDK_DRAWABLE(drawing->pixmap),
x, y,
x, y,
width, height);
update_rect.x = 0 ;
update_rect.y = 0 ;
- update_rect.width = Drawing->width;
- update_rect.height = Drawing->height ;
- gtk_widget_draw( Drawing->drawing_area, &update_rect);
+ update_rect.width = drawing->width;
+ update_rect.height = drawing->height ;
+ gtk_widget_draw( drawing->drawing_area, &update_rect);
}
-void drawing_draw_line( Drawing_t *Drawing,
+void drawing_draw_line( Drawing_t *drawing,
GdkPixmap *pixmap,
guint x1, guint y1,
guint x2, guint y2,
-void drawing_resize(Drawing_t *Drawing, guint h, guint w)
+void drawing_resize(Drawing_t *drawing, guint h, guint w)
{
- Drawing->height = h ;
- Drawing->width = w ;
+ drawing->height = h ;
+ drawing->width = w ;
- gtk_widget_set_size_request ( Drawing->drawing_area,
- Drawing->width,
- Drawing->height);
+ gtk_widget_set_size_request ( drawing->drawing_area,
+ drawing->width,
+ drawing->height);
}
/* Insert a square corresponding to a new process in the list */
-/* Applies to whole Drawing->width */
-void drawing_insert_square(Drawing_t *Drawing,
+/* Applies to whole drawing->width */
+void drawing_insert_square(Drawing_t *drawing,
guint y,
guint height)
{
//GdkRectangle update_rect;
/* Allocate a new pixmap with new height */
- GdkPixmap *pixmap = gdk_pixmap_new(Drawing->drawing_area->window,
- Drawing->width + SAFETY,
- Drawing->height + height + SAFETY,
+ GdkPixmap *pixmap = gdk_pixmap_new(drawing->drawing_area->window,
+ drawing->width + SAFETY,
+ drawing->height + height + SAFETY,
-1);
/* Copy the high region */
gdk_draw_drawable (pixmap,
- Drawing->drawing_area->style->black_gc,
- Drawing->pixmap,
+ drawing->drawing_area->style->black_gc,
+ drawing->pixmap,
0, 0,
0, 0,
- Drawing->width + SAFETY, y);
+ drawing->width + SAFETY, y);
/* add an empty square */
gdk_draw_rectangle (pixmap,
- Drawing->drawing_area->style->white_gc,
+ drawing->drawing_area->style->white_gc,
TRUE,
0, y,
- Drawing->width + SAFETY, // do not overlap
+ drawing->width + SAFETY, // do not overlap
height);
/* copy the bottom of the region */
gdk_draw_drawable (pixmap,
- Drawing->drawing_area->style->black_gc,
- Drawing->pixmap,
+ drawing->drawing_area->style->black_gc,
+ drawing->pixmap,
0, y,
0, y + height,
- Drawing->width+SAFETY, Drawing->height - y + SAFETY);
+ drawing->width+SAFETY, drawing->height - y + SAFETY);
- if (Drawing->pixmap)
- gdk_pixmap_unref(Drawing->pixmap);
+ if (drawing->pixmap)
+ gdk_pixmap_unref(drawing->pixmap);
- Drawing->pixmap = pixmap;
+ drawing->pixmap = pixmap;
- Drawing->height+=height;
+ drawing->height+=height;
- /* Rectangle to update, from new Drawing dimensions */
+ /* Rectangle to update, from new drawing dimensions */
//update_rect.x = 0 ;
//update_rect.y = y ;
- //update_rect.width = Drawing->width;
- //update_rect.height = Drawing->height - y ;
- //gtk_widget_draw( Drawing->drawing_area, &update_rect);
+ //update_rect.width = drawing->width;
+ //update_rect.height = drawing->height - y ;
+ //gtk_widget_draw( drawing->drawing_area, &update_rect);
}
/* Remove a square corresponding to a removed process in the list */
-void drawing_remove_square(Drawing_t *Drawing,
+void drawing_remove_square(Drawing_t *drawing,
guint y,
guint height)
{
/* Allocate a new pixmap with new height */
GdkPixmap *pixmap = gdk_pixmap_new(
- Drawing->drawing_area->window,
- Drawing->width + SAFETY,
- Drawing->height - height + SAFETY,
+ drawing->drawing_area->window,
+ drawing->width + SAFETY,
+ drawing->height - height + SAFETY,
-1);
/* Copy the high region */
gdk_draw_drawable (pixmap,
- Drawing->drawing_area->style->black_gc,
- Drawing->pixmap,
+ drawing->drawing_area->style->black_gc,
+ drawing->pixmap,
0, 0,
0, 0,
- Drawing->width + SAFETY, y);
+ drawing->width + SAFETY, y);
/* Copy up the bottom of the region */
gdk_draw_drawable (pixmap,
- Drawing->drawing_area->style->black_gc,
- Drawing->pixmap,
+ drawing->drawing_area->style->black_gc,
+ drawing->pixmap,
0, y + height,
0, y,
- Drawing->width, Drawing->height - y - height + SAFETY);
+ drawing->width, drawing->height - y - height + SAFETY);
- if (Drawing->pixmap)
- gdk_pixmap_unref(Drawing->pixmap);
+ if (drawing->pixmap)
+ gdk_pixmap_unref(drawing->pixmap);
- Drawing->pixmap = pixmap;
+ drawing->pixmap = pixmap;
- Drawing->height-=height;
+ drawing->height-=height;
- /* Rectangle to update, from new Drawing dimensions */
+ /* Rectangle to update, from new drawing dimensions */
//update_rect.x = 0 ;
//update_rect.y = y ;
- //update_rect.width = Drawing->width;
- //update_rect.height = Drawing->height - y ;
- //gtk_widget_draw( Drawing->drawing_area, &update_rect);
+ //update_rect.width = drawing->width;
+ //update_rect.height = drawing->height - y ;
+ //gtk_widget_draw( drawing->drawing_area, &update_rect);
}
};
Drawing_t *drawing_construct(ControlFlowData *control_flow_data);
-void drawing_destroy(Drawing_t *Drawing);
+void drawing_destroy(Drawing_t *drawing);
-GtkWidget *drawing_get_widget(Drawing_t *Drawing);
+GtkWidget *drawing_get_widget(Drawing_t *drawing);
-//void Drawing_Refresh ( Drawing_t *Drawing,
+//void drawing_Refresh ( Drawing_t *drawing,
// guint x, guint y,
// guint width, guint height);
-void drawing_draw_line( Drawing_t *Drawing,
+void drawing_draw_line( Drawing_t *drawing,
GdkPixmap *pixmap,
guint x1, guint y1,
guint x2, guint y2,
GdkGC *GC);
-//void Drawing_copy( Drawing_t *Drawing,
+//void drawing_copy( Drawing_t *drawing,
// guint xsrc, guint ysrc,
// guint xdest, guint ydest,
// guint width, guint height);
/* Insert a square corresponding to a new process in the list */
-void drawing_insert_square(Drawing_t *Drawing,
+void drawing_insert_square(Drawing_t *drawing,
guint y,
guint height);
/* Remove a square corresponding to a removed process in the list */
-void drawing_remove_square(Drawing_t *Drawing,
+void drawing_remove_square(Drawing_t *drawing,
guint y,
guint height);
-//void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
+//void drawing_Resize(Drawing_t *drawing, guint h, guint w);
void convert_pixels_to_time(
gint width,
&y_out,
&height,
&hashed_process_data_out);
- drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height);
+ drawing_insert_square( event_request->control_flow_data->drawing, y_out, height);
}
g_free(name);
&height,
&hashed_process_data_in);
- drawing_insert_square( event_request->control_flow_data->Drawing, y_in, height);
+ drawing_insert_square( event_request->control_flow_data->drawing, y_in, height);
}
g_free(name);
/* Find pixels corresponding to time of the event. If the time does
* not fit in the window, show a warning, not supposed to happend. */
guint x = 0;
- guint width = control_flow_data->Drawing->drawing_area->allocation.width;
+ guint width = control_flow_data->drawing->drawing_area->allocation.width;
LttTime time = ltt_event_time(e);
DrawContext *draw_context_out = hashed_process_data_out->draw_context;
draw_context_out->current->modify_over->x = x;
draw_context_out->current->modify_over->y = y_out;
- draw_context_out->drawable = control_flow_data->Drawing->pixmap;
- draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout;
- GtkWidget *widget = control_flow_data->Drawing->drawing_area;
+ draw_context_out->drawable = control_flow_data->drawing->pixmap;
+ draw_context_out->pango_layout = control_flow_data->drawing->pango_layout;
+ GtkWidget *widget = control_flow_data->drawing->drawing_area;
//draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
- draw_context_out->gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ draw_context_out->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(draw_context_out->gc, widget->style->black_gc);
//draw_context_out->gc = widget->style->black_gc;
//draw_arc((void*)&prop_arc, (void*)draw_context_out);
- //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->pixmap);
+ //test_draw_item(control_flow_data->drawing, control_flow_data->drawing->pixmap);
GdkColor colorfg_out = { 0, 0xffff, 0x0000, 0x0000 };
GdkColor colorbg_out = { 0, 0xffff, 0xffff, 0xffff };
draw_context_out->current->middle->x = x;
draw_context_out->current->middle->y = y_out + height/2;
draw_context_out->previous->middle->y = y_out + height/2;
- draw_context_out->drawable = control_flow_data->Drawing->pixmap;
- draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout;
+ draw_context_out->drawable = control_flow_data->drawing->pixmap;
+ draw_context_out->pango_layout = control_flow_data->drawing->pango_layout;
//draw_context_out->gc = widget->style->black_gc;
- draw_context_out->gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ draw_context_out->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(draw_context_out->gc, widget->style->black_gc);
PropertiesLine prop_line_out;
DrawContext *draw_context_in = hashed_process_data_in->draw_context;
draw_context_in->current->modify_over->x = x;
draw_context_in->current->modify_over->y = y_in;
- draw_context_in->drawable = control_flow_data->Drawing->pixmap;
- draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout;
- widget = control_flow_data->Drawing->drawing_area;
+ draw_context_in->drawable = control_flow_data->drawing->pixmap;
+ draw_context_in->pango_layout = control_flow_data->drawing->pango_layout;
+ widget = control_flow_data->drawing->drawing_area;
//draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
//draw_context_in->gc = widget->style->black_gc;
- draw_context_in->gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
//draw_arc((void*)&prop_arc, (void*)draw_context_in);
- //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->pixmap);
+ //test_draw_item(control_flow_data->drawing, control_flow_data->drawing->pixmap);
GdkColor colorfg_in = { 0, 0x0000, 0xffff, 0x0000 };
GdkColor colorbg_in = { 0, 0xffff, 0xffff, 0xffff };
draw_context_in->current->middle->x = x;
draw_context_in->previous->middle->y = y_in + height/2;
draw_context_in->current->middle->y = y_in + height/2;
- draw_context_in->drawable = control_flow_data->Drawing->pixmap;
- draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout;
+ draw_context_in->drawable = control_flow_data->drawing->pixmap;
+ draw_context_in->pango_layout = control_flow_data->drawing->pango_layout;
//draw_context_in->gc = widget->style->black_gc;
- draw_context_in->gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
PropertiesLine prop_line_in;
&y_out,
&height,
&hashed_process_data_out);
- drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height);
+ drawing_insert_square( event_request->control_flow_data->drawing, y_out, height);
}
g_free(name);
&height,
&hashed_process_data_in);
- drawing_insert_square( event_request->control_flow_data->Drawing, y_in, height);
+ drawing_insert_square( event_request->control_flow_data->drawing, y_in, height);
}
g_free(name);
/* Find pixels corresponding to time of the event. If the time does
* not fit in the window, show a warning, not supposed to happend. */
//guint x = 0;
- //guint width = control_flow_data->Drawing->drawing_area->allocation.width;
+ //guint width = control_flow_data->drawing->drawing_area->allocation.width;
//LttTime time = ltt_event_time(e);
DrawContext *draw_context_out = hashed_process_data_out->draw_context;
//draw_context_out->current->modify_over->x = x;
draw_context_out->current->modify_over->y = y_out;
- draw_context_out->drawable = control_flow_data->Drawing->pixmap;
- draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout;
- GtkWidget *widget = control_flow_data->Drawing->drawing_area;
+ draw_context_out->drawable = control_flow_data->drawing->pixmap;
+ draw_context_out->pango_layout = control_flow_data->drawing->pango_layout;
+ GtkWidget *widget = control_flow_data->drawing->drawing_area;
//draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
draw_context_out->gc = widget->style->black_gc;
//draw_arc((void*)&prop_arc, (void*)draw_context_out);
- //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->pixmap);
+ //test_draw_item(control_flow_data->drawing, control_flow_data->drawing->pixmap);
GdkColor colorfg_out = { 0, 0xffff, 0x0000, 0x0000 };
GdkColor colorbg_out = { 0, 0xffff, 0xffff, 0xffff };
DrawContext *draw_context_in = hashed_process_data_in->draw_context;
//draw_context_in->current->modify_over->x = x;
draw_context_in->current->modify_over->y = y_in;
- draw_context_in->drawable = control_flow_data->Drawing->pixmap;
- draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout;
- widget = control_flow_data->Drawing->drawing_area;
+ draw_context_in->drawable = control_flow_data->drawing->pixmap;
+ draw_context_in->pango_layout = control_flow_data->drawing->pango_layout;
+ widget = control_flow_data->drawing->drawing_area;
//draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
draw_context_in->gc = widget->style->black_gc;
//draw_arc((void*)&prop_arc, (void*)draw_context_in);
- //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->pixmap);
+ //test_draw_item(control_flow_data->drawing, control_flow_data->drawing->pixmap);
GdkColor colorfg_in = { 0, 0x0000, 0xffff, 0x0000 };
GdkColor colorbg_in = { 0, 0xffff, 0xffff, 0xffff };
g_info("scrolling near right");
/* Scroll right, keep right part of the screen */
guint x = 0;
- guint width = control_flow_data->Drawing->drawing_area->allocation.width;
+ guint width = control_flow_data->drawing->drawing_area->allocation.width;
convert_time_to_pixels(
*os,
old_end,
&x);
/* Copy old data to new location */
- gdk_draw_drawable (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
- control_flow_data->Drawing->pixmap,
+ gdk_draw_drawable (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
+ control_flow_data->drawing->pixmap,
x, 0,
0, 0,
-1, -1);
*old_time_window = *new_time_window;
/* Clear the data request background, but not SAFETY */
- gdk_draw_rectangle (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
+ gdk_draw_rectangle (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
TRUE,
x+SAFETY, 0,
- control_flow_data->Drawing->width - x, // do not overlap
- control_flow_data->Drawing->height+SAFETY);
+ control_flow_data->drawing->width - x, // do not overlap
+ control_flow_data->drawing->height+SAFETY);
/* Get new data for the rest. */
- drawing_data_request(control_flow_data->Drawing,
- &control_flow_data->Drawing->pixmap,
+ drawing_data_request(control_flow_data->drawing,
+ &control_flow_data->drawing->pixmap,
x, 0,
- control_flow_data->Drawing->width - x,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width - x,
+ control_flow_data->drawing->height);
- drawing_refresh(control_flow_data->Drawing,
+ drawing_refresh(control_flow_data->drawing,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
} else {
g_info("scrolling near left");
/* Scroll left, keep left part of the screen */
guint x = 0;
- guint width = control_flow_data->Drawing->drawing_area->allocation.width;
+ guint width = control_flow_data->drawing->drawing_area->allocation.width;
convert_time_to_pixels(
*ns,
new_end,
&x);
/* Copy old data to new location */
- gdk_draw_drawable (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
- control_flow_data->Drawing->pixmap,
+ gdk_draw_drawable (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
+ control_flow_data->drawing->pixmap,
0, 0,
x, 0,
-1, -1);
*old_time_window = *new_time_window;
/* Clean the data request background */
- gdk_draw_rectangle (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
+ gdk_draw_rectangle (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
x, // do not overlap
- control_flow_data->Drawing->height+SAFETY);
+ control_flow_data->drawing->height+SAFETY);
/* Get new data for the rest. */
- drawing_data_request(control_flow_data->Drawing,
- &control_flow_data->Drawing->pixmap,
+ drawing_data_request(control_flow_data->drawing,
+ &control_flow_data->drawing->pixmap,
0, 0,
x,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->height);
- drawing_refresh(control_flow_data->Drawing,
+ drawing_refresh(control_flow_data->drawing,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
} else {
g_info("scrolling far");
*old_time_window = *new_time_window;
- gdk_draw_rectangle (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
+ gdk_draw_rectangle (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
- control_flow_data->Drawing->width+SAFETY, // do not overlap
- control_flow_data->Drawing->height+SAFETY);
+ control_flow_data->drawing->width+SAFETY, // do not overlap
+ control_flow_data->drawing->height+SAFETY);
- drawing_data_request(control_flow_data->Drawing,
- &control_flow_data->Drawing->pixmap,
+ drawing_data_request(control_flow_data->drawing,
+ &control_flow_data->drawing->pixmap,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
- drawing_refresh(control_flow_data->Drawing,
+ drawing_refresh(control_flow_data->drawing,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
}
}
} else {
*old_time_window = *new_time_window;
- gdk_draw_rectangle (control_flow_data->Drawing->pixmap,
- control_flow_data->Drawing->drawing_area->style->white_gc,
+ gdk_draw_rectangle (control_flow_data->drawing->pixmap,
+ control_flow_data->drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
- control_flow_data->Drawing->width+SAFETY, // do not overlap
- control_flow_data->Drawing->height+SAFETY);
+ control_flow_data->drawing->width+SAFETY, // do not overlap
+ control_flow_data->drawing->height+SAFETY);
- drawing_data_request(control_flow_data->Drawing,
- &control_flow_data->Drawing->pixmap,
+ drawing_data_request(control_flow_data->drawing,
+ &control_flow_data->drawing->pixmap,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
- drawing_refresh(control_flow_data->Drawing,
+ drawing_refresh(control_flow_data->drawing,
0, 0,
- control_flow_data->Drawing->width,
- control_flow_data->Drawing->height);
+ control_flow_data->drawing->width,
+ control_flow_data->drawing->height);
}
return 0;
set_time_window(control_flow_data->mw, &time_window);
}
- gtk_widget_queue_draw(control_flow_data->Drawing->drawing_area);
+ gtk_widget_queue_draw(control_flow_data->drawing->drawing_area);
return 0;
}
ControlFlowData *control_flow_data =
closure_data->event_request->control_flow_data;
- GtkWidget *widget = control_flow_data->Drawing->drawing_area;
+ GtkWidget *widget = control_flow_data->drawing->drawing_area;
/* Get y position of process */
gint y=0, height=0;
draw_context->current->middle->x = closure_data->event_request->x_end;
draw_context->current->middle->y = y + height/2;
draw_context->previous->middle->y = y + height/2;
- draw_context->drawable = control_flow_data->Drawing->pixmap;
- draw_context->pango_layout = control_flow_data->Drawing->pango_layout;
+ draw_context->drawable = control_flow_data->drawing->pixmap;
+ draw_context->pango_layout = control_flow_data->drawing->pango_layout;
//draw_context->gc = widget->style->black_gc;
- draw_context->gc = gdk_gc_new(control_flow_data->Drawing->pixmap);
+ draw_context->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
gdk_gc_copy(draw_context->gc, widget->style->black_gc);
PropertiesLine prop_line;
/* Event_hooks.c defines the hooks that are given to processTrace as parameter.
- * These hooks call the Drawing API to draw the information on the screen,
+ * These hooks call the drawing API to draw the information on the screen,
* using information from Context, but mostly state (running, waiting...).
*/
-void send_test_data(ProcessList *process_list, Drawing_t *Drawing);
+void send_test_data(ProcessList *process_list, Drawing_t *drawing);
GtkWidget *h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key);
/* Calculate, from pixels in expose, the time interval to get data */
get_time_from_pixels(expose->area.x, expose->area.width,
- control_flow_data->Drawing_Area_Info.width,
+ control_flow_data->drawing_Area_Info.width,
&control_flow_data->Begin_Time, &control_flow_data->End_Time,
&event_request->time_begin, &event_request->time_end)
void add_test_data(ControlFlowData *control_flow_data);
void test_draw(ControlFlowData *control_flow_data);
-void Drawing_Area_Init(ControlFlowData *control_flow_data);
+void drawing_Area_Init(ControlFlowData *control_flow_data);
/*\@}*/
* This function calls the reading library to get the draw_hook called
* for the desired period of time. */
- DrawingAreaInfo *Drawing_Area_Info = &control_flow_data->Drawing_Area_Info;
+ drawingAreaInfo *drawing_Area_Info = &control_flow_data->drawing_Area_Info;
}
/* When redrawing, use widget->allocation.width to get the width of
* drawable area. */
- control_flow_data->Drawing_Area_Info.width = widget->allocation.width;
+ control_flow_data->drawing_Area_Info.width = widget->allocation.width;
test_draw(control_flow_data);
// TRUE,
// //0, 0, widget->allocation.width, widget->allocation.height,
// 0, 0, widget->allocation.width,
- // control_flow_data->Drawing_Area_Info.height,
+ // control_flow_data->drawing_Area_Info.height,
// 0, 64 * 360);
- //Drawing_Area_Init(control_flow_data);
+ //drawing_Area_Init(control_flow_data);
// 2 pixels for the box around the drawing area, 1 pixel for off-by-one
// (starting from 0)
/* Event_Hook.c tests */
-void test_draw_item(Drawing_t *Drawing,
+void test_draw_item(Drawing_t *drawing,
GdkPixmap *pixmap)
{
PropertiesIcon properties_icon;
current.modify_over = &over;
draw_context.drawable = pixmap;
- draw_context.gc = Drawing->drawing_area->style->black_gc;
+ draw_context.gc = drawing->drawing_area->style->black_gc;
draw_context.current = ¤t;
draw_context.previous = NULL;
/* NOTE : no drawing data should be sent there, since the drawing widget
* has not been initialized */
void send_test_drawing(ProcessList *process_list,
- Drawing_t *Drawing,
+ Drawing_t *drawing,
GdkPixmap *pixmap,
gint x, gint y, // y not used here?
gint width,
gc = gdk_gc_new(pixmap);
/* Sent text data */
- layout = gtk_widget_create_pango_layout(Drawing->drawing_area,
+ layout = gtk_widget_create_pango_layout(drawing->drawing_area,
NULL);
context = pango_layout_get_context(layout);
FontDesc = pango_context_get_font_description(context);
g_info("we draw : x : %u, y : %u, width : %u, height : %u", x, y, width, height);
drawing_draw_line(
- Drawing, pixmap, x,
+ drawing, pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->drawing_area->style->black_gc);
+ drawing->drawing_area->style->black_gc);
pango_layout_set_text(layout, "Test", -1);
- gdk_draw_layout(pixmap, Drawing->drawing_area->style->black_gc,
+ gdk_draw_layout(pixmap, drawing->drawing_area->style->black_gc,
0, y+height, layout);
birth.tv_sec = 14000;
drawing_draw_line(
- Drawing, pixmap, x,
+ drawing, pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->drawing_area->style->black_gc);
+ drawing->drawing_area->style->black_gc);
g_info("y : %u, height : %u", y, height);
&height);
/* Draw rectangle (background color) */
- gdk_gc_copy(gc, Drawing->drawing_area->style->black_gc);
+ gdk_gc_copy(gc, drawing->drawing_area->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,
+ drawing, pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->drawing_area->style->black_gc);
+ drawing->drawing_area->style->black_gc);
/* Draw arc */
- gdk_draw_arc(pixmap, Drawing->drawing_area->style->black_gc,
+ gdk_draw_arc(pixmap, drawing->drawing_area->style->black_gc,
TRUE, 100, y, height/2, height/2, 0, 360*64);
g_info("y : %u, height : %u", y, height);
drawing_draw_line(
- Drawing, pixmap, x,
+ drawing, pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->drawing_area->style->black_gc);
+ drawing->drawing_area->style->black_gc);
g_critical("y : %u, height : %u", y, height);
drawing_draw_line(
- Drawing, pixmap, x,
+ drawing, pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->drawing_area->style->black_gc);
+ drawing->drawing_area->style->black_gc);
g_info("y : %u, height : %u", y, height);
// "/home/compudj/local/share/LinuxTraceToolkit/pixmaps/move_message.xpm");
// "/home/compudj/local/share/LinuxTraceToolkit/pixmaps/mini-display.xpm");
- // gdk_gc_set_clip_mask(Drawing->drawing_area->style->black_gc, mask);
+ // gdk_gc_set_clip_mask(drawing->drawing_area->style->black_gc, mask);
// for(i=x;i<x+width;i=i+15)
// {
// {
/* Draw icon */
- //gdk_gc_copy(gc, Drawing->drawing_area->style->black_gc);
-// gdk_gc_set_clip_origin(Drawing->drawing_area->style->black_gc, i, j);
+ //gdk_gc_copy(gc, drawing->drawing_area->style->black_gc);
+// gdk_gc_set_clip_origin(drawing->drawing_area->style->black_gc, i, j);
// gdk_draw_drawable(pixmap,
-// Drawing->drawing_area->style->black_gc,
+// drawing->drawing_area->style->black_gc,
// icon_pixmap,
// 0, 0, i, j, -1, -1);
// }
// }
- test_draw_item(Drawing,pixmap);
+ test_draw_item(drawing,pixmap);
- //gdk_gc_set_clip_origin(Drawing->drawing_area->style->black_gc, 0, 0);
- //gdk_gc_set_clip_mask(Drawing->drawing_area->style->black_gc, NULL);
+ //gdk_gc_set_clip_origin(drawing->drawing_area->style->black_gc, 0, 0);
+ //gdk_gc_set_clip_mask(drawing->drawing_area->style->black_gc, NULL);
//g_free(icon_pixmap);
//g_free(mask);
g_free(gc);
}
-void send_test_process(ProcessList *process_list, Drawing_t *Drawing)
+void send_test_process(ProcessList *process_list, Drawing_t *drawing)
{
guint height, y;
int i;
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
//g_critical("y : %u, height : %u", y, height);
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
//g_critical("y : %u, height : %u", y, height);
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
//g_critical("y : %u, height : %u", y, height);
- //drawing_insert_square( Drawing, height, 5);
+ //drawing_insert_square( drawing, height, 5);
for(i=0; i<10; i++)
{
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
// g_critical("y : %u, height : %u", y, height);
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
//g_critical("y : %u, height : %u", y, height);
&birth,
&y,
&height);
- drawing_insert_square( Drawing, y, height);
+ drawing_insert_square( drawing, y, height);
//g_critical("y : %u, height : %u", y, height);
- //drawing_insert_square( Drawing, height, 5);
+ //drawing_insert_square( drawing, height, 5);
//g_critical("height : %u", height);
10000,
&birth);
- drawing_remove_square( Drawing, y, height);
+ drawing_remove_square( drawing, y, height);
if(row_ref =
(GtkTreeRowReference*)g_hash_table_lookup(