#
Menu "file"
+ Item "New Window|W" "window-new"
Item "New|N" "buffer-new"
Item "New from Template...|m" "buffer-new-template"
Item "Open...|O" "file-open"
{ LFUN_MOUSE_TRIPLE, "", ReadOnly },
{ LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop },
{ LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop },
+ { LFUN_WINDOW_NEW, "window-new", NoBuffer },
{ LFUN_NOACTION, "", Noop }
};
data_.clear();
}
+ bool const empty() const
+ {
+ return data_.empty();
+ }
+
void add(T const * thing, int x, int y)
{
data_[thing] = Point(x, y);
void GuiWorkArea::update(int x, int y, int w, int h)
{
- viewport()->update(x, y, w, h);
+ viewport()->repaint(x, y, w, h);
}
// 280
LFUN_INSET_DISSOLVE, // jspitzm 20060807
LFUN_CHANGE_NEXT,
+ LFUN_WINDOW_NEW, // Abdel 20062110
LFUN_LASTACTION // end of the table
};
void LyX::restoreGuiSession(vector<string> const & files)
+{
+ LyXView * view = newLyXView();
+
+ // load files
+ for_each(files.begin(), files.end(),
+ bind(&LyXView::loadLyXFile, view, _1, true));
+
+ // if a file is specified, I assume that user wants to edit *that* file
+ if (files.empty() && lyxrc.load_session) {
+ vector<string> const & lastopened = pimpl_->session_->lastOpenedFiles();
+ // do not add to the lastfile list since these files are restored from
+ // last seesion, and should be already there (regular files), or should
+ // not be added at all (help files).
+ for_each(lastopened.begin(), lastopened.end(),
+ bind(&LyXView::loadLyXFile, view, _1, false));
+ }
+ // clear this list to save a few bytes of RAM
+ pimpl_->session_->clearLastOpenedFiles();
+}
+
+
+LyXView * LyX::newLyXView()
{
// determine windows size and position, from lyxrc and/or session
// initial geometry
if (session().loadSessionInfo("WindowIsMaximized") == "yes")
maximize = true;
}
+
// if user wants to restore window position
int posx = -1;
int posy = -1;
LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize);
ref().addLyXView(view);
- // load files
- for_each(files.begin(), files.end(),
- bind(&LyXView::loadLyXFile, view, _1, true));
-
- // if a file is specified, I assume that user wants to edit *that* file
- if (files.empty() && lyxrc.load_session) {
- vector<string> const & lastopened = pimpl_->session_->lastOpenedFiles();
- // do not add to the lastfile list since these files are restored from
- // last seesion, and should be already there (regular files), or should
- // not be added at all (help files).
- for_each(lastopened.begin(), lastopened.end(),
- bind(&LyXView::loadLyXFile, view, _1, false));
- }
- // clear this list to save a few bytes of RAM
- pimpl_->session_->clearLastOpenedFiles();
+ return view;
}
-
/*
Signals and Windows
===================
kb_keymap & topLevelKeymap();
kb_keymap const & topLevelKeymap() const;
- void addLyXView(LyXView * lyxview);
+ LyXView * newLyXView();
/** redraw \c inset in all the BufferViews in which it is currently
* visible. If successful return a pointer to the owning Buffer.
/// Create a View and restore GUI Session.
void restoreGuiSession(std::vector<std::string> const & files);
+ ///
+ void addLyXView(LyXView * lyxview);
+
/// Initialize RC font for the GUI.
void initGuiFont();
case LFUN_LYXRC_APPLY:
case LFUN_BUFFER_NEXT:
case LFUN_BUFFER_PREVIOUS:
+ case LFUN_WINDOW_NEW:
// these are handled in our dispatch()
break;
break;
}
+ case LFUN_WINDOW_NEW:
+ BOOST_ASSERT(theApp);
+ LyX::ref().newLyXView();
+
default: {
view()->cursor().dispatch(cmd);
updateforce |= view()->cursor().result().update();
return 0;
}
+ int i=0;
+ InsetBase * inset2 = pars_[pit].getInset(pos - 1);
+ InsetBase * inset3 = pars_[pit].getInset(pos);
+ if (inset != pars_[pit].getInset(pos - 1))
+ {
+ i++;
+ std::cout << "pit " << pit
+ << " pos -1 " << pos - 1
+ << "\ninset " << inset
+ << "\ninset2 " << inset2
+ << endl;
+ }
+
+ if (inset != pars_[pit].getInset(pos))
+ {
+ i++;
+ std::cout << "pit " << pit
+ << " pos " << pos
+ << "\ninset " << inset
+ << "\ninset3 " << inset3
+ << endl;
+ }
+ if (i == 2)
+ std::cout << endl;
+
// This should be just before or just behind the
// cursor position set above.
- InsetBase * inset2 = pars_[pit].getInset(pos - 1);
- InsetBase * inset3 = pars_[pit].getInset(pos);
BOOST_ASSERT((pos != 0 && inset == inset2)
|| inset == inset3);