Notices


Reply
Thread Tools
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#41
Good to see you haven't given up on this, shin.

Does this thread help you at all?
http://www.gtkforums.com/about2262.html

I also saw this.
http://www.nimblecoder.com/blog/arch...lverlight.aspx

There's one spot on that page which claims to have a "python version" but I wasn't sure how to find the coding for it.

There's quite a lot to find through Google searching, I'm not sure what is really needed though.

It seems like the best solution is to figure out why Cairo doesn't support a transparent background.

Could this just be a dependency issue?
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#42
The author of Cairo Clock mentioned that if there was a black background behind the clock, it meant you needed to open up composite-manager, like Compiz (whatever that means).

So this is the best I could find on the forums here.
http://talk.maemo.org/showthread.php...posite+manager

Have you had any luck with anything so far?

To be honest, the second hand is just a luxury feature that isn't critical for much of anything outside of it's sexy look.

So yeah, there's no loss here without it.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#43
Still no luck on this, Shin?
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#44
Apparently, I guess I made a new friend today.

All credit goes to this one guy named Marius Gedminas.

Here's what he had to.say on your clock build.



Four things come into mind:

** The background and foreground never changes; instead of rendering the SVG every time, render them into an offscreen buffer and blit the cached image in your expose event.

Something like http://old.nabble.com/Cairo-double-b...d22493956.html
but don't draw to the image surface on every frame; cache it if the widget size hasn't changed.

** Use timeout_add_seconds rather than timeout_add, that should be slightly more battery-efficient (multiple apps will get scheduled to wake up at the same time, rather than staggered throughout the second).

-- see http://library.gnome.org/devel/pygob...ut-add-seconds

** clip the drawing in the expose event handler to just the dirty area:

# Create the cairo context
cr = self.window.cairo_create()

# Restrict Cairo to the exposed area; avoid extra work
cr.rectangle(event.area.x, event.area.y,
event.area.width, event.area.height)
cr.clip()

-- from http://www.tortall.net/mu/wiki/PyGTKCairoTutorial

This will probably not matter much for Maemo where all windows are not overlapping, but then you can

** compute the dirty area in your timer interrupt and use queue_draw_area instead of queue_draw

This will let you draw less on every frame.

Hope that helps!
 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 133 | Thanked: 172 times | Joined on Jul 2009 @ Travel bag
#45
Addison

apologies for delayed response.. Work and private life has been keeping me really busy ( have a 4 yr and a 10 month old at home..). For the first time since I bought the N810, I had to let the battery drain a couple of times , since I did not have time to play with it or recharge it..

But I have been working on refactoring the code on and off to write to a image surface to buffer ( and move it out of the expose event) like your friend has mentioned.. I had also queried in the GTK forum, and a guy named Tadej has been kind enough to show some pointers here

I will look at the suggestions from your friend too and hopefully I should be able to report something soon..
 

The Following 2 Users Say Thank You to shin For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#46
No need to apologize there, shin.

At least you've got your priorities in order though I'm sure there have been times when you wouldn't mind letting your kids completely drain instead.

Anyway, I mentioned to ukki here that I've got about a week left on this forum.

Any conversations on Diablo have all but dried up so there's not much of a point to visit here anymore.

So yeah, this is basically the last thing I'm hoping to see resolved.

But no need to put a rush on this, shin.
 
Posts: 133 | Thanked: 172 times | Joined on Jul 2009 @ Travel bag
#47
okey.. I have modularized the code to a large extent and pulled the rendering of static content such as the clock face, out of the expose event so that these does not get rendered every time the clock seconds hand tick..

However there may be an inherent limitation to the performance improvement that can be achieved as we are using SVG files in place of simple Cairo objects ( Performance in this case is also dependent on the size of the SVG files).

Addison - Could you please try the attached version of the code and let me know if you see some improvement..

Pls copy the attached svgclock.py to /usr/lib/hildon-desktop replacing the existing svgclock file. Also ensure the permissions are set ( execute rights). ( I have added .zip as I was not able to attach the.py file as it is. So one you download the attachment, you could rename and just remove the .zip extension - it is not a zipped file)
Attached Files
File Type: zip svgclock.py.zip (6.2 KB, 431 views)
 

The Following User Says Thank You to shin For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#48
It's perfect, shin.

It's almost a 100% change in improvement.

Thank you very much for this, it definitely livens up my desktop.

I've been trying to find some kind of computer graphic clock tower as a desktop wallpaper to be used with this but haven't found anything yet. I thought that might be kind of a neat theme to play around with. Do you have any possible theme suggestions for one of these clocks?

Anyway, I hope you enjoyed the overall experience of creating your first application. I appreciate what you've done with it.

This is definitely a keeper.
 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 133 | Thanked: 172 times | Joined on Jul 2009 @ Travel bag
#49
Thank you for testing this and your interest/patience.

Now I will try to repackage the SVGClock with the optimized code and release as a next version.. perhaps put in the extras repository too..

On Daiblo and the N810, I think there is still more to come.. This is such a capable platform and I only hope Nokia comes out with the next IT soon.. One of them is Wavy + Skippy-Xd from t-moyashi san. Look here for more details ( site is in Japanese!) ..
t-moyashiさん、
すみません。フォーラムで公開する前に、こちらから話してしまって。。
」..

It is a nice gesture launcher for diablo, that gives it N900 like Task panel. Another cool stuff worth trying. hope t-moyashi releases it here, soon.

On the clock tower like theme, where the desktop clock widget can fit in, try here. This is the theme of St.Peter tower Zurich. Theme is made for KDE /Gnome desktop
 

The Following 2 Users Say Thank You to shin For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#50
Believe it or not, I actually can read some japanese.

And yeah, moyashi sent me a message asking to test it awhile ago but, you know me, couldn't figure out the dependency issues. He never did write me back on this.

What he's doing looks really slick, so yeah, I'm looking forward to seeing what becomes of skippy.

I saw that KDE wallpaper a few days ago and thought it was pretty ripe with ugliness.

Oh well, it's still a fun time waster looking for themes to match well with some of these new clocks available.

I tested your SVG clock with everything I could think of, even including a soft power down, and it passed it all quite easily.

Great job on the coding, it's like the clock isn't even running a script anymore.
 

The Following User Says Thank You to Addison For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:40.