Пример #1
0
/* virtual */
string FormatterHTML::makeFunctionHeader(const string &strKeyword,
                                         const string &strIdentifier,
                                         ParamsVector &vParams,
                                         bool fLong) /* override */
{
    string str;

    if (!vParams.size())
        str = strKeyword + " " + makeBold(strIdentifier) + "()";
    else
    {
        if (fLong)
            str = "<table class=\"functable\"><tr><td style=\"white-space: nowrap;\">";
        str += strKeyword + " " + makeBold(strIdentifier) + "(";
        if (fLong)
            str += "</td>";

        size_t c = 0;
        for (const auto &param : vParams)
        {
            ++c;
            if (fLong)
            {
                if (c > 1)
                    str += "<tr><td>&nbsp;</td>";
                str += "<td>";
            }

            if (!param._strTypeFormattedHTML.empty())
                str += param._strTypeFormattedHTML + " ";
            str += format(param._argname, false);
            str += (c == vParams.size()) ? ") " : ", ";
            if (fLong)
            {
                str += "</td>\n<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>" + format(param._description, false);
                str += "</i></td></tr>";
            }
        }
        if (fLong)
            str += "</table>";
    }

    return str;
}
Пример #2
0
std::string MouseEventManager::printXYViewEvent(const ui::XYViewEvent& xyViewEvent)
{
	switch (xyViewEvent)
	{
		case ui::xyNothing: return makeBold(_("Nothing"));
		case ui::xyMoveView: return makeBold(_("Move View"));
		case ui::xySelect: return makeBold(_("Select"));
		case ui::xyZoom: return makeBold(_("Zoom View"));
		case ui::xyCameraMove: return makeBold(_("Drag Camera"));
		case ui::xyCameraAngle: return makeBold(_("Point Camera"));
		case ui::xyNewBrushDrag: return makeBold(_("Create New Brush"));
		default: return makeBold(_("Unknown event"));
	}
}
Пример #3
0
/* virtual */
string FormatterLatex::makeFunctionHeader(const string &strKeyword,
                                          const string &strIdentifier0,
                                          ParamsVector &vParams,
                                          bool fLong) /* override */
{
    string str;
    string strIdentifier = makeBold(format(strIdentifier0, false));

    if (!vParams.size())
    {
        str = strKeyword + " " + strIdentifier + "()";
        if (fLong)
            str = makeCODE(str);
    }
    else
    {
        if (fLong)
        {
            str += "\n\\begin{funcbox}";
            str += "\n\\begin{tabularx}{\\textwidth}{ l l X }\n";
            str += "\\multicolumn{3}{l}{" + makeCODE(strKeyword) + "} \\\\\n";
            str += makeCODE(strIdentifier + "(");
        }
        else
            str = strKeyword + " " + strIdentifier + "(";

        size_t c = 0;
        for (const auto &param : vParams)
        {
            ++c;

            if (fLong)
                str += " & ";
            if (!param._strTypeFormattedLaTeX.empty())
                str += param._strTypeFormattedLaTeX + " ";
            str += format(param._argname, false);
            str += (c == vParams.size()) ? ") " : ", ";
            if (fLong)
            {
                str += " & \\textit{" + format(param._description, false) + "} \\\\\n";
            }
        }
        if (fLong)
            str += "\\end{tabularx}\n\\end{funcbox}\n";
    }

    return str;
}
Пример #4
0
std::string MouseEventManager::printObserverEvent(const ui::ObserverEvent& observerEvent)
{
	switch (observerEvent)
	{
		case ui::obsNothing: return makeBold(_("Nothing"));
		case ui::obsManipulate: return makeBold(_("Manipulate"));
		case ui::obsSelect: return makeBold(_("Select"));
		case ui::obsToggle: return makeBold(_("Toggle Selection"));
		case ui::obsToggleFace: return makeBold(_("Toggle Face Selection"));
		case ui::obsReplace: return makeBold(_("Cycle Selection"));
		case ui::obsReplaceFace: return makeBold(_("Cycle Face Selection"));
		case ui::obsCopyTexture: return makeBold(_("Copy Texture"));
		case ui::obsPasteTextureProjected: return makeBold(_("PasteTexture Projected"));
		case ui::obsPasteTextureNatural: return makeBold(_("PasteTexture Natural"));
		case ui::obsPasteTextureCoordinates: return makeBold(_("PasteTexture Coordinates"));
		case ui::obsPasteTextureToBrush: return makeBold(_("Paste Texture to all Brush Faces"));
		case ui::obsPasteTextureNameOnly: return makeBold(_("Paste Texture Name only"));
		case ui::obsJumpToObject: return makeBold(_("Jump to Object"));
		default: return makeBold(_("Unknown event"));
	}
}
Пример #5
0
/*
Given a specification for a document and a view, this function will run the
single-edit tests for that document/view.

The document is represented by a descriptor array in which each descriptor is a paragraph.

The view is represented simply by the TInt aTopOfBand argument, which tells us how
many paragraphs to lose from the top of the band. So if it is zero, then we just initialise
the doc and don't scroll at all; if it is 1 we scroll down until 1 paragraph is removed from
the top of the band, and so on. Currently it's basically only ever set to 1 or 0, and is thus
used as a boolean "top_of_doc!=top_of_band"

So, given the document/view. the function will retrieve the list of useful positions to test,
and then test:
- increasing font size
- deleting
- inserting text
- inserting various other things
...making use of various helper functions to do so
*/
void RunSingleEditTestsOnDocumentL(CRichText& aRichText, CBandMaintainer& aMaintainer,
	CBandValidator& aValidator, const MDesCArray& aTextContents, TInt aTopOfBand)
	{
	TDocumentSpec docSpec(aTextContents, aTopOfBand);
	docSpec.SetupDocumentL(aRichText, aMaintainer);


	RArray<TInt> positions;
	CleanupClosePushL(positions);

	RArray<TTmLineInfo> lines;
	CleanupClosePushL(lines);

	if(KSelectEditPointsFromWholeBand)
		{
		GetLinesInBandL(aMaintainer.TmLayoutUnderTest(), lines);
		}
	else
		{
		GetVisibleLinesL(aMaintainer.LayoutUnderTest(), lines);
		}

	PositionsToTestL(lines, positions);

	output->WriteDocumentAttributesL(aMaintainer.ViewUnderTest());
	output->WriteDocumentPositionsL(positions);

	test.Start(_L("Reformatting: change font"));
	TReformatText changeFont(aMaintainer, aRichText, aValidator, EChangeFont, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, changeFont, docSpec, positions);

	test.Next(_L("Reformatting: decrease font"));
	TReformatText decreaseFont(aMaintainer, aRichText, aValidator, EDecreaseFontSize, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, decreaseFont, docSpec, positions);

	test.Next(_L("Reformatting: make bold"));
	TReformatText makeBold(aMaintainer, aRichText, aValidator, EMakeBold, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, makeBold, docSpec, positions);

	test.Next(_L("Reformatting: increase font"));
	TReformatText increaseFont(aMaintainer, aRichText, aValidator, EIncreaseFontSize, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, increaseFont, docSpec, positions);

	test.Next(_L("Deleting"));
	TDeleteText deleteText(aMaintainer, aRichText, aValidator);
	ExecuteTestL(aRichText, aMaintainer, deleteText, docSpec, positions);

	test.Next(_L("Inserting a space"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KSpace, positions);

	test.Next(_L("Inserting several spaces"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KSpaces, positions);

	test.Next(_L("Inserting less than a line of text"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KEnglishLessThanALine_1, positions);

	test.Next(_L("Inserting multi-line text"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KEnglishMoreThanALine_1, positions);

	test.Next(_L("Inserting RLO marker"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KRLO, positions);

	test.Next(_L("Inserting paragraph delimiter"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KParagraphDelimiter, positions);

	test.End();

	CleanupStack::PopAndDestroy(2);
	}