diff --git a/src/BufferView.C b/src/BufferView.C
index 6e169eb689..78b4b09d25 100644
--- a/src/BufferView.C
+++ b/src/BufferView.C
@@ -41,7 +41,7 @@ Buffer * BufferView::buffer() const
}
-LScreen & BufferView::screen() const
+LyXScreen & BufferView::screen() const
{
return pimpl_->screen();
}
diff --git a/src/BufferView.h b/src/BufferView.h
index f994f582cd..ef3072a889 100644
--- a/src/BufferView.h
+++ b/src/BufferView.h
@@ -25,7 +25,7 @@ class LyXView;
class LyXText;
class TeXErrors;
class Buffer;
-class LScreen;
+class LyXScreen;
class Language;
class Painter;
class UpdatableInset;
@@ -54,7 +54,7 @@ public:
///
Painter & painter() const;
///
- LScreen & screen() const;
+ LyXScreen & screen() const;
///
void buffer(Buffer * b);
///
diff --git a/src/BufferView2.C b/src/BufferView2.C
index 8022c299b6..7638b0435e 100644
--- a/src/BufferView2.C
+++ b/src/BufferView2.C
@@ -564,7 +564,7 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
locking_inset))
text->setCursor(this, cursor,
cursor.par(), cursor.pos() - 1);
- LScreen::Cursor_Shape shape = LScreen::BAR_SHAPE;
+ LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
LyXText * txt = getLyXText();
if (locking_inset->isTextInset() &&
locking_inset->lyxCode() != Inset::ERT_CODE &&
@@ -573,8 +573,8 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
|| txt->real_current_font.isVisibleRightToLeft()
!= buffer()->params.language->RightToLeft()))
shape = (txt->real_current_font.isVisibleRightToLeft())
- ? LScreen::REVERSED_L_SHAPE
- : LScreen::L_SHAPE;
+ ? LyXScreen::REVERSED_L_SHAPE
+ : LyXScreen::L_SHAPE;
y += cursor.iy() + theLockingInset()->insetInInsetY();
screen().showManualCursor(text, x, y, asc, desc,
shape);
@@ -594,7 +594,7 @@ bool BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
{
if (theLockingInset() && available()) {
y += text->cursor.iy() + theLockingInset()->insetInInsetY();
- if (screen().fitManualCursor(text, this, x, y, asc, desc)) {
+ if (screen().fitManualCursor(this, text, x, y, asc, desc)) {
updateScrollbar();
return true;
}
diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C
index 83696e9b15..e3804be66d 100644
--- a/src/BufferView_pimpl.C
+++ b/src/BufferView_pimpl.C
@@ -15,6 +15,8 @@
#include "BufferView_pimpl.h"
#include "frontends/WorkArea.h"
#include "frontends/screen.h"
+#include "frontends/LyXScreenFactory.h"
+#include "frontends/WorkAreaFactory.h"
#include "frontends/Dialogs.h"
#include "frontends/Alert.h"
#include "frontends/FileDialog.h"
@@ -117,25 +119,6 @@ namespace {
const unsigned int saved_positions_num = 20;
-inline
-void waitForX()
-{
- XSync(fl_get_display(), 0);
-}
-
-
-void SetXtermCursor(Window win)
-{
- static Cursor cursor;
- static bool cursor_undefined = true;
- if (cursor_undefined) {
- cursor = XCreateFontCursor(fl_get_display(), XC_xterm);
- XFlush(fl_get_display());
- cursor_undefined = false;
- }
- XDefineCursor(fl_get_display(), win, cursor);
- XFlush(fl_get_display());
-}
} // anon namespace
@@ -145,8 +128,8 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
: bv_(b), owner_(o), buffer_(0), cursor_timeout(400),
using_xterm_cursor(false)
{
- workarea_.reset(new WorkArea(xpos, ypos, width, height));
- screen_.reset(new LScreen(workarea()));
+ workarea_.reset(WorkAreaFactory::create(xpos, ypos, width, height));
+ screen_.reset(LyXScreenFactory::create(workarea()));
// Setup the signals
workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
@@ -182,7 +165,7 @@ WorkArea & BufferView::Pimpl::workarea() const
}
-LScreen & BufferView::Pimpl::screen() const
+LyXScreen & BufferView::Pimpl::screen() const
{
return *screen_.get();
}
@@ -408,7 +391,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
void BufferView::Pimpl::updateScreen()
{
// Regenerate the screen.
- screen().reset();
+ screen().redraw(bv_->text, bv_);
}
@@ -435,7 +418,6 @@ void BufferView::Pimpl::scrollDocView(int value)
screen().draw(bv_->text, bv_, value);
if (!lyxrc.cursor_follows_scrollbar) {
- waitForX();
return;
}
@@ -449,8 +431,6 @@ void BufferView::Pimpl::scrollDocView(int value)
vbt->setCursorFromCoordinates(bv_, 0, first);
else if (vbt->cursor.y() > last)
vbt->setCursorFromCoordinates(bv_, 0, last);
-
- waitForX();
}
@@ -470,7 +450,8 @@ int BufferView::Pimpl::scroll(long time)
}
-void BufferView::Pimpl::workAreaKeyPress(KeySym key, key_modifier::state state)
+void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
+ key_modifier::state state)
{
bv_->owner()->getLyXFunc()->processKeySym(key, state);
}
@@ -2545,7 +2526,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
LyXText * lt = bv_->getLyXText();
if (!lt->selection.set()) {
- if (owner_->getIntl()->getTrans().backspace()) {
+ if (owner_->getIntl()->getTransManager().backspace()) {
lt->backspace(bv_);
lt->selection.cursor = lt->cursor;
update(lt,
@@ -2930,7 +2911,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
owner_->getLyXFunc()->handleKeyFunc(action);
} else {
owner_->getLyXFunc()->handleKeyFunc(action);
- owner_->getIntl()->getTrans()
+ owner_->getIntl()->getTransManager()
.TranslateAndInsert(argument[0], bv_->getLyXText());
update(bv_->getLyXText(),
BufferView::SELECT
@@ -2939,6 +2920,10 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
}
break;
+ case LFUN_MATH:
+ mathDispatch(bv_, argument);
+ break;
+
case LFUN_MATH_MACRO:
mathDispatchMathMacro(bv_, argument);
break;
@@ -3174,7 +3159,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
string::const_iterator cit = argument.begin();
string::const_iterator end = argument.end();
for (; cit != end; ++cit) {
- owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
+ owner_->getIntl()->getTransManager().
+ TranslateAndInsert(*cit, lt);
}
bv_->update(lt,
diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h
index b0a45d1461..4ae67509b3 100644
--- a/src/BufferView_pimpl.h
+++ b/src/BufferView_pimpl.h
@@ -15,6 +15,7 @@
#include "frontends/Timeout.h"
#include "frontends/key_state.h"
#include "frontends/mouse_state.h"
+#include "frontends/LyXKeySym.h"
#include "box.h"
#include "insets/insetspecialchar.h"
#include "support/types.h"
@@ -28,10 +29,7 @@
class LyXView;
class WorkArea;
-class LScreen;
-
-// FIXME: remove
-#include
+class LyXScreen;
///
struct BufferView::Pimpl : public boost::signals::trackable {
@@ -43,7 +41,7 @@ struct BufferView::Pimpl : public boost::signals::trackable {
/// return the work area for this bview
WorkArea & workarea() const;
/// return the screen for this bview
- LScreen & screen() const;
+ LyXScreen & screen() const;
///
void buffer(Buffer *);
///
@@ -79,7 +77,8 @@ struct BufferView::Pimpl : public boost::signals::trackable {
/// wheel mouse scroll
int scroll(long time);
///
- void workAreaKeyPress(KeySym key, key_modifier::state state);
+ void workAreaKeyPress(LyXKeySymPtr key,
+ key_modifier::state state);
///
void workAreaMotionNotify(int x, int y, mouse_button::state state);
///
@@ -172,7 +171,7 @@ private:
///
Buffer * buffer_;
///
- boost::scoped_ptr screen_;
+ boost::scoped_ptr screen_;
///
boost::scoped_ptr workarea_;
///
diff --git a/src/ChangeLog b/src/ChangeLog
index bc3b515175..772d27f183 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,39 @@
+2002-06-16
+
+ * BufferView_pimpl.C (Pimpl): Use WorkAreaFactory.
+ Got rid of FORMS_H_LOCATION include. Now we are
+ GUII.
+
+2002-06-15 LyX Development team
+
+ * buffer.[Ch] (sgmlOpenTag):
+ (sgmlCloseTag): Added support for avoiding pernicious mixed
+ content. Return number of lines written.
+
+ (makeLinuxDocFile):
+ (makeDocBookFile): Fixed calls to sgml*Tag.
+ Simple white space clean.
+
+ (simpleDocBookOnePar): Simple white space clean.
+
+ * tabular.[Ch] (docBook): Renamed to docbook and got another
+ argument to related with the pernicious mixed content.
+
+ (docbookRow): Fixed calls for docbook inset method.
+
+2002-06-15 Lyx Development team
+
+ * lyxfunc.[Ch]: Use LyXKeySym instead of KeySym,
+ so it's X11 independent.
+
+ * kb*.[Ch]: ditto.
+
+ * BufferView_pimpl.[Ch] (workAreaKeyPress): ditto.
+
+2002-06-15 Lyx Development team
+
+ * intl.h: Renamed getTrans to getTransManager.
+
2002-06-14 Angus Leeming
* Makefile.am: nuke forgotten stl_string_fwd.h.
diff --git a/src/LyXAction.C b/src/LyXAction.C
index ae804fb502..ca434957ff 100644
--- a/src/LyXAction.C
+++ b/src/LyXAction.C
@@ -280,6 +280,7 @@ void LyXAction::init()
{ LFUN_MARK_OFF, "mark-off", "", ReadOnly },
{ LFUN_MARK_ON, "mark-on", "", ReadOnly },
{ LFUN_SETMARK, "mark-toggle", "", ReadOnly },
+ { LFUN_MATH, "math", "", Noop },
{ LFUN_MATH_DELIM, "math-delim", "", Noop },
{ LFUN_MATH_DISPLAY, "math-display", "", Noop },
{ LFUN_GREEK, "math-greek", N_("Math Greek"), Noop },
diff --git a/src/buffer.C b/src/buffer.C
index 95912feaea..ef5cf08538 100644
--- a/src/buffer.C
+++ b/src/buffer.C
@@ -1713,7 +1713,7 @@ bool Buffer::readFile(LyXLex & lex, Paragraph * par)
} else if (file_format < 220) {
Alert::alert(_("ERROR!"),
_("Old LyX file format found. "
- "User LyX 1.2.x to read this!"));
+ "Use LyX 1.2.x to read this!"));
return false;
}
}
@@ -2749,21 +2749,35 @@ bool Buffer::isSGML() const
}
-void Buffer::sgmlOpenTag(ostream & os, Paragraph::depth_type,
+int Buffer::sgmlOpenTag(ostream & os, Paragraph::depth_type depth, bool mixcont,
string const & latexname) const
{
- if (!latexname.empty() && latexname != "!-- --")
- //os << "" << "<" << latexname << ">";
- os << "<" << latexname << ">";
+ if (!latexname.empty() && latexname != "!-- --") {
+ if (!mixcont)
+ os << string(" ",depth);
+ os << "<" << latexname << ">";
+ }
+
+ if (!mixcont)
+ os << endl;
+
+ return mixcont?0:1;
}
-void Buffer::sgmlCloseTag(ostream & os, Paragraph::depth_type,
+int Buffer::sgmlCloseTag(ostream & os, Paragraph::depth_type depth, bool mixcont,
string const & latexname) const
{
- if (!latexname.empty() && latexname != "!-- --")
- //os << "" << "" << latexname << ">\n";
+ if (!latexname.empty() && latexname != "!-- --") {
+ if (!mixcont)
+ os << endl << string(" ",depth);
os << "" << latexname << ">";
+ }
+
+ if (!mixcont)
+ os << endl;
+
+ return mixcont?0:1;
}
@@ -2803,12 +2817,12 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
ofs << ">\n\n";
if (params.options.empty())
- sgmlOpenTag(ofs, 0, top_element);
+ sgmlOpenTag(ofs, 0, false, top_element);
else {
string top = top_element;
top += " ";
top += params.options;
- sgmlOpenTag(ofs, 0, top);
+ sgmlOpenTag(ofs, 0, false, top);
}
}
@@ -2830,7 +2844,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::TOC_CODE) {
string const temp = "toc";
- sgmlOpenTag(ofs, depth, temp);
+ sgmlOpenTag(ofs, depth, false, temp);
par = par->next();
continue;
@@ -2839,7 +2853,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
// environment tag closing
for (; depth > par->params().depth(); --depth) {
- sgmlCloseTag(ofs, depth, environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, false, environment_stack[depth]);
environment_stack[depth].erase();
}
@@ -2848,14 +2862,14 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
case LATEX_PARAGRAPH:
if (depth == par->params().depth()
&& !environment_stack[depth].empty()) {
- sgmlCloseTag(ofs, depth, environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, false, environment_stack[depth]);
environment_stack[depth].erase();
if (depth)
--depth;
else
ofs << "
";
}
- sgmlOpenTag(ofs, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, false, style.latexname());
break;
case LATEX_COMMAND:
@@ -2865,21 +2879,19 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
" LatexType Command.\n"));
if (!environment_stack[depth].empty()) {
- sgmlCloseTag(ofs, depth,
- environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, false, environment_stack[depth]);
ofs << "";
}
environment_stack[depth].erase();
- sgmlOpenTag(ofs, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, false, style.latexname());
break;
case LATEX_ENVIRONMENT:
case LATEX_ITEM_ENVIRONMENT:
if (depth == par->params().depth()
&& environment_stack[depth] != style.latexname()) {
- sgmlCloseTag(ofs, depth,
- environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, false, environment_stack[depth]);
environment_stack[depth].erase();
}
if (depth < par->params().depth()) {
@@ -2888,9 +2900,9 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
}
if (environment_stack[depth] != style.latexname()) {
if (depth == 0) {
- sgmlOpenTag(ofs, depth, "p");
+ sgmlOpenTag(ofs, depth, false, "p");
}
- sgmlOpenTag(ofs, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, false, style.latexname());
if (environment_stack.size() == depth + 1)
environment_stack.push_back("!-- --");
@@ -2907,10 +2919,10 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
else
item_name = "item";
- sgmlOpenTag(ofs, depth + 1, item_name);
+ sgmlOpenTag(ofs, depth + 1, false, item_name);
break;
default:
- sgmlOpenTag(ofs, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, false, style.latexname());
break;
}
@@ -2929,18 +2941,18 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
ofs << "]]>";
break;
default:
- sgmlCloseTag(ofs, depth, style.latexname());
+ sgmlCloseTag(ofs, depth, false, style.latexname());
break;
}
}
// Close open tags
for (int i=depth; i >= 0; --i)
- sgmlCloseTag(ofs, depth, environment_stack[i]);
+ sgmlCloseTag(ofs, depth, false, environment_stack[i]);
if (!body_only) {
ofs << "\n\n";
- sgmlCloseTag(ofs, 0, top_element);
+ sgmlCloseTag(ofs, 0, false, top_element);
}
ofs.close();
@@ -3266,7 +3278,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
top += " ";
top += params.options;
}
- sgmlOpenTag(ofs, 0, top);
+ sgmlOpenTag(ofs, 0, false, top);
ofs << "\n";
@@ -3296,14 +3308,11 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
for (; depth > par->params().depth(); --depth) {
if (environment_inner[depth] != "!-- --") {
item_name = "listitem";
- sgmlCloseTag(ofs, command_depth + depth,
- item_name);
+ sgmlCloseTag(ofs, command_depth + depth, false, item_name);
if (environment_inner[depth] == "varlistentry")
- sgmlCloseTag(ofs, depth+command_depth,
- environment_inner[depth]);
+ sgmlCloseTag(ofs, depth+command_depth, false, environment_inner[depth]);
}
- sgmlCloseTag(ofs, depth + command_depth,
- environment_stack[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();
}
@@ -3313,16 +3322,12 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
&& !environment_stack[depth].empty()) {
if (environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(ofs, command_depth+depth,
- item_name);
+ sgmlCloseTag(ofs, command_depth+depth, false, item_name);
if (environment_inner[depth] == "varlistentry")
- sgmlCloseTag(ofs,
- depth + command_depth,
- environment_inner[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_inner[depth]);
}
- sgmlCloseTag(ofs, depth + command_depth,
- environment_stack[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();
@@ -3331,8 +3336,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
// Write opening SGML tags.
switch (style.latextype) {
case LATEX_PARAGRAPH:
- sgmlOpenTag(ofs, depth + command_depth,
- style.latexname());
+ sgmlOpenTag(ofs, depth + command_depth, false, style.latexname());
break;
case LATEX_COMMAND:
@@ -3352,14 +3356,14 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
if (cmd_depth < command_base) {
for (Paragraph::depth_type j = command_depth;
j >= command_base; --j) {
- sgmlCloseTag(ofs, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, false, command_stack[j]);
ofs << endl;
}
command_depth = command_base = cmd_depth;
} else if (cmd_depth <= command_depth) {
for (int j = command_depth;
j >= int(cmd_depth); --j) {
- sgmlCloseTag(ofs, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, false, command_stack[j]);
ofs << endl;
}
command_depth = cmd_depth;
@@ -3388,12 +3392,10 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
}
}
- sgmlOpenTag(ofs, depth + command_depth, command_name);
- if (c_params.empty())
- item_name = "title";
- else
- item_name = c_params;
- sgmlOpenTag(ofs, depth + 1 + command_depth, item_name);
+ sgmlOpenTag(ofs, depth + command_depth, false, command_name);
+
+ item_name = c_params.empty()?"title":c_params;
+ sgmlOpenTag(ofs, depth + 1 + command_depth, false, item_name);
break;
case LATEX_ENVIRONMENT:
@@ -3410,18 +3412,13 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
}
environment_stack[depth] = style.latexname();
environment_inner[depth] = "!-- --";
- sgmlOpenTag(ofs, depth + command_depth,
- environment_stack[depth]);
+ sgmlOpenTag(ofs, depth + command_depth, false, environment_stack[depth]);
} else {
if (environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(ofs,
- command_depth + depth,
- item_name);
+ sgmlCloseTag(ofs, command_depth + depth, false, item_name);
if (environment_inner[depth] == "varlistentry")
- sgmlCloseTag(ofs,
- depth + command_depth,
- environment_inner[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_inner[depth]);
}
}
@@ -3430,35 +3427,21 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
if (style.latexparam() == "CDATA")
ofs << "";
else
- sgmlCloseTag(ofs, depth + command_depth,
- style.latexparam());
+ sgmlCloseTag(ofs, depth + command_depth, false, style.latexparam());
}
break;
case LATEX_ITEM_ENVIRONMENT:
if (desc_on == 1) break;
end_tag= "para";
- sgmlCloseTag(ofs, depth + 1 + command_depth, end_tag);
+ sgmlCloseTag(ofs, depth + 1 + command_depth, false, end_tag);
break;
case LATEX_PARAGRAPH:
- sgmlCloseTag(ofs, depth + command_depth, style.latexname());
+ sgmlCloseTag(ofs, depth + command_depth, false, style.latexname());
break;
default:
- sgmlCloseTag(ofs, depth + command_depth, style.latexname());
+ sgmlCloseTag(ofs, depth + command_depth, false, style.latexname());
break;
}
}
@@ -3503,26 +3482,23 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
if (!environment_stack[depth].empty()) {
if (environment_inner[depth] != "!-- --") {
item_name = "listitem";
- sgmlCloseTag(ofs, command_depth + depth,
- item_name);
+ sgmlCloseTag(ofs, command_depth + depth, false, item_name);
if (environment_inner[depth] == "varlistentry")
- sgmlCloseTag(ofs, depth + command_depth,
- environment_inner[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_inner[depth]);
}
- sgmlCloseTag(ofs, depth + command_depth,
- environment_stack[depth]);
+ sgmlCloseTag(ofs, depth + command_depth, false, environment_stack[depth]);
}
}
for (int j = command_depth; j >= 0 ; --j)
if (!command_stack[j].empty()) {
- sgmlCloseTag(ofs, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, false, command_stack[j]);
ofs << endl;
}
ofs << "\n\n";
- sgmlCloseTag(ofs, 0, top_element);
+ sgmlCloseTag(ofs, 0, false, top_element);
ofs.close();
// How to check for successful close
@@ -3538,8 +3514,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
{
bool emph_flag = false;
- LyXLayout const & style =
- textclasslist[params.textclass][par->layout()];
+ LyXLayout const & style = textclasslist[params.textclass][par->layout()];
LyXFont font_old = style.labeltype == LABEL_MANUAL ? style.labelfont : style.font;
@@ -3577,7 +3552,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
if ( i || desc_on != 3) {
if(style.latexparam() == "CDATA")
os << "]]>";
- inset->docbook(this, os);
+ inset->docbook(this, os, false);
if(style.latexparam() == "CDATA")
os << "
+
+ * add a nother layer of inderection for calling gui specific
+ methods.
+ * guiapi.h: new file
+
+2002-06-16
+
+ * WorkArea.C: New file for GUII.
+
+ * WorkAreaFactory.h: New file for GUII.
+
+ * WorkArea.h: GUII stuff.
+
+2002-06-15 Lyx Development team
+
+ * LyXKeySymFactory.h: Added GUII factory for LyXKeySyms.
+
+ * LyXKeySym.[Ch]: Made the LyXKeySym class GUII.
+
+ * LyXKeySym.[Ch]: new LyXKeySym class for representing a
+ keypress. For now, X11 dependent.
+
+ * Makefile.am: Added LyXKeySym.
+
+2002-06-14 Lyx Development team
+
+ * LyXScreenFactory.h: New factory for creating the screen
+ object in the super GUII way.
+
+ * screen.h: Made LyXScreen an abstract base class for the
+ screen object.
+
+ * LyXView.h: Moved last_textclass_ member to Toolbar.C where it
+ belongs.
+
2002-06-12 John Levon
* Painter.h:
* Painter.C: s/PainterBase/Painter, remove dead code
-
+
2002-06-12 Angus Leeming
- * lyx_gui.h: remove trailing semi-colon after the brace closing
+ * lyx_gui.h: remove trailing semi-colon after the brace closing
the namespace.
2002-06-12 John Levon
@@ -13,15 +49,15 @@
* LyXView.h: cleanup
* LyXView.C: move init() here from xforms/
-
+
2002-06-12 John Levon
* screen.h:
* screen.C: change topCursorVisible() prototype
-
+
2002-06-12 Angus Leeming
- * font_metrics.h: remove trailing semi-colon after the brace closing
+ * font_metrics.h: remove trailing semi-colon after the brace closing
the namespace.
2002-06-12 John Levon
@@ -29,34 +65,34 @@
* GUIRunTime.h: remove in favour of ...
* Makefile.am:
- * lyx_gui.h: ... namespace for GUI start up
-
- * LyXView.h: remove init(),show(),setPosition()
-
+ * lyx_gui.h: ... namespace for GUI start up
+
+ * LyXView.h: remove init(),show(),setPosition()
+
2002-06-12 John Levon
* Menubar.C:
* Timeout.h:
* Toolbar.C:
* LyXView.h:
- * LyXView.C: some cleanup, prefer scoped_ptr
-
+ * LyXView.C: some cleanup, prefer scoped_ptr
+
2002-06-12 John Levon
* screen.C:
* Painter.C: use workHeight()
* WorkArea.h: remove confusing duplicate unused code
-
+
2002-06-12 John Levon
* screen.h:
* screen.C: rename, add reset()
-
+
2002-06-11 John Levon
* font_metrics.h: move X-specific stuff out of namespace
-
+
2002-06-07 Angus Leeming
Fixes needed to compile with Compaq cxx 6.5.
@@ -68,7 +104,7 @@
2002-05-31 John Levon
* Alert.h: better variable name
-
+
2002-05-29 Lars Gullik Bjønnes
* switch from SigC signals to boost::signals
diff --git a/src/frontends/Dialogs.C b/src/frontends/Dialogs.C
index 85d7611b11..01a67137ea 100644
--- a/src/frontends/Dialogs.C
+++ b/src/frontends/Dialogs.C
@@ -21,18 +21,296 @@
#endif
#include "Dialogs.h"
+
#include "support/LAssert.h"
+#include "guiapi.h"
+
// Signal enabling all visible dialogs to be redrawn if so desired.
// E.g., when the GUI colours have been remapped.
boost::signal0 Dialogs::redrawGUI;
+extern LyXView * dialogs_lyxview;
+
// toggle tooltips on/off in all dialogs.
boost::signal0 Dialogs::toggleTooltips;
-void Dialogs::add(DialogBase * ptr)
+void Dialogs::showAboutlyx()
{
- lyx::Assert(ptr);
- dialogs_.push_back(db_ptr(ptr));
+ gui_ShowAboutlyx(*dialogs_lyxview, *this);
}
+
+
+void Dialogs::showBibitem(InsetCommand * ic)
+{
+ gui_ShowBibitem(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showBibtex(InsetCommand * ic)
+{
+ gui_ShowBibtex(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showCharacter()
+{
+ gui_ShowCharacter(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::setUserFreeFont()
+{
+ gui_SetUserFreeFont(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showCitation(InsetCommand * ic)
+{
+ gui_ShowCitation(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::createCitation(string const & s)
+{
+ gui_CreateCitation(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showDocument()
+{
+ gui_ShowDocument(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showError(InsetError * ie)
+{
+ gui_ShowError(ie, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showERT(InsetERT * ie)
+{
+ gui_ShowERT(ie, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::updateERT(InsetERT * ie)
+{
+ gui_UpdateERT(ie, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showExternal(InsetExternal * ie)
+{
+ gui_ShowExternal(ie, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showFile(string const & f)
+{
+ gui_ShowFile(f, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showFloat(InsetFloat * ifl)
+{
+ gui_ShowFloat(ifl, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showForks()
+{
+ gui_ShowForks(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showGraphics(InsetGraphics * ig)
+{
+ gui_ShowGraphics(ig, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showInclude(InsetInclude * ii)
+{
+ gui_ShowInclude(ii, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showIndex(InsetCommand * ic)
+{
+ gui_ShowIndex(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::createIndex(string const & s)
+{
+ gui_CreateIndex(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showInfo(InsetInfo * /*ii*/)
+{
+#if 0
+ gui_ShowInfo(ii, *dialogs_lyxview, *this);
+#endif
+}
+
+
+void Dialogs::showLogFile()
+{
+ gui_ShowLogFile(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showMathPanel()
+{
+ gui_ShowMathPanel(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showMinipage(InsetMinipage * im)
+{
+ gui_ShowMinipage(im, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::updateMinipage(InsetMinipage * im)
+{
+ gui_UpdateMinipage(im, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showParagraph()
+{
+ gui_ShowParagraph(*dialogs_lyxview, *this);
+}
+
+void Dialogs::updateParagraph()
+{
+#if 0
+ gui_UpdateParagraph(*dialogs_lyxview, *this);
+#endif
+}
+
+
+void Dialogs::showPreamble()
+{
+ gui_ShowPreamble(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showPreferences()
+{
+ gui_ShowPreferences(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showPrint()
+{
+ gui_ShowPrint(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showRef(InsetCommand * ic)
+{
+ gui_ShowRef(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::createRef(string const & s)
+{
+ gui_CreateRef(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showSearch()
+{
+ gui_ShowSearch(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showSendto()
+{
+ gui_ShowSendto(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showSpellchecker()
+{
+ gui_ShowSpellchecker(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showSpellcheckerPreferences()
+{
+ gui_ShowSpellcheckerPreferences(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showTabular(InsetTabular * it)
+{
+ gui_ShowTabular(it, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::updateTabular(InsetTabular * it)
+{
+ gui_UpdateTabular(it, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showTabularCreate()
+{
+ gui_ShowTabularCreate(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showThesaurus(string const & s)
+{
+ gui_ShowThesaurus(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showTexinfo()
+{
+ gui_ShowTexinfo(*dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showTOC(InsetCommand * ic)
+{
+ gui_ShowTOC(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::createTOC(string const & s)
+{
+ gui_CreateTOC(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showUrl(InsetCommand * ic)
+{
+ gui_ShowUrl(ic, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::createUrl(string const & s)
+{
+ gui_CreateUrl(s, *dialogs_lyxview, *this);
+}
+
+
+void Dialogs::showVCLogFile()
+{
+ gui_ShowVCLogFile(*dialogs_lyxview, *this);
+}
+
+
+//void Dialogs::add(DialogBase * ptr)
+//{
+// lyx::Assert(ptr);
+// dialogs_.push_back(db_ptr(ptr));
+//}
diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h
index d9eb211d5f..fd32e5ea90 100644
--- a/src/frontends/Dialogs.h
+++ b/src/frontends/Dialogs.h
@@ -24,8 +24,6 @@
#include
#include
#include
-#include
-
#include
#ifdef __GNUG__
@@ -95,101 +93,101 @@ public:
Put into some sort of alphabetical order */
//@{
///
- boost::function showAboutlyx;
+ void showAboutlyx();
/// show the key and label of a bibliography entry
- boost::function showBibitem;
+ void showBibitem(InsetCommand * ic);
/// show the bibtex dialog
- boost::function showBibtex;
+ void showBibtex(InsetCommand * ic);
///
- boost::function showCharacter;
+ void showCharacter();
/// connected to the character dialog also
- boost::function setUserFreeFont;
+ void setUserFreeFont();
///
- boost::function showCitation;
+ void showCitation(InsetCommand *);
///
- boost::function createCitation;
+ void createCitation(string const &);
///
- boost::function showDocument;
+ void showDocument();
///
- boost::function showError;
+ void showError(InsetError *);
/// show the external inset dialog
- boost::function showExternal;
+ void showExternal(InsetExternal *);
/// show the contents of a file.
- boost::function showFile;
+ void showFile(string const &);
/// show all forked child processes
- boost::function showForks;
+ void showForks();
///
- boost::function showGraphics;
+ void showGraphics(InsetGraphics *);
/// show the details of a LyX file include inset
- boost::function showInclude;
+ void showInclude(InsetInclude *);
///
- boost::function showIndex;
+ void showIndex(InsetCommand *);
///
- boost::function createIndex;
+ void createIndex(string const &);
///
- boost::function showInfo;
+ void showInfo(InsetInfo *);
/// show the LaTeX log or build file
- boost::function showLogFile;
+ void showLogFile();
/// display the top-level maths panel
- boost::function showMathPanel;
+ void showMathPanel();
///
- boost::function showMinipage;
+ void showMinipage(InsetMinipage *);
///
- boost::function updateMinipage;
+ void updateMinipage(InsetMinipage *);
///
- boost::function showERT;
+ void showERT(InsetERT *);
///
- boost::function updateERT;
+ void updateERT(InsetERT *);
///
- boost::function showFloat;
+ void showFloat(InsetFloat *);
///
- boost::function showParagraph;
+ void showParagraph();
///
- boost::signal0 updateParagraph;
+ void updateParagraph();
///
- boost::function showPreamble;
+ void showPreamble();
///
- boost::function showPreferences;
+ void showPreferences();
///
- boost::function showPrint;
+ void showPrint();
///
- boost::function showRef;
+ void showRef(InsetCommand *);
///
- boost::function createRef;
+ void createRef(string const &);
///
- boost::function showSearch;
+ void showSearch();
///
- boost::function showSendto;
+ void showSendto();
/// bring up the spellchecker
- boost::function showSpellchecker;
+ void showSpellchecker();
/// bring up the spellchecker tab in preferences
- boost::function showSpellcheckerPreferences;
+ void showSpellcheckerPreferences();
///
- boost::function showTabular;
+ void showTabular(InsetTabular *);
///
- boost::function updateTabular;
+ void updateTabular(InsetTabular *);
///
- boost::function showTabularCreate;
+ void showTabularCreate();
/// show the TexInfo
- boost::function showTexinfo;
+ void showTexinfo();
/// show the thesaurus dialog
- boost::function showThesaurus;
+ void showThesaurus(string const &);
///
- boost::function showTOC;
+ void showTOC(InsetCommand *);
///
- boost::function createTOC;
+ void createTOC(string const &);
///
- boost::function showUrl;
+ void showUrl(InsetCommand *);
///
- boost::function createUrl;
+ void createUrl(string const &);
/// show the version control log
- boost::function showVCLogFile;
+ void showVCLogFile();
//@}
private:
/// Add a dialog to the vector of dialogs.
- void add(DialogBase *);
+ //void add(DialogBase *);
/// the dialogs being managed
- std::vector dialogs_;
+ //std::vector dialogs_;
};
#endif
diff --git a/src/frontends/LyXKeySym.C b/src/frontends/LyXKeySym.C
new file mode 100644
index 0000000000..4e24684491
--- /dev/null
+++ b/src/frontends/LyXKeySym.C
@@ -0,0 +1,15 @@
+/**
+ * \file LyXKeySym.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger and Juergen
+ */
+
+#include
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "LyXKeySym.h"
diff --git a/src/frontends/LyXKeySym.h b/src/frontends/LyXKeySym.h
new file mode 100644
index 0000000000..c003e5ab7a
--- /dev/null
+++ b/src/frontends/LyXKeySym.h
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+/**
+ * \file LyXKeySym.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger and Juergen
+ */
+
+#ifndef LYXKEYSYM_H
+#define LYXKEYSYM_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "LString.h"
+#include
+
+/**
+ * This is a base class for representing a keypress.
+ * Each frontend has to implement this to provide
+ * the functionality that LyX needs in regards to
+ * key presses.
+ */
+class LyXKeySym {
+public:
+ LyXKeySym() {}
+
+ virtual ~LyXKeySym() {}
+
+ /// Initialize with the name of a key. F. ex. "space" or "a"
+ virtual void init(string const & symbolname) = 0;
+
+ /// Is this a valid key?
+ virtual bool isOK() const = 0;
+
+ /// Is this a modifier key only?
+ virtual bool isModifier() const = 0;
+
+ /// What is the symbolic name of this key? F.ex. "Return" or "c"
+ virtual string getSymbolName() const = 0;
+
+ /**
+ * Return the value of the keysym into the local ISO encoding.
+ * This converts the LyXKeySym to a 8-bit encoded character.
+ * This relies on user to use the right encoding.
+ */
+ virtual char getISOEncoded() const = 0;
+
+ /**
+ * We need to be able to equality compare these for the
+ * sake of the keymap business.
+ */
+ virtual bool operator==(LyXKeySym const & k) const = 0;
+};
+
+typedef boost::shared_ptr LyXKeySymPtr;
+
+#endif
diff --git a/src/frontends/LyXKeySymFactory.h b/src/frontends/LyXKeySymFactory.h
new file mode 100644
index 0000000000..5bff157105
--- /dev/null
+++ b/src/frontends/LyXKeySymFactory.h
@@ -0,0 +1,22 @@
+/**
+ * \file LyXKeySymFactory.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger & Juergen
+ */
+
+#ifndef LYXKEYSYMFACTORY_H
+#define LYXKEYSYMFACTORY_H
+
+class LyXKeySym;
+
+namespace LyXKeySymFactory {
+ /**
+ * Make a LyXKeySym. Used because we want to
+ * generate a toolkit-specific instance.
+ */
+ LyXKeySym * create();
+}
+
+#endif // LYXKEYSYM_FACTORY_H
diff --git a/src/frontends/LyXScreenFactory.h b/src/frontends/LyXScreenFactory.h
new file mode 100644
index 0000000000..880f2cd3b6
--- /dev/null
+++ b/src/frontends/LyXScreenFactory.h
@@ -0,0 +1,23 @@
+/**
+ * \file LyXScreenFactory.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon
+ */
+
+#ifndef LYXSCREENFACTORY_H
+#define LYXSCREENFACTORY_H
+
+class WorkArea;
+class LyXScreen;
+
+namespace LyXScreenFactory {
+ /**
+ * Make a screen renderer. Used because we want to
+ * generate a toolkit-specific instance.
+ */
+ LyXScreen * create(WorkArea & owner);
+}
+
+#endif // LYXSCREEN_FACTORY_H
diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C
index d8c4ee1539..7daffc511a 100644
--- a/src/frontends/LyXView.C
+++ b/src/frontends/LyXView.C
@@ -66,8 +66,6 @@ LyXView::~LyXView()
void LyXView::init()
{
- // Set the textclass choice
- invalidateLayoutChoice();
updateLayoutChoice();
updateMenubar();
@@ -182,12 +180,6 @@ void LyXView::resetAutosaveTimer()
}
-void LyXView::invalidateLayoutChoice()
-{
- last_textclass_ = -1;
-}
-
-
void LyXView::updateLayoutChoice()
{
// don't show any layouts without a buffer
@@ -197,12 +189,8 @@ void LyXView::updateLayoutChoice()
}
// update the layout display
- if (last_textclass_ != int(buffer()->params.textclass)) {
- toolbar_->updateLayoutList(true);
- last_textclass_ = int(buffer()->params.textclass);
- current_layout = textclasslist[last_textclass_].defaultLayoutName();
- } else {
- toolbar_->updateLayoutList(false);
+ if (toolbar_->updateLayoutList(buffer()->params.textclass)) {
+ current_layout = textclasslist[buffer()->params.textclass].defaultLayoutName();
}
string const & layout =
diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h
index bf8388a3a4..fcf4187011 100644
--- a/src/frontends/LyXView.h
+++ b/src/frontends/LyXView.h
@@ -55,7 +55,11 @@ public:
virtual ~LyXView();
- /// FIXME: what is the requirement for this be to separate from the ctor ?
+ /**
+ * This is called after the concrete view has been created.
+ * We have to have the toolbar and the other stuff created
+ * before we can populate it with this call.
+ */
void init();
/// start modal operation
@@ -111,7 +115,7 @@ public:
void messagePop();
/// show state (font etc.) in minibuffer
void showState();
-
+
/// updates the title of the window
void updateWindowTitle();
@@ -138,9 +142,6 @@ protected:
/// called on timeout
void autoSave();
- /// FIXME: GUII - toolbar property
- void invalidateLayoutChoice();
-
private:
/**
* setWindowTitle - set title of window
@@ -153,15 +154,6 @@ private:
boost::scoped_ptr lyxfunc_;
/// dialogs for this view
boost::scoped_ptr dialogs_;
-
- /**
- * The last textclass layout list in the layout choice selector
- * This should probably be moved to the toolbar, but for now it's
- * here. (Asger)
- *
- * FIXME: GUII
- */
- int last_textclass_;
};
#endif // LYXVIEW_H
diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am
index b586297be1..0dc1e8e019 100644
--- a/src/frontends/Makefile.am
+++ b/src/frontends/Makefile.am
@@ -23,6 +23,12 @@ libfrontends_la_SOURCES = \
FileDialog.h \
Liason.C \
Liason.h \
+ LyXKeySym.C \
+ LyXKeySym.h \
+ LyXKeySymFactory.h \
+ LyXScreenFactory.h \
+ LyXView.C \
+ LyXView.h \
Menubar.C \
Menubar.h \
Painter.C \
@@ -31,11 +37,12 @@ libfrontends_la_SOURCES = \
Timeout.h \
Toolbar.C \
Toolbar.h \
- LyXView.C \
- LyXView.h \
+ WorkArea.C \
WorkArea.h \
+ WorkAreaFactory.h \
font_loader.h \
font_metrics.h \
+ guiapi.h \
key_state.h \
lyx_gui.h \
mouse_state.h \
diff --git a/src/frontends/Toolbar.C b/src/frontends/Toolbar.C
index f564c534df..bfe845a638 100644
--- a/src/frontends/Toolbar.C
+++ b/src/frontends/Toolbar.C
@@ -23,6 +23,7 @@ extern LyXAction lyxaction;
Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
+ : last_textclass_(-1)
{
pimpl_ = new Pimpl(o, x, y);
@@ -75,9 +76,17 @@ void Toolbar::setLayout(string const & layout)
}
-void Toolbar::updateLayoutList(bool force)
+bool Toolbar::updateLayoutList(int textclass)
{
- pimpl_->updateLayoutList(force);
+ // update the layout display
+ if (last_textclass_ != textclass) {
+ pimpl_->updateLayoutList(true);
+ last_textclass_ = textclass;
+ return true;
+ } else {
+ pimpl_->updateLayoutList(false);
+ return false;
+ }
}
diff --git a/src/frontends/Toolbar.h b/src/frontends/Toolbar.h
index 3ef7dcb85a..3558f73121 100644
--- a/src/frontends/Toolbar.h
+++ b/src/frontends/Toolbar.h
@@ -55,8 +55,11 @@ public:
/// update the layout combox
void setLayout(string const & layout);
- /// Populate the layout combox; re-do everything if force is true.
- void updateLayoutList(bool force);
+ /**
+ * Populate the layout combox - returns whether we did a full
+ * update or not
+ */
+ bool updateLayoutList(int textclass);
/// Drop down the layout list
void openLayoutList();
/// Erase the layout list
@@ -69,5 +72,10 @@ private:
friend struct Toolbar::Pimpl;
///
Pimpl * pimpl_;
+
+ /**
+ * The last textclass layout list in the layout choice selector
+ */
+ int last_textclass_;
};
#endif
diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C
new file mode 100644
index 0000000000..70ae7bebf0
--- /dev/null
+++ b/src/frontends/WorkArea.C
@@ -0,0 +1,23 @@
+/**
+ * \file WorkArea.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger and Juergen
+ */
+
+#include
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "WorkArea.h"
+
+
+
+
+
+
+
+
diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h
index a3751bf52e..091318b0d6 100644
--- a/src/frontends/WorkArea.h
+++ b/src/frontends/WorkArea.h
@@ -1,2 +1,98 @@
-// temporary
-#include "frontends/xforms/XWorkArea.h"
+// -*- C++ -*-
+/**
+ * \file WorkArea.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author unknown
+ * \author John Levon
+ */
+
+#ifndef WORKAREA_H
+#define WORKAREA_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "frontends/Painter.h"
+#include "frontends/mouse_state.h"
+#include "frontends/key_state.h"
+#include "frontends/LyXKeySym.h"
+
+#include
+#include
+#include
+#include
+
+#include
+
+///
+class WorkArea {
+public:
+ ///
+ WorkArea() {}
+ ///
+ virtual ~WorkArea() {}
+ ///
+ virtual Painter & getPainter() = 0;
+ ///
+ virtual int workWidth() const = 0;
+ ///
+ virtual int workHeight() const = 0;
+ ///
+ virtual unsigned int width() const = 0;
+
+ ///
+ virtual int xpos() const = 0;
+ ///
+ virtual int ypos() const = 0;
+ ///
+ virtual void resize(int xpos, int ypos, int width, int height) = 0;
+ ///
+ virtual void redraw() const = 0;
+ ///
+ virtual void setFocus() const = 0;
+ ///
+ virtual bool hasFocus() const = 0;
+ ///
+ virtual bool visible() const = 0;
+ ///
+ virtual void greyOut() const = 0;
+ ///
+ virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
+
+ /// a selection exists
+ virtual void haveSelection(bool) const = 0;
+ ///
+ virtual string const getClipboard() const = 0;
+ ///
+ virtual void putClipboard(string const &) const = 0;
+ // Signals
+ ///
+ boost::signal0 workAreaExpose;
+ ///
+ boost::signal1 scrollDocView;
+ ///
+ boost::signal2 workAreaKeyPress;
+ ///
+ boost::signal3 workAreaButtonPress;
+ ///
+ boost::signal3 workAreaButtonRelease;
+ ///
+ boost::signal3 workAreaMotionNotify;
+ ///
+ boost::signal0 workAreaFocus;
+ ///
+ boost::signal0 workAreaUnfocus;
+ ///
+ boost::signal3 workAreaDoubleClick;
+ ///
+ boost::signal3 workAreaTripleClick;
+ /// emitted when an X client has requested our selection
+ boost::signal0 selectionRequested;
+ /// emitted when another X client has stolen our selection
+ boost::signal0 selectionLost;
+};
+
+#endif // WORKAREA_H
diff --git a/src/frontends/WorkAreaFactory.h b/src/frontends/WorkAreaFactory.h
new file mode 100644
index 0000000000..ce276bfe4c
--- /dev/null
+++ b/src/frontends/WorkAreaFactory.h
@@ -0,0 +1,22 @@
+/**
+ * \file WorkAreaFactory.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon
+ */
+
+#ifndef WORKAREAFACTORY_H
+#define WORKAREAFACTORY_H
+
+class WorkArea;
+
+namespace WorkAreaFactory {
+ /**
+ * Make a work area. Used because we want to generate
+ * a toolkit-specific instance.
+ */
+ WorkArea * create(int x, int y, int w, int h);
+}
+
+#endif // WORKAREA_FACTORY_H
diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog
index 0f31d13f40..9e3a53cd15 100644
--- a/src/frontends/controllers/ChangeLog
+++ b/src/frontends/controllers/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-16 Lars Gullik Bjønnes
+
+ * changes to simplify function setup, removal of a lot of includes.
+
2002-06-12 Angus Leeming
* ControlParagraph.[Ch]: forward declare ParagraphParameters.
@@ -7,11 +11,11 @@
* ControlInset.tmpl: add missing header file, ButtonControllerBase.h.
2002-06-11 Edwin Leuven
-
- * ControlParagraph.[Ch]: new paragraph controller
- * GUI.h: add new controller
- * Makefile.am: ditto
-
+
+ * ControlParagraph.[Ch]: new paragraph controller
+ * GUI.h: add new controller
+ * Makefile.am: ditto
+
2002-06-10 Lars Gullik Bjønnes
* GUI.h: do not include ButtonController.tmpl
diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C
index ddde313cfc..f7815b97cc 100644
--- a/src/frontends/controllers/ControlAboutlyx.C
+++ b/src/frontends/controllers/ControlAboutlyx.C
@@ -14,10 +14,7 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlAboutlyx.h"
-#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "Lsstream.h"
#include "BufferView.h"
@@ -25,17 +22,14 @@
#include "support/filetools.h" // FileSearch
#include "version.h"
-#include
-
// needed for the browser
extern string system_lyxdir;
extern string user_lyxdir;
+
ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
-{
- d_.showAboutlyx = boost::bind(&ControlAboutlyx::show, this);
-}
+{}
stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
@@ -65,21 +59,25 @@ stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
return ss;
}
+
string const ControlAboutlyx::getCopyright() const
{
return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
}
+
string const ControlAboutlyx::getLicense() const
{
return _("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.");
}
+
string const ControlAboutlyx::getDisclaimer() const
{
return _("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.");
}
+
string const ControlAboutlyx::getVersion() const
{
stringstream ss;
diff --git a/src/frontends/controllers/ControlBibitem.C b/src/frontends/controllers/ControlBibitem.C
index 04be99188c..288bfff455 100644
--- a/src/frontends/controllers/ControlBibitem.C
+++ b/src/frontends/controllers/ControlBibitem.C
@@ -19,23 +19,12 @@
#endif
#include "ControlBibitem.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
#include "BufferView.h"
-#include "frontends/LyXView.h"
-
-#include
-
-#include
ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d)
-{
- d_.showBibitem = boost::bind(&ControlBibitem::showInset, this, _1);
-}
+{}
void ControlBibitem::applyParamsToInset()
diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C
index 22927cae4e..43e7557cb3 100644
--- a/src/frontends/controllers/ControlBibtex.C
+++ b/src/frontends/controllers/ControlBibtex.C
@@ -19,11 +19,7 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlBibtex.h"
-#include "Dialogs.h"
-#include "buffer.h"
#include "BufferView.h"
#include "lyxrc.h"
#include "helper_funcs.h"
@@ -31,18 +27,13 @@
#include "frontends/LyXView.h"
-#include
-
-#include
-
using std::pair;
-using std::make_pair;
+
ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d)
-{
- d_.showBibtex = boost::bind(&ControlBibtex::showInset, this, _1);
-}
+{}
+
void ControlBibtex::applyParamsToInset()
{
diff --git a/src/frontends/controllers/ControlCharacter.C b/src/frontends/controllers/ControlCharacter.C
index f0e2e78901..a12534fe85 100644
--- a/src/frontends/controllers/ControlCharacter.C
+++ b/src/frontends/controllers/ControlCharacter.C
@@ -16,7 +16,6 @@
#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "buffer.h"
-#include "Dialogs.h"
#include "Liason.h"
#include "bufferview_funcs.h" // ToggleAndShow
#include "gettext.h"
@@ -25,21 +24,13 @@
#include "frontends/LyXView.h"
-#include
-
-#include
-
using Liason::setMinibuffer;
-using std::vector;
ControlCharacter::ControlCharacter(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
font_(0), toggleall_(false)
-{
- d_.showCharacter = boost::bind(&ControlCharacter::show, this);
- d_.setUserFreeFont = boost::bind(&ControlCharacter::apply, this);
-}
+{}
void ControlCharacter::setParams()
diff --git a/src/frontends/controllers/ControlCharacter.h b/src/frontends/controllers/ControlCharacter.h
index b8d3938849..108025de0a 100644
--- a/src/frontends/controllers/ControlCharacter.h
+++ b/src/frontends/controllers/ControlCharacter.h
@@ -61,9 +61,9 @@ public:
///
bool getToggleAll() const;
-private:
/// Get changed parameters and Dispatch them to the kernel.
virtual void apply();
+private:
/// set the params before show or update.
virtual void setParams();
diff --git a/src/frontends/controllers/ControlCitation.C b/src/frontends/controllers/ControlCitation.C
index 5af344ed4a..d1069ef90e 100644
--- a/src/frontends/controllers/ControlCitation.C
+++ b/src/frontends/controllers/ControlCitation.C
@@ -18,30 +18,16 @@
#endif
#include "ControlCitation.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "buffer.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
-
-#include
-
-#include
-
-using std::pair;
using std::vector;
+using std::pair;
vector ControlCitation::citeStyles_;
+
ControlCitation::ControlCitation(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d, LFUN_CITATION_INSERT)
-{
- // These are permanent connections so we won't bother
- // storing a copy because we won't be disconnecting.
- d_.showCitation = boost::bind(&ControlCitation::showInset, this, _1);
- d_.createCitation = boost::bind(&ControlCitation::createInset, this, _1);
-}
+{}
void ControlCitation::clearDaughterParams()
diff --git a/src/frontends/controllers/ControlDialog.tmpl b/src/frontends/controllers/ControlDialog.tmpl
index adfa9e424f..ff4151d581 100644
--- a/src/frontends/controllers/ControlDialog.tmpl
+++ b/src/frontends/controllers/ControlDialog.tmpl
@@ -72,4 +72,3 @@ void ControlDialog::hide()
disconnect();
view().hide();
}
-
diff --git a/src/frontends/controllers/ControlERT.C b/src/frontends/controllers/ControlERT.C
index 55a4ac2220..1125440686 100644
--- a/src/frontends/controllers/ControlERT.C
+++ b/src/frontends/controllers/ControlERT.C
@@ -17,31 +17,15 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlERT.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
-#include "buffer.h"
-#include "BufferView.h"
-
-#include
-
-using std::vector;
// sorry this is just a temporary hack we should include vspace.h! (Jug)
extern const char * stringFromUnit(int);
+
ControlERT::ControlERT(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showERT = boost::bind(&ControlERT::showInset, this, _1);
-
- // We could have an extra method updateInset that calls
- // view().update() rather than view().show(), but I don't see why
- // it is really needed.
- d_.updateERT = boost::bind(&ControlERT::showInset, this, _1);
-}
+{}
void ControlERT::applyParamsToInset()
@@ -65,6 +49,7 @@ ERTParams::ERTParams()
: status(InsetERT::Collapsed)
{}
+
ERTParams::ERTParams(InsetERT const & inset)
: status(inset.status())
{}
diff --git a/src/frontends/controllers/ControlError.C b/src/frontends/controllers/ControlError.C
index 412c6e6691..fd3918bc84 100644
--- a/src/frontends/controllers/ControlError.C
+++ b/src/frontends/controllers/ControlError.C
@@ -18,21 +18,12 @@
#endif
#include "ControlError.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
#include "insets/inseterror.h"
-#include "frontends/LyXView.h"
-
-#include
ControlError::ControlError(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showError = boost::bind(&ControlError::showInset, this, _1);
-}
+{}
string const ControlError::getParams(InsetError const & inset)
diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C
index 8436ef787e..7a5d3c36f9 100644
--- a/src/frontends/controllers/ControlExternal.C
+++ b/src/frontends/controllers/ControlExternal.C
@@ -19,35 +19,20 @@
#pragma implementation
#endif
-#include "BufferView.h"
-#include "ButtonControllerBase.h"
#include "ControlExternal.h"
-#include "Dialogs.h"
-#include "Liason.h"
-#include "frontends/LyXView.h"
-#include "ViewBase.h"
-#include "buffer.h"
-#include "frontends/Alert.h"
+#include "BufferView.h"
#include "gettext.h"
#include "helper_funcs.h"
#include "lyxrc.h"
#include "support/filetools.h"
-#include "support/lstrings.h"
-#include
-#include
-
-#include
#include
-using std::make_pair;
using std::vector;
ControlExternal::ControlExternal(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showExternal = boost::bind(&ControlExternal::showInset, this, _1);
-}
+{}
InsetExternal::Params const ControlExternal::getParams(string const &)
diff --git a/src/frontends/controllers/ControlFloat.C b/src/frontends/controllers/ControlFloat.C
index 2e8891a3c9..a04eb8dd48 100644
--- a/src/frontends/controllers/ControlFloat.C
+++ b/src/frontends/controllers/ControlFloat.C
@@ -16,30 +16,11 @@
#endif
#include "ControlFloat.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
-#include "BufferView.h"
-
-#include "insets/insetfloat.h"
-#include "frontends/LyXView.h"
-
-#include
-
-using std::vector;
ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
-
- // We could have an extra method updateInset that calls
- // view().update() rather than view().show(), but I don't see why
- // it is really needed.
- //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
-}
+{}
void ControlFloat::applyParamsToInset()
diff --git a/src/frontends/controllers/ControlForks.C b/src/frontends/controllers/ControlForks.C
index 962790f165..80f65f43f7 100644
--- a/src/frontends/controllers/ControlForks.C
+++ b/src/frontends/controllers/ControlForks.C
@@ -13,15 +13,12 @@
#endif
#include "ControlForks.h"
-#include "ButtonControllerBase.h"
#include "ViewBase.h"
#include "BufferView.h"
#include "frontends/LyXView.h"
#include "lyxfunc.h"
-#include "frontends/Dialogs.h"
-
#include "support/forkedcontr.h"
#include "support/lstrings.h"
@@ -32,9 +29,7 @@ using std::vector;
ControlForks::ControlForks(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
-{
- d_.showForks = boost::bind(&ControlForks::show, this);
-}
+{}
vector const ControlForks::getPIDs() const
diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C
index c43807c0cd..cb799c2f27 100644
--- a/src/frontends/controllers/ControlGraphics.C
+++ b/src/frontends/controllers/ControlGraphics.C
@@ -18,8 +18,6 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlGraphics.h"
#include "helper_funcs.h"
@@ -42,13 +40,8 @@
#include "support/filetools.h"
#include "support/FileInfo.h"
-#include
-
-#include
-
using std::pair;
using std::make_pair;
-using std::ifstream;
using std::vector;
namespace {
@@ -103,9 +96,7 @@ string const xforms_pattern()
ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showGraphics = boost::bind(&ControlGraphics::showInset, this, _1);
-}
+{}
InsetGraphicsParams const ControlGraphics::getParams(string const &)
@@ -209,6 +200,7 @@ size_t const rorigin_size = sizeof(rorigin_lyx_strs) / sizeof(char *);
} // namespace anon
+
vector getRotationOriginData()
{
static vector data;
@@ -217,8 +209,8 @@ vector getRotationOriginData()
data.resize(rorigin_size);
for (lyx::size_type i = 0; i < rorigin_size; ++i) {
- data[i] = std::make_pair(_(rorigin_gui_strs[i]),
- rorigin_lyx_strs[i]);
+ data[i] = make_pair(_(rorigin_gui_strs[i]),
+ rorigin_lyx_strs[i]);
}
return data;
diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C
index 5c01ad3839..bc2f698920 100644
--- a/src/frontends/controllers/ControlInclude.C
+++ b/src/frontends/controllers/ControlInclude.C
@@ -9,19 +9,14 @@
*/
#include
-#include
#ifdef __GNUG__
#pragma implementation
#endif
#include "ControlInclude.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "buffer.h"
#include "Alert.h"
#include "BufferView.h"
-#include "Dialogs.h"
#include "lyxfunc.h"
#include "gettext.h"
#include "helper_funcs.h"
@@ -29,18 +24,14 @@
#include "support/filetools.h"
-#include "frontends/LyXView.h"
-
-#include
+#include
using std::pair;
-using std::make_pair;
+
ControlInclude::ControlInclude(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showInclude = boost::bind(&ControlInclude::showInset, this, _1);
-}
+{}
void ControlInclude::applyParamsToInset()
diff --git a/src/frontends/controllers/ControlIndex.C b/src/frontends/controllers/ControlIndex.C
index 6ed48c5b36..a74bea85fd 100644
--- a/src/frontends/controllers/ControlIndex.C
+++ b/src/frontends/controllers/ControlIndex.C
@@ -18,18 +18,8 @@
#endif
#include "ControlIndex.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "buffer.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
-
-#include
ControlIndex::ControlIndex(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d, LFUN_INDEX_INSERT)
-{
- d_.showIndex = boost::bind(&ControlIndex::showInset, this, _1);
- d_.createIndex = boost::bind(&ControlIndex::createInset, this, _1);
-}
+{}
diff --git a/src/frontends/controllers/ControlInset.tmpl b/src/frontends/controllers/ControlInset.tmpl
index 7b36a70529..fe88747c36 100644
--- a/src/frontends/controllers/ControlInset.tmpl
+++ b/src/frontends/controllers/ControlInset.tmpl
@@ -16,7 +16,10 @@
#include "buffer.h"
#include "debug.h"
#include "frontends/LyXView.h"
+#include "insets/insetfloat.h"
+#include "insets/insetgraphics.h"
#include "support/LAssert.h"
+
#include
template
diff --git a/src/frontends/controllers/ControlLog.C b/src/frontends/controllers/ControlLog.C
index 2bc2873432..bcaa49bb67 100644
--- a/src/frontends/controllers/ControlLog.C
+++ b/src/frontends/controllers/ControlLog.C
@@ -19,21 +19,14 @@
#endif
#include "ControlLog.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "lyxrc.h"
#include "BufferView.h"
#include "frontends/LyXView.h"
-#include
ControlLog::ControlLog(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
-{
- d_.showLogFile = boost::bind(&ControlLog::show, this);
-}
+{}
void ControlLog::setParams()
diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C
index 017abd6e4d..2ebc759a4c 100644
--- a/src/frontends/controllers/ControlMinipage.C
+++ b/src/frontends/controllers/ControlMinipage.C
@@ -18,29 +18,12 @@
#endif
#include "ControlMinipage.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
-#include "buffer.h"
#include "BufferView.h"
-#include "helper_funcs.h"
-
-#include
-
-using std::vector;
ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
: ControlInset(lv, d)
-{
- d_.showMinipage = boost::bind(&ControlMinipage::showInset, this, _1);
-
- // We could have an extra method updateInset that calls
- // view().update() rather than view().show(), but I don't see why
- // it is really needed.
- d_.updateMinipage = boost::bind(&ControlMinipage::showInset, this, _1);
-}
+{}
void ControlMinipage::applyParamsToInset()
diff --git a/src/frontends/controllers/ControlParagraph.C b/src/frontends/controllers/ControlParagraph.C
index e554cb1e5a..0438e044b0 100644
--- a/src/frontends/controllers/ControlParagraph.C
+++ b/src/frontends/controllers/ControlParagraph.C
@@ -13,11 +13,9 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlParagraph.h"
+#include "ViewBase.h"
#include "ParagraphParameters.h"
-#include "Dialogs.h"
#include "Liason.h"
#include "LyXView.h"
#include "BufferView.h"
@@ -27,16 +25,12 @@
#include "lyxtextclasslist.h"
#include "support/LAssert.h"
-#include
-
using Liason::setMinibuffer;
ControlParagraph::ControlParagraph(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d), pp_(0), ininset_(false)
-{
- d_.showParagraph = boost::bind(&ControlParagraph::show, this);
-}
+{}
ControlParagraph::~ControlParagraph()
@@ -83,13 +77,13 @@ void ControlParagraph::apply()
pp_->noindent());
// Actually apply these settings
- lv_.view()->update(text,
+ lv_.view()->update(text,
BufferView::SELECT |
BufferView::FITCUR |
BufferView::CHANGE);
-
+
lv_.buffer()->markDirty();
-
+
setMinibuffer(&lv_, _("Paragraph layout set"));
}
@@ -101,13 +95,13 @@ void ControlParagraph::setParams()
/// get paragraph
Paragraph const * par_ = lv_.view()->getLyXText()->cursor.par();
-
+
/// Set the paragraph parameters
- *pp_ = par_->params();
-
+ *pp_ = par_->params();
+
/// this needs to be done separately
pp_->labelWidthString(par_->getLabelWidthString());
-
+
/// alignment
LyXTextClass const & tclass =
textclasslist[lv_.view()->buffer()->params.textclass];
@@ -118,5 +112,5 @@ void ControlParagraph::setParams()
alignpos_ = tclass[par_->layout()].alignpossible;
/// is paragraph in inset
- ininset_ = par_->inInset();
+ ininset_ = par_->inInset();
}
diff --git a/src/frontends/controllers/ControlParagraph.h b/src/frontends/controllers/ControlParagraph.h
index b089a07ec9..343e0dd28a 100644
--- a/src/frontends/controllers/ControlParagraph.h
+++ b/src/frontends/controllers/ControlParagraph.h
@@ -54,4 +54,3 @@ private:
};
#endif // CONTROLPARAGRAPH_H
-
diff --git a/src/frontends/controllers/ControlPreamble.C b/src/frontends/controllers/ControlPreamble.C
index 4f3485c84b..7f30834f55 100644
--- a/src/frontends/controllers/ControlPreamble.C
+++ b/src/frontends/controllers/ControlPreamble.C
@@ -12,26 +12,20 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlPreamble.h"
+#include "ViewBase.h"
#include "frontends/LyXView.h"
-#include "Dialogs.h"
#include "buffer.h"
-#include "lyxrc.h"
#include "Liason.h"
#include "gettext.h"
#include "BufferView.h"
#include "support/LAssert.h"
-#include
ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
params_(0)
-{
- d_.showPreamble = boost::bind(&ControlPreamble::show, this);
-}
+{}
void ControlPreamble::apply()
@@ -56,15 +50,13 @@ string & ControlPreamble::params() const
void ControlPreamble::setParams()
{
- if (params_) delete params_;
+ delete params_;
params_ = new string(lv_.buffer()->params.preamble);
}
void ControlPreamble::clearParams()
{
- if (params_) {
- delete params_;
- params_ = 0;
- }
+ delete params_;
+ params_ = 0;
}
diff --git a/src/frontends/controllers/ControlPreamble.h b/src/frontends/controllers/ControlPreamble.h
index 3042abce12..893bd11a52 100644
--- a/src/frontends/controllers/ControlPreamble.h
+++ b/src/frontends/controllers/ControlPreamble.h
@@ -16,6 +16,8 @@
#include "ControlDialog_impl.h"
+#include "LString.h"
+
/** A controller for Preamble dialogs.
*/
class ControlPreamble : public ControlDialogBD {
diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C
index 6c0609734c..8e5ba18f4f 100644
--- a/src/frontends/controllers/ControlPrint.C
+++ b/src/frontends/controllers/ControlPrint.C
@@ -12,17 +12,15 @@
*/
#include
-#include
#ifdef __GNUG__
#pragma implementation
#endif
+#include "ControlPrint.h"
#include "ViewBase.h"
#include "ButtonControllerBase.h"
-#include "ControlPrint.h"
#include "buffer.h"
-#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "PrinterParams.h"
#include "Liason.h"
@@ -32,18 +30,14 @@
#include "BufferView.h"
#include "support/LAssert.h"
-#include
-
using Liason::printBuffer;
using Liason::getPrinterParams;
-using std::make_pair;
+
ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
params_(0)
-{
- d_.showPrint = boost::bind(&ControlPrint::show, this);
-}
+{}
void ControlPrint::apply()
diff --git a/src/frontends/controllers/ControlPrint.h b/src/frontends/controllers/ControlPrint.h
index d88362ceb6..211787f389 100644
--- a/src/frontends/controllers/ControlPrint.h
+++ b/src/frontends/controllers/ControlPrint.h
@@ -21,6 +21,8 @@
#include "ControlDialog_impl.h"
+#include "LString.h"
+
class PrinterParams;
/** A controller for Print dialogs.
diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C
index 568fc2c6ba..98e6cbc795 100644
--- a/src/frontends/controllers/ControlRef.C
+++ b/src/frontends/controllers/ControlRef.C
@@ -18,33 +18,19 @@
#endif
#include "ControlRef.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
#include "lyxfunc.h"
#include "bufferlist.h"
-#include "debug.h"
-
-#include "frontends/LyXView.h"
#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
-#include
-
-#include
-
using std::vector;
-using std::find;
extern BufferList bufferlist;
+
ControlRef::ControlRef(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d, LFUN_REF_INSERT)
-{
- d_.showRef = boost::bind(&ControlRef::showInset, this, _1);
- d_.createRef = boost::bind(&ControlRef::createInset, this, _1);
-}
+{}
vector const ControlRef::getLabelList(string const & name) const
diff --git a/src/frontends/controllers/ControlSearch.C b/src/frontends/controllers/ControlSearch.C
index 224930cea9..867ef54425 100644
--- a/src/frontends/controllers/ControlSearch.C
+++ b/src/frontends/controllers/ControlSearch.C
@@ -18,13 +18,9 @@
#endif
#include "ControlSearch.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
#include "Liason.h"
#include "buffer.h"
#include "lyxfind.h"
-#include "debug.h"
#include "gettext.h"
#include "BufferView.h"
@@ -32,26 +28,20 @@
#include "support/lstrings.h"
-#include
-
using Liason::setMinibuffer;
+
ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
-{
- d_.showSearch = boost::bind(&ControlSearch::show, this);
-
- // perhaps in the future we'd like a
- // "search again" button/keybinding
- // d_.searchAgain.connect(SigC::slot(this, &ControlSearch::FindNext));
-}
+{}
void ControlSearch::find(string const & search,
bool casesensitive, bool matchword, bool forward) const
{
- bool const found = LyXFind(lv_.view(), search,
- forward, false, casesensitive, matchword);
+ bool const found = lyxfind::LyXFind(lv_.view(), search,
+ forward, casesensitive,
+ matchword);
if (!found)
setMinibuffer(&lv_, _("String not found!"));
@@ -65,9 +55,10 @@ void ControlSearch::replace(string const & search, string const & replace,
// move on to the next instance once the present instance has been
// changed
bool const once = !all;
- int const replace_count = LyXReplace(lv_.view(),
- search, replace, true, casesensitive,
- matchword, all, once);
+ int const replace_count =
+ lyxfind::LyXReplace(lv_.view(),
+ search, replace, true, casesensitive,
+ matchword, all, once);
if (replace_count == 0) {
setMinibuffer(&lv_, _("String not found!"));
diff --git a/src/frontends/controllers/ControlSendto.C b/src/frontends/controllers/ControlSendto.C
index 8aaa29b805..7eb8376e22 100644
--- a/src/frontends/controllers/ControlSendto.C
+++ b/src/frontends/controllers/ControlSendto.C
@@ -12,10 +12,8 @@
#pragma implementation
#endif
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlSendto.h"
-#include "Dialogs.h"
+#include "ViewBase.h"
#include "frontends/LyXView.h"
#include "BufferView.h"
#include "buffer.h"
@@ -28,19 +26,14 @@
#include "support/lstrings.h"
#include "support/systemcall.h"
-#include
-
-#include
-
using std::vector;
+
ControlSendto::ControlSendto(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
format_(0),
command_(lyxrc.custom_export_command)
-{
- d_.showSendto = boost::bind(&ControlSendto::show, this);
-}
+{}
vector const ControlSendto::allFormats() const
diff --git a/src/frontends/controllers/ControlSendto.h b/src/frontends/controllers/ControlSendto.h
index e4189a9b12..25a4ee08de 100644
--- a/src/frontends/controllers/ControlSendto.h
+++ b/src/frontends/controllers/ControlSendto.h
@@ -15,6 +15,8 @@
#endif
#include "ControlDialog_impl.h"
+#include "LString.h"
+
#include
class Format;
diff --git a/src/frontends/controllers/ControlShowFile.C b/src/frontends/controllers/ControlShowFile.C
index 9d5e0b5ce6..a412ff4831 100644
--- a/src/frontends/controllers/ControlShowFile.C
+++ b/src/frontends/controllers/ControlShowFile.C
@@ -13,24 +13,13 @@
#endif
#include "ControlShowFile.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
-#include "BufferView.h"
-#include "gettext.h"
#include "support/filetools.h" // FileSearch
-#include
-
-#include
ControlShowFile::ControlShowFile(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
-{
- d_.showFile = boost::bind(&ControlShowFile::showFile, this, _1);
-}
+{}
void ControlShowFile::showFile(string const & file)
diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C
index 1d7ebce2ab..329bb68c86 100644
--- a/src/frontends/controllers/ControlSpellchecker.C
+++ b/src/frontends/controllers/ControlSpellchecker.C
@@ -26,7 +26,6 @@
#include "language.h"
#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "Dialogs.h"
#include "Liason.h"
@@ -39,10 +38,6 @@
# include "sp_pspell.h"
#endif
-#include "debug.h"
-
-#include
-
#include // needed by at least on freebsd
#ifdef HAVE_SYS_SELECT_H
@@ -60,9 +55,7 @@ ControlSpellchecker::ControlSpellchecker(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
rtl_(false), newval_(0.0), oldval_(0), newvalue_(0), count_(0),
stop_(false), result_(SpellBase::ISP_OK), speller_(0)
-{
- d_.showSpellchecker = boost::bind(&ControlSpellchecker::show, this);
-}
+{}
void ControlSpellchecker::setParams()
diff --git a/src/frontends/controllers/ControlTabularCreate.C b/src/frontends/controllers/ControlTabularCreate.C
index 9eb5254229..9db249361b 100644
--- a/src/frontends/controllers/ControlTabularCreate.C
+++ b/src/frontends/controllers/ControlTabularCreate.C
@@ -20,20 +20,16 @@
#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "BufferView.h"
-#include "Dialogs.h"
#include "lyxfunc.h"
#include "frontends/LyXView.h"
#include "support/lstrings.h"
-#include
ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
-{
- d_.showTabularCreate = boost::bind(&ControlTabularCreate::show, this);
-}
+{}
ControlTabularCreate::rowsCols & ControlTabularCreate::params()
diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C
index ad4981069b..7637bbdccf 100644
--- a/src/frontends/controllers/ControlTexinfo.C
+++ b/src/frontends/controllers/ControlTexinfo.C
@@ -18,8 +18,6 @@
#endif
#include "ControlTexinfo.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "Dialogs.h"
#include "BufferView.h"
#include "gettext.h"
@@ -32,16 +30,12 @@
#include "support/path.h"
#include "support/lstrings.h"
-#include
-
extern string user_lyxdir; // home of *Files.lst
ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
-{
- d_.showTexinfo = boost::bind(&ControlTexinfo::show, this);
-}
+{}
// build filelists of all availabe bst/cls/sty-files. done through
diff --git a/src/frontends/controllers/ControlThesaurus.C b/src/frontends/controllers/ControlThesaurus.C
index 29e11c01b6..19e042e612 100644
--- a/src/frontends/controllers/ControlThesaurus.C
+++ b/src/frontends/controllers/ControlThesaurus.C
@@ -13,27 +13,20 @@
#endif
#include "ControlThesaurus.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
#include "Liason.h"
#include "lyxfind.h"
#include "buffer.h"
-#include "debug.h"
#include "gettext.h"
#include "BufferView.h"
#include "frontends/LyXView.h"
-#include
-
using Liason::setMinibuffer;
+
ControlThesaurus::ControlThesaurus(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
-{
- d_.showThesaurus = boost::bind(&ControlThesaurus::showEntry, this, _1);
-}
+{}
void ControlThesaurus::showEntry(string const & entry)
@@ -49,8 +42,9 @@ void ControlThesaurus::replace(string const & newstr)
* on a particular charpos in a paragraph that is broken on
* deletion/change !
*/
- int const replace_count = LyXReplace(lv_.view(), oldstr_, newstr,
- true, true, true, false, true);
+ int const replace_count =
+ lyxfind::LyXReplace(lv_.view(), oldstr_, newstr,
+ true, true, true, false, true);
oldstr_ = newstr;
diff --git a/src/frontends/controllers/ControlToc.C b/src/frontends/controllers/ControlToc.C
index 5c731c0566..50cf2a5cb3 100644
--- a/src/frontends/controllers/ControlToc.C
+++ b/src/frontends/controllers/ControlToc.C
@@ -18,28 +18,20 @@
#endif
#include "ControlToc.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "gettext.h"
#include "BufferView.h"
-#include "frontends/LyXView.h"
-
#include "support/lstrings.h" // tostr
-#include
-
using std::vector;
+
ControlToc::ControlToc(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d, LFUN_TOC_INSERT)
-{
- d_.showTOC = boost::bind(&ControlToc::showInset, this, _1);
- d_.createTOC = boost::bind(&ControlToc::createInset, this, _1);
-}
+{}
void ControlToc::Goto(int const & id) const
diff --git a/src/frontends/controllers/ControlUrl.C b/src/frontends/controllers/ControlUrl.C
index 03e2ce7d48..97438d8606 100644
--- a/src/frontends/controllers/ControlUrl.C
+++ b/src/frontends/controllers/ControlUrl.C
@@ -18,18 +18,8 @@
#endif
#include "ControlUrl.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
-#include "frontends/LyXView.h"
-
-#include
ControlUrl::ControlUrl(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d, LFUN_INSERT_URL)
-{
- d_.showUrl = boost::bind(&ControlUrl::showInset, this, _1);
- d_.createUrl = boost::bind(&ControlUrl::createInset, this, _1);
-}
+{}
diff --git a/src/frontends/controllers/ControlVCLog.C b/src/frontends/controllers/ControlVCLog.C
index 5670d19d94..2b5f13a254 100644
--- a/src/frontends/controllers/ControlVCLog.C
+++ b/src/frontends/controllers/ControlVCLog.C
@@ -20,11 +20,9 @@
#include "ControlVCLog.h"
#include "Lsstream.h"
-#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "buffer.h"
#include "BufferView.h"
-#include "Dialogs.h"
#include "lyxrc.h"
#include "gettext.h"
@@ -32,17 +30,15 @@
#include "support/lyxlib.h"
-#include
-
#include
using std::endl;
+
ControlVCLog::ControlVCLog(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
-{
- d_.showVCLogFile = boost::bind(&ControlVCLog::show, this);
-}
+{}
+
string const ControlVCLog::getBufferFileName() const
{
diff --git a/src/frontends/controllers/GUI.h b/src/frontends/controllers/GUI.h
index c22090ce28..49f62ea290 100644
--- a/src/frontends/controllers/GUI.h
+++ b/src/frontends/controllers/GUI.h
@@ -11,38 +11,7 @@
#define GUI_H
#include "ButtonController.h"
-#include "ButtonPolicies.h"
-#include "ControlAboutlyx.h"
-#include "ControlBibitem.h"
-#include "ControlBibtex.h"
-#include "ControlCharacter.h"
-#include "ControlCitation.h"
-#include "ControlError.h"
-#include "ControlERT.h"
-#include "ControlExternal.h"
-#include "ControlFloat.h"
-#include "ControlForks.h"
-#include "ControlGraphics.h"
-#include "insets/insetgraphicsParams.h"
-#include "ControlInclude.h"
-#include "ControlIndex.h"
-#include "ControlLog.h"
-#include "ControlMinipage.h"
-#include "ControlParagraph.h"
-#include "ControlPreamble.h"
-#include "ControlPrint.h"
-#include "ControlRef.h"
-#include "ControlSearch.h"
-#include "ControlSendto.h"
-#include "ControlShowFile.h"
-#include "ControlSpellchecker.h"
-#include "ControlTabularCreate.h"
-#include "ControlTexinfo.h"
-#include "ControlThesaurus.h"
-#include "ControlToc.h"
-#include "ControlUrl.h"
-#include "ControlVCLog.h"
-
+#include "ViewBase.h"
/** This class instantiates and makes available the GUI-specific
ButtonController and View.
@@ -57,6 +26,45 @@ public:
///
virtual ViewBase & view() { return view_; }
+ friend void gui_ShowAboutlyx(LyXView &, Dialogs &);
+ friend void gui_ShowBibitem(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_ShowBibtex(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_ShowCharacter(LyXView &, Dialogs &);
+ friend void gui_SetUserFreeFont(LyXView &, Dialogs &);
+ friend void gui_ShowCitation(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_CreateCitation(string const &, LyXView &, Dialogs &);
+ friend void gui_ShowDocument(LyXView &, Dialogs &);
+ friend void gui_ShowError(InsetError *, LyXView &, Dialogs &);
+ friend void gui_ShowERT(InsetERT *, LyXView &, Dialogs &);
+ friend void gui_UpdateERT(InsetERT *, LyXView &, Dialogs &);
+ friend void gui_ShowExternal(InsetExternal *, LyXView &, Dialogs &);
+ friend void gui_ShowFloat(InsetFloat *, LyXView &, Dialogs &);
+ friend void gui_ShowForks(LyXView &, Dialogs &);
+ friend void gui_ShowGraphics(InsetGraphics *, LyXView &, Dialogs &);
+ friend void gui_ShowInclude(InsetInclude *, LyXView &, Dialogs &);
+ friend void gui_ShowIndex(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_CreateIndex(string const &, LyXView &, Dialogs &);
+ friend void gui_ShowLogFile(LyXView &, Dialogs &);
+ friend void gui_ShowMathPanel(LyXView &, Dialogs &);
+ friend void gui_ShowMinipage(InsetMinipage *, LyXView &, Dialogs &);
+ friend void gui_UpdateMinipage(InsetMinipage *, LyXView &, Dialogs &);
+ friend void gui_ShowParagraph(LyXView &, Dialogs &);
+ friend void gui_ShowPreamble(LyXView &, Dialogs &);
+ friend void gui_ShowPreferences(LyXView &, Dialogs &);
+ friend void gui_ShowPrint(LyXView &, Dialogs &);
+ friend void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_CreateRef(string const &, LyXView &, Dialogs &);
+ friend void gui_ShowSearch(LyXView &, Dialogs &);
+ friend void gui_ShowSendto(LyXView &, Dialogs &);
+ friend void gui_ShowSpellchecker(LyXView &, Dialogs &);
+ friend void gui_ShowTabularCreate(LyXView &, Dialogs &);
+ friend void gui_ShowTexinfo(LyXView &, Dialogs &);
+ friend void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_CreateTOC(string const &, LyXView &, Dialogs &);
+ friend void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &);
+ friend void gui_CreateUrl(string const &, LyXView &, Dialogs &);
+ friend void gui_ShowVCLogFile(LyXView &, Dialogs &);
+
private:
///
ButtonController bc_;
@@ -64,357 +72,4 @@ private:
GUIview view_;
};
-#if 0
-/** Specialization for About LyX dialog
- */
-template
-class GUIAboutlyx :
- public GUI {
-public:
- ///
- GUIAboutlyx(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Bibitem dialog
- */
-template
-class GUIBibitem :
- public GUI {
-public:
- ///
- GUIBibitem(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Bibtex dialog
- */
-template
-class GUIBibtex :
- public GUI {
-public:
- ///
- GUIBibtex(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Character dialog
- */
-template
-class GUICharacter : public GUI
-{
-public:
- ///
- GUICharacter(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Citation dialog
- */
-template
-class GUICitation : public GUI
-{
-public:
- ///
- GUICitation(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Error dialog
- */
-template
-class GUIError :
- public GUI {
-public:
- ///
- GUIError(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for ERT dialog
- */
-template
-class GUIERT :
- public GUI {
-public:
- ///
- GUIERT(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for External dialog
- */
-template
-class GUIExternal :
- public GUI {
-public:
- ///
- GUIExternal(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Forks dialog
- */
-template
-class GUIForks :
- public GUI {
-public:
- ///
- GUIForks(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Graphics dialog
- */
-template
-class GUIGraphics :
- public GUI {
-public:
- ///
- GUIGraphics(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Include dialog
- */
-template
-class GUIInclude :
- public GUI {
-public:
- ///
- GUIInclude(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Index dialog
- */
-template
-class GUIIndex :
- public GUI {
-public:
- ///
- GUIIndex(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Log dialog
- */
-template
-class GUILog :
- public GUI {
-public:
- ///
- GUILog(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Minipage dialog
- */
-template
-class GUIMinipage :
- public GUI {
-public:
- ///
- GUIMinipage(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Float dialog
- */
-template
-class GUIFloat :
- public GUI {
-public:
- ///
- GUIFloat(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Paragraph dialog
- */
-template
-class GUIParagraph : public GUI
-{
-public:
- ///
- GUIParagraph(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Preamble dialog
- */
-template
-class GUIPreamble :
- public GUI {
-public:
- ///
- GUIPreamble(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Print dialog
- */
-template
-class GUIPrint :
- public GUI {
-public:
- ///
- GUIPrint(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Ref dialog
- */
-template
-class GUIRef :
- public GUI {
-public:
- ///
- GUIRef(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Search dialog
- */
-template
-class GUISearch :
- public GUI {
-public:
- ///
- GUISearch(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Sendto dialog
- */
-template
-class GUISendto :
- public GUI {
-public:
- ///
- GUISendto(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for ShowFile dialog
- */
-template
-class GUIShowFile :
- public GUI {
-public:
- ///
- GUIShowFile(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Spellchecker dialog
- */
-template
-class GUISpellchecker :
- public GUI {
-public:
- ///
- GUISpellchecker(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Toc dialog
- */
-template
-class GUIToc :
- public GUI {
-public:
- ///
- GUIToc(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for TabularCreate dialog
- */
-template
-class GUITabularCreate :
- public GUI {
-public:
- ///
- GUITabularCreate(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Texinfo dialog
- */
-template
-class GUITexinfo :
- public GUI {
-public:
- ///
- GUITexinfo(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-/** Specialization for Thesaurus dialog
- */
-template
-class GUIThesaurus :
- public GUI {
-public:
- ///
- GUIThesaurus(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for Url dialog
- */
-template
-class GUIUrl :
- public GUI {
-public:
- ///
- GUIUrl(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-
-/** Specialization for VCLog dialog
- */
-template
-class GUIVCLog :
- public GUI {
-public:
- ///
- GUIVCLog(LyXView & lv, Dialogs & d)
- : GUI(lv, d) {}
-};
-
-#endif
-
#endif // GUI_H
diff --git a/src/frontends/guiapi.h b/src/frontends/guiapi.h
new file mode 100644
index 0000000000..e7abe92950
--- /dev/null
+++ b/src/frontends/guiapi.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+#include "LString.h"
+
+class LyXView;
+class Dialogs;
+class InsetCommand;
+class InsetError;
+class InsetERT;
+class InsetExternal;
+class InsetFloat;
+class InsetGraphics;
+class InsetInclude;
+class InsetInfo;
+class InsetMinipage;
+class InsetTabular;
+
+extern "C" {
+
+ void gui_ShowAboutlyx(LyXView &, Dialogs &);
+ void gui_ShowBibitem(InsetCommand * ic, LyXView & lv, Dialogs & d);
+ void gui_ShowBibtex(InsetCommand * ic, LyXView & lv, Dialogs & d);
+ void gui_ShowCharacter(LyXView & lv, Dialogs & d);
+ void gui_SetUserFreeFont(LyXView & lv, Dialogs & d);
+ void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d);
+ void gui_CreateCitation(string const &, LyXView & lv, Dialogs & d);
+ void gui_ShowDocument(LyXView & lv, Dialogs & d);
+ void gui_ShowError(InsetError * ie, LyXView & lv, Dialogs & d);
+ void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d);
+ void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d);
+ void gui_ShowExternal(InsetExternal * ie, LyXView & lv, Dialogs & d);
+ void gui_ShowFile(string const & f, LyXView & lv, Dialogs & d);
+ void gui_ShowFloat(InsetFloat *, LyXView & lv, Dialogs &);
+ void gui_ShowForks(LyXView & lv, Dialogs & d);
+ void gui_ShowGraphics(InsetGraphics *, LyXView & lv, Dialogs & d);
+ void gui_ShowInclude(InsetInclude *, LyXView & lv, Dialogs & d);
+ void gui_ShowIndex(InsetCommand *, LyXView & lv, Dialogs & d);
+ void gui_CreateIndex(string const &, LyXView & lv, Dialogs & d);
+ void gui_ShowInfo(InsetInfo *, LyXView & lv, Dialogs & d);
+ void gui_ShowLogFile(LyXView & lv, Dialogs & d);
+ void gui_ShowMathPanel(LyXView & lv, Dialogs & d);
+ void gui_ShowMinipage(InsetMinipage *, LyXView & lv, Dialogs & d);
+ void gui_UpdateMinipage(InsetMinipage *, LyXView & lv, Dialogs & d);
+ void gui_ShowParagraph(LyXView & lv, Dialogs & d);
+ void gui_UpdateParagraph(LyXView & lv, Dialogs & d);
+ void gui_ShowPreamble(LyXView & lv, Dialogs & d);
+ void gui_ShowPreferences(LyXView & lv, Dialogs & d);
+ void gui_ShowPrint(LyXView & lv, Dialogs & d);
+ void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &);
+ void gui_CreateRef(string const &, LyXView &, Dialogs &);
+ void gui_ShowSearch(LyXView & lv, Dialogs & d);
+ void gui_ShowSendto(LyXView & lv, Dialogs & d);
+ void gui_ShowSpellchecker(LyXView & lv, Dialogs & d);
+ void gui_ShowSpellcheckerPreferences(LyXView & lv, Dialogs & d);
+ void gui_ShowTabular(InsetTabular *, LyXView &, Dialogs &);
+ void gui_UpdateTabular(InsetTabular *, LyXView &, Dialogs &);
+ void gui_ShowTabularCreate(LyXView & lv, Dialogs & d);
+ void gui_ShowTexinfo(LyXView & lv, Dialogs & d);
+ void gui_ShowThesaurus(string const &, LyXView &, Dialogs &);
+ void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &);
+ void gui_CreateTOC(string const &, LyXView &, Dialogs &);
+ void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &);
+ void gui_CreateUrl(string const &, LyXView &, Dialogs &);
+ void gui_ShowVCLogFile(LyXView & lv, Dialogs & d);
+
+} // extern "C"
diff --git a/src/frontends/screen.C b/src/frontends/screen.C
index 79dd6542d5..8c72d54018 100644
--- a/src/frontends/screen.C
+++ b/src/frontends/screen.C
@@ -1,284 +1,87 @@
-/* This file is part of
-* ======================================================
-*
-* LyX, The Document Processor
-*
-* Copyright 1995 Matthias Ettrich
-* Copyright 1995-1998 The LyX Team
-*
-* ====================================================== */
-
-#include
+/**
+ * \file screen.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon