Reorganize library code into libs/ (#3119)

* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}

* Update configure.py and project.py for new libs structure

* Refactor `#include <dolphin/x.h>` -> `<x.h>`

* Remove `__REVOLUTION_SDK__` forwards from dolphin

* Fix dolphin/ references in revolution

* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`

* Always build TRK against dolphin headers

* Resolve revolution SDK header resolution issues
This commit is contained in:
Luke Street
2026-03-01 15:35:36 -07:00
committed by GitHub
parent c9a46bd65b
commit 4df8ccc871
1740 changed files with 583 additions and 825 deletions
+116
View File
@@ -0,0 +1,116 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JAHostIO/JAHioNode.h"
#include "JSystem/JAHostIO/JAHioMessage.h"
#include "JSystem/JAHostIO/JAHioMgr.h"
#include "JSystem/JHostIO/JORServer.h"
#include <cstring>
JAHioNode::JAHioNode(const char* name) : mTree(this) {
mLastChild = NULL;
if (name) {
setNodeName(name);
} else {
setNodeName("no named");
}
}
JAHioNode::~JAHioNode() {
if (getParent()) {
getParent()->removeNode(this);
}
}
void JAHioNode::updateNode() {
JORMContext* mctx = JORReflexible::getJORServer()->attachMCTX(5);
mctx->invalidNode(this, 3);
JORReflexible::getJORServer()->releaseMCTX(mctx);
}
void JAHioNode::setNodeName(const char* name) {
int size = strlen(name) + 1;
JUT_ASSERT(51, size < 32);
strcpy(mName, name);
}
void JAHioNode::genMessage(JORMContext* mctx) {
JAHControl control(mctx, this);
message(control);
if (JAHSingletonBase<JAHioMgr>::getIns()->getNodeSysType() == 0) {
generateTempChildren(mctx);
} else {
generateRealChildren(mctx);
}
}
void JAHioNode::appendNode(JAHioNode* node, const char* name) {
mTree.appendChild(&node->mTree);
JAHSingletonBase<JAHioMgr>::getIns()->appendFrameNode(node);
if (name) {
node->setNodeName(name);
}
updateNode();
}
void JAHioNode::prependNode(JAHioNode* node, const char* name) {
mTree.prependChild(&node->mTree);
JAHSingletonBase<JAHioMgr>::getIns()->appendFrameNode(node);
if (name) {
node->setNodeName(name);
}
updateNode();
}
void JAHioNode::removeNode(JAHioNode* node) {
if (smCurrentNode == this) {
smCurrentNode = NULL;
}
mTree.removeChild(&node->mTree);
JAHSingletonBase<JAHioMgr>::getIns()->removeFrameNode(node);
updateNode();
}
void JAHioNode::generateRealChildren(JORMContext* mctx) {
for (JSUTreeIterator<JAHioNode> it(mTree.getFirstChild()); it != mTree.getEndChild(); ++it) {
JAHioNode* node = it.getObject();
mctx->startNode(node->mName, node, 4, node->getNodeIcon());
node->genMessage(mctx);
mctx->endNode();
}
}
void JAHioNode::generateTempChildren(JORMContext* mctx) {
for (JSUTreeIterator<JAHioNode> it(mTree.getFirstChild()); it != mTree.getEndChild(); ++it) {
JAHioNode* node = it.getObject();
mctx->genNode(node->mName, node, 4, node->getNodeIcon());
}
}
u32 JAHioNode::getNodeKind() const { return 0; }
JAHioNode* JAHioNode::getParent() {
if (mTree.getParent()) {
return mTree.getParent()->getObject();
}
return NULL;
}
void JAHioNode::listenPropertyEvent(const JORPropertyEvent* event) {
propertyEvent(JAH_P_EVENT0, (u32)event->id);
JORReflexible::listenPropertyEvent(event);
propertyEvent(JAH_P_EVENT1, (u32)event->id);
}
void JAHioNode::listenNodeEvent(const JORNodeEvent* event) {
if (event->field_0x0 == 3) {
smCurrentNode = this;
if (getParent()) {
getParent()->setLastChild(this);
}
nodeEvent(JAH_N_EVENT0);
} else if (event->field_0x0 == 4) {
nodeEvent(JAH_N_EVENT1);
} else if (event->field_0x0 == 5) {
nodeEvent(JAH_N_EVENT2);
}
}