bool ListControl::OnKeyCheck(unsigned key_code) const { switch (key_code) { case KEY_RETURN: return CanActivateItem(); case KEY_LEFT: if (!HasPointer()) /* no wrap-around on Altair, as KEY_LEFT is usually used to switch to the previous dialog page */ return true; return GetCursorIndex() > 0; case KEY_UP: if (!HasPointer() && IsShort()) /* no page up/down behaviour in short lists on Altair; this rotation knob should move focus */ return false; return GetCursorIndex() > 0; case KEY_RIGHT: if (!HasPointer()) /* no wrap-around on Altair, as KEY_RIGHT is usually used to switch to the next dialog page */ return true; return GetCursorIndex() + 1 < length; case KEY_DOWN: if (!HasPointer() && IsShort()) /* no page up/down behaviour in short lists on Altair; this rotation knob should move focus */ return false; return GetCursorIndex() + 1 < length; default: return false; } }
void PkChar::Read (/*[in]*/ InputStream & inputstream, /*[in]*/ int flag) { this->flag = flag; if (IsShort()) { // read character preamble (short form) packetSize = (((static_cast<int>(GetLower3()) % 4) << 8 | inputstream.ReadByte()) - 8); charCode = inputstream.ReadByte(); tfm = inputstream.ReadTrio(); cx = inputstream.ReadByte(); rasterWidth = inputstream.ReadByte(); rasterHeight = inputstream.ReadByte(); cxOffset = inputstream.ReadSignedByte(); cyOffset = inputstream.ReadSignedByte(); } else if (IsExtendedShort()) { // read character preamble (extended short form) packetSize = (((static_cast<int>(GetLower3()) % 4) << 16 | inputstream.ReadPair()) - 13); charCode = inputstream.ReadByte(); tfm = inputstream.ReadTrio(); cx = inputstream.ReadPair(); rasterWidth = inputstream.ReadPair(); rasterHeight = inputstream.ReadPair(); cxOffset = inputstream.ReadSignedPair(); cyOffset = inputstream.ReadSignedPair(); } else { // read character preamble (long form) packetSize = inputstream.ReadSignedQuad() - 28; charCode = inputstream.ReadSignedQuad(); tfm = inputstream.ReadSignedQuad(); cx = inputstream.ReadSignedQuad(); cx = (cx + 0x10000) >> 16; cy = inputstream.ReadSignedQuad(); cy = (cy + 0x10000) >> 16; rasterWidth = inputstream.ReadSignedQuad(); rasterHeight = inputstream.ReadSignedQuad(); cxOffset = inputstream.ReadSignedQuad(); cyOffset = inputstream.ReadSignedQuad(); } tfm = ScaleFix(tfm, pDviFont->GetScaledAt()); if (packetSize == 0) { #if 0 trace_error->WriteFormattedLine ("libdvi", T_("%d: no glyph!"), charCode); #endif } else { trace_pkchar->WriteFormattedLine ("libdvi", T_("going to read character %d"), charCode); pPackedRaster = new BYTE[packetSize]; inputstream.Read (pPackedRaster, packetSize); } }
Boolean ShortInt::IsValue(const ChrString& Str_) { return IsShort(Str_.c_str()); }
bool PkChar::IsExtendedShort () { return (GetLower3() < 7 && ! IsShort() ? true : false); }