Beispiel #1
0
void TunedMemory::CalculateRecommendedMemory()
{
	TRACE( _T("Warning - TunedMemory::CalculateRecommendedMemory called") );

#if defined(__WXMSW)
	MEMORYSTATUS MemStat;
	MemStat.dwLength = sizeof(MEMORYSTATUS);
	GlobalMemoryStatus(&MemStat);

	INT32 PhysicalMemory = MemStat.dwTotalPhys;
	TRACEALL( wxT("Total Physical Memory is %d\n"), PhysicalMemory);

//	INT32 ScreenMem = GetScreenMemSize();
//	TRACEALL( _T("Screen Memory is %d\n"), ScreenMem);

	if (PhysicalMemory <= 8*1024*1024)			// 8 Megs or less
	{
		RecommendInfinite = FALSE;				// Use limited memory
		RecommendRAM = 512*1024;				// Limit to max of 512 K
	}
	else if (PhysicalMemory <= 12*1024*1024)	// 8 to 12 Megs
	{
		RecommendInfinite = FALSE;				// Use limited memory
		RecommendRAM = 1*1024*1024;				// Limit to max of 1024 K
	}
	else if (PhysicalMemory <= 16*1024*1024)	// 12 to 16 Megs
	{
		RecommendInfinite = FALSE;				// Use limited memory
		RecommendRAM = 2*1024*1024;				// Limit to max of 2048 K
	}
	else 										// More than 16 Megs
	{
		RecommendInfinite = TRUE;				// Unlimited memory
	}

	if (ShowBandingRAM)
	{
		ERROR3_PF( ("Total Physical Memory is %d", PhysicalMemory) );

		if (IsInfinite)
		{
			ERROR3("Using unlimited banding RAM");
			TRACEALL( wxT("Using unlimited Rendering RAM\n") );
		}
		else
		{
			ERROR3_PF( ("Rendering RAM set to %d",TotalRAM) );
			TRACEALL( wxT("Rendering RAM set to %d\n"), TotalRAM );
		}
	}
#else
	RecommendInfinite = TRUE;
#endif
}
Beispiel #2
0
/********************************************************************************************

>	void OperationHistory::DumpAll()

	Author:		Peter_Arnold (Xara Group Ltd) <*****@*****.**>
	Created:	15/8/95
	Inputs:		-
	Outputs:	Dumps debugging information to the debugger display
	Returns:	-
	Purpose:	This function displays debugging information on the last operation in the
				operation history.  This is the "current" one.
	Errors:		-
	SeeAlso:	OperationHistory::DumpAll
				Operation::Dump

********************************************************************************************/
void OperationHistory::DumpLast()
{
#if DEBUG_TREE
    Operation* CurrentOp = FindLastOp();

    TRACEALL( _T("\n******* Dump of last operation *******\n") );

    if (CurrentOp == NULL)
        TRACE( _T("No operations in history\n") );
    else
        CurrentOp->Dump();

    TRACEALL( _T("\n******* End of last operation dump *******\n\n") );

#endif
}
Beispiel #3
0
GlobalFractalList::~GlobalFractalList()
{
	if (!IsEmpty())
	{
		TRACEALL( _T("Trying to delete global fractal list when it's not empty !!\n") );
		Destroy();
	}
}
Beispiel #4
0
void GBrush::DeinitGBrush(void)
{
#ifdef _DEBUG
	// This was an ERROR3, but our stupid error handler doesn't handle errors very well,
	// (in fact, at this stage in program de-initialisation, it doesn' handle them at all)
	// so it's just a trace warning now.
	if (!BrushList.IsEmpty())
	{
		TRACEALL( wxT("Warning: Deinitialising GBrush when GBrush(es) still active\n\n" ) );
	}
#endif
}
Beispiel #5
0
/********************************************************************************************

>	void OperationHistory::DumpAll()

	Author:		Peter_Arnold (Xara Group Ltd) <*****@*****.**>
	Created:	15/8/95
	Inputs:		-
	Outputs:	Dumps debugging information to the debugger display
	Returns:	-
	Purpose:	This function displays debugging information on all the operations in the
				history list
	Errors:		-
	SeeAlso:	OperationHistory::DumpLast
				Operation::Dump

********************************************************************************************/
void OperationHistory::DumpAll()
{
#if DEBUG_TREE
    // loop through all the ops in the history, calling their dump functions
    ListItem* CurrentOp = OpHistoryList.GetHead();

    TRACEALL( _T("******* Complete Operation history dump *******\n") );

    if (CurrentOp == NULL)
        TRACEALL( _T("No operations in history\n") );
    else
    {
        do
        {
            ((Operation*)CurrentOp)->Dump();

            CurrentOp = OpHistoryList.GetNext(CurrentOp);
        } while (CurrentOp != NULL);
    }

    TRACEALL( _T("******* End of history dump *******\n\n") );

#endif
}
Beispiel #6
0
void FitPoint::Dump()
{
	TRACEALL( _T("FitPoint Object (%7.2f, %7.2f)\n"), x, y );
}
Beispiel #7
0
SGDisplayPreviewFonts* OpCreateFontThumbnails::FindFontFromName(String_256& strName)
{
	//First get a pointer to the fonts gallery
	FontsSGallery* pGallery=FontsSGallery::ThisGallery;

	if (!pGallery)
		return NULL;

	//And a pointer to the display tree
	SGDisplayRoot* pTree=pGallery->GetDisplayTree();

	if (!pTree)
		return NULL;

	//Welcome to Hack City! Have a nice day...

	//Now we need to remove all the spaces from strName...it's a long story why
	String_256 strCorrectedName=strName;

	INT32 iSpace=strCorrectedName.FindNextChar(' ');

	while(iSpace>=0)
	{
		strCorrectedName.Remove(iSpace, 1);
		iSpace=strCorrectedName.FindNextChar(' ');
	}

	//And let's all replace all instances of the word italic with "Ital". Another long story.
	INT32 iItalic=strCorrectedName.Sub(String_256("Italic"));

	while(iItalic>=0)
	{
		strCorrectedName.Remove(iItalic, 6);
		strCorrectedName.Insert(&String_256("Ital"), iItalic);
		iItalic=strCorrectedName.Sub(String_256("Italic"));
	}

	//Now let's check for two particular fonts that have strange description strings
	if (strCorrectedName==String_256("CacheExtraBold"))
		strCorrectedName="CacheExtra";

	else if (strCorrectedName==String_256("CalmarItal"))
			 strCorrectedName="CalmariItal";

	else if (strCorrectedName==String_256("SerpentineDBolItal"))
			 strCorrectedName="SerpentineDBol";

	else if (strCorrectedName==String_256("TimesNewRoman"))
			 strCorrectedName="Times New Roman";

	else if (strCorrectedName==String_256("AbbessRegular"))
			 strCorrectedName= "Abbess";

	else if (strCorrectedName==String_256("BalthazarRegular"))
			 strCorrectedName= "Balthazar";

	else if (strCorrectedName==String_256("KlingBoldBold"))
			 strCorrectedName= "KlingBold";

	else if (strCorrectedName==String_256("MargaretRegular"))
			 strCorrectedName= "Margaret";

	else if (strCorrectedName==String_256("PhrasticMediumRegular"))
			 strCorrectedName= "PhrasticMedium";

	else if (strCorrectedName==String_256("TarzanRegular"))
			 strCorrectedName= "Tarzan";

	else if (strCorrectedName==String_256("BorealisRegular"))
			 strCorrectedName= "Borealis";

	else if (strCorrectedName.Sub(String_256("FontBank")) == 0)
			 strCorrectedName.Remove(0, 8);

	else if (strCorrectedName==String_256("GaramondAmericanRegular"))
			 strCorrectedName= "GaramondAmerican";

	//Select everything in the gallery - (bodge!)
	pGallery->SelectItems(TRUE);

	//Get the first selected item
	SGDisplayNode* pThisItem = pTree->FindNextSelectedItem(NULL);		

	static BOOL skipall = FALSE;

	//And while we are looking at an item
	while (pThisItem)
	{
		
		if (pThisItem->IsKindOf(CC_RUNTIME_CLASS(SGTTFItem)))
		{
			//Then cast it into a True Type font pointer
			SGTTFItem* pTTFItem=(SGTTFItem*) pThisItem;
		
			//Now we need to get the cached font description for that
			//item
			LOGFONT* pLogFont=pTTFItem->CachedLogFont;

			if (!pLogFont)
				continue;

			String_256 strDescription=pLogFont->lfFaceName;

			//And if that description is the one we're looking for
			if (camStrncmp(strDescription, strCorrectedName, strCorrectedName.Length())==0)
			{
				//Return that item
				return pTTFItem;
			}

			if (!skipall)
			{
				// possible match up - does our name of the font start with the font's own description.
				if (strCorrectedName.Sub(strDescription) == 0)
				{
					// we must only match up GaramondAmerican with itself, not with plain Garamond.
					if (strCorrectedName==String_256("GaramondAmerican"))
					{
						if (strDescription==String_256("GaramondAmerican"))
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this a bold-italic font?
					else if (camStrstr(strCorrectedName, "BoldItal") != 0)
					{
						if (camStrstr(strDescription, "BoldItal") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this a heavy-italic font?
					else if (camStrstr(strCorrectedName, "HeavyItal") != 0)
					{
						if (camStrstr(strDescription, "HeavyItal") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this a heavy font?
					else if (camStrstr(strCorrectedName, "Heavy") != 0)
					{
						if (camStrstr(strDescription, "Heavy") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this a bold font?
					else if (camStrstr(strCorrectedName, "Bold") != 0)
					{
						if (camStrstr(strDescription, "Bold") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this an italic font?
					else if (camStrstr(strCorrectedName, "Ital") != 0)
					{
						if (camStrstr(strDescription, "Ital") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// is this an engraved font?
					else if (camStrstr(strCorrectedName, "Engraved") != 0)
					{
						if (camStrstr(strDescription, "Engraved") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pTTFItem;
						}
					}

					// not italic or engraved.
					else
					{
						TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
						return pTTFItem;
					}
				}
			}
		}

		else if (pThisItem->IsKindOf(CC_RUNTIME_CLASS(SGATMItem)))
		{
			//Then cast it into an ATM font pointer
			SGATMItem* pATMItem=(SGATMItem*) pThisItem;
		
			//Now we need to get the cached font description for that
			//item
			LOGFONT* pLogFont=pATMItem->CachedLogFont;

			if (!pLogFont)
				continue;

			String_256 strDescription=pLogFont->lfFaceName;

			//And if that description is the one we're looking for
			if (camStrncmp(strDescription, strCorrectedName, strCorrectedName.Length())==0)
			{
				//Return that item
				return pATMItem;
			}

			if (!skipall)
			{
				// possible match up - does our name of the font start with the font's own description.
				if (strCorrectedName.Sub(strDescription) == 0)
				{
					// we must only match up GaramondAmerican with itself, not with plain Garamond.
					if (strCorrectedName==String_256("GaramondAmerican"))
					{
						if (strDescription==String_256("GaramondAmerican"))
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this a bold-italic font?
					else if (camStrstr(strCorrectedName, "BoldItal") != 0)
					{
						if (camStrstr(strDescription, "BoldItal") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this a heavy-italic font?
					else if (camStrstr(strCorrectedName, "HeavyItal") != 0)
					{
						if (camStrstr(strDescription, "HeavyItal") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this a heavy font?
					else if (camStrstr(strCorrectedName, "Heavy") != 0)
					{
						if (camStrstr(strDescription, "Heavy") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this a bold font?
					else if (camStrstr(strCorrectedName, "Bold") != 0)
					{
						if (camStrstr(strDescription, "Bold") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this an italic font?
					else if (camStrstr(strCorrectedName, "Ital") != 0)
					{
						if (camStrstr(strDescription, "Ital") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// is this an engraved font?
					else if (camStrstr(strCorrectedName, "Engraved") != 0)
					{
						if (camStrstr(strDescription, "Engraved") != 0)
						{
							TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
							return pATMItem;
						}
					}

					// not italic or engraved.
					else
					{
						TRACEALL( _T("Matched %s with %s\n"), (TCHAR*)strCorrectedName, (TCHAR*)strDescription);
						return pATMItem;
					}
				}
			}
		}

		//And move on to the next item
		pThisItem = pTree->FindNextSelectedItem(pThisItem);		

	}

	//We haven't found anything. So return NULL.
	return NULL;
}