|
|
2010-01-10
, 12:41
|
|
Posts: 133 |
Thanked: 172 times |
Joined on Jul 2009
@ Travel bag
|
#22
|
import pango import pygtk import gtk from gtk import gdk import hildondesktop import cairo import rsvg import math
hildon-desktop-python-loader, python2.5-hildondesktop, python2.5-hildon, python2.5-gobject, python2.5-dbus, python2.5-osso, python2.5-cairo, python2.5-gtk2
| The Following User Says Thank You to shin For This Useful Post: | ||
|
|
2010-01-10
, 17:58
|
|
|
Posts: 903 |
Thanked: 632 times |
Joined on Apr 2008
|
#23
|
| The Following User Says Thank You to BrentDC For This Useful Post: | ||
|
|
2010-01-10
, 20:16
|
|
|
Posts: 3,811 |
Thanked: 1,150 times |
Joined on Oct 2007
@ East Lansing, MI
|
#24
|
Addison,
Could you just try running, as root:
apt-get -f install
I think that'll resolve all the problems.

[1|root@Nokia-N800-43-7|~]apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED: osso-software-version-rx34 0 upgraded, 0 newly installed, 1 to remove and 19 not upgraded. Need to get 0B of archives. After unpacking 0B of additional disk space will be used. Do you want to continue [Y/n]? n Abort.
|
|
2010-01-11
, 01:35
|
|
|
Posts: 3,811 |
Thanked: 1,150 times |
Joined on Oct 2007
@ East Lansing, MI
|
#25
|

[1|user@Nokia-N800-43-7|~]cd /media/mmc2 [1|user@Nokia-N800-43-7|/media/mmc2]tar zxvf 61952-voda.tar.gz tar: invalid gzip magic
|
|
2010-01-12
, 04:41
|
|
|
Posts: 3,811 |
Thanked: 1,150 times |
Joined on Oct 2007
@ East Lansing, MI
|
#26
|



| The Following User Says Thank You to Addison For This Useful Post: | ||
|
|
2010-01-12
, 09:14
|
|
Posts: 133 |
Thanked: 172 times |
Joined on Jul 2009
@ Travel bag
|
#27
|
|
|
2010-01-12
, 09:33
|
|
Posts: 133 |
Thanked: 172 times |
Joined on Jul 2009
@ Travel bag
|
#28
|

I believe this can be done within Python itself ( without worrying too much about, Cairo or rsvg)#All imports we need
import sys, os
import gobject
import pango
import pygtk
pygtk.require('2.0')
import gtk
from gtk import gdk
import hildondesktop
import cairo
from datetime import datetime
import time
import rsvg
import math
# set this to False to disable display of seconds and update
# only once per minute (saves CPU cycles on the tablet)
enable_seconds = True
supports_alpha = False
class SVGClock(hildondesktop.HomeItem):
def __init__(self):
hildondesktop.HomeItem.__init__(self)
self.set_resize_type(hildondesktop.HOME_ITEM_RESIZE_BOTH)
self.set_size_request(200, 200)
self.connect("expose-event", self.expose)
self.connect("screen-changed", self.screen_changed)
self.connect ("background", self.set_timer, False)
self.connect ("foreground", self.set_timer, True)
self.connect ("unrealize", self.unrealize)
# set a timeout to update the clock, depending
# on whether we are in the foreground or background
self.timer = None
self.set_timer(self, True)
self.show_all()
def expose(self, widget, event):
global supports_alpha
width, height = self.allocation[2], self.allocation[3]
#Get a cairo context
cr = widget.window.cairo_create()
if supports_alpha == True:
cr.set_source_rgba(0.0, 0.0, 0.0, 0.0) # Transparent
else:
cr.set_source_rgb(1.0, 1.0, 1.0) # Opaque white
# Draw the background
cr.set_operator(cairo.OPERATOR_SOURCE)
cr.paint()
#And draw everything we want
if width < height:
radius = float(width)/2 - 0.8
else:
radius = float(height)/2 - 0.8
SVGH_Drop_Shadow = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-drop-shadow.svg")
SVGH_Face = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-face.svg")
SVGH_Face_Shadow = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-face-shadow.svg")
SVGH_Marks = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-marks.svg")
SVGH_Frame = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-frame.svg")
SVGH_Glass = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-glass.svg")
SVGH_Hour_Hand = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-hour-hand.svg")
SVGH_Minute_Hand = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-minute-hand.svg")
SVGH_Second_Hand = rsvg.Handle(file="/home/user/MyDocs/Themes/default/clock-second-hand.svg")
cr.scale(2.0,2.0)
cr.save()
# Draw foreground
SVGH_Face_Shadow.render_cairo(cr)
SVGH_Glass.render_cairo(cr)
SVGH_Frame.render_cairo(cr)
# Draw Background
cr.set_operator(cairo.OPERATOR_OVER)
SVGH_Drop_Shadow.render_cairo(cr)
SVGH_Face.render_cairo(cr)
SVGH_Marks.render_cairo(cr)
#Draw the clock glass face with shadow
cr.set_operator(cairo.OPERATOR_OVER)
SVGH_Glass.render_cairo(cr)
cr.translate(50,50)
cr.save()
#Draw the hours/minutes and seconds hands
time = datetime.now()
hour = time.hour
minutes = time.minute
seconds = time.second
cr.set_operator(cairo.OPERATOR_OVER)
#cr.rotate((360/12) * (hour+9) * (3.141593/180))
cr.rotate(((360/12) * (hour+9) * (3.141593/180)) + (((360/60) * minutes * (3.141593/180)) / 12))
SVGH_Hour_Hand.render_cairo(cr)
cr.restore()
cr.save()
cr.rotate((360/60) * (minutes+45) * (3.141593/180))
SVGH_Minute_Hand.render_cairo(cr)
cr.restore()
cr.save()
# only draw seconds when in foreground
if enable_seconds: # disable seconds, to much work for little tablets
cr.rotate((360/60) * (seconds+45) * (3.141593/180))
cr.set_operator(cairo.OPERATOR_OVER)
SVGH_Second_Hand.render_cairo(cr)
cr.restore()
#Once everything has been drawn, create our XShape mask
#Our window content is contained inside the big circle,
#so let's use that one as our mask
"""pm = gtk.gdk.Pixmap(None, width, height, 1)
pmcr = pm.cairo_create()
pmcr.arc(float(width)/2, float(height)/2, radius, 0, 2.0*3.14)
pmcr.fill()
pmcr.stroke()
#Apply input mask
self.input_shape_combine_mask(pm, 0, 0)"""
return False
def screen_changed(self, widget, old_screen=None):
global supports_alpha
# print "screen changed"
# To check if the display supports alpha channels, get the colormap
screen = self.get_screen()
colormap = screen.get_rgba_colormap()
if colormap == None:
# print 'Your screen does not support alpha channels!'
colormap = screen.get_rgb_colormap()
supports_alpha = False
else:
# print 'Your screen supports alpha channels!'
supports_alpha = True
# Now we have a colormap appropriate for the screen, use it
self.set_colormap(colormap)
return False
# return True
def unrealize(self, widget, date=None):
# cancel timeout
if self.timer:
v = gobject.source_remove(self.timer)
print "canceled svgclock timeout:", v
self.timer = None
def set_timer(self, widget, on):
# when called first time from __init__ widget is None
if self.timer != None:
# print "removing old timer"
gobject.source_remove(self.timer)
if on:
# print "creating new timer"
delay = 1000 if enable_seconds else 60000
self.timer = gobject.timeout_add(delay, self.update)
# repaint immediately when coming to the foreground
self.update()
def update(self):
# print "updating svgclock"
self.queue_draw()
return True
def hd_plugin_get_objects():
plugin = SVGClock()
return [plugin]
| The Following 2 Users Say Thank You to shin For This Useful Post: | ||
|
|
2010-01-13
, 03:10
|
|
|
Posts: 3,811 |
Thanked: 1,150 times |
Joined on Oct 2007
@ East Lansing, MI
|
#29
|

| The Following 2 Users Say Thank You to Addison For This Useful Post: | ||
|
|
2010-01-13
, 06:38
|
|
Posts: 133 |
Thanked: 172 times |
Joined on Jul 2009
@ Travel bag
|
#30
|
# set this to False to disable display of seconds and update # only once per minute (saves CPU cycles on the tablet) enable_seconds = True
# set this to False to disable display of seconds and update # only once per minute (saves CPU cycles on the tablet) #enable_seconds = True enable_seconds = False
| The Following 2 Users Say Thank You to shin For This Useful Post: | ||
Your instructions were to start off as root but it was unclear if that was still needed when I untarred the Themes file.
And yeah, it looks like everything is set up correctly on my end so there has to be a small dependency issue here that we're missing.
Well, hopefully your big brain will problem solve this stupid crud you've created.
Thanks for hanging in there with me.