Re: [PATCH] get_wwindow_image_from_wmhints scale image

2012-11-17 Thread Rodolfo García Peñas
On Thu, 15 Nov 2012, BALATON Zoltan escribió:

 On Wed, 14 Nov 2012, Rodolfo García Peñas wrote:
 Then, the image can be resized using wIconValidateIconSize(). The resize
 should be done in get_rimage_icon_from_wm_hints(), not in the function
 get_wwindow_image_from_wmhints(). This is because the function
 get_wwindow_image_from_wmhints() is used in wIconStore() too. If we resize
 the image before save it to disk, then if we change the icon/dock size, then
 the image saved will have a different size than the curren icon size. Is
 better resize the image when is painted in the screen, not the image saved.
 
 Thanks a lot for fixing all this. I couldn't really follow all your
 changes so I'm not sure how it all works now so here are some
 questions/thoughts. I think you've thought about these already but
 asking it just in case:
 
 - This does not mean that the image is resized every time it is
 painted, does it? If yes then it may be faster to check the size of
 the cached image before using it and remove it when the icon size
 has been changed.
 
 - Images are also enlarged when they are too small? This may look
 bad so probably there could be a limit (say no more than 2x) or only
 scale down images if they are too big but never enlarge them.
 
 - Is it possible to change icons of applications without restarting
 them (the Apply button in the inspector is working) and does the
 ignore client supplied icon option work?

Hi,

please, test the patches just I sent.

Carlos, please, make a deep test before uploading it. I think the patches are 
ok, but I can make a deep checking at this moment. Feel free to rebase them or 
change the apply order, commit info,...

The main change is that wIconUpdate can receive the icon. Then 
wIconChangeImageFile can set the image without using the icon database (Domain).

Cheers.
kix
 
 Regards,
 BALATON Zoltan


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


Re: [PATCH] get_wwindow_image_from_wmhints scale image

2012-11-17 Thread BALATON Zoltan

On Fri, 16 Nov 2012, Rodolfo García Peñas (kix) wrote:
I am busy these days :-( a lot of work. I will try to release the patch about 
winspector these weekend. Sorry for the delay.


No problem, do it when you have free time, it can wait until you can work 
on it.


Therefore, the image is resized (if needed) only one time when the 
application is running.


This sounds good. Thanks for the explanation.


- Images are also enlarged when they are too small? This may look bad
so probably there could be a limit (say no more than 2x) or only scale
down images if they are too big but never enlarge them.


No. But could be easy to implement. Now, all image resize is done at 
wIconValidateIconSize(). This function is quick, because see the image width 
and height and resize it only if the image is bigger than the icon size.


If you want it, I can do it. I am not sure about the quality of the resize 
image, but I think wrlib includes some functions to do it fine.


I don't know how much of a problem can this be practically so I let you 
decide about it. Just brought up this for consideration as I was thinking 
about it. If it can be done easily anytime we see a practical example it 
may be good enough as it is and could be fixed when we have a bug report 
in the future.


Yes. I am working in the patch. I will try to release the patches this 
weekend.


Thanks again.

Regards,
BALATON Zoltan

Re: [PATCH] get_wwindow_image_from_wmhints scale image

2012-11-16 Thread kix

On 2012-11-15 03:32, BALATON Zoltan wrote:

On Wed, 14 Nov 2012, Rodolfo García Peñas wrote:
Then, the image can be resized using wIconValidateIconSize(). The 
resize
should be done in get_rimage_icon_from_wm_hints(), not in the 
function

get_wwindow_image_from_wmhints(). This is because the function
get_wwindow_image_from_wmhints() is used in wIconStore() too. If we 
resize
the image before save it to disk, then if we change the icon/dock 
size, then
the image saved will have a different size than the curren icon 
size. Is
better resize the image when is painted in the screen, not the image 
saved.


Thanks a lot for fixing all this. I couldn't really follow all your
changes so I'm not sure how it all works now so here are some
questions/thoughts. I think you've thought about these already but
asking it just in case:


Hi!,

I am busy these days :-( a lot of work. I will try to release the patch 
about winspector these weekend. Sorry for the delay.



- This does not mean that the image is resized every time it is
painted, does it? If yes then it may be faster to check the size of
the cached image before using it and remove it when the icon size has
been changed.


Yes and no. There are two steps in the image usage:

1. Read the file/X11/... and load the image in icon-file_image 
(wIconUpdate)
2. Paint the image. Read the icon-file_image and paint it in the 
screen as pixmap (update_pixmap() or something like).


Things:
- Now, the image at wIconUpdate (step 1) is only changed when is loaded 
first time and if the image changes.
- The image is painted and painted (step 2) multiple times in the 
wmaker session, for example selecting windows,..
- The image resize is done in the process at wIconUpdate, so is only 
resized when the image is loaded or changed, not when is painted.


Therefore, the image is resized (if needed) only one time when the 
application is running.


The image is not resized when it is saved as cache icon. Why? because 
if we change the icon size, then the caché image has a wrong size.



- Images are also enlarged when they are too small? This may look bad
so probably there could be a limit (say no more than 2x) or only 
scale

down images if they are too big but never enlarge them.


No. But could be easy to implement. Now, all image resize is done at 
wIconValidateIconSize(). This function is quick, because see the image 
width and height and resize it only if the image is bigger than the icon 
size.


If you want it, I can do it. I am not sure about the quality of the 
resize image, but I think wrlib includes some functions to do it fine.



- Is it possible to change icons of applications without restarting
them (the Apply button in the inspector is working) and does the
ignore client supplied icon option work?


Yes. I am working in the patch. I will try to release the patches this 
weekend.



Regards,
BALATON Zoltan


Thanks a lot for your comments/ideas.
kix
--
||// //\\// Rodolfo kix Garcia
||\\// //\\ http://www.kix.es/


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


Re: [PATCH] get_wwindow_image_from_wmhints scale image

2012-11-14 Thread BALATON Zoltan

On Wed, 14 Nov 2012, Rodolfo García Peñas wrote:

Then, the image can be resized using wIconValidateIconSize(). The resize
should be done in get_rimage_icon_from_wm_hints(), not in the function
get_wwindow_image_from_wmhints(). This is because the function
get_wwindow_image_from_wmhints() is used in wIconStore() too. If we resize
the image before save it to disk, then if we change the icon/dock size, then
the image saved will have a different size than the curren icon size. Is
better resize the image when is painted in the screen, not the image saved.


Thanks a lot for fixing all this. I couldn't really follow all your 
changes so I'm not sure how it all works now so here are some 
questions/thoughts. I think you've thought about these already but asking 
it just in case:


- This does not mean that the image is resized every time it is painted, 
does it? If yes then it may be faster to check the size of the cached 
image before using it and remove it when the icon size has been changed.


- Images are also enlarged when they are too small? This may look bad so 
probably there could be a limit (say no more than 2x) or only scale down 
images if they are too big but never enlarge them.


- Is it possible to change icons of applications without restarting them 
(the Apply button in the inspector is working) and does the ignore client 
supplied icon option work?


Regards,
BALATON Zoltan