Monday, August 14, 2006

X level solution for VKB and Minimo interaction

These days I have been in touch with some low level (at least in my option) code. I've gone deeply down toward the "ugly" X level programming. Lots of Display, Window, RootWindow, Atom , blablabla ...

Anyways, it was good to have an idea about it , and mainly because through this I got the built-in maemo's virtual keyboard popping up/hiding when focus in/out event occur on minimo, without any gtk-based stuff.

Follows some lines of code that popup vbk manually for you:

(...)
// same as XOpenDisplay (0)?
Display *display = GDK_DISPLAY ();
if (!display) return ;

Atom hildonWindow;

hildonWindow = XInternAtom (display, "_HILDON_IM_WINDOW", true); // original code from Tim.

static char *XAtomNames[] = {"WINDOW"};
static Atom XAtoms[ARRAY_LENGTH(XAtomNames)];

// get needed atoms
XInternAtoms(display, XAtomNames, ARRAY_LENGTH(XAtomNames), False, XAtoms);

if (hildonWindow != None) {
Atom atomType;
int atomFormat;
int res;
unsigned long atomItems;
unsigned long atomBytes;
unsigned char* atomProperties;
::Window imWindow;

// this code fragment, I can get from widget/src/gtksuperwin/gtkmozarea.c:310
// gdk_property_get ?????
res=XGetWindowProperty(display,
RootWindow (display,XDefaultScreen(display)), hildonWindow, 0, 1, false, XAtoms[0],
&atomType, &atomFormat, &atomItems, &atomBytes, &atomProperties);

if (res!=Success || atomProperties==NULL) {
std::cout << "Cannot get IM window" <<>

imWindow=reinterpret_cast< ::Window*>(atomProperties)[0];
std::cout << "Acquire " <<>window << " " <<>

::XEvent event;

memset(&event,0,sizeof(event));
event.xclient.type=ClientMessage;
event.xclient.window=imWindow;
event.xclient.message_type=XInternAtom(display,"_HILDON_IM_ACTIVATE",False);
event.xclient.format=8;
// event.xclient.data.l[0]=RootWindow (display,XDefaultScreen(display));
// event.xclient.data.l[1]=RootWindow (display,XDefaultScreen(display));
event.xclient.data.l[2]=0x08;
event.xclient.data.l[3]=0x00400007;
event.xclient.data.l[4]=0;
if (XSendEvent(display,imWindow,False,NoEventMask,&event)==0) {
std::cerr << "Error while sending vk-1" <<>

event.xclient.message_type= XInternAtom(display,"_HILDON_IM_ACTIVATE",False);
event.xclient.data.l[2]=0x09;

if (XSendEvent(display,imWindow,False,NoEventMask,&event)==0) {
std::cerr << "Error while sending vk-7" <<>
} // end

(...)

ps: I got great support on this coming from Tim (nice German guy) who is also porting a non-gtk application to maemo 2.0. Most of the code above comes from his Illumination app.

--Antonio Gomes

Tuesday, July 25, 2006

minimo special effort (part II) - update

After releasing 3 RC .debs of the maemo/nokia 770 minimo port, and having got lots of feedback, bugs and suggestion, I decided to blog about them. Follows what I think are the most relevant issues to be done:
  • fix browsing through security site (PARTIALLY DONE - mail.yahoo.com(.xx) works with some magic tricks only).
  • implement an easy way to leave fullscreen mode (DONE - via bottombar).
  • improve input fields and virtual keyboard interaction.
  • autocomplete widget forces you to click twice to remove focus from it (maybe this is no device specific bug, I have to file this into bugzilla)
  • improving my way of packing up: set up a repository for minimo and its dependecies missing on maemo 2.0 image.
  • make all patches available asap.

  • implement 770 Hardware keys support (e.g. ZOOM_IN crashes it)
  • implement timers to context sensitive menus (it works only on x86 through right-button mouse click - have to file this as a bug).
  • implement command line parser support bug 334019
  • implement dbus service for minimo. It would avoid having more then one instance of it running at the same time (btw, dbus-xpcom binding has been announced recently).
  • fix fs browsing support (it crashes when I type /usr or /etc - although it works for /etf/fstab)

  • improve ssr (css file) - it makes rendering extremely ugly if on SSR mode (disabled)
  • make default font bigger (possible adding an observer on preference system) (workarounded)
  • fix segfault on window closing.
  • maybe implement a portrait mode view ???
read - critical
blue - that'd be great
black - I could live without it

Other issues:

- gmaps misvisualizing - works for me, though.
- lacking of svg, mathml and cairo.
- testing rendering of some Chinese, Japanese and Arabian encoded websites (ah.sima ???)

any thinkg else ? just mail me.

I wish to have any fund on this :p, after all funding means time !

-- Antonio Gomes

Thursday, July 06, 2006

minimo 016.1 (maemo port) available - update

New minimo 016.1 .deb available. It's getting better ;)

$ more mozilla/debian/changelog

minimo (0.16.1-1) unstable; urgency=low

* Trunk updated (July 04)
* Automated build/packing initial version (build_minimo.sh , tarball ,
patches) working
* Fixed lack of entry on task navigator by adding StartupWMClass=minimo into
.desktop file. Minimizing it possible now :) - thanks henry.
* made default webpages font bigger
* made preferences/menus font bigger
* ssr (minimo/components/ssr) component temporarily disabled.

minimo (0.16.1-0) unstable; urgency=low

* added initial dbus-glib implementation, fixing the "system is killing me
after few seconds" problem.
* packed libXt, libSM and libICE together into .deb

shots






Please, any suggestion, bug report or whatever is welcome via comment, email or bugzilla .

ps: check menus at window right and left bottom corner for functionalities.

-- Antonio Gomes

Monday, July 03, 2006

minimo 016 .deb (beta/hack version)


I got minimo 016 packed into a preliminary-stage-.deb for maemo 2.0/armel. It's AI-able (installable via Application Installer or dpkg) and launchable via 'menu->extra->minimo'.
  • Main issues I am working on now for the next .deb:
    1. Currently, minimo does not add an entry into Task Navigator after launched, so MINIMIZING IT MIGHT GET YOU INTO PROBLEMS :)
    2. Security sites sometimes work sometime don't (on sbox/i386 it works all the time though).
    3. Typing from the vkb is possible: you can pop it up or hide it by keystroking "ENTER" (button in the middle of arrows).

minimo's port for nokia 770 is not close to be complete (lots to do yet) .

NOTE: This .deb is built over armel architecture, so it will not working on non-armel ones.

NOTE: In this current stage, reproduce by your own the steps I did to build this .deb might be a bit painful (manual process). But, I've been working on a script for automate all these hackings. The script will:
  • applying all required patches
  • build and pack it all.
NOTE: some missing libraries on Maemo 2.0 image were a problem.

Please, any suggestion, bug report or whatever is welcome via comment or email.

-- Antonio Gomes

Thursday, June 29, 2006

Some progresses on ARM

Ubuntu (dapper) is great for home using, but there is nothing better then our good and old friend Debian for devel :). While using Ubuntu as development platform, I was able to build minimo for i386 and arm, but always when I tried run it on n770/maemo2.0 it failed. Since then, I've been spending part of my rare free time producing debug builds, strace'ing it, blablabla and nothing 'till today.

So unintentionally I did it all again using a fresh debian sarge machine (set up with same toolchain, rootstraps, compilers). Follows the results:



cnn


brazilian soccer idols


minimo in fullscreen mode


minimo in fullscreen mode (and vkb popped up)



I am cleaning patches up just now and .deb is about to upload.

--Antonio Gomes

Sunday, June 25, 2006

arm'ing Minimo 016 ! What am I missing ?

My odyssey of make minimo 016 work on the n770 has began. After got it built on sbox/maemo2.0 for both i386 and arm, but running it on arm is being painful. That's where I am:
  • arm build - DONE
  • AI-installable .deb - DONE
  • source packing - DONE
    • menu item added on extra menu (am able to launch minimo from it on sbox/i386 only)
    • icon on task manager is not added after launch it, even on i386 !!!
  • initial dbus support - DONE
    • it is not killed by system when launched from menu on sbox/i386.
  • vkb synchronization - MISSING
  • CORE: minimo does not show up when on n770
    • maybe a libstdc++6 incompatibility ????
I've posted about it on maemo-dev mailing list, but nothing yet ? Btw, after a hand of some nice guys (jay and guilt from ITT) I got it working on IT 2005. Any hint ?

--Antonio Gomes

Thursday, June 15, 2006

minimo 016 on maemo2.0/sbox

good news: I got lots of my old stuff recovered after my laptop damaging 2 weeks later. This holiday, and during world cup matches :), I got back hacking minimo for maemo-2.0. Follows the situation currently:
  • dougt has launched minimo 0.16. WOW.
  • I applied some patches (psm + testgtkembed + packaging) into it and built/ran on sbox2.0b-i386.
  • odd build failing on arm. working on it.
Some nice screenshots:





--Antonio Gomes
http:// tonikitoo dot blogspot dot com