add connection objects and assign to them to

work around a bug with some gcc compilers,
RHs 2.96 in particular.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4752 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-07-22 20:57:58 +00:00
parent c43fc67eff
commit 92c15c86a5
7 changed files with 218 additions and 170 deletions

View File

@ -118,8 +118,24 @@ extern int bibitemMaxWidth(BufferView *, LyXFont const &);
namespace {
const unsigned int saved_positions_num = 20;
unsigned int const saved_positions_num = 20;
// All the below connection objects are needed because of a bug in some
// versions of GCC (<=2.96 are on the suspects list.) By having and assigning
// to these connections we avoid a segfault upon startup, and also at exit.
// (Lgb)
boost::signals::connection timecon;
boost::signals::connection doccon;
boost::signals::connection resizecon;
boost::signals::connection bpresscon;
boost::signals::connection breleasecon;
boost::signals::connection motioncon;
boost::signals::connection doublecon;
boost::signals::connection triplecon;
boost::signals::connection kpresscon;
boost::signals::connection selectioncon;
boost::signals::connection lostcon;
} // anon namespace
@ -133,27 +149,27 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
screen_.reset(LyXScreenFactory::create(workarea()));
// Setup the signals
workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
workarea().workAreaResize
doccon = workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
resizecon = workarea().workAreaResize
.connect(boost::bind(&BufferView::Pimpl::workAreaResize, this));
workarea().workAreaButtonPress
bpresscon = workarea().workAreaButtonPress
.connect(boost::bind(&BufferView::Pimpl::workAreaButtonPress, this, _1, _2, _3));
workarea().workAreaButtonRelease
breleasecon = workarea().workAreaButtonRelease
.connect(boost::bind(&BufferView::Pimpl::workAreaButtonRelease, this, _1, _2, _3));
workarea().workAreaMotionNotify
motioncon = workarea().workAreaMotionNotify
.connect(boost::bind(&BufferView::Pimpl::workAreaMotionNotify, this, _1, _2, _3));
workarea().workAreaDoubleClick
doublecon = workarea().workAreaDoubleClick
.connect(boost::bind(&BufferView::Pimpl::doubleClick, this, _1, _2, _3));
workarea().workAreaTripleClick
triplecon = workarea().workAreaTripleClick
.connect(boost::bind(&BufferView::Pimpl::tripleClick, this, _1, _2, _3));
workarea().workAreaKeyPress
kpresscon = workarea().workAreaKeyPress
.connect(boost::bind(&BufferView::Pimpl::workAreaKeyPress, this, _1, _2));
workarea().selectionRequested
selectioncon = workarea().selectionRequested
.connect(boost::bind(&BufferView::Pimpl::selectionRequested, this));
workarea().selectionLost
lostcon = workarea().selectionLost
.connect(boost::bind(&BufferView::Pimpl::selectionLost, this));
cursor_timeout.timeout.connect(boost::bind(&BufferView::Pimpl::cursorToggle, this));
timecon = cursor_timeout.timeout.connect(boost::bind(&BufferView::Pimpl::cursorToggle, this));
cursor_timeout.start();
saved_positions.resize(saved_positions_num);
}
@ -376,7 +392,7 @@ void BufferView::Pimpl::updateScrollbar()
}
LyXText const & t = *bv_->text;
lyxerr[Debug::GUI] << "Updating scrollbar: h " << t.height << ", first_y "
<< t.first_y << ", default height " << t.defaultHeight() << endl;
@ -1301,15 +1317,15 @@ void BufferView::Pimpl::toggleToggle()
void BufferView::Pimpl::center()
{
LyXText * t = bv_->text;
beforeChange(t);
int const half_height = workarea().workHeight() / 2;
int new_y = 0;
if (t->cursor.y() > half_height) {
new_y = t->cursor.y() - half_height;
}
// FIXME: can we do this w/o calling screen directly ?
// This updates first_y but means the fitCursor() call
// from the update(FITCUR) doesn't realise that we might
@ -1317,10 +1333,10 @@ void BufferView::Pimpl::center()
// the scrollbar to be updated as it should, so we have
// to do it manually. Any operation that does a center()
// and also might have moved first_y must make sure to call
// updateScrollbar() currently. Never mind that this is a
// updateScrollbar() currently. Never mind that this is a
// pretty obfuscated way of updating t->first_y
screen().draw(t, bv_, new_y);
update(t, BufferView::SELECT | BufferView::FITCUR);
}
@ -3267,7 +3283,7 @@ void BufferView::Pimpl::insertAndEditInset(Inset * inset)
if (gotsel)
owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION);
}
else
else
delete inset;
#endif
}

View File

@ -1,20 +1,25 @@
2002-07-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* BufferView_pimpl.C: add connection objects and use them...
(Pimpl): here.
2002-07-22 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* MenuBackend.C (expandLastfiles):
(expandDocuments):
(expandFormats):
(expandFloatListInsert):
(expandFloatInsert):
* MenuBackend.C (expandLastfiles):
(expandDocuments):
(expandFormats):
(expandFloatListInsert):
(expandFloatInsert):
(expand): split expand in parts
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: use lyx_gui::exit()
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* LyXAction.C: show the failing pseudo action
2002-07-22 Dekel Tsur <dekelts@tau.ac.il>
* buffer.C (readFile): Run the lyxconvert script in order to read
@ -31,16 +36,16 @@
* LyXAction.C:
* commandtags.h:
* lyxfunc.C: remove LFUN_TOOLBAR_PUSH
2002-07-22 Herbert Voss <voss@lyx.org>
* lengthcommon.C:
* lyxlength.[Ch]: add support for the vertical lengths
2002-07-21 John Levon <moz@compsoc.man.ac.uk>
* toc.[Ch]: std:: fixes
2002-07-21 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* lyxrc.C: do not include lyx_main.h
@ -48,26 +53,26 @@
* LaTeXFeatures.h: use a list<string> instead of a vector<string>
for layouts
* lyxrc.C:
* encoding.C:
* bufferlist.C:
* lyxrc.C:
* encoding.C:
* bufferlist.C:
* BufferView2.C: include "lyxlex.h"
* tabular.h:
* tabular.h:
* bufferparams.h: do not #include "lyxlex.h"
* lyxtextclasslist.C (Add): remove method
(classlist): renamed to classlist_
* paragraph_pimpl.C:
* paragraph.C:
* text2.C:
* CutAndPaste.C:
* bufferview_funcs.C:
* bufferlist.C:
* text.C:
* LaTeXFeatures.C:
* buffer.C:
* paragraph_pimpl.C:
* paragraph.C:
* text2.C:
* CutAndPaste.C:
* bufferview_funcs.C:
* bufferlist.C:
* text.C:
* LaTeXFeatures.C:
* buffer.C:
* toc.C (getTocList): use BufferParams::getLyXTextClass
* toc.C (getTocList): use InsetFloat::addToToc
@ -102,17 +107,17 @@
2002-07-20 John Levon <moz@compsoc.man.ac.uk>
* paragraph_pimpl.C: constify
* paragraph_pimpl.C: constify
* BufferView_pimpl.C:
* LaTeX.C:
* lyxfunc.C: fix dispatch in a nicer way
2002-07-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* lyxfunc.C (dispatch):
* BufferView_pimpl.C:
* BufferView_pimpl.h:
* lyxfunc.C (dispatch):
* BufferView_pimpl.C:
* BufferView_pimpl.h:
* BufferView.C:
* BufferView.h: rename Dispatch() to dispatch()
@ -145,12 +150,12 @@
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: move minibuffer completion handling out of here
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.C:
* LaTeX.C: fix dispatch calls
2002-07-19 Dekel Tsur <dekelts@tau.ac.il>
* text.C (drawChars): Fix Arabic text rendering.
@ -160,12 +165,12 @@
* LyXAction.C:
* commandtags.h:
* lyxfunc.C: remove message-push/pop
* lyxserver.C:
* lyxfunc.h:
* lyxfunc.C: rationalise some code by removing verboseDispatch
in favour of a bool argument to dispatch()
2002-07-17 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* lyx_main.C (init): make sure to read symlinks as absolute paths
@ -176,7 +181,7 @@
* lyxfunc.C: no need for commandshortcut to be a member
2002-07-15 André Pönitz <poenitz@gmx.net>
* converter.C: add support for $$s (scripts from lib/scripts dir)
* lyx_main.C: white space
@ -186,16 +191,16 @@
* bufferlist.C:
* lyxrc.h:
* lyxrc.C: remove second exit confirmation
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
* BufferView.h:
* BufferView.C:
* BufferView2.C:
* BufferView.C:
* BufferView2.C:
* BufferView_pimpl.h:
* BufferView_pimpl.C:
* lyxfunc.C: s/setState/switchKeyMap/, s/showState/view_state_changed/
* lyxfunc.C: s/setState/switchKeyMap/, s/showState/view_state_changed/
2002-07-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* MenuBackend.C (expand): add numeric shortcuts to document menu
@ -204,26 +209,26 @@
2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* lyxfont.C (setLyXFamily):
(setLyXSeries):
(setLyXShape):
(setLyXSize):
(setLyXMisc):
(lyxRead):
* debug.C (value):
* lyxfont.C (setLyXFamily):
(setLyXSeries):
(setLyXShape):
(setLyXSize):
(setLyXMisc):
(lyxRead):
* debug.C (value):
* buffer.C (asciiParagraph): use ascii_lowercase
2002-07-15 Mike Fabian <mfabian@suse.de>
* lyxlex_pimpl.C (search_kw):
* lyxlex.C (getLongString):
* converter.h (operator<):
* converter.C (operator<):
* buffer.C (parseSingleLyXformat2Token):
(asciiParagraph):
* ToolbarDefaults.C (read):
* MenuBackend.C (checkShortcuts):
(read):
* lyxlex_pimpl.C (search_kw):
* lyxlex.C (getLongString):
* converter.h (operator<):
* converter.C (operator<):
* buffer.C (parseSingleLyXformat2Token):
(asciiParagraph):
* ToolbarDefaults.C (read):
* MenuBackend.C (checkShortcuts):
(read):
* LColor.C (getFromGUIName):
(getFromLyXName): use the compare_ascii_no_case instead of
compare_no_case, because in turkish, 'i' is not the lowercase
@ -237,14 +242,14 @@
2002-07-15 John Levon <moz@compsoc.man.ac.uk>
* BufferView.C (resize): check there's a buffer to resize
2002-07-14 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: remove dead code
* lyxserver.h:
* lyxserver.C: use lyx_guii::set_read_callback
2002-07-13 Dekel Tsur <dekelts@tau.ac.il>
* lyxfunc.C (dispatch): Correct cursor behaviour when exiting
@ -261,30 +266,30 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: use lyx_gui::update_fonts()
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: use lyx_gui::update_color()
2002-07-11 John Levon <moz@compsoc.man.ac.uk>
* bufferlist.C:
* lyxfunc.h:
* lyxfunc.h:
* lyxfunc.C:
* lyxrc.h:
* lyxrc.C: remove file->new asks for name option, and let
buffer-new take an argument
2002-07-11 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.C: remove unneeded extra repaint()
2002-07-10 John Levon <moz@compsoc.man.ac.uk>
* LyXAction.C: allow command-sequence with NoBuffer
* lyxfunc.C: don't insist on trailing ';' for command-sequence
2002-07-10 Angus Leeming <leeming@lyx.org>
* lyxrc.[Ch]: preview_scale_factor should be a float not an int.
@ -296,12 +301,12 @@
2002-07-09 John Levon <moz@compsoc.man.ac.uk>
* lengthcommon.h: whitespace
* lyxfunc.C: update scrollbar after goto paragraph
* lyxfunc.C: update scrollbar after goto paragraph
* lyxtext.h: factor out page break drawing, and fix it so
page break/added space paints as selected nicely
2002-07-09 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.C: add FIXMEs, clean up a little
@ -312,7 +317,7 @@
2002-07-08 André Pönitz <poenitz@gmx.net>
* BufferView_pimpl.C: apply John's patch for #93.
* BufferView_pimpl.C: apply John's patch for #93.
2002-07-05 Angus Leeming <leeming@lyx.org>

View File

@ -1,3 +1,12 @@
2002-07-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* XMiniBuffer.h: add connection objects, and use them
* XMiniBuffer.C (XMiniBuffer): here and
(dd_init): here
* XFormsView.h: add connection objects, use them
* XFormsView.C (XFormsView): here
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* XFormsView.C: don't call toolbar_->set()
@ -9,21 +18,21 @@
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add lyx_gui::exit()
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* Toolbar_pimpl.h:
* Toolbar_pimpl.C: remove ->push()
* Toolbar_pimpl.C: remove ->push()
2002-07-22 Herbert Voss <voss@lyx.org>
* FormGraphics.C: add tooltips, changesize_type to size_kind.
some rearrangements to the code
2002-07-21 John Levon <moz@compsoc.man.ac.uk>
* FormToc.C: std:: fix
2002-07-21 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.h: do not include "MenuBackend.h" and "commandtags.h"
@ -33,11 +42,11 @@
* Toolbar_pimpl.C: use BufferParams::getLyXTextClass
* FormSendto.C:
* FormParagraph.C:
* FormMinipage.C:
* FormGraphics.C:
* FormForks.C:
* FormSendto.C:
* FormParagraph.C:
* FormMinipage.C:
* FormGraphics.C:
* FormForks.C:
* FormCitation.C:
* DropDown.C: update to use new getString and getVector
@ -46,13 +55,13 @@
getStringFromBrowser and getSelectedStringFromBrowser with
getString, which works with input, choice and browser objects
* Menubar_pimpl.C:
* Menubar_pimpl.C:
* FormToc.C: update to use new toc.[Ch]
2002-07-21 John Levon <moz@compsoc.man.ac.uk>
* XFormsView.C: move autosave timer to LyXView.C
2002-07-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.[Ch]: remove support for multiple menubars
@ -61,16 +70,16 @@
* XMiniBuffer.h:
* XMiniBuffer.C: cleanup, make start/end history work as before
2002-07-20 John Levon <moz@compsoc.man.ac.uk>
* FormMathsDelim.C:
* FormMathsMatrix.C: fix dispatch calls nicely
2002-07-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.C (add_toc): avoid crash when there is no document
open
open
* Menubar_pimpl.[Ch]: turn owner_ into a XFormsView, to avoid casting
@ -83,29 +92,29 @@
* DropDown.h:
* DropDown.C: remove unneeded LyXView *
* XFormsView.h:
* XFormsView.C: changes for minibuffer rework
* XMiniBuffer.h:
* XMiniBuffer.C: use ControlCommandBuffer. Move relevant
old code to here
* lyx_gui.C: add FIXME
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* FormMathsDelim.C:
* FormMathsDelim.C:
* FormMathsMatrix.C: fix dispatch calls
2002-07-18 John Levon <moz@compsoc.man.ac.uk>
* Menubar_pimpl.C:
* Toolbar_pimpl.C:
* Menubar_pimpl.C:
* Toolbar_pimpl.C:
* lyx_gui.C:
* XformsView.C: remove initMiniBuffer(), verboseDispatch()
* xfont_loader.C: remove call to messagePush(),Pop()
* xfont_loader.C: remove call to messagePush(),Pop()
2002-07-17 Dekel Tsur <dekelts@tau.ac.il>
@ -125,12 +134,12 @@
* FormPreferences.C:
* forms/form_preferences.fd: remove 2nd exit confirmation
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
* XFormsView.h:
* XFormsView.C: hook up view_state_changed
2002-07-16 Angus Leeming <leeming@lyx.org>
* XPainter.C: add some #ifdef ugliness to enable the home grown image
@ -146,7 +155,7 @@
* xformsImage.C: add isDrawable()
* XPainter.C: use static cast to xformsImage
2002-07-14 Angus Leeming <leeming@lyx.org>
* lyx_gui.C (C_read_callback): give it extern "C" linkage.
@ -154,11 +163,11 @@
2002-07-14 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add set_read_callback()
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: move init_graphics() into setup
2002-07-12 Angus Leeming <leeming@lyx.org>
* xformsImage.C (width): apply fudge irrespective of library version.
@ -167,40 +176,40 @@
* Toolbar_pimpl.h:
* Toolbar_pimpl.C: remove unused (de)activate()
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: implement update_fonts(), font_available()
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add update_color()
2002-07-11 John Levon <moz@compsoc.man.ac.uk>
* FormPreferences.C:
* forms/form_preferences.fd: remove file->new asks for name
2002-07-11 John Levon <moz@compsoc.man.ac.uk>
* XWorkArea.h:
* XWorkArea.C: do a copy area on redraw when no geometry change
2002-07-11 Herbert Voss <voss@perce.de>
* FormGraphics.C (input): test also the height for %-value, when
importing the latex-value into the lyx-view
* FormGraphics.C (input): test also the height for %-value, when
importing the latex-value into the lyx-view
2002-07-10 Andrew Zabolotny <zap@cobra.ru>
* XMiniBuffer.C (peek_event):
* combox.C (peek_event):
* XMiniBuffer.C (peek_event):
* combox.C (peek_event):
* DropDown.C (peek): support keypad keys
2002-07-09 John Levon <moz@compsoc.man.ac.uk>
* xscreen.C: add const
2002-07-09 Angus Leeming <leeming@lyx.org>
* xformsImage.C (scale): use boost::tie.

View File

@ -35,7 +35,7 @@
#include "BufferView.h"
#include <boost/bind.hpp>
#include <boost/signals/connection.hpp>
using std::abs;
using std::endl;
@ -62,12 +62,12 @@ XFormsView::XFormsView(int width, int height)
create_form_form_main(*getDialogs(), width, height);
fl_set_form_atclose(getForm(), C_XFormsView_atCloseMainFormCB, 0);
view_state_changed.connect(boost::bind(&XFormsView::show_view_state, this));
focus_command_buffer.connect(boost::bind(&XMiniBuffer::focus, minibuffer_.get()));
view_state_con = view_state_changed.connect(boost::bind(&XFormsView::show_view_state, this));
focus_con = focus_command_buffer.connect(boost::bind(&XMiniBuffer::focus, minibuffer_.get()));
// Make sure the buttons are disabled if needed.
updateToolbar();
getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
redraw_con = getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
}
@ -196,13 +196,13 @@ void XFormsView::message(string const & str)
minibuffer_->message(str);
}
void XFormsView::show_view_state()
{
message(getLyXFunc()->view_status_message());
}
// How should this actually work? Should it prohibit input in all BufferViews,
// or just in the current one? If "just the current one", then it should be
// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should

View File

@ -54,7 +54,7 @@ public:
/// callback for close event from window manager
static int atCloseMainFormCB(FL_FORM *, void *);
/// display a status message
virtual void message(string const & str);
@ -73,6 +73,13 @@ private:
void create_form_form_main(Dialogs & d, int width, int height);
/// the minibuffer
boost::scoped_ptr<XMiniBuffer> minibuffer_;
///
boost::signals::connection view_state_con;
///
boost::signals::connection focus_con;
///
boost::signals::connection redraw_con;
/// the main form.
FL_FORM * form_;
};

View File

@ -44,24 +44,24 @@ XMiniBuffer::XMiniBuffer(XFormsView * v, ControlCommandBuffer & control,
input_obj_ = create_input_box(FL_NORMAL_INPUT, x, y, h, w);
info_timer_.reset(new Timeout(1500));
idle_timer_.reset(new Timeout(6000));
info_timer_->timeout.connect(boost::bind(&XMiniBuffer::info_timeout, this));
idle_timer_->timeout.connect(boost::bind(&XMiniBuffer::idle_timeout, this));
idle_timer_->start();
info_con = info_timer_->timeout.connect(boost::bind(&XMiniBuffer::info_timeout, this));
idle_con = idle_timer_->timeout.connect(boost::bind(&XMiniBuffer::idle_timeout, this));
idle_timer_->start();
messageMode();
}
// This is here so that scoped ptr will not require a complete type.
XMiniBuffer::~XMiniBuffer()
{}
// thanks for nothing, xforms (recursive creation not allowed)
void XMiniBuffer::dd_init()
{
dropdown_.reset(new DropDown(the_buffer_));
dropdown_->result.connect(boost::bind(&XMiniBuffer::set_complete_input, this, _1));
dropdown_->keypress.connect(boost::bind(&XMiniBuffer::append_char, this, _1));
}
XMiniBuffer::~XMiniBuffer()
{
result_con = dropdown_->result.connect(boost::bind(&XMiniBuffer::set_complete_input, this, _1));
keypress_con = dropdown_->keypress.connect(boost::bind(&XMiniBuffer::append_char, this, _1));
}
@ -82,7 +82,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
info_timer_->stop();
info_timeout();
}
char const * tmp = fl_get_input(ob);
input = tmp ? tmp : "";
@ -100,7 +100,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
}
return 1;
}
case XK_Up:
#ifdef XK_KP_Up
case XK_KP_Up:
@ -114,13 +114,13 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
}
return 1;
}
case 9:
case XK_Tab:
{
string new_input;
vector<string> comp = controller_.completions(input, new_input);
if (comp.empty() && new_input == input) {
show_info(_("[no match]"), input);
break;
@ -131,7 +131,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
show_info(("[only completion]"), new_input + " ");
break;
}
set_input(new_input);
int x,y,w,h;
@ -215,7 +215,7 @@ void XMiniBuffer::freeze()
fl_set_object_prehandler(input_obj_, 0);
}
void XMiniBuffer::show_info(string const & info, string const & input, bool append)
{
stored_input_ = input;
@ -226,21 +226,21 @@ void XMiniBuffer::show_info(string const & info, string const & input, bool appe
set_input(info);
info_timer_->start();
}
void XMiniBuffer::idle_timeout()
{
set_input(currentState(view_->view()));
}
void XMiniBuffer::info_timeout()
{
info_shown_ = false;
set_input(stored_input_);
}
bool XMiniBuffer::isEditingMode() const
{
return the_buffer_->focus;
@ -284,8 +284,8 @@ void XMiniBuffer::append_char(char c)
fl_set_input(the_buffer_, str.c_str());
}
void XMiniBuffer::set_complete_input(string const & str)
{
if (!str.empty()) {
@ -293,8 +293,8 @@ void XMiniBuffer::set_complete_input(string const & str)
// an argument immediately
set_input(str + " ");
}
}
}
void XMiniBuffer::message(string const & str)
{
@ -302,7 +302,7 @@ void XMiniBuffer::message(string const & str)
set_input(str);
}
void XMiniBuffer::set_input(string const & str)
{
fl_set_input(the_buffer_, str.c_str());

View File

@ -15,7 +15,8 @@
#include FORMS_H_LOCATION
#include <boost/scoped_ptr.hpp>
#include <boost/signals/connection.hpp>
#ifdef __GNUG__
#pragma interface
#endif
@ -27,9 +28,11 @@ class Timeout;
/// in xforms, the minibuffer is both a status bar and a command buffer
class XMiniBuffer {
public:
///
XMiniBuffer(XFormsView * o, ControlCommandBuffer & control,
FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w);
///
~XMiniBuffer();
/// create drop down
@ -43,14 +46,14 @@ public:
/// show a message
void message(string const & str);
/// focus the buffer for editing mode
void focus() { messageMode(false); }
/// disable event management
void freeze();
protected:
private:
/// Are we in editing mode?
bool isEditingMode() const;
@ -59,14 +62,14 @@ protected:
/// go back to "at rest" message
void idle_timeout();
/**
* Append "c" to the current input contents when the completion
* list is displayed and has focus.
*/
void append_char(char c);
/// completion selection callback
/// completion selection callback
void set_complete_input(string const & str);
/// set the minibuffer content in editing mode
@ -77,7 +80,7 @@ protected:
/// go into message mode
void messageMode(bool on = true);
/// show a temporary message whilst in edit mode
void show_info(string const & info, string const & input, bool append = true);
@ -89,13 +92,21 @@ protected:
/// idle timer
boost::scoped_ptr<Timeout> idle_timer_;
///
boost::signals::connection info_con;
///
boost::signals::connection idle_con;
///
boost::signals::connection result_con;
///
boost::signals::connection keypress_con;
/// This is the input widget object
FL_OBJECT * the_buffer_;
/// the input box
FL_OBJECT * input_obj_;
/// the controller we use
ControlCommandBuffer & controller_;
@ -108,5 +119,5 @@ protected:
/// are we showing an informational temporary message ?
bool info_shown_;
};
#endif // XMINIBUFFER_H