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 
11 
12 #ifndef _PageTab_h
13 #define _PageTab_h
14 
15 #include "NotebookTab.h"
16 #include "DragSource.h"
17 #include "DXDropSite.h"
18 
19 class WorkSpace;
20 class PageGroupRecord;
21 class PageSelector;
22 class Network;
23 class EditorWindow;
24 
25 extern "C" void PageTab_ColorTimerTO (XtPointer clientData, XtIntervalId* );
26 
27 #define ClassPageTab "PageTab"
28 
29 class PageTab: public NotebookTab, public DXDropSite, public DragSource {
30   private:
31 
32     WorkSpace* 		workSpace;
33     PageGroupRecord*	group_rec;
34     char*		group_name;
35     boolean		set;
36     int			position;
37     int			desired_position;
38     boolean		has_desired_position;
39     XtIntervalId	color_timer;
40     PageSelector*	selector;
41     Pixel		pending_fg;
42 
43     static String	DefaultResources[];
44     static boolean	ClassInitialized;
45     static Pixmap	TopShadowPixmap;
46     static Pixmap	BottomShadowPixmap;
47     static Pixmap	AnimationPixmap;
48     static Pixmap	AnimationMaskPixmap;
49     static boolean 	BrokenServer;
50 
51     //
52     // data type dictionary for drops.
53     //
54     static Dictionary *DropTypeDictionary;
55     static Dictionary *DragTypeDictionary;
56 
57     //
58     // Supply the type dictionary which stores the types we can supply for a dnd
59     //
getDropDictionary()60     virtual Dictionary *getDropDictionary() { return PageTab::DropTypeDictionary; }
getDragDictionary()61     virtual Dictionary *getDragDictionary() { return PageTab::DragTypeDictionary; }
62 
63   protected:
64 
65     friend  void PageTab_ColorTimerTO (XtPointer clientData, XtIntervalId* );
66 
67     static Widget 	DragIcon;
68     // Define constants for the dnd data types we understand
69     enum {
70         PageTrash,
71         PageName,
72         Modules
73     };
74 
75 
76     //
77     // Drag - n - Drop
78     //
79     virtual boolean decodeDropType (int , char *, XtPointer , unsigned long , int , int );
80     virtual boolean decodeDragType (int, char *, XtPointer*, unsigned long*, long);
81 
82     virtual boolean mergeNetElements (Network*, List*, int, int);
83 
84     virtual void activate();
85     virtual void multiClick();
86 
87   public:
88 
89     PageTab (PageSelector*, WorkSpace* ws, const char* button_text);
90     ~PageTab();
91 
92     //
93     // In order to {un}setDropWidget
94     //
95     virtual void manage();
96     virtual void unmanage();
97 
98     virtual void 	createButton(Widget );
99     void 	createButton(Widget, PageGroupRecord*);
100 
101     void setState(boolean set=TRUE);
getWorkSpace()102     WorkSpace* getWorkSpace() { return this->workSpace; }
getGroupName()103     const char* getGroupName() { return this->group_name; }
104     void setGroup(PageGroupRecord* rec);
105     void setPosition(int, boolean designated_by_user=FALSE);
106     int  getPosition();
107     void setColor(Pixel);
108     int getDesiredPosition();
hasDesiredPosition()109     boolean hasDesiredPosition() { return this->has_desired_position; }
110     boolean getDesiredShowing();
getClassName()111     const char* getClassName() { return ClassPageTab; }
112 
113 };
114 
115 #endif // _PageTab_h
116