2009-02-22 13:06 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/gtxwc/gtxwc.c
    ! fixed typo which caused GPF when palette was set before console window
      initialization

  * harbour/source/rtl/gttrm/gttrm.c
    * reset console color palette to default on application exist
This commit is contained in:
Przemyslaw Czerpak
2009-02-22 12:01:40 +00:00
parent 62545cf25f
commit 5a5b5bc6ee
3 changed files with 29 additions and 2 deletions

View File

@@ -8,6 +8,14 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-02-22 13:06 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/gtxwc/gtxwc.c
! fixed typo which caused GPF when palette was set before console window
initialization
* harbour/source/rtl/gttrm/gttrm.c
* reset console color palette to default on application exist
2009-02-22 00:51 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/gtwvg/wvgtoolb.prg
! Enabled disabling debug calls (requiring xhb) in non-debug mode.

View File

@@ -1580,6 +1580,13 @@ static void hb_gt_trm_LinuxSetPalette( PHB_GTTRM pTerm, int iIndex )
}
}
static void hb_gt_trm_LinuxResetPalette( PHB_GTTRM pTerm )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gt_trm_LinuxResetPalette(%p)", pTerm));
hb_gt_trm_termOut( pTerm, ( BYTE * ) "\033]R", 3 );
}
/*
* XTERM terminal operations
*/
@@ -2120,6 +2127,17 @@ static void hb_gt_trm_SetPalette( PHB_GTTRM pTerm, int iIndex )
}
}
static void hb_gt_trm_ResetPalette( PHB_GTTRM pTerm )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gt_trm_ResetPalette(%p)", pTerm));
if( pTerm->terminal_type == TERM_LINUX ||
( pTerm->terminal_ext & TERM_PUTTY ) )
{
hb_gt_trm_LinuxResetPalette( pTerm );
}
}
static void hb_gt_trm_SetKeyTrans( PHB_GTTRM pTerm, char * pSrcChars, char * pDstChars )
{
int i;
@@ -2987,6 +3005,7 @@ static void hb_gt_trm_Exit( PHB_GT pGT )
removeAllKeyMap( pTerm, &pTerm->pKeyTab );
pTerm->Exit( pTerm );
hb_gt_trm_ResetPalette( pTerm );
if( pTerm->fOutTTY && pTerm->iCol > 0 )
hb_gt_trm_termOut( pTerm, ( BYTE * ) "\n\r", 2 );
hb_gt_trm_termFlush( pTerm );

View File

@@ -3996,7 +3996,7 @@ static BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
{
wnd->colors[ iVal ].value = iColor;
wnd->colors[ iVal ].set = FALSE;
if( hb_gt_xwc_setPalette( wnd ) && wnd->dpy )
if( wnd->dpy && hb_gt_xwc_setPalette( wnd ) )
{
memset( wnd->pCurrScr, 0xFFFFFFFFL, wnd->cols * wnd->rows * sizeof( ULONG ) );
hb_gt_xwc_InvalidateChar( wnd, 0, 0, wnd->cols - 1, wnd->rows - 1 );
@@ -4024,7 +4024,7 @@ static BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
wnd->colors[ iVal ].set = FALSE;
}
}
if( hb_gt_xwc_setPalette( wnd ) && wnd->dpy )
if( wnd->dpy && hb_gt_xwc_setPalette( wnd ) )
{
memset( wnd->pCurrScr, 0xFFFFFFFFL, wnd->cols * wnd->rows * sizeof( ULONG ) );
hb_gt_xwc_InvalidateChar( wnd, 0, 0, wnd->cols - 1, wnd->rows - 1 );