| 664 | } |
| 665 | |
| 666 | GJS_JSAPI_RETURN_CONVENTION |
| 667 | static bool popGroup_func(JSContext* cx, unsigned argc, JS::Value* vp) { |
| 668 | GJS_CAIRO_CONTEXT_GET_PRIV_CR_CHECKED(cx, argc, vp, rec, obj); |
| 669 | |
| 670 | if (argc > 0) { |
| 671 | gjs_throw(cx, "Context.popGroup() takes no arguments"); |
| 672 | return false; |
| 673 | } |
| 674 | |
| 675 | cairo_pattern_t* pattern = cairo_pop_group(cr); |
| 676 | if (!gjs_cairo_check_status(cx, cairo_status(cr), "context")) |
| 677 | return false; |
| 678 | |
| 679 | JSObject* pattern_wrapper = gjs_cairo_pattern_from_pattern(cx, pattern); |
| 680 | cairo_pattern_destroy(pattern); |
| 681 | if (!pattern_wrapper) { |
| 682 | gjs_throw(cx, "failed to create pattern"); |
| 683 | return false; |
| 684 | } |
| 685 | |
| 686 | rec.rval().setObject(*pattern_wrapper); |
| 687 | |
| 688 | return true; |
| 689 | } |
| 690 | GJS_JSAPI_RETURN_CONVENTION |
| 691 | static bool getSource_func(JSContext* cx, unsigned argc, JS::Value* vp) { |
| 692 | GJS_CAIRO_CONTEXT_GET_PRIV_CR_CHECKED(cx, argc, vp, rec, obj); |
nothing calls this directly
no test coverage detected