8 #include "Process_List.h"
10 #include "../icons/hGuiControlFlowInsert.xpm"
13 /*****************************************************************************
14 * Control Flow Viewer class implementation *
15 *****************************************************************************/
18 typedef struct _ControlFlowData
{
20 GtkWidget
*Drawing_Area_V
;
21 GtkWidget
*Scrolled_Window_VC
;
23 ProcessList
*Process_List
;
27 GtkWidget
*Inside_HBox_V
;
29 GtkAdjustment
*VAdjust_C
;
31 /* Trace information */
33 TraceStatistics
*Trace_Statistics
;
35 /* Shown events information */
36 guint First_Event
, Last_Event
;
37 ltt_time Begin_Time
, End_Time
;
40 /* TEST DATA, TO BE READ FROM THE TRACE */
41 gint Number_Of_Events
;
42 guint Currently_Selected_Event
;
43 gboolean Selected_Event
;
44 guint Number_Of_Process
;
49 /** Array containing instanced objects. Used when module is unloaded */
50 static GSList
*sControl_Flow_Data_List
= NULL
;
54 * Control Flow Viewer's constructor
56 * This constructor is given as a parameter to the menuitem and toolbar button
57 * registration. It creates the drawing widget.
58 * @param ParentWindow A pointer to the parent window.
59 * @return The widget created.
64 GtkWidget
*Process_List_Widget
;
66 ControlFlowData
* Control_Flow_Data
= g_new(ControlFlowData
,1) ;
68 /* Create the Drawing */
69 //Control_Flow_Data->Drawing = Drawing();
71 /* TEST DATA, TO BE READ FROM THE TRACE */
72 Control_Flow_Data
->Number_Of_Events
= 1000 ;
73 Control_Flow_Data
->Currently_Selected_Event
= FALSE
;
74 Control_Flow_Data
->Selected_Event
= 0;
75 Control_Flow_Data
->Number_Of_Process
= 10;
77 /* FIXME register Event_Selected_Hook */
81 /* Create the Process list */
82 //Control_Flow_Data->Process_List = ProcessList();
84 //Process_List_Widget =
85 // ProcessList_getWidget(Control_Flow_Data->Process_List);
87 Control_Flow_Data
->Inside_HBox_V
= gtk_hbox_new(0, 0);
90 // GTK_BOX(Control_Flow_Data->Inside_HBox_V),
91 // Process_List_Widget, FALSE, TRUE, 0);
93 // GTK_BOX(Control_Flow_Data->Inside_HBox_V),
94 // Control_Flow_Data->Drawing_Area_V, TRUE, TRUE, 0);
97 Control_Flow_Data
->VAdjust_C
=
98 GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
103 0.0)); /* page size */
106 Control_Flow_Data
->Scrolled_Window_VC
=
107 gtk_scrolled_window_new (NULL
,
108 Control_Flow_Data
->VAdjust_C
);
110 gtk_scrolled_window_set_policy(
111 GTK_SCROLLED_WINDOW(Control_Flow_Data
->Scrolled_Window_VC
) ,
113 GTK_POLICY_AUTOMATIC
);
115 gtk_scrolled_window_add_with_viewport(
116 GTK_SCROLLED_WINDOW(Control_Flow_Data
->Scrolled_Window_VC
),
117 Control_Flow_Data
->Inside_HBox_V
);
120 //g_signal_connect (G_OBJECT (Control_Flow_Data->Drawing_Area_V),
122 // G_CALLBACK (expose_event_cb),
123 // Control_Flow_Data);
127 //g_signal_connect (G_OBJECT (Control_Flow_Data->VAdjust_C),
129 // G_CALLBACK (v_scroll_cb),
130 // Control_Flow_Data);
133 /* Set the size of the drawing area */
134 //Drawing_Resize(Drawing, h, w);
136 /* Get trace statistics */
137 //Control_Flow_Data->Trace_Statistics = get_trace_statistics(Trace);
140 gtk_widget_show(Control_Flow_Data
->Drawing_Area_V
);
141 gtk_widget_show(Process_List_Widget
);
142 gtk_widget_show(Control_Flow_Data
->Inside_HBox_V
);
143 gtk_widget_show(Control_Flow_Data
->Scrolled_Window_VC
);
145 g_object_set_data_full(
146 G_OBJECT(Control_Flow_Data
->HBox_V
),
149 GuiControlFlow_Destructor
);
152 return Control_Flow_Data
;
157 GuiControlFlow_Destructor(ControlFlowData
*Control_Flow_Data
)
161 /* May already been done by GTK window closing */
162 if(GTK_IS_WIDGET(Control_Flow_Data
->HBox_V
))
163 gtk_widget_destroy(Control_Flow_Data
->HBox_V
);
165 ProcessList_destroy(Control_Flow_Data
->Process_List
);
167 g_slist_remove(sControl_Flow_Data_List
,Control_Flow_Data
);
170 //FIXME : call hGuiEvents_Destructor for corresponding data upon widget destroy