diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial')
5 files changed, 146 insertions, 0 deletions
diff --git a/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp new file mode 100644 index 000000000..c1f1aed7c --- /dev/null +++ b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp @@ -0,0 +1,67 @@ +// TQt stuff +#include "tqnp.h" +#include <tqpainter.h> +#include <tqmessagebox.h> + +class Trivial : public TQNPWidget { + TQ_OBJECT +public: + void mouseReleaseEvent(TQMouseEvent* event) + { + TQMessageBox::aboutTQt(this); + } + + void paintEvent(TQPaintEvent* event) + { + TQPainter 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 TQNPInstance { + TQ_OBJECT +public: + TQNPWidget* newWindow() + { + return new Trivial; + } + + void print(TQPainter* p) + { + p->drawText(0,0,"Hello"); + } +}; + +class TrivialPlugin : public TQNPlugin { +public: + TQNPInstance* newInstance() + { + return new TrivialInstance; + } + + const char* getMIMEDescription() const + { + return "trivial/very:xxx:Trivial and useless"; + } + + const char * getPluginNameString() const + { + return "Trivial TQt-based Plugin"; + } + + const char * getPluginDescriptionString() const + { + return "A TQt-based LiveConnected plug-in that does nothing"; + } + +}; + +TQNPlugin* TQNPlugin::create() +{ + return new TrivialPlugin; +} + +#include "trivial.tqmoc" diff --git a/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.def b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.def new file mode 100644 index 000000000..1732fc67c --- /dev/null +++ b/experimental/tqtinterface/qt4/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/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.doc b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.doc new file mode 100644 index 000000000..14325c9ea --- /dev/null +++ b/experimental/tqtinterface/qt4/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/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.pro b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.pro new file mode 100644 index 000000000..d61bf7830 --- /dev/null +++ b/experimental/tqtinterface/qt4/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/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.rc b/experimental/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.rc new file mode 100644 index 000000000..481cf0878 --- /dev/null +++ b/experimental/tqtinterface/qt4/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 |