|##########| |#MAGIC #|FKIIGLKJ |#PROJECT #|"" |#PATHS #|"StdProject" |#LINK #|"" |#GUIDE #|"" |#STACK #|"4096" |#FLAGS #|xx-x-x-xxxx--xx----------------- |#USERSW #|--x----------------------------- |#USERMASK#|-------------------------------- |#SWITCHES#|xx---xxxxx-xx--- |##########| DEFINITION MODULE MCCDate; (* ** ** Copyright © 1997 Kai Hofmann. All rights reserved. ** Registered MUI custom class! ** ** $VER: MCCDate.def 12.2 (22.12.97) ** ** Cluster interface model by henning.thielemann@student.uni-halle.de *) FROM SYSTEM IMPORT SysStringPtr; FROM Intuition IMPORT MsgRoot; FROM Utility IMPORT HookPtr; FROM MuiO IMPORT CBOOLEAN, MuiTags, ObjectRec, MethodID; CONST cDate = "Date.mcc" TYPE DateRec = RECORD OF ObjectRec END; DateObject = POINTER TO DateRec; Countries = (unknown, Italia, Deutschland, Schweiz, Danmark, Nederland, GreatBritain); Calendars = (Julian, Gregorian, Heis); Weekdays = (monday = 1, tuesday, wednesday, thursday, friday, saturday, sunday); Languages = (locale, English, Deutsch, Francais, Espanol, Portugues, Dansk, Italiano, Nederlands, Norsk, Svenska, Polski, Suomi, Magyar, Greek, Esperanto, Latina, Russian, Czech, Catalonian); Compare = (less = -1, equal = 0, greater = 1); DateTags = TAGS OF MuiTags dateDay = $81EE0001 : SHORTCARD; dateMonth = $81EE0002 : SHORTCARD; dateYear = $81EE0003 : LONGINT; dateFirstWeekday = $81EE0004 : Weekdays; dateLanguage = $81EE0007 : Languages; dateCountry = $81EE0008 : Countries; dateCalendar = $81EE0035 : Calendars; dateMinDay = $81EE0041 : SHORTCARD; dateMinMonth = $81EE0042 : SHORTCARD; dateMinYear = $81EE0043 : LONGINT; dateMaxDay = $81EE0044 : SHORTCARD; dateMaxMonth = $81EE0045 : SHORTCARD; dateMaxYear = $81EE0046 : LONGINT; dateJD = $81EE0053 : LONGCARD; dateMJD = $81EE0054 : LONGCARD; dateYDay = $81EE0056 : SHORTCARD; dateWeek = $81EE0057 : SHORTCARD; dateWeekday = $81EE0058 : Weekdays, END; DateTagAPtr = POINTER TO ARRAY OF DateTags; CONST mDateSetCurrent = MethodID($81EE0048); mDateIncreaseDays = MethodID($81EE0049); mDateDecreaseDays = MethodID($81EE004A); mDateIncreaseMonths = MethodID($81EE004B); mDateDecreaseMonths = MethodID($81EE004C); mDateIncreaseYears = MethodID($81EE004D); mDateDecreaseYears = MethodID($81EE004E); mDateIncreaseToWeekday = MethodID($81EE004F); mDateDecreaseToWeekday = MethodID($81EE0052); mDateCompare = MethodID($81EE0055); TYPE pDateSetCurrent = RECORD OF MsgRoot END; pDateIncreaseDays = RECORD OF MsgRoot days : LONGCARD; END; pDateDecreaseDays = RECORD OF MsgRoot days : LONGCARD; END; pDateIncreaseMonths = RECORD OF MsgRoot months : LONGCARD; END; pDateDecreaseMonths = RECORD OF MsgRoot months : LONGCARD; END; pDateIncreaseYears = RECORD OF MsgRoot years : LONGCARD; END; pDateDecreaseYears = RECORD OF MsgRoot years : LONGCARD; END; pDateIncreaseToWeekday = RECORD OF MsgRoot weekday : LONGCARD; END; pDateDecreaseToWeekday = RECORD OF MsgRoot weekday : LONGCARD; END; pDateCompare = RECORD OF MsgRoot obj : DateObject; END; (* In this case, there is no simplification by implementing Cluster methods as interface for MUI methods. Please use DoMethod instead, like C programmers does. METHOD SetCurrent (o : DateObject); METHOD IncreaseDays (o : DateObject; days : LONGCARD); METHOD DecreaseDays (o : DateObject; days : LONGCARD); METHOD IncreaseMonths (o : DateObject; months : LONGCARD); METHOD DecreaseMonths (o : DateObject; months : LONGCARD); METHOD IncreaseYears (o : DateObject; years : LONGCARD); METHOD DecreaseYears (o : DateObject; years : LONGCARD); METHOD IncreaseToWeekday (o : DateObject; weekday : LONGCARD); METHOD DecreaseToWeekday (o : DateObject; weekday : LONGCARD); METHOD Compare (o : DateObject; obj : DateObject); *) PROCEDURE MakeDateObjectA (tags : DateTagAPtr) : DateObject; PROCEDURE MakeDateObject (tags : LIST OF DateTags) : DateObject; GROUP TypeGrp = Countries, Weekdays, Languages, Compare; EssentialGrp = cDate, DateRec, DateObject, DateTags, DateTagAPtr, mDateIncreaseDays, pDateIncreaseDays, mDateDecreaseDays, pDateDecreaseDays, mDateIncreaseMonths, pDateIncreaseMonths, mDateDecreaseMonths, pDateDecreaseMonths, mDateIncreaseYears, pDateIncreaseYears, mDateDecreaseYears, pDateDecreaseYears, mDateSetCurrent, pDateSetCurrent, mDateCompare, MakeDateObject, MakeDateObjectA; All = EssentialGrp, TypeGrp; END MCCDate.