Thread: Re: [bme-develop] icon loading
Status: Planning
Brought to you by:
sirmik
|
From: Sir M. <obe...@ho...> - 2004-03-31 09:53:49
|
Hi, I think I'm going to rewrite the code a bit today so we only need tabs and spaces in the text file...maybe also write a BHandler to handle the icons...IconManager or something...My idea is this: the handler will be owned by the main application object and the windows will send messages to that app to request for: -the entire list of emoticon objects -a message item representing an entire text with emoticons in it -a bitmap for one part of text(can be used when typing text in a textbox and instantly changing that to emoticons) what do you guys think? >--in icon prefs file---- >/icons/standard/angel.png (a) (A) ; Angel >[...] >/icons/standard/wink.anim ;) ;-) ; Winking smiley >--------- Uhm, the file format is currently like this :D : /icons/standard/angel.png Angel ; (a) (A) like you suggested.... > >--in wink.anim---- >icons/standard/wink1.png 10 >icons/standard/wink2.png 50 >icons/standard/wink3.png 10 >0 >---------- > >Where the number after each frame represents the number of hundreths of >seconds to display the frame for, and the final 0 means to loop >forever. > We can do it like this....but why? If we do it like this we better use the gifs(get some gif animation code from the web)...I think converting gifs to a file like this is a lot of work, and we're just working around the problem, introducing another file format in stead of the gifs....anyway it can be done, but it's a lot of work... >Other news: > >I've finally got a BListItem class that does proper automatic text >wrapping, performance seems similar to a BTextView on resizing a lot of >items. > Nice work! have a screenshot? regards, Tim P.s. Daniel did you upload your latest code into cvs? _________________________________________________________________ Talk with your online friends with MSN Messenger http://messenger.msn.nl/ |
|
From: Sir M. <obe...@ho...> - 2004-04-02 10:56:16
|
aloha amigos :D, > > Hello guys, sorry I have not reply till now, it's been a busy week. > >No problem > Like Simon said in the interview at tbj, we're all busy people :D but then again I think we're progressing nicely.... >The BHandler should help with multithreading issues - the protocol >handlers or the conversation windows can simply target a BHandler with >a message, the BHandler can pick up the messages in order and parse >them in it's own thread (which owns all the icon data), then send a >parsed-text message back to the window. The other approach would be to >have a shared pointer passed around all the time, and I'm not too keen >on that approach - also I'm not sure how thread-safe it would be. > The reason Simon points out is the main reason. We also could handle all icon messages in the app's MessageReceived method, but that would be a mess. If we have a separate handler things are separated nicely. Also if the code works, other IM projects just have to plug in the Handler in to their code and they will have emoticon support. The multi-threading issues weigh more heavily though. >The GIF translator only decodes the first frame of any animated images. >Actually drawing them shouldn't be a problem (I have a few ideas on >that), once we have a list of BBitmaps for each of the frames in the >animation. > It's a shame the translation kit can't deal with more complex format's like animated gifs, and vector image formats...Btw, Simon, about that list of BBitmaps...we'll also need something to store the delays between frames, won't we? I think that also should be in the emoticon object... > >I've also just made it much more lightweight, so resize performance far >exceeds BTextView (I've tested a BListView with 15000 NetListItems like >in the screenshot - still resizes in real time). Memory usuage is high >though (the width of every character is cached), so I might try a >compromise. > As I said, nice! btw Simon, I don't now for sure how you're dealing with those character sizes...but would it be possible to store only the character widths in an array? I think utf-8 hasn't to much characters, if I'm not mistaken, it is encoded as a byte, right? so we have 256 characters, if you store those 256 character lengths in an array, you needn't store that much information...and you can use these 256 lengths to calculate the length of the entire string...or am I completely mistaken? (and visualizing this too simple) > > Not yet... mmm... I have made some changes in the Network handlers > > code, change some things to get p2p messages again (somehow it got > > broken when I changed to BLoopers), and a few other changes. So far.. > > looks good! There might be an improvement on stability ... maybe.. > > je, > > I need you guys to test it because you do a better work on testing > > than > > I :D . > >lol no problem. > hehe, I think it's because we use it a lot, especially, now since I'm almost using beOS and bme all day....Do those p2p messages also have something to do with bme crashing when chatting with someone who uses the latest windoze msn? btw, great work! > > I promise I will get it up there on friday evening (my time). > > Ok, so we'll have the code by saturday morning, thnx! > > Good work team!! > >Yay! > Group hug :D! Tim _________________________________________________________________ Hotmail en Messenger on the move http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/ |
|
From: Simon T. <sim...@ga...> - 2004-04-02 17:53:06
|
[snip] > >The GIF translator only decodes the first frame of any animated > > images. > >Actually drawing them shouldn't be a problem (I have a few ideas on > >that), once we have a list of BBitmaps for each of the frames in the > >animation. > > > It's a shame the translation kit can't deal with more complex > format's like > animated gifs, and vector image formats...Btw, Simon, about that list > of > BBitmaps...we'll also need something to store the delays between > frames, > won't we? I think that also should be in the emoticon object... Yes, I had thought of that, but forgot to mention it to you. It should be part of the emoticon object, yes. > > > >I've also just made it much more lightweight, so resize performance > > far > >exceeds BTextView (I've tested a BListView with 15000 NetListItems > > like > >in the screenshot - still resizes in real time). Memory usuage is > > high > >though (the width of every character is cached), so I might try a > >compromise. > > > As I said, nice! btw Simon, I don't now for sure how you're dealing > with > those character sizes...but would it be possible to store only the > character > widths in an array? I think utf-8 hasn't to much characters, if I'm > not > mistaken, it is encoded as a byte, right? so we have 256 characters, > if you > store those 256 character lengths in an array, you needn't store that > much > information...and you can use these 256 lengths to calculate the > length of > the entire string...or am I completely mistaken? (and visualizing > this too > simple) Yes, you are completely mistaken! UTF-8 encodes the entire unicode character set, some 16,000 or so characters I think. Although only a subset are used. Even so, caching the width of individual characters would mean every time you need to calculate word wrapping, you would have to loop through the string, look up each individual character's width, and add them together. I currently store the width up to that character number in an array, and have a seperate array for the width up to the next preffered wrap point (space, dash, etc). I'm thinking of getting rid of the individual character caching, and just keep the wrap-point caching. Speed will still be blazing fast until the window is small enough that a single long word has to be wrapped in the middle. Then that will require app server calls, so will slow down. But I think for the majority of cases that would work fine and would save a lot of memory too. > > > Not yet... mmm... I have made some changes in the Network > > > handlers > > > code, change some things to get p2p messages again (somehow it > > > got > > > broken when I changed to BLoopers), and a few other changes. So > > > far.. > > > looks good! There might be an improvement on stability ... > > > maybe.. > > > je, > > > I need you guys to test it because you do a better work on > > > testing > > > than > > > I :D . > > > >lol no problem. > > > hehe, I think it's because we use it a lot, especially, now since I'm > almost > using beOS and bme all day....Do those p2p messages also have > something to > do with bme crashing when chatting with someone who uses the latest > windoze > msn? btw, great work! I experienced that crash today too. > > > I promise I will get it up there on friday evening (my time). > > > > Ok, so we'll have the code by saturday morning, thnx! > > > > Good work team!! > > > >Yay! > > > Group hug :D! lol > Tim Simon |
|
From: Simon T. <sim...@ga...> - 2004-03-31 13:17:49
|
> Hi, > > I think I'm going to rewrite the code a bit today so we only need > tabs and > spaces in the text file... OK. > maybe also write a BHandler to handle the > icons...IconManager or something...My idea is this: the handler will > be > owned by the main application object and the windows will send > messages to > that app to request for: > -the entire list of emoticon objects > -a message item representing an entire text with emoticons in it > -a bitmap for one part of text(can be used when typing text in a > textbox and > instantly changing that to emoticons) > > what do you guys think? I agree with a BHandler owned by the be_app, that sounds fine. I think we need a class to parse text that is passed a simple char * or BString of a bit of text, and returns some kind of custom structure containing processed text - ie the raw characters along with emoticons and thier offsets, plus maybe url detection and things like that. > >--in icon prefs file---- > >/icons/standard/angel.png (a) (A) ; Angel > >[...] > >/icons/standard/wink.anim ;) ;-) ; Winking smiley > >--------- > Uhm, the file format is currently like this :D : > /icons/standard/angel.png Angel ; (a) (A) > like you suggested.... Ah good, I was trying to make my example match the current format. > > > >--in wink.anim---- > >icons/standard/wink1.png 10 > >icons/standard/wink2.png 50 > >icons/standard/wink3.png 10 > >0 > >---------- > > > >Where the number after each frame represents the number of hundreths > > of > >seconds to display the frame for, and the final 0 means to loop > >forever. > > > We can do it like this....but why? If we do it like this we better > use the > gifs(get some gif animation code from the web)...I think converting > gifs to > a file like this is a lot of work, and we're just working around the > problem, introducing another file format in stead of the > gifs....anyway it > can be done, but it's a lot of work... How else are we going to load the animated images? The translation kit doesn't support animated images, and I couldn't find a free library on the web to handle reading GIFs (probably due to patent restrictions of the GIF format). If you have easier ideas that will work, by all means implement them! > >Other news: > > > >I've finally got a BListItem class that does proper automatic text > >wrapping, performance seems similar to a BTextView on resizing a lot > > of > >items. > > > Nice work! have a screenshot? http://si-msn.port5.com/bme2.png > regards, > > Tim Simon > P.s. Daniel did you upload your latest code into cvs? |
|
From: Daniel G. <al7...@ma...> - 2004-04-02 07:15:15
|
Hello guys, sorry I have not reply till now, it's been a busy week. > > maybe also write a BHandler to handle the > > icons...IconManager or something...My idea is this: the handler > > will > > be > > owned by the main application object and the windows will send > > messages to > > that app to request for: > > -the entire list of emoticon objects > > -a message item representing an entire text with emoticons in it > > -a bitmap for one part of text(can be used when typing text in a > > textbox and > > instantly changing that to emoticons) > > > > what do you guys think? > > I agree with a BHandler owned by the be_app, that sounds fine. I > think > we need a class to parse text that is passed a simple char * or > BString > of a bit of text, and returns some kind of custom structure > containing > processed text - ie the raw characters along with emoticons and thier > offsets, plus maybe url detection and things like that. > It sounds ok, but does it really need to be a BHandler, why not just a Class with some methods to do the parsing, load the images, convert strings to icon enabled messages, etc. What are the benefits of using a BHandler instead of just regular class? Don't get me wrong, I am not saying it's a bad idea, just want to know the reasons why either approach would be better. > > > > > >Where the number after each frame represents the number of > > > hundreths > > > of > > >seconds to display the frame for, and the final 0 means to loop > > >forever. > > > > > We can do it like this....but why? If we do it like this we better > > use the > > gifs(get some gif animation code from the web)...I think converting > > gifs to > > a file like this is a lot of work, and we're just working around > > the > > problem, introducing another file format in stead of the > > gifs....anyway it > > can be done, but it's a lot of work... > > How else are we going to load the animated images? The translation > kit > doesn't support animated images, and I couldn't find a free library > on > the web to handle reading GIFs (probably due to patent restrictions > of > the GIF format). If you have easier ideas that will work, by all > means > implement them! > I thought there was a translator for GIFs, isn't there? But I don't know how we are going to paint animated gifs into the views, there should be some code out there we could use as examples, I never dealt with animated gifs before. All the animations I have worked on have always involved threads looping through a bunch of images. > > >Other news: > > > > > >I've finally got a BListItem class that does proper automatic text > > >wrapping, performance seems similar to a BTextView on resizing a > > > lot > > > of > > >items. > > > > > Nice work! have a screenshot? > > http://si-msn.port5.com/bme2.png > Great work! It looks good. > > P.s. Daniel did you upload your latest code into cvs? > Not yet... mmm... I have made some changes in the Network handlers code, change some things to get p2p messages again (somehow it got broken when I changed to BLoopers), and a few other changes. So far.. looks good! There might be an improvement on stability ... maybe.. je, I need you guys to test it because you do a better work on testing than I :D . I promise I will get it up there on friday evening (my time). Good work team!! Regards, Daniel |
|
From: Simon T. <sim...@ga...> - 2004-04-02 08:19:37
|
> Hello guys, sorry I have not reply till now, it's been a busy week. No problem > > > maybe also write a BHandler to handle the > > > icons...IconManager or something...My idea is this: the handler > > > will > > > be > > > owned by the main application object and the windows will send > > > messages to > > > that app to request for: > > > -the entire list of emoticon objects > > > -a message item representing an entire text with emoticons in it > > > -a bitmap for one part of text(can be used when typing text in a > > > textbox and > > > instantly changing that to emoticons) > > > > > > what do you guys think? > > > > I agree with a BHandler owned by the be_app, that sounds fine. I > > think > > we need a class to parse text that is passed a simple char * or > > BString > > of a bit of text, and returns some kind of custom structure > > containing > > processed text - ie the raw characters along with emoticons and > > thier > > offsets, plus maybe url detection and things like that. > > > It sounds ok, but does it really need to be a BHandler, why not just > a > Class with some methods to do the parsing, load the images, convert > strings to icon enabled messages, etc. What are the benefits of using > a > BHandler instead of just regular class? > Don't get me wrong, I am not saying it's a bad idea, just want to > know > the reasons why either approach would be better. The BHandler should help with multithreading issues - the protocol handlers or the conversation windows can simply target a BHandler with a message, the BHandler can pick up the messages in order and parse them in it's own thread (which owns all the icon data), then send a parsed-text message back to the window. The other approach would be to have a shared pointer passed around all the time, and I'm not too keen on that approach - also I'm not sure how thread-safe it would be. > > > > > > > >Where the number after each frame represents the number of > > > > hundreths > > > > of > > > >seconds to display the frame for, and the final 0 means to loop > > > >forever. > > > > > > > We can do it like this....but why? If we do it like this we > > > better > > > use the > > > gifs(get some gif animation code from the web)...I think > > > converting > > > gifs to > > > a file like this is a lot of work, and we're just working around > > > the > > > problem, introducing another file format in stead of the > > > gifs....anyway it > > > can be done, but it's a lot of work... > > > > How else are we going to load the animated images? The translation > > kit > > doesn't support animated images, and I couldn't find a free library > > on > > the web to handle reading GIFs (probably due to patent restrictions > > of > > the GIF format). If you have easier ideas that will work, by all > > means > > implement them! > > > I thought there was a translator for GIFs, isn't there? But I don't > know how we are going to paint animated gifs into the views, there > should be some code out there we could use as examples, I never dealt > with animated gifs before. All the animations I have worked on have > always involved threads looping through a bunch of images. The GIF translator only decodes the first frame of any animated images. Actually drawing them shouldn't be a problem (I have a few ideas on that), once we have a list of BBitmaps for each of the frames in the animation. > > > >Other news: > > > > > > > >I've finally got a BListItem class that does proper automatic > > > > text > > > >wrapping, performance seems similar to a BTextView on resizing a > > > > lot > > > > of > > > >items. > > > > > > > Nice work! have a screenshot? > > > > http://si-msn.port5.com/bme2.png > > > Great work! It looks good. I've also just made it much more lightweight, so resize performance far exceeds BTextView (I've tested a BListView with 15000 NetListItems like in the screenshot - still resizes in real time). Memory usuage is high though (the width of every character is cached), so I might try a compromise. > > > P.s. Daniel did you upload your latest code into cvs? > > > Not yet... mmm... I have made some changes in the Network handlers > code, change some things to get p2p messages again (somehow it got > broken when I changed to BLoopers), and a few other changes. So far.. > looks good! There might be an improvement on stability ... maybe.. > je, > I need you guys to test it because you do a better work on testing > than > I :D . lol no problem. I had a problem with the CVS version before, where whenever I built the code, the deskbar replicant didn't work. I think I may have been using an old beta of the OBOS translation kit; moved to beta 3 now, and it works well. That means I can be a bit more active in development. > I promise I will get it up there on friday evening (my time). > > Good work team!! Yay! > Regards, > Daniel > Simon |