wxMetafileRefData::wxMetafileRefData(void)
{
m_metafile = 0;
- m_windowsMappingMode = MM_ANISOTROPIC;
+ m_windowsMappingMode = wxMM_ANISOTROPIC;
}
wxMetafileRefData::~wxMetafileRefData(void)
{
m_refData = new wxMetafileRefData;
- M_METAFILEDATA->m_windowsMappingMode = MM_ANISOTROPIC;
+ M_METAFILEDATA->m_windowsMappingMode = wxMM_ANISOTROPIC;
M_METAFILEDATA->m_metafile = 0;
- if (!file.IsNull() && (file.Cmp("") == 0))
+ if (!file.IsNull() && (file.Cmp(wxT("")) == 0))
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
}
if (!file.IsNull() && wxFileExists(file))
wxRemoveFile(file);
- if (!file.IsNull() && (file != ""))
+ if (!file.IsNull() && (file != wxT("")))
m_hDC = (WXHDC) CreateMetaFile(file);
else
m_hDC = (WXHDC) CreateMetaFile(NULL);
m_ok = (m_hDC != (WXHDC) 0) ;
// Actual Windows mapping mode, for future reference.
- m_windowsMappingMode = MM_TEXT;
-
- SetMapMode(MM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
+ m_windowsMappingMode = wxMM_TEXT;
+
+ SetMapMode(wxMM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
}
// New constructor that takes origin and extent. If you use this, don't
m_minY = 10000;
m_maxX = -10000;
m_maxY = -10000;
- if (file != "" && wxFileExists(file)) wxRemoveFile(file);
+ if (file != wxT("") && wxFileExists(file)) wxRemoveFile(file);
m_hDC = (WXHDC) CreateMetaFile(file);
m_ok = TRUE;
::SetWindowExtEx((HDC) m_hDC,xext,yext, NULL);
// Actual Windows mapping mode, for future reference.
- m_windowsMappingMode = MM_ANISOTROPIC;
-
- SetMapMode(MM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
+ m_windowsMappingMode = wxMM_ANISOTROPIC;
+
+ SetMapMode(wxMM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
}
wxMetafileDC::~wxMetafileDC(void)
SIZE sizeRect;
TEXTMETRIC tm;
- GetTextExtentPoint(dc, (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect);
+ GetTextExtentPoint(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
GetTextMetrics(dc, &tm);
ReleaseDC(NULL, dc);
- *x = XDEV2LOGREL(sizeRect.cx);
- *y = YDEV2LOGREL(sizeRect.cy);
- if (descent) *descent = tm.tmDescent;
- if (externalLeading) *externalLeading = tm.tmExternalLeading;
+ if ( x )
+ *x = sizeRect.cx;
+ if ( y )
+ *y = sizeRect.cy;
+ if ( descent )
+ *descent = tm.tmDescent;
+ if ( externalLeading )
+ *externalLeading = tm.tmExternalLeading;
}
wxMetafile *wxMetafileDC::Close(void)
switch (mode)
{
- case MM_TWIPS:
+ case wxMM_TWIPS:
{
m_logicalScaleX = (float)(twips2mm * mm2pixelsX);
m_logicalScaleY = (float)(twips2mm * mm2pixelsY);
break;
}
- case MM_POINTS:
+ case wxMM_POINTS:
{
m_logicalScaleX = (float)(pt2mm * mm2pixelsX);
m_logicalScaleY = (float)(pt2mm * mm2pixelsY);
break;
}
- case MM_METRIC:
+ case wxMM_METRIC:
{
m_logicalScaleX = mm2pixelsX;
m_logicalScaleY = mm2pixelsY;
break;
}
- case MM_LOMETRIC:
+ case wxMM_LOMETRIC:
{
m_logicalScaleX = (float)(mm2pixelsX/10.0);
m_logicalScaleY = (float)(mm2pixelsY/10.0);
break;
}
default:
- case MM_TEXT:
+ case wxMM_TEXT:
{
m_logicalScaleX = 1.0;
m_logicalScaleY = 1.0;
/*
* Pass filename of existing non-placeable metafile, and bounding box.
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
- * and sets the window origin and extent to mimic the MM_TEXT mapping mode.
+ * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
*
*/
p < (WORD *)&pMFHead ->checksum; ++p)
pMFHead ->checksum ^= *p;
- FILE *fd = fopen((char *)(const char *)filename, "rb");
+ FILE *fd = fopen(filename.fn_str(), "rb");
if (!fd) return FALSE;
- char tempFileBuf[256];
- wxGetTempFileName("mf", tempFileBuf);
- FILE *fHandle = fopen(tempFileBuf, "wb");
+ wxChar tempFileBuf[256];
+ wxGetTempFileName(wxT("mf"), tempFileBuf);
+ FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
if (!fHandle)
return FALSE;
fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);