Module htmltextview
[hide private]
[frames] | no frames]

Module htmltextview

source code

A gtk.TextView-based renderer for XHTML-IM, as described in:
http://www.jabber.org/jeps/jep-0071.html

Starting with the version posted by Gustavo Carneiro, I (Santiago Gala) am trying to make it more compatible with the markup that docutils generate, and also more modular.

Classes [hide private]
  HtmlHandler
A handler to display html to a gtk textview
  HtmlTextView
Functions [hide private]
 
_parse_css_color(color) source code
 
style_iter(style) source code
Variables [hide private]
  whitespace_rx = re.compile('\\s+')
  allwhitespace_rx = re.compile('^\\s*$')
  display_resolution = 0.3514598*(gtk.gdk.screen_height()/ float...
  classes = {'problematic': ';color: red',}
  element_styles = {'u': ';text-decoration: underline', 'em': ';...
  BLOCK_HEAD = set(('h1', 'h2', 'h3', 'h4', 'h5', 'h6',))
  BLOCK_PHRASAL = set(('address', 'blockquote', 'pre',))
  BLOCK_PRES = set(('hr',))
  BLOCK_STRUCT = set(('div', 'p',))
  BLOCK_HACKS = set(('table', 'tr'))
  BLOCK = BLOCK_HEAD.union(BLOCK_PHRASAL).union(BLOCK_STRUCT).un...
  INLINE_PHRASAL = set('abbr, acronym, cite, code, dfn, em, kbd,...
  INLINE_PRES = set('b, i, u, tt'.split(', '))
  INLINE_STRUCT = set('br, span'.split(', '))
  INLINE = INLINE_PHRASAL.union(INLINE_PRES).union(INLINE_STRUCT)
  LIST_ELEMS = set('dl, ol, ul'.split(', '))
  change_cursor = None

Imports: gobject, pango, gtk, xml, re, warnings, StringIO, socket, time, urllib2, operator, gajim, tooltips


Function Details [hide private]

_parse_css_color(color)

source code 

style_iter(style)

source code 

Variables Details [hide private]

whitespace_rx

Value:
re.compile('\\s+')

allwhitespace_rx

Value:
re.compile('^\\s*$')

display_resolution

Value:
0.3514598*(gtk.gdk.screen_height()/ float(gtk.gdk.screen_height_mm()))

classes

Value:
{'problematic': ';color: red',}

element_styles

Value:
{'u': ';text-decoration: underline', 'em': ';font-style: oblique', 'ci\
te': '; background-color:rgb(170,190,250); font-style: oblique', 'li':\
 '; margin-left: 1em; margin-right: 10%', 'strong': ';font-weight: bol\
d', 'pre': '; background-color:rgb(190,190,190); font-family: monospac\
e; white-space: pre; margin-left: 1em; margin-right: 10%', 'kbd': ';ba\
ckground-color:rgb(210,210,210);font-family: monospace', 'blockquote':\
 '; background-color:rgb(170,190,250); margin-left: 2em; margin-right:\
 10%', 'dt': ';font-weight: bold; font-style: oblique', 'dd': ';margin\
...

BLOCK_HEAD

Value:
set(('h1', 'h2', 'h3', 'h4', 'h5', 'h6',))

BLOCK_PHRASAL

Value:
set(('address', 'blockquote', 'pre',))

BLOCK_PRES

Value:
set(('hr',))

BLOCK_STRUCT

Value:
set(('div', 'p',))

BLOCK_HACKS

Value:
set(('table', 'tr'))

BLOCK

Value:
BLOCK_HEAD.union(BLOCK_PHRASAL).union(BLOCK_STRUCT).union(BLOCK_PRES).\
union(BLOCK_HACKS)

INLINE_PHRASAL

Value:
set('abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var'.sp\
lit(', '))

INLINE_PRES

Value:
set('b, i, u, tt'.split(', '))

INLINE_STRUCT

Value:
set('br, span'.split(', '))

INLINE

Value:
INLINE_PHRASAL.union(INLINE_PRES).union(INLINE_STRUCT)

LIST_ELEMS

Value:
set('dl, ol, ul'.split(', '))

change_cursor

Value:
None