+2004-09-27 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * lyx_gui.C (start): change comment
+ (start): use for_each instead of explicit loop
+
+ * GWorkArea.h: store shared_ptr in the Maps.
+
+ * GWorkArea.C (~ColorCache): delete
+ (getColor): adjust
+ (getXftColor): adjust
+ (cacheColor): adjust
+ (cacheXftColor): adjust
+ (clear): simplify
+
+ * GView.C (GView): use show_all() instead of explict loop
+
+ * GMathPanel.C (doBuild): ws change
+
2004-09-27 John Spray <spray_john@users.sourceforge.net>
* The Character dialog
{
add(name);
}
-
+
Gtk::TreeModelColumn<Glib::ustring> name;
};
listStore_ = Gtk::ListStore::create(listCols_);
functions_->set_model(listStore_);
functions_->append_column("Functions", listCol_);
-
+
listSel_ = functions_->get_selection();
listSel_->signal_changed().connect(
sigc::mem_fun(*this, &GMathPanel::onFunctionSelected));
// 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));
#include "funcrequest.h"
#include "LColor.h"
+using boost::shared_ptr;
+
using std::string;
namespace lyx {
ColorCache colorCache;
-ColorCache::~ColorCache()
-{
- clear();
-}
-
-
Gdk::Color * ColorCache::getColor(LColor_color clr)
{
MapIt it = cache_.find(clr);
- return it == cache_.end() ? 0 : it->second;
+ return it == cache_.end() ? 0 : it->second.get();
}
XftColor * ColorCache::getXftColor(LColor_color clr)
{
MapIt2 it = cache2_.find(clr);
- return it == cache2_.end() ? 0 : it->second;
+ return it == cache2_.end() ? 0 : it->second.get();
}
void ColorCache::cacheColor(LColor_color clr, Gdk::Color * gclr)
{
- cache_[clr] = gclr;
+ cache_[clr] = shared_ptr<Gdk::Color>(gclr);
}
void ColorCache::cacheXftColor(LColor_color clr, XftColor * xclr)
{
- cache2_[clr] = xclr;
+ cache2_[clr] = shared_ptr<XftColor>(xclr);
}
void ColorCache::clear()
{
- MapIt it = cache_.begin();
- for (; it != cache_.end(); ++it)
- delete it->second;
cache_.clear();
- MapIt2 it2 = cache2_.begin();
- for (; it2 != cache2_.end(); ++it2)
- delete it2->second;
cache2_.clear();
}
class ColorCache {
public:
- typedef std::map<LColor_color, Gdk::Color *> Map;
+ typedef std::map<LColor_color, boost::shared_ptr<Gdk::Color> > Map;
typedef Map::iterator MapIt;
- typedef std::map<LColor_color, XftColor *> Map2;
+ typedef std::map<LColor_color, boost::shared_ptr<XftColor> > Map2;
typedef Map2::iterator MapIt2;
- ~ColorCache();
Gdk::Color * getColor(LColor_color);
XftColor * getXftColor(LColor_color);
void cacheColor(LColor_color, Gdk::Color *);
view.show();
view.init();
- // FIXME: some code below needs moving
+ // FIXME: server code below needs moving
lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
lyxsocket = new LyXServerSocket(&view.getLyXFunc(),
os::slashify_path(os::getTmpDir() + "/lyxsocket"));
- std::vector<string>::const_iterator cit = files.begin();
- std::vector<string>::const_iterator end = files.end();
- for (; cit != end; ++cit)
- view.view()->loadLyXFile(*cit, true);
+ for_each(files.begin(), files.end(),
+ bind(&BufferView::loadLyXFile, view.view(), _1, true));
// handle the batch commands the user asked for
if (!batch.empty()) {