Ejemplo n.º 1
0
	int TryScanLine( const char *tag, T0& t0, T1& t1, T2& t2, T3& t3, T4& t4 )
	{
		if( strcmp( GetTagStr(), tag ) != 0 )
			return 0;

		return ScanLine( tag, t0, t1, t2, t3, t4 );
	}
Ejemplo n.º 2
0
	int TryScanLine( const char *tag, T& t )
	{
		if( strcmp( GetTagStr(), tag ) != 0 )
			return 0;

		return ScanLine( tag, t );
	}
Ejemplo n.º 3
0
	int TryScanLine( const char *tag, T0& t0, T1& t1 )
	{
		if( strcmp( GetTagStr(), tag ) != 0 )
			return 0;

		return ScanLine( tag, t0, t1 );
	}
Ejemplo n.º 4
0
void check_buffer( a_helpnode *h, char *buffer )
{
    ScanLine( buffer, checkBufCB, h );
    HelpMemFree( nameBuf );
    nameBuf = NULL;
    nameBufLen = 0;
}
Ejemplo n.º 5
0
void CDrawTwoBppScreenBitmap::UpdateRect(const TRect& aRect) const
	{
	ASSERT(aRect.iTl.iX >= 0 && aRect.iTl.iY >= 0);
	ASSERT(aRect.iBr.iX <= iSize.iWidth);
	ASSERT(aRect.iBr.iY <= iSize.iHeight);

	const TUint8 gray4lookup[4] = {0, 85, 170, 255};

	TInt lx = aRect.iTl.iX & ~0xf;
	TInt rx = (aRect.iBr.iX + 15) & ~0xf;

	TUint8* srcePtr = ((TUint8*)(ScanLine(aRect.iTl.iY))) + (lx / 4);
	TUint8* srcePtrLimit = srcePtr + ((rx - lx) / 4);

	TInt byteWidth = iScanLineWords * 4;

	for(TInt row = aRect.iTl.iY; row < aRect.iBr.iY; row++)
		{
		TUint8* tempSrcePtr = srcePtr;
		TUint8* destPixel = WinPixelAddress(lx,row);

		while (tempSrcePtr < srcePtrLimit)
			{
			TUint8 pixelValue1 = *tempSrcePtr++;
			TUint8 pixelValue2 = TUint8((pixelValue1 >> 2) & 0x03);
			TUint8 pixelValue3 = TUint8((pixelValue1 >> 4) & 0x03);
			TUint8 pixelValue4 = TUint8((pixelValue1 >> 6) & 0x03);
			pixelValue1 &= 0x03;

			TUint8 pixelGray = gray4lookup[pixelValue1];
			destPixel[0] = pixelGray;
			destPixel[1] = pixelGray;
			destPixel[2] = pixelGray;

			pixelGray = gray4lookup[pixelValue2];
			destPixel[3] = pixelGray;
			destPixel[4] = pixelGray;
			destPixel[5] = pixelGray;

			pixelGray = gray4lookup[pixelValue3];
			destPixel[6] = pixelGray;
			destPixel[7] = pixelGray;
			destPixel[8] = pixelGray;

			pixelGray = gray4lookup[pixelValue4];
			destPixel[9] = pixelGray;
			destPixel[10] = pixelGray;
			destPixel[11] = pixelGray;

			destPixel += 12;
			}

		srcePtr += byteWidth;
		srcePtrLimit += byteWidth;
		}
	}
Ejemplo n.º 6
0
/*
 * processLine
 */
static bool processLine( char *bufin, char *bufout, int line, bool changecurr )
{
    ScanInfo    info;

    info.buf = bufout;
    info.line = line;
    info.changecurr = changecurr;
    info.pos = 0;
    ScanLine( bufin, scanCallBack, &info );
    return( true );
}
Ejemplo n.º 7
0
inline bool CTextFileScanner::ScanBool( const std::string& strTag, const std::string& bool_tag_str, bool& b )
{
	std::string tag_true, tag_false, bool_tag;
	if( !GetBoolTagStr( tag_true, tag_false, bool_tag_str ) )
		return false;

	ScanLine( strTag.c_str(), bool_tag );

	if( bool_tag == tag_true )		{ b = true;		return true; }
	else if( bool_tag == tag_false ){ b = false;	return true; }
	else return false;
}
Ejemplo n.º 8
0
bool CGainer::ScanMatrix(BYTE data[GAINER_LED_MATRIX][GAINER_LED_MATRIX])
{
	check_config();

	if ( m_config != 7 ) { return false; }

	for ( size_t row = 0 ; row < GAINER_LED_MATRIX ; ++row ) {
		ScanLine(row,data[row]);
	}

	return true;
}
Ejemplo n.º 9
0
// ##### addTriangle() ###############################################
void OctGen::addTriangle(NodeIndex pA, NodeIndex pB, NodeIndex pC,
			  Color color)
    throw (NotEnoughMemoryException*) {
  assert (pA.getHight() == pB.getHight() && pB.getHight() == pC.getHight());
  assert (octree->isIn(pA));
  assert (octree->isIn(pB));
  assert (octree->isIn(pC));

  ScanLine l1= ScanLine(pA, pB);
  ScanLine l2= ScanLine(pA, pC);
  addLine(l1.getCurrent(), l2.getCurrent(), color);
  while (l1.hasNext() || l2.hasNext()) {
    if (l1.hasNext()) {
      l1.next();
    }
    if (l2.hasNext()) {
      l2.next();
    }
    addLine(l1.getCurrent(), l2.getCurrent(), color);
  }
}
Ejemplo n.º 10
0
static int line_len( char *str )
{
    unsigned    len;
    bool        newfile;

    len = 0;
    newfile = ScanLine( str, lineLenCB, &len );
    if( ( !GenIndex || !GenStrings ) && newfile ) {
        PrintError( "Cross file hyperlink in \"%s\" not supported with this format.\n", str );
    }
    return( len );
}
Ejemplo n.º 11
0
// ##### addLine() ###################################################
void OctGen::addLine(NodeIndex start, NodeIndex end, Color color)
    throw (NotEnoughMemoryException*) {
  assert (start.getHight() == end.getHight());
  assert (octree->isIn(start));
  assert (octree->isIn(end));

  ScanLine l= ScanLine(start, end);
  add(l.getCurrent(), color);
  while (l.hasNext()) {
    l.next();
    add(l.getCurrent(), color);
  }
}
Ejemplo n.º 12
0
	int ScanLine( const std::string& tag, T0& t0, T1& t1, T2& t2, T3& t3, T4& t4 ) { return ScanLine( tag.c_str(), t0, t1, t2, t3, t4 ); }
Ejemplo n.º 13
0
	int ScanLine( const std::string& tag, T0& t0, T1& t1, T2& t2 ) { return ScanLine( tag.c_str(), t0, t1, t2 ); }
Ejemplo n.º 14
0
	int ScanLine( const std::string& tag, T& t ) { return ScanLine( tag.c_str(), t ); }
Ejemplo n.º 15
0
int FscRead::Pass2()
/******************************************************/
/* Second pass. Read in actual picture data this time */
/******************************************************/
	{
	unsigned int bit;            	// Used to set bits in pic
	int ret,chNum;
	int n_row;            	// counts row in character picture
	int offset=0;
	int isCharBody;
	int lastLine;

	iFileBufPos=0;
	n_row=0;
	chNum=0;
	do	{
		lastLine=ReadLine();
		isCharBody=0;
        if (iInputBufLen>0 && iInputBuf[0]=='*')
            {
            if ((ret=DoCom(1))>0)
                {
                if (ret<chNum)
                    return(FileFormat);
                chNum=ret;
                }
            }
		else
			{
			int len=0;
			char* ptr=ScanLine(len);
			if (len)
                {
				isCharBody=1;
                if (n_row==0)
                    {
                    iChar=iFxf->chr[chNum];
                    chNum++;
                    }
				unsigned short int* pDest=(unsigned short int*)(iFontCompiler->FontStore()+offset+iChar->ByteWid*n_row);
                bit=1;
                *pDest=0;
                for (int width=0;width<len && (ptr[width]=='0' || ptr[width]=='1');width++)
                    {
                    if (ptr[width]=='1')
                        *pDest|=bit;
                    if (bit==0x8000)
                        {
                        bit=1;
                        pDest++;
                        *pDest=0;
                        }
                    else
                        bit<<=1;
                    }
                n_row++;
                }
            }
        if ((n_row!=0 &&  !isCharBody) || (lastLine && isCharBody))
            {
            iChar->offset=offset;
			offset+=iChar->ByteWid*n_row;
            n_row=0;
            }
        } while(!lastLine);
	return(NoError);
    }
Ejemplo n.º 16
0
int FscRead::Pass1()
    {
    int n_row=0;            	// counts row in character picture
    int ret=0;
    int specChr=0;
	int isCharBody=0;
	int lastLine=0;
	int widthofi=0;
	int widthofM=0;

	iFxf->MaxChrWidth=0;
	iFxf->cell_height=0;
	iFxf->UlinePos=0;
	iFxf->UlineThickness=0;
	iFxf->nominal_ascent=0;
	iFxf->descent=0;
	iFxf->chr_seg=0;
	iFxf->FirstChr=0;
	iFxf->n_chars=0;
	iFxf->max_info_width=0;
	iFxf->flags=0;
	iFxf->special=0;
	iFxf->ByteWid=0;
	iFxf->UseWords=0;
	iFxf->iBold=0;
	iFxf->iItalic=0;
	iFxf->iProportional=0;
	iFxf->iSerif=0;
	iFxf->iSymbol=0;
	iFxf->iUid=0;

	iUnderHang=0;
    iOverHang=0;
    iChar=new FcmCharHead[MAX_CHARS];
    for(int letter=0;letter<MAX_CHARS;letter++)
        iFxf->chr[letter]=NULL;
//**************************************************
// First pass. Read header info & character widths *
//**************************************************
    do
        {
	    int width=0;         	// width of current character picture

		lastLine=ReadLine();
		isCharBody=0;
        if (iInputBufLen>0 && iInputBuf[0]=='*')
            {
            if ((ret=DoCom(0))<0)
                  return(FileFormat);
            else if (ret)
                {
                for(;iFxf->n_chars<ret;iFxf->n_chars++)
                    iFxf->chr[iFxf->n_chars]=NULL;
                specChr=iFxf->n_chars;
                }
            }
        else
            {
			int len=0;
		    char* ptr=ScanLine(len);
            if (len)
                {
				isCharBody=1;
                if (iFxf->FirstChr<0)
                    iFxf->FirstChr=iFxf->n_chars;
                if (n_row==0)
                    {
                    for (width=0;width<len && (ptr[width]=='0' || ptr[width]=='1');width++);
                    if (iFxf->n_chars>255)
                        return(FileFormat);
                    iFxf->chr[iFxf->n_chars]=iChar;
                    iFxf->n_chars++;
                    iChar->xOffset= -iUnderHang;
                    iChar->width=width;
                    iChar->ByteWid=((iChar->width+15)>>3)&(~1);
                    iChar->move=width-iUnderHang-iOverHang;
					if(iFxf->n_chars=='i')
						widthofi=iChar->move;
					else if(iFxf->n_chars=='M')
						widthofM=iChar->move;
                    iUnderHang=0;
                    iOverHang=0;
                    if (width>iFxf->MaxChrWidth)
                        iFxf->MaxChrWidth=width;
                    }
                n_row++;
                }
            }
        if ((n_row!=0 && !isCharBody) || (lastLine && isCharBody))
            {
            if (n_row>iFxf->cell_height)
                return(FileFormat);
            iChar->height=n_row;
            iChar->yOffset=iFxf->cell_height-iFxf->descent;
            specChr++;
            n_row=0;
            width=0;
            iChar++;
            }
        } while(!lastLine);
    if (iFxf->cell_height==0)
        return(FileFormat);
	if(widthofi && widthofM)
		iFxf->iProportional=(widthofi!=widthofM);
	return(NoError);
	}