metalsvm/apps/gfx_generic.h

84 lines
2.3 KiB
C

/*
* Copyright 2011 Sarah Fischer, Nicolas Berr, Pablo Reble
* Chair for Operating Systems, RWTH Aachen University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of MetalSVM.
*/
#ifndef _GFX_GENERIC_H_
#define _GFX_GENERIC_H_
#include "gfx_client.h"
#if defined(CONFIG_LWIP) && defined(CONFIG_GFX) && LWIP_SOCKET
#define GFX_init(ip_str, port_str, rank) gfx_init(ip_str, port_str, rank)
#define GFX_send(buf, size, tag) gfx_send(buf, size, tag)
#define GFX_finalize() gfx_finalize()
int GFX_update();
int GFX_set_rgb(int index, int r, int g, int b);
int GFX_set_xy(int x, int y);
int GFX_set_hd(int height, int direction);
int GFX_draw_data(char *buf, int len);
int GFX_draw_pixel(int x, int y, int color);
int GFX_draw_line(int x1, int y1, int x2, int y2, int color);
int GFX_draw_box(int x, int y, int height, int width, int color);
int GFX_draw_text(int x, int y, int color, char *text);
int GFX_draw_points(int* points, int num);
int GFX_draw_poly(int *points, int num, int color);
typedef enum _GFX_colors
{
GFX_WHITE = -1,
GFX_BLACK = -2,
GFX_RED = -3,
GFX_DRED = -4,
GFX_GREEN = -5,
GFX_DGREEN = -6,
GFX_BLUE = -7,
GFX_DBLUE = -8,
GFX_CYAN = -9,
GFX_DCYAN = -10,
GFX_MAGENTA = -11,
GFX_DMAGENTA = -12,
GFX_YELLOW = -13,
GFX_DYELLOW = -14,
GFX_GRAY = -15,
GFX_DGRAY = -16
} GFX_colors;
typedef enum GFX_commands
{
GFX_UPDATE = 0,
GFX_USLEEP = 1,
GFX_SET_RGB = 2,
GFX_SET_XY = 3,
GFX_SET_HD = 4,
GFX_DRAW_DATA = 5,
GFX_DRAW_PIXEL = 6,
GFX_DRAW_POINTS = 7,
GFX_DRAW_LINE = 8,
GFX_DRAW_BOX = 9,
GFX_DRAW_POLY = 10,
GFX_DRAW_TEXT = 11
} GFX_commands;
#endif
#endif