123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #include "sys-defines.h"
- #include "extern.h"
- int
- _API_erase (S___(Plotter *_plotter))
- {
- bool retval1;
- int retval2 = 0;
- if (!_plotter->data->open)
- {
- _plotter->error (R___(_plotter)
- "erase: invalid operation");
- return -1;
- }
- _API_endpath (S___(_plotter));
- switch ((int)_plotter->data->output_model)
- {
- case (int)PL_OUTPUT_NONE:
-
- break;
- case (int)PL_OUTPUT_ONE_PAGE:
- case (int)PL_OUTPUT_ONE_PAGE_AT_A_TIME:
- case (int)PL_OUTPUT_PAGES_ALL_AT_ONCE:
-
- if (_plotter->data->page)
- _reset_outbuf (_plotter->data->page);
- break;
- case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES:
- case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME:
- case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM:
-
- break;
- default:
- break;
- }
-
- retval1 = _plotter->erase_page (S___(_plotter));
-
- if (_plotter->data->output_model ==
- PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME
- || _plotter->data->output_model ==
- PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM)
- retval2 = _API_flushpl (S___(_plotter));
-
- _plotter->data->frame_number++;
- return (retval1 == true && retval2 == 0 ? 0 : -1);
- }
- bool
- _pl_g_erase_page (S___(Plotter *_plotter))
- {
- return true;
- }
|