| 1 |
#!/usr/bin/env python |
|---|
| 2 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 3 |
##~ License |
|---|
| 4 |
##~ |
|---|
| 5 |
##- The RuneBlade Foundation library is intended to ease some |
|---|
| 6 |
##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.) |
|---|
| 7 |
##- applications, while providing the flexibility to modularly change the |
|---|
| 8 |
##- architecture. Enjoy. |
|---|
| 9 |
##~ |
|---|
| 10 |
##~ Copyright (C) 2002 TechGame Networks, LLC. |
|---|
| 11 |
##~ |
|---|
| 12 |
##~ This library is free software; you can redistribute it and/or |
|---|
| 13 |
##~ modify it under the terms of the BSD style License as found in the |
|---|
| 14 |
##~ LICENSE file included with this distribution. |
|---|
| 15 |
##~ |
|---|
| 16 |
##~ TechGame Networks, LLC can be reached at: |
|---|
| 17 |
##~ 3578 E. Hartsel Drive #211 |
|---|
| 18 |
##~ Colorado Springs, Colorado, USA, 80920 |
|---|
| 19 |
##~ |
|---|
| 20 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 21 |
|
|---|
| 22 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 23 |
#~ Imports |
|---|
| 24 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 25 |
|
|---|
| 26 |
import logging |
|---|
| 27 |
import Abstract |
|---|
| 28 |
|
|---|
| 29 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 30 |
#~ Definitions |
|---|
| 31 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 32 |
|
|---|
| 33 |
class NullRenderer(Abstract.AbstractRenderer): |
|---|
| 34 |
def Display(self, ri): |
|---|
| 35 |
self.resolver = [] |
|---|
| 36 |
ri.DisplayOn(self) |
|---|
| 37 |
del self.resolver |
|---|
| 38 |
|
|---|
| 39 |
#~ Meta Information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 40 |
|
|---|
| 41 |
def DisplayTitle(self, ri_title): pass |
|---|
| 42 |
def DisplayDescription(self, ri_desc): pass |
|---|
| 43 |
|
|---|
| 44 |
#~ Groups ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 45 |
|
|---|
| 46 |
def DisplaySVG(self, ri_svg): |
|---|
| 47 |
self.PushContext(ri_svg) |
|---|
| 48 |
self.resolver.append(ri_svg.idmapping) |
|---|
| 49 |
try: |
|---|
| 50 |
ri_svg.DisplayChildrenOn(self) |
|---|
| 51 |
finally: |
|---|
| 52 |
self.resolver.pop() |
|---|
| 53 |
self.PopContext(ri_svg) |
|---|
| 54 |
|
|---|
| 55 |
def DisplayGroup(self, ri_group): |
|---|
| 56 |
self.PushContext(ri_group) |
|---|
| 57 |
try: |
|---|
| 58 |
ri_group.DisplayChildrenOn(self) |
|---|
| 59 |
finally: |
|---|
| 60 |
self.PopContext(ri_group) |
|---|
| 61 |
|
|---|
| 62 |
def DisplaySymbol(self, ri_symbol): |
|---|
| 63 |
self.PushContext(ri_symbol) |
|---|
| 64 |
try: |
|---|
| 65 |
ri_symbol.DisplayChildrenOn(self) |
|---|
| 66 |
finally: |
|---|
| 67 |
self.PopContext(ri_symbol) |
|---|
| 68 |
|
|---|
| 69 |
def DisplayUse(self, ri_use): |
|---|
| 70 |
ri_used = self.ResolveReference(ri_use.usereference) |
|---|
| 71 |
if ri_used is not None: |
|---|
| 72 |
self.PushContext(ri_use) |
|---|
| 73 |
try: |
|---|
| 74 |
ri_used.DisplayOn(self) |
|---|
| 75 |
finally: |
|---|
| 76 |
self.PopContext(ri_use) |
|---|
| 77 |
|
|---|
| 78 |
#~ Shapes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 79 |
|
|---|
| 80 |
def DisplayLine(self, ri_line): pass |
|---|
| 81 |
def DisplayRect(self, ri_rect): pass |
|---|
| 82 |
def DisplayCircle(self, ri_circle): pass |
|---|
| 83 |
def DisplayEllipse(self, ri_ellipse): pass |
|---|
| 84 |
def DisplayPolygon(self, ri_polygon): pass |
|---|
| 85 |
def DisplayPolyline(self, ri_polyline): pass |
|---|
| 86 |
def DisplayPath(self, ri_path): pass |
|---|
| 87 |
def DisplayText(self, ri_text): pass |
|---|
| 88 |
|
|---|
| 89 |
#~ Order management ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 90 |
|
|---|
| 91 |
def PushContext(self, ri): pass |
|---|
| 92 |
def PopContext(self, ri): pass |
|---|
| 93 |
def ResolveReference(self, reference): |
|---|
| 94 |
base, tag = reference |
|---|
| 95 |
return self.resolver[-1].get(tag, None) |
|---|
| 96 |
|
|---|
| 97 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 98 |
|
|---|
| 99 |
class NullPathFactory(object): |
|---|
| 100 |
def BeginPath(self, pathstr): pass |
|---|
| 101 |
def AddPathElement(self, name, relative, *args): |
|---|
| 102 |
getattr(self, name.lower())(relative, *args) |
|---|
| 103 |
def EndPath(self, pathstr): pass |
|---|
| 104 |
|
|---|
| 105 |
def move(self, relative, x, y): pass |
|---|
| 106 |
def closepath(self, relative): pass |
|---|
| 107 |
def line(self, relative, x, y): pass |
|---|
| 108 |
def hline(self, relative, x): pass |
|---|
| 109 |
def vline(self, relative, y): pass |
|---|
| 110 |
def cubicbezier(self, relative, x1, y1, x2, y2, x, y): pass |
|---|
| 111 |
def smoothcurve(self, relative, x2, y2, x, y): pass |
|---|
| 112 |
def quadraticbezier(self, relative, x1, y1, x, y): pass |
|---|
| 113 |
def smoothquadraticbezier(self, relative, x, y): pass |
|---|
| 114 |
def ellipticarc(self, relative, rx, ry, xrotation, largeArcFlag, sweepFlag, x, y): pass |
|---|
| 115 |
|
|---|
| 116 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 117 |
|
|---|
| 118 |
class NullTransformFactory(object): |
|---|
| 119 |
def BeginTransform(self, transformstr): pass |
|---|
| 120 |
def AddTransformElement(self, name, *args): pass |
|---|
| 121 |
def EndTransform(self, transformstr): pass |
|---|
| 122 |
|
|---|
| 123 |
def translate(self, x=0.0, y=0.0): pass |
|---|
| 124 |
def scale(self, x=1., y=None): pass |
|---|
| 125 |
def rotate(self, angle=0.0, x=0, y=0): pass |
|---|
| 126 |
def skewx(self, angle=0.0): pass |
|---|
| 127 |
def skewy(self, angle=0.0): pass |
|---|
| 128 |
def matrix(self, xx=1.0, xy=0.0, xh=0.0, yx=0.0, yy=1.0, yh=0.0, hx=0.0, hy=0.0, hh=1.0): pass |
|---|
| 129 |
|
|---|