summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/extensions/nsplugin/examples/trivial
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commitdda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch)
tree7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/extensions/nsplugin/examples/trivial
parent6260b6178868c03aab1644bf93b0ef043654bdb0 (diff)
downloadexperimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz
experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/extensions/nsplugin/examples/trivial')
-rw-r--r--tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp67
-rw-r--r--tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.def9
-rw-r--r--tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.doc22
-rw-r--r--tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.pro12
-rw-r--r--tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.rc36
5 files changed, 146 insertions, 0 deletions
diff --git a/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp b/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.cpp
new file mode 100644
index 0000000..c1f1aed
--- /dev/null
+++ b/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/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.def b/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.def
new file mode 100644
index 0000000..1732fc6
--- /dev/null
+++ b/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/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.doc b/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.doc
new file mode 100644
index 0000000..14325c9
--- /dev/null
+++ b/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/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.pro b/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.pro
new file mode 100644
index 0000000..d61bf78
--- /dev/null
+++ b/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/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.rc b/tqtinterface/qt4/extensions/nsplugin/examples/trivial/trivial.rc
new file mode 100644
index 0000000..481cf08
--- /dev/null
+++ b/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