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