8 #include "Process_List.h"
11 extern GSList
*gControl_Flow_Data_List
;
13 /*****************************************************************************
14 * Control Flow Viewer class implementation *
15 *****************************************************************************/
18 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 */
32 //TraceSet *Trace_Set;
33 //TraceStatistics *Trace_Statistics;
35 /* Shown events information */
36 guint First_Event
, Last_Event
;
37 LttTime 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
;
50 * Control Flow Viewer's constructor
52 * This constructor is given as a parameter to the menuitem and toolbar button
53 * registration. It creates the drawing widget.
54 * @param ParentWindow A pointer to the parent window.
55 * @return The widget created.
60 GtkWidget
*Process_List_Widget
;
62 ControlFlowData
* Control_Flow_Data
= g_new(ControlFlowData
,1) ;
64 /* Create the Drawing */
65 //Control_Flow_Data->Drawing = Drawing();
67 /* TEST DATA, TO BE READ FROM THE TRACE */
68 Control_Flow_Data
->Number_Of_Events
= 1000 ;
69 Control_Flow_Data
->Currently_Selected_Event
= FALSE
;
70 Control_Flow_Data
->Selected_Event
= 0;
71 Control_Flow_Data
->Number_Of_Process
= 10;
73 /* FIXME register Event_Selected_Hook */
77 /* Create the Process list */
78 Control_Flow_Data
->Process_List
= ProcessList_construct();
81 ProcessList_getWidget(Control_Flow_Data
->Process_List
);
83 Control_Flow_Data
->Inside_HBox_V
= gtk_hbox_new(0, 0);
86 GTK_BOX(Control_Flow_Data
->Inside_HBox_V
),
87 Process_List_Widget
, TRUE
, TRUE
, 0); // FALSE TRUE
89 // GTK_BOX(Control_Flow_Data->Inside_HBox_V),
90 // Control_Flow_Data->Drawing_Area_V, TRUE, TRUE, 0);
93 Control_Flow_Data
->VAdjust_C
=
94 GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
99 0.0)); /* page size */
101 Control_Flow_Data
->Scrolled_Window_VC
=
102 gtk_scrolled_window_new (NULL
,
103 Control_Flow_Data
->VAdjust_C
);
105 gtk_scrolled_window_set_policy(
106 GTK_SCROLLED_WINDOW(Control_Flow_Data
->Scrolled_Window_VC
) ,
108 GTK_POLICY_AUTOMATIC
);
110 gtk_scrolled_window_add_with_viewport(
111 GTK_SCROLLED_WINDOW(Control_Flow_Data
->Scrolled_Window_VC
),
112 Control_Flow_Data
->Inside_HBox_V
);
115 //g_signal_connect (G_OBJECT (Control_Flow_Data->Drawing_Area_V),
117 // G_CALLBACK (expose_event_cb),
118 // Control_Flow_Data);
122 //g_signal_connect (G_OBJECT (Control_Flow_Data->VAdjust_C),
124 // G_CALLBACK (v_scroll_cb),
125 // Control_Flow_Data);
128 /* Set the size of the drawing area */
129 //Drawing_Resize(Drawing, h, w);
131 /* Get trace statistics */
132 //Control_Flow_Data->Trace_Statistics = get_trace_statistics(Trace);
135 //gtk_widget_show(Control_Flow_Data->Drawing_Area_V);
136 gtk_widget_show(Process_List_Widget
);
137 gtk_widget_show(Control_Flow_Data
->Inside_HBox_V
);
138 gtk_widget_show(Control_Flow_Data
->Scrolled_Window_VC
);
140 g_object_set_data_full(
141 G_OBJECT(Control_Flow_Data
->Scrolled_Window_VC
),
144 (GDestroyNotify
)GuiControlFlow_Destructor
);
146 g_slist_append(gControl_Flow_Data_List
,Control_Flow_Data
);
148 return Control_Flow_Data
;
152 /* Destroys widget also */
154 GuiControlFlow_Destructor_Full(ControlFlowData
*Control_Flow_Data
)
156 /* May already have been done by GTK window closing */
157 if(GTK_IS_WIDGET(Control_Flow_Data
->Scrolled_Window_VC
))
158 gtk_widget_destroy(Control_Flow_Data
->Scrolled_Window_VC
);
160 GuiControlFlow_Destructor(Control_Flow_Data
);
164 GuiControlFlow_Destructor(ControlFlowData
*Control_Flow_Data
)
168 /* Process List is removed with it's widget */
169 //ProcessList_destroy(Control_Flow_Data->Process_List);
171 g_slist_remove(gControl_Flow_Data_List
,Control_Flow_Data
);
172 g_free(Control_Flow_Data
);
175 GtkWidget
*GuiControlFlow_get_Widget(ControlFlowData
*Control_Flow_Data
)
177 return Control_Flow_Data
->Scrolled_Window_VC
;