struct _ControlFlowData {
- GtkWidget *Scrolled_Window_VC;
- MainWindow *Parent_Window;
+ GtkWidget *scrolled_window;
+ MainWindow *mw;
- ProcessList *Process_List;
+ ProcessList *process_list;
Drawing_t *Drawing;
- //GtkWidget *HBox_V;
- //GtkWidget *Inside_HBox_V;
- GtkWidget *HPaned;
+ GtkWidget *h_paned;
- GtkAdjustment *VAdjust_C ;
-
- /* Trace information */
- //TraceSet *Trace_Set;
- //TraceStatistics *Trace_Statistics;
+ GtkAdjustment *v_adjust ;
/* Shown events information */
- guint First_Event, Last_Event;
- TimeWindow Time_Window;
- LttTime Current_Time;
-
+ TimeWindow time_window;
+ LttTime current_time;
- /* TEST DATA, TO BE READ FROM THE TRACE */
- gint Number_Of_Events ;
- guint Currently_Selected_Event ;
- gboolean Selected_Event ;
- guint Number_Of_Process;
+ //guint Currently_Selected_Event ;
+ guint number_of_process;
} ;
ControlFlowData *
guicontrolflow(void)
{
- GtkWidget *Process_List_Widget, *Drawing_Widget;//, *button;
+ GtkWidget *process_list_Widget, *Drawing_Widget;//, *button;
ControlFlowData* Control_Flow_Data = g_new(ControlFlowData,1) ;
Drawing_Widget =
drawing_get_widget(Control_Flow_Data->Drawing);
- /* TEST DATA, TO BE READ FROM THE TRACE */
- Control_Flow_Data->Number_Of_Events = 1000 ;
- Control_Flow_Data->Currently_Selected_Event = FALSE ;
- Control_Flow_Data->Selected_Event = 0;
- Control_Flow_Data->Number_Of_Process = 10;
-
- /* FIXME register Event_Selected_Hook */
-
-
+ Control_Flow_Data->number_of_process = 0;
/* Create the Process list */
- Control_Flow_Data->Process_List = processlist_construct();
+ Control_Flow_Data->process_list = processlist_construct();
- Process_List_Widget =
- processlist_get_widget(Control_Flow_Data->Process_List);
+ 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->HPaned = gtk_hpaned_new();
+ Control_Flow_Data->h_paned = gtk_hpaned_new();
- //gtk_box_pack_start(
- // GTK_BOX(Control_Flow_Data->Inside_HBox_V),
- // Process_List_Widget, FALSE, TRUE, 0); // FALSE TRUE
- //gtk_box_pack_start(
- // GTK_BOX(Control_Flow_Data->Inside_HBox_V),
- // Drawing_Widget, TRUE, TRUE, 0);
-
- //button = gtk_button_new();
- //gtk_button_set_relief(button, GTK_RELIEF_NONE);
- //gtk_container_set_border_width(GTK_CONTAINER(button),0);
- //gtk_container_add(GTK_CONTAINER(button), Drawing_Widget);
- gtk_paned_pack1(GTK_PANED(Control_Flow_Data->HPaned), Process_List_Widget, FALSE, TRUE);
- gtk_paned_pack2(GTK_PANED(Control_Flow_Data->HPaned), Drawing_Widget, TRUE, TRUE);
-
- Control_Flow_Data->VAdjust_C =
+ 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);
+
+ Control_Flow_Data->v_adjust =
GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
0.0, /* Lower */
0.0, /* Upper */
0.0, /* Page inc. */
0.0)); /* page size */
- Control_Flow_Data->Scrolled_Window_VC =
+ Control_Flow_Data->scrolled_window =
gtk_scrolled_window_new (NULL,
- Control_Flow_Data->VAdjust_C);
+ Control_Flow_Data->v_adjust);
gtk_scrolled_window_set_policy(
- GTK_SCROLLED_WINDOW(Control_Flow_Data->Scrolled_Window_VC) ,
+ 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_VC),
- //Control_Flow_Data->Inside_HBox_V);
- Control_Flow_Data->HPaned);
+ GTK_SCROLLED_WINDOW(Control_Flow_Data->scrolled_window),
+ Control_Flow_Data->h_paned);
- //g_signal_connect (G_OBJECT (Control_Flow_Data->Drawing_Area_V),
- // "expose_event",
- // G_CALLBACK (expose_event_cb),
- // Control_Flow_Data);
-
-
-
- //g_signal_connect (G_OBJECT (Control_Flow_Data->VAdjust_C),
- // "value-changed",
- // G_CALLBACK (v_scroll_cb),
- // Control_Flow_Data);
-
-
/* Set the size of the drawing area */
//Drawing_Resize(Drawing, h, w);
gtk_widget_show(Drawing_Widget);
- //gtk_widget_show(button);
- gtk_widget_show(Process_List_Widget);
- //gtk_widget_show(Control_Flow_Data->Inside_HBox_V);
- gtk_widget_show(Control_Flow_Data->HPaned);
- gtk_widget_show(Control_Flow_Data->Scrolled_Window_VC);
+ 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_VC),
+ G_OBJECT(Control_Flow_Data->scrolled_window),
"Control_Flow_Data",
Control_Flow_Data,
(GDestroyNotify)guicontrolflow_destructor);
{
g_info("CFV.c : guicontrolflow_destructor_full, %p", Control_Flow_Data);
/* May already have been done by GTK window closing */
- if(GTK_IS_WIDGET(Control_Flow_Data->Scrolled_Window_VC))
- gtk_widget_destroy(Control_Flow_Data->Scrolled_Window_VC);
- //Control_Flow_Data->Parent_Window = NULL;
+ if(GTK_IS_WIDGET(Control_Flow_Data->scrolled_window))
+ gtk_widget_destroy(Control_Flow_Data->scrolled_window);
+ //Control_Flow_Data->mw = NULL;
//FIXME guicontrolflow_destructor(Control_Flow_Data);
}
guint index;
g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data);
- g_info("%p, %p, %p", update_time_window_hook, Control_Flow_Data, Control_Flow_Data->Parent_Window);
- if(GTK_IS_WIDGET(Control_Flow_Data->Scrolled_Window_VC))
+ g_info("%p, %p, %p", update_time_window_hook, Control_Flow_Data, Control_Flow_Data->mw);
+ if(GTK_IS_WIDGET(Control_Flow_Data->scrolled_window))
g_info("widget still exists");
/* Process List is removed with it's widget */
- //ProcessList_destroy(Control_Flow_Data->Process_List);
- if(Control_Flow_Data->Parent_Window != NULL)
+ //ProcessList_destroy(Control_Flow_Data->process_list);
+ if(Control_Flow_Data->mw != NULL)
{
unreg_update_time_window(update_time_window_hook,
Control_Flow_Data,
- Control_Flow_Data->Parent_Window);
+ Control_Flow_Data->mw);
unreg_update_current_time(update_current_time_hook,
Control_Flow_Data,
- Control_Flow_Data->Parent_Window);
+ Control_Flow_Data->mw);
}
g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data);
g_slist_remove(gControl_Flow_Data_List,Control_Flow_Data);
GtkWidget *guicontrolflow_get_widget(ControlFlowData *Control_Flow_Data)
{
- return Control_Flow_Data->Scrolled_Window_VC ;
+ return Control_Flow_Data->scrolled_window ;
}
ProcessList *guicontrolflow_get_process_list
(ControlFlowData *Control_Flow_Data)
{
- return Control_Flow_Data->Process_List ;
+ return Control_Flow_Data->process_list ;
}
TimeWindow *guicontrolflow_get_time_window(ControlFlowData *Control_Flow_Data)
{
- return &Control_Flow_Data->Time_Window;
+ return &Control_Flow_Data->time_window;
}
LttTime *guicontrolflow_get_current_time(ControlFlowData *Control_Flow_Data)
{
- return &Control_Flow_Data->Current_Time;
+ return &Control_Flow_Data->current_time;
}
"Control_Flow_Data");
LttTime start, end;
- LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
- control_flow_data->Time_Window.start_time);
+ LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width,
+ control_flow_data->time_window.start_time);
g_critical("req : window_end : %u, %u", window_end.tv_sec,
window_end.tv_nsec);
- g_critical("req : time width : %u, %u", control_flow_data->Time_Window.time_width.tv_sec,
- control_flow_data->Time_Window.time_width.tv_nsec);
+ g_critical("req : time width : %u, %u", control_flow_data->time_window.time_width.tv_sec,
+ control_flow_data->time_window.time_width.tv_nsec);
g_critical("x is : %i, x+width is : %i", x, x+width);
convert_pixels_to_time(Drawing->Drawing_Area_V->allocation.width, x,
- &control_flow_data->Time_Window.start_time,
+ &control_flow_data->time_window.start_time,
&window_end,
&start);
convert_pixels_to_time(Drawing->Drawing_Area_V->allocation.width, x + width,
- &control_flow_data->Time_Window.start_time,
+ &control_flow_data->time_window.start_time,
&window_end,
&end);
LttvTracesetContext * tsc =
- get_traceset_context(control_flow_data->Parent_Window);
+ get_traceset_context(control_flow_data->mw);
//send_test_process(
//guicontrolflow_get_process_list(Drawing->Control_Flow_Data),
lttv_hooks_add(after_traceset, after_data_request, &event_request);
lttv_hooks_add(event, draw_event_hook, &event_request);
//Modified by xiangxiu: state update hooks are added by the main window
- //state_add_event_hooks_api(control_flow_data->Parent_Window);
+ //state_add_event_hooks_api(control_flow_data->mw);
lttv_hooks_add(after_event, draw_after_hook, &event_request);
lttv_process_traceset_seek_time(tsc, start);
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, after_traceset, NULL, event, after_event);
//Modified by xiangxiu: state update hooks are removed by the main window
- //state_remove_event_hooks_api(control_flow_data->Parent_Window);
+ //state_remove_event_hooks_api(control_flow_data->mw);
lttv_hooks_destroy(after_traceset);
lttv_hooks_destroy(event);
* has updated the time interval before this configure gets
* executed.
*/
- get_time_window(Drawing->Control_Flow_Data->Parent_Window,
- &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,
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;
g_critical("drawing expose event");
guint x=0;
- LttTime* Current_Time =
+ LttTime* current_time =
guicontrolflow_get_current_time(control_flow_data);
- LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
- control_flow_data->Time_Window.start_time);
+ LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width,
+ control_flow_data->time_window.start_time);
convert_time_to_pixels(
- control_flow_data->Time_Window.start_time,
+ control_flow_data->time_window.start_time,
window_end,
- *Current_Time,
+ *current_time,
widget->allocation.width,
&x);
{
LttTime time;
- LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
- control_flow_data->Time_Window.start_time);
+ LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width,
+ control_flow_data->time_window.start_time);
/* left mouse button click */
g_critical("x click is : %f", event->x);
convert_pixels_to_time(widget->allocation.width, (guint)event->x,
- &control_flow_data->Time_Window.start_time,
+ &control_flow_data->time_window.start_time,
&window_end,
&time);
- set_current_time(control_flow_data->Parent_Window, &time);
+ set_current_time(control_flow_data->mw, &time);
}
g_info("h_guicontrolflow, %p, %p, %s", pmParentWindow, s, key);
ControlFlowData *Control_Flow_Data = guicontrolflow() ;
- Control_Flow_Data->Parent_Window = pmParentWindow;
+ Control_Flow_Data->mw = pmParentWindow;
TimeWindow *time_window = guicontrolflow_get_time_window(Control_Flow_Data);
time_window->start_time.tv_sec = 0;
time_window->start_time.tv_nsec = 0;
LttTime time = ltt_event_time(e);
- LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
- control_flow_data->Time_Window.start_time);
+ LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width,
+ control_flow_data->time_window.start_time);
convert_time_to_pixels(
- control_flow_data->Time_Window.start_time,
+ control_flow_data->time_window.start_time,
window_end,
time,
width,
//LttTime time = ltt_event_time(e);
- //LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
- // control_flow_data->Time_Window.start_time);
+ //LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width,
+ // control_flow_data->time_window.start_time);
//convert_time_to_pixels(
- // control_flow_data->Time_Window.start_time,
+ // control_flow_data->time_window.start_time,
// window_end,
// time,
// width,
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)
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,
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,
} 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,
/* 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,
TimeWindow time_window;
- LttTime time_begin = control_flow_data->Time_Window.start_time;
- LttTime width = control_flow_data->Time_Window.time_width;
+ LttTime time_begin = control_flow_data->time_window.start_time;
+ LttTime width = control_flow_data->time_window.time_width;
LttTime half_width = ltt_time_div(width,2.0);
LttTime time_end = ltt_time_add(time_begin, width);
LttvTracesetContext * tsc =
- get_traceset_context(control_flow_data->Parent_Window);
+ get_traceset_context(control_flow_data->mw);
LttTime trace_start = tsc->Time_Span->startTime;
LttTime trace_end = tsc->Time_Span->endTime;
time_window.start_time = time_begin;
time_window.time_width = width;
- set_time_window(control_flow_data->Parent_Window, &time_window);
+ set_time_window(control_flow_data->mw, &time_window);
}
else if(ltt_time_compare(*current_time, time_end) == 1)
{
time_window.start_time = time_begin;
time_window.time_width = width;
- set_time_window(control_flow_data->Parent_Window, &time_window);
+ set_time_window(control_flow_data->mw, &time_window);
}
gtk_widget_queue_draw(control_flow_data->Drawing->Drawing_Area_V);
/* Get y position of process */
gint y=0, height=0;
- processlist_get_pixels_from_data( control_flow_data->Process_List,
+ processlist_get_pixels_from_data( control_flow_data->process_list,
process_info,
hashed_process_data,
&y,
-void send_test_data(ProcessList *Process_List, Drawing_t *Drawing);
+void send_test_data(ProcessList *process_list, Drawing_t *Drawing);
GtkWidget *h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key);
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- ProcessList* Process_List = g_new(ProcessList,1);
+ ProcessList* process_list = g_new(ProcessList,1);
- Process_List->Number_Of_Process = 0;
+ process_list->number_of_process = 0;
/* Create the Process list */
- Process_List->Store_M = gtk_list_store_new ( N_COLUMNS,
+ process_list->Store_M = gtk_list_store_new ( N_COLUMNS,
G_TYPE_STRING,
G_TYPE_UINT,
G_TYPE_ULONG,
G_TYPE_ULONG);
- Process_List->Process_List_VC =
+ process_list->process_list_VC =
gtk_tree_view_new_with_model
- (GTK_TREE_MODEL (Process_List->Store_M));
+ (GTK_TREE_MODEL (process_list->Store_M));
- g_object_unref (G_OBJECT (Process_List->Store_M));
+ g_object_unref (G_OBJECT (process_list->Store_M));
gtk_tree_sortable_set_sort_func(
- GTK_TREE_SORTABLE(Process_List->Store_M),
+ GTK_TREE_SORTABLE(process_list->Store_M),
PID_COLUMN,
process_sort_func,
NULL,
NULL);
gtk_tree_sortable_set_sort_column_id(
- GTK_TREE_SORTABLE(Process_List->Store_M),
+ GTK_TREE_SORTABLE(process_list->Store_M),
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
);
gtk_tree_view_set_headers_visible(
- GTK_TREE_VIEW(Process_List->Process_List_VC), FALSE);
+ GTK_TREE_VIEW(process_list->process_list_VC), FALSE);
/* Create a column, associating the "text" attribute of the
* cell_renderer to the first column of the model */
gtk_tree_view_column_set_alignment (column, 0.0);
gtk_tree_view_column_set_fixed_width (column, 45);
gtk_tree_view_append_column (
- GTK_TREE_VIEW (Process_List->Process_List_VC), column);
+ GTK_TREE_VIEW (process_list->process_list_VC), column);
column = gtk_tree_view_column_new_with_attributes ( "PID",
renderer,
PID_COLUMN,
NULL);
gtk_tree_view_append_column (
- GTK_TREE_VIEW (Process_List->Process_List_VC), column);
+ GTK_TREE_VIEW (process_list->process_list_VC), column);
column = gtk_tree_view_column_new_with_attributes ( "Birth sec",
BIRTH_S_COLUMN,
NULL);
gtk_tree_view_append_column (
- GTK_TREE_VIEW (Process_List->Process_List_VC), column);
+ GTK_TREE_VIEW (process_list->process_list_VC), column);
//gtk_tree_view_column_set_visible(column, 0);
//
BIRTH_NS_COLUMN,
NULL);
gtk_tree_view_append_column (
- GTK_TREE_VIEW (Process_List->Process_List_VC), column);
+ GTK_TREE_VIEW (process_list->process_list_VC), column);
//gtk_tree_view_column_set_visible(column, 0);
g_object_set_data_full(
- G_OBJECT(Process_List->Process_List_VC),
- "Process_List_Data",
- Process_List,
+ G_OBJECT(process_list->process_list_VC),
+ "process_list_Data",
+ process_list,
(GDestroyNotify)processlist_destroy);
- Process_List->Test_Process_Sent = 0;
+ process_list->Test_Process_Sent = 0;
- return Process_List;
+ return process_list;
}
-void processlist_destroy(ProcessList *Process_List)
+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);
+ g_free(process_list);
}
-GtkWidget *processlist_get_widget(ProcessList *Process_List)
+GtkWidget *processlist_get_widget(ProcessList *process_list)
{
- return Process_List->Process_List_VC;
+ return process_list->process_list_VC;
}
g_free(data);
}
-int processlist_add( ProcessList *Process_List,
+int processlist_add( ProcessList *process_list,
guint pid,
LttTime *birth,
gchar *name,
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);
+ gtk_list_store_append ( process_list->Store_M, &iter);
//g_critical ( "iter before : %s", gtk_tree_path_to_string (
// gtk_tree_model_get_path (
- // GTK_TREE_MODEL(Process_List->Store_M),
+ // GTK_TREE_MODEL(process_list->Store_M),
// &iter)));
- gtk_list_store_set ( Process_List->Store_M, &iter,
+ gtk_list_store_set ( process_list->Store_M, &iter,
PROCESS_COLUMN, name,
PID_COLUMN, pid,
BIRTH_S_COLUMN, birth->tv_sec,
BIRTH_NS_COLUMN, birth->tv_nsec,
-1);
Hashed_Process_Data->RowRef = gtk_tree_row_reference_new (
- GTK_TREE_MODEL(Process_List->Store_M),
+ GTK_TREE_MODEL(process_list->Store_M),
gtk_tree_model_get_path(
- GTK_TREE_MODEL(Process_List->Store_M),
+ 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);
//g_critical ( "iter after : %s", gtk_tree_path_to_string (
// gtk_tree_model_get_path (
- // GTK_TREE_MODEL(Process_List->Store_M),
+ // GTK_TREE_MODEL(process_list->Store_M),
// &iter)));
- Process_List->Number_Of_Process++;
+ process_list->number_of_process++;
- *height = get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC))
- * Process_List->Number_Of_Process ;
+ *height = get_cell_height(GTK_TREE_VIEW(process_list->process_list_VC))
+ * process_list->number_of_process ;
return 0;
}
-int processlist_remove( ProcessList *Process_List,
+int processlist_remove( ProcessList *process_list,
guint pid,
LttTime *birth)
{
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),
+ GTK_TREE_MODEL(process_list->Store_M),
&iter,
gtk_tree_row_reference_get_path(
(GtkTreeRowReference*)Hashed_Process_Data->RowRef)
);
- gtk_list_store_remove (Process_List->Store_M, &iter);
+ 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);
g_free(Hashed_Process_Data);
- g_hash_table_remove(Process_List->Process_Hash,
+ g_hash_table_remove(process_list->Process_Hash,
&Process_Info);
- Process_List->Number_Of_Process--;
+ process_list->number_of_process--;
return 0;
} else {
}
-guint processlist_get_height(ProcessList *Process_List)
+guint processlist_get_height(ProcessList *process_list)
{
- return get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC))
- * Process_List->Number_Of_Process ;
+ return get_cell_height(GTK_TREE_VIEW(process_list->process_list_VC))
+ * process_list->number_of_process ;
}
-gint processlist_get_process_pixels( ProcessList *Process_List,
+gint processlist_get_process_pixels( ProcessList *process_list,
guint pid, LttTime *birth,
guint *y,
guint *height,
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(
path_indices = gtk_tree_path_get_indices (tree_path);
*height = get_cell_height(
- GTK_TREE_VIEW(Process_List->Process_List_VC));
+ GTK_TREE_VIEW(process_list->process_list_VC));
*y = *height * path_indices[0];
*pmHashed_Process_Data = Hashed_Process_Data;
return 0;
}
-gint processlist_get_pixels_from_data( ProcessList *Process_List,
+gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
HashedProcessData *Hashed_Process_Data,
guint *y,
path_indices = gtk_tree_path_get_indices (tree_path);
*height = get_cell_height(
- GTK_TREE_VIEW(Process_List->Process_List_VC));
+ GTK_TREE_VIEW(process_list->process_list_VC));
*y = *height * path_indices[0];
return 0;
struct _ProcessList {
- GtkWidget *Process_List_VC;
+ GtkWidget *process_list_VC;
GtkListStore *Store_M;
/* A hash table by PID to speed up process position find in the list */
GHashTable *Process_Hash;
- guint Number_Of_Process;
+ guint number_of_process;
gboolean Test_Process_Sent;
};
typedef struct _ProcessList ProcessList;
ProcessList *processlist_construct(void);
-void processlist_destroy(ProcessList *Process_List);
-GtkWidget *processlist_get_widget(ProcessList *Process_List);
+void processlist_destroy(ProcessList *process_list);
+GtkWidget *processlist_get_widget(ProcessList *process_list);
// out : success (0) and height
-int processlist_add(ProcessList *Process_List, guint pid, LttTime *birth,
+int processlist_add(ProcessList *process_list, guint pid, LttTime *birth,
gchar *name,
guint *height, HashedProcessData **Hashed_Process_Data);
// out : success (0) and height
-int processlist_remove(ProcessList *Process_List, guint pid, LttTime *birth);
+int processlist_remove(ProcessList *process_list, guint pid, LttTime *birth);
-guint processlist_get_height(ProcessList *Process_List);
+guint processlist_get_height(ProcessList *process_list);
// Returns 0 on success
-gint processlist_get_process_pixels(ProcessList *Process_List,
+gint processlist_get_process_pixels(ProcessList *process_list,
guint pid, LttTime *birth,
guint *y, guint *height,
HashedProcessData **Hashed_Process_Data);
-gint processlist_get_pixels_from_data( ProcessList *Process_List,
+gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
HashedProcessData *Hashed_Process_Data,
guint *y,
guint ev_sel = 444 ;
/* Horizontal scrollbar and it's adjustment */
GtkWidget *VScroll_VC;
- GtkAdjustment *VAdjust_C ;
+ GtkAdjustment *v_adjust ;
/* Initialize i18n support */
gtk_set_locale ();
//gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, FALSE, TRUE, 0);
Control_Flow_Data = guicontrolflow();
- CF_Viewer = Control_Flow_Data->Scrolled_Window_VC;
+ CF_Viewer = Control_Flow_Data->scrolled_window;
gtk_box_pack_start(GTK_BOX(VBox_V), CF_Viewer, TRUE, TRUE, 0);
/* Create horizontal scrollbar and pack it */
int i;
gchar *process[] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" };
- for(i=0; i<Control_Flow_Data->Number_Of_Process; i++)
+ for(i=0; i<Control_Flow_Data->number_of_process; i++)
{
/* Add a new row to the model */
gtk_list_store_append (Control_Flow_Data->Store_M, &iter);
#ifdef DEBUG
void test_draw() {
- gint cell_height = get_cell_height(GTK_TREE_VIEW(Control_Flow_Data->Process_List_VC));
+ gint cell_height = get_cell_height(GTK_TREE_VIEW(Control_Flow_Data->process_list_VC));
GdkGC *GC = gdk_gc_new(widget->window);
GdkColor color = CF_Colors[GREEN];
#ifdef NOTUSE
/* NOTE : no drawing data should be sent there, since the drawing widget
* has not been initialized */
-void send_test_drawing(ProcessList *Process_List,
+void send_test_drawing(ProcessList *process_list,
Drawing_t *Drawing,
GdkPixmap *Pixmap,
gint x, gint y, // y not used here?
birth.tv_sec = 12000;
birth.tv_nsec = 55500;
g_info("we have : x : %u, y : %u, width : %u, height : %u", x, y, width, height);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
1,
&birth,
&y,
birth.tv_sec = 14000;
birth.tv_nsec = 55500;
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
156,
&birth,
&y,
birth.tv_sec = 12000;
birth.tv_nsec = 55700;
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10,
&birth,
&y,
birth.tv_sec = i*12000;
birth.tv_nsec = i*55700;
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
i,
&birth,
&y,
birth.tv_sec = 12000;
birth.tv_nsec = 55600;
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10,
&birth,
&y,
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;
LttTime birth;
- if(Process_List->Test_Process_Sent) return;
+ if(process_list->Test_Process_Sent) return;
birth.tv_sec = 12000;
birth.tv_nsec = 55500;
- processlist_add(Process_List,
+ processlist_add(process_list,
1,
&birth,
&y);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
1,
&birth,
&y,
birth.tv_sec = 14000;
birth.tv_nsec = 55500;
- processlist_add(Process_List,
+ processlist_add(process_list,
156,
&birth,
&y);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
156,
&birth,
&y,
birth.tv_sec = 12000;
birth.tv_nsec = 55700;
- processlist_add(Process_List,
+ processlist_add(process_list,
10,
&birth,
&height);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10,
&birth,
&y,
birth.tv_sec = i*12000;
birth.tv_nsec = i*55700;
- processlist_add(Process_List,
+ processlist_add(process_list,
i,
&birth,
&height);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
i,
&birth,
&y,
birth.tv_sec = 12000;
birth.tv_nsec = 55600;
- processlist_add(Process_List,
+ processlist_add(process_list,
10,
&birth,
&y);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10,
&birth,
&y,
//g_critical("y : %u, height : %u", y, height);
- processlist_add(Process_List,
+ processlist_add(process_list,
10000,
&birth,
&height);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10000,
&birth,
&y,
//g_critical("height : %u", height);
- processlist_get_process_pixels(Process_List,
+ processlist_get_process_pixels(process_list,
10000,
&birth,
&y, &height);
- processlist_remove( Process_List,
+ processlist_remove( process_list,
10000,
&birth);
if(got_RowRef =
(GtkTreeRowReference*)g_hash_table_lookup(
- Process_List->Process_Hash,
+ process_list->Process_Hash,
&Process_Info))
{
g_critical("key found");
}
- Process_List->Test_Process_Sent = TRUE;
+ process_list->Test_Process_Sent = TRUE;
}
#endif//NOTUSE