Screens Environment is a multi-platform component based middleware research project designed to connect technologies together and provide better user experiences for the future of computing http://sourceforge.net/projects/screensos/
Thursday, October 18, 2007
Update
Hi,
I just wanted to update you all that this week and next week are going to have very little programming time because my full time job at NDS needs some time reinforcemant.
But things are going great for Screens. As you know Screens evolves all the time and I get to rewrite it on a monthly basis to get it just that much easier. Well, it looks like its going to happen again after seeing the work that was required to do drawing on-screen which was a bit too complex. The new object design is so much closer to C but has a cool backdoor effect to allow any structure attached to an object, to be used as the object handle itself. I dont know of any system that does this and I am very happy to be able to work on it.
Here is an example:
object * Object = ObjectNew();
window_struct * Window = ObjectAdd(Object, window_struct);
element_struct * Element = ObjectAdd(Object, element_struct);
ObjectRename(Window, "My object name");
ObjectAttach(Element, ObjectRoot());
Window = ObjectCast(Object, window_struct);
In this example: Object, Window & Element are all the same object. This design allows to use multiple pointers to represent the same object. Whats cool is that the casting allows to access data stored in each object natively. So that Element pointer allows to actually read/write members in the element structure with no need for function read/write overhead. It makes objects much closer to the C language.
BTW: About the spaces feature in MacOSX idea, I expect these kind of features to be included in Screens in its future but I doubt in the 1st version. Thanks.
Tuesday, October 09, 2007
Update
Last week I spent alot of time coding because I was on vacation from work. This week however I am back at work which explains why the lack of coding. I have however tried to squeeze some time out of my day for some programming on Screens. I have finished the fill part of the rectangle class, so I can fill the screen with rectangle fills.
Things are moving...
Friday, October 05, 2007
Update
Things are progressing very nice. I have already finished the Shape component which deals with caching drawing to the display. It allows the windows and controls to be detailed objects while not reducing the performance of drawing to the display. This model allows to have transparency with a single off-screen buffer without requiring a seperate off-screen buffer for each window. This makes windows much cheaper in memory requirements.
Thursday, October 04, 2007
Practice makes perfect
Practice is realy the way to make something perfect. I have rewitten the object storage so many times improving over the previous when I hit a wall since it was easier to rewrite the entire code, then patch the previous design. I did not expect to write over 20 times the same object storage but I guess thats what I needed... Pratice.
And yes, I have done it again... I have rewritten the code again but wait... here's why:
1. Objects only understood streams
While it was nice on design, it did not work out in usage. I had to make alot of wrapper functions that would take a structure and break it down into values and it required alot of the same code to get to the data. It felt like alot of the code was just to talk between C and my object storage.
2. The alpha was recieved well, but it was hacked a bit together
I sent an alpha to some of my Windows Live (MSN) users (zhamilton1@yahoo.co.uk if you want to join) and while it showed of windoing, it was very fixed and very quickly I found the problems when trying to do something simple as making a button class. The whole idea of the object storage was to make things easier not harder. Thanks to the users who tested the alpha.
But dont worry, this post is already after I have written the new object storage and I am very near the alpha demo stage that I was on the previous version. I have already used the new design and its so much nicer.
Let's say I have the windows structure MSG. And I want to send it to all listeners so they can act on the message. Before hand I would have to break the parameters into a string and then each listener had to repack the structure. Alot of work for nothing. The new code is like this (without error checking):
object Core, Message;
MSG * WinEvent;
/* Retrieves the event core */
Core = EventCore();
/* Creates a message object */
Message = ObjectNew(Core, 0);
/* Add the windows message structure to the object */
ObjectAdd(Message, MSG);
/* Retrieve the windows message structure from the object */
WinEvent = ObjectCast(Message, MSG);
/* Fill the win32 message */
if(!GetMessage( WinEvent, NULL, 0, 0 )) {
return false; /* exit the application */
}
/* Send the message to all event core listeners */
ObjectSend(Core, Method_EventDispatch, Message);
When a listener recieves the message it just does this:
MSG * WinEvent;
WinEvent = ObjectCast(Message, MSG);
You can see that the code is readable and clean. I will get back to the previous status of the moving windows and buttons and I will give some of you a version for feedback.
Thanks
Subscribe to:
Posts (Atom)