2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkKW.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.2 $
34 =========================================================================*/
38 #ifndef __bbtkKW_h_INCLUDED__
39 #define __bbtkKW_h_INCLUDED__
41 //===========================================================================
46 //#include <vtkKWWidget.h>
47 //#include <vtkKWWindowBase.h>
51 //===========================================================================
53 //===========================================================================
54 #include "bbtkSystem.h"
55 #include "vtkKWApplication.h"
56 //===========================================================================
58 //===========================================================================
59 // SIGNAL/SLOT MECHANISM
60 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION
62 #include <boost/signals2/signal.hpp>
63 #include <boost/bind.hpp>
65 //===========================================================================
70 //==================================================================
71 /// Global KWWidgets handlers (application, cursor...)
74 #define bbtkAddKWSignalObserver(METHOD) \
75 KW::AddSignalObserver(boost::bind(&METHOD, this))
78 #define BBTK_KW_BUSY_CURSOR bbtk::KW::BusyCursor __bbtk_dummy_busy_cursor;
84 typedef boost::signals2::signals::trackable SignalObserver;
85 typedef boost::signals2::signal<void ()> Signal_type;
86 typedef Signal_type::slot_function_type Slot_function_type;
89 static vtkKWApplication* GetApplication();
92 static void ResetCursor();
93 static void BeginBusyCursor();
94 static void EndBusyCursor();
97 // static void LoopUntilAllWindowsClose();
104 // wxBusyCursor* mCursor;
107 // static void SetTopWindowParent(vtkKWWidget*);
108 static void SetAutoDestroyTopWindow(bool);
110 /// Returns the creation time parent of all bbtk windows
111 /// (window can be reparented after creation)
112 // static vtkKWWindowBase* GetTopWindow();
113 // static bool TopWindowExists();
115 static void IncNbWindowsAlive();
116 static void DecNbWindowsAlive();
117 static int GetNbWindowsAlive();
118 static bool IsSomeWindowAlive();
120 static void IncNbWindowsShown();
121 static void DecNbWindowsShown();
122 static int GetNbWindowsShown();
123 static bool IsSomeWindowShown();
126 static void AddSignalObserver(Slot_function_type);
131 static void CreateKWAppIfNeeded();
132 static void DestroyKWAppIfNeeded();
134 // static void CreateTopWindowIfNeeded();
135 // static void DestroyTopWindowIfNeeded();
137 /// Sets the creation time parent of all bbtk windows
138 // static void SetTopWindow(vtkKWWindowBase*);
142 //==================================================================
149 #endif // EO USE_KWWIDGETS
150 #endif // EO __bbtkKW_h_INCLUDED__