#include "lyxtext.h"
#include "lyxcursor.h"
#include "CutAndPaste.h"
-#include "font.h"
+#include "frontends/font_metrics.h"
#include "LColor.h"
#include "lyxrow.h"
#include "lyxrc.h"
#include "intl.h"
#include "trans_mgr.h"
-#include "lyxscreen.h"
+#include "frontends/screen.h"
#include "gettext.h"
#include "lyxfunc.h"
#include "ParagraphParameters.h"
}
-void InsetText::edit(BufferView * bv, int x, int y, unsigned int button)
+void InsetText::edit(BufferView * bv, int x, int y, mouse_button::state button)
{
UpdatableInset::edit(bv, x, y, button);
// we put here -1 and not button as now the button in the
// edit call should not be needed we will fix this in 1.3.x
// cycle hopefully (Jug 20020509)
- if (!checkAndActivateInset(bv, x, tmp_y, -1)) {
+ // FIXME: GUII I've changed this to none: probably WRONG
+ if (!checkAndActivateInset(bv, x, tmp_y, mouse_button::none)) {
lt->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
lt->cursor.x_fix(lt->cursor.x());
}
-void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
+void InsetText::insetButtonPress(BufferView * bv,
+ int x, int y, mouse_button::state button)
{
no_selection = true;
return;
}
}
- if (!inset) { // && (button == 2)) {
+ if (!inset) { // && (button == mouse_button::button2)) {
bool paste_internally = false;
- if ((button == 2) && getLyXText(bv)->selection.set()) {
+ if ((button == mouse_button::button2) && getLyXText(bv)->selection.set()) {
localDispatch(bv, LFUN_COPY, "");
paste_internally = true;
}
// Insert primary selection with middle mouse
// if there is a local selection in the current buffer,
// insert this
- if (button == 2) {
+ if (button == mouse_button::button2) {
if (paste_internally)
localDispatch(bv, LFUN_PASTE, "");
else
}
-bool InsetText::insetButtonRelease(BufferView * bv, int x, int y, int button)
+bool InsetText::insetButtonRelease(BufferView * bv,
+ int x, int y, mouse_button::state button)
{
no_selection = true;
if (the_locking_inset) {
}
-void InsetText::insetMotionNotify(BufferView * bv, int x, int y, int state)
+void InsetText::insetMotionNotify(BufferView * bv, int x, int y, mouse_button::state state)
{
if (the_locking_inset) {
the_locking_inset->insetMotionNotify(bv, x - inset_x,
}
-void InsetText::insetKeyPress(XKeyEvent * xke)
-{
- if (the_locking_inset) {
- the_locking_inset->insetKeyPress(xke);
- return;
- }
-}
-
-
UpdatableInset::RESULT
InsetText::localDispatch(BufferView * bv,
kb_action action, string const & arg)
LyXFont const font(getLyXText(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv)));
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
-
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
+
if (isCursorVisible())
bv->hideLockedInsetCursor();
else
if (!isCursorVisible()) {
LyXFont const font =
getLyXText(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv));
-
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
+
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
bv->fitLockedInsetCursor(cx(bv), cy(bv), asc, desc);
if (show)
}
LyXFont const font =
getLyXText(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv));
-
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
+
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
if (bv->fitLockedInsetCursor(cx(bv), cy(bv), asc, desc))
need_update |= FULL;
bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
- int button)
+ mouse_button::state button)
{
x -= drawTextXOffset;
int dummyx = x;
// we only do the edit() call if the inset was hit by the mouse
// or if it is a highly editable inset. So we should call this
// function from our own edit with button < 0.
- if (button < 0 && !isHighlyEditableInset(inset))
+ // FIXME: GUII jbl. I've changed this to ::none for now which is probably
+ // WRONG
+ if (button == mouse_button::none && !isHighlyEditableInset(inset))
return false;
if (inset) {