Example #1
0
 def Image(self, path, x, y, width, height):
     if not "/" in path:
         path = g15icontools.get_icon_path(path, width if width != 0 else 128)
         
     size = None if width == 0 or height == 0 else (width, height)
     
     img_surface = g15cairo.load_surface_from_file(path, size)
     self._page.image(img_surface, x, y)
Example #2
0
    def Image(self, path, x, y, width, height):
        if not "/" in path:
            path = g15icontools.get_icon_path(path, width if width != 0 else 128)

        size = None if width == 0 or height == 0 else (width, height)

        img_surface = g15cairo.load_surface_from_file(path, size)
        self._page.image(img_surface, x, y)
Example #3
0
 def __init__(self, gconf_client, gconf_key, screen, icon, page_id, title):
     """
     Constructor
     
     Keyword arguments:
     gconf_client            - gconf client
     gconf_key               - gconf key for plugin
     screen                  - screen
     icon                    - icon to use for thumbnail
     title                   - title for page (displayed in menu etc)
     refresh_interval        - how often to refresh the page
     """
     G15Plugin.__init__(self, gconf_client, gconf_key, screen)
     self.page_id = page_id
     self.hidden = False
     self._icon_path = g15icontools.get_icon_path(icon)
     self._title = title
     self.page = None
     self.thumb_icon = g15cairo.load_surface_from_file(self._icon_path)
     self.add_page_on_activate = True
Example #4
0
 def __init__(self, gconf_client, gconf_key, screen, icon, page_id, title):
     """
     Constructor
     
     Keyword arguments:
     gconf_client            - gconf client
     gconf_key               - gconf key for plugin
     screen                  - screen
     icon                    - icon to use for thumbnail
     title                   - title for page (displayed in menu etc)
     refresh_interval        - how often to refresh the page
     """
     G15Plugin.__init__(self, gconf_client, gconf_key, screen)
     self.page_id = page_id
     self.hidden = False
     self._icon_path = g15icontools.get_icon_path(icon)
     self._title = title
     self.page = None
     self.thumb_icon = g15cairo.load_surface_from_file(self._icon_path)
     self.add_page_on_activate = True
Example #5
0
 def ImageData(self, image_data, x, y):
     file_str = StringIO(str(image_data))
     img_surface = g15cairo.load_surface_from_file(file_str, None)
     file_str.close()
     self._page.image(img_surface, x, y)
Example #6
0
 def set_icon(self, icon):
     self._icon_path = g15icontools.get_icon_path(icon)
     self.thumb_icon = g15cairo.load_surface_from_file(self._icon_path)
Example #7
0
 def set_icon(self, icon):
     self._icon_path = g15icontools.get_icon_path(icon)
     self.thumb_icon = g15cairo.load_surface_from_file(self._icon_path)
Example #8
0
 def ImageData(self, image_data, x, y):
     file_str = StringIO(str(image_data))
     img_surface = g15cairo.load_surface_from_file(file_str, None)
     file_str.close()
     self._page.image(img_surface, x, y)
Example #9
0
def load_surface_from_file(filename, size=None):
    return g15cairo.load_surface_from_file(filename, size)