7 class ImageStore(object):
17 "small_next": "small_next.png",
18 "small_prev": "small_prev.png",
19 "small_pause": "small_pause.png",
20 "small_play": "small_play.png",
21 "small_stop": "small_stop.png",
22 "small_home": "small_home.png",
24 "loading": "loading.gif",
26 "radio_header": "radio_header.png",
27 "conference_background": "conference_bg.png",
28 "magazine_background": "magazine_bg.png",
29 "scriptures_background": "scripture_bg.png",
31 "conferences": "conference.png",
32 "magazines": "magazines.png",
34 "mormonmessages": "mormonmessages.png",
36 "scriptures": "scriptures.png",
40 def __init__(self, storePath, cachePath):
41 self._storePath = storePath
42 self._cachePath = cachePath
44 def get_surface_from_store(self, imageName):
45 path = os.path.join(self._storePath, imageName)
46 image = cairo.ImageSurface.create_from_png(path)
49 def get_image_from_store(self, imageName):
50 path = os.path.join(self._storePath, imageName)
52 image.set_from_file(path)
55 def set_image_from_store(self, image, imageName):
56 path = os.path.join(self._storePath, imageName)
57 image.set_from_file(path)
60 def get_pixbuf_from_store(self, imageName):
61 path = os.path.join(self._storePath, imageName)
62 return gtk.gdk.pixbuf_new_from_file(path)
64 def get_pixbuf_animation_from_store(self, imageName):
65 path = os.path.join(self._storePath, imageName)
66 return gtk.gdk.PixbufAnimation(path)