Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 08-31-2011, 02:24 AM   #1
TJW
Enthusiast
TJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipediaTJW knows more than wikipedia
 
Posts: 27
Karma: 47504
Join Date: Aug 2011
Device: Kindle DXG
DirectFB/Gtk+/WebKit on DXG

The following links contains the binary files of DirectFB, Gtk+ , WebKit and related shared libraries for Kindle DXG, back ported from Kindle 3 source code release.
WebKitGtkKindleDXG.tar.xz (19M)

Usage:
  1. ssh to your kindle
  2. Extract the tar files into a loop file system and mount it on /usr/local. The size of the loop file system should be at least 100M.
  3. cp -r /usr/local/root /var/tmp
  4. /usr/local/bin/gwebkit
  5. you should see debugging messages running and the browser should appear in a while showing a local html file.
  6. use Shift-arrow to move mouse cursor.
  7. use keypad select to simulate mouse button click (only works in the browser window.)
  8. Sym and Shift-Sym to navigate through links and inputs.
  9. Alt-l to update screen, Alt-a Alt-z to zoom. Alt-x to exit.
  10. Menu to jump to uri input box. (then use arrow keys and Sym to escape from the uri input box)
  11. the GtkLauncher has a command line option -d turing, to set the screen size to be 600x800.
This browser is only a prototype and served as a demo. It can surf the web via free 3G network. However, it is intentionally to cripple the functionality so that you will have to enable it manually and take the full responsibility.
Even without 3G network, web browser works very well as an alternative UI and application platform for Kindle. It can be used as a viewer for ebooks in html format, or an image viewer if you are willing to write some javascript code.
There are also other applications come with the tar ball you may wish to try.
  • gtk-demo
  • leafpad a text editor
  • gtkterm2 a terminal emulator
  • vte a terminal emulator
  • gqview image viewer (not working for me)
  • cl (curl)
For example, you can execute gtk-demo using the following command:
LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/gtk-demo
To use vte and gtkterm2, you need to put termcap file in /etc.
--------------------------------------------------------------------------------------------------
I made some change into the source code.
  1. modified keyboard map, so that DircetFB and Gtk+ can handle the DX arrow keys correctly. I also made the Sym key works like Tab key.
  2. merge a simple Kindle dirty call back into Gdk source code so that many Gtk+ application can be build out of box.
  3. I use unmodified and newer Cairo, pango, gnutls instead of those in Kindle 3 source tree. libsoup comes with kindle 3 does not play well with newer version of gnutls. So I modified the source code of libsoup a little bit.
  4. SVG support is disabled.
The modified source code can be found in src directory of the tar ball.
If you can read traditional Chinese, more detail can be found at
http://weijr-note.blogspot.com/2011/...kindle-dx.html
TJW is offline   Reply With Quote
Old 12-29-2012, 10:21 PM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
This is excellent work. surprised it didn't get more attention. appreciation from me.
https://github.com/tjwei/WebKitGtkKindleDXG is a worthy touchstone.

Thanks again


QUOTE:::

(If you dont read chinese) This is a very rough translation...
Quote:
WebKit Kindle DX backport
Kindle DX netfront browser worthy, but many pages could not be read.

For example, my blog home page appears insufficient memory message page rendering effects, although it seems very fresh and clean, but the DX screen 824x1200 resolution enough to display the full page.
Overall, or the the Kindle browser preferred. A practice directly DX execution kindle 3 operating system . Very amazing, actually no problem. But since kindle is based on the open source release of the revised code, so I try to be ported to the dx kindle 3's webkit.
The preliminary results are as follows:



It is not complete, but at least able to play in google search, display some pages.

The process is Directfb -> Gtk + -> WebKit

Compilation environment; scratchbox
toolchain is glibc2.5 2007q1. Although libstdc + + and kindle dx incompatible , but 2006q3 too old, it is difficult to compile. And gtk + with C instead of C + + webkit Although C + + but not used libstdc + + but comes with a library, so not a big problem. The android extremely poor C + + runtime seen. Because apparently the same WebKit based Android web browser without complete libstdc + +. So the toolchain of glibc2.5 should be all OK.

Scratchbox i386 binary, kernel vdso32 = 0 parameter to increase the amd64 linux, otherwise there will be Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) ph-> the p_vaddr == error
The My cputransp not up and running, so I have compiled a static linked x64 qemu-arm. Then write a wrapper eat binfmt feed come - sbox parameters. In addition to the the pthread outside, it seems no problem. Ran configure some pthread test program will not stop down, maybe qemu problem. When encountered this problem, are manual to modify configure.in inside test program, he directly through.
I broke a 200mb of the ext3 loop filesystem, mount to the /usr/local/mnt/us. After just set ld.so or set LD_LIBRARY_PATH = /usr/local/lib can not affect the original system.


Compile DirectFB
With kindle 3 source. Set - prefix=/usr/local, gfxdriver=none
When to compile required jepg and libpng, set the - prefix=/usr. libpng version 1.2. I had temporary police with libpng 1.4 amending the little DirectFB of code libpng 1.2 compatibility issues, but also additional install the libpng 1.4 to the /usr/local
The compiler does not have any problems, then /usr/local copy to kindle complete the installation. Can use ssh + tar or ssh mount to copy files.
kindle eink framebuffer 4bit grayscale can not be directFB to direct support, so I had to use as indirect fb. If you take 0.5 seconds to think about how to solve this problem, here you will be found that the amazon's lab126 want the solution you. He spent a LUT8 (8bit indexed color) virtual framebuffer to pretend is true the frame buffer, and then will be able to successfully construct the DirectFB. Next, as long as trying to get virtual pass on to the frame buffer and the real frame buffer. lab126 is a call back to the user program to decide how to deal with. From the code, lab126 for frame buffer address seems a little insurance.
the kindle 3 eink more than the DX update eink screen several ways.
the lab126 version DirectfB basically have to take into account the DX keys, in addition to a keymap file. So you want to modify this file, or after some key problems. I am the way, the Sym key as Tab.
Use no-vt mode execution. No-vt ~~ /. Directfbrc the inside.

Compile GTK +
Compile basically not much of a problem, but it is complicated. Some kindle 3 source no autogen.sh or configure aclocal && autoconf && automake. Is not enough to catch the copy of the same version of genuine source, then copy past lab126 version.
DX's glib is too old to get hold of the new version to the /usr/local. In scratchbox, I am also the way to a new version of glib installed to /usr/compiled after more relaxed. Although no rationale to gtk-doc does not seem installed to /usr/ , automake grasp unlikely to.

Although often can be turned off when configure gtk-doc, but sometimes need autogen, do not install a gtk-doc to pass the test. autogen should be designed to simplify the problem, rather than to the question of increase.
automake the versions use SBOX_DEFAULT_AUTOMAKE set to 1.9. Otherwise there will be tar-ustar error.
Compiled directly execute gtk-demo will appear like the case here . I practice in gdk_init inside plus the own kindle dirty rect callback, and to change flies box update eink screen. So, gtk-demo can be displayed properly.
Directfb's keymap in front did not change the situation will occur inside the up and down keys can not be used in gtk-demo.

I met the fonts into the grid this problem. google query to, it seems that some pango + of cairo combination of this happens, so I will be pango and cairo replaced the slightly newer version. lab126 cairo code has been modified, but it looks just hack some font information is not a fatal problem, so I directly using correction board.
I set gtkrc-2.0, so that the font bigger set fontconfig to use the /usr/java/lib/fonts corresponding font.
In addition to the gtk-demo, I tried leafpad, gtkterm, gqview. the leafpad and gtkterm can compile correctly executed but the window you want to modify or set larger point, the best full-screen. The reason is that the gtk cursor in the middle of the screen, If gtk Programs window is too small, because the mouse is not in the window and not catch keyboard focus. This is probably the directfb wm's characteristics. the gqview also executable and operation, but it seems graphical display. gtkterm need vte, compile vte time, need termcap. The ncurses replace termcap line, but ncurses I compiled it up, do not bother to get. In addition to gtkterm, vte itself should also be able to run. Vte based terminal can be a big advantage compared to kindle on the other terminal program display correctly display utf8 Chinese. LXDE's gpicview Although the advertised pure gtk but in fact useful to X11. Alone gdkx.h bad enough, which is useful to the X11 file, so I can not directly compile. gedit need gtksourceview bunch of looks too complicated, you do not really get it.

WebKit
View kindle the Changelog in 3 source code, to May 18, 2009, so the download webkit r43841.
Untie will kindle 3 inside the modified source copy and covering the past.
Modify configure.ac, default directfb become. Because this option does not seem to build-webkit.
The execution WebKitTools/Script/build-webkit - gtk, I choose to shut down xslt unwanted option.
make the process error because some. h file did not put on the position. Can to modify GNUMakefile source, or to properly position. H ln-s. In short, according to personal preference, so that he compiled in the past it wants to.
There are some errors kindle profiling, I deleted directly related part.
The link of GtkPerf will be a problem should .libs/libWebcore.a into the box.
make install /usr/local copy to kindle on the line.
The series out GtkLauncher be able to execute, but kindle the proxy requires special x-fsn http header, we do not yet Internet. You can try GtkLauncher Browse the kindle inside local files, use the full file name. If you only see the html source code, it is because there is no mime data. Your computer inside /usr/share/mime copy can go kindle.
Webkit settings for this version does not support user-agent to modify, and also does not support proxy not to support custom http header, so modify the code to send the appropriate header and use the proxy.
Modify the be modified GtkLauncher lab126 code, let urlbar displayed.
urlbar can enter, but can not enter text google search box. Google query, ICU problems. I use ICU 3.6, in scratchbox unable to successfully compile because pkgdata unable to perform. I modify the makefile, pkgdata smooth execution, to complete the make. But apparently I missed something. In accordance with the way here , to be recompiled. At this time, the input box will be able to enter.

I do not know how to use the keyboard complete the operation, GtkLauncher, even if open caret browsing, do not know how to operate, also need to modify the interface. Chinese input method is not integrated into it.

Last edited by twobob; 12-30-2012 at 10:44 AM.
twobob is offline   Reply With Quote
Old 01-04-2013, 12:19 PM   #3
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Okay so I thought I would do a quick - on a 3 howto...

Get the files. Un-zip. Un-Tar.

(on the PC)

mkdir -p ~/webkitgtk
cd ~/webkitgtk


dd if=/dev/zero of=~/webkitgtk/webkit.ext3 bs=1M count=150
mkfs.ext3 ~/webkitgtk/webkit.ext3
sudo tune2fs -i 0 -c 0 ~/webkitgtk/webkit.ext3


now mount it and shove the stuff in it that you unzipped...
mkdir -p /mnt/loop
sudo mount -o loop -t ext3 ~/webkitgtk/webkit.ext3 /mnt/loop


cp -r (location of unzipped stuff)/* /mnt/loop/

sudo umount /mnt/loop

ssh root@<kindleIP> mkdir -p /mnt/us/webkitgtk
scp ~/webkitgtk/webkit.ext3 root@<kindleIP>:/mnt/us/webkitgtk/webkit.ext3


That should cover the first bit...

then on the kindle...

[root@kindle us]# mount -o loop -t ext3 /mnt/us/webkitgtk/webkit.ext3 /usr/local
[root@kindle us]# cp -r /usr/local/root /var/tmp
[root@kindle us]# /usr/local/bin/gwebkit
Quote:
starting webkit
That should get you close enough to play around...

Enjoy!!!

EDIT: If you really want to look at the browser full size?

check your $LD_LIBRARY_PATH contains /usr/local/lib

[root@kindle root]# echo $LD_LIBRARY_PATH
Quote:
/mnt/us/usr/lib:/usr/local/lib:/usr/lib:/lib:/mnt/us/lib
Then you can run

[root@kindle root]# GtkLauncher -w 600 -h 800 http://mobileread.com
Attached Thumbnails
Click image for larger version

Name:	ImageMagick: root.fb.pgm_069.png
Views:	72
Size:	74.1 KB
ID:	98751   Click image for larger version

Name:	ImageMagick: root.fb.pgm_070.png
Views:	60
Size:	68.7 KB
ID:	98752   Click image for larger version

Name:	ImageMagick: root.fb.pgm_071.png
Views:	50
Size:	69.2 KB
ID:	98755   Click image for larger version

Name:	ImageMagick: root.fb.pgm_094.png
Views:	51
Size:	76.5 KB
ID:	98907   Click image for larger version

Name:	ImageMagick: root.fb.pgm_096.png
Views:	48
Size:	83.6 KB
ID:	98908   Click image for larger version

Name:	ImageMagick: root.fb.pgm_095.png
Views:	40
Size:	26.5 KB
ID:	98909  

Last edited by twobob; 01-06-2013 at 12:01 PM.
twobob is offline   Reply With Quote
Old 01-04-2013, 12:58 PM   #4
knc1
Embedded Cheerleader
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,378
Karma: 5840126
Join Date: Feb 2012
Device: Too many.
Super!
All the little pieces are starting to come together.
knc1 is offline   Reply With Quote
Old 01-04-2013, 03:10 PM   #5
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by knc1 View Post
Super!
All the little pieces are starting to come together.
Yeah. this needs reverse engineering from source patches in GIT one day.

OR butchering a bit to get its weight down.

however these are exactly the bits I was after so great news for the 3 crowd
twobob is offline   Reply With Quote
Old 01-04-2013, 07:44 PM   #6
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Just enough to give us keys support and eink updates...

Butchery complete?

Caveats: I did not look to include webkit support in this extraction.

Just enough libs to add native eink updates to gtk application OOTB with minimal impact to the devices.

Attached: extracted libs and etc files for /mnt/us/local (taken from inside this lot)
In the absence of an installer...

usage.

(transfer to device, untar as /mnt/us/local/)

mntroot rw
cd /usr/local
ln -s /mnt/us/local/etc etc
ln -s /mnt/us/local/lib lib


chmod a+x /usr/local/bin/gtkinit
mntroot ro

To Initialise:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
gtkinit

That should be enough EXTRA FILES to get a gtk compiled application using THIS METHOD running nicely on the 3... no loopmounts, no big space waste, and a place to shove usr libs neatly under FAT.

There may be a requirement to provide other files... If so I may re-release with the complete support - the idea is to reuse as many of the original libs as possible...

Note: The
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
command needs to be included in the shell running the app (and any sub-shells you expect to have access to the libs)

you could easily do this in a launch shell script. or include it by default through amending your system details via a .bashrc or whatever you prefer.

The gtkinit command would need to be invoked once per reboot at a minimum to load the /tmp/root

For my purposes this is enough from this project to provide the little stepping stone required on the 3's over the native gtk invocations.

If this helps you too? then great.

Pictured it running a custom app. cheers.

If I missed a lib nudge me. Works okay on mine now.


CHANGES:

0.1 added cairo libs.
embedded init script
Attached Thumbnails
Click image for larger version

Name:	ImageMagick: root.fb.pgm_072.png
Views:	66
Size:	23.5 KB
ID:	98786  
Attached Files
File Type: gz local-V0.1.tar.gz (8.09 MB, 36 views)

Last edited by twobob; 01-04-2013 at 08:39 PM. Reason: links, gtkinit
twobob is offline   Reply With Quote
Old 03-07-2013, 12:04 AM   #7
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021142
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
cheering myself up doing silly things

Code:
#!/bin/sh
mkdir -p /var/tmp/root
rm /var/tmp/root/.directfbrc
echo no-vt > /var/tmp/root/.directfbrc
#echo disable-module=keyboard > /var/tmp/root/.directfbrc
#echo disable-module=ps2mouse > /var/tmp/root/.directfbrc
echo linux-input-devices=/dev/input/event0,/dev/input/event1 >>/var/tmp/root/.directfbrc
rm /var/tmp/root/.gtkrc-2.0
echo gtk-font-name=\"sans 10\" > /var/tmp/root/.gtkrc-2.0

directfbrc file could contain:
system = fbdev
fbdev = /dev/fb0

mode = 600x800
scaled = 600x800
depth = 8
pixelformat = LUT8
no-cursor # Disable Cursor
no-init-layer = 0 # Disable Layer Initialization
no-vt # Disable vt
no-vt-switch # Don't allow vt switching (redundant?)
smooth-upscale # Scaling
smooth-downscale
window-surface-policy = systemonly # Window surface swapping policy:
desktop-buffer-mode = backsystem # Desktop buffer mode:


NOTE: want to find this:
Vince's patch for armasm_memcpy().
memcpy=armasm # Use the ARM optimized memcpy() <-- Hmm might look at this RSN
Attached Thumbnails
Click image for larger version

Name:	Selection_092.png
Views:	70
Size:	56.4 KB
ID:	102467  

Last edited by twobob; 03-07-2013 at 12:09 AM. Reason: stuff
twobob is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kindle directfb tutorial fbdev Kindle Developer's Corner 16 06-11-2014 01:14 PM
Getting SDL to work on DirectFB B_Lizzard Kindle Developer's Corner 13 10-01-2012 12:42 PM
directfb fbdev Kindle Developer's Corner 5 12-16-2011 09:57 PM
Cross-compilation question--building directfb mark03 Kindle Developer's Corner 4 06-20-2011 11:59 AM
iLiad What if iLiad adopts GTK on DirectFB? ericshliao iRex Developer's Corner 1 01-26-2008 05:36 AM


All times are GMT -4. The time now is 08:00 PM.


MobileRead.com is a privately owned, operated and funded community.