1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 
14 #ifndef _SequencerWindow_h
15 #define _SequencerWindow_h
16 
17 
18 #include "DXWindow.h"
19 #include "SequencerNode.h"
20 
21 //
22 // Class name definition:
23 //
24 #define ClassSequencerWindow	"SequencerWindow"
25 
26 //
27 // XtCallbackProc (*CB), XtEventHandler (*EH) and XtActionProc (*AP)
28 // DialogCallback (*DCB), XtInputCallbackProc (*ICP), XtWorkProc (*WP)
29 // functions for this and derived classes
30 //
31 extern "C" void SequencerWindow_VcrCB(Widget, XtPointer, XtPointer);
32 extern "C" void SequencerWindow_FrameCB(Widget, XtPointer, XtPointer);
33 extern "C" void SequencerWindow_PopdownCB(Widget, XtPointer, XtPointer);
34 
35 //
36 // SequencerWindow class definition:
37 //
38 
39 class SequencerWindow : public DXWindow
40 {
41   friend class SequencerNode;
42 
43   private:
44     //
45     // Private member data:
46     //
47     static Boolean ClassInitialized;
48     static String  DefaultResources[];
49 
50     Widget vcr;
51     SequencerNode* node;
52     boolean handlingStateChange;
53 
54   protected:
55     //
56     // Protected member data:
57     //
58     Widget createWorkArea(Widget);
59 
60     friend void SequencerWindow_PopdownCB(Widget, XtPointer , XtPointer);
61     friend void SequencerWindow_FrameCB(Widget, XtPointer , XtPointer);
62     friend void SequencerWindow_VcrCB(Widget, XtPointer , XtPointer);
63     void frameCallback(XtPointer callData);
64 
65 
66     //
67     // En/Disable the Frame control.
68     //
69     void disableFrameControl();
70     void enableFrameControl();
71 
72     virtual void handleStateChange(boolean unmanage = FALSE);
73 
74     //
75     // Dis/enable frame control and then call the super class method.
76     //
77     virtual void beginExecution();
78     virtual void standBy();
79     virtual void endExecution();
80 
81     //
82     // Install the default resources for this class and then call the
83     // same super class method to get the default resources from the
84     // super classes.
85     //
86     virtual void installDefaultResources(Widget baseWidget);
87 
88   public:
89 
90     //
91     // Constructor:
92     //
93     SequencerWindow(SequencerNode* node);
94 
95     //
96     // Destructor:
97     //
98     ~SequencerWindow();
99 
100     void    	mapRaise();
101     void 	reset();
102 
103     //
104     // In the local copies of these methods we'll set the startup mode in
105     // the SequencerNode so that the user can control the display of the Sequencer.
106     // Other windows provide a menubar button which controls startup mode.  Since
107     // we have no menubar we'll cheat.
108     //
109     virtual void manage();
110     virtual void unmanage();
111     virtual void setStartup(boolean set = TRUE);
112 
113 
114     //
115     // Set the buttons that indicate which way the sequencer is playing.
116     //
117     void setPlayDirection(SequencerDirection dir);
118 
119     //
120     // Returns a pointer to the class name.
121     //
getClassName()122     const char* getClassName()
123     {
124 	return ClassSequencerWindow;
125     }
126 };
127 
128 
129 #endif // _SequencerWindow_h
130