1 /*****************************************************************************
2 * Hooks to be called by the main window *
3 *****************************************************************************/
9 #include <lttv/common.h>
14 * Event Viewer's constructor hook
16 * This constructor is given as a parameter to the menuitem and toolbar button
17 * registration. It creates the list.
18 * @param pmParentWindow A pointer to the parent window.
19 * @return The widget created.
22 hGuiControlFlow(mainWindow
*pmParentWindow
)
24 ControlFlowData
* Control_Flow_Data
= GuiControlFlow() ;
26 return GuiControlFlow_get_Widget(Control_Flow_Data
) ;
30 int Event_Selected_Hook(void *hook_data
, void *call_data
)
32 ControlFlowData
*Control_Flow_Data
= (ControlFlowData
*) hook_data
;
33 guint
*Event_Number
= (guint
*) call_data
;
35 g_critical("DEBUG : event selected by main window : %u", *Event_Number
);
37 // Control_Flow_Data->Currently_Selected_Event = *Event_Number;
38 // Control_Flow_Data->Selected_Event = TRUE ;
40 // Tree_V_set_cursor(Control_Flow_Data);
45 /* Hook called before drawing. Gets the initial context at the beginning of the
46 * drawing interval and copy it to the context in Event_Request.
48 int Draw_Before_Hook(void *hook_data
, void *call_data
)
50 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
51 EventsContext Events_Context
= (EventsContext
*)call_data
;
53 Event_Request
->Events_Context
= Events_Context
;
59 * The draw event hook is called by the reading API to have a
60 * particular event drawn on the screen.
61 * @param hook_data ControlFlowData structure of the viewer.
62 * @param call_data Event context.
64 * This function basically draw lines and icons. Two types of lines are drawn :
65 * one small (3 pixels?) representing the state of the process and the second
66 * type is thicker (10 pixels?) representing on which CPU a process is running
67 * (and this only in running state).
69 * Extremums of the lines :
70 * x_min : time of the last event context for this process kept in memory.
71 * x_max : time of the current event.
72 * y : middle of the process in the process list. The process is found in the
73 * list, therefore is it's position in pixels.
75 * The choice of lines'color is defined by the context of the last event for this
78 int Draw_Event_Hook(void *hook_data
, void *call_data
)
80 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
86 int Draw_After_Hook(void *hook_data
, void *call_data
)
88 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
90 g_free(Event_Request
);