diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
commit | bd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch) | |
tree | 7a520322212d48ebcb9fbe1087e7fca28b76185c /extensions/nsplugin/examples/trivial | |
download | qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip |
Add Qt3 development HEAD version
Diffstat (limited to 'extensions/nsplugin/examples/trivial')
-rw-r--r-- | extensions/nsplugin/examples/trivial/trivial.cpp | 67 | ||||
-rw-r--r-- | extensions/nsplugin/examples/trivial/trivial.def | 9 | ||||
-rw-r--r-- | extensions/nsplugin/examples/trivial/trivial.doc | 22 | ||||
-rw-r--r-- | extensions/nsplugin/examples/trivial/trivial.pro | 12 | ||||
-rw-r--r-- | extensions/nsplugin/examples/trivial/trivial.rc | 36 |
5 files changed, 146 insertions, 0 deletions
diff --git a/extensions/nsplugin/examples/trivial/trivial.cpp b/extensions/nsplugin/examples/trivial/trivial.cpp new file mode 100644 index 0000000..6db691d --- /dev/null +++ b/extensions/nsplugin/examples/trivial/trivial.cpp @@ -0,0 +1,67 @@ +// Qt stuff +#include "qnp.h" +#include <qpainter.h> +#include <qmessagebox.h> + +class Trivial : public QNPWidget { + Q_OBJECT +public: + void mouseReleaseEvent(QMouseEvent* event) + { + QMessageBox::aboutQt(this); + } + + void paintEvent(QPaintEvent* event) + { + QPainter p(this); + p.setClipRect(event->rect()); + int w = width(); + p.drawRect(rect()); + p.drawText(w/8, 0, w-w/4, height(), AlignCenter|WordBreak, "Trivial!"); + } +}; + +class TrivialInstance : public QNPInstance { + Q_OBJECT +public: + QNPWidget* newWindow() + { + return new Trivial; + } + + void print(QPainter* p) + { + p->drawText(0,0,"Hello"); + } +}; + +class TrivialPlugin : public QNPlugin { +public: + QNPInstance* newInstance() + { + return new TrivialInstance; + } + + const char* getMIMEDescription() const + { + return "trivial/very:xxx:Trivial and useless"; + } + + const char * getPluginNameString() const + { + return "Trivial Qt-based Plugin"; + } + + const char * getPluginDescriptionString() const + { + return "A Qt-based LiveConnected plug-in that does nothing"; + } + +}; + +QNPlugin* QNPlugin::create() +{ + return new TrivialPlugin; +} + +#include "trivial.moc" diff --git a/extensions/nsplugin/examples/trivial/trivial.def b/extensions/nsplugin/examples/trivial/trivial.def new file mode 100644 index 0000000..1732fc6 --- /dev/null +++ b/extensions/nsplugin/examples/trivial/trivial.def @@ -0,0 +1,9 @@ +LIBRARY nptrivial.dll + +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD SINGLE + +EXPORTS + NP_GetEntryPoints @1 + NP_Initialize @2 + NP_Shutdown @3 diff --git a/extensions/nsplugin/examples/trivial/trivial.doc b/extensions/nsplugin/examples/trivial/trivial.doc new file mode 100644 index 0000000..14325c9 --- /dev/null +++ b/extensions/nsplugin/examples/trivial/trivial.doc @@ -0,0 +1,22 @@ +/*! \page trivial-nsplugin-example.html + \ingroup nsplugin-examples + + \title Trivial Example + + This example is trivial, and thus useful for + investigating problems you might have installing the + extension. + + To build the example, you must first build the + \link netscape-plugin.html Qt Netscape Plugin Extension\endlink library. + Then type \c{make} in \c{extensions/nsplugin/examples/trivial/} + and copy the resulting \c{trivial.so} or \c{nptrivial.dll} + to the Plugins directory of your WWW browser. + + <EMBED TYPE=trivial/very WIDTH=100 HEIGHT=100> + + <hr> + Implementation: + + \include trivial/trivial.cpp +*/ diff --git a/extensions/nsplugin/examples/trivial/trivial.pro b/extensions/nsplugin/examples/trivial/trivial.pro new file mode 100644 index 0000000..d61bf78 --- /dev/null +++ b/extensions/nsplugin/examples/trivial/trivial.pro @@ -0,0 +1,12 @@ +TEMPLATE = lib +TARGET = trivial +win32:TARGET = nptrivial + +CONFIG += qt dll release +LIBS += -lqnp +unix:LIBS += -lXt + +HEADERS = +SOURCES = trivial.cpp +DEF_FILE = trivial.def +RC_FILE = trivial.rc diff --git a/extensions/nsplugin/examples/trivial/trivial.rc b/extensions/nsplugin/examples/trivial/trivial.rc new file mode 100644 index 0000000..481cf08 --- /dev/null +++ b/extensions/nsplugin/examples/trivial/trivial.rc @@ -0,0 +1,36 @@ + +1 VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Trolltech\0" + VALUE "FileDescription", "trivial\0" + VALUE "FileExtents", "xxx\0" + VALUE "FileOpenName", "Nothing (*.xxx)\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "trivial\0" + VALUE "LegalCopyright", "Copyright © 1997-2006 Trolltech ASA\0" + VALUE "MIMEType", "trivial/very\0" + VALUE "OriginalFilename", "trivial.dll\0" + VALUE "ProductName", "Trolltech trivial\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END |