Ejemplo n.º 1
0
// reassign copper text to new layers
// enter with layer[] = table of new copper layers for each old copper layer
//
void CTextList::ReassignCopperLayers( int n_new_layers, int * layer )
{
	CText * t = GetFirstText();
	while( t )
	{
		int old_layer = t->m_layer;
		if( old_layer >= LAY_TOP_COPPER )
		{
					int index = old_layer - LAY_TOP_COPPER;
					int new_layer = layer[index];
					if( new_layer == old_layer )
					{
						// do nothing
					}
					else if( new_layer == -1 )
					{
						// delete this text
						t->Undraw();
						RemoveText( t );
					}
					else
					{
						// move to new layer
						t->Undraw();
						t->m_layer = new_layer + LAY_TOP_COPPER;
						t->Draw( m_dlist, m_smfontutil ); 
					}
		}
		t = GetNextText();
	}
}
Ejemplo n.º 2
0
// get bounding rectangle for all text strings
// return FALSE if no text strings
//
BOOL CTextList::GetTextBoundaries( CRect * r )
{
	BOOL bValid = FALSE;
	CRect br;
	br.bottom = INT_MAX;
	br.left = INT_MAX;
	br.top = INT_MIN;
	br.right = INT_MIN;
	CText * t = GetFirstText();
	while( t )
	{
		for( int is=0; is<t->m_stroke.GetSize(); is++ )
		{
			stroke * s = &t->m_stroke[is];
			br.bottom = min( br.bottom, s->yi - s->w );
			br.bottom = min( br.bottom, s->yf - s->w );
			br.top = max( br.top, s->yi + s->w );
			br.top = max( br.top, s->yf + s->w );
			br.left = min( br.left, s->xi - s->w );
			br.left = min( br.left, s->xf - s->w );
			br.right = max( br.right, s->xi + s->w );
			br.right = max( br.right, s->xf + s->w );
			bValid = TRUE;
		}
		t = GetNextText();
	}
	*r = br;
	return bValid;
}
Ejemplo n.º 3
0
// return text that matches guid
//
CText * CTextList::GetText( GUID * guid )
{
	CText * text = GetFirstText();
	while( text )
	{
		if( text->m_guid == *guid )
			return text;
		text = GetNextText();
	}
	return NULL;
}
Ejemplo n.º 4
0
void CMsnContactManager::ParseContactHeader(ACL_XML* xml)
{
	cache_key_ = GetFirstText(xml, "CacheKey");
	preferred_hostname_ = GetFirstText(xml, "PreferredHostName");
	session_id_ = GetFirstText(xml, "SessionId");
}