ListP.h revision 7a84e134
1/* $Xorg: ListP.h,v 1.4 2001/02/09 02:03:44 xorgcvs Exp $ */
2
3/*
4Copyright 1989, 1994, 1998  The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in this Software without prior written authorization from The Open Group.
25*/
26/* $XFree86: xc/lib/Xaw/ListP.h,v 1.8 2001/01/17 19:42:27 dawes Exp $ */
27
28
29/*
30 * This is a List widget.  It allows the user to select an item in a list and
31 * notifies the application through a callback function.
32 *
33 *	Created: 	8/13/88
34 *	By:		Chris D. Peterson
35 *                      MIT - Project Athena
36 */
37
38#ifndef _XawListP_h
39#define _XawListP_h
40
41/*
42 * List Widget Private Data
43 */
44#include <X11/Xaw/SimpleP.h>
45#include <X11/Xaw/List.h>
46
47#define NO_HIGHLIGHT            XAW_LIST_NONE
48#define OUT_OF_RANGE            -1
49#define OKAY                     0
50
51/* New fields for the List widget class */
52typedef struct {
53    XtPointer extension;
54} ListClassPart;
55
56/* Full class record */
57typedef struct _ListClassRec {
58    CoreClassPart	core_class;
59    SimpleClassPart	simple_class;
60    ListClassPart	list_class;
61} ListClassRec;
62
63extern ListClassRec listClassRec;
64
65/* New fields for the List widget */
66typedef struct {
67    /* resources */
68    Pixel foreground;
69    Dimension internal_width;		/* if not 3d, user sets directly */
70    Dimension internal_height;
71    Dimension column_space;		/* half of *_space is add on
72					   top/bot/left of */
73    Dimension row_space;		/* each item's text bounding box
74					   half added to longest for right */
75    int default_cols;
76    Boolean force_cols;
77    Boolean paste;
78    Boolean vertical_cols;
79    int longest;			/* in pixels */
80    int nitems;
81    XFontStruct	*font;
82    XFontSet fontset;			/* Sheeran, Omron KK, 93/03/05 */
83    String *list;			/* for i18n, always in multibyte
84					   format */
85    XtCallbackList callback;
86
87    /* private */
88    int is_highlighted;			/* set to the item currently
89					   highlighted */
90    int highlight;			/* set to the item that should be
91					   highlighted */
92    int col_width;			/* width of each column */
93    int row_height;			/* height of each row */
94    int nrows;				/* number of rows in the list */
95    int ncols;				/* number of columns in the list */
96    GC normgc;
97    GC revgc;
98    GC graygc;
99    int freedoms;			/* flags for resizing height
100					   and width */
101#ifndef OLDXAW
102    int selected;
103    Boolean show_current;
104    char pad1[(sizeof(XtPointer) - sizeof(Boolean)) +
105		 (sizeof(XtPointer) - sizeof(int))];
106    XtPointer pad2[2];	/* for future use and keep binary compatability */
107#endif
108} ListPart;
109
110
111/* Full instance record */
112typedef struct _ListRec {
113    CorePart	core;
114    SimplePart	simple;
115    ListPart	list;
116} ListRec;
117
118#endif /* _XawListP_h */
119