diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9cc576c60e..36a720e35d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,28 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-10-07 07:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbct/ctwin.c + + Added HB_C52_STRICT guard around artificial windows + size limits. Please review me. + HB_C52_STRICT macros should be renamed to HB_CLP_STRICT + to reflect usage of recent years, where it's also used + to cover 5.3 strictness f.e.. + + * source/rtl/gtwvt/gtwvt.c + ! Minor formatting. + ! Fixed to use WVT_MAX_COLS instead of WVT_MAX_ROWS in one + place. + + * source/codepage/Makefile + + source/codepage/cpeliso.c + + source/codepage/cptriso.c + + Added two new codepage modules. + Patch submitted by Istvan Bisz. + + * include/hbextcdp.ch + + Added above codepages to codepage list. + 2009-10-07 00:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/Makefile + harbour/source/rtl/hbascii.c @@ -112,7 +134,7 @@ * config/win/msvc.mk + Replaced MSVC specific compiler version setting with generic compiler version setting. - HB_VISUALC_VER_PRE80 and HB_VISUALC_VER_PRE70 setting are + HB_VISUALC_VER_PRE80 and HB_VISUALC_VER_PRE70 settings are deleted and HB_COMPILER_VER is activated. ; INCOMPATIBLE. diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index f14487556b..a45fa8b416 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -74,10 +74,13 @@ static int s_GtId; #define HB_CTW_SETCURRENT(p,n) ( HB_CTW_TSD(p)->iCurrWindow = (n) ) #define HB_CTWIN_ALLOC 16 + +#ifdef HB_C52_STRICT #define HB_CTWIN_MINROWS 1 #define HB_CTWIN_MINCOLS 1 #define HB_CTWIN_MAXROWS 255 #define HB_CTWIN_MAXCOLS 255 +#endif #define HB_CTW_SHADOW_MASK 0x8000000 @@ -334,6 +337,7 @@ static int hb_ctw_SetWindowBoard( PHB_GTCTW pCTW, int iTop, int iLeft, int iBott { HB_TRACE(HB_TR_DEBUG, ("hb_ctw_SetWindowBoard(%p,%d,%d,%d,%d)", pCTW, iTop, iLeft, iBottom, iRight)); +#ifdef HB_C52_STRICT /* * This limitation is only for strict CT3 compatibility, the CTW GTs * can work in practice with any virtual board size and position and @@ -343,6 +347,7 @@ static int hb_ctw_SetWindowBoard( PHB_GTCTW pCTW, int iTop, int iLeft, int iBott iBottom = pCTW->iMapHeight - 1; if( iRight >= pCTW->iMapWidth ) iRight = pCTW->iMapWidth - 1; +#endif if( iTop >= 0 && iLeft >= 0 && iTop < iBottom && iLeft < iRight ) { @@ -629,9 +634,11 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom if( iWidth > pCTW->iBoardRight - pCTW->iBoardLeft + 1 ) iWidth = pCTW->iBoardRight - pCTW->iBoardLeft + 1; +#ifdef HB_C52_STRICT if( iHeight < HB_CTWIN_MINROWS || iWidth < HB_CTWIN_MINCOLS || iHeight > HB_CTWIN_MAXROWS || iWidth > HB_CTWIN_MAXCOLS ) return -1; +#endif iTop = pCTW->iBoardTop - ( pCTW->fBoardTop ? iHeight : 0 ); iBottom = pCTW->iBoardBottom + 1 - ( pCTW->fBoardBottom ? 0 : iHeight ); diff --git a/harbour/include/hbextcdp.ch b/harbour/include/hbextcdp.ch index 7e59568d4e..fae4275c5b 100644 --- a/harbour/include/hbextcdp.ch +++ b/harbour/include/hbextcdp.ch @@ -68,6 +68,7 @@ EXTERNAL HB_CODEPAGE_DE850 EXTERNAL HB_CODEPAGE_DEISO EXTERNAL HB_CODEPAGE_DEWIN EXTERNAL HB_CODEPAGE_EL737 +EXTERNAL HB_CODEPAGE_ELISO EXTERNAL HB_CODEPAGE_ELWIN EXTERNAL HB_CODEPAGE_EN EXTERNAL HB_CODEPAGE_ES850 @@ -121,6 +122,7 @@ EXTERNAL HB_CODEPAGE_SVCLIP EXTERNAL HB_CODEPAGE_SVISO EXTERNAL HB_CODEPAGE_SVWIN EXTERNAL HB_CODEPAGE_TR857 +EXTERNAL HB_CODEPAGE_TRISO EXTERNAL HB_CODEPAGE_TRWIN EXTERNAL HB_CODEPAGE_UA1125 EXTERNAL HB_CODEPAGE_UA1251 diff --git a/harbour/source/codepage/Makefile b/harbour/source/codepage/Makefile index a692e6f84c..61b8418d04 100644 --- a/harbour/source/codepage/Makefile +++ b/harbour/source/codepage/Makefile @@ -17,6 +17,7 @@ C_SOURCES := \ cpdeiso.c \ cpdewin.c \ cpel737.c \ + cpeliso.c \ cpelwin.c \ cpes850.c \ cpes850c.c \ @@ -70,6 +71,7 @@ C_SOURCES := \ cpsviso.c \ cpsvwin.c \ cptr857.c \ + cptriso.c \ cptrwin.c \ cpua1125.c \ cpua866.c \ diff --git a/harbour/source/codepage/cpeliso.c b/harbour/source/codepage/cpeliso.c new file mode 100644 index 0000000000..12db784695 --- /dev/null +++ b/harbour/source/codepage/cpeliso.c @@ -0,0 +1,103 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * National Collation Support Module ( Greek ISO ) + * + * Copyright 2004 Pete Dionisopoulos + * www - http://www.harbour-project.org + * v1.0 2004 Panayotis (Pete) Dionysopoulos + * + * 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, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +/* Language name: Greek WIN*/ +/* ISO language code (2 chars): EL */ +/* Codepage: ISO-8859-7 */ + +#include "hbapi.h" +#include "hbapicdp.h" + +#define NUMBER_OF_CHARACTERS 32 /* The number of single characters in the + alphabet, two-as-one aren't considered + here, accented - are considered. */ +#define IS_LATIN 0 /* Should be 1, if the national alphabet + is based on Latin */ +#define ACCENTED_EQUAL 1 /* Should be 1, if accented character + has the same weight as appropriate + unaccented. */ +#define ACCENTED_INTERLEAVED 0 /* Should be 1, if accented characters + sort after their unaccented counterparts + only if the unaccented versions of all + characters being compared are the same + ( interleaving ) */ + +/* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the + accented characters with the symbol '~' before each of them, for example: + a~€ + If there is two-character sequence, which is considered as one, it should + be marked with '.' before and after it, for example: + ... h.ch.i ... + + The Upper case string and the Lower case string should be absolutely the + same excepting the characters case, of course. + */ + +static HB_CODEPAGE s_codepage = { "ELISO", + HB_CPID_8859_7, HB_UNITB_8859_7, NUMBER_OF_CHARACTERS, + "Á~¶ÂÃÄÅ~¸ÆÇ~¹ÈÉ~ºÊËÌÍÎÏ~¼ÐÑÓÓÔÕ~¾ÖרÙ~¿", + "á~Üâãäå~Ýæç~Þèé~ßêëìíîï~üðñóòôõ~ýö÷øù~þ", + IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; + +HB_CODEPAGE_INIT( ELISO ) + +#if defined( HB_PRAGMA_STARTUP ) + #pragma startup hb_codepage_Init_ELISO +#elif defined( HB_MSC_STARTUP ) + #if defined( HB_OS_WIN_64 ) + #pragma section( HB_MSC_START_SEGMENT, long, read ) + #endif + #pragma data_seg( HB_MSC_START_SEGMENT ) + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ELISO = hb_codepage_Init_ELISO; + #pragma data_seg() +#endif diff --git a/harbour/source/codepage/cptriso.c b/harbour/source/codepage/cptriso.c new file mode 100644 index 0000000000..b031edab51 --- /dev/null +++ b/harbour/source/codepage/cptriso.c @@ -0,0 +1,102 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * National Collation Support Module ( Turkish -- ISO ) + * + * Copyright 2006 Bicahi Esgici + * www - http://www.harbour-project.org + * + * 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, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +/* Language name: Turkish */ +/* ISO language code TR : (please look it up in /doc/lang_id.txt) */ +/* Codepage: ISO-8859-9 */ + +#include "hbapi.h" +#include "hbapicdp.h" + +#define NUMBER_OF_CHARACTERS 34 /* The number of single characters in the + alphabet, two-as-one aren't considered + here, accented - are considered. */ +#define IS_LATIN 1 /* Should be 1, if the national alphabet + is based on Latin */ +#define ACCENTED_EQUAL 0 /* Should be 1, if accented character + has the same weight as appropriate + unaccented. */ +#define ACCENTED_INTERLEAVED 0 /* Should be 1, if accented characters + sort after their unaccented counterparts + only if the unaccented versions of all + characters being compared are the same + ( interleaving ) */ + +/* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the + accented characters with the symbol '~' before each of them, for example: + a~€ + If there is two-character sequence, which is considered as one, it should + be marked with '.' before and after it, for example: + ... h.ch.i ... + + The Upper case string and the Lower case string should be absolutely the + same excepting the characters case, of course. + */ + +static HB_CODEPAGE s_codepage = { "TRISO", + HB_CPID_8859_9, HB_UNITB_8859_9, NUMBER_OF_CHARACTERS, + "AÂBCÇDEÊFGÐHIÝÎJKLMNOÔÖPRSÞTUÛÜVYZ", + "aâbcçdeêfgðhýiîjklmnoôöprsþtuûüvyz", + IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; + +HB_CODEPAGE_INIT( TRISO ) + +#if defined( HB_PRAGMA_STARTUP ) + #pragma startup hb_codepage_Init_TRISO +#elif defined( HB_MSC_STARTUP ) + #if defined( HB_OS_WIN_64 ) + #pragma section( HB_MSC_START_SEGMENT, long, read ) + #endif + #pragma data_seg( HB_MSC_START_SEGMENT ) + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_TRISO = hb_codepage_Init_TRISO; + #pragma data_seg() +#endif diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index aaf1ceb0b2..7d5fa190c1 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -808,7 +808,7 @@ static void hb_gt_wvt_ResetWindowSize( PHB_GTWVT pWVT, HFONT hFont ) #if defined( HB_OS_WIN_CE ) pWVT->FixedFont = FALSE; #else - pWVT->FixedFont = !pWVT->Win9X && pWVT->fontWidth >= 0 && + pWVT->FixedFont = ! pWVT->Win9X && pWVT->fontWidth >= 0 && ( tm.tmPitchAndFamily & TMPF_FIXED_PITCH ) == 0 && ( pWVT->PTEXTSIZE.x == tm.tmMaxCharWidth ); #endif @@ -1539,7 +1539,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) HFONT hFont, hOldFont = NULL; #endif USHORT usChar; - TCHAR text[ WVT_MAX_ROWS ]; + TCHAR text[ WVT_MAX_COLS ]; hdc = BeginPaint( pWVT->hWnd, &ps ); #if defined( UNICODE ) @@ -1783,7 +1783,7 @@ static BOOL hb_gt_wvt_ValidWindowSize( HWND hWnd, int rows, int cols, HFONT hFon TEXTMETRIC tm; RECT rcWorkArea; - SystemParametersInfo( SPI_GETWORKAREA,0, &rcWorkArea, 0 ); + SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 ); maxWidth = ( int ) ( rcWorkArea.right - rcWorkArea.left ); maxHeight = ( int ) ( rcWorkArea.bottom - rcWorkArea.top );