Exemple #1
0
    def __init__(self, type=LINEAR, x=0, y=0, width=1, height=1, string=None):
        Serializable.__init__(self)
        self.type = type
        self.colors = [
            GradientColor(1, 1, 1, 1, 0),
            GradientColor(0, 0, 0, 1, 1)
        ]
        self.x, self.y = x, y
        self.width, self.height = width, height
        if type == LINEAR:
            self.gradient = cairo.LinearGradient(x, y, width, height)
        elif type == RADIAL:
            self.gradient = cairo.RadialGradient(x, y, width, height, 10, 100)

        if string:
            self.colors = []
            data = string.split('|')
            area = data.pop().split(':')
            self.x = float(area[0])
            self.y = float(area[1])
            self.width = float(area[2])
            self.height = float(area[3])
            map(lambda color: self.colors.append(GradientColor(string=color)),
                data)

        self.update()
Exemple #2
0
    def __init__(self, red=0.0, green=0.0, blue=0.0, alpha=1.0, string=None):
        Serializable.__init__(self)
        self.red = red
        self.green = green
        self.blue = blue
        self.alpha = alpha

        if string:
            self.set_color_as_hex(string)
Exemple #3
0
    def __init__(self, red=0.0, green=0.0, blue=0.0, alpha=1.0, string=None):
        Serializable.__init__(self)
        self.red = red
        self.green = green
        self.blue = blue
        self.alpha = alpha

        if string:
            self.set_color_as_hex(string)
Exemple #4
0
    def __init__(self, type=LINEAR, x=0, y=0, width=1, height=1, string=None):
        Serializable.__init__(self)
        self.type = type
        self.colors = [GradientColor(1, 1, 1, 1, 0), GradientColor(0, 0, 0, 1, 1)]
        self.x, self.y = x, y
        self.width, self.height = width, height
        if type == LINEAR:
            self.gradient = cairo.LinearGradient(x, y, width, height)
        elif type == RADIAL:
            self.gradient = cairo.RadialGradient(x, y, width, height, 10, 100)

        if string:
            self.colors = []
            data = string.split('|')
            area = data.pop().split(':')
            self.x = float(area[0])
            self.y = float(area[1])
            self.width = float(area[2])
            self.height = float(area[3])
            map(lambda color: self.colors.append(GradientColor(string=color)), data)

        self.update()
Exemple #5
0
 def __init__(self):
     Serializable.__init__(self)
     self.width = 0
     self.height = 0
Exemple #6
0
 def __init__(self, x = 0, y = 0):
     Serializable.__init__(self)
     self.x, self.y = y, y
Exemple #7
0
    def __init__(self):
        Serializable.__init__(self)

        self.pages = list()