From 9878c8a4ce727f8a542a836ed289f5eb365d3292 Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 22 Jun 2004 22:03:07 +0000 Subject: [PATCH] added redraw, continue and stop git-svn-id: http://ltt.polymtl.ca/svn@608 04897980-b3bd-0310-b5e0-8ef037075253 --- .../gui/lttvwindow/lttvwindow/callbacks.c | 104 +++++++++++++++++- .../gui/lttvwindow/lttvwindow/callbacks.h | 11 ++ .../gui/lttvwindow/lttvwindow/interface.c | 50 +++++++++ .../gui/lttvwindow/lttvwindow/lttvwindow.c | 96 ++++++++++++++++ .../gui/lttvwindow/lttvwindow/lttvwindow.h | 54 +++++++++ .../gui/lttvwindow/pixmaps/Makefile.am | 5 +- .../gui/lttvwindow/pixmaps/stock_redo_24.png | Bin 0 -> 756 bytes .../lttvwindow/pixmaps/stock_refresh_24.png | Bin 0 -> 1138 bytes .../gui/lttvwindow/pixmaps/stock_stop_24.png | Bin 0 -> 1379 bytes 9 files changed, 317 insertions(+), 3 deletions(-) create mode 100644 ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png create mode 100644 ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_refresh_24.png create mode 100644 ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index c6f574d4..c734f89d 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -435,8 +435,6 @@ gboolean lttvwindow_process_pending_requests(Tab *tab) LttvTracesetContextPosition *end_position; - /* Current tab check : if no current tab is present, no hooks to call. */ - /* (Xang Xiu) It makes the expose works.. MD:? */ if(tab == NULL) return FALSE; @@ -1270,6 +1268,86 @@ void remove_trace(GtkWidget * widget, gpointer user_data) } +/* Redraw all the viewers in the current tab */ +void redraw(GtkWidget *widget, gpointer user_data) +{ + GtkWidget * notebook = lookup_widget(widget, "MNotebook"); + GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), + gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); + Tab *tab; + if(!page) { + return; + } else { + tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info"); + } + + LttvHooks * tmp; + LttvAttributeValue value; + + g_assert(lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw", LTTV_POINTER, &value)); + + tmp = (LttvHooks*)*(value.v_pointer); + g_assert(tmp != NULL); + + lttv_hooks_call(tmp,NULL); +} + + +void continue_processing(GtkWidget *widget, gpointer user_data) +{ + GtkWidget * notebook = lookup_widget(widget, "MNotebook"); + GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), + gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); + Tab *tab; + if(!page) { + return; + } else { + tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info"); + } + + LttvHooks * tmp; + LttvAttributeValue value; + + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/continue", LTTV_POINTER, &value)); + + tmp = (LttvHooks*)*(value.v_pointer); + g_assert(tmp != NULL); + + lttv_hooks_call(tmp,NULL); +} + +/* Stop the processing for the calling main window's current tab. + * It removes every processing requests that are in its list. It does not call + * the end request hooks, because the request is not finished. + */ + +void stop_processing(GtkWidget *widget, gpointer user_data) +{ + GtkWidget * notebook = lookup_widget(widget, "MNotebook"); + GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), + gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); + Tab *tab; + if(!page) { + return; + } else { + tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info"); + } + GSList *events_requests = tab->events_requests; + + GSList *iter = events_requests; + + while(iter != NULL) { + GSList *remove_iter = iter; + iter = g_slist_next(iter); + + g_free(remove_iter->data); + events_requests = g_slist_remove_link(events_requests, remove_iter); + } + g_assert(g_slist_length(events_requests) == 0); +} + + /* save will save the traceset to a file * Not implemented yet FIXME */ @@ -1870,6 +1948,28 @@ on_button_remove_trace_clicked (GtkButton *button, remove_trace((GtkWidget*)button, user_data); } +void +on_button_redraw_clicked (GtkButton *button, + gpointer user_data) +{ + redraw((GtkWidget*)button, user_data); +} + +void +on_button_continue_processing_clicked (GtkButton *button, + gpointer user_data) +{ + continue_processing((GtkWidget*)button, user_data); +} + +void +on_button_stop_processing_clicked (GtkButton *button, + gpointer user_data) +{ + stop_processing((GtkWidget*)button, user_data); +} + + void on_button_save_clicked (GtkButton *button, diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h index c46c9254..31589b38 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h @@ -182,6 +182,17 @@ on_button_add_trace_clicked (GtkButton *button, void on_button_remove_trace_clicked (GtkButton *button, gpointer user_data); +void +on_button_redraw_clicked (GtkButton *button, + gpointer user_data); + +void +on_button_continue_processing_clicked (GtkButton *button, + gpointer user_data); + +void +on_button_stop_processing_clicked (GtkButton *button, + gpointer user_data); void on_button_save_clicked (GtkButton *button, diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/interface.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/interface.c index 46a82b17..da688fdf 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/interface.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/interface.c @@ -117,6 +117,9 @@ create_MWindow (void) // GtkWidget *tlbOpenTraceset; GtkWidget *tlbAddTrace; GtkWidget *tlbRemoveTrace; + GtkWidget *tlbRedraw; + GtkWidget *tlbContinueProcessing; + GtkWidget *tlbStopProcessing; // GtkWidget *tlbSave; // GtkWidget *tlbSaveAs; GtkWidget *tlbZoomIn; @@ -474,6 +477,44 @@ create_MWindow (void) gtk_widget_show (tlbSaveAs); gtk_container_set_border_width (GTK_CONTAINER (tlbSaveAs), 1); */ + gtk_toolbar_append_space (GTK_TOOLBAR (MToolbar1)); + + /* Manually added by Mathieu Desnoyers */ + + tmp_toolbar_icon = create_pixmap (MWindow, "stock_redraw_24.png"); + tlbRedraw = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + "", + "Redraw", NULL, + tmp_toolbar_icon, NULL, NULL); + gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE); + gtk_widget_show (tlbRedraw); + gtk_container_set_border_width (GTK_CONTAINER (tlbRedraw), 1); + + tmp_toolbar_icon = create_pixmap (MWindow, "stock_redo_24.png"); + tlbContinueProcessing = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + "", + "Continue Processing", NULL, + tmp_toolbar_icon, NULL, NULL); + gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE); + gtk_widget_show (tlbContinueProcessing); + gtk_container_set_border_width (GTK_CONTAINER (tlbContinueProcessing), 1); + + tmp_toolbar_icon = create_pixmap (MWindow, "stock_stop_24.png"); + tlbStopProcessing = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + "", + "Stop Processing", NULL, + tmp_toolbar_icon, NULL, NULL); + gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE); + gtk_widget_show (tlbStopProcessing); + gtk_container_set_border_width (GTK_CONTAINER (tlbStopProcessing), 1); + + gtk_toolbar_append_space (GTK_TOOLBAR (MToolbar1)); tmp_toolbar_icon = create_pixmap (MWindow, "stock_zoom_in_24.png"); @@ -727,6 +768,15 @@ create_MWindow (void) g_signal_connect ((gpointer) tlbRemoveTrace, "clicked", G_CALLBACK (on_button_remove_trace_clicked), NULL); + g_signal_connect ((gpointer) tlbRedraw, "clicked", + G_CALLBACK (on_button_redraw_clicked), + NULL); + g_signal_connect ((gpointer) tlbContinueProcessing, "clicked", + G_CALLBACK (on_button_continue_processing_clicked), + NULL); + g_signal_connect ((gpointer) tlbStopProcessing, "clicked", + G_CALLBACK (on_button_stop_processing_clicked), + NULL); /* g_signal_connect ((gpointer) tlbSave, "clicked", G_CALLBACK (on_button_save_clicked), diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c index f7035ea3..cac8e126 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c @@ -464,6 +464,102 @@ void lttvwindow_unregister_traceset_notify(Tab *tab, lttv_hooks_remove_data(tmp, hook, hook_data); } +/** + * Function to register a hook function for a viewer be completely redrawn. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_register_redraw_notify(Tab *tab, + LttvHook hook, gpointer hook_data) +{ + LttvAttributeValue value; + LttvHooks * tmp; + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/redraw", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp == NULL){ + tmp = lttv_hooks_new(); + *(value.v_pointer) = tmp; + } + lttv_hooks_add(tmp, hook, hook_data, LTTV_PRIO_DEFAULT); +} + + +/** + * Function to unregister a hook function for a viewer be completely redrawn. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_unregister_redraw_notify(Tab *tab, + LttvHook hook, gpointer hook_data) +{ + LttvAttributeValue value; + LttvHooks * tmp; + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/redraw", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp == NULL) return; + lttv_hooks_remove_data(tmp, hook, hook_data); +} + +/** + * Function to register a hook function for a viewer to re-do the events + * requests for the needed interval. + * + * This action is typically done after a "stop". + * + * The typical hook will remove all current requests for the viewer + * and make requests for missing information. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_register_continue_notify(Tab *tab, + LttvHook hook, gpointer hook_data) +{ + LttvAttributeValue value; + LttvHooks * tmp; + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/continue", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp == NULL){ + tmp = lttv_hooks_new(); + *(value.v_pointer) = tmp; + } + lttv_hooks_add(tmp, hook, hook_data, LTTV_PRIO_DEFAULT); +} + + +/** + * Function to unregister a hook function for a viewer to re-do the events + * requests for the needed interval. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_unregister_continue_notify(Tab *tab, + LttvHook hook, gpointer hook_data) +{ + LttvAttributeValue value; + LttvHooks * tmp; + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/continue", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp == NULL) return; + lttv_hooks_remove_data(tmp, hook, hook_data); +} + + /** * Function to register a hook function for a viewer to set/update its * filter. diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h index 83a67d02..785a22f4 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h @@ -400,6 +400,60 @@ void lttvwindow_unregister_traceset_notify(Tab *tab, gpointer hook_data); +/** + * Function to register a hook function for a viewer be completely redrawn. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_register_redraw_notify(Tab *tab, + LttvHook hook, gpointer hook_data); + +/** + * Function to unregister a hook function for a viewer be completely redrawn. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_unregister_redraw_notify(Tab *tab, + LttvHook hook, gpointer hook_data); + + +/** + * Function to register a hook function for a viewer to re-do the events + * requests for the needed interval. + * + * This action is typically done after a "stop". + * + * The typical hook will remove all current requests for the viewer + * and make requests for missing information. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_register_continue_notify(Tab *tab, + LttvHook hook, gpointer hook_data); + + +/** + * Function to unregister a hook function for a viewer to re-do the events + * requests for the needed interval. + * + * @param tab viewer's tab + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + */ + +void lttvwindow_unregister_continue_notify(Tab *tab, + LttvHook hook, gpointer hook_data); + + /** * Function to register a hook function for a viewer to set/update its * filter. diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am index fbaef594..eb375f40 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am @@ -21,4 +21,7 @@ EXTRA_DIST = \ remove1.png\ stock_zoom_fit_24.png\ stock_zoom_in_24.png\ - stock_zoom_out_24.png + stock_zoom_out_24.png\ + stock_stop_24.png\ + stock_redo_24.png\ + stock_refresh_24.png diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png new file mode 100644 index 0000000000000000000000000000000000000000..9a5ef57359676772d4e1549ce22d234ded16689d GIT binary patch literal 756 zcmV3p)#vCLsU-0&z)1K~#9!wU$k26G0e;pWP&;i49fSrrIL(617@e1W~+sDxTDn zN5O+Ac#w*q1)(TH57r-Sp;*0mQNc>Rd6A-csG=0H)=um9aDs z0O|y!yFv6SqxMSFbpS)7*8mbg5b(>qBSc?8+yit0rbPVlU zLHsZ+xtJ9Jk|@)2Bd&2kOK#gda%e*u<|4p=UB>T$`-_C zIy!csX&Mu6?-5UYb@cMf%sdZnP6KQeTbG@K*I|tZc+`LW zG>zc^PhJd=F_Mnr(Wy9(M?L~{%l*jP{dWQ=|A}mmF#Y*C86#-@SS`C$XT_MuoSn7CAu1$d_V|jvE}rz^y_85DsiVQvLu&H5or-YYc-a*0T3|-^V-IW mm2$0r74}c1UXlb=@8U16jOFisOTWPY0000<@73$o z^Q%96&N#ZQXzhiU!+GELe8120KF{-g4*c`*fCvx*6jymDA@G0|K-SeHQGf|}6W+K_ zQg|gKdeQr80doNhp!a+a)7}(749Eq-mmpDrdC`VHHs|Cm`{>!~ayFEfQCzfU{(zc4 zQe0F*o{#?D+85aL@RJLHQE07DT4O2`r4?sJdU$Nz z6G%*wl3`OH9;xBj@#E}ybss?$qG}x<0*jMz%n3Y0+igamQw>A%p_+R>>lEqnx+epe`Rk4 zz3u%pyxZi1PXc2=99SyBv;nlCxo%aF|7kWbsR354TuoXF1*0 z1JEKEo(7HreAjZAoek9hzlx}tLXxg+d7pypDDJF-W4RcXiRp$g-4G!!MCaL4bf4+w zkFG)54jlv7E5_NrYCZxqKJ(_&qz4`56r5Zqb+s7~AS~f~+@WAyvJkP~-U0lZ_ zHJ)N$)#m_T0Xsw-6TSjw0rvvUa!uPsz(%D~bAfop2U~D08_Tls6d1}NnMg4ao1k&m zVITYriQ^cMR)JVV1SnV5CS}fv-sA$Ytu@c%%-QU!tX-_k+khj144ejR9SCejHvR&J z1K_SalR&ijvlf(bp^e-lbx;a4iN|9;IG1T0i+gf#FYJ3FYqtdeEiuHB47%c0nk5O~ zi7e+!qUe9?X#a&I?5m|HX?l^j|BE2_Q((wl+m}1|H*dv=qkGuM&j0`b07*qoM6N<$ Eg1s39-v9sr literal 0 HcmV?d00001 diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png new file mode 100644 index 0000000000000000000000000000000000000000..89c212493e4c6b7f4a3621b4722e9b8b887bb7c2 GIT binary patch literal 1379 zcmV-p1)TbcP)vdGml&%H!h?@2Owfe#af?;xPLBDSQo{2BknLg$Rf!9D)Mc+k{oVS#$ zpcM=S&~-}(@kd_dT(WgSqVH+(X-lbhBA{pwr~x`&Y;S(@_64^Pc72bh6`q3rg`KQ> zeJjg5){<&!;kScdVnlJ~&SzM@eiKVqt)aQDmO@`I<&g{6C|wBtPb0PqI39}vYG@1h)4tgp+2T) z@M#+f@id^C;$Drj7UKkC1!EyF!pvI5f}cO&^EWnK!O-*jwv#!uhr+;VM!JtqKvc;( z>U|vpRBW`cI0wc8I0TI+3eSP^6kalQWi6>|BHMd{Qsz9)O@!=l;0Rrn%rQVRWm^dy z3FD$Xio+A=$_vR=FL2jW8?Ok^yka%PQyhKkdCC_Cu@0;goCvu<$Qubqd0=vet~2NQ z2pnVVJax$;w?9h9ORq6y%9OF35A5CccaS9y(e}hfVvVhs2ppM;qwFAS=mBgjqV$$y zmE`VaRuHYQ0vF0cV{-DCv;Hr((YJdmVLp#>!iqDbiX&YTfLDP) zMP;Jy+Jx%;ptHRp>_3H8pcV9nNp4!bo>t#-@$doiXS?v5TCpfvmail}bvoU<-zO}W z$PEsVE?NdFjvZ%$++e`z)FR17?)u8mRRZ+h1Fddi=H#m(P4JVqQT*3;~ zM|4%Ov93BcB6MdBr*aMp>`I3}mK~iyA(GSyGADoygk1-R!kI2NJpVc`Kq7Rw(I6ri zfwKk6@euu?EPGI{zoh^rA|5cXJIp?!Ts{u`Q)&_7z1dq)QHkqGE;N zQ26$u85s(A8aNP1ru{z+fCl0~1Mo0#IH4)F#FcA_E0@refFr=lXiXy8^Pi%BwYDV| liAU_Rw#7soGXK`L{008Ut+%NB!kPd8002ovPDHLkV1fvjh8_R_ literal 0 HcmV?d00001 -- 2.34.1