# automatically generated by the FlatBuffers compiler, do not modify

# namespace: AllWatchSerialize

import flatbuffers

class Style(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsStyle(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Style()
        x.Init(buf, n + offset)
        return x

    # Style
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Style
    def AbsoluteWidth(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def AbsoluteHeight(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def BackgroundColor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # Style
    def BorderColor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # Style
    def Background(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Background import Background
            obj = Background()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Style
    def X(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def Y(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def MarginTop(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def MarginBottom(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def MarginLeft(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def MarginRight(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
        return 0

    # Style
    def Width(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Style
    def Height(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Style
    def OffsetX(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Style
    def OffsetY(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

def StyleStart(builder): builder.StartObject(15)
def StyleAddAbsoluteWidth(builder, absoluteWidth): builder.PrependInt16Slot(0, absoluteWidth, 0)
def StyleAddAbsoluteHeight(builder, absoluteHeight): builder.PrependInt16Slot(1, absoluteHeight, 0)
def StyleAddBackgroundColor(builder, backgroundColor): builder.PrependInt64Slot(2, backgroundColor, 0)
def StyleAddBorderColor(builder, borderColor): builder.PrependInt64Slot(3, borderColor, 0)
def StyleAddBackground(builder, background): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(background), 0)
def StyleAddX(builder, x): builder.PrependInt16Slot(5, x, 0)
def StyleAddY(builder, y): builder.PrependInt16Slot(6, y, 0)
def StyleAddMarginTop(builder, marginTop): builder.PrependInt16Slot(7, marginTop, 0)
def StyleAddMarginBottom(builder, marginBottom): builder.PrependInt16Slot(8, marginBottom, 0)
def StyleAddMarginLeft(builder, marginLeft): builder.PrependInt16Slot(9, marginLeft, 0)
def StyleAddMarginRight(builder, marginRight): builder.PrependInt16Slot(10, marginRight, 0)
def StyleAddWidth(builder, width): builder.PrependFloat64Slot(11, width, 0.0)
def StyleAddHeight(builder, height): builder.PrependFloat64Slot(12, height, 0.0)
def StyleAddOffsetX(builder, offsetX): builder.PrependFloat64Slot(13, offsetX, 0.0)
def StyleAddOffsetY(builder, offsetY): builder.PrependFloat64Slot(14, offsetY, 0.0)
def StyleEnd(builder): return builder.EndObject()
