#include "BufferView.h"
#include "ColorHandler.h"
#include "lyxserver.h"
-#include "figure_form.h"
#include "intl.h"
#include "lyx_main.h"
#include "lyx_cb.h"
// Disable insertion of floats in a tabular.
disable = false;
if (owner->view()->theLockingInset()) {
- disable = (owner->view()->theLockingInset()->LyxCode() == Inset::TABULAR_CODE) ||
- owner->view()->theLockingInset()->GetFirstLockingInsetOfType(Inset::TABULAR_CODE);
+ disable = (owner->view()->theLockingInset()->lyxCode() == Inset::TABULAR_CODE) ||
+ owner->view()->theLockingInset()->getFirstLockingInsetOfType(Inset::TABULAR_CODE);
}
break;
case LFUN_LAYOUT_TABULAR:
disable = true;
if (owner->view()->theLockingInset()) {
- disable = (owner->view()->theLockingInset()->LyxCode() != Inset::TABULAR_CODE) &&
- !owner->view()->theLockingInset()->GetFirstLockingInsetOfType(Inset::TABULAR_CODE);
+ disable = (owner->view()->theLockingInset()->lyxCode() != Inset::TABULAR_CODE) &&
+ !owner->view()->theLockingInset()->getFirstLockingInsetOfType(Inset::TABULAR_CODE);
}
break;
disable = true;
if (owner->view()->theLockingInset()) {
func_status::value_type ret = func_status::Disabled;
- if (owner->view()->theLockingInset()->LyxCode() == Inset::TABULAR_CODE) {
+ if (owner->view()->theLockingInset()->lyxCode() == Inset::TABULAR_CODE) {
ret = static_cast<InsetTabular *>
(owner->view()->theLockingInset())->
getStatus(argument);
- } else if (owner->view()->theLockingInset()->GetFirstLockingInsetOfType(Inset::TABULAR_CODE)) {
+ } else if (owner->view()->theLockingInset()->getFirstLockingInsetOfType(Inset::TABULAR_CODE)) {
ret = static_cast<InsetTabular *>
(owner->view()->theLockingInset()->
- GetFirstLockingInsetOfType(Inset::TABULAR_CODE))->
+ getFirstLockingInsetOfType(Inset::TABULAR_CODE))->
getStatus(argument);
}
flag |= ret;
isSavedPosition(strToUnsignedInt(argument));
case LFUN_MATH_VALIGN: {
Inset * tli = owner->view()->theLockingInset();
- if (tli && (tli->LyxCode() == Inset::MATH_CODE
- || tli->LyxCode() == Inset::MATHMACRO_CODE)) {
+ if (tli && (tli->lyxCode() == Inset::MATH_CODE
+ || tli->lyxCode() == Inset::MATHMACRO_CODE)) {
char align = mathcursor->valign();
if (align == '\0') {
disable = true;
}
case LFUN_MATH_HALIGN: {
Inset * tli = owner->view()->theLockingInset();
- if (tli && (tli->LyxCode() == Inset::MATH_CODE
- || tli->LyxCode() == Inset::MATHMACRO_CODE)) {
+ if (tli && (tli->lyxCode() == Inset::MATH_CODE
+ || tli->lyxCode() == Inset::MATHMACRO_CODE)) {
char align = mathcursor->halign();
if (align == '\0') {
disable = true;
}
case LFUN_MATH_MUTATE: {
Inset * tli = owner->view()->theLockingInset();
- if (tli && (tli->LyxCode() == Inset::MATH_CODE)) {
+ if (tli && (tli->lyxCode() == Inset::MATH_CODE)) {
MathInsetTypes type = mathcursor->par()->GetType();
func_status::value_type box = func_status::ToggleOff;
if (argument == "inline") {
if (!do_not_use_this_arg.empty())
argument = do_not_use_this_arg; // except here
}
-
+
+#ifdef NEW_DISPATCHER
+ // We try do call the most specific dispatcher first:
+ // 1. the lockinginset's dispatch
+ // 2. the bufferview's dispatch
+ // 3. the lyxview's dispatch
+#endif
+
selection_possible = false;
if (owner->view()->available())
int sly;
UpdatableInset * inset =
owner->view()->theLockingInset();
- inset->GetCursorPos(owner->view(), slx, sly);
+ inset->getCursorPos(owner->view(), slx, sly);
owner->view()->unlockInset(inset);
owner->view()->menuUndo();
if (TEXT()->cursor.par()->
inset = 0;
}
if (inset)
- inset->Edit(owner->view(),slx,sly,0);
+ inset->edit(owner->view(),slx,sly,0);
return string();
} else if (action == LFUN_REDO) {
int slx;
int sly;
UpdatableInset * inset = owner->view()->
theLockingInset();
- inset->GetCursorPos(owner->view(), slx, sly);
+ inset->getCursorPos(owner->view(), slx, sly);
owner->view()->unlockInset(inset);
owner->view()->menuRedo();
inset = static_cast<UpdatableInset*>(
getInset(TEXT()->
cursor.pos()));
if (inset)
- inset->Edit(owner->view(),slx,sly,0);
+ inset->edit(owner->view(),slx,sly,0);
return string();
} else if (((result=owner->view()->theLockingInset()->
- LocalDispatch(owner->view(), action,
+ localDispatch(owner->view(), action,
argument)) ==
UpdatableInset::DISPATCHED) ||
(result == UpdatableInset::DISPATCHED_NOUPDATE))
UpdatableInset * tli =
owner->view()->theLockingInset();
if (tli) {
- UpdatableInset * lock = tli->GetLockingInset();
+ UpdatableInset * lock = tli->getLockingInset();
if (tli == lock) {
owner->view()->unlockInset(tli);
moveCursorUpdate(true, false);
owner->showState();
} else {
- tli->UnlockInsetInInset(owner->view(),
+ tli->unlockInsetInInset(owner->view(),
lock,
true);
}
setErrorMessage(N_("Missing argument"));
break;
}
- ProhibitInput(owner->view());
+ owner->prohibitInput();
string const fname = i18nLibFileSearch("doc", arg, "lyx");
if (fname.empty()) {
lyxerr << "LyX: unable to find documentation file `"
<< arg << "'. Bad installation?" << endl;
- AllowInput(owner->view());
+ owner->allowInput();
break;
}
ostringstream str;
str << _("Opening help file") << ' '
<< MakeDisplayPath(fname) << "...";
owner->message(str.str().c_str());
- owner->view()->buffer(bufferlist.loadLyXFile(fname,false));
- AllowInput(owner->view());
+ owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
+ owner->allowInput();
break;
}
case LFUN_HELP_VERSION: {
- ProhibitInput(owner->view());
+ owner->prohibitInput();
string msg(_("LyX Version "));
msg += LYX_VERSION;
msg += " of ";
+ MakeDisplayPath(system_lyxdir)).c_str(),
(_("User directory: ")
+ MakeDisplayPath(user_lyxdir)).c_str());
- AllowInput(owner->view());
+ owner->allowInput();
break;
}
case LFUN_LAYOUT_TABULAR:
if (owner->view()->theLockingInset()) {
- if (owner->view()->theLockingInset()->LyxCode()==Inset::TABULAR_CODE) {
+ if (owner->view()->theLockingInset()->lyxCode()==Inset::TABULAR_CODE) {
InsetTabular * inset = static_cast<InsetTabular *>
(owner->view()->theLockingInset());
- inset->OpenLayoutDialog(owner->view());
+ inset->openLayoutDialog(owner->view());
} else if (owner->view()->theLockingInset()->
- GetFirstLockingInsetOfType(Inset::TABULAR_CODE)!=0) {
+ getFirstLockingInsetOfType(Inset::TABULAR_CODE)!=0) {
InsetTabular * inset = static_cast<InsetTabular *>(
- owner->view()->theLockingInset()->GetFirstLockingInsetOfType(Inset::TABULAR_CODE));
- inset->OpenLayoutDialog(owner->view());
+ owner->view()->theLockingInset()->getFirstLockingInsetOfType(Inset::TABULAR_CODE));
+ inset->openLayoutDialog(owner->view());
}
}
break;
case LFUN_GOTOFILEROW:
{
+#if 0
char file_name[100];
int row;
::sscanf(argument.c_str(), " %s %d", file_name, &row);
-
+#else
+ string file_name;
+ int row;
+ istringstream istr(argument.c_str());
+ istr >> file_name >> row;
+#endif
// Must replace extension of the file to be .lyx and get full path
- string s = ChangeExtension(string(file_name), ".lyx");
+ string const s(ChangeExtension(file_name, ".lyx"));
// Either change buffer or load the file
- if (bufferlist.exists(s))
+ if (bufferlist.exists(s)) {
owner->view()->buffer(bufferlist.getBuffer(s));
- else
+ } else {
owner->view()->buffer(bufferlist.loadLyXFile(s));
-
+ }
+
// Set the cursor
owner->view()->setCursorFromRow(row);
int id;
istr >> id;
Paragraph * par = TEXT()->getParFromID(id);
- if (par == 0)
+ if (par == 0) {
+ lyxerr[Debug::INFO] << "No matching paragraph found! ["
+ << id << "]" << std::endl;
break;
+ }
// Set the cursor
TEXT()->setCursor(owner->view(), par, 0);