7 class ImageStore(object):
16 "loading": "loading.gif",
18 "radio_header": "radio_header.png",
19 "conference_background": "conference_bg.png",
20 "magazine_background": "magazine_bg.png",
21 "scriptures_background": "scripture_bg.png",
23 "conferences": "conference.png",
24 "magazines": "magazines.png",
26 "mormonmessages": "mormonmessages.png",
28 "scriptures": "scriptures.png",
32 def __init__(self, storePath, cachePath):
33 self._storePath = storePath
34 self._cachePath = cachePath
36 def get_surface_from_store(self, imageName):
37 path = os.path.join(self._storePath, imageName)
38 image = cairo.ImageSurface.create_from_png(path)
41 def get_image_from_store(self, imageName):
42 path = os.path.join(self._storePath, imageName)
44 image.set_from_file(path)
47 def set_image_from_store(self, image, imageName):
48 path = os.path.join(self._storePath, imageName)
49 image.set_from_file(path)
52 def get_pixbuf_from_store(self, imageName):
53 path = os.path.join(self._storePath, imageName)
54 return gtk.gdk.pixbuf_new_from_file(path)
56 def get_pixbuf_animation_from_store(self, imageName):
57 path = os.path.join(self._storePath, imageName)
58 return gtk.gdk.PixbufAnimation(path)