2011-09-27 09:04 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/rtl/gtwvt/gtwvt.c
  * harbour/src/rtl/gtxwc/gtxwc.c
    + allow to use HB_GTI_ONLINE to check if terminal window exists

  * harbour/src/rtl/gtxwc/gtxwc.c
    ! protection against possible GPF when XServer is not accessible
      and user calls HB_GTI_FONTSEL
    * do not activate terminal window by HB_GTI_FONTSEL
    * use maximal logical width of character instead of maximal size
      of character rectangle to calculate width of character cell
This commit is contained in:
Przemyslaw Czerpak
2011-09-27 07:04:21 +00:00
parent c80c0feb2a
commit 37986061a5
3 changed files with 25 additions and 3 deletions

View File

@@ -16,6 +16,18 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-09-27 09:04 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/gtwvt/gtwvt.c
* harbour/src/rtl/gtxwc/gtxwc.c
+ allow to use HB_GTI_ONLINE to check if terminal window exists
* harbour/src/rtl/gtxwc/gtxwc.c
! protection against possible GPF when XServer is not accessible
and user calls HB_GTI_FONTSEL
* do not activate terminal window by HB_GTI_FONTSEL
* use maximal logical width of character instead of maximal size
of character rectangle to calculate width of character cell
2011-09-26 10:57 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbgtcore.h
* harbour/src/rtl/gtclip.c

View File

@@ -2326,6 +2326,10 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE );
break;
case HB_GTI_ONLINE:
pInfo->pResult = hb_itemPutL( pInfo->pResult, pWVT->hWnd != NULL );
break;
case HB_GTI_ISUNICODE:
#if defined( UNICODE )
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE );

View File

@@ -3070,7 +3070,8 @@ static HB_BOOL hb_gt_xwc_SetFont( PXWND_DEF wnd, const char *fontFace,
/* a shortcut for window height and width */
wnd->fontHeight = xfs->max_bounds.ascent + xfs->max_bounds.descent;
wnd->fontWidth = xfs->max_bounds.rbearing - xfs->min_bounds.lbearing;
/* wnd->fontWidth = xfs->max_bounds.rbearing - xfs->min_bounds.lbearing; */
wnd->fontWidth = xfs->max_bounds.width;
wnd->xfs = xfs;
return HB_TRUE;
@@ -3879,7 +3880,6 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_ISSCREENPOS:
case HB_GTI_KBDSUPPORT:
case HB_GTI_ISGRAPHIC:
case HB_GTI_FONTSEL:
hb_gt_xwc_ConnectX( wnd, HB_FALSE );
break;
@@ -3891,6 +3891,7 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_DESKTOPCOLS:
case HB_GTI_DESKTOPROWS:
case HB_GTI_CLIPBOARDDATA:
case HB_GTI_FONTSEL:
hb_gt_xwc_ConnectX( wnd, HB_TRUE );
break;
}
@@ -3904,6 +3905,10 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutL( pInfo->pResult, wnd->dpy != NULL );
break;
case HB_GTI_ONLINE:
pInfo->pResult = hb_itemPutL( pInfo->pResult, wnd->dpy && wnd->window );
break;
case HB_GTI_ISUNICODE:
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE );
break;
@@ -3955,7 +3960,8 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING )
{
HB_XWC_XLIB_LOCK
if( hb_gt_xwc_SetFont( wnd, hb_itemGetCPtr( pInfo->pNewVal ), NULL, 0, NULL ) )
if( hb_gt_xwc_SetFont( wnd, hb_itemGetCPtr( pInfo->pNewVal ), NULL, 0, NULL ) &&
wnd->window )
hb_gt_xwc_CreateWindow( wnd );
HB_XWC_XLIB_UNLOCK
}