// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#define DEBUG_PRINTF(NAME) { static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
+
+ #include <malloc.h>
+ #include <stdio.h>
+
+ int HeapCheck(void)
+ {
+ int rc;
+
+ if (_HEAPOK != (rc = _heapchk()))
+ {
+ switch(rc)
+ {
+ case _HEAPEMPTY:
+ puts("The heap has not been initialized.");
+ break;
+ case _HEAPBADNODE:
+ puts("A memory node is corrupted or the heap is damaged.");
+ break;
+ case _HEAPBADBEGIN:
+ puts("The heap specified is not valid.");
+ break;
+ }
+ fflush(stdout);
+ }
+ return 0;
+ }
// ============================================================================
// declarations
// headers
// ----------------------------------------------------------------------------
+ #include <malloc.h>
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
wxFontRefData::~wxFontRefData()
{
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
// TODO:
// if ( m_hFont )
// {
void wxFont::Init()
{
+
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
+
if ( wxTheFontList )
wxTheFontList->Append(this);
}
wxFontEncoding encoding)
{
UnRef();
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
m_refData = new wxFontRefData(pointSize, family, style, weight,
underlined, faceName, encoding);
wxFont::~wxFont()
{
+ int l;
+ l = sizeof(*this);
+HeapCheck();
+ _heap_check();
+
if ( wxTheFontList )
wxTheFontList->DeleteObject(this);
+HeapCheck();
+ _heap_check();
+
}
// ----------------------------------------------------------------------------
bool wxFont::RealizeResource()
{
+DEBUG_PRINTF(wxFont::RealizeResource)
if ( GetResourceHandle() )
{
// VZ: the old code returned FALSE in this case, but it doesn't seem
fName.usWeightClass = FWEIGHT_BOLD;
break;
}
-
+
if( M_FONTDATA->m_underlined )
fAttrs.fsSelection |= FATTR_SEL_UNDERSCORE;
break;
}
-// Now cheking
+// Now cheking
fLid = 1;
hps = ::WinGetPS( HWND_DESKTOP );
long numLids = ::GpiQueryNumberSetIds( hps );
long gpiError;
-
+
// First we should generate unique id
if( numLids )
{
::WinReleasePS( hps );
return 0;
}
-
+
for(unsigned long LCNum = 0; LCNum < numLids; LCNum++)
if(lIds[LCNum] == fLid)
++fLid;
int wxFont::GetPointSize() const
{
- return M_FONTDATA->m_pointSize;
+DEBUG_PRINTF(wxFont::GetPointSize)
+ wxFontRefData* pTmp;
+
+ pTmp = M_FONTDATA;
+ if(pTmp)
+ return pTmp->m_pointSize;
+ else
+ return 10;
}
int wxFont::GetFamily() const