예제 #1
0
파일: g15dbus.py 프로젝트: FPar/gnome15
 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)
예제 #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)
예제 #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
예제 #4
0
파일: g15plugin.py 프로젝트: FPar/gnome15
 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
예제 #5
0
파일: g15dbus.py 프로젝트: FPar/gnome15
 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)
예제 #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)
예제 #7
0
파일: g15plugin.py 프로젝트: FPar/gnome15
 def set_icon(self, icon):
     self._icon_path = g15icontools.get_icon_path(icon)
     self.thumb_icon = g15cairo.load_surface_from_file(self._icon_path)
예제 #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)
예제 #9
0
def load_surface_from_file(filename, size=None):
    return g15cairo.load_surface_from_file(filename, size)