Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Commit to the patch; code history is in code history. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | dgp-method-type |
Files: | files | file ages | folders |
SHA1: |
9b412503a36f59f4858224d7a99e6eeb |
User & Date: | dgp 2017-06-29 16:48:48.313 |
Context
2017-06-29
| ||
17:17 | Bump to 4.1.0 check-in: c368859cb1 user: dgp tags: dgp-method-type | |
16:48 | Commit to the patch; code history is in code history. check-in: 9b412503a3 user: dgp tags: dgp-method-type | |
16:23 | merge trunk check-in: dde8dc2497 user: dgp tags: dgp-method-type | |
Changes
Changes to generic/itkArchBase.c.
︙ | ︙ | |||
190 191 192 193 194 195 196 | ItclClass *contextClass; ItclClass *ownerClass; ItclObject *contextObj; ArchInfo *info; Tcl_Command accessCmd; Tcl_Obj *objPtr; Tcl_DString buffer; | < < < < < < < | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | ItclClass *contextClass; ItclClass *ownerClass; ItclObject *contextObj; ArchInfo *info; Tcl_Command accessCmd; Tcl_Obj *objPtr; Tcl_DString buffer; ItclShowArgs(1, "Itk_ArchCompAddCmd", objc, objv); /* * Get the Archetype info associated with this widget. */ contextClass = NULL; if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK || |
︙ | ︙ | |||
303 304 305 306 307 308 309 | } } /* * Execute the <createCmds> to create the component widget. * Do this one level up, in the scope of the calling routine. */ | < < < < < < | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | } } /* * Execute the <createCmds> to create the component widget. * Do this one level up, in the scope of the calling routine. */ result = Tcl_EvalObjEx(interp, objv[2], 0); if (result != TCL_OK) { goto compFail; } /* * Take the result from the widget creation commands as the |
︙ | ︙ | |||
339 340 341 342 343 344 345 | Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "cannot find component access command \"", path, "\" for component \"", name, "\"", (char*)NULL); goto compFail; } | < < < < | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "cannot find component access command \"", path, "\" for component \"", name, "\"", (char*)NULL); goto compFail; } winNamePtr = Tcl_NewStringObj((char*)NULL, 0); Tcl_GetCommandFullName(interp, accessCmd, winNamePtr); Tcl_IncrRefCount(winNamePtr); /* * Create the component record. Set the protection level |
︙ | ︙ | |||
491 492 493 494 495 496 497 | if (objc != 4) { objPtr = Tcl_NewStringObj("usual", -1); Tcl_IncrRefCount(objPtr); } else { objPtr = objv[3]; } | < < < < | 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | if (objc != 4) { objPtr = Tcl_NewStringObj("usual", -1); Tcl_IncrRefCount(objPtr); } else { objPtr = objv[3]; } Tcl_Import(interp, NULL, "::itk::option-parser::*", 1); if (result == TCL_OK) { result = Tcl_EvalObj(interp, objPtr); Tcl_ForgetImport(interp, NULL, "::itk::option-parser::*"); } if (objc != 4) { Tcl_DecrRefCount(objPtr); } if (result != TCL_OK) { |
︙ | ︙ | |||
537 538 539 540 541 542 543 | Tcl_SetResult(interp, name, TCL_VOLATILE); return TCL_OK; /* * If any errors were encountered, clean up and return. */ compFail: | < < < < < | 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | Tcl_SetResult(interp, name, TCL_VOLATILE); return TCL_OK; /* * If any errors were encountered, clean up and return. */ compFail: if (archComp) { Itk_DelArchComponent(archComp); } if (entry) { Tcl_DeleteHashEntry(entry); } if (path) { |
︙ | ︙ | |||
1613 1614 1615 1616 1617 1618 1619 | /* * Update the public variable with the new option value. * There should already be a call frame installed for handling * instance variables, but make sure that the namespace context * is the most-specific class, so that the public variable can * be found. */ | < < < < < < < | 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 | /* * Update the public variable with the new option value. * There should already be a call frame installed for handling * instance variables, but make sure that the namespace context * is the most-specific class, so that the public variable can * be found. */ if (result == TCL_OK) { /* * Casting away CONST of newval only to satisfy Tcl 8.3 and * earlier headers. */ val = Tcl_SetVar2(interp, Tcl_GetString(ivPtr->fullNamePtr), (char *) NULL, (char *) newval, TCL_LEAVE_ERR_MSG); if (!val) { result = TCL_ERROR; } } if (result != TCL_OK) { char msg[256]; sprintf(msg, "\n (error in configuration of public variable \"%.100s\")", Tcl_GetString(ivPtr->fullNamePtr)); Tcl_AddErrorInfo(interp, msg); return TCL_ERROR; |
︙ | ︙ | |||
2121 2122 2123 2124 2125 2126 2127 | Tcl_Interp *interp, /* interpreter managing the object */ ArchInfo *info, /* info for Archetype mega-widget */ ArchOption *archOpt, /* option to initialize */ CONST char *defVal, /* last-resort default value */ char *currVal) /* current option value */ { CONST char *init = NULL; | < < < < < | 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 | Tcl_Interp *interp, /* interpreter managing the object */ ArchInfo *info, /* info for Archetype mega-widget */ ArchOption *archOpt, /* option to initialize */ CONST char *defVal, /* last-resort default value */ char *currVal) /* current option value */ { CONST char *init = NULL; CONST char *ival; char c; /* * If the option is already initialized, then abort. */ if (archOpt->init) { |
︙ | ︙ | |||
2166 2167 2168 2169 2170 2171 2172 | (c == 's' && strcmp(archOpt->switchName,"-screen") == 0) || (c == 'v' && strcmp(archOpt->switchName,"-visual") == 0)) { ival = currVal; } else { ival = init; } | < < < < < < < < < < < < < < < < < < < < < < < | 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 | (c == 's' && strcmp(archOpt->switchName,"-screen") == 0) || (c == 'v' && strcmp(archOpt->switchName,"-visual") == 0)) { ival = currVal; } else { ival = init; } Tcl_SetVar2(interp, "itk_option", archOpt->switchName, (char *)((ival) ? ival : ""), 0); if (ival) { archOpt->init = (char*)ckalloc((unsigned)(strlen(ival)+1)); strcpy(archOpt->init, ival); } } |
︙ | ︙ | |||
2310 2311 2312 2313 2314 2315 2316 | char *resClass, /* resource class name in X11 database */ CONST char *defVal, /* last-resort default value */ char *currVal, /* current value (or NULL) */ ArchOptionPart *optPart, /* part to be added in */ ArchOption **raOpt) /* returns: option containing new part */ { CONST char *init = NULL; | < < < < | 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 | char *resClass, /* resource class name in X11 database */ CONST char *defVal, /* last-resort default value */ char *currVal, /* current value (or NULL) */ ArchOptionPart *optPart, /* part to be added in */ ArchOption **raOpt) /* returns: option containing new part */ { CONST char *init = NULL; int result; ArchOption *archOpt; *raOpt = NULL; archOpt = NULL; /* |
︙ | ︙ | |||
2340 2341 2342 2343 2344 2345 2346 | * simply update this part to the current value. Otherwise, * leave the configuration to Itk_ArchInitCmd(). */ Itcl_AppendList(&archOpt->parts, (ClientData)optPart); if ((archOpt->flags & ITK_ARCHOPT_INIT) != 0) { | < < < | 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 | * simply update this part to the current value. Otherwise, * leave the configuration to Itk_ArchInitCmd(). */ Itcl_AppendList(&archOpt->parts, (ClientData)optPart); if ((archOpt->flags & ITK_ARCHOPT_INIT) != 0) { if (result == TCL_OK) { init = Tcl_GetVar2(interp, "itk_option", archOpt->switchName, 0); } if (!init) { Itk_ArchOptAccessError(interp, info, archOpt); return TCL_ERROR; } |
︙ | ︙ |
Changes to generic/itkArchetype.c.
︙ | ︙ | |||
423 424 425 426 427 428 429 | Itcl_ParseNamespPath(cmd, &buffer, &head, &tail); if (objc < 2) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "wrong # args: should be one of...\n", " ", tail, " add ?-protected? ?-private? ?--? name createCmds ?optionCmds?\n", " ", tail, " delete name ?name name...?", (char*)NULL); | | | | | | | 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | Itcl_ParseNamespPath(cmd, &buffer, &head, &tail); if (objc < 2) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "wrong # args: should be one of...\n", " ", tail, " add ?-protected? ?-private? ?--? name createCmds ?optionCmds?\n", " ", tail, " delete name ?name name...?", (char*)NULL); Tcl_DStringFree(&buffer); return TCL_ERROR; } token = Tcl_GetString(objv[1]); c = *token; length = strlen(token); /* * Handle: itk_component add... */ if (c == 'a' && strncmp(token, "add", length) == 0) { if (objc < 4) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "wrong # args: should be \"", tail, " add ?-protected? ?-private? ?--?", " name createCmds ?optionCmds?\"", (char*)NULL); Tcl_DStringFree(&buffer); return TCL_ERROR; } Tcl_DStringFree(&buffer); return Itk_ArchCompAddCmd(dummy, interp, objc-1, objv+1); } else { /* * Handle: itk_component delete... */ if (c == 'd' && strncmp(token, "delete", length) == 0) { if (objc < 3) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "wrong # args: should be \"", tail, " delete name ?name name...?\"", (char*)NULL); Tcl_DStringFree(&buffer); return TCL_ERROR; } Tcl_DStringFree(&buffer); return Itk_ArchCompDeleteCmd(dummy, interp, objc-1, objv+1); } } Tcl_DStringFree(&buffer); /* * Flag any errors. |
︙ | ︙ | |||
525 526 527 528 529 530 531 | Itcl_ListElem *part; ArchOption *archOpt; ArchOptionPart *optPart; ItclHierIter hier; ItclVariable *ivPtr; Tcl_HashSearch place; Tcl_HashEntry *entry; | < < < < < < < < < < < < < < < < < < < < < | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | Itcl_ListElem *part; ArchOption *archOpt; ArchOptionPart *optPart; ItclHierIter hier; ItclVariable *ivPtr; Tcl_HashSearch place; Tcl_HashEntry *entry; ItclShowArgs(2, "Itk_ArchInitCmd", objc, objv); contextClass = NULL; if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK || !contextObj) { token = Tcl_GetString(objv[0]); Tcl_ResetResult(interp); Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "improper usage: should be \"object ", token, " ?-option value -option value...?\"", (char*)NULL); return TCL_ERROR; } if (Itk_GetArchInfo(interp, contextObj, &info) != TCL_OK) { return TCL_ERROR; } /* * See what class is being initialized by getting the namespace * for the calling context. */ /* * Integrate all public variables for the current class * context into the composite option list. */ Itcl_InitHierIter(&hier, contextClass); while ((iclsPtr=Itcl_AdvanceHierIter(&hier)) != NULL) { |
︙ | ︙ | |||
888 889 890 891 892 893 894 | return TCL_ERROR; } if (Itk_GetArchInfo(interp, contextObj, &info) != TCL_OK) { return TCL_ERROR; } | | < < < < < < < < < < < < < < < < < | 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 | return TCL_ERROR; } if (Itk_GetArchInfo(interp, contextObj, &info) != TCL_OK) { return TCL_ERROR; } callingNs = Tcl_GetCurrentNamespace(interp); /* * With no arguments, return a list of components that can be * accessed from the calling scope. */ if (objc == 2) { /* if the name of the component is the empty string ignore that arg */ if (strlen(Tcl_GetString(objv[1])) == 0) { |
︙ | ︙ | |||
1102 1103 1104 1105 1106 1107 1108 | } } ItclShowArgs(1, "Itk_ArchConfigureCmd2", objc, objv); if (objc == 1) { Tcl_DStringInit(&buffer); for (i=0; i < info->order.len; i++) { | | | | | 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 | } } ItclShowArgs(1, "Itk_ArchConfigureCmd2", objc, objv); if (objc == 1) { Tcl_DStringInit(&buffer); for (i=0; i < info->order.len; i++) { Tcl_Namespace *save = Tcl_GetCurrentNamespace(interp); archOpt = (ArchOption*)Tcl_GetHashValue(info->order.list[i]); Itcl_SetCallFrameNamespace(interp, contextObj->iclsPtr->nsPtr); val = Tcl_GetVar2(interp, "itk_option", archOpt->switchName, 0); Itcl_SetCallFrameNamespace(interp, save); if (!val) { Itk_ArchOptAccessError(interp, info, archOpt); Tcl_DStringFree(&buffer); return TCL_ERROR; } Tcl_DStringStartSublist(&buffer); |
︙ | ︙ | |||
1136 1137 1138 1139 1140 1141 1142 | /* * If there is just one argument, then query the information * for that one argument and return: * {name resName resClass init value} */ if (objc == 2) { | | | | | 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | /* * If there is just one argument, then query the information * for that one argument and return: * {name resName resClass init value} */ if (objc == 2) { Tcl_Namespace *save = Tcl_GetCurrentNamespace(interp); token = Tcl_GetString(objv[1]); entry = Tcl_FindHashEntry(&info->options, token); if (!entry) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "unknown option \"", token, "\"", (char*)NULL); return TCL_ERROR; } archOpt = (ArchOption*)Tcl_GetHashValue(entry); Itcl_SetCallFrameNamespace(interp, contextObj->iclsPtr->nsPtr); val = Tcl_GetVar2(interp, "itk_option", archOpt->switchName, 0); Itcl_SetCallFrameNamespace(interp, save); if (!val) { Itk_ArchOptAccessError(interp, info, archOpt); return TCL_ERROR; } Tcl_AppendElement(interp, archOpt->switchName); Tcl_AppendElement(interp, |
︙ | ︙ | |||
1174 1175 1176 1177 1178 1179 1180 | /* * Otherwise, it must be a series of "-option value" assignments. * Look up each option and assign the new value. */ for (objc--,objv++; objc > 0; objc-=2, objv+=2) { char *value; int code; | | | | | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 | /* * Otherwise, it must be a series of "-option value" assignments. * Look up each option and assign the new value. */ for (objc--,objv++; objc > 0; objc-=2, objv+=2) { char *value; int code; Tcl_Namespace *save = Tcl_GetCurrentNamespace(interp); token = Tcl_GetString(objv[0]); if (objc < 2) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "value for \"", token, "\" missing", (char*)NULL); return TCL_ERROR; } value = Tcl_GetString(objv[1]); Itcl_SetCallFrameNamespace(interp, contextObj->iclsPtr->nsPtr); code = Itk_ArchConfigOption(interp, info, token, value); Itcl_SetCallFrameNamespace(interp, save); if (code != TCL_OK) { return TCL_ERROR; } } Tcl_ResetResult(interp); return TCL_OK; |
︙ | ︙ |