| 2746 | |
| 2747 | |
| 2748 | class DeviceWrapper: |
| 2749 | def __init__(self, *args): |
| 2750 | if args_match( args, mupdf.FzDevice): |
| 2751 | device, = args |
| 2752 | self.this = device |
| 2753 | elif args_match( args, Pixmap, None): |
| 2754 | pm, clip = args |
| 2755 | bbox = JM_irect_from_py( clip) |
| 2756 | if mupdf.fz_is_infinite_irect( bbox): |
| 2757 | self.this = mupdf.fz_new_draw_device( mupdf.FzMatrix(), pm) |
| 2758 | else: |
| 2759 | self.this = mupdf.fz_new_draw_device_with_bbox( mupdf.FzMatrix(), pm, bbox) |
| 2760 | elif args_match( args, mupdf.FzDisplayList): |
| 2761 | dl, = args |
| 2762 | self.this = mupdf.fz_new_list_device( dl) |
| 2763 | elif args_match( args, mupdf.FzStextPage, None): |
| 2764 | tp, flags = args |
| 2765 | opts = mupdf.FzStextOptions( flags) |
| 2766 | self.this = mupdf.fz_new_stext_device( tp, opts) |
| 2767 | else: |
| 2768 | raise Exception( f'Unrecognised args for DeviceWrapper: {args!r}') |
| 2769 | |
| 2770 | |
| 2771 | class DisplayList: |
no outgoing calls
no test coverage detected
searching dependent graphs…