home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / Tk / pTk / tixInt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-10  |  27.6 KB  |  870 lines

  1. /*
  2.  * tixInt.h --
  3.  *
  4.  *    Defines internal data types and functions used by the Tix library.
  5.  *
  6.  * Copyright (c) 1996, Expert Interface Technologies
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  */
  12. #ifndef _TIX
  13. #include "tix.h"
  14. #endif
  15. #ifndef _TIXINT
  16. #define _TIXINT
  17. #define _TIX_INT_H_
  18.  
  19. /*----------------------------------------------------------------------
  20.  *
  21.  *        Tix Display Item Types
  22.  *
  23.  *----------------------------------------------------------------------
  24.  */
  25.  
  26. #define TIX_DITEM_NONE            0
  27. #define TIX_DITEM_TEXT            1
  28. #define TIX_DITEM_IMAGETEXT        2
  29. #define TIX_DITEM_WINDOW        3
  30. #define TIX_DITEM_IMAGE            4
  31.  
  32. /*
  33.  * The flags for drawing DItems
  34.  */
  35.  
  36. #define TIX_DITEM_NORMAL_BG        (0x1 <<     0)
  37. #define TIX_DITEM_ACTIVE_BG        (0x1 <<     1)
  38. #define TIX_DITEM_SELECTED_BG        (0x1 <<     2)
  39. #define TIX_DITEM_DISABLED_BG        (0x1 <<     3)
  40. #define TIX_DITEM_NORMAL_FG        (0x1 <<     4)
  41. #define TIX_DITEM_ACTIVE_FG        (0x1 <<     5)
  42. #define TIX_DITEM_SELECTED_FG        (0x1 <<     6)
  43. #define TIX_DITEM_DISABLED_FG        (0x1 <<     7)
  44. #define TIX_DITEM_FONT            (0x1 <<     8)
  45. #define TIX_DITEM_PADX            (0x1 <<     9)
  46. #define TIX_DITEM_PADY            (0x1 << 10)
  47.  
  48. #if  0
  49.     /*
  50.      * %bordercolor not used
  51.      */
  52. #define TIX_DITEM_BORDER_COLOR        (0x1 << 11)
  53. #define TIX_DITEM_BORDER_WIDTH        (0x1 << 12)
  54. #define TIX_DITEM_RELIEF        (0x1 << 13)
  55. #define TIX_DITEM_BOTTOM        (0x1 << 14)
  56. #define TIX_DITEM_RIGHT            (0x1 << 15)
  57. #endif
  58.  
  59. #define TIX_DONT_CALL_CONFIG        TK_CONFIG_USER_BIT
  60.  
  61. /*
  62.  * These values are used ONLY for indexing the color array in
  63.  * Tix_StyleTemplate
  64.  */
  65.  
  66. #define TIX_DITEM_NORMAL        0
  67. #define TIX_DITEM_ACTIVE        1
  68. #define TIX_DITEM_SELECTED        2
  69. #define TIX_DITEM_DISABLED        3
  70.  
  71. /*
  72.  * Flags for MultiInfo
  73.  */
  74. #define TIX_CONFIG_INFO            1
  75. #define TIX_CONFIG_VALUE        2
  76.  
  77. typedef union  Tix_DItem        Tix_DItem;
  78. typedef union  Tix_DItemStyle        Tix_DItemStyle;
  79. typedef struct Tix_DItemInfo        Tix_DItemInfo;
  80. typedef struct Tix_DispData        Tix_DispData;
  81. typedef struct Tix_StyleTemplate    Tix_StyleTemplate;
  82.  
  83. typedef void        Tix_DItemCalculateSizeProc  _ANSI_ARGS_((
  84.                 Tix_DItem * iPtr));
  85. typedef char *        Tix_DItemComponentProc _ANSI_ARGS_((
  86.                 Tix_DItem * iPtr, int x, int y));
  87. typedef int        Tix_DItemConfigureProc _ANSI_ARGS_((
  88.                 Tix_DItem * iPtr, int argc, Arg *args,
  89.                 int flags));
  90. typedef Tix_DItem *    Tix_DItemCreateProc _ANSI_ARGS_((
  91.                 Tix_DispData * ddPtr,
  92.                 Tix_DItemInfo * diTypePtr));
  93. typedef void        Tix_DItemDisplayProc  _ANSI_ARGS_((
  94.                 Pixmap pixmap, GC gc, Tix_DItem * iPtr,
  95.                 int x, int y, int width, int height, int flag));
  96. typedef void        Tix_DItemFreeProc  _ANSI_ARGS_((Tix_DItem * diPtr));
  97. typedef void        Tix_DItemSizeChangedProc  _ANSI_ARGS_((
  98.                 Tix_DItem * iPtr));
  99.  
  100. typedef void        Tix_DItemStyleChangedProc  _ANSI_ARGS_((
  101.                 Tix_DItem * iPtr));
  102. typedef void        Tix_DItemLostStyleProc    _ANSI_ARGS_((
  103.                 Tix_DItem * iPtr));
  104. typedef int        Tix_DItemStyleConfigureProc _ANSI_ARGS_((
  105.                 Tix_DItemStyle* style, int argc, Arg *args,
  106.                 int flags));
  107. typedef Tix_DItemStyle*    Tix_DItemStyleCreateProc _ANSI_ARGS_((
  108.                 Tcl_Interp * interp, Tk_Window tkwin,
  109.                 Tix_DItemInfo * diTypePtr, char * name));
  110. typedef void        Tix_DItemStyleFreeProc _ANSI_ARGS_((
  111.                 Tix_DItemStyle* style));
  112. typedef void        Tix_DItemStyleSetTemplateProc _ANSI_ARGS_((
  113.                 Tix_DItemStyle* style,
  114.                 Tix_StyleTemplate * tmplPtr));
  115.  
  116. /*
  117.  * These are debugging routines
  118.  */
  119.  
  120. typedef int        Tix_DItemRefCountProc _ANSI_ARGS_(());
  121. typedef int        Tix_DItemStyleRefCountProc _ANSI_ARGS_(());
  122.  
  123. /*----------------------------------------------------------------------
  124.  * Tix_DItemInfo --
  125.  *
  126.  *    This structure is used to register a new display item (call
  127.  *    Tix_AddDItemType).
  128.  *----------------------------------------------------------------------
  129.  */
  130. struct Tix_DItemInfo {
  131.     char * name;
  132.     int type;
  133.  
  134.     /*
  135.      * These procedures communicate with the items
  136.      */
  137.     Tix_DItemCreateProc * createProc;
  138.     Tix_DItemConfigureProc * configureProc;
  139.     Tix_DItemCalculateSizeProc * calculateSizeProc;
  140.     Tix_DItemComponentProc * componentProc;
  141.     Tix_DItemDisplayProc * displayProc;
  142.     Tix_DItemFreeProc * freeProc;
  143.     Tix_DItemStyleChangedProc *styleChangedProc;
  144.     Tix_DItemLostStyleProc * lostStyleProc;
  145.  
  146.     /*
  147.      * These procedures communicate with the styles
  148.      */
  149.     Tix_DItemStyleCreateProc * styleCreateProc;
  150.     Tix_DItemStyleConfigureProc * styleConfigureProc;
  151.     Tix_DItemStyleFreeProc * styleFreeProc;
  152.     Tix_DItemStyleSetTemplateProc * styleSetTemplateProc;
  153.  
  154.     Tk_ConfigSpec * itemConfigSpecs;
  155.     Tk_ConfigSpec * styleConfigSpecs;
  156.     struct Tix_DItemInfo * next;
  157. };
  158.  
  159. /*----------------------------------------------------------------------
  160.  * Tix_DispData --
  161.  *
  162.  *    Information needed by the display types to display the item in
  163.  *    an X drawable.
  164.  *----------------------------------------------------------------------
  165.  */
  166. struct Tix_DispData {
  167.     Display * display;
  168.     Tcl_Interp * interp;
  169.     Tk_Window tkwin;
  170.     Tix_DItemSizeChangedProc * sizeChangedProc;
  171. };
  172.  
  173. /*----------------------------------------------------------------------
  174.  * Tix_StyleTemplate --
  175.  *
  176.  *    A StyleTemplate is used to set the values of the default styles
  177.  *    associated with a widget
  178.  *----------------------------------------------------------------------
  179.  */
  180. struct Tix_StyleTemplate {
  181.     int flags;            /* determines which field is valid */
  182.  
  183.     struct {
  184.     XColor * bg;
  185.     XColor * fg;
  186.     } colors[4];        /* colors for the four basic modes*/
  187.  
  188.     int pad[2];
  189. #if 0
  190.     /* %bordercolor not used */
  191.     XColor * borderColor;
  192.     Tix_Relief relief;
  193.     int borderWidth;
  194. #endif
  195.     TixFont font;
  196. };
  197.  
  198. /*----------------------------------------------------------------------
  199.  *
  200.  *
  201.  *            Display Item Types
  202.  *
  203.  *
  204.  *----------------------------------------------------------------------
  205.  */
  206.  
  207. /*
  208.  *  Display Styles
  209.  */
  210. typedef struct TixBaseStyle        TixBaseStyle;
  211. typedef struct TixImageTextStyle    TixImageTextStyle;
  212. typedef struct TixImageStyle        TixImageStyle;
  213. typedef struct TixTextStyle        TixTextStyle;
  214. typedef struct TixWindowStyle        TixWindowStyle;
  215.  
  216. typedef struct TixBaseItem        TixBaseItem;
  217. typedef struct TixColorStyle        TixColorStyle;
  218. typedef struct TixImageTextItem        TixImageTextItem;
  219. typedef struct TixImageItem        TixImageItem;
  220. typedef struct TixTextItem        TixTextItem;
  221. typedef struct TixWindowItem        TixWindowItem;
  222.  
  223. /*----------------------------------------------------------------------
  224.  * TixBaseItem --
  225.  *
  226.  *    This is the abstract base class for all display items. All
  227.  *    display items should have the data members defined in the
  228.  *    BaseItem structure
  229.  *----------------------------------------------------------------------
  230.  */
  231. #define ITEM_COMMON_MEMBERS \
  232.     Tix_DItemInfo * diTypePtr; \
  233.     Tix_DispData * ddPtr; \
  234.     ClientData clientData; \
  235.     int size[2]            /* Size of this element */ \
  236.  
  237. struct TixBaseItem {
  238.     ITEM_COMMON_MEMBERS;
  239.     TixBaseStyle * stylePtr;
  240. };
  241.  
  242. /*----------------------------------------------------------------------
  243.  * TixBaseStyle --
  244.  *
  245.  *    This is the abstract base class for all display styles. All
  246.  *    display items should have the data members defined in the
  247.  *    BaseStyle structure.  The common members are initialized by
  248.  *    tixDiStyle.c
  249.  *
  250.  *----------------------------------------------------------------------
  251.  */
  252.  
  253. #define STYLE_COMMON_MEMBERS \
  254.     Tcl_Command styleCmd;    /* Token for style's command. */ \
  255.     Tcl_HashTable items;    /* Ditems affected by this style */ \
  256.     int refCount;        /* Number of ditems affected by this style */\
  257.     int flags;            /* Various attributes */ \
  258.     Tcl_Interp *interp;        /* Interpreter associated with style. */ \
  259.     Tk_Window tkwin;        /* Window associated with this style */ \
  260.     Tix_DItemInfo * diTypePtr; \
  261.     Tk_Anchor anchor;        /* Anchor information */ \
  262.     char * name;        /* Name of this style */ \
  263.     int pad[2]            /* paddings */ 
  264.  
  265.  
  266. #if 0
  267.     Tix_Relief relief
  268.     /* %bordercolor not used */
  269.     int borderWidth; 
  270.     XColor * borderColor;    /* color of the border when it is displayed 
  271.                  * in "flat border" mode 
  272.                  */ 
  273.     GC borderGC
  274. #endif
  275.  
  276. #define STYLE_COLOR_MEMBERS \
  277.     struct { \
  278.     XColor * bg; \
  279.     XColor * fg; \
  280.     GC foreGC;   \
  281.     GC backGC;   \
  282.     } colors[4]            /* colors and GC's for the four basic modes*/
  283.  
  284. struct TixBaseStyle {
  285.     STYLE_COMMON_MEMBERS;
  286. };
  287.  
  288. #define TIX_STYLE_DELETED 1
  289. #define TIX_STYLE_DEFAULT 2
  290.  
  291. /*
  292.  * Abstract type for all styles that have a color element
  293.  */
  294. struct TixColorStyle {
  295.     STYLE_COMMON_MEMBERS;
  296.     STYLE_COLOR_MEMBERS;
  297. };
  298.  
  299. /*----------------------------------------------------------------------
  300.  * ImageTextItem --
  301.  *
  302.  *    Display an image together with a text string
  303.  *----------------------------------------------------------------------
  304.  */
  305. struct TixImageTextItem {
  306.     ITEM_COMMON_MEMBERS;
  307.  
  308.     TixImageTextStyle *stylePtr;
  309.     /*-------------------------*/
  310.     /*     Bitmap           */
  311.     /*-------------------------*/
  312.     Pixmap bitmap;
  313.     int bitmapW, bitmapH;    /* Size of bitmap */
  314.  
  315.     /*-------------------------*/
  316.     /*     Image           */
  317.     /*-------------------------*/
  318.     char *imageString;        /* Name of image to display (malloc'ed), or
  319.                  * NULL.  If non-NULL, bitmap, text, and
  320.                  * textVarName are ignored. */
  321.     Tk_Image image;
  322.     int imageW, imageH;        /* Size of image */
  323.  
  324.     /*-------------------------*/
  325.     /*     Text          */
  326.     /*-------------------------*/
  327.  
  328.     Arg text;        /* Show descriptive text */
  329.     size_t numChars;        /* Size of text */
  330.     int textW, textH;
  331.     int wrapLength;
  332.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  333.     int underline;        /* Index of character to underline.  < 0 means
  334.                  * don't underline anything. */
  335.  
  336.     int showImage, showText;
  337. };
  338.  
  339. struct TixImageTextStyle {
  340.     STYLE_COMMON_MEMBERS;
  341.     STYLE_COLOR_MEMBERS;
  342.     int wrapLength;
  343.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  344.     TixFont font;
  345.     int gap;            /* Gap between text and image */
  346. };
  347.  
  348. /*----------------------------------------------------------------------
  349.  * ImageItem --
  350.  *
  351.  *    Displays an image
  352.  *----------------------------------------------------------------------
  353.  */
  354. struct TixImageItem {
  355.     ITEM_COMMON_MEMBERS;
  356.  
  357.     TixImageStyle *stylePtr;
  358.  
  359.     /*-------------------------*/
  360.     /*     Image           */
  361.     /*-------------------------*/
  362.     char *imageString;        /* Name of image to display (malloc'ed), or
  363.                  * NULL.  If non-NULL, bitmap, text, and
  364.                  * textVarName are ignored. */
  365.     Tk_Image image;
  366.     int imageW, imageH;        /* Size of image */
  367. };
  368.  
  369. struct TixImageStyle {
  370.     STYLE_COMMON_MEMBERS;
  371.     STYLE_COLOR_MEMBERS;
  372. };
  373. /*----------------------------------------------------------------------
  374.  * TextItem --
  375.  *
  376.  *    Displays a text string.
  377.  *----------------------------------------------------------------------
  378.  */
  379. struct TixTextItem {
  380.     ITEM_COMMON_MEMBERS;
  381.  
  382.     TixTextStyle *stylePtr;
  383.     /*-------------------------*/
  384.     /*     Text          */
  385.     /*-------------------------*/
  386.  
  387.     Arg text;        /* Show descriptive text */
  388.     size_t numChars;        /* Size of text */
  389.     int textW, textH;
  390.     int underline;        /* Index of character to underline.  < 0 means
  391.                  * don't underline anything. */
  392. };
  393.  
  394. struct TixTextStyle {
  395.     STYLE_COMMON_MEMBERS;
  396.     STYLE_COLOR_MEMBERS;
  397.     int wrapLength;
  398.     Tk_Justify justify;        /* Justification to use for multi-line text. */
  399.     TixFont font;
  400. };
  401.  
  402. /*----------------------------------------------------------------------
  403.  * WindowItem --
  404.  *
  405.  *    Displays a window.
  406.  *----------------------------------------------------------------------
  407.  */
  408. struct TixWindowItem {
  409.     ITEM_COMMON_MEMBERS;
  410.     TixWindowStyle *stylePtr;
  411.     Tk_Window tkwin;
  412.     struct TixWindowItem * next;
  413.     int serial;
  414. };
  415.  
  416. struct TixWindowStyle {
  417.     STYLE_COMMON_MEMBERS;
  418. };
  419.  
  420. /*----------------------------------------------------------------------
  421.  * Tix_DItem and Tix_DItemStyle --
  422.  *
  423.  *    These unions just make it easy to address the internals of the
  424.  *    structures of the display items and styles. If you create a new
  425.  *    display item, you will need to do you type casting yourself.
  426.  *----------------------------------------------------------------------
  427.  */
  428. union Tix_DItem {
  429.     TixBaseItem        base;
  430.     TixImageTextItem    imagetext;
  431.     TixTextItem        text;
  432.     TixWindowItem    window;
  433.     TixImageItem    image;
  434. };
  435.  
  436. union Tix_DItemStyle {
  437.     TixBaseStyle    base;
  438.     TixColorStyle    color;
  439.     TixImageTextStyle    imagetext;
  440.     TixTextStyle    text;
  441.     TixWindowStyle    window;
  442.     TixImageStyle    image;
  443. };
  444.  
  445. #define Tix_DItemType(x)    ((x)->base.diTypePtr->type)
  446. #define Tix_DItemTypeName(x)    ((x)->base.diTypePtr->name)
  447. #define Tix_DItemWidth(x)    ((x)->base.size[0])
  448. #define Tix_DItemHeight(x)    ((x)->base.size[1])
  449. #define Tix_DItemConfigSpecs(x) ((x)->base.diTypePtr->itemConfigSpecs)
  450. #define Tix_DItemPadX(x)    ((x)->base.stylePtr->pad[0])
  451. #define Tix_DItemPadY(x)    ((x)->base.stylePtr->pad[1])
  452.  
  453. #define TIX_WIDTH  0
  454. #define TIX_HEIGHT 1
  455.  
  456. /*----------------------------------------------------------------------
  457.  * Tix_ArgumentList --
  458.  * 
  459.  *    This data structure is used to split command arguments for
  460.  *    the display item types
  461.  *----------------------------------------------------------------------
  462.  */
  463. #define FIXED_SIZE 4
  464. typedef struct {
  465.     int argc;
  466.     Arg *args;
  467. } Tix_Argument;
  468.  
  469. typedef struct {
  470.     Tix_Argument * arg;
  471.     int numLists;
  472.     Tix_Argument preAlloc[FIXED_SIZE];
  473. } Tix_ArgumentList;
  474.  
  475. /*----------------------------------------------------------------------
  476.  * Tix_ScrollInfo --
  477.  * 
  478.  *    This data structure encapsulates all the necessary operations
  479.  *    for scrolling widgets
  480.  *----------------------------------------------------------------------
  481.  */
  482. #define TIX_SCROLL_INT        1
  483. #define TIX_SCROLL_DOUBLE    2
  484.  
  485. /* abstract type */
  486. typedef struct Tix_ScrollInfo {
  487.     int type;        /* TIX_SCROLL_INT or TIX_SCROLL_DOUBLE */
  488.     LangCallback *command;
  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, Arg *args));
  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, Arg *args));
  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, Arg *args,
  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.                 Arg *args, 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, Arg *args, 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, Arg *args,
  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, Arg *args,
  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. /* 
  795.  * Functions that should be used by Tix only. Functions prefixed by "Tix"
  796.  * are generic functions that has one implementation for all platforms.
  797.  * Functions prefixed with "Tixp" requires one implementation on each
  798.  * platform.
  799.  */
  800.  
  801. EXTERN int        TixInitSam _ANSI_ARGS_((Tcl_Interp * interp));
  802. EXTERN int        TixLoadLibrary _ANSI_ARGS_((Tcl_Interp * interp));
  803. EXTERN void        TixRestoreInterpState _ANSI_ARGS_((
  804.                 Tcl_Interp * interp, TixInterpState * statePtr));
  805. EXTERN void        TixSaveInterpState _ANSI_ARGS_((Tcl_Interp * interp,
  806.                 TixInterpState * statePtr));
  807.  
  808. EXTERN void        TixpDrawAnchorLines _ANSI_ARGS_((Display *display,
  809.                 Drawable drawable, GC gc, int x, int y,
  810.                 int w, int h));
  811. EXTERN void        TixpDrawTmpLine _ANSI_ARGS_((int x1, int y1,
  812.                 int x2, int y2, Tk_Window tkwin));
  813. EXTERN void        TixpEndSubRegionDraw _ANSI_ARGS_((Display *display,
  814.                  Drawable drawable, GC gc,
  815.                  TixpSubRegion * subRegPtr));
  816. EXTERN int        TixpSetWindowParent _ANSI_ARGS_((Tcl_Interp * interp,
  817.                 Tk_Window tkwin, Tk_Window newParent,
  818.                 int parentId));
  819. EXTERN void        TixpStartSubRegionDraw _ANSI_ARGS_((Display *display,
  820.                  Drawable drawable, GC gc,
  821.                  TixpSubRegion * subRegPtr, int origX,
  822.                  int origY, int x, int y, int width, int height,
  823.                  int needWidth, int needHeight));
  824. EXTERN void        TixpSubRegDisplayText _ANSI_ARGS_((Display *display,
  825.                 Drawable drawable, GC gc,
  826.                 TixpSubRegion * subRegPtr,
  827.                 TixFont font, char *string,
  828.                 int numChars, int x, int y, int length,
  829.                 Tk_Justify justify, int underline));
  830. EXTERN void        TixpSubRegDrawBitmap _ANSI_ARGS_((Display *display,
  831.                 Drawable drawable, GC gc,
  832.                 TixpSubRegion * subRegPtr, Pixmap bitmap,
  833.                 int src_x, int src_y, int width, int height,
  834.                 int dest_x, int dest_y, unsigned long plane));
  835. EXTERN void         TixpSubRegDrawImage _ANSI_ARGS_((
  836.                 TixpSubRegion * subRegPtr, Tk_Image image,
  837.                 int imageX, int imageY, int width, int height,
  838.                 Drawable drawable, int drawableX, int drawableY));
  839. EXTERN void        TixpSubRegFillRectangle _ANSI_ARGS_((Display *display,
  840.                 Drawable drawable, GC gc,
  841.                 TixpSubRegion * subRegPtr, int x, int y,
  842.                 int width, int height));
  843.  
  844.  
  845. /*
  846.  * Console Stuff
  847.  */
  848.  
  849. #if ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION == 5))
  850.  
  851. /*
  852.  * The TixConsole stuff was implemented for Tcl 7.5 only
  853.  */
  854.  
  855. extern void        TixConsoleCreate _ANSI_ARGS_((Tcl_Interp *interp));
  856. extern int        TixConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
  857.  
  858. #else
  859.  
  860. extern void        TkConsoleCreate _ANSI_ARGS_((void));
  861. extern int        TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
  862.  
  863. #define TixConsoleCreate(x)    TkConsoleCreate()
  864. #define TixConsoleInit(x)    TkConsoleInit(x)
  865.  
  866. #endif
  867.  
  868. #endif /* _TIXINT */
  869.  
  870.