[runtime tests] Small fix in test

[runtime tests] Small fix in test

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit
USING System.Globalization

BEGIN NAMESPACE XSharp.VO.Tests

	CLASS VoConversionTests

		[Fact, Trait("Category", "Conversion")];
		METHOD AsStringTest() AS VOID
			LOCAL u AS USUAL
			u := "123"
			Assert.Equal("123", AsString(u))
			u := #A123
			Assert.Equal("A123", AsString(u))

			Assert.Equal("1", AsString(1))
			VAR c1 := GetRTFullPath()
			Assert.Equal(TRUE, c1:ToLower():IndexOf(".rt.dll") > 0)

			VAR n1 := GetThreadCount()
			Assert.Equal(TRUE, n1 > 1)

		[Fact, Trait("Category", "Conversion")];
		METHOD StrTest() AS VOID
			LOCAL c AS STRING
            LOCAL f AS FLOAT
			SetDecimalSep(46)
			c := Str3(12.3456,5,2)
			Assert.Equal("12.35", c)	// ROunded up
			c := Str3(12.3411,5,2)
			Assert.Equal("12.34", c)	// ROunded down
            f := FloatFormat(12.3456,10,4)
			c := Str3(f,10,5)
			Assert.Equal("  12.34560", c)	// ROunded down
			c := StrZero(12.3456,10,2)
			Assert.Equal("0000012.35", c)	// ROunded up
			c := Str3(2.49999,4,2)
			Assert.Equal("2.50", c )
			c := Str3(2.50012,4,2)
			Assert.Equal("2.50", c )

			c := Str3(70.00 - 65.01 - 4.99 , 16 , 2)
			Assert.Equal("            0.00", c )
			c := Str3(70.00 - 65.01 - 4.99 , 20 , 15)
			Assert.Equal("  -0.000000000000005", c )

			c := Str3(123456.7890/2.34, 25,15)
			Assert.Equal("    52759.311538461545000", c )
			c := Str(123456.7890/2.34, 25,15)
			Assert.Equal("    52759.311538461545000", c )

			SetDecimalSep(Asc(","))
			f := 1.2345999999
			Assert.Equal("1,2", Str(f, 30,1):Trim() )
			Assert.Equal("1,23", Str(f, 30,2):Trim() )
			Assert.Equal("1,235", Str(f, 30,3):Trim() )
			Assert.Equal("1,2346", Str(f, 30,4):Trim() )
			Assert.Equal("1,23460", Str(f, 30,5):Trim() )
			Assert.Equal("1,234600", Str(f, 30,6):Trim() )
			Assert.Equal("1,2346000", Str(f, 30,7):Trim() )
			Assert.Equal("1,23460000", Str(f, 30,8):Trim() )
			Assert.Equal("1,234600000", Str(f, 30,9):Trim() )
			Assert.Equal("1,2345999999", Str(f, 30,10):Trim() )
			Assert.Equal("1,23459999990", Str(f, 30,11):Trim() )
			Assert.Equal("1,234599999900", Str(f, 30,12):Trim() )

		[Fact, Trait("Category", "Val")];
		METHOD ValTest() AS VOID
			LOCAL u AS USUAL
            SetDecimalSep('.')
            SetThousandSep(',')
			u := Val("1.234")
			Assert.Equal(1.234, (FLOAT) u)
			SetDecimalSep(',')
            SetThousandSep('.')
			u := Val("1,234")
			Assert.Equal(1.234, (FLOAT) u)
            SetDecimalSep('.')
            SetThousandSep(',')
			u := Val("1.23E2")
			Assert.Equal(123.0, (FLOAT) u)
			u := Val("1.2345E2")
			Assert.Equal(123.45, (FLOAT) u)

			Assert.True(Val("0XEE") == 238)
			Assert.True(Val("0xEE") == 238)
			Assert.True(Val("0x100") == 256)
			Assert.True(Val("0x1AE") == 430)

			SetDecimalSep(',')
            SetThousandSep('.')

			u := Val("12,34")
			Assert.Equal(12.34, (FLOAT) u)
			u := Val("12.34")
			Assert.Equal(12.34, (FLOAT) u)

            SetDecimalSep('.')
            SetThousandSep(',')

			u := Val("12,34")
			Assert.Equal(12, (INT) u) // idiotic VO behavior
			u := Val("12.34")
			Assert.Equal(12.34, (FLOAT) u)

            SetDecimalSep('.')
            SetThousandSep(',')

            LOCAL cVal AS STRING
            LOCAL uRet AS USUAL

            cVal := "123456789"; uRet := Val(cVal)
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(1, (INT) UsualType(uRet))

            cVal := "1234567890"; uRet := Val(cVal)
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(3, (INT) UsualType(uRet))

            cVal := "- 123456789"; uRet := Val(cVal); cVal := "-123456789"
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(3, (INT) UsualType(uRet))

            cVal := "   - 123"; uRet := Val(cVal); cVal := "-123"
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(1, (INT) UsualType(uRet))

			Assert.Equal("123.456", AsString(Val("123.456")))
			Assert.Equal("123.456", AsString(Val("123.456")))
			Assert.Equal("123.456", AsString(Val("  123.456"  )))
			Assert.Equal("-123.4567", AsString(Val(" - 123.4567")))

			Assert.Equal( "  12345678901234567000", Str(Val("12345678901234567890"),22,-1) )
			Assert.Equal( " -12345678901234567000", Str(Val("-12345678901234567890"),22,-1) )

			Assert.Equal("255", AsString(Val("0xFF")))
			Assert.Equal("-255", AsString(Val("-0xFF")))
			Assert.Equal("-255", AsString(Val(" - 0xFF")))
			Assert.Equal("65534", AsString(Val("0xFFFE")))
			Assert.Equal("2147483648", AsString(Val(" 0X80000000")))

            SetDecimalSep(',')
            SetThousandSep('.')
			Assert.Equal("123,456", AsString(Val("  123.456"  )))
			Assert.Equal("123,456", AsString(Val("  123,456"  )))

		[Fact, Trait("Category", "Val")];
		METHOD ValTests2() AS VOID
			SetDecimalSep(',')
			SetThousandSep('.')
			Assert.Equal(123, (INT) Val("123") )
			Assert.Equal(123.456, (FLOAT) Val("123,456") )

			Assert.Equal(0, (INT) Val("") )

			Assert.Equal(0, (INT) Val("abc") )
			Assert.Equal(123, (INT) Val("123abc") )
			Assert.Equal(123, (INT) Val("123abc456") )
			Assert.Equal(123, (INT) Val("123abc456,789") )
			Assert.Equal(0, (INT) Val("abc123456,789") )
			Assert.Equal(255, (INT) Val("0xFF") )
			Assert.Equal(0xFFFF, (INT) Val("0xFFFF") )
			Assert.Equal(4294967295, (INT64) Val("0xFFFFFFFF") )
			Assert.Equal(11, (INT) Val("11L11") )

			Assert.Equal(1.000, (FLOAT) Val("1,000.1") )
			Assert.Equal(1.001, (FLOAT) Val("1,001.1") )
			SetDecimalSep('.')
			SetThousandSep(',')
			Assert.Equal(1.0, (FLOAT) Val("1,000.1") )
			Assert.Equal(1.0, (FLOAT) Val("1,001.1") )
		RETURN

	END CLASS
END NAMESPACE // XSharp.Runtime.Tests

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit
USING System.Globalization

BEGIN NAMESPACE XSharp.VO.Tests

	CLASS VoConversionTests

		[Fact, Trait("Category", "Conversion")];
		METHOD AsStringTest() AS VOID
			LOCAL u AS USUAL
			u := "123"
			Assert.Equal("123", AsString(u))
			u := #A123
			Assert.Equal("A123", AsString(u))

			Assert.Equal("1", AsString(1))
			VAR c1 := GetRTFullPath()
			Assert.Equal(TRUE, c1:ToLower():IndexOf(".rt.dll") > 0)

			VAR n1 := GetThreadCount()
			Assert.Equal(TRUE, n1 > 1)

		[Fact, Trait("Category", "Conversion")];
		METHOD StrTest() AS VOID
			LOCAL c AS STRING
            LOCAL f AS FLOAT
			SetDecimalSep(46)
			c := Str3(12.3456,5,2)
			Assert.Equal("12.35", c)	// ROunded up
			c := Str3(12.3411,5,2)
			Assert.Equal("12.34", c)	// ROunded down
            f := FloatFormat(12.3456,10,4)
			c := Str3(f,10,5)
			Assert.Equal("  12.34560", c)	// ROunded down
			c := StrZero(12.3456,10,2)
			Assert.Equal("0000012.35", c)	// ROunded up
			c := Str3(2.49999,4,2)
			Assert.Equal("2.50", c )
			c := Str3(2.50012,4,2)
			Assert.Equal("2.50", c )

			c := Str3(70.00 - 65.01 - 4.99 , 16 , 2)
			Assert.Equal("            0.00", c )
			c := Str3(70.00 - 65.01 - 4.99 , 20 , 15)
			Assert.Equal("  -0.000000000000005", c )

			c := Str3(123456.7890/2.34, 25,15)
			Assert.Equal("    52759.311538461545000", c )
			c := Str(123456.7890/2.34, 25,15)
			Assert.Equal("    52759.311538461545000", c )

			SetDecimalSep(Asc(","))
			f := 1.2345999999
			Assert.Equal("1,2", Str(f, 30,1):Trim() )
			Assert.Equal("1,23", Str(f, 30,2):Trim() )
			Assert.Equal("1,235", Str(f, 30,3):Trim() )
			Assert.Equal("1,2346", Str(f, 30,4):Trim() )
			Assert.Equal("1,23460", Str(f, 30,5):Trim() )
			Assert.Equal("1,234600", Str(f, 30,6):Trim() )
			Assert.Equal("1,2346000", Str(f, 30,7):Trim() )
			Assert.Equal("1,23460000", Str(f, 30,8):Trim() )
			Assert.Equal("1,234600000", Str(f, 30,9):Trim() )
			Assert.Equal("1,2345999999", Str(f, 30,10):Trim() )
			Assert.Equal("1,23459999990", Str(f, 30,11):Trim() )
			Assert.Equal("1,234599999900", Str(f, 30,12):Trim() )

		[Fact, Trait("Category", "Val")];
		METHOD ValTest() AS VOID
			LOCAL u AS USUAL
            SetDecimalSep('.')
            SetThousandSep(',')
			u := Val("1.234")
			Assert.Equal(1.234, (FLOAT) u)
			SetDecimalSep(',')
            SetThousandSep('.')
			u := Val("1,234")
			Assert.Equal(1.234, (FLOAT) u)
            SetDecimalSep('.')
            SetThousandSep(',')
			u := Val("1.23E2")
			Assert.Equal(123.0, (FLOAT) u)
			u := Val("1.2345E2")
			Assert.Equal(123.45, (FLOAT) u)

			Assert.True(Val("0XEE") == 238)
			Assert.True(Val("0xEE") == 238)
			Assert.True(Val("0x100") == 256)
			Assert.True(Val("0x1AE") == 430)

			SetDecimalSep(',')
            SetThousandSep('.')

			u := Val("12,34")
			Assert.Equal(12.34, (FLOAT) u)
			u := Val("12.34")
			Assert.Equal(12.34, (FLOAT) u)

            SetDecimalSep('.')
            SetThousandSep(',')

			u := Val("12,34")
			Assert.Equal(12, (INT) u) // idiotic VO behavior
			u := Val("12.34")
			Assert.Equal(12.34, (FLOAT) u)

            SetDecimalSep('.')
            SetThousandSep(',')

            LOCAL cVal AS STRING
            LOCAL uRet AS USUAL

            cVal := "123456789"; uRet := Val(cVal)
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(1, (INT) UsualType(uRet))

            cVal := "1234567890"; uRet := Val(cVal)
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(3, (INT) UsualType(uRet))

            cVal := "- 123456789"; uRet := Val(cVal); cVal := "-123456789"
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(3, (INT) UsualType(uRet))

            cVal := "   - 123"; uRet := Val(cVal); cVal := "-123"
			Assert.Equal(cVal, AsString(uRet))
			Assert.Equal(1, (INT) UsualType(uRet))

			Assert.Equal("123.456", AsString(Val("123.456")))
			Assert.Equal("123.456", AsString(Val("123.456")))
			Assert.Equal("123.456", AsString(Val("  123.456"  )))
			Assert.Equal("123.456", AsString(Val("  123,456"  )))
			Assert.Equal("-123.4567", AsString(Val(" - 123.4567")))

			Assert.Equal( "  12345678901234567000", Str(Val("12345678901234567890"),22,-1) )
			Assert.Equal( " -12345678901234567000", Str(Val("-12345678901234567890"),22,-1) )

			Assert.Equal("255", AsString(Val("0xFF")))
			Assert.Equal("-255", AsString(Val("-0xFF")))
			Assert.Equal("-255", AsString(Val(" - 0xFF")))
			Assert.Equal("65534", AsString(Val("0xFFFE")))
			Assert.Equal("2147483648", AsString(Val(" 0X80000000")))

		[Fact, Trait("Category", "Val")];
		METHOD ValTests2() AS VOID
			SetDecimalSep(',')
			SetThousandSep('.')
			Assert.Equal(123, (INT) Val("123") )
			Assert.Equal(123.456, (FLOAT) Val("123,456") )

			Assert.Equal(0, (INT) Val("") )

			Assert.Equal(0, (INT) Val("abc") )
			Assert.Equal(123, (INT) Val("123abc") )
			Assert.Equal(123, (INT) Val("123abc456") )
			Assert.Equal(123, (INT) Val("123abc456,789") )
			Assert.Equal(0, (INT) Val("abc123456,789") )
			Assert.Equal(255, (INT) Val("0xFF") )
			Assert.Equal(0xFFFF, (INT) Val("0xFFFF") )
			Assert.Equal(4294967295, (INT64) Val("0xFFFFFFFF") )
			Assert.Equal(11, (INT) Val("11L11") )

			Assert.Equal(1.000, (FLOAT) Val("1,000.1") )
			Assert.Equal(1.001, (FLOAT) Val("1,001.1") )
			SetDecimalSep('.')
			SetThousandSep(',')
			Assert.Equal(1.0, (FLOAT) Val("1,000.1") )
			Assert.Equal(1.0, (FLOAT) Val("1,001.1") )
		RETURN

	END CLASS
END NAMESPACE // XSharp.Runtime.Tests


文字列定数の直前にスペース無しで文字列定数以外の単語が来ていても判別できるようにした

' PROJECT SMILE++
' Smile++ Transpiler 2017.1

option strict

acls
prgEdit 1

' 配列の要素を検索する

def indexOf$(array$[], string$)
	var i
	for i = 0 to len(array$) - 1
		if array$[i] == string$ then return i
	next
	return -1
end

' 配列を生成する

def array(list$)
	dim arr[0]
	var tmp = ""
	var i
	var c$ = ""
	for i = 0 to len(list$) - 1
		c$ = mid$(list$, i, 1)
		if c$ == " " && tmp$ != "" then
			push arr, val(tmp$)
			tmp$ = ""
		endif
		tmp$ = tmp$ + c$
	next
	if tmp$ != "" && tmp$ != " " then push arr, val(tmp$)
	return arr
end

def array$(list$)
	dim arr$[0]
	var tmp$ = ""
	var i
	var c$ = ""
	for i = 0 to len(list$) - 1
		c$ = mid$(list$, i, 1)
		if c$ == " " && tmp$ != "" then
			push arr$, tmp$
			tmp$ = ""
		else
			tmp$ = tmp$ + c$
		endif
	next
	if tmp$ != "" && tmp$ != " " then push arr$, tmp$
	return arr$
end

' 配列の内容を出力する

def arrayDump arr[]
	var i
	for i = 0 to len(arr) - 1
		? str$(arr[i]) + " ";
	next
	? ""
end

def arrayDump arr$[]
	var i
	for i = 0 to len(arr$) - 1
		? arr$[i] + " ";
	next
	? ""
end

' 定数

var UNKNOWN = 1, DIRECTION = 2, RESERVED = 3
var OPERATOR = 4, CONSTANT = 5, STRING = 6

' 演算子

dim operators$[0]
operators$ = array$("+ - * / DIV MOD << >> NOT ( ) == != < <= > >= && || AND OR XOR !")

' 予約語

dim reservedWords$[0]
reservedWords$ = array$("IF THEN ELSE ELSEIF ENDIF GOTO GOSUB RETURN ON FOR NEXT WHILE WEND REPEAT UNTIL BREAK CONTINUE DEF END VAR DIM DATA READ RESTORE PRINT INPUT LINPUT CALL SWAP OUT COMMON USE EXEC FILES SAVE RENAME DELETE CHKFILE PRGEDIT PRGGET$ PRGSET PRGINS PRGDEL PRGSIZE PRGNAME$ XSCREEN DISPLAY VISIBLE BACKCOLOR ACLS FADE CLS COLOR LOCATE PRINT ? ATTR SCROLL FONTDEF WIDTH SPPAGE SPCLIP SPDEF SPSET SPCLR SPSHOW SPHIDE SPHOME SPOFS SPROT SPSCALE SPCOLOR SPCHR SPLINK SPUNLINK SPANIM SPSTOP SPSTART SPCHK SPVAR SPCOL SPCOLVEC SPHITINFO SPFUNC BGPAGE BGSCREEN BGCLR BGSHOW BGHIDE BGCLIP BGHOME BGOFS BGROT BGSCALE BGPUT BGFILL BGSET BGANIM BGSTOP BGSTART BGCHK BGVAR BGLOAD BGSAVE BGCOORD BGCOLOR BGFUNC GPAGE GCOLOR RGBREAD GCLIP GPRIO GCLS GPSET GLINE GCIRCLE GBOX GFILL GPAINT GCOPY GSAVE GLOAD GTRI GPUTCHR GOFS GPUTCHR16 XON XOFF BUTTON BREPEAT STICK STICKX ACCEL GYROA GYROV GYROSYNC TOUCH MICSTART MICSTOP MICDATA MICSAVE CONTROLLER VIBLATE BEEP BGMCHK BGMCLEAR BGMPLAY BGMSET BGMSETD BGMVAR BGMSTOP BGMVOL WAVSET WAVSETA EFCOFF EFCON EFCSET EFCWET TALK TALKCHK TALKSTOP BGMPAUSE BGMCONT SNDSTOP BIQUAD BQPARAM FFT IFFT FFTWFN PCMCONT PCMSTOP PCMSTREAM PCMVOL RINGCOPY ARYOP MPSTART MPSEND MPRECV MPSTAT MPNAME$ MPGET MPSET INC DEC COPY SORT RSORT PUSH UNSHIFT FILL RANDOMIZE STOP OPTION WAIT VSYNC REM KEY DTREAD TMREAD DIALOG CLIPBOARD DLCOPEN")

' 組み込み定数

dim constants$[0]
constants$ = array$("ON OFF YES NO TRUE FALSE BLACK NAVY BLUE GREEN TEAL LIME AQUA CYAN MAROON PURPLE OLIVE GRAY SILVER RED FUCHSIA MAGENTA YELLOW WHITE TBLACK TMAROON TRED TGREEN TLIME TOLIVE TYELLOW TNAVY TBLUE TPURPLE TMAGENTA TTREAL TCYAN TGRAY TWHITE UP DOWN LEFT RIGHT A B X Y L R ZR ZL TROT0 TROT90 TROT180 TROT270 TREVH TREVV SPSHOW SPROT0 SPROT90 SPROT180 SPROT180 SPROT270 SPREVH SPREVV SPADD BGROT0 BGROT90 BGROT180 BGROT270 BGREVH BGREVV CHKXY CHKZ CHKUV CHKI CHKR CHKS CHKC CHKV BQAPF BQLPF BQHPF BQBPF BQBSF BQLSF BQHSF BQPEQ WFRECT WFHAMM WFHANN WFBLKM AOPADD AOPSUB AOPMUL AOPDIV AOPMAD AOPLIP AOPCLP")

' 字句解析

def lex string$, tk$[], type[]
	var record$ = ""
	dim phase[0]
	var index = 0
	var isRecorded = false

	while true
		var c$ = mid$(string$, index, 1)

		if c$ == chr$(34) && !len(phase) then
			push phase, STRING
			isRecorded = true
			inc index
		elseif c$ == chr$(34) && !len(phase) then
			push type, pop(phase)
			push tk$, record$ + chr$(34)
			record$ = ""
			isRecorded = false
			inc index
		elseif len(phase) && phase[len(phase) - 1] == STRING && index != len(string$) - 1 then
			inc index
		elseif c$ == chr$(34) && phase[len(phase) - 1] != STRING then
			if indexOf$(reservedWords$, record$) != -1 then phase[len(phase) - 1] = RESERVED
			if indexOf$(operators$, record$) != -1 then phase[len(phase) - 1] = OPERATOR
			push type, pop(phase)
			push tk$, record$
			record$ = ""
			push phase, STRING
			inc index
		elseif c$ == "#" then
			push phase, DIRECTION
			isRecorded = true
			inc index
		elseif c$ == " " || index == len(string$) - 1 then
			if len(phase) then
				if phase[len(phase) - 1] == UNKNOWN then
					if indexOf$(reservedWords$, record$) != -1 then phase[len(phase) - 1] = RESERVED
					if indexOf$(operators$, record$) != -1 then phase[len(phase) - 1] = OPERATOR
				endif
				if phase[len(phase) - 1] == DIRECTION && indexOf$(constants$, record$) != -1 then phase[len(phase) - 1] = CONSTANT
				if phase[len(phase) - 1] == STRING then ? "Error: 文字列定数がダブルクォートによって正しく閉じられていません" : break
				push type, pop(phase)
				push tk$, record$
				record$ = ""
				isRecorded = false
			endif
			inc index
		elseif c$ != " " && !isRecorded then
			push phase, UNKNOWN
			isRecorded = true
			inc index
		else
			inc index
		endif

		if isRecorded then record$ = record$ + c$
		if index >= len(string$) then break
	wend
end

var i, n
for n = 0 to prgSize(1) - 1
	dim tk$[0]
	dim type[0]
	lex prgGet$(), tk$, type
	for i = 0 to len(tk$)
		? tk$[i] + " " + str$(type[i])
	next
next

' PROJECT SMILE++
' Smile++ Transpiler 2017.1

option strict

acls
prgEdit 1

' 配列の要素を検索する

def indexOf$(array$[], string$)
	var i
	for i = 0 to len(array$) - 1
		if array$[i] == string$ then return i
	next
	return -1
end

' 配列を生成する

def array(list$)
	dim arr[0]
	var tmp = ""
	var i
	var c$ = ""
	for i = 0 to len(list$) - 1
		c$ = mid$(list$, i, 1)
		if c$ == " " && tmp$ != "" then
			push arr, val(tmp$)
			tmp$ = ""
		endif
		tmp$ = tmp$ + c$
	next
	if tmp$ != "" && tmp$ != " " then push arr, val(tmp$)
	return arr
end

def array$(list$)
	dim arr$[0]
	var tmp$ = ""
	var i
	var c$ = ""
	for i = 0 to len(list$) - 1
		c$ = mid$(list$, i, 1)
		if c$ == " " && tmp$ != "" then
			push arr$, tmp$
			tmp$ = ""
		else
			tmp$ = tmp$ + c$
		endif
	next
	if tmp$ != "" && tmp$ != " " then push arr$, tmp$
	return arr$
end

' 配列の内容を出力する

def arrayDump arr[]
	var i
	for i = 0 to len(arr) - 1
		? str$(arr[i]) + " ";
	next
	? ""
end

def arrayDump arr$[]
	var i
	for i = 0 to len(arr$) - 1
		? arr$[i] + " ";
	next
	? ""
end

' 定数

var UNKNOWN = 1, DIRECTION = 2, RESERVED = 3
var OPERATOR = 4, CONSTANT = 5, STRING = 6

' 演算子

dim operators$[0]
operators$ = array$("+ - * / DIV MOD << >> NOT ( ) == != < <= > >= && || AND OR XOR !")

' 予約語

dim reservedWords$[0]
reservedWords$ = array$("IF THEN ELSE ELSEIF ENDIF GOTO GOSUB RETURN ON FOR NEXT WHILE WEND REPEAT UNTIL BREAK CONTINUE DEF END VAR DIM DATA READ RESTORE PRINT INPUT LINPUT CALL SWAP OUT COMMON USE EXEC FILES SAVE RENAME DELETE CHKFILE PRGEDIT PRGGET$ PRGSET PRGINS PRGDEL PRGSIZE PRGNAME$ XSCREEN DISPLAY VISIBLE BACKCOLOR ACLS FADE CLS COLOR LOCATE PRINT ? ATTR SCROLL FONTDEF WIDTH SPPAGE SPCLIP SPDEF SPSET SPCLR SPSHOW SPHIDE SPHOME SPOFS SPROT SPSCALE SPCOLOR SPCHR SPLINK SPUNLINK SPANIM SPSTOP SPSTART SPCHK SPVAR SPCOL SPCOLVEC SPHITINFO SPFUNC BGPAGE BGSCREEN BGCLR BGSHOW BGHIDE BGCLIP BGHOME BGOFS BGROT BGSCALE BGPUT BGFILL BGSET BGANIM BGSTOP BGSTART BGCHK BGVAR BGLOAD BGSAVE BGCOORD BGCOLOR BGFUNC GPAGE GCOLOR RGBREAD GCLIP GPRIO GCLS GPSET GLINE GCIRCLE GBOX GFILL GPAINT GCOPY GSAVE GLOAD GTRI GPUTCHR GOFS GPUTCHR16 XON XOFF BUTTON BREPEAT STICK STICKX ACCEL GYROA GYROV GYROSYNC TOUCH MICSTART MICSTOP MICDATA MICSAVE CONTROLLER VIBLATE BEEP BGMCHK BGMCLEAR BGMPLAY BGMSET BGMSETD BGMVAR BGMSTOP BGMVOL WAVSET WAVSETA EFCOFF EFCON EFCSET EFCWET TALK TALKCHK TALKSTOP BGMPAUSE BGMCONT SNDSTOP BIQUAD BQPARAM FFT IFFT FFTWFN PCMCONT PCMSTOP PCMSTREAM PCMVOL RINGCOPY ARYOP MPSTART MPSEND MPRECV MPSTAT MPNAME$ MPGET MPSET INC DEC COPY SORT RSORT PUSH UNSHIFT FILL RANDOMIZE STOP OPTION WAIT VSYNC REM KEY DTREAD TMREAD DIALOG CLIPBOARD DLCOPEN")

' 組み込み定数

dim constants$[0]
constants$ = array$("ON OFF YES NO TRUE FALSE BLACK NAVY BLUE GREEN TEAL LIME AQUA CYAN MAROON PURPLE OLIVE GRAY SILVER RED FUCHSIA MAGENTA YELLOW WHITE TBLACK TMAROON TRED TGREEN TLIME TOLIVE TYELLOW TNAVY TBLUE TPURPLE TMAGENTA TTREAL TCYAN TGRAY TWHITE UP DOWN LEFT RIGHT A B X Y L R ZR ZL TROT0 TROT90 TROT180 TROT270 TREVH TREVV SPSHOW SPROT0 SPROT90 SPROT180 SPROT180 SPROT270 SPREVH SPREVV SPADD BGROT0 BGROT90 BGROT180 BGROT270 BGREVH BGREVV CHKXY CHKZ CHKUV CHKI CHKR CHKS CHKC CHKV BQAPF BQLPF BQHPF BQBPF BQBSF BQLSF BQHSF BQPEQ WFRECT WFHAMM WFHANN WFBLKM AOPADD AOPSUB AOPMUL AOPDIV AOPMAD AOPLIP AOPCLP")

' 字句解析

def lex string$, tk$[], type[]
	var record$ = ""
	dim phase[0]
	var index = 0
	var isRecorded = false

	while true
		var c$ = mid$(string$, index, 1)

		if c$ == chr$(34) && !len(phase) then
			push phase, STRING
			isRecorded = true
			inc index
		elseif c$ == chr$(34) && !len(phase) then
			push type, pop(phase)
			push tk$, record$ + chr$(34)
			record$ = ""
			isRecorded = false
			inc index
		elseif len(phase) && phase[len(phase) - 1] == STRING && index != len(string$) - 1 then
			inc index
		elseif c$ == "#" then
			push phase, DIRECTION
			isRecorded = true
			inc index
		elseif c$ == " " || index == len(string$) - 1 then
			if len(phase) then
				if phase[len(phase) - 1] == UNKNOWN then
					if indexOf$(reservedWords$, record$) != -1 then phase[len(phase) - 1] = RESERVED
					if indexOf$(operators$, record$) != -1 then phase[len(phase) - 1] = OPERATOR
				endif
				if phase[len(phase) - 1] == DIRECTION && indexOf$(constants$, record$) != -1 then phase[len(phase) - 1] = CONSTANT
				if phase[len(phase) - 1] == STRING then ? "Error: 文字列定数がダブルクォートによって正しく閉じられていません" : break
				push type, pop(phase)
				push tk$, record$
				record$ = ""
				isRecorded = false
			endif
			inc index
		elseif c$ != " " && !isRecorded then
			push phase, UNKNOWN
			isRecorded = true
			inc index
		else
			inc index
		endif

		if isRecorded then record$ = record$ + c$
		if index >= len(string$) then break
	wend
end

var i, n
for n = 0 to prgSize(1) - 1
	dim tk$[0]
	dim type[0]
	lex prgGet$(), tk$, type
	for i = 0 to len(tk$)
		? tk$[i] + " " + str$(type[i])
	next
next


[Model] Added XSolution.IsShuttingDown

[Model] Added XSolution.IsShuttingDown

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System.Collections.Concurrent
USING System.Collections.Generic
USING System.IO
USING System.Linq
USING System

BEGIN NAMESPACE XSharpModel
    STATIC CLASS XSolution
    // Fields
    STATIC PRIVATE _orphanedFilesProject := NULL AS XProject
    STATIC PROPERTY IsOpen as LOGIC GET !String.IsNullOrEmpty(_fileName)

    STATIC PRIVATE _projects AS ConcurrentDictionary<STRING, XProject>
    STATIC PRIVATE _fileName   AS STRING
    STATIC PRIVATE _sqldb      AS STRING
    STATIC PRIVATE _commentTokens AS List<XCommentToken>
    STATIC PROPERTY IsClosing  AS LOGIC AUTO
    STATIC PROPERTY IsShuttingDown  AS LOGIC AUTO

        // OrphanedFiles Project is always open, so at least 1
    STATIC PROPERTY HasProject AS  LOGIC GET _projects:Count > 1
    STATIC PROPERTY FileName AS STRING GET _fileName
    STATIC PROPERTY BuiltInFunctions AS STRING AUTO
    STATIC PROPERTY CommentTokens AS IList<XCommentToken> GET _commentTokens
    STATIC PROPERTY Projects AS IList<XProject> get _projects:Values:ToArray()

        // Methods
    STATIC CONSTRUCTOR
        _projects := ConcurrentDictionary<STRING, XProject>{StringComparer.OrdinalIgnoreCase}
        IsClosing   := FALSE
        _commentTokens := List < XCommentToken >{}

    STATIC METHOD SetCommentTokens( aTokens AS IList<XCommentToken>) AS VOID
        _commentTokens:Clear()
        _commentTokens:AddRange(aTokens)

    STATIC METHOD WriteOutputMessage(message AS STRING) AS VOID
        IF XSettings.EnableLogging
            XSettings.LogMessage(message)
        ENDIF
    STATIC METHOD WriteException(ex AS Exception, msg as STRING) AS VOID
        XSettings.LogException(ex, msg)
        RETURN

    STATIC METHOD CreateBuiltInFunctions(folder as STRING) AS VOID
        TRY
            BuiltInFunctions := Path.Combine(folder, "BuiltInFunctions.prg")
            IF System.IO.File.Exists(BuiltInFunctions)
                System.IO.File.SetAttributes(BuiltInFunctions, FileAttributes.Normal)
                System.IO.File.Delete(BuiltInFunctions)
            ENDIF
            System.IO.File.WriteAllText(BuiltInFunctions, XSharpBuiltInFunctions(BuiltInFunctions))
            System.IO.File.SetAttributes(BuiltInFunctions, FileAttributes.ReadOnly)
        CATCH e as Exception
            XSettings.LogException(e,__FUNCTION__)
            BuiltInFunctions := ""
        END TRY

    STATIC METHOD Open(cFile as STRING) AS VOID
        WriteOutputMessage("XModel.Solution.OpenSolution() "+cFile)
        _fileName := cFile
        var folder := Path.GetDirectoryName(_fileName)
        folder     := Path.Combine(folder, ".vs")
        IF ! Directory.Exists(folder)
            Directory.CreateDirectory(folder)
        ENDIF
        folder    := Path.Combine(folder, Path.GetFileNameWithoutExtension(_fileName))
        IF ! Directory.Exists(folder)
            Directory.CreateDirectory(folder)
        ENDIF
        CreateBuiltInFunctions(folder)
        _sqldb    := Path.Combine(folder, "X#Model.xsdb")
        XDatabase.CreateOrOpenDatabase(_sqldb)
        VAR dbprojectList := XDatabase.GetProjectFileNames()
        FOREACH var project in _projects:Values
            XDatabase.Read(project)
            ModelWalker.AddProject(project)
            FOREACH VAR dbproject  in dbprojectList
                if String.Compare(dbproject, project:FileName, StringComparison.OrdinalIgnoreCase) == 0
                    dbprojectList:Remove(dbproject)
                    EXIT
                ENDIF
            NEXT
            IF System.IO.File.Exists(BuiltInFunctions)
                project:AddFile(BuiltInFunctions)
            ENDIF
        NEXT
        if dbprojectList:Count > 0
            FOREACH var dbproject in dbprojectList
                XDatabase.DeleteProject(dbproject)
            NEXT
        endif
        ModelWalker.Start()

    STATIC METHOD AddOrphan(fileName as STRING) AS XFile
        OrphanedFilesProject:AddFile(fileName)
        return OrphanedFilesProject:FindXFile(fileName)

    INTERNAL STATIC METHOD Add(project AS XProject) AS LOGIC
        RETURN @@Add(project:Name, project)

    INTERNAL STATIC METHOD Add(projectName AS STRING, project AS XProject) AS LOGIC
        WriteOutputMessage("XModel.Solution.Add() "+projectName+" "+project.FileName)
        IF _projects:ContainsKey(projectName)
            RETURN FALSE
        ENDIF
        VAR lOk := _projects:TryAdd(projectName, project)
        IF lOk .and. IsOpen
            XDatabase.Read(project)
        ENDIF
        RETURN lOk

    STATIC METHOD Close() AS VOID
        IF IsOpen
            WriteOutputMessage("XModel.Solution.CloseSolution()" + _fileName)
            ModelWalker.Stop()
            XDatabase.CloseDatabase(_sqldb)

            FOREACH VAR pair IN _projects:ToArray()
                var project := (XProject) pair:Value
                project:UnLoad()
                project:Close()
            NEXT
            _projects:Clear()
            SystemTypeController.Clear()
            _orphanedFilesProject := NULL
            _fileName  := NULL
        ENDIF

    STATIC METHOD FileClose(fileName AS STRING) AS VOID
        IF FindFile(fileName):Project == _orphanedFilesProject
            _orphanedFilesProject:RemoveFile(fileName)
        ENDIF

    STATIC METHOD FindFile(fileName AS STRING) AS XFile
        FOREACH VAR project IN _projects
            VAR file := project:Value:FindXFile(fileName)
            IF file != NULL
                RETURN file
            ENDIF
        NEXT
        RETURN NULL

    STATIC METHOD FindFullPath(fullPath AS STRING) AS XFile
        FOREACH VAR project IN _projects
            VAR file := project:Value:FindXFile(fullPath)
            IF file != NULL
                RETURN file
            ENDIF
        NEXT
        RETURN NULL

    STATIC METHOD FindProject(projectFile AS STRING) AS XProject
        LOCAL project AS XProject
        projectFile := System.IO.Path.GetFileNameWithoutExtension(projectFile)
        project := NULL
        IF _projects:TryGetValue(projectFile, OUT project) .AND. project != NULL
            RETURN project
        ENDIF
        RETURN NULL

    INTERNAL STATIC METHOD Remove(projectName AS STRING) AS LOGIC
        WriteOutputMessage("XModel.Solution.Remove() "+projectName)
        IF _projects:ContainsKey(projectName)
            VAR result := _projects:TryRemove(projectName, OUT VAR p)
            IF (p != NULL)
                FOREACH otherProject AS XProject IN _projects:Values
                    otherProject:RemoveProjectReference(p:FileName)
                NEXT
            ENDIF
            RETURN result
        ENDIF
        RETURN FALSE

    INTERNAL STATIC METHOD RenameProject(oldName AS STRING, newName AS STRING) AS VOID
         WriteOutputMessage("XModel.Solution.RenameProject() "+oldName+" "+newName)
        IF _projects:ContainsKey(oldName)
            _projects:TryRemove(oldName, OUT VAR project)
            IF project != NULL
                _projects:TryAdd(newName, project)
            ENDIF
        ENDIF

    INTERNAL STATIC METHOD Remove(project AS XProject) AS LOGIC
        IF project != NULL .AND. project:ProjectNode != NULL  .AND. _projects:Count > 0
            RETURN XSolution.Remove(project:Name)
        ENDIF
        RETURN FALSE

    STATIC METHOD WalkFile(fileName AS STRING) AS VOID
        VAR file := FindFile(fileName)
        IF file != NULL
            ModelWalker.FileWalk(file)
        ENDIF
        RETURN

    STATIC METHOD CreateOrphanedFilesProject() AS VOID
        var prj := OrphanedFilesProject{}
        _orphanedFilesProject := XProject{prj}
        VAR projectNode := (OrphanedFilesProject)(_orphanedFilesProject:ProjectNode)
        projectNode:Project := _orphanedFilesProject
        IF _projects:TryAdd(prj:Name, _orphanedFilesProject)
            projectNode:Project:AddAssemblyReference(TYPEOF(STRING):Assembly:Location)
        ENDIF

    STATIC METHOD SetStatusBarText(cText AS STRING) AS VOID
        XSettings.SetStatusBarText(cText)

    STATIC METHOD SetStatusBarProgress(cMessage as STRING, nItem AS LONG, nTotal as LONG) AS VOID
        XSettings.SetStatusBarProgress(cMessage, nItem, nTotal)

    STATIC METHOD SetStatusBarAnimation(onOff AS LOGIC, id AS SHORT) AS VOID
        XSettings.SetStatusBarAnimation(onOff, id)

   STATIC PROPERTY OrphanedFilesProject AS XProject
        GET
            IF _orphanedFilesProject == NULL
                CreateOrphanedFilesProject()
            ENDIF
            RETURN _orphanedFilesProject
        END GET
    END PROPERTY

    END CLASS

END NAMESPACE

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System.Collections.Concurrent
USING System.Collections.Generic
USING System.IO
USING System.Linq
USING System

BEGIN NAMESPACE XSharpModel
    STATIC CLASS XSolution
    // Fields
    STATIC PRIVATE _orphanedFilesProject := NULL AS XProject
    STATIC PROPERTY IsOpen as LOGIC GET !String.IsNullOrEmpty(_fileName)

    STATIC PRIVATE _projects AS ConcurrentDictionary<STRING, XProject>
    STATIC PRIVATE _fileName   AS STRING
    STATIC PRIVATE _sqldb      AS STRING
    STATIC PRIVATE _commentTokens AS List<XCommentToken>
    STATIC PROPERTY IsClosing  AS LOGIC AUTO

        // OrphanedFiles Project is always open, so at least 1
    STATIC PROPERTY HasProject AS  LOGIC GET _projects:Count > 1
    STATIC PROPERTY FileName AS STRING GET _fileName
    STATIC PROPERTY BuiltInFunctions AS STRING AUTO
    STATIC PROPERTY CommentTokens AS IList<XCommentToken> GET _commentTokens
    STATIC PROPERTY Projects AS IList<XProject> get _projects:Values:ToArray()

        // Methods
    STATIC CONSTRUCTOR
        _projects := ConcurrentDictionary<STRING, XProject>{StringComparer.OrdinalIgnoreCase}
        IsClosing   := FALSE
        _commentTokens := List < XCommentToken >{}

    STATIC METHOD SetCommentTokens( aTokens AS IList<XCommentToken>) AS VOID
        _commentTokens:Clear()
        _commentTokens:AddRange(aTokens)

    STATIC METHOD WriteOutputMessage(message AS STRING) AS VOID
        IF XSettings.EnableLogging
            XSettings.LogMessage(message)
        ENDIF
    STATIC METHOD WriteException(ex AS Exception, msg as STRING) AS VOID
        XSettings.LogException(ex, msg)
        RETURN

    STATIC METHOD CreateBuiltInFunctions(folder as STRING) AS VOID
        TRY
            BuiltInFunctions := Path.Combine(folder, "BuiltInFunctions.prg")
            IF System.IO.File.Exists(BuiltInFunctions)
                System.IO.File.SetAttributes(BuiltInFunctions, FileAttributes.Normal)
                System.IO.File.Delete(BuiltInFunctions)
            ENDIF
            System.IO.File.WriteAllText(BuiltInFunctions, XSharpBuiltInFunctions(BuiltInFunctions))
            System.IO.File.SetAttributes(BuiltInFunctions, FileAttributes.ReadOnly)
        CATCH e as Exception
            XSettings.LogException(e,__FUNCTION__)
            BuiltInFunctions := ""
        END TRY

    STATIC METHOD Open(cFile as STRING) AS VOID
        WriteOutputMessage("XModel.Solution.OpenSolution() "+cFile)
        _fileName := cFile
        var folder := Path.GetDirectoryName(_fileName)
        folder     := Path.Combine(folder, ".vs")
        IF ! Directory.Exists(folder)
            Directory.CreateDirectory(folder)
        ENDIF
        folder    := Path.Combine(folder, Path.GetFileNameWithoutExtension(_fileName))
        IF ! Directory.Exists(folder)
            Directory.CreateDirectory(folder)
        ENDIF
        CreateBuiltInFunctions(folder)
        _sqldb    := Path.Combine(folder, "X#Model.xsdb")
        XDatabase.CreateOrOpenDatabase(_sqldb)
        VAR dbprojectList := XDatabase.GetProjectFileNames()
        FOREACH var project in _projects:Values
            XDatabase.Read(project)
            ModelWalker.AddProject(project)
            FOREACH VAR dbproject  in dbprojectList
                if String.Compare(dbproject, project:FileName, StringComparison.OrdinalIgnoreCase) == 0
                    dbprojectList:Remove(dbproject)
                    EXIT
                ENDIF
            NEXT
            IF System.IO.File.Exists(BuiltInFunctions)
                project:AddFile(BuiltInFunctions)
            ENDIF
        NEXT
        if dbprojectList:Count > 0
            FOREACH var dbproject in dbprojectList
                XDatabase.DeleteProject(dbproject)
            NEXT
        endif
        ModelWalker.Start()

    STATIC METHOD AddOrphan(fileName as STRING) AS XFile
        OrphanedFilesProject:AddFile(fileName)
        return OrphanedFilesProject:FindXFile(fileName)

    INTERNAL STATIC METHOD Add(project AS XProject) AS LOGIC
        RETURN @@Add(project:Name, project)

    INTERNAL STATIC METHOD Add(projectName AS STRING, project AS XProject) AS LOGIC
        WriteOutputMessage("XModel.Solution.Add() "+projectName+" "+project.FileName)
        IF _projects:ContainsKey(projectName)
            RETURN FALSE
        ENDIF
        VAR lOk := _projects:TryAdd(projectName, project)
        IF lOk .and. IsOpen
            XDatabase.Read(project)
        ENDIF
        RETURN lOk

    STATIC METHOD Close() AS VOID
        IF IsOpen
            WriteOutputMessage("XModel.Solution.CloseSolution()" + _fileName)
            ModelWalker.Stop()
            XDatabase.CloseDatabase(_sqldb)

            FOREACH VAR pair IN _projects:ToArray()
                var project := (XProject) pair:Value
                project:UnLoad()
                project:Close()
            NEXT
            _projects:Clear()
            SystemTypeController.Clear()
            _orphanedFilesProject := NULL
            _fileName  := NULL
        ENDIF

    STATIC METHOD FileClose(fileName AS STRING) AS VOID
        IF FindFile(fileName):Project == _orphanedFilesProject
            _orphanedFilesProject:RemoveFile(fileName)
        ENDIF

    STATIC METHOD FindFile(fileName AS STRING) AS XFile
        FOREACH VAR project IN _projects
            VAR file := project:Value:FindXFile(fileName)
            IF file != NULL
                RETURN file
            ENDIF
        NEXT
        RETURN NULL

    STATIC METHOD FindFullPath(fullPath AS STRING) AS XFile
        FOREACH VAR project IN _projects
            VAR file := project:Value:FindXFile(fullPath)
            IF file != NULL
                RETURN file
            ENDIF
        NEXT
        RETURN NULL

    STATIC METHOD FindProject(projectFile AS STRING) AS XProject
        LOCAL project AS XProject
        projectFile := System.IO.Path.GetFileNameWithoutExtension(projectFile)
        project := NULL
        IF _projects:TryGetValue(projectFile, OUT project) .AND. project != NULL
            RETURN project
        ENDIF
        RETURN NULL

    INTERNAL STATIC METHOD Remove(projectName AS STRING) AS LOGIC
        WriteOutputMessage("XModel.Solution.Remove() "+projectName)
        IF _projects:ContainsKey(projectName)
            VAR result := _projects:TryRemove(projectName, OUT VAR p)
            IF (p != NULL)
                FOREACH otherProject AS XProject IN _projects:Values
                    otherProject:RemoveProjectReference(p:FileName)
                NEXT
            ENDIF
            RETURN result
        ENDIF
        RETURN FALSE

    INTERNAL STATIC METHOD RenameProject(oldName AS STRING, newName AS STRING) AS VOID
         WriteOutputMessage("XModel.Solution.RenameProject() "+oldName+" "+newName)
        IF _projects:ContainsKey(oldName)
            _projects:TryRemove(oldName, OUT VAR project)
            IF project != NULL
                _projects:TryAdd(newName, project)
            ENDIF
        ENDIF

    INTERNAL STATIC METHOD Remove(project AS XProject) AS LOGIC
        IF project != NULL .AND. project:ProjectNode != NULL  .AND. _projects:Count > 0
            RETURN XSolution.Remove(project:Name)
        ENDIF
        RETURN FALSE

    STATIC METHOD WalkFile(fileName AS STRING) AS VOID
        VAR file := FindFile(fileName)
        IF file != NULL
            ModelWalker.FileWalk(file)
        ENDIF
        RETURN

    STATIC METHOD CreateOrphanedFilesProject() AS VOID
        var prj := OrphanedFilesProject{}
        _orphanedFilesProject := XProject{prj}
        VAR projectNode := (OrphanedFilesProject)(_orphanedFilesProject:ProjectNode)
        projectNode:Project := _orphanedFilesProject
        IF _projects:TryAdd(prj:Name, _orphanedFilesProject)
            projectNode:Project:AddAssemblyReference(TYPEOF(STRING):Assembly:Location)
        ENDIF

    STATIC METHOD SetStatusBarText(cText AS STRING) AS VOID
        XSettings.SetStatusBarText(cText)

    STATIC METHOD SetStatusBarProgress(cMessage as STRING, nItem AS LONG, nTotal as LONG) AS VOID
        XSettings.SetStatusBarProgress(cMessage, nItem, nTotal)

    STATIC METHOD SetStatusBarAnimation(onOff AS LOGIC, id AS SHORT) AS VOID
        XSettings.SetStatusBarAnimation(onOff, id)

   STATIC PROPERTY OrphanedFilesProject AS XProject
        GET
            IF _orphanedFilesProject == NULL
                CreateOrphanedFilesProject()
            ENDIF
            RETURN _orphanedFilesProject
        END GET
    END PROPERTY

    END CLASS

END NAMESPACE


class QClipboard updated - fixed method text - removed methods text# - formatting

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt5xhb_clsid.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QIMAGE
REQUEST QMIMEDATA
REQUEST QPIXMAP
#endif

CLASS QClipboard INHERIT QObject

   DATA class_id INIT Class_Id_QClipboard
   DATA class_flags INIT 1
   DATA self_destruction INIT .f.

   METHOD clear
   METHOD image
   METHOD mimeData
   METHOD ownsClipboard
   METHOD ownsFindBuffer
   METHOD ownsSelection
   METHOD pixmap
   METHOD setImage
   METHOD setMimeData
   METHOD setPixmap
   METHOD setText
   METHOD supportsFindBuffer
   METHOD supportsSelection
   METHOD text
   METHOD onChanged
   METHOD onDataChanged
   METHOD onFindBufferChanged
   METHOD onSelectionChanged
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QClipboard
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#include <QClipboard>
#endif

#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"

#ifndef __XHARBOUR__
#include "hbapicls.h"
#define ISNIL HB_ISNIL
#define ISLOG HB_ISLOG
#define ISNUM HB_ISNUM
#define ISCHAR HB_ISCHAR
#define ISPOINTER HB_ISPOINTER
#define ISOBJECT HB_ISOBJECT
#define ISARRAY HB_ISARRAY
#endif

#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#include <QClipboard>
#endif

#include <QImage>
#include <QMimeData>
#include <QPixmap>

/*
void clear ( Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_CLEAR )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    obj->clear (  (QClipboard::Mode) par1 );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QImage image ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_IMAGE )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    QImage * ptr = new QImage( obj->image (  (QClipboard::Mode) par1 ) );
    _qt5xhb_createReturnClass ( ptr, "QIMAGE", true );
  }
}

/*
const QMimeData * mimeData ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_MIMEDATA )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    const QMimeData * ptr = obj->mimeData (  (QClipboard::Mode) par1 );
    _qt5xhb_createReturnClass ( ptr, "QMIMEDATA" );
  }
}

/*
bool ownsClipboard () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSCLIPBOARD )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    hb_retl( obj->ownsClipboard (  ) );
  }
}

/*
bool ownsFindBuffer () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSFINDBUFFER )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    hb_retl( obj->ownsFindBuffer (  ) );
  }
}

/*
bool ownsSelection () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSSELECTION )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    hb_retl( obj->ownsSelection (  ) );
  }
}

/*
QPixmap pixmap ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_PIXMAP )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    QPixmap * ptr = new QPixmap( obj->pixmap (  (QClipboard::Mode) par1 ) );
    _qt5xhb_createReturnClass ( ptr, "QPIXMAP", true );
  }
}

/*
void setImage ( const QImage & image, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETIMAGE )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    QImage * par1 = (QImage *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setImage ( *par1,  (QClipboard::Mode) par2 );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setMimeData ( QMimeData * src, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETMIMEDATA )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setMimeData ( par1,  (QClipboard::Mode) par2 );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setPixmap ( const QPixmap & pixmap, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETPIXMAP )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    QPixmap * par1 = (QPixmap *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setPixmap ( *par1,  (QClipboard::Mode) par2 );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setText ( const QString & text, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETTEXT )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setText ( par1,  (QClipboard::Mode) par2 );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool supportsFindBuffer () const
*/
HB_FUNC_STATIC( QCLIPBOARD_SUPPORTSFINDBUFFER )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    hb_retl( obj->supportsFindBuffer (  ) );
  }
}

/*
bool supportsSelection () const
*/
HB_FUNC_STATIC( QCLIPBOARD_SUPPORTSSELECTION )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    hb_retl( obj->supportsSelection (  ) );
  }
}

/*
QString text ( Mode mode = Clipboard ) const
*/
void QClipboard_text1 ()
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    hb_retc( (const char *) obj->text (  (QClipboard::Mode) par1 ).toLatin1().data() );
  }
}

/*
QString text ( QString & subtype, Mode mode = Clipboard ) const
*/
void QClipboard_text2 ()
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    hb_retc( (const char *) obj->text ( par1,  (QClipboard::Mode) par2 ).toLatin1().data() );
  }
}

//[1]QString text ( Mode mode = Clipboard ) const
//[2]QString text ( QString & subtype, Mode mode = Clipboard ) const

HB_FUNC_STATIC( QCLIPBOARD_TEXT )
{
  if( ISBETWEEN(0,1) && (ISNUM(1)||ISNIL(1)) )
  {
    QClipboard_text1();
  }
  else if( ISBETWEEN(1,2) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) )
  {
    QClipboard_text2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

#pragma ENDDUMP

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt5xhb_clsid.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QIMAGE
REQUEST QMIMEDATA
REQUEST QPIXMAP
#endif

CLASS QClipboard INHERIT QObject

   DATA class_id INIT Class_Id_QClipboard
   DATA class_flags INIT 1
   DATA self_destruction INIT .f.

   METHOD clear
   METHOD image
   METHOD mimeData
   METHOD ownsClipboard
   METHOD ownsFindBuffer
   METHOD ownsSelection
   METHOD pixmap
   METHOD setImage
   METHOD setMimeData
   METHOD setPixmap
   METHOD setText
   METHOD supportsFindBuffer
   METHOD supportsSelection
   METHOD text1
   METHOD text2
   METHOD text
   METHOD onChanged
   METHOD onDataChanged
   METHOD onFindBufferChanged
   METHOD onSelectionChanged
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QClipboard
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#include <QClipboard>
#endif

#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"

#ifndef __XHARBOUR__
#include "hbapicls.h"
#define ISNIL HB_ISNIL
#define ISLOG HB_ISLOG
#define ISNUM HB_ISNUM
#define ISCHAR HB_ISCHAR
#define ISPOINTER HB_ISPOINTER
#define ISOBJECT HB_ISOBJECT
#define ISARRAY HB_ISARRAY
#endif

#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#include <QClipboard>
#endif

#include <QImage>
#include <QMimeData>
#include <QPixmap>

/*
void clear ( Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_CLEAR )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    obj->clear (  (QClipboard::Mode) par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QImage image ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_IMAGE )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    QImage * ptr = new QImage( obj->image (  (QClipboard::Mode) par1 ) );
    _qt5xhb_createReturnClass ( ptr, "QIMAGE", true );
  }
}

/*
const QMimeData * mimeData ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_MIMEDATA )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    const QMimeData * ptr = obj->mimeData (  (QClipboard::Mode) par1 );
    _qt5xhb_createReturnClass ( ptr, "QMIMEDATA" );
  }
}

/*
bool ownsClipboard () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSCLIPBOARD )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->ownsClipboard (  ) );
  }
}

/*
bool ownsFindBuffer () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSFINDBUFFER )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->ownsFindBuffer (  ) );
  }
}

/*
bool ownsSelection () const
*/
HB_FUNC_STATIC( QCLIPBOARD_OWNSSELECTION )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->ownsSelection (  ) );
  }
}

/*
QPixmap pixmap ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_PIXMAP )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    QPixmap * ptr = new QPixmap( obj->pixmap (  (QClipboard::Mode) par1 ) );
    _qt5xhb_createReturnClass ( ptr, "QPIXMAP", true );
  }
}

/*
void setImage ( const QImage & image, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETIMAGE )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QImage * par1 = (QImage *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setImage ( *par1,  (QClipboard::Mode) par2 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setMimeData ( QMimeData * src, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETMIMEDATA )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setMimeData ( par1,  (QClipboard::Mode) par2 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setPixmap ( const QPixmap & pixmap, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETPIXMAP )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QPixmap * par1 = (QPixmap *) _qt5xhb_itemGetPtr(1);
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setPixmap ( *par1,  (QClipboard::Mode) par2 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setText ( const QString & text, Mode mode = Clipboard )
*/
HB_FUNC_STATIC( QCLIPBOARD_SETTEXT )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    obj->setText ( par1,  (QClipboard::Mode) par2 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool supportsFindBuffer () const
*/
HB_FUNC_STATIC( QCLIPBOARD_SUPPORTSFINDBUFFER )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->supportsFindBuffer (  ) );
  }
}

/*
bool supportsSelection () const
*/
HB_FUNC_STATIC( QCLIPBOARD_SUPPORTSSELECTION )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->supportsSelection (  ) );
  }
}

/*
QString text ( Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_TEXT1 )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    int par1 = ISNIL(1)? (int) QClipboard::Clipboard : hb_parni(1);
    hb_retc( (const char *) obj->text (  (QClipboard::Mode) par1 ).toLatin1().data() );
  }
}

/*
QString text ( QString & subtype, Mode mode = Clipboard ) const
*/
HB_FUNC_STATIC( QCLIPBOARD_TEXT2 )
{
  QClipboard * obj = (QClipboard *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    int par2 = ISNIL(2)? (int) QClipboard::Clipboard : hb_parni(2);
    hb_retc( (const char *) obj->text ( par1,  (QClipboard::Mode) par2 ).toLatin1().data() );
  }
}

//[1]QString text ( Mode mode = Clipboard ) const
//[2]QString text ( QString & subtype, Mode mode = Clipboard ) const

HB_FUNC_STATIC( QCLIPBOARD_TEXT )
{
  if( ISBETWEEN(1,2) && (ISNUM(1)||ISNIL(1)) )
  {
    HB_FUNC_EXEC( QCLIPBOARD_TEXT1 );
  }
  else if( ISBETWEEN(1,2) && ISCHAR(1) && (ISNUM(2)||ISNIL(1)) )
  {
    HB_FUNC_EXEC( QCLIPBOARD_TEXT2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

#pragma ENDDUMP


QtScriptTools: module updated to use the file qt4xhb_common.h

/*

  Qt4xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 4

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt4xhb_clsid.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QMENU
REQUEST QTOOLBAR
REQUEST QMAINWINDOW
REQUEST QWIDGET
#endif

CLASS QScriptEngineDebugger INHERIT QObject

   DATA class_id INIT Class_Id_QScriptEngineDebugger
   DATA self_destruction INIT .f.

   METHOD new
   METHOD delete
   METHOD action
   METHOD attachTo
   METHOD autoShowStandardWindow
   METHOD createStandardMenu
   METHOD createStandardToolBar
   METHOD detach
   METHOD setAutoShowStandardWindow
   METHOD standardWindow
   METHOD state
   METHOD widget
   METHOD onEvaluationResumed
   METHOD onEvaluationSuspended
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngineDebugger
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngineDebugger>

#include "qt4xhb_common.h"
#include "qt4xhb_clsid.h"
#include "qt4xhb_utils.h"

/*
QScriptEngineDebugger ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_NEW )
{
  QScriptEngineDebugger * o = NULL;
  QObject * par1 = ISNIL(1)? 0 : (QObject *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
  o = new QScriptEngineDebugger ( par1 );
  PHB_ITEM self = hb_stackSelfItem();
  PHB_ITEM ptr = hb_itemPutPtr( NULL,(QScriptEngineDebugger *) o );
  hb_objSendMsg( self, "_pointer", 1, ptr );
  hb_itemRelease( ptr );
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DELETE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QAction * action ( DebuggerAction action ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ACTION )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QAction * ptr = obj->action (  (QScriptEngineDebugger::DebuggerAction) hb_parni(1) );
    _qt4xhb_createReturnClass ( ptr, "QACTION" );
  }
}

/*
void attachTo ( QScriptEngine * engine )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ATTACHTO )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QScriptEngine * par1 = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    obj->attachTo ( par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool autoShowStandardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_AUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    hb_retl( obj->autoShowStandardWindow (  ) );
  }
}

/*
QMenu * createStandardMenu ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDMENU )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * par1 = ISNIL(1)? 0 : (QWidget *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    QMenu * ptr = obj->createStandardMenu ( par1 );
    _qt4xhb_createReturnClass ( ptr, "QMENU" );
  }
}

/*
QToolBar * createStandardToolBar ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDTOOLBAR )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * par1 = ISNIL(1)? 0 : (QWidget *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    QToolBar * ptr = obj->createStandardToolBar ( par1 );
    _qt4xhb_createReturnClass ( ptr, "QTOOLBAR" );
  }
}

/*
void detach ()
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DETACH )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->detach (  );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAutoShowStandardWindow ( bool autoShow )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_SETAUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setAutoShowStandardWindow ( (bool) hb_parl(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QMainWindow * standardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QMainWindow * ptr = obj->standardWindow (  );
    _qt4xhb_createReturnClass ( ptr, "QMAINWINDOW" );
  }
}

/*
DebuggerState state () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STATE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    hb_retni( (int) obj->state (  ) );
  }
}

/*
QWidget * widget ( DebuggerWidget widget ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_WIDGET )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->widget (  (QScriptEngineDebugger::DebuggerWidget) hb_parni(1) );
    _qt4xhb_createReturnClass ( ptr, "QWIDGET" );
  }
}

#pragma ENDDUMP

/*

  Qt4xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 4

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt4xhb_clsid.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QMENU
REQUEST QTOOLBAR
REQUEST QMAINWINDOW
REQUEST QWIDGET
#endif

CLASS QScriptEngineDebugger INHERIT QObject

   DATA class_id INIT Class_Id_QScriptEngineDebugger
   DATA self_destruction INIT .f.

   METHOD new
   METHOD delete
   METHOD action
   METHOD attachTo
   METHOD autoShowStandardWindow
   METHOD createStandardMenu
   METHOD createStandardToolBar
   METHOD detach
   METHOD setAutoShowStandardWindow
   METHOD standardWindow
   METHOD state
   METHOD widget
   METHOD onEvaluationResumed
   METHOD onEvaluationSuspended
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngineDebugger
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngineDebugger>

#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"
#ifndef __XHARBOUR__
#include "hbapicls.h"
#define ISNIL HB_ISNIL
#define ISLOG HB_ISLOG
#define ISNUM HB_ISNUM
#define ISCHAR HB_ISCHAR
#define ISPOINTER HB_ISPOINTER
#define ISOBJECT HB_ISOBJECT
#define ISARRAY HB_ISARRAY
#endif
#include "qt4xhb_clsid.h"
#include "qt4xhb_utils.h"

/*
QScriptEngineDebugger ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_NEW )
{
  QScriptEngineDebugger * o = NULL;
  QObject * par1 = ISNIL(1)? 0 : (QObject *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
  o = new QScriptEngineDebugger ( par1 );
  PHB_ITEM self = hb_stackSelfItem();
  PHB_ITEM ptr = hb_itemPutPtr( NULL,(QScriptEngineDebugger *) o );
  hb_objSendMsg( self, "_pointer", 1, ptr );
  hb_itemRelease( ptr );
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DELETE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QAction * action ( DebuggerAction action ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ACTION )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QAction * ptr = obj->action (  (QScriptEngineDebugger::DebuggerAction) hb_parni(1) );
    _qt4xhb_createReturnClass ( ptr, "QACTION" );
  }
}

/*
void attachTo ( QScriptEngine * engine )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ATTACHTO )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QScriptEngine * par1 = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    obj->attachTo ( par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool autoShowStandardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_AUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    hb_retl( obj->autoShowStandardWindow (  ) );
  }
}

/*
QMenu * createStandardMenu ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDMENU )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * par1 = ISNIL(1)? 0 : (QWidget *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    QMenu * ptr = obj->createStandardMenu ( par1 );
    _qt4xhb_createReturnClass ( ptr, "QMENU" );
  }
}

/*
QToolBar * createStandardToolBar ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDTOOLBAR )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * par1 = ISNIL(1)? 0 : (QWidget *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) );
    QToolBar * ptr = obj->createStandardToolBar ( par1 );
    _qt4xhb_createReturnClass ( ptr, "QTOOLBAR" );
  }
}

/*
void detach ()
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DETACH )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->detach (  );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAutoShowStandardWindow ( bool autoShow )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_SETAUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setAutoShowStandardWindow ( (bool) hb_parl(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QMainWindow * standardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QMainWindow * ptr = obj->standardWindow (  );
    _qt4xhb_createReturnClass ( ptr, "QMAINWINDOW" );
  }
}

/*
DebuggerState state () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STATE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    hb_retni( (int) obj->state (  ) );
  }
}

/*
QWidget * widget ( DebuggerWidget widget ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_WIDGET )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->widget (  (QScriptEngineDebugger::DebuggerWidget) hb_parni(1) );
    _qt4xhb_createReturnClass ( ptr, "QWIDGET" );
  }
}

#pragma ENDDUMP


source/QtScriptTools: updated

source/QtScriptTools: updated

Modified:
source/QtScriptTools/QScriptEngineDebuggerClass.prg

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QMAINWINDOW
REQUEST QMENU
REQUEST QTOOLBAR
REQUEST QWIDGET
#endif

CLASS QScriptEngineDebugger INHERIT QObject

   METHOD new
   METHOD delete
   METHOD action
   METHOD attachTo
   METHOD autoShowStandardWindow
   METHOD createStandardMenu
   METHOD createStandardToolBar
   METHOD detach
   METHOD setAutoShowStandardWindow
   METHOD standardWindow
   METHOD state
   METHOD widget

   METHOD onEvaluationResumed
   METHOD onEvaluationSuspended

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngineDebugger
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngineDebugger>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QAction>
#include <QMenu>
#include <QToolBar>
#include <QMainWindow>

/*
QScriptEngineDebugger ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QScriptEngineDebugger * o = new QScriptEngineDebugger ( OPQOBJECT(1,0) );
    _qt4xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DELETE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QAction * action ( DebuggerAction action ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ACTION )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      QAction * ptr = obj->action ( (QScriptEngineDebugger::DebuggerAction) hb_parni(1) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QACTION" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void attachTo ( QScriptEngine * engine )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ATTACHTO )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTENGINE(1) )
    {
#endif
      obj->attachTo ( PQSCRIPTENGINE(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool autoShowStandardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_AUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->autoShowStandardWindow () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QMenu * createStandardMenu ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDMENU )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQWIDGET(1)||ISNIL(1)) )
    {
#endif
      QMenu * ptr = obj->createStandardMenu ( OPQWIDGET(1,0) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QMENU" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QToolBar * createStandardToolBar ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDTOOLBAR )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQWIDGET(1)||ISNIL(1)) )
    {
#endif
      QToolBar * ptr = obj->createStandardToolBar ( OPQWIDGET(1,0) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QTOOLBAR" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void detach ()
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DETACH )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->detach ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAutoShowStandardWindow ( bool autoShow )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_SETAUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISLOG(1) )
    {
#endif
      obj->setAutoShowStandardWindow ( PBOOL(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QMainWindow * standardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QMainWindow * ptr = obj->standardWindow ();
      _qt4xhb_createReturnQObjectClass ( ptr, "QMAINWINDOW" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
DebuggerState state () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STATE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->state () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QWidget * widget ( DebuggerWidget widget ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_WIDGET )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      QWidget * ptr = obj->widget ( (QScriptEngineDebugger::DebuggerWidget) hb_parni(1) );
      _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

void QScriptEngineDebuggerSlots_connect_signal ( const QString & signal, const QString & slot );

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ONEVALUATIONRESUMED )
{
  QScriptEngineDebuggerSlots_connect_signal( "evaluationResumed()", "evaluationResumed()" );
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ONEVALUATIONSUSPENDED )
{
  QScriptEngineDebuggerSlots_connect_signal( "evaluationSuspended()", "evaluationSuspended()" );
}

#pragma ENDDUMP

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QMAINWINDOW
REQUEST QMENU
REQUEST QTOOLBAR
REQUEST QWIDGET
#endif

CLASS QScriptEngineDebugger INHERIT QObject

   METHOD new
   METHOD delete
   METHOD action
   METHOD attachTo
   METHOD autoShowStandardWindow
   METHOD createStandardMenu
   METHOD createStandardToolBar
   METHOD detach
   METHOD setAutoShowStandardWindow
   METHOD standardWindow
   METHOD state
   METHOD widget

   METHOD onEvaluationResumed
   METHOD onEvaluationSuspended

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngineDebugger
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngineDebugger>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QAction>
#include <QMenu>
#include <QToolBar>
#include <QMainWindow>

/*
QScriptEngineDebugger ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QScriptEngineDebugger * o = new QScriptEngineDebugger ( OPQOBJECT(1,0) );
    _qt4xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DELETE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QAction * action ( DebuggerAction action ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ACTION )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      QAction * ptr = obj->action ( (QScriptEngineDebugger::DebuggerAction) hb_parni(1) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QACTION" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void attachTo ( QScriptEngine * engine )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ATTACHTO )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(1) && ISQSCRIPTENGINE(1) )
    {
      obj->attachTo ( PQSCRIPTENGINE(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool autoShowStandardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_AUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->autoShowStandardWindow () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QMenu * createStandardMenu ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDMENU )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISBETWEEN(0,1) && (ISQWIDGET(1)||ISNIL(1)) )
    {
      QMenu * ptr = obj->createStandardMenu ( OPQWIDGET(1,0) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QMENU" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QToolBar * createStandardToolBar ( QWidget * parent = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_CREATESTANDARDTOOLBAR )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISBETWEEN(0,1) && (ISQWIDGET(1)||ISNIL(1)) )
    {
      QToolBar * ptr = obj->createStandardToolBar ( OPQWIDGET(1,0) );
      _qt4xhb_createReturnQObjectClass ( ptr, "QTOOLBAR" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void detach ()
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_DETACH )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->detach ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAutoShowStandardWindow ( bool autoShow )
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_SETAUTOSHOWSTANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(1) && ISLOG(1) )
    {
      obj->setAutoShowStandardWindow ( PBOOL(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QMainWindow * standardWindow () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STANDARDWINDOW )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QMainWindow * ptr = obj->standardWindow ();
      _qt4xhb_createReturnQObjectClass ( ptr, "QMAINWINDOW" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
DebuggerState state () const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_STATE )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->state () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QWidget * widget ( DebuggerWidget widget ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_WIDGET )
{
  QScriptEngineDebugger * obj = (QScriptEngineDebugger *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      QWidget * ptr = obj->widget ( (QScriptEngineDebugger::DebuggerWidget) hb_parni(1) );
      _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

void QScriptEngineDebuggerSlots_connect_signal ( const QString & signal, const QString & slot );

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ONEVALUATIONRESUMED )
{
  QScriptEngineDebuggerSlots_connect_signal( "evaluationResumed()", "evaluationResumed()" );
}

HB_FUNC_STATIC( QSCRIPTENGINEDEBUGGER_ONEVALUATIONSUSPENDED )
{
  QScriptEngineDebuggerSlots_connect_signal( "evaluationSuspended()", "evaluationSuspended()" );
}

#pragma ENDDUMP