[Kde-bindings] Qyoto: Linux build fixed

Steven Boswell II ulatekh at yahoo.com
Sun Jan 13 22:06:13 UTC 2013


OK, enclosed is my best attempt at a patch.  It gets Qyoto to build on Fedora Core 17, although I can't tell yet if it runs, because I have a zillion API changes to deal with in my project first.  But I diffed the generated bin/qyoto-qtcore.cs and bin/qyoto-qtgui.cs files, and they're identical except that now, the blacklisted classes are completely missing, instead of being partially created.  I didn't check the rest of the subprojects; I figured qtcore and qtgui were good enough torture tests. :-)

Please look at Translator.IsTypeSupported(), and decide whether it's sane, or if there's a better way to do this.  Also look at my lame hack to EnumGenerator.DefineEnums() to see if there's a better way to do that.

Eventually, if you decide to accept this patch, please credit its authorship to "sboswell", my username on kde.org -- it wouldn't let me use "ulatekh".

Finally...do the Qyoto assemblies show up for you in MonoDevelop?  They don't for me, although they seem to be in the GAC.

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 11:44 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 


    Makes sense. But even that doesn't explain why it works on my machine. Anyway, I'd gladly take a patch.

    Dimitar



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 7:58 PM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

Digging around the assemblygen source code, I see that Translator.CppToCSharp() is what uses the type-code-map to determine what should be excluded.  But it's only called for properties, signals, attributes, and methods -- there's nothing that cuts out the class in general.

Here's part of the output from assemblygen when run on qyoto-qtgui:

  |--Won't wrap method QX11EmbedContainer::QX11EmbedContainer()
  |--Won't wrap method QX11EmbedContainer::QX11EmbedContainer(QWidget*)
  |--Won't wrap method QX11EmbedContainer::error()
 const
 
 |--Conflicting names: method/classname: Error in class QX11EmbedContainer - keeping original method name
  |--Won't wrap method QX11EmbedContainer::error(QX11EmbedContainer::Error)
  |--Won't wrap method QX11EmbedContainer::x11Event(_XEvent*)
  |--Won't wrap method QX11EmbedWidget::QX11EmbedWidget()
  |--Won't wrap method QX11EmbedWidget::QX11EmbedWidget(QWidget*)
  |--Won't wrap method QX11EmbedWidget::error() const
  |--Conflicting names: method/classname: Error in class QX11EmbedWidget - keeping original method name
  |--Won't wrap method QX11EmbedWidget::error(QX11EmbedWidget::Error)
  |--Won't wrap method QX11EmbedWidget::x11Event(_XEvent*)

In the generated code, though, that leaves behind several components of the supposedly blacklisted classes, e.g. slots, overridden methods, static methods, etc.  Maybe that's why the class get included despite the blacklist?

So
 far, I'm thinking of adding a check for blacklisted classes near the top of the loop in Translator.Run(), but that's just a guess.

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 9:12 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 


    I see but it's not what I meant. I'm saying that this shouldn't happen because QX11EmbedContainer and QX11EmbedWidget shouldn't be generated in the first place. Anyway, I think I know where the problem is - in QyotoHooks.PostMembersHook the naming logic for signal events does not check for other members or nested types with the same name. I'll try fixing this (and reincluding QX11EmbedContainer and QX11EmbedWidget) within three days.

    Regards,
    Dimitar


________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: Dimitar Dobrev <dpldobrev at yahoo.com> 
Sent: Sunday, January 13, 2013 5:59 PM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

See the enclosed generated C# file.  At  line 179965, there's a definition of "public enum Error", and at line 179756, there's a definition of "public event Slot Error".  So it may have something to do with the way signals are mapped to C# events.

The original signal, defined in /usr/include/QtGui/qx11embed_x11.h, is called "error", i.e. "void error(QX11EmbedWidget::Error error);".  Perhaps it's a consequence of capitalization?


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 8:49 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

    

    No, they are not different. However, as I've written to Carlos Machado, I have no idea how this error happens. Both classes are blacklisted, by you, actually, 8 months ago, and I haven't had a problem since, and neither had you. Other that what I've advised him, I have unfortunately nothing else to offer for now.
    

    Dimitar


________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 5:41 PM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

Argh...freaking old repositories...

Now my build stops with the problem reported yesterday by Carlos Machado, namely:

qyoto-qtgui.cs(179965,21) : error CS0102: The type `QtGui.QX11EmbedContainer' already contains a definition for `Error'
qyoto-qtgui.cs(180222,21) : error CS0102: The type `QtGui.QX11EmbedWidget' already contains a definition for `Error'

I'm using latest smokegen (git://anongit.kde.org/smokegen) and smokeqt (git://anongit.kde.org/smokeqt), unless their repositories are different now too...

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 7:34 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

    

    Oh, I think I know what's going on here. Are you using http://gitorious.org/assemblygen/assemblygen? Because a few months ago with Arno's help the repository was moved back to KDE. Now https://projects.kde.org/projects/kde/kdebindings/csharp/assemblygen/repository/ is the place where all work is being done.Qyoto's page was updated back then to point to this new location.
    Arno, could you please delete the assemblygen repo at Gitorious? It's not just about the current confusion (if any) but in the future some search provider may lead people to it and they could think it's no longer supported.


    Dimitar



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: Dimitar Dobrev <dpldobrev at yahoo.com> 
Sent: Sunday, January 13, 2013 4:22 PM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

"CreateEscapedIdentifier" doesn't appear to exist anywhere in assemblygen's source code...?



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 7:20 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

I've been here, just busy with other projects...
new CSharpCodeProvider().CreateEscapedIdentifier("base") does indeed return "@base", so it doesn't appear to be a Mono bug.

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 5:00 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

    

    Hi, Steven,

    Long time no see. :)
    About this error, I think there may be some bug in the Mono you use because I completed the related functionality months ago. I use CodeDomProvider.CreateEscapedIdentifier to get a valid argument name. Could you create a small test like this:

    new CSharpCodeProvider().CreateEscapedIdentifier("base")
    
    and see if you get "@base". You could use the Mono's Compiler as a Service.

    Regards,
    Dimitar



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Sunday, January 13, 2013 6:31 AM
Subject: Re: [Kde-bindings] Qyoto: Linux build fixed
 

I just tried to build latest assemblygen-based Qyoto (after building and installing latest smokegen and smokeqt) on my Fedora Core 17 system, and got a compilation error while trying to build qyoto-qtcore.

The first offending line is in the assemblygen-created bin/qyoto-qtcore.cs, at line 8316:

public static QByteArray Number(int arg1, int base = 10) {

The problem is that "base" is a reserved word, but it's being used as a variable name.  The usual solution is to put "@" in front of the name, but I don't know where assemblygen deals with this issue.


This is with latest mono (which I built today too) and Qt 4.8.4 (installed from Fedora Core's yum repos).

Thanks in advance for any help with this!

Steven Boswell



________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Saturday, January 12, 2013 2:52 PM
Subject: [Kde-bindings] Qyoto: Linux build fixed
 

    

    The Qyoto Linux build is working again. Sorry about the delay.
    

    Regards,
    Dimitar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20130113/a1dafd0a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assemblygen-wontwrap.patch
Type: text/x-patch
Size: 6584 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20130113/a1dafd0a/attachment-0001.patch>


More information about the Kde-bindings mailing list