Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to import non-QFace types #83

Open
jacky309 opened this issue Jan 10, 2019 · 3 comments
Open

Add possibility to import non-QFace types #83

jacky309 opened this issue Jan 10, 2019 · 3 comments
Milestone

Comments

@jacky309
Copy link
Contributor

Sometimes it would be convenient to define QFace interfaces which use external types which are not described with QFace.
For example, if a C++ class called "MyClass" is defined in the namespace called "MyNamespace", it could be imported and used in a QFace file:

module mymodule 1.0

import interface MyNamespace.MyClass

interface MyInterface {
readonly MyNamespace.MyClass myPropertyOfNativeType
}

As far as the QFace Python object model is concerned, an imported interface could be provided as an "Interface" object (just like any "normal" interface), but with a new "imported" property set to true.

@jryannel
Copy link
Collaborator

Could this also be solved using code fences? E.g target source code embedded into the IDL?

@jryannel
Copy link
Collaborator

Maybe sth like this:

external {
    interface MyModule.MyInterface
    interface MyModule.MyInterface2
    struct MyModule.MyStruct
    enum MyModule.MyStruct
}

interface MyInterface {
    readonly MyModule.MyInterface myPropertyOfNativeType
}

The declared external symbols are like type declarations (interface, struct, enum, flag) and then can be used as such in the interface.

@jryannel
Copy link
Collaborator

This would also require to use code fences to ensure headers are included.

include cpp {
  #include <myinterface.h>
}

Where include followed by a scope name and inside the brackets the code to be included as is. {,} need to be escaped with \{, \}.

@jryannel jryannel added this to the Cleanup milestone Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants