OS2World OLD-STATIC-BACKUP Forum

OS/2 - Technical => Programming => Topic started by: miturbide on 2012.06.11, 22:36:15

Title: WPS Classes
Post by: miturbide on 2012.06.11, 22:36:15
..wait... wait... I think I'm getting it.... no :)


Title: Re: WPS Classes
Post by: ivan on 2012.06.12, 11:06:27
Just what are you trying to get?

ivan
Title: Re: WPS Classes
Post by: miturbide on 2012.06.12, 17:38:20
Im trying to learn more about WPS programming, and to understand the WPS classes structure.
Title: Re: WPS Classes
Post by: ivan on 2012.06.12, 19:57:21
Wasn't there one of the IBM Red Books about that?  Other than that I can't help very much.

ivan
Title: Re: WPS Classes
Post by: RobertM on 2012.06.14, 02:49:22
There are a few books that are great on the topic. there are also references on EDM/2 and Hobbes. Basically, the WPS is a set of subclasses and "superclasses" based off its default 3 classes (OS/2 only has three main classes: WPAbstract, WPFileSystem and WPTransient). The biggest and most important thing to learn is how OS/2 handles objects - or inotherwords, how OS/2's object oriented nature is *DRASTICALLY* different from Windows, and has various levels of differences from other oo methods.

This all also applies to how any true OS/2 GUI based program that utilizes WPS features works and can behave (which the WPS is just one of). Learning about the message queue and how it is handled is also vitally important. Everything gets done with messages of some sort. The default classes handle all things by default. BUT, when a sub-class is registered, it will handle certain messages (either system-wide or for specific things). A "super-class" is basically a replacement class for a class (or sub-class) that does just that - replaces the entire class.

If a subclass exists (that is intended to override an existing class) that handles certain things, those messages get passed to it. That sub-class has the option of handling the message, or "sending it back" to be handled by the parent class. Again, that applies to all "PM programs" including the WPS.

If a subclass exists that does NOT override an existing class, it can instead be (usually is) something that extends the capabilities of the main class. For instance, the main classes (such as WPFileSystem) are really "dumb" in that they are rather unaware of much of anything and simply provide a basic framework - the subclasses linked to them are what provide the additional functionality beyond that framework. As an example, WPFilesystem knows virtually nothing about multimedia files - the MM sub-classes give it that "knowledge".

Almost anything can be sub-classed or "super-classed" - and ALL of that is defined in what becomes system DLLs. (inotherwords, sub-classes and "super-classes" get handled by their DLLs - thus, that is what defines them. Once the DLL is registered, the WPS suddenly becomes aware it knows more and knows how to do more - the rest being transparent).

The class lists will of course vary on various installations of OS/2 depending on what additional DLLs are loaded as part of the WPS.

Here's some resources on the topic:
http://www.edm2.com/0510/wps1.html
http://www.amazon.com/OS-2-1-Workplace-Shell-Programming/dp/0679791620
- (good starting point at that price, even with its age)
http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..%5Chtml%5Cbook%5CToolkt40%5CWPSGUIDE.INF+326
Title: Re: WPS Classes
Post by: ALT on 2012.06.15, 15:19:52
There are a few books that are great on the topic.

I'd love to know where, I haven't been able to find any.

Quote
http://www.amazon.com/OS-2-1-Workplace-Shell-Programming/dp/0679791620
- (good starting point at that price, even with its age)

According to the reviews, this book is actually about PM programming and contains no WPS information at all.

Last year I tried to dip my toes into WPS programming, but I hit a wall when I realized that there are (apparently) no clearly-written, comprehensive guides to be found anywhere.  I looked through the information on EDM/2 but it's all confusing and/or incomplete snippets, half of which seem to be using an obsolete version of the SOM compiler with a different programming syntax.

I just want a good, solid, methodical and comprehensive text on the subject, much the same way that Petzold's book was for Presentation Manager.  Is that too much to ask?  Surely all the developers who wrote WPS-aware programs back in the heydey must have gotten their training from somewhere... but I've never been able to find anything like that.

Sorry for the griping but as you can tell I got a bit (OK, a lot) discouraged about the whole topic.
Title: Re: WPS Classes
Post by: jep on 2012.06.15, 19:04:46
I so totally agree with you...
Give me some proper info/docs and I'll try as well.

//Jan-Erik
Title: Re: WPS Classes
Post by: melf on 2012.06.15, 19:09:55
 Know nothing about this of course, just searched for fun:

http://books.google.se/books?id=3cBQAAAAMAAJ&q=Os2+Warp+workplace+shell+api&dq=Os2+Warp+workplace+shell+api&hl=sv&sa=X&ei=mGjbT4T2F4nf4QSJqpyzCg&redir_esc=y

http://www.amazon.co.uk/OS-2-Workplace-Shell-SOM/dp/0471038725/ref=sr_1_1_title_0_main?s=books&ie=UTF8&qid=1339779728&sr=1-1  (six used books left?)

http://cyberkinetica.homeunix.net/os2tk45/    (seems to be a nice collection of docs, among them wps programming)
Title: Re: WPS Classes
Post by: aschn on 2012.06.15, 20:25:31
Surely all the developers who wrote WPS-aware programs back in the heydey must have gotten their training from somewhere...

They were probably taught in IBM courses. Training is a major part of the business -- now and then.

Andreas
Title: Re: WPS Classes
Post by: RobertM on 2012.06.16, 07:26:46
There are a few books that are great on the topic.

I'd love to know where, I haven't been able to find any.

I *THINK* this is what I first used as a reference (and the other books mentioned lower in the page: OS/2 Warp Control Program API and OS/2 Warp Presentation Manager API):
- http://www.amazon.com/OS-Warp-Workplace-Shell-API/dp/0471038725

It will be out of date in numerous aspects, and is probably directed at IBM C-Set/2 (ie: their OS/2 C++ compiler that predates VAC++). But, if it is the book I remember, it was still a very helpful reference (even later on as it became more out of date) for many of the things that were difficult to find elsewhere.

Title: Re: WPS Classes
Post by: RobertM on 2012.06.16, 07:37:14
Hmmm... actually, I *know* it was one of the books I relied on.
- http://books.google.com/books/about/OS_2_Warp_Workplace_Shell_API.html?id=3cBQAAAAMAAJ

These are others I owned or borrowed - but cannot recall much about them:
- http://books.google.com/books?id=FqVQAAAAMAAJ
- http://books.google.com/books?id=HlUAAAAACAAJ
- http://books.google.com/books?id=2l2qQgAACAAJ
- http://books.google.com/books?id=Z7ZQAAAAMAAJ

And perhaps the best suggestion (especially since they have been doing this far more recently than those of us responding) is to send messages to the people who worked on xWorkplace, Nice, WPSWizard and so on to ask them what they used/use as references.



Quote
http://www.amazon.com/OS-2-1-Workplace-Shell-Programming/dp/0679791620
- (good starting point at that price, even with its age)

According to the reviews, this book is actually about PM programming and contains no WPS information at all.

Last year I tried to dip my toes into WPS programming, but I hit a wall when I realized that there are (apparently) no clearly-written, comprehensive guides to be found anywhere.  I looked through the information on EDM/2 but it's all confusing and/or incomplete snippets, half of which seem to be using an obsolete version of the SOM compiler with a different programming syntax.

I just want a good, solid, methodical and comprehensive text on the subject, much the same way that Petzold's book was for Presentation Manager.  Is that too much to ask?  Surely all the developers who wrote WPS-aware programs back in the heydey must have gotten their training from somewhere... but I've never been able to find anything like that.

Sorry for the griping but as you can tell I got a bit (OK, a lot) discouraged about the whole topic.

It probably is... though I wonder how much of the information might be in VAC++'s docs. I have v3 (and I think I might have v4, but I suspect it may be lacking in such in depth docs). I do know that C-Set/2 had some pretty detailed information in it (though outdated - and probably the "obsolete... SOM compiler" you reference above) - but point is I suspect that during the VAC++ v3 timeframe, the docs may have been still somewhat decently updated and somewhat complete.
Title: Re: WPS Classes
Post by: RobertM on 2012.06.16, 07:40:27
Surely all the developers who wrote WPS-aware programs back in the heydey must have gotten their training from somewhere...

They were probably taught in IBM courses. Training is a major part of the business -- now and then.

Andreas

Yup - with references, code snippets, example code and programs and such given away on floppies or printed form or both. Members of BesTEAM and IBM SD (and other partner/developer groups IBM had) also were given the above (sans the training part unless chosen by the member as something they wanted to attend).
Title: Re: WPS Classes
Post by: miturbide on 2012.06.17, 01:09:26
Hi

I'm looking forward to learn more about WPS programming on the next months. But I having the problem to clearly define where does WPS starts and PM, SOM ends.  For the moment my idea is that WPS is the objects that I can see with WPS Class explorer. I still need to understand more the potential of WPS and what can it be done with that and what can not be done.

Since I was trying to organize the EDM/2 wiki (http://www.edm2.com/index.php/Category:SOM_Articles). I think that the only official WPS Programming stuff from IBM I was able to find were:

WPS1.INF - Workplace Shell Programming Reference, Part 1 of 3 by IBM
WPS2.INF - Workplace Shell Programming Reference, Part 2 of 3 by IBM
WPS3.INF - Workplace Shell Programming Reference, Part 3 of 3 by IBM
WPSGUIDE.INF - Workplace Shell Programming Guide by IBM
...
And the stuff that is on IBM Toolkit.

I still need to get some time to start my training.

I agreed with Alex that there is no good consolidated material about the topic. The articles on EDM/2 are good, but are snippets.

Thanks the for links on the books. I will check them out.
Title: Re: WPS Classes
Post by: LErdmann on 2012.07.02, 08:30:10
Hallo,

1) I have the book "OS/2 Warp Workplace Shell API" (ISBN: 0-471-03872-5). It's very helpful to understand some of the things like object lifetime etc. that the OS/2 toolkit docs won't properly explain. It's completely independent of any compiler but it might be outdated here and there as it refers to Warp 3.

2) you can create a WPS DLL with about any C/C++ compiler. You use "sc.exe" from the toolkit to create code skeleton (C/C++ code and header files). Forget about "Direct To SOM". You don't necessarily need it in order to write a WPS DLL.

3) I advise to use the C++-emitter from "sc.exe" even if you program in C. It's so much more elegant to code as naturally, SOM/WPS is object oriented (think about methods ...).

4) I once started writing a "post-it" class. It's finished to the point where it is usable but it was more of a learning project to me. It shows how to set up exception handling where necessary (an important thing to do in a WPS DLL). If anyone is interested, I can zip it up and send it to you.

Title: Re: WPS Classes
Post by: miturbide on 2012.07.08, 16:43:28
Thanks Lars.

I will appreciate if you can send me your "Post-it Class"  (martin@os2world.com) or if you can post the file on the forum.

Title: Re: WPS Classes
Post by: jep on 2012.07.11, 18:00:27
Lars,

please do also send me (jan-erik.larka@os2world.com) your "Post-it Class".

//Jan-Erik