void ide_device::sync_file_device() { try { rhost::util::errors_to_exceptions([&] { int file_device_num = Rf_ndevNumber(_file_device); int ide_device_num = Rf_ndevNumber(device_desc); Rf_selectDevice(file_device_num); GEcopyDisplayList(ide_device_num); Rf_selectDevice(ide_device_num); }); } catch (rhost::util::r_error&) { auto path = save_empty(); send(path); } }
RestorePreviousGraphicsDeviceScope::~RestorePreviousGraphicsDeviceScope() { try { // reslect the previously selected device if we had one if (pImpl_->pPreviousDevice != NULL) Rf_selectDevice(Rf_ndevNumber(pImpl_->pPreviousDevice->dev)); } catch(...) { } }
void ide_device::select() { rhost::util::errors_to_exceptions([&] { auto num = Rf_ndevNumber(device_instance->device_desc); Rf_selectDevice(num); }); }