Package screenlets :: Class ScreenletTheme
[hide private]
[frames] | no frames]

Class ScreenletTheme

source code

object --+    
         |    
      dict --+
             |
            ScreenletTheme

ScreenletThemes are simple storages that allow loading files as svg-handles within a theme-directory. Each Screenlet can have its own theme-directory. It is up to the Screenlet-developer if he wants to let his Screenlet support themes or not. Themes are turned off by default - if your Screenlet uses Themes, just set the attribute 'theme_name' to the name of the theme's dir you want to use. TODO: remove dict-inheritance


Version:  

Author:  

Instance Methods [hide private]
new empty dictionary

__init__(self, path)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__getattr__(self, name) source code
 
apply_option_overrides(self, screenlet)
Apply this theme's overridden options to the given Screenlet.
source code
 
check_entry(self, filename)
Checks if a file with filename is loaded in this theme.
source code
 
get_text_width(self, ctx, text, font) source code
 
get_text_extents(self, ctx, text, font) source code
 
draw_text(self, ctx, text, x, y, font, size, width, allignment, weight=0, ellipsize=<enum PANGO_ELLIPSIZE_NONE of type PangoEllipsizeMode>) source code
 
draw_circle(self, ctx, x, y, width, height, fill=True) source code
 
draw_line(self, ctx, start_x, start_y, end_x, end_y, line_width=1, close=False, preserve=False) source code
 
draw_rectangle(self, ctx, x, y, width, height, fill=True) source code
 
draw_rounded_rectangle(self, ctx, x, y, rounded_angle, width, height, fill=True) source code
 
get_image_size(self, pix) source code
 
draw_image(self, ctx, x, y, pix) source code
 
draw_scaled_image(self, ctx, x, y, pix, w, h) source code
 
show_notification(self, text) source code
 
hide_notification(self) source code
 
show_tooltip(self, text, tooltipx, tooltipy) source code
 
hide_tooltip(self) source code
 
has_overrides(self)
Check if this theme contains overrides for options.
source code
 
load_conf(self, filename)
Load a config-file from this theme's dir and save vars in list.
source code
 
load_svg(self, filename)
Load an SVG-file into this theme and reference it as ref_name.
source code
 
load_png(self, filename)
Load a PNG-file into this theme and reference it as ref_name.
source code
 
__load_all(self)
Load all files in the theme's path.
source code
 
reload(self)
Re-Load all files in the theme's path.
source code
 
free(self)
Deletes the Theme's contents and frees all rsvg-handles.
source code
 
render(self, ctx, name)
Render an image from within this theme to the given context.
source code
 
render_png_colorized(self, ctx, name, color) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]
  __name__ = ''
  __info__ = ''
  path = ''
  loaded = False
  width = 0
  height = 0
  option_overrides = {}
  p_fdesc = None
hash(x)
  p_layout = None
hash(x)
  tooltip = None
hash(x)
  notify = None
hash(x)

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

show_tooltip(self, text, tooltipx, tooltipy)

source code 

Deprecated: Moved to Screenlets class: Show tooltip window at current mouse position.

__load_all(self)

source code 

Load all files in the theme's path. Currently only loads SVGs and PNGs.

free(self)

source code 

Deletes the Theme's contents and frees all rsvg-handles. TODO: freeing rsvg-handles does NOT work for some reason

render(self, ctx, name)

source code 

Render an image from within this theme to the given context. This function can EITHER use png OR svg images, so it is possible to create themes using both image-formats when a Screenlet uses this function for drawing its images. The image name has to be defined without the extension and the function will automatically select the available one (SVG is prefered over PNG).