# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
import sys
[docs]class AbstractGradientBrush(object):
""" Abstract base class for gradient brushes so they can be detected
easily.
"""
[docs] def IsOk(self):
return True
[docs]class NullRenderer(object):
NullBrush = None
NullGraphicsBrush = None
NullPen = None
TransparentPen = None
caps = {"butt": None, "round": None, "square": None}
joins = {"miter": None, "round": None, "bevel": None}
fill_rules = {"nonzero": None, "evenodd": None}
def __init__(self):
pass
[docs] @classmethod
def createAffineMatrix(cls, a, b, c, d, x, y):
raise NotImplementedError()
[docs] @classmethod
def createBrush(cls, color_tuple):
raise NotImplementedError()
[docs] @classmethod
def createNativePen(cls, pen):
raise NotImplementedError()
[docs] @classmethod
def createPen(cls, color_tuple):
raise NotImplementedError()
[docs] @classmethod
def createLinearGradientBrush(cls, x1, y1, x2, y2, stops,
spreadMethod="pad", transforms=None,
units="userSpaceOnUse"):
raise NotImplementedError()
[docs] @classmethod
def createRadialGradientBrush(cls, cx, cy, r, stops, fx=None, fy=None,
spreadMethod="pad", transforms=None,
units="userSpaceOnUse"):
raise NotImplementedError()
[docs] @classmethod
def getFont(cls, font_name="Arial"):
raise NotImplementedError()
[docs] @classmethod
def makeMatrix(cls, *args):
raise NotImplementedError()
[docs] @classmethod
def makePath(cls):
raise NotImplementedError()
[docs] @classmethod
def popState(cls, gc):
raise NotImplementedError()
[docs] @classmethod
def pushState(cls, gc):
raise NotImplementedError()
[docs] @classmethod
def setFontSize(cls, font, size):
raise NotImplementedError()
[docs] @classmethod
def setFontStyle(cls, font, style):
raise NotImplementedError()
[docs] @classmethod
def setFontWeight(cls, font, weight):
raise NotImplementedError()
[docs] @classmethod
def setFont(cls, gc, font, brush):
raise NotImplementedError()
[docs] @classmethod
def setBrush(cls, gc, brush):
raise NotImplementedError()
[docs] @classmethod
def setPenDash(cls, pen, dasharray, offset):
raise NotImplementedError()
[docs] @classmethod
def setPen(cls, gc, pen):
raise NotImplementedError()
[docs] @classmethod
def strokePath(cls, gc, path):
raise NotImplementedError()
[docs] @classmethod
def fillPath(cls, gc, path, mode):
raise NotImplementedError()
[docs] @classmethod
def gradientPath(cls, gc, path, brush):
raise NotImplementedError()
[docs] @classmethod
def clipPath(cls, gc, path):
raise NotImplementedError()
[docs] @classmethod
def translate(cls, gc, *args):
raise NotImplementedError()
[docs] @classmethod
def rotate(cls, gc, angle):
raise NotImplementedError()
[docs] @classmethod
def scale(cls, gc, sx, sy):
raise NotImplementedError()
[docs] @classmethod
def GetTextExtent(cls, gc, text):
raise NotImplementedError()
[docs] @classmethod
def DrawText(cls, gc, text, x, y, brush, anchor="start"):
""" Draw text at the given x,y position with the color of the
given brush.
"""
raise NotImplementedError()
[docs] @classmethod
def DrawImage(cls, gc, image, x, y, width, height):
raise NotImplementedError()