This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dave-ee Jones's profile picture

[Project] djOS -> WOOPS based

Started by Dave-ee Jones, 03 March 2017 - 02:54 AM
Dave-ee Jones #1
Posted 03 March 2017 - 03:54 AM
djOS


Pastebin: QKh35fqK


djOS is a project I have been working on that combines object-orientated 'windows' and the Windows API. Nothing too special, just me learning how coroutines and things work.


You're welcome to learn off of this OS (what not to do maybe..) and give suggestions for how it could be written better (especially coroutines and windows, they are really messy!)


The UI is pretty nice, and everything is modular.

At the moment its WIP, so things like the Notifications Menu and Control Panel aren't complete (however the Notifications is functional, just needs touches here and there).


FEATURES

Spoiler
  • Multiple Windows, all draggable, running at once
  • Control Panel (WIP, does have buttons functioning fine, but no real…feature)
  • Notifications (WIP, but the idea is so you can see who has been spamming your modem with messages, see when a disk was inserted into, or ejected out of, your Disk Drive, and more!)
  • Desktop Environment (WIP, but the idea is that you can navigate your way through a visual file system, clicking on folder icons to bring up a new desktop within that directory or clicking on a program icon to run it)
  • Time (…yay…)
  • When setting the Window's 'Path', you don't have to link it to a file, it can be linked to programs that you can run normally (e.g. "edit test" or "hello"
  • Active Window displays above all else! (Also displays the Active Window's label on taskbar)


SCREENSHOTS
Everyone loves these!

Spoiler















QUESTIONS YOU WILL PROBABLY ASK

OR

THINGS YOU MIGHT SAY IN THE COMMENTS

Spoiler


What is WOOPS?*

WOOPS is what this OS is based on.

It's basically a mix between Object-Oriented Programming (OOP) and the Windows API (W-S).
Or, if easier, can be understood as Window-Object-Oriented Programming. But that would be WOOP.


What does that mean?

Well, it means that this OS has objects and windows and window objects.


This is like your 4th OS, why another?

I love programming with CC.

Making OS' is my favourite thing is CC.

Learning new CC tricks is awesome.

Just learning how coroutines/windows work is awesome.

Those combined equals a new OS…


In regards to your code…

Yes, I know, it's very neat.

Got 'em.


You will notice it isn't commented much…at all.

It isn't like it's hugely hard to understand anyway :P


Yes, I'm open to suggestions. Comment below!




WHAT'S NEXT?

Spoiler


You mean aside from finishing the Notifications Menu, Control Panel and Icons?

Well…

Spoiler
  • Login on startup (Would use SHA-256 hashes, maybe with a flick of salt..)
  • Register availability (?) (Would involve making EVERYTHING read-only on the computer if your not an Admin)
  • Custom Shell (Hate those black boxes on my desktop when running 'shell' in a window…)
  • Email/Modem Messaging (With Notifications Menu integration)
  • App Store (Download common apps and programs)
  • Network FS (Sharing folders/programs over a network - Integrated into djOS)




FEEL FREE TO COMMENT FEEDBACK, SUGGESTIONS ETC.

('Good job' is a thing as well…)




*I so read your mind, didn't I?
Edited on 03 March 2017 - 03:58 AM
Piorjade #2
Posted 04 March 2017 - 12:50 PM
A nice feature is resizable windows.
Dave-ee Jones #3
Posted 05 March 2017 - 03:08 AM
Yeah, did you notice the green button on the window's bar? I plan to use that to open a window editor to change the path, x, y, width and height of the window object. Should work fairly smoothly, I know how it would be done.

Same goes with icons/folders. That will be a little more tricky though.
Piorjade #4
Posted 08 March 2017 - 01:15 PM
Yeah, did you notice the green button on the window's bar? I plan to use that to open a window editor to change the path, x, y, width and height of the window object. Should work fairly smoothly, I know how it would be done.

Same goes with icons/folders. That will be a little more tricky though.
You don't plan on using e.g. the botttom right corner to "drag" it to make the window smaller/bigger?
Dave-ee Jones #5
Posted 08 March 2017 - 08:41 PM
The problem with that is that if the program inside the window is running and I start dragging from the bottom right then the program might think you are clicking the bottom right (e.g. if it was TicTacToe or some kind of mini-OS or GUI). This would also mean I cannot stop the window from getting certain events either just incase you actually wanted to click the bottom right corner in the program.

I would need to create a second bar (or even just a border around the whole thing?) on the bottom that has the dragging capability. Painful, because the height and y of the window would actually be smaller because the bars take up space.

Bit tricky, pluses and minuses either way.
Dave-ee Jones #6
Posted 15 March 2017 - 10:42 PM
Working on a re-write of the whole OS. Basing it on an API that handles all the objects (Windows and Boxes), which will make it easy to use tests (checking where user clicked/what they clicked on, drop/rise menus, where they clicked on a box/status bar etc.).

Should be good. Not sure when it will be done. Only finished the Start Menu yesterday. It's a more of a "write-all-the-functions-then-add-the-actual-objects" process, so the only time I can test it is right at the end. :P/> Not the wisest way to do it but that is how OOP works..Or should I say, WOOPS.

EDIT: Just built a shell as well for it. However, there are minor bugs…
Using
cd <path>
changes the previous shell's path, so when I use
exit
it goes back to the previous shell (like normal) but it's path (sDir) has been changed.

Also, I have managed to make basically everything read-only and any program/function FS/OS changing has been disabled within the shell. Quite effectively, in fact. :)/>
Edited on 16 March 2017 - 04:51 AM
ObloxCC #7
Posted 18 March 2017 - 03:02 AM
The OS looks good, but the window design isn't all that original (looks vary simular to the screenshots of the upcoming Oblox OS version I was posting). I look forwards to WOOPS' future.

EDIT: I have no problem with the use of this design (kind of hard doing anything with the limitations of CC), I was planning to rewrite Oblox OS anyway, it was just too buggy when running programs in windows, etc.

EDIT 2: I was going to keep this for Oblox OS, but try to use the notification window to notify the user of updates available, app updates (when you add a store), security warnings, etc.
Edited on 18 March 2017 - 02:13 AM
Dave-ee Jones #8
Posted 20 March 2017 - 12:11 AM
The OS looks good, but the window design isn't all that original (looks vary simular to the screenshots of the upcoming Oblox OS version I was posting). I look forwards to WOOPS' future.

EDIT: I have no problem with the use of this design (kind of hard doing anything with the limitations of CC), I was planning to rewrite Oblox OS anyway, it was just too buggy when running programs in windows, etc.

EDIT 2: I was going to keep this for Oblox OS, but try to use the notification window to notify the user of updates available, app updates (when you add a store), security warnings, etc.

Thanks for the feedback! :)/>

Yeah, window design is kind of hard to change in CC, as you only have a limited amount of pixels to use. The taskbar on top of the windows is neat looking but basic.

The Notifications window is meant to handle basically any event that isn't a mouse click, button press or key press. This means it will tell you if a disk was found/ejected, redstone toggling, rednet/modem messages sent over your channel, alarm events, peripheral attach/detach events etc.

However because I haven't planned usage of a app store yet I cannot provide an updates notification just yet.

EDIT: I don't really have a coroutine manager either. Deleting windows has always been a problem, as you don't really delete them you just tell the program to forget them. I store my windows in tables, and to delete the window I hide it and then set the window to nil, then the table the window is held in to nil. This means the program sometimes thinks the window still exists but it cannot figure out anything about it. There are workarounds, so it does work, just might not be the most efficient in terms of CPU usage.
Edited on 19 March 2017 - 11:21 PM