home *** CD-ROM | disk | FTP | other *** search
- #include <Gestalt.h>
- #include <DCon.h>
- #include <QuickDraw.h>
- #include <MixedMode.h>
- #include <A4Stuff.h>
- #include <ControlStrip.h>
-
- #include "DockStrip.h"
-
- ProcInfoType __procinfo = sdevMain_ProcInfo;
-
- SdevMainUPP* gCallThroughSdevMain = (SdevMainUPP*) 0xDEADBEEF;
- SDockStripGlobals* gGlobalsPtr = nil;
-
- pascal long main (
- unsigned long message,
- Handle prefsHandle,
- Rect *statusRect,
- GrafPtr statusPort)
- {
- Rect copy;
- long result;
- Boolean runModule;
-
- static Boolean gotIndex = false;
- static UInt32 index;
-
- if (gGlobalsPtr == nil) {
- Gestalt (dockStripGestalt, (SInt32*)&(gGlobalsPtr));
- }
- if (gGlobalsPtr == nil) {
- DebugStr ("\pGlobals not found in Gestalt");
- }
-
- // DebugStr ("\pSdev stub main");
-
- if (!gotIndex) {
- for (index = 0; index < StubListSize; index++) {
- if (gGlobalsPtr -> moduleList [index].module.handle == (Handle) gCallThroughSdevMain) {
- gotIndex = true;
- break;
- }
- }
- }
-
- if (!gotIndex) {
- DebugStr ("\pModule not found in the list");
- }
-
- result = BeforeModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, &runModule);
-
- if (runModule) {
- copy = *statusRect;
- result = CallSdevMainProc (*gCallThroughSdevMain, message, prefsHandle, ©, statusPort);
-
- result = AfterModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, result);
- }
-
- return result;
- }