ginebra2/ChromeWidgetJSObject.h
changeset 6 1c3b8676e58c
parent 5 0f2326c2a325
--- a/ginebra2/ChromeWidgetJSObject.h	Wed Jun 23 17:59:43 2010 +0300
+++ b/ginebra2/ChromeWidgetJSObject.h	Tue Jul 06 14:03:49 2010 +0300
@@ -25,6 +25,7 @@
 #include <QObject>
 #include <QUrl>
 
+#include "ChromeLayout.h"
 #include "ChromeWidget.h"
 #include "ChromeEffect.h"
 
@@ -33,8 +34,6 @@
 
 namespace GVA {
 
-class ChromeWidget;
-
 /*!
  * \defgroup JavascriptAPI Javascript API objects.
  * All classes in this group provide Javascript API access to the underlying
@@ -61,9 +60,9 @@
   ChromeWidgetJSObject(QObject *parent, ChromeWidget *chromeWidget);
 
 public slots:
-  int width() { return m_chromeWidget->width(); }
+  int width() { return m_chromeWidget->layout()->size().width(); }
   void alert(const QString & msg) { m_chromeWidget->alert(msg); }
-  qreal slideView(qreal delta) { return m_chromeWidget->slideView(delta); }
+  qreal slideView(qreal delta) { return m_chromeWidget->layout()->slideView(delta); }
   void chromeInitialized() { m_chromeWidget->chromeInitialized(); }
   void reloadChrome() { m_chromeWidget->reloadChrome(); }
   void loadUrlToCurrentPage(const QString & url) { m_chromeWidget->loadUrlToCurrentPage(url); }
@@ -89,7 +88,7 @@
   Q_PROPERTY(QObjectList snippets READ getSnippets)
 
   /// \brief Returns either "portrait" or "landscape".
-  QString getDisplayMode() const { return m_chromeWidget->getDisplayMode(); }
+  QString getDisplayMode() const { return m_chromeWidget->layout()->getDisplayMode(); }
   Q_PROPERTY(QString displayMode READ getDisplayMode)
 
   QObject* getDisplaySize() const { return m_chromeWidget->getDisplaySize(); }