2009-11-23 20:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbwin/win_tprn.prg
  * contrib/hbwin/win_prn1.c
    ! Fixed ::SETPEN() and WIN_SETPEN() to not leak objects.
      Patch submitted by Xavi.

  * config/wce/poccarm.mk
  * config/win/pocc.mk
    % Removed some unnecessary logic, thus making it similar to all
      other compiler setups.

  * ChangeLog
    * TODO marked as DONE.
This commit is contained in:
Viktor Szakats
2009-11-23 19:27:18 +00:00
parent 645fa32181
commit 4528304446
5 changed files with 52 additions and 35 deletions

View File

@@ -17,6 +17,20 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-23 20:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/win_tprn.prg
* contrib/hbwin/win_prn1.c
! Fixed ::SETPEN() and WIN_SETPEN() to not leak objects.
Patch submitted by Xavi.
* config/wce/poccarm.mk
* config/win/pocc.mk
% Removed some unnecessary logic, thus making it similar to all
other compiler setups.
* ChangeLog
* TODO marked as DONE.
2009-11-23 16:28 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/mpkg_rpm_win.sh
+ added yet another path for cross-mingw compiler detection
@@ -95,7 +109,7 @@
problems. Please test and if it does, we should add missing
options to LDFLAGS.
; TODO: Clean CPPFLAGS vs. CFLAGS usage in all .mk files.
They should all uniformly use CFLAGS now.
They should all uniformly use CFLAGS now. [DONE]
2009-11-23 09:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/filesys.c

View File

@@ -14,8 +14,7 @@ CC := pocc.exe
CC_IN := -c
CC_OUT := -Fo
CFLAGS := -I.
CFLAGS += -Ze -Go
CFLAGS := -I. -I$(HB_INC_COMPILE) -Ze -Go
LDFLAGS :=
ifneq ($(HB_BUILD_WARN),no)
@@ -32,10 +31,6 @@ endif
# For Pocket PC and ARM processors (including XScale)
CFLAGS += -Tarm-coff -D_M_ARM -D_WINCE
ifneq ($(HB_INC_COMPILE),)
CFLAGS += -I$(HB_INC_COMPILE)
endif
ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -Zi
endif

View File

@@ -14,7 +14,7 @@ CC := pocc.exe
CC_IN := -c
CC_OUT := -Fo
CFLAGS := -I. -Ze -Go -MT
CFLAGS := -I. -I$(HB_INC_COMPILE) -Ze -Go -MT
LDFLAGS :=
ifneq ($(HB_BUILD_WARN),no)
@@ -28,10 +28,6 @@ ifneq ($(HB_BUILD_OPTIM),no)
# -Ox: can cause GPF in 4.50/5.00, so it's disabled.
endif
ifneq ($(HB_INC_COMPILE),)
CFLAGS += -I$(HB_INC_COMPILE)
endif
ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -Zi
endif

View File

@@ -120,7 +120,7 @@ static HB_GARBAGE_FUNC( win_HPEN_release )
if( ph && * ph )
{
/* Destroy the object */
DeleteObject( ( HDC ) * ph );
DeleteObject( ( HPEN ) * ph );
/* set pointer to NULL to avoid multiple freeing */
* ph = NULL;
@@ -159,9 +159,18 @@ HB_FUNC( WIN_CREATEDC )
if( HB_ISCHAR( 1 ) )
{
LPTSTR lpText = HB_TCHAR_CONVTO( hb_parc( 1 ) );
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HDC * ), &s_gc_HDC_funcs );
*ph = ( void * ) CreateDC( TEXT( "" ), lpText, NULL, NULL );
hb_retptrGC( ph );
HDC hDC = CreateDC( TEXT( "" ), lpText, NULL, NULL );
if( hDC )
{
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HDC * ), &s_gc_HDC_funcs );
*ph = hDC;
hb_retptrGC( ph );
}
else
hb_retptr( NULL );
HB_TCHAR_FREE( lpText );
}
else
@@ -663,21 +672,23 @@ HB_FUNC( WIN_SETPEN )
if( hDC )
{
HPEN hOldPen;
HPEN hPen;
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HPEN * ), &s_gc_HPEN_funcs );
hPen = CreatePen( hb_parni( 2 ), /* pen style */
hb_parni( 3 ), /* pen width */
( COLORREF ) hb_parnl( 4 ) /* pen color */
);
* ph = ( void * ) CreatePen( hb_parni( 2 ), /* pen style */
hb_parni( 3 ), /* pen width */
( COLORREF ) hb_parnl( 4 ) /* pen color */
);
if( hPen )
{
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HPEN * ), &s_gc_HPEN_funcs );
hOldPen = ( HPEN ) SelectObject( hDC, ( HPEN ) * ph );
if( hOldPen )
DeleteObject( hOldPen );
hb_retptrGC( ph );
*ph = hPen;
SelectObject( hDC, hPen );
hb_retptrGC( ph );
}
else
hb_retptr( NULL );
}
else

View File

@@ -195,6 +195,7 @@ CREATE CLASS WIN_PRN
VAR BkColor
VAR TextAlign
VAR hPen INIT 0
VAR PenStyle
VAR PenWidth
VAR PenColor
@@ -511,7 +512,7 @@ METHOD SetPen( nStyle, nWidth, nColor ) CLASS WIN_PRN
::PenStyle := nStyle
::PenWidth := nWidth
::PenColor := nColor
RETURN win_SetPen(::hPrinterDC, nStyle, nWidth, nColor )
RETURN ! Empty( ::hPen := win_SetPen(::hPrinterDC, nStyle, nWidth, nColor ) )
METHOD Line( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN
RETURN win_LineTo( ::hPrinterDC, nX1, nY1, nX2, nY2 )
@@ -565,10 +566,10 @@ METHOD SetPrc( nRow, nCol ) CLASS WIN_PRN
::SetPos( ( nCol * ::CharWidth ) + ::LeftMArgin, ( nRow * ::LineHeight ) + ::TopMargin )
RETURN NIL
METHOD PROW() CLASS WIN_PRN
METHOD PRow() CLASS WIN_PRN
RETURN Int( ( ::PosY- ::TopMargin ) / ::LineHeight ) // No test for Div by ZERO
METHOD PCOL() CLASS WIN_PRN
METHOD PCol() CLASS WIN_PRN
RETURN Int( ( ::PosX - ::LeftMargin ) / ::CharWidth ) // Uses width of current character
METHOD MaxRow() CLASS WIN_PRN
@@ -577,16 +578,16 @@ METHOD MaxRow() CLASS WIN_PRN
METHOD MaxCol() CLASS WIN_PRN
RETURN Int( ( ( ::RightMargin - ::LeftMargin ) + 1 ) / ::CharWidth ) - 1
METHOD MM_TO_POSX( nMm ) CLASS WIN_PRN
METHOD MM_To_PosX( nMm ) CLASS WIN_PRN
RETURN Int( ( ( nMM * ::PixelsPerInchX ) / MM_TO_INCH ) - ::LeftMargin )
METHOD MM_TO_POSY( nMm ) CLASS WIN_PRN
METHOD MM_To_PosY( nMm ) CLASS WIN_PRN
RETURN Int( ( ( nMM * ::PixelsPerInchY ) / MM_TO_INCH ) - ::TopMargin )
METHOD INCH_TO_POSX( nInch ) CLASS WIN_PRN
METHOD Inch_To_PosX( nInch ) CLASS WIN_PRN
RETURN Int( ( nInch * ::PixelsPerInchX ) - ::LeftMargin )
METHOD INCH_TO_POSY( nInch ) CLASS WIN_PRN
METHOD Inch_To_PosY( nInch ) CLASS WIN_PRN
RETURN Int( ( nInch * ::PixelsPerInchY ) - ::TopMargin )
METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, nWidth, nBold, lUnderLine, lItalic, nCharSet, lNewLine, lUpdatePosX, nColor, nAlign ) CLASS WIN_PRN