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

  1.  
  2. /*    $Id: tixInt.h,v 1.1.1.1 2000/05/17 11:08:42 idiscovery Exp $    */
  3.  
  4. /*
  5.  * tixInt.h --
  6.  *
  7.  *    Defines internal data types and functions used by the Tix library.
  8.  *
  9.  * Copyright (c) 1996, Expert Interface Technologies
  10.  *
  11.  * See the file "license.terms" for information on usage and redistribution
  12.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13.  *
  14.  */
  15. #ifndef _TIX
  16. #include "tix.h"
  17. #endif
  18. #ifndef _TIXINT
  19. #define _TIXINT
  20. #define _TIX_INT_H_
  21.  
  22. /*----------------------------------------------------------------------
  23.  *
  24.  *        Tix Display Item Types
  25.  *
  26.  *----------------------------------------------------------------------
  27.  */
  28.  
  29. #define TIX_DITEM_NONE            0
  30. #define TIX_DITEM_TEXT            1
  31. #define TIX_DITEM_IMAGETEXT        2
  32. #define TIX_DITEM_WINDOW        3
  33. #define TIX_DITEM_IMAGE            4
  34.  
  35. /*
  36.  * The flags for drawing DItems
  37.  */
  38.  
  39. #define TIX_DITEM_NORMAL_BG        (0x1 <<     0)
  40. #define TIX_DITEM_ACTIVE_BG        (0x1 <<     1)
  41. #define TIX_DITEM_SELECTED_BG        (0x1 <<     2)
  42. #define TIX_DITEM_DISABLED_BG        (0x1 <<     3)
  43. #define TIX_DITEM_NORMAL_FG        (0x1 <<     4)
  44. #define TIX_DITEM_ACTIVE_FG        (0x1 <<     5)
  45. #define TIX_DITEM_SELECTED_FG        (0x1 <<     6)
  46. #define TIX_DITEM_DISABLED_FG        (0x1 <<     7)
  47. #define TIX_DITEM_FONT            (0x1 <<     8)
  48. #define TIX_DITEM_PADX            (0x1 <<     9)
  49. #define TIX_DITEM_PADY            (0x1 << 10)
  50.  
  51. #define TIX_DONT_CALL_CONFIG        TK_CONFIG_USER_BIT
  52.  
  53. /*
  54.  * These values are used ONLY for indexing the color array in
  55.  * Tix_StyleTemplate
  56.  */
  57.  
  58. #define TIX_DITEM_NORMAL        0
  59. #define TIX_DITEM_ACTIVE        1
  60. #define TIX_DITEM_SELECTED        2
  61. #define TIX_DITEM_DISABLED        3
  62.  
  63. /*
  64.  * Flags for MultiInfo
  65.  */
  66. #define TIX_CONFIG_INFO            1
  67. #define TIX_CONFIG_VALUE        2
  68.  
  69. typedef union  Tix_DItem        Tix_DItem;
  70. typedef union  Tix_DItemStyle        Tix_DItemStyle;
  71. typedef struct Tix_DItemInfo        Tix_DItemInfo;
  72. typedef struct Tix_DispData        Tix_DispData;
  73. typedef struct Tix_StyleTemplate    Tix_StyleTemplate;
  74.  
  75. typedef void        Tix_DItemCalculateSizeProc  _ANSI_ARGS_((
  76.                 Tix_DItem * iPtr));
  77. typedef char *        Tix_DItemComponentProc _ANSI_ARGS_((
  78.                 Tix_DItem * iPtr, int x, int y));
  79. typedef int        Tix_DItemConfigureProc _ANSI_ARGS_((
  80.                 Tix_DItem * iPtr, int argc, Tcl_Obj *CONST *objv,
  81.                 int flags));
  82. typedef Tix_DItem *    Tix_DItemCreateProc _ANSI_ARGS_((
  83.                 Tix_DispData * ddPtr,
  84.                 Tix_DItemInfo * diTypePtr));
  85. typedef void        Tix_DItemDisplayProc  _ANSI_ARGS_((
  86.                 Pixmap pixmap, GC gc, Tix_DItem * iPtr,
  87.                 int x, int y, int width, int height, int flag));
  88. typedef void        Tix_DItemFreeProc  _ANSI_ARGS_((Tix_DItem * diPtr));
  89. typedef void        Tix_DItemSizeChangedProc  _ANSI_ARGS_((
  90.                 Tix_DItem * iPtr));
  91.  
  92. typedef void        Tix_DItemStyleChangedProc  _ANSI_ARGS_((
  93.                 Tix_DItem * iPtr));
  94. typedef void        Tix_DItemLostStyleProc    _ANSI_ARGS_((
  95.                 Tix_DItem * iPtr));
  96. typedef int        Tix_DItemStyleConfigureProc _ANSI_ARGS_((
  97.                 Tix_DItemStyle* style, int argc, Tcl_Obj *CONST *objv,
  98.                 int flags));
  99. typedef Tix_DItemStyle*    Tix_DItemStyleCreateProc _ANSI_ARGS_((
  100.                 Tcl_Interp * interp, Tk_Window tkwin,
  101.                 Tix_DItemInfo * diTypePtr, char * name));
  102. typedef void        Tix_DItemStyleFreeProc _ANSI_ARGS_((
  103.                 Tix_DItemStyle* style));
  104. typedef void        Tix_DItemStyleSetTemplateProc _ANSI_ARGS_((
  105.                 Tix_DItemStyle* style,
  106.                 Tix_StyleTemplate * tmplPtr));
  107.  
  108. /*
  109.  * These are debugging routines
  110.  */
  111.  
  112. typedef int        Tix_DItemRefCountProc _ANSI_ARGS_(());
  113. typedef int        Tix_DItemStyleRefCountProc _ANSI_ARGS_(());
  114.  
  115. /*----------------------------------------------------------------------
  116.  * Tix_DItemInfo --
  117.  *
  118.  *    This structure is used to register a new display item (call
  119.  *    Tix_AddDItemType).
  120.  *----------------------------------------------------------------------
  121.  */
  122. struct Tix_DItemInfo {
  123.     char * name;
  124.     int type;
  125.  
  126.     /*
  127.      * These procedures communicate with the items
  128.      */
  129.     Tix_DItemCreateProc * createProc;
  130.     Tix_DItemConfigureProc * configureProc;
  131.     Tix_DItemCalculateSizeProc * calculateSizeProc;
  132.     Tix_DItemComponentProc * componentProc;
  133.     Tix_DItemDisplayProc * displayProc;
  134.     Tix_DItemFreeProc * freeProc;
  135.     Tix_DItemStyleChangedProc *styleChangedProc;
  136.     Tix_DItemLostStyleProc * lostStyleProc;
  137.  
  138.     /*
  139.      * These procedures communicate with the styles
  140.      */
  141.     Tix_DItemStyleCreateProc * styleCreateProc;
  142.     Tix_DItemStyleConfigureProc * styleConfigureProc;
  143.     Tix_DItemStyleFreeProc * styleFreeProc;
  144.     Tix_DItemStyleSetTemplateProc * styleSetTemplateProc;
  145.  
  146.     Tk_ConfigSpec * itemConfigSpecs;
  147.     Tk_ConfigSpec * styleConfigSpecs;
  148.     struct Tix_DItemInfo * next;
  149. };
  150.  
  151. /*----------------------------------------------------------------------
  152.  * Tix_DispData --
  153.  *
  154.  *    Information needed by the display types to display the item in
  155.  *    an X drawable.
  156.  *----------------------------------------------------------------------
  157.  */
  158. struct Tix_DispData {
  159.     Display * display;
  160.     Tcl_Interp * interp;
  161.     Tk_Window tkwin;
  162.     Tix_DItemSizeChangedProc * sizeChangedProc;
  163. };
  164.  
  165. /*----------------------------------------------------------------------
  166.  * Tix_StyleTemplate --
  167.  *
  168.  *    A StyleTemplate is used to set the values of the default styles
  169.  *    associated with a widget
  170.  *----------------------------------------------------------------------
  171.  */
  172. struct Tix_StyleTemplate {
  173.     int flags;            /* determines which field is valid */
  174.  
  175.     struct {
  176.     XColor * bg;
  177.     XColor * fg;
  178.     } colors[4];        /* colors for the four basic modes*/
  179.  
  180.     int pad[2];
  181. #if 0
  182.     /* %bordercolor not used */
  183.     XColor * borderColor;
  184.     Tix_Relief relief;
  185.     int borderWidth;
  186. #endif
  187.     TixFont font;
  188. };
  189.  
  190. /*----------------------------------------------------------------------
  191.  *
  192.  *
  193.  *            Display Item Types
  194.  *
  195.  *
  196.  *----------------------------------------------------------------------
  197.  */
  198.  
  199. /*
  200.  *  Display Styles
  201.  */
  202. typedef struct TixBaseStyle        TixBaseStyle;
  203. typedef struct TixImageTextStyle    TixImageTextStyle;
  204. typedef struct TixImageStyle        TixImageStyle;
  205. typedef struct TixTextStyle        TixTextStyle;
  206. typedef struct TixWindowStyle        TixWindowStyle;
  207.  
  208. typedef struct TixBaseItem        TixBaseItem;
  209. typedef struct TixColorStyle        TixColorStyle;
  210. typedef struct TixImageTextItem        TixImageTextItem;
  211. typedef struct TixImageItem        TixImageItem;
  212. typedef struct TixTextItem        TixTextItem;
  213. typedef struct TixWindowItem        TixWindowItem;
  214.  
  215. /*----------------------------------------------------------------------
  216.  * TixBaseItem --
  217.  *
  218.  *    This is the abstract base class for all display items. All
  219.  *    display items should have the data members defined in the
  220.  *    BaseItem structure
  221.  *----------------------------------------------------------------------
  222.  */
  223. #define ITEM_COMMON_MEMBERS \
  224.     Tix_DItemInfo * diTypePtr; \
  225.     Tix_DispData * ddPtr; \
  226.     ClientData clientData; \
  227.     int size[2]            /* Size of this element */ \
  228.  
  229. struct TixBaseItem {
  230.     ITEM_COMMON_MEMBERS;
  231.     TixBaseStyle * stylePtr;
  232. };
  233.  
  234. /*----------------------------------------------------------------------
  235.  * TixBaseStyle --
  236.  *
  237.  *    This is the abstract base class for all display styles. All
  238.  *    display items should have the data members defined in the
  239.  *    BaseStyle structure.  The common members are initialized by
  240.  *    tixDiStyle.c
  241.  *
  242.  *----------------------------------------------------------------------
  243.  */
  244.  
  245. #define STYLE_COMMON_MEMBERS \
  246.     Tcl_Command styleCmd;    /* Token for style's command. */ \
  247.     Tcl_HashTable items;    /* Ditems affected by this style */ \
  248.     int refCount;        /* Number of ditems affected by this style */\
  249.     int flags;            /* Various attributes */ \
  250.     Tcl_Interp *interp;        /* Interpreter associated with style. */ \
  251.     Tk_Window tkwin;        /* Window associated with this style */ \
  252.     Tix_DItemInfo * diTypePtr; \
  253.     Tk_Anchor anchor;        /* Anchor information */ \
  254.     char * name;        /* Name of this style */ \
  255.     int pad[2]            /* paddings */
  256.  
  257.  
  258. #if 0
  259.     Tix_Relief relief
  260.     /* %bordercolor not used */
  261.     int borderWidth;
  262.     XColor * borderColor;    /* color of the border when it is displayed
  263.                  * in "flat border" mode
  264.                  */
  265.     GC borderGC
  266. #endif
  267.  
  268. #define STYLE_COLOR_MEMBERS \
  269.     struct { \
  270.     XColor * bg; \
  271.     XColor * fg; \
  272.     GC foreGC;   \
  273.     GC backGC;   \
  274.     } colors[4]            /* colors and GC's for the four basic modes*/
  275.  
  276. struct TixBaseStyle {
  277.     STYLE_COMMON_MEMBERS;
  278. };
  279.  
  280. #define TIX_STYLE_DELETED 1
  281. #define TIX_STYLE_DEFAULT 2
  282.  
  283. /*
  284.  * Abstract type for all styles that have a color element
  285.  */
  286. struct TixColorStyle {
  287.     STYLE_COMMON_MEMBERS;
  288.     STYLE_COLOR_MEMBERS;
  289. };
  290.  
  291. /*----------------------------------------------------------------------
  292.  * ImageTextItem --
  293.  *
  294.  *    Display an image together with a text string
  295.  *----------------------------------------------------------------------
  296.  */
  297. struct TixImageTextItem {
  298.     ITEM_COMMON_MEMBERS;
  299.  
  300.     TixImageTextStyle *stylePtr;
  301.     /*-------------------------*/
  302.     /*     Bitmap           */
  303.     /*-------------------------*/
  304.     Pixmap bitmap;
  305.     int bitmapW, bitmapH;    /* Size of bitmap */
  306.  
  307.     /*-------------------------*/
  308.     /*     Image           */
  309.     /*-------------------------*/
  310.     char *imageString;        /* Name of image to display (malloc'ed), or
  311.                  * NULL.  If non-NULL, bitmap, text, and
  312.                  * textVarName are ignored. */
  313.     Tk_Image image;
  314.     int imageW, imageH;        /* Size of image */
  315.  
  316.     /*-------------------------*/
  317.     /*     Text          */
  318.     /*-------------------------*/
  319.  
  320.     Tcl_Obj * text;        /* Show descriptive text */
  321.     size_t numChars;        /* Size of text */
  322.     int textW, textH;
  323.     int wrapLength;
  324.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  325.     int underline;        /* Index of character to underline.  < 0 means
  326.                  * don't underline anything. */
  327.  
  328.     int showImage, showText;
  329. };
  330.  
  331. struct TixImageTextStyle {
  332.     STYLE_COMMON_MEMBERS;
  333.     STYLE_COLOR_MEMBERS;
  334.     int wrapLength;
  335.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  336.     TixFont font;
  337.     int gap;            /* Gap between text and image */
  338.     Tk_Anchor textanchor;    /* Text anchor information */
  339. };
  340.  
  341. /*----------------------------------------------------------------------
  342.  * ImageItem --
  343.  *
  344.  *    Displays an image
  345.  *----------------------------------------------------------------------
  346.  */
  347. struct TixImageItem {
  348.     ITEM_COMMON_MEMBERS;
  349.  
  350.     TixImageStyle *stylePtr;
  351.  
  352.     /*-------------------------*/
  353.     /*     Image           */
  354.     /*-------------------------*/
  355.     char *imageString;        /* Name of image to display (malloc'ed), or
  356.                  * NULL.  If non-NULL, bitmap, text, and
  357.                  * textVarName are ignored. */
  358.     Tk_Image image;
  359.     int imageW, imageH;        /* Size of image */
  360. };
  361.  
  362. struct TixImageStyle {
  363.     STYLE_COMMON_MEMBERS;
  364.     STYLE_COLOR_MEMBERS;
  365. };
  366. /*----------------------------------------------------------------------
  367.  * TextItem --
  368.  *
  369.  *    Displays a text string.
  370.  *----------------------------------------------------------------------
  371.  */
  372. struct TixTextItem {
  373.     ITEM_COMMON_MEMBERS;
  374.  
  375.     TixTextStyle *stylePtr;
  376.     /*-------------------------*/
  377.     /*     Text          */
  378.     /*-------------------------*/
  379.  
  380.     Tcl_Obj * text;        /* Show descriptive text */
  381.     size_t numChars;        /* Size of text */
  382.     int textW, textH;
  383.     int underline;        /* Index of character to underline.  < 0 means
  384.                  * don't underline anything. */
  385. };
  386.  
  387. struct TixTextStyle {
  388.     STYLE_COMMON_MEMBERS;
  389.     STYLE_COLOR_MEMBERS;
  390.     int wrapLength;
  391.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  392.     TixFont font;
  393. };
  394.  
  395. /*----------------------------------------------------------------------
  396.  * WindowItem --
  397.  *
  398.  *    Displays a window.
  399.  *----------------------------------------------------------------------
  400.  */
  401. struct TixWindowItem {
  402.     ITEM_COMMON_MEMBERS;
  403.     TixWindowStyle *stylePtr;
  404.     Tk_Window tkwin;
  405.     struct TixWindowItem * next;
  406.     int serial;
  407. };
  408.  
  409. struct TixWindowStyle {
  410.     STYLE_COMMON_MEMBERS;
  411. };
  412.  
  413. /*----------------------------------------------------------------------
  414.  * Tix_DItem and Tix_DItemStyle --
  415.  *
  416.  *    These unions just make it easy to address the internals of the
  417.  *    structures of the display items and styles. If you create a new
  418.  *    display item, you will need to do you type casting yourself.
  419.  *----------------------------------------------------------------------
  420.  */
  421. union Tix_DItem {
  422.     TixBaseItem        base;
  423.     TixImageTextItem    imagetext;
  424.     TixTextItem        text;
  425.     TixWindowItem    window;
  426.     TixImageItem    image;
  427. };
  428.  
  429. union Tix_DItemStyle {
  430.     TixBaseStyle    base;
  431.     TixColorStyle    color;
  432.     TixImageTextStyle    imagetext;
  433.     TixTextStyle    text;
  434.     TixWindowStyle    window;
  435.     TixImageStyle    image;
  436. };
  437.  
  438. #define Tix_DItemType(x)    ((x)->base.diTypePtr->type)
  439. #define Tix_DItemTypeName(x)    ((x)->base.diTypePtr->name)
  440. #define Tix_DItemWidth(x)    ((x)->base.size[0])
  441. #define Tix_DItemHeight(x)    ((x)->base.size[1])
  442. #define Tix_DItemConfigSpecs(x) ((x)->base.diTypePtr->itemConfigSpecs)
  443. #define Tix_DItemPadX(x)    ((x)->base.stylePtr->pad[0])
  444. #define Tix_DItemPadY(x)    ((x)->base.stylePtr->pad[1])
  445.  
  446. #define TIX_WIDTH  0
  447. #define TIX_HEIGHT 1
  448.  
  449. /*----------------------------------------------------------------------
  450.  * Tix_ArgumentList --
  451.  *
  452.  *    This data structure is used to split command arguments for
  453.  *    the display item types
  454.  *----------------------------------------------------------------------
  455.  */
  456. #define FIXED_SIZE 4
  457. typedef struct {
  458.     int argc;
  459.     Tcl_Obj **objv;
  460. } Tix_Argument;
  461.  
  462. typedef struct {
  463.     Tix_Argument * arg;
  464.     int numLists;
  465.     Tix_Argument preAlloc[FIXED_SIZE];
  466. } Tix_ArgumentList;
  467.  
  468. /*----------------------------------------------------------------------
  469.  * Tix_ScrollInfo --
  470.  *
  471.  *    This data structure encapsulates all the necessary operations
  472.  *    for scrolling widgets
  473.  *----------------------------------------------------------------------
  474.  */
  475. #define TIX_SCROLL_INT        1
  476. #define TIX_SCROLL_DOUBLE    2
  477.  
  478. /* abstract type */
  479. typedef struct Tix_ScrollInfo {
  480.     int type;        /* TIX_SCROLL_INT or TIX_SCROLL_DOUBLE */
  481.     LangCallback *command;
  482.     /* place holder for actual space - double must be mentioned
  483.        to force alignment for too-clever-by-half compilers
  484.      */
  485.     union {
  486.      int    iscroll[4];
  487.      double dscroll[4];
  488.     } info;
  489. } Tix_ScrollInfo;
  490.  
  491. typedef struct Tix_IntScrollInfo {
  492.     int type;        /* TIX_SCROLL_INT */
  493.     LangCallback *command;
  494.  
  495.     int total;        /* total size (width or height) of the widget*/
  496.     int window;        /* visible size */
  497.     int offset;        /* The top/left side of the scrolled widget */
  498.     int unit;        /* How much should we scroll when the user
  499.              * press the arrow on a scrollbar? */
  500.  
  501. } Tix_IntScrollInfo;
  502.  
  503. typedef struct Tix_DoubleScrollInfo {
  504.     int type;        /* TIX_SCROLL_DOUBLE */
  505.     LangCallback *command;
  506.  
  507.     double total;    /* total size (width or height) of the widget*/
  508.     double window;    /* visible size */
  509.     double offset;    /* The top/left side of the scrolled widget */
  510.     double unit;    /* How much should we scroll when the user
  511.              * press the arrow on a scrollbar? */
  512. } Tix_DoubleScrollInfo;
  513.  
  514. /*----------------------------------------------------------------------
  515.  *
  516.  *        Global variables
  517.  *
  518.  * Should be used only in the Tix library. Some systems don't support
  519.  * exporting of global variables from shared libraries.
  520.  *
  521.  *----------------------------------------------------------------------
  522.  */
  523. EXTERN Tk_Uid tixNormalUid;
  524. EXTERN Tk_Uid tixDisabledUid;
  525. EXTERN Tk_Uid tixCellUid;
  526. EXTERN Tk_Uid tixRowUid;
  527. EXTERN Tk_Uid tixColumnUid;
  528.  
  529. #define FLAG_READONLY    0
  530. #define FLAG_STATIC    1
  531. #define FLAG_FORCECALL    2
  532.  
  533. /*----------------------------------------------------------------------
  534.  *
  535.  *
  536.  *            MEGA-WIDGET CONFIG HANDLING
  537.  *
  538.  *
  539.  *----------------------------------------------------------------------
  540.  */
  541. typedef struct _TixConfigSpec        TixConfigSpec;
  542. typedef struct _TixConfigAlias        TixConfigAlias;
  543. typedef struct _TixClassRecord        TixClassRecord;
  544.  
  545. struct _TixConfigSpec {
  546.     unsigned int isAlias    : 1;
  547.     unsigned int readOnly    : 1;
  548.     unsigned int isStatic    : 1;
  549.     unsigned int forceCall    : 1;
  550.  
  551.     char * argvName;
  552.     char * defValue;
  553.  
  554.     char * dbName;        /* The additional parts of a */
  555.     char * dbClass;        /* TixWidgetConfigSpec structure */
  556.  
  557.     char *verifyCmd;
  558.  
  559.     TixConfigSpec * realPtr;    /* valid only if this option is an alias */
  560. };
  561.  
  562. /*
  563.  * Controls the access of root widget and subwidget commands and options
  564.  */
  565. typedef struct _Tix_ExportSpec {
  566.     Tix_LinkList exportCmds;
  567.     Tix_LinkList restrictCmds;
  568.     Tix_LinkList exportOpts;
  569.     Tix_LinkList restrictOpts;
  570. } Tix_ExportSpec;
  571.  
  572. typedef struct _Tix_SubWidgetSpec {
  573.     struct _Tix_SubWidgetSpec * next;
  574.     char * name;
  575.     Tix_ExportSpec export;
  576. } Tix_SubWidgetSpec;
  577.  
  578. typedef struct _Tix_StringLink {
  579.     struct _Tix_StringLink *next;
  580.     char * string;
  581. } Tix_StringLink;
  582.  
  583. typedef struct _Tix_SubwidgetDef {
  584.     struct _TixSubwidgetDef * next;
  585.     char * spec;
  586.     char * value;
  587. } Tix_SubwidgetDef;
  588.  
  589. typedef struct _TixClassParseStruct {
  590.     char * alias;
  591.     char * ClassName;
  592.     char * configSpec;
  593.     char * def;
  594.     char * flag;
  595.     char * forceCall;
  596.     char * method;
  597.     char * readOnly;
  598.     char * isStatic;
  599.     char * superClass;
  600.     char * subWidget;
  601.     char * isVirtual;
  602.  
  603.     int        optArgc;
  604.     char ** optArgv;
  605. } TixClassParseStruct;
  606.  
  607. struct _TixClassRecord {
  608.     TixClassRecord    * next;        /* Chains to the next class record in
  609.                      * a superClass's unInitSubCls list */
  610.     TixClassRecord    * superClass;    /* The superclass of this class. Is
  611.                      * NULL if this class does not have
  612.                      * a superclass. */
  613.     unsigned int    isWidget;    /* TRUE iff this class is created by
  614.                      * the "tixWidgetClass" command */
  615.     char          * className;    /* Instiantiation command */
  616.     char          * ClassName;    /* used in TK option database */
  617.  
  618.     int            nSpecs;
  619.     TixConfigSpec    ** specs;
  620.     int            nMethods;
  621.     char         ** methods;
  622.     Tk_Window        mainWindow;    /* This variable is essentially
  623.                      * a cached variable so that
  624.                      * we can advoid calling
  625.                      * Tk_MainWindow() */
  626.     int            isVirtual;    /* is this a virtual base class
  627.                      * (shouldn't be instantiated)*/
  628.     TixClassParseStruct*parsePtr;    /* Information supplied by the
  629.                      * tixClass or tixWidgetClass
  630.                      * commands */
  631.     Tix_LinkList    unInitSubCls;    /* The subclasses that have not been
  632.                      * initialized. */
  633.     int            initialized;    /* Is this class initialized? A class
  634.                      * is not initialized if it has been
  635.                      * defined but some its superclass
  636.                      * is not initialized.
  637.                      */
  638.     Tix_LinkList    subWDefs;    /* the -defaults option */
  639. #if USE_ACCESS_CONTROL
  640.     Tix_LinkList    subWidgets;
  641.     Tix_ExportSpec    exportSpec;    /* controls the export status
  642.                      * of the commands and options
  643.                      * of the root widget */
  644. #endif
  645. };
  646.  
  647. typedef struct _TixInterpState {
  648.     char * result;
  649.     char * errorInfo;
  650.     char * errorCode;
  651. } TixInterpState;
  652.  
  653. /*----------------------------------------------------------------------
  654.  *
  655.  *        Internal procedures
  656.  *
  657.  *----------------------------------------------------------------------
  658.  */
  659.  
  660. EXTERN int        Tix_CallConfigMethod _ANSI_ARGS_((
  661.                 Tcl_Interp *interp, TixClassRecord *cPtr,
  662.                 char * widRec, TixConfigSpec *spec, char * value));
  663. EXTERN int        Tix_CallMethod _ANSI_ARGS_((Tcl_Interp *interp,
  664.                 char *context, char *widRec, char *method,
  665.                 int argc, Tcl_Obj *CONST *objv));
  666. EXTERN int        Tix_ChangeOneOption _ANSI_ARGS_((
  667.                 Tcl_Interp *interp, TixClassRecord *cPtr,
  668.                 char * widRec, TixConfigSpec *spec, char * value,
  669.                 int isDefault, int isInit));
  670. EXTERN int        Tix_ChangeOptions _ANSI_ARGS_((
  671.                 Tcl_Interp *interp, TixClassRecord *cPtr,
  672.                 char * widRec, int argc, Tcl_Obj *CONST *objv));
  673. EXTERN TixConfigSpec *    Tix_FindConfigSpecByName _ANSI_ARGS_((
  674.                 Tcl_Interp * interp,
  675.                 TixClassRecord * cPtr, char * name));
  676. EXTERN char  *        Tix_FindMethod _ANSI_ARGS_((Tcl_Interp *interp,
  677.                 char *context, char *method));
  678. EXTERN char *        Tix_FindPublicMethod _ANSI_ARGS_((
  679.                 Tcl_Interp *interp, TixClassRecord * cPtr,
  680.                 char * method));
  681. EXTERN int        Tix_GetChars _ANSI_ARGS_((Tcl_Interp *interp,
  682.                 char *string, double *doublePtr));
  683. EXTERN char  *        Tix_GetConfigSpecFullName _ANSI_ARGS_((char *clasRec,
  684.                 char *flag));
  685. EXTERN char *        Tix_GetContext _ANSI_ARGS_((
  686.                 Tcl_Interp * interp, char * widRec));
  687. EXTERN char  *        Tix_GetMethodFullName _ANSI_ARGS_((char *context,
  688.                 char *method));
  689. EXTERN void        Tix_GetPublicMethods _ANSI_ARGS_((Tcl_Interp *interp,
  690.                 char *widRec, int *numMethods,
  691.                 char *** validMethods));
  692. EXTERN int        Tix_GetWidgetOption _ANSI_ARGS_((
  693.                 Tcl_Interp *interp, Tk_Window tkwin,
  694.                 char *argvName, char *dbName, char *dbClass,
  695.                 char *defValue, int argc, Tcl_Obj *CONST *objv,
  696.                 int type, char *ptr));
  697. EXTERN int        Tix_GetVar _ANSI_ARGS_((
  698.                 Tcl_Interp *interp, TixClassRecord *cPtr,
  699.                 char * widRec, char * flag));
  700. EXTERN int        Tix_QueryAllOptions _ANSI_ARGS_((
  701.                 Tcl_Interp *interp, TixClassRecord * cPtr,
  702.                 char *widRec));
  703. EXTERN int        Tix_QueryOneOption _ANSI_ARGS_((
  704.                 Tcl_Interp *interp, TixClassRecord *cPtr,
  705.                 char *widRec, char *flag));
  706. EXTERN int        Tix_SuperClass _ANSI_ARGS_((Tcl_Interp *interp,
  707.                 char *widClass, char ** superClass_ret));
  708. EXTERN int        Tix_UnknownPublicMethodError _ANSI_ARGS_((
  709.                 Tcl_Interp *interp, TixClassRecord * cPtr,
  710.                 char * widRec, char * method));
  711. EXTERN int        Tix_ValueMissingError _ANSI_ARGS_((Tcl_Interp *interp,
  712.                 char *spec));
  713. EXTERN void        Tix_AddDItemType _ANSI_ARGS_((
  714.                 Tix_DItemInfo * diTypePtr));
  715. EXTERN int        Tix_ConfigureInfo2 _ANSI_ARGS_((
  716.                 Tcl_Interp *interp, Tk_Window tkwin,
  717.                 char *entRec, Tk_ConfigSpec *entConfigSpecs,
  718.                 Tix_DItem * iPtr, char *argvName, int flags));
  719. EXTERN int        Tix_ConfigureValue2 _ANSI_ARGS_((Tcl_Interp *interp,
  720.                 Tk_Window tkwin, char * entRec,
  721.                 Tk_ConfigSpec *entConfigSpecs, Tix_DItem * iPtr,
  722.                 char *argvName, int flags));
  723. EXTERN void        Tix_DItemCalculateSize _ANSI_ARGS_((
  724.                 Tix_DItem * iPtr));
  725. EXTERN char *        Tix_DItemComponent _ANSI_ARGS_((Tix_DItem * diPtr,
  726.                 int x, int y));
  727. EXTERN int        Tix_DItemConfigure _ANSI_ARGS_((
  728.                 Tix_DItem * diPtr, int argc,
  729.                 Tcl_Obj *CONST *objv, int flags));
  730. EXTERN Tix_DItem *    Tix_DItemCreate _ANSI_ARGS_((Tix_DispData * ddPtr,
  731.                 char * type));
  732. EXTERN void        Tix_DItemDrawBackground _ANSI_ARGS_((
  733.                 Pixmap pixmap, GC gc, Tix_DItem * iPtr,
  734.                 int x, int y, int width, int height, int flags));
  735. EXTERN void        Tix_DItemDisplay _ANSI_ARGS_((
  736.                 Pixmap pixmap, GC gc, Tix_DItem * iPtr,
  737.                 int x, int y, int width, int height, int flag));
  738. EXTERN void        Tix_DItemFree _ANSI_ARGS_((
  739.                 Tix_DItem * iPtr));
  740. EXTERN void        TixDItemStyleChanged _ANSI_ARGS_((
  741.                 Tix_DItemInfo * diTypePtr,
  742.                 Tix_DItemStyle * stylePtr));
  743. EXTERN void        TixDItemStyleFree  _ANSI_ARGS_((Tix_DItem *iPtr,
  744.                 Tix_DItemStyle * stylePtr));
  745. EXTERN void        TixDItemGetAnchor _ANSI_ARGS_((Tk_Anchor anchor,
  746.                 int x, int y, int cav_w, int cav_h,
  747.                 int width, int height, int * x_ret, int * y_ret));
  748. EXTERN void        Tix_FreeArgumentList _ANSI_ARGS_((
  749.                 Tix_ArgumentList *argListPtr));
  750. EXTERN void        TixGetColorDItemGC _ANSI_ARGS_((
  751.                 Tix_DItem * iPtr, GC * backGC_ret,
  752.                 GC * foreGC_ret, int flags));
  753. EXTERN Tix_DItemStyle*    TixGetDefaultDItemStyle _ANSI_ARGS_((
  754.                 Tix_DispData * ddPtr, Tix_DItemInfo * diTypePtr,
  755.                 Tix_DItem *iPtr, Tix_DItemStyle* oldStylePtr));
  756. EXTERN Tix_DItemInfo *    Tix_GetDItemType _ANSI_ARGS_((
  757.                 Tcl_Interp * interp, char *type));
  758. EXTERN void        Tix_GetScrollFractions _ANSI_ARGS_((
  759.                 Tix_ScrollInfo * siPtr,
  760.                 double * first_ret, double * last_ret));
  761. EXTERN void        Tix_InitScrollInfo  _ANSI_ARGS_((
  762.                 Tix_ScrollInfo * siPtr, int type));
  763. EXTERN int        Tix_MultiConfigureInfo _ANSI_ARGS_((
  764.                 Tcl_Interp * interp,
  765.                 Tk_Window tkwin, Tk_ConfigSpec **specsList,
  766.                 int numLists, char **widgRecList, char *argvName,
  767.                 int flags, int request));
  768. EXTERN void        Tix_SetDefaultStyleTemplate _ANSI_ARGS_((
  769.                 Tk_Window tkwin, Tix_StyleTemplate * tmplPtr));
  770. EXTERN int        Tix_SetScrollBarView _ANSI_ARGS_((
  771.                 Tcl_Interp *interp, Tix_ScrollInfo * siPtr,
  772.                 int argc, Tcl_Obj *CONST *objv, int compat));
  773. EXTERN void        Tix_SetWindowItemSerial _ANSI_ARGS_((
  774.                 Tix_LinkList * lPtr, Tix_DItem * iPtr,
  775.                 int serial));
  776. EXTERN int        Tix_SplitConfig _ANSI_ARGS_((Tcl_Interp * interp,
  777.                 Tk_Window tkwin, Tk_ConfigSpec  ** specsList,
  778.                 int numLists, int argc, Tcl_Obj *CONST *objv,
  779.                 Tix_ArgumentList * argListPtr));
  780. EXTERN void        Tix_UnmapInvisibleWindowItems _ANSI_ARGS_((
  781.                 Tix_LinkList * lPtr, int serial));
  782. EXTERN void        Tix_UpdateScrollBar  _ANSI_ARGS_((
  783.                 Tcl_Interp *interp, Tix_ScrollInfo * siPtr));
  784. EXTERN int        Tix_WidgetConfigure2 _ANSI_ARGS_((
  785.                 Tcl_Interp *interp, Tk_Window tkwin, char * entRec,
  786.                 Tk_ConfigSpec *entConfigSpecs,
  787.                 Tix_DItem * iPtr, int argc, Tcl_Obj *CONST *objv,
  788.                 int flags, int forced, int * sizeChanged_ret));
  789. EXTERN void        Tix_WindowItemListRemove  _ANSI_ARGS_((
  790.                 Tix_LinkList * lPtr, Tix_DItem * iPtr));
  791.  
  792. typedef struct _TixpSubRegion TixpSubRegion;
  793.  
  794. struct _TixpSubRegion {
  795.     Pixmap pixmap;
  796.     int origX, origY;
  797.     int x, y;
  798.     int width, height;
  799. };
  800.  
  801. /*
  802.  * Functions that should be used by Tix only. Functions prefixed by "Tix"
  803.  * are generic functions that has one implementation for all platforms.
  804.  * Functions prefixed with "Tixp" requires one implementation on each
  805.  * platform.
  806.  */
  807.  
  808. extern int        TixInitSam _ANSI_ARGS_((Tcl_Interp * interp));
  809. extern int        TixLoadLibrary _ANSI_ARGS_((Tcl_Interp * interp));
  810. extern void        TixRestoreInterpState _ANSI_ARGS_((
  811.                 Tcl_Interp * interp, TixInterpState * statePtr));
  812. extern void        TixSaveInterpState _ANSI_ARGS_((Tcl_Interp * interp,
  813.                 TixInterpState * statePtr));
  814.  
  815. extern void        TixpDrawAnchorLines _ANSI_ARGS_((Display *display,
  816.                 Drawable drawable, GC gc, int x, int y,
  817.                 int w, int h));
  818. extern void        TixpDrawTmpLine _ANSI_ARGS_((int x1, int y1,
  819.                 int x2, int y2, Tk_Window tkwin));
  820. extern void        TixpEndSubRegionDraw _ANSI_ARGS_((Display *display,
  821.                  Drawable drawable, GC gc,
  822.                  TixpSubRegion * subRegPtr));
  823. extern int        TixpSetWindowParent _ANSI_ARGS_((Tcl_Interp * interp,
  824.                 Tk_Window tkwin, Tk_Window newParent,
  825.                 int parentId));
  826. extern void        TixpStartSubRegionDraw _ANSI_ARGS_((Tix_DispData *ddPtr,
  827.                  Drawable drawable, GC gc,
  828.                  TixpSubRegion * subRegPtr, int origX,
  829.                  int origY, int x, int y, int width, int height,
  830.                  int needWidth, int needHeight));
  831. extern void        TixpSubRegDisplayText _ANSI_ARGS_((Display *display,
  832.                 Drawable drawable, GC gc,
  833.                 TixpSubRegion * subRegPtr,
  834.                 TixFont font, char *string,
  835.                 int numChars, int x, int y, int length,
  836.                 Tk_Justify justify, int underline));
  837. extern void        TixpSubRegDrawBitmap _ANSI_ARGS_((Display *display,
  838.                 Drawable drawable, GC gc,
  839.                 TixpSubRegion * subRegPtr, Pixmap bitmap,
  840.                 int src_x, int src_y, int width, int height,
  841.                 int dest_x, int dest_y, unsigned long plane));
  842. extern void         TixpSubRegDrawImage _ANSI_ARGS_((
  843.                 TixpSubRegion * subRegPtr, Tk_Image image,
  844.                 int imageX, int imageY, int width, int height,
  845.                 Drawable drawable, int drawableX, int drawableY));
  846. extern void        TixpSubRegFillRectangle _ANSI_ARGS_((Display *display,
  847.                 Drawable drawable, GC gc,
  848.                 TixpSubRegion * subRegPtr, int x, int y,
  849.                 int width, int height));
  850.  
  851. /* These functions are also, and originaly declared in tixPort.h but
  852.  * that would mean even more Vtables
  853.  */
  854.  
  855. EXTERN void        TixComputeTextGeometry _ANSI_ARGS_((
  856.                 TixFont fontStructPtr, char *string,
  857.                 int numChars, int wrapLength, int *widthPtr,
  858.                 int *heightPtr));
  859. EXTERN void        TixDisplayText _ANSI_ARGS_((Display *display,
  860.                 Drawable drawable, TixFont font,
  861.                 char *string, int numChars, int x, int y,
  862.                 int length, Tk_Justify justify, int underline,
  863.                 GC gc));
  864. EXTERN Tcl_HashTable *    TixGetHashTable _ANSI_ARGS_((Tcl_Interp * interp,
  865.                 char * name, Tcl_InterpDeleteProc *deleteProc));
  866.  
  867. /*
  868.  * built-in strdup is not compatible with the tcl memory allocator. We
  869.  * replace all strdup calls with tixStrDup.
  870.  */
  871. #define NO_STRDUP 1
  872. extern char *tixStrDup _ANSI_ARGS_(( CONST char * s));
  873.  
  874. /*
  875.  * Console Stuff
  876.  * (these are declared with the EXTERN in win/winMain.c but without it
  877.  * in generic/tkConsole.c)
  878.  */
  879. EXTERN void        TkConsoleCreate _ANSI_ARGS_((void));
  880. EXTERN int        TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
  881.  
  882. #define TixConsoleCreate(x)    TkConsoleCreate()
  883. #define TixConsoleInit(x)    TkConsoleInit(x)
  884.  
  885. #endif /* _TIXINT */
  886.  
  887.