1 /*=========================================================================
3 Module: $RCSfile: bbtkKW.h,v $
5 Date: $Date: 2008/11/29 21:41:33 $
6 Version: $Revision: 1.1 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
31 #ifndef __bbtkKW_h_INCLUDED__
32 #define __bbtkKW_h_INCLUDED__
34 //===========================================================================
39 //#include <vtkKWWidget.h>
40 //#include <vtkKWWindowBase.h>
44 //===========================================================================
46 //===========================================================================
47 #include "bbtkSystem.h"
48 #include "vtkKWApplication.h"
49 //===========================================================================
51 //===========================================================================
52 // SIGNAL/SLOT MECHANISM
53 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION
55 #include <boost/signal.hpp>
56 #include <boost/bind.hpp>
58 //===========================================================================
63 //==================================================================
64 /// Global KWWidgets handlers (application, cursor...)
67 #define bbtkAddKWSignalObserver(METHOD) \
68 KW::AddSignalObserver(boost::bind(&METHOD, this))
71 #define BBTK_KW_BUSY_CURSOR bbtk::KW::BusyCursor __bbtk_dummy_busy_cursor;
77 typedef boost::signals::trackable SignalObserver;
78 typedef boost::signal<void ()> Signal_type;
79 typedef Signal_type::slot_function_type Slot_function_type;
82 static vtkKWApplication* GetApplication();
85 static void ResetCursor();
86 static void BeginBusyCursor();
87 static void EndBusyCursor();
90 // static void LoopUntilAllWindowsClose();
97 // wxBusyCursor* mCursor;
100 // static void SetTopWindowParent(vtkKWWidget*);
101 static void SetAutoDestroyTopWindow(bool);
103 /// Returns the creation time parent of all bbtk windows
104 /// (window can be reparented after creation)
105 // static vtkKWWindowBase* GetTopWindow();
106 // static bool TopWindowExists();
108 static void IncNbWindowsAlive();
109 static void DecNbWindowsAlive();
110 static int GetNbWindowsAlive();
111 static bool IsSomeWindowAlive();
113 static void IncNbWindowsShown();
114 static void DecNbWindowsShown();
115 static int GetNbWindowsShown();
116 static bool IsSomeWindowShown();
119 static void AddSignalObserver(Slot_function_type);
124 static void CreateKWAppIfNeeded();
125 static void DestroyKWAppIfNeeded();
127 // static void CreateTopWindowIfNeeded();
128 // static void DestroyTopWindowIfNeeded();
130 /// Sets the creation time parent of all bbtk windows
131 // static void SetTopWindow(vtkKWWindowBase*);
135 //==================================================================
142 #endif // EO USE_KWWIDGETS
143 #endif // EO __bbtkKW_h_INCLUDED__