DEFINITION MODULE MuiClasses; (*************************************************************************** ** ** $VER: MuiClasses.def 3.3 (21.2.96) ** ** The following updates have been done by ** ** Olaf "Olf" Peters ** ** $HISTORY: ** ** 21.2.96 3.3 : updated for MUI 3.3 release ** 23.1.96 3.2 : updated for MUI 3.2 release ** 18.11.95 3.1 : updated for MUI v3.1 release ** ***************************************************************************) (************************************************************************* ** Structures and Macros for creating MUI custom classes. ** ** converted for M2 by Christian 'Kochtopf' Scholz ** ************************************************************************** ** ** $Id: MuiClasses.def 1.7 1996/01/25 20:24:36 olf Exp olf $ ** ** /// "$Log: MuiClasses.def $ # Revision 1.7 1996/01/25 20:24:36 olf # revised for MUI 3.2 # # Revision 1.6 1995/12/15 16:37:53 olf # - applied changes from Stefan Schulz # - cleanup of IMPORT section #" # Revision 1.5 1995/11/18 16:46:18 olf # MUI Release 3.1 # # Revision 1.4 1995/11/02 20:02:47 olf # updated to muimaster 11.3283 # # Revision 1.3 1995/10/23 17:59:16 olf # *** empty log message *** # # Revision 1.2 1995/10/23 17:06:34 olf # *** empty log message *** # # Revision 1.1 1995/09/25 15:32:52 olf # Initial revision # # Revision 1.8 1994/08/16 20:24:55 Kochtopf # mCustumClassPtr hinzugefügt # mCustomClass nach M2-Standard umbenannt # # Revision 1.7 1994/08/16 19:41:22 Kochtopf # added MUIKEYPOPUP # # Revision 1.6 1994/06/30 21:03:01 Kochtopf # changed again SHORTINT to SHORTCARD for madAddLeft, etc. # # Revision 1.5 1994/06/30 20:56:40 Kochtopf # Typ bei madAddLeft, etc. von BYTE in SHORTINT geändert, um # besser damit rechnen zu können. # # Revision 1.4 1994/06/27 22:04:58 Kochtopf # changed name from MUIClasses to MuiClasses # added definition of mCustomClass # # Revision 1.3 1994/06/23 21:36:53 Kochtopf # upgraded to MUI 2.1 # added mCustumClass-Definition # # Revision 1.2 1994/02/19 12:42:19 Kochtopf # Neue Prozeduren hinzugefuegt, die in mui.h definiert waren. # Ausserdem etwas die Reihenfolge geaendert, so dass man jetzt alles # benutzen koennen sollte. # # Revision 1.1 1994/02/02 09:37:18 Kochtopf # Initial revision # **\\\ **************************************************************************) FROM SYSTEM IMPORT ADDRESS, WORD, BYTE, LONGSET; FROM IFFParseD IMPORT IFFHandlePtr; FROM MuiD IMPORT mInputHandlerNodePtr, mListTestPosResultPtr, APTR ; IMPORT ed : ExecD, gd : GraphicsD, id : IntuitionD, R, ud : UtilityD ; TYPE StrPtr = POINTER TO ARRAY [0..MAX(LONGINT)-1] OF CHAR ; (* ** at the beginning some general things used for BOOPSI-Objects *) (* get a pointer to our instance data *) PROCEDURE InstData(cl : id.IClassPtr; obj : id.ObjectPtr) : ADDRESS; (* get the size ... *) PROCEDURE InstSize(cl : id.IClassPtr) : CARDINAL; (* ** now the things concerning MUI's view of the things ** ** GENERAL NOTES: ** ** - Everything described in this defintion file is only valid within ** MUI classes. You may never use any of these things out of ** a class, e.g. in a traditional MUI application. ** ** - Except when otherwise stated, all structures are strictly read only. *) (* Pointer-Types *) TYPE mGlobalInfoPtr = POINTER TO mGlobalInfo; mMinMaxPtr = POINTER TO mMinMax; mNotifyDataPtr = POINTER TO mNotifyData; mAreaDataPtr = POINTER TO mAreaData; mRenderInfoPtr = POINTER TO mRenderInfo; mConfigurationPtr = ADDRESS; WORDPtr = POINTER TO WORD; mCustomClassPtr = POINTER TO mCustomClass; (* ** Definitions for madFlags ** (you will get these flags e.g. with a Draw-Method.) *) TYPE MADFlags = (drawObject, (* completely redraw yourself *) drawUpdate, (* only update! *) p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31 (* rest is private, but must be specified to get a LONGSET *) ); MADFlagSet = SET OF MADFlags; (* ** Type definitions of some important Methods ** You will need them in your own classes. *) (*/// "Notify" *) mpCallHookPtr = POINTER TO mpCallHook; mpCallHook = RECORD methodID : LONGINT; hook : ud.HookPtr; param1 : LONGINT; (* ... *) END; mpExportPtr = POINTER TO mpExport ; mpExport = RECORD methodID : LONGINT ; datapase : id.ObjectPtr ; END; mpFindUDataPtr = POINTER TO mpFindUData; mpFindUData = RECORD methodID : LONGINT; data : LONGINT; END; mpGetUDataPtr = POINTER TO mpGetUData; mpGetUData = RECORD methodID : LONGINT; udata : LONGINT; attr : LONGINT; storage : APTR; END; mpImportPtr = POINTER TO mpImport ; mpImport = RECORD methodID : LONGINT ; datapase : id.ObjectPtr ; END; mpKillNotifyPtr = POINTER TO mpKillNotify; mpKillNotify = RECORD methodID : LONGINT; trigAttr : LONGINT; END; mpMultiSetPtr = POINTER TO mpMultiSet; mpMultiSet = RECORD methodID : LONGINT; attr : LONGINT; val : LONGINT; obj : APTR; (* ... *) END; mpNoNotifySetPtr = POINTER TO mpNoNotifySet; mpNoNotifySet = RECORD methodID : LONGINT; attr : LONGINT; format : StrPtr; val : LONGINT; (* ... *) END; mpNotifyPtr = POINTER TO mpNotify; mpNotify = RECORD methodID : LONGINT; trigAttr : LONGINT; trigVal : LONGINT; destObj : APTR; followParams:LONGINT; (* ... *) END; mpSetPtr = POINTER TO mpSet; mpSet = RECORD methodID : LONGINT; attr : LONGINT; val : LONGINT; END; mpSetAsStringPtr = POINTER TO mpSetAsString; mpSetAsString = RECORD methodID : LONGINT; attr : LONGINT; format : StrPtr; val : LONGINT; (* ... *) END; mpSetUDataPtr = POINTER TO mpSetUData; mpSetUData = RECORD methodID : LONGINT; udata : LONGINT; attr : LONGINT; val : LONGINT; END; mpSetUDataOncePtr = POINTER TO mpSetUDataOnce ; mpSetUDataOnce = RECORD methodID : LONGINT ; udata : LONGINT ; attr : LONGINT ; val : LONGINT ; END ; mpWriteLongPtr = POINTER TO mpWriteLong; mpWriteLong = RECORD methodID : LONGINT; val : LONGINT; memory : APTR; END; mpWriteStringPtr = POINTER TO mpWriteString; mpWriteString = RECORD methodID : LONGINT; str : StrPtr; memory : APTR; END; (*\\\*) (*/// "Family" *) mpFamilyAddHeadPtr = POINTER TO mpFamilyAddHead; mpFamilyAddHead = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpFamilyAddTailPtr = POINTER TO mpFamilyAddTail; mpFamilyAddTail = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpFamilyInsertPtr = POINTER TO mpFamilyInsert; mpFamilyInsert = RECORD methodID : LONGINT; obj : id.ObjectPtr; pred : id.ObjectPtr; END; mpFamilyRemovePtr = POINTER TO mpFamilyRemove; mpFamilyRemove = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpFamilySortPtr = POINTER TO mpFamilySort; mpFamilySort = RECORD methodID : LONGINT; (* obj : ARRAY OF ObjectPtr ; *) END; mpFamilyTransferPtr = POINTER TO mpFamilyTransfer; mpFamilyTransfer = RECORD methodID : LONGINT; family : id.ObjectPtr; END; (*\\\*) (*/// "Application" *) mpApplicationAboutMUIPtr = POINTER TO mpApplicationAboutMUI ; mpApplicationAboutMUI = RECORD methodID : LONGINT; refwindow : id.ObjectPtr ; END; mpApplicationAddInputHandlerPtr = POINTER TO mpApplicationAddInputHandler; mpApplicationAddInputHandler = RECORD methodID : LONGINT; ihnode : mInputHandlerNodePtr; END; mpApplicationCheckRefreshPtr = POINTER TO mpApplicationCheckRefresh; mpApplicationCheckRefresh = RECORD methodID : LONGINT; END; mpApplicationGetMenuCheckPtr = POINTER TO mpApplicationGetMenuCheck; mpApplicationGetMenuCheck = RECORD methodID : LONGINT; menuId : LONGINT; END; mpApplicationGetMenuStatePtr = POINTER TO mpApplicationGetMenuState; mpApplicationGetMenuState = RECORD methodID : LONGINT; menuId : LONGINT; END; mpApplicationInputPtr = POINTER TO mpApplicationInput; mpApplicationInput = RECORD methodID : LONGINT; signal : POINTER TO LONGSET ; END; mpApplicationInputBufferedPtr = POINTER TO mpApplicationInputBuffered; mpApplicationInputBuffered = RECORD methodID : LONGINT; END; mpApplicationLoadPtr = POINTER TO mpApplicationLoad; mpApplicationLoad = RECORD methodID : LONGINT; name : StrPtr; END; mpApplicationOpenConfigWindowPtr = POINTER TO mpApplicationOpenConfigWindow; mpApplicationOpenConfigWindow = RECORD methodID : LONGINT; flags : LONGINT; END; mpApplicationNewInputPtr = POINTER TO mpApplicationNewInput; mpApplicationNewInput = RECORD methodID : LONGINT ; signal : POINTER TO LONGSET ; END; mpApplicationPushMethodPtr = POINTER TO mpApplicationPushMethod; mpApplicationPushMethod = RECORD methodID : LONGINT; dest : id.ObjectPtr; count : LONGINT; (* ... *) END; mpApplicationRemInputHandlerPtr = POINTER TO mpApplicationRemInputHandler; mpApplicationRemInputHandler = RECORD methodID : LONGINT; ihnode : mInputHandlerNodePtr; END; mpApplicationReturnIDPtr = POINTER TO mpApplicationReturnID; mpApplicationReturnID = RECORD methodID : LONGINT; retid : LONGINT; END; mpApplicationSavePtr = POINTER TO mpApplicationSave; mpApplicationSave = RECORD methodID : LONGINT; name : StrPtr; END; mpApplicationSetConfigItemPtr = POINTER TO mpApplicationSetConfigItem; mpApplicationSetConfigItem = RECORD methodID : LONGINT; item : LONGINT; data : APTR; END; mpApplicationSetMenuCheckPtr = POINTER TO mpApplicationSetMenuCheck; mpApplicationSetMenuCheck = RECORD methodID : LONGINT; menuId : LONGINT; stat : LONGINT; END; mpApplicationSetMenuStatePtr = POINTER TO mpApplicationSetMenuState; mpApplicationSetMenuState = RECORD methodID : LONGINT; menuId : LONGINT; stat : LONGINT; END; mpApplicationShowHelpPtr = POINTER TO mpApplicationShowHelp; mpApplicationShowHelp = RECORD methodID : LONGINT; window : id.ObjectPtr; name : StrPtr; node : StrPtr; line : LONGINT; END; (*\\\*) (*/// "Window" *) mpWindowGetMenuCheckPtr = POINTER TO mpWindowGetMenuCheck; mpWindowGetMenuCheck = RECORD methodID : LONGINT; menuId : LONGINT; END; mpWindowGetMenuStatePtr = POINTER TO mpWindowGetMenuState; mpWindowGetMenuState = RECORD methodID : LONGINT; menuId : LONGINT; END; mpWindowScreenToBackPtr = POINTER TO mpWindowScreenToBack; mpWindowScreenToBack = RECORD methodID : LONGINT; END; mpWindowScreenToFrontPtr = POINTER TO mpWindowScreenToFront; mpWindowScreenToFront = RECORD methodID : LONGINT; END; mpWindowSetCycleChainPtr = POINTER TO mpWindowSetCycleChain; mpWindowSetCycleChain = RECORD methodID : LONGINT; (* obj : ARRAY OF ObjectPtr; *) END; mpWindowSetMenuCheckPtr = POINTER TO mpWindowSetMenuCheck; mpWindowSetMenuCheck = RECORD methodID : LONGINT; menuId : LONGINT; stat : LONGINT; END; mpWindowSetMenuStatePtr = POINTER TO mpWindowSetMenuState; mpWindowSetMenuState = RECORD methodID : LONGINT; menuId : LONGINT; stat : LONGINT; END; mpWindowToBackPtr = POINTER TO mpWindowToBack; mpWindowToBack = RECORD methodID : LONGINT; END; mpWindowToFrontPtr = POINTER TO mpWindowToFront; mpWindowToFront = RECORD methodID : LONGINT; END; (*\\\*) (*/// Area *) mpAskMinMaxPtr = POINTER TO mpAskMinMax; mpAskMinMax = RECORD methodID : LONGINT; MinMaxInfo: mMinMaxPtr ; END; (* Custom Class *) mpCleanupPtr = POINTER TO mpCleanup; mpCleanup = RECORD methodID : LONGINT; END; (* Custom Class *) mpContextMenuBuildPtr = POINTER TO mpContextMenuBuild; mpContextMenuBuild = RECORD methodID : LONGINT; mx, my : LONGINT; END; mpContextMenuChoicePtr = POINTER TO mpContextMenuChoice; mpContextMenuChoice = RECORD methodID : LONGINT; item : id.ObjectPtr; END; mpDragBeginPtr = POINTER TO mpDragBegin; mpDragBegin = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpDragDropPtr = POINTER TO mpDragDrop; mpDragDrop = RECORD methodID : LONGINT; obj : id.ObjectPtr; x, y : LONGINT; END; mpDragFinishPtr = POINTER TO mpDragFinish; mpDragFinish = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpDragQueryPtr = POINTER TO mpDragQuery; mpDragQuery = RECORD methodID : LONGINT; obj : id.ObjectPtr; END; mpDragReportPtr = POINTER TO mpDragReport; mpDragReport = RECORD methodID : LONGINT; obj : id.ObjectPtr; x, y, update : LONGINT; END; mpDrawPtr = POINTER TO mpDraw; mpDraw = RECORD methodID : LONGINT; flags : MADFlagSet; END; (* Custom Class *) mpHandleInputPtr = POINTER TO mpHandleInput; mpHandleInput = RECORD methodID : LONGINT; imsg : id.IntuiMessagePtr; muikey : LONGINT; END; (* Custom Class *) mpHidePtr = POINTER TO mpHide; mpHide = RECORD methodID : LONGINT; END; (* Custom Class *) mpSetupPtr = POINTER TO mpSetup; mpSetup = RECORD methodID : LONGINT; renderInfo: mRenderInfoPtr; END; (* Custom Class *) mpShowPtr = POINTER TO mpShow; mpShow = RECORD methodID : LONGINT; END; (* Custom Class *) (*\\\*) (*/// "List" *) mpListClearPtr = POINTER TO mpListClear; mpListClear = RECORD methodID : LONGINT; END; mpListCreateImagePtr = POINTER TO mpListCreateImage ; mpListCreateImage = RECORD methodID : LONGINT ; obj : id.ObjectPtr ; flags : LONGINT ; END ; mpListDeleteImagePtr = POINTER TO mpListDeleteImage ; mpListDeleteImage = RECORD methodID : LONGINT ; listimg : APTR ; END ; mpListExchangePtr = POINTER TO mpListExchange; mpListExchange = RECORD methodID : LONGINT; pos1 : LONGINT; pos2 : LONGINT; END; mpListGetEntryPtr = POINTER TO mpListGetEntry; mpListGetEntry = RECORD methodID : LONGINT; pos : LONGINT; entry : POINTER TO APTR; END; mpListInsertPtr = POINTER TO mpListInsert; mpListInsert = RECORD methodID : LONGINT; entries : POINTER TO APTR; count : LONGINT; pos : LONGINT; END; mpListInsertSinglePtr = POINTER TO mpListInsertSingle; mpListInsertSingle = RECORD methodID : LONGINT; entry : APTR; pos : LONGINT; END; mpListJumpPtr = POINTER TO mpListJump; mpListJump = RECORD methodID : LONGINT; pos : LONGINT; END; mpListMovePtr = POINTER TO mpListMove; mpListMove = RECORD methodID : LONGINT; from : LONGINT; to : LONGINT; END; mpListNextSelectedPtr = POINTER TO mpListNextSelected; mpListNextSelected = RECORD methodID : LONGINT; pos : APTR; END; mpListRedrawPtr = POINTER TO mpListRedraw; mpListRedraw = RECORD methodID : LONGINT; pos : LONGINT; END; mpListRemovePtr = POINTER TO mpListRemove; mpListRemove = RECORD methodID : LONGINT; pos : LONGINT; END; mpListSelectPtr = POINTER TO mpListSelect; mpListSelect = RECORD methodID : LONGINT; pos : LONGINT; seltype : LONGINT; state : APTR; END; mpListSortPtr = POINTER TO mpListSort; mpListSort = RECORD methodID : LONGINT; END; mpListTestPosPtr = POINTER TO mpListTestPos; mpListTestPos = RECORD methodID : LONGINT; x, y : LONGINT; res : mListTestPosResultPtr ; END; (*\\\*) (*/// "Dirlist" *) mpDirlistReReadPtr = POINTER TO mpDirlistReRead; mpDirlistReRead = RECORD methodID : LONGINT; END; (*\\\*) (*/// "Numeric" *) mpNumericDecreasePtr = POINTER TO mpNumericDecrease; mpNumericDecrease = RECORD methodID : LONGINT; amount : LONGINT; END; mpNumericIncreasePtr = POINTER TO mpNumericIncrease; mpNumericIncrease = RECORD methodID : LONGINT; amount : LONGINT; END; mpNumericScaleToValuePtr = POINTER TO mpNumericScaleToValue; mpNumericScaleToValue = RECORD methodID : LONGINT; scalemin : LONGINT; scalemax : LONGINT; scale : LONGINT; END; mpNumericSetDefaultPtr = POINTER TO mpNumericSetDefault; mpNumericSetDefault = RECORD methodID : LONGINT; END; mpNumericStringifyPtr = POINTER TO mpNumericStringify; mpNumericStringify = RECORD methodID : LONGINT; value : LONGINT; END; mpNumericValueToScalePtr = POINTER TO mpNumericValueToScale; mpNumericValueToScale = RECORD methodID : LONGINT; scalemin : LONGINT; scalemax : LONGINT; END; (*\\\*) (*/// "Pendisplay" *) mpPendisplaySetColormapPtr = POINTER TO mpPendisplaySetColormap ; mpPendisplaySetColormap = RECORD methodID : LONGINT ; colormap : LONGCARD ; END ; mpPendisplaySetMUIPenPtr = POINTER TO mpPendisplaySetMUIPen ; mpPendisplaySetMUIPen = RECORD methodID : LONGINT ; muipen : LONGCARD ; END ; mpPendisplaySetRGBPtr = POINTER TO mpPendisplaySetRGB ; mpPendisplaySetRGB = RECORD methodID : LONGINT ; red, green, blue : LONGCARD ; END ; (*\\\*) (*/// "Group" *) mpGroupExitChangePtr = POINTER TO mpGroupExitChange; mpGroupExitChange = RECORD methodID : LONGINT; END; mpGroupInitChangePtr = POINTER TO mpGroupInitChange; mpGroupInitChange = RECORD methodID : LONGINT; END; (*\\\*) (*/// "Popstring" *) mpPopstringClosePtr = POINTER TO mpPopstringClose; mpPopstringClose = RECORD methodID : LONGINT; result : LONGINT; END; mpPopstringOpenPtr = POINTER TO mpPopstringOpen; mpPopstringOpen = RECORD methodID : LONGINT; END; (*\\\*) (*/// "Semaphore" *) mpSemaphoreAttemptPtr = POINTER TO mpSemaphoreAttempt; mpSemaphoreAttempt = RECORD methodID : LONGINT; END; mpSemaphoreAttemptSharedPtr = POINTER TO mpSemaphoreAttemptShared; mpSemaphoreAttemptShared = RECORD methodID: LONGINT; END; mpSemaphoreObtainPtr = POINTER TO mpSemaphoreObtain; mpSemaphoreObtain = RECORD methodID : LONGINT; END; mpSemaphoreObtainSharedPtr = POINTER TO mpSemaphoreObtainShared; mpSemaphoreObtainShared = RECORD methodID : LONGINT; END; mpSemaphoreReleasePtr = POINTER TO mpSemaphoreRelease; mpSemaphoreRelease = RECORD methodID : LONGINT; END; (*\\\*) (*/// "Dataspace" *) mpDataspaceAddPtr = POINTER TO mpDataspaceAdd; mpDataspaceAdd = RECORD methodID : LONGINT; data : APTR; len : LONGINT; dsId : LONGINT; END; mpDataspaceClearPtr = POINTER TO mpDataspaceClear; mpDataspaceClear = RECORD methodID : LONGINT; END; mpDataspaceMergePtr = POINTER TO mpDataspaceMerge; mpDataspaceMerge = RECORD methodID : LONGINT; dataspace : id.ObjectPtr ; END; mpDataspaceReadIFFPtr = POINTER TO mpDataspaceReadIFF; mpDataspaceReadIFF = RECORD methodID : LONGINT; handle : IFFHandlePtr; END; mpDataspaceRemovePtr = POINTER TO mpDataspaceRemove; mpDataspaceRemove = RECORD methodID : LONGINT; dsId : LONGINT; END; mpDataspaceWriteIFFPtr = POINTER TO mpDataspaceWriteIFF; mpDataspaceWriteIFF = RECORD methodID : LONGINT; handle : IFFHandlePtr; type : LONGINT; dsId : LONGINT; END; (*\\\*) (* /// BoopsiQuery *) mpBoopsiQueryPtr = POINTER TO mpBoopsiQuery ; mpBoopsiQuery = RECORD methodID : LONGCARD; screen : id.ScreenPtr; (* obsolete *) flags : LONGCARD; (* read only *) minWidth, (* write only *) minHeight, (* write only *) maxWidth, (* write only *) maxHeight, (* write only *) defWidth, (* write only *) defHeight : LONGCARD; (* write only *) renderInfo : mRenderInfoPtr; (* read only *) (* may grow in future ... *) END; CONST mbqfHORIZ = 1; CONST mbqMAXMAX = 10000; (* \\\ *) (* (partial) instance data of notify class *) TYPE mNotifyData = RECORD mndGlobalInfo : mGlobalInfoPtr; mndUserData : LONGINT; priv1 : LONGINT; priv2 : LONGINT; priv3 : LONGINT; priv4 : LONGINT; priv5 : LONGINT; END; (* mMinMax structure holds information about minimum, maximum and default dimensions of an object. *) mMinMax = RECORD MinWidth : CARDINAL; MinHeight : CARDINAL; MaxWidth : CARDINAL; MaxHeight : CARDINAL; DefWidth : CARDINAL; DefHeight : CARDINAL; END; CONST mMAXMAX = 10000; (* use this if a dimension is not limited. *) (* Hook message for custom layout *) TYPE mLayoutPtr = POINTER TO mLayout; mLayout = RECORD Width : LONGINT; Height : LONGINT; END; mLayoutMsgPtr = POINTER TO mLayoutMsg; mLayoutMsg = RECORD lmType : LONGINT; (* type of message (see defines below) *) lmChildren : ed.MinListPtr; (* list of this groups children, traverse with NextObject() *)          lmMinMax : mMinMax; (* results for MUILM_MINMAX *) lmLayout : mLayout; (* size (and result) for MUILM_LAYOUT *) END ; CONST mlmMINMAX = 1 ; (* MUI wants you to calc your min & max sizes *) CONST mlmLAYOUT = 2 ; (* MUI wants you to layout your children *) CONST mlmUNKNOWN = -1 ; (* return this if your hook doesn't implement lm_Type *) (* (partial) instance data of area class *) TYPE mAreaData = RECORD madRenderInfo : mRenderInfoPtr; (* RenderInfo for this object *) priv6 : LONGINT; madFont : gd.TextFontPtr; (* Font *) madMinMax : mMinMax; (* min/max/default sizes *) madBox : id.IBox; (* position and dimension *) madAddLeft : SHORTCARD; (* frame & innerspacing left offset *) madAddTop : SHORTCARD; (* frame & innerspacing top offset *) madSubWidth : SHORTCARD; (* frame & innerspacing add. width *) madSubHeight : SHORTCARD; (* frame & innerspacing add. height *) madFlags : MADFlagSet; (* see definitions above *) (* ... private data follows ... *) END; (* Global information about configuration and parent application. *) TYPE mGlobalInfo = RECORD mgiConfiguration : mConfigurationPtr; mgiApplicationObject : id.ObjectPtr; (* ... private data follows ... *) END; (* MUI's draw pens *) CONST mpenShine = 0 ; CONST mpenHalfshine = 1 ; CONST mpenBackground = 2 ; CONST mpenHalfshadow = 3 ; CONST mpenShadow = 4 ; CONST mpenText = 5 ; CONST mpenFill = 6 ; CONST mpenMark = 7 ; CONST mpenCount = 8 ; (* Mask for pens from MUI_ObtainPen() *) CONST muipenMask = 0000FFFFH ; PROCEDURE muiPen(pen : LONGCARD) : LONGCARD; (* Information on display environment *) TYPE mRenderInfo = RECORD mriWindowObject : id.ObjectPtr; (* valid between MUIMSetup/MUIMCleanup *)   mriScreen : id.ScreenPtr; (* valid between MUIMSetup/MUIMCleanup *) mriDrawInfo : id.DrawInfoPtr; (* valid between MUIMSetup/MUIMCleanup *) mriPens : WORDPtr; (* valid between MUIMSetup/MUIMCleanup *) mriWindow : id.WindowPtr; (* valid between MUIMShow/MUIMHide *) mriRastPort : gd.RastPortPtr; (* valid between MUIMShow/MUIMHide *) mriFlags : LONGINT; (* valid between MUIM_Setup/MUIM_Cleanup *) (* ... private data follows ... *) END; TYPE MRIFlags = ( (* ** If mri_Flags & MUIMRI_RECTFILL, RectFill() is quicker ** than Move()/Draw() for horizontal or vertical lines. ** on the current display. *) rectFill, (* ** If mri_Flags & MUIMRI_TRUECOLOR, display environment is a ** cybergraphics emulated hicolor or true color display with ** an unlimited number of pens available. Obtain/ReleasePen()s ** as many as you want... :-) *) trueColor, (* ** If mri_Flags & MUIMRI_THINFRAMES, MUI uses thin frames ** (1:1) apsect ratio instead of standard 2:1 frames. *) thinFrames, (* ** If mri_Flags & MUIMRI_REFRESHMODE, MUI is currently ** refreshing a WFLG_SIMPLEREFRESH window and is between ** a BeginRefresh()/EndRefresh() pair. *) refreshMode, mp4, mp5, mp6, mp7, mp8, mp9, mp10, mp11, mp12, mp13, mp14, mp15, mp16, mp17, mp18, mp19, mp20, mp21, mp22, mp23, mp24, mp25, mp26, mp27, mp28, mp29, mp30, mp31 (* rest is private, but must be specified to get a LONGSET *) ); MRIFlagSet = SET OF MRIFlags; (* ** some procedures to get some information about our object *) PROCEDURE muiNotifyData(obj : APTR) : mNotifyDataPtr; PROCEDURE muiAreaData(obj : APTR) : mAreaDataPtr; PROCEDURE muiGlobalInfo(obj : APTR) : mGlobalInfoPtr; PROCEDURE muiUserData(obj : APTR) : ADDRESS ; PROCEDURE muiRenderInfo(obj : APTR) : mRenderInfoPtr; (* ** some more specialized functions to retain information about special ** object-data like rastport, window, etc. ** ** NOTE: These macros may only be used in custom classes and are ** only valid if your class is inbetween the specified methods! *) PROCEDURE OBJ_app(obj : APTR) : id.ObjectPtr; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_win(obj : APTR) : id.ObjectPtr; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_dri(obj : APTR) : id.DrawInfoPtr; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_screen(obj : APTR) : id.ScreenPtr; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_pens(obj : APTR) : WORDPtr ; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_window(obj : APTR) : id.WindowPtr; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_rp(obj : APTR) : gd.RastPortPtr; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_left(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_top(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_width(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_height(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_right(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_bottom(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_addleft(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_addtop(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_subwidth(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_subheight(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mleft(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mtop(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mwidth(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mheight(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mright(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_mbottom(obj : APTR) : INTEGER; (* valid during MUIM_Draw *) PROCEDURE OBJ_font(obj : APTR) : gd.TextFontPtr; (* valid between MUIM_Setup/Cleanup *) PROCEDURE OBJ_minwidth(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_minheight(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_maxwidth(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_maxheight(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_defwidth(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_defheight(obj : APTR) : CARDINAL; (* valid between MUIM_Show/Hide *) PROCEDURE OBJ_flags(obj : APTR) : MADFlagSet; (* User configurable keyboard events coming with MUIMHandleInput *) CONST MUIKEYRELEASE = -2; (* not a real key, faked when MUIKEYPRESS is released *) CONST MUIKEYNONE = -1; CONST MUIKEYPRESS = 0; CONST MUIKEYTOGGLE = 1; CONST MUIKEYUP = 2; CONST MUIKEYDOWN = 3; CONST MUIKEYPAGEUP = 4; CONST MUIKEYPAGEDOWN = 5; CONST MUIKEYTOP = 6; CONST MUIKEYBOTTOM = 7; CONST MUIKEYLEFT = 8; CONST MUIKEYRIGHT = 9; CONST MUIKEYWORDLEFT = 10; CONST MUIKEYWORDRIGHT = 11; CONST MUIKEYLINESTART = 12; CONST MUIKEYLINEEND = 13; CONST MUIKEYGADGETNEXT = 14; CONST MUIKEYGADGETPREV = 15; CONST MUIKEYGADGETOFF = 16; CONST MUIKEYWINDOWCLOSE = 17; CONST MUIKEYWINDOWNEXT = 18; CONST MUIKEYWINDOWPREV = 19; CONST MUIKEYHELP = 20; CONST MUIKEYPOPUP = 21; CONST MUIKEYCOUNT = 22; (* private *) (* ** now something about dispatchers. ** if you have written your dispatcher make sure it has the format of ** PROCEDURE Dispatcher(cl : IClassPtr; obj : ADDRESS; msg : ADDRESS) : ADDRESS ** (like DispatcherDef) ** Then call in your main routine the procedure MakeDispatcher like this : ** MakeDispatcher(Dispatcher, MyClass), ** where MyClass is the initialized IClassPtr of your new class. ** This function will then set up your dispatcher with a little stub which ** will restore A4 for your (will mean, your programm will be pure, if you ** do all right) *) (* here the definition of a dispatcher! *) TYPE DispatcherDef = PROCEDURE ( (* class *) id.IClassPtr, (* object *) ADDRESS, (* message *) ADDRESS) : ADDRESS; (* this is the template for moCreateCustomClass() ! *) TYPE ClassDispatcher = PROCEDURE ( (* class *) id.IClassPtr{R.A0}, (* object *) ADDRESS{R.A2}, (* message *) ADDRESS{R.A1}) : ADDRESS; (* now the procedure MakeDispatcher : *) PROCEDURE MakeDispatcher(entry:DispatcherDef; VAR myclass : id.IClassPtr); (* ** at last a little procedure to fill in the values in the MinMax-Record. ** You can call it inside an AskMinMax-Method, because it is ever the same... *) PROCEDURE FillMinMaxInfo (msg : mpAskMinMaxPtr; MinWidth : CARDINAL; DefWidth : CARDINAL; MaxWidth : CARDINAL; MinHeight : CARDINAL; DefHeight : CARDINAL; MaxHeight : CARDINAL); (* ** 2 useful procedures for testing if some coordinates are inside your object ** (converted from the ones in class3.c. So look there how to use... ) *) (* this will test if x is between a and b *) PROCEDURE OBJ_between(a,x,b : INTEGER) : BOOLEAN; (* this will test, if the position (x, y) is inside the Object obj *) PROCEDURE OBJ_isInObject(x, y : INTEGER; obj : id.ObjectPtr) : BOOLEAN; (* MUI_CustomClass returned by MUI_CreateCustomClass() *) TYPE mCustomClass = RECORD userData : APTR; (* use for whatever you want *) utilityBase : ed.LibraryPtr; (* MUI has opened these libraries *) dosBase : ed.LibraryPtr; (* for you automatically. You can *) gfxBase : ed.LibraryPtr; (* use them or decide to open *) intuitionBase : ed.LibraryPtr; (* your libraries yourself. *) super : id.IClassPtr; (* pointer to super class *) class : id.IClassPtr; (* pointer to the new class *) (* ... private data follows ... *) END; END MuiClasses.