1 /*-----------------------------------------------------------------------------
2 ** MwListTree.c	A Specialized List widget
3 **
4 ** Private header file
5 **
6 ** Copyright (c) 1995 Robert W. McMullen
7 **
8 ** Permission to use, copy, modify, distribute, and sell this software and its
9 ** documentation for any purpose is hereby granted without fee, provided that
10 ** the above copyright notice appear in all copies and that both that
11 ** copyright notice and this permission notice appear in supporting
12 ** documentation.  The author makes no representations about the suitability
13 ** of this software for any purpose.  It is provided "as is" without express
14 ** or implied warranty.
15 **
16 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
17 ** ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL
18 ** THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
19 ** ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 ** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 ** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
22 ** SOFTWARE.
23 */
24 
25 #ifndef _MwListTreeP_H
26 #define _MwListTreeP_H
27 
28 #include <X11/Core.h>
29 
30 #include "MwListTree.h"
31 #define MwListTreeRET_ALLOC 10
32 
33 #define TIMER_CLEAR 0
34 #define TIMER_SINGLE 1
35 #define TIMER_DOUBLE 2
36 #define TIMER_WAITING 3
37 
38 typedef struct {
39 	int		dummy;		/* keep compiler happy with dummy field */
40 } MwListTreeClassPart;
41 
42 typedef struct _MwListTreeClassRec {
43 	CoreClassPart		core_class;
44 	MwListTreeClassPart	MwListTree_class;
45 } MwListTreeClassRec;
46 
47 extern MwListTreeClassRec listtreeClassRec;
48 
49 typedef struct {
50 	Pixmap		bitmap;
51 	Pixmap		pix;
52 	int		width,height;
53 	int		xoff;
54 } Pixinfo;
55 
56 typedef struct {
57 	/* Public stuff ... */
58 	long		foreground_pixel;
59 	XFontStruct	*font;
60 	int		NumItems;
61 	Dimension	HSpacing;
62 	Dimension	VSpacing;
63 /*	Dimension	LabelSpacing;*/
64 	Dimension	Margin;
65 	Dimension	Indent;
66 	Pixinfo		Open;
67 	Pixinfo		Closed;
68 	Pixinfo		Leaf;
69 	Pixinfo		LeafOpen;
70 	Dimension	LineWidth;
71 	XtCallbackList  BranchCallback;
72 	XtCallbackList  LeafCallback;
73 	XtCallbackList  PathCallback;
74 	XtCallbackList  HighlightCallback;
75 	XtCallbackList  ActivateCallback;
76 
77 	/* Private stuff ... */
78 	GC		drawGC;
79 	GC		eraseGC;
80         GC              eorGC;
81 	GC		highlightGC;
82 	int		exposeTop,exposeBot;
83 	int		pixWidth;
84 	int		preferredWidth,preferredHeight;
85 	MwListTreeItem	*first,		/* always points to a top level entry */
86 			*highlighted,
87                         *drop_highlighted;
88 
89 	XtIntervalId	timer_id;	/* timer for double click test */
90 	MwListTreeItem	*timer_item;	/* item to make sure both clicks */
91 					/* occurred on the same item */
92   int timer_type; /* flag for type of click that just happened */
93 	int		timer_y;
94 	int		timer_x;
95 	int		multi_click_time;
96 
97   MwListTreeItem  **ret_item_list;
98   int           ret_item_alloc;
99 
100 	Boolean		Refresh;
101 } MwListTreePart;
102 
103 typedef struct _MwListTreeRec {
104 	CorePart	core;
105 	MwListTreePart	list;
106 } MwListTreeRec;
107 
108 
109 #endif /* _MwListTreeP_H */
110