Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-f214b8ad5b Excluding Merge-Ins
This is equivalent to a diff from 61cefa0e to 2e7dccd2
2013-11-20
| ||
09:11 | Store menu option tables in Thread storage in stead of allocated storage. This makes "menu" a normal command without needing special initialization tricks. check-in: 8822345d user: jan.nijtmans tags: trunk | |
2013-11-03
| ||
11:33 | [1632447]: Allow the PPM maxval to go up to 65535, to conform with a format definition change from around 2000 (even if that's a rare format). check-in: 251c1226 user: dkf tags: trunk | |
2013-10-31
| ||
22:01 | merge trunk Closed-Leaf check-in: 2e7dccd2 user: jan.nijtmans tags: bug-f214b8ad5b | |
21:25 | Fix refcount bug in FreeFontObjProc. Could result in freeing a TkFont which was already freed. check-in: 61cefa0e user: jan.nijtmans tags: trunk | |
21:25 | Fix refcount bug in FreeFontObjProc. Could result in freeing a TkFont which was already freed. check-in: d13e6a58 user: jan.nijtmans tags: core-8-5-branch | |
09:35 | Fix [c0cc9fd153]: PNG parser does not support uppercase format string (using -format) check-in: 8363f1b5 user: jan.nijtmans tags: trunk | |
2013-10-29
| ||
13:59 | Make "menu" a normal command, initialized like any other Tk command. check-in: 1abdce95 user: jan.nijtmans tags: bug-f214b8ad5b | |
Changes to generic/tkInt.h.
︙ | |||
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 | + + + | Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_ListboxObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_LowerObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_MenuObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_MenubuttonObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_MessageBoxObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); |
︙ | |||
1144 1145 1146 1147 1148 1149 1150 | 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 | - | MODULE_SCOPE int TkSetGeometryMaster(Tcl_Interp *interp, Tk_Window tkwin, const char *master); MODULE_SCOPE void TkFreeGeometryMaster(Tk_Window tkwin, const char *master); MODULE_SCOPE void TkEventInit(void); MODULE_SCOPE void TkRegisterObjTypes(void); |
︙ |
Changes to generic/tkMenu.c.
︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + + + + | #define MENU_HASH_KEY "tkMenus" typedef struct ThreadSpecificData { int menusInitialized; /* Flag indicates whether thread-specific * elements of the Windows Menu module have * been initialized. */ Tk_OptionTable menuOptionTable; /* The option table for menus. */ Tk_OptionTable entryOptionTables[6]; /* The tables for menu entries. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following flag indicates whether the process-wide state for the Menu * module has been intialized. The Mutex protects access to that flag. */ |
︙ | |||
345 346 347 348 349 350 351 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | - - | static int MenuDoYPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuDoXPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuAddOrInsert(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc, Tcl_Obj *const objv[]); |
︙ | |||
377 378 379 380 381 382 383 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - + + | NULL, /* createProc */ NULL /* modalProc */ }; /* *-------------------------------------------------------------- * |
︙ | |||
507 508 509 510 511 512 513 | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - - + | menuPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, menuPtr, MenuCmdDeletedProc); menuPtr->active = -1; menuPtr->cursorPtr = None; menuPtr->masterMenuPtr = menuPtr; menuPtr->menuType = UNKNOWN_TYPE; |
︙ | |||
671 672 673 674 675 676 677 678 679 680 681 682 683 684 | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | + + | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { register TkMenu *menuPtr = clientData; register TkMenuEntry *mePtr; int result = TCL_OK; int option; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObjStruct(interp, objv[1], menuOptions, sizeof(char *), "option", 0, &option) != TCL_OK) { |
︙ | |||
721 722 723 724 725 726 727 | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | - + - + - + | Tcl_Obj *resultPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "option"); goto error; } resultPtr = Tk_GetOptionValue(interp, (char *) menuPtr, |
︙ | |||
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 | 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | + + | { int i; TkMenu *menuInstancePtr; TkMenuEntry *cascadePtr, *nextCascadePtr; Tcl_Obj *newObjv[2]; TkMenu *parentMasterMenuPtr; TkMenuEntry *parentMasterEntryPtr; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * If the menu has any cascade menu entries pointing to it, the cascade * entries need to be told that the menu is going away. We need to clear * the menu ptr field in the menu reference at this point in the code so * that everything else can forget about this menu properly. We also need * to reset -menu field of all entries that are not master menus back to |
︙ | |||
1229 1230 1231 1232 1233 1234 1235 | 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | - + | menuPtr->numEntries = i; } if (menuPtr->entries != NULL) { ckfree(menuPtr->entries); } TkMenuFreeDrawOptions(menuPtr); Tk_FreeConfigOptions((char *) menuPtr, |
︙ | |||
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 | + + - + | * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[]) /* Arguments. */ { int i; TkMenu *menuListPtr, *cleanupPtr; int result; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { menuListPtr->errorStructPtr = ckalloc(sizeof(Tk_SavedOptions)); result = Tk_SetOptions(interp, (char *) menuListPtr, |
︙ | |||
2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 | 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 | + + | int index, /* Where in the menu the new entry is to * go. */ int type) /* The type of the new entry. */ { TkMenuEntry *mePtr; TkMenuEntry **newEntries; int i; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Create a new array of entries with an empty slot for the new entry. */ newEntries = ckalloc((menuPtr->numEntries+1) * sizeof(TkMenuEntry *)); for (i = 0; i < index; i++) { |
︙ | |||
2304 2305 2306 2307 2308 2309 2310 | 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 | - + | ckfree(menuPtr->entries); } menuPtr->entries = newEntries; menuPtr->numEntries++; mePtr = ckalloc(sizeof(TkMenuEntry)); menuPtr->entries[index] = mePtr; mePtr->type = type; |
︙ | |||
3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 | 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 | + + + + + + + + + + + + + + | */ TkCreateExitHandler((Tcl_ExitProc *) TkMenuCleanup, NULL); Tcl_MutexUnlock(&menuMutex); } if (!tsdPtr->menusInitialized) { TkpMenuThreadInit(); tsdPtr->menuOptionTable = Tk_CreateOptionTable(NULL, tkMenuConfigSpecs); tsdPtr->entryOptionTables[TEAROFF_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[TEAROFF_ENTRY]); tsdPtr->entryOptionTables[COMMAND_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[COMMAND_ENTRY]); tsdPtr->entryOptionTables[CASCADE_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[CASCADE_ENTRY]); tsdPtr->entryOptionTables[SEPARATOR_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[SEPARATOR_ENTRY]); tsdPtr->entryOptionTables[RADIO_BUTTON_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[RADIO_BUTTON_ENTRY]); tsdPtr->entryOptionTables[CHECK_BUTTON_ENTRY] = Tk_CreateOptionTable(NULL, specsArray[CHECK_BUTTON_ENTRY]); tsdPtr->menusInitialized = 1; } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to generic/tkMenu.h.
︙ | |||
355 356 357 358 359 360 361 | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - - - - + | struct TkMenu *nextInstancePtr; /* The next instance of this menu in the * chain. */ struct TkMenu *masterMenuPtr; /* A pointer to the original menu for this * clone chain. Points back to this structure * if this menu is a master menu. */ |
︙ | |||
426 427 428 429 430 431 432 | 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | - - - - - - - - - - - | * entries that have this menu as their child. * NULL means no cascade entries. */ Tcl_HashEntry *hashEntryPtr;/* This is needed because the pathname of the * window (which is what we hash on) may not * be around when we are deleting. */ } TkMenuReferences; |
︙ |
Changes to generic/tkWindow.c.
︙ | |||
145 146 147 148 149 150 151 152 153 154 155 156 157 158 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | + | {"canvas", Tk_CanvasObjCmd, PASSMAINWINDOW|ISSAFE}, {"checkbutton", Tk_CheckbuttonObjCmd, ISSAFE}, {"entry", Tk_EntryObjCmd, ISSAFE}, {"frame", Tk_FrameObjCmd, ISSAFE}, {"label", Tk_LabelObjCmd, ISSAFE}, {"labelframe", Tk_LabelframeObjCmd, ISSAFE}, {"listbox", Tk_ListboxObjCmd, ISSAFE}, {"menu", Tk_MenuObjCmd, PASSMAINWINDOW}, {"menubutton", Tk_MenubuttonObjCmd, ISSAFE}, {"message", Tk_MessageObjCmd, ISSAFE}, {"panedwindow", Tk_PanedWindowObjCmd, ISSAFE}, {"radiobutton", Tk_RadiobuttonObjCmd, ISSAFE}, {"scale", Tk_ScaleObjCmd, ISSAFE}, {"scrollbar", (Tcl_ObjCmdProc *) Tk_ScrollbarCmd, NOOBJPROC|PASSMAINWINDOW|ISSAFE}, |
︙ | |||
983 984 985 986 987 988 989 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 | - - | clientData, NULL); } if (isSafe && !(cmdPtr->flags & ISSAFE)) { Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name); } } |
︙ |