BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / cortex / RouteApp / RouteWindow.h
blobdfbaa5ecefec09351461dc8da27c999b1b326680
1 /*
2 * Copyright (c) 1999-2000, Eric Moon.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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 // RouteWindow.h
33 // e.moon 14may99
35 // PURPOSE
36 // Window class containing a MediaRoutingView for
37 // inspection & manipulation of Media Kit nodes.
39 // HISTORY
40 // 14may99 e.moon Created from routeApp.cpp
41 // 21may00 c.lenz added StatusView to the window
43 #ifndef __ROUTEWINDOW_H__
44 #define __ROUTEWINDOW_H__
46 #include <list>
48 #include <Node.h>
49 #include <ScrollBar.h>
50 #include <Window.h>
52 #include "IStateArchivable.h"
54 #include "cortex_defs.h"
56 class BMenu;
58 __BEGIN_CORTEX_NAMESPACE
60 class MediaRoutingView;
61 class StatusView;
62 class RouteAppNodeManager;
63 class DormantNodeWindow;
64 class TransportWindow;
66 class RouteWindow :
67 public BWindow,
68 public IStateArchivable {
70 typedef BWindow _inherited;
72 public: // messages
73 enum message_t {
74 M_TOGGLE_TRANSPORT_WINDOW =RouteWindow_message_base,
76 // nodeID: int32
77 M_SHOW_NODE_INSPECTOR,
79 // groupID: int32
80 M_REFRESH_TRANSPORT_SETTINGS,
82 // [e.moon 17nov99]
83 M_TOGGLE_PULLING_PALETTES,
85 // [e.moon 29nov99]
86 M_TOGGLE_DORMANT_NODE_WINDOW,
88 // [e.moon 1dec99]
89 M_TOGGLE_GROUP_ROLLING
92 public: // ctor/dtor
93 virtual ~RouteWindow();
94 RouteWindow(
95 RouteAppNodeManager* manager);
97 public: // palette-window operations
99 // enable/disable palette position-locking (when the main
100 // window is moved, all palettes follow)
101 bool isPullPalettes() const;
102 void setPullPalettes(
103 bool enabled);
105 // [e.moon 2dec99] force window & palettes on-screen
106 void constrainToScreen();
108 public: // BWindow impl
110 // [e.moon 17nov99] 'palette-pulling' impl
111 virtual void FrameMoved(
112 BPoint point);
114 // [c.lenz 1mar2000] added for better Zoom() support
115 virtual void FrameResized(
116 float width,
117 float height);
119 bool QuitRequested();
121 // [c.lenz 1mar2000] resize to MediaRoutingView's preferred size
122 virtual void Zoom(
123 BPoint origin,
124 float width,
125 float height);
127 public: // BHandler impl
128 void MessageReceived(
129 BMessage* message);
131 public: // *** IStateArchivable
133 status_t importState(
134 const BMessage* archive);
136 status_t exportState(
137 BMessage* archive) const;
139 private: // implementation
140 friend class RouteApp;
142 // resizes the window to fit in the current screen rect
143 void _constrainToScreen();
145 void _toggleTransportWindow();
147 void _handleGroupSelected(
148 BMessage* message);
150 // [c.lenz 21may00]
151 void _handleShowErrorMessage(
152 BMessage* message);
154 // [e.moon 17nov99]
155 void _togglePullPalettes();
157 void _toggleDormantNodeWindow();
159 // refresh the transport window for the given group, if any
160 void _refreshTransportSettings(
161 BMessage* message);
163 void _closePalettes();
165 // [e.moon 17nov99] move all palette windows by the
166 // specified amounts
167 void _movePalettesBy(
168 float xDelta,
169 float yDelta);
171 // [e.moon 1dec99] toggle group playback
172 void _toggleGroupRolling();
174 private: // members
175 MediaRoutingView* m_routingView;
176 BScrollBar* m_hScrollBar;
177 BScrollBar* m_vScrollBar;
179 StatusView* m_statusView;
181 BMenuItem* m_transportWindowItem;
182 BRect m_transportWindowFrame;
183 TransportWindow* m_transportWindow;
184 // list<InspectorWindow*> m_nodeInspectorWindows;
186 BMenuItem* m_dormantNodeWindowItem;
187 BRect m_dormantNodeWindowFrame;
188 DormantNodeWindow* m_dormantNodeWindow;
190 // BPoint m_nodeInspectorBasePosition;
192 // all items in this menu control the routing view
193 BMenu* m_viewMenu;
195 // cached window position [e.moon 17nov99]
196 BMenuItem* m_pullPalettesItem;
197 BPoint m_lastFramePosition;
199 // ID of currently selected group [e.moon 1dec99]
200 uint32 m_selectedGroupID;
202 BRect m_manualSize;
204 // true if window was zoomed to MediaRoutingView's preferred size
205 // [c.lenz 1mar2000]
206 bool m_zoomed;
208 // true if a resize operation resulted from a call to Zoom()
209 // [c.lenz 1mar2000]
210 bool m_zooming;
213 private: // constants
214 static const BRect s_initFrame;
215 static const char* const s_windowName;
218 __END_CORTEX_NAMESPACE
219 #endif /* __ROUTEWINDOW_H__ */