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>
34 #include <Xm/DragDrop.h>
38 /* LessTif definitions that are convenient for Motif */
39 #ifndef Prim_HighlightThickness
40 #define Prim_HighlightThickness(w) \
41 (((XmPrimitiveWidget)(w))->primitive.highlight_thickness)
44 #ifndef Prim_ShadowThickness
45 #define Prim_ShadowThickness(w) \
46 (((XmPrimitiveWidget)(w))->primitive.shadow_thickness)
49 #ifndef Prim_TopShadowGC
50 #define Prim_TopShadowGC(w) \
51 (((XmPrimitiveWidget)(w))->primitive.top_shadow_GC)
54 #ifndef Prim_BottomShadowGC
55 #define Prim_BottomShadowGC(w) \
56 (((XmPrimitiveWidget)(w))->primitive.bottom_shadow_GC)
60 #define ListTreeRET_ALLOC 10
63 #define TIMER_SINGLE 1
64 #define TIMER_DOUBLE 2
65 #define TIMER_WAITING 3
68 int dummy
; /* keep compiler happy with dummy field */
71 typedef struct _ListTreeClassRec
{
72 CoreClassPart core_class
;
73 XmPrimitiveClassPart primitive_class
;
74 ListTreeClassPart ListTree_class
;
77 extern ListTreeClassRec listtreeClassRec
;
87 /* Public stuff ... */
88 long foreground_pixel
;
93 /* Dimension LabelSpacing; */
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 ... */
114 Pixinfo ItemPix
; /* temporary storage for GetItemPix */
115 int exposeTop
, exposeBot
;
117 int preferredWidth
, preferredHeight
;
118 ListTreeItem
*first
, /* always points to a top level entry */
119 *highlighted
, *drop_highlighted
;
121 XtIntervalId timer_id
; /* timer for double click test */
122 ListTreeItem
*timer_item
; /* item to make sure both clicks */
123 /* occurred on the same item */
124 int timer_type
; /* flag for type of click that just happened */
127 int multi_click_time
;
129 ListTreeItem
**ret_item_list
;
136 /* New stuff for maintaining its own scrolling state */
137 Widget mom
; /* scrolled window */
138 Widget hsb
; /* horizontal scrollbar */
139 Widget vsb
; /* vertical scrollbar */
143 Dimension viewHeight
;
149 int topItemPos
; /* position of topItem in itemCount */
150 int bottomItemPos
; /* last position drawn in window */
151 int lastItemPos
; /* last value of topItempos */
152 ListTreeItem
*topItem
; /* first visible item on screen */
153 int itemCount
; /* total number of open ListTreeItems */
154 Dimension itemHeight
;
155 Dimension maxPixHeight
;
156 int visibleCount
; /* number currently visible on screen */
161 typedef struct _ListTreeRec
{
163 XmPrimitivePart primitive
;
168 #endif /* _ListTreeP_H */