home *** CD-ROM | disk | FTP | other *** search
Wrap
/* File: Controls.h Copyright: © 1984-1993 by Apple Computer, Inc., all rights reserved. WARNING This file was auto generated by the interfacer tool. Modifications must be made to the master file. */ #ifndef __CONTROLS__ #define __CONTROLS__ #ifndef __QUICKDRAW__ #include <Quickdraw.h> /* #include <Types.h> */ /* #include <ConditionalMacros.h> */ /* #include <MixedMode.h> */ /* #include <Traps.h> */ /* #include <QuickdrawText.h> */ /* #include <IntlResources.h> */ #endif #ifndef __MENUS__ #include <Menus.h> #endif enum { pushButProc = 0, checkBoxProc = 1, radioButProc = 2, useWFont = 8, scrollBarProc = 16, inButton = 10, inCheckBox = 11, inUpButton = 20, inDownButton = 21, inPageUp = 22, inPageDown = 23, inThumb = 129, popupMenuProc = 1008, /* 63 * 16 */ inLabel = 1, inMenu = 2, inTriangle = 4 }; enum { popupFixedWidth = 1 << 0, popupVariableWidth = 1 << 1, popupUseAddResMenu = 1 << 2, popupUseWFont = 1 << 3 }; enum { popupTitleBold = 1 << 8, popupTitleItalic = 1 << 9, popupTitleUnderline = 1 << 10, popupTitleOutline = 1 << 11, popupTitleShadow = 1 << 12, popupTitleCondense = 1 << 13, popupTitleExtend = 1 << 14, popupTitleNoStyle = 1 << 15 }; enum { popupTitleLeftJust = 0x00000000, popupTitleCenterJust = 0x00000001, popupTitleRightJust = 0x000000FF, /* axis constraints for DragGrayRgn call*/ noConstraint = 0, hAxisOnly = 1, vAxisOnly = 2, /* control messages*/ drawCntl = 0, testCntl = 1, calcCRgns = 2, initCntl = 3, dispCntl = 4, posCntl = 5, thumbCntl = 6, dragCntl = 7, autoTrack = 8, calcCntlRgn = 10, calcThumbRgn = 11, cFrameColor = 0, cBodyColor = 1, cTextColor = 2 }; enum { cThumbColor = 3 }; typedef struct ControlRecord ControlRecord, *ControlPtr, **ControlHandle; typedef pascal long (*ControlDefProcPtr)(short varCode, ControlHandle theControl, short message, long param); enum { uppControlDefProcInfo = kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(long))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlHandle))) | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short))) | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))) }; #if USESROUTINEDESCRIPTORS typedef UniversalProcPtr ControlDefUPP; #define CallControlDefProc(userRoutine, varCode, theControl, message, param) \ CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlDefProcInfo, (varCode), (theControl), (message), (param)) #define NewControlDefProc(userRoutine) \ (ControlDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentISA()) #else typedef ControlDefProcPtr ControlDefUPP; #define CallControlDefProc(userRoutine, varCode, theControl, message, param) \ (*(userRoutine))((varCode), (theControl), (message), (param)) #define NewControlDefProc(userRoutine) \ (ControlDefUPP)(userRoutine) #endif typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, short partCode); enum { uppControlActionProcInfo = kPascalStackBased | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle))) | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short))) }; #if USESROUTINEDESCRIPTORS typedef UniversalProcPtr ControlActionUPP; #define CallControlActionProc(userRoutine, theControl, partCode) \ CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlActionProcInfo, (theControl), (partCode)) #define NewControlActionProc(userRoutine) \ (ControlActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentISA()) #else typedef ControlActionProcPtr ControlActionUPP; #define CallControlActionProc(userRoutine, theControl, partCode) \ (*(userRoutine))((theControl), (partCode)) #define NewControlActionProc(userRoutine) \ (ControlActionUPP)(userRoutine) #endif #if defined(powerc) || defined (__powerc) #pragma options align=mac68k #endif struct ControlRecord { ControlHandle nextControl; WindowPtr contrlOwner; Rect contrlRect; unsigned char contrlVis; unsigned char contrlHilite; short contrlValue; short contrlMin; short contrlMax; Handle contrlDefProc; Handle contrlData; ControlActionUPP contrlAction; long contrlRfCon; Str255 contrlTitle; }; #if defined(powerc) || defined(__powerc) #pragma options align=reset #endif #if defined(powerc) || defined (__powerc) #pragma options align=mac68k #endif struct PopupPrivateData { MenuHandle mHandle; /*popup menu handle*/ short mID; /*popup menu ID*/ }; #if defined(powerc) || defined(__powerc) #pragma options align=reset #endif typedef struct PopupPrivateData PopupPrivateData; typedef PopupPrivateData *PopupPrivateDataPtr, **PopupPrivateDataHandle; #if defined(powerc) || defined (__powerc) #pragma options align=mac68k #endif struct CtlCTab { long ccSeed; /*reserved*/ short ccRider; /*see what you have done - reserved*/ short ctSize; /*usually 3 for controls*/ ColorSpec ctTable[4]; }; #if defined(powerc) || defined(__powerc) #pragma options align=reset #endif typedef struct CtlCTab CtlCTab; typedef CtlCTab *CCTabPtr, **CCTabHandle; #if defined(powerc) || defined (__powerc) #pragma options align=mac68k #endif struct AuxCtlRec { Handle acNext; /*handle to next AuxCtlRec*/ ControlHandle acOwner; /*handle for aux record's control*/ CCTabHandle acCTable; /*color table for this control*/ short acFlags; /*misc flag byte*/ long acReserved; /*reserved for use by Apple*/ long acRefCon; /*for use by application*/ }; #if defined(powerc) || defined(__powerc) #pragma options align=reset #endif typedef struct AuxCtlRec AuxCtlRec; typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle; #ifdef __cplusplus extern "C" { #endif extern pascal ControlHandle NewControl(WindowPtr theWindow, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short value, short min, short max, short procID, long refCon) ONEWORDINLINE(0xA954); extern pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title) ONEWORDINLINE(0xA95F); extern pascal void GetControlTitle(ControlHandle theControl, Str255 title) ONEWORDINLINE(0xA95E); extern pascal ControlHandle GetNewControl(short controlID, WindowPtr owner) ONEWORDINLINE(0xA9BE); extern pascal void DisposeControl(ControlHandle theControl) ONEWORDINLINE(0xA955); extern pascal void KillControls(WindowPtr theWindow) ONEWORDINLINE(0xA956); extern pascal void HideControl(ControlHandle theControl) ONEWORDINLINE(0xA958); extern pascal void ShowControl(ControlHandle theControl) ONEWORDINLINE(0xA957); extern pascal void DrawControls(WindowPtr theWindow) ONEWORDINLINE(0xA969); extern pascal void Draw1Control(ControlHandle theControl) ONEWORDINLINE(0xA96D); extern pascal void HiliteControl(ControlHandle theControl, short hiliteState) ONEWORDINLINE(0xA95D); extern pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRgn) ONEWORDINLINE(0xA953); extern pascal void MoveControl(ControlHandle theControl, short h, short v) ONEWORDINLINE(0xA959); extern pascal void SizeControl(ControlHandle theControl, short w, short h) ONEWORDINLINE(0xA95C); extern pascal void SetControlValue(ControlHandle theControl, short theValue) ONEWORDINLINE(0xA963); extern pascal short GetControlValue(ControlHandle theControl) ONEWORDINLINE(0xA960); extern pascal void SetControlMinimum(ControlHandle theControl, short minValue) ONEWORDINLINE(0xA964); extern pascal short GetControlMinimum(ControlHandle theControl) ONEWORDINLINE(0xA961); extern pascal void SetControlMaximum(ControlHandle theControl, short maxValue) ONEWORDINLINE(0xA965); extern pascal short GetControlMaximum(ControlHandle theControl) ONEWORDINLINE(0xA962); extern pascal void SetControlReference(ControlHandle theControl, long data) ONEWORDINLINE(0xA95B); extern pascal long GetControlReference(ControlHandle theControl) ONEWORDINLINE(0xA95A); extern pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc) ONEWORDINLINE(0xA96B); extern pascal ControlActionUPP GetControlAction(ControlHandle theControl) ONEWORDINLINE(0xA96A); extern pascal void DragControl(ControlHandle theControl, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis) ONEWORDINLINE(0xA967); extern pascal short TestControl(ControlHandle theControl, Point thePt) ONEWORDINLINE(0xA966); extern pascal short TrackControl(ControlHandle theControl, Point thePoint, ControlActionUPP actionProc) ONEWORDINLINE(0xA968); extern pascal short FindControl(Point thePoint, WindowPtr theWindow, ControlHandle *theControl) ONEWORDINLINE(0xA96C); extern pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable) ONEWORDINLINE(0xAA43); extern pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl) ONEWORDINLINE(0xAA44); extern pascal short GetControlVariant(ControlHandle theControl) ONEWORDINLINE(0xA809); extern void dragcontrol(ControlHandle theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis); extern ControlHandle newcontrol(WindowPtr theWindow, const Rect *boundsRect, char *title, Boolean visible, short value, short min, short max, short procID, long refCon); extern short findcontrol(Point *thePoint, WindowPtr theWindow, ControlHandle *theControl); extern void getcontroltitle(ControlHandle theControl, char *title); extern void setcontroltitle(ControlHandle theControl, char *title); extern short trackcontrol(ControlHandle theControl, Point *thePoint, ControlActionUPP actionProc); extern short testcontrol(ControlHandle theControl, Point *thePt); #if OLDROUTINENAMES #define SetCTitle(theControl, title) SetControlTitle(theControl, title) #define GetCTitle(theControl, title) GetControlTitle(theControl, title) #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn) #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue) #define GetCtlValue(theControl) GetControlValue(theControl) #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue) #define GetCtlMin(theControl) GetControlMinimum(theControl) #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue) #define GetCtlMax(theControl) GetControlMaximum(theControl) #define SetCRefCon(theControl, data) SetControlReference(theControl, data) #define GetCRefCon(theControl) GetControlReference(theControl) #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc) #define GetCtlAction(theControl) GetControlAction(theControl) #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable) #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl) #define GetCVariant(theControl) GetControlVariant(theControl) #define getctitle(theControl, title) getcontroltitle(theControl, title) #define setctitle(theControl, title) setcontroltitle(theControl, title) #endif #ifdef __cplusplus } #endif #endif