]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/GView.C
make it compile again
[lyx.git] / src / frontends / gtk / GView.C
index b975a81b4b215e938a45accbac79d258ff2cbccd..dae159db6a2f9c853f5bc74e0eb1be3a54e95f16 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "GView.h"
 #include "GMenubar.h"
+#include "GToolbar.h"
 #include "GMiniBuffer.h"
 
 #include "BufferView.h"
@@ -32,6 +33,7 @@
 #include "funcrequest.h"
 
 #include "frontends/Toolbars.h"
+#include "frontends/WorkArea.h"
 
 #include "support/filetools.h"
 #include "support/convert.h"
@@ -57,7 +59,7 @@ void add_el(Gtk::Box::BoxList & list, Gtk::Box & box, bool shrink)
 } // namespace anon
 
 
-GView::GView()
+GView::GView() : LyXView()
 {
        // The physical store for the boxes making up the layout.
        box_store_.push_back(BoxPtr(new Gtk::VBox));
@@ -93,12 +95,10 @@ GView::GView()
        // Define the components making up the window.
        menubar_.reset(new GMenubar(this, menubackend));
        getToolbars().init();
-       bufferview_.reset(new BufferView(this, 300, 300));
        minibuffer_.reset(new GMiniBuffer(this, *controlcommand_));
 
        focus_command_buffer.connect(
                boost::bind(&GMiniBuffer::editMode, minibuffer_.get()));
-       view_state_changed.connect(boost::bind(&GView::showViewState, this));
        signal_focus_in_event().connect(sigc::mem_fun(*this, &GView::onFocusIn));
        //
        int width = 750;
@@ -119,7 +119,7 @@ GView::GView()
        }
        set_default_size(width, height);
        // Make sure the buttons are disabled if needed.
-       updateToolbars();
+       //updateToolbars();
        string const iconName =
                support::libFileSearch("images", "lyx", "xpm");
        if (!iconName.empty())
@@ -143,10 +143,10 @@ bool GView::on_delete_event(GdkEventAny * /*event*/)
        Gtk::Requisition req = workArea_->size_request();
        LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(req.width));
        LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(req.height));
-       // trigger LFUN_QUIT instead of quit directly
-       // since LFUN_QUIT may have more cleanup stuff
+       // trigger LFUN_LYX_QUIT instead of quit directly
+       // since LFUN_LYX_QUIT may have more cleanup stuff
        //
-       getLyXFunc().dispatch(FuncRequest(LFUN_QUIT));
+       getLyXFunc().dispatch(FuncRequest(LFUN_LYX_QUIT));
        return true;
 }
 
@@ -160,7 +160,9 @@ bool GView::onFocusIn(GdkEventFocus * /*event*/)
 
 void GView::prohibitInput() const
 {
-       view()->hideCursor();
+       // FIXME: Why is prohibitInput const?
+       // FIXME: hideCursor is protected
+       //const_cast<GView*>(this)->workArea()->hideCursor();
        const_cast<GView*>(this)->set_sensitive(false);
 }
 
@@ -171,28 +173,30 @@ void GView::allowInput() const
 }
 
 
-void GView::message(string const & msg)
+void GView::message(docstring const & msg)
 {
-       minibuffer_->message(msg);
+       minibuffer_->message(lyx::to_utf8(msg));
 }
 
 
-void GView::showViewState()
+void GView::updateStatusBar()
 {
-       message(getLyXFunc().viewStatusMessage());
+       message(lyx::from_utf8(getLyXFunc().viewStatusMessage()));
 }
 
 
-void GView::setWindowTitle(string const & t, string const & /*it*/)
+void GView::setWindowTitle(docstring const & t, docstring const & /*it*/)
 {
-       set_title(Glib::locale_to_utf8(t));
+       set_title(lyx::to_utf8(t));
 }
 
 
 void GView::busy(bool yes) const
 {
-       if (yes ) {
-               view()->hideCursor();
+       // FIXME: Why is busy const?
+       if (yes) {
+               // FIXME: hideCursor is protected
+               //const_cast<GView*>(this)->workArea()->hideCursor();
                Gdk::Cursor cursor(Gdk::WATCH);
                const_cast<GView *>(this)->get_window()->set_cursor(cursor);
                const_cast<GView *>(this)->set_sensitive(false);
@@ -205,7 +209,7 @@ void GView::busy(bool yes) const
 
 void GView::clearMessage()
 {
-       message(getLyXFunc().viewStatusMessage());
+       message(lyx::from_utf8(getLyXFunc().viewStatusMessage()));
 }
 
 
@@ -216,5 +220,10 @@ bool GView::hasFocus() const
 }
 
 
+Toolbars::ToolbarPtr GView::makeToolbar(ToolbarBackend::Toolbar const & tbb)
+{
+       return make_toolbar(tbb, *this);
+}
+
 } // namespace frontend
 } // namespace lyx