[Kde-bindings] A sample of our subset of QtC
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sat Jan 11 11:26:47 UTC 2003
On Friday 10 January 2003 8:20 pm, Adam Treat wrote:
> Richard,
>
> I just wanted to show you an example of our subset of QtC. This only
> includes the ctors at the moment (not the virtuals) but the important piece
> is the typedef ;) The inclusion of the typedefs in the xml metadata really
> increases the amount of ctors/methods in QtC.
I'm not quite sure what problem you are solving here. What does that
'managedObject' instance variable do - why not just return an instance of
QApplicationGlue and use that? I don't convert any of the methods with HANDLE
and 'Display *' types because they're X11 specific, and I'm only interested
in a cross platform api (in java anyway).
'QApplication *' is a C++ type, and I wouldn't have thought you could bracket
it within an extern "C" {.. } block as you've done below.
-- Richard
>
> #include "qapplication.h"
> class QApplicationGlue: public QApplication
> {
> public:
>
> void* managedObject;
> QApplicationGlue (Display* dpy, HANDLE visual, HANDLE cmap):
> QApplication ((Display*)dpy, (HANDLE)visual, (HANDLE)cmap) {}
> QApplicationGlue (Display* dpy, int argc, char** argv, HANDLE
> visual, HANDLE cmap): QApplication ((Display*)dpy, (int)argc, (char**)argv,
> (HANDLE)visual, (HANDLE)cmap) {}
> QApplicationGlue (int& argc, char* * argv): QApplication (argc,
> argv) {}
> QApplicationGlue (int& argc, char** argv, bool GUIenabled):
> QApplication ((int&)argc, (char**)argv, (bool)GUIenabled) {}
> QApplicationGlue (int& argc, char** argv, QApplication::Type arg1):
> QApplication ((int&)argc, (char**)argv, (QApplication::Type)arg1) {}
> };
>
> extern "C"
> {
> typedef unsigned long HANDLE;
> QApplication* new_QApplication3 (void* managedPtr, Display* dpy,
> HANDLE visual, HANDLE cmap)
> {
> QApplicationGlue* glue = new QApplicationGlue
> ((Display*)dpy, (HANDLE)visual, (HANDLE)cmap);
> glue->managedObject = managedPtr;
> return (QApplication*)glue;
> }
>
> QApplication* new_QApplication4 (void* managedPtr, Display* dpy,
> int argc, char** argv, HANDLE visual, HANDLE cmap)
> {
> QApplicationGlue* glue = new QApplicationGlue
> ((Display*)dpy, (int)argc, (char**)argv, (HANDLE)visual, (HANDLE)cmap);
> glue->managedObject = managedPtr;
> return (QApplication*)glue;
> }
>
> QApplication* new_QApplication0 (void* managedPtr, int& argc,
> char** argv)
> //void new_QApplication0 (void* managedPtr, int& argc, char** argv)
> {
> QApplicationGlue* glue = new QApplicationGlue (argc, argv);
> //glue->managedObject = managedPtr;
> return (QApplication*)glue;
> }
>
> QApplication* new_QApplication1 (void* managedPtr, int& argc,
> char** argv, bool GUIenabled)
> {
> QApplicationGlue* glue = new QApplicationGlue ((int&)argc,
> (char**)argv, (bool)GUIenabled);
> glue->managedObject = managedPtr;
> return (QApplication*)glue;
> }
>
> QApplication* new_QApplication2 (void* managedPtr, int& argc,
> char** argv, QApplication::Type arg1)
> {
> QApplicationGlue* glue = new QApplicationGlue ((int&)argc,
> (char**)argv, (QApplication::Type)arg1);
> glue->managedObject = managedPtr;
> return (QApplication*)glue;
> }
>
> } // extern "C"
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-bindings
More information about the Kde-bindings
mailing list