qtcsharp-patches Mailing List for Qt#
Status: Inactive
Brought to you by:
manyoso
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(193) |
Sep
(161) |
Oct
(202) |
Nov
(116) |
Dec
(165) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(154) |
Feb
(43) |
Mar
(14) |
Apr
|
May
(1) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(35) |
Jun
(113) |
Jul
(105) |
Aug
(179) |
Sep
(13) |
Oct
(7) |
Nov
(2) |
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
(4) |
Apr
(3) |
May
(4) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andreas H. <ah...@us...> - 2005-06-12 20:53:00
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4052/src/Writers Modified Files: CWriter.cs KylixWriter.cs Log Message: Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** KylixWriter.cs 14 May 2005 15:31:09 -0000 1.15 --- KylixWriter.cs 12 Jun 2005 20:52:51 -0000 1.16 *************** *** 63,69 **** --- 63,71 ---- basicTypes.Add("int", "Integer"); basicTypes.Add("signed int", "Integer"); + basicTypes.Add("signed", "Integer"); basicTypes.Add("uint", "Cardinal"); basicTypes.Add("unsigned int", "Cardinal"); + basicTypes.Add("unsigned", "Cardinal"); basicTypes.Add("short", "Smallint"); *************** *** 185,188 **** --- 187,192 ---- reservedNames.Add("raise"); reservedNames.Add("Result"); + + reservedNames.Add("qs"); } *************** *** 212,221 **** cw.WriteLine(" {$MODE DELPHI}"); cw.WriteLine(" {$ASMMODE Intel}"); - //cw.WriteLine(" {$DEFINE QSW} // extended WideString support is disabled due to a method-implementation bug (fpc 1.9.5)"); cw.WriteLine("{$ELSE}"); cw.WriteLine(" {$A4,B-,C-,D-,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}"); if(weakPackageUnit) cw.WriteLine(" {$WEAKPACKAGEUNIT ON}"); - //cw.WriteLine(" {$DEFINE QSW}"); cw.WriteLine("{$ENDIF}"); cw.WriteLine(); --- 216,223 ---- *************** *** 304,310 **** cw.WriteLine("LibWrapperIntf = '{0}c.dll';", api.ApiName ); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("LibWrapperIntf = '{0}.so';", api.CLibName ); cw.WriteLine("{$ENDIF MSWINDOWS}"); - cw.WriteLine("//LibWrapper = ''; // see initialization section"); cw.WriteLine("LibWrapper = LibWrapperIntf;"); cw.Indent--; --- 306,311 ---- cw.WriteLine("LibWrapperIntf = '{0}c.dll';", api.ApiName ); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("LibWrapperIntf = '{0}.so.1';", api.CLibName ); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("LibWrapper = LibWrapperIntf;"); cw.Indent--; *************** *** 355,359 **** cw.Indent++; cw.WriteLine("{{$INCLUDE {0}ForwardClasses.inc}}", ApiName); ! BeginFile(ApiName + "ForwardClasses.inc"); try { --- 356,360 ---- cw.Indent++; cw.WriteLine("{{$INCLUDE {0}ForwardClasses.inc}}", ApiName); ! BeginFile(ApiName + "ForwardClasses.inc"); try { *************** *** 517,524 **** foreach(string key in api.Defines.Keys) { string value = (string)api.Defines[key]; string ret; ! if ( value == "" ) ! list.Add(String.Format("{0} = True;", key)); else if(value[0] == '"' || value[0] == '\'') --- 518,535 ---- foreach(string key in api.Defines.Keys) { + bool hasFunction = false; + foreach(Function f in api.GlobalNamespace.Functions) + { + if (String.Compare(key, ResolveClassName(f.Name), /*ignore case=*/true ) == 0) + { + Console.WriteLine(" " + ResolveClassName(f.Name)); + hasFunction = true; + break; + } + } string value = (string)api.Defines[key]; string ret; ! if(value == "") ! list.Add(String.Format("{0}{1} = True;", (hasFunction ? "Const" : ""), key)); else if(value[0] == '"' || value[0] == '\'') *************** *** 538,542 **** { ret = ParseConstString(value); ! list.Add(String.Format("{0} = {1};", ResolveName(key), ret)); } } --- 549,553 ---- { ret = ParseConstString(value); ! list.Add(String.Format("{0}{1} = {2};", (hasFunction ? "Const" : ""), ResolveName(key), ret)); } } *************** *** 545,549 **** { if(ret.IndexOf('#') == -1 && ret != "" && (ret[0] == '$' || Char.IsDigit(ret[0])) ) ! list.Add(String.Format("{0} = {1};", ResolveName(key), ret)); } } --- 556,560 ---- { if(ret.IndexOf('#') == -1 && ret != "" && (ret[0] == '$' || Char.IsDigit(ret[0])) ) ! list.Add(String.Format("{0}{1} = {2};", (hasFunction ? "Const" : ""), ResolveName(key), ret)); } } *************** *** 633,636 **** --- 644,648 ---- } + private Hashtable writtenEnums = new Hashtable(); private void WriteEnums(TypeContainer c) *************** *** 667,670 **** --- 679,686 ---- { string enumName = ResolveClassName(e.GetFullTypeName()); + if(writtenEnums.Contains(enumName)) + continue; + writtenEnums.Add(enumName, ""); + EnumItem[] items = (EnumItem[])e.Items.ToArray(typeof(EnumItem)); *************** *** 1050,1054 **** // paramstr = "; " + paramstr; sb = new StringBuilder(); ! if(m.ReturnType.IsVoidValue) sb.Append("procedure"); else --- 1066,1079 ---- // paramstr = "; " + paramstr; sb = new StringBuilder(); ! bool IsValueRetType = Function.IsValueRetFunction(m); ! if (IsValueRetType) ! { ! if (paramstr != null && paramstr.Length > 0) ! paramstr = String.Format("out{{byValue}} Result: {0}H; {1}", m.ReturnType.GetFullTypeName(), paramstr); ! else ! paramstr = String.Format("out{{byValue}} Result: {0}H", m.ReturnType.GetFullTypeName()); ! } ! ! if(m.ReturnType.IsVoidValue || IsValueRetType) sb.Append("procedure"); else *************** *** 1056,1060 **** //sb.AppendFormat("(Handle: {0}H{1})", rfullname, paramstr); sb.AppendFormat("({0})", paramstr); ! if(!m.ReturnType.IsVoidValue) sb.AppendFormat(": {0}", TypeReferenceToString(m.ReturnType, false, c)); //sb.Append("; cdecl"); --- 1081,1085 ---- //sb.AppendFormat("(Handle: {0}H{1})", rfullname, paramstr); sb.AppendFormat("({0})", paramstr); ! if(!m.ReturnType.IsVoidValue && !IsValueRetType) sb.AppendFormat(": {0}", TypeReferenceToString(m.ReturnType, false, c)); //sb.Append("; cdecl"); *************** *** 1109,1116 **** if(IsQStringFunction(m)) { - // cw.Write("{$IFDEF QSW}"); CreatePascalMethodIntern(m, funcName, c, methodSignatures, ctorClass, prefix, staticNew, true, inInterfaceSection); - // cw.WriteLine("{$ENDIF}"); } } --- 1134,1139 ---- *************** *** 1990,1994 **** string typeName; string defValue = null; ! TypeBase tb = API.GetTypeBase(parameters[i].Type.RefId); string paramName = ResolveClassName(parameters[i].Name); if(paramName == "") --- 2013,2017 ---- string typeName; string defValue = null; ! //TypeBase tb = API.GetTypeBase(parameters[i].Type.RefId); string paramName = ResolveClassName(parameters[i].Name); if(paramName == "") *************** *** 2184,2188 **** { ArrayList methods = c.GetSignals(); ! string baseHook = GetBaseSignalHookClassName(c); string rfullname = ResolveClassName(c.GetFullTypeName()); StringBuilder sb; --- 2207,2211 ---- { ArrayList methods = c.GetSignals(); ! //string baseHook = GetBaseSignalHookClassName(c); string rfullname = ResolveClassName(c.GetFullTypeName()); StringBuilder sb; Index: CWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CWriter.cs 14 May 2005 12:36:38 -0000 1.13 --- CWriter.cs 12 Jun 2005 20:52:51 -0000 1.14 *************** *** 663,666 **** --- 663,668 ---- if ( overrideClasses.Contains( c ) ) { + if ( c.BaseClasses.Count == 0 && destructor.VirtualKind == VirtualKind.None && c.HasVirtualMethods( true ) ) + cw.Write( "virtual " ); // it is a autogenerated non-virtual destructor (see Class.cs) but we need a virtual destructor cw.WriteLine( "~{0}() {{ if(overrideHook.destructor) overrideHook.destructor(overrideHook.destructorInst); }}", GetXClassName( c ), destructor.Name.Substring(1) ); *************** *** 804,809 **** protected void CreateNewFunction( Constructor ctor, Class c ) { - StringBuilder sb = new StringBuilder(); - // CLASS_EX* new_NAME(PARAMETERS) { return new CLASS_EX(PARAMETERS); } --- 806,809 ---- *************** *** 1024,1036 **** // { // if (overrideHook.NAME) [{ ! // RETTYPE returnValue = / return] ! // [*/&]overrideHook.NAME(overrideHookNAMEInst[, PARAMETERS]); ! // [RETTYPE returnValueValue = returnValue; ! // delete &returnValue; ! // return returnValueValue; // }] // [else [return] METHODOWNER::Name(PARAMETERS);] // } string ConstFunction = m.Const ? " const" : ""; --- 1024,1057 ---- // { // if (overrideHook.NAME) [{ ! // [TYPE* tmp;] ! // [return / return ::valueType((] ! // overrideHook.NAME(overrideHookNAMEInst[, PARAMETERS][, _tmp])[, _tmp))]; // }] // [else [return] METHODOWNER::Name(PARAMETERS);] // } + /* + example: + <code> + QVariant getText() { + if (overrideHook.getText) { + QVariant* _tmp; + return ::valueType((overrideHook.getText(overrideHookgetTextInst, _tmp), _tmp)); + } + else + return base_getText(); + } + </code> + + <code> + int getValue() { + if (overrideHook.getValue) + return overrideHook.getValue(overrideHookgetTextInst); + else + return base_getText(); + } + </code> + */ + string ConstFunction = m.Const ? " const" : ""; *************** *** 1044,1050 **** cw.Indent++; - //Function cfunc = Function.GetValueRetFunction( m ); - Function cfunc = m; - if (m.Name == "qt_cast") { --- 1065,1068 ---- *************** *** 1058,1071 **** if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method cw.Write( "if (overrideHook.{0}) ", m.UniqueName ); ! string paramstr = ParametersToString( cfunc.GetParameters(), ParameterStyle.CXXtoCInvocation, null ); if ( paramstr != "" ) paramstr = ", " + paramstr; ! if ( Function.IsValueRetFunction( m ) ) { // Handle value return types. If a copy constructor exists, use it. ! // If none exist, try to use the first parameter type as reference ! // and create the return type object after the overrideHooks ! // invocation. if ( m.VirtualKind != VirtualKind.Pure ) { --- 1076,1089 ---- if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method cw.Write( "if (overrideHook.{0}) ", m.UniqueName ); ! string paramstr = ParametersToString( m.GetParameters(), ParameterStyle.CXXtoCInvocation, null ); if ( paramstr != "" ) paramstr = ", " + paramstr; ! bool IsValueRetType = Function.IsValueRetFunction( m ); ! if ( IsValueRetType ) { // Handle value return types. If a copy constructor exists, use it. ! // If none exist, use the <class T>::valueType(T*) template function ! // to receive a stack based instance of the pointer. if ( m.VirtualKind != VirtualKind.Pure ) { *************** *** 1073,1095 **** cw.Indent++; } ! cw.Write( "{0} returnValue = ", m.ReturnType.Name ); // here "m." because we need the type name } //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Inst{1});", m.UniqueName, paramstr, ! (Function.IsValueRetFunction( m ) || cfunc.ReturnType.IsVoidValue) ? "" : "return ", ! cfunc.ReturnType.IsVoidValue ? "" : TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CtoCXXInvocation ) ); ! if ( Function.IsValueRetFunction( m ) ) { ! cw.WriteLine( "{0} returnValueValue = returnValue;", m.ReturnType.Name ); ! cw.WriteLine( "delete &returnValue;" ); ! cw.WriteLine( "return returnValueValue;" ); ! if ( m.VirtualKind != VirtualKind.Pure ) ! { ! cw.Indent--; ! cw.WriteLine( "}" ); ! } } --- 1091,1112 ---- cw.Indent++; } ! cw.WriteLine( "{0}* _tmp;", m.ReturnType.Name ); ! cw.Write( "return ::valueType((" ); ! paramstr = ", _tmp" + paramstr; } //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.Write( "{2}{3}overrideHook.{0}(overrideHook.{0}Inst{1})", m.UniqueName, paramstr, ! (IsValueRetType || m.ReturnType.IsVoidValue) ? "" : "return ", ! m.ReturnType.IsVoidValue ? "" : TypeReferenceToString( "", m.ReturnType, ParameterStyle.CtoCXXInvocation )); ! if ( IsValueRetType ) ! cw.Write( ", _tmp))" ); ! cw.WriteLine( ";" ); ! if ( IsValueRetType && m.VirtualKind != VirtualKind.Pure ) { ! cw.Indent--; ! cw.WriteLine( "}" ); } *************** *** 1237,1241 **** /*cw.WriteLine( "typedef void(*destructorHookType)({0}* instPtr);", c.Destructor.Name.Substring( 1 ) );*/ ! cw.WriteLine( "typedef void(*destructorHookType)(void* hookData);" ); cw.WriteLine( "destructorHookType destructor;" ); cw.WriteLine( "void* destructorInst;" ); --- 1254,1258 ---- /*cw.WriteLine( "typedef void(*destructorHookType)({0}* instPtr);", c.Destructor.Name.Substring( 1 ) );*/ ! cw.WriteLine( "typedef void(*destructorHookType)(void*);" ); cw.WriteLine( "destructorHookType destructor;" ); cw.WriteLine( "void* destructorInst;" ); *************** *** 1244,1254 **** foreach ( Method m in ownVirtMethods ) { ! /*Function cfunc = Function.GetValueRetFunction( m );*/ ! Function cfunc = m; ! string paramstr = ParametersToString( cfunc.GetParameters(), ParameterStyle.CDeclaration, c ); if ( paramstr != "" ) paramstr = ", " + paramstr; //cw.WriteLine( "typedef {0}(*{1}HookType)({2}{3}* instPtr{4});", ! cw.WriteLine( "typedef {0}(*{1}HookType)(void* hookData{4});", TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CDeclaration, c ), m.UniqueName, --- 1261,1278 ---- foreach ( Method m in ownVirtMethods ) { ! Function cfunc = Function.GetValueRetFunction( m ); ! string paramstr = ParametersToString( m.GetParameters(), ParameterStyle.CDeclaration, c ); ! bool IsValueRetType = Function.IsValueRetFunction( m ); ! if (IsValueRetType) ! { ! if ( paramstr != "" ) ! paramstr = String.Format("{0}*&, {1}", m.ReturnType.Name, paramstr); ! else ! paramstr = String.Format("{0}*&", m.ReturnType.Name); ! } if ( paramstr != "" ) paramstr = ", " + paramstr; //cw.WriteLine( "typedef {0}(*{1}HookType)({2}{3}* instPtr{4});", ! cw.WriteLine( "typedef {0}(*{1}HookType)(void*{4});", TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CDeclaration, c ), m.UniqueName, *************** *** 1391,1394 **** --- 1415,1420 ---- string baseHook = GetBaseSignalHookClassName( c ); + // TODO: Convert class-info to signal-info and call WriteSignalSignalHook(SignalHook s, bool inHeader) + if ( inHeader ) { |
From: Andreas H. <ah...@us...> - 2005-06-12 20:53:00
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/kylix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4052/src/static/kylix Modified Files: QtClassesUtils.pas Log Message: Index: QtClassesUtils.pas =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/kylix/QtClassesUtils.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QtClassesUtils.pas 18 Apr 2005 09:32:21 -0000 1.3 --- QtClassesUtils.pas 12 Jun 2005 20:52:51 -0000 1.4 *************** *** 37,40 **** --- 37,43 ---- Windows, {$ENDIF MSWINDOWS} + {$IFDEF LINUX} + Libc, + {$ENDIF LINUX} QtLibrary, Classes, Contnrs; *************** *** 77,82 **** destructor Destroy; override; ! procedure AddSignal(Member: string; const Method); ! procedure AddSlot(Member: string; const Method: TMethod); end; --- 80,85 ---- destructor Destroy; override; ! procedure AddSignal(Member: string; Method: Pointer); ! procedure AddSlot(Member: string; Method: Pointer); end; *************** *** 130,133 **** --- 133,162 ---- function QtCast(ToClass: TCWrapperObjectBaseClass; Instance: TCWrapperObjectBase): Pointer;{TCWrapperObjectBase} overload; + type + PQUType = ^QUType; + QUType = object + end; + + PQUParameter = ^QUParameter; + QUParameter = record + Name: PChar; + Typ: PQUType; + TypeExtra: Pointer; + InOut: (inoutIn = 1, inoutOut = 2, inoutInOut = 1 or 2); + end; + + PQUMethod = ^QUMethod; + QUMethod = record + Name: PChar; + Count: Integer; + Parameters: PQUParameter; + end; + + QMetaData = record + Name: PChar; + Method: PQUMethod; + Access: (aPrivate, aProtected, aPublic); + end; + implementation *************** *** 161,165 **** FInstance := AInstance; FAutoDeleteInstance := AAutoDeleteInstance; ! IntfCastList.Add(AInstance); end; --- 190,195 ---- FInstance := AInstance; FAutoDeleteInstance := AAutoDeleteInstance; ! if AInstance <> nil then ! IntfCastList.Add(AInstance); end; *************** *** 258,262 **** end else ! Result := nil; end; --- 288,292 ---- end else ! Result := TQtCastObject.Create(nil, False); end; *************** *** 273,277 **** TSignalSlotItem = record Member: string; ! Method: TMethod; end; --- 303,307 ---- TSignalSlotItem = record Member: string; ! Method: Pointer; end; *************** *** 282,290 **** destructor TSignalSlotList.Destroy; begin FList.Free; end; ! procedure TSignalSlotList.AddSignal(Member: string; const Method); var N: PSignalSlotItem; --- 312,324 ---- destructor TSignalSlotList.Destroy; + var + i: Integer; begin + for i := 0 to FList.Count - 1 do + Dispose(PSignalSlotItem(FList[i])); FList.Free; end; ! procedure TSignalSlotList.AddSignal(Member: string; Method: Pointer); var N: PSignalSlotItem; *************** *** 295,303 **** New(N); N.Member := Member; ! N.Method := TMethod(Method); end; end; ! procedure TSignalSlotList.AddSlot(Member: string; const Method: TMethod); var N: PSignalSlotItem; --- 329,338 ---- New(N); N.Member := Member; ! N.Method := Method; ! FList.Add(N); end; end; ! procedure TSignalSlotList.AddSlot(Member: string; Method: Pointer); var N: PSignalSlotItem; *************** *** 308,312 **** New(N); N.Member := Member; ! N.Method := TMethod(Method); FList.Add(N); end; --- 343,347 ---- New(N); N.Member := Member; ! N.Method := Method; FList.Add(N); end; |
From: Andreas H. <ah...@us...> - 2005-06-12 20:52:59
|
Update of /cvsroot/qtcsharp/Bugtussle/src/APILoader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4052/src/APILoader Modified Files: API.cs CGen.bdsproj Log Message: Index: CGen.bdsproj =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/CGen.bdsproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CGen.bdsproj 1 Mar 2005 13:25:22 -0000 1.9 --- CGen.bdsproj 12 Jun 2005 20:52:51 -0000 1.10 *************** *** 88,92 **** </Options> </OptionsSet> ! </Options> <FileList> --- 88,97 ---- </Options> </OptionsSet> ! </Options> ! ! ! ! ! <FileList> *************** *** 125,128 **** --- 130,135 ---- <File FileName="..\Writers\CWriter.cs" ContainerId="CSharpCompiler" ModuleName="CWriter"/> <File FileName="..\Writers\KylixWriter.cs" ContainerId="CSharpCompiler" ModuleName="KylixWriter"/> + <File FileName="$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.Data" AssemblyName="System.Data" Version="1.0.5000.0"/> + <File FileName="AdditionalSignalHooks.cs" ContainerId="CSharpCompiler" ModuleName="AdditionalSignalHooks"/> </FileList> </CSharp.Personality> Index: API.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/API.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** API.cs 1 Oct 2004 11:32:55 -0000 1.44 --- API.cs 12 Jun 2005 20:52:51 -0000 1.45 *************** *** 51,54 **** --- 51,55 ---- public readonly ArrayList Groups = new ArrayList(); // API.ApiGroup[] public readonly Hashtable MissingHeaders = new Hashtable(); + public readonly AdditionalSignalHooks AdditionalSignalHooks = new AdditionalSignalHooks(); // common for all APIs *************** *** 294,297 **** --- 295,308 ---- MissingHeaders.Add( element.Attributes["name"].Value, element.Attributes["add"].Value ); } + else if (element.Name == "c:signals" ) + { + AdditionalSignalHook hook = AdditionalSignalHooks.Add(element.Attributes["name"].Value, element.Attributes["include"].Value ); + foreach ( XmlElement e in element.ChildNodes ) + { + if ( e.Name == "c:signal" ) + hook.AddSignal(e.Attributes["name"].Value, + e.Attributes["returntype"].Value, e.Attributes["parameters"].Value); + } + } } } |
From: Andreas H. <ah...@us...> - 2005-06-12 20:52:59
|
Update of /cvsroot/qtcsharp/Bugtussle/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4052/src Modified Files: configure Log Message: Index: configure =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/configure,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure 18 Aug 2004 14:00:25 -0000 1.3 --- configure 12 Jun 2005 20:52:51 -0000 1.4 *************** *** 1,8 **** #!/bin/sh ! echo "Extracting qt/xml/linux files..." ! tar -xjf qt/xml/xmllinux.tar.bz2 -C qt/xml/linux ! echo "Extracting qt/xml/win32 files..." ! tar -xjf qt/xml/xmlwin32.tar.bz2 -C qt/xml/win32 echo "Generating Makefile..." --- 1,8 ---- #!/bin/sh ! #echo "Extracting qt/xml/linux files..." ! #tar -xjf qt/xml/xmllinux.tar.bz2 -C qt/xml/linux ! #echo "Extracting qt/xml/win32 files..." ! #tar -xjf qt/xml/xmlwin32.tar.bz2 -C qt/xml/win32 echo "Generating Makefile..." |
From: Andreas H. <ah...@us...> - 2005-05-16 21:51:49
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/clib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14961/src/static/clib Modified Files: libqtcglobal.h Log Message: value type return types Index: libqtcglobal.h =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/clib/libqtcglobal.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libqtcglobal.h 17 Aug 2004 08:44:26 -0000 1.2 --- libqtcglobal.h 16 May 2005 17:21:32 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- #include <qglobal.h> #include <qplatformdefs.h> + #include <memory> #if defined(Q_CC_BOR) || defined(Q_CC_MSVC) *************** *** 26,29 **** --- 27,35 ---- #endif + template<class T>T valueType(T* value) + { + std::auto_ptr<T> p(value); + return *p; + } #endif |
From: Andreas H. <ah...@us...> - 2005-05-14 15:31:17
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16298/src/Writers Modified Files: KylixWriter.cs Log Message: Added missing Types for Linux Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** KylixWriter.cs 14 May 2005 12:52:57 -0000 1.14 --- KylixWriter.cs 14 May 2005 15:31:09 -0000 1.15 *************** *** 2278,2282 **** cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("{$IFDEF LINUX}"); ! cw.WriteLine("Libc, Xlib,"); cw.WriteLine("{$ENDIF LINUX}"); cw.WriteLine("{0}Library;", ApiName); --- 2278,2282 ---- cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("{$IFDEF LINUX}"); ! cw.WriteLine("Libc, Xlib, Types,"); cw.WriteLine("{$ENDIF LINUX}"); cw.WriteLine("{0}Library;", ApiName); |
From: Andreas H. <ah...@us...> - 2005-05-14 12:53:05
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21497/src/Writers Modified Files: KylixWriter.cs Log Message: Added missing Types for Linux Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** KylixWriter.cs 18 Apr 2005 09:31:03 -0000 1.13 --- KylixWriter.cs 14 May 2005 12:52:57 -0000 1.14 *************** *** 295,299 **** cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; --- 295,299 ---- cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib, Types;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; |
From: Andreas H. <ah...@us...> - 2005-05-14 12:36:51
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18824/src/Writers Modified Files: CWriter.cs Log Message: Fixed "resizeData" issue Index: CWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CWriter.cs 18 Apr 2005 09:31:03 -0000 1.12 --- CWriter.cs 14 May 2005 12:36:38 -0000 1.13 *************** *** 663,667 **** if ( overrideClasses.Contains( c ) ) { ! cw.WriteLine( "~{0}() {{ if(overrideHook.destructor) overrideHook.destructor(overrideHook.destructorData); }}", GetXClassName( c ), destructor.Name.Substring(1) ); } --- 663,667 ---- if ( overrideClasses.Contains( c ) ) { ! cw.WriteLine( "~{0}() {{ if(overrideHook.destructor) overrideHook.destructor(overrideHook.destructorInst); }}", GetXClassName( c ), destructor.Name.Substring(1) ); } *************** *** 1025,1029 **** // if (overrideHook.NAME) [{ // RETTYPE returnValue = / return] ! // [*/&]overrideHook.NAME(overrideHookNAMEData[, PARAMETERS]); // [RETTYPE returnValueValue = returnValue; // delete &returnValue; --- 1025,1029 ---- // if (overrideHook.NAME) [{ // RETTYPE returnValue = / return] ! // [*/&]overrideHook.NAME(overrideHookNAMEInst[, PARAMETERS]); // [RETTYPE returnValueValue = returnValue; // delete &returnValue; *************** *** 1077,1081 **** //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});", m.UniqueName, paramstr, --- 1077,1081 ---- //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Inst{1});", m.UniqueName, paramstr, *************** *** 1239,1243 **** cw.WriteLine( "typedef void(*destructorHookType)(void* hookData);" ); cw.WriteLine( "destructorHookType destructor;" ); ! cw.WriteLine( "void* destructorData;" ); } --- 1239,1243 ---- cw.WriteLine( "typedef void(*destructorHookType)(void* hookData);" ); cw.WriteLine( "destructorHookType destructor;" ); ! cw.WriteLine( "void* destructorInst;" ); } *************** *** 1260,1264 **** { cw.WriteLine( "{0}HookType {0};", m.UniqueName ); ! cw.WriteLine( "void* {0}Data;", m.UniqueName ); } --- 1260,1264 ---- { cw.WriteLine( "{0}HookType {0};", m.UniqueName ); ! cw.WriteLine( "void* {0}Inst;", m.UniqueName ); } |
From: Andreas H. <ah...@us...> - 2005-04-18 09:32:29
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/kylix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/static/kylix Modified Files: QtClassesUtils.pas Log Message: Update Index: QtClassesUtils.pas =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/kylix/QtClassesUtils.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QtClassesUtils.pas 9 Nov 2004 20:05:36 -0000 1.2 --- QtClassesUtils.pas 18 Apr 2005 09:32:21 -0000 1.3 *************** *** 93,97 **** slots are not usable through connect/disconnect. } public ! function className: string; function isA(const classname: string): Boolean; function inherits(const classname: string): Boolean; --- 93,98 ---- slots are not usable through connect/disconnect. } public ! function metaObject: QMetaObjectH; ! function className: string; function isA(const classname: string): Boolean; function inherits(const classname: string): Boolean; *************** *** 288,292 **** var N: PSignalSlotItem; - i: Integer; begin Member := '2' + MemberToCMember(Member); --- 289,292 ---- *************** *** 302,306 **** var N: PSignalSlotItem; - i: Integer; begin Member := '1' + MemberToCMember(Member); --- 302,305 ---- *************** *** 537,540 **** --- 536,544 ---- end; + function TQObjectBase.metaObject: QMetaObjectH; + begin + Result := Handle.metaObject; + end; + function TQObjectBase.connect(sender: TQObjectBase; const signal, member: string): Boolean; *************** *** 555,558 **** --- 559,563 ---- // MemberToCMember(signal) // MemberToCMember(member) + Result := False; end; *************** *** 569,575 **** // MemberToCMember(signal) // MemberToCMember(member) end; - initialization ObjectLookup := TBucketList.Create(bl256); --- 574,580 ---- // MemberToCMember(signal) // MemberToCMember(member) + Result := False; end; initialization ObjectLookup := TBucketList.Create(bl256); |
From: Andreas H. <ah...@us...> - 2005-04-18 09:32:29
|
Update of /cvsroot/qtcsharp/Bugtussle/src/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/scripts Modified Files: Doxyfile-qtwin Log Message: Update Index: Doxyfile-qtwin =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/scripts/Doxyfile-qtwin,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Doxyfile-qtwin 11 Oct 2004 19:03:03 -0000 1.2 --- Doxyfile-qtwin 18 Apr 2005 09:32:20 -0000 1.3 *************** *** 1,3 **** ! # Doxyfile 1.3.8 #--------------------------------------------------------------------------- --- 1,3 ---- ! # Doxyfile 1.3.6 #--------------------------------------------------------------------------- *************** *** 7,11 **** PROJECT_NUMBER = 3.3.3 OUTPUT_DIRECTORY = z:/Qts/Bugtussle/src/qt/xml/win32/ - CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO --- 7,10 ---- *************** *** 17,21 **** FULL_PATH_NAMES = NO STRIP_FROM_PATH = - STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO --- 16,19 ---- *************** *** 36,40 **** EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES - EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO --- 34,37 ---- *************** *** 81,85 **** IMAGE_PATH = INPUT_FILTER = - FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- --- 78,81 ---- |
From: Andreas H. <ah...@us...> - 2005-04-18 09:31:15
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17120/src/Writers Modified Files: CWriter.cs KylixWriter.cs Log Message: Update KylixWriter: Int64 -> Integer Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** KylixWriter.cs 13 Oct 2004 18:47:27 -0000 1.12 --- KylixWriter.cs 18 Apr 2005 09:31:03 -0000 1.13 *************** *** 214,218 **** //cw.WriteLine(" {$DEFINE QSW} // extended WideString support is disabled due to a method-implementation bug (fpc 1.9.5)"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine(" {$A4,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}"); if(weakPackageUnit) cw.WriteLine(" {$WEAKPACKAGEUNIT ON}"); --- 214,218 ---- //cw.WriteLine(" {$DEFINE QSW} // extended WideString support is disabled due to a method-implementation bug (fpc 1.9.5)"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine(" {$A4,B-,C-,D-,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}"); if(weakPackageUnit) cw.WriteLine(" {$WEAKPACKAGEUNIT ON}"); *************** *** 295,299 **** cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib, Types;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; --- 295,299 ---- cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; *************** *** 674,678 **** cw.WriteLine("{0} = (", enumName); else if(e.ExceedsInt32) ! cw.WriteLine("{0} = type Int64;", enumName); else if(e.HasNegatives) cw.WriteLine("{0} = type Integer;", enumName); --- 674,678 ---- cw.WriteLine("{0} = (", enumName); else if(e.ExceedsInt32) ! cw.WriteLine("{0} = type Integer;", enumName); else if(e.HasNegatives) cw.WriteLine("{0} = type Integer;", enumName); *************** *** 1206,1210 **** // add function name sb.Append(funcName); ! if (m.OverloadIndex > 0 && m.Const) sb.Append('C'); // const flag, but only when this function is overloaded --- 1206,1210 ---- // add function name sb.Append(funcName); ! if (m.OverloadIndex > 0 && m.Const && !m.HasUniqueParameters()) sb.Append('C'); // const flag, but only when this function is overloaded *************** *** 1343,1347 **** cw.Write("{0}{1}({2})", funcName, ! (m.OverloadIndex > 0 && m.Const ? "C" : ""), ParametersToString(cfunc.GetParameters(), ParameterStyle.DelphiToDelphiInvocation, isStringMethod, c, true)); if(hasStringRetValue && cfunc.ReturnType.Name == "QString") --- 1343,1347 ---- cw.Write("{0}{1}({2})", funcName, ! (m.OverloadIndex > 0 && m.Const && !m.HasUniqueParameters() ? "C" : ""), ParametersToString(cfunc.GetParameters(), ParameterStyle.DelphiToDelphiInvocation, isStringMethod, c, true)); if(hasStringRetValue && cfunc.ReturnType.Name == "QString") *************** *** 1368,1372 **** --- 1368,1377 ---- // ---- getter ---- Method method = new Method(String.Format("get_{0}", v.ExportName), null, v.Type); + if(Function.IsValueRetFunction(method)) + method = new Method(String.Format("get_{0}", v.ExportName), null, + new TypeReference(v.Type.GetFullTypeName(), PassByMode.Pointer)); method.ExportName = method.Name; + + CreatePascalMethod(method, null, null, null, false, "", inInterfaceSection); *************** *** 1381,1385 **** } ! private void CreateClassStaticVariableGetterSetter(Class c, bool inInterfaceSection) { --- 1386,1390 ---- } ! private void CreateClassStaticVariableGetterSetter(Class c, bool inInterfaceSection) { *************** *** 2091,2094 **** --- 2096,2102 ---- cw.WriteLine("type"); cw.Indent++; + cw.WriteLine("TSignalHookType_eventFilter = function(Sender: QObjectH; Event: QEventH): Boolean of object; cdecl;"); + cw.WriteLine("TSignalHookType_objectDestroyed = procedure(Obj: QObjectH) of object; cdecl;"); + cw.WriteLine(); cw.WriteLine("TSignalHookBase = class(TObject)"); cw.WriteLine("public"); *************** *** 2097,2100 **** --- 2105,2110 ---- cw.WriteLine("procedure Delete; cdecl;"); cw.WriteLine("procedure Free;"); + cw.WriteLine("procedure eventFilter(hook: TSignalHookType_eventFilter);"); + cw.WriteLine("procedure objectDestroyed(hook: TSignalHookType_objectDestroyed);"); cw.Indent--; cw.WriteLine("end;"); *************** *** 2136,2139 **** --- 2146,2164 ---- cw.WriteLine("end;"); cw.WriteLine(); + cw.WriteLine("procedure SignalHookBase_setEventFilter(Handle: TSignalHookBase; Data, Hook: Pointer); cdecl; external LibWrapper name Prefix+'SignalHookBase_setEventFilter';"); + cw.WriteLine("procedure TSignalHookBase.eventFilter(hook: TSignalHookType_eventFilter);"); + cw.WriteLine("begin"); + cw.Indent++; + cw.WriteLine("SignalHookBase_setEventFilter(Self, TMethod(hook).Data, TMethod(hook).Code);"); + cw.Indent--; + cw.WriteLine("end;"); + cw.WriteLine("procedure SignalHookBase_setObjectDestroyed(Handle: TSignalHookBase; Data, Hook: Pointer); cdecl; external LibWrapper name Prefix+'SignalHookBase_setObjectDestroyed';"); + cw.WriteLine("procedure TSignalHookBase.objectDestroyed(hook: TSignalHookType_objectDestroyed);"); + cw.WriteLine("begin"); + cw.Indent++; + cw.WriteLine("SignalHookBase_setObjectDestroyed(Self, TMethod(hook).Data, TMethod(hook).Code);"); + cw.Indent--; + cw.WriteLine("end;"); + cw.WriteLine(); cw.WriteLine("end."); } *************** *** 2251,2257 **** cw.WriteLine("{$IFDEF MSWINDOWS}"); cw.WriteLine("Windows,"); - cw.WriteLine("{$ELSE}"); - cw.WriteLine("Libc, Xlib, Types,"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("{0}Library;", ApiName); cw.Indent--; --- 2276,2283 ---- cw.WriteLine("{$IFDEF MSWINDOWS}"); cw.WriteLine("Windows,"); cw.WriteLine("{$ENDIF MSWINDOWS}"); + cw.WriteLine("{$IFDEF LINUX}"); + cw.WriteLine("Libc, Xlib,"); + cw.WriteLine("{$ENDIF LINUX}"); cw.WriteLine("{0}Library;", ApiName); cw.Indent--; Index: CWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CWriter.cs 13 Oct 2004 16:28:51 -0000 1.11 --- CWriter.cs 18 Apr 2005 09:31:03 -0000 1.12 *************** *** 18,27 **** } - public enum VariableGetter - { - Yes, - No - } - /*! --- 18,21 ---- *************** *** 781,785 **** cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation, VariableGetter.No ); cw.Indent--; --- 775,779 ---- cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation ); cw.Indent--; *************** *** 789,793 **** ! private void WriteFunctionReturn( Method method, StringBuilder invocation, VariableGetter isVarGetter ) { if ( Function.IsValueRetFunction( method ) ) --- 783,787 ---- ! private void WriteFunctionReturn( Method method, StringBuilder invocation ) { if ( Function.IsValueRetFunction( method ) ) *************** *** 797,807 **** cw.WriteLine( "returnValue = {0};", invocation ); cw.Indent--; ! if ( isVarGetter == VariableGetter.No ) ! { ! cw.WriteLine( "else" ); ! cw.Indent++; ! cw.WriteLine( "{0};", invocation ); // ignore return value ! cw.Indent--; ! } } else --- 791,798 ---- cw.WriteLine( "returnValue = {0};", invocation ); cw.Indent--; ! cw.WriteLine( "else" ); ! cw.Indent++; ! cw.WriteLine( "{0};", invocation ); // ignore return value ! cw.Indent--; } else *************** *** 1056,1059 **** --- 1047,1059 ---- Function cfunc = m; + if (m.Name == "qt_cast") + { + /* We use qt_cast() for a get_overrideHook method because it is virtual + and has the correct return type (and the name fits */ + cw.WriteLine( "if ({0} && {0}[0] == '\\255')", m.Parameters[0].Name ); + cw.Indent++; + cw.WriteLine( "return &overrideHook;" ); + cw.Indent--; + } if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method cw.Write( "if (overrideHook.{0}) ", m.UniqueName ); *************** *** 1077,1081 **** //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}((void*)overrideHook.{0}Data{1});", // (void*) because of a gcc bug m.UniqueName, paramstr, --- 1077,1081 ---- //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});", m.UniqueName, paramstr, *************** *** 1122,1126 **** cw.WriteLine( "{" ); cw.Indent++; ! cw.WriteLine( "return &(instPtr->overrideHook);" ); cw.Indent--; cw.WriteLine( "}" ); --- 1122,1133 ---- cw.WriteLine( "{" ); cw.Indent++; ! if ( c.Name == "QObject" || c.Inherits( "QObject" ) ) ! { ! /* we need a virtual method in order to return the overrideHook and qt_cast seems to be perfect by ! name and return type. */ ! cw.WriteLine( "return ({0}OverrideHook*)(instPtr->qt_cast(\"\\255\"));", c.Name ); ! } ! else ! cw.WriteLine( "return &(instPtr->overrideHook);" ); cw.Indent--; cw.WriteLine( "}" ); *************** *** 1674,1678 **** cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation, VariableGetter.No ); cw.Indent--; cw.WriteLine( "}" ); --- 1681,1685 ---- cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation ); cw.Indent--; cw.WriteLine( "}" ); *************** *** 1695,1702 **** // ---- getter ---- Method method = new Method( String.Format( "get_{0}", v.ExportName ), null, v.Type ); ! Function cfunc = Function.GetValueRetFunction( method ); sbHeader = new StringBuilder(); sbHeader.Append( TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CDeclaration, ns ) ); sbHeader.Append( "QTC_EXPORT " ); sbHeader.Append( method.Name ); --- 1702,1713 ---- // ---- getter ---- Method method = new Method( String.Format( "get_{0}", v.ExportName ), null, v.Type ); ! Function cfunc = method; //Function.GetValueRetFunction( method ); ! bool isValueRet = Function.IsValueRetFunction( method ); sbHeader = new StringBuilder(); sbHeader.Append( TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CDeclaration, ns ) ); + bool isRefValueRet = sbHeader.Length > 2 && sbHeader[sbHeader.Length - 2] == '&'; + if ( isValueRet && !isRefValueRet ) + sbHeader.Append("* "); sbHeader.Append( "QTC_EXPORT " ); sbHeader.Append( method.Name ); *************** *** 1720,1724 **** invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() ); invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) ); ! WriteFunctionReturn( method, invocation, VariableGetter.Yes ); cw.Indent--; cw.WriteLine( "}" ); --- 1731,1744 ---- invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() ); invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) ); ! ! // function return "type" ! cw.Write( "return " ); ! if ( isValueRet && !isRefValueRet ) ! cw.Write( '&' ); ! cw.WriteLine( "{0};", invocation ); ! //WriteFunctionReturn( method, invocation ); ! // ---- ! ! cw.Indent--; cw.WriteLine( "}" ); *************** *** 1790,1794 **** string proDir = Path.GetDirectoryName(outputDirectory); ! headerFiles.Add( "../static/clib/libqtcglobal.h" ); headerFiles.Add( "../static/clib/signalhookbase.h" ); --- 1810,1814 ---- string proDir = Path.GetDirectoryName(outputDirectory); ! headerFiles.Add( String.Format( "../static/clib/lib{0}cglobal.h", api.ApiName.ToLower() ) ); headerFiles.Add( "../static/clib/signalhookbase.h" ); |
From: Andreas H. <ah...@us...> - 2005-03-03 22:07:17
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/clib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30899/src/static/clib Modified Files: signalhookbase.cpp signalhookbase.h Log Message: Fixed OverrideHook bug (inheritance) Index: signalhookbase.h =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/clib/signalhookbase.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** signalhookbase.h 13 Oct 2004 15:10:35 -0000 1.3 --- signalhookbase.h 3 Mar 2005 22:06:48 -0000 1.4 *************** *** 8,11 **** --- 8,12 ---- typedef void(*objectDestroyedHook)(void* hook, QObject* obj); + typedef bool(*eventFilterHook)(void* hook, QObject* sender, QEvent* event); class SignalHookBase: public QObject *************** *** 14,19 **** public: SignalHookBase(QObject* o); ! virtual ~SignalHookBase() {} ! public: inline void setObjectDestroyed(void* hookData, objectDestroyedHook hook) --- 15,24 ---- public: SignalHookBase(QObject* o); ! virtual ~SignalHookBase() ! { ! if(objectDestroyedCallback) ! objectDestroyedCallback(objectDestroyedCallbackData ? objectDestroyedCallbackData : this, owner); ! } ! public: inline void setObjectDestroyed(void* hookData, objectDestroyedHook hook) *************** *** 23,26 **** --- 28,41 ---- } + inline void setEventFilter(void* hookData, eventFilterHook hook) + { + eventFilterCallbackData = hookData; + eventFilterCallback = hook; + if (eventFilterCallback) + owner->installEventFilter(this); + else + owner->removeEventFilter(this); + } + inline const QObject* getOwner() const { *************** *** 28,31 **** --- 43,48 ---- } + bool eventFilter(QObject* sender, QEvent* event); + /* gcc does not support InstallSignalHook((void**){2}Callback, hook, ...) so we must typecast to (void*) and do the cast to (void**) in *************** *** 33,42 **** void InstallSignalHook(void* hookvarX, void* newhook, const char* signal, const char* slot); - public slots: - void ObjectDestroyedSlot(QObject* obj); - private: objectDestroyedHook objectDestroyedCallback; void* objectDestroyedCallbackData; protected: QObject* owner; --- 50,62 ---- void InstallSignalHook(void* hookvarX, void* newhook, const char* signal, const char* slot); private: objectDestroyedHook objectDestroyedCallback; void* objectDestroyedCallbackData; + eventFilterHook eventFilterCallback; + void* eventFilterCallbackData; + + public slots: + void objectDestroyedSlot(QObject* obj); + protected: QObject* owner; Index: signalhookbase.cpp =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/clib/signalhookbase.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** signalhookbase.cpp 13 Oct 2004 15:10:35 -0000 1.4 --- signalhookbase.cpp 3 Mar 2005 22:06:47 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- #include "signalhookbase.h" + #include "qmessagebox.h" extern "C" { *************** *** 16,19 **** --- 17,24 ---- } + void QTC_EXPORT SignalHookBase_setEventFilter(SignalHookBase* handle, void* hookData, eventFilterHook hook) { + handle->setEventFilter(hookData, hook); + } + const QTC_EXPORT QObject* SignalHookBase_getOwner(SignalHookBase* handle) { return handle->getOwner(); *************** *** 24,29 **** SignalHookBase::SignalHookBase(QObject* o): QObject(o, 0) { owner = o; ! QObject::connect(owner, SIGNAL( destroyed(QObject*) ), this, SLOT( ObjectDestroyedSlot(QObject*) )); } --- 29,40 ---- SignalHookBase::SignalHookBase(QObject* o): QObject(o, 0) { + /* The signal hook is a child of the owner. So it will be destroyed when the + owner gets destroyed. */ owner = o; ! objectDestroyedCallback = 0; ! objectDestroyedCallbackData = 0; ! eventFilterCallback = 0; ! eventFilterCallbackData = 0; ! QObject::connect(owner, SIGNAL( destroyed(QObject*) ), this, SLOT( objectDestroyedSlot(QObject*) )); } *************** *** 41,49 **** } ! void SignalHookBase::ObjectDestroyedSlot(QObject* obj) { - if(objectDestroyedCallback) - objectDestroyedCallback(objectDestroyedCallbackData ? objectDestroyedCallbackData : this, obj); delete this; } --- 52,65 ---- } ! void SignalHookBase::objectDestroyedSlot(QObject* obj) { delete this; } + bool SignalHookBase::eventFilter(QObject* sender, QEvent* event) + { + if(eventFilterCallback) + return eventFilterCallback(eventFilterCallbackData ? eventFilterCallbackData : this, sender, event); + return false; + } + |
From: Andreas H. <ah...@us...> - 2005-03-01 13:27:27
|
Update of /cvsroot/qtcsharp/Disco/bindings/qt/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18171/src/qt/xml Added Files: ignorelist_win32_333 Log Message: Qt/Win32 3.3.3 --- NEW FILE: ignorelist_win32_333 --- QtTableView QtMultiLineEdit QWindowsXPStyle qwindowdefs_win.h qt_windows.h qt_x11.h qt_x11_p.h qgl_x11_p.h QPaintDeviceX11Data qgif.h qpngio.h QPNGImagePacker QPNGImageWriter QSjisCodec QJpUnicodeConv QGbkCodec QGb18030Codec QGb2312Codec QEucJpCodec QDnsSocket QJisCodec qmotif.h qmotifdialog.h qmotifplusstyle.h qmotifstyle.h qmotifwidget.h QMotif QMotifDialog QMotifPlusStyle QMotifStyle QMotifWidget QCDEStyle QSGIStyle qsql_mysql.h qsql_odbc.h qsql_psql.h qsql_sqlite.h qsql_ibase.h QMYSQLResult QMYSQLDriver QODBCResult QODBCDriver QPSQLResult QPSQLDriver QtSqlCachedResult QSQLiteDriver QSQLiteResult QIBaseDriver QIBaseResult qsqlcachedresult.h QXtWidget qxtwidget.h q1xcompatibility.h qtl.h qstring.h QNPInstance QNPStream QNPWidget QNPlugin QAuBucket QAuServer QSqlRecordShared QCompactStyle QWidgetFactory QAssistantClient qjpegio.h qmngio.h |
From: Andreas H. <ah...@us...> - 2005-03-01 13:26:13
|
Update of /cvsroot/qtcsharp/Disco/bindings/qt/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17905/src/qt/xml Modified Files: ignorelist_win32 Log Message: Qt/Win32 3.3.3 Index: ignorelist_win32 =================================================================== RCS file: /cvsroot/qtcsharp/Disco/bindings/qt/xml/ignorelist_win32,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ignorelist_win32 17 Aug 2004 12:16:36 -0000 1.1 --- ignorelist_win32 1 Mar 2005 13:26:05 -0000 1.2 *************** *** 5,8 **** --- 5,11 ---- qwindowdefs_win.h qt_x11.h + qt_x11_p.h + qgl_x11_p.h + QPaintDeviceX11Data qgif.h qpngio.h |
From: Andreas H. <ah...@us...> - 2005-03-01 13:25:32
|
Update of /cvsroot/qtcsharp/Bugtussle/src/APILoader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17704/src/APILoader Modified Files: CGen.bdsproj Class.cs Function.cs Parameter.cs TypeReference.cs Log Message: Improved Kylix export Index: Class.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Class.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Class.cs 4 Nov 2004 18:35:46 -0000 1.51 --- Class.cs 1 Mar 2005 13:25:22 -0000 1.52 *************** *** 172,176 **** { string funcName = memberdef["name"].InnerText; - if ( sectionKind.StartsWith( "private-" ) ) { --- 172,175 ---- Index: CGen.bdsproj =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/CGen.bdsproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CGen.bdsproj 4 Nov 2004 18:35:46 -0000 1.8 --- CGen.bdsproj 1 Mar 2005 13:25:22 -0000 1.9 *************** *** 69,77 **** <Options Name="BuildInOutput" Type="Boolean">False</Options> <Options Name="OutputDirectory" Type="String">bin\Debug</Options> ! <Options Name="RunParams" Type="String">wx -t win32</Options> <Options Name="HostApplication" Type="String"></Options> <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">Z:\wxC</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> --- 69,77 ---- <Options Name="BuildInOutput" Type="Boolean">False</Options> <Options Name="OutputDirectory" Type="String">bin\Debug</Options> ! <Options Name="RunParams" Type="String">qt -t win32_333</Options> <Options Name="HostApplication" Type="String"></Options> <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">z:\Qts\Bugtussle\src</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> *************** *** 88,95 **** </Options> </OptionsSet> ! </Options> ! <FileList> ! <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> ! <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> <File FileName="AssemblyInfo.cs" ContainerId="CSharpCompiler" ModuleName="AssemblyInfo"/> <File FileName="AccessKind.cs" ContainerId="CSharpCompiler" ModuleName="AccessKind"/> --- 88,96 ---- </Options> </OptionsSet> ! </Options> ! ! <FileList> ! <File FileName="$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> ! <File FileName="$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> <File FileName="AssemblyInfo.cs" ContainerId="CSharpCompiler" ModuleName="AssemblyInfo"/> <File FileName="AccessKind.cs" ContainerId="CSharpCompiler" ModuleName="AccessKind"/> Index: Function.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Function.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Function.cs 19 Sep 2004 22:32:49 -0000 1.18 --- Function.cs 1 Mar 2005 13:25:22 -0000 1.19 *************** *** 133,136 **** --- 133,137 ---- list.Add( new Parameter( new TypeReference( f.ReturnType, false ), "returnValue" ) ); list.AddRange( f.parameters ); + /*Function m = new Method( (Method)f, f.Container as Class ); *************** *** 173,184 **** - /*! Gets a list of the parameters to the function. If there are no ! parameters, including the case where the Function is a Destructor, ! an empty array is returned. */ ! public Parameter[] GetParameters() ! { ! return (Parameter[]) parameters.ToArray( typeof(Parameter) ); ! } /*! Gets a list of parameters, caching a static array from the dynamic --- 174,184 ---- /*! Gets a list of the parameters to the function. If there are no ! parameters, including the case where the Function is a Destructor, ! an empty array is returned. */ ! public Parameter[] GetParameters() ! { ! return (Parameter[]) parameters.ToArray( typeof(Parameter) ); ! } /*! Gets a list of parameters, caching a static array from the dynamic *************** *** 206,210 **** } ! /* GetUniqueName returns the method's name with the Id, if Id != 0 */ public string UniqueName { --- 206,210 ---- } ! /*! GetUniqueName returns the method's name with the Id, if Id != 0 */ public string UniqueName { *************** *** 217,221 **** - // ANN: "==" must not compare the "Id" public static bool operator == (Function m1, Function m2) --- 217,220 ---- *************** *** 258,260 **** --- 257,310 ---- } + /*! OverloadEqualParameter compares Parameter p1 and p2 for overload + equality. (used by OverloadEqual) */ + private bool OverloadEqualParameter( Parameter p1, Parameter p2 ) + { + if ( p1.Type == p2.Type ) + return true; + if ( p1.Type.TypeBase == p2.Type.TypeBase && p1.Type.Mode == p2.Type.Mode ) + return true; + return false; + } + + /*! OverloadEqual compares the two parameter lists for equality when + overloading. (Used by HasUniqueParameters) */ + private bool OverloadEqual( Function f ) + { + if ( parameters.Count == f.parameters.Count ) + { + int count = parameters.Count; + for ( int i = 0; i < count; i++ ) + if ( OverloadEqualParameter((Parameter)parameters[i], (Parameter)f.parameters[i]) ) + return true; + } + return false; + } + + /*! HasUniqueParameters returns true if there is no overloaded function in + the same namespace/class that has overload-equal parameters */ + public bool HasUniqueParameters() + { + if (Overloaded) + { + if ( Container is Namespace ) + { + Namespace ns = (Namespace)Container; + foreach ( Function f in ns.Functions ) + if (f != this && f.Name == Name ) + if ( this.OverloadEqual( f ) ) + return false; + } + else if ( Container is Class ) + { + Class c = (Class)Container; + foreach ( Function f in c.Methods ) + if (f != this && f.Name == Name ) + if ( this.OverloadEqual( f ) ) + return false; + } + } + return true; + } + } \ No newline at end of file Index: TypeReference.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/TypeReference.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** TypeReference.cs 18 Aug 2004 12:11:57 -0000 1.29 --- TypeReference.cs 1 Mar 2005 13:25:22 -0000 1.30 *************** *** 98,101 **** --- 98,107 ---- string last = words[words.Count - 1]; + if ( last == "__stdcall" ) + { + last = words[words.Count - 2]; + lastIndex--; + } + switch ( last ) { Index: Parameter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Parameter.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Parameter.cs 1 Oct 2004 11:32:56 -0000 1.13 --- Parameter.cs 1 Mar 2005 13:25:22 -0000 1.14 *************** *** 80,90 **** } ! ! /*! Gets or sets the name of the parameter. Normal users should not ! need to set the name, but a setter method is provided because ! Method and Constructor classes may need to back-patch the parameter ! name when the C/C++ code does not provide one. ! */ ! public string Name { get { return name; } --- 80,89 ---- } ! /*! Gets or sets the name of the parameter. Normal users should not ! need to set the name, but a setter method is provided because ! Method and Constructor classes may need to back-patch the parameter ! name when the C/C++ code does not provide one. ! */ ! public string Name { get { return name; } |
From: Marcus U. <ma...@us...> - 2004-12-12 07:22:30
|
Update of /cvsroot/qtcsharp/qtsharp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv940 Modified Files: Tag: QTSHARP-0_7_1_BRANCH TODO Log Message: Include message stating that the file is antiquated. Index: TODO =================================================================== RCS file: /cvsroot/qtcsharp/qtsharp/TODO,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** TODO 29 Sep 2002 05:15:40 -0000 1.6 --- TODO 12 Dec 2004 07:22:21 -0000 1.6.6.1 *************** *** 1,2 **** --- 1,4 ---- + Revise TODO. It's totally antiquated. + ** General |
From: Andreas H. <ah...@us...> - 2004-11-09 20:05:47
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/kylix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21422/src/static/kylix Modified Files: QtClassesUtils.pas Log Message: Update Index: QtClassesUtils.pas =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/kylix/QtClassesUtils.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QtClassesUtils.pas 15 Aug 2004 20:46:00 -0000 1.1 --- QtClassesUtils.pas 9 Nov 2004 20:05:36 -0000 1.2 *************** *** 1,2 **** --- 1,32 ---- + { + Type Casts: + It is not possible to typecast a Qt Delphi object to another Qt Delphi object + when the Qt object handle is not created by Delphi (ObjectLookup) because in + this case the returned value is a Qt Delphi object of the return type and a + direct typecast with a following call to a virual/dynamic function will raise + an AV due to a wrong VMT. So we must use the QtCast() functions for this. + + If a Qt created object is returned the Delphi object that is created has the + return-type type. If this is not the same as the actual object you must cast + to the actual type with the QtCast() function. It simply creates a new Delphi + instance with the same handle (that is not registered to the ObjectLookup- + table) and adds the instance to a CastConnection list, which is shared by the + "old" and "new" Delphi object. At this time two Delphi instances exist in + memory and both refere to the same Qt object. This is repeated for each type + cast to another class type. If the type cast is to a type that has already + been done or is a base class of another type cast's type, the most specialized + type is returned which makes type casts faster. + + When you destroy one of these cast-connected objects all other connected + objects will be destroyed, too. This means that if you keep at least one + reference to one of the casted objects, you can discard the other ones. + + + Signals/Slots: + Delphi signals and slots must be registered in the QObjectBase.GetSignalSlot() + method. + + } + unit QtClassesUtils; *************** *** 4,260 **** uses ! QtLibrary; type ! TQtObjectBase = class(TObject) private protected FHandle: Pointer; ! procedure DeleteHandle; virtual; procedure OverrideMethods; virtual; public - constructor CreateHandle(AHandle: TImportLibraryBase); destructor Destroy; override; end; ! PHashItemCollision = ^THashItemCollision; ! THashItemCollision = record ! Key, Value: TObject; ! Next: PHashItemCollision; ! end; ! ! THashItem = record ! Empty: Boolean; ! Key, Value: TObject; ! Collision: PHashItemCollision; end; ! // THashtable is a small hash table that is not really good, but better than ! // a search in a TList. ! THashtable = class(TObject) private ! FDelta: Integer; ! FItems: array of THashItem; ! function GetItems(AKey: TObject): TObject; protected ! function Hashing(AKey: TObject): Cardinal; public ! constructor Create(ADelta: Integer = 512); ! destructor Destroy; override; ! procedure Add(AKey, AValue: TObject); ! function Remove(AKey: TObject): Boolean; ! property Items[AKey: TObject]: TObject read GetItems; default; end; ! type ! TQtObjectBaseClass = class of TQtObjectBase; ! function QtCast(Handle: TImportLibraryBase; ToClass: TQtObjectBaseClass): Pointer;{TQtObjectBase} overload; ! function QtCast(Obj: TQtObjectBase; ToClass: TQtObjectBaseClass): Pointer;{TQtObjectBase} overload; implementation var ! ObjectLookup: THashtable; type ! IQtCastHandle = interface ! function get: Pointer; end; ! function QtCast(Handle: TImportLibraryBase; ToClass: TQtObjectBaseClass): Pointer;{TQtObjectBase} begin ! Result := TQtObjectBase(ObjectLookup[Handle]); ! if Result = nil then ! Result := ToClass.CreateHandle(Handle); end; ! function QtCast(Obj: TQtObjectBase; ToClass: TQtObjectBaseClass): Pointer;{TQtObjectBase} begin ! Result := TQtObjectBase(ObjectLookup[Obj.FHandle]); ! if Result = nil then ! Result := ToClass.CreateHandle(Obj.FHandle); end; ! function QtCastIntf(Obj: TImportLibraryBase; ToClass: TQtObjectBaseClass): IQtCastHandle; begin ! //Result := TQtCastHandle.Create(QtCast(Obj, ToClass)); ! Result := nil; end; ! { TQtObjectBase } ! constructor TQtObjectBase.CreateHandle(AHandle: TImportLibraryBase); begin ! inherited Create; ! FHandle := AHandle; ! ObjectLookup.Add(AHandle, Self); ! OverrideMethods; end; ! destructor TQtObjectBase.Destroy; ! var ! H: Pointer; begin ! H := FHandle; ! try ! DeleteHandle; ! finally ! ObjectLookup.Remove(TObject(FHandle)); ! end; ! inherited Destroy; end; ! procedure TQtObjectBase.DeleteHandle; begin ! // do nothing end; ! procedure TQtObjectBase.OverrideMethods; begin end; ! { THashtable } ! constructor THashtable.Create(ADelta: Integer); begin ! inherited Create; ! FDelta := ADelta; ! if FDelta < 256 then ! FDelta := 256; ! SetLength(FItems, FDelta); end; ! destructor THashtable.Destroy; var i: Integer; - P, N: PHashItemCollision; begin ! for i := 0 to High(FItems) do begin ! P := FItems[i].Collision; ! // release collision list ! while P <> nil do ! begin ! N := P.Next; ! Dispose(P); ! P := N; ! end; end; end; ! function THashtable.Hashing(AKey: TObject): Cardinal; begin ! Result := (Cardinal(AKey) shr 2) mod Cardinal(Length(FItems)); end; ! procedure THashtable.Add(AKey, AValue: TObject); var ! Index: Cardinal; ! P: PHashItemCollision; begin ! Index := Hashing(AKey); ! with FItems[Index] do ! begin ! if Empty then ! begin ! Key := AKey; ! Value := AValue; ! Empty := False; ! end ! else begin ! New(P); ! P.Key := AKey; ! P.Value := AValue; ! P.Next := Collision; ! Collision := P; end; end; end; ! function THashtable.GetItems(AKey: TObject): TObject; var ! P: PHashItemCollision; ! Index: Cardinal; begin ! Result := nil; ! Index := Hashing(AKey); ! with FItems[Index] do begin ! if Key = AKey then ! Result := Value ! else begin ! // search in collision list ! P := Collision; ! while P <> nil do begin ! if P.Key = AKey then ! begin ! Result := Value; ! Break; ! end; ! P := P.Next; end; end; end; end; ! function THashtable.Remove(AKey: TObject): Boolean; var ! P, N: PHashItemCollision; ! Index: Cardinal; begin ! Result := False; ! Index := Hashing(AKey); ! with FItems[Index] do begin ! if Key = AKey then ! begin ! Result := True; ! if Collision <> nil then ! begin ! Key := Collision.Key; ! Value := Collision.Value; ! P := Collision.Next; ! Dispose(Collision); ! Collision := P; ! if Collision = nil then ! Empty := True; ! end; ! end ! else if Collision <> nil then ! begin ! P := Collision^.Next; ! if Collision.Key = AKey then begin Result := True; ! Dispose(Collision); ! Collision := P; ! end ! else ! begin ! N := Collision; ! while P <> nil do begin ! if P.Key = AKey then ! begin ! Result := True; ! N^.Next := P^.Next; ! Dispose(P); ! Break; ! end; ! N := P; ! P := P.Next; end; end; end; end; end; end. --- 34,585 ---- uses ! {$IFDEF MSWINDOWS} ! Windows, ! {$ENDIF MSWINDOWS} ! QtLibrary, Classes, Contnrs; type ! TCWrapperObjectBase = class; ! ! PCastConnection = ^TCastConnection; ! TCastConnection = record ! Instance: TCWrapperObjectBase; ! Next: PCastConnection; ! end; ! ! TCWrapperObjectBase = class(TObject) private + FCastConnection: PCastConnection; + FAutoDelete: Boolean; + FHandleMode: Integer; + + constructor CreateCastedHandle(AHandle: TImportLibraryBase); + constructor CreateCasted(Instance: TCWrapperObjectBase); protected FHandle: Pointer; ! procedure override_destructor; cdecl; ! ! procedure DeleteHandle(Handle: Pointer); virtual; abstract; procedure OverrideMethods; virtual; + + constructor CreateHandle(AHandle: TImportLibraryBase; AAutoDelete: Boolean = True); public destructor Destroy; override; end; + TSignalSlotList = class(TObject) + private + FList: TList; + protected + function Find(const XMember: string): Pointer; + public + constructor Create; + destructor Destroy; override; ! procedure AddSignal(Member: string; const Method); ! procedure AddSlot(Member: string; const Method: TMethod); end; ! TQObjectBase = class(TCWrapperObjectBase) private ! FSignalSlots: TSignalSlotList; ! function GetHandle: QObjectH; protected ! procedure InitHandle; virtual; ! procedure DeleteHandle(Handle: Pointer); override; ! procedure GetSignalSlot(List: TSignalSlotList); virtual; ! { This method is invoked by the constructor. Each decendant must add it's ! signals and slots in this method to the list. Otherwise the signals and ! slots are not usable through connect/disconnect. } public ! function className: string; ! function isA(const classname: string): Boolean; ! function inherits(const classname: string): Boolean; ! function signalsBlocked: Boolean; ! procedure blockSignals(b: Boolean); ! class function connect(sender: TQObjectBase; const signal: string; receiver: TQObjectBase; const member: string): Boolean; overload; ! class function disconnect(sender: TQObjectBase; const signal: string; receiver: TQObjectBase; const member: string): Boolean; overload; ! function connect(sender: TQObjectBase; const signal: string; const member: string): Boolean; overload; ! function disconnect(const signal: string = ''; receiver: TQObjectBase = nil; const member: string = ''): Boolean; overload; ! function disconnect(receiver: TQObjectBase; const member: string = ''): Boolean; overload; cdecl; ! ! property Handle: QObjectH read GetHandle; end; ! TCWrapperObjectBaseClass = class of TCWrapperObjectBase; ! IQtCastObject = interface ! function get: TCWrapperObjectBase; ! end; ! ! // QtCastIntf casts the @Handle to @ToClass and returns a autodeletion interface. ! // If the Handle is a Delphi Instance handle the autodelete mechanism is ! // deactivated. ! function QtCastIntf(ToClass: TCWrapperObjectBaseClass; Handle: TImportLibraryBase): IQtCastObject overload; ! ! // QtCast(handle) casts the @Handle to @ToClass. If the handle is a Delphi Instance ! // handle the Instance is returned otherwise a new Instance of ToClass is created ! // and returned. ! function QtCast(ToClass: TCWrapperObjectBaseClass; Handle: TImportLibraryBase): Pointer;{TCWrapperObjectBase} overload; ! ! // QtCast(instance) casts the @Instance to @ToClass. if @Instances is @ToClass ! // the Instance is returned. Otherwise the Instance is removed from the Delphi ! // Object Lookup list and connected to the new (created) Delphi Instance ! function QtCast(ToClass: TCWrapperObjectBaseClass; Instance: TCWrapperObjectBase): Pointer;{TCWrapperObjectBase} overload; implementation var ! ObjectLookup: TBucketList; ! IntfCastList: TList; ! LookupCritSect: TRTLCriticalSection; ! ! const ! // HandleMode ! HMODE_HANDLE = 0; ! HMODE_CASTEDHANDLE = 1; ! HMODE_CASTEDINSTANCE = 2; type ! TQtCastObject = class(TInterfacedObject, IQtCastObject) ! private ! FInstance: TCWrapperObjectBase; ! FAutoDeleteInstance: Boolean; ! public ! constructor Create(AInstance: TCWrapperObjectBase; AAutoDeleteInstance: Boolean); ! destructor Destroy; override; ! function get: TCWrapperObjectBase; end; ! { TQtCastObject } ! ! constructor TQtCastObject.Create(AInstance: TCWrapperObjectBase; AAutoDeleteInstance: Boolean); begin ! inherited Create; ! FInstance := AInstance; ! FAutoDeleteInstance := AAutoDeleteInstance; ! IntfCastList.Add(AInstance); end; ! destructor TQtCastObject.Destroy; begin ! if FAutoDeleteInstance then ! begin ! FInstance.FAutoDelete := False; // Do not delete the handle ! ! EnterCriticalSection(LookupCritSect); ! try ! if IntfCastList.IndexOf(FInstance) >= 0 then ! FInstance.Free; ! finally ! LeaveCriticalSection(LookupCritSect); ! end; ! end; end; ! function TQtCastObject.get: TCWrapperObjectBase; begin ! Result := FInstance; end; ! function GetMostSpecializedInstance(Handle: TImportLibraryBase): TCWrapperObjectBase; ! var ! P: PCastConnection; ! begin ! Result := nil; ! if (Handle <> nil) and ObjectLookup.Find(Handle, Pointer(Result)) then ! begin ! P := Result.FCastConnection; ! while P <> nil do ! begin ! if P.Instance.InheritsFrom(Result.ClassType) then ! Result := P.Instance; ! P := P.Next; ! end; ! end; ! end; ! function QtCast(ToClass: TCWrapperObjectBaseClass; Handle: TImportLibraryBase): Pointer;{TCWrapperObjectBase} begin ! if Handle <> nil then ! begin ! EnterCriticalSection(LookupCritSect); ! try ! Result := GetMostSpecializedInstance(Handle); ! if Result = nil then ! Result := ToClass.CreateCastedHandle(Handle); // does not destroy the handle on destruction ! finally ! LeaveCriticalSection(LookupCritSect); ! end; ! end ! else ! Result := nil; end; ! function QtCast(ToClass: TCWrapperObjectBaseClass; Instance: TCWrapperObjectBase): Pointer;{TCWrapperObjectBase} begin ! if Instance <> nil then ! begin ! if Instance is ToClass then ! Result := Instance ! else ! begin ! EnterCriticalSection(LookupCritSect); ! try ! Result := ToClass.CreateCasted(Instance); // does not destroy the handle on destruction ! finally ! LeaveCriticalSection(LookupCritSect); ! end; ! end; ! end ! else ! Result := nil; end; ! function QtCastIntf(ToClass: TCWrapperObjectBaseClass; Handle: TImportLibraryBase): IQtCastObject; ! var ! Instance: TCWrapperObjectBase; begin ! if Handle <> nil then ! begin ! EnterCriticalSection(LookupCritSect); ! try ! Instance := GetMostSpecializedInstance(Handle); ! if Instance <> nil then ! Result := TQtCastObject.Create(Instance, False) ! else ! Result := TQtCastObject.Create(QtCast(ToClass, Handle), True); ! finally ! LeaveCriticalSection(LookupCritSect); ! end; ! end ! else ! Result := nil; end; ! function MemberToCMember(const Member: string): string; begin + Result := Member; + {TODO implement } end; + { TSignalSlotList } ! type ! PSignalSlotItem = ^TSignalSlotItem; ! TSignalSlotItem = record ! Member: string; ! Method: TMethod; ! end; ! constructor TSignalSlotList.Create; begin ! FList := TList.Create; end; ! destructor TSignalSlotList.Destroy; ! begin ! FList.Free; ! end; ! ! procedure TSignalSlotList.AddSignal(Member: string; const Method); var + N: PSignalSlotItem; i: Integer; begin ! Member := '2' + MemberToCMember(Member); ! if Find(Member) = nil then begin ! New(N); ! N.Member := Member; ! N.Method := TMethod(Method); end; end; ! procedure TSignalSlotList.AddSlot(Member: string; const Method: TMethod); ! var ! N: PSignalSlotItem; ! i: Integer; begin ! Member := '1' + MemberToCMember(Member); ! if Find(Member) = nil then ! begin ! New(N); ! N.Member := Member; ! N.Method := TMethod(Method); ! FList.Add(N); ! end; end; ! function TSignalSlotList.Find(const XMember: string): Pointer; var ! i: Integer; begin ! Result := nil; ! for i := 0 to FList.Count - 1 do ! if PSignalSlotItem(FList[i]).Member = XMember then begin ! Result := FList[i]; ! Exit; end; + end; + + { TCWrapperObjectBase } + + constructor TCWrapperObjectBase.CreateHandle(AHandle: TImportLibraryBase; AAutoDelete: Boolean); + begin + inherited Create; + FHandleMode := HMODE_HANDLE; + FHandle := AHandle; + FAutoDelete := AAutoDelete; + ObjectLookup.Add(AHandle, Self); + OverrideMethods; + end; + + // Creates a Instance that does not own the handle (no auto delete) but registers + // the instance to the LookupObject list. + constructor TCWrapperObjectBase.CreateCastedHandle(AHandle: TImportLibraryBase); + begin + inherited Create; + FHandleMode := HMODE_CASTEDHANDLE; + FHandle := AHandle; + FAutoDelete := False; + ObjectLookup.Add(AHandle, Self); + end; + + // Create a Instance that does not own the handle but must be connected to the + // handle owner. + constructor TCWrapperObjectBase.CreateCasted(Instance: TCWrapperObjectBase); + var + P: PCastConnection; + begin + inherited Create; + FHandleMode := HMODE_CASTEDINSTANCE; + FHandle := Instance.FHandle; + FAutoDelete := False; // The original Instance destroys the handle. + + // Add to the CastConnection list. + if Instance.FCastConnection = nil then + begin + // Create the CastConnection list for the handle owner and add the owner + // as the first entry. + New(Instance.FCastConnection); + Instance.FCastConnection.Instance := Instance; + Instance.FCastConnection.Next := nil; end; + P := Instance.FCastConnection; + while P.Next <> nil do + P := P.Next; + New(P.Next); + P := P.Next; + P.Instance := Self; + P.Next := nil; + FCastConnection := Instance.FCastConnection; end; ! destructor TCWrapperObjectBase.Destroy; var ! P: PCastConnection; ! H: Pointer; begin ! IntfCastList.Remove(Self); ! if FHandleMode = HMODE_CASTEDINSTANCE then begin ! // The first item in the cast-connection list is the handle owner. ! if FCastConnection <> nil then begin ! P := FCastConnection; ! FCastConnection := nil; // prevent recursive destruction ! P.Instance.Free; ! end; ! end ! else ! begin ! // destroy other cast connected instances (does not destroy the handle) ! if FCastConnection <> nil then ! begin ! // remove the first item because it is this object (Instance = Self) ! P := FCastConnection.Next; ! Dispose(FCastConnection); ! FCastConnection := P; ! end; ! while FCastConnection <> nil do ! begin ! if FCastConnection.Instance.FCastConnection <> nil then begin ! FCastConnection.Instance.FCastConnection := nil; // prevent recursion ! FCastConnection.Instance.Free; end; + P := FCastConnection.Next; + Dispose(FCastConnection); + FCastConnection := P; + end; + end; + + H := FHandle; + if H <> nil then + begin + FHandle := nil; // prevent recursive destruction by override_destroy + try + if FAutoDelete then + DeleteHandle(H); + finally + if FHandleMode <> HMODE_CASTEDINSTANCE then // HMODE_HANDLE and HMODE_CASTEDHANDLE register themself + ObjectLookup.Remove(H); end; end; + inherited Destroy; end; ! procedure TCWrapperObjectBase.override_destructor; ! begin ! if FHandle <> nil then // the handle was not destroyed by DeleteHandle ! begin ! FAutoDelete := False; // already deleted ! Free; ! end; ! end; ! ! procedure TCWrapperObjectBase.OverrideMethods; ! begin ! // do nothing ! end; ! ! ! { TQObjectBase } ! ! procedure TQObjectBase.GetSignalSlot(List: TSignalSlotList); ! begin ! end; ! ! function TQObjectBase.GetHandle: QObjectH; ! begin ! Result := nil; ! if Self <> nil then ! Result := FHandle; ! end; ! ! procedure TQObjectBase.InitHandle; ! begin ! FSignalSlots := TSignalSlotList.Create; ! GetSignalSlot(FSignalSlots); ! end; ! ! procedure TQObjectBase.DeleteHandle(Handle: Pointer); ! begin ! try ! QObjectH(Handle).Delete; // "virtual ~QObject()" ! finally ! FSignalSlots.Free; ! end; ! end; ! ! procedure TQObjectBase.blockSignals(b: Boolean); ! begin ! Handle.blockSignals(b); ! end; ! ! function TQObjectBase.signalsBlocked: Boolean; ! begin ! Result := Handle.signalsBlocked; ! end; ! ! function TQObjectBase.className: string; var ! Data: Pointer; begin ! Result := Handle.className; ! EnterCriticalSection(LookupCritSect); ! try ! if (FHandleMode = HMODE_HANDLE) and ObjectLookup.Find(FHandle, Data) and ! (Data = Self) then ! Result := TObject(Self).ClassName; ! finally ! LeaveCriticalSection(LookupCritSect); ! end; ! end; ! ! function TQObjectBase.inherits(const classname: string): Boolean; ! var ! Data: Pointer; ! Parent: TClass; ! begin ! Result := Handle.inherits(classname); ! if not Result then begin ! EnterCriticalSection(LookupCritSect); ! try ! if (FHandleMode = HMODE_HANDLE) and ObjectLookup.Find(FHandle, Data) and ! (Data = Self) then begin Result := True; ! Parent := TObject(Self).ClassParent; ! while Parent <> nil do begin ! if Parent.ClassName = classname then ! Exit; ! Parent := Parent.ClassParent; end; end; + finally + LeaveCriticalSection(LookupCritSect); end; end; end; + function TQObjectBase.isA(const classname: string): Boolean; + begin + Result := Handle.isA(classname); + if not Result then + Result := TObject(Self).ClassName = classname; + end; + + function TQObjectBase.connect(sender: TQObjectBase; const signal, + member: string): Boolean; + begin + Result := connect(sender, signal, Self, member); + end; + + function TQObjectBase.disconnect(const signal: string; + receiver: TQObjectBase; const member: string): Boolean; + begin + Result := disconnect(Self, signal, receiver, member); + end; + + class function TQObjectBase.connect(sender: TQObjectBase; + const signal: string; receiver: TQObjectBase; + const member: string): Boolean; + begin + // MemberToCMember(signal) + // MemberToCMember(member) + end; + + function TQObjectBase.disconnect(receiver: TQObjectBase; + const member: string): Boolean; + begin + Result := Handle.disconnect(receiver.Handle, Member); + end; + + class function TQObjectBase.disconnect(sender: TQObjectBase; + const signal: string; receiver: TQObjectBase; + const member: string): Boolean; + begin + // MemberToCMember(signal) + // MemberToCMember(member) + end; + + + initialization + ObjectLookup := TBucketList.Create(bl256); + IntfCastList := TList.Create; + InitializeCriticalSection(LookupCritSect); + + finalization + DeleteCriticalSection(LookupCritSect); + IntfCastList.Free; + ObjectLookup.Free; + end. + |
From: Andreas H. <ah...@us...> - 2004-11-04 18:35:56
|
Update of /cvsroot/qtcsharp/Bugtussle/src/APILoader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4385/src/APILoader Modified Files: CGen.bdsproj Class.cs Namespace.cs Log Message: Fixed "..." bug for constructors and global functions Index: Class.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Class.cs,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Class.cs 1 Oct 2004 11:32:56 -0000 1.50 --- Class.cs 4 Nov 2004 18:35:46 -0000 1.51 *************** *** 259,262 **** --- 259,268 ---- if ( IsStdNamespaceUser( ctor ) ) return; + if ( ctor.Varargs ) + { + if ( API.OptWarnVarargs ) + Console.WriteLine( "Skipped varargs ctor {0}", ctor.GetFullTypeName() ); + return; + } if ( ctor.Access != AccessKind.Private ) isFinal = false; Index: CGen.bdsproj =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/CGen.bdsproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CGen.bdsproj 1 Oct 2004 11:32:56 -0000 1.7 --- CGen.bdsproj 4 Nov 2004 18:35:46 -0000 1.8 *************** *** 69,77 **** <Options Name="BuildInOutput" Type="Boolean">False</Options> <Options Name="OutputDirectory" Type="String">bin\Debug</Options> ! <Options Name="RunParams" Type="String">qt -t win32_333</Options> <Options Name="HostApplication" Type="String"></Options> <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">z:\Qts\Bugtussle\src</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> --- 69,77 ---- <Options Name="BuildInOutput" Type="Boolean">False</Options> <Options Name="OutputDirectory" Type="String">bin\Debug</Options> ! <Options Name="RunParams" Type="String">wx -t win32</Options> <Options Name="HostApplication" Type="String"></Options> <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">Z:\wxC</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> *************** *** 88,95 **** </Options> </OptionsSet> ! </Options> ! ! ! <FileList> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> --- 88,93 ---- </Options> </OptionsSet> ! </Options> ! <FileList> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> Index: Namespace.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Namespace.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Namespace.cs 17 Aug 2004 08:49:08 -0000 1.12 --- Namespace.cs 4 Nov 2004 18:35:46 -0000 1.13 *************** *** 49,52 **** --- 49,55 ---- public void AddFunction( Function f ) { + if ( f.Varargs ) + return; + if ( !f.Operator && f.ReturnType.Name.IndexOf( "Q_INLINE_TEMPLATES" ) == -1 && f.ReturnType.RefId.IndexOf( '<' ) == -1 ) |
From: Andreas H. <ah...@us...> - 2004-10-13 18:47:44
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24140 Modified Files: KylixWriter.cs Log Message: Update Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** KylixWriter.cs 11 Oct 2004 19:02:49 -0000 1.11 --- KylixWriter.cs 13 Oct 2004 18:47:27 -0000 1.12 *************** *** 295,299 **** cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; --- 295,299 ---- cw.WriteLine("Windows;"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib, Types;"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.Indent--; *************** *** 2252,2256 **** cw.WriteLine("Windows,"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib,"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("{0}Library;", ApiName); --- 2252,2256 ---- cw.WriteLine("Windows,"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine("Libc, Xlib, Types,"); cw.WriteLine("{$ENDIF MSWINDOWS}"); cw.WriteLine("{0}Library;", ApiName); |
From: Andreas H. <ah...@us...> - 2004-10-13 16:30:01
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18599 Modified Files: CWriter.cs Log Message: Workaround for a gcc bug. Index: CWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CWriter.cs 1 Oct 2004 11:33:31 -0000 1.10 --- CWriter.cs 13 Oct 2004 16:28:51 -0000 1.11 *************** *** 18,21 **** --- 18,27 ---- } + public enum VariableGetter + { + Yes, + No + } + /*! *************** *** 775,779 **** cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation ); cw.Indent--; --- 781,785 ---- cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation, VariableGetter.No ); cw.Indent--; *************** *** 783,787 **** ! private void WriteFunctionReturn( Method method, StringBuilder invocation ) { if ( Function.IsValueRetFunction( method ) ) --- 789,793 ---- ! private void WriteFunctionReturn( Method method, StringBuilder invocation, VariableGetter isVarGetter ) { if ( Function.IsValueRetFunction( method ) ) *************** *** 791,798 **** cw.WriteLine( "returnValue = {0};", invocation ); cw.Indent--; ! cw.WriteLine( "else" ); ! cw.Indent++; ! cw.WriteLine( "{0};", invocation ); // ignore return value ! cw.Indent--; } else --- 797,807 ---- cw.WriteLine( "returnValue = {0};", invocation ); cw.Indent--; ! if ( isVarGetter == VariableGetter.No ) ! { ! cw.WriteLine( "else" ); ! cw.Indent++; ! cw.WriteLine( "{0};", invocation ); // ignore return value ! cw.Indent--; ! } } else *************** *** 1068,1072 **** //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});", m.UniqueName, paramstr, --- 1077,1081 ---- //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}((void*)overrideHook.{0}Data{1});", // (void*) because of a gcc bug m.UniqueName, paramstr, *************** *** 1665,1669 **** cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation ); cw.Indent--; cw.WriteLine( "}" ); --- 1674,1678 ---- cw.WriteLine( "{0};", invocation ); else ! WriteFunctionReturn( method, invocation, VariableGetter.No ); cw.Indent--; cw.WriteLine( "}" ); *************** *** 1711,1715 **** invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() ); invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) ); ! WriteFunctionReturn( method, invocation ); cw.Indent--; cw.WriteLine( "}" ); --- 1720,1724 ---- invocation.AppendFormat( "{0}::", v.Container.GetFullTypeName() ); invocation.Append( TypeReferenceToString( v.Name, v.Type, ParameterStyle.CtoCXXInvocation, ns ) ); ! WriteFunctionReturn( method, invocation, VariableGetter.Yes ); cw.Indent--; cw.WriteLine( "}" ); |
From: Andreas H. <ah...@us...> - 2004-10-13 15:12:03
|
Update of /cvsroot/qtcsharp/Bugtussle/src/static/clib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv507/src/static/clib Modified Files: signalhookbase.cpp signalhookbase.h Log Message: Update Index: signalhookbase.h =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/clib/signalhookbase.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** signalhookbase.h 18 Aug 2004 22:16:12 -0000 1.2 --- signalhookbase.h 13 Oct 2004 15:10:35 -0000 1.3 *************** *** 7,11 **** class SignalHookBase; ! typedef void(*objectDestroyedHook)(SignalHookBase* hook, QObject* obj); class SignalHookBase: public QObject --- 7,11 ---- class SignalHookBase; ! typedef void(*objectDestroyedHook)(void* hook, QObject* obj); class SignalHookBase: public QObject *************** *** 17,23 **** public: ! inline void setObjectDestroyed(objectDestroyedHook hook) { ! objectDestroyed = hook; } --- 17,24 ---- public: ! inline void setObjectDestroyed(void* hookData, objectDestroyedHook hook) { ! objectDestroyedCallbackData = hookData; ! objectDestroyedCallback = hook; } *************** *** 36,44 **** private: ! objectDestroyedHook objectDestroyed; protected: QObject* owner; }; - #endif --- 37,45 ---- private: ! objectDestroyedHook objectDestroyedCallback; ! void* objectDestroyedCallbackData; protected: QObject* owner; }; #endif Index: signalhookbase.cpp =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/static/clib/signalhookbase.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** signalhookbase.cpp 18 Aug 2004 22:09:55 -0000 1.3 --- signalhookbase.cpp 13 Oct 2004 15:10:35 -0000 1.4 *************** *** 12,17 **** } ! void QTC_EXPORT SignalHookBase_setObjectDestroyed(SignalHookBase* handle, objectDestroyedHook hook) { ! handle->setObjectDestroyed(hook); } --- 12,17 ---- } ! void QTC_EXPORT SignalHookBase_setObjectDestroyed(SignalHookBase* handle, void* hookData, objectDestroyedHook hook) { ! handle->setObjectDestroyed(hookData, hook); } *************** *** 43,48 **** void SignalHookBase::ObjectDestroyedSlot(QObject* obj) { ! if(objectDestroyed) ! objectDestroyed(this, obj); delete this; } --- 43,48 ---- void SignalHookBase::ObjectDestroyedSlot(QObject* obj) { ! if(objectDestroyedCallback) ! objectDestroyedCallback(objectDestroyedCallbackData ? objectDestroyedCallbackData : this, obj); delete this; } |
From: Andreas H. <ah...@us...> - 2004-10-11 19:03:18
|
Update of /cvsroot/qtcsharp/Bugtussle/src/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3803/src/scripts Modified Files: Doxyfile-qtwin Log Message: Update Index: Doxyfile-qtwin =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/scripts/Doxyfile-qtwin,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Doxyfile-qtwin 19 Sep 2004 22:33:22 -0000 1.1 --- Doxyfile-qtwin 11 Oct 2004 19:03:03 -0000 1.2 *************** *** 1,3 **** ! # Doxyfile 1.3.6 #--------------------------------------------------------------------------- --- 1,3 ---- ! # Doxyfile 1.3.8 #--------------------------------------------------------------------------- *************** *** 6,10 **** PROJECT_NAME = Qt3/Win32 PROJECT_NUMBER = 3.3.3 ! OUTPUT_DIRECTORY = z:/Bugtussle/src/qt/xml/win32/ OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO --- 6,11 ---- PROJECT_NAME = Qt3/Win32 PROJECT_NUMBER = 3.3.3 ! OUTPUT_DIRECTORY = z:/Qts/Bugtussle/src/qt/xml/win32/ ! CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO *************** *** 16,19 **** --- 17,21 ---- FULL_PATH_NAMES = NO STRIP_FROM_PATH = + STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO *************** *** 34,37 **** --- 36,40 ---- EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES + EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO *************** *** 78,81 **** --- 81,85 ---- IMAGE_PATH = INPUT_FILTER = + FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- *************** *** 149,153 **** #--------------------------------------------------------------------------- GENERATE_XML = YES ! XML_OUTPUT = z:/Bugtussle/src/qt/xml/win32_333/ XML_SCHEMA = XML_DTD = --- 153,157 ---- #--------------------------------------------------------------------------- GENERATE_XML = YES ! XML_OUTPUT = z:/Qts/Bugtussle/src/qt/xml/win32_333/ XML_SCHEMA = XML_DTD = *************** *** 175,179 **** PREDEFINED = slots=slots \ signals=signals \ - Q_QDOC=1 \ Q_NO_USING_KEYWORD \ QT_SHARED \ --- 179,182 ---- *************** *** 197,207 **** Q_CC_BOR \ Q_WS_WIN \ ! Q_WS_WIN32 ! EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- ! # Configuration::additions related to external references #--------------------------------------------------------------------------- ! TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO --- 200,212 ---- Q_CC_BOR \ Q_WS_WIN \ ! Q_WS_WIN32 \ ! QDOC=1 \ ! Q_DOC=1 ! EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- ! # Configuration::additions related to external references #--------------------------------------------------------------------------- ! TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO *************** *** 224,228 **** DOT_IMAGE_FORMAT = png DOT_PATH = ! DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 --- 229,233 ---- DOT_IMAGE_FORMAT = png DOT_PATH = ! DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 |
From: Andreas H. <ah...@us...> - 2004-10-11 19:03:06
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3697/src/Writers Modified Files: KylixWriter.cs Log Message: QRectH -> PRect QPointH -> PPoint Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** KylixWriter.cs 1 Oct 2004 11:33:31 -0000 1.10 --- KylixWriter.cs 11 Oct 2004 19:02:49 -0000 1.11 *************** *** 14,17 **** --- 14,22 ---- }; + private enum NativeType { + Yes, + No + } + public enum PointerRequire { None, // name *************** *** 566,570 **** string s; ! if(IsClass(td)) typeName += "H"; else if(td.Reference is FunctionPtr) --- 571,575 ---- string s; ! if(IsClass(td, NativeType.No)) typeName += "H"; else if(td.Reference is FunctionPtr) *************** *** 1586,1590 **** if(value.IndexOf('(') > 0 && value.IndexOf(')') > 0) { ! if(t.Mode != PassByMode.Value || IsClass(tb) || IsPointer(tb)) return "nil"; else --- 1591,1595 ---- if(value.IndexOf('(') > 0 && value.IndexOf(')') > 0) { ! if(t.Mode != PassByMode.Value || IsClass(tb, NativeType.Yes) || IsPointer(tb)) return "nil"; else *************** *** 1601,1605 **** if(tb == null) tb = API.GetTypeByName(cname); ! if(IsClass(tb)) { string v = ParseEnumValue(value.Substring(pos + 2), null, (Class)tb); --- 1606,1610 ---- if(tb == null) tb = API.GetTypeByName(cname); ! if(IsClass(tb, NativeType.Yes)) { string v = ParseEnumValue(value.Substring(pos + 2), null, (Class)tb); *************** *** 1630,1634 **** if((value == "0" || value == "NULL") && ! (t.Mode == PassByMode.Pointer || IsClass(tb))) // classes are always references/pointers return "nil"; --- 1635,1639 ---- if((value == "0" || value == "NULL") && ! (t.Mode == PassByMode.Pointer || IsClass(tb, NativeType.Yes))) // classes are always references/pointers return "nil"; *************** *** 1639,1643 **** if(!ParseEnumValueEx(value, null, container, null, out ret)) ret = "0"; ! if(ret == "0" && t.Mode != PassByMode.Value || IsClass(tb) || IsPointer(tb)) ret = "nil"; return ret; --- 1644,1648 ---- if(!ParseEnumValueEx(value, null, container, null, out ret)) ret = "0"; ! if(ret == "0" && t.Mode != PassByMode.Value || IsClass(tb, NativeType.Yes) || IsPointer(tb)) ret = "nil"; return ret; *************** *** 1673,1680 **** } /* Returns true if the type if a Class or a typedef to a Class. */ ! private bool IsClass(TypeBase tb) { ! if(tb != null && tb.Name == "QChar") return false; if(tb is Class) --- 1678,1696 ---- } + private bool IsNativeType(string typeName) + { + return typeName == "QChar"; + } + + private void ChangeToNativeType(ref string typeName) + { + if(typeName == "QChar") + typeName = "WideChar"; + } + /* Returns true if the type if a Class or a typedef to a Class. */ ! private bool IsClass(TypeBase tb, NativeType nt) { ! if(tb != null && (nt == NativeType.Yes && IsNativeType(tb.Name))) return false; if(tb is Class) *************** *** 1683,1687 **** { Typedef td = (Typedef)tb; ! bool ret = IsClass(td.Reference); if(ret && td.TypeRef != null && td.TypeRef.Mode != PassByMode.Value) ret = false; --- 1699,1703 ---- { Typedef td = (Typedef)tb; ! bool ret = IsClass(td.Reference, nt); if(ret && td.TypeRef != null && td.TypeRef.Mode != PassByMode.Value) ret = false; *************** *** 1746,1750 **** else if(typeName != "Pointer") { ! if(!IsClass(tb) && !IsPointer(tb) && !(tb is Enum)) return 'P' + typeName; } --- 1762,1766 ---- else if(typeName != "Pointer") { ! if(!IsClass(tb, NativeType.Yes) && !IsPointer(tb) && !(tb is Enum)) return 'P' + typeName; } *************** *** 1788,1792 **** modifier = ""; ! if(IsClass(tb)) { // class instances are always passed by reference/pointer --- 1804,1808 ---- modifier = ""; ! if(IsClass(tb, NativeType.Yes)) { // class instances are always passed by reference/pointer *************** *** 1829,1833 **** } else ! { // isClass switch(t.Mode) { --- 1845,1849 ---- } else ! { switch(t.Mode) { *************** *** 1845,1850 **** else { ! if(typeName == "QChar") ! typeName = "WideChar"; switch(t.Mode) --- 1861,1865 ---- else { ! ChangeToNativeType(ref typeName); switch(t.Mode) *************** *** 1980,1989 **** // ANN: Maybe move this to GetTypeMode ! if(PCharToString && modifier == "" && parameters[i].Type.Const && typeName == "PChar" ) { ! // ANN: Maybe limit this to QObjectH.connect/disconnect where it works in all cases. ! modifier = "const"; ! typeName = "string"; } if(modifier != "") --- 1995,2011 ---- // ANN: Maybe move this to GetTypeMode ! if(modifier == "" && parameters[i].Type.Const) { ! if(PCharToString && typeName == "PChar" ) ! { ! modifier = "const"; ! typeName = "string"; ! } } + // for easier handling QRect is binary compatible to TRect and QPoint to TPoint + if(typeName == "QRectH" ) + typeName = "PRect"; + else if(typeName == "QPointH" ) + typeName = "PPoint"; if(modifier != "") *************** *** 2064,2068 **** cw.WriteLine("uses"); cw.Indent++; ! cw.WriteLine("{0}Library;", ApiName); cw.Indent--; cw.WriteLine(); --- 2086,2090 ---- cw.WriteLine("uses"); cw.Indent++; ! cw.WriteLine("{0}Library, Types;", ApiName); cw.Indent--; cw.WriteLine(); |
From: Andreas H. <ah...@us...> - 2004-10-01 11:33:43
|
Update of /cvsroot/qtcsharp/Bugtussle/src/Writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15328/src/Writers Modified Files: CWriter.cs KylixWriter.cs Log Message: Changed overrideHooks with Value return type. Index: KylixWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/KylixWriter.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** KylixWriter.cs 21 Sep 2004 16:57:44 -0000 1.9 --- KylixWriter.cs 1 Oct 2004 11:33:31 -0000 1.10 *************** *** 209,213 **** //cw.WriteLine(" {$DEFINE QSW} // extended WideString support is disabled due to a method-implementation bug (fpc 1.9.5)"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine(" {$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}"); if(weakPackageUnit) cw.WriteLine(" {$WEAKPACKAGEUNIT ON}"); --- 209,213 ---- //cw.WriteLine(" {$DEFINE QSW} // extended WideString support is disabled due to a method-implementation bug (fpc 1.9.5)"); cw.WriteLine("{$ELSE}"); ! cw.WriteLine(" {$A4,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}"); if(weakPackageUnit) cw.WriteLine(" {$WEAKPACKAGEUNIT ON}"); *************** *** 836,845 **** cw.Indent++; } - // free pascal has a bug that requires the class methods to be listed first - /*foreach(Method m in methodList) - if(!m.Name.StartsWith( "operator" ) && m.Static) - if( m.VirtualKind != VirtualKind.Override) - CreatePascalMethod(m, null, c, methodSignatures, false, "public_", inInterfaceSection); - */ foreach(Method m in methodList) if(!m.Name.StartsWith( "operator" ) /*&& !m.Static*/) --- 836,839 ---- *************** *** 858,866 **** cw.Indent++; } - /*foreach(Method m in methodList) - if (!m.Name.StartsWith( "operator") && m.Static) - if (m.VirtualKind != VirtualKind.Override) - CreatePascalMethod(m, null, c, methodSignatures, false, "", inInterfaceSection); - */ foreach(Method m in methodList) if(!m.Name.StartsWith( "operator") /*&& !m.Static*/) --- 852,855 ---- *************** *** 900,904 **** } - private void WriteDestructor(Class c, bool inInterfaceSection) { --- 889,892 ---- *************** *** 1057,1062 **** // paramstr = "; " + paramstr; sb = new StringBuilder(); ! Function cfunc = Function.GetValueRetFunction(m); ! if(cfunc.ReturnType.IsVoidValue) sb.Append("procedure"); else --- 1045,1049 ---- // paramstr = "; " + paramstr; sb = new StringBuilder(); ! if(m.ReturnType.IsVoidValue) sb.Append("procedure"); else *************** *** 1064,1069 **** //sb.AppendFormat("(Handle: {0}H{1})", rfullname, paramstr); sb.AppendFormat("({0})", paramstr); ! if(!cfunc.ReturnType.IsVoidValue) ! sb.AppendFormat(": {0}", TypeReferenceToString(cfunc.ReturnType, false, c)); //sb.Append("; cdecl"); sb.Append(" of object; cdecl"); --- 1051,1056 ---- //sb.AppendFormat("(Handle: {0}H{1})", rfullname, paramstr); sb.AppendFormat("({0})", paramstr); ! if(!m.ReturnType.IsVoidValue) ! sb.AppendFormat(": {0}", TypeReferenceToString(m.ReturnType, false, c)); //sb.Append("; cdecl"); sb.Append(" of object; cdecl"); *************** *** 2161,2166 **** // create function prototype for "m" string paramstr = ParametersToString(m.GetParameters(), ParameterStyle.DelphiNoDefaultDeclaration, c, false); ! if (paramstr != "") ! paramstr = "; " + paramstr; sb = new StringBuilder(); Function cfunc = Function.GetValueRetFunction(m); --- 2148,2153 ---- // create function prototype for "m" string paramstr = ParametersToString(m.GetParameters(), ParameterStyle.DelphiNoDefaultDeclaration, c, false); ! //if (paramstr != "") ! // paramstr = "; " + paramstr; sb = new StringBuilder(); Function cfunc = Function.GetValueRetFunction(m); *************** *** 2169,2177 **** else sb.Append("function"); ! sb.AppendFormat("(SignalHook: {0}{1})", GetSignalHookClassName(c), paramstr); if(!cfunc.ReturnType.IsVoidValue) sb.AppendFormat(": {0}", TypeReferenceToString(cfunc.ReturnType, false, c)); ! sb.Append("; cdecl"); ! cw.WriteLine("TSignalHookType{0}_{1} = {2};", rfullname, m.UniqueName, sb); } --- 2156,2165 ---- else sb.Append("function"); ! //sb.AppendFormat("(SignalHook: {0}{1})", GetSignalHookClassName(c), paramstr); ! sb.AppendFormat("({0})", paramstr); if(!cfunc.ReturnType.IsVoidValue) sb.AppendFormat(": {0}", TypeReferenceToString(cfunc.ReturnType, false, c)); ! sb.Append(" of object"); ! cw.WriteLine("TSignalHookType{0}_{1} = {2}; cdecl;", rfullname, m.UniqueName, sb); } *************** *** 2184,2188 **** { string signalName = m.UniqueName; ! cw.WriteLine( "procedure {0}(Hook: TSignalHookType{1}_{0}); cdecl;", signalName, rfullname); } --- 2172,2178 ---- { string signalName = m.UniqueName; ! //cw.WriteLine( "procedure {0}(Hook: TSignalHookType{1}_{0}); cdecl;", ! // signalName, rfullname); ! cw.WriteLine( "procedure {0}(Hook: TSignalHookType{1}_{0});", signalName, rfullname); } *************** *** 2206,2211 **** { string signalName = m.UniqueName; ! cw.WriteLine( "procedure {2}.{0}(Hook: TSignalHookType{1}_{0}); cdecl; external LibWrapper name Prefix+'{3}SignalHook_set{0}';", signalName, rfullname, GetSignalHookClassName(c), c.Name); } cw.WriteLine(); --- 2196,2211 ---- { string signalName = m.UniqueName; ! //cw.WriteLine( "procedure {2}.{0}(Hook: TSignalHookType{1}_{0}); cdecl; external LibWrapper name Prefix+'{3}SignalHook_set{0}';", ! // signalName, rfullname, GetSignalHookClassName(c), c.Name); ! cw.WriteLine( "procedure {2}_{0}(Handle: {2}; Data, Hook: Pointer); cdecl; external LibWrapper name Prefix+'{3}SignalHook_set{0}';", signalName, rfullname, GetSignalHookClassName(c), c.Name); + cw.WriteLine( "procedure {2}.{0}(Hook: TSignalHookType{1}_{0});", + signalName, rfullname, GetSignalHookClassName(c)); + cw.WriteLine("begin"); + cw.Indent++; + cw.WriteLine("{0}_{1}(Self, TMethod(Hook).Data, TMethod(Hook).Code);", GetSignalHookClassName(c), signalName); + cw.Indent--; + cw.WriteLine("end;"); + cw.WriteLine(); } cw.WriteLine(); Index: CWriter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/Writers/CWriter.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CWriter.cs 20 Sep 2004 11:42:59 -0000 1.9 --- CWriter.cs 1 Oct 2004 11:33:31 -0000 1.10 *************** *** 332,344 **** constStr = "const"; - /* Templates with a "< type * >" do not work with a "const type &" - parameter. g - cc means that "const type*" and type*" do not match. - The solution is to remove the "const" for this case. */ - /*if ( c == null || - (c is Class && ((Class)c).Template == null) || - typeRef.Mode != PassByMode.ReferenceToPointer ) - sb.Append( "const " );*/ - switch ( typeRef.Mode ) { --- 332,335 ---- *************** *** 701,705 **** /* ANN: method.ExportName is used in the CSharpWriter. Isn't it ! possible to generate this name in the CSharpWriter either. So the CSharpWriter does not depend on the call order of CWriter and CSharpWriter. */ --- 692,696 ---- /* ANN: method.ExportName is used in the CSharpWriter. Isn't it ! possible to generate this name in the CSharpWriter, too. So the CSharpWriter does not depend on the call order of CWriter and CSharpWriter. */ *************** *** 1032,1036 **** // TYPE NAME(PARAMETERS) [const] // { ! // if (overrideHook.NAME) [return] [*/&]overrideHook.NAME(this[, PARAMETERS]); // [else [return] METHODOWNER::Name(PARAMETERS);] // } --- 1023,1033 ---- // TYPE NAME(PARAMETERS) [const] // { ! // if (overrideHook.NAME) [{ ! // RETTYPE returnValue = / return] ! // [*/&]overrideHook.NAME(overrideHookNAMEData[, PARAMETERS]); ! // [RETTYPE returnValueValue = returnValue; ! // delete &returnValue; ! // return returnValueValue; ! // }] // [else [return] METHODOWNER::Name(PARAMETERS);] // } *************** *** 1038,1042 **** string ConstFunction = m.Const ? " const" : ""; ! cw.WriteLine( /*"/*override{4}*/ "{0}{1}({2}){3} {{", TypeReferenceToString( "", m.ReturnType, ParameterStyle.CXXDeclaration ), m.Name, --- 1035,1039 ---- string ConstFunction = m.Const ? " const" : ""; ! cw.WriteLine( "/*override{4}*/ {0}{1}({2}){3} {{", TypeReferenceToString( "", m.ReturnType, ParameterStyle.CXXDeclaration ), m.Name, *************** *** 1047,1063 **** cw.Indent++; if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method cw.Write( "if (overrideHook.{0}) ", m.UniqueName ); ! string paramstr = ParametersToString( m.GetParameters(), ParameterStyle.CXXtoCInvocation, null ); if ( paramstr != "" ) paramstr = ", " + paramstr; //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine("{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});", m.UniqueName, paramstr, ! m.ReturnType.IsVoidValue ? "" : "return ", ! m.ReturnType.IsVoidValue ? "" : TypeReferenceToString( "", m.ReturnType, ParameterStyle.CtoCXXInvocation ) ); ! if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method { cw.Write( "else "); --- 1044,1091 ---- cw.Indent++; + //Function cfunc = Function.GetValueRetFunction( m ); + Function cfunc = m; + if (m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method cw.Write( "if (overrideHook.{0}) ", m.UniqueName ); ! string paramstr = ParametersToString( cfunc.GetParameters(), ParameterStyle.CXXtoCInvocation, null ); if ( paramstr != "" ) paramstr = ", " + paramstr; + + if ( Function.IsValueRetFunction( m ) ) + { + // Handle value return types. If a copy constructor exists, use it. + // If none exist, try to use the first parameter type as reference + // and create the return type object after the overrideHooks + // invocation. + if ( m.VirtualKind != VirtualKind.Pure ) + { + cw.WriteLine( "{" ); + cw.Indent++; + } + cw.Write( "{0} returnValue = ", m.ReturnType.Name ); // here "m." because we need the type name + } + //cw.WriteLine("{2}{3}overrideHook.{0}(this{1});", ! cw.WriteLine( "{2}{3}overrideHook.{0}(overrideHook.{0}Data{1});", m.UniqueName, paramstr, ! (Function.IsValueRetFunction( m ) || cfunc.ReturnType.IsVoidValue) ? "" : "return ", ! cfunc.ReturnType.IsVoidValue ? "" : TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CtoCXXInvocation ) ); ! if ( Function.IsValueRetFunction( m ) ) ! { ! cw.WriteLine( "{0} returnValueValue = returnValue;", m.ReturnType.Name ); ! cw.WriteLine( "delete &returnValue;" ); ! cw.WriteLine( "return returnValueValue;" ); ! if ( m.VirtualKind != VirtualKind.Pure ) ! { ! cw.Indent--; ! cw.WriteLine( "}" ); ! } ! } ! // from here "m." because the cfunc stuff is complete ! ! if ( m.VirtualKind != VirtualKind.Pure ) // abstract methods have no base_xx method { cw.Write( "else "); *************** *** 1193,1197 **** /*cw.WriteLine( "typedef void(*destructorHookType)({0}* instPtr);", c.Destructor.Name.Substring( 1 ) );*/ ! cw.WriteLine( "typedef void(*destructorHookType)(void* instPtr);" ); cw.WriteLine( "destructorHookType destructor;" ); cw.WriteLine( "void* destructorData;" ); --- 1221,1225 ---- /*cw.WriteLine( "typedef void(*destructorHookType)({0}* instPtr);", c.Destructor.Name.Substring( 1 ) );*/ ! cw.WriteLine( "typedef void(*destructorHookType)(void* hookData);" ); cw.WriteLine( "destructorHookType destructor;" ); cw.WriteLine( "void* destructorData;" ); *************** *** 1200,1209 **** foreach ( Method m in ownVirtMethods ) { ! string paramstr = ParametersToString( m.GetParameters(), ParameterStyle.CDeclaration, c ); if ( paramstr != "" ) paramstr = ", " + paramstr; //cw.WriteLine( "typedef {0}(*{1}HookType)({2}{3}* instPtr{4});", ! cw.WriteLine( "typedef {0}(*{1}HookType)(void* instPtr{4});", ! TypeReferenceToString( "", m.ReturnType, ParameterStyle.CDeclaration, c ), m.UniqueName, ( m.Const ? "const " : "" ), --- 1228,1239 ---- foreach ( Method m in ownVirtMethods ) { ! /*Function cfunc = Function.GetValueRetFunction( m );*/ ! Function cfunc = m; ! string paramstr = ParametersToString( cfunc.GetParameters(), ParameterStyle.CDeclaration, c ); if ( paramstr != "" ) paramstr = ", " + paramstr; //cw.WriteLine( "typedef {0}(*{1}HookType)({2}{3}* instPtr{4});", ! cw.WriteLine( "typedef {0}(*{1}HookType)(void* hookData{4});", ! TypeReferenceToString( "", cfunc.ReturnType, ParameterStyle.CDeclaration, c ), m.UniqueName, ( m.Const ? "const " : "" ), *************** *** 1291,1299 **** cw.WriteLine(); - // pre-declare all hook classes - /*for ( int i = 0; i < signalClasses.Count; i++ ) - cw.WriteLine( "class {0};", GetSignalHookClassName( (Class)signalClasses[i] ) ); - cw.WriteLine();*/ - for ( int i = 0; i < signalClasses.Count; i++ ) WriteSignalsHook( (Class)signalClasses[i], true ); --- 1321,1324 ---- *************** *** 1374,1378 **** if ( parameters.Length > 0 ) parameters = ", " + parameters; ! cw.Write( "(*{0}{1}Hook)({2}*", m.UniqueName, c.Name, GetSignalHookClassName(c) ); cw.Write( parameters ); cw.WriteLine( ");" ); --- 1399,1404 ---- if ( parameters.Length > 0 ) parameters = ", " + parameters; ! //cw.Write( "(*{0}{1}Hook)({2}*", m.UniqueName, c.Name, GetSignalHookClassName(c) ); ! cw.Write( "(*{0}{1}Hook)(void* hookData", m.UniqueName, c.Name ); cw.Write( parameters ); cw.WriteLine( ");" ); *************** *** 1385,1389 **** --- 1411,1418 ---- cw.Indent++; foreach ( Method m in methods ) + { cw.WriteLine( "{0}Callback = 0;", m.UniqueName ); + cw.WriteLine( "{0}CallbackData = 0;", m.UniqueName ); + } cw.Indent--; cw.WriteLine( "}"); *************** *** 1392,1395 **** --- 1421,1425 ---- string signalName = m.UniqueName; cw.WriteLine( "{0}{1}Hook {0}Callback;", signalName, c.Name ); + cw.WriteLine( "void* {0}CallbackData;", signalName ); StringBuilder sb = new StringBuilder(); *************** *** 1400,1404 **** sb.Append( TypeReferenceToString( "", p.Type, ParameterStyle.CXXDeclaration, c ).Trim() ); } ! cw.WriteLine( "inline void set{0}({0}{1}Hook hook)", signalName, c.Name ); cw.WriteLine( "{" ); cw.Indent++; --- 1430,1435 ---- sb.Append( TypeReferenceToString( "", p.Type, ParameterStyle.CXXDeclaration, c ).Trim() ); } ! //cw.WriteLine( "inline void set{0}({0}{1}Hook hook)", signalName, c.Name ); ! cw.WriteLine( "inline void set{0}(void* hookData, {0}{1}Hook hook)", signalName, c.Name ); cw.WriteLine( "{" ); cw.Indent++; *************** *** 1406,1409 **** --- 1437,1443 ---- so we must typecast to (void*) and do the cast to (void**) in InstallSignalHook(). */ + //cw.WriteLine( "InstallSignalHook(&{2}Callback, (void*)hook, SIGNAL( {0}({1}) ), SLOT( {2}Slot({1}) ));", + // m.Name, sb.ToString(), signalName ); + cw.WriteLine( "{0}CallbackData = hookData;", signalName ); cw.WriteLine( "InstallSignalHook(&{2}Callback, (void*)hook, SIGNAL( {0}({1}) ), SLOT( {2}Slot({1}) ));", m.Name, sb.ToString(), signalName ); *************** *** 1422,1427 **** cw.Write( ParametersToString( m.GetParameters(), ParameterStyle.CXXDeclaration, c ) ); cw.Write( ") { " ); ! //cw.Write( "if( {0}Callback ) {0}Callback(this", signalName ); this "if" is not necessary because we connect only if hook != null ! cw.Write( "{0}Callback(this", signalName ); string parameters = ParametersToString( m.GetParameters(), ParameterStyle.CXXtoCXXInvocation, c ); if ( parameters.Length > 0 ) --- 1456,1461 ---- cw.Write( ParametersToString( m.GetParameters(), ParameterStyle.CXXDeclaration, c ) ); cw.Write( ") { " ); ! //cw.Write( "{0}Callback(this", signalName ); ! cw.Write( "{0}Callback({0}CallbackData ? {0}CallbackData : this", signalName ); string parameters = ParametersToString( m.GetParameters(), ParameterStyle.CXXtoCXXInvocation, c ); if ( parameters.Length > 0 ) *************** *** 1460,1466 **** // set functions ! cw.WriteLine( "void QTC_EXPORT {0}_set{1}({0}* instPtr, {0}::{1}{2}Hook hook) {{", GetSignalHookClassName(c), signalName, c.Name ); cw.Indent++; ! cw.WriteLine( "instPtr->set{0}(hook);", signalName ); cw.Indent--; cw.WriteLine( "}" ); --- 1494,1500 ---- // set functions ! cw.WriteLine( "void QTC_EXPORT {0}_set{1}({0}* instPtr, void* hookData, {0}::{1}{2}Hook hook) {{", GetSignalHookClassName(c), signalName, c.Name ); cw.Indent++; ! cw.WriteLine( "instPtr->set{0}(hookData, hook);", signalName ); cw.Indent--; cw.WriteLine( "}" ); |
From: Andreas H. <ah...@us...> - 2004-10-01 11:33:05
|
Update of /cvsroot/qtcsharp/Bugtussle/src/APILoader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15138/src/APILoader Modified Files: API.cs CGen.bdsproj Class.cs Parameter.cs Log Message: Update Index: Class.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Class.cs,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Class.cs 18 Sep 2004 08:54:31 -0000 1.49 --- Class.cs 1 Oct 2004 11:32:56 -0000 1.50 *************** *** 845,849 **** } ! /* Returns true if the type if a Class or a typedef to a Class. */ public static bool IsClass(TypeBase tb) { --- 845,873 ---- } ! ! /*! GetDefaultContructor() returns the constructor with no parameters. If ! there is none and @allowAlternative = true, it return the constructor ! with only one pointer/reference parameter. */ ! public Constructor GetDefaultContructor(bool allowAlternative) ! { ! Constructor altContructor = null; ! if ( Constructors.Count > 0 ) ! { ! foreach( Constructor ctr in Constructors ) ! { ! if ( ctr.Parameters.Length == 0 ) ! return ctr; ! else if ( ctr.Parameters.Length == 1 && ! ctr.Parameters[0].Type.Mode != PassByMode.Value ) ! altContructor = ctr; ! } ! } ! if ( altContructor == null && baseClasses.Count > 0 && baseClasses[0] != null ) ! return ((Class)baseClasses[0]).GetDefaultContructor(true); ! return altContructor; ! } ! ! ! /* Returns true if the type is a Class or a typedef to a Class. */ public static bool IsClass(TypeBase tb) { Index: CGen.bdsproj =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/CGen.bdsproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CGen.bdsproj 19 Sep 2004 22:32:49 -0000 1.6 --- CGen.bdsproj 1 Oct 2004 11:32:56 -0000 1.7 *************** *** 73,77 **** <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">z:\Bugtussle\src</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> --- 73,77 ---- <Options Name="Launcher" Type="String"></Options> <Options Name="UseLauncher" Type="Boolean">False</Options> ! <Options Name="DebugCWD" Type="String">z:\Qts\Bugtussle\src</Options> <Options Name="RemotePath" Type="String"></Options> <Options Name="RemoteHost" Type="String"></Options> *************** *** 88,97 **** </Options> </OptionsSet> ! </Options> ! <FileList> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> - <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.Data" AssemblyName="System.Data" Version="1.0.5000.0"/> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> <File FileName="AssemblyInfo.cs" ContainerId="CSharpCompiler" ModuleName="AssemblyInfo"/> --- 88,96 ---- </Options> </OptionsSet> ! </Options> ! <FileList> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System" AssemblyName="System" Version="1.0.5000.0"/> <File FileName="c:\windows\microsoft.net\framework\v1.1.4322\System.XML.dll" ContainerId="DotNetAssemblyCompiler" ModuleName="System.XML" AssemblyName="System.XML" Version="1.0.5000.0"/> <File FileName="AssemblyInfo.cs" ContainerId="CSharpCompiler" ModuleName="AssemblyInfo"/> Index: API.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/API.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** API.cs 18 Sep 2004 08:54:31 -0000 1.43 --- API.cs 1 Oct 2004 11:32:55 -0000 1.44 *************** *** 44,47 **** --- 44,48 ---- public readonly Hashtable ClassMemberIgnore = new Hashtable(); public readonly Hashtable ClassMemberIgnoreOverrride = new Hashtable(); + public readonly Hashtable ClassIgnoreOverrride = new Hashtable(); public readonly Hashtable ClassIgnore = new Hashtable(); public readonly StringCollection CIncludes = new StringCollection(); // "c:include" *************** *** 261,265 **** ClassMemberIgnore.Add( element.Attributes["name"].Value, element.ChildNodes ); if ( element.Attributes["ignoreoverride"] != null ) // used in Class.InitializeOverrideMethodLists() ! ClassMemberIgnoreOverrride.Add( element.Attributes["name"].Value, element.ChildNodes ); } else if ( element.Name == "csharp:define" ) // used in TypeReference.TypeReference() --- 262,271 ---- ClassMemberIgnore.Add( element.Attributes["name"].Value, element.ChildNodes ); if ( element.Attributes["ignoreoverride"] != null ) // used in Class.InitializeOverrideMethodLists() ! { ! if ( element.ChildNodes.Count == 0 ) ! ClassIgnoreOverrride.Add( element.Attributes["name"].Value, null ); ! else ! ClassMemberIgnoreOverrride.Add( element.Attributes["name"].Value, element.ChildNodes ); ! } } else if ( element.Name == "csharp:define" ) // used in TypeReference.TypeReference() *************** *** 680,684 **** return true; } ! } return false; } --- 686,691 ---- return true; } ! } else if ( ClassIgnoreOverrride.Contains(className) ) ! return true; return false; } Index: Parameter.cs =================================================================== RCS file: /cvsroot/qtcsharp/Bugtussle/src/APILoader/Parameter.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Parameter.cs 18 Aug 2004 09:11:50 -0000 1.12 --- Parameter.cs 1 Oct 2004 11:32:56 -0000 1.13 *************** *** 13,17 **** public class Parameter { ! public readonly TypeReference Type; private string name; public readonly string Default; --- 13,17 ---- public class Parameter { ! public TypeReference Type; private string name; public readonly string Default; |