mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
some small changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9017 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
de8a7a9214
commit
fa371fa1eb
@ -1,3 +1,21 @@
|
||||
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
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
{
|
||||
add(name);
|
||||
}
|
||||
|
||||
|
||||
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ void GMathPanel::doBuild()
|
||||
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));
|
||||
|
@ -76,10 +76,7 @@ GView::GView()
|
||||
|
||||
// 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));
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include "funcrequest.h"
|
||||
#include "LColor.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace lyx {
|
||||
@ -27,47 +29,35 @@ namespace frontend {
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,10 @@ namespace frontend {
|
||||
|
||||
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 *);
|
||||
|
@ -336,16 +336,14 @@ void lyx_gui::start(string const & batch, std::vector<string> const & files)
|
||||
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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user