HTTP/1.1 -1 Read error in cache disk data: SuccessContent-Type: text/plain
Last-Modified: Tue, 10 Mar 2009 13:15:47 GMT
ETag: "43cee-2311-464c38c97c6c0"
Content-length: 8977
Connection: Close
Proxy-Connection: Close
X-Cache: HIT from web1.osuosl.org
Server: ProxyTrack 0.5 (HTTrack 3.49.2)

Index: CREDITS
===================================================================
--- CREDITS	(revision 37268)
+++ CREDITS	(working copy)
@@ -901,6 +901,7 @@
 U: ujwalic
 E: ujwalic@gmail.com
 D: OpenGL/GLUT include file order with MSVS
+D: Updated Qt/NCI example for Windows
 
 N: Uri Guttman
 D: Lot of general Parrot design hints
Index: examples/nci/QtHelloWorld.pasm
===================================================================
--- examples/nci/QtHelloWorld.pasm	(revision 37268)
+++ examples/nci/QtHelloWorld.pasm	(working copy)
@@ -11,12 +11,12 @@
 
 =head1 DESCRIPTION
 
-Sample "Hello World" with Qt, via Parrot Native Call Interface (nci). See
+Sample "Hello World" with Qt, via Parrot Native Call Interface (NCI). See
 F<docs/pdds/pdd03_calling_conventions.pod>.
 
-Qt is a multiplatform C++ GUI application framework
-(Lhttp://doc.trolltech.com/3.1/aboutqt.html>). You'll need to build
-F<libPQt.so> and install it in F<runtime/parrot/dynext> for this to
+Qt – A cross-platform application and UI framework
+(L<http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt>). You'll need to build
+F<libPQt.so> or F<PQt.dll> and install it in F<runtime/parrot/dynext> for this to
 work, see F<examples/nci/PQt.C> for more information.
 
 Note that this will either need JIT for building the NCI-functions on
@@ -35,30 +35,24 @@
     set P2, P5  # remember pApp
 
 # get and invoke QLabel_new
-    set S5, "Hello, world!"
     dlfunc P0, P1, "QLabel_new", "pt"
     # if you need more labels, save P0 = QLabel_new() function
+    set_args "0", "Hello, world!"
+    get_results "0", P5
     invokecc P0
     set P6, P5  # save pLabel
 
 # size the QLabel
-    set I5, 30  # y
-    set I6, 120 # x
     dlfunc P0, P1, "QLabel_resize", "vpii"
+    set_args "0,0,0", P6, 120, 30
     invokecc P0
 
-# register the label
-    dlfunc P0, P1, "QApplication_setMainWidget", "vpp"
-    set P5, P6  # pLabel
-    set P6, P2  # pApp
-    invokecc P0
-    # P5  = label
     dlfunc P0, P1, "QLabel_show", "vp"
     invokecc P0
 
 # and go
     dlfunc P0, P1,"QApplication_exec", "vp"
-    set P5, P2  # app
+    set_args "0", P2
     invokecc P0
     end
 
Index: examples/nci/PQt.C
===================================================================
--- examples/nci/PQt.C	(revision 37268)
+++ examples/nci/PQt.C	(working copy)
@@ -1,149 +0,0 @@
-/*
-
-# Copyright (C) 2001-2003, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-examples/nci/PQt.C - Qt/Parrot Library
-
-=head1 SYNOPSIS
-
-Compile with:
-
-    g++ -fPIC -I$QTDIR/include -L$QTDIR -c PQt.C
-
-    gcc -shared -o libPQt.so PQt.o $QTDIR/lib/libqt.so
-
-Or something like that...
-
-=head1 DESCRIPTION
-
-Qt Native interface for Parrot. See F<examples/nci/QtHelloWorld.pasm>
-for more information.
-
-=cut
-
-*/
-
-#include <qapplication.h>
-#include <qlabel.h>
-extern "C" {
-#include <stdio.h>
-#include <dlfcn.h>
-
-QApplication * pApp;
-
-/*
-
-=head2 QApplication bindings
-
-=over 4
-
-=item C<QApplication *QApplication_new(void)>
-
-=cut
-
-*/
-QApplication *QApplication_new(void) {
-    int PQtargc = 0;
-    char *PQtargv[2];
-    PQtargv[0] = "";
-    PQtargv[1] = NULL;
-    pApp = new QApplication(PQtargc, PQtargv);
-    return pApp;
-}
-
-/*
-
-=item C<void QApplication_exec(QApplication *app)>
-
-=cut
-
-*/
-
-void QApplication_exec(QApplication *app)
-{
-    app->exec();
-}
-
-/*
-
-=item C<void QApplication_setMainWidget(QApplication *app, QWidget *w)>
-
-=cut
-
-*/
-
-void QApplication_setMainWidget(QApplication *app, QWidget *w)
-{
-    app->setMainWidget(w);
-}
-
-/*
-
-=back
-
-=head2 QLabel bindings
-
-=over 4
-
-=item C<QLabel * QLabel_new(const char *txt)>
-
-=cut
-
-*/
-
-QLabel * QLabel_new(const char *txt)
-{
-    QLabel * pLabel = new QLabel(txt, 0);
-    return pLabel;
-}
-
-/*
-
-=item C<void QLabel_show(QLabel *label)>
-
-=cut
-
-*/
-
-void QLabel_show(QLabel *label)
-{
-    label->show();
-}
-
-/*
-
-=item C<void QLabel_resize(QLabel *label, int x, int y)>
-
-=cut
-
-*/
-
-void QLabel_resize(QLabel *label, int x, int y)
-{
-    label->resize(x, y);
-}
-
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<examples/nci/QtHelloWorld.pasm>,
-F<docs/pdds/pdd03_calling_conventions.pod>.
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Index: examples/nci/PQt.cpp
===================================================================
--- examples/nci/PQt.cpp	(revision 0)
+++ examples/nci/PQt.cpp	(revision 0)
@@ -0,0 +1,151 @@
+/*
+
+# Copyright (C) 2001-2003, Parrot Foundation.
+# $Id: PQt.C 37201 2009-03-08 12:07:48Z fperrad $
+
+=head1 NAME
+
+examples/nci/PQt.cpp - Qt/Parrot Library
+
+=head1 SYNOPSIS
+
+Compile with:
+
+*NIX:
+
+    $ g++ -fPIC -I$QTDIR/include -L$QTDIR -c PQt.cpp
+
+    $ gcc -shared -o libPQt.so PQt.o $QTDIR/lib/libqt.so
+
+Windows:
+
+    > "%VS90COMNTOOLS%\vsvars32.bat"
+
+    > set INCLUDE=%QTDIR%\include;%QTDIR%\include\QtGui;%INCLUDE%
+    
+    > set LIB=%QTDIR%\lib;%LIB%
+
+    > cl /LD PQt.cpp QtGui4.lib QtCore4.lib
+
+Or something like that...
+
+=head1 DESCRIPTION
+
+Qt Native interface for Parrot. See F<examples/nci/QtHelloWorld.pir>
+for more information.
+
+=cut
+
+*/
+
+#ifdef _WIN32
+  #define PQT_API __declspec(dllexport)
+#else
+  #define PQT_API 
+#endif
+
+#include <QtGui>
+extern "C" {
+
+PQT_API QApplication * pApp;
+
+/*
+
+=head2 QApplication bindings
+
+=over 4
+
+=item C<QApplication *QApplication_new(void)>
+
+=cut
+
+*/
+PQT_API QApplication *QApplication_new(void) {
+    int PQtargc = 0;
+    char *PQtargv[2];
+    PQtargv[0] = "";
+    PQtargv[1] = NULL;
+    pApp = new QApplication(PQtargc, PQtargv);
+    return pApp;
+}
+
+/*
+
+=item C<void QApplication_exec(QApplication *app)>
+
+=cut
+
+*/
+
+PQT_API void QApplication_exec(QApplication *app)
+{
+    app->exec();
+}
+
+/*
+
+=back
+
+=head2 QLabel bindings
+
+=over 4
+
+=item C<QLabel * QLabel_new(const char *txt)>
+
+=cut
+
+*/
+
+PQT_API QLabel * QLabel_new(const char *txt)
+{
+    QLabel * pLabel = new QLabel(txt, 0);
+    return pLabel;
+}
+
+/*
+
+=item C<void QLabel_show(QLabel *label)>
+
+=cut
+
+*/
+
+PQT_API void QLabel_show(QLabel *label)
+{
+    label->show();
+}
+
+/*
+
+=item C<void QLabel_resize(QLabel *label, int x, int y)>
+
+=cut
+
+*/
+
+PQT_API void QLabel_resize(QLabel *label, int x, int y)
+{
+    label->resize(x, y);
+}
+
+}
+
+/*
+
+=back
+
+=head1 SEE ALSO
+
+F<examples/nci/QtHelloWorld.pir>,
+F<docs/pdds/pdd03_calling_conventions.pod>.
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Index: examples/nci/QtHelloWorld.pir
===================================================================
--- examples/nci/QtHelloWorld.pir	(revision 0)
+++ examples/nci/QtHelloWorld.pir	(revision 0)
@@ -0,0 +1,69 @@
+# Copyright (C) 2001-2003, Parrot Foundation.
+# $Id: QtHelloWorld.pasm 37201 2009-03-08 12:07:48Z fperrad $
+
+=head1 NAME
+
+examples/nci/QtHelloWorld.pir - Qt Example
+
+=head1 SYNOPSIS
+
+    % ./parrot examples/nci/QtHelloWorld.pir
+
+=head1 DESCRIPTION
+
+Sample "Hello World" with Qt, via Parrot Native Call Interface (NCI). See
+F<docs/pdds/pdd03_calling_conventions.pod>.
+
+Qt – A cross-platform application and UI framework
+(L<http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt>). You'll need to build
+F<libPQt.so> or F<PQt.dll> and install it in F<runtime/parrot/dynext> for this to
+work, see F<examples/nci/PQt.C> for more information.
+
+Note that this will either need JIT for building the NCI-functions on
+the fly. If this is not available try adding missing signatures to
+F<src/call_list.txt> and rebuilding Parrot.
+
+=cut
+.sub main
+    
+    .local pmc libpqt
+    loadlib libpqt, "libPQt"
+    if libpqt goto loaded
+
+  failed:
+    .local string message
+    message  = 'Install PQt.dll or libPQt.so into runtime/parrot/dynext'
+    die message
+
+  loaded:
+    print "Loaded\n"
+
+    .local pmc QApplication_new, pApp
+    dlfunc QApplication_new, libpqt, "QApplication_new", "pv"
+    pApp = QApplication_new()
+
+    .local pmc QLabel_new, pLabel
+    .local string caption
+    caption = "Hello, world!"
+    dlfunc QLabel_new, libpqt, "QLabel_new", "pt"
+    pLabel = QLabel_new(caption)
+
+    .local pmc QLabel_resize
+    dlfunc QLabel_resize, libpqt, "QLabel_resize", "vpii"
+    QLabel_resize(pLabel, 120, 30)
+
+    .local pmc QLabel_show
+    dlfunc QLabel_show, libpqt, "QLabel_show", "vp"
+    QLabel_show(pLabel)
+
+    .local pmc QApplication_exec
+    dlfunc QApplication_exec, libpqt,"QApplication_exec", "vp"
+    QApplication_exec(pApp)
+
+.end
+
+=head1 SEE ALSO
+
+F<examples/nci/PQt.C>, F<docs/pdds/pdd03_calling_conventions.pod>.
+
+=cut
... (new)">#369</em> (Change to Parrot::Configure::Compiler causes uninitialized value warning ...) created
                by <span class="author">jkeenan</span>
              </a>
            </dt>
            <dd class="newticket">
           