| 355 | #endif |
| 356 | |
| 357 | void xs_poco_end(xsMachine *the) |
| 358 | { |
| 359 | Poco poco = xsmcGetHostDataPoco(xsThis); |
| 360 | PixelsOutDispatch pixelsOutDispatch = |
| 361 | #if MODDEF_ECMA419_DISPLAY |
| 362 | (!poco->displayHooks && poco->outputRefcon) ? *(PixelsOutDispatch *)poco->outputRefcon : NULL; |
| 363 | #else |
| 364 | poco->outputRefcon ? *(PixelsOutDispatch *)poco->outputRefcon : NULL; |
| 365 | #endif |
| 366 | int result; |
| 367 | |
| 368 | if (!(poco->flags & kPocoFlagDidBegin)) |
| 369 | xsUnknownError("inactive"); |
| 370 | |
| 371 | if (!(poco->flags & kPocoFlagFrameBuffer)) { |
| 372 | xsmcVars(5); |
| 373 | |
| 374 | #if MODDEF_ECMA419_DISPLAY |
| 375 | if (poco->displayHooks) { |
| 376 | (((xsDisplayHostHooks)poco->displayHooks)->doBegin(poco->outputRefcon, poco->x, poco->y, poco->w, poco->h, C_NULL, C_NULL, (poco->flags & kPocoFlagContinue) ? 1 : 0)); |
| 377 | } |
| 378 | else |
| 379 | #endif |
| 380 | if (pixelsOutDispatch) { |
| 381 | (pixelsOutDispatch->doBegin)(poco->outputRefcon, poco->x, poco->y, poco->w, poco->h); |
| 382 | } |
| 383 | else { |
| 384 | xsmcGet(xsVar(0), xsThis, xsID_pixelsOut); |
| 385 | #if MODDEF_ECMA419_DISPLAY |
| 386 | xsmcSetNewObject(xsVar(1)); |
| 387 | xsmcSetInteger(xsVar(2), poco->x); |
| 388 | xsmcSet(xsVar(1), xsID_x, xsVar(2)); |
| 389 | xsmcSetInteger(xsVar(2), poco->y); |
| 390 | xsmcSet(xsVar(1), xsID_y, xsVar(2)); |
| 391 | xsmcSetInteger(xsVar(2), poco->w); |
| 392 | xsmcSet(xsVar(1), xsID_width, xsVar(2)); |
| 393 | xsmcSetInteger(xsVar(2), poco->h); |
| 394 | xsmcSet(xsVar(1), xsID_height, xsVar(2)); |
| 395 | if (poco->flags & kPocoFlagContinue) { |
| 396 | xsmcSetTrue(xsVar(2)); |
| 397 | xsmcSet(xsVar(1), xsID_continue, xsVar(2)); |
| 398 | } |
| 399 | xsCall1(xsVar(0), xsID_begin, xsVar(1)); |
| 400 | #else |
| 401 | xsmcSetInteger(xsVar(1), poco->x); |
| 402 | xsmcSetInteger(xsVar(2), poco->y); |
| 403 | xsmcSetInteger(xsVar(3), poco->w); |
| 404 | xsmcSetInteger(xsVar(4), poco->h); |
| 405 | xsCall4(xsVar(0), xsID_begin, xsVar(1), xsVar(2), xsVar(3), xsVar(4)); |
| 406 | #endif |
| 407 | } |
| 408 | #if MODDEF_ECMA419_DISPLAY |
| 409 | if (poco->displayHooks) { |
| 410 | result = PocoDrawingEnd(poco, poco->pixels, poco->pixelsLength, displayPixelReceiver, poco); |
| 411 | } |
| 412 | else |
| 413 | #endif |
| 414 | if (poco->outputRefcon) |
nothing calls this directly
no test coverage detected