From 5d2c2b27a6323e2666378b986129b2a7c2c39e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 6 Feb 2022 16:04:24 +0100 Subject: New upstream version 5.2.2GA --- app/bin/draw.h | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'app/bin/draw.h') diff --git a/app/bin/draw.h b/app/bin/draw.h index dc01695..4942b8d 100644 --- a/app/bin/draw.h +++ b/app/bin/draw.h @@ -24,7 +24,6 @@ #define DRAW_H #include "common.h" -#include "wlib.h" // drawCmd_t.options // @@ -41,8 +40,13 @@ #define DC_CENTERLINE (1<<4) // TICKS: draw rulers on edges #define DC_TICKS (1<<5) +// TEMP: temp mode draws +#define DC_TEMP (1<<6) +// OUTLINE: use outline font +#define DC_OUTLINE (1<<7) + // Line styles -#define DC_THICK (1<<7) +#define DC_THICK (1<<9) #define DC_DASH (1<<12) #define DC_DOT (1<<13) #define DC_DASHDOT (1<<14) @@ -54,27 +58,28 @@ #define INIT_MAIN_SCALE (8.0) #define INIT_MAP_SCALE (64.0) -#define MAX_MAIN_SCALE (256.0) +#define MAX_MAIN_SCALE (1024.0) #define MIN_MAIN_SCALE (1.0) #define MIN_MAIN_MACRO (0.10) +typedef enum { DRAW_OPEN, DRAW_CLOSED, DRAW_FILL, DRAW_TRANSPARENT } drawFill_e; + typedef struct drawCmd_t * drawCmd_p; typedef struct { - long options; void (*drawLine)(drawCmd_p, coOrd, coOrd, wDrawWidth, wDrawColor); void (*drawArc)(drawCmd_p, coOrd, DIST_T, ANGLE_T, ANGLE_T, BOOL_T, wDrawWidth, wDrawColor); void (*drawString)(drawCmd_p, coOrd, ANGLE_T, char *, wFont_p, FONTSIZE_T, wDrawColor); void (*drawBitMap)(drawCmd_p, coOrd, wDrawBitMap_p, wDrawColor); - void (*drawPoly)(drawCmd_p, int, coOrd *, int *, wDrawColor, wDrawWidth, int, - int); + void (*drawPoly)(drawCmd_p, int, coOrd *, int *, wDrawColor, wDrawWidth, drawFill_e); void (*drawFillCircle)(drawCmd_p, coOrd, DIST_T, wDrawColor); + void (*drawRectangle)(drawCmd_p, coOrd, coOrd, wDrawColor, drawFill_e); } drawFuncs_t; -typedef void (*drawConvertPix2CoOrd)(drawCmd_p, wPos_t, wPos_t, coOrd *); -typedef void (*drawConvertCoOrd2Pix)(drawCmd_p, coOrd, wPos_t *, wPos_t *); +typedef void (*drawConvertPix2CoOrd)(drawCmd_p, wDrawPix_t, wDrawPix_t, coOrd *); +typedef void (*drawConvertCoOrd2Pix)(drawCmd_p, coOrd, wDrawPix_t *, wDrawPix_t *); typedef struct drawCmd_t { wDraw_p d; drawFuncs_t * funcs; @@ -101,8 +106,8 @@ typedef struct drawCmd_t { #define RBORDER (9) #define TBORDER (8) -void Pix2CoOrd(drawCmd_p, wPos_t, wPos_t, coOrd *); -void CoOrd2Pix(drawCmd_p, coOrd, wPos_t *, wPos_t *); +void Pix2CoOrd(drawCmd_p, wDrawPix_t, wDrawPix_t, coOrd *); +void CoOrd2Pix(drawCmd_p, coOrd, wDrawPix_t *, wDrawPix_t *); extern BOOL_T inError; extern DIST_T pixelBins; @@ -115,7 +120,7 @@ extern drawCmd_t mapD; extern drawCmd_t tempD; #define RoomSize (mapD.size) extern coOrd oldMarker; -extern wPos_t closePixels; +extern wDrawPix_t closePixels; #define dragDistance (dragPixels*mainD.scale / mainD.dpi) extern long dragPixels; extern long dragTimeout; @@ -190,8 +195,9 @@ extern drawFuncs_t printDrawFuncs; #define DrawArc( D, P, R, A0, A1, F, W, C ) (D)->funcs->drawArc( D, P, R, A0, A1, F, W, C ) #define DrawString( D, P, A, S, FP, FS, C ) (D)->funcs->drawString( D, P, A, S, FP, FS, C ) #define DrawBitMap( D, P, B, C ) (D)->funcs->drawBitMap( D, P, B, C ) -#define DrawPoly( D, N, P, T, C, W, F, O ) (D)->funcs->drawPoly( D, N, P, T, C, W, F, O ); +#define DrawPoly( D, N, P, T, C, W, O ) (D)->funcs->drawPoly( D, N, P, T, C, W, O ); #define DrawFillCircle( D, P, R, C ) (D)->funcs->drawFillCircle( D, P, R, C ); +#define DrawRectangle( D, P, S, C, O ) (D)->funcs->drawRectangle( D, P, S, C, O ) #define REORIGIN( Q, P, A, O ) { \ (Q) = (P); \ @@ -219,6 +225,8 @@ void DrawHilightPolygon(drawCmd_p, coOrd *, int); #define BOX_INVERT (3) #define BOX_ARROW (4) #define BOX_BACKGROUND (5) +#define BOX_ARROW_BACKGROUND (6) +#define BOX_BOX_BACKGROUND (7) void DrawBoxedString(int, drawCmd_p, coOrd, char *, wFont_p, wFontSize_t, wDrawColor, ANGLE_T); void DrawMultiLineTextSize(drawCmd_p dp, char * text, wFont_p fp, @@ -229,6 +237,9 @@ void DrawTextSize(drawCmd_p, char *, wFont_p, wFontSize_t, BOOL_T, coOrd *); void DrawMultiString(drawCmd_p d, coOrd pos, char * text, wFont_p fp, wFontSize_t fs, wDrawColor color, ANGLE_T a, coOrd * lo, coOrd * hi, BOOL_T boxed); +void TranslateBackground(drawCmd_p drawP, POS_T origX, POS_T origY, + wWinPix_t* posX, + wWinPix_t* posY, wWinPix_t* pWidth); BOOL_T SetRoomSize(coOrd); void GetRoomSize(coOrd *); void DoRedraw(void); @@ -240,12 +251,11 @@ void DrawRuler(drawCmd_p, coOrd, coOrd, DIST_T, int, int, wDrawColor); void MainProc(wWin_p, winProcEvent, void *, void *); void InitInfoBar(void); void DrawInit(int); -void DoZoomUp(void *); -void DoZoomDown(void *); -void DoZoomExtents( void *); -void DoZoom(DIST_T *); -void PanHere(void *); -void PanMenuEnter(int); +void DoZoomUp(void * modeVP); +void DoZoomDown(void * modeVP); +void DoZoomExtents( void * modeVP); +void PanHere(void * modeVP); +void PanMenuEnter(void * modeVP); void InitCmdZoom(wMenu_p, wMenu_p, wMenu_p, wMenu_p); @@ -253,7 +263,7 @@ void InfoPos(coOrd); void InfoCount(wIndex_t); void SetMessage(char *); -wIndex_t panCmdInx; +extern wIndex_t panCmdInx; void InfoSubstituteControls(wControl_p *, char * *); @@ -265,10 +275,10 @@ STATUS_T GridAction(wAction_t, coOrd, coOrd *, DIST_T *); void ResetMouseState(void); void FakeDownMouseState(void); -void GetMousePosition(int *x, int *y); +void GetMousePosition(wDrawPix_t *x, wDrawPix_t *y); void RecordMouse(char *, wAction_t, POS_T, POS_T); extern long playbackDelay; -void MovePlaybackCursor(drawCmd_p, wPos_t, wPos_t, wBool_t, wControl_p); +void MovePlaybackCursor(drawCmd_p, coOrd pos, wBool_t, wControl_p); typedef void (*playbackProc)(wAction_t, coOrd); void PlaybackMouse(playbackProc, drawCmd_p, wAction_t, coOrd, wDrawColor); void RedrawPlaybackCursor(); -- cgit v1.2.3 From a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 3 Jul 2024 10:19:30 +0200 Subject: New upstream version 5.3.0GA --- app/bin/draw.h | 87 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 36 deletions(-) (limited to 'app/bin/draw.h') diff --git a/app/bin/draw.h b/app/bin/draw.h index 4942b8d..0ddf547 100644 --- a/app/bin/draw.h +++ b/app/bin/draw.h @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DRAW_H @@ -44,6 +44,8 @@ #define DC_TEMP (1<<6) // OUTLINE: use outline font #define DC_OUTLINE (1<<7) +// Round pixel pos for performance +#define DC_ROUND (1<<8) // Line styles #define DC_THICK (1<<9) @@ -64,44 +66,48 @@ typedef enum { DRAW_OPEN, DRAW_CLOSED, DRAW_FILL, DRAW_TRANSPARENT } drawFill_e; +struct drawCmd_t; typedef struct drawCmd_t * drawCmd_p; typedef struct { - void (*drawLine)(drawCmd_p, coOrd, coOrd, wDrawWidth, wDrawColor); - void (*drawArc)(drawCmd_p, coOrd, DIST_T, ANGLE_T, ANGLE_T, BOOL_T, wDrawWidth, - wDrawColor); - void (*drawString)(drawCmd_p, coOrd, ANGLE_T, char *, wFont_p, FONTSIZE_T, - wDrawColor); - void (*drawBitMap)(drawCmd_p, coOrd, wDrawBitMap_p, wDrawColor); - void (*drawPoly)(drawCmd_p, int, coOrd *, int *, wDrawColor, wDrawWidth, drawFill_e); - void (*drawFillCircle)(drawCmd_p, coOrd, DIST_T, wDrawColor); - void (*drawRectangle)(drawCmd_p, coOrd, coOrd, wDrawColor, drawFill_e); + void (*drawLine)(drawCmd_p, coOrd, coOrd, wDrawWidth, wDrawColor); + void (*drawArc)(drawCmd_p, coOrd, DIST_T, ANGLE_T, ANGLE_T, BOOL_T, wDrawWidth, + wDrawColor); + void (*drawString)(drawCmd_p, coOrd, ANGLE_T, char *, wFont_p, FONTSIZE_T, + wDrawColor); + void (*drawBitMap)(drawCmd_p, coOrd, wDrawBitMap_p, wDrawColor); + void (*drawPoly)(drawCmd_p, int, coOrd *, int *, wDrawColor, wDrawWidth, + drawFill_e); + void (*drawFillCircle)(drawCmd_p, coOrd, DIST_T, wDrawColor); + void (*drawRectangle)(drawCmd_p, coOrd, coOrd, wDrawColor, drawFill_e); } drawFuncs_t; -typedef void (*drawConvertPix2CoOrd)(drawCmd_p, wDrawPix_t, wDrawPix_t, coOrd *); -typedef void (*drawConvertCoOrd2Pix)(drawCmd_p, coOrd, wDrawPix_t *, wDrawPix_t *); +typedef void (*drawConvertPix2CoOrd)(drawCmd_p, wDrawPix_t, wDrawPix_t, + coOrd *); +typedef void (*drawConvertCoOrd2Pix)(drawCmd_p, coOrd, wDrawPix_t *, + wDrawPix_t *); typedef struct drawCmd_t { - wDraw_p d; - drawFuncs_t * funcs; - unsigned long options; - DIST_T scale; - ANGLE_T angle; - coOrd orig; - coOrd size; - drawConvertPix2CoOrd Pix2CoOrd; - drawConvertCoOrd2Pix CoOrd2Pix; - FLOAT_T dpi; + wDraw_p d; + drawFuncs_t * funcs; + unsigned long options; + DIST_T scale; + ANGLE_T angle; + coOrd orig; + coOrd size; + drawConvertPix2CoOrd Pix2CoOrd; + drawConvertCoOrd2Pix CoOrd2Pix; + FLOAT_T dpi; } drawCmd_t; #define SCALEX(D,X) ((X)/(D).dpi) #define SCALEY(D,Y) ((Y)/(D).dpi) #ifdef WINDOWS - #define LBORDER (33) - #define BBORDER (32) +#define LBORDER (33) +#define BBORDER (32) #else - #define LBORDER (26) - #define BBORDER (27) +#define LBORDER (26) +#define BBORDER (27) #endif #define RBORDER (9) #define TBORDER (8) @@ -120,7 +126,6 @@ extern drawCmd_t mapD; extern drawCmd_t tempD; #define RoomSize (mapD.size) extern coOrd oldMarker; -extern wDrawPix_t closePixels; #define dragDistance (dragPixels*mainD.scale / mainD.dpi) extern long dragPixels; extern long dragTimeout; @@ -129,12 +134,16 @@ extern long minGridSpacing; extern long drawCount; extern BOOL_T drawEnable; extern long currRedraw; +extern long constrainMain; +extern long liveMap; +extern long descriptionFontSize; extern coOrd panCenter; extern coOrd menuPos; extern int log_pan; +extern wBool_t wDrawDoTempDraw; extern wDrawColor drawColorBlack; extern wDrawColor drawColorWhite; @@ -142,8 +151,13 @@ extern wDrawColor drawColorRed; extern wDrawColor drawColorBlue; extern wDrawColor drawColorGreen; extern wDrawColor drawColorAqua; +extern wDrawColor drawColorDkRed; +extern wDrawColor drawColorDkBlue; +extern wDrawColor drawColorDkGreen; +extern wDrawColor drawColorDkAqua; extern wDrawColor drawColorPowderedBlue; extern wDrawColor drawColorPurple; +extern wDrawColor drawColorMagenta; extern wDrawColor drawColorGold; extern wDrawColor drawColorGrey10; extern wDrawColor drawColorGrey20; @@ -219,14 +233,15 @@ extern drawFuncs_t printDrawFuncs; void DrawHilight(drawCmd_p, coOrd, coOrd, BOOL_T add); void DrawHilightPolygon(drawCmd_p, coOrd *, int); -#define BOX_NONE (0) -#define BOX_UNDERLINE (1) -#define BOX_BOX (2) -#define BOX_INVERT (3) -#define BOX_ARROW (4) -#define BOX_BACKGROUND (5) -#define BOX_ARROW_BACKGROUND (6) -#define BOX_BOX_BACKGROUND (7) +#define BOX_NONE (0) // do not draw a frame around text +#define BOX_UNDERLINE (1) // draw underline under text only +#define BOX_BOX (2) // draw a frame around text +#define BOX_INVERT (3) // invert colors, text is drawn gray +#define BOX_ARROW (4) // box has a connector +#define BOX_BACKGROUND (5) // draw box with backgound only, no frame +#define BOX_ARROW_BACKGROUND (6) // box has a connector and background +#define BOX_BOX_BACKGROUND (7) // draw complete frame and background + void DrawBoxedString(int, drawCmd_p, coOrd, char *, wFont_p, wFontSize_t, wDrawColor, ANGLE_T); void DrawMultiLineTextSize(drawCmd_p dp, char * text, wFont_p fp, @@ -241,7 +256,6 @@ void TranslateBackground(drawCmd_p drawP, POS_T origX, POS_T origY, wWinPix_t* posX, wWinPix_t* posY, wWinPix_t* pWidth); BOOL_T SetRoomSize(coOrd); -void GetRoomSize(coOrd *); void DoRedraw(void); void SetMainSize(void); void MainRedraw(void); @@ -250,6 +264,7 @@ void TempRedraw(void); void DrawRuler(drawCmd_p, coOrd, coOrd, DIST_T, int, int, wDrawColor); void MainProc(wWin_p, winProcEvent, void *, void *); void InitInfoBar(void); +void InitColor(void); void DrawInit(int); void DoZoomUp(void * modeVP); void DoZoomDown(void * modeVP); -- cgit v1.2.3