View Single Post
  #1 (permalink)  
Old January 12th, 2008, 10:31 AM
Angryman_H10 Angryman_H10 is offline
Mistical Abstract
 
Join Date: Aug 2006
Posts: 670
VIEWPORTS SIM & TESTBUILD ::: WPS Creators read this!

This information is especially for the WPS Creators ...

In the not so far future viewports will be implemented to SVN builds and its expected that this will break nearly all available themes which made use of multifont, scrolling lines and so on. Viewports are only downwards compatible to themes which didnt make use of these patches.

The multifont, scroliing lines, custom list position patches will die because viewports will take control of all these functionalities.
But it should be possible to port all themes to viewports.

WHAT ARE VIEWPORTS?
I would recommend you read the following article:
Viewports > Main > Wiki


A SHORT EXPLANATION HOW VIEWPORTS WORK:
The WPS usage of viewports is as followed...
If you want to make use of the viewport capabilities you first need to define a viewport.
You can place a viewport with x and y coordinates as you did with customline. A viewport has its own width and height. So margin patches are not required anymore. You can define a font and the color of the font (That makes the multifont patch useless).
The background color of the viewport will be ignored if a WPS background is set.
After you defined a viewport just use the typical tags to display what you want. Everything which follows after your viewport definition will be drawn linebased in your last defined viewport as long as you do not define a new viewport. This means if you want to have each line pixel-precise placed, each line has to be drawn in its own viewport or the lineheight by the font will be used to define the position of a new line.

The syntax of a viewport is defined like this: %V|x|y|width|height| font|fgcolor|bgcolor |
The fonts are defined as usual in the .cfg file of your WPS but numbers 0 and 1 are reserved for FONT_SYSFIXED and FONT_WPS. So if you define userfonts they start with 2.

An Example viewport using userfont1 and displaying the current time:
%V|32|114|26|7|2|C8BFB5|000000| <-- 0 and 1 reserved, userfont1 = 2
%cH:%cM

Another example (showing up more differences):
%V|0|115 |122|5|1|B5B5B5|0000 00| <-- We create another viewport to hold our progressbar with an y-coordinate of 115px
%pb|2|85|122|0 | <-- The pb tag itself contains also an y-coordinate (last value) we set it to 0px because its drawn in our viewport

Actually the above example isnt as clean as it could be. Why? If this Viewport would really only hold the progressbar why should its start at x=0?
And why do we need to define x=85px for the progressbar? A cleaner version would look like this:
%V|85|115|122|5|1|B5 B5B5|000000| <- Now we placed the viewport exactly where we want to draw the upper left corner of our progressbar
%pb|2|0|122|0| <- The progressbar tag only contains a height value of 2 and its width of 122, we set x and y to zero

I hope this demonstrates a bit what viewports are meant to be... You can define areas (viewports) in your WPS. All followed tags which follow a
viewport definition are drawn in that viewport. Measurements are then taken from the viewports x and y coordinate not from your screen anymore.

I would recommend that you take a look at the flyspray page of viewports at the rockbox forums:
FS#8385: Viewports

I also ported the Lavenia theme for the H10 (5G/6G) models to viewports.
You can have a look in the WPS to see how it works.
iwantanimac compiled Windows Simulators which make it easier to test your WPS's...

ONLY LIMITATION RIGHT NOW IS THAT CUSTOM LIST POSITION IS NOT YET SUPPORTED BUT WILL BE...
and the configuration setting for list position can be added easiliy as soon as viewports offer it.
Its also not 100% guaranteed that there will be no further changes how viewports are drawn. This means as long
as viewports are developed themes could need to be reedited again.

SO IF YOU ARE INTERESTED IN UPDATING OR CREATING A NEW THEME FOR VIEWPORTS... HERE YOU GO...
iwantanimac viewports simulators (H10 5G and 20G)
H10 Lavenia Viewports WPS (5G/6G Models)
Mono's H10 (5G/6G) viewports build
Mono's H10 (20G)viewports build

WHATS UP NEXT???
As already mentioned viewports will be able to replace the custom-list-position patch. That means that you can also define
the x and y positions of your browser screen. More information is not yet available but its quite sure that you can even play
more around with the screen elements. E.g. placing the statusbar at the bottom, seperatly define the position of the scrollbar
or the icons... Maybe other screens will be also accessible by viewports like the radio screen. We will see how far the
rockbox devs will push this.

Cheerio Angry
__________________
www.handmadematters. tk

Last edited by Angryman_H10 : January 13th, 2008 at 04:08 AM.
Reply With Quote