Back to index

plt-scheme  4.2.1
xwMultiListP.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003        MultiListP.h
00004 
00005        This file is the private header file for the MultiList widget, an
00006        extension to the Athena List widget.
00007 
00008        This code is loosely based on the Athena List source which
00009        is why the MIT copyright notice appears below.
00010 
00011        The code was changed substantially in V3.4 to change the
00012        action/callback interface which was unnecessarily ugly.  Code
00013        using some features of the old interface may need to be changed.
00014        Hope the changes don't make people's lives too miserable.
00015 
00016  ****************************************************************************/
00017 
00018 /*
00019  * Author:
00020  *     Brian Totty
00021  *     Department of Computer Science
00022  *     University Of Illinois at Urbana-Champaign
00023  *     1304 West Springfield Avenue
00024  *     Urbana, IL 61801
00025  * 
00026  *     totty@cs.uiuc.edu
00027  *     
00028  */ 
00029 
00030 /*
00031  * Copyright 2004-2009 PLT Scheme Inc.
00032  * Copyright 1989 Massachusetts Institute of Technology
00033  *
00034  * Permission to use, copy, modify, distribute, and sell this software and its
00035  * documentation for any purpose is hereby granted without fee, provided that
00036  * the above copyright notice appear in all copies and that both that
00037  * copyright notice and this permission notice appear in supporting
00038  * documentation, and that the name of M.I.T. not be used in advertising or
00039  * publicity pertaining to distribution of the software without specific,
00040  * written prior permission.  M.I.T. makes no representations about the
00041  * suitability of this software for any purpose.  It is provided "as is"
00042  * without express or implied warranty.
00043  *
00044  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
00045  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
00046  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00047  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
00048  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
00049  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00050  *
00051  * Original Athena Author:  Chris D. Peterson, MIT X Consortium
00052  */
00053 
00054 #ifndef _MULTILISTP_H_
00055 #define _MULTILISTP_H_
00056 
00057 #include <X11/CoreP.h>
00058 #include <xwMultiList.h>
00059 
00060 /*---------------------------------------------------------------------------*
00061 
00062       L O C A L    D A T A    S T R U C T U R E    D E F I N I T I O N S
00063 
00064  *---------------------------------------------------------------------------*/
00065 
00066 typedef       struct
00067 {
00068        Boolean              sensitive;
00069        Boolean              highlighted;
00070        String        string;
00071 } XfwfMultiListItem;
00072 
00073 /*---------------------------------------------------------------------------*
00074 
00075      W I D G E T    D A T A    S T R U C T U R E    D E F I N I T I O N S
00076 
00077  *---------------------------------------------------------------------------*/
00078 
00079 typedef struct
00080 {
00081        int           foo;
00082 } XfwfMultiListClassPart;
00083 
00084 typedef struct _XfwfMultiListClassRec
00085 {
00086        CoreClassPart        core_class;
00087        XfwfMultiListClassPart      multiList_class;
00088 } XfwfMultiListClassRec;
00089 
00090 extern XfwfMultiListClassRec xfwfMultiListClassRec;
00091 
00092 typedef struct
00093 {
00094        Pixel                foreground;
00095        Pixel                highlight_fg;
00096        Pixel                highlight_bg;
00097        Dimension            column_space;
00098        Dimension            row_space;
00099        int                  default_cols;
00100        Boolean                     force_cols;
00101        Boolean                     paste;
00102        Boolean                     row_major;
00103        int                  longest;
00104        int                  nitems;
00105        XFontStruct          *font;
00106 #ifdef WX_USE_XFT
00107        XftFont                       *xft_font;
00108 #endif
00109        String               *list;
00110        Boolean                     *sensitive_array;
00111        XtCallbackList       callback;
00112        int                  max_selectable;
00113        Boolean                     shade_surplus;
00114        Dimension            col_width;
00115        Dimension            row_height;
00116 
00117         int                     offset;
00118        int                  nrows;
00119        int                  ncols;
00120        int                  most_recent_clicked_item;
00121        int                  most_recent_action;
00122        Time                 last_button_release;
00123        GC                   erase_gc;
00124        GC                   draw_gc;
00125        GC                   highlight_bg_gc;
00126        GC                   highlight_fg_gc;
00127        GC                   gray_gc;
00128        XfwfMultiListItem    *item_array;
00129        int                  num_selected;
00130        int                  *sel_array;
00131 
00132        char                 *tablist;
00133        int                  *tabs;
00134        Boolean                 clickExtends;
00135        Boolean                 drawgray;
00136 } XfwfMultiListPart;
00137 
00138 typedef struct _XfwfMultiListRec
00139 {
00140        CorePart             core;
00141        XfwfMultiListPart    multiList;
00142 } XfwfMultiListRec;
00143 
00144 /*---------------------------------------------------------------------------*
00145 
00146           D A T A    S T R U C T U R E    A C C E S S    M A C R O S
00147 
00148  *---------------------------------------------------------------------------*/
00149 
00150 #define       MultiListItemSensitive(i)   ((i)->sensitive)
00151 #define       MultiListItemHighlighted(i) ((i)->highlighted)
00152 #define       MultiListItemString(i)             ((i)->string)
00153 
00154 #define       InstanceCore(w)                    (&((w)->core))
00155 #define       InstanceMultiList(w)        (&((w)->multiList))
00156 
00157 #define       MultiListWidth(w)           (InstanceCore(w)->width)
00158 #define       MultiListHeight(w)          (InstanceCore(w)->height)
00159 #define       MultiListBG(w)                     (InstanceCore(w)->background_pixel)
00160 #define       MultiListSensitive(w)              (InstanceCore(w)->sensitive)
00161 #define       MultiListAncesSensitive(w)  (InstanceCore(w)->ancestor_sensitive)
00162 #define       MultiListDepth(w)           (InstanceCore(w)->depth)
00163 
00164 #define       MultiListFG(w)                     (InstanceMultiList(w)->foreground)
00165 #define       MultiListHighlightFG(w)            (InstanceMultiList(w)->highlight_fg)
00166 #define       MultiListHighlightBG(w)            (InstanceMultiList(w)->highlight_bg)
00167 #define       MultiListColumnSpace(w)            (InstanceMultiList(w)->column_space)
00168 #define       MultiListRowSpace(w)        (InstanceMultiList(w)->row_space)
00169 #define       MultiListDefaultCols(w)            (InstanceMultiList(w)->default_cols)
00170 #define       MultiListForceCols(w)              (InstanceMultiList(w)->default_cols)
00171 #define       MultiListPaste(w)           (InstanceMultiList(w)->paste)
00172 #define       MultiListRowMajor(w)        (InstanceMultiList(w)->row_major)
00173 #define       MultiListLongest(w)         (InstanceMultiList(w)->longest)
00174 #define       MultiListNumItems(w)        (InstanceMultiList(w)->nitems)
00175 #define       MultiListFont(w)            (InstanceMultiList(w)->font)
00176 #ifdef WX_USE_XFT
00177 # define MultiListXftFont(w)              (InstanceMultiList(w)->xft_font)
00178 #else
00179 # define MultiListXftFont(w)              NULL
00180 #endif
00181 #define       MultiListList(w)            (InstanceMultiList(w)->list)
00182 #define       MultiListSensitiveArray(w)  (InstanceMultiList(w)->sensitive_array)
00183 #define       MultiListCallback(w)        (InstanceMultiList(w)->callback)
00184 #define       MultiListMaxSelectable(w)   (InstanceMultiList(w)->max_selectable)
00185 #define       MultiListShadeSurplus(w)    (InstanceMultiList(w)->shade_surplus)
00186 #define       MultiListClickExtends(w)    (InstanceMultiList(w)->clickExtends)
00187 #define       MultiListDrawGray(w)         (InstanceMultiList(w)->drawgray)
00188 
00189 #define       MultiListOffset(w)           (InstanceMultiList(w)->offset)
00190 
00191 #define       MultiListColWidth(w)        (InstanceMultiList(w)->col_width)
00192 #define       MultiListRowHeight(w)              (InstanceMultiList(w)->row_height)
00193 #define       MultiListNumRows(w)         (InstanceMultiList(w)->nrows)
00194 #define       MultiListNumCols(w)         (InstanceMultiList(w)->ncols)
00195 #define       MultiListMostRecentItem(w)  (InstanceMultiList(w)->most_recent_clicked_item)
00196 #define       MultiListMostRecentAct(w)   (InstanceMultiList(w)->most_recent_action)
00197 #define MultiListLastRelease(w)           (InstanceMultiList(w)->last_button_release)
00198 #define       MultiListEraseGC(w)         (InstanceMultiList(w)->erase_gc)
00199 #define       MultiListDrawGC(w)          (InstanceMultiList(w)->draw_gc)
00200 #define       MultiListHighlightForeGC(w) (InstanceMultiList(w)->highlight_fg_gc)
00201 #define       MultiListHighlightBackGC(w) (InstanceMultiList(w)->highlight_bg_gc)
00202 #define       MultiListGrayGC(w)          (InstanceMultiList(w)->gray_gc)
00203 #define       MultiListItemArray(w)              (InstanceMultiList(w)->item_array)
00204 #define       MultiListNthItem(w,n)              (&(MultiListItemArray(w)[n]))
00205 #define       MultiListSelArray(w)        (InstanceMultiList(w)->sel_array)
00206 #define       MultiListNumSelected(w)            (InstanceMultiList(w)->num_selected)
00207 
00208 #define       MultiListTabList(w)         (InstanceMultiList(w)->tablist)
00209 #define       MultiListTabs(w)            (InstanceMultiList(w)->tabs)
00210 
00211 #endif