Tk Source Code

Check-in [cc4a0d4c]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:New files from René Zaumseil
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-510
Files: files | file ages | folders
SHA3-256: cc4a0d4c91c061203d712636f3d00aa01446da50a45e2e391f5bce493c25a062
User & Date: fvogel 2018-12-15 11:33:38
Context
2019-04-10
19:22
New files from René Zaumseil (branch does not compile at this point). check-in: a7c3cf8b user: fvogel tags: tip-510
2018-12-15
11:33
New files from René Zaumseil check-in: cc4a0d4c user: fvogel tags: tip-510
2018-12-03
18:59
Add a missing file from René Zaumseil check-in: 8a818458 user: fvogel tags: tip-510
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/rbc/rbcConfig.c.

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
....
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
    int offset,
    Tcl_FreeProc ** freeProcPtr);

Tk_CustomOption rbcShadowOption = {
    StringToShadow, ShadowToString, (ClientData) 0
};

static int      StringToUid(
    ClientData clientData,
    Tcl_Interp * interp,
    Tk_Window tkwin,
    const char *string,
    char *widgRec,
    int flags);
static const char *UidToString(
    ClientData clientData,
    Tk_Window tkwin,
    char *widgRec,
    int offset,
    Tcl_FreeProc ** freeProcPtr);

Tk_CustomOption rbcUidOption = {
    StringToUid, UidToString, (ClientData) 0
};

static int      StringToState(
    ClientData clientData,
    Tcl_Interp * interp,
    Tk_Window tkwin,
    const char *string,
    char *widgRec,
    int flags);
................................................................................
    if (result == dString.staticSpace) {
        result = RbcStrdup(result);
    }
    *freeProcPtr = (Tcl_FreeProc *) Tcl_Free;
    return result;
}

/*
 *----------------------------------------------------------------------
 *
 * StringToUid --
 *
 *      Converts the string to a RbcUid. RbcUid's are hashed, reference
 *      counted strings.
 *
 * Results:
 *      TODO: Results
 *
 * Side Effects:
 *      TODO: Side Effects
 *
 *----------------------------------------------------------------------
 */
static int
StringToUid(
    ClientData clientData,      /* Not used. */
    Tcl_Interp * interp,        /* Interpreter to send results back to */
    Tk_Window tkwin,            /* Not used. */
    const char *string,         /* Fill style string */
    char *widgRec,              /* Cubicle structure record */
    int offset)
{                               /* Offset of style in record */
    RbcUid         *uidPtr = (RbcUid *) (widgRec + offset);
    RbcUid          newId;

    newId = NULL;
    if ((string != NULL) && (*string != '\0')) {
        newId = RbcGetUid(string);
    }
    if (*uidPtr != NULL) {
        RbcFreeUid(*uidPtr);
    }
    *uidPtr = newId;
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * UidToString --
 *
 *      Returns the fill style string based upon the fill flags.
 *
 * Results:
 *      The fill style string is returned.
 *
 * Side Effects:
 *      TODO: Side Effects
 *
 *----------------------------------------------------------------------
 */
static const char *
UidToString(
    ClientData clientData,      /* Not used. */
    Tk_Window tkwin,            /* Not used. */
    char *widgRec,              /* Widget structure record */
    int offset,                 /* Offset of fill in widget record */
    Tcl_FreeProc ** freeProcPtr)
{                               /* Not used. */
    RbcUid          uid = *(RbcUid *) (widgRec + offset);

    return (uid == NULL) ? "" : uid;
}

/*
 *----------------------------------------------------------------------
 *
 * StringToState --
 *
 *      Converts the string to a state value. Valid states are
 *      disabled, normal.






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







172
173
174
175
176
177
178


















179
180
181
182
183
184
185
...
997
998
999
1000
1001
1002
1003



































































1004
1005
1006
1007
1008
1009
1010
    int offset,
    Tcl_FreeProc ** freeProcPtr);

Tk_CustomOption rbcShadowOption = {
    StringToShadow, ShadowToString, (ClientData) 0
};



















static int      StringToState(
    ClientData clientData,
    Tcl_Interp * interp,
    Tk_Window tkwin,
    const char *string,
    char *widgRec,
    int flags);
................................................................................
    if (result == dString.staticSpace) {
        result = RbcStrdup(result);
    }
    *freeProcPtr = (Tcl_FreeProc *) Tcl_Free;
    return result;
}




































































/*
 *----------------------------------------------------------------------
 *
 * StringToState --
 *
 *      Converts the string to a state value. Valid states are
 *      disabled, normal.

Changes to generic/rbc/rbcGrAxis.c.

413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
...
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
...
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
....
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
....
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
static int      NameToAxis(
    RbcGraph * graphPtr,
    const char *name,
    RbcAxis ** axisPtrPtr);
static int      GetAxis(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid classUid,
    RbcAxis ** axisPtrPtr);
static void     FreeAxis(
    RbcGraph * graphPtr,
    RbcAxis * axisPtr);

static int      BindOp(
    RbcGraph * graphPtr,
................................................................................
    Tcl_Interp * interp,        /* Interpreter to send results back to. */
    Tk_Window tkwin,            /* Used to look up pointer to graph. */
    const char *string,         /* String representing new value. */
    char *widgRec,              /* Pointer to structure record. */
    int offset)
{                               /* Offset of field in structure. */
    RbcAxis       **axisPtrPtr = (RbcAxis **) (widgRec + offset);
    RbcUid          classUid = *(RbcUid *) clientData;
    RbcGraph       *graphPtr;
    RbcAxis        *axisPtr;

    graphPtr = RbcGetGraphFromWindowData(tkwin);
    if (*axisPtrPtr != NULL) {
        FreeAxis(graphPtr, *axisPtrPtr);
    }
................................................................................
    Tcl_Interp * interp,        /* Interpreter to send results back to. */
    Tk_Window tkwin,            /* Used to look up pointer to graph. */
    const char *string,         /* String representing new value. */
    char *widgRec,              /* Pointer to structure record. */
    int offset)
{                               /* Offset of field in structure. */
    RbcAxis       **axisPtrPtr = (RbcAxis **) (widgRec + offset);
    RbcUid          classUid = *(RbcUid *) clientData;
    RbcGraph       *graphPtr;

    graphPtr = RbcGetGraphFromWindowData(tkwin);
    if (*axisPtrPtr != NULL) {
        FreeAxis(graphPtr, *axisPtrPtr);
    }
    if (GetAxis(graphPtr, string, classUid, axisPtrPtr) != TCL_OK) {
................................................................................
 *
 *----------------------------------------------------------------------
 */
static int
GetAxis(
    RbcGraph * graphPtr,
    const char *axisName,
    RbcUid classUid,
    RbcAxis ** axisPtrPtr)
{
    RbcAxis        *axisPtr;

    if (NameToAxis(graphPtr, axisName, &axisPtr) != TCL_OK) {
        return TCL_ERROR;
    }
................................................................................
    const char **argv)
{
    RbcChain       *chainPtr;
    int             nNames;
    const char    **names;
    RbcChainLink   *linkPtr;
    int             i;
    RbcUid          classUid;
    int             margin;

    margin = (int) argv[-1];
    chainPtr = graphPtr->margins[margin].axes;
    if (argc == 0) {
        for (linkPtr = RbcChainFirstLink(chainPtr); linkPtr != NULL;
            linkPtr = RbcChainNextLink(linkPtr)) {






|







 







|







 







|







 







|







 







|







413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
...
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
...
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
....
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
....
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
static int      NameToAxis(
    RbcGraph * graphPtr,
    const char *name,
    RbcAxis ** axisPtrPtr);
static int      GetAxis(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid classUid,
    RbcAxis ** axisPtrPtr);
static void     FreeAxis(
    RbcGraph * graphPtr,
    RbcAxis * axisPtr);

static int      BindOp(
    RbcGraph * graphPtr,
................................................................................
    Tcl_Interp * interp,        /* Interpreter to send results back to. */
    Tk_Window tkwin,            /* Used to look up pointer to graph. */
    const char *string,         /* String representing new value. */
    char *widgRec,              /* Pointer to structure record. */
    int offset)
{                               /* Offset of field in structure. */
    RbcAxis       **axisPtrPtr = (RbcAxis **) (widgRec + offset);
    Tk_Uid          classUid = *(Tk_Uid *) clientData;
    RbcGraph       *graphPtr;
    RbcAxis        *axisPtr;

    graphPtr = RbcGetGraphFromWindowData(tkwin);
    if (*axisPtrPtr != NULL) {
        FreeAxis(graphPtr, *axisPtrPtr);
    }
................................................................................
    Tcl_Interp * interp,        /* Interpreter to send results back to. */
    Tk_Window tkwin,            /* Used to look up pointer to graph. */
    const char *string,         /* String representing new value. */
    char *widgRec,              /* Pointer to structure record. */
    int offset)
{                               /* Offset of field in structure. */
    RbcAxis       **axisPtrPtr = (RbcAxis **) (widgRec + offset);
    Tk_Uid          classUid = *(Tk_Uid *) clientData;
    RbcGraph       *graphPtr;

    graphPtr = RbcGetGraphFromWindowData(tkwin);
    if (*axisPtrPtr != NULL) {
        FreeAxis(graphPtr, *axisPtrPtr);
    }
    if (GetAxis(graphPtr, string, classUid, axisPtrPtr) != TCL_OK) {
................................................................................
 *
 *----------------------------------------------------------------------
 */
static int
GetAxis(
    RbcGraph * graphPtr,
    const char *axisName,
    Tk_Uid classUid,
    RbcAxis ** axisPtrPtr)
{
    RbcAxis        *axisPtr;

    if (NameToAxis(graphPtr, axisName, &axisPtr) != TCL_OK) {
        return TCL_ERROR;
    }
................................................................................
    const char **argv)
{
    RbcChain       *chainPtr;
    int             nNames;
    const char    **names;
    RbcChainLink   *linkPtr;
    int             i;
    Tk_Uid          classUid;
    int             margin;

    margin = (int) argv[-1];
    chainPtr = graphPtr->margins[margin].axes;
    if (argc == 0) {
        for (linkPtr = RbcChainFirstLink(chainPtr); linkPtr != NULL;
            linkPtr = RbcChainNextLink(linkPtr)) {

Changes to generic/rbc/rbcGrBar.c.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
....
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
    double          value;      /* Duplicated abscissa */
    RbcAxis2D       axes;       /* Axis mapping of element */
} FreqKey;

typedef struct {
    char           *name;       /* Pen style identifier.  If NULL pen
                                 * was statically allocated. */
    RbcUid          classUid;   /* Type of pen */
    char           *typeId;     /* String token identifying the type of pen */
    unsigned int    flags;      /* Indicates if the pen element is active or
                                 * normal */
    int             refCount;   /* Reference count for elements using
                                 * this pen. */
    Tcl_HashEntry  *hashPtr;
    Tk_ConfigSpec  *specsPtr;   /* Configuration specifications */
................................................................................
} BarPenStyle;

typedef struct {
    char           *name;       /* Identifier to refer the
                                 * element. Used in the "insert",
                                 * "delete", or "show", commands. */

    RbcUid          classUid;   /* Type of element; either
                                 * rbcBarElementUid, rbcLineElementUid, or
                                 * rbcStripElementUid. */

    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Indicates if the entire element is
                                 * active, or if coordinates need to
                                 * be calculated */
................................................................................
 *
 * ----------------------------------------------------------------------
 */
RbcElement     *
RbcBarElement(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid type)
{
    register Bar   *barPtr;

    barPtr = RbcCalloc(1, sizeof(Bar));
    assert(barPtr);
    barPtr->normalPenPtr = &(barPtr->builtinPen);
    barPtr->procsPtr = &barProcs;






|







 







|







 







|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
....
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
    double          value;      /* Duplicated abscissa */
    RbcAxis2D       axes;       /* Axis mapping of element */
} FreqKey;

typedef struct {
    char           *name;       /* Pen style identifier.  If NULL pen
                                 * was statically allocated. */
    Tk_Uid          classUid;   /* Type of pen */
    char           *typeId;     /* String token identifying the type of pen */
    unsigned int    flags;      /* Indicates if the pen element is active or
                                 * normal */
    int             refCount;   /* Reference count for elements using
                                 * this pen. */
    Tcl_HashEntry  *hashPtr;
    Tk_ConfigSpec  *specsPtr;   /* Configuration specifications */
................................................................................
} BarPenStyle;

typedef struct {
    char           *name;       /* Identifier to refer the
                                 * element. Used in the "insert",
                                 * "delete", or "show", commands. */

    Tk_Uid          classUid;   /* Type of element; either
                                 * rbcBarElementUid, rbcLineElementUid, or
                                 * rbcStripElementUid. */

    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Indicates if the entire element is
                                 * active, or if coordinates need to
                                 * be calculated */
................................................................................
 *
 * ----------------------------------------------------------------------
 */
RbcElement     *
RbcBarElement(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid type)
{
    register Bar   *barPtr;

    barPtr = RbcCalloc(1, sizeof(Bar));
    assert(barPtr);
    barPtr->normalPenPtr = &(barPtr->builtinPen);
    barPtr->procsPtr = &barProcs;

Changes to generic/rbc/rbcGrElem.c.

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
....
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
....
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
....
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
static int      counter;

static RbcVectorChangedProc VectorChangedProc;

static int      GetPenStyle(
    RbcGraph * graphPtr,
    const char *string,
    RbcUid type,
    RbcPenStyle * stylePtr);
static void     SyncElemVector(
    RbcElemVector * vPtr);
static void     FindRange(
    RbcElemVector * vPtr);
static void     FreeDataVector(
    RbcElemVector * vPtr);
................................................................................
    const char *name,
    RbcElement ** elemPtrPtr);
static int      CreateElement(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    RbcUid classUid);
static void     DestroyElement(
    RbcGraph * graphPtr,
    RbcElement * elemPtr);
static int      RebuildDisplayList(
    RbcGraph * graphPtr,
    const char *newList);

................................................................................
    int argc,
    const char **argv);
static int      CreateOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    RbcUid type);
static int      ConfigureOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char *argv[]);
static int      DeactivateOp(
    RbcGraph * graphPtr,
................................................................................
 *
 *----------------------------------------------------------------------
 */
static int
GetPenStyle(
    RbcGraph * graphPtr,
    const char *string,
    RbcUid type,
    RbcPenStyle * stylePtr)
{
    RbcPen         *penPtr;
    Tcl_Interp     *interp = graphPtr->interp;
    const char    **elemArr;
    int             nElem;

................................................................................
 */
static int
CreateElement(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    RbcUid classUid)
{
    RbcElement     *elemPtr;
    Tcl_HashEntry  *hPtr;
    int             isNew;

    if (argv[3][0] == '-') {
        Tcl_AppendResult(graphPtr->interp, "name of element \"", argv[3],
................................................................................
 */
static int
CreateOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    RbcUid type)
{
    return CreateElement(graphPtr, interp, argc, argv, type);
}

/*
 *----------------------------------------------------------------------
 *
................................................................................
 */
int
RbcElementOp(
    RbcGraph * graphPtr,        /* Graph widget record */
    Tcl_Interp * interp,
    int argc,                   /* # arguments */
    const char **argv,          /* Argument list */
    RbcUid type)
{
    RbcOp           proc;
    int             result;

    proc = RbcGetOp(interp, numElemOps, elemOps, RBC_OP_ARG2, argc, argv, 0);
    if (proc == NULL) {
        return TCL_ERROR;






|







 







|







 







|







 







|







 







|







 







|







 







|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
....
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
....
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
....
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
static int      counter;

static RbcVectorChangedProc VectorChangedProc;

static int      GetPenStyle(
    RbcGraph * graphPtr,
    const char *string,
    Tk_Uid type,
    RbcPenStyle * stylePtr);
static void     SyncElemVector(
    RbcElemVector * vPtr);
static void     FindRange(
    RbcElemVector * vPtr);
static void     FreeDataVector(
    RbcElemVector * vPtr);
................................................................................
    const char *name,
    RbcElement ** elemPtrPtr);
static int      CreateElement(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    Tk_Uid classUid);
static void     DestroyElement(
    RbcGraph * graphPtr,
    RbcElement * elemPtr);
static int      RebuildDisplayList(
    RbcGraph * graphPtr,
    const char *newList);

................................................................................
    int argc,
    const char **argv);
static int      CreateOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    Tk_Uid type);
static int      ConfigureOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char *argv[]);
static int      DeactivateOp(
    RbcGraph * graphPtr,
................................................................................
 *
 *----------------------------------------------------------------------
 */
static int
GetPenStyle(
    RbcGraph * graphPtr,
    const char *string,
    Tk_Uid type,
    RbcPenStyle * stylePtr)
{
    RbcPen         *penPtr;
    Tcl_Interp     *interp = graphPtr->interp;
    const char    **elemArr;
    int             nElem;

................................................................................
 */
static int
CreateElement(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    Tk_Uid classUid)
{
    RbcElement     *elemPtr;
    Tcl_HashEntry  *hPtr;
    int             isNew;

    if (argv[3][0] == '-') {
        Tcl_AppendResult(graphPtr->interp, "name of element \"", argv[3],
................................................................................
 */
static int
CreateOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    Tk_Uid type)
{
    return CreateElement(graphPtr, interp, argc, argv, type);
}

/*
 *----------------------------------------------------------------------
 *
................................................................................
 */
int
RbcElementOp(
    RbcGraph * graphPtr,        /* Graph widget record */
    Tcl_Interp * interp,
    int argc,                   /* # arguments */
    const char **argv,          /* Argument list */
    Tk_Uid type)
{
    RbcOp           proc;
    int             result;

    proc = RbcGetOp(interp, numElemOps, elemOps, RBC_OP_ARG2, argc, argv, 0);
    if (proc == NULL) {
        return TCL_ERROR;

Changes to generic/rbc/rbcGrLegd.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 *      Contains information specific to how the legend will be
 *      displayed.
 *
 * -------------------------------------------------------------------
 */
typedef struct RbcLegend {
    unsigned int    flags;
    RbcUid          classUid;   /* Type: Element or Marker. */
    int             hidden;     /* If non-zero, don't display the legend. */
    int             raised;     /* If non-zero, draw the legend last, above
                                 * everything else. */
    int             nEntries;   /* Number of element entries in table. */
    short int       width, height;      /* Dimensions of the legend */
    short int       nColumns, nRows;    /* Number of columns and rows in legend */
    int             site;






|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 *      Contains information specific to how the legend will be
 *      displayed.
 *
 * -------------------------------------------------------------------
 */
typedef struct RbcLegend {
    unsigned int    flags;
    Tk_Uid          classUid;   /* Type: Element or Marker. */
    int             hidden;     /* If non-zero, don't display the legend. */
    int             raised;     /* If non-zero, draw the legend last, above
                                 * everything else. */
    int             nEntries;   /* Number of element entries in table. */
    short int       width, height;      /* Dimensions of the legend */
    short int       nColumns, nRows;    /* Number of columns and rows in legend */
    int             site;

Changes to generic/rbc/rbcGrLine.c.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
....
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
                        * coordinate indices back to their
                        * data coordinates */
} LineTrace;
typedef struct {
    const char *name; /* Name of pen style. If the pen was
                 * statically allocated the name will
                 * be NULL. */
    RbcUid classUid; /* Type of pen */
    char *typeId;/* String token identifying the type
                  * of pen */
    unsigned int flags; /* Indicates if the pen element is
                         * active or normal */
    int refCount; /* Reference count for elements using
                   * this pen. */
    Tcl_HashEntry *hashPtr;
................................................................................
				 * for this pen. */
    int nStrips;		/* # of line segments for this pen. */
} LinePenStyle;
typedef struct {
    char *name;			/* Identifier used to refer the
				 * element. Used in the "insert",
				 * "delete", or "show", operations. */
    RbcUid classUid;		/* Type of element */
    RbcGraph *graphPtr;		/* Graph widget of element*/
    unsigned int flags;		/* Indicates if the entire element is
				 * active, or if coordinates need to
				 * be calculated */
    char **tags;
    int hidden;			/* If non-zero, don't display the
				 * element. */
................................................................................
 *
 *----------------------------------------------------------------------
 */
RbcElement *
RbcLineElement(
    RbcGraph *graphPtr,
    const char *name,
    RbcUid classUid)
{
    register Line *linePtr;
    linePtr = RbcCalloc(1, sizeof(Line));
    assert(linePtr);
    linePtr->procsPtr = &lineProcs;
    if (classUid == rbcLineElementUid) {
        linePtr->configSpecs = lineElemConfigSpecs;






|







 







|







 







|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
....
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
                        * coordinate indices back to their
                        * data coordinates */
} LineTrace;
typedef struct {
    const char *name; /* Name of pen style. If the pen was
                 * statically allocated the name will
                 * be NULL. */
    Tk_Uid classUid; /* Type of pen */
    char *typeId;/* String token identifying the type
                  * of pen */
    unsigned int flags; /* Indicates if the pen element is
                         * active or normal */
    int refCount; /* Reference count for elements using
                   * this pen. */
    Tcl_HashEntry *hashPtr;
................................................................................
				 * for this pen. */
    int nStrips;		/* # of line segments for this pen. */
} LinePenStyle;
typedef struct {
    char *name;			/* Identifier used to refer the
				 * element. Used in the "insert",
				 * "delete", or "show", operations. */
    Tk_Uid classUid;		/* Type of element */
    RbcGraph *graphPtr;		/* Graph widget of element*/
    unsigned int flags;		/* Indicates if the entire element is
				 * active, or if coordinates need to
				 * be calculated */
    char **tags;
    int hidden;			/* If non-zero, don't display the
				 * element. */
................................................................................
 *
 *----------------------------------------------------------------------
 */
RbcElement *
RbcLineElement(
    RbcGraph *graphPtr,
    const char *name,
    Tk_Uid classUid)
{
    register Line *linePtr;
    linePtr = RbcCalloc(1, sizeof(Line));
    assert(linePtr);
    linePtr->procsPtr = &lineProcs;
    if (classUid == rbcLineElementUid) {
        linePtr->configSpecs = lineElemConfigSpecs;

Changes to generic/rbc/rbcGrMarker.c.

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
...
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
...
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
...
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
...
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
...
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
....
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
....
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
 *      Don't change this structure without changing the individual
 *      marker structures of each type below.
 *
 * -------------------------------------------------------------------
 */
typedef struct RbcMarker {
    char           *name;       /* Identifier for marker in list */
    RbcUid          classUid;   /* Type of marker. */
    RbcGraph       *graphPtr;   /* Graph widget of marker. */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* If non-zero, don't display the marker. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
    RbcPoint2D     *worldPts;   /* Coordinate array to position marker */
................................................................................
 *
 * TextMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* The graph this marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* If non-zero, don't display the
                                 * marker. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * WindowMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is
                                 * currently hidden or not. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * BitmapMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * ImageMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is
                                 * currently hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
 *
 * LineMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type is "linemarker" */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
 *
 * PolygonMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    RbcUid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
static RbcPoint2D MapPoint(
    RbcGraph * graphPtr,
    RbcPoint2D * pointPtr,
    RbcAxis2D * axesPtr);
static RbcMarker *CreateMarker(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid classUid);
static void     DestroyMarker(
    RbcMarker * markerPtr);
static int      NameToMarker(
    RbcGraph * graphPtr,
    const char *name,
    RbcMarker ** markerPtrPtr);
static int      RenameMarker(
................................................................................
 *
 *----------------------------------------------------------------------
 */
static RbcMarker *
CreateMarker(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid classUid)
{
    RbcMarker      *markerPtr;

    /* Create the new marker based upon the given type */
    if (classUid == rbcBitmapMarkerUid) {
        markerPtr = CreateBitmapMarker();       /* bitmap */
    } else if (classUid == rbcLineMarkerUid) {
................................................................................
    Tcl_Interp * interp,
    int argc,
    const char **argv)
{
    RbcMarker      *markerPtr;
    Tcl_HashEntry  *hPtr;
    int             isNew;
    RbcUid          classUid;
    register int    i;
    const char     *name;
    char            string[200];
    unsigned int    length;
    char            c;

    c = argv[3][0];






|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
...
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
...
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
...
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
...
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
...
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
....
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
....
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
 *      Don't change this structure without changing the individual
 *      marker structures of each type below.
 *
 * -------------------------------------------------------------------
 */
typedef struct RbcMarker {
    char           *name;       /* Identifier for marker in list */
    Tk_Uid          classUid;   /* Type of marker. */
    RbcGraph       *graphPtr;   /* Graph widget of marker. */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* If non-zero, don't display the marker. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
    RbcPoint2D     *worldPts;   /* Coordinate array to position marker */
................................................................................
 *
 * TextMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* The graph this marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* If non-zero, don't display the
                                 * marker. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * WindowMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is
                                 * currently hidden or not. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * BitmapMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */
    Tcl_HashEntry  *hashPtr;
    RbcChainLink   *linkPtr;
................................................................................
 *
 * ImageMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is
                                 * currently hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
 *
 * LineMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type is "linemarker" */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
 *
 * PolygonMarker --
 *
 * -------------------------------------------------------------------
 */
typedef struct {
    char           *name;       /* Identifier for marker */
    Tk_Uid          classUid;   /* Type of marker */
    RbcGraph       *graphPtr;   /* Graph marker belongs to */
    unsigned int    flags;
    char          **tags;
    int             hidden;     /* Indicates if the marker is currently
                                 * hidden or not. */

    Tcl_HashEntry  *hashPtr;
................................................................................
static RbcPoint2D MapPoint(
    RbcGraph * graphPtr,
    RbcPoint2D * pointPtr,
    RbcAxis2D * axesPtr);
static RbcMarker *CreateMarker(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid classUid);
static void     DestroyMarker(
    RbcMarker * markerPtr);
static int      NameToMarker(
    RbcGraph * graphPtr,
    const char *name,
    RbcMarker ** markerPtrPtr);
static int      RenameMarker(
................................................................................
 *
 *----------------------------------------------------------------------
 */
static RbcMarker *
CreateMarker(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid classUid)
{
    RbcMarker      *markerPtr;

    /* Create the new marker based upon the given type */
    if (classUid == rbcBitmapMarkerUid) {
        markerPtr = CreateBitmapMarker();       /* bitmap */
    } else if (classUid == rbcLineMarkerUid) {
................................................................................
    Tcl_Interp * interp,
    int argc,
    const char **argv)
{
    RbcMarker      *markerPtr;
    Tcl_HashEntry  *hPtr;
    int             isNew;
    Tk_Uid          classUid;
    register int    i;
    const char     *name;
    char            string[200];
    unsigned int    length;
    char            c;

    c = argv[3][0];

Changes to generic/rbc/rbcGrPen.c.

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
    ClientData clientData,      /* Not used. */
    Tcl_Interp * interp,        /* Interpreter to send results back to */
    Tk_Window tkwin,            /* Not used. */
    const char *string,         /* String representing pen */
    char *widgRec,              /* Widget record */
    int offset)
{                               /* Offset of pen field in record */
    RbcUid          classUid = *(RbcUid *) clientData;  /* Element type. */
    RbcPen        **penPtrPtr = (RbcPen **) (widgRec + offset);
    RbcPen         *penPtr;
    RbcGraph       *graphPtr;

    penPtr = NULL;
    graphPtr = RbcGetGraphFromWindowData(tkwin);

................................................................................
 *
 *----------------------------------------------------------------------
 */
RbcPen         *
RbcCreatePen(
    RbcGraph * graphPtr,
    const char *penName,
    RbcUid classUid,
    int nOpts,
    const char **options)
{

    RbcPen         *penPtr;
    Tcl_HashEntry  *hPtr;
    unsigned int    length, configFlags;
................................................................................
 *
 *----------------------------------------------------------------------
 */
int
RbcGetPen(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid classUid,
    RbcPen ** penPtrPtr)
{
    RbcPen         *penPtr;

    penPtr = NameToPen(graphPtr, name);
    if (penPtr == NULL) {
        return TCL_ERROR;






|







 







|







 







|







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
    ClientData clientData,      /* Not used. */
    Tcl_Interp * interp,        /* Interpreter to send results back to */
    Tk_Window tkwin,            /* Not used. */
    const char *string,         /* String representing pen */
    char *widgRec,              /* Widget record */
    int offset)
{                               /* Offset of pen field in record */
    Tk_Uid          classUid = *(Tk_Uid *) clientData;  /* Element type. */
    RbcPen        **penPtrPtr = (RbcPen **) (widgRec + offset);
    RbcPen         *penPtr;
    RbcGraph       *graphPtr;

    penPtr = NULL;
    graphPtr = RbcGetGraphFromWindowData(tkwin);

................................................................................
 *
 *----------------------------------------------------------------------
 */
RbcPen         *
RbcCreatePen(
    RbcGraph * graphPtr,
    const char *penName,
    Tk_Uid classUid,
    int nOpts,
    const char **options)
{

    RbcPen         *penPtr;
    Tcl_HashEntry  *hPtr;
    unsigned int    length, configFlags;
................................................................................
 *
 *----------------------------------------------------------------------
 */
int
RbcGetPen(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid classUid,
    RbcPen ** penPtrPtr)
{
    RbcPen         *penPtr;

    penPtr = NameToPen(graphPtr, name);
    if (penPtr == NULL) {
        return TCL_ERROR;

Changes to generic/rbc/rbcGraph.c.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
....
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
....
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
 *
 * 7) Arrows for line markers
 *
 */

#include "rbcInt.h"

RbcUid          rbcXAxisUid;
RbcUid          rbcYAxisUid;
RbcUid          rbcBarElementUid;
RbcUid          rbcLineElementUid;
RbcUid          rbcStripElementUid;
RbcUid          rbcContourElementUid;
RbcUid          rbcLineMarkerUid;
RbcUid          rbcBitmapMarkerUid;
RbcUid          rbcImageMarkerUid;
RbcUid          rbcTextMarkerUid;
RbcUid          rbcPolygonMarkerUid;
RbcUid          rbcWindowMarkerUid;

extern Tk_CustomOption rbcLinePenOption;
extern Tk_CustomOption rbcBarPenOption;
extern Tk_CustomOption rbcDistanceOption;
extern Tk_CustomOption rbcBarModeOption;
extern Tk_CustomOption rbcPadOption;
extern Tk_CustomOption rbcTileOption;
................................................................................
{
    Tcl_Class clazz;
    Tcl_Object object;
    Tcl_Obj *objPtr;
    int i;
	static const char *initScript =
		"::oo::class create ::graph {"
		" self method unknown {args} {uplevel #0 ::graph create args; return [lindex $args 0]}\n"
        " self unexport new destroy\n"
        " unexport new create destroy\n"
        "}";

    rbcBarElementUid = (RbcUid) Tk_GetUid("BarElement");
    rbcLineElementUid = (RbcUid) Tk_GetUid("LineElement");
    rbcStripElementUid = (RbcUid) Tk_GetUid("StripElement");
    rbcContourElementUid = (RbcUid) Tk_GetUid("ContourElement");

    rbcLineMarkerUid = (RbcUid) Tk_GetUid("LineMarker");
    rbcBitmapMarkerUid = (RbcUid) Tk_GetUid("BitmapMarker");
    rbcImageMarkerUid = (RbcUid) Tk_GetUid("ImageMarker");
    rbcTextMarkerUid = (RbcUid) Tk_GetUid("TextMarker");
    rbcPolygonMarkerUid = (RbcUid) Tk_GetUid("PolygonMarker");
    rbcWindowMarkerUid = (RbcUid) Tk_GetUid("WindowMarker");

    rbcXAxisUid = (RbcUid) Tk_GetUid("X");
    rbcYAxisUid = (RbcUid) Tk_GetUid("Y");

	/* Needed oo extension */
	if (Tcl_OOInitStubs(interp) == NULL) {
		return TCL_ERROR;
	}

    /* Create widget class. */
................................................................................
    Tcl_ObjectContext objectContext,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Object object;
    RbcGraph       *graphPtr;
    Tk_Window tkWin;
    RbcUid classUid = rbcLineElementUid;
    int i;
    const char *chPtr;
    int myArgc;
    const char **myArgv;

	/* Get current object. Should not fail? */
    if ((object = Tcl_ObjectContextObject(objectContext)) == NULL) {






|
|
|
|
|
|
|
|
|
|
|
|







 







|




|
|
|
|

|
|
|
|
|
|

|
|







 







|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
....
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
....
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
 *
 * 7) Arrows for line markers
 *
 */

#include "rbcInt.h"

Tk_Uid          rbcXAxisUid;
Tk_Uid          rbcYAxisUid;
Tk_Uid          rbcBarElementUid;
Tk_Uid          rbcLineElementUid;
Tk_Uid          rbcStripElementUid;
Tk_Uid          rbcContourElementUid;
Tk_Uid          rbcLineMarkerUid;
Tk_Uid          rbcBitmapMarkerUid;
Tk_Uid          rbcImageMarkerUid;
Tk_Uid          rbcTextMarkerUid;
Tk_Uid          rbcPolygonMarkerUid;
Tk_Uid          rbcWindowMarkerUid;

extern Tk_CustomOption rbcLinePenOption;
extern Tk_CustomOption rbcBarPenOption;
extern Tk_CustomOption rbcDistanceOption;
extern Tk_CustomOption rbcBarModeOption;
extern Tk_CustomOption rbcPadOption;
extern Tk_CustomOption rbcTileOption;
................................................................................
{
    Tcl_Class clazz;
    Tcl_Object object;
    Tcl_Obj *objPtr;
    int i;
	static const char *initScript =
		"::oo::class create ::graph {"
		" self method unknown {args} {uplevel #0 ::graph create $args; return [lindex $args 0]}\n"
        " self unexport new destroy\n"
        " unexport new create destroy\n"
        "}";

    rbcBarElementUid = Tk_GetUid("BarElement");
    rbcLineElementUid = Tk_GetUid("LineElement");
    rbcStripElementUid = Tk_GetUid("StripElement");
    rbcContourElementUid = Tk_GetUid("ContourElement");

    rbcLineMarkerUid = Tk_GetUid("LineMarker");
    rbcBitmapMarkerUid = Tk_GetUid("BitmapMarker");
    rbcImageMarkerUid = Tk_GetUid("ImageMarker");
    rbcTextMarkerUid = Tk_GetUid("TextMarker");
    rbcPolygonMarkerUid = Tk_GetUid("PolygonMarker");
    rbcWindowMarkerUid = Tk_GetUid("WindowMarker");

    rbcXAxisUid = Tk_GetUid("X");
    rbcYAxisUid = Tk_GetUid("Y");

	/* Needed oo extension */
	if (Tcl_OOInitStubs(interp) == NULL) {
		return TCL_ERROR;
	}

    /* Create widget class. */
................................................................................
    Tcl_ObjectContext objectContext,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Object object;
    RbcGraph       *graphPtr;
    Tk_Window tkWin;
    Tk_Uid classUid = rbcLineElementUid;
    int i;
    const char *chPtr;
    int myArgc;
    const char **myArgv;

	/* Get current object. Should not fail? */
    if ((object = Tcl_ObjectContextObject(objectContext)) == NULL) {

Changes to generic/rbc/rbcInt.h.

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
...
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
....
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
....
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
....
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
....
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
....
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
....
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
....
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
....
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
....
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
typedef struct RbcTileClient *RbcTile;  /* Opaque type for tiles */
typedef struct RbcPsToken RbcPsToken;
typedef struct RbcPen RbcPen;
typedef struct RbcMarker RbcMarker;
typedef struct RbcCrosshairs RbcCrosshairs;
typedef struct RbcParseValue RbcParseValue;

/*
 * RbcUid --
 */
typedef const char *RbcUid;

/*
 * RbcPad --
 *
 * 	Specifies vertical and horizontal padding.
 *
 *	Padding can be specified on a per side basis.  The fields
 *	side1 and side2 refer to the opposite sides, either
................................................................................
 * 	Structure contains options controlling how the axis will be
 * 	displayed.
 */
typedef struct {
    char           *name;       /* Identifier to refer the element.
                                 * Used in the "insert", "delete", or
                                 * "show", commands. */
    RbcUid          classUid;   /* Type of axis. */
    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Set bit field definitions below */
    /*
     * AXIS_DRAWN               Axis is designated as a logical axis
     * AXIS_DIRTY
     *
     * AXIS_CONFIG_MAJOR        User specified major ticks.
................................................................................
/*
 * RbcElement --
 */
typedef struct RbcElement {
    char           *name;       /* Identifier to refer the element.
                                 * Used in the "insert", "delete", or
                                 * "show", commands. */
    RbcUid          classUid;   /* Type of element */
    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Indicates if the entire element is
                                 * active, or if coordinates need to
                                 * be calculated */
    char          **tags;
    int             hidden;     /* If non-zero, don't display the element. */
    Tcl_HashEntry  *hashPtr;
................................................................................

/*
 * RbcPen --
 */
typedef struct RbcPen {
    char           *name;       /* Pen style identifier.  If NULL pen
                                 * was statically allocated. */
    RbcUid          classUid;   /* Type of pen */
    char           *typeId;     /* String token identifying the type of pen */
    unsigned int    flags;      /* Indicates if the pen element is active or
                                 * normal */
    int             refCount;   /* Reference count for elements using
                                 * this pen. */
    Tcl_HashEntry  *hashPtr;

................................................................................
    struct Component {
        Tcl_HashTable   table;  /* Hash table of ids. */
        RbcChain       *displayList;    /* Display list. */
        Tcl_HashTable   tagTable;       /* Table of bind tags. */
    } elements     ,
                    markers,
                    axes;
    RbcUid          classUid;   /* Default element type */
    const char     *chartStyle; /* one of line, bar or strip */
    RbcBindTable   *bindTable;
    int             nextMarkerId;       /* Tracks next marker identifier available */
    RbcChain       *axisChain[4];       /* Chain of axes for each of the
                                         * margins.  They're separate from the
                                         * margin structures to make it easier
                                         * to invert the X-Y axes by simply
................................................................................
} RbcResampleFilter;

/*
 * Data declarations:
 */
extern double   rbcNaN;
extern RbcResampleFilter *rbcBoxFilterPtr;      /* The ubiquitous box filter */
extern RbcUid   rbcBarElementUid;
extern RbcUid   rbcLineElementUid;
extern RbcUid   rbcStripElementUid;
extern RbcUid   rbcLineMarkerUid;
extern RbcUid   rbcBitmapMarkerUid;
extern RbcUid   rbcImageMarkerUid;
extern RbcUid   rbcTextMarkerUid;
extern RbcUid   rbcPolygonMarkerUid;
extern RbcUid   rbcWindowMarkerUid;
extern RbcUid   rbcXAxisUid;
extern RbcUid   rbcYAxisUid;

/*
 * Inline function declarations:
 */

/* int RbcNumberOfPoints(RbcAxis2D e); */
#define RbcNumberOfPoints(e)	MIN((e)->x.nValues, (e)->y.nValues)
................................................................................

/* rbcGrBar.c */
MODULE_SCOPE RbcPen *RbcBarPen(
    const char *penName);
MODULE_SCOPE RbcElement *RbcBarElement(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid type);
MODULE_SCOPE void RbcInitFreqTable(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcComputeStacks(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcResetStacks(
    RbcGraph * graphPtr);

................................................................................
    RbcGraph * graphPtr,
    const char *tagName);
MODULE_SCOPE int RbcElementOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    RbcUid classUid);

/* rbcGrGrid.c */
MODULE_SCOPE void RbcMapGrid(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcDrawGrid(
    RbcGraph * graphPtr,
    Drawable drawable);
................................................................................

/* rbcGrLine.c */
MODULE_SCOPE RbcPen *RbcLinePen(
    const char *penName);
MODULE_SCOPE RbcElement *RbcLineElement(
    RbcGraph *graphPtr,
    const char *name,
    RbcUid classUid);

/* rbcGrMarker.c */
MODULE_SCOPE ClientData RbcMakeMarkerTag(
    RbcGraph * graphPtr,
    const char *tagName);
MODULE_SCOPE int RbcMarkerOp(
    RbcGraph * graphPtr,
................................................................................
/* rbcPen.c */
MODULE_SCOPE void RbcFreePen(
    RbcGraph * graphPtr,
    RbcPen * penPtr);
MODULE_SCOPE RbcPen *RbcCreatePen(
    RbcGraph * graphPtr,
    const char *penName,
    RbcUid classUid,
    int nOpts,
    const char **options);
MODULE_SCOPE int RbcGetPen(
    RbcGraph * graphPtr,
    const char *name,
    RbcUid classUid,
    RbcPen ** penPtrPtr);
MODULE_SCOPE void RbcDestroyPens(
    RbcGraph * graphPtr);
MODULE_SCOPE int RbcPenOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
................................................................................

/* rbcUtil.c */
MODULE_SCOPE void *RbcCalloc(
    unsigned int nElem,
    size_t size);
MODULE_SCOPE char *RbcStrdup(
    const char *ptr);
MODULE_SCOPE RbcUid RbcGetUid(
    const char *string);
MODULE_SCOPE void RbcFreeUid(
    RbcUid uid);
MODULE_SCOPE RbcUid RbcFindUid(
    char *string);
MODULE_SCOPE RbcOp RbcGetOp(
    Tcl_Interp * interp,
    int nSpecs,
    RbcOpSpec * specArr,
    int operPos,
    int argc,
    const char **argv,






<
<
<
<
<







 







|







 







|







 







|







 







|







 







|
|
|
|
|
|
|
|
|
|
|







 







|







 







|







 







|







 







|





|







 







<
<
<
<
<
<







326
327
328
329
330
331
332





333
334
335
336
337
338
339
...
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
....
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
....
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
....
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
....
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
....
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
....
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
....
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
....
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
....
2621
2622
2623
2624
2625
2626
2627






2628
2629
2630
2631
2632
2633
2634
typedef struct RbcTileClient *RbcTile;  /* Opaque type for tiles */
typedef struct RbcPsToken RbcPsToken;
typedef struct RbcPen RbcPen;
typedef struct RbcMarker RbcMarker;
typedef struct RbcCrosshairs RbcCrosshairs;
typedef struct RbcParseValue RbcParseValue;






/*
 * RbcPad --
 *
 * 	Specifies vertical and horizontal padding.
 *
 *	Padding can be specified on a per side basis.  The fields
 *	side1 and side2 refer to the opposite sides, either
................................................................................
 * 	Structure contains options controlling how the axis will be
 * 	displayed.
 */
typedef struct {
    char           *name;       /* Identifier to refer the element.
                                 * Used in the "insert", "delete", or
                                 * "show", commands. */
    Tk_Uid          classUid;   /* Type of axis. */
    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Set bit field definitions below */
    /*
     * AXIS_DRAWN               Axis is designated as a logical axis
     * AXIS_DIRTY
     *
     * AXIS_CONFIG_MAJOR        User specified major ticks.
................................................................................
/*
 * RbcElement --
 */
typedef struct RbcElement {
    char           *name;       /* Identifier to refer the element.
                                 * Used in the "insert", "delete", or
                                 * "show", commands. */
    Tk_Uid          classUid;   /* Type of element */
    RbcGraph       *graphPtr;   /* Graph widget of element */
    unsigned int    flags;      /* Indicates if the entire element is
                                 * active, or if coordinates need to
                                 * be calculated */
    char          **tags;
    int             hidden;     /* If non-zero, don't display the element. */
    Tcl_HashEntry  *hashPtr;
................................................................................

/*
 * RbcPen --
 */
typedef struct RbcPen {
    char           *name;       /* Pen style identifier.  If NULL pen
                                 * was statically allocated. */
    Tk_Uid          classUid;   /* Type of pen */
    char           *typeId;     /* String token identifying the type of pen */
    unsigned int    flags;      /* Indicates if the pen element is active or
                                 * normal */
    int             refCount;   /* Reference count for elements using
                                 * this pen. */
    Tcl_HashEntry  *hashPtr;

................................................................................
    struct Component {
        Tcl_HashTable   table;  /* Hash table of ids. */
        RbcChain       *displayList;    /* Display list. */
        Tcl_HashTable   tagTable;       /* Table of bind tags. */
    } elements     ,
                    markers,
                    axes;
    Tk_Uid          classUid;   /* Default element type */
    const char     *chartStyle; /* one of line, bar or strip */
    RbcBindTable   *bindTable;
    int             nextMarkerId;       /* Tracks next marker identifier available */
    RbcChain       *axisChain[4];       /* Chain of axes for each of the
                                         * margins.  They're separate from the
                                         * margin structures to make it easier
                                         * to invert the X-Y axes by simply
................................................................................
} RbcResampleFilter;

/*
 * Data declarations:
 */
extern double   rbcNaN;
extern RbcResampleFilter *rbcBoxFilterPtr;      /* The ubiquitous box filter */
extern Tk_Uid   rbcBarElementUid;
extern Tk_Uid   rbcLineElementUid;
extern Tk_Uid   rbcStripElementUid;
extern Tk_Uid   rbcLineMarkerUid;
extern Tk_Uid   rbcBitmapMarkerUid;
extern Tk_Uid   rbcImageMarkerUid;
extern Tk_Uid   rbcTextMarkerUid;
extern Tk_Uid   rbcPolygonMarkerUid;
extern Tk_Uid   rbcWindowMarkerUid;
extern Tk_Uid   rbcXAxisUid;
extern Tk_Uid   rbcYAxisUid;

/*
 * Inline function declarations:
 */

/* int RbcNumberOfPoints(RbcAxis2D e); */
#define RbcNumberOfPoints(e)	MIN((e)->x.nValues, (e)->y.nValues)
................................................................................

/* rbcGrBar.c */
MODULE_SCOPE RbcPen *RbcBarPen(
    const char *penName);
MODULE_SCOPE RbcElement *RbcBarElement(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid type);
MODULE_SCOPE void RbcInitFreqTable(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcComputeStacks(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcResetStacks(
    RbcGraph * graphPtr);

................................................................................
    RbcGraph * graphPtr,
    const char *tagName);
MODULE_SCOPE int RbcElementOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
    const char **argv,
    Tk_Uid classUid);

/* rbcGrGrid.c */
MODULE_SCOPE void RbcMapGrid(
    RbcGraph * graphPtr);
MODULE_SCOPE void RbcDrawGrid(
    RbcGraph * graphPtr,
    Drawable drawable);
................................................................................

/* rbcGrLine.c */
MODULE_SCOPE RbcPen *RbcLinePen(
    const char *penName);
MODULE_SCOPE RbcElement *RbcLineElement(
    RbcGraph *graphPtr,
    const char *name,
    Tk_Uid classUid);

/* rbcGrMarker.c */
MODULE_SCOPE ClientData RbcMakeMarkerTag(
    RbcGraph * graphPtr,
    const char *tagName);
MODULE_SCOPE int RbcMarkerOp(
    RbcGraph * graphPtr,
................................................................................
/* rbcPen.c */
MODULE_SCOPE void RbcFreePen(
    RbcGraph * graphPtr,
    RbcPen * penPtr);
MODULE_SCOPE RbcPen *RbcCreatePen(
    RbcGraph * graphPtr,
    const char *penName,
    Tk_Uid classUid,
    int nOpts,
    const char **options);
MODULE_SCOPE int RbcGetPen(
    RbcGraph * graphPtr,
    const char *name,
    Tk_Uid classUid,
    RbcPen ** penPtrPtr);
MODULE_SCOPE void RbcDestroyPens(
    RbcGraph * graphPtr);
MODULE_SCOPE int RbcPenOp(
    RbcGraph * graphPtr,
    Tcl_Interp * interp,
    int argc,
................................................................................

/* rbcUtil.c */
MODULE_SCOPE void *RbcCalloc(
    unsigned int nElem,
    size_t size);
MODULE_SCOPE char *RbcStrdup(
    const char *ptr);






MODULE_SCOPE RbcOp RbcGetOp(
    Tcl_Interp * interp,
    int nSpecs,
    RbcOpSpec * specArr,
    int operPos,
    int argc,
    const char **argv,

Changes to generic/rbc/rbcUtil.c.

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
    allocPtr = ckalloc(size * sizeof(char));
    if (allocPtr != NULL) {
        strcpy(allocPtr, string);
    }
    return allocPtr;
}

/*
 * The hash table below is used to keep track of all the RbcUids created
 * so far.
 */
static Tcl_HashTable uidTable;
static int      uidInitialized = 0;

/*
 *----------------------------------------------------------------------
 *
 * RbcGetUid --
 *
 *      Given a string, returns a unique identifier for the string.
 *      A reference count is maintained, so that the identifier
 *      can be freed when it is not needed any more. This can be used
 *      in many places to replace Tcl_GetUid.
 *
 * Results:
 *      This procedure returns a RbcUid corresponding to the "string"
 *      argument.  The RbcUid has a string value identical to string
 *      (strcmp will return 0), but it's guaranteed that any other
 *      calls to this procedure with a string equal to "string" will
 *      return exactly the same result (i.e. can compare RbcUid
 *      *values* directly, without having to call strcmp on what they
 *      point to).
 *
 * Side effects:
 *      New information may be entered into the identifier table.
 *
 *----------------------------------------------------------------------
 */
RbcUid
RbcGetUid(
    const char *string)
{                               /* String to convert. */
    int             isNew;
    Tcl_HashEntry  *hPtr;
    int             refCount;

    if (!uidInitialized) {
        Tcl_InitHashTable(&uidTable, TCL_STRING_KEYS);
        uidInitialized = 1;
    }
    hPtr = Tcl_CreateHashEntry(&uidTable, string, &isNew);
    if (isNew) {
        refCount = 0;
    } else {
        refCount = (int) Tcl_GetHashValue(hPtr);
    }
    refCount++;
    Tcl_SetHashValue(hPtr, (ClientData) refCount);
    return (RbcUid) Tcl_GetHashKey(&uidTable, hPtr);
}

/*
 *----------------------------------------------------------------------
 *
 * RbcFreeUid --
 *
 *      Frees the RbcUid if there are no more clients using this
 *      identifier.
 *
 * Results:
 *      None.
 *
 * Side effects:
 *      The identifier may be deleted from the identifier table.
 *
 *----------------------------------------------------------------------
 */
void
RbcFreeUid(
    RbcUid uid)
{                               /* Identifier to release. */
    Tcl_HashEntry  *hPtr;

    if (!uidInitialized) {
        Tcl_InitHashTable(&uidTable, TCL_STRING_KEYS);
        uidInitialized = 1;
    }
    hPtr = Tcl_FindHashEntry(&uidTable, uid);
    if (hPtr) {
        int             refCount;

        refCount = (int) Tcl_GetHashValue(hPtr);
        refCount--;
        if (refCount == 0) {
            Tcl_DeleteHashEntry(hPtr);
        } else {
            Tcl_SetHashValue(hPtr, (ClientData) refCount);
        }
    } else {
        fprintf(stderr, "tried to release unknown identifier \"%s\"\n", uid);
    }
}

/*
 *----------------------------------------------------------------------
 *
 * RbcFindUid --
 *
 *      Returns a RbcUid associated with a given string, if one
 *      exists.
 *
 * Results:
 *      A RbcUid for the string if one exists. Otherwise NULL.
 *
 * Side effects:
 *      TODO: Side Effects
 *
 *----------------------------------------------------------------------
 */
RbcUid
RbcFindUid(
    char *string)
{                               /* String to find. */
    Tcl_HashEntry  *hPtr;

    if (!uidInitialized) {
        Tcl_InitHashTable(&uidTable, TCL_STRING_KEYS);
        uidInitialized = 1;
    }
    hPtr = Tcl_FindHashEntry(&uidTable, string);
    if (hPtr == NULL) {
        return NULL;
    }
    return (RbcUid) Tcl_GetHashKey(&uidTable, hPtr);
}

/*
 *----------------------------------------------------------------------
 *
 * BinaryOpSearch --
 *
 *      Performs a binary search on the array of command operation
 *      specifications to find a partial, anchored match for the






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







80
81
82
83
84
85
86

































































































































87
88
89
90
91
92
93
    allocPtr = ckalloc(size * sizeof(char));
    if (allocPtr != NULL) {
        strcpy(allocPtr, string);
    }
    return allocPtr;
}


































































































































/*
 *----------------------------------------------------------------------
 *
 * BinaryOpSearch --
 *
 *      Performs a binary search on the array of command operation
 *      specifications to find a partial, anchored match for the