home *** CD-ROM | disk | FTP | other *** search
- /* =================
- * Ped0MacToolbox.cc
- * =================
- */
-
- #include "PedestalDebugging.h"
-
- #include <AEObjects.h>
- #include <Dialogs.h>
- #include <EPPC.h>
- #include <Fonts.h>
- #include <Gestalt.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <Windows.h>
-
- #include "Ped0MacToolbox.hh"
-
- void
- Ped0MacToolbox::InitToolbox()
- {
- ::InitGraf(&qd.thePort);
- ::InitFonts();
- ::InitWindows();
- ::InitMenus();
- ::TEInit();
- ::InitDialogs(NULL);
- ::InitCursor();
- // FlushEvents?
- }
-
- void
- Ped0MacToolbox::InitMemory(short inMoreMasters)
- {
- ::MaxApplZone();
- for (int i = 0; i < inMoreMasters; i++)
- ::MoreMasters();
- }
-
- void
- Ped0MacToolbox::InitPPCToolbox()
- {
- OSErr err;
- long ppcAttrs;
-
- err = ::Gestalt(gestaltPPCToolboxAttr, &ppcAttrs);
- ThrowIfOSErr_(err); // No PPC Toolbox
-
- if (!(ppcAttrs & gestaltPPCSupportsRealTime)) { // Not initialized
- err = ::PPCInit();
- ThrowIfOSErr_(err); // Couldn't initialize the PPC Toolbox
- }
-
- if (ppcAttrs & gestaltPPCSupportsOutGoing) ;
- if (ppcAttrs & gestaltPPCSupportsIncoming) ;
-
- }
-
- void
- Ped0MacToolbox::InitObjectSupportLibrary()
- {
- OSErr err = ::AEObjectInit();
- ThrowIfOSErr_(err);
- }
-
- Boolean
- Ped0MacToolbox::HasAppleEvents()
- {
- long gestaltValue;
- return ::Gestalt(gestaltAppleEventsAttr, &gestaltValue) == noErr
- && gestaltValue & (1 << gestaltAppleEventsPresent);
- }
-
- Boolean
- Ped0MacToolbox::HasFindFolder()
- {
- long gestaltValue;
- return ::Gestalt(gestaltFindFolderAttr, &gestaltValue) == noErr
- && gestaltValue & (1 << gestaltFindFolderPresent);
- }
-
- Boolean
- Ped0MacToolbox::HasNewStandardFile()
- {
- long gestaltValue;
- return ::Gestalt(gestaltStandardFileAttr, &gestaltValue) == noErr
- && gestaltValue & (1 << gestaltStandardFile58);
- }
-
- Boolean
- Ped0MacToolbox::HasHelpManager()
- {
- long gestaltValue;
- return ::Gestalt(gestaltHelpMgrAttr, &gestaltValue) == noErr
- && gestaltValue & (1 << gestaltHelpMgrPresent);
- }
-
- Boolean
- Ped0MacToolbox::HasAliasManager()
- {
- long gestaltValue;
- return ::Gestalt(gestaltAliasMgrAttr, &gestaltValue) == noErr
- && gestaltValue & (1 << gestaltAliasMgrPresent);
- }
-
- Boolean
- Ped0MacToolbox::HasComponentManager()
- {
- long gestaltValue;
- return ::Gestalt(gestaltComponentMgr, &gestaltValue) == noErr
- && gestaltValue > 0;
- }
-