home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
ByeClock.sit
/
ByeClock
/
Sources
/
Bye.h
< prev
next >
Wrap
Text File
|
1996-05-10
|
5KB
|
226 lines
/*
*--------------------------------------------------------------
* Bye.h
*--------------------------------------------------------------
* Version 0.7.2
* Saturday, December 16, 1995
* Fumio Rokkaku
*--------------------------------------------------------------
*/
/*
*--------------------------------------------------------------
* custom type definitions
*--------------------------------------------------------------
*/
typedef struct {
OSType signature;
long version;
Boolean zoom;
char fill1;
Boolean shut;
char fill2;
Boolean confirm;
char fill3;
Boolean date;
char fill4;
Boolean blink;
char fill5;
short reserved1;
short reserved2;
short reserved3;
short hour;
short minute;
short retry;
short font;
Rect clockPos;
} PrefRecord, *PrefPtr, **PrefHandle;
/*
*--------------------------------------------------------------
* constants
*--------------------------------------------------------------
*/
#define kInFront (WindowRef)-1
#define kInHeap (void *)0
enum myOwnTypes {
kMySignature = 'yBye',
kPrefRsrcType = 'ByPr',
kPrefFileType = 'ByPr'
};
enum myVersions {
kTheLatestVers = 0x00000082,
kCompatibleVers = 0x00000060
};
enum generalIDs {
kBaseID = 128
};
/* Menu IDs */
enum menuIDs {
mAppleID = kBaseID,
mFileID,
mEditID,
mFontID
};
/* Menu Items */
enum AboutMenuItems {
of_About = 1
};
enum FileMenuItems {
of_Prefs = 1,
of_F___1,
of_Quit
};
enum EditMenuItems {
of_Undo = 1,
of_E___1,
of_Cut,
of_Copy,
of_Paste,
of_Clear,
of_E___2,
of_SelAll
};
/* Dialog IDs */
enum dialogIDs {
kPrefsID = 128,
kAboutID = 129,
kOldSysID = 1024,
kConfirmID = 1025
};
/* Finder Types */
enum FinderTypes {
kFinderSig = 'MACS',
kAEFinder = 'FNDR',
kSystemType = 'FNDR'
};
/* string IDs */
enum stringIDs {
kTitleStrID = 128,
kPrefNameID = 129,
kWeekNameID = 130,
kMonthNameID = 131,
kSampleStrID = 132
};
/* title string IDs and indexes */
enum titleStrIndexes {
kWinTitleIdx = 1,
kCalendarIdx = 2,
kShutTimeIdx = 3
};
/* time interval values (TICKS) */
enum tickValues {
kSleepTicks = 60 /* 60 ticks * 1 second */
};
/* time interval values (SECS) */
enum secsValues {
k10Minutes = 10 * 60 /* 10 minutes * 60 seconds */
};
/* clock drawing commands */
enum updateFlags {
kDrawIfNeeded = 0,
kDrawBlinkDot,
kDrawRightNow
};
/* key event character and key codes */
enum constCharCodes {
kHomeKey = 0x01,
kEnterKey = 0x03,
kReturnKey = 0x0D,
kEscapeKey = 0x1B
};
enum constKeyCodes {
kCmmndKey = 0x37,
kShiftKey = 0x38,
kCapsKey = 0x38,
kOptionKey = 0x3A,
kCntrlKey = 0x3B
};
/*
*--------------------------------------------------------------
* prototypes
*--------------------------------------------------------------
*/
/* Bye.main.c */
extern void DoMountDisk(EventRecord *);
extern void DoOSEvent(EventRecord *);
extern Boolean IsKeyPressed(unsigned char);
/* Bye.menu.c */
extern Boolean SetUpMyMenus(void);
extern void DoMenus(const long);
extern void AdjustMenus(void);
/* Bye.clock.c */
extern void InitShutDownActions(void);
extern void InitClockWindowSizes(void);
extern Boolean SetUpClockWindow(void);
extern void ZoomClockWindow(const short);
extern void DrawClockWindow(const short);
extern void EventOccurred(EventRecord *);
extern void CheckDeadLine(void);
/* Bye.dialog.c */
extern Boolean SetUpPrefsDialog(void);
extern void RemovePrefsDialog(void);
extern Boolean IsModelessState(WindowRef);
extern void DoModelessDialog(EventRecord *);
extern void OpenPrefsDialog(void);
extern void DoPrefsDialog(const short);
extern Boolean HiliteButton(DialogRef, const short);
extern void FrameBoldButton(DialogRef, const short);
extern void DrawBoldButton(DialogRef, const short);
extern void DoAboutDialog(void);
/* Bye.AE.c */
extern Boolean SetUpMyAppleEvent(void);
extern void RemoveMyAppleEvent(void);
extern OSErr DoShutDown(void);
/* Bye.pref.c */
extern Boolean GetMyPreferences(void);
extern OSErr SaveMyPreferences(void);
extern short GetTimesFontNumber(void);
/*
*--------------------------------------------------------------
* macros
*--------------------------------------------------------------
*/
extern long PStrLen(const StringPtr);
extern void PStrCpy(StringPtr src, StringPtr dst);
extern void PStrCat(StringPtr src, StringPtr dst);
extern void SetStrLen(StringPtr, int);
extern void CatChar(const unsigned char ch, StringPtr dst);
#define PStrLen(str) ((long)((str)[0]))
#define PStrCpy(s, d) { BlockMoveData((s), (d), ((s)[0]+1)); }
#define PStrCat(s, d) { BlockMoveData(&(s)[1], &(d)[(d)[0] +1], ((s)[0])); ((d)[0]) += ((s)[0]); }
#define SetStrLen(s, l) (s)[0] = (l)
#define CatChar(c, d) { (d)[0] += 1; (d)[(d)[0]] = c; }
/*
*--------------------------------------------------------------
* global variables
*--------------------------------------------------------------
*/
extern WindowRef gClockWindow; /* clock window */
extern DialogRef gPrefsDialog; /* preferences dialog */
extern PrefPtr gMyPrefs; /* preferences data pointer */
extern Boolean goForever; /* main loop flag */
extern Boolean gNowBackGround; /* process switch flag */
extern Boolean gHasColorQD; /* color QuickDraw flag */