From 3978396f54540039f1a4f54d9ff7eeefe6d7621d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 9 Oct 2012 18:33:17 +0000 Subject: [PATCH] 2012-10-09 20:27 UTC+0200 Viktor Szakats (harbour syenar.net) * extras/gfspell/gfspell.hbp * extras/gtwvw/gtwvw.hbp * extras/hbvpdf/hbvpdf.hbp * extras/hbxlsxml/hbxlsxml.hbp * extras/ps32/ps32.hbp * extras/rddado/rddado.hbp * extras/superlib/superlib.hbp + added $hb_pkg_install.hbm so they now all will automatically install into /addons/ * extras/gtwvw/tests/hbmk.hbm * extras/hbvpdf/tests/hbmk.hbm * extras/ps32/tests/hbmk.hbm * extras/rddado/tests/hbmk.hbm * deleted relative dir from .hbc file references + extras/hbxlsxml/hbxlsxml.hbc * extras/hbxlsxml/tests/hbmk.hbm + added missing .hbc file * extras/hbusb/hbusb.hbc * deleted dll related leftovers that only work with contribs - extras/commouse - extras/commouse/commouse.prg + tests/commouse.prg * moved to /tests/ --- harbour/ChangeLog | 30 ++++++ harbour/extras/commouse/commouse.prg | 133 ------------------------ harbour/extras/gfspell/gfspell.hbp | 4 +- harbour/extras/gtwvw/gtwvw.hbp | 2 + harbour/extras/gtwvw/tests/hbmk.hbm | 2 +- harbour/extras/hbusb/hbusb.hbc | 2 +- harbour/extras/hbvpdf/hbvpdf.hbp | 4 +- harbour/extras/hbvpdf/tests/hbmk.hbm | 2 +- harbour/extras/hbxlsxml/hbxlsxml.hbc | 8 ++ harbour/extras/hbxlsxml/hbxlsxml.hbp | 2 + harbour/extras/hbxlsxml/tests/hbmk.hbm | 9 +- harbour/extras/ps32/ps32.hbp | 4 +- harbour/extras/ps32/tests/hbmk.hbm | 4 +- harbour/extras/rddado/rddado.hbp | 4 +- harbour/extras/rddado/tests/hbmk.hbm | 2 +- harbour/extras/superlib/superlib.hbp | 2 + harbour/tests/commouse.prg | 135 +++++++++++++++++++++++++ 17 files changed, 196 insertions(+), 153 deletions(-) delete mode 100644 harbour/extras/commouse/commouse.prg create mode 100644 harbour/extras/hbxlsxml/hbxlsxml.hbc create mode 100644 harbour/tests/commouse.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 71f46cffb6..279e491f90 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,36 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-09 20:27 UTC+0200 Viktor Szakats (harbour syenar.net) + * extras/gfspell/gfspell.hbp + * extras/gtwvw/gtwvw.hbp + * extras/hbvpdf/hbvpdf.hbp + * extras/hbxlsxml/hbxlsxml.hbp + * extras/ps32/ps32.hbp + * extras/rddado/rddado.hbp + * extras/superlib/superlib.hbp + + added $hb_pkg_install.hbm so they now all will + automatically install into /addons/ + + * extras/gtwvw/tests/hbmk.hbm + * extras/hbvpdf/tests/hbmk.hbm + * extras/ps32/tests/hbmk.hbm + * extras/rddado/tests/hbmk.hbm + * deleted relative dir from .hbc file references + + + extras/hbxlsxml/hbxlsxml.hbc + * extras/hbxlsxml/tests/hbmk.hbm + + added missing .hbc file + + * extras/hbusb/hbusb.hbc + * deleted dll related leftovers that only work + with contribs + + - extras/commouse + - extras/commouse/commouse.prg + + tests/commouse.prg + * moved to /tests/ + 2012-10-09 19:49 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg ! minor fix to prev to properly parent built-in hbm files diff --git a/harbour/extras/commouse/commouse.prg b/harbour/extras/commouse/commouse.prg deleted file mode 100644 index d8d849fb63..0000000000 --- a/harbour/extras/commouse/commouse.prg +++ /dev/null @@ -1,133 +0,0 @@ -/* - * $Id$ - */ - -#include "hbcom.ch" - -PROC main( cParam ) -LOCAL nPort, cBuf, cBuffer, nLen, nType, lL, lM, lR, nX, nY - - IF cParam == NIL - ? "Usage: commouse [ nPort | cDevice ]" - RETURN - ENDIF - - nPort := VAL( cParam ) - IF nPort == 0 - ? "Using device:", cParam - nPort := 1 - hb_comSetDevice( nPort, cParam ) - ELSE - ? "Using port number:", nPort - ENDIF - - IF ! hb_comOpen( nPort ) - ? "Unable to open port. Error:", hb_comGetError( nPort ), " OS error:", hb_comGetOsError( nPort ) - RETURN - ENDIF - - IF ! hb_comInit( nPort, 1200, "N", 8, 1 ) - ? "Unable to initialize port. Error:", hb_comGetError( nPort ), " OS error:", hb_comGetOsError( nPort ) - hb_comClose( nPort ) - RETURN - ENDIF - - hb_comMCR( nPort,, HB_COM_MCR_DTR + HB_COM_MCR_RTS ) - hb_idleSleep( 0.1 ) - hb_comFlush( nPort ) - hb_comMCR( nPort,,, HB_COM_MCR_DTR + HB_COM_MCR_RTS ) - - cBuf := SPACE( 256 ) - IF ( nLen := hb_comRecv( nPort, @cBuf,, 500 ) ) > 0 - IF hb_BCode( cBuf ) == 0xCD - ? "Bingo: 2 button mouse detected!" - nType := 2 - cBuffer := HB_BSUBSTR( cBuf, 2, nLen - 1 ) - ELSE - cBuffer := HB_BLEFT( cBuf, nLen ) - ENDIF - ELSE - cBuffer := "" - ENDIF - - IF nType == NIL - ? "Mouse not detected, assuming 3 button mouse" - nType := 3 - ENDIF - - ? "Press any key to exit..." - DO WHILE ( nLen := INKEY() ) == 0 - IF ( nLen := hb_comRecv( nPort, @cBuf ) ) > 0 - cBuffer += HB_BLEFT( cBuf, nLen ) - ENDIF - IF HB_BLEN( cBuffer ) == 0 - hb_idleSleep( 0.05 ) - LOOP - ENDIF - IF nType == 2 - IF hb_bitAnd( hb_BCode( cBuffer ), 0xC0 ) != 0xC0 - cBuffer := HB_BSUBSTR( cBuffer, 2 ) - ELSEIF HB_BLEN( cBuffer ) >= 3 - lR := hb_bitAnd( hb_BCode( cBuffer ), 0x10 ) != 0 - lL := hb_bitAnd( hb_BCode( cBuffer ), 0x20 ) != 0 - nX := hb_bitAnd( hb_BCode( cBuffer ), 3 ) * 64 + hb_bitAnd( hb_BCode( HB_BSUBSTR( cBuffer, 2 ) ), 0x3F ) - IF nX > 127 - nX -= 256 - ENDIF - nY := hb_bitAnd( hb_BCode( cBuffer ), 0x0C ) * 16 + hb_bitAnd( hb_BCode( HB_BSUBSTR( cBuffer, 3 ) ), 0x3F ) - IF nY > 127 - nY -= 256 - ENDIF - ? "dX,dY:", STR( nX, 4 ), STR( nY, 4 ), " " - IF lL - ?? "LEFT " - ENDIF - IF lR - ?? "RIGHT" - ENDIF - cBuffer := HB_BSUBSTR( cBuffer, 4 ) - ENDIF - ELSEIF nType == 3 - IF hb_bitAnd( hb_BCode( cBuffer ), 0xC0 ) != 0x80 - cBuffer := HB_BSUBSTR( cBuffer, 2 ) - ELSEIF HB_BLEN( cBuffer ) >= 4 - lR := hb_bitAnd( hb_BCode( cBuffer ), 1 ) == 0 - lM := hb_bitAnd( hb_BCode( cBuffer ), 2 ) == 0 - lL := hb_bitAnd( hb_BCode( cBuffer ), 4 ) == 0 - nI := hb_BCode( HB_BSUBSTR( cBuffer, 2 ) ) - IF nI > 127 - nI -= 256 - ENDIF - nX := nI - nI := hb_BCode( HB_BSUBSTR( cBuffer, 4 ) ) - IF nI > 127 - nI -= 256 - ENDIF - nX += nI - nI := hb_BCode( HB_BSUBSTR( cBuffer, 3 ) ) - IF nI > 127 - nI -= 256 - ENDIF - nY := - nI - nI := hb_BCode( HB_BSUBSTR( cBuffer, 5 ) ) - IF nI > 127 - nI -= 256 - ENDIF - nY -= nI - ? "dX,dY:", STR( nX, 4 ), STR( nY, 4 ), " " - IF lL - ?? "LEFT " - ENDIF - IF lM - ?? "MIDDLE " - ENDIF - IF lR - ?? "RIGHT" - ENDIF - cBuffer := HB_BSUBSTR( cBuffer, 5 ) - ENDIF - - ENDIF - ENDDO - hb_comClose( nPort ) -RETURN diff --git a/harbour/extras/gfspell/gfspell.hbp b/harbour/extras/gfspell/gfspell.hbp index d3cb52d361..427ba7c246 100644 --- a/harbour/extras/gfspell/gfspell.hbp +++ b/harbour/extras/gfspell/gfspell.hbp @@ -9,7 +9,7 @@ -w1 -es2 --instfile=inc:spell.ch - spell.prg spellc.c + +$hb_pkg_install.hbm diff --git a/harbour/extras/gtwvw/gtwvw.hbp b/harbour/extras/gtwvw/gtwvw.hbp index 7fd23cad2f..44e118fd16 100644 --- a/harbour/extras/gtwvw/gtwvw.hbp +++ b/harbour/extras/gtwvw/gtwvw.hbp @@ -27,3 +27,5 @@ wvwtbar.c -cpp=no # NOTE: Due to large quantity of unprecise code, it doesn't build in C++ mode. -warn=no + +$hb_pkg_install.hbm diff --git a/harbour/extras/gtwvw/tests/hbmk.hbm b/harbour/extras/gtwvw/tests/hbmk.hbm index 26a117e9c4..2df32b17b1 100644 --- a/harbour/extras/gtwvw/tests/hbmk.hbm +++ b/harbour/extras/gtwvw/tests/hbmk.hbm @@ -2,7 +2,7 @@ # $Id$ # -../gtwvw.hbc +gtwvw.hbc # NOTE: Disabled until test code is cleaned/fixed. #-w3 -es2 diff --git a/harbour/extras/hbusb/hbusb.hbc b/harbour/extras/hbusb/hbusb.hbc index 1e5dde3cd4..ac2681b21a 100644 --- a/harbour/extras/hbusb/hbusb.hbc +++ b/harbour/extras/hbusb/hbusb.hbc @@ -5,7 +5,7 @@ incpaths=. libpaths=lib/${hb_plat}/${hb_comp} -libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF} +libs=${hb_name} {win}libs=libusb-1 {!win}libs=libusb diff --git a/harbour/extras/hbvpdf/hbvpdf.hbp b/harbour/extras/hbvpdf/hbvpdf.hbp index 315e44f0b3..0ce1dabb5a 100644 --- a/harbour/extras/hbvpdf/hbvpdf.hbp +++ b/harbour/extras/hbvpdf/hbvpdf.hbp @@ -9,7 +9,7 @@ -w3 -es2 --instfile=inc:hbvpdf.ch - hbvpdf.prg hbvpsup.prg + +$hb_pkg_install.hbm diff --git a/harbour/extras/hbvpdf/tests/hbmk.hbm b/harbour/extras/hbvpdf/tests/hbmk.hbm index 1c456d2d52..ed681633a8 100644 --- a/harbour/extras/hbvpdf/tests/hbmk.hbm +++ b/harbour/extras/hbvpdf/tests/hbmk.hbm @@ -2,6 +2,6 @@ # $Id$ # -../hbvpdf.hbc +hbvpdf.hbc -w3 -es2 diff --git a/harbour/extras/hbxlsxml/hbxlsxml.hbc b/harbour/extras/hbxlsxml/hbxlsxml.hbc new file mode 100644 index 0000000000..f4d06b7f71 --- /dev/null +++ b/harbour/extras/hbxlsxml/hbxlsxml.hbc @@ -0,0 +1,8 @@ +# +# $Id$ +# + +incpaths=. +libpaths=lib/${hb_plat}/${hb_comp} + +libs=${hb_name} diff --git a/harbour/extras/hbxlsxml/hbxlsxml.hbp b/harbour/extras/hbxlsxml/hbxlsxml.hbp index b55e0f7880..dbf7389c9b 100644 --- a/harbour/extras/hbxlsxml/hbxlsxml.hbp +++ b/harbour/extras/hbxlsxml/hbxlsxml.hbp @@ -12,3 +12,5 @@ xlsxml.prg xlsxml_s.prg xlsxml_y.prg + +$hb_pkg_install.hbm diff --git a/harbour/extras/hbxlsxml/tests/hbmk.hbm b/harbour/extras/hbxlsxml/tests/hbmk.hbm index 85430de53c..9343fe282c 100644 --- a/harbour/extras/hbxlsxml/tests/hbmk.hbm +++ b/harbour/extras/hbxlsxml/tests/hbmk.hbm @@ -2,11 +2,6 @@ # $Id$ # --w3 --es2 - --L../ - --lhbxlsxml - +hbxlsxml.hbc +-w3 -es2 diff --git a/harbour/extras/ps32/ps32.hbp b/harbour/extras/ps32/ps32.hbp index 9cec1cb36d..1bce4c948d 100644 --- a/harbour/extras/ps32/ps32.hbp +++ b/harbour/extras/ps32/ps32.hbp @@ -11,6 +11,6 @@ hbxpp.hbc --instfile=inc:pscript.ch - tpscript.prg + +$hb_pkg_install.hbm diff --git a/harbour/extras/ps32/tests/hbmk.hbm b/harbour/extras/ps32/tests/hbmk.hbm index e65df1d1a5..8e7fc149b2 100644 --- a/harbour/extras/ps32/tests/hbmk.hbm +++ b/harbour/extras/ps32/tests/hbmk.hbm @@ -2,4 +2,6 @@ # $Id$ # -../ps32.hbc +ps32.hbc + +-w3 -es2 diff --git a/harbour/extras/rddado/rddado.hbp b/harbour/extras/rddado/rddado.hbp index d4025d07b9..469d5ab577 100644 --- a/harbour/extras/rddado/rddado.hbp +++ b/harbour/extras/rddado/rddado.hbp @@ -11,6 +11,6 @@ -stop{!win} --instfile=inc:adordd.ch - adordd.prg + +$hb_pkg_install.hbm diff --git a/harbour/extras/rddado/tests/hbmk.hbm b/harbour/extras/rddado/tests/hbmk.hbm index 3cdb65dada..e52dfa4d94 100644 --- a/harbour/extras/rddado/tests/hbmk.hbm +++ b/harbour/extras/rddado/tests/hbmk.hbm @@ -2,6 +2,6 @@ # $Id$ # -../rddado.hbc +rddado.hbc -w3 -es2 diff --git a/harbour/extras/superlib/superlib.hbp b/harbour/extras/superlib/superlib.hbp index 469a2c069e..1d0508b31b 100644 --- a/harbour/extras/superlib/superlib.hbp +++ b/harbour/extras/superlib/superlib.hbp @@ -216,3 +216,5 @@ s_womon.prg s_woyear.prg s_writef.prg s_xbxx.prg + +$hb_pkg_install.hbm diff --git a/harbour/tests/commouse.prg b/harbour/tests/commouse.prg new file mode 100644 index 0000000000..4e5d40d38d --- /dev/null +++ b/harbour/tests/commouse.prg @@ -0,0 +1,135 @@ +/* + * $Id$ + */ + +#include "hbcom.ch" + +PROCEDURE Main( cParam ) + + LOCAL nPort, cBuf, cBuffer, nLen, nType, lL, lM, lR, nX, nY + + IF cParam == NIL + ? "Usage: commouse [ nPort | cDevice ]" + RETURN + ENDIF + + nPort := Val( cParam ) + IF nPort == 0 + ? "Using device:", cParam + nPort := 1 + hb_comSetDevice( nPort, cParam ) + ELSE + ? "Using port number:", nPort + ENDIF + + IF ! hb_comOpen( nPort ) + ? "Unable to open port. Error:", hb_comGetError( nPort ), " OS error:", hb_comGetOSError( nPort ) + RETURN + ENDIF + + IF ! hb_comInit( nPort, 1200, "N", 8, 1 ) + ? "Unable to initialize port. Error:", hb_comGetError( nPort ), " OS error:", hb_comGetOSError( nPort ) + hb_comClose( nPort ) + RETURN + ENDIF + + hb_comMCR( nPort, , HB_COM_MCR_DTR + HB_COM_MCR_RTS ) + hb_idleSleep( 0.1 ) + hb_comFlush( nPort ) + hb_comMCR( nPort, , , HB_COM_MCR_DTR + HB_COM_MCR_RTS ) + + cBuf := Space( 256 ) + IF ( nLen := hb_comRecv( nPort, @cBuf,, 500 ) ) > 0 + IF hb_BCode( cBuf ) == 0xCD + ? "Bingo: 2 button mouse detected!" + nType := 2 + cBuffer := hb_BSubStr( cBuf, 2, nLen - 1 ) + ELSE + cBuffer := hb_BLeft( cBuf, nLen ) + ENDIF + ELSE + cBuffer := "" + ENDIF + + IF nType == NIL + ? "Mouse not detected, assuming 3 button mouse" + nType := 3 + ENDIF + + ? "Press any key to exit..." + DO WHILE ( nLen := Inkey() ) == 0 + IF ( nLen := hb_comRecv( nPort, @cBuf ) ) > 0 + cBuffer += hb_BLeft( cBuf, nLen ) + ENDIF + IF hb_BLen( cBuffer ) == 0 + hb_idleSleep( 0.05 ) + LOOP + ENDIF + IF nType == 2 + IF hb_bitAnd( hb_BCode( cBuffer ), 0xC0 ) != 0xC0 + cBuffer := hb_BSubStr( cBuffer, 2 ) + ELSEIF hb_BLen( cBuffer ) >= 3 + lR := hb_bitAnd( hb_BCode( cBuffer ), 0x10 ) != 0 + lL := hb_bitAnd( hb_BCode( cBuffer ), 0x20 ) != 0 + nX := hb_bitAnd( hb_BCode( cBuffer ), 3 ) * 64 + hb_bitAnd( hb_BCode( hb_BSubStr( cBuffer, 2 ) ), 0x3F ) + IF nX > 127 + nX -= 256 + ENDIF + nY := hb_bitAnd( hb_BCode( cBuffer ), 0x0C ) * 16 + hb_bitAnd( hb_BCode( hb_BSubStr( cBuffer, 3 ) ), 0x3F ) + IF nY > 127 + nY -= 256 + ENDIF + ? "dX,dY:", Str( nX, 4 ), Str( nY, 4 ), " " + IF lL + ?? "LEFT " + ENDIF + IF lR + ?? "RIGHT" + ENDIF + cBuffer := hb_BSubStr( cBuffer, 4 ) + ENDIF + ELSEIF nType == 3 + IF hb_bitAnd( hb_BCode( cBuffer ), 0xC0 ) != 0x80 + cBuffer := hb_BSubStr( cBuffer, 2 ) + ELSEIF hb_BLen( cBuffer ) >= 4 + lR := hb_bitAnd( hb_BCode( cBuffer ), 1 ) == 0 + lM := hb_bitAnd( hb_BCode( cBuffer ), 2 ) == 0 + lL := hb_bitAnd( hb_BCode( cBuffer ), 4 ) == 0 + nI := hb_BCode( hb_BSubStr( cBuffer, 2 ) ) + IF nI > 127 + nI -= 256 + ENDIF + nX := nI + nI := hb_BCode( hb_BSubStr( cBuffer, 4 ) ) + IF nI > 127 + nI -= 256 + ENDIF + nX += nI + nI := hb_BCode( hb_BSubStr( cBuffer, 3 ) ) + IF nI > 127 + nI -= 256 + ENDIF + nY := - nI + nI := hb_BCode( hb_BSubStr( cBuffer, 5 ) ) + IF nI > 127 + nI -= 256 + ENDIF + nY -= nI + ? "dX,dY:", Str( nX, 4 ), Str( nY, 4 ), " " + IF lL + ?? "LEFT " + ENDIF + IF lM + ?? "MIDDLE " + ENDIF + IF lR + ?? "RIGHT" + ENDIF + cBuffer := hb_BSubStr( cBuffer, 5 ) + ENDIF + + ENDIF + ENDDO + hb_comClose( nPort ) + + RETURN