m68kmac: Add deskmgr, dialogmgr, fontmgr, menumgr

.. & sort the module list

Note that routines in the "needs-glue" list are not wrapped.
This commit is contained in:
Jeff Epler 2025-07-20 09:31:26 -05:00
parent d53177561e
commit 66c8cdd388
3 changed files with 193 additions and 4 deletions

View file

@ -70,7 +70,7 @@ SRC_QSTR += \
.PHONY: mkapi
DEFS = lib/multiversal/defs/MacTypes.yaml
DEFS = lib/multiversal/defs/MacTypes.yaml etc/MacTypesExtras.yaml
TDEFS = $(patsubst %, -t %, $(DEFS))
# $(eval $(call multiversal_module, module name, defs files))
@ -84,12 +84,16 @@ SRC_QSTR += $(BUILD)/mod$(1).c
mkapi:: $$(BUILD)/mod$(1).c
endef
$(eval $(call multiversal_module,eventmgr,lib/multiversal/defs/EventMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,deskmgr,lib/multiversal/defs/DeskMgr.yaml -t lib/multiversal/defs/WindowMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,dialogmgr,lib/multiversal/defs/DialogMgr.yaml -t lib/multiversal/defs/WindowMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml -t etc/DialogMgrExtras.yaml))
$(eval $(call multiversal_module,fontmgr,lib/multiversal/defs/FontMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,mactypes,lib/multiversal/defs/MacTypes.yaml etc/MacTypesExtras.yaml))
$(eval $(call multiversal_module,menumgr,lib/multiversal/defs/MenuMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,qd,lib/multiversal/defs/QuickDraw.yaml etc/QuickDrawExtras.yaml))
$(eval $(call multiversal_module,windowmgr,lib/multiversal/defs/WindowMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,toolboxevent,lib/multiversal/defs/ToolboxEvent.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,toolboxutil,lib/multiversal/defs/ToolboxUtil.yaml -t lib/multiversal/defs/EventMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,mactypes,lib/multiversal/defs/MacTypes.yaml etc/MacTypesExtras.yaml))
$(eval $(call multiversal_module,eventmgr,lib/multiversal/defs/EventMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
$(eval $(call multiversal_module,windowmgr,lib/multiversal/defs/WindowMgr.yaml -t lib/multiversal/defs/QuickDraw.yaml))
OBJ += $(PY_CORE_O) $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))

View file

@ -0,0 +1,177 @@
Using multiversal interfaces
ADBOp
FSOpen
OpenRF
OpenDF
FSRead
FSWrite
GetFPos
SetFPos
GetEOF
SetEOF
Allocate
AllocContig
FSClose
Create
FSDelete
GetFInfo
HGetFInfo
SetFInfo
SetFLock
RstFLock
Rename
GetFSQHdr
GetVCBQHdr
GetDrvQHdr
GetVInfo
GetVRefNum
GetVol
SetVol
FlushVol
UnmountVol
Eject
PBAllocContig
HCreate
HOpenRF
HOpen
HOpenDF
HRename
HDelete
GetWDInfo
StringToNum
GetPortTextFont
GetPortTextSize
QDFlushPortBuffer
GetPortBounds
GetPortVisibleRegion
GetRegionBounds
GetPortBitMapForCopyBits
GetQDGlobalsScreenBits
GetWindowPort
InvalWindowRect
ScreenRes
SetPalette
CRMGetCRMVersion
CRMGetHeader
CRMInstall
CRMRemove
CRMSearch
InitCRM
OpenDriver
CloseDriver
Control
Status
KillIO
GetDCtlEntry
TESetWordBreak
TESetClickLoop
TEFromScrap
TEToScrap
TEScrapHandle
TEGetScrapLength
TESetScrapLength
DialogCut
DialogCopy
DialogPaste
DialogDelete
SetDialogFont
GetAlertStage
ResetAlertStage
AppendDITL
ShortenDITL
CountDITL
DiskEject
SetTagBuffer
DriveStatus
Gestalt
ReplaceGestalt
EnableMenuItem
DisableMenuItem
IUCompString
IUEqualString
MaxMem
MaxMemSys
PurgeSpace
PurgeSpaceSys
InitZone
HLockHi
SystemZone
GetApplLimit
TopMem
GZSaveHnd
CallUniversalProc
NavServicesCanRun
NavLibraryVersion
NavLoad
NavUnload
NavDisposeReply
NavGetFile
NavChooseFile
NavTranslateFile
NavChooseVolume
NavChooseFolder
NavChooseObject
NavNewFolder
NavPutFile
NavAskSaveChanges
NavCustomAskSaveChanges
NavAskDiscardChanges
NavCompleteSave
NavCreatePreview
NavCustomControl
PPostEvent
PostEvent
SetEventMask
GetEvQHdr
geteventelem
GetVBLQHdr
HandToHand
PtrToHand
RelString
EqualString
UpperString
DateToSeconds
GetTime
SetTime
GetSysPPtr
NGetTrapAddress
NSetTrapAddress
Delay
Environs
Restart
SetUpA5
RestoreA5
GetMMUMode
SwapMMUMode
MakeDataExecutable
c2pstrcpy
p2cstrcpy
CopyCStringToPascal
CopyPascalStringToC
GetSysDirection
SetSysDirection
LowercaseText
UppercaseText
StripDiacritics
UppercaseStripDiacritics
CountAppFiles
GetAppFiles
ClrAppFiles
RAMSDOpen
RAMSDClose
SerReset
SerSetBuf
SerHShake
SerSetBrk
SerClrBrk
SerGetBuf
SerStatus
StartSound
StopSound
SoundDone
GetSoundVol
SetSoundVol
GetDblTime
GetCaretTime
GetIndString
GetIndPattern

View file

@ -14,6 +14,9 @@ if sys.version_info >= (3, 10):
else:
UnionType = type(Union[int, float])
with open("etc/needs-glue.txt") as f:
needs_glue = set(f.read().split("\n"))
@dataclass(frozen=True)
class Ptr:
@ -73,6 +76,7 @@ class Struct:
class EnumMember:
name: str
value: int | str | None = None # a number or a 4 character literal
old_name: str | None = None
@toplevel
@ -127,6 +131,7 @@ class Function:
dispatcher: str | None = None
selector: int | None = None
returnreg: str | None = None
old_name: str | None = None
@toplevel
@ -734,6 +739,9 @@ class Processor:
@emit_node.register
def emit_function(self, node: Function):
name = node.name
if name in needs_glue:
self.info.append(f"Not binding {name}, it needs glue")
return
args = node.args
if node.api == 'carbon':
return