SEAL Forum Index SEAL
The SEAL Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why not make seal handle-based like windows?

 
Post new topic   Reply to topic    SEAL Forum Index -> General
View previous topic :: View next topic  
Author Message
Sean



Joined: 04 Apr 2002
Posts: 20
Location: United States

PostPosted: Sat Feb 15, 2003 12:30 pm    Post subject: Why not make seal handle-based like windows? Reply with quote

Windows uses handles to reference objects. That way, the implementation of the object can change, while not breaking the applications that use the API's. And this way, users can't directly access objects data members. I think it would be a good idea. Let me know what you think.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Iamryan2002



Joined: 09 Apr 2002
Posts: 525
Location: San Diego, California United States

PostPosted: Sat Feb 15, 2003 10:57 pm    Post subject: Reply with quote

interesting idea.. seal already has a handle like system.. that is why you use:

Code:
OBJECT(obj)->insert(OBJECT(win), OBJECT(obj));

_________________
HybridOS: Maintainer.

E-Mail: DigitalBliss2003@cs.com
MSN: digitalbliss2003@hotmail.com
AIM: DigitalBliss2003

Questions? Contact Me!
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Sean



Joined: 04 Apr 2002
Posts: 20
Location: United States

PostPosted: Tue Feb 18, 2003 2:40 pm    Post subject: Reply with quote

I mean a system where object members can't be seen directly, providing more of a modular approach to objects like so:

typedef void* handle;
handle window = CreateWindow("Some title",0,0,100,100,some other arguments);

and members of the window would be accessed by calling a function like so:

text title = GetWindowTitle(window);

just an idea.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Tue Feb 18, 2003 3:11 pm    Post subject: Reply with quote

Isn't that how it works today? Sorry, either I must be very tired or I don't know what you mean.
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Sean



Joined: 04 Apr 2002
Posts: 20
Location: United States

PostPosted: Wed Feb 19, 2003 11:49 am    Post subject: Reply with quote

Objects like p_button or whatever it's called, are structures that have members that can be accessed by end-user applications. If the structure of the button ever changes, then the older applications that use the button, might be broken. If the application doesn't know the button's structure, but just calls functions provided by the system, the button structure could change a million times, without ever harming the applications that use it. Maybe someone who has a lot of experience with the win32 APIs could help explain this better.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Wed Feb 19, 2003 4:26 pm    Post subject: Reply with quote

But you know, that is how it is today... Sure you can access the variables from the structs directly, but that's not the recommended way to program your programs... The Seal api is built so you'll use functions for manipulating data, not the data itself. And that is the classic object oriented approach...
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ganesh



Joined: 11 Jul 2002
Posts: 133
Location: Vancouver, BC, CA

PostPosted: Fri Feb 21, 2003 8:07 pm    Post subject: Reply with quote

The functions that you talk of aren't true functions. They are function pointers.

They are setup at runtime. IIRC, some _init function sets the pointers.

This way, as long as the struct doesn't change, enduser apps will not be broken.
_________________
Ganesh lives @
www.iamganesh.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Sat Feb 22, 2003 3:00 am    Post subject: Reply with quote

Exactly

So don't touch the vars in the structs directly, and voila, you have oo
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Sean



Joined: 04 Apr 2002
Posts: 20
Location: United States

PostPosted: Sat Feb 22, 2003 4:04 pm    Post subject: Reply with quote

But I was talking about the structures from the very start. If the struct does change, that could mean all hell for the apps.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
lukas139



Joined: 29 Mar 2002
Posts: 293
Location: Slovakia

PostPosted: Sun Feb 23, 2003 12:05 am    Post subject: Reply with quote

Sean wrote:
But I was talking about the structures from the very start. If the struct does change, that could mean all hell for the apps.


Even If the structures change, the functions that access them will stay, so all apps will work even if all the structures are changed but the functions accessing certain paramaters stay and are mofified.
_________________
Lukas Lipka
My Home
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Tue Feb 25, 2003 11:01 am    Post subject: Reply with quote

But there is one problem, because when you create a new object you send the size to the memory allocator, and if you have added an int or someting to the structure you wont' allocate enought memory... so I think you kinda have to recompile anyway... or?
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ganesh



Joined: 11 Jul 2002
Posts: 133
Location: Vancouver, BC, CA

PostPosted: Sun Mar 16, 2003 11:00 pm    Post subject: Reply with quote

Yes, thats right.

When I say the struct changes, it includes two things:

+ Adding or removing members
+ Changing the order of the members

In any of the above cases, you need to recompile. But, thats kinda ok.

Take mozilla for example. The complete function parameter changes every version. So, any gecko based browser will have to keep close watch at the CVS commits. PITA.
_________________
Ganesh lives @
www.iamganesh.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Mon Mar 17, 2003 9:42 am    Post subject: Reply with quote

Something like that

I think pita is a rather rude word, isn't it?
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ganesh



Joined: 11 Jul 2002
Posts: 133
Location: Vancouver, BC, CA

PostPosted: Mon Mar 17, 2003 11:11 pm    Post subject: Reply with quote

pita is considered offensive only if I s-p-e-l-l it out.

BTW, pita in hindi means father. !
_________________
Ganesh lives @
www.iamganesh.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TuxLiker



Joined: 19 Apr 2003
Posts: 1

PostPosted: Sat Apr 19, 2003 10:53 am    Post subject: Reply with quote

Funny Mr Green Pita also has another name. Meaning a type of bread where I come from. Usually filled with meat and other good stuff to eat!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SEAL Forum Index -> General All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group