File: MwListTree.h

package info (click to toggle)
mowitz 0.2.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,168 kB
  • ctags: 4,214
  • sloc: ansic: 30,869; sh: 9,051; makefile: 169
file content (125 lines) | stat: -rw-r--r-- 4,266 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*-----------------------------------------------------------------------------
** MwListTree.c	A Specialized List widget
**
** Public header file
**
** Copyright (c) 1995 Robert W. McMullen
**
** Permission to use, copy, modify, distribute, and sell this software and its
** documentation for any purpose is hereby granted without fee, provided that
** the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation.  The author makes no representations about the suitability
** of this software for any purpose.  It is provided "as is" without express
** or implied warranty.
**
** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
** ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL
** THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
** ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
** SOFTWARE.
*/

#ifndef _MwListTree_H
#define _MwListTree_H

#include <X11/Core.h>

#define _MwListTree_WIDGET_VERSION	2.0

#define XtNmargin		"margin"
#define XtNindent		"indent"
#define XtNhorizontalSpacing	"horizontalSpacing"
#define XtNverticalSpacing	"verticalSpacing"
#define XtNlineWidth		"lineWidth"
#define XtNbranchPixmap		"branchPixmap"
#define XtNbranchOpenPixmap	"branchOpenPixmap"
#define XtNleafPixmap		"leafPixmap"
#define XtNleafOpenPixmap	"leafOpenPixmap"
#define XtNbranchCallback	"branchCallback"
#define XtNleafCallback		"leafCallback"
#define XtNpathCallback		"pathCallback"
#define XtNhighlightCallback	"highlightCallback"
#define XtNactivateCallback	"activateCallback"

#define XtBRANCH	1
#define XtLEAF		2

extern WidgetClass listtreeWidgetClass;

typedef struct _MwListTreeClassRec *MwListTreeWidgetClass;
typedef struct _MwListTreeRec      *MwListTreeWidget;

typedef struct _MwListTreeItem {
	Boolean		open;
	Boolean		highlighted;
	char		*text;
	int		length;
	int		x,y,ytext;
	Dimension	height;
	struct _MwListTreeItem 	*parent,
			*firstchild,
			*prevsibling,*nextsibling;
	XtPointer	user_data;
} MwListTreeItem;

typedef struct _MwListTreeReturnStruct {
	int		reason;
	MwListTreeItem	*item;
	MwListTreeItem	**path;
	int		count;
	Boolean		open;
} MwListTreeReturnStruct;

typedef struct _MwListTreeMultiReturnStruct {
	MwListTreeItem	**items;
	int		count;
} MwListTreeMultiReturnStruct;

typedef struct _MwListTreeActivateStruct {
	int		reason;
	MwListTreeItem	*item;
	Boolean		open;
	MwListTreeItem	**path;
	int		count;
} MwListTreeActivateStruct;

/*
** Public function declarations
*/
#ifndef _MwListTree_
#if __STDC__ || defined(__cplusplus)
#define P_(s) s
#else
#define P_(s) ()
#endif

/* MwListTree.c */
void MwListTreeRefresh P_((Widget w));
void MwListTreeRefreshOff P_((Widget w));
void MwListTreeRefreshOn P_((Widget w));
MwListTreeItem *MwListTreeAdd P_((Widget w, MwListTreeItem *parent, char *string));
void MwListTreeRenameItem P_((Widget w, MwListTreeItem *item, char *string));
int MwListTreeDelete P_((Widget w, MwListTreeItem *item));
int MwListTreeDeleteChildren P_((Widget w, MwListTreeItem *item));
int MwListTreeReparent P_((Widget w, MwListTreeItem *item, MwListTreeItem *newparent));
int MwListTreeReparentChildren P_((Widget w, MwListTreeItem *item, MwListTreeItem *newparent));
int MwListTreeOrderSiblings P_((Widget w, MwListTreeItem *item));
int MwListTreeOrderChildren P_((Widget w, MwListTreeItem *item));
MwListTreeItem *MwListTreeFindSiblingName P_((Widget w, MwListTreeItem *item, char *name));
MwListTreeItem *MwListTreeFindChildName P_((Widget w, MwListTreeItem *item, char *name));
void MwListTreeHighlightItem P_((Widget w, MwListTreeItem *item));
MwListTreeItem *MwListTreeFirstItem P_((Widget w));
#ifdef USE_RDD
void MwListTreeHighlightDrop P_((Widget w, XEvent *event, String *params, Cardinal *num_params));
MwListTreeReturnStruct *MwListTreeGetDrop P_((Widget w));
#endif
extern void MwListTreeSetHighlighted(Widget,MwListTreeItem **,int,Boolean);
extern void MwListTreeGetHighlighted(Widget,MwListTreeMultiReturnStruct *);

#undef P_
#endif

#endif /* _MwListTree_H */