BufferView::BufferView(LyXView * owner)
: owner_(owner), buffer_(0), wh_(0),
cursor_(*this),
- multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0)
+ multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
+ intl_(new Intl)
{
xsel_cache_.set = false;
saved_positions[bm->get<0>()] = Position( bm->get<1>(), bm->get<2>(), bm->get<3>() );
// and then clear them
bmList.clear();
+
+ intl_->initKeyMapper(lyxrc.use_kbmap);
}
if (!lyxrc.rtl_support)
return;
- Intl & intl = owner_->getIntl();
if (getLyXText()->real_current_font.isRightToLeft()) {
- if (intl.keymap == Intl::PRIMARY)
- intl.keyMapSec();
+ if (intl_->keymap == Intl::PRIMARY)
+ intl_->keyMapSec();
} else {
- if (intl.keymap == Intl::SECONDARY)
- intl.keyMapPrim();
+ if (intl_->keymap == Intl::SECONDARY)
+ intl_->keyMapPrim();
}
}
}
-int BufferView::offset_ref() const
-{
- return offset_ref_;
-}
-
-
ViewMetricsInfo const & BufferView::viewMetricsInfo()
{
return metrics_info_;
class DocIterator;
class FuncRequest;
class FuncStatus;
+class Intl;
class Language;
class LCursor;
class LyXText;
/// a function should be executed from the workarea
bool workAreaDispatch(FuncRequest const & ev);
- /// access to offset
- int offset_ref() const;
/// access to anchor
lyx::pit_type anchor_ref() const;
///
void updateMetrics(bool singlepar = false);
+ /// get this view's keyboard map handler
+ Intl & getIntl() { return *intl_.get(); }
+ ///
+ Intl const & getIntl() const { return *intl_.get(); }
+
/// This signal is emitted when some message shows up.
boost::signal<void(lyx::docstring)> message;
lyx::pit_type anchor_ref_;
///
int offset_ref_;
+
+ /// keyboard mapping object
+ boost::scoped_ptr<Intl> const intl_;
};
#endif // BUFFERVIEW_H
: work_area_(0),
owner_(owner),
toolbars_(new Toolbars(*this)),
- intl_(new Intl),
autosave_timeout_(new Timeout(5000)),
lyxfunc_(new LyXFunc(this)),
dialogs_(new Dialogs(*this)),
autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
autosave_timeout_->start();
}
-
- intl_->initKeyMapper(lyxrc.use_kbmap);
}
class Buffer;
class InsetBase;
-class Intl;
class Menubar;
class BufferView;
///
Dialogs const & getDialogs() const { return *dialogs_.get(); }
- /// get this view's keyboard map handler
- Intl & getIntl() { return *intl_.get(); }
- ///
- Intl const & getIntl() const { return *intl_.get(); }
-
//@}
/// load a buffer into the current workarea
/// view's toolbar
boost::scoped_ptr<Toolbars> toolbars_;
- /// keyboard mapping object
- boost::scoped_ptr<Intl> const intl_;
/// auto-saving of buffers
boost::scoped_ptr<Timeout> const autosave_timeout_;
/// our function handler
c = 0;
}
- owner->getIntl().getTransManager()
+ owner->view()->getIntl().getTransManager()
.deadkey(c, get_accent(action).accent, view()->getLyXText());
// Need to clear, in case the minibuffer calls these
// actions
break;
case LFUN_KEYMAP_OFF:
- owner->getIntl().keyMapOn(false);
+ owner->view()->getIntl().keyMapOn(false);
break;
case LFUN_KEYMAP_PRIMARY:
- owner->getIntl().keyMapPrim();
+ owner->view()->getIntl().keyMapPrim();
break;
case LFUN_KEYMAP_SECONDARY:
- owner->getIntl().keyMapSec();
+ owner->view()->getIntl().keyMapSec();
break;
case LFUN_KEYMAP_TOGGLE:
- owner->getIntl().toggleKeyMap();
+ owner->view()->getIntl().toggleKeyMap();
break;
case LFUN_REPEAT: {
string::const_iterator cit = str.begin();
string::const_iterator end = str.end();
for (; cit != end; ++cit)
- view_->owner()->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
+ view_->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
// remove ourselves
//view_->owner()->dispatch(LFUN_ESCAPE);
case LFUN_CHAR_DELETE_BACKWARD:
if (!cur.selection()) {
- if (bv->owner()->getIntl().getTransManager().backspace()) {
+ if (bv->getIntl().getTransManager().backspace()) {
// Par boundary, full-screen update
if (cur.pos() == 0)
singleParUpdate = false;
docstring::const_iterator end = cmd.argument().end();
for (; cit != end; ++cit)
#if 0
- bv->owner()->getIntl().getTransManager().
+ bv->getIntl().getTransManager().
translateAndInsert(*cit, this);
#else
insertChar(bv->cursor(), *cit);
bv->owner()->getLyXFunc().handleKeyFunc(cmd.action);
if (!cmd.argument().empty())
// FIXME: Are all these characters encoded in one byte in utf8?
- bv->owner()->getIntl().getTransManager()
+ bv->getIntl().getTransManager()
.translateAndInsert(cmd.argument()[0], this);
break;