1 /*****************************************************************************
2 * Hooks to be called by the main window *
3 *****************************************************************************/
6 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
7 #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
9 //#define PANGO_ENABLE_BACKEND
16 //#include <pango/pango.h>
18 #include <ltt/event.h>
22 #include <lttv/hook.h>
23 #include <lttv/common.h>
24 #include <lttv/state.h>
27 #include "Event_Hooks.h"
29 #include "Process_List.h"
31 #include "CFV-private.h"
34 #define MAX_PATH_LEN 256
38 * Event Viewer's constructor hook
40 * This constructor is given as a parameter to the menuitem and toolbar button
41 * registration. It creates the list.
42 * @param pmParentWindow A pointer to the parent window.
43 * @return The widget created.
46 h_guicontrolflow(MainWindow
*pmParentWindow
, LttvTracesetSelector
* s
, char * key
)
48 g_info("h_guicontrolflow, %p, %p, %s", pmParentWindow
, s
, key
);
49 ControlFlowData
*Control_Flow_Data
= guicontrolflow() ;
51 Control_Flow_Data
->Parent_Window
= pmParentWindow
;
52 TimeWindow
*time_window
= guicontrolflow_get_time_window(Control_Flow_Data
);
53 time_window
->start_time
.tv_sec
= 0;
54 time_window
->start_time
.tv_nsec
= 0;
55 time_window
->time_width
.tv_sec
= 0;
56 time_window
->time_width
.tv_nsec
= 0;
58 LttTime
*current_time
= guicontrolflow_get_current_time(Control_Flow_Data
);
59 current_time
->tv_sec
= 0;
60 current_time
->tv_nsec
= 0;
62 //g_critical("time width1 : %u",time_window->time_width);
64 get_time_window(pmParentWindow
,
66 get_current_time(pmParentWindow
,
69 //g_critical("time width2 : %u",time_window->time_width);
70 // Unreg done in the GuiControlFlow_Destructor
71 reg_update_time_window(update_time_window_hook
, Control_Flow_Data
,
73 reg_update_current_time(update_current_time_hook
, Control_Flow_Data
,
75 return guicontrolflow_get_widget(Control_Flow_Data
) ;
79 int event_selected_hook(void *hook_data
, void *call_data
)
81 ControlFlowData
*Control_Flow_Data
= (ControlFlowData
*) hook_data
;
82 guint
*Event_Number
= (guint
*) call_data
;
84 g_critical("DEBUG : event selected by main window : %u", *Event_Number
);
86 // Control_Flow_Data->Currently_Selected_Event = *Event_Number;
87 // Control_Flow_Data->Selected_Event = TRUE ;
89 // tree_v_set_cursor(Control_Flow_Data);
93 /* Hook called before drawing. Gets the initial context at the beginning of the
94 * drawing interval and copy it to the context in Event_Request.
96 int draw_before_hook(void *hook_data
, void *call_data
)
98 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
99 //EventsContext Events_Context = (EventsContext*)call_data;
101 //Event_Request->Events_Context = Events_Context;
107 * The draw event hook is called by the reading API to have a
108 * particular event drawn on the screen.
109 * @param hook_data ControlFlowData structure of the viewer.
110 * @param call_data Event context.
112 * This function basically draw lines and icons. Two types of lines are drawn :
113 * one small (3 pixels?) representing the state of the process and the second
114 * type is thicker (10 pixels?) representing on which CPU a process is running
115 * (and this only in running state).
117 * Extremums of the lines :
118 * x_min : time of the last event context for this process kept in memory.
119 * x_max : time of the current event.
120 * y : middle of the process in the process list. The process is found in the
121 * list, therefore is it's position in pixels.
123 * The choice of lines'color is defined by the context of the last event for this
126 int draw_event_hook(void *hook_data
, void *call_data
)
128 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
129 ControlFlowData
*control_flow_data
= Event_Request
->Control_Flow_Data
;
131 LttvTracefileContext
*tfc
= (LttvTracefileContext
*)call_data
;
133 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
139 if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e
)),"schedchange") == 0)
141 g_critical("schedchange!");
143 /* Add process to process list (if not present) and get drawing "y" from
144 * process position */
145 guint pid_out
, pid_in
;
146 LttvProcessState
*process_out
, *process_in
;
148 guint y_in
= 0, y_out
= 0, height
= 0, pl_height
= 0;
150 ProcessList
*process_list
=
151 guicontrolflow_get_process_list(Event_Request
->Control_Flow_Data
);
154 LttField
*f
= ltt_event_field(e
);
156 element
= ltt_field_member(f
,0);
157 pid_out
= ltt_event_get_long_unsigned(e
,element
);
158 element
= ltt_field_member(f
,1);
159 pid_in
= ltt_event_get_long_unsigned(e
,element
);
160 g_critical("out : %u in : %u", pid_out
, pid_in
);
163 /* Find process pid_out in the list... */
164 process_out
= lttv_state_find_process(tfs
, pid_out
);
165 g_critical("out : %s",g_quark_to_string(process_out
->state
->s
));
167 birth
= process_out
->creation_time
;
168 gchar
*name
= strdup(g_quark_to_string(process_out
->name
));
169 HashedProcessData
*Hashed_Process_Data_out
= NULL
;
171 if(processlist_get_process_pixels(process_list
,
176 &Hashed_Process_Data_out
) == 1)
178 /* Process not present */
179 processlist_add(process_list
,
184 &Hashed_Process_Data_out
);
185 processlist_get_process_pixels(process_list
,
190 &Hashed_Process_Data_out
);
191 drawing_insert_square( Event_Request
->Control_Flow_Data
->Drawing
, y_out
, height
);
196 /* Find process pid_in in the list... */
197 process_in
= lttv_state_find_process(tfs
, pid_in
);
198 g_critical("in : %s",g_quark_to_string(process_in
->state
->s
));
200 birth
= process_in
->creation_time
;
201 name
= strdup(g_quark_to_string(process_in
->name
));
202 HashedProcessData
*Hashed_Process_Data_in
= NULL
;
204 if(processlist_get_process_pixels(process_list
,
209 &Hashed_Process_Data_in
) == 1)
211 /* Process not present */
212 processlist_add(process_list
,
217 &Hashed_Process_Data_in
);
218 processlist_get_process_pixels(process_list
,
223 &Hashed_Process_Data_in
);
225 drawing_insert_square( Event_Request
->Control_Flow_Data
->Drawing
, y_in
, height
);
230 /* Find pixels corresponding to time of the event. If the time does
231 * not fit in the window, show a warning, not supposed to happend. */
233 guint width
= control_flow_data
->Drawing
->Drawing_Area_V
->allocation
.width
;
235 LttTime time
= ltt_event_time(e
);
237 LttTime window_end
= ltt_time_add(control_flow_data
->Time_Window
.time_width
,
238 control_flow_data
->Time_Window
.start_time
);
241 convert_time_to_pixels(
242 control_flow_data
->Time_Window
.start_time
,
250 /* draw what represents the event for outgoing process. */
252 DrawContext
*draw_context_out
= Hashed_Process_Data_out
->draw_context
;
253 draw_context_out
->Current
->modify_over
->x
= x
;
254 draw_context_out
->Current
->modify_over
->y
= y_out
;
255 draw_context_out
->drawable
= control_flow_data
->Drawing
->Pixmap
;
256 draw_context_out
->pango_layout
= control_flow_data
->Drawing
->pango_layout
;
257 GtkWidget
*widget
= control_flow_data
->Drawing
->Drawing_Area_V
;
258 //draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
259 draw_context_out
->gc
= widget
->style
->black_gc
;
261 //draw_arc((void*)&prop_arc, (void*)draw_context_out);
262 //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->Pixmap);
264 GdkColor colorfg_out
= { 0, 0xffff, 0x0000, 0x0000 };
265 GdkColor colorbg_out
= { 0, 0xffff, 0xffff, 0xffff };
266 PropertiesText prop_text_out
;
267 prop_text_out
.foreground
= &colorfg_out
;
268 prop_text_out
.background
= &colorbg_out
;
269 prop_text_out
.size
= 10;
270 prop_text_out
.position
= OVER
;
272 /* Print status of the process : U, WF, WC, E, W, R */
273 if(process_out
->state
->s
== LTTV_STATE_UNNAMED
)
274 prop_text_out
.Text
= "U";
275 else if(process_out
->state
->s
== LTTV_STATE_WAIT_FORK
)
276 prop_text_out
.Text
= "WF";
277 else if(process_out
->state
->s
== LTTV_STATE_WAIT_CPU
)
278 prop_text_out
.Text
= "WC";
279 else if(process_out
->state
->s
== LTTV_STATE_EXIT
)
280 prop_text_out
.Text
= "E";
281 else if(process_out
->state
->s
== LTTV_STATE_WAIT
)
282 prop_text_out
.Text
= "W";
283 else if(process_out
->state
->s
== LTTV_STATE_RUN
)
284 prop_text_out
.Text
= "R";
286 prop_text_out
.Text
= "U";
288 draw_text((void*)&prop_text_out
, (void*)draw_context_out
);
290 /* Finally, update the drawing context of the pid_in. */
292 DrawContext
*draw_context_in
= Hashed_Process_Data_in
->draw_context
;
293 draw_context_in
->Current
->modify_over
->x
= x
;
294 draw_context_in
->Current
->modify_over
->y
= y_in
;
295 draw_context_in
->drawable
= control_flow_data
->Drawing
->Pixmap
;
296 draw_context_in
->pango_layout
= control_flow_data
->Drawing
->pango_layout
;
297 widget
= control_flow_data
->Drawing
->Drawing_Area_V
;
298 //draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
299 draw_context_in
->gc
= widget
->style
->black_gc
;
301 //draw_arc((void*)&prop_arc, (void*)draw_context_in);
302 //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->Pixmap);
304 GdkColor colorfg_in
= { 0, 0x0000, 0xffff, 0x0000 };
305 GdkColor colorbg_in
= { 0, 0xffff, 0xffff, 0xffff };
306 PropertiesText prop_text_in
;
307 prop_text_in
.foreground
= &colorfg_in
;
308 prop_text_in
.background
= &colorbg_in
;
309 prop_text_in
.size
= 10;
310 prop_text_in
.position
= OVER
;
312 /* Print status of the process : U, WF, WC, E, W, R */
313 if(process_in
->state
->s
== LTTV_STATE_UNNAMED
)
314 prop_text_in
.Text
= "U";
315 else if(process_in
->state
->s
== LTTV_STATE_WAIT_FORK
)
316 prop_text_in
.Text
= "WF";
317 else if(process_in
->state
->s
== LTTV_STATE_WAIT_CPU
)
318 prop_text_in
.Text
= "WC";
319 else if(process_in
->state
->s
== LTTV_STATE_EXIT
)
320 prop_text_in
.Text
= "E";
321 else if(process_in
->state
->s
== LTTV_STATE_WAIT
)
322 prop_text_in
.Text
= "W";
323 else if(process_in
->state
->s
== LTTV_STATE_RUN
)
324 prop_text_in
.Text
= "R";
326 prop_text_in
.Text
= "U";
328 draw_text((void*)&prop_text_in
, (void*)draw_context_in
);
336 GString
*string
= g_string_new("");;
337 gboolean field_names
= TRUE
, state
= TRUE
;
339 lttv_event_to_string(e
, tfc
->tf
, string
, TRUE
, field_names
, tfs
);
340 g_string_append_printf(string
,"\n");
343 g_string_append_printf(string
, " %s",
344 g_quark_to_string(tfs
->process
->state
->s
));
347 g_info("%s",string
->str
);
349 g_string_free(string
, TRUE
);
351 /* End of text dump */
357 int draw_after_hook(void *hook_data
, void *call_data
)
359 EventRequest
*Event_Request
= (EventRequest
*)hook_data
;
360 ControlFlowData
*control_flow_data
= Event_Request
->Control_Flow_Data
;
362 LttvTracefileContext
*tfc
= (LttvTracefileContext
*)call_data
;
364 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
370 if(strcmp(ltt_eventtype_name(ltt_event_eventtype(e
)),"schedchange") == 0)
372 g_critical("schedchange!");
374 /* Add process to process list (if not present) and get drawing "y" from
375 * process position */
376 guint pid_out
, pid_in
;
377 LttvProcessState
*process_out
, *process_in
;
379 guint y_in
= 0, y_out
= 0, height
= 0, pl_height
= 0;
381 ProcessList
*process_list
=
382 guicontrolflow_get_process_list(Event_Request
->Control_Flow_Data
);
385 LttField
*f
= ltt_event_field(e
);
387 element
= ltt_field_member(f
,0);
388 pid_out
= ltt_event_get_long_unsigned(e
,element
);
389 element
= ltt_field_member(f
,1);
390 pid_in
= ltt_event_get_long_unsigned(e
,element
);
391 g_critical("out : %u in : %u", pid_out
, pid_in
);
394 /* Find process pid_out in the list... */
395 process_out
= lttv_state_find_process(tfs
, pid_out
);
396 g_critical("out : %s",g_quark_to_string(process_out
->state
->s
));
398 birth
= process_out
->creation_time
;
399 gchar
*name
= strdup(g_quark_to_string(process_out
->name
));
400 HashedProcessData
*Hashed_Process_Data_out
= NULL
;
402 if(processlist_get_process_pixels(process_list
,
407 &Hashed_Process_Data_out
) == 1)
409 /* Process not present */
410 processlist_add(process_list
,
415 &Hashed_Process_Data_out
);
416 processlist_get_process_pixels(process_list
,
421 &Hashed_Process_Data_out
);
422 drawing_insert_square( Event_Request
->Control_Flow_Data
->Drawing
, y_out
, height
);
427 /* Find process pid_in in the list... */
428 process_in
= lttv_state_find_process(tfs
, pid_in
);
429 g_critical("in : %s",g_quark_to_string(process_in
->state
->s
));
431 birth
= process_in
->creation_time
;
432 name
= strdup(g_quark_to_string(process_in
->name
));
433 HashedProcessData
*Hashed_Process_Data_in
= NULL
;
435 if(processlist_get_process_pixels(process_list
,
440 &Hashed_Process_Data_in
) == 1)
442 /* Process not present */
443 processlist_add(process_list
,
448 &Hashed_Process_Data_in
);
449 processlist_get_process_pixels(process_list
,
454 &Hashed_Process_Data_in
);
456 drawing_insert_square( Event_Request
->Control_Flow_Data
->Drawing
, y_in
, height
);
461 /* Find pixels corresponding to time of the event. If the time does
462 * not fit in the window, show a warning, not supposed to happend. */
464 //guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width;
466 //LttTime time = ltt_event_time(e);
468 //LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width,
469 // control_flow_data->Time_Window.start_time);
472 //convert_time_to_pixels(
473 // control_flow_data->Time_Window.start_time,
479 //assert(x <= width);
481 /* draw what represents the event for outgoing process. */
483 DrawContext
*draw_context_out
= Hashed_Process_Data_out
->draw_context
;
484 //draw_context_out->Current->modify_over->x = x;
485 //draw_context_out->Current->modify_over->y = y_out;
486 draw_context_out
->drawable
= control_flow_data
->Drawing
->Pixmap
;
487 draw_context_out
->pango_layout
= control_flow_data
->Drawing
->pango_layout
;
488 GtkWidget
*widget
= control_flow_data
->Drawing
->Drawing_Area_V
;
489 //draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
490 draw_context_out
->gc
= widget
->style
->black_gc
;
492 //draw_arc((void*)&prop_arc, (void*)draw_context_out);
493 //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->Pixmap);
495 GdkColor colorfg_out
= { 0, 0xffff, 0x0000, 0x0000 };
496 GdkColor colorbg_out
= { 0, 0xffff, 0xffff, 0xffff };
497 PropertiesText prop_text_out
;
498 prop_text_out
.foreground
= &colorfg_out
;
499 prop_text_out
.background
= &colorbg_out
;
500 prop_text_out
.size
= 10;
501 prop_text_out
.position
= OVER
;
503 /* Print status of the process : U, WF, WC, E, W, R */
504 if(process_out
->state
->s
== LTTV_STATE_UNNAMED
)
505 prop_text_out
.Text
= "U";
506 else if(process_out
->state
->s
== LTTV_STATE_WAIT_FORK
)
507 prop_text_out
.Text
= "WF";
508 else if(process_out
->state
->s
== LTTV_STATE_WAIT_CPU
)
509 prop_text_out
.Text
= "WC";
510 else if(process_out
->state
->s
== LTTV_STATE_EXIT
)
511 prop_text_out
.Text
= "E";
512 else if(process_out
->state
->s
== LTTV_STATE_WAIT
)
513 prop_text_out
.Text
= "W";
514 else if(process_out
->state
->s
== LTTV_STATE_RUN
)
515 prop_text_out
.Text
= "R";
517 prop_text_out
.Text
= "U";
519 draw_text((void*)&prop_text_out
, (void*)draw_context_out
);
521 /* Finally, update the drawing context of the pid_in. */
523 DrawContext
*draw_context_in
= Hashed_Process_Data_in
->draw_context
;
524 //draw_context_in->Current->modify_over->x = x;
525 //draw_context_in->Current->modify_over->y = y_in;
526 draw_context_in
->drawable
= control_flow_data
->Drawing
->Pixmap
;
527 draw_context_in
->pango_layout
= control_flow_data
->Drawing
->pango_layout
;
528 widget
= control_flow_data
->Drawing
->Drawing_Area_V
;
529 //draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
530 draw_context_in
->gc
= widget
->style
->black_gc
;
532 //draw_arc((void*)&prop_arc, (void*)draw_context_in);
533 //test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->Pixmap);
535 GdkColor colorfg_in
= { 0, 0x0000, 0xffff, 0x0000 };
536 GdkColor colorbg_in
= { 0, 0xffff, 0xffff, 0xffff };
537 PropertiesText prop_text_in
;
538 prop_text_in
.foreground
= &colorfg_in
;
539 prop_text_in
.background
= &colorbg_in
;
540 prop_text_in
.size
= 10;
541 prop_text_in
.position
= OVER
;
543 /* Print status of the process : U, WF, WC, E, W, R */
544 if(process_in
->state
->s
== LTTV_STATE_UNNAMED
)
545 prop_text_in
.Text
= "U";
546 else if(process_in
->state
->s
== LTTV_STATE_WAIT_FORK
)
547 prop_text_in
.Text
= "WF";
548 else if(process_in
->state
->s
== LTTV_STATE_WAIT_CPU
)
549 prop_text_in
.Text
= "WC";
550 else if(process_in
->state
->s
== LTTV_STATE_EXIT
)
551 prop_text_in
.Text
= "E";
552 else if(process_in
->state
->s
== LTTV_STATE_WAIT
)
553 prop_text_in
.Text
= "W";
554 else if(process_in
->state
->s
== LTTV_STATE_RUN
)
555 prop_text_in
.Text
= "R";
557 prop_text_in
.Text
= "U";
559 draw_text((void*)&prop_text_in
, (void*)draw_context_in
);
569 void update_time_window_hook(void *hook_data
, void *call_data
)
571 ControlFlowData
*control_flow_data
= (ControlFlowData
*) hook_data
;
572 TimeWindow
*Old_Time_Window
=
573 guicontrolflow_get_time_window(control_flow_data
);
574 TimeWindow
*New_Time_Window
= ((TimeWindow
*)call_data
);
576 /* Two cases : zoom in/out or scrolling */
578 /* In order to make sure we can reuse the old drawing, the scale must
579 * be the same and the new time interval being partly located in the
580 * currently shown time interval. (reuse is only for scrolling)
583 g_info("Old time window HOOK : %u, %u to %u, %u",
584 Old_Time_Window
->start_time
.tv_sec
,
585 Old_Time_Window
->start_time
.tv_nsec
,
586 Old_Time_Window
->time_width
.tv_sec
,
587 Old_Time_Window
->time_width
.tv_nsec
);
589 g_info("New time window HOOK : %u, %u to %u, %u",
590 New_Time_Window
->start_time
.tv_sec
,
591 New_Time_Window
->start_time
.tv_nsec
,
592 New_Time_Window
->time_width
.tv_sec
,
593 New_Time_Window
->time_width
.tv_nsec
);
595 if( New_Time_Window
->time_width
.tv_sec
== Old_Time_Window
->time_width
.tv_sec
596 && New_Time_Window
->time_width
.tv_nsec
== Old_Time_Window
->time_width
.tv_nsec
)
598 /* Same scale (scrolling) */
600 LttTime
*ns
= &New_Time_Window
->start_time
;
601 LttTime
*os
= &Old_Time_Window
->start_time
;
602 LttTime old_end
= ltt_time_add(Old_Time_Window
->start_time
,
603 Old_Time_Window
->time_width
);
604 LttTime new_end
= ltt_time_add(New_Time_Window
->start_time
,
605 New_Time_Window
->time_width
);
607 //if(ns<os+w && os+w<ns+w)
608 //if(ns<old_end && os<ns)
609 if(ltt_time_compare(*ns
, old_end
) == -1
610 && ltt_time_compare(*os
, *ns
) == -1)
612 g_info("scrolling near right");
613 /* Scroll right, keep right part of the screen */
615 guint width
= control_flow_data
->Drawing
->Drawing_Area_V
->allocation
.width
;
616 convert_time_to_pixels(
623 /* Copy old data to new location */
624 gdk_draw_drawable (control_flow_data
->Drawing
->Pixmap
,
625 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
626 control_flow_data
->Drawing
->Pixmap
,
631 convert_time_to_pixels(
638 *Old_Time_Window
= *New_Time_Window
;
639 /* Clear the data request background, but not SAFETY */
640 gdk_draw_rectangle (control_flow_data
->Drawing
->Pixmap
,
641 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
644 control_flow_data
->Drawing
->width
- x
, // do not overlap
645 control_flow_data
->Drawing
->height
+SAFETY
);
646 /* Get new data for the rest. */
647 drawing_data_request(control_flow_data
->Drawing
,
648 &control_flow_data
->Drawing
->Pixmap
,
650 control_flow_data
->Drawing
->width
- x
,
651 control_flow_data
->Drawing
->height
);
653 drawing_refresh(control_flow_data
->Drawing
,
655 control_flow_data
->Drawing
->width
,
656 control_flow_data
->Drawing
->height
);
661 //if(ns<os && os<ns+w)
662 //if(ns<os && os<new_end)
663 if(ltt_time_compare(*ns
,*os
) == -1
664 && ltt_time_compare(*os
,new_end
) == -1)
666 g_info("scrolling near left");
667 /* Scroll left, keep left part of the screen */
669 guint width
= control_flow_data
->Drawing
->Drawing_Area_V
->allocation
.width
;
670 convert_time_to_pixels(
677 /* Copy old data to new location */
678 gdk_draw_drawable (control_flow_data
->Drawing
->Pixmap
,
679 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
680 control_flow_data
->Drawing
->Pixmap
,
685 *Old_Time_Window
= *New_Time_Window
;
687 /* Clean the data request background */
688 gdk_draw_rectangle (control_flow_data
->Drawing
->Pixmap
,
689 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
693 control_flow_data
->Drawing
->height
+SAFETY
);
694 /* Get new data for the rest. */
695 drawing_data_request(control_flow_data
->Drawing
,
696 &control_flow_data
->Drawing
->Pixmap
,
699 control_flow_data
->Drawing
->height
);
701 drawing_refresh(control_flow_data
->Drawing
,
703 control_flow_data
->Drawing
->width
,
704 control_flow_data
->Drawing
->height
);
707 g_info("scrolling far");
708 /* Cannot reuse any part of the screen : far jump */
709 *Old_Time_Window
= *New_Time_Window
;
712 gdk_draw_rectangle (control_flow_data
->Drawing
->Pixmap
,
713 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
716 control_flow_data
->Drawing
->width
+SAFETY
, // do not overlap
717 control_flow_data
->Drawing
->height
+SAFETY
);
719 drawing_data_request(control_flow_data
->Drawing
,
720 &control_flow_data
->Drawing
->Pixmap
,
722 control_flow_data
->Drawing
->width
,
723 control_flow_data
->Drawing
->height
);
725 drawing_refresh(control_flow_data
->Drawing
,
727 control_flow_data
->Drawing
->width
,
728 control_flow_data
->Drawing
->height
);
732 /* Different scale (zoom) */
735 *Old_Time_Window
= *New_Time_Window
;
737 gdk_draw_rectangle (control_flow_data
->Drawing
->Pixmap
,
738 control_flow_data
->Drawing
->Drawing_Area_V
->style
->white_gc
,
741 control_flow_data
->Drawing
->width
+SAFETY
, // do not overlap
742 control_flow_data
->Drawing
->height
+SAFETY
);
745 drawing_data_request(control_flow_data
->Drawing
,
746 &control_flow_data
->Drawing
->Pixmap
,
748 control_flow_data
->Drawing
->width
,
749 control_flow_data
->Drawing
->height
);
751 drawing_refresh(control_flow_data
->Drawing
,
753 control_flow_data
->Drawing
->width
,
754 control_flow_data
->Drawing
->height
);
760 void update_current_time_hook(void *hook_data
, void *call_data
)
762 ControlFlowData
*Control_Flow_Data
= (ControlFlowData
*) hook_data
;
763 LttTime
* Current_Time
=
764 guicontrolflow_get_current_time(Control_Flow_Data
);
765 *Current_Time
= *((LttTime
*)call_data
);
766 g_info("New Current time HOOK : %u, %u", Current_Time
->tv_sec
,
767 Current_Time
->tv_nsec
);
769 /* If current time is inside time interval, just move the highlight
772 /* Else, we have to change the time interval. We have to tell it
773 * to the main window. */
774 /* The time interval change will take care of placing the current
775 * time at the center of the visible area */