2012-10-11 14:13 UTC+0200 Viktor Szakats (harbour syenar.net)

* tests/tstchbx.prg
  * extras/httpsrv/modules/showcounter.prg
    * lessen references and references to Windows

  * contrib/hbfbird/tests/stress.prg
    * use UTF8 instead of Windows specific CP
    * formatting

  * contrib/hbhttpd/widgets.prg
    * use UTF8 instead of Windows specific CP

  * contrib/hbcairo/tests/fancytxt.prg
  * contrib/hbcairo/tests/glyphdbg.prg
  * contrib/hbcairo/tests/hellow.prg
  * contrib/hbcairo/tests/lightning.prg
  * contrib/hbcairo/tests/table.prg
  * contrib/hbxpp/tests/opover.prg
  * contrib/hbxpp/tests/testdll.prg
    + added #require "<pkgname>" so these can now be run as
      scripts.

  * contrib/hbgd/gdimage.prg
    % no longer needed manual image destroy methods
      converted to empty stubs

  * contrib/hbgd/gdwrp.c
    ! GDIMAGEDESTROY() to act as true dummy wrapper.
      Before it was still checking parameter and RTE-ing
      as a result.

  * contrib/hbgd/gdbarcod.prg
    ! fixed RTEs caused by using [] operator on strings

  * contrib/hbgd/tests/animgif.prg
  * contrib/hbgd/tests/antialia.prg
  * contrib/hbgd/tests/barms.prg
  * contrib/hbgd/tests/bartest.prg
  * contrib/hbgd/tests/counter.prg
  * contrib/hbgd/tests/gdtest.prg
  * contrib/hbgd/tests/gdtestcl.prg
  * contrib/hbgd/tests/test_out.prg
  * contrib/hbgd/tests/test.prg
  * contrib/hbgd/tests/testdpi.prg
  * contrib/hbgd/tests/tostring.prg
  * contrib/hbgd/tests/tpoly.prg
    + added #require "hbgd" so they can be run as scripts
    * deleted platform specific stuff
    + added TOFIXes for non-working font settings (not even
      before above modifications)
    ! fixed some examples to save output to file
    * some mods to make code portable
    * some formatting

  * contrib/hbmisc/tests/readfile.prg
  * contrib/hbmisc/tests/rtfclass.prg
  * contrib/hbmisc/tests/testbbab.prg
  * contrib/hbmisc/tests/testcall.prg
  * contrib/hbmisc/tests/testhbf.prg
  * contrib/hbmisc/tests/tsstrfmt.prg
  * contrib/hbmisc/tests/twirl.prg
  * contrib/hbmisc/tests/udpdstst.prg
    + added #require "hbmisc" so they can be run as scripts
    ! added one missing platform guard
    * minor cleanups in SVN header and Windows references
This commit is contained in:
Viktor Szakats
2012-10-11 12:24:00 +00:00
parent 3576994b5d
commit 08b85109d9
35 changed files with 233 additions and 206 deletions

View File

@@ -16,6 +16,72 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-11 14:13 UTC+0200 Viktor Szakats (harbour syenar.net)
* tests/tstchbx.prg
* extras/httpsrv/modules/showcounter.prg
* lessen references and references to Windows
* contrib/hbfbird/tests/stress.prg
* use UTF8 instead of Windows specific CP
* formatting
* contrib/hbhttpd/widgets.prg
* use UTF8 instead of Windows specific CP
* contrib/hbcairo/tests/fancytxt.prg
* contrib/hbcairo/tests/glyphdbg.prg
* contrib/hbcairo/tests/hellow.prg
* contrib/hbcairo/tests/lightning.prg
* contrib/hbcairo/tests/table.prg
* contrib/hbxpp/tests/opover.prg
* contrib/hbxpp/tests/testdll.prg
+ added #require "<pkgname>" so these can now be run as
scripts.
* contrib/hbgd/gdimage.prg
% no longer needed manual image destroy methods
converted to empty stubs
* contrib/hbgd/gdwrp.c
! GDIMAGEDESTROY() to act as true dummy wrapper.
Before it was still checking parameter and RTE-ing
as a result.
* contrib/hbgd/gdbarcod.prg
! fixed RTEs caused by using [] operator on strings
* contrib/hbgd/tests/animgif.prg
* contrib/hbgd/tests/antialia.prg
* contrib/hbgd/tests/barms.prg
* contrib/hbgd/tests/bartest.prg
* contrib/hbgd/tests/counter.prg
* contrib/hbgd/tests/gdtest.prg
* contrib/hbgd/tests/gdtestcl.prg
* contrib/hbgd/tests/test_out.prg
* contrib/hbgd/tests/test.prg
* contrib/hbgd/tests/testdpi.prg
* contrib/hbgd/tests/tostring.prg
* contrib/hbgd/tests/tpoly.prg
+ added #require "hbgd" so they can be run as scripts
* deleted platform specific stuff
+ added TOFIXes for non-working font settings (not even
before above modifications)
! fixed some examples to save output to file
* some mods to make code portable
* some formatting
* contrib/hbmisc/tests/readfile.prg
* contrib/hbmisc/tests/rtfclass.prg
* contrib/hbmisc/tests/testbbab.prg
* contrib/hbmisc/tests/testcall.prg
* contrib/hbmisc/tests/testhbf.prg
* contrib/hbmisc/tests/tsstrfmt.prg
* contrib/hbmisc/tests/twirl.prg
* contrib/hbmisc/tests/udpdstst.prg
+ added #require "hbmisc" so they can be run as scripts
! added one missing platform guard
* minor cleanups in SVN header and Windows references
2012-10-11 12:55 UTC+0200 Viktor Szakats (harbour syenar.net)
* tests/gtwin.prg
* tests/wvt_fs.prg

View File

@@ -2,10 +2,12 @@
* $Id$
*/
#require "hbcairo"
#include "hbcairo.ch"
PROC main()
PROCEDURE Main()
LOCAL hSurface
hSurface := cairo_pdf_surface_create( "fancytxt.pdf", 566.9, 793.7 ) // 200x280 mm in pt

View File

@@ -2,10 +2,11 @@
* $Id$
*/
#require "hbcairo"
#include "hbcairo.ch"
PROC main()
PROCEDURE Main()
LOCAL hSurface, hCairo
hSurface := cairo_pdf_surface_create( "glyphdbg.pdf", 566.9, 793.7 ) // 200x280 mm in pt

View File

@@ -4,11 +4,13 @@
/* UTF-8 */
#require "hbcairo"
#include "hbcairo.ch"
REQUEST HB_CODEPAGE_LTWIN
PROC main()
PROCEDURE Main()
LOCAL hSurface, hCairo, nI
HB_CDPSELECT("LTWIN")

View File

@@ -2,11 +2,12 @@
* $Id$
*/
#require "hbcairo"
#include "hbcairo.ch"
PROC main()
PROCEDURE Main()
LOCAL hSurface, hCairo, nI
hSurface := cairo_pdf_surface_create( "lightning.pdf", 566.9, 793.7 ) // 200x280 mm in pt
@@ -14,9 +15,9 @@ PROC main()
// 20 pages
FOR nI := 1 TO 20
cairo_set_source_rgb( hCairo, 0, 0, 0 )
cairo_set_source_rgb( hCairo, 0, 0, 0 )
cairo_paint( hCairo )
cairo_set_source_rgb( hCairo, 1, 0.7, 1 )
cairo_set_source_rgb( hCairo, 1, 0.7, 1 )
DrawLightning( hCairo, 250, 50, 700, 3 )
cairo_show_page( hCairo )
NEXT
@@ -38,7 +39,7 @@ PROC DrawLightning( hCairo, nX, nY, nLen, nW, nInit )
// AR(1) process
nInit := nInit * 0.9 + (hb_random() - 0.5)
// ARIMA(1, 1, 0) process
nK += nInit
nK += nInit
// ARIMA(1, 1, 0) + white noise
nX2 := nX + nK + hb_random()
cairo_line_to( hCairo, nX2, nI + nY )

View File

@@ -2,11 +2,12 @@
* $Id$
*/
#require "hbcairo"
#include "hbcairo.ch"
PROC main()
PROCEDURE Main()
LOCAL hSurface, hCairo
FIELD CODE, NAME, RESIDENTS

View File

@@ -15,7 +15,7 @@ PROCEDURE Main()
LOCAL cUser := "SYSDBA"
LOCAL cPass := "masterkey"
LOCAL nPageSize := 1024
LOCAL cCharSet := "WIN1251"
LOCAL cCharSet := "UTF8"
LOCAL nDialect := 1
LOCAL cQuery, cName
@@ -66,16 +66,16 @@ PROCEDURE Main()
oServer:StartTransaction()
FOR i := 1 TO 10000
@ 15, 0 say "Inserting values...." + hb_ntos( i )
@ 15, 0 SAY "Inserting values...." + hb_ntos( i )
oRow := oQuery:Blank()
oRow:Fieldput(1, i)
oRow:Fieldput(2, i+1)
oRow:Fieldput(3, "DEPARTMENT NAME " + strzero( i ) )
oRow:Fieldput(4, (i % 10) == 0)
oRow:Fieldput(5, 3000 + i )
oRow:fieldput(6, Date() )
oRow:Fieldput( 1, i )
oRow:Fieldput( 2, i + 1 )
oRow:Fieldput( 3, "DEPARTMENT NAME " + strzero( i ) )
oRow:Fieldput( 4, ( i % 10 ) == 0 )
oRow:Fieldput( 5, 3000 + i )
oRow:fieldput( 6, Date() )
oServer:Append( oRow )
@@ -86,10 +86,10 @@ PROCEDURE Main()
NEXT
FOR i := 5000 TO 7000
@ 16,0 say "Deleting values...." + str( i )
@ 16, 0 SAY "Deleting values...." + Str( i )
oRow := oQuery:Blank()
oServer:Delete( oRow, "code = " + str( i ) )
oServer:Delete( oRow, "code = " + Str( i ) )
IF i % 100 == 0
oServer:Commit()
@@ -98,11 +98,11 @@ PROCEDURE Main()
NEXT
FOR i := 2000 TO 3000
@ 17,0 say "Updating values...." + str( i )
@ 17, 0 SAY "Updating values...." + Str( i )
oRow := oQuery:Blank()
oRow:Fieldput( 5, 4000 + i )
oServer:update( oRow, "code = " + str( i ) )
oServer:update( oRow, "code = " + Str( i ) )
IF i % 100 == 0
oServer:Commit()
@@ -114,13 +114,13 @@ PROCEDURE Main()
IF ! oQuery:Neterr()
oQuery:Fetch()
@ 18,0 say "Sum values...." + Str( oQuery:Fieldget( 1 ) )
@ 18, 0 SAY "Sum values...." + Str( oQuery:Fieldget( 1 ) )
oQuery:Destroy()
ENDIF
x := 0
FOR i := 1 TO 4000
oQuery := oServer:Query( "SELECT * FROM test WHERE code = " + str( i ) )
oQuery := oServer:Query( "SELECT * FROM test WHERE code = " + Str( i ) )
IF ! oQuery:Neterr()
oQuery:Fetch()
@@ -129,7 +129,7 @@ PROCEDURE Main()
oQuery:destroy()
x += oRow:fieldget( oRow:fieldpos( "salary" ) )
@ 19,0 say "Sum values...." + str( x )
@ 19, 0 SAY "Sum values...." + Str( x )
ENDIF
NEXT

View File

@@ -612,7 +612,7 @@ METHOD GenCodei25() CLASS TCode
LOCAL lError := .F.
LOCAL bc_string // := ::text
//LOCAL new_string := ""
// LOCAL new_string := ""
IF ( Len( ::text ) % 2 ) != 0
::DrawError( "Invalid barcode lenght" )
@@ -623,11 +623,11 @@ METHOD GenCodei25() CLASS TCode
bc_string := Upper( ::text )
// encode itemId to I25 barcode standard. //////////////////////////////////////
// encode itemId to I25 barcode standard.
bc_string := ::MixCode( bc_string )
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
//Adding Start and Stop Pattern
::DrawSingleI25( ::acode[ 11 ] + bc_string + ::acode[ 12 ] )
@@ -666,14 +666,14 @@ METHOD MixCode( value ) CLASS TCode
DO WHILE i < l
cFirst := ::Findcode( value[ i ] )
cnext := ::Findcode( value[ i + 1 ] )
cFirst := ::Findcode( SubStr( value, i, 1 ) )
cnext := ::Findcode( SubStr( value, i + 1, 1 ) )
// Mix of the codes
// NNNNWNNWWW
// N N N W W
FOR k := 1 TO 5
s += cFirst[ k ] + cnext[ k ]
s += SubStr( cFirst, k, 1 ) + SubStr( cnext, k, 1 )
NEXT
i += 2
@@ -691,7 +691,7 @@ METHOD Findcode( uval ) CLASS TCode
LOCAL npos
LOCAL cretc
npos := AScan( ::keys, {| x | x[ 1 ] == uval } )
npos := AScan( ::keys, {| x | Left( x, 1 ) == uval } )
cretc := ::acode[ npos ]
RETURN cretc

View File

@@ -134,7 +134,7 @@ CREATE CLASS GDImage
METHOD ToString() INLINE gdImageToString( Self )
// Destructor
METHOD Destroy() INLINE gdImageDestroy( ::pImage )
METHOD Destroy()
DESTRUCTOR Destruct()
@@ -298,11 +298,6 @@ METHOD New( sx, sy ) CLASS GDImage
RETURN Self
METHOD PROCEDURE Destruct() CLASS GDImage
IF ::lDestroy
::Destroy()
ENDIF
RETURN
METHOD Polygon( aPoints, lFilled, color ) CLASS GDImage
@@ -385,6 +380,10 @@ METHOD LoadFromFile( cFile ) CLASS GDImage
RETURN Self
/* dummy. no longer needed */
METHOD Destroy() CLASS GDImage
RETURN Self
METHOD Copy( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, oDestImage ) CLASS GDImage
hb_default( @nSrcX , 0 )

View File

@@ -743,31 +743,6 @@ HB_FUNC( GDIMAGEGD ) /* original: void gdImageGD(gdImagePtr im, FILE *out) */
*/
HB_FUNC( GDIMAGEDESTROY ) /* gdImageDestroy(gdImagePtr im) */
{
if( hb_pcount() == 1 &&
HB_ISPOINTER( 1 ) )
{
/*
gdImagePtr im;
*/
/* Retrieve image pointer */
/*
im = (gdImagePtr)hb_parptr( 1 );
*/
/* Destroy the image */
/*
gdImageDestroy( im );
*/
}
else
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
}
}
/* - */

View File

@@ -10,6 +10,8 @@
* This test shows how handle either file handle than file name
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -24,7 +26,7 @@ PROCEDURE Main()
/*
// Check output directory
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/

View File

@@ -8,6 +8,8 @@
* GD API test file
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -21,7 +23,7 @@ PROCEDURE Main()
/*
// Check output directory
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/

View File

@@ -2,6 +2,8 @@
* $Id$
*/
#require "hbgd"
#define IMAGES_OUT "imgs_out" + hb_ps()
PROCEDURE Main()
@@ -43,7 +45,7 @@ PROCEDURE Main()
2 - Height
3 - Filename (empty : display on screen)
4 - Background color */
bar:CreateBar( 205, 105,, white )
bar:CreateBar( 205, 105, IMAGES_OUT + "bar13.jpg", white )
// 1 - code bar
bar:Draw13( ccode13 )
@@ -56,7 +58,7 @@ PROCEDURE Main()
bar:Configure( 70, black, white, 2, 1 )
bar:CreateBar( 154, 100,, white )
bar:CreateBar( 154, 100, IMAGES_OUT + "bar8.gif", white )
bar:Draw8( ccode8 )
@@ -72,7 +74,7 @@ PROCEDURE Main()
// output image
//bar:out_img := "image_out/"
bar:CreateBar( 559, 88, IMAGES_OUT + "Bar128", white )
bar:CreateBar( 559, 88, IMAGES_OUT + "bar128.gif", white )
// 1- code bar
// 2- barcode types A/B/C
@@ -90,7 +92,7 @@ PROCEDURE Main()
// output image
//bar:out_img := "febraban/"
bar:CreateBar( 560, 60, IMAGES_OUT + "febraban", white )
bar:CreateBar( 560, 60, IMAGES_OUT + "febraban.gif", white )
bar:DrawI25( "P48WBQ7BX3M73X8V3WRT7F9JW" )
bar:Finish( 8 )

View File

@@ -2,6 +2,8 @@
* $Id$
*/
#require "hbgd"
#define IMAGES_OUT "imgs_out" + hb_ps()
PROCEDURE Main()
@@ -44,7 +46,7 @@ PROCEDURE Main()
2 - Height
3 - Filename (empty : display on screen)
4 - Background color */
bar:CreateBar( 205, 105,, white )
bar:CreateBar( 205, 105, IMAGES_OUT + "bar13.jpg", white )
// 1 - code bar
bar:Draw13( ccode13 )
@@ -57,7 +59,7 @@ PROCEDURE Main()
bar:Configure( 70, black, white, 2, 1 )
bar:CreateBar( 154, 100,, white )
bar:CreateBar( 154, 100, IMAGES_OUT + "bar8.gif", white )
bar:Draw8( ccode8 )
@@ -70,7 +72,7 @@ PROCEDURE Main()
bar:Configure( 50, black, white, 2, 1 )
bar:CreateBar( 300, 400, IMAGES_OUT + "Bar128", white )
bar:CreateBar( 300, 400, IMAGES_OUT + "bar128.gif", white )
// 1- code bar
// 2- barcode types A/B/C
@@ -86,7 +88,7 @@ PROCEDURE Main()
bar:Configure( 25, black, white, 1, 1,, .T. )
bar:CreateBar( 560, 60, IMAGES_OUT + "febraban", white )
bar:CreateBar( 560, 60, IMAGES_OUT + "febraban.gif", white )
bar:DrawI25( "104995628545723070285700000008218000" )
bar:Finish( 8 )

View File

@@ -11,6 +11,8 @@
* i.e.: counter 34524
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -50,21 +52,9 @@ PROCEDURE Main( cValue, cBaseImage )
? "Value = ", cValue
// To set fonts run this command:
// for Windows: SET GDFONTPATH=%WINDIR%\fonts
// per Linux : export GDFONTPATH=/usr/share/fonts/default/TrueType
// SET GDFONTPATH=%WINDIR%\fonts
// IF GetEnv( "GDFONTPATH" ) == ""
// ? "Please set GDFONTPATH"
// ? "On Windows: SET GDFONTPATH=%WINDIR%\fonts"
// ? "On Linux : export GDFONTPATH=/usr/share/fonts/default/TrueType"
// ?
// ENDIF
// Check output directory
/*
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/

View File

@@ -8,6 +8,8 @@
* GD API test file
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -20,18 +22,9 @@ PROCEDURE Main()
LOCAL black, blue, red, green, cyan
LOCAL color, font
// LOCAL aClip
// SET GDFONTPATH=%WINDIR%\fonts
IF GetEnv( "GDFONTPATH" ) == ""
? "Please set GDFONTPATH"
? "On Windows: SET GDFONTPATH=%WINDIR%\fonts"
? "On Linux : export GDFONTPATH=/usr/share/fonts/default/TrueType"
?
ENDIF
/*
// Check output directory
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/
@@ -87,18 +80,11 @@ PROCEDURE Main()
gdImageStringFt( im, blue, "arial", 20, 30, 20, 90, "Test" )
? gdImageStringFTCircle( im, 120, 120, 50, 25, 0.8, "arial", 24, "Up", /*"Down"*/
, red )
? gdImageStringFTCircle( im, 120, 120, 50, 25, 0.8, "arial", 24, "Up", /*"Down"*/, red )
/* Set Clip Rectangle */
gdImageSetClip( im, 25, 25, 75, 75 )
/* Retrieve Clipping rectangle */
// aClip := gdImageGetClip(im)
// ? "Clipping rectangle values"
// ? hb_DumpVar( aClip )
/* Query functions */
color := gdImageGetPixel( im, gdImageSX( im ) / 2, gdImageSY( im ) / 2 )
? "Pixel Color is: ", color

View File

@@ -8,6 +8,8 @@
* GD Class test file
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -22,18 +24,9 @@ PROCEDURE Main()
LOCAL oI5
LOCAL oB
// LOCAL aClip
// SET GDFONTPATH=%WINDIR%\fonts
IF GetEnv( "GDFONTPATH" ) == ""
? "Please set GDFONTPATH"
? "On Windows: SET GDFONTPATH=%WINDIR%\fonts"
? "On Linux : export GDFONTPATH=/usr/share/fonts/default/TrueType"
?
ENDIF
/*
// Check output directory
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/
@@ -123,11 +116,6 @@ PROCEDURE Main()
/* Set Clip Rectangle */
oI:SetClippingArea( 25, 25, 75, 75 )
/* Retrieve Clipping rectangle */
// aClip := oI:GetClippingArea()
? "Clipping rectangle values"
// ? hb_DumpVar( aClip )
/* Query functions */
color := oI:GetPixel( oI:Width() / 2, oI:Height() / 2 )

View File

@@ -2,6 +2,8 @@
* $Id$
*/
#require "hbgd"
#define IMAGES_OUT "imgs_out" + hb_ps()
PROCEDURE Main()

View File

@@ -5,26 +5,26 @@
/*
* Copyright 2004-2005 Francesco Saverio Giudice <info@fsgiudice.com>
*
* Windows CGI test application
* CGI test application
*/
#require "hbgd"
#include "gd.ch"
#define CRLF ( Chr( 13 ) + Chr( 10 ) )
#command WRITE <c> => FWrite( 1, <c> + CRLF )
#command WRITE <c> => FWrite( 1, <c> + hb_eol() )
#command OutHTML <c> => WRITE <c>
PROCEDURE Main( ... )
LOCAL cPar
LOCAL aParams := hb_aParams()
LOCAL aParams := hb_AParams()
LOCAL cQuery := GetEnv( "QUERY_STRING" )
LOCAL hParams := { => }
LOCAL cImg, nPt, nWidth, nHeight, cPhoto
// LOCAL cText
// LOCAL cText
IF Empty( aParams )
IF ! Empty( cQuery )
@@ -34,7 +34,7 @@ PROCEDURE Main( ... )
hParams := GetParams( aParams )
ENDIF
//
//
// Gestione parametri
IF ! Empty( hParams )
@@ -42,44 +42,42 @@ PROCEDURE Main( ... )
DO CASE
CASE cPar == "txt"
// cText := hb_hGet( hParams, cPar )
// cText := hb_HGet( hParams, cPar )
CASE cPar == "img"
cImg := hb_hGet( hParams, cPar )
cImg := hb_HGet( hParams, cPar )
CASE cPar == "photo"
cPhoto := hb_hGet( hParams, cPar )
cPhoto := hb_HGet( hParams, cPar )
CASE cPar == "width"
nWidth := Val( hb_hGet( hParams, cPar ) )
nWidth := Val( hb_HGet( hParams, cPar ) )
CASE cPar == "height"
nHeight := Val( hb_hGet( hParams, cPar ) )
nHeight := Val( hb_HGet( hParams, cPar ) )
CASE cPar == "pt"
nPt := Val( hb_hGet( hParams, cPar ) )
nPt := Val( hb_HGet( hParams, cPar ) )
ENDCASE
NEXT
ENDIF
//__OutDebug( cQuery, ValToPrg( hParams ) )
// __OutDebug( cQuery, ValToPrg( hParams ) )
//
//hb_default( @cText, "Testo di Prova" )
// hb_default( @cText, "Testo di Prova" )
hb_default( @nPt, 30 )
IF cImg != NIL
//OutJpg( cImg, nPt )
//OutJpg( cImg, nPt )
OutPhoto( cImg, nWidth, nHeight )
ELSEIF cPhoto != NIL
StartHTML()
//OutHTML ValToPrg( hParams ) + "<br>"
//OutHTML ValToPrg( cParams ) + "<br>"
//OutHTML ValToPrg( cQuery ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
//OutHTML ValToPrg( hParams ) + "<br>"
//OutHTML ValToPrg( cParams ) + "<br>"
//OutHTML ValToPrg( cQuery ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
OutHTML "<table border=1>"
OutHTML "<tr><td align='center'>"
OutHTML "<img src='test_out.exe?img=" + cPhoto + "'>" + "<br>"
@@ -95,9 +93,8 @@ PROCEDURE Main( ... )
OutHTML "</td></tr>"
OutHTML "</table>"
OutHTML "<br>"
//OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
//OutHTML OS() + "<br>"
//OutHTML iif( OS_ISWINNT(), "WIN NT", "NON WIN NT" ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
//OutHTML OS() + "<br>"
EndHTML()
ELSE
StartHTML()
@@ -112,7 +109,7 @@ PROCEDURE StartHTML( cTitle )
WRITE 'content-type: text/html'
WRITE 'Pragma: no-cache'
WRITE CRLF
WRITE hb_eol()
WRITE "<html>"
WRITE "<head>"
WRITE "<title>" + cTitle + "</title>"
@@ -128,9 +125,6 @@ PROCEDURE EndHTML()
RETURN
// per windows: SET GDFONTPATH=%WINDIR%\fonts
// per linux : export GDFONTPATH=/usr/share/fonts/default/TrueType
PROCEDURE OutPhoto( cPhoto, nWidth, nHeight )
LOCAL cType
@@ -147,9 +141,9 @@ PROCEDURE OutPhoto( cPhoto, nWidth, nHeight )
oImage:Resize( nWidth, nHeight )
ENDIF
//__OutDebug( hb_dumpvar( oImage ) )
// __OutDebug( hb_dumpvar( oImage ) )
WRITE 'content-type: ' + oImage:cMime + CRLF
WRITE 'content-type: ' + oImage:cMime + hb_eol()
cType := oImage:cType
DO CASE
@@ -165,13 +159,11 @@ PROCEDURE OutPhoto( cPhoto, nWidth, nHeight )
PROCEDURE OutJpg( cText, nPitch )
LOCAL cPath := GetEnv( "WINDIR" ) + "\fonts\"
LOCAL oI
// LOCAL cyan
// LOCAL cyan
LOCAL blue
LOCAL aSize, nWidth, nHeight, nX, nY
LOCAL cFont := cPath + "verdana.ttf"
hb_default( @cText , "Sample TEXT" )
hb_default( @nPitch, 30 )
@@ -185,10 +177,10 @@ PROCEDURE OutJpg( cText, nPitch )
/* Allocate drawing color */
// blue := oI:SetColor( 0, 0, 200 )
//oI:SetTransparent( blue )
oI:SetFontName( cFont )
// oI:SetTransparent( blue )
oI:SetFontName( "Verdana" ) // TOFIX
oI:SetFontPitch( nPitch )
//__OutDebug( oI:GetFTFontHeight() )
// __OutDebug( oI:GetFTFontHeight() )
aSize := oI:GetFTStringSize( cText )
nWidth := aSize[ 1 ]
nHeight := aSize[ 2 ]
@@ -199,21 +191,21 @@ PROCEDURE OutJpg( cText, nPitch )
/* Allocate drawing color */
blue := oI:SetColor( 0, 0, 200 )
oI:SetFontName( cPath + "verdana.ttf" )
oI:SetFontName( "Verdana" ) // TOFIX
oI:SetFontPitch( nPitch )
oI:SayFreeType( 0 - nX, 0 + nHeight - nY, cText, , , 0, blue )
//oI:SayFreeType( 0, 0, cText, , , 0, blue )
// oI:SayFreeType( 0, 0, cText, , , 0, blue )
//oI:Resize( nWidth, nHeight )
//__OutDebug( "prima", oI:Width(), oI:Height() )
//oI:Resize( 60, 40 )
//__OutDebug( "dopo", oI:Width(), oI:Height() )
// oI:Resize( nWidth, nHeight )
// __OutDebug( "prima", oI:Width(), oI:Height() )
// oI:Resize( 60, 40 )
// __OutDebug( "dopo", oI:Width(), oI:Height() )
//oI:SetFontLarge()
//oI:SetColor( blue )
//oI:Say( 0, 0, cText )
// oI:SetFontLarge()
// oI:SetColor( blue )
// oI:Say( 0, 0, cText )
WRITE 'content-type: image/jpeg' + CRLF
WRITE 'content-type: image/jpeg' + hb_eol()
oI:OutputJpeg()
@@ -227,10 +219,10 @@ FUNCTION GetVars( cFields, cSeparator )
hb_default( @cSeparator, "&" )
aFields := HB_RegExSplit( cSeparator, cFields )
aFields := hb_regexSplit( cSeparator, cFields )
FOR EACH cField in aFields
aField := HB_RegexSplit( "=", cField, 2 )
aField := hb_regexSplit( "=", cField, 2 )
IF Len( aField ) != 2
LOOP
ENDIF
@@ -253,7 +245,7 @@ FUNCTION GetVars( cFields, cSeparator )
ENDIF
//Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue )
NEXT
//__OutDebug( hHashVars )
// __OutDebug( hHashVars )
RETURN hHashVars
@@ -266,7 +258,7 @@ FUNCTION GetParams( aParams )
aFields := aParams
FOR EACH cField in aFields
aField := HB_RegexSplit( "=", cField, 2 )
aField := hb_regexSplit( "=", cField, 2 )
IF Len( aField ) != 2
LOOP
ENDIF
@@ -289,7 +281,7 @@ FUNCTION GetParams( aParams )
ENDIF
//Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue )
NEXT
//__OutDebug( hHashVars )
// __OutDebug( hHashVars )
RETURN hHashVars
@@ -302,7 +294,7 @@ FUNCTION URLDecode( cStr )
LOCAL cRet := "", i, cCar
// LOCAL lNumeric := .T.
// LOCAL lNumeric := .T.
FOR i := 1 TO Len( cStr )
cCar := cStr[ i ]
@@ -316,7 +308,7 @@ FUNCTION URLDecode( cStr )
cRet += Chr( hb_HexToNum( SubStr( cStr, i, 2 ) ) )
i++
OTHERWISE
OTHERWISE
cRet += cCar
ENDCASE
@@ -326,9 +318,9 @@ FUNCTION URLDecode( cStr )
// ENDIF
NEXT
// IF lNumeric
// cRet := Val( cRet )
// ENDIF
// IF lNumeric
// cRet := Val( cRet )
// ENDIF
RETURN cRet

View File

@@ -9,6 +9,8 @@
* Copyright 2005 Francesco Saverio Giudice <info@fsgiudice.com>
*/
#require "hbgd"
#include "gd.ch"
#define IMAGES_IN "imgs_in" + hb_ps()
@@ -18,10 +20,10 @@ PROCEDURE Main()
LOCAL oI := GDImage():Create( 600, 300 )
LOCAL black := oI:SetColor( 0, 0, 0 )
LOCAL black := oI:SetColor( 50, 0, 0 )
oI:SetColor( black )
oI:SetFontName( GetEnv( "WINDIR" ) + "\fonts\arial.ttf" )
oI:SetFontName( "Arial" ) // TOFIX
oI:SetFontPitch( 10 )
// Resolution = 96 dpi, default

View File

@@ -8,6 +8,8 @@
* GD Class test file: tostring() demo
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"
@@ -20,7 +22,7 @@ PROCEDURE Main()
/*
// Check output directory
IF !hb_DirExists( IMAGES_OUT )
IF ! hb_DirExists( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
*/

View File

@@ -6,6 +6,8 @@
* Koch Flake -- for testing gdImage*Polygon()
*/
#require "hbgd"
#include "gd.ch"
#include "simpleio.ch"

View File

@@ -30,7 +30,7 @@ FUNCTION UWMainNew()
METHOD Paint() CLASS UWMain
UWrite( '<html><link href="/files/main.css" type=text/css rel=stylesheet>' )
UWrite( '<meta http-equiv="content-type" content="text/html; charset=windows-1257">' )
UWrite( '<meta http-equiv="content-type" content="text/html; charset=UTF-8">' )
UWrite( '<script language="javascript" src="/files/main.js"></script>' )
UWrite( '<body>' )
AEval( Self:aChilds, {| x | x:Paint() } )
@@ -545,7 +545,7 @@ PROCEDURE UWDefaultHandler( cMethod )
session[ "_uthis", "main" ]:Paint()
ELSE
IF ( oW := UGetWidgetById( cID ) ) != NIL
UAddHeader( "Content-type", "text/html; charset=windows-1257" )
UAddHeader( "Content-type", "text/html; charset=UTF-8" )
oW:Ajax( hb_HGetDef( get, "action" ) )
ENDIF
ENDIF

View File

@@ -9,6 +9,8 @@
Donated to the public domain on 2001-03-08 by David G. Holm <dholm@jsd-llc.com>
*/
#require "hbmisc"
PROCEDURE Main( cFile )
LOCAL oFile := TFileRead():New( cFile )

View File

@@ -8,11 +8,12 @@
- using hb_f*() - some compilers are not friendly with this :(
- rtf is assumed to have association
* initial release : 23 June 1999 Andi Jahja
* tested under Windows 98 only with RTF associated to WinWord
* works with printable ascii only
* placed in the public domain
*/
#require "hbmisc"
PROCEDURE Main()
LOCAL ortf := trtf():new( "test.rtf" )

View File

@@ -10,6 +10,8 @@
*
*/
#require "hbmisc"
PROCEDURE Main()
? BubbleBabbleEncode_prg( "" )

View File

@@ -10,11 +10,15 @@
*
*/
#require "hbmisc"
PROCEDURE Main()
#if defined( __PLATFORM__WINDOWS )
LOCAL nFlags
nFlags := -1
? CALLDLL32( "InternetGetConnectedState", "wininet.dll", @nFlags, 0 )
? nFlags
#endif
RETURN

View File

@@ -17,6 +17,8 @@ inplementation of :
* hb_fgobottom()
*/
#require "hbmisc"
PROCEDURE Main()
// open a text file here

View File

@@ -2,6 +2,8 @@
* $Id$
*/
#require "hbmisc"
PROCEDURE Main()
? StrFormat( "%1 thing %2", "a", "b" )

View File

@@ -1,6 +1,6 @@
//
// $Id$
//
/*
* $Id$
*/
// Test program for new libmisc twirler class
/* Harbour Project source code
@@ -8,6 +8,8 @@
Donated to the public domain on 2001-03-15 by David G. Holm <dholm@jsd-llc.com>
*/
#require "hbmisc"
PROCEDURE Main()
LOCAL counter := 0, start_time, stop_time

View File

@@ -6,6 +6,8 @@
* This module demonstrates a simple UDP Discovery Server
*/
#require "hbmisc"
PROCEDURE main( cParam )
LOCAL h

View File

@@ -2,6 +2,8 @@
* $Id$
*/
#require "hbxpp"
#include "hbxpp.ch"
PROCEDURE Main()

View File

@@ -11,6 +11,8 @@
*
*/
#require "hbxpp"
#include "simpleio.ch"
#include "dll.ch"

View File

@@ -122,18 +122,6 @@ STATIC FUNCTION CreateCounter( cValue, cBaseImage )
// ? "Value = ", cValue
// To set fonts run this command:
// for windows: SET GDFONTPATH=%WINDIR%\fonts
// per linux : export GDFONTPATH=/usr/share/fonts/default/TrueType
// SET GDFONTPATH=%WINDIR%\fonts
// IF GetEnv( "GDFONTPATH" ) == ""
// ? "Please set GDFONTPATH"
// ? "On Windows: SET GDFONTPATH=%WINDIR%\fonts"
// ? "On Linux : export GDFONTPATH=/usr/share/fonts/default/TrueType"
// ?
// ENDIF
// Check output directory
/*
IF ! hb_DirExists( IMAGES_OUT )

View File

@@ -6,26 +6,25 @@ PROCEDURE Main()
LOCAL GetList := {}
LOCAL cItem := "Windows"
LOCAL lx := .F.
LOCAL ly := .F.
LOCAL cItem := "Windows NT/2000"
LOCAL aItems[ 4 ]
LOCAL aItems[ 3 ]
aItems[ 1 ] := RADIOBUTTO( 3, 3, "&Windows NT/2000" )
aItems[ 2 ] := RADIOBUTTO( 4, 3, "W&indows 9x" )
aItems[ 3 ] := RADIOBUTTO( 5, 3, "&Linux" )
aItems[ 4 ] := RADIOBUTTO( 6, 3, "&OS X" )
aItems[ 1 ] := RadioButto( 3, 3, "&Windows" )
aItems[ 2 ] := RadioButto( 4, 3, "&Linux" )
aItems[ 3 ] := RadioButto( 5, 3, "&OS X" )
CLS
SetColor( "W/B+,R/B,G+/R,B+/R+,BG/N+,W/BG,RB/BG" )
@ 2, 2, 7,40 GET cItem RADIOGROUP aItems COLOR "W/B+,R/B,G/B+" MESSAGE "Select your OS"
@ 2, 2, 6, 40 GET cItem RADIOGROUP aItems COLOR "W/B+,R/B,G/B+" MESSAGE "Select your OS"
@ 8, 3 SAY "Married"
@ 8,12 GET lx CHECKBOX COLOR "W/B+,W/B,W+/R,W/G+" MESSAGE "Is you married?"
@ 9, 3 SAY "Singer"
@ 9,12 GET ly CHECKBOX COLOR "W/B+,W/B,W+/R,W/G+" MESSAGE "Are you a singer?"
@ 8, 3 SAY "Married"
@ 8, 12 GET lx CHECKBOX COLOR "W/B+,W/B,W+/R,W/G+" MESSAGE "Are you married?"
@ 9, 3 SAY "Singer"
@ 9, 12 GET ly CHECKBOX COLOR "W/B+,W/B,W+/R,W/G+" MESSAGE "Are you a singer?"
READ MSG AT MaxRow(), 0, MaxCol() MSG COLOR "W/B+"