summaryrefslogtreecommitdiffstats
path: root/qwidgethostnative.h
diff options
context:
space:
mode:
Diffstat (limited to 'qwidgethostnative.h')
-rw-r--r--qwidgethostnative.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/qwidgethostnative.h b/qwidgethostnative.h
new file mode 100644
index 0000000..e753b75
--- /dev/null
+++ b/qwidgethostnative.h
@@ -0,0 +1,34 @@
+#ifndef QWIDGETHOSTNATIVE_H
+#define QWIDGETHOSTNATIVE_H
+
+#include <QtGui>
+
+#if defined(QT_JAMBI_RUN)
+# define QWIDGETHOSTNATIVE_BASECLASS QWidget
+#elif defined(Q_OS_WIN32)
+# include "qwinwidget.h"
+# define QWIDGETHOSTNATIVE_BASECLASS QWinWidget
+#else
+# include <QtGui/QX11EmbedWidget>
+# define QWIDGETHOSTNATIVE_BASECLASS QX11EmbedWidget
+#endif
+
+#include <jni.h>
+
+class QWidgetHostNative: public QWIDGETHOSTNATIVE_BASECLASS
+{
+public:
+ QWidgetHostNative(jobject parentWindow);
+
+protected:
+ void childEvent(QChildEvent *e);
+ bool eventFilter(QObject *o, QEvent *e);
+ void focusInEvent(QFocusEvent *e);
+ bool event(QEvent *);
+ void resizeEvent(QResizeEvent *);
+
+private:
+ WId getWindowHandle(jobject window);
+};
+
+#endif