#include <wx/metafile.h>
#include <wx/utils.h>
-#include <wx/ogl/mfutils.h>
+#include "wx/ogl/ogl.h"
+
#include <stdio.h>
static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated.
if (stringParam) delete[] stringParam;
}
-wxXMetaFile::wxXMetaFile(char *file)
+wxXMetaFile::wxXMetaFile(const wxChar *file)
{
ok = FALSE;
top = 0.0;
return (HandleTableSize - 1);
}
-bool wxXMetaFile::ReadFile(char *file)
+bool wxXMetaFile::ReadFile(const wxChar *file)
{
HandleTableSize = 0;
- FILE *handle = fopen(file, "rb");
+ FILE *handle = wxFopen(file, wxT("rb"));
if (!handle) return FALSE;
// Read placeable metafile header, if any
{
wxMetaRecord *rec = new wxMetaRecord(META_TEXTOUT);
int count = getshort(handle);
- rec->stringParam = new char[count+1];
- fread((void *)rec->stringParam, sizeof(char), count, handle);
+ rec->stringParam = new wxChar[count+1];
+ fread((void *)rec->stringParam, sizeof(wxChar), count, handle);
rec->stringParam[count] = 0;
rec->param2 = getshort(handle); // Y
rec->param1 = getshort(handle); // X
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
// case META_STRETCHDIB:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBRUSH:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEPATTERNBRUSH:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEPENINDIRECT:
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
// For some reason, the size of this record is sometimes 9 words!!!
// instead of the usual 8. So read 2 characters extra.
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBRUSHINDIRECT:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBITMAPINDIRECT:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBITMAP:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEREGION:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
default:
wxXMetaFile::~wxXMetaFile(void)
{
- wxNode *node = metaRecords.First();
+ wxNode *node = metaRecords.GetFirst();
while (node)
{
- wxMetaRecord *rec = (wxMetaRecord *)node->Data();
+ wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
delete rec;
- wxNode *next = node->Next();
+ wxNode *next = node->GetNext();
delete node;
node = next;
}
bool wxXMetaFile::Play(wxDC *dc)
{
- wxNode *node = metaRecords.First();
+ wxNode *node = metaRecords.GetFirst();
while (node)
{
- wxMetaRecord *rec = (wxMetaRecord *)node->Data();
+ wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
int rdFunction = rec->metaFunction;
switch (rdFunction)
break;
}
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}