1 /*****************************************************************************
2 * Hooks to be called by the main window *
3 *****************************************************************************/
11 * Event Viewer's constructor hook
13 * This constructor is given as a parameter to the menuitem and toolbar button
14 * registration. It creates the list.
15 * @param pmParentWindow A pointer to the parent window.
16 * @return The widget created.
19 hGuiControlFlow(GtkWidget
*pmParentWindow
)
21 ControlFlowData
* Control_Flow_Data
= GuiControlFlow() ;
23 return Control_Flow_Data
->HBox_V
;
27 int Event_Selected_Hook(void *hook_data
, void *call_data
)
29 ControlFlowData
*Control_Flow_Data
= (ControlFlowData
*) hook_data
;
30 guint
*Event_Number
= (guint
*) call_data
;
32 g_critical("DEBUG : event selected by main window : %u", *Event_Number
);
34 // Control_Flow_Data->Currently_Selected_Event = *Event_Number;
35 // Control_Flow_Data->Selected_Event = TRUE ;
37 // Tree_V_set_cursor(Control_Flow_Data);
42 /* Hook called before drawing. Gets the initial context at the beginning of the
43 * drawing interval and copy it to the context in Event_Request.
45 int Draw_Before_Hook(void *hook_data
, void *call_data
)
47 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
48 EventsContext Events_Context
= (EventsContext
*)call_data
;
50 Event_Request
->Events_Context
= Events_Context
;
56 * The draw event hook is called by the reading API to have a
57 * particular event drawn on the screen.
58 * @param hook_data ControlFlowData structure of the viewer.
59 * @param call_data Event context.
61 * This function basically draw lines and icons. Two types of lines are drawn :
62 * one small (3 pixels?) representing the state of the process and the second
63 * type is thicker (10 pixels?) representing on which CPU a process is running
64 * (and this only in running state).
66 * Extremums of the lines :
67 * x_min : time of the last event context for this process kept in memory.
68 * x_max : time of the current event.
69 * y : middle of the process in the process list. The process is found in the
70 * list, therefore is it's position in pixels.
72 * The choice of lines'color is defined by the context of the last event for this
75 int Draw_Event_Hook(void *hook_data
, void *call_data
)
77 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
83 int Draw_After_Hook(void *hook_data
, void *call_data
)
85 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
87 g_free(Event_Request
);