ControlFlowData *control_flow_data =
(ControlFlowData*)g_object_get_data(
G_OBJECT(
- Drawing->Drawing_Area_V),
+ 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_V->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_V->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);
/* Clear the backgound for data request, but not SAFETY */
gdk_draw_rectangle (Pixmap,
- Drawing->Drawing_Area_V->style->white_gc,
+ Drawing->drawing_area->style->white_gc,
TRUE,
Drawing->width + SAFETY, 0,
widget->allocation.width - Drawing->width, // do not overlap
{
Drawing_t *Drawing = g_new(Drawing_t, 1);
- Drawing->Drawing_Area_V = gtk_drawing_area_new ();
+ 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_V, NULL);
+ gtk_widget_create_pango_layout(Drawing->drawing_area, NULL);
- //gtk_widget_set_size_request(Drawing->Drawing_Area_V->window, 50, 50);
+ //gtk_widget_set_size_request(Drawing->drawing_area->window, 50, 50);
g_object_set_data_full(
- G_OBJECT(Drawing->Drawing_Area_V),
+ G_OBJECT(Drawing->drawing_area),
"Link_Drawing_Data",
Drawing,
(GDestroyNotify)drawing_destroy);
- //gtk_widget_modify_bg( Drawing->Drawing_Area_V,
+ //gtk_widget_modify_bg( Drawing->drawing_area,
// GTK_STATE_NORMAL,
// &CF_Colors[BLACK]);
- //gdk_window_get_geometry(Drawing->Drawing_Area_V->window,
+ //gdk_window_get_geometry(Drawing->drawing_area->window,
// NULL, NULL,
// &(Drawing->width),
// &(Drawing->height),
// -1);
//Drawing->Pixmap = gdk_pixmap_new(
- // Drawing->Drawing_Area_V->window,
+ // Drawing->drawing_area->window,
// Drawing->width,
// Drawing->height,
// Drawing->depth);
Drawing->Pixmap = NULL;
-// Drawing->Pixmap = gdk_pixmap_new(Drawing->Drawing_Area_V->window,
-// Drawing->Drawing_Area_V->allocation.width,
-// Drawing->Drawing_Area_V->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_V, GDK_BUTTON_PRESS_MASK);
+ gtk_widget_add_events(Drawing->drawing_area, GDK_BUTTON_PRESS_MASK);
- g_signal_connect (G_OBJECT(Drawing->Drawing_Area_V),
+ g_signal_connect (G_OBJECT(Drawing->drawing_area),
"configure_event",
G_CALLBACK (configure_event),
(gpointer)Drawing);
- g_signal_connect (G_OBJECT(Drawing->Drawing_Area_V),
+ g_signal_connect (G_OBJECT(Drawing->drawing_area),
"expose_event",
G_CALLBACK (expose_event),
(gpointer)Drawing);
- g_signal_connect (G_OBJECT(Drawing->Drawing_Area_V),
+ g_signal_connect (G_OBJECT(Drawing->drawing_area),
"button-press-event",
G_CALLBACK (button_press_event),
(gpointer)Drawing);
{
// Do not unref here, Drawing_t destroyed by it's widget.
- //g_object_unref( G_OBJECT(Drawing->Drawing_Area_V));
+ //g_object_unref( G_OBJECT(Drawing->drawing_area));
g_free(Drawing->pango_layout);
g_free(Drawing);
GtkWidget *drawing_get_widget(Drawing_t *Drawing)
{
- return Drawing->Drawing_Area_V;
+ return Drawing->drawing_area;
}
/* convert_pixels_to_time
GdkRectangle update_rect;
gdk_draw_drawable(
- Drawing->Drawing_Area_V->window,
- Drawing->Drawing_Area_V->
- style->fg_gc[GTK_WIDGET_STATE (Drawing->Drawing_Area_V)],
+ Drawing->drawing_area->window,
+ Drawing->drawing_area->
+ style->fg_gc[GTK_WIDGET_STATE (Drawing->drawing_area)],
GDK_DRAWABLE(Drawing->Pixmap),
x, y,
x, y,
update_rect.y = 0 ;
update_rect.width = Drawing->width;
update_rect.height = Drawing->height ;
- gtk_widget_draw( Drawing->Drawing_Area_V, &update_rect);
+ gtk_widget_draw( Drawing->drawing_area, &update_rect);
}
Drawing->height = h ;
Drawing->width = w ;
- gtk_widget_set_size_request ( Drawing->Drawing_Area_V,
+ gtk_widget_set_size_request ( Drawing->drawing_area,
Drawing->width,
Drawing->height);
//GdkRectangle update_rect;
/* Allocate a new pixmap with new height */
- GdkPixmap *Pixmap = gdk_pixmap_new(Drawing->Drawing_Area_V->window,
+ 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_V->style->black_gc,
+ Drawing->drawing_area->style->black_gc,
Drawing->Pixmap,
0, 0,
0, 0,
/* add an empty square */
gdk_draw_rectangle (Pixmap,
- Drawing->Drawing_Area_V->style->white_gc,
+ Drawing->drawing_area->style->white_gc,
TRUE,
0, y,
Drawing->width + SAFETY, // do not overlap
/* copy the bottom of the region */
gdk_draw_drawable (Pixmap,
- Drawing->Drawing_Area_V->style->black_gc,
+ Drawing->drawing_area->style->black_gc,
Drawing->Pixmap,
0, y,
0, y + height,
//update_rect.y = y ;
//update_rect.width = Drawing->width;
//update_rect.height = Drawing->height - y ;
- //gtk_widget_draw( Drawing->Drawing_Area_V, &update_rect);
+ //gtk_widget_draw( Drawing->drawing_area, &update_rect);
}
/* Allocate a new pixmap with new height */
GdkPixmap *Pixmap = gdk_pixmap_new(
- Drawing->Drawing_Area_V->window,
+ Drawing->drawing_area->window,
Drawing->width + SAFETY,
Drawing->height - height + SAFETY,
-1);
/* Copy the high region */
gdk_draw_drawable (Pixmap,
- Drawing->Drawing_Area_V->style->black_gc,
+ Drawing->drawing_area->style->black_gc,
Drawing->Pixmap,
0, 0,
0, 0,
/* Copy up the bottom of the region */
gdk_draw_drawable (Pixmap,
- Drawing->Drawing_Area_V->style->black_gc,
+ Drawing->drawing_area->style->black_gc,
Drawing->Pixmap,
0, y + height,
0, y,
//update_rect.y = y ;
//update_rect.width = Drawing->width;
//update_rect.height = Drawing->height - y ;
- //gtk_widget_draw( Drawing->Drawing_Area_V, &update_rect);
+ //gtk_widget_draw( Drawing->drawing_area, &update_rect);
}
typedef struct _Drawing_t Drawing_t;
struct _Drawing_t {
- GtkWidget *Drawing_Area_V;
+ GtkWidget *drawing_area;
GdkPixmap *Pixmap;
ControlFlowData *control_flow_data;
*
* This constructor is given as a parameter to the menuitem and toolbar button
* registration. It creates the list.
- * @param pmParentWindow A pointer to the parent window.
+ * @param mw A pointer to the parent window.
* @return The widget created.
*/
GtkWidget *
-h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key)
+h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key)
{
- g_info("h_guicontrolflow, %p, %p, %s", pmParentWindow, s, key);
+ g_info("h_guicontrolflow, %p, %p, %s", mw, s, key);
ControlFlowData *control_flow_data = guicontrolflow() ;
- control_flow_data->mw = pmParentWindow;
+ control_flow_data->mw = mw;
TimeWindow *time_window = guicontrolflow_get_time_window(control_flow_data);
time_window->start_time.tv_sec = 0;
time_window->start_time.tv_nsec = 0;
//g_critical("time width1 : %u",time_window->time_width);
- get_time_window(pmParentWindow,
+ get_time_window(mw,
time_window);
- get_current_time(pmParentWindow,
+ get_current_time(mw,
current_time);
//g_critical("time width2 : %u",time_window->time_width);
// Unreg done in the GuiControlFlow_Destructor
reg_update_time_window(update_time_window_hook, control_flow_data,
- pmParentWindow);
+ mw);
reg_update_current_time(update_current_time_hook, control_flow_data,
- pmParentWindow);
+ mw);
return guicontrolflow_get_widget(control_flow_data) ;
}
int event_selected_hook(void *hook_data, void *call_data)
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
- guint *Event_Number = (guint*) call_data;
+ guint *event_number = (guint*) call_data;
- g_critical("DEBUG : event selected by main window : %u", *Event_Number);
+ g_critical("DEBUG : event selected by main window : %u", *event_number);
-// control_flow_data->currently_Selected_Event = *Event_Number;
+// control_flow_data->currently_Selected_Event = *event_number;
// control_flow_data->Selected_Event = TRUE ;
// tree_v_set_cursor(control_flow_data);
}
/* Hook called before drawing. Gets the initial context at the beginning of the
- * drawing interval and copy it to the context in Event_Request.
+ * drawing interval and copy it to the context in event_request.
*/
int draw_before_hook(void *hook_data, void *call_data)
{
- EventRequest *Event_Request = (EventRequest*)hook_data;
+ EventRequest *event_request = (EventRequest*)hook_data;
//EventsContext Events_Context = (EventsContext*)call_data;
- //Event_Request->Events_Context = Events_Context;
+ //event_request->Events_Context = Events_Context;
return 0;
}
*/
int draw_event_hook(void *hook_data, void *call_data)
{
- EventRequest *Event_Request = (EventRequest*)hook_data;
- ControlFlowData *control_flow_data = Event_Request->control_flow_data;
+ EventRequest *event_request = (EventRequest*)hook_data;
+ ControlFlowData *control_flow_data = event_request->control_flow_data;
LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
ProcessList *process_list =
- guicontrolflow_get_process_list(Event_Request->control_flow_data);
+ guicontrolflow_get_process_list(event_request->control_flow_data);
LttField *f = ltt_event_field(e);
birth = process_out->creation_time;
gchar *name = strdup(g_quark_to_string(process_out->name));
- HashedProcessData *Hashed_Process_Data_out = NULL;
+ HashedProcessData *hashed_process_data_out = NULL;
if(processlist_get_process_pixels(process_list,
pid_out,
&birth,
&y_out,
&height,
- &Hashed_Process_Data_out) == 1)
+ &hashed_process_data_out) == 1)
{
/* Process not present */
processlist_add(process_list,
&birth,
name,
&pl_height,
- &Hashed_Process_Data_out);
+ &hashed_process_data_out);
processlist_get_process_pixels(process_list,
pid_out,
&birth,
&y_out,
&height,
- &Hashed_Process_Data_out);
- drawing_insert_square( Event_Request->control_flow_data->Drawing, y_out, height);
+ &hashed_process_data_out);
+ drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height);
}
g_free(name);
birth = process_in->creation_time;
name = strdup(g_quark_to_string(process_in->name));
- HashedProcessData *Hashed_Process_Data_in = NULL;
+ HashedProcessData *hashed_process_data_in = NULL;
if(processlist_get_process_pixels(process_list,
pid_in,
&birth,
&y_in,
&height,
- &Hashed_Process_Data_in) == 1)
+ &hashed_process_data_in) == 1)
{
/* Process not present */
processlist_add(process_list,
&birth,
name,
&pl_height,
- &Hashed_Process_Data_in);
+ &hashed_process_data_in);
processlist_get_process_pixels(process_list,
pid_in,
&birth,
&y_in,
&height,
- &Hashed_Process_Data_in);
+ &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_V->allocation.width;
+ guint width = control_flow_data->Drawing->drawing_area->allocation.width;
LttTime time = ltt_event_time(e);
/* draw what represents the event for outgoing process. */
- DrawContext *draw_context_out = Hashed_Process_Data_out->draw_context;
+ 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_V;
+ 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);
gdk_gc_copy(draw_context_out->gc, widget->style->black_gc);
/* Draw the line of the out process */
if(draw_context_out->previous->middle->x == -1)
{
- draw_context_out->previous->middle->x = Event_Request->x_begin;
- g_critical("out middle x_beg : %u",Event_Request->x_begin);
+ draw_context_out->previous->middle->x = event_request->x_begin;
+ g_critical("out middle x_beg : %u",event_request->x_begin);
}
draw_context_out->current->middle->x = x;
/* Finally, update the drawing context of the pid_in. */
- DrawContext *draw_context_in = Hashed_Process_Data_in->draw_context;
+ 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_V;
+ 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 the line of the in process */
if(draw_context_in->previous->middle->x == -1)
{
- draw_context_in->previous->middle->x = Event_Request->x_begin;
- g_critical("in middle x_beg : %u",Event_Request->x_begin);
+ draw_context_in->previous->middle->x = event_request->x_begin;
+ g_critical("in middle x_beg : %u",event_request->x_begin);
}
draw_context_in->current->middle->x = x;
int draw_after_hook(void *hook_data, void *call_data)
{
- EventRequest *Event_Request = (EventRequest*)hook_data;
- ControlFlowData *control_flow_data = Event_Request->control_flow_data;
+ EventRequest *event_request = (EventRequest*)hook_data;
+ ControlFlowData *control_flow_data = event_request->control_flow_data;
LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
ProcessList *process_list =
- guicontrolflow_get_process_list(Event_Request->control_flow_data);
+ guicontrolflow_get_process_list(event_request->control_flow_data);
LttField *f = ltt_event_field(e);
birth = process_out->creation_time;
gchar *name = strdup(g_quark_to_string(process_out->name));
- HashedProcessData *Hashed_Process_Data_out = NULL;
+ HashedProcessData *hashed_process_data_out = NULL;
if(processlist_get_process_pixels(process_list,
pid_out,
&birth,
&y_out,
&height,
- &Hashed_Process_Data_out) == 1)
+ &hashed_process_data_out) == 1)
{
/* Process not present */
processlist_add(process_list,
&birth,
name,
&pl_height,
- &Hashed_Process_Data_out);
+ &hashed_process_data_out);
processlist_get_process_pixels(process_list,
pid_out,
&birth,
&y_out,
&height,
- &Hashed_Process_Data_out);
- drawing_insert_square( Event_Request->control_flow_data->Drawing, y_out, height);
+ &hashed_process_data_out);
+ drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height);
}
g_free(name);
birth = process_in->creation_time;
name = strdup(g_quark_to_string(process_in->name));
- HashedProcessData *Hashed_Process_Data_in = NULL;
+ HashedProcessData *hashed_process_data_in = NULL;
if(processlist_get_process_pixels(process_list,
pid_in,
&birth,
&y_in,
&height,
- &Hashed_Process_Data_in) == 1)
+ &hashed_process_data_in) == 1)
{
/* Process not present */
processlist_add(process_list,
&birth,
name,
&pl_height,
- &Hashed_Process_Data_in);
+ &hashed_process_data_in);
processlist_get_process_pixels(process_list,
pid_in,
&birth,
&y_in,
&height,
- &Hashed_Process_Data_in);
+ &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_V->allocation.width;
+ //guint width = control_flow_data->Drawing->drawing_area->allocation.width;
//LttTime time = ltt_event_time(e);
/* draw what represents the event for outgoing process. */
- DrawContext *draw_context_out = Hashed_Process_Data_out->draw_context;
+ 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_V;
+ 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;
/* Finally, update the drawing context of the pid_in. */
- DrawContext *draw_context_in = Hashed_Process_Data_in->draw_context;
+ 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_V;
+ 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;
gint update_time_window_hook(void *hook_data, void *call_data)
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
- TimeWindow *Old_time_window =
+ TimeWindow *old_time_window =
guicontrolflow_get_time_window(control_flow_data);
- TimeWindow *New_time_window = ((TimeWindow*)call_data);
+ TimeWindow *new_time_window = ((TimeWindow*)call_data);
/* Two cases : zoom in/out or scrolling */
*/
g_info("Old time window HOOK : %u, %u to %u, %u",
- Old_time_window->start_time.tv_sec,
- Old_time_window->start_time.tv_nsec,
- Old_time_window->time_width.tv_sec,
- Old_time_window->time_width.tv_nsec);
+ old_time_window->start_time.tv_sec,
+ old_time_window->start_time.tv_nsec,
+ old_time_window->time_width.tv_sec,
+ old_time_window->time_width.tv_nsec);
g_info("New time window HOOK : %u, %u to %u, %u",
- New_time_window->start_time.tv_sec,
- New_time_window->start_time.tv_nsec,
- New_time_window->time_width.tv_sec,
- New_time_window->time_width.tv_nsec);
+ new_time_window->start_time.tv_sec,
+ new_time_window->start_time.tv_nsec,
+ new_time_window->time_width.tv_sec,
+ new_time_window->time_width.tv_nsec);
- if( New_time_window->time_width.tv_sec == Old_time_window->time_width.tv_sec
- && New_time_window->time_width.tv_nsec == Old_time_window->time_width.tv_nsec)
+ if( new_time_window->time_width.tv_sec == old_time_window->time_width.tv_sec
+ && new_time_window->time_width.tv_nsec == old_time_window->time_width.tv_nsec)
{
/* Same scale (scrolling) */
g_info("scrolling");
- LttTime *ns = &New_time_window->start_time;
- LttTime *os = &Old_time_window->start_time;
- LttTime old_end = ltt_time_add(Old_time_window->start_time,
- Old_time_window->time_width);
- LttTime new_end = ltt_time_add(New_time_window->start_time,
- New_time_window->time_width);
+ LttTime *ns = &new_time_window->start_time;
+ LttTime *os = &old_time_window->start_time;
+ LttTime old_end = ltt_time_add(old_time_window->start_time,
+ old_time_window->time_width);
+ LttTime new_end = ltt_time_add(new_time_window->start_time,
+ new_time_window->time_width);
//if(ns<os+w<ns+w)
//if(ns<os+w && os+w<ns+w)
//if(ns<old_end && os<ns)
g_info("scrolling near right");
/* Scroll right, keep right part of the screen */
guint x = 0;
- guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width;
+ guint width = control_flow_data->Drawing->drawing_area->allocation.width;
convert_time_to_pixels(
*os,
old_end,
/* Copy old data to new location */
gdk_draw_drawable (control_flow_data->Drawing->Pixmap,
- control_flow_data->Drawing->Drawing_Area_V->style->white_gc,
+ control_flow_data->Drawing->drawing_area->style->white_gc,
control_flow_data->Drawing->Pixmap,
x, 0,
0, 0,
width,
&x);
- *Old_time_window = *New_time_window;
+ *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_V->style->white_gc,
+ control_flow_data->Drawing->drawing_area->style->white_gc,
TRUE,
x+SAFETY, 0,
control_flow_data->Drawing->width - x, // do not overlap
g_info("scrolling near left");
/* Scroll left, keep left part of the screen */
guint x = 0;
- guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width;
+ guint width = control_flow_data->Drawing->drawing_area->allocation.width;
convert_time_to_pixels(
*ns,
new_end,
/* Copy old data to new location */
gdk_draw_drawable (control_flow_data->Drawing->Pixmap,
- control_flow_data->Drawing->Drawing_Area_V->style->white_gc,
+ 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;
+ *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_V->style->white_gc,
+ control_flow_data->Drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
x, // do not overlap
} else {
g_info("scrolling far");
/* Cannot reuse any part of the screen : far jump */
- *Old_time_window = *New_time_window;
+ *old_time_window = *new_time_window;
gdk_draw_rectangle (control_flow_data->Drawing->Pixmap,
- control_flow_data->Drawing->Drawing_Area_V->style->white_gc,
+ control_flow_data->Drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
control_flow_data->Drawing->width+SAFETY, // do not overlap
/* Different scale (zoom) */
g_info("zoom");
- *Old_time_window = *New_time_window;
+ *old_time_window = *new_time_window;
gdk_draw_rectangle (control_flow_data->Drawing->Pixmap,
- control_flow_data->Drawing->Drawing_Area_V->style->white_gc,
+ control_flow_data->Drawing->drawing_area->style->white_gc,
TRUE,
0, 0,
control_flow_data->Drawing->width+SAFETY, // do not overlap
gint update_current_time_hook(void *hook_data, void *call_data)
{
- ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
+ ControlFlowData *control_flow_data = (ControlFlowData*)hook_data;
LttTime* current_time =
guicontrolflow_get_current_time(control_flow_data);
set_time_window(control_flow_data->mw, &time_window);
}
- gtk_widget_queue_draw(control_flow_data->Drawing->Drawing_Area_V);
+ 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_V;
+ GtkWidget *widget = control_flow_data->Drawing->drawing_area;
/* Get y position of process */
gint y=0, height=0;
*/
int after_data_request(void *hook_data, void *call_data)
{
- EventRequest *Event_Request = (EventRequest*)hook_data;
- ControlFlowData *control_flow_data = Event_Request->control_flow_data;
+ EventRequest *event_request = (EventRequest*)hook_data;
+ ControlFlowData *control_flow_data = event_request->control_flow_data;
ProcessList *process_list =
- guicontrolflow_get_process_list(Event_Request->control_flow_data);
+ guicontrolflow_get_process_list(event_request->control_flow_data);
ClosureData closure_data;
closure_data.event_request = (EventRequest*)hook_data;
closure_data.ts = (LttvTraceState*)call_data;
- g_hash_table_foreach(process_list->Process_Hash, draw_closure,
+ g_hash_table_foreach(process_list->process_hash, draw_closure,
(void*)&closure_data);
}
void send_test_data(ProcessList *process_list, Drawing_t *Drawing);
-GtkWidget *h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key);
+GtkWidget *h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key);
int event_selected_hook(void *hook_data, void *call_data);
/* Hook called before drawing. Gets the initial context at the beginning of the
- * drawing interval and copy it to the context in Event_Request.
+ * drawing interval and copy it to the context in event_request.
*/
int draw_before_hook(void *hook_data, void *call_data);
PID_COLUMN,
GTK_SORT_ASCENDING);
- process_list->Process_Hash = g_hash_table_new_full(
+ process_list->process_hash = g_hash_table_new_full(
hash_fct, equ_fct,
destroy_hash_key, destroy_hash_data
);
}
void processlist_destroy(ProcessList *process_list)
{
- g_hash_table_destroy(process_list->Process_Hash);
- process_list->Process_Hash = NULL;
+ g_hash_table_destroy(process_list->process_hash);
+ process_list->process_hash = NULL;
g_free(process_list);
}
LttTime *birth,
gchar *name,
guint *height,
- HashedProcessData **pmHashed_Process_Data)
+ HashedProcessData **pmhashed_process_data)
{
GtkTreeIter iter ;
ProcessInfo *Process_Info = g_new(ProcessInfo, 1);
- HashedProcessData *Hashed_Process_Data = g_new(HashedProcessData, 1);
- *pmHashed_Process_Data = Hashed_Process_Data;
+ HashedProcessData *hashed_process_data = g_new(HashedProcessData, 1);
+ *pmhashed_process_data = hashed_process_data;
Process_Info->pid = pid;
Process_Info->birth = *birth;
- Hashed_Process_Data->draw_context = g_new(DrawContext, 1);
- Hashed_Process_Data->draw_context->drawable = NULL;
- Hashed_Process_Data->draw_context->gc = NULL;
- Hashed_Process_Data->draw_context->pango_layout = NULL;
- Hashed_Process_Data->draw_context->current = g_new(DrawInfo,1);
- Hashed_Process_Data->draw_context->current->over = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->over->x = -1;
- Hashed_Process_Data->draw_context->current->over->y = -1;
- Hashed_Process_Data->draw_context->current->middle = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->middle->x = -1;
- Hashed_Process_Data->draw_context->current->middle->y = -1;
- Hashed_Process_Data->draw_context->current->under = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->under->x = -1;
- Hashed_Process_Data->draw_context->current->under->y = -1;
- Hashed_Process_Data->draw_context->current->modify_over = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->modify_over->x = -1;
- Hashed_Process_Data->draw_context->current->modify_over->y = -1;
- Hashed_Process_Data->draw_context->current->modify_middle = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->modify_middle->x = -1;
- Hashed_Process_Data->draw_context->current->modify_middle->y = -1;
- Hashed_Process_Data->draw_context->current->modify_under = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->current->modify_under->x = -1;
- Hashed_Process_Data->draw_context->current->modify_under->y = -1;
- Hashed_Process_Data->draw_context->current->status = LTTV_STATE_UNNAMED;
- Hashed_Process_Data->draw_context->previous = g_new(DrawInfo,1);
- Hashed_Process_Data->draw_context->previous->over = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->over->x = -1;
- Hashed_Process_Data->draw_context->previous->over->y = -1;
- Hashed_Process_Data->draw_context->previous->middle = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->middle->x = -1;
- Hashed_Process_Data->draw_context->previous->middle->y = -1;
- Hashed_Process_Data->draw_context->previous->under = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->under->x = -1;
- Hashed_Process_Data->draw_context->previous->under->y = -1;
- Hashed_Process_Data->draw_context->previous->modify_over = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->modify_over->x = -1;
- Hashed_Process_Data->draw_context->previous->modify_over->y = -1;
- Hashed_Process_Data->draw_context->previous->modify_middle = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->modify_middle->x = -1;
- Hashed_Process_Data->draw_context->previous->modify_middle->y = -1;
- Hashed_Process_Data->draw_context->previous->modify_under = g_new(ItemInfo,1);
- Hashed_Process_Data->draw_context->previous->modify_under->x = -1;
- Hashed_Process_Data->draw_context->previous->modify_under->y = -1;
- Hashed_Process_Data->draw_context->previous->status = LTTV_STATE_UNNAMED;
+ hashed_process_data->draw_context = g_new(DrawContext, 1);
+ hashed_process_data->draw_context->drawable = NULL;
+ hashed_process_data->draw_context->gc = NULL;
+ hashed_process_data->draw_context->pango_layout = NULL;
+ hashed_process_data->draw_context->current = g_new(DrawInfo,1);
+ hashed_process_data->draw_context->current->over = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->over->x = -1;
+ hashed_process_data->draw_context->current->over->y = -1;
+ hashed_process_data->draw_context->current->middle = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->middle->x = -1;
+ hashed_process_data->draw_context->current->middle->y = -1;
+ hashed_process_data->draw_context->current->under = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->under->x = -1;
+ hashed_process_data->draw_context->current->under->y = -1;
+ hashed_process_data->draw_context->current->modify_over = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->modify_over->x = -1;
+ hashed_process_data->draw_context->current->modify_over->y = -1;
+ hashed_process_data->draw_context->current->modify_middle = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->modify_middle->x = -1;
+ hashed_process_data->draw_context->current->modify_middle->y = -1;
+ hashed_process_data->draw_context->current->modify_under = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->current->modify_under->x = -1;
+ hashed_process_data->draw_context->current->modify_under->y = -1;
+ hashed_process_data->draw_context->current->status = LTTV_STATE_UNNAMED;
+ hashed_process_data->draw_context->previous = g_new(DrawInfo,1);
+ hashed_process_data->draw_context->previous->over = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->over->x = -1;
+ hashed_process_data->draw_context->previous->over->y = -1;
+ hashed_process_data->draw_context->previous->middle = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->middle->x = -1;
+ hashed_process_data->draw_context->previous->middle->y = -1;
+ hashed_process_data->draw_context->previous->under = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->under->x = -1;
+ hashed_process_data->draw_context->previous->under->y = -1;
+ hashed_process_data->draw_context->previous->modify_over = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->modify_over->x = -1;
+ hashed_process_data->draw_context->previous->modify_over->y = -1;
+ hashed_process_data->draw_context->previous->modify_middle = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->modify_middle->x = -1;
+ hashed_process_data->draw_context->previous->modify_middle->y = -1;
+ hashed_process_data->draw_context->previous->modify_under = g_new(ItemInfo,1);
+ hashed_process_data->draw_context->previous->modify_under->x = -1;
+ hashed_process_data->draw_context->previous->modify_under->y = -1;
+ hashed_process_data->draw_context->previous->status = LTTV_STATE_UNNAMED;
/* Add a new row to the model */
gtk_list_store_append ( process_list->Store_M, &iter);
BIRTH_S_COLUMN, birth->tv_sec,
BIRTH_NS_COLUMN, birth->tv_nsec,
-1);
- Hashed_Process_Data->RowRef = gtk_tree_row_reference_new (
+ hashed_process_data->RowRef = gtk_tree_row_reference_new (
GTK_TREE_MODEL(process_list->Store_M),
gtk_tree_model_get_path(
GTK_TREE_MODEL(process_list->Store_M),
&iter));
- g_hash_table_insert( process_list->Process_Hash,
+ g_hash_table_insert( process_list->process_hash,
(gpointer)Process_Info,
- (gpointer)Hashed_Process_Data);
+ (gpointer)hashed_process_data);
//g_critical ( "iter after : %s", gtk_tree_path_to_string (
// gtk_tree_model_get_path (
{
ProcessInfo Process_Info;
gint *path_indices;
- HashedProcessData *Hashed_Process_Data;
+ HashedProcessData *hashed_process_data;
GtkTreeIter iter;
Process_Info.pid = pid;
Process_Info.birth = *birth;
- if(Hashed_Process_Data =
+ if(hashed_process_data =
(HashedProcessData*)g_hash_table_lookup(
- process_list->Process_Hash,
+ process_list->process_hash,
&Process_Info))
{
gtk_tree_model_get_iter (
GTK_TREE_MODEL(process_list->Store_M),
&iter,
gtk_tree_row_reference_get_path(
- (GtkTreeRowReference*)Hashed_Process_Data->RowRef)
+ (GtkTreeRowReference*)hashed_process_data->RowRef)
);
gtk_list_store_remove (process_list->Store_M, &iter);
- g_free(Hashed_Process_Data->draw_context->previous->modify_under);
- g_free(Hashed_Process_Data->draw_context->previous->modify_middle);
- g_free(Hashed_Process_Data->draw_context->previous->modify_over);
- g_free(Hashed_Process_Data->draw_context->previous->under);
- g_free(Hashed_Process_Data->draw_context->previous->middle);
- g_free(Hashed_Process_Data->draw_context->previous->over);
- g_free(Hashed_Process_Data->draw_context->previous);
- g_free(Hashed_Process_Data->draw_context->current->modify_under);
- g_free(Hashed_Process_Data->draw_context->current->modify_middle);
- g_free(Hashed_Process_Data->draw_context->current->modify_over);
- g_free(Hashed_Process_Data->draw_context->current->under);
- g_free(Hashed_Process_Data->draw_context->current->middle);
- g_free(Hashed_Process_Data->draw_context->current->over);
- g_free(Hashed_Process_Data->draw_context->current);
- g_free(Hashed_Process_Data->draw_context);
- g_free(Hashed_Process_Data);
-
- g_hash_table_remove(process_list->Process_Hash,
+ g_free(hashed_process_data->draw_context->previous->modify_under);
+ g_free(hashed_process_data->draw_context->previous->modify_middle);
+ g_free(hashed_process_data->draw_context->previous->modify_over);
+ g_free(hashed_process_data->draw_context->previous->under);
+ g_free(hashed_process_data->draw_context->previous->middle);
+ g_free(hashed_process_data->draw_context->previous->over);
+ g_free(hashed_process_data->draw_context->previous);
+ g_free(hashed_process_data->draw_context->current->modify_under);
+ g_free(hashed_process_data->draw_context->current->modify_middle);
+ g_free(hashed_process_data->draw_context->current->modify_over);
+ g_free(hashed_process_data->draw_context->current->under);
+ g_free(hashed_process_data->draw_context->current->middle);
+ g_free(hashed_process_data->draw_context->current->over);
+ g_free(hashed_process_data->draw_context->current);
+ g_free(hashed_process_data->draw_context);
+ g_free(hashed_process_data);
+
+ g_hash_table_remove(process_list->process_hash,
&Process_Info);
process_list->number_of_process--;
guint pid, LttTime *birth,
guint *y,
guint *height,
- HashedProcessData **pmHashed_Process_Data)
+ HashedProcessData **pmhashed_process_data)
{
ProcessInfo Process_Info;
gint *path_indices;
GtkTreePath *tree_path;
- HashedProcessData *Hashed_Process_Data = NULL;
+ HashedProcessData *hashed_process_data = NULL;
Process_Info.pid = pid;
Process_Info.birth = *birth;
- if(Hashed_Process_Data =
+ if(hashed_process_data =
(HashedProcessData*)g_hash_table_lookup(
- process_list->Process_Hash,
+ process_list->process_hash,
&Process_Info))
{
tree_path = gtk_tree_row_reference_get_path(
- Hashed_Process_Data->RowRef);
+ hashed_process_data->RowRef);
path_indices = gtk_tree_path_get_indices (tree_path);
*height = get_cell_height(
GTK_TREE_VIEW(process_list->process_list_VC));
*y = *height * path_indices[0];
- *pmHashed_Process_Data = Hashed_Process_Data;
+ *pmhashed_process_data = hashed_process_data;
return 0;
} else {
- *pmHashed_Process_Data = Hashed_Process_Data;
+ *pmhashed_process_data = hashed_process_data;
return 1;
}
gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
- HashedProcessData *Hashed_Process_Data,
+ HashedProcessData *hashed_process_data,
guint *y,
guint *height)
{
GtkTreePath *tree_path;
tree_path = gtk_tree_row_reference_get_path(
- Hashed_Process_Data->RowRef);
+ hashed_process_data->RowRef);
path_indices = gtk_tree_path_get_indices (tree_path);
*height = get_cell_height(
GtkListStore *Store_M;
/* A hash table by PID to speed up process position find in the list */
- GHashTable *Process_Hash;
+ GHashTable *process_hash;
guint number_of_process;
gboolean Test_Process_Sent;
// out : success (0) and height
int processlist_add(ProcessList *process_list, guint pid, LttTime *birth,
gchar *name,
- guint *height, HashedProcessData **Hashed_Process_Data);
+ guint *height, HashedProcessData **hashed_process_data);
// out : success (0) and height
int processlist_remove(ProcessList *process_list, guint pid, LttTime *birth);
gint processlist_get_process_pixels(ProcessList *process_list,
guint pid, LttTime *birth,
guint *y, guint *height,
- HashedProcessData **Hashed_Process_Data);
+ HashedProcessData **hashed_process_data);
gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
- HashedProcessData *Hashed_Process_Data,
+ HashedProcessData *hashed_process_data,
guint *y,
guint *height);
{
ControlFlowData *control_flow_data = (ControlFlowData*)data;
- EventRequest *Event_Request = g_new(sizeof(EventRequest));
+ EventRequest *event_request = g_new(sizeof(EventRequest));
- Event_Request->control_flow_data = control_flow_data;
+ event_request->control_flow_data = control_flow_data;
/* 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->Begin_Time, &control_flow_data->End_Time,
- &Event_Request->time_begin, &Event_Request->time_end)
+ &event_request->time_begin, &event_request->time_end)
/* Look in statistics of the trace the processes present during the
* whole time interval _shown on the screen_. Modify the list of
Draw_Event_Hooks,
Draw_After_Hooks,
NULL, //FIXME : filter here
- Event_Request->time_begin,
- Event_Request->time_end);
+ event_request->time_begin,
+ event_request->time_end);
}
* Function prototypes *
*****************************************************************************/
//! Control Flow Viewer's constructor hook
-GtkWidget *hGuiControlFlow(GtkWidget *pmParentWindow);
+GtkWidget *hGuiControlFlow(GtkWidget *mw);
//! Control Flow Viewer's constructor
ControlFlowData *GuiControlFlow(void);
//! Control Flow Viewer's destructor
void add_test_process(ControlFlowData *control_flow_data);
-static void get_test_data(guint Event_Number, guint List_Height,
+static void get_test_data(guint event_number, guint List_Height,
ControlFlowData *control_flow_data);
void add_test_data(ControlFlowData *control_flow_data);
current.modify_over = &over;
draw_context.drawable = Pixmap;
- draw_context.gc = Drawing->Drawing_Area_V->style->black_gc;
+ draw_context.gc = Drawing->drawing_area->style->black_gc;
draw_context.current = ¤t;
draw_context.previous = NULL;
gc = gdk_gc_new(Pixmap);
/* Sent text data */
- layout = gtk_widget_create_pango_layout(Drawing->Drawing_Area_V,
+ layout = gtk_widget_create_pango_layout(Drawing->drawing_area,
NULL);
context = pango_layout_get_context(layout);
FontDesc = pango_context_get_font_description(context);
drawing_draw_line(
Drawing, Pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->Drawing_Area_V->style->black_gc);
+ Drawing->drawing_area->style->black_gc);
pango_layout_set_text(layout, "Test", -1);
- gdk_draw_layout(Pixmap, Drawing->Drawing_Area_V->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,
y+(height/2), x + width, y+(height/2),
- Drawing->Drawing_Area_V->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_V->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,
drawing_draw_line(
Drawing, Pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->Drawing_Area_V->style->black_gc);
+ Drawing->drawing_area->style->black_gc);
/* Draw arc */
- gdk_draw_arc(Pixmap, Drawing->Drawing_Area_V->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,
y+(height/2), x + width, y+(height/2),
- Drawing->Drawing_Area_V->style->black_gc);
+ Drawing->drawing_area->style->black_gc);
g_critical("y : %u, height : %u", y, height);
drawing_draw_line(
Drawing, Pixmap, x,
y+(height/2), x + width, y+(height/2),
- Drawing->Drawing_Area_V->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_V->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_V->style->black_gc);
-// gdk_gc_set_clip_origin(Drawing->Drawing_Area_V->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_V->style->black_gc,
+// Drawing->drawing_area->style->black_gc,
// icon_pixmap,
// 0, 0, i, j, -1, -1);
test_draw_item(Drawing,Pixmap);
- //gdk_gc_set_clip_origin(Drawing->Drawing_Area_V->style->black_gc, 0, 0);
- //gdk_gc_set_clip_mask(Drawing->Drawing_Area_V->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);
if(got_RowRef =
(GtkTreeRowReference*)g_hash_table_lookup(
- process_list->Process_Hash,
+ process_list->process_hash,
&Process_Info))
{
g_critical("key found");