]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/GView.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / gtk / GView.C
index b9b22248a147fb20f2fd568f8b375df80869387a..742541afa31eeeb45e488b7b402f2120d3e0bb23 100644 (file)
@@ -9,18 +9,23 @@
  */
 
 #include <config.h>
-#include <gtkmm.h>
+
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
 
 #include "GView.h"
 #include "GMenubar.h"
 #include "GMiniBuffer.h"
-#include "GToolbar.h"
 
 #include "BufferView.h"
 #include "lyx_cb.h"
 #include "lyxfunc.h"
 #include "MenuBackend.h"
 
+#include "frontends/Toolbars.h"
+
 #include "support/filetools.h"
 
 #include <boost/bind.hpp>
@@ -29,6 +34,8 @@
 
 using std::string;
 
+namespace lyx {
+namespace frontend {
 
 namespace {
 
@@ -45,22 +52,22 @@ void add_el(Gtk::Box::BoxList & list, Gtk::Box & box, bool shrink)
 GView::GView()
 {
        // The physical store for the boxes making up the layout.
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::VBox));
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::HBox));
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::VBox));
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::HBox));
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::HBox));
-       box_store_.push_back(boost::shared_ptr<Gtk::Box>(new Gtk::HBox));
+       box_store_.push_back(BoxPtr(new Gtk::VBox));
+       box_store_.push_back(BoxPtr(new Gtk::HBox));
+       box_store_.push_back(BoxPtr(new Gtk::VBox));
+       box_store_.push_back(BoxPtr(new Gtk::HBox));
+       box_store_.push_back(BoxPtr(new Gtk::HBox));
+       box_store_.push_back(BoxPtr(new Gtk::HBox));
 
        // Lay them out correctly.
        add(top_box_);
 
-       Gtk::Box::BoxList & layout1 = top_box_.children();
+       Gtk::Box::BoxList & layout1 = top_box_.children();
        add_el(layout1, *box_store_[0], true);
-       add_el(layout1, *box_store_[1], true);
+       add_el(layout1, *box_store_[1], false);
        add_el(layout1, *box_store_[2], true);
 
-       Gtk::Box::BoxList & layout2 = box_store_[1]->children();
+       Gtk::Box::BoxList & layout2 = box_store_[1]->children();
        add_el(layout2, *box_store_[3], true);
        add_el(layout2, *box_store_[4], false);
        add_el(layout2, *box_store_[5], true);
@@ -73,28 +80,23 @@ GView::GView()
        box_map_[Right]  = box_store_[5];
 
        // Make all Boxes visible.
-       top_box_.show();
-       BoxStore::iterator it = box_store_.begin();
-       BoxStore::iterator const end = box_store_.end();
-       for (; it != end; ++it)
-               (*it)->show();
+       top_box_.show_all();
 
        // Define the components making up the window.
        menubar_.reset(new GMenubar(this, menubackend));
-       toolbar_.reset(new GToolbar(this, 0, 0));
-       toolbar_->init();
-       bufferview_.reset(new BufferView(this, 0, 0, 300, 300));
+       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::slot(*this, &GView::onFocusIn));
-       set_default_size(500, 550);
+       signal_focus_in_event().connect(sigc::mem_fun(*this, &GView::onFocusIn));
+       set_default_size(620, 550);
        // Make sure the buttons are disabled if needed.
-       updateToolbar();
+       updateToolbars();
        string const iconName =
-               lyx::support::LibFileSearch("images", "lyx", "xpm");
+               support::LibFileSearch("images", "lyx", "xpm");
        if (!iconName.empty())
                set_icon_from_file(iconName);
 }
@@ -173,3 +175,14 @@ void GView::clearMessage()
 {
        message(getLyXFunc().viewStatusMessage());
 }
+
+
+bool GView::hasFocus() const
+{
+       // No real implementation needed for now
+       return true;
+}
+
+
+} // namespace frontend
+} // namespace lyx