home *** CD-ROM | disk | FTP | other *** search
- #include "ApplicationLib.h"
- #include "EventLib.h"
- #include "MenuLib.h"
- #include "ResourceConstantsLib.h"
-
- /* associate commands with menu items */
- static MenuPickType menus[64] = {
- { RLM_APPLE, 0, CMD_APPLE, NULL },
- { RLM_APPLE, 1, CMD_ABOUT, NULL },
- { RLM_APPLE, 2, CMD_HELP, NULL },
- { RLM_FILE, 0, CMD_FILE, NULL },
- { RLM_FILE, 1, CMD_NEW, NULL },
- { RLM_FILE, 2, CMD_OPEN, NULL },
- { RLM_FILE, 4, CMD_CLOSE, NULL },
- { RLM_FILE, 5, CMD_SAVE, NULL },
- { RLM_FILE, 6, CMD_SAVE_AS, NULL },
- { RLM_FILE, 7, CMD_REVERT, NULL },
- { RLM_FILE, 9, CMD_PAGE_SETUP, NULL },
- { RLM_FILE, 10, CMD_PRINT, NULL },
- { RLM_FILE, 12, CMD_QUIT, NULL },
- { RLM_EDIT, 0, CMD_EDIT, NULL },
- { RLM_EDIT, 1, CMD_UNDO, NULL },
- { RLM_EDIT, 3, CMD_CUT, NULL },
- { RLM_EDIT, 4, CMD_COPY, NULL },
- { RLM_EDIT, 5, CMD_PASTE, NULL },
- { RLM_EDIT, 6, CMD_CLEAR, NULL },
- { RLM_EDIT, 7, CMD_SELECT_ALL, NULL },
- { RLM_EDIT, 9, CMD_CLIPBOARD, NULL },
- { RLM_EDIT, 10, CMD_PREFERENCES, NULL },
- { RLM_FONT, 0, CMD_FONT, NULL },
- { RLM_SIZE, 0, CMD_SIZE, NULL },
- { RLM_STYLE, 0, CMD_STYLE, NULL },
- { RLM_JUST, 0, CMD_JUST, NULL },
- { RLM_JUST, 1, CMD_JUSTIFY_LEFT, NULL },
- { RLM_JUST, 2, CMD_JUSTIFY_CENTER, NULL },
- { RLM_JUST, 3, CMD_JUSTIFY_RIGHT, NULL },
- { RLM_TEXT, 0, CMD_TEXT, NULL },
- { RLM_TEXT, 5, CMD_MARGIN, NULL },
- { RLM_WINDOWS, 0, CMD_WINDOW, NULL },
- { RLM_DEBUG, 0, CMD_DEBUG, NULL },
- { RLM_DEBUG, 1, CMD_DEBUG_DEBUGGER, NULL },
- { RLM_DEBUG, 2, CMD_DEBUG_WINDOW, NULL },
- { RLM_DEBUG, 3, CMD_DEBUG_MEMORY, NULL },
- { RLM_DEBUG, 5, CMD_DEBUG_ASSERT_ALL, NULL },
- { RLM_DEBUG, 6, CMD_DEBUG_ASSERT_REQUIRE, NULL },
- { RLM_DEBUG, 7, CMD_DEBUG_ASSERT_ENSURE, NULL },
- { RLM_DEBUG, 8, CMD_DEBUG_ASSERT_CHECK, NULL },
- { RLM_DEBUG, 10, CMD_DEBUG_ASSERT_BREAK, NULL },
- { RLM_DEBUG, 11, CMD_DEBUG_ASSERT_RAISE, NULL },
- { RLM_DEBUG, 12, CMD_DEBUG_ASSERT_TRACE, NULL },
- { RLM_DEBUG, 13, CMD_DEBUG_ASSERT_STACK, NULL },
- { RLM_DEBUG, 15, CMD_DEBUG_PROFILE, NULL },
- { RLM_DEBUG, 16, CMD_DEBUG_TRACE, NULL },
- { 0, 0, CMD_NONE, NULL },
- };
-
- #pragma options(!require_protos, infer_protos)
-
- // debug_note
- #include "PatchLib.h"
-
- // debug_note
- pascal Boolean PatchSystemEvent(PatchType *patch, EventRecord *event)
- {
- /* do nothing */
- return(false);
- }
-
- static void init(void)
- {
- TRY {
-
- // debug_note
- (void) PatchBegin(PatchSystemEvent, _SystemEvent, sizeof(EventRecord *),
- sizeof(PatchBooleanParameter), NULL);
-
- /* minimal event tables */
- ApplicationEventTableRegister();
- CtlEventTableRegister();
- DlgModalEventTableRegister();
- WinEventTableRegister();
- TxEventTableRegister();
-
- /* next tier of event tables */
- RadioEventTableRegister();
- FloatMenuEventTableRegister();
- FrameEventTableRegister();
- ListEventTableRegister();
- SBarEventTableRegister();
-
- /* next tier of event tables */
- AboutEventTableRegister();
- ClipboardEventTableRegister();
- HelpEventTableRegister();
- ProgressEventTableRegister();
-
- /* application event tables */
- AppPrefsEventTableRegister();
- IconListEventTableRegister();
- TxScrlEventTableRegister();
- WinMenuEventTableRegister();
-
- DocEventTableRegister();
- DocHLEInstall();
- TxDocTableRegister();
-
- //ConcatenateTextFoldersHLEInstall();//debug_note
-
- /* specific application event tables */
- TestEventTableRegister();
-
- /* debugging event tables */
- #ifndef NDEBUG
- DebugEventTableRegister();
- MemoryWindowEventTableRegister();
- #endif
-
- /* attach commands to menu items */
- MenuTableAppend(menus);
-
- } CATCH {
- AppFailed();
- } ENDTRY;
- }
-
- #pragma options(require_protos, !infer_protos)
-
- void main(void)
- {
- TRY {
- AppBegin();
- init();
- AppRun();
- AppEnd();
- } CATCH {
- NOPROPAGATE;
- } ENDTRY;
- ExitToShell(); /* also removes all of our patches */
- }
-