Example #1
0
/**
This is the entry point for parsing when you have a source file's path. It just
attempts to open the file and passes it on to the stream-taking sParse, which is
responsible for actually catching and reporting parse exceptions.
*/
bool ZASParser::sParse(const string& iPath, ParseHandler& iParseHandler,
                       const StreamProvider& iStreamProvider,
                       const ErrorHandler& iErrorHandler, IncludeHandler* iIncludeHandler)
{
    ZFileSpec fileSpecUsed;
    if (ZRef<ZStreamerR> theStreamer
            = iStreamProvider.ProvideStreamSource(ZFileSpec(), iPath, true, fileSpecUsed))
    {
        return sParse(fileSpecUsed, theStreamer->GetStreamR(),
                      iParseHandler, iStreamProvider, iErrorHandler, iIncludeHandler);
    }
    else
    {
        iErrorHandler.ReportError("Could not open source file \"" + iPath + "\"");
    }
    return false;
}
Example #2
0
void PainterTest_App::RunStarted()
	{
	ZApp::RunStarted();

	ZWindow* theWindow;

	theWindow = new NPainterStd_UI::ToolWindow(this, ZPoint::sZero, fPaintState, fAsset_NPainterStd.GetChild("Buttons"));
	theWindow->SetLocation(theWindow->GetOSWindow()->GetContentTopLeftInset() + theWindow->GetOSWindow()->GetMainScreenFrame(true).TopLeft());
	theWindow->BringFront();
	theWindow->GetWindowLock().Release();

	if (TESTING)
		{
		theWindow = new PainterTest_Window(this, fAsset.GetChild("Windows").GetChild("Painter"), fPaintState, ZRef<NPaintDataRep>(), ZFileSpec(), string());
		theWindow->Center();
		theWindow->BringFront();
		theWindow->GetWindowLock().Release();
		}
	}
Example #3
0
void PainterTest_App::ReceivedMessage(const ZMessage& inMessage)
	{
	bool handledIt = false;
	if (inMessage.Has("what"))
		{
		string theWhat = inMessage.GetString("what");
		if (theWhat == "zoolib:Menu")
			{
			switch (inMessage.GetInt32("menuCommand"))
				{
				case mcNew:
					{
					handledIt = true;
					PainterTest_Window* theWindow = new PainterTest_Window(this, fAsset.GetChild("Windows").GetChild("Painter"), fPaintState, ZRef<NPaintDataRep>(), ZFileSpec(), string());
					theWindow->Center();
					theWindow->BringFront();
					theWindow->GetWindowLock().Release();
					break;
					}
				}
			}
		}
	if (!handledIt)
		ZApp::ReceivedMessage(inMessage);
	}