Announcing: The way, QLiberator use the PE

Anything QL Software or Programming Related.
Post Reply
User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Announcing: The way, QLiberator use the PE

Post by RalfR »

QLiberator v3.xx was the first compiled SuperBASIC program, which was able to use the PE. I am in progress to make some demo programs for that, to show, how easy it is. Meanwhile, there is QPTR and EasyPTR, so there may be no demand for that, but perhaps it is even interesting.

Before launching all of the stuff, here my preface of the documentation. Perhaps it makes some appetite:

---------- snip ----------

How Qlib uses the Pointer.

Since v3.xx. QLiberator can be used with the PE. You have the look and feel of real Loose Menu Items, when you drag the pointer over the window to select its "Loose Menu Items" or move the window. But this is just an illusion, as we will see later.

QLiberator v3.xx was born in the days of QRAM, so the window and colour had the same feeling, colour 208. It was designed for the Sandy Futura and the QRAM colours should match.

Since this time, I always thought about the way, QLiberator manages the use of PE. As it is a compiled SuperBASIC program, there must be linked MC extensions in QLib_obj to use the PE. At this time, QPTR was far from release. QLiberator looked so PE native and I have asked Liberation Software several times about it, but never got an answer.

Qliberator v3.xx is a self compiled program with inbuilt machine code extensions to manage the hard work of compiling and the first compiled SB program, which uses the PE.

The next step was loading QLib_obj in S_Edit and look for keywords, which perhaps are used for those pointer things.

I found keywords like WM_Rptr, WM_Outln, WM_Sptr and so on. So I extracted this little "toolkit" from the file QLib_obj. Marcel Kilgus was a great help in disassembling it and gave the correct parameters and an example SB program to me.

The result is a little "toolkit": QLib_ptr_exts. It does not all the work, but it does the hard work. Whether this extension was written by Liberation software or written by Tony Tebby to help them out is not verified, as I have never got an answer about that from both of them.

As most of you might know, PE programs can be written with the help of the Window Manager or just with the Pointer Interface. QPTR has quite good examples for this. The Window Manager has the advantage to make a lot things by itself, for example returning the item number and drawing a little border outside an item, if the pointer has touched it and so on. The drawback is a bit more work in SB. Especially the QPTR keywords for the Window Manager can be quite complicated.

The Pointer Interface itself does not have such things, so you have to do a few things in SB. EDSPR is a good example, there are no item outlines, if you move the pointer over a block and the position of the pointer to a block is checked with a lot of SB procedures and functions.

---------- snip ----------


4E75 7000
User avatar
Artificer
Brittle Membrane
Posts: 120
Joined: Fri Nov 24, 2017 8:43 am

Re: Announcing: The way, QLiberator use the PE

Post by Artificer »

Hi,

Very interesting. Is there more?

Cheers


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: Announcing: The way, QLiberator use the PE

Post by RalfR »

I am on the way to write a demonstration program and to make the doccumentation ;)


4E75 7000
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Announcing: The way, QLiberator use the PE

Post by Derek_Stewart »

Hi Ralf,

Quite enlightening with regards to the Pointer Environment integration into Qliberator.

I thought that QPTR S*Basic could be compiled with Qliberator, due passing the data required to programme the Pointer definitions.

It looks now that Qliberator was programmed with QPTR in mind.

I look forward to the next update


Regards,

Derek
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Announcing: The way, QLiberator use the PE

Post by pjw »

Derek_Stewart wrote:Hi Ralf,

Quite enlightening with regards to the Pointer Environment integration into Qliberator.
Yes, indeed. All the indications are that there was a close working relationship between Liberation Software and QJump.

@ Ralf, Good idea about your enlightenment project. I hope it is a success!
BTW, do you have enough of a handle on this to fix the main Q-Liberator window so it can be moved beyond the confines of the 512x256a0x0 screen?


Per
dont be happy. worry
- ?
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Announcing: The way, QLiberator use the PE

Post by mk79 »

pjw wrote:BTW, do you have enough of a handle on this to fix the main Q-Liberator window so it can be moved beyond the confines of the 512x256a0x0 screen?
No, that limit is imposed in the compiled code, not in the basic extension.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Announcing: The way, QLiberator use the PE

Post by mk79 »

By the way, disassembling this was a fun little exercise, but essentially they rewrote WMAN in basic. At the level they're doing this it's fairly easy, but still this is not how one should code these days. Using EasyPtr and the real WMAN is always less work and the result will always work better!


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: Announcing: The way, QLiberator use the PE

Post by RalfR »

Thank you guys. It seems, even as there are more modern ways to make a PE program with SB, it is always interesting to see, how it was done in the beginning.

I have often wondered, why Liberation Software did not publish such a little toolkit, probably because QPTR was in the pipeline. There are sitill some secrets in the QL universe ;) .

Even though some of the mentioned keywords start with "WM_", QLiberator just uses the Pointer Interface. Marcel was quite right in saying, that they used a kind of SB WMAN. EDSPR does it in a similar way, but more complicated and complete in SB.

QLiberator has a keyword to find its items, not so very far from the way WMAN does. I always missed such a keyword for the Pointer Interface in QPTR.

Ok, enough for the moment. ;)


4E75 7000
User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: Announcing: The way, QLiberator use the PE

Post by RalfR »

Ok, now we have to look at the optics again, before we read a pointer (be patient).

In PE, every Loose Menu Item, which is touched by the pointer, gets a little outline outside. So how do we make this in SB?

We need a keyword, which draws this in a rush, LINE is too slow. Or we use an MC extension like RECT from the Pyramide Graphic Toolkit. As QLib_obj does not have any extension for this, then it should be a pure SB keyword.

Marcel was very clever in suggesting BORDER. Well, good idea but BORDER draws itself inside the window. But we need a border outside.

Some things are so easy, that you can think about it for hours :D . The solution is so very simple: If the border should not be seen, simply use the colour of the background.

And here is a little demonstration, how QLiberator make an item look, as if it is a real WMAN one. I attach a little SB file, which you should EX under SMSQ/E. It demonstrates the border colour of an item, if the pointer is inside or outside. The colours are the same as QLiberator uses, you should be quite familiar with them.

And for those who want to see it soon, here is the listing:

Code: Select all

110 WINDOW 200,50,100,100
120 OPEN#2,"con_160x15a118x116"
130 PAPER 208: BORDER 1,255: CLS
140 PAPER#2,0: INK#2,7:CLS#2
150 CURSOR#2,20,2: PRINT#2,"I am not a real item"
160 REPeat loop
170     BORDER#2,1,4
180     PAUSE 50
190     BORDER#2,1,208
200     PAUSE 50
210 END REPeat loop
Scare easily, isn't it?
Attachments
QLib_item_demo_01_bas.zip
(372 Bytes) Downloaded 103 times


4E75 7000
Post Reply