1
0
Fork 0
leet/framebuffer/framebuffer.pb.go

427 lines
14 KiB
Go
Raw Normal View History

2019-04-12 15:11:11 +08:00
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: framebuffer.proto
package framebuffer
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
2019-04-12 16:08:54 +08:00
//
//Layer defines some default layers for compositing animations onto for
//various purposes, and also defines some generic layers. Each service
//should be allocated a unique enum eventually.
//
//In the future, this system should be replaced by a configuration file
//that assigns priorities to each service.
2019-04-12 15:11:11 +08:00
type Layer int32
const (
Layer_NONE Layer = 0
// Well-known layers
Layer_LIGHT Layer = 10
Layer_COLOR Layer = 20
Layer_NOTIFICATIONS Layer = 90
// Public layers
Layer_GENERAL_0 Layer = 40
Layer_GENERAL_1 Layer = 41
Layer_GENERAL_2 Layer = 42
Layer_GENERAL_3 Layer = 43
Layer_GENERAL_4 Layer = 44
Layer_GENERAL_5 Layer = 45
Layer_GENERAL_6 Layer = 46
Layer_GENERAL_7 Layer = 47
Layer_GENERAL_8 Layer = 48
Layer_GENERAL_9 Layer = 49
)
var Layer_name = map[int32]string{
0: "NONE",
10: "LIGHT",
20: "COLOR",
90: "NOTIFICATIONS",
40: "GENERAL_0",
41: "GENERAL_1",
42: "GENERAL_2",
43: "GENERAL_3",
44: "GENERAL_4",
45: "GENERAL_5",
46: "GENERAL_6",
47: "GENERAL_7",
48: "GENERAL_8",
49: "GENERAL_9",
}
var Layer_value = map[string]int32{
"NONE": 0,
"LIGHT": 10,
"COLOR": 20,
"NOTIFICATIONS": 90,
"GENERAL_0": 40,
"GENERAL_1": 41,
"GENERAL_2": 42,
"GENERAL_3": 43,
"GENERAL_4": 44,
"GENERAL_5": 45,
"GENERAL_6": 46,
"GENERAL_7": 47,
"GENERAL_8": 48,
"GENERAL_9": 49,
}
func (x Layer) String() string {
return proto.EnumName(Layer_name, int32(x))
}
func (Layer) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_4476fbda566a3634, []int{0}
}
2019-04-12 16:08:54 +08:00
//
//FrameData represents either an array of dots or a fixed fill color to apply
//to all dots. Having two use cases makes it easier for applications to
//draw solid fill colors.
2019-04-12 15:11:11 +08:00
type FrameData struct {
// ARGB
Dots []uint32 `protobuf:"fixed32,1,rep,packed,name=dots,proto3" json:"dots,omitempty"`
Fill uint32 `protobuf:"fixed32,2,opt,name=fill,proto3" json:"fill,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FrameData) Reset() { *m = FrameData{} }
func (m *FrameData) String() string { return proto.CompactTextString(m) }
func (*FrameData) ProtoMessage() {}
func (*FrameData) Descriptor() ([]byte, []int) {
return fileDescriptor_4476fbda566a3634, []int{0}
}
func (m *FrameData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FrameData.Unmarshal(m, b)
}
func (m *FrameData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FrameData.Marshal(b, m, deterministic)
}
func (m *FrameData) XXX_Merge(src proto.Message) {
xxx_messageInfo_FrameData.Merge(m, src)
}
func (m *FrameData) XXX_Size() int {
return xxx_messageInfo_FrameData.Size(m)
}
func (m *FrameData) XXX_DiscardUnknown() {
xxx_messageInfo_FrameData.DiscardUnknown(m)
}
var xxx_messageInfo_FrameData proto.InternalMessageInfo
func (m *FrameData) GetDots() []uint32 {
if m != nil {
return m.Dots
}
return nil
}
func (m *FrameData) GetFill() uint32 {
if m != nil {
return m.Fill
}
return 0
}
2019-04-12 16:08:54 +08:00
//
//FrameBuffer represents an entire frame together with a layer tag. It also
//defines a timestamp that can be used within a FrameSequence to define the
//duration a frame will be shown.
2019-04-12 15:11:11 +08:00
type FrameBuffer struct {
Frame *FrameData `protobuf:"bytes,1,opt,name=frame,proto3" json:"frame,omitempty"`
Timestamp uint32 `protobuf:"fixed32,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Layer Layer `protobuf:"varint,4,opt,name=layer,proto3,enum=Layer" json:"layer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FrameBuffer) Reset() { *m = FrameBuffer{} }
func (m *FrameBuffer) String() string { return proto.CompactTextString(m) }
func (*FrameBuffer) ProtoMessage() {}
func (*FrameBuffer) Descriptor() ([]byte, []int) {
return fileDescriptor_4476fbda566a3634, []int{1}
}
func (m *FrameBuffer) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FrameBuffer.Unmarshal(m, b)
}
func (m *FrameBuffer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FrameBuffer.Marshal(b, m, deterministic)
}
func (m *FrameBuffer) XXX_Merge(src proto.Message) {
xxx_messageInfo_FrameBuffer.Merge(m, src)
}
func (m *FrameBuffer) XXX_Size() int {
return xxx_messageInfo_FrameBuffer.Size(m)
}
func (m *FrameBuffer) XXX_DiscardUnknown() {
xxx_messageInfo_FrameBuffer.DiscardUnknown(m)
}
var xxx_messageInfo_FrameBuffer proto.InternalMessageInfo
func (m *FrameBuffer) GetFrame() *FrameData {
if m != nil {
return m.Frame
}
return nil
}
func (m *FrameBuffer) GetTimestamp() uint32 {
if m != nil {
return m.Timestamp
}
return 0
}
func (m *FrameBuffer) GetLayer() Layer {
if m != nil {
return m.Layer
}
return Layer_NONE
}
2019-04-12 16:08:54 +08:00
//
//FrameSequence buffers a series of frames to be drawn one by one at intervals
//defined by the timestamp included in the FrameBuffers. Useful for running
//smooth animations.
//
//In the future, this should have more metadata like looping counts and async
//animations.
2019-04-12 15:11:11 +08:00
type FrameSequence struct {
Frames []*FrameBuffer `protobuf:"bytes,1,rep,name=frames,proto3" json:"frames,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FrameSequence) Reset() { *m = FrameSequence{} }
func (m *FrameSequence) String() string { return proto.CompactTextString(m) }
func (*FrameSequence) ProtoMessage() {}
func (*FrameSequence) Descriptor() ([]byte, []int) {
return fileDescriptor_4476fbda566a3634, []int{2}
}
func (m *FrameSequence) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FrameSequence.Unmarshal(m, b)
}
func (m *FrameSequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FrameSequence.Marshal(b, m, deterministic)
}
func (m *FrameSequence) XXX_Merge(src proto.Message) {
xxx_messageInfo_FrameSequence.Merge(m, src)
}
func (m *FrameSequence) XXX_Size() int {
return xxx_messageInfo_FrameSequence.Size(m)
}
func (m *FrameSequence) XXX_DiscardUnknown() {
xxx_messageInfo_FrameSequence.DiscardUnknown(m)
}
var xxx_messageInfo_FrameSequence proto.InternalMessageInfo
func (m *FrameSequence) GetFrames() []*FrameBuffer {
if m != nil {
return m.Frames
}
return nil
}
type DrawResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DrawResponse) Reset() { *m = DrawResponse{} }
func (m *DrawResponse) String() string { return proto.CompactTextString(m) }
func (*DrawResponse) ProtoMessage() {}
func (*DrawResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4476fbda566a3634, []int{3}
}
func (m *DrawResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DrawResponse.Unmarshal(m, b)
}
func (m *DrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DrawResponse.Marshal(b, m, deterministic)
}
func (m *DrawResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DrawResponse.Merge(m, src)
}
func (m *DrawResponse) XXX_Size() int {
return xxx_messageInfo_DrawResponse.Size(m)
}
func (m *DrawResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DrawResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DrawResponse proto.InternalMessageInfo
func init() {
proto.RegisterEnum("Layer", Layer_name, Layer_value)
proto.RegisterType((*FrameData)(nil), "FrameData")
proto.RegisterType((*FrameBuffer)(nil), "FrameBuffer")
proto.RegisterType((*FrameSequence)(nil), "FrameSequence")
proto.RegisterType((*DrawResponse)(nil), "DrawResponse")
}
func init() { proto.RegisterFile("framebuffer.proto", fileDescriptor_4476fbda566a3634) }
var fileDescriptor_4476fbda566a3634 = []byte{
// 349 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0x4f, 0x6f, 0xaa, 0x40,
0x14, 0xc5, 0xe5, 0x29, 0xbc, 0xc7, 0x55, 0xcc, 0x78, 0xf3, 0x16, 0xe4, 0xc5, 0x05, 0x21, 0x6f,
0x41, 0x6d, 0xa5, 0x8a, 0xb5, 0x7f, 0x96, 0xd6, 0x7f, 0x25, 0x21, 0x90, 0x8c, 0xae, 0xba, 0x69,
0xd0, 0x0e, 0x89, 0xa9, 0x8a, 0x05, 0x4c, 0xd3, 0x6f, 0xd9, 0x8f, 0xd4, 0xcc, 0xd8, 0xd8, 0x31,
0xdd, 0x9d, 0xdf, 0xb9, 0x97, 0x93, 0xcb, 0xc9, 0x40, 0x23, 0xc9, 0xe2, 0x0d, 0x5b, 0xec, 0x93,
0x84, 0x65, 0xee, 0x2e, 0x4b, 0x8b, 0xd4, 0xee, 0x81, 0x3e, 0xe1, 0xe6, 0x28, 0x2e, 0x62, 0x44,
0xa8, 0x3c, 0xa7, 0x45, 0x6e, 0x2a, 0x56, 0xd9, 0xf9, 0x4d, 0x85, 0xe6, 0x5e, 0xb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0xf1, 0x8e, 0x74, 0xbd, 0x25, 0x68, 0xfc, 0x17, 0x59,
0x86, 0x2d, 0xd0, 0xb9, 0x12, 0x3d, 0xe0, 0x49, 0x1f, 0xff, 0x0c, 0x57, 0xae, 0xc1, 0x2e, 0x61,
0x1b, 0xe0, 0xb8, 0x9b, 0x63, 0xdd, 0x3d, 0x29, 0xf7, 0xc7, 0xfa, 0x42, 0x13, 0xef, 0xa4, 0xf7,
0x19, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x99, 0xbe, 0xf0, 0x3c, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// DrawerClient is the client API for Drawer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type DrawerClient interface {
2019-04-12 16:08:54 +08:00
// DrawFrame draws one frame
2019-04-12 15:11:11 +08:00
DrawFrame(ctx context.Context, in *FrameBuffer, opts ...grpc.CallOption) (*DrawResponse, error)
2019-04-12 16:08:54 +08:00
// DrawFrames draws a series of frames
2019-04-12 15:11:11 +08:00
DrawFrames(ctx context.Context, in *FrameSequence, opts ...grpc.CallOption) (*DrawResponse, error)
}
type drawerClient struct {
cc *grpc.ClientConn
}
func NewDrawerClient(cc *grpc.ClientConn) DrawerClient {
return &drawerClient{cc}
}
func (c *drawerClient) DrawFrame(ctx context.Context, in *FrameBuffer, opts ...grpc.CallOption) (*DrawResponse, error) {
out := new(DrawResponse)
err := c.cc.Invoke(ctx, "/Drawer/DrawFrame", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drawerClient) DrawFrames(ctx context.Context, in *FrameSequence, opts ...grpc.CallOption) (*DrawResponse, error) {
out := new(DrawResponse)
err := c.cc.Invoke(ctx, "/Drawer/DrawFrames", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DrawerServer is the server API for Drawer service.
type DrawerServer interface {
2019-04-12 16:08:54 +08:00
// DrawFrame draws one frame
2019-04-12 15:11:11 +08:00
DrawFrame(context.Context, *FrameBuffer) (*DrawResponse, error)
2019-04-12 16:08:54 +08:00
// DrawFrames draws a series of frames
2019-04-12 15:11:11 +08:00
DrawFrames(context.Context, *FrameSequence) (*DrawResponse, error)
}
func RegisterDrawerServer(s *grpc.Server, srv DrawerServer) {
s.RegisterService(&_Drawer_serviceDesc, srv)
}
func _Drawer_DrawFrame_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FrameBuffer)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DrawerServer).DrawFrame(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Drawer/DrawFrame",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DrawerServer).DrawFrame(ctx, req.(*FrameBuffer))
}
return interceptor(ctx, in, info, handler)
}
func _Drawer_DrawFrames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FrameSequence)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DrawerServer).DrawFrames(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Drawer/DrawFrames",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DrawerServer).DrawFrames(ctx, req.(*FrameSequence))
}
return interceptor(ctx, in, info, handler)
}
var _Drawer_serviceDesc = grpc.ServiceDesc{
ServiceName: "Drawer",
HandlerType: (*DrawerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "DrawFrame",
Handler: _Drawer_DrawFrame_Handler,
},
{
MethodName: "DrawFrames",
Handler: _Drawer_DrawFrames_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "framebuffer.proto",
}