Exemplo n.º 1
0
TextFileComp::TextFileComp(istream& in, OverlayComp* parent) 
: TextOvComp(nil, parent) {
    _pathname = _begstr = _endstr = nil;
    _linewidth = -1;
    _valid = GetParamList()->read_args(in, this); 
    Init();
}
Exemplo n.º 2
0
TextOvComp::TextOvComp(istream& in, OverlayComp* parent) 
: OverlayComp(nil, parent) {
    _valid = GetParamList()->read_args(in, this); 

    /* correct font vertical position */
    PSFont* f = _gr->GetFont();
    float sep = 1 - (f ? f->GetLineHt() : 0);
    Transformer* t = _gr->GetTransformer();
    float dx = 0., dy = sep;

    if (t != nil) {
        float x0, y0, x1, y1;
        t->Transform(0., 0., x0, y0);
        t->Transform(0., sep, x1, y1);
        dx = x1 - x0;
        dy = y1 - y0;
    }
    _gr->Translate(dx, dy);
}
Exemplo n.º 3
0
void IEffectPainter::OnWriteToStream (IWriteStream *pStream)

//	OnWriteToStream
//
//	Writes list of parameters from the painter.

	{
	int i;

	TArray<CString> Params;
	if (!m_bSingleton && GetParamList(&Params))
		{
		//	Write the count of parameters

		DWORD dwSave = Params.GetCount();
		pStream->Write((char *)&dwSave, sizeof(DWORD));

		//	Write each parameter (name and value)

		for (i = 0; i < Params.GetCount(); i++)
			{
			//	Write the parameter value

			Params[i].WriteToStream(pStream);

			//	Write the value

			CEffectParamDesc Value;
			GetParam(Params[i], &Value);

			Value.WriteToStream(pStream);
			}
		}
	else
		{
		DWORD dwSave = 0;
		pStream->Write((char *)&dwSave, sizeof(DWORD));
		}
	}