BOOL CEtsEodManagerDoc::OnOpenDocument(LPCTSTR lpszPathName) { DeleteContents(); SetModifiedFlag(); CWaitCursor wait; if(ERROR_SUCCESS == FileOpen(lpszPathName)) { _ReadReport(); m_bIsCurrent = _IsCurrent(lpszPathName); EnableNotify(m_bIsCurrent); } SetModifiedFlag(FALSE); return TRUE; }
status_t TabletProtocolHandler::Control(uint32 *cookie, uint32 op, void *buffer, size_t length) { switch (op) { case MS_READ: { if (length < sizeof(tablet_movement)) return B_BUFFER_OVERFLOW; while (true) { status_t result = _ReadReport(buffer); if (result != B_INTERRUPTED) return result; } } case MS_NUM_EVENTS: { if (fReport.Device()->IsRemoved()) return B_DEV_NOT_READY; // we are always on demand, so 0 queued events return 0; } case MS_SET_CLICKSPEED: #ifdef __HAIKU__ return user_memcpy(&fClickSpeed, buffer, sizeof(bigtime_t)); #else fClickSpeed = *(bigtime_t *)buffer; return B_OK; #endif } return B_ERROR; }