7 class ImageStore(object):
15 "loading": "loading.gif",
17 "radio_header": "radio_header.png",
18 "conference_background": "conference_bg.png",
19 "magazine_background": "magazine_bg.png",
20 "scriptures_background": "scripture_bg.png",
22 "conferences": "conference.png",
23 "magazines": "magazines.png",
25 "mormonmessages": "mormonmessages.png",
27 "scriptures": "scriptures.png",
31 def __init__(self, storePath, cachePath):
32 self._storePath = storePath
33 self._cachePath = cachePath
35 def get_surface_from_store(self, imageName):
36 path = os.path.join(self._storePath, imageName)
37 image = cairo.ImageSurface.create_from_png(path)
40 def get_image_from_store(self, imageName):
41 path = os.path.join(self._storePath, imageName)
43 image.set_from_file(path)
46 def set_image_from_store(self, image, imageName):
47 path = os.path.join(self._storePath, imageName)
48 image.set_from_file(path)
51 def get_pixbuf_from_store(self, imageName):
52 path = os.path.join(self._storePath, imageName)
53 return gtk.gdk.pixbuf_new_from_file(path)
55 def get_pixbuf_animation_from_store(self, imageName):
56 path = os.path.join(self._storePath, imageName)
57 return gtk.gdk.PixbufAnimation(path)