Icon creation in only one function
commite357e94896ba5dfb05dcc22b077a52e66eba4f9f
authorRodolfo García Peñas (kix) <kix@kix.es>
Mon, 8 Oct 2012 03:43:22 +0000 (8 05:43 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 8 Oct 2012 14:26:29 +0000 (8 15:26 +0100)
treecc58491bf017affa8ce549f6f6f453ff1d102698
parent952f6bfb1cee41d7c4b0962d0acf94d82d698715
Icon creation in only one function

This patch avoids the icon creation in winspector.c and adds the
ability of creating + paiting and unpainting instead of destroying the icon.

Now the icon is always created by wApplicationCreate and the icon
exists while the application is runnning. If the user doesn't want
an appicon the winspector.c will not remove the icon, it will only
not paint it on the screen. But the icon is still created.

Probably the most difficult part in this code is how to handle the
icons in the iconlist. We must include the icon in the iconlist when
it is painted, not when it is created. And it must be removed when it
is unpainted.

We can check if the icon is in the iconlist if icon->next AND icon->prev
are null, else it is on the applist. If it is included we must not
paint it again because the function PlaceIcon() will calculate a new
icon place in the screen including the icon!, then a hole is painted.
src/appicon.c
src/appicon.h
src/winspector.c