Reset parser in grace_set_project().
[grace.git] / src / ListTreeP.h
blobfb4990de9e1ec1b2c3c3614398486101847c5dec
1 /*-----------------------------------------------------------------------------
2 * ListTree A list widget that displays a file manager style tree
4 * Copyright (c) 1996 Robert W. McMullen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Author: Rob McMullen <rwmcm@mail.ae.utexas.edu>
22 * http://www.ae.utexas.edu/~rwmcm
25 #ifndef _ListTreeP_H
26 #define _ListTreeP_H
28 #include <Xm/Xm.h>
29 #include <Xm/XmP.h>
30 #include <Xm/DrawP.h>
31 #include <Xm/PrimitiveP.h>
32 #include <Xm/ScrollBar.h>
33 #include <Xm/ScrolledW.h>
34 #include <Xm/DragDrop.h>
36 #include "ListTree.h"
38 /* LessTif definitions that are convenient for Motif */
39 #ifndef Prim_HighlightThickness
40 #define Prim_HighlightThickness(w) \
41 (((XmPrimitiveWidget)(w))->primitive.highlight_thickness)
42 #endif
44 #ifndef Prim_ShadowThickness
45 #define Prim_ShadowThickness(w) \
46 (((XmPrimitiveWidget)(w))->primitive.shadow_thickness)
47 #endif
49 #ifndef Prim_TopShadowGC
50 #define Prim_TopShadowGC(w) \
51 (((XmPrimitiveWidget)(w))->primitive.top_shadow_GC)
52 #endif
54 #ifndef Prim_BottomShadowGC
55 #define Prim_BottomShadowGC(w) \
56 (((XmPrimitiveWidget)(w))->primitive.bottom_shadow_GC)
57 #endif
60 #define ListTreeRET_ALLOC 10
62 #define TIMER_CLEAR 0
63 #define TIMER_SINGLE 1
64 #define TIMER_DOUBLE 2
65 #define TIMER_WAITING 3
67 typedef struct {
68 int dummy; /* keep compiler happy with dummy field */
69 } ListTreeClassPart;
71 typedef struct _ListTreeClassRec {
72 CoreClassPart core_class;
73 XmPrimitiveClassPart primitive_class;
74 ListTreeClassPart ListTree_class;
75 } ListTreeClassRec;
77 extern ListTreeClassRec listtreeClassRec;
79 typedef struct {
80 Pixmap bitmap;
81 Pixmap pix;
82 int width, height;
83 int xoff;
84 } Pixinfo;
86 typedef struct {
87 /* Public stuff ... */
88 long foreground_pixel;
89 XFontStruct *font;
90 int NumItems;
91 Dimension HSpacing;
92 Dimension VSpacing;
93 /* Dimension LabelSpacing; */
94 Dimension Margin;
95 Dimension Indent;
96 Pixinfo Open;
97 Pixinfo Closed;
98 Pixinfo Leaf;
99 Pixinfo LeafOpen;
100 Dimension LineWidth;
101 Boolean HighlightPath;
102 Boolean ClickPixmapToOpen;
103 Boolean DoIncrementalHighlightCallback;
105 XtCallbackList HighlightCallback;
106 XtCallbackList ActivateCallback;
107 XtCallbackList MenuCallback;
108 XtCallbackList DestroyItemCallback;
109 XtCallbackList DropCallback;
111 /* Private stuff ... */
112 GC drawGC;
113 GC eraseGC;
114 GC eorGC;
115 GC highlightGC;
116 Pixinfo ItemPix; /* temporary storage for GetItemPix */
117 int exposeTop, exposeBot;
118 int pixWidth;
119 int preferredWidth, preferredHeight;
120 ListTreeItem *first, /* always points to a top level entry */
121 *highlighted, *drop_highlighted;
123 XtIntervalId timer_id; /* timer for double click test */
124 ListTreeItem *timer_item; /* item to make sure both clicks */
125 /* occurred on the same item */
126 int timer_type; /* flag for type of click that just happened */
127 int timer_y;
128 int timer_x;
129 int multi_click_time;
131 ListTreeItem **ret_item_list;
132 int ret_item_alloc;
134 Boolean Refresh;
135 Boolean HasFocus;
137 /* New stuff for maintaining its own scrolling state */
138 Widget mom; /* scrolled window */
139 Widget hsb; /* horizontal scrollbar */
140 Widget vsb; /* vertical scrollbar */
141 Dimension viewX;
142 Dimension viewY;
143 Dimension viewWidth;
144 Dimension viewHeight;
145 int XOffset;
146 int hsbPos;
147 int hsbMax;
149 int lastXOffset;
150 int topItemPos; /* position of topItem in itemCount */
151 int bottomItemPos; /* last position drawn in window */
152 int lastItemPos; /* last value of topItempos */
153 ListTreeItem *topItem; /* first visible item on screen */
154 int itemCount; /* total number of open ListTreeItems */
155 Dimension itemHeight;
156 Dimension maxPixHeight;
157 int visibleCount; /* number currently visible on screen */
158 Boolean recount;
160 } ListTreePart;
162 typedef struct _ListTreeRec {
163 CorePart core;
164 XmPrimitivePart primitive;
165 ListTreePart list;
166 } ListTreeRec;
169 #endif /* _ListTreeP_H */