2007-10-12 03:24:46 +00:00
|
|
|
|
/**************/
|
|
|
|
|
/* gr_basic.h */
|
|
|
|
|
/**************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#ifndef GR_BASIC
|
|
|
|
|
#define GR_BASIC
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#ifndef COMMON_GLOBL
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#define COMMON_GLOBL extern
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#endif
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#include "colors.h"
|
|
|
|
|
|
|
|
|
|
/* Constantes utiles */
|
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
#define GR_COPY 0
|
|
|
|
|
#define GR_OR 0x01000000
|
|
|
|
|
#define GR_XOR 0x02000000
|
|
|
|
|
#define GR_AND 0x04000000
|
|
|
|
|
#define GR_NXOR 0x08000000
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
#define GR_SURBRILL 0x80000000
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
#define GR_M_LEFT_DOWN 0x10000000
|
|
|
|
|
#define GR_M_RIGHT_DOWN 0x20000000
|
|
|
|
|
#define GR_M_MIDDLE_DOWN 0x40000000
|
|
|
|
|
#define GR_M_DCLICK 0x80000000
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* variables generales */
|
2007-10-12 03:24:46 +00:00
|
|
|
|
COMMON_GLOBL int g_XorMode // = GR_XOR ou GR_NXOR selon couleur de fond
|
|
|
|
|
#ifdef EDA_BASE // pour les trac<61>s en mode XOR
|
2007-06-05 12:10:51 +00:00
|
|
|
|
= GR_NXOR
|
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-10-12 03:24:46 +00:00
|
|
|
|
COMMON_GLOBL int g_DrawBgColor // couleur de fond de la frame de dessin
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef EDA_BASE
|
|
|
|
|
= WHITE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
typedef enum { /* Line styles for Get/SetLineStyle. */
|
|
|
|
|
GR_SOLID_LINE = 0,
|
|
|
|
|
GR_DOTTED_LINE = 1,
|
|
|
|
|
GR_DASHED_LINE = 3
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} GRLineStypeType;
|
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
typedef enum { /* Line widths for Get/SetLineStyle. */
|
|
|
|
|
GR_NORM_WIDTH = 1,
|
|
|
|
|
GR_THICK_WIDTH = 3
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} GRLineWidthType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************/
|
|
|
|
|
/* Prototypage des fonctions definies dans gr_basic.cc */
|
|
|
|
|
/*******************************************************/
|
|
|
|
|
int GRMapX(int x);
|
|
|
|
|
int GRMapY(int y);
|
|
|
|
|
|
|
|
|
|
class WinEDA_DrawPanel;
|
|
|
|
|
void GRMouseWarp(WinEDA_DrawPanel * panel, const wxPoint& pos); /* positionne la souris au point de coord pos */
|
|
|
|
|
|
|
|
|
|
/* routines generales */
|
|
|
|
|
void GRSetDrawMode(wxDC * DC, int mode);
|
|
|
|
|
int GRGetDrawMode(wxDC * DC);
|
|
|
|
|
void GRResetPenAndBrush(wxDC * DC);
|
|
|
|
|
void GRSetColorPen(wxDC * DC, int Color , int width = 1, int stype = wxSOLID);
|
|
|
|
|
void GRSetBrush(wxDC * DC, int Color , int fill = 0);
|
2008-08-09 08:05:42 +00:00
|
|
|
|
|
|
|
|
|
/** function GRForceBlackPen
|
|
|
|
|
* @param flagforce True to force a black pen whenever the asked color
|
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRForceBlackPen(bool flagforce );
|
2008-08-09 08:05:42 +00:00
|
|
|
|
|
|
|
|
|
/** function GetGRForceBlackPenState
|
|
|
|
|
* @return ForceBlackPen (True if a black pen was forced)
|
|
|
|
|
*/
|
|
|
|
|
bool GetGRForceBlackPenState( void );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void SetPenMinWidth(int minwidth); /* ajustage de la largeur mini de plume */
|
|
|
|
|
|
|
|
|
|
void GRLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRDashedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSDashedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRMoveTo(int x, int y);
|
|
|
|
|
void GRSMoveTo(int x, int y);
|
|
|
|
|
void GRLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color);
|
|
|
|
|
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color);
|
|
|
|
|
void GRMoveRel(int x, int y);
|
|
|
|
|
void GRSMoveRel(int x, int y);
|
|
|
|
|
void GRLineRel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color);
|
|
|
|
|
void GRSLineRel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color);
|
|
|
|
|
void GRPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int Fill, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRClosedPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int Fill, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRClosedPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int Fill, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int Fill, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSClosedPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int Fill, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int Color);
|
|
|
|
|
void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color);
|
|
|
|
|
void GRFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color);
|
|
|
|
|
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int Color);
|
|
|
|
|
void GRArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int width, int Color);
|
|
|
|
|
void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int xc, int yc, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int xc, int yc, int width, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int xc, int yc, int width, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int width, int Color);
|
|
|
|
|
void GRFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int StAngle, int EndAngle, int r, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int StAngle, int EndAngle, int r, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int StAngle, int EndAngle, int r, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRFillCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
|
|
|
|
|
void GRSFillCSegm(EDA_Rect * ClipBox, wxDC * DC,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x1, int y1, int x2, int y2, int width, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
void GRSetColor(int Color);
|
2007-09-13 11:55:46 +00:00
|
|
|
|
void GRSetDefaultPalette();
|
|
|
|
|
int GRGetColor();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color);
|
|
|
|
|
void GRSPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color);
|
|
|
|
|
int GRGetPixel(wxDC * DC, int x, int y);
|
|
|
|
|
void GRFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int width, int Color, int BgColor);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int width, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
void GRSRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1,
|
2007-10-12 03:24:46 +00:00
|
|
|
|
int x2, int y2, int width, int Color);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Routines relatives a l'affichage des textes */
|
|
|
|
|
void GRSetFont(wxDC * DC, wxFont * Font);
|
|
|
|
|
void GRResetTextFgColor(wxDC * DC);
|
|
|
|
|
void GRSetTextFgColor(wxDC * DC, int Color);
|
|
|
|
|
void GRSetTextFgColor(wxDC * DC, wxFont * Font, int Color);
|
|
|
|
|
int GRGetTextFgColor(wxDC * DC, wxFont * Font);
|
|
|
|
|
void GRSetTextBgColor(wxDC * DC, int Color);
|
|
|
|
|
void GRSetTextBgColor(wxDC * DC, wxFont * Font, int Color);
|
|
|
|
|
int GRGetTextBgColor(wxDC * DC, wxFont * Font);
|
|
|
|
|
void GRGetTextExtent(wxDC * DC, const wxChar * Text, long * width, long * height);
|
|
|
|
|
|
2007-10-12 03:24:46 +00:00
|
|
|
|
#endif /* define GR_BASIC */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|