void wfComplete(NET_StreamClass *stream) { struct stream_data *data = (struct stream_data *) stream->data_object; void *fh = nfstrm_Complete((nfstrm *)data->fpStream, NULL); cfImpl *oimpl = cf2cfImpl(data->f); FontObject *fob = (FontObject *)oimpl->object; if (fh) { // Include this fh in the correct FontObject fob->addFontHandle(data->fpPeer, fh); WF_TRACEMSG( ("NF: Stream done. Fonthandle created. Setting font state to COMPLETE.") ); fob->setState(NF_FONT_COMPLETE); } else { // This font will never become ok as the fonthandle // that we got was 0. We will assume that the data // that we streamed didn't make a valid font. WF_TRACEMSG( ("NF: Stream done. Fonthandle NOT CREATED. Setting font state to ERROR.") ); fob->setState(NF_FONT_ERROR); } // Notify the nfdoer on the status of Complete wf_NotifyObserver(data); wf_ReleaseStreamData(data); return; }
void wfAbort(NET_StreamClass *stream, int status) { struct stream_data *data = (struct stream_data *) stream->data_object; nfstrm_Abort((nfstrm *)data->fpStream, (jint) status, NULL); // Mark the font as in error cfImpl *oimpl = cf2cfImpl(data->f); FontObject *fob = (FontObject *)oimpl->object; fob->setState(NF_FONT_ERROR); // Notify nfdoer with status of Abort wf_NotifyObserver(data); wf_ReleaseStreamData(data); return; }