2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 // ParameterWindowManager.h
35 // Manages all the ParameterWindows and control panels.
36 // Will not let you open multiple windows referring to
37 // the same node, and takes care of quitting them all
41 // c.lenz 17feb2000 Begun
44 #ifndef __ParameterWindowManager_H__
45 #define __ParameterWindowManager_H__
53 #include "cortex_defs.h"
54 __BEGIN_CORTEX_NAMESPACE
58 class ParameterWindowManager
:
61 public: // *** constants
63 // the screen position where the first window should
65 static const BPoint M_INIT_POSITION
;
67 // horizontal/vertical offset by which subsequent
68 // parameter windows positions are shifted
69 static const BPoint M_DEFAULT_OFFSET
;
71 private: // *** ctor/dtor
73 // hidden ctor; is called only from inside Instance()
74 ParameterWindowManager();
78 // quits all registered parameter windows and control
80 virtual ~ParameterWindowManager();
82 public: // *** singleton access
84 // access to the one and only instance of this class
85 static ParameterWindowManager
*Instance();
87 // will delete the singleton instance and take down all
89 static void shutDown();
91 public: // *** operations
93 // request a ParameterWindow to be openened for the given
94 // NodeRef; registeres the window
95 status_t
openWindowFor(
98 // request to call StartControlPanel() for the given
99 // NodeRef; registeres the panels messenger
100 status_t
startControlPanelFor(
103 public: // *** BLooper impl
105 virtual void MessageReceived(
108 private: // *** internal operations
110 // ParameterWindow management
116 BWindow
**outWindow
);
117 void _removeWindowFor(
120 // ControlPanel management
123 const BMessenger
&messenger
);
126 BMessenger
*outMessenger
);
127 void _removePanelFor(
130 private: // *** data members
132 // a list of window_map_entry objects, ie parameter windows
133 // identified by the node_id
136 // a list of window_map_entry objects, this time for
137 // node control panels
140 // the BPoint at which the last InfoWindow was initially
142 BPoint m_lastWindowPosition
;
144 private: // *** static members
146 // the magic singleton instance
147 static ParameterWindowManager
*s_instance
;
150 __END_CORTEX_NAMESPACE
151 #endif /*__ParameterWindowManager_H__*/