page = new QWebPage();
frame = page->mainFrame();
bridge = new ComingBridge(frame);
+ instpector = NULL;
//connect(page, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(attachBridge()));
}
IPage::~IPage() {
+ if(inspector != NULL){
+ delete inspector;
+ inspector = NULL;
+ }
delete page;
page = NULL;
}
return page->mainFrame()->contentsSize();
}
+void IPage::showInspector(int show) {
+ if(show != 0){
+ if(inspector == NULL){
+ inspector = new QWebInspector();
+ inspector->setPage(this);
+ }
+
+ inspector->show();
+ } else {
+ if(inspector != NULL){
+ inspector->hide();
+ }
+ }
+}
+
void IPage::loadFinished() {
((flag == 0)? callbacks0:callbacks1).push(new LoadFinishedCallback(browserId, true));
}
#include <ComingBridge.h>
#include <QtGui>
#include <QtWebKitWidgets>
+#include <QWebInspector>
typedef struct {
int width, height;
QWebPage *page;
QWebFrame *frame;
ComingBridge *bridge;
+ QWebInspector *inspector;
private:
QSize vpsize;
QWebSettings *settings = QWebSettings::globalSettings();
settings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
+ settings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
++newId;
IPage *page = new IPage(newId);
QCoreApplication::addLibraryPath(newPath);
env->ReleaseStringUTFChars(path, sz);
}
+
+/*
+ * Class: org_tizen_webuibuilder_browserwidget_showInspector
+ * Method: showInspector
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_tizen_webuibuilder_browserwidget_ImageBufferedBrowser_showInspector
+ (JNIEnv *env, jclass, jint browserId, jint show)
+{
+ browsers[browserId]->showInspector(show);
+}
+
JNIEXPORT void JNICALL Java_org_tizen_webuibuilder_browserwidget_ImageBufferedBrowser_addLibraryPath
(JNIEnv *env, jclass, jstring);
+/*
+ * Class: org_tizen_webuibuilder_browserwidget_showInspector
+ * Method: showInspector
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_tizen_webuibuilder_browserwidget_ImageBufferedBrowser_showInspector
+ (JNIEnv *env, jclass, jint, jint);
+
#ifdef __cplusplus
}
#endif
private static native Point getContentsSize(int browserId);
+ private static native Point showInspector(int browserId, int show);
+
private static Map<Integer, ImageBufferedBrowser> browsers;
private static Set<Integer> updated = new HashSet<Integer>();
private static int heartbeater;