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

Applications/Advice Needed - Object Oriented Window Based Multitasking OS

Started by oeed, 01 March 2013 - 07:27 PM
oeed #1
Posted 01 March 2013 - 08:27 PM
Hi guys,

Over the last few weeks I've been working on a object-orientent window based OS, called PearOS (I know the names cliché, suggest a new one). The OS supports (in theory) unlimited applications open at once and each application can run as many windows as it wants.

Screenshots
Spoiler
Example of two windows and the Dock.


Example of two applications open at once.

The OS, as you may have noticed, is based on Mac OS. Why? A number of my friends would love to be able to use computers in Tekkit, FTB, etc. but they have absolutely no idea where to start. This is designed to make it really easy to do basic tasks such as a door lock & base control system and very advance tasks as easy as possible. Mac OS is widely regarded as the easiest OS to use… so can you see the link? It also looks the nicest, as a side effect. Although, trying to make this look 'shiny' isn't exactly easy with 16 colours on a 51 x 19 display :P/>)

So anyway, I will be releasing the OS soon and if anyone is interested I am inviting people to create applications for the OS such as text editors, switch boards, maybe even ports for Firewolf that will be included with the OS.

Or, if you have any ideas for features, a problem/modification with the UI, a new name (as I said earlier, PearOS is very cliché) and so on.

Just to reiterate there is no download, it's not ready yet. If you create an application you will (obviously) get a testing copy, but apart from that it won't be available until it's done.

Current Additions Suggested (all will be added):
  1. Support for 'standard' ComputerCraft applications.
  2. Spotlight (Mac search tool)
Lyqyd #2
Posted 01 March 2013 - 08:37 PM
So, can you not use the default programs with this? Is it only able to handle programs created specifically for it?
Frederiken23 #3
Posted 01 March 2013 - 08:39 PM
This looks ridiculously complicated, and awesome!
But…
It looks like *shivers* Mac….
oeed #4
Posted 01 March 2013 - 08:53 PM
So, can you not use the default programs with this? Is it only able to handle programs created specifically for it?

Well you could run the default programs, however, as most programs use the entire screen they won't be able use windows or the user interface controls (such as lists, buttons, progress bars etc.)
oeed #5
Posted 01 March 2013 - 09:10 PM
This looks ridiculously complicated, and awesome!
But…
It looks like *shivers* Mac….

Actually, making an application is very easy, you'd actually have to type less code with this because the button, list etc. interaction and layout it done for you.
theoriginalbit #6
Posted 01 March 2013 - 09:13 PM
Well you could run the default programs, however, as most programs use the entire screen they won't be able use windows or the user interface controls (such as lists, buttons, progress bars etc.)
An extremely dodgy thing you could do, is you could override term.getSize() so that it returns <width>, <height - 1> and term.setCursorPos(x,y) to set the position to <x> and <y> + 1 … this is extremely dodgy, but if the program developer has programmed their program nicely to allow for any screen size then their program would be allowing for the menubar… and then you could do the same as apple and do a generic app name on the bar like "XCC" (X11) making it seem like another program is running for 'compatibility' or maybe just using the name of the file…
oeed #7
Posted 01 March 2013 - 09:19 PM
Well you could run the default programs, however, as most programs use the entire screen they won't be able use windows or the user interface controls (such as lists, buttons, progress bars etc.)
An extremely dodgy thing you could do, is you could override term.getSize() so that it returns <width>, <height - 1> and term.setCursorPos(x,y) to set the position to <x> and <y> + 1 … this is extremely dodgy, but if the program developer has programmed their program nicely to allow for any screen size then their program would be allowing for the menubar… and then you could do the same as apple and do a generic app name on the bar like "XCC" (X11) making it seem like another program is running for 'compatibility' or maybe just using the name of the file…

Good idea, I was trying to figure out how I could do that, and that seems like it's probably the best.
Mendax #8
Posted 01 March 2013 - 10:22 PM
'Mac OS is widely regarded as the easiest OS to use…' Ahem, Mac user, the majority would say that Windows is easiest to use, though I run Linux and find Windows and Mac both absurd.

Anywho, you did a great job on this. It looks great! :D/>
Will it be Open-Source? I would certainly like a look at the code…
Lyqyd #9
Posted 02 March 2013 - 04:43 AM
Well you could run the default programs, however, as most programs use the entire screen they won't be able use windows or the user interface controls (such as lists, buttons, progress bars etc.)
An extremely dodgy thing you could do, is you could override term.getSize() so that it returns <width>, <height - 1> and term.setCursorPos(x,y) to set the position to <x> and <y> + 1 … this is extremely dodgy, but if the program developer has programmed their program nicely to allow for any screen size then their program would be allowing for the menubar… and then you could do the same as apple and do a generic app name on the bar like "XCC" (X11) making it seem like another program is running for 'compatibility' or maybe just using the name of the file…

Good idea, I was trying to figure out how I could do that, and that seems like it's probably the best.

Partially overriding term functions is very hacky and not a good long-term fix. There are a number of problems inherent to that workaround. You might check out how LyqydOS does windowing.
NeptunasLT #10
Posted 02 March 2013 - 09:02 AM
Good Now i got Idea for archily OS thx.
ETHANATOR360 #11
Posted 02 March 2013 - 09:07 AM
looks pretty neat
theoriginalbit #12
Posted 02 March 2013 - 11:04 AM
Partially overriding term functions is very hacky and not a good long-term fix. There are a number of problems inherent to that workaround. You might check out how LyqydOS does windowing.
I did say it was very dodgy.
Lyqyd #13
Posted 02 March 2013 - 11:15 AM
Partially overriding term functions is very hacky and not a good long-term fix. There are a number of problems inherent to that workaround. You might check out how LyqydOS does windowing.
I did say it was very dodgy.

You did indeed. My reply was directed more at OP regarding it as a "good idea" and "probably the best" solution. :)/>
oeed #14
Posted 02 March 2013 - 01:20 PM
Partially overriding term functions is very hacky and not a good long-term fix. There are a number of problems inherent to that workaround. You might check out how LyqydOS does windowing.
I did say it was very dodgy.

You did indeed. My reply was directed more at OP regarding it as a "good idea" and "probably the best" solution. :)/>/&amp;gt;

Thanks, LyqydOS' method does look pretty good, I'll take a look at the source code.

So apart from supporting standard applications, which is a must, any other feed back?
Dlcruz129 #15
Posted 02 March 2013 - 03:45 PM
Adding spotlight would be cool.
oeed #16
Posted 02 March 2013 - 04:32 PM
Adding spotlight would be cool.

Yes, that would be very cool. I'm not sure what the icon would be, maybe just a capital 'O'
Dlcruz129 #17
Posted 02 March 2013 - 06:39 PM
Adding spotlight would be cool.
Yes, that would be very cool. I'm not sure what the icon would be, maybe just a capital 'O'

I was thinking a question mark, but it's entirely up to you.
Mailmanq! #18
Posted 03 March 2013 - 06:22 AM
What do you mean by the 'OS' is object-oriented, I know you can have tables to basically act like objects, but why is this 'OS' object oriented?
lieudusty #19
Posted 03 March 2013 - 10:54 AM
Looks great!
oeed #20
Posted 03 March 2013 - 01:58 PM
What do you mean by the 'OS' is object-oriented, I know you can have tables to basically act like objects, but why is this 'OS' object oriented?

Well, for example. To create a new label you would call:

local myLabel = OSLabel:new(7, 6, "Hello"),
Where 7 is the x-coordinate, 6 is the y-coordinate and "Hello" is the string. All the objects are in tables and inherit from each other.
Every object is an 'OSObject', every on-screen object is an 'OSEntity'.
An OSObject just defines what type it is basically, but an OSEntity looks like this:

OSEntity = {
  __index = OSObject, -- parent class
  x = 0,
  y = 0,
  width = 0,
  height = 0,
  title = "",
  tag = 0,
  remove = function(self)
      OSInterfaceEntities.remove(self)
  end
}
It inherits from OSObject and then adds on screen rendering information (x,y, width etc).
(By the way, 'OS' at the beginning is the prefix of all OS based commands, similar to 'NS' in Cocoa.)
This probably isn't the best explanation but it will probably be more obvious once I release the code.
tesla1889 #21
Posted 03 March 2013 - 02:07 PM
you could always create a sandbox for lua scripts to run in that contains the modified term API. that's how i restrict programs to windows

that also allows for control over functions such as os.shutdown and os.reboot
Mailmanq! #22
Posted 03 March 2013 - 02:10 PM
What do you mean by the 'OS' is object-oriented, I know you can have tables to basically act like objects, but why is this 'OS' object oriented?

Well, for example. To create a new label you would call:

local myLabel = OSLabel:new(7, 6, "Hello"),
Where 7 is the x-coordinate, 6 is the y-coordinate and "Hello" is the string. All the objects are in tables and inherit from each other.
Every object is an 'OSObject', every on-screen object is an 'OSEntity'.
An OSObject just defines what type it is basically, but an OSEntity looks like this:

OSEntity = {
  __index = OSObject, -- parent class
  x = 0,
  y = 0,
  width = 0,
  height = 0,
  title = "",
  tag = 0,
  remove = function(self)
	  OSInterfaceEntities.remove(self)
  end
}
It inherits from OSObject and then adds on screen rendering information (x,y, width etc).
(By the way, 'OS' at the beginning is the prefix of all OS based commands, similar to 'NS' in Cocoa.)
This probably isn't the best explanation but it will probably be more obvious once I release the code.

I know that, but I didn't think you would call an program object oriented because it uses them, I though that is like a language is object oriented
oeed #23
Posted 03 March 2013 - 02:35 PM
you could always create a sandbox for lua scripts to run in that contains the modified term API. that's how i restrict programs to windows

that also allows for control over functions such as os.shutdown and os.reboot

Yea, I do have sandboxing in place for functions such as 'quit' etc. But haven't thought about those, thanks.


–snip snip–
I know that, but I didn't think you would call an program object oriented because it uses them, I though that is like a language is object oriented

Well, the reason I made this object oriented is because it allows it to be more complex, I do understand where your coming from, however. In terms of being called object oriented, is more how an application would interact with the OS.

(Woot, no longer clueless :D/>)
AnthonyD98™ #24
Posted 03 March 2013 - 02:53 PM
This looks really nice :)/>
oeed #25
Posted 03 March 2013 - 03:25 PM
This looks really nice :)/>

Why thank you :)/>
Sxw #26
Posted 04 March 2013 - 04:50 PM
As for the windowing apps, take a look at gophersatls api, redirect.
oeed #27
Posted 04 March 2013 - 05:01 PM
As for the windowing apps, take a look at gophersatls api, redirect.

I might do that for non-PearOS applications, but the propetary application's window system is finnished.
EDSman11 #28
Posted 07 March 2013 - 10:27 AM
WOW… This looks amazing!
I began coding an OS way back about 2 years ago, back when advanced computers didn't exist, but then soon got tired and gave up…
I decided to look into computercraft again and the first thing I find is this… Totally shocked at how far this mod and its capabilities have come!

My first computer was an iMac and I can honestly say that I have been truely spoiled by them. I am a Mac user for life…
I can't wait for this OS to be released! Could you posibly create a server version so that I can use it as the main OS on my server?
Also, I would love to see these quite impressive programs in it as well:

Mineception

Firewolf

AdventureCraft (although it isn't in color)
oeed #29
Posted 07 March 2013 - 01:52 PM
WOW… This looks amazing!
I began coding an OS way back about 2 years ago, back when advanced computers didn't exist, but then soon got tired and gave up…
I decided to look into computercraft again and the first thing I find is this… Totally shocked at how far this mod and its capabilities have come!

My first computer was an iMac and I can honestly say that I have been truely spoiled by them. I am a Mac user for life…
I can't wait for this OS to be released! Could you posibly create a server version so that I can use it as the main OS on my server?
Also, I would love to see these quite impressive programs in it as well:

Mineception

Firewolf

AdventureCraft (although it isn't in color)

First of all, thanks!
I've spent the last few days adding a few small features and ironing out some bugs.
New features I've added are:
  • Keyboard shortcuts (set from menus)
  • File Extension Associations (if you open a .txt in Finder it will open in TextEdit)
  • Minimising to the dock
  • Window resizing
  • A few more things
By server version, do you mean that all computers on the server will run it? If so I will try. As suggested earlier in this topic, I'll be adding a way to run 'legacy' applications, so with permission I'll add Mineception and AdventureCraft. Also, I haven't spoken to the developer yet, but I intend to make a special version of Firewolf the uses a Safari like interface.
GravityScore #30
Posted 10 March 2013 - 11:40 PM
First of all, thanks!
I've spent the last few days adding a few small features and ironing out some bugs.
New features I've added are:
  • Keyboard shortcuts (set from menus)
  • File Extension Associations (if you open a .txt in Finder it will open in TextEdit)
  • Minimising to the dock
  • Window resizing
  • A few more things
By server version, do you mean that all computers on the server will run it? If so I will try. As suggested earlier in this topic, I'll be adding a way to run 'legacy' applications, so with permission I'll add Mineception and AdventureCraft. Also, I haven't spoken to the developer yet, but I intend to make a special version of Firewolf the uses a Safari like interface.

Looking at the screenshots… this looks amazing. I'd love to help make a Firewolf port somehow!

I'm not sure how you might make it more safari-like, but if you give me some criteria on what I need to do to make it compatibile for this OS, I'll give it a shot! I image you would have made it so applications are drawn into a window by overriding term, and the only thing I'd need to do is make it compatible with the window resizing…
Mikee251 #31
Posted 11 March 2013 - 06:09 AM
WOW… This looks amazing!
I began coding an OS way back about 2 years ago, back when advanced computers didn't exist, but then soon got tired and gave up…
I decided to look into computercraft again and the first thing I find is this… Totally shocked at how far this mod and its capabilities have come!

My first computer was an iMac and I can honestly say that I have been truely spoiled by them. I am a Mac user for life…
I can't wait for this OS to be released! Could you posibly create a server version so that I can use it as the main OS on my server?
Also, I would love to see these quite impressive programs in it as well:

Mineception

Firewolf

AdventureCraft (although it isn't in color)

Why thank you ;)/>
spyman68 #32
Posted 11 March 2013 - 09:58 AM
I really wish that I could test this, any way you could PM me a beta version?
oeed #33
Posted 11 March 2013 - 10:27 AM
Well the way I was thinking of making it Safari-like is a bit like this screen shot (of Finder):

Basically you'd just have a similar tool bar and maybe of few things here and there.
oeed #34
Posted 11 March 2013 - 11:32 AM
I have released PearOS Preview 1.
Download it here:
http://www.computercraft.info/forums2/index.php?/topic/11049-pearos-the-best-computercraft-os-ever-preview-1/
CH3DD4R #35
Posted 11 March 2013 - 02:47 PM
First of all, this looks PWNAGE. ABSOLUTELY THE BEST OPERATING SYSTEM EVER. I LOVE the inspiration from mac os x, even though windows is my favorite os. Installed and running. My only problems is that the notepad has some crazy issues. I cant use it. Also; Another recommendation, though I bet it is CRAZY to code, is allowing users to import pictures from the Paint application in shell as their wallpaper.
theoriginalbit #36
Posted 11 March 2013 - 03:19 PM
So anyway, I will be releasing the OS soon and if anyone is interested I am inviting people to create applications for the OS such as text editors, switch boards, maybe even ports for Firewolf that will be included with the OS.

Or, if you have any ideas for features, a problem/modification with the UI, a new name (as I said earlier, PearOS is very cliché) and so on.
If you wish I have the 'cp' and 'echo' programs that 'emulate' as close as possible how the OS X ones work. PM me if you want them.
I have been working on everything in the '.bin' folder. but they are the only 2 I have done so far.
Lyqyd #37
Posted 20 April 2013 - 11:56 AM
Locked; topic is about PearOS and is therefore duplicitous.