X-Git-Url: http://git.maemo.org/git/?p=watersofshiloah;a=blobdiff_plain;f=src%2Fimagestore.py;h=bf82efc12dfa776660abce0bd4639995b4f20980;hp=7119d655886d6e1a847dc11ec3eabc9822675eb7;hb=417e8baa6032669e8901d69f10aec1d51f0c15aa;hpb=81954555c66b9c039f05e9dfd8c1d8c5759fd3c6 diff --git a/src/imagestore.py b/src/imagestore.py index 7119d65..bf82efc 100644 --- a/src/imagestore.py +++ b/src/imagestore.py @@ -6,17 +6,53 @@ import gtk class ImageStore(object): + STORE_LOOKUP = { + "next": "next.png", + "prev": "prev.png", + "pause": "pause.png", + "play": "play.png", + "stop": "stop.png", + "home": "home.png", + "loading": "loading.gif", + + "radio_header": "radio_header.png", + "conference_background": "conference_bg.png", + "magazine_background": "magazine_bg.png", + "scriptures_background": "scripture_bg.png", + + "conferences": "conference.png", + "magazines": "magazines.png", + "more": "more.png", + "mormonmessages": "mormonmessages.png", + "radio": "radio.png", + "scriptures": "scriptures.png", + "icon": "icon.png", + } + def __init__(self, storePath, cachePath): self._storePath = storePath self._cachePath = cachePath - def get_surface_from_store(self, image): - path = os.path.join(self._storePath, image) + def get_surface_from_store(self, imageName): + path = os.path.join(self._storePath, imageName) image = cairo.ImageSurface.create_from_png(path) return image - def get_image_from_store(self, image): - path = os.path.join(self._storePath, image) + def get_image_from_store(self, imageName): + path = os.path.join(self._storePath, imageName) image = gtk.Image() image.set_from_file(path) return image + + def set_image_from_store(self, image, imageName): + path = os.path.join(self._storePath, imageName) + image.set_from_file(path) + return image + + def get_pixbuf_from_store(self, imageName): + path = os.path.join(self._storePath, imageName) + return gtk.gdk.pixbuf_new_from_file(path) + + def get_pixbuf_animation_from_store(self, imageName): + path = os.path.join(self._storePath, imageName) + return gtk.gdk.PixbufAnimation(path)