home *** CD-ROM | disk | FTP | other *** search
- #include "DemoLib.h"
-
- long gDemoLong;
-
- #pragma export on
-
- RoutineDescriptor Do_DemoRD = BUILD_ROUTINE_DESCRIPTOR(kDo_DemoProcInfo,Do_Demo);
- RoutineDescriptor Set_DemoValueRD = BUILD_ROUTINE_DESCRIPTOR(kSet_DemoValueProcInfo,Set_DemoValue);
- RoutineDescriptor Get_DemoValueRD = BUILD_ROUTINE_DESCRIPTOR(kGet_DemoValueProcInfo,Get_DemoValue);
-
- pascal void Do_Demo(void)
- {
- Rect tRect = {0,0,200,200};
- WindowPtr tWindowPtr = FrontWindow();
- unsigned char* strPtr;
- Point tPoint;
-
- if (tWindowPtr)
- tRect = tWindowPtr->portRect;
- tPoint.h = (tRect.right + tRect.left) >> 1;
- tPoint.v = (tRect.top + tRect.bottom) >> 1;
- MoveTo(tPoint.h,tPoint.v + (24 * gDemoLong));
-
- switch (gDemoLong)
- {
- case 0:
- strPtr = (unsigned char*) &"\pThis is the Library! gDemoLong is zero.";
- break;
- case 1:
- strPtr = (unsigned char*) &"\pThis is the Library! gDemoLong is one.";
- break;
- case 2:
- strPtr = (unsigned char*) &"\pThis is the Library! gDemoLong is two.";
- break;
- default:
- strPtr = (unsigned char*) &"\pThis is the Library! gDemoLong is many.";
- gDemoLong = 0;
- break;
- }
- DrawString(strPtr);
- }
-
- pascal void Set_DemoValue(long pLong)
- {
- gDemoLong = pLong;
- }
-
- pascal long Get_DemoValue(void)
- {
- return gDemoLong;
- }
-
- #pragma export off
-