| 542 | static void PiuApplicationFindMenu(PiuApplication* self, xsIntegerValue id); |
| 543 | |
| 544 | xsIntegerValue PiuApplicationCanMenu(PiuApplication* self, xsIntegerValue id) |
| 545 | { |
| 546 | xsMachine* the = (*self)->the; |
| 547 | xsIntegerValue result = 0; |
| 548 | PiuApplicationFindMenu(self, id); |
| 549 | if (xsTest(xsVar(2))) { |
| 550 | xsIdentifier canID = (xsIdentifier)xsToInteger(xsGet(xsVar(2), xsID_canID)); |
| 551 | PiuContent* content = (*self)->focus; |
| 552 | while (content) { |
| 553 | if ((*content)->behavior) { |
| 554 | xsVar(0) = xsReference((*content)->behavior); |
| 555 | if (xsFindResult(xsVar(0), canID)) { |
| 556 | xsVar(1) = xsReference((*content)->reference); |
| 557 | xsVar(3) = xsCallFunction2(xsResult, xsVar(0), xsVar(1), xsVar(2)); |
| 558 | if (xsTest(xsVar(3))) |
| 559 | result |= piuMenuEnabled; |
| 560 | break; |
| 561 | } |
| 562 | } |
| 563 | content = (PiuContent*)(*content)->container; |
| 564 | } |
| 565 | xsVar(3) = xsGet(xsVar(2), xsID_check); |
| 566 | if (xsTest(xsVar(3))) |
| 567 | result |= piuMenuChecked; |
| 568 | xsVar(3) = xsGet(xsVar(2), xsID_titles); |
| 569 | if (xsTest(xsVar(3))) { |
| 570 | xsVar(0) = xsGet(xsVar(2), xsID_state); |
| 571 | xsVar(1) = xsGetAt(xsVar(3), xsVar(0)); |
| 572 | xsSet(xsVar(2), xsID_title, xsVar(1)); |
| 573 | result |= piuMenuTitled; |
| 574 | } |
| 575 | xsResult = xsVar(2); |
| 576 | } |
| 577 | return result; |
| 578 | } |
| 579 | |
| 580 | void PiuApplicationDoMenu(PiuApplication* self, xsIntegerValue id) |
| 581 | { |
no test coverage detected