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]
 
__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
 
draw_text(self, ctx, text, x, y, font, size, width, allignment)
Draws text
source code
 
draw_circle(self, ctx, x, y, width, height, fill=True)
Draws a circule
source code
 
draw_line(self, ctx, start_x, start_y, end_x, end_y, line_width=1, close=False, preserve=False)
Draws a line
source code
 
draw_rectangle(self, ctx, x, y, width, height, fill=True)
Draws a rectangle
source code
 
draw_rounded_rectangle(self, ctx, x, y, rounded_angle, width, height, fill=True)
Draws a rounded rectangle
source code
 
show_notification(self, text)
Show notification window at current mouse position.
source code
 
hide_notification(self)
hide notification window
source code
 
show_tooltip(self, text, tooltipx, tooltipy)
Show tooltip window at current mouse position.
source code
 
hide_tooltip(self)
hide tooltip window
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

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

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

Class Variables [hide private]
  __name__ = ''
  __info__ = ''
  path = ''
  loaded = False
  width = 0
  height = 0
  option_overrides = {}
  p_fdesc = None
  p_layout = None
  tooltip = None
  notify = None
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: dict.__init__
(inherited documentation)

__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).