graphics interface

This commit is contained in:
MeexReay 2025-03-22 00:44:24 +03:00
parent b4bb5b6dff
commit e755140124
3 changed files with 62 additions and 16 deletions

View File

@ -63,6 +63,12 @@
width: 100%; width: 100%;
display: block; display: block;
} }
#graphics {
position: absolute;
width: 100%;
height: 100%;
}
</style> </style>
</head> </head>
@ -74,4 +80,5 @@
<script src="sys/fs.js"></script> <script src="sys/fs.js"></script>
<script src="sys/ppm.js"></script> <script src="sys/ppm.js"></script>
<script src="sys/system.js"></script> <script src="sys/system.js"></script>
<script src="sys/graphics.js"></script>
</html> </html>

55
sys/graphics.js Normal file
View File

@ -0,0 +1,55 @@
var graphics_canvas = null
var graphics_context = null
function enableGraphics() {
graphics_canvas = document.createElement("canvas")
graphics_canvas.id = "graphics"
graphics_context = graphics_canvas.getContext("2d")
document.body.appendChild(graphics_canvas)
}
function getGraphics() {
return graphics_context
}
function disableGraphics() {
graphics_canvas.remove()
graphics_canvas = null
graphics_context = null
}
function hasGraphicsImplementation() {
return false
}
/** returns wid and context */
function createWindow(options) {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation");
}
function moveWindow(wid, x, y, w, h) {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation")
}
function signalWindow(wid, signal) {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation")
}
function closeWindow(wid) {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation")
}
function getWindow(wid) {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation")
}
function listWindows() {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation")
}

View File

@ -157,22 +157,6 @@ function executeCommand(args, read=readStdin, write=writeStdout) {
return process return process
} }
function loadApp(name) {
fetch("app/"+name+".js")
.then(o => o.text())
.then(o => {
writeFile("/app/"+name+".js", o)
})
}
function loadAppAndExecute(name) {
fetch("app/"+name+".js")
.then(o => o.text())
.then(o => {
writeFile("/app/"+name+".js", o)
})
}
async function resetSystem() { async function resetSystem() {
clearFileSystem() clearFileSystem()