mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
54 lines
1009 B
C++
54 lines
1009 B
C++
#include "stdafx.h"
|
|
#include "WizardTypes.h"
|
|
|
|
__declspec(dllexport) WIDGET GlobalWidgetArray[1000];
|
|
__declspec(dllexport) int GlobalArrayIndex=0;
|
|
|
|
extern "C" __declspec(dllexport)
|
|
WIDGET* findWidget(CString theName)
|
|
{
|
|
|
|
for (int i = 0; i < GlobalArrayIndex; i++)
|
|
{
|
|
if (GlobalWidgetArray[i].name == theName) {
|
|
return (&GlobalWidgetArray[i]);
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
extern "C" __declspec(dllexport)
|
|
WIDGET* SetGlobal(CString theName, CString theValue)
|
|
{
|
|
WIDGET* w = findWidget(theName);
|
|
if (w == NULL)
|
|
{
|
|
// Make sure we can add this value
|
|
if (GlobalArrayIndex >= sizeof(GlobalWidgetArray))
|
|
exit(11);
|
|
|
|
GlobalWidgetArray[GlobalArrayIndex].name = theName;
|
|
GlobalWidgetArray[GlobalArrayIndex].value = theValue;
|
|
w = &GlobalWidgetArray[GlobalArrayIndex];
|
|
GlobalArrayIndex++;
|
|
}
|
|
else
|
|
w->value = theValue;
|
|
|
|
return w;
|
|
}
|
|
|
|
extern "C" __declspec(dllexport)
|
|
char *GetGlobal(CString theName)
|
|
{
|
|
WIDGET *w = findWidget(theName);
|
|
|
|
if (w)
|
|
return (char *) (LPCTSTR) w->value;
|
|
|
|
return "";
|
|
}
|
|
|
|
|