mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-21 07:12:10 +00:00
modify Inset::EntryDirectionType to follow style used in FontEnums.h for enums.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22936 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4bc9498c7d
commit
8e831bb602
@ -608,7 +608,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo
|
|||||||
if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
|
if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
|
||||||
return false;
|
return false;
|
||||||
inset->edit(cur, movingForward,
|
inset->edit(cur, movingForward,
|
||||||
movingLeft ? Inset::ENTER_FROM_RIGHT : Inset::ENTER_FROM_LEFT);
|
movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Inset::edit(Cursor &, bool, EntryDirectionType)
|
void Inset::edit(Cursor &, bool, EntryDirection)
|
||||||
{
|
{
|
||||||
LYXERR(Debug::INSETS, "edit left/right");
|
LYXERR(Debug::INSETS, "edit left/right");
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,10 @@ namespace graphics { class PreviewLoader; }
|
|||||||
class Inset {
|
class Inset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
enum EntryDirectionType {
|
enum EntryDirection {
|
||||||
IGNORE_ENTRY_DIRECTION,
|
ENTRY_DIRECTION_IGNORE,
|
||||||
ENTER_FROM_RIGHT,
|
ENTRY_DIRECTION_RIGHT,
|
||||||
ENTER_FROM_LEFT,
|
ENTRY_DIRECTION_LEFT,
|
||||||
};
|
};
|
||||||
///
|
///
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
@ -126,7 +126,7 @@ public:
|
|||||||
|
|
||||||
/// cursor enters
|
/// cursor enters
|
||||||
virtual void edit(Cursor & cur, bool front,
|
virtual void edit(Cursor & cur, bool front,
|
||||||
EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION);
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
||||||
/// cursor enters
|
/// cursor enters
|
||||||
virtual Inset * editXY(Cursor & cur, int x, int y);
|
virtual Inset * editXY(Cursor & cur, int x, int y);
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetCaption::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void InsetCaption::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
cur.push(*this);
|
cur.push(*this);
|
||||||
InsetText::edit(cur, front, entry_from);
|
InsetText::edit(cur, front, entry_from);
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
///
|
///
|
||||||
virtual void draw(PainterInfo & pi, int x, int y) const;
|
virtual void draw(PainterInfo & pi, int x, int y) const;
|
||||||
///
|
///
|
||||||
virtual void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
virtual void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
virtual Inset * editXY(Cursor & cur, int x, int y);
|
virtual Inset * editXY(Cursor & cur, int x, int y);
|
||||||
///
|
///
|
||||||
|
@ -466,7 +466,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetCollapsable::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void InsetCollapsable::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
//lyxerr << "InsetCollapsable: edit left/right" << endl;
|
//lyxerr << "InsetCollapsable: edit left/right" << endl;
|
||||||
cur.push(*this);
|
cur.push(*this);
|
||||||
|
@ -163,7 +163,7 @@ protected:
|
|||||||
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front,
|
void edit(Cursor & cur, bool front,
|
||||||
EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION);
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
///
|
///
|
||||||
|
@ -160,7 +160,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetCommand::edit(Cursor & cur, bool, EntryDirectionType)
|
void InsetCommand::edit(Cursor & cur, bool, EntryDirection)
|
||||||
{
|
{
|
||||||
if (!mailer_name_.empty())
|
if (!mailer_name_.empty())
|
||||||
InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
|
InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
|
||||||
|
@ -73,7 +73,7 @@ public:
|
|||||||
}
|
}
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front,
|
void edit(Cursor & cur, bool front,
|
||||||
EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION);
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
||||||
///
|
///
|
||||||
RenderButton & button() const { return button_; }
|
RenderButton & button() const { return button_; }
|
||||||
///
|
///
|
||||||
|
@ -516,7 +516,7 @@ void InsetExternal::updateEmbeddedFile(Buffer const & buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetExternal::edit(Cursor & cur, bool, EntryDirectionType)
|
void InsetExternal::edit(Cursor & cur, bool, EntryDirection)
|
||||||
{
|
{
|
||||||
InsetExternalMailer(*this).showDialog(&cur.bv());
|
InsetExternalMailer(*this).showDialog(&cur.bv());
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ public:
|
|||||||
///
|
///
|
||||||
void addPreview(graphics::PreviewLoader &) const;
|
void addPreview(graphics::PreviewLoader &) const;
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
||||||
/// external file can be embedded
|
/// external file can be embedded
|
||||||
|
@ -239,7 +239,7 @@ void InsetGraphics::updateEmbeddedFile(Buffer const & buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetGraphics::edit(Cursor & cur, bool, EntryDirectionType)
|
void InsetGraphics::edit(Cursor & cur, bool, EntryDirection)
|
||||||
{
|
{
|
||||||
InsetGraphicsMailer(*this).showDialog(&cur.bv());
|
InsetGraphicsMailer(*this).showDialog(&cur.bv());
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public:
|
|||||||
///
|
///
|
||||||
void draw(PainterInfo & pi, int x, int y) const;
|
void draw(PainterInfo & pi, int x, int y) const;
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
void editGraphics(InsetGraphicsParams const &, Buffer const &) const;
|
void editGraphics(InsetGraphicsParams const &, Buffer const &) const;
|
||||||
///
|
///
|
||||||
|
@ -3151,13 +3151,13 @@ docstring const InsetTabular::editMessage() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetTabular::edit(Cursor & cur, bool, EntryDirectionType direction)
|
void InsetTabular::edit(Cursor & cur, bool, EntryDirection direction)
|
||||||
{
|
{
|
||||||
//lyxerr << "InsetTabular::edit: " << this << endl;
|
//lyxerr << "InsetTabular::edit: " << this << endl;
|
||||||
cur.finishUndo();
|
cur.finishUndo();
|
||||||
cur.selection() = false;
|
cur.selection() = false;
|
||||||
cur.push(*this);
|
cur.push(*this);
|
||||||
if (direction == ENTER_FROM_LEFT) {
|
if (direction == ENTRY_DIRECTION_LEFT) {
|
||||||
if (isRightToLeft(cur))
|
if (isRightToLeft(cur))
|
||||||
cur.idx() = tabular.getLastCellInRow(0);
|
cur.idx() = tabular.getLastCellInRow(0);
|
||||||
else
|
else
|
||||||
|
@ -745,7 +745,7 @@ public:
|
|||||||
/// set the owning buffer
|
/// set the owning buffer
|
||||||
void buffer(Buffer const * buf);
|
void buffer(Buffer const * buf);
|
||||||
/// lock cell with given index
|
/// lock cell with given index
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
/// can we go further down on mouse click?
|
/// can we go further down on mouse click?
|
||||||
|
@ -200,17 +200,17 @@ docstring const InsetText::editMessage() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetText::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void InsetText::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
pit_type const pit = front ? 0 : paragraphs().size() - 1;
|
pit_type const pit = front ? 0 : paragraphs().size() - 1;
|
||||||
pos_type pos = front ? 0 : paragraphs().back().size();
|
pos_type pos = front ? 0 : paragraphs().back().size();
|
||||||
|
|
||||||
// if visual information is not to be ignored, move to extreme right/left
|
// if visual information is not to be ignored, move to extreme right/left
|
||||||
if (entry_from != IGNORE_ENTRY_DIRECTION) {
|
if (entry_from != ENTRY_DIRECTION_IGNORE) {
|
||||||
Cursor temp_cur = cur;
|
Cursor temp_cur = cur;
|
||||||
temp_cur.pit() = pit;
|
temp_cur.pit() = pit;
|
||||||
temp_cur.pos() = pos;
|
temp_cur.pos() = pos;
|
||||||
temp_cur.posVisToRowExtremity(entry_from == ENTER_FROM_LEFT);
|
temp_cur.posVisToRowExtremity(entry_from == ENTRY_DIRECTION_LEFT);
|
||||||
pos = temp_cur.pos();
|
pos = temp_cur.pos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
void addPreview(graphics::PreviewLoader &) const;
|
void addPreview(graphics::PreviewLoader &) const;
|
||||||
|
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
|
|
||||||
|
@ -1314,11 +1314,11 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetMathHull::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
cur.push(*this);
|
cur.push(*this);
|
||||||
bool enter_front = (entry_from == Inset::ENTER_FROM_LEFT ||
|
bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT ||
|
||||||
(entry_from == Inset::IGNORE_ENTRY_DIRECTION && front));
|
(entry_from == Inset::ENTRY_DIRECTION_IGNORE && front));
|
||||||
enter_front ? idxFirst(cur) : idxLast(cur);
|
enter_front ? idxFirst(cur) : idxLast(cur);
|
||||||
// The inset formula dimension is not necessarily the same as the
|
// The inset formula dimension is not necessarily the same as the
|
||||||
// one of the instant preview image, so we have to indicate to the
|
// one of the instant preview image, so we have to indicate to the
|
||||||
|
@ -200,7 +200,7 @@ public:
|
|||||||
EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front,
|
void edit(Cursor & cur, bool front,
|
||||||
EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION);
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
///
|
///
|
||||||
|
@ -1208,11 +1208,11 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetMathNest::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void InsetMathNest::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
cur.push(*this);
|
cur.push(*this);
|
||||||
bool enter_front = (entry_from == Inset::ENTER_FROM_RIGHT ||
|
bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_RIGHT ||
|
||||||
(entry_from == Inset::IGNORE_ENTRY_DIRECTION && front));
|
(entry_from == Inset::ENTRY_DIRECTION_IGNORE && front));
|
||||||
cur.idx() = enter_front ? 0 : cur.lastidx();
|
cur.idx() = enter_front ? 0 : cur.lastidx();
|
||||||
cur.pos() = enter_front ? 0 : cur.lastpos();
|
cur.pos() = enter_front ? 0 : cur.lastpos();
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
bool boundary, int & x, int & y) const;
|
bool boundary, int & x, int & y) const;
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front,
|
void edit(Cursor & cur, bool front,
|
||||||
EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION);
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ void MathMacro::validate(LaTeXFeatures & features) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathMacro::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void MathMacro::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
cur.updateFlags(Update::Force);
|
cur.updateFlags(Update::Force);
|
||||||
InsetMathNest::edit(cur, front, entry_from);
|
InsetMathNest::edit(cur, front, entry_from);
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
void cursorPos(BufferView const & bv, CursorSlice const & sl,
|
void cursorPos(BufferView const & bv, CursorSlice const & sl,
|
||||||
bool boundary, int & x, int & y) const;
|
bool boundary, int & x, int & y) const;
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirectionType entry_from)
|
void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirection entry_from)
|
||||||
{
|
{
|
||||||
updateLook();
|
updateLook();
|
||||||
cur.updateFlags(Update::Force);
|
cur.updateFlags(Update::Force);
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
///
|
///
|
||||||
EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
||||||
///
|
///
|
||||||
void edit(Cursor & cur, bool front, EntryDirectionType entry_from);
|
void edit(Cursor & cur, bool front, EntryDirection entry_from);
|
||||||
///
|
///
|
||||||
bool notifyCursorLeaves(Cursor & cur);
|
bool notifyCursorLeaves(Cursor & cur);
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user