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
31
#include <Xm/PrimitiveP.h>
32
#include <Xm/ScrollBar.h>
33
#include <Xm/ScrolledW.h>
37
/* LessTif definitions that are convenient for Motif */
38
#ifndef Prim_HighlightThickness
39
#define Prim_HighlightThickness(w) \
40
(((XmPrimitiveWidget)(w))->primitive.highlight_thickness)
43
#ifndef Prim_ShadowThickness
44
#define Prim_ShadowThickness(w) \
45
(((XmPrimitiveWidget)(w))->primitive.shadow_thickness)
48
#ifndef Prim_TopShadowGC
49
#define Prim_TopShadowGC(w) \
50
(((XmPrimitiveWidget)(w))->primitive.top_shadow_GC)
53
#ifndef Prim_BottomShadowGC
54
#define Prim_BottomShadowGC(w) \
55
(((XmPrimitiveWidget)(w))->primitive.bottom_shadow_GC)
59
#define ListTreeRET_ALLOC 10
62
#define TIMER_SINGLE 1
63
#define TIMER_DOUBLE 2
64
#define TIMER_WAITING 3
67
** DND support and debugging
74
int dummy; /* keep compiler happy with dummy field */
77
typedef struct _ListTreeClassRec {
78
CoreClassPart core_class;
79
XmPrimitiveClassPart primitive_class;
80
ListTreeClassPart ListTree_class;
83
extern ListTreeClassRec listtreeClassRec;
93
ListTreeWidget list_tree;
98
/* Public stuff ... */
99
long foreground_pixel;
104
/* Dimension LabelSpacing; */
112
Boolean HighlightPath;
113
Boolean ClickPixmapToOpen;
114
Boolean DoIncrementalHighlightCallback;
116
XtCallbackList HighlightCallback;
117
XtCallbackList ActivateCallback;
118
XtCallbackList MenuCallback;
119
XtCallbackList DestroyItemCallback;
120
XtCallbackList CreateItemCallback;
124
/* Private stuff ... */
129
Pixinfo ItemPix; /* temporary storage for GetItemPix */
130
int exposeTop, exposeBot;
132
int preferredWidth, preferredHeight;
133
ListTreeItem *first, /* always points to a top level entry */
134
*highlighted, *drop_highlighted;
136
XtIntervalId timer_id; /* timer for double click test */
137
ListTreeItem *timer_item; /* item to make sure both clicks */
138
/* occurred on the same item */
139
int timer_type; /* flag for type of click that just happened */
142
int multi_click_time;
144
ListTreeItem **ret_item_list;
150
/* New stuff for maintaining its own scrolling state */
151
Widget mom; /* scrolled window */
152
Widget hsb; /* horizontal scrollbar */
153
Widget vsb; /* vertical scrollbar */
157
Dimension viewHeight;
163
int topItemPos; /* position of topItem in itemCount */
164
int bottomItemPos; /* last position drawn in window */
165
int lastItemPos; /* last value of topItempos */
166
ListTreeItem *topItem; /* first visible item on screen */
167
int itemCount; /* total number of open ListTreeItems */
168
Dimension itemHeight;
169
Dimension maxPixHeight;
170
int visibleCount; /* number currently visible on screen */
175
typedef struct _ListTreeRec {
177
XmPrimitivePart primitive;
182
#endif /* _ListTreeP_H */