struct _ControlFlowData {
- GtkWidget *scrolled_window;
+ GtkWidget *top_widget;
Tab *tab;
GtkWidget *h_paned;
ControlFlowData * control_flow_data = (ControlFlowData *)data;
Tab * tab = control_flow_data->tab;
lttvwindow_report_focus(tab, guicontrolflow_get_widget(control_flow_data));
+ //g_assert(GTK_WIDGET_CAN_FOCUS(widget));
+ //gtk_widget_grab_focus(widget);
+ g_debug("FOCUS GRABBED");
}
ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ;
+ control_flow_data->v_adjust =
+ GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
+ 0.0, /* Lower */
+ 0.0, /* Upper */
+ 0.0, /* Step inc. */
+ 0.0, /* Page inc. */
+ 0.0)); /* page size */
+
/* Create the drawing */
control_flow_data->drawing = drawing_construct(control_flow_data);
process_list_widget =
processlist_get_widget(control_flow_data->process_list);
- //control_flow_data->Inside_HBox_V = gtk_hbox_new(0, 0);
- control_flow_data->h_paned = gtk_hpaned_new();
-
- gtk_paned_pack1(GTK_PANED(control_flow_data->h_paned), process_list_widget, FALSE, TRUE);
- gtk_paned_pack2(GTK_PANED(control_flow_data->h_paned), drawing_widget, TRUE, TRUE);
+ gtk_tree_view_set_vadjustment(GTK_TREE_VIEW(process_list_widget),
+ GTK_ADJUSTMENT(
+ control_flow_data->v_adjust));
- control_flow_data->v_adjust =
- GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
- 0.0, /* Lower */
- 0.0, /* Upper */
- 0.0, /* Step inc. */
- 0.0, /* Page inc. */
- 0.0)); /* page size */
-
- control_flow_data->scrolled_window =
- gtk_scrolled_window_new (NULL,
- control_flow_data->v_adjust);
-
- gtk_scrolled_window_set_policy(
- GTK_SCROLLED_WINDOW(control_flow_data->scrolled_window) ,
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
-
- gtk_scrolled_window_add_with_viewport(
- GTK_SCROLLED_WINDOW(control_flow_data->scrolled_window),
- control_flow_data->h_paned);
+ //control_flow_data->Inside_HBox_V = gtk_hbox_new(0, 0);
+ control_flow_data->top_widget = control_flow_data->h_paned =
+ gtk_hpaned_new();
+
+ gtk_paned_pack1(GTK_PANED(control_flow_data->h_paned),
+ process_list_widget, FALSE, TRUE);
+ gtk_paned_pack2(GTK_PANED(control_flow_data->h_paned),
+ drawing_widget, TRUE, TRUE);
+
/* Set the size of the drawing area */
//drawing_Resize(drawing, h, w);
gtk_widget_show(drawing_widget);
gtk_widget_show(process_list_widget);
gtk_widget_show(control_flow_data->h_paned);
- gtk_widget_show(control_flow_data->scrolled_window);
g_object_set_data_full(
- G_OBJECT(control_flow_data->scrolled_window),
+ G_OBJECT(control_flow_data->top_widget),
"control_flow_data",
control_flow_data,
(GDestroyNotify)guicontrolflow_destructor);
//can be configured (and this must happend bedore sending
//data)
- g_signal_connect (G_OBJECT (process_list_widget), "grab-focus",
- G_CALLBACK (control_flow_grab_focus),
- control_flow_data);
-
+ //g_signal_connect (G_OBJECT (process_list_widget), "grab-focus",
+ //g_signal_connect (G_OBJECT (control_flow_data->scrolled_window),
+ // "button-press-event",
+ // G_CALLBACK (control_flow_grab_focus),
+ // control_flow_data);
return control_flow_data;
lttvwindow_events_request_remove_all(control_flow_data->tab,
control_flow_data);
+
+ lttvwindowtraces_background_notify_remove(control_flow_data);
}
g_control_flow_data_list =
g_slist_remove(g_control_flow_data_list,control_flow_data);
GtkWidget *guicontrolflow_get_widget(ControlFlowData *control_flow_data)
{
- return control_flow_data->scrolled_window ;
+ return control_flow_data->top_widget ;
}
ProcessList *guicontrolflow_get_process_list
if(width < 0) return ;
if(height < 0) return ;
+ if(drawing->gc == NULL) {
+ drawing->gc = gdk_gc_new(drawing->drawing_area->window);
+ gdk_gc_copy(drawing->gc, drawing->drawing_area->style->black_gc);
+ }
+
+
+
TimeWindow time_window =
lttvwindow_get_time_window(drawing->control_flow_data->tab);
g_debug("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->width, x,
time_window.start_time,
window_end,
&start);
- convert_pixels_to_time(drawing->drawing_area->allocation.width, x+width,
+ convert_pixels_to_time(drawing->width, x+width,
time_window.start_time,
window_end,
&time_end);
//drawing->damage_end = drawing->width;
/* ask for the buffer to be redrawn */
+
gtk_widget_queue_draw_area ( drawing->drawing_area,
- x, 0,
- width, drawing->height);
+ 0, 0,
+ drawing->width, drawing->height);
+
+ /* FIXME
+ * will need more precise pixel_to_time and time_to_pixel conversion
+ * functions to redraw only the needed area. */
+ //gtk_widget_queue_draw_area ( drawing->drawing_area,
+ // x, 0,
+ // width, drawing->height);
}
if(widget->allocation.width != drawing->width) {
g_debug("drawing configure event");
- g_debug("New draw size : %i by %i",widget->allocation.width,
+ g_debug("New alloc draw size : %i by %i",widget->allocation.width,
widget->allocation.height);
if (drawing->pixmap)
gdk_pixmap_unref(drawing->pixmap);
- drawing->pixmap = gdk_pixmap_new(
- widget->window,
- widget->allocation.width + SAFETY,
- widget->allocation.height + SAFETY,
+ drawing->width = widget->allocation.width;
+ //drawing->height = widget->allocation.height;
+
+ drawing->pixmap = gdk_pixmap_new(widget->window,
+ drawing->width + SAFETY,
+ drawing->height,
+ -1);
//ProcessList_get_height
// (GuiControlFlow_get_process_list(drawing->control_flow_data)),
- -1);
- drawing->width = widget->allocation.width;
- drawing->height = widget->allocation.height;
// Clear the image
widget->style->black_gc,
TRUE,
0, 0,
- widget->allocation.width+SAFETY,
- widget->allocation.height+SAFETY);
+ drawing->width+SAFETY,
+ drawing->height);
//g_info("init data request");
// 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;
drawing->damage_begin = 0;
drawing->damage_end = widget->allocation.width;
drawing->damage_begin,
0,
drawing->damage_end - drawing->damage_begin,
- widget->allocation.height);
+ drawing->height);
}
}
return TRUE;
time_window.start_time,
window_end,
current_time,
- widget->allocation.width,
+ drawing->width,
&cursor_x);
0,
dash_list,
2);
- drawing_draw_line(NULL, widget->window,
- cursor_x, 0,
- cursor_x, drawing->height,
- drawing->dotted_gc);
}
+
+ drawing_draw_line(NULL, widget->window,
+ cursor_x, 0,
+ cursor_x, drawing->height,
+ drawing->dotted_gc);
return FALSE;
}
after_expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data )
{
//g_assert(0);
- g_critical("AFTER EXPOSE");
+ g_debug("AFTER EXPOSE");
return FALSE;
/* left mouse button click */
g_debug("x click is : %f", event->x);
- convert_pixels_to_time(widget->allocation.width, (guint)event->x,
+ convert_pixels_to_time(drawing->width, (guint)event->x,
time_window.start_time,
window_end,
&time);
return FALSE;
}
+static gboolean
+scrollbar_size_request(GtkWidget *widget,
+ GtkRequisition *requisition,
+ gpointer user_data)
+{
+ Drawing_t *drawing = (Drawing_t*)user_data;
+
+ gtk_widget_set_size_request(drawing->padding, requisition->width, -1);
+ //gtk_widget_queue_resize(drawing->padding);
+ //gtk_widget_queue_resize(drawing->ruler);
+ gtk_container_check_resize(GTK_CONTAINER(drawing->ruler_hbox));
+ return 0;
+}
drawing->control_flow_data = control_flow_data;
drawing->vbox = gtk_vbox_new(FALSE, 1);
+
+
+ drawing->ruler_hbox = gtk_hbox_new(FALSE, 1);
drawing->ruler = gtk_drawing_area_new ();
+ gtk_widget_add_events(drawing->ruler, GDK_BUTTON_PRESS_MASK);
gtk_widget_set_size_request(drawing->ruler, -1, 27);
+ drawing->padding = gtk_drawing_area_new ();
+ gtk_widget_add_events(drawing->padding, GDK_BUTTON_PRESS_MASK);
+ //gtk_widget_set_size_request(drawing->padding, -1, 27);
+ gtk_box_pack_start(GTK_BOX(drawing->ruler_hbox), drawing->ruler,
+ TRUE, TRUE, 0);
+ gtk_box_pack_end(GTK_BOX(drawing->ruler_hbox), drawing->padding,
+ FALSE, FALSE, 0);
+
+
+
drawing->drawing_area = gtk_drawing_area_new ();
+
+ drawing->gc = NULL;
+
+ drawing->hbox = gtk_hbox_new(FALSE, 1);
+ drawing->viewport = gtk_viewport_new(NULL, control_flow_data->v_adjust);
+ drawing->scrollbar = gtk_vscrollbar_new(control_flow_data->v_adjust);
+ gtk_box_pack_start(GTK_BOX(drawing->hbox), drawing->viewport,
+ TRUE, TRUE, 0);
+ gtk_box_pack_end(GTK_BOX(drawing->hbox), drawing->scrollbar,
+ FALSE, FALSE, 0);
+
+ //drawing->scrolled_window =
+ // gtk_scrolled_window_new (NULL,
+ // control_flow_data->v_adjust);
+
+ //gtk_scrolled_window_set_policy(
+ // GTK_SCROLLED_WINDOW(drawing->scrolled_window),
+ // GTK_POLICY_NEVER,
+ // GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(drawing->vbox), drawing->ruler,
+ gtk_container_add(GTK_CONTAINER(drawing->viewport),
+ drawing->drawing_area);
+ //gtk_scrolled_window_add_with_viewport(
+ // GTK_SCROLLED_WINDOW(drawing->scrolled_window),
+ // drawing->drawing_area);
+
+ gtk_box_pack_start(GTK_BOX(drawing->vbox), drawing->ruler_hbox,
FALSE, FALSE, 0);
- gtk_box_pack_end(GTK_BOX(drawing->vbox), drawing->drawing_area,
+ gtk_box_pack_end(GTK_BOX(drawing->vbox), drawing->hbox,
TRUE, TRUE, 0);
drawing->pango_layout =
drawing->dotted_gc = NULL;
- drawing->height = 0;
- drawing->width = 0;
+ drawing->height = 1;
+ drawing->width = 1;
drawing->depth = 0;
drawing->damage_begin = 0;
(gpointer)drawing);
+ g_signal_connect (G_OBJECT(drawing->scrollbar),
+ "size-request",
+ G_CALLBACK(scrollbar_size_request),
+ (gpointer)drawing);
+
+
+
g_signal_connect (G_OBJECT(drawing->drawing_area),
"expose_event",
G_CALLBACK (expose_event),
(gpointer)drawing);
gtk_widget_show(drawing->ruler);
+ gtk_widget_show(drawing->padding);
+ gtk_widget_show(drawing->ruler_hbox);
+
gtk_widget_show(drawing->drawing_area);
-
+ //gtk_widget_show(drawing->scrolled_window);
+ gtk_widget_show(drawing->viewport);
+ gtk_widget_show(drawing->scrollbar);
+ gtk_widget_show(drawing->hbox);
+
return drawing;
}
g_info("drawing_destroy %p", drawing);
// Do not unref here, Drawing_t destroyed by it's widget.
//g_object_unref( G_OBJECT(drawing->drawing_area));
-
+ if(drawing->gc != NULL)
+ gdk_gc_unref(drawing->gc);
+
g_free(drawing->pango_layout);
if(!drawing->dotted_gc) gdk_gc_unref(drawing->dotted_gc);
g_free(drawing);
/* Allocate a new pixmap with new height */
GdkPixmap *pixmap = gdk_pixmap_new(drawing->drawing_area->window,
drawing->width + SAFETY,
- drawing->height + height + SAFETY,
+ drawing->height + height,
-1);
/* Copy the high region */
drawing->pixmap,
0, y,
0, y + height,
- drawing->width+SAFETY, drawing->height - y + SAFETY);
-
-
+ drawing->width+SAFETY, drawing->height - y);
if (drawing->pixmap)
drawing->pixmap = pixmap;
- drawing->height+=height;
-
+ if(drawing->height==1) drawing->height = height;
+ else drawing->height += height;
+
+ gtk_widget_set_size_request(drawing->drawing_area,
+ -1,
+ drawing->height);
+ gtk_widget_queue_resize_no_redraw(drawing->drawing_area);
+
/* ask for the buffer to be redrawn */
gtk_widget_queue_draw_area ( drawing->drawing_area,
0, y,
GdkPixmap *pixmap = gdk_pixmap_new(
drawing->drawing_area->window,
drawing->width + SAFETY,
- drawing->height - height + SAFETY,
+ drawing->height - height,
-1);
/* Copy the high region */
drawing->pixmap,
0, y + height,
0, y,
- drawing->width, drawing->height - y - height + SAFETY);
+ drawing->width, drawing->height - y - height);
if (drawing->pixmap)
drawing->height-=height;
+ gtk_widget_set_size_request(drawing->drawing_area,
+ -1,
+ drawing->height);
+ gtk_widget_queue_resize_no_redraw(drawing->drawing_area);
/* ask for the buffer to be redrawn */
gtk_widget_queue_draw_area ( drawing->drawing_area,
0, y,
struct _Drawing_t {
GtkWidget *vbox;
GtkWidget *drawing_area;
+ //GtkWidget *scrolled_window;
+ GtkWidget *hbox;
+ GtkWidget *viewport;
+ GtkWidget *scrollbar;
+
+ GtkWidget *ruler_hbox;
GtkWidget *ruler;
+ GtkWidget *padding;
GdkPixmap *pixmap;
ControlFlowData *control_flow_data;
gint damage_begin, damage_end;
LttTime last_start;
GdkGC *dotted_gc;
+ GdkGC *gc;
};
Drawing_t *drawing_construct(ControlFlowData *control_flow_data);
void drawing_data_request_end(EventsRequest *events_request, LttvTracesetState *tss);
-
#endif // _DRAWING_H
g_debug("out : %s",g_quark_to_string(process_out->state->s));
birth = process_out->creation_time;
- gchar *name = strdup(g_quark_to_string(process_out->name));
+ const gchar *name = g_quark_to_string(process_out->name);
HashedProcessData *hashed_process_data_out = NULL;
if(processlist_get_process_pixels(process_list,
&height,
&hashed_process_data_out) == 1)
{
- /* Process not present */
- processlist_add(process_list,
- pid_out,
- &birth,
- tfc->t_context->index,
- name,
- &pl_height,
- &hashed_process_data_out);
- processlist_get_process_pixels(process_list,
- pid_out,
- &birth,
- tfc->t_context->index,
- &y_out,
- &height,
- &hashed_process_data_out);
- drawing_insert_square( control_flow_data->drawing, y_out, height);
+ /* Process not present */
+ processlist_add(process_list,
+ pid_out,
+ &birth,
+ tfc->t_context->index,
+ name,
+ &pl_height,
+ &hashed_process_data_out);
+ g_assert(processlist_get_process_pixels(process_list,
+ pid_out,
+ &birth,
+ tfc->t_context->index,
+ &y_out,
+ &height,
+ &hashed_process_data_out)==0);
+ drawing_insert_square( control_flow_data->drawing, y_out, height);
}
-
- g_free(name);
+ //g_free(name);
/* Find process pid_in in the list... */
process_in = lttv_state_find_process(tfs, pid_in);
g_debug("in : %s",g_quark_to_string(process_in->state->s));
birth = process_in->creation_time;
- name = strdup(g_quark_to_string(process_in->name));
+ name = g_quark_to_string(process_in->name);
HashedProcessData *hashed_process_data_in = NULL;
if(processlist_get_process_pixels(process_list,
&height,
&hashed_process_data_in) == 1)
{
- /* Process not present */
+ /* Process not present */
processlist_add(process_list,
pid_in,
&birth,
drawing_insert_square( control_flow_data->drawing, y_in, height);
}
- g_free(name);
+ //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->width;
LttTime time = ltt_event_time(e);
width,
&x);
//assert(x <= width);
-
+ //
/* draw what represents the event for outgoing process. */
DrawContext *draw_context_out = hashed_process_data_out->draw_context;
if(process_out->state->s == LTTV_STATE_RUN)
{
- 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 = gdk_gc_new(control_flow_data->drawing->pixmap);
+ //gdk_gc_copy(draw_context_out->gc, widget->style->black_gc);
+ draw_context_out->gc = control_flow_data->drawing->gc;
PropertiesBG prop_bg;
prop_bg.color = g_new(GdkColor,1);
g_debug("calling from draw_event");
draw_bg((void*)&prop_bg, (void*)draw_context_out);
g_free(prop_bg.color);
- gdk_gc_unref(draw_context_out->gc);
+ //gdk_gc_unref(draw_context_out->gc);
}
draw_context_out->gc = widget->style->black_gc;
draw_text((void*)&prop_text_out, (void*)draw_context_out);
//gdk_gc_unref(draw_context_out->gc);
- 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 = gdk_gc_new(control_flow_data->drawing->pixmap);
+ //gdk_gc_copy(draw_context_out->gc, widget->style->black_gc);
+ draw_context_out->gc = control_flow_data->drawing->gc;
PropertiesLine prop_line_out;
prop_line_out.color = g_new(GdkColor,1);
draw_line((void*)&prop_line_out, (void*)draw_context_out);
g_free(prop_line_out.color);
- gdk_gc_unref(draw_context_out->gc);
+ //gdk_gc_unref(draw_context_out->gc);
/* Note : finishing line will have to be added when trace read over. */
/* Finally, update the drawing context of the pid_in. */
if(process_in->state->s == LTTV_STATE_RUN)
{
- draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
- gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
+ //draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
+ //gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
+ draw_context_in->gc = control_flow_data->drawing->gc;
PropertiesBG prop_bg;
prop_bg.color = g_new(GdkColor,1);
draw_bg((void*)&prop_bg, (void*)draw_context_in);
g_free(prop_bg.color);
- gdk_gc_unref(draw_context_in->gc);
+ //gdk_gc_unref(draw_context_in->gc);
}
draw_context_in->gc = widget->style->black_gc;
draw_text((void*)&prop_text_in, (void*)draw_context_in);
//gdk_gc_unref(draw_context_in->gc);
- draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
- gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
+ //draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
+ //gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
+ draw_context_in->gc = control_flow_data->drawing->gc;
PropertiesLine prop_line_in;
prop_line_in.color = g_new(GdkColor,1);
draw_line((void*)&prop_line_in, (void*)draw_context_in);
g_free(prop_line_in.color);
- gdk_gc_unref(draw_context_in->gc);
+ //gdk_gc_unref(draw_context_in->gc);
}
return 0;
- /* Temp dump */
+ /* Text dump */
#ifdef DONTSHOW
GString *string = g_string_new("");;
gboolean field_names = TRUE, state = TRUE;
&height,
&hashed_process_data_out) == 1)
{
- /* Process not present */
- processlist_add(process_list,
- pid_out,
- &birth,
- tfc->t_context->index,
- name,
- &pl_height,
- &hashed_process_data_out);
- processlist_get_process_pixels(process_list,
- pid_out,
- &birth,
- tfc->t_context->index,
- &y_out,
- &height,
- &hashed_process_data_out);
- drawing_insert_square( control_flow_data->drawing, y_out, height);
+ /* Process not present */
+ processlist_add(process_list,
+ pid_out,
+ &birth,
+ tfc->t_context->index,
+ name,
+ &pl_height,
+ &hashed_process_data_out);
+ processlist_get_process_pixels(process_list,
+ pid_out,
+ &birth,
+ tfc->t_context->index,
+ &y_out,
+ &height,
+ &hashed_process_data_out);
+ drawing_insert_square( control_flow_data->drawing, y_out, height);
}
g_free(name);
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->width;
convert_time_to_pixels(
*os,
old_end,
TRUE,
drawing->damage_begin+SAFETY, 0,
drawing->damage_end - drawing->damage_begin, // do not overlap
- control_flow_data->drawing->height+SAFETY);
+ control_flow_data->drawing->height);
- gtk_widget_queue_draw_area (drawing->drawing_area,
+ gtk_widget_queue_draw_area (drawing->drawing_area,
0,0,
control_flow_data->drawing->width,
control_flow_data->drawing->height);
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->width;
convert_time_to_pixels(
*ns,
new_end,
x, 0,
-1, -1);
- *old_time_window = *new_time_window;
-
if(drawing->damage_begin == drawing->damage_end)
drawing->damage_end = x;
else
drawing->damage_end =
- control_flow_data->drawing->drawing_area->allocation.width;
+ control_flow_data->drawing->width;
drawing->damage_begin = 0;
TRUE,
drawing->damage_begin, 0,
drawing->damage_end - drawing->damage_begin, // do not overlap
- control_flow_data->drawing->height+SAFETY);
+ control_flow_data->drawing->height);
gtk_widget_queue_draw_area (drawing->drawing_area,
0,0,
TRUE,
0, 0,
control_flow_data->drawing->width+SAFETY, // do not overlap
- control_flow_data->drawing->height+SAFETY);
+ control_flow_data->drawing->height);
gtk_widget_queue_draw_area (drawing->drawing_area,
0,0,
TRUE,
0, 0,
control_flow_data->drawing->width+SAFETY, // do not overlap
- control_flow_data->drawing->height+SAFETY);
+ control_flow_data->drawing->height);
gtk_widget_queue_draw_area (drawing->drawing_area,
0,0,
GtkWidget *widget = drawing->drawing_area;
drawing->damage_begin = 0;
- drawing->damage_end = widget->allocation.width;
+ drawing->damage_end = drawing->width;
// Clear the image
widget->style->black_gc,
TRUE,
0, 0,
- widget->allocation.width+SAFETY,
- widget->allocation.height+SAFETY);
+ drawing->width+SAFETY,
+ drawing->height);
if(drawing->damage_begin < drawing->damage_end)
drawing->damage_begin,
0,
drawing->damage_end-drawing->damage_begin,
- widget->allocation.height);
+ drawing->height);
}
gtk_widget_queue_draw_area(drawing->drawing_area,
GtkWidget *widget = drawing->drawing_area;
drawing->damage_begin = 0;
- drawing->damage_end = widget->allocation.width;
+ drawing->damage_end = drawing->width;
// Clear the image
widget->style->black_gc,
TRUE,
0, 0,
- widget->allocation.width+SAFETY,
- widget->allocation.height+SAFETY);
+ drawing->width+SAFETY,
+ drawing->height);
if(drawing->damage_begin < drawing->damage_end)
drawing->damage_begin,
0,
drawing->damage_end-drawing->damage_begin,
- widget->allocation.height);
+ drawing->height);
}
gtk_widget_queue_draw_area(drawing->drawing_area,
drawing->damage_begin,
0,
drawing->damage_end-drawing->damage_begin,
- widget->allocation.height);
+ drawing->height);
}
return FALSE;
/* Find pixels corresponding to current time . 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->width;
TimeWindow time_window =
lttvwindow_get_time_window(control_flow_data->tab);
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);
- gdk_gc_copy(draw_context->gc, widget->style->black_gc);
+ //draw_context->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
+ //gdk_gc_copy(draw_context->gc, widget->style->black_gc);
+ draw_context->gc = control_flow_data->drawing->gc;
if(process != NULL && process->state->s == LTTV_STATE_RUN)
{
draw_line((void*)&prop_line, (void*)draw_context);
g_free(prop_line.color);
- gdk_gc_unref(draw_context->gc);
+ //gdk_gc_unref(draw_context->gc);
/* Reset draw_context of the process for next request */
process_list->process_list_widget =
gtk_tree_view_new_with_model
(GTK_TREE_MODEL (process_list->list_store));
-
g_object_unref (G_OBJECT (process_list->list_store));
gtk_tree_sortable_set_sort_func(
guint pid,
LttTime *birth,
guint trace_num,
- gchar *name,
+ const gchar *name,
guint *height,
HashedProcessData **pm_hashed_process_data)
{
process_list->process_hash,
&Process_Info))
{
+ GtkTreePath *tree_path;
+
+ tree_path = gtk_tree_row_reference_get_path(
+ hashed_process_data->row_ref);
+
gtk_tree_model_get_iter (
GTK_TREE_MODEL(process_list->list_store),
- &iter,
- gtk_tree_row_reference_get_path(
- (GtkTreeRowReference*)hashed_process_data->row_ref)
- );
+ &iter, tree_path);
+
+ gtk_tree_path_free(tree_path);
gtk_list_store_remove (process_list->list_store, &iter);
GTK_TREE_VIEW(process_list->process_list_widget));
*y = *height * path_indices[0];
*pm_hashed_process_data = hashed_process_data;
+ gtk_tree_path_free(tree_path);
+
return 0;
} else {
*pm_hashed_process_data = hashed_process_data;
*height = get_cell_height(
GTK_TREE_VIEW(process_list->process_list_widget));
*y = *height * path_indices[0];
+ gtk_tree_path_free(tree_path);
return 0;
// out : success (0) and height
int processlist_add(ProcessList *process_list, guint pid, LttTime *birth,
- guint trace_num, gchar *name, guint *height,
+ guint trace_num, const gchar *name, guint *height,
HashedProcessData **hashed_process_data);
// out : success (0) and height
int processlist_remove(ProcessList *process_list, guint pid, LttTime *birth,