Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#9424 - WPS editor rework: use native LCD drawing system instead of Qt's one

Attached to Project: Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Sunday, 28 September 2008, 17:24 GMT+2
Last edited by Maurus Cuelenaere (mcuelenaere) - Sunday, 06 June 2010, 19:04 GMT+2
Task Type Patches
Category Utils
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

See title description.

== Old description ==
This patch tries to use the native Rockbox font system instead of relying on Qt's one.

But due to my lack of knowledge of the Rockbox font format/mono bitmap format, the result currently is only garbage as output.

(When using the patch, don't forget to modify the hard coded font path)
======
   wps_editor_native_font.diff (10.1 KiB)
 libwps/src/api.h              |   10 ++++++---
 libwps/src/proxy.c            |    2 -
 libwps/src/lcd.c              |   33 ++++++++++++++++++++++++++++++++
 libwps/src/dummies.c          |   11 ++++++++--
 libwps/src/api.c              |   31 +++++++++++++++++++++++++-----
 libwps/Makefile               |    2 -
 gui/src/qwpsdrawer.cpp        |    5 ++++
 gui/src/qwpsdrawer.h          |    2 +
 gui/src/qwpsdrawer_static.cpp |   43 ++++++++++++++++++++++++++++++++++++++++--
 9 files changed, 125 insertions(+), 14 deletions(-)

This task depends upon

Closed by  Maurus Cuelenaere (mcuelenaere)
Sunday, 06 June 2010, 19:04 GMT+2
Reason for closing:  Fixed
Additional comments about closing:  The new theme editor should replace this.
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 28 September 2008, 17:26 GMT+2
Fix filesize()
   wps_editor_native_font.diff (10.1 KiB)
 libwps/src/api.h              |   10 ++++++---
 libwps/src/proxy.c            |    2 -
 libwps/src/lcd.c              |   33 ++++++++++++++++++++++++++++++++
 libwps/src/dummies.c          |   11 ++++++++--
 libwps/src/api.c              |   31 +++++++++++++++++++++++++-----
 libwps/Makefile               |    2 -
 gui/src/qwpsdrawer.cpp        |    5 ++++
 gui/src/qwpsdrawer.h          |    2 +
 gui/src/qwpsdrawer_static.cpp |   43 ++++++++++++++++++++++++++++++++++++++++--
 9 files changed, 125 insertions(+), 14 deletions(-)

Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 28 September 2008, 19:28 GMT+2
This is a complete rework of libwps, but it currently crashes in lcd_mono_bitmap_part() when drawing strings (probably due too no font being available?)
   wps_editor_native_font.diff (31 KiB)
 libwps/src/api.h                      |   43 +----
 libwps/src/proxy.c                    |   26 ++-
 libwps/src/include/backlight-target.h |    2 
 libwps/src/include/system-target.h    |    3 
 libwps/src/lcd.c                      |   33 ++++
 libwps/src/dummies.c                  |   32 +++-
 libwps/src/proxy.h                    |    3 
 libwps/src/api.c                      |  260 +++++++++++++++-------------------
 libwps/Makefile                       |   14 +
 gui/src/qwpsdrawer.cpp                |   98 +++++++-----
 gui/src/qwpsdrawer.h                  |   22 +-
 gui/src/qwpsdrawer_static.cpp         |   58 +------
 12 files changed, 296 insertions(+), 298 deletions(-)

Comment by Thomas Martitz (kugel.) - Tuesday, 30 September 2008, 14:25 GMT+2
I've shortly looked at the patch. Your current approach definitely sounds better to me (the editor should use as much existing code as possible).

That's why I'm curious you re-implement/copy some functions, like lcd_putsxyofs or lcd_update.
Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 30 September 2008, 14:30 GMT+2
That's because the original patch was intended to use the original approach while the newer one has a complete new one, and I apparently forgot to delete the old lcd_putsxyofs() implementation.

lcd_update() on the other hand needs to be implemented, how would the framebuffer otherwise get shown on the screen?
Comment by Thomas Martitz (kugel.) - Tuesday, 30 September 2008, 17:16 GMT+2
lcd_update_rect has to be reimplemented, lcd_update uses lcd_update_rect and could thus be taken from the original source.
Comment by Maurus Cuelenaere (mcuelenaere) - Friday, 21 November 2008, 13:55 GMT+2
Update WPS editor source to work with current SVN, still not working because Qt can't interpret the framebuffer correctly (wrong colours are displayed).
   wps_editor_native.diff (32.4 KiB)
 utils/wpseditor/libwps/src/api.h                      |   43 --
 utils/wpseditor/libwps/src/proxy.c                    |   31 +-
 utils/wpseditor/libwps/src/include/backlight-target.h |    2 
 utils/wpseditor/libwps/src/include/rockboxlogo.h      |    1 
 utils/wpseditor/libwps/src/include/system-target.h    |    3 
 utils/wpseditor/libwps/src/lcd.c                      |   33 ++
 utils/wpseditor/libwps/src/dummies.c                  |   32 +-
 utils/wpseditor/libwps/src/proxy.h                    |    3 
 utils/wpseditor/libwps/src/api.c                      |  260 ++++++++----------
 utils/wpseditor/libwps/Makefile                       |   22 -
 utils/wpseditor/gui/src/qwpsdrawer.cpp                |   98 +++---
 utils/wpseditor/gui/src/qwpsdrawer.h                  |   22 -
 utils/wpseditor/gui/src/qwpsdrawer_static.cpp         |   58 ----
 13 files changed, 304 insertions(+), 304 deletions(-)

Comment by Maurus Cuelenaere (mcuelenaere) - Monday, 15 December 2008, 01:12 GMT+2
A frequent problem I've run into is: whenever the WPS source code changes, it requires changes to libwps/.

As this is rather inflexible, I would like to suggest an other approach for the WPS editor:
why don't we extend the existing UI simulator so it can get built as a lib and as an app (kinda like libwps) and build the WPS editor app around this lib, while still using SDL but integrated into Qt as a widget.

This would give the benefit that whenever something gets changed in apps/, obviously this shouldn't break uisimulator/ so it also won't break the WPS editor (compared to now, code should get checked whether it runs in the simulator and in wpseditor/libwps/).

Comments, thoughts?
Comment by Thomas Martitz (kugel.) - Monday, 15 December 2008, 02:09 GMT+2
It's sad to hear that it's not working as supposed to be. Wasn't it supposed to use Rockbox code and need a minimum of "sync's" the main tree?
Comment by Dominik Wenger (Domonoky) - Monday, 15 December 2008, 18:36 GMT+2
Using the a "simulator-lib" in the wps editor would probably be better.
Especially as the wps editor doesnt use the internal wps tree of rockbox, at the moment it uses rockbox code only for display.
Also such a simulator-lib could be used in other apps (for example a preview in rbutil, or for building tagcache).

So if someone has the time and motivation to change this, go forward !!

@ kugel: it uses rockbox code, but wraps it into a libwps, which needs maintainment when wps code changes.
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 28 December 2008, 01:49 GMT+2
This is a start at how I integrated the simulator into WPS editor.

It's functional as in running the simulator from within WPS editor, but that's it atm.
The WPS editor can't get the simulator to load specific WPS files nor can it control its state.
   wpseditor_sim.diff (25 KiB)
 uisimulator/sdl/uisdl.c                       |   44 +++++
 tools/configure                               |   13 +
 utils/wpseditor/wpseditor.pro                 |    4 
 utils/wpseditor/gui/gui.pro                   |    1 
 utils/wpseditor/gui/src/qwpsdrawer.cpp        |  204 ++++++++++++--------------
 utils/wpseditor/gui/src/qwpsdrawer.h          |   60 ++++---
 utils/wpseditor/gui/src/qwpsdrawer_static.cpp |   97 ------------
 utils/wpseditor/gui/src/qwpseditorwindow.cpp  |    8 -
 utils/wpseditor/gui/ui/mainwindow.ui          |  104 ++++++++++---
 9 files changed, 266 insertions(+), 269 deletions(-)

Loading...