From 2e49f35f34221f928d4ab193ed4fce83b6e4581e Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 8 Sep 2011 20:00:36 +0000 Subject: [PATCH] 2011-09-08 22:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/gtxwc/gtxwc.h * harbour/src/rtl/gtxwc/gtxwc.c * cleaned macro names --- harbour/ChangeLog | 5 +++++ harbour/src/rtl/gtxwc/gtxwc.c | 34 +++++++++++++++++----------------- harbour/src/rtl/gtxwc/gtxwc.h | 27 ++++++++++++++------------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eeef38078f..b0b6ac0687 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-09-08 22:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/gtxwc/gtxwc.h + * harbour/src/rtl/gtxwc/gtxwc.c + * cleaned macro names + 2011-09-07 18:32 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * doc/howtosvn.txt + added extra rules to "1.3 Here's how to format your ChangeLog entries" diff --git a/harbour/src/rtl/gtxwc/gtxwc.c b/harbour/src/rtl/gtxwc/gtxwc.c index 7cbb02c111..1593352177 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.c +++ b/harbour/src/rtl/gtxwc/gtxwc.c @@ -520,18 +520,18 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT switch( usCh ) { - case HB_GTXVG_FILLER1: - case HB_GTXVG_FILLER2: - case HB_GTXVG_FILLER3: + case HB_GTXWC_FILLER1: + case HB_GTXWC_FILLER2: + case HB_GTXWC_FILLER3: { int x, y, xx, yy, skip, start, mod; - if( usCh == HB_GTXVG_FILLER1 ) + if( usCh == HB_GTXWC_FILLER1 ) { skip = 4; start = mod = 1; } - else if( usCh == HB_GTXVG_FILLER2 ) + else if( usCh == HB_GTXWC_FILLER2 ) { skip = 2; start = 0; @@ -563,11 +563,11 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT size++; } } - type = CH_PTS; + type = size == 0 ? CH_NONE : CH_PTS; break; } - case HB_GTXVG_ARROW_R: + case HB_GTXWC_ARROW_R: i = HB_MIN( ( celly >> 1 ), cellx ) - 3; pts[0].x = ( ( cellx - i ) >> 1 ); pts[0].y = ( celly >> 1 ) - i; @@ -579,7 +579,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_POLY; break; - case HB_GTXVG_ARROW_L: + case HB_GTXWC_ARROW_L: i = HB_MIN( ( celly >> 1 ), cellx ) - 3; pts[0].x = ( ( cellx - i ) >> 1 ) + i; pts[0].y = ( celly >> 1 ) - i; @@ -591,7 +591,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_POLY; break; - case HB_GTXVG_ARROW_U: + case HB_GTXWC_ARROW_U: i = HB_MIN( celly, cellx >> 1 ); pts[0].x = ( cellx >> 1 ) - i; pts[0].y = ( ( celly - i ) >> 1 ) + i; @@ -603,7 +603,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_POLY; break; - case HB_GTXVG_ARROW_D: + case HB_GTXWC_ARROW_D: i = HB_MIN( celly, cellx >> 1 ); pts[0].x = ( cellx >> 1 ) - i; pts[0].y = ( ( celly - i ) >> 1 ); @@ -615,14 +615,14 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_POLY; break; - case HB_GTXVG_FULL: + case HB_GTXWC_FULL: inverse = HB_TRUE; type = CH_NONE; break; - case HB_GTXVG_FULL_B: + case HB_GTXWC_FULL_B: inverse = HB_TRUE; - case HB_GTXVG_FULL_T: + case HB_GTXWC_FULL_T: rect[0].x = 0; rect[0].y = 0; rect[0].width = cellx; @@ -631,9 +631,9 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_RECT; break; - case HB_GTXVG_FULL_R: + case HB_GTXWC_FULL_R: inverse = HB_TRUE; - case HB_GTXVG_FULL_L: + case HB_GTXWC_FULL_L: rect[0].x = 0; rect[0].y = 0; rect[0].width = cellx/2; @@ -1453,7 +1453,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT type = CH_SEG; break; - case HB_GTXVG_SQUARE: + case HB_GTXWC_SQUARE: rect[0].width = cellx - HB_MAX(cellx >> 2, 2); rect[0].height = rect[0].width; rect[0].x = ( ( cellx - rect[0].width ) >> 1 ); @@ -1473,7 +1473,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT */ } - if( size > 0 ) + if( type != CH_CHAR ) { bxCh->type = type; bxCh->u.ch16 = usCh; diff --git a/harbour/src/rtl/gtxwc/gtxwc.h b/harbour/src/rtl/gtxwc/gtxwc.h index 347f3c9f39..8d000f82c3 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.h +++ b/harbour/src/rtl/gtxwc/gtxwc.h @@ -95,6 +95,7 @@ typedef HB_USHORT HB_GT_CELLTYPE; #define XWC_DEFAULT_COLS 80 #define XWC_MAX_BUTTONS 8 #define XWC_MAX_CHAR_POINTS 1024 +#define XWC_MAX_CHAR_RECTS ( XWC_MAX_CHAR_POINTS / 2 ) /* Font definition */ #define XWC_DEFAULT_FONT_HEIGHT 18 @@ -183,10 +184,10 @@ typedef HB_USHORT HB_GT_CELLTYPE; KeyPressMask | KeyReleaseMask ) /* Box char unicode values */ -#define HB_GTXVG_ARROW_R 0x0010 -#define HB_GTXVG_ARROW_L 0x0011 -#define HB_GTXVG_ARROW_U 0x001E -#define HB_GTXVG_ARROW_D 0x001F +#define HB_GTXWC_ARROW_R 0x0010 /* ARROW RIGHT */ +#define HB_GTXWC_ARROW_L 0x0011 /* ARROW LEFT */ +#define HB_GTXWC_ARROW_U 0x001E /* ARROW UP */ +#define HB_GTXWC_ARROW_D 0x001F /* ARROW DOWN */ #define HB_GTXWC_DBL_LT 0x2554 /* BOX DRAWINGS DOUBLE DOWN AND RIGHT (Double left top angle) */ #define HB_GTXWC_DBL_TD 0x2566 /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL (Double top with junction down) */ @@ -244,17 +245,17 @@ typedef HB_USHORT HB_GT_CELLTYPE; #define HB_GTXWC_DBL_V_SNG_L 0x255F /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE (Double vertical single right junction) */ #define HB_GTXWC_DBL_SNG_CRS 0x256B /* BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE (Double cross (single horiz) */ -#define HB_GTXVG_FULL 0x2588 /* FULL BLOCK */ -#define HB_GTXVG_FULL_B 0x2584 /* LOWER HALF BLOCK */ -#define HB_GTXVG_FULL_L 0x258C /* LEFT HALF BLOCK */ -#define HB_GTXVG_FULL_R 0x2590 /* RIGHT HALF BLOCK */ -#define HB_GTXVG_FULL_T 0x2580 /* UPPER HALF BLOCK */ +#define HB_GTXWC_FULL 0x2588 /* FULL BLOCK */ +#define HB_GTXWC_FULL_B 0x2584 /* LOWER HALF BLOCK */ +#define HB_GTXWC_FULL_L 0x258C /* LEFT HALF BLOCK */ +#define HB_GTXWC_FULL_R 0x2590 /* RIGHT HALF BLOCK */ +#define HB_GTXWC_FULL_T 0x2580 /* UPPER HALF BLOCK */ -#define HB_GTXVG_FILLER1 0x2591 /* LIGHT SHADE */ -#define HB_GTXVG_FILLER2 0x2592 /* MEDIUM SHADE */ -#define HB_GTXVG_FILLER3 0x2593 /* DARK SHADE */ +#define HB_GTXWC_FILLER1 0x2591 /* LIGHT SHADE */ +#define HB_GTXWC_FILLER2 0x2592 /* MEDIUM SHADE */ +#define HB_GTXWC_FILLER3 0x2593 /* DARK SHADE */ -#define HB_GTXVG_SQUARE 0x25A0 /* BLACK SQUARE */ +#define HB_GTXWC_SQUARE 0x25A0 /* BLACK SQUARE */ /********************** Unix to graphic box translation ******************/