home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _991516b910da4eeeaa06e833f19ed551 < prev    next >
Text File  |  2004-06-01  |  5KB  |  149 lines

  1.  
  2. /*    $Id: tixTList.h,v 1.1.1.1 2000/05/17 11:08:42 idiscovery Exp $    */
  3.  
  4. /*
  5.  * tixTList.h --
  6.  *
  7.  *    This header file defines the data structures used by the tixTList
  8.  *    widget.
  9.  *
  10.  * Copyright (c) 1996, Expert Interface Technologies
  11.  *
  12.  * See the file "license.terms" for information on usage and redistribution
  13.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  14.  *
  15.  */
  16.  
  17. #ifndef _TIX_TLIST_H_
  18. #define _TIX_TLIST_H_
  19.  
  20. #ifndef  _TIX_INT_H_
  21. #include "tixInt.h"
  22. #endif
  23.  
  24. #include "tkVMacro.h"
  25.  
  26. #define TIX_X 0
  27. #define TIX_Y 1
  28.  
  29. typedef struct ListEntry {
  30.     struct ListEntry * next;
  31.     Tix_DItem * iPtr;
  32.     Tk_Uid state;
  33.     Tcl_Obj * data;            /* user data field */
  34.     int size[2];
  35.     unsigned int selected : 1;
  36. } ListEntry;
  37.  
  38. typedef struct ListRow {
  39.     ListEntry * chPtr;
  40.     int size[2];
  41.     int numEnt;
  42. } ListRow;
  43.  
  44. /*
  45.  * A data structure of the following type is kept for each
  46.  * widget managed by this file:
  47.  */
  48. typedef struct ListStruct {
  49.     Tix_DispData dispData;
  50.  
  51.     Tcl_Command widgetCmd;    /* Token for button's widget command. */
  52.  
  53.     /*
  54.      * Information used when displaying widget:
  55.      */
  56.     int width, height;        /* For app programmer to request size */
  57.  
  58.     /*
  59.      * Information used when displaying widget:
  60.      */
  61.  
  62.     /* Border and general drawing */
  63.     int borderWidth;        /* Width of 3-D borders. */
  64.     int selBorderWidth;        /* Width of 3-D borders for selected items */
  65.     int relief;            /* Indicates whether window as a whole is
  66.                  * raised, sunken, or flat. */
  67.     Tk_3DBorder border;        /* Used for drawing the 3d border. */
  68.     Tk_3DBorder selectBorder;    /* Used for selected background. */
  69.     XColor *normalFg;        /* Normal foreground for text. */
  70.     XColor *normalBg;        /* Normal background for  text. */
  71.     XColor *selectFg;        /* Color for drawing selected text. */
  72.  
  73.        /* GC and stuff */
  74.     GC backgroundGC;        /* GC for drawing background. */
  75.     GC selectGC;        /* GC for drawing selected background. */
  76.     GC anchorGC;        /* GC for drawing dotted anchor highlight. */
  77.     TixFont font;        /* Default font used by the DItems. */
  78.  
  79.     /* Text drawing */
  80.     Cursor cursor;        /* Current cursor for window, or None. */
  81.  
  82.     /* For highlights */
  83.     int highlightWidth;        /* Width in pixels of highlight to draw
  84.                  * around widget when it has the focus.
  85.                  * <= 0 means don't draw a highlight. */
  86.     XColor *highlightColorPtr;    /* Color for drawing traversal highlight. */
  87.     GC highlightGC;        /* For drawing traversal highlight. */
  88.  
  89.     /* default pad and gap values */
  90.     int padX, padY;
  91.  
  92.     Tk_Uid selectMode;        /* Selection style: single, browse, multiple,
  93.                  * or extended.  This value isn't used in C
  94.                  * code, but the Tcl bindings use it. */
  95.     Tk_Uid state;        /* State can only be normal or disabled. */
  96.     Tix_LinkList entList;
  97.  
  98.     int numRowAllocd;
  99.     int numRow;
  100.     ListRow * rows;
  101.  
  102.     ListEntry * seeElemPtr;    /* The current item to "see" */
  103.     ListEntry * anchor;        /* The current anchor item */
  104.     ListEntry * active;        /* The current active item */
  105.     ListEntry * dropSite;    /* The current drop site */
  106.     ListEntry * dragSite;    /* The current drop site */
  107.  
  108.     /*
  109.      * Commands
  110.      */
  111.     LangCallback *command;        /* The command when user double-clicks */
  112.     LangCallback *browseCmd;        /* The command to call when the selection
  113.                  * changes. */
  114.     LangCallback *sizeCmd;        /* The command to call when the size of
  115.                  * the listbox changes. E.g., when the user
  116.                  * add/deletes elements. Useful for
  117.                  * auto-scrollbar geometry managers */
  118.  
  119.     /* These options control how the items are arranged on the list */
  120.     Tk_Uid orientUid;        /* Can be "vertical" or "horizontal" */
  121.     int packMode[2];        /* is row and column packed */
  122.     int numMajor[2];        /* num of rows and columns */
  123.     int itemSize[2];        /* horizontal and vertical size of items, -1
  124.                  * means natural size */
  125.  
  126.     /* Info for laying out */
  127.     int maxSize[2];        /* max size of all elements in X and Y, (they
  128.                  * do not need to be the same element, may be
  129.                  * invalid according to mode */
  130.     char *takeFocus;        /* Value of -takefocus option;  not used in
  131.                  * the C code, but used by keyboard traversal
  132.                  * scripts.  Malloc'ed, but may be NULL. */
  133.  
  134.     int serial;            /* this number is incremented before each time
  135.                  * the widget is redisplayed */
  136.  
  137.     Tix_DItemInfo * diTypePtr;    /* Default item type */
  138.     Tix_IntScrollInfo scrollInfo[2];
  139.     unsigned int redrawing : 1;
  140.     unsigned int resizing  : 1;
  141.     unsigned int hasFocus  : 1;
  142.     unsigned int isVertical : 1;
  143. } TixTListWidget;
  144.  
  145. typedef TixTListWidget   WidgetRecord;
  146. typedef TixTListWidget * WidgetPtr;
  147.  
  148. #endif /* _TIX_TLIST_H_ */
  149.