Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
BigEasy/BigEasy2.h
/* |
File: BigEasy2.h |
Contains: xxx put contents here xxx |
Written by: xxx put writers here xxx |
Copyright: © 1990-1992, 1994 by Apple Computer, Inc., all rights reserved. |
This file is used in these builds: Warhol |
Change History (most recent first): |
<24> 17-8-94 dvb GX Printing |
<23> 9-8-94 dvb |
<22> 27-7-94 dvb InstallQuitItem |
<21> 5/27/94 dvb . |
<18> 1/7/93 dvb Built in window-copy command. |
<17> 4/13/92 dvb Pass activate/deactivates to back windows. |
<16> 3/22/92 dvb QuitApp message. |
<15> 1/20/92 dvb Cool new features. Easier AppleEvents. |
<14> 12/19/91 JB removing think 4.0 code |
<13> 8/25/91 JB Changed #def Ticks to #def GetTicks |
<12> 6/3/91 dvb Just hackin. |
<11> 5/28/91 JB Added prototypes for BigEasy Proc Ptrs |
<10> 5/25/91 JB OLD_THINK_C && TOOLBOX_LINKED |
<9> 5/23/91 PH functions.. |
<8> 5/5/91 dvb App Open Events |
<7> 4/25/91 JB Changing to new THINK C interface files |
<6> 4/19/91 dvb Add WindowEventProc |
<5> 2/24/91 dvb Various cool new calls |
<4> 2/18/91 dvb Miscellaneous Updates |
<3> 2/6/91 JB Made nil #define conditional |
<2> 11/17/90 dvb Remove subport machinery |
<4> 9/19/90 dvb Fix graphics math collision |
<3> 9/10/90 dvb Take Zoomproc out of InstallWindow call. |
<2> 7/31/90 dvb Modify inclusion hierarchy |
To Do: |
*/ |
/* file: BigEasy2.h |
* |
* Started 4 July 1989, more or less. |
* |
* A set of routines to allow the quick development |
* of simple Macintosh applications. |
* |
*/ |
#ifndef BigEasyIncludes |
#define BigEasyIncludes |
#include <Types.h> |
#include <Menus.h> |
#include <Events.h> |
#include <Files.h> |
/************************************ |
* Simple things |
************************************/ |
#ifdef __cplusplus |
extern "C" { |
#endif |
typedef void (*beUpdateProcPtr)(short windowNum); |
typedef void (*beClickProcPtr)(short windowNum, Point p, short modifiers); |
typedef void (*beKeyProcPtr)(short windowNum, short key, short keycode, short modifiers); |
typedef void (*beGoAwayProcPtr)(short windowNum); |
typedef void (*beActivateProcPtr)(short windowNum); |
typedef void (*beDeactivateProcPtr)(short windowNum); |
typedef void (*beIdleProcPtr)(short windowNum, Boolean upfront); |
typedef void (*beResizeProcPtr)(short windowNum, Point *oldSize, Point *newSize, short modifiers); |
typedef void (*beGrowWindowProcPtr)(long *newSize, short windowNum, |
WindowPtr w, Point where, Rect *resizeLim); |
typedef void (*beEventProcPtr)(short windowNum, EventRecord *event, Boolean *tookEvent); |
typedef void (*beMoveWindowProcPtr)(short windowNum); |
typedef void (*beMenuProcPtr)(short windowNum, short menuItem, short menuRef); |
typedef void (*beAboutProcPtr)(void); |
typedef void (*beWNumCallProcPtr)(short windowNum); |
typedef void (*beOpenAppProcPtr)(void); |
typedef void (*beOpenDocProcPtr)(FSSpec *file); |
typedef void (*beQuitAppProcPtr)(void); |
#ifdef __cplusplus |
} |
#endif |
#ifndef nil |
#define nil (0L) |
#endif |
#define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;} |
/************************************ |
* Types |
************************************/ |
/* |
* Window Flags (as passed to InstallWindow) |
*/ |
typedef enum |
{ |
wGrowable = 1, |
wZoomable = 2, |
wCoolDrag = 4, /* Set to do the really cool live-dragwindow trick */ |
wCopyDraw = 8, /* Enables Copy edit item, and uses DrawDoc to do it. */ |
wPrintDraw = 16 /* Enables Print & Page Setup via GX */ |
}; |
/* |
* Built in menu ref-numbers |
*/ |
typedef enum |
{ |
mUndo = 30000, |
mCut, |
mCopy, |
mPaste, |
mClear, |
mPageSetup, |
mPrint |
}; |
/************************************ |
* BigEasy2 Public Global Variables |
************************************/ |
#ifdef BigEasy2 |
#define VAR |
#else |
#define VAR extern |
#endif |
VAR Boolean gQuitApp; |
VAR Boolean gMenuNeedsCmdKey; |
VAR Boolean gStaggerWindows; |
VAR Boolean gWindowsInView; |
VAR short gLastModifiers; |
VAR long gLastEventTime; |
VAR long gSystemVersion; /* for app to read */ |
VAR Boolean gHasAppleEvents; /* for app interest */ |
VAR Boolean gHasColor; /* for app interest */ |
VAR Boolean gHasGX; /* for everyone */ |
VAR Rect gBigRect; |
VAR short gStagStepX; |
VAR short gStagStepY; |
#ifndef __QUICKDRAW__ |
#include <QuickDraw.h> |
#endif |
#ifndef __WINDOWS__ |
#include <Windows.h> |
#endif |
#undef VAR |
/************************************ |
* Major BigEasy2 Routines |
************************************/ |
#ifdef __cplusplus |
extern "C" { |
#endif |
WindowPtr InstallWindow(short iNum,StringPtr iTitle,Rect *iRect,short iType,short newFlags, |
beUpdateProcPtr iUpdate,beClickProcPtr iClick,beKeyProcPtr iKey,beGoAwayProcPtr iGoAway, |
beActivateProcPtr iActivate,beDeactivateProcPtr iDeactivate,beIdleProcPtr iIdle); |
void UninstallWindow(short iNum); |
Boolean HandleUpdateEvent(EventRecord *er); |
Boolean HandleActivateEvent(EventRecord *er); |
void Show(short inum); |
void Hide(short iNum); |
MenuHandle InstallMenu(StringPtr s,beMenuProcPtr action,short ref); |
void InstallMenuItem(StringPtr s,beMenuProcPtr action,short ref); |
void InstallQuitItem(beMenuProcPtr action,short ref); |
void InstallPrintItems(beMenuProcPtr pageSetup,beMenuProcPtr print); |
void RemoveMenuItem(short ref); |
void SetMenuItem(short ref,char enable,char isMarked,char mark,StringPtr s); |
void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear); |
void InstallEditMenu(beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr); |
MenuHandle SetCurrentMenu(short ref); |
long DisableAllMenus(void); |
void EnableAllMenus(long saveMenus); |
void SetMasterIdle(beAboutProcPtr); |
void IdleWindow(short n); |
void SetMasterOpenAppProc(beOpenAppProcPtr); |
void SetMasterOpenDocProc(beOpenDocProcPtr); |
void SetMasterQuitAppProc(beQuitAppProcPtr); |
void SetWindowResizeProc(short n,beResizeProcPtr resizeProc); |
void SetWindowGrowWindowProc(short n,beGrowWindowProcPtr growWindowProc); |
void SetWindowZoomProc(short n,beWNumCallProcPtr iZoom); |
void SetWindowMoveProc(short n,beMoveWindowProcPtr moveWindowProc); |
void SetWindowEventProc(short n, beEventProcPtr iEvent); |
long GetWindowFlags(short n); |
void SetWindowFlags(short n,long flags); |
void GetWindowRect(short n,Rect *r); |
WindowPtr GetWindowPtr(short n); |
Boolean GetWindowVisible(short n); |
void Replace1Resource(Handle,long type,short id); |
void SaveWindowPosition(short n); |
void ForgetWindowPosition(short n); |
void SetAbout(StringPtr progName,StringPtr s0,beAboutProcPtr aboutProc); |
void GoWatch(void); |
void GoArrow(void); |
void GoCursor(short c); |
void FailNil(long); |
void FailOSErr(long); |
/************************************ |
* Client Provided BigEasy2 Routines |
************************************/ |
void Bootstrap(void); |
void Hatstrap(void); |
#ifdef __cplusplus |
} |
#endif |
/************************************ |
* Minor BigEasy2 Hacks |
************************************/ |
#ifndef BigEasy2 |
#define FailNil(x) FailNil((long)(x)) /* Simulate a typeless call */ |
#define FailOSErr(x) FailOSErr((long)(x)) /* Simulate a typeless call */ |
#endif |
#define GetTicks() (*(long *)Ticks) |
#endif |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-03-19