home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
CLASS.ZIP
/
2.CC
< prev
next >
Wrap
Text File
|
1993-02-21
|
29KB
|
800 lines
#include "MenuPMProcess.h"
#include "apfel.resource.h"
#include "memory.h"
#ifdef INCLUDESOURCE
#include "pmprocess.cc"
#endif
Boolean calcThread::initPost(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling calcThread::initThread(%x)\n", this);
#endif SHOWCALLS
pmThreadTree::initPost();
DosSetPriority(PRTYS_THREAD, PRTYC_IDLETIME, -31, pTIB->tib_ptib2->tib2_ultid);
return TRUE;
}
calcThread::calcThread(menuPmThreadTree *pParentNew):pmThreadTree(pParentNew)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling calcThread(%x)\n", this);
#endif SHOWCALLS
((menuPmThreadTree*)pParent)->pCalcThread = this;
}
calcThread::~calcThread(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling ~calcThread(%x)\n", this);
#endif SHOWCALLS
((menuPmThreadTree*)pParent)->pCalcThread = (calcThread*)0;
}
#ifdef undefined
fullScreen::fullScreen(menuPmThreadTree *pMsgThread)
:windowPaint(pMsgThread, 0, "")
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling fullScreen::fullScreen()\n");
#endif SHOWCALLS
((menuPmThreadTree*)pMsgThread)->pFullScreen = this;
}
#endif undefined
fullScreen::fullScreen(windowTree *pParent)
:windowPaint(pParent, 0, "")
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling fullScreen::fullScreen(%x)\n", this);
#endif SHOWCALLS
((menuPmThreadTree*)pMsgThread)->pFullScreen = this;
}
Boolean fullScreen::initPre(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling fullScreen:initPre(%x)\n", this);
#endif SHOWCALLS
if (!windowPaint::initPre())
return FALSE;
frameFlags = FCF_NOMOVEWITHOWNER | FCF_SCREENALIGN | FCF_BORDER;
windowStyle = WS_MAXIMIZED | WS_VISIBLE | FS_NOMOVEWITHOWNER | FS_SCREENALIGN;
classStyle = 0;
pWindowClassName = "fullScreen";
return TRUE;
}
Boolean fullScreen::initPost(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling fullScreen:initPost(%x)\n", this);
#endif SHOWCALLS
if (!windowPaint::initPost())
return FALSE;
WinSetWindowPos(hwndFrame, HWND_TOP, 0, 0, ((menuPmThreadTree*)pMsgThread)->iSizeX,
((menuPmThreadTree*)pMsgThread)->iSizeY,
SWP_ACTIVATE | SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW);
return TRUE;
}
MRESULT fullScreen::WMClose(MPARAM mp1, MPARAM mp2)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling fullScreen::WMClose(%x)\n", this);
#endif SHOWCALLS
return FALSE;
}
fullScreen::~fullScreen(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling ~fullScreen(%x)\n", this);
#endif SHOWCALLS
((menuPmThreadTree*)pMsgThread)->pFullScreen = (fullScreen*)0;
}
#ifdef DEBUG
void showFloatRegs(int n, int iLine)
{ double r[8];
if (n >= 1)
asm("FStPL %0" : "=m" (r[0]));
if (n >= 2)
asm("FStPL %0" : "=m" (r[1]));
if (n >= 3)
asm("FStPL %0" : "=m" (r[2]));
if (n >= 4)
asm("FStPL %0" : "=m" (r[3]));
if (n >= 5)
asm("FStPL %0" : "=m" (r[4]));
if (n >= 6)
asm("FStPL %0" : "=m" (r[5]));
if (n >= 7)
asm("FStPL %0" : "=m" (r[6]));
if (n >= 8)
asm("FStPL %0" : "=m" (r[7]));
fprintf(stderr, "%u", iLine); \
if (n >= 1) \
fprintf(stderr, " r0=%f", r[0]); \
if (n >= 2) \
fprintf(stderr, " r1=%f", r[1]); \
if (n >= 3) \
fprintf(stderr, " r2=%f", r[2]); \
if (n >= 4) \
fprintf(stderr, " r3=%f", r[3]); \
if (n >= 5) \
fprintf(stderr, " r4=%f", r[4]); \
if (n >= 6) \
fprintf(stderr, " r5=%f", r[5]); \
if (n >= 7) \
fprintf(stderr, " r6=%f", r[6]); \
if (n >= 8) \
fprintf(stderr, " r7=%f", r[7]); \
fprintf(stderr, "\n"); \
if (n >= 8)
asm("FLdL %0" : : "m" (r[7]));
if (n >= 7)
asm("FLdL %0" : : "m" (r[6]));
if (n >= 6)
asm("FLdL %0" : : "m" (r[5]));
if (n >= 5)
asm("FLdL %0" : : "m" (r[4]));
if (n >= 4)
asm("FLdL %0" : : "m" (r[3]));
if (n >= 3)
asm("FLdL %0" : : "m" (r[2]));
if (n >= 2)
asm("FLdL %0" : : "m" (r[1]));
if (n >= 1)
asm("FLdL %0" : : "m" (r[0]));
}
#else DEBUG
#define showFloatRegs(n, iLine) (void)1
#endif !DEBUG
void calcThread::doSomething(void)
{ unsigned int xi, yi, it, iMaxColors_1;
menuPmThreadTree *pMsgThread = (menuPmThreadTree*)pParent;
double xl = pMsgThread->xa, yl = pMsgThread->ya, x, y;
#ifdef undefined
const static double B1D16 = 0.0625,
B1D2 = 0.5,
B16 = 16.0,
B5 = 5.0,
B4 = 4.0;
#endif
BITMAPINFO2 *pBitmapInfo;
unsigned char *pData;
unsigned char *pDataCompare;
unsigned int iBitmapSize;
#ifdef SHOWCALLS
fprintf(stderr, "Calling calcThread::runThread(%x)\n", this);
#endif
iMaxColors_1 = pMsgThread->iMaxColors - 1;
pData = alloca(iBitmapSize = pMsgThread->iSizeX * sizeof(*pData));
pDataCompare = alloca(iBitmapSize);
assert(!((unsigned long)pData & 3));
{ unsigned int iSize;
pBitmapInfo = alloca(iSize = 256*sizeof(RGB2)
+ (unsigned int)((char*)&pBitmapInfo->ulCompression
- (char*)&pBitmapInfo->cbFix));
memset(pBitmapInfo, 0, iSize);
}
printFileLine();
{ RGB2 *pScan;
unsigned short iColor;
for (pScan = (RGB2*)&pBitmapInfo->ulCompression,
iColor = 0;
iColor < 256;
pScan++, iColor++)
{ pScan->fcOptions = PC_EXPLICIT;
(unsigned short)pScan->bBlue = iColor;
}
}
printFileLine();
pBitmapInfo->cbFix = (unsigned int)((char*)&pBitmapInfo->ulCompression
- (char*)&pBitmapInfo->cbFix);
assert(pBitmapInfo->cbFix > 0);
pBitmapInfo->cx = pMsgThread->iSizeX;
pBitmapInfo->cy = 1;
pBitmapInfo->cPlanes = 1;
pBitmapInfo->cBitCount = sizeof(*pData)*8;
/*
pBitmapInfo->ulCompression = BCA_UNCOMP;
pBitmapInfo->cbImage = 0;
pBitmapInfo->cxResolution = 0;
pBitmapInfo->cyResolution = 0;
pBitmapInfo->cclrUsed = 0;
pBitmapInfo->cclrImportant = 0;
pBitmapInfo->usUnits = 0;
pBitmapInfo->usReserved = 0;
pBitmapInfo->usRecording = BRA_BOTTOMUP;
pBitmapInfo->usRendering = BRH_NOTHALFTONED;
pBitmapInfo->ulColorEncoding = BCE_RGB;
*/
printFileLine();
for (yi = 0, x = xl, y = yl;
yi < pMsgThread->iSizeY;
x = (xl += pMsgThread->xdy), y = (yl += pMsgThread->ydy),
GpiSetBitmapBits((void*)pMsgThread->hpsBitmap, (LONG)yi, (LONG)1,
(unsigned char*)pData, pBitmapInfo),
GpiQueryBitmapBits((void*)pMsgThread->hpsBitmap, (LONG)yi, (LONG)1,
(unsigned char*)pDataCompare, pBitmapInfo),
#ifdef undefined
memcmp(pData, pDataCompare, iBitmapSize)
? fprintf(stderr, "Daten stimmen nicht!\n") : (void)1,
#endif undefined
( { RECTL rcl;
rcl.xLeft = 0;
rcl.yTop = yi + 1;
rcl.yBottom = yi;
rcl.xRight = pMsgThread->iSizeX;
if (pMsgThread->pFullScreen)
WinInvalidateRect(pMsgThread->pFullScreen->hwndClient,
&rcl, FALSE);
WinInvalidateRect(pMsgThread->pWindow->hwndClient,
&rcl, FALSE);
}
),
yi++)
for (xi = 0,
memset(pData, 0, iBitmapSize);
xi < pMsgThread->iSizeX;
xi++,
y += pMsgThread->ydx, x += pMsgThread->xdx
)
{ double y2 = y*y;
double x_1_2 = x + 1.0;
x_1_2 *= x_1_2;
if (y2 + x_1_2 > 1.0/16.0)
{ double r = x*x + y2;
double s = r - x*0.5 + 1.0/16.0;
if ((r*16 - 5.0)*s + 4*x > 1)
{ double xit = x, yit = y;
for (it = 0;
it < pMsgThread->iMaxIterations;
it++)
{ double x2 = xit*xit;
double y2 = yit*yit;
double r = y2 + x2;
if (r > pMsgThread->Grenze)
{ //POINTL ptl;
pData[xi] = it % iMaxColors_1 + 1;
//ptl.x = xi;
//ptl.y = yi;
//GpiSetColor(pMsgThread->hpsBitmap, pData[xi]);
//GpiSetPel(pMsgThread->hpsBitmap, &ptl);
break;
}
r = 2*xit*yit + y;
xit = x2 - y2 + x;
yit = r;
}
}
}
}
}
#ifdef undefined
void calcThread::runThread(void)
{ unsigned int xi, yi, it, iMaxColors_1;
menuWindowTree *pWindowTree = (menuWindowTree*)(((pmMsgThreadTree*)pParent)->pWindowTree);
double xl = pWindowTree->xa, yl = pWindowTree->ya, x, y;
static const volatile double B1D16 = 0.0625,
B1D2 = 0.5,
B16 = 16.0,
B5 = 5.0,
B4 = 4.0;
BITMAPINFO2 structBitmapInfo;
unsigned int *pData;
#ifdef SHOWCALLS
fprintf(stderr, "Calling calcThread::runThread()\n");
#endif
pmThreadTree::runThread();
printFileLine();
iMaxColors_1 = pWindowTree->iMaxColors - 1;
memset(&structBitmapInfo, 0, sizeof structBitmapInfo);
structBitmapInfo.cbFix = sizeof structBitmapInfo;
structBitmapInfo.cx = pWindowTree->iSizeX;
structBitmapInfo.cy = 1;
structBitmapInfo.cPlanes = 32;
structBitmapInfo.cBitCount = 1;
structBitmapInfo.ulCompression = 0;
pData = alloca(structBitmapInfo.cbImage
= pWindowTree->iSizeX * sizeof(unsigned int));
for (yi = 0, x = xl, y = yl,
( { asm("FldL %0" : : "m" (pWindowTree->Grenze));
asm("FldL %0" : : "m" (x));
asm("FldL %0" : : "m" (y));
}
);
yi < pWindowTree->iSizeY;
yi++, x = (xl += pWindowTree->xdy), y = (yl += pWindowTree->ydy),
GpiSetBitmapBits((void*)pWindowTree->hpsBitmap, (LONG)yi, (LONG)1,
(unsigned char*)pData, &structBitmapInfo),
( { RECTL rcl;
rcl.xLeft = 0;
rcl.yTop = rcl.yBottom = yi;
rcl.xRight = pWindowTree->iSizeX - 1;
WinInvalidateRect(pWindowTree->hwndClient, &rcl, FALSE);
}
))
for (xi = 0,
( { asm("FLdL %0" : : "m" (x));
asm("FStPL %St(2)");
asm("FLdL %0" : : "m" (y));
asm("FStPL %St(1)");
}),
memset(pData, 0, structBitmapInfo.cbImage);
xi < pWindowTree->iSizeX;
xi++,
( { asm("FAddL %0" : : "m" (pWindowTree->ydx));
asm("FLdL %0" : : "m" (pWindowTree->xdx));
asm("FAddPL %St(2)");
}
)
)
{
printFileLine();
showFloatRegs(3, __LINE__);
asm("FLdL %St(1)"); /* -- -- -- -- G xa ya x */
showFloatRegs(4, __LINE__);
asm("FLdL %St(1)"); /* -- -- -- G xa ya x y */
showFloatRegs(5, __LINE__);
asm("FLdL %St(0)"); /* -- -- G xa ya x y y */
showFloatRegs(6, __LINE__);
asm("FMul %St, %St(0)"); /* -- -- G xa ya x y y*y */
showFloatRegs(6, __LINE__);
asm("FLd %St(2)"); /* -- G xa ya x y y*y x */
showFloatRegs(7, __LINE__);
asm("FLD1"); /* G xa ya x y y*y x 1 */
showFloatRegs(8, __LINE__);
asm("FAddP %St(1), %St"); /* -- G xa ya x y y*y x+1 */
showFloatRegs(7, __LINE__);
asm("FMul %St, %St(0)"); /* -- G xa ya x y y*y (x+1)*(x+1) */
showFloatRegs(7, __LINE__);
asm("FAdd %St, %St(1)"); /* -- G xa ya x y y*y (x+1)*(x+1)+y*y */
showFloatRegs(7, __LINE__);
asm("FComPL %0" : : "m" (B1D16)); /* -- -- G xa ya x y y*y */
asm("FSTSW %EAX");
asm("SAHF");
asm("JA Weiter1");
showFloatRegs(6, __LINE__);
asm("FStP %St(0)"); /* -- -- -- G xa ya x y */
showFloatRegs(5, __LINE__);
asm("Jmp Erhoehe");
asm("Weiter1:"); /* -- -- G xa ya x y y*y */
showFloatRegs(6, __LINE__);
asm("FLd %St(2)"); /* -- G xa ya x y y*y x */
showFloatRegs(7, __LINE__);
asm("FMul %St, %St(0)"); /* -- G xa ya x y y*y x*x */
showFloatRegs(7, __LINE__);
asm("FAddP %St(1), %St"); /* -- -- G xa ya x y r */
showFloatRegs(6, __LINE__);
asm("FLdL %St(2)"); /* -- G xa ya x y r x */
showFloatRegs(7, __LINE__);
asm("FMulL %0" : : "m" (B1D2));
showFloatRegs(7, __LINE__);
asm("FSubR %St(0), %St(1)"); /* -- G xa ya x y r r-x*0.5 */
showFloatRegs(7, __LINE__);
asm("FAddL %0" : : "m" (B1D16)); /* -- G xa ya x y r r-x*0.5+1/16 */
showFloatRegs(7, __LINE__);
asm("FSqrt"); /* -- G xa ya x y r s */
showFloatRegs(7, __LINE__);
asm("FLdL %0" : : "m" (B16)); /* G xa ya x y r s 16 */
showFloatRegs(8, __LINE__);
asm("FMulP %St(2), %St"); /* -- G xa ya x y r*16 s */
showFloatRegs(7, __LINE__);
asm("FLdL %0" : : "m" (B5)); /* G xa ya x y r*16 s 5 */
showFloatRegs(8, __LINE__);
asm("FSubP %St(2), %St"); /* -- G xa ya x y r*16-5 s */
showFloatRegs(7, __LINE__);
asm("FMulP %St(1), %St"); /* -- -- G xa ya x y (r*16-5)*s */
showFloatRegs(6, __LINE__);
asm("FLdL %0" : : "m" (B4)); /* -- G xa ya x y (r*16-5)*s 4 */
showFloatRegs(7, __LINE__);
asm("FMul %St, %St(3)"); /* -- G xa ya x y (r*16-5)*s 4*x */
showFloatRegs(7, __LINE__);
asm("FAddP %St(1), %St"); /* -- -- G xa ya x y (r*16-5)*s+4*x */
showFloatRegs(6, __LINE__);
asm("FLd1"); /* -- G xa ya x y (r*16-5)*s+4*x 1 */
showFloatRegs(7, __LINE__);
asm("FComP %St(1)"); /* -- -- G xa ya x y (r*16-5)*s+4*x */
asm("FSTSW %EAX");
asm("FStP %St(0)");
asm("SAHF");
asm("JA Erhoehe");
printFileLine();
showFloatRegs(5, __LINE__);
for (it = 0; it < pWindowTree->iMaxIterations; it++)
{
asm("FLd %St(1)"); /* -- -- G xa ya x y x */
asm("FMul %St, %St(0)"); /* -- -- G xa ya x y x*x */
asm("FLd %St(1)"); /* -- G xa ya x y x*x y */
asm("FMul %St, %St(0)"); /* -- G xa ya x y x*x y*y */
asm("FLd %St(1)"); /* G xa ya x y x*x y*y x*x */
asm("FAdd %St, %St(1)"); /* G xa ya x y x*x y*y x*x+y*y */
asm("FComP %St(7)"); /* -- G xa ya x y x*x y*y */
asm("FSTSW %EAX");
asm("SAHF");
asm("JA Erreicht");
asm("FSubP %St(1), %St"); /* -- -- G xa ya x y x*x-y*y */
asm("FAdd %St, %St(4)"); /* -- -- G xa ya x y x*x-y*y+xa */
asm("FLdL %St(2)"); /* -- G xa ya x y x*x-y*y+xa x */
asm("FMul %St, %St(2)"); /* -- G xa ya x y x*x-y*y+xa x*y */
asm("FAdd %St, %St(0)"); /* -- G xa ya x y x*x-y*y+xa 2*x*y */
asm("FAdd %St, %St(4)"); /* -- G xa ya x y x*x-y*y+xa 2*x*y+ya */
asm("FStP %St(2)"); /* -- -- G xa ya x 2*x*y+ya x*x-y*y+xa */
asm("FStP %St(2)"); /* -- -- G xa ya x*x-y*y+xa 2*x*y+ya */
}
printFileLine();
showFloatRegs(5, __LINE__);
showFloatRegs(5, __LINE__);
asm("Jmp Erhoehe");
asm("Erreicht:");
#ifdef DEBUG
fprintf(stderr, "xi= %u, yi = %u, it = %u\n", xi, yi, it);
#endif
pData[xi] = it % iMaxColors_1 + 1;
asm("FStP %St");
asm("FStP %St");
asm("Erhoehe:");
asm("FStP %St");
asm("FStP %St");
}
asm("FStP %St");
asm("FStP %St");
asm("FStP %St");
}
#endif undefined
MRESULT menuWindowTree::windowProc(ULONG msg, MPARAM mp1, MPARAM mp2)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree::windowProc(%x)\n", this);
#endif SHOWCALLS
switch (msg)
{ default:
return windowPaint::windowProc(msg, mp1, mp2);
case WM_COMMAND:
switch ((USHORT)mp1)
{ case IDM_Calculate:
if (!((menuPmThreadTree*)pMsgThread)
->pCalcThread)
(void)new calcThread(
(menuPmThreadTree*)pMsgThread);
break;
case IDM_BreakCalculation:
if (((menuPmThreadTree*)pMsgThread)
->pCalcThread)
delete ((menuPmThreadTree*)pMsgThread)
->pCalcThread;
break;
case IDM_FullScreen:
printFileLine();
if (!((menuPmThreadTree*)pMsgThread)
->pFullScreen)
{ (void)new fullScreen(this);
printFileLine();
if (!((menuPmThreadTree*)pMsgThread)
->pFullScreen->init())
delete ((menuPmThreadTree*)
pMsgThread)->pFullScreen;
printFileLine();
}
break;
case IDM_CloseFullScreen:
if (((menuPmThreadTree*)pMsgThread)
->pFullScreen)
WinDestroyWindow(
((menuPmThreadTree*)pMsgThread)
->pFullScreen->hwndFrame);
break;
}
return windowPaint::windowProc(msg, mp1, mp2);
}
}
Boolean menuWindowTree::initPost(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree::initPost(%x)\n", this);
#endif
return windowPaint::initPost();
}
#ifdef undefined
Boolean menuWindowTree::initPre(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree::initPre(%x)\n", this);
#endif
return windowPaint::initPre();
}
#endif
windowPaint::windowPaint(pmMsgThreadTree *pMsgThreadNew, int idResource, char *pTitle)
:processWindow(pMsgThreadNew, idResource, pTitle)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling windowPaint::windowPaint(%x)\n", this);
#endif SHOWCALLS
}
windowPaint::windowPaint(windowTree *pParent, int idResource, char *pTitle)
:processWindow(pParent, idResource, pTitle)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling windowPaint::windowPaint(%x)\n", this);
#endif SHOWCALLS
}
void windowPaint::doPaint(HPS hps, RECTL *pStructRectl)
{ POINTL aPoint[4];
#ifdef SHOWCALLS
fprintf(stderr, "Calling windowPaint::WMPaint(%x)\n", this);
#endif SHOWCALLS
aPoint[0].x = pStructRectl->xLeft;
aPoint[0].y = pStructRectl->yBottom;
aPoint[1].x = pStructRectl->xRight;
aPoint[1].y = pStructRectl->yTop;
aPoint[2].x = pStructRectl->xLeft;
aPoint[2].y = pStructRectl->yBottom;
aPoint[3].x = pStructRectl->xRight;
aPoint[3].y = pStructRectl->yTop;
GpiBitBlt(hps, ((menuPmThreadTree*)pMsgThread)->hpsBitmap, 4, aPoint,
ROP_SRCCOPY, BBO_OR);
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree::WMPaint()\n");
fprintf(stderr, "invalidated rectangle : \n");
fprintf(stderr, "xLeft = %ld yBottom = %ld \n",
pStructRectl->xLeft, pStructRectl->yBottom);
fprintf(stderr, "xRight = %ld yTop = %ld \n",
pStructRectl->xRight, pStructRectl->yTop);
#endif SHOWCALLS
}
Boolean windowPaint::initPre(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling windowPaint::initPre(%x)\n", this);
#endif
return processWindow::initPre();
}
Boolean windowPaint::initPost(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling windowPaint::initPost(%x)\n", this);
#endif
return processWindow::initPost();
}
Boolean menuWindowTree::initPre(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree:initPre(%x)\n", this);
#endif SHOWCALLS
if (!windowPaint::initPre())
return FALSE;
frameFlags |= FCF_MENU;
pWindowClassName = "menuWindowTree";
return TRUE;
}
menuWindowTree::menuWindowTree(pmMsgThreadTree *pMsgThreadNew, int idResource,
char *pTitle):windowPaint(pMsgThreadNew, idResource, pTitle)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuWindowTree::menuWindowTree(%x)\n", this);
#endif SHOWCALLS
((menuPmThreadTree*)pMsgThreadNew)->pWindow = this;
}
menuWindowTree::~menuWindowTree(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling ~menuWindowTree(%x)\n", this);
#endif SHOWCALLS
}
#ifdef undefined
Boolean dummyWindow::initPre(void)
{ return fullScreen::initPre();
}
Boolean dummyWindow::initPost(void)
{ return fullScreen::initPost();
}
#endif
#ifdef DEBUG
void menuPmThreadTree::run(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::run(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "this->doSomething() = %x (%x)\n", &this->doSomething,
menuPmThreadTree::doSomething);
#endif
pmMsgThreadTree::run();
}
void menuPmThreadTree::doSomething(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::doSomething(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "this->doSomething() = %x (%x)\n", &this->doSomething,
menuPmThreadTree::doSomething);
#endif
pmMsgThreadTree::doSomething();
}
Boolean menuPmThreadTree::init(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::init(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "this->doSomething() = %x (%x)\n", &this->doSomething,
menuPmThreadTree::doSomething);
#endif
return pmMsgThreadTree::init();
}
Boolean menuPmThreadTree::initPre(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::initPre(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "this->doSomething() = %x (%x)\n", &this->doSomething,
menuPmThreadTree::doSomething);
#endif
return pmMsgThreadTree::initPre();
}
#endif DEBUG
Boolean menuPmThreadTree::create(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::create(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "this->doSomething() = %x (%x)\n", &this->doSomething,
menuPmThreadTree::doSomething);
#endif
if (!(pWindowTree
= new menuWindowTree((pmMsgThreadTree*)this, ID_Resource,
"Apfel")))
return FALSE;
#ifdef SHOWCALLS
fprintf(stderr, "Leaving menuPmThreadTree::create()\n");
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "doSomething() = %x\n", &this->doSomething);
#endif
return TRUE;
}
Boolean menuPmThreadTree::initPost(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmThreadTree::initPost(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "doSomething() = %x\n", &this->doSomething);
#endif
pmMsgThreadTree::initPost();
hdcBitmap = DevOpenDC(hab, OD_MEMORY, (unsigned char*)"*", 0, 0, 0);
{ SIZEL size;
size.cx = size.cy = 0;
hpsBitmap = GpiCreatePS(hab, hdcBitmap, &size,
PU_PELS | GPIF_DEFAULT | GPIT_MICRO | GPIA_ASSOC);
}
iSizeX = WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN);
iSizeY = WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN);
{ long alBmpFormats[2];
BITMAPINFOHEADER2 structBmpInfoHeader;
GpiQueryDeviceBitmapFormats(hpsBitmap, 2, alBmpFormats);
memset(&structBmpInfoHeader, 0, sizeof(structBmpInfoHeader));
structBmpInfoHeader.cbFix = sizeof(structBmpInfoHeader);
structBmpInfoHeader.cx = iSizeX;
structBmpInfoHeader.cy = iSizeY;
structBmpInfoHeader.cPlanes = (USHORT)alBmpFormats[0];
structBmpInfoHeader.cBitCount = (USHORT)alBmpFormats[1];
hbm = GpiCreateBitmap(hpsBitmap, &structBmpInfoHeader, 0, (BYTE*)0,
(BITMAPINFO2*)0);
}
GpiSetBitmap(hpsBitmap, hbm);
{ POINTL aPoint[4];
aPoint[0].x = 0;
aPoint[0].y = iSizeY;
aPoint[1].x = iSizeX;
aPoint[1].y = 0;
aPoint[2].x = 0;
aPoint[2].y = iSizeY;
aPoint[3].x = iSizeX;
aPoint[3].y = 0;
GpiBitBlt(hpsBitmap, hpsBitmap, 4, aPoint, ROP_ZERO, BBO_OR);
}
xa = -2.0;
xdx = 3.0 / iSizeX;
xdy = 0.0;
ya = xdx*iSizeY*0.5;
ydy = -xdx;
ydx = 0.0;
iMaxIterations = 255;
Grenze = 100.0;
{ HDC hdc;
hdc = WinOpenWindowDC(HWND_DESKTOP);
DevQueryCaps((HDC)hdc, (LONG)CAPS_COLORS, (LONG)1, (LONG*)&iMaxColors);
}
#ifdef SHOWCALLS
fprintf(stderr, "Leaving menuPmThreadTree::initPost(%x)\n", this);
#endif SHOWCALLS
#ifdef DEBUG
fprintf(stderr, "doSomething() = %x\n", &this->doSomething);
#endif
return TRUE;
}
Boolean menuPmProcess::create(void)
{
#ifdef SHOWCALLS
fprintf(stderr, "Calling menuPmProcess::create(%x)\n", this);
#endif SHOWCALLS
if (!(pThreadTree = new menuPmThreadTree(this)))
return FALSE;
return TRUE;
}