Initial Commit
[packages] / xemacs-packages / oo-browser / tree-x / intf.h
1 /* ----------------------------------------------------------------------------
2  * File    : intf.h
3  * Purpose : include file for intf.c and draw.c
4  * ----------------------------------------------------------------------------
5  */
6
7 #include <X11/Intrinsic.h>
8 #include <X11/StringDefs.h>
9 #define DEFAULT_FONT    "-adobe-helvetica-bold-r-normal--12-*"
10 #define BIG_FONT        "-adobe-helvetica-bold-r-normal--12-*"
11
12 #define X11_APPLICATION_CLASS    "Tree"
13 #define X11_DEFAULT_FONT         "fixed"
14 #define X11_FONT_RESOURCE        "tree.font"
15 #define X11_FONT_CLASS_RESOURCE  "Tree.Font"
16
17 #define HELP_FILE                 "tree.help"
18
19 #define LABEL_MAT_WIDTH           3
20 #define LABEL_MAT_HEIGHT          3
21 #define BORDER_SIZE               4      /* beginning border size     */
22 #define MAX_BORDER_SIZE           25
23 #define PARENT_DISTANCE           30     /* beginning parent distance */
24 #define MAX_PARENT_DISTANCE       50
25 #define DENSITY_FACTOR            1.50
26 #define MAT_SIZE                  BORDER_SIZE * 2
27 #define ELISION_WIDTH             5
28 #define ANIMATION_STEP            3
29 #define ANIMATION_STEP_STEP       4
30
31 #define BACKGROUND_COLOR          0
32 #define TREE_COLOR                1
33 #define CONTOUR_COLOR             2
34 #define HIGHLIGHT_COLOR           3
35 #define SPLIT_COLOR               4
36 #define ACTION_COLOR              5
37 #define NUM_COLORS                6
38
39 #define TREE_MENU_NEW             0
40 #define TREE_MENU_LOAD            1
41 #define TREE_MENU_SAVE            2
42 #define TREE_MENU_SEP1            3
43 #define TREE_MENU_QUIT            4
44 #define TREE_MENU_STATS           6
45 #define TREE_MENU_ITEMS           5
46
47 #define TREE_MENU_SEP2            5
48
49 #if 0
50   #define LAYOUT_MENU_FIXED         0 /* not used at this time */
51   #define LAYOUT_MENU_VARIABLE      1
52   #define LAYOUT_MENU_SEP1          2
53
54   #define LAYOUT_MENU_SPACING       3
55   #define LAYOUT_MENU_SEP2          4
56   #define LAYOUT_MENU_ALIGN_NODES   5
57   #define LAYOUT_MENU_ITEMS         5
58 #endif
59
60 #define NODE_MENU_LABEL           0
61 #define NODE_MENU_SEP1            1
62 #if 0
63   #define NODE_MENU_ADD_CHILD       2
64   #define NODE_MENU_ADD_BEFORE      3
65   #define NODE_MENU_ADD_AFTER       4
66   #define NODE_MENU_ELISION         5
67   #define NODE_MENU_DELETE          6
68   #define NODE_MENU_ITEMS           7
69 #else
70   #define NODE_MENU_ELISION         2
71   #define NODE_MENU_DELETE          3
72   #define NODE_MENU_ITEMS           4
73 #endif
74
75 #define TREE_MENU                 0
76 #define LAYOUT_MENU               1
77 #define NODE_MENU                 2
78 #define NUM_MENUS                 3
79
80 #define STR_SHOW_STATS            0
81 #define STR_HIDE_STATS            1
82 #define STR_NODE_COLLAPSE         2
83 #define STR_NODE_EXPAND           3
84 #define STR_SHOW_CONTOUR          4
85 #define STR_HIDE_CONTOUR          5
86 #define STR_LOAD_FILE             6
87 #define STR_SAVE_FILE             7
88 #define NUM_MENU_STRS             8
89
90 #define DLG_NEW                   0
91 #define DLG_NODE_NAME             1
92 #define DLG_FILE                  2
93 #define DLG_INFO                  3
94 #define DLG_ERROR                 4
95 #define DLG_SPACING               5
96 #define NUM_DLG                   6
97
98 /* in 1/10ths of a second */
99 #define ANIMATION_SPEED_FAST       1
100
101 typedef enum {
102    NoContours,
103    OutsideContour,
104    AllContours,
105    SelectedContours
106 } ContourOption;
107
108 typedef enum {
109    Child,
110    Before,
111    After
112 } NodePosition;
113
114 typedef enum {
115    Fixed,
116    Variable
117 } DensityOption;
118
119 extern  Widget        TreeTopLevel;
120 extern  Widget        TreeDrawingArea;
121 extern  Display      *TreeDisplay;
122 extern  int           TreeScreen;
123 extern  int           TreeContourWidth;
124 extern  int           TreeBorderSize;
125 extern  int           TreeParentDistance;
126 extern  XFontStruct  *TreeLabelFont;
127 extern  DoubleBuffer *TreeDrawingAreaDB;
128 extern  char          TreeShowSteps;
129 extern  ContourOption TreeShowContourOption;
130 extern  DensityOption TreeLayoutDensity;
131 extern  char          TreeAlignNodes;
132 extern  char          PauseAfterStep;
133
134 void    Pause(void);
135 void    StatusMsg(char *msg, int urgent);
136 void    InsertNode(Tree *base_node, NodePosition node_pos, char *new_node_text);
137 void    SetNodeLabel(Tree *node, char *label);
138 void    SetDrawColor(int color);
139 void    ExpandCollapseNode(Tree *node);
140 void    SetDrawingTree(Tree *tree);
141 void    ExposeHandler(Widget, XtPointer, XEvent*, Boolean*);