case FL_KEYPRESS:
{
lyxerr[Debug::WORKAREA] << "Workarea event: KEYPRESS" << endl;
-
- KeySym keysym = 0;
- char dummy[1];
XKeyEvent * xke = reinterpret_cast<XKeyEvent *>(ev);
- XLookupString(xke, dummy, 1, &keysym, 0);
if (lyxerr.debugging(Debug::KEY)) {
char const * const tmp = XKeysymToString(key);
- char const * const tmp2 = XKeysymToString(keysym);
- string const stm = (tmp ? tmp : string());
- string const stm2 = (tmp2 ? tmp2 : string());
-
- lyxerr << "XWorkArea: Key is `" << stm
- << "' [" << key << "]\n"
- << "XWorkArea: Keysym is `" << stm2
- << "' [" << keysym << ']' << endl;
+ lyxerr << "XWorkArea: Key is `" << tmp
+ << "' [" << key << "]" << endl;
}
- // Note that we need this handling because of a bug
- // in XForms 0.89, if this bug is resolved in the way I hope
- // we can just use the keysym directly without looking
- // at key at all. (Lgb)
- KeySym ret_key = 0;
if (!key) {
- // We might have to add more keysyms here also,
- // we will do that as the issues arise. (Lgb)
- if (keysym == XK_space) {
- ret_key = keysym;
- lyxerr[Debug::KEY] << "Using keysym [A]"
- << endl;
- } else
- break;
- } else {
- // It seems that this was a bit optimistic...
- // With this hacking things seems to be better (Lgb)
- //if (!iscntrl(key)) {
- // ret_key = key;
- // lyxerr[Debug::KEY]
- // << "Using key [B]\n"
- // << "Uchar["
- // << static_cast<unsigned char>(key)
- // << endl;
- //} else {
- ret_key = (keysym ? keysym : key);
- lyxerr[Debug::KEY] << "Using keysym [B]"
- << endl;
- //}
+ lyxerr << "Probably composing" << endl;
+ break;
}
+ KeySym ret_key = key;
unsigned int const ret_state = xke->state;
// If you have a better way to handle "wild-output" of
+2003-02-25 Alfredo Braunstein <abraunst@libero.it>
+
+ * GraphicsConverter (startConversion): add the call to
+ ForkedCallQueue::add
+
+ * GraphicsLoader.[Ch],
+ * PreviewImage.[Ch],
+ * PreviewedInset.C: Removed unneeded BufferView
+
2003-02-25 Alfredo Braunstein <abraunst@libero.it>
* LoaderQueue.[Ch]: a simplification of the code, eliminated
#include "GraphicsLoader.h"
-#include "BufferView.h"
-
#include "GraphicsCache.h"
#include "GraphicsCacheItem.h"
#include "GraphicsImage.h"
#include "LoaderQueue.h"
#include "frontends/LyXView.h"
-#include "frontends/Timeout.h"
-#include <boost/weak_ptr.hpp>
#include <boost/bind.hpp>
#include <boost/signals/trackable.hpp>
void createPixmap();
///
- void startLoading(Inset const &, BufferView const &);
+ void startLoading(Inset const &);
/// The loading status of the image.
ImageStatus status_;
typedef std::list<Inset const *> InsetList;
///
InsetList insets;
- ///
- boost::weak_ptr<BufferView const> view;
};
}
-void Loader::startLoading(Inset const & inset, BufferView const & bv) const
+void Loader::startLoading(Inset const & inset) const
{
if (pimpl_->status_ != WaitingToLoad || !pimpl_->cached_item_.get())
return;
- pimpl_->startLoading(inset, bv);
+ pimpl_->startLoading(inset);
}
}
-void Loader::Impl::startLoading(Inset const & inset, BufferView const & bv)
+void Loader::Impl::startLoading(Inset const & inset)
{
if (status_ != WaitingToLoad)
return;
it = std::find(it, end, &inset);
if (it == end)
insets.push_back(&inset);
- view = bv.owner()->view();
LoaderQueue::get().touch(cached_item_);
}
/// We are explicit about when we begin the loading process.
void startLoading() const;
- /** starting loading of the image is conditional upon the
- * inset being visible or not.
+ /** starting loading of the image is done by a urgency-based
+ * decision. Here we only call LoaderQueue::touch to request it.
*/
- void startLoading(Inset const &, BufferView const &) const;
+ void startLoading(Inset const &) const;
/** Monitor any changes to the file.
* There is no point monitoring the file before startLoading() is
///
~Impl();
///
- Image const * image(Inset const &, BufferView const &);
+ Image const * image(Inset const &);
///
void statusChanged();
}
-Image const * PreviewImage::image(Inset const & inset,
- BufferView const & bv) const
+Image const * PreviewImage::image(Inset const & inset) const
{
- return pimpl_->image(inset, bv);
+ return pimpl_->image(inset);
}
}
-Image const * PreviewImage::Impl::image(Inset const & inset,
- BufferView const & bv)
+Image const * PreviewImage::Impl::image(Inset const & inset)
{
if (iloader_.status() == WaitingToLoad)
- iloader_.startLoading(inset, bv);
+ iloader_.startLoading(inset);
return iloader_.image();
}
/** If the image is not yet loaded (WaitingToLoad), then this method
* triggers that.
- * inset and bv are passed so we can choose to load only
- * those insets that are visible.
*/
- Image const * image(Inset const & inset, BufferView const & bv) const;
+ Image const * image(Inset const & inset) const;
private:
/// Use the Pimpl idiom to hide the internals.
if (!pimage_)
return false;
- return pimage_->image(inset_, *view());
+ return pimage_->image(inset_);
}
+2003-02-25 Alfredo Braunstein <abraunst@libero.it>
+
+ * insetgraphics.C (draw)
+ * insetinclude.C (draw): Eliminate Buferview argument in call to
+ PreviewImage::image
+
2003-02-25 John Levon <levon@movementarian.org>
* insetgraphicsParams.h:
if (gparams.display != grfx::NoDisplay
&& cache_->loader.status() == grfx::WaitingToLoad)
- cache_->loader.startLoading(*this, *bv);
+ cache_->loader.startLoading(*this);
if (!cache_->loader.monitoring())
cache_->loader.startMonitoring();
int const h = a + d;
bv->painter().image(x, y - a, w, h,
- *(preview_->pimage()->image(*this, *bv)));
+ *(preview_->pimage()->image(*this)));
xx += w;
}
if (use_preview) {
pi.pain.image(x + 1, y - a, w, h, // one pixel gap in front
- *(preview_->pimage()->image(*this, *bv)));
+ *(preview_->pimage()->image(*this)));
} else {
pi.base.style = LM_ST_TEXT;
pi.base.font = font;
#include "textpainter.h"
#include "frontends/Dialogs.h"
#include "intl.h"
-#include "insets/insetcommand.h"
#include "ref_inset.h"
using std::endl;
case LFUN_DIALOG_SHOW_NEW_INSET: {
string const & name = argument;
if (name == "ref") {
- InsetCommandParams p(name);
- string data = InsetCommandMailer::params2string(p);
+ string data = "LatexCommand \\ref{}\n\\end_inset\n\n";
bv->owner()->getDialogs().show(name, data, 0);
} else
result = UNDISPATCHED;
break;
case LFUN_REF_APPLY: {
- InsetCommandParams params;
- InsetCommandMailer::string2params(argument, params);
+ // argument comes with a head "LatexCommand " and a
+ // tail "\nend_inset\n\n". Strip them off.
+ string trimmed;
+ string body = split(argument, trimmed, ' ');
+ split(body, trimmed, '\n');
+ lyxerr << "passing '" << trimmed << "' to the math parser\n";
+
+ MathAtom at;
+ if (!mathed_parse_normal(at, trimmed)) {
+ result = UNDISPATCHED;
+ break;
+ }
- // It would be nice if RefInset could handle an
- // InsetCommandParams arg, but for now we convert it to
- // 'foo|++|bar|++|nonsense'.
- string const tmp = params.getAsString();
+ RefInset * tmp = at.nucleus()->asRefInset();
+ if (!tmp) {
+ result = UNDISPATCHED;
+ break;
+ }
InsetBase * base =
bv->owner()->getDialogs().getOpenInset("ref");
break;
}
- *inset = RefInset(tmp);
+ *inset = *tmp;
} else {
- mathcursor->insert(MathAtom(new RefInset(tmp)));
+ mathcursor->insert(at);
}
updateLocal(bv, true);
}