diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1dabb4c204..a0bff8f0dc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,19 @@ +2000-03-20 21:55 GMT-5 David G. Holm + + * config/os2/icc.cf + * config/w32/bcc32.cf + + Added HB_GT_LIB support + + * source/rtl/gtdos/gtdos.c + * source/rtl/gtos2/gtos2.c + * source/rtl/gtwin/gtwin.c + + Added Copyright notice for hb_gt_ReadKey() + + Added missing conditionals and includes to gtos2.c for ICC + + Added hb_gt_Version() to gtos2.c + - Removed GCC conditionals and includes from gtos2.c, because + gtos2.c doesn't support GCC for screen output, so there is + little point in including keyboard input or sound suport. + 20000321-02:00 GMT+1 Victor Szakats + source/vm/runner.c diff --git a/harbour/config/os2/icc.cf b/harbour/config/os2/icc.cf index 5448e7a02f..73157a4a73 100644 --- a/harbour/config/os2/icc.cf +++ b/harbour/config/os2/icc.cf @@ -37,6 +37,19 @@ LINKLIBS += $(foreach lib, $(HB_DB_DRIVERS), $(lib)$(LIB_EXT)) endif endif +# Add the specified GT driver library +ifeq ($(findstring rtl,$(LIBS)),rtl) +LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(ARCH)/$(HB_GT_LIB)$(LIB_EXT) +endif + +# HB_SCREEN_LIB: empty, or one of ncurses, slang +# HB_SCREEN_LIB=ncurses +# HB_SCREEN_LIB=slang + +ifneq ($(HB_SCREEN_LIB),) +LINKLIBS += $(HB_SCREEN_LIB) +endif + AR = ilib ARFLAGS = /NOE /NOIgnoreCase AROBJS = $(foreach file, $^, -+$(file)) diff --git a/harbour/config/w32/bcc32.cf b/harbour/config/w32/bcc32.cf index 9cacbe2026..3a6540e5e2 100644 --- a/harbour/config/w32/bcc32.cf +++ b/harbour/config/w32/bcc32.cf @@ -48,6 +48,19 @@ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), $(drv)$(LIB_EXT)) endif endif +# Add the specified GT driver library +ifeq ($(findstring rtl,$(LIBS)),rtl) +LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(ARCH)/$(HB_GT_LIB)$(LIB_EXT) +endif + +# HB_SCREEN_LIB: empty, or one of ncurses, slang +# HB_SCREEN_LIB=ncurses +# HB_SCREEN_LIB=slang + +ifneq ($(HB_SCREEN_LIB),) +LINKLIBS += $(HB_SCREEN_LIB) +endif + LDFLAGS = $(LINKPATHS) AR = tlib diff --git a/harbour/source/rtl/gtdos/gtdos.c b/harbour/source/rtl/gtdos/gtdos.c index 6fc4dc5af7..617568bff2 100644 --- a/harbour/source/rtl/gtdos/gtdos.c +++ b/harbour/source/rtl/gtdos/gtdos.c @@ -41,6 +41,9 @@ * hb_gt_CtrlBrkHandler() * hb_gt_CtrlBrkRestore() * + * Copyright 1999 David G. Holm + * hb_gt_ReadKey() + * * See doc/license.txt for licensing terms. * */ diff --git a/harbour/source/rtl/gtos2/gtos2.c b/harbour/source/rtl/gtos2/gtos2.c index 40e408f963..8f32245211 100644 --- a/harbour/source/rtl/gtos2/gtos2.c +++ b/harbour/source/rtl/gtos2/gtos2.c @@ -37,6 +37,9 @@ * The following parts are Copyright of the individual authors. * www - http://www.harbour-project.org * + * Copyright 1999 David G. Holm + * hb_gt_ReadKey() + * * Copyright 1999 Chen Kedem * hb_gt_Tone() * @@ -52,18 +55,16 @@ /* NOTE: User programs should never call this layer directly! */ #define INCL_VIO +#define INCL_DOSPROCESS #define INCL_NOPMAPI #include #include +#include +#include #include "hbapigt.h" - -#if defined(HARBOUR_GCC_OS2) - ULONG DosBeep( ULONG ulFrequency, ULONG ulDuration ); -#else - #include -#endif +#include "inkey.ch" static char hb_gt_GetCellSize( void ); static void hb_gt_SetCursorSize( char start, char end, int visible ); @@ -106,20 +107,6 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey(%d)", (int) event_mask)); -#if defined(HARBOUR_GCC_OS2) - - /* Read from the keyboard with no echo, no wait, and no SIGSEV on Ctrl-C */ - ch = _read_kbd( 0, 0, 0 ); - if( ch == 0 ) - { - /* It's a function key lead-in, so read the function key scan code */ - ch = _read_kbd( 0, 0, 0 ); - if( ch != -1 ) ch += 256; /* If it's really a scan code, offset it */ - } - /* _read_kbd() returns -1 for no key, the switch statement will handle - this. */ -#else - if( kbhit() ) { /* A key code is available in the BIOS keyboard buffer, so read it */ @@ -136,13 +123,12 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) the actual function key and then offset it by 256, unless extended keyboard events are allowed, in which case offset it by 512 */ - if( s_eventmask & INKEY_EXTENDED ) ch = getch() + 512; + if( eventmask & INKEY_EXTENDED ) ch = getch() + 512; else ch = getch() + 256; } } else ch = 0; -#endif /* Perform key translations */ switch( ch ) @@ -603,11 +589,7 @@ void hb_gt_Tone( double dFrequency, double dDuration ) while( dDuration > 0.0 ) { -#if defined(HB_TONE_OS2_GCC) - ULONG temp = ( ULONG ) HB_MIN_( HB_MAX_( 0, dDuration ), ULONG_MAX ); -#else USHORT temp = ( USHORT ) HB_MIN_( HB_MAX_( 0, dDuration ), USHRT_MAX ); -#endif dDuration -= temp; if( temp <= 0 ) @@ -618,11 +600,7 @@ void hb_gt_Tone( double dFrequency, double dDuration ) } else { -#if defined(HB_TONE_OS2_GCC) - DosBeep( ( ULONG ) dFrequency, temp ); -#else DosBeep( ( USHORT ) dFrequency, temp ); -#endif } } } diff --git a/harbour/source/rtl/gtwin/gtwin.c b/harbour/source/rtl/gtwin/gtwin.c index 003e6495ab..a93f310709 100644 --- a/harbour/source/rtl/gtwin/gtwin.c +++ b/harbour/source/rtl/gtwin/gtwin.c @@ -43,6 +43,9 @@ * Copyright 1999 David G. Holm * hb_gt_Tone() * + * Copyright 1999 David G. Holm + * hb_gt_ReadKey() + * * See doc/license.txt for licensing terms. * */ @@ -280,7 +283,12 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) /* Save the keyboard state and ASCII key code */ DWORD dwState = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.dwControlKeyState; ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.AsciiChar; - if( ch < 0 ) + if( ch == 224 ) + { + /* Strip extended key lead-in codes */ + ch = 0; + } + else if( ch < 0 ) { /* Process international key codes */ ch += 256;