mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-02 19:42:28 +02:00
55 lines
1.8 KiB
C
55 lines
1.8 KiB
C
|
/*
|
||
|
* gfx.h - Generate graphical output for Eeschema items
|
||
|
*
|
||
|
* Written 2016 by Werner Almesberger
|
||
|
* Copyright 2016 by Werner Almesberger
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation; either version 2 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*/
|
||
|
|
||
|
|
||
|
#ifndef GFX_H
|
||
|
#define GFX_H
|
||
|
|
||
|
#include "text.h"
|
||
|
|
||
|
|
||
|
struct gfx_ops {
|
||
|
void (*line)(void *ctx, int sx, int sy, int ex, int ey);
|
||
|
void (*rect)(void *ctx, int sx, int sy, int ex, int ey,
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void (*poly)(void *ctx, int points, int x[points], int y[points],
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void (*circ)(void *ctx, int x, int y, int r,
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void (*arc)(void *ctx, int x, int y, int r, int sa, int ea,
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void (*text)(void *ctx, int x, int y, const char *s, unsigned size,
|
||
|
enum text_align align, int rot, unsigned color, unsigned layer);
|
||
|
void *(*init)(const char *template, int n_vars, const char **vars);
|
||
|
};
|
||
|
|
||
|
|
||
|
/* wrappers */
|
||
|
|
||
|
void gfx_line(int sx, int sy, int ex, int ey);
|
||
|
void gfx_rect(int sx, int sy, int ex, int ey,
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void gfx_poly(int points, int x[points], int y[points],
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void gfx_circ(int x, int y, int r, int color, int fill_color, unsigned layer);
|
||
|
void gfx_arc(int x, int y, int r, int sa, int ea,
|
||
|
int color, int fill_color, unsigned layer);
|
||
|
void gfx_text(int x, int y, const char *s, unsigned size,
|
||
|
enum text_align align, int rot, unsigned color, unsigned layer);
|
||
|
|
||
|
/* inititalization */
|
||
|
|
||
|
void gfx_init(const struct gfx_ops *ops,
|
||
|
const char *template, int n_vars, const char **vars);
|
||
|
|
||
|
#endif /* !GFX_H */
|