// SPDX-License-Identifier: MIT #include #include "entity_ldef.h" #include "entity.h" #include "util.h" pascal void entity_ldef_proc(short message, Boolean selected, Rect *cellRect, Cell theCell, short dataOffset, short dataLen, ListHandle theList) { FontInfo info; Handle cells = (**theList).cells; struct entity* ent; HLock(cells); GetFontInfo(&info); switch (message) { case lInitMsg: break; case lCloseMsg: break; case lDrawMsg: if (dataLen > 0) { if (dataLen != sizeof(Ptr)) die("invalid dataLen %d", dataLen); memcpy(&ent, (*cells) + dataOffset, dataLen); EraseRect(cellRect); MoveTo(cellRect->left + 2, cellRect->top + info.ascent); DrawText(ent->state.name, 0, strlen(ent->state.name)); } if (selected) { InvertRect(cellRect); } break; case lHiliteMsg: InvertRect(cellRect); break; } HUnlock(cells); }