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