~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/qmon/ltree/ListTreeP.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-----------------------------------------------------------------------------
 
2
 * ListTree     A list widget that displays a file manager style tree
 
3
 *
 
4
 * Copyright (c) 1996 Robert W. McMullen
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 *
 
20
 *
 
21
 * Author: Rob McMullen <rwmcm@mail.ae.utexas.edu>
 
22
 *         http://www.ae.utexas.edu/~rwmcm
 
23
 */
 
24
 
 
25
#ifndef _ListTreeP_H
 
26
#define _ListTreeP_H
 
27
 
 
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
 
 
35
#include "ListTree.h"
 
36
 
 
37
/* LessTif definitions that are convenient for Motif */
 
38
#ifndef Prim_HighlightThickness
 
39
#define Prim_HighlightThickness(w) \
 
40
    (((XmPrimitiveWidget)(w))->primitive.highlight_thickness)
 
41
#endif
 
42
 
 
43
#ifndef Prim_ShadowThickness
 
44
#define Prim_ShadowThickness(w) \
 
45
    (((XmPrimitiveWidget)(w))->primitive.shadow_thickness)
 
46
#endif
 
47
 
 
48
#ifndef Prim_TopShadowGC
 
49
#define Prim_TopShadowGC(w) \
 
50
    (((XmPrimitiveWidget)(w))->primitive.top_shadow_GC)
 
51
#endif
 
52
 
 
53
#ifndef Prim_BottomShadowGC
 
54
#define Prim_BottomShadowGC(w) \
 
55
    (((XmPrimitiveWidget)(w))->primitive.bottom_shadow_GC)
 
56
#endif
 
57
 
 
58
 
 
59
#define ListTreeRET_ALLOC 10
 
60
 
 
61
#define TIMER_CLEAR 0
 
62
#define TIMER_SINGLE 1
 
63
#define TIMER_DOUBLE 2
 
64
#define TIMER_WAITING 3
 
65
 
 
66
/*
 
67
** DND support and debugging
 
68
*/
 
69
/* #define DEBUG */
 
70
/* #define DND */
 
71
 
 
72
 
 
73
typedef struct {
 
74
  int dummy;                    /* keep compiler happy with dummy field */
 
75
} ListTreeClassPart;
 
76
 
 
77
typedef struct _ListTreeClassRec {
 
78
   CoreClassPart core_class;
 
79
   XmPrimitiveClassPart primitive_class;
 
80
   ListTreeClassPart ListTree_class;
 
81
} ListTreeClassRec;
 
82
 
 
83
extern ListTreeClassRec listtreeClassRec;
 
84
 
 
85
typedef struct {
 
86
   Pixmap bitmap;
 
87
   Pixmap pix;
 
88
   int width, height;
 
89
   int xoff;
 
90
}  Pixinfo;
 
91
 
 
92
typedef struct {
 
93
   ListTreeWidget list_tree;
 
94
   ListTreeItem *item;
 
95
} DNDInfo;
 
96
 
 
97
typedef struct {
 
98
   /* Public stuff ... */
 
99
   long foreground_pixel;
 
100
   XFontStruct *font;
 
101
   int NumItems;
 
102
   Dimension HSpacing;
 
103
   Dimension VSpacing;
 
104
   /*      Dimension       LabelSpacing; */
 
105
   Dimension Margin;
 
106
   Dimension Indent;
 
107
   Pixinfo Open;
 
108
   Pixinfo Closed;
 
109
   Pixinfo Leaf;
 
110
   Pixinfo LeafOpen;
 
111
   Dimension LineWidth;
 
112
   Boolean HighlightPath;
 
113
   Boolean ClickPixmapToOpen;
 
114
   Boolean DoIncrementalHighlightCallback;
 
115
 
 
116
   XtCallbackList HighlightCallback;
 
117
   XtCallbackList ActivateCallback;
 
118
   XtCallbackList MenuCallback;
 
119
   XtCallbackList DestroyItemCallback;
 
120
   XtCallbackList CreateItemCallback;
 
121
 
 
122
   Boolean ListMode;
 
123
 
 
124
   /* Private stuff ... */
 
125
   GC drawGC;
 
126
   GC eraseGC;
 
127
   GC eorGC;
 
128
   GC highlightGC;
 
129
   Pixinfo ItemPix;              /* temporary storage for GetItemPix */
 
130
   int exposeTop, exposeBot;
 
131
   int pixWidth;
 
132
   int preferredWidth, preferredHeight;
 
133
   ListTreeItem *first, /* always points to a top level entry */
 
134
                *highlighted, *drop_highlighted;
 
135
 
 
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 */
 
140
   int timer_y;
 
141
   int timer_x;
 
142
   int multi_click_time;
 
143
 
 
144
   ListTreeItem **ret_item_list;
 
145
   int ret_item_alloc;
 
146
 
 
147
   Boolean Refresh;
 
148
   Boolean HasFocus;
 
149
 
 
150
   /* New stuff for maintaining its own scrolling state */
 
151
   Widget mom;       /* scrolled window */
 
152
   Widget hsb;       /* horizontal scrollbar */
 
153
   Widget vsb;       /* vertical scrollbar */
 
154
   Dimension viewX;
 
155
   Dimension viewY;
 
156
   Dimension viewWidth;
 
157
   Dimension viewHeight;
 
158
   int XOffset;
 
159
   int hsbPos;
 
160
   int hsbMax;
 
161
 
 
162
   int lastXOffset;
 
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 */
 
171
   Boolean recount;
 
172
 
 
173
} ListTreePart;
 
174
 
 
175
typedef struct _ListTreeRec {
 
176
   CorePart core;
 
177
   XmPrimitivePart primitive;
 
178
   ListTreePart list;
 
179
} ListTreeRec;
 
180
 
 
181
 
 
182
#endif /* _ListTreeP_H */