Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:24

0001 /*
0002 Copyright 1989, 1994, 1998  The Open Group
0003 
0004 Permission to use, copy, modify, distribute, and sell this software and its
0005 documentation for any purpose is hereby granted without fee, provided that
0006 the above copyright notice appear in all copies and that both that
0007 copyright notice and this permission notice appear in supporting
0008 documentation.
0009 
0010 The above copyright notice and this permission notice shall be included in
0011 all copies or substantial portions of the Software.
0012 
0013 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0014 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0015 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0016 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0017 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0018 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0019 
0020 Except as contained in this notice, the name of The Open Group shall not be
0021 used in advertising or otherwise to promote the sale, use or other dealings
0022 in this Software without prior written authorization from The Open Group.
0023 */
0024 
0025 /*  This is the List widget, it is useful to display a list, without the
0026  *  overhead of having a widget for each item in the list.  It allows
0027  *  the user to select an item in a list and notifies the application through
0028  *  a callback function.
0029  *
0030  *  Created:    8/13/88
0031  *  By:     Chris D. Peterson
0032  *                      MIT X Consortium
0033  */
0034 
0035 #ifndef _XawList_h
0036 #define _XawList_h
0037 
0038 #include <X11/Xaw/Simple.h>
0039 
0040 /* Resources:
0041 
0042  Name            Class      RepType     Default Value
0043  ----            -----      -------     -------------
0044  background      Background     Pixel       XtDefaultBackground
0045  borderColor         BorderColor    Pixel       XtDefaultForeground
0046  borderWidth         BorderWidth    Dimension   1
0047  callback            Callback           XtCallbackList  NULL       **6
0048  columnSpacing       Spacing            Dimension       6
0049  cursor          Cursor     Cursor      left_ptr
0050  cursorName      Cursor     String      NULL
0051  defaultColumns      Columns            int             2          **5
0052  destroyCallback     Callback       Pointer     NULL
0053  font            Font       XFontStruct*    XtDefaultFont
0054  forceColumns        Columns            Boolean         False      **5
0055  foreground      Foreground     Pixel       XtDefaultForeground
0056  height          Height     Dimension   0          **1
0057  insensitiveBorder   Insensitive    Pixmap      Gray
0058  internalHeight      Height     Dimension   2
0059  internalWidth       Width      Dimension   4
0060  list            List       String*     NULL       **2
0061  longest             Longest            int             0          **3  **4
0062  mappedWhenManaged   MappedWhenManaged  Boolean     True
0063  numberStrings       NumberStrings      int             0          **4
0064  pasteBuffer         Boolean            Boolean         False
0065  pointerColor        Foreground     Pixel       XtDefaultForeground
0066  pointerColorBackground Background  Pixel       XtDefaultBackground
0067  rowSpacing          Spacing            Dimension       4
0068  sensitive       Sensitive      Boolean     True
0069  verticalList        Boolean            Boolean         False
0070  width           Width      Dimension   0          **1
0071  x           Position       Position    0
0072  y           Position       Position    0
0073 
0074  **1 - If the Width or Height of the list widget is zero (0) then the value
0075        is set to the minimum size necessary to fit the entire list.
0076 
0077        If both Width and Height are zero then they are adjusted to fit the
0078        entire list that is created width the number of default columns
0079        specified in the defaultColumns resource.
0080 
0081  **2 - This is an array of strings the specify elements of the list.
0082        This resource must be specified.
0083        (What good is a list widget without a list??  :-)
0084 
0085  **3 - Longest is the length of the widest string in pixels.
0086 
0087  **4 - If either of these values are zero (0) then the list widget calculates
0088        the correct value.
0089 
0090        (This allows you to make startup faster if you already have
0091         this information calculated)
0092 
0093        NOTE: If the numberStrings value is zero the list must
0094              be NULL terminated.
0095 
0096  **5 - By setting the List.Columns resource you can force the application to
0097        have a given number of columns.
0098 
0099  **6 - This returns the name and index of the item selected in an
0100        XawListReturnStruct that is pointed to by the client_data
0101        in the CallbackProc.
0102 
0103 */
0104 
0105 /*
0106  * Value returned when there are no highlighted objects
0107  */
0108 #define XAW_LIST_NONE -1
0109 
0110 #define XtCList "List"
0111 #define XtCSpacing "Spacing"
0112 #define XtCColumns "Columns"
0113 #define XtCLongest "Longest"
0114 #define XtCNumberStrings "NumberStrings"
0115 
0116 #define XtNcursor "cursor"
0117 #define XtNcolumnSpacing "columnSpacing"
0118 #define XtNdefaultColumns "defaultColumns"
0119 #define XtNforceColumns "forceColumns"
0120 #define XtNlist "list"
0121 #define XtNlongest "longest"
0122 #define XtNnumberStrings "numberStrings"
0123 #define XtNpasteBuffer "pasteBuffer"
0124 #define XtNrowSpacing "rowSpacing"
0125 #define XtNverticalList "verticalList"
0126 #define XtNshowCurrent "showCurrent"
0127 
0128 #ifndef XtNfontSet
0129 #define XtNfontSet "fontSet"
0130 #endif
0131 
0132 #ifndef XtCFontSet
0133 #define XtCFontSet "FontSet"
0134 #endif
0135 
0136 extern WidgetClass listWidgetClass;
0137 
0138 typedef struct _ListClassRec *ListWidgetClass;
0139 typedef struct _ListRec      *ListWidget;
0140 
0141 /* list return structure */
0142 typedef struct _XawListReturnStruct {
0143   String string;
0144   int list_index;
0145 } XawListReturnStruct;
0146 
0147 _XFUNCPROTOBEGIN
0148 
0149 /*
0150  * Function:
0151  *  XawListChange
0152  *
0153  * Parameters:
0154  *  w   - list widget
0155  *  list    - new list
0156  *  nitems  - number of items in the list
0157  *  longest - length (in Pixels) of the longest element in the list
0158  *  resize  - if True the the list widget will try to resize itself
0159  *
0160  * Description:
0161  *  Changes the list being used and shown.
0162  *
0163  * Note:
0164  *  If nitems of longest are <= 0 then they will be calculated
0165  *  If nitems is <= 0 then the list needs to be NULL terminated
0166  */
0167 void XawListChange
0168 (
0169  Widget         w,
0170  String         *list,
0171  int            nitems,
0172  int            longest,
0173 #if NeedWidePrototypes
0174  int            resize
0175 #else
0176  Boolean        resize
0177 #endif
0178  );
0179 
0180 /*
0181  * Function:
0182  *  XawListUnhighlight
0183  *
0184  * Parameters:
0185  *  w - list widget
0186  *
0187  * Description:
0188  *  Unlights the current highlighted element.
0189  */
0190 void XawListUnhighlight
0191 (
0192  Widget         w
0193  );
0194 
0195 /*
0196  * Function:
0197  *  XawListHighlight
0198  *
0199  * Parameters:
0200  *  w    - list widget
0201  *  item - item to highlight
0202  *
0203  * Description:
0204  *  Highlights the given item.
0205  */
0206 void XawListHighlight
0207 (
0208  Widget         w,
0209  int            item
0210  );
0211 
0212 
0213 /*
0214  * Function:
0215  *  XawListShowCurrent
0216  *
0217  * Paraneters:
0218  *  w - list widget
0219  *
0220  * Description:
0221  *  Returns the currently highlighted object.
0222  *
0223  * Returns:
0224  *  The info about the currently highlighted object
0225  */
0226 
0227 XawListReturnStruct *XawListShowCurrent
0228 (
0229  Widget         w
0230  );
0231 
0232 _XFUNCPROTOEND
0233 
0234 #endif /* _XawList_h */