From 92c15c86a5fa16004f7a6a6eb77eed1f0af5526d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 22 Jul 2002 20:57:58 +0000 Subject: [PATCH] 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 --- src/BufferView_pimpl.C | 54 ++++++++---- src/ChangeLog | 137 +++++++++++++++-------------- src/frontends/xforms/ChangeLog | 89 ++++++++++--------- src/frontends/xforms/XFormsView.C | 16 ++-- src/frontends/xforms/XFormsView.h | 9 +- src/frontends/xforms/XMiniBuffer.C | 48 +++++----- src/frontends/xforms/XMiniBuffer.h | 35 +++++--- 7 files changed, 218 insertions(+), 170 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 2483a3aa9c..78e5740e92 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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 } diff --git a/src/ChangeLog b/src/ChangeLog index cacc762abc..c727c4b8e4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,20 +1,25 @@ +2002-07-22 Lars Gullik Bjønnes + + * BufferView_pimpl.C: add connection objects and use them... + (Pimpl): here. + 2002-07-22 Jean-Marc Lasgouttes - * MenuBackend.C (expandLastfiles): - (expandDocuments): - (expandFormats): - (expandFloatListInsert): - (expandFloatInsert): + * MenuBackend.C (expandLastfiles): + (expandDocuments): + (expandFormats): + (expandFloatListInsert): + (expandFloatInsert): (expand): split expand in parts 2002-07-22 John Levon * lyx_gui.C: use lyx_gui::exit() - + 2002-07-22 John Levon * LyXAction.C: show the failing pseudo action - + 2002-07-22 Dekel Tsur * 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 * lengthcommon.C: * lyxlength.[Ch]: add support for the vertical lengths - + 2002-07-21 John Levon * toc.[Ch]: std:: fixes - + 2002-07-21 Jean-Marc Lasgouttes * lyxrc.C: do not include lyx_main.h @@ -48,26 +53,26 @@ * LaTeXFeatures.h: use a list instead of a vector 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 - * 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 - * 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 * lyxfunc.C: move minibuffer completion handling out of here - + 2002-07-19 John Levon * BufferView_pimpl.C: * LaTeX.C: fix dispatch calls - + 2002-07-19 Dekel Tsur * 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 * 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 - + * 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 * 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 * MenuBackend.C (expand): add numeric shortcuts to document menu @@ -204,26 +209,26 @@ 2002-07-15 Jean-Marc Lasgouttes - * 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 - * 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 * BufferView.C (resize): check there's a buffer to resize - + 2002-07-14 John Levon * lyxfunc.C: remove dead code * lyxserver.h: * lyxserver.C: use lyx_guii::set_read_callback - + 2002-07-13 Dekel Tsur * lyxfunc.C (dispatch): Correct cursor behaviour when exiting @@ -261,30 +266,30 @@ 2002-07-12 John Levon * lyxfunc.C: use lyx_gui::update_fonts() - + 2002-07-12 John Levon * lyxfunc.C: use lyx_gui::update_color() - + 2002-07-11 John Levon * 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 * BufferView_pimpl.C: remove unneeded extra repaint() - + 2002-07-10 John Levon * LyXAction.C: allow command-sequence with NoBuffer * lyxfunc.C: don't insist on trailing ';' for command-sequence - + 2002-07-10 Angus Leeming * lyxrc.[Ch]: preview_scale_factor should be a float not an int. @@ -296,12 +301,12 @@ 2002-07-09 John Levon * 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 * BufferView_pimpl.C: add FIXMEs, clean up a little @@ -312,7 +317,7 @@ 2002-07-08 André Pönitz - * BufferView_pimpl.C: apply John's patch for #93. + * BufferView_pimpl.C: apply John's patch for #93. 2002-07-05 Angus Leeming diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 2ca2856e57..7f38a7a5e2 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2002-07-22 Lars Gullik Bjønnes + + * 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 * XFormsView.C: don't call toolbar_->set() @@ -9,21 +18,21 @@ 2002-07-22 John Levon * lyx_gui.C: add lyx_gui::exit() - + 2002-07-22 John Levon * Toolbar_pimpl.h: - * Toolbar_pimpl.C: remove ->push() + * Toolbar_pimpl.C: remove ->push() 2002-07-22 Herbert Voss * FormGraphics.C: add tooltips, changesize_type to size_kind. some rearrangements to the code - + 2002-07-21 John Levon * FormToc.C: std:: fix - + 2002-07-21 Jean-Marc Lasgouttes * 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 * XFormsView.C: move autosave timer to LyXView.C - + 2002-07-20 Jean-Marc Lasgouttes * 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 * FormMathsDelim.C: * FormMathsMatrix.C: fix dispatch calls nicely - + 2002-07-20 Jean-Marc Lasgouttes * 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 - * FormMathsDelim.C: + * FormMathsDelim.C: * FormMathsMatrix.C: fix dispatch calls - + 2002-07-18 John Levon - * 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 @@ -125,12 +134,12 @@ * FormPreferences.C: * forms/form_preferences.fd: remove 2nd exit confirmation - + 2002-07-17 John Levon * XFormsView.h: * XFormsView.C: hook up view_state_changed - + 2002-07-16 Angus Leeming * 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 * lyx_gui.C (C_read_callback): give it extern "C" linkage. @@ -154,11 +163,11 @@ 2002-07-14 John Levon * lyx_gui.C: add set_read_callback() - + 2002-07-12 John Levon * lyx_gui.C: move init_graphics() into setup - + 2002-07-12 Angus Leeming * 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 * lyx_gui.C: implement update_fonts(), font_available() - + 2002-07-12 John Levon * lyx_gui.C: add update_color() - + 2002-07-11 John Levon * FormPreferences.C: * forms/form_preferences.fd: remove file->new asks for name - + 2002-07-11 John Levon * XWorkArea.h: * XWorkArea.C: do a copy area on redraw when no geometry change - + 2002-07-11 Herbert Voss - - * 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 - * 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 * xscreen.C: add const - + 2002-07-09 Angus Leeming * xformsImage.C (scale): use boost::tie. diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 4c867017c7..09d0d63fa0 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -35,7 +35,7 @@ #include "BufferView.h" #include - +#include 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 diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index 81c9e52139..6e8953ae34 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -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 minibuffer_; + /// + boost::signals::connection view_state_con; + /// + boost::signals::connection focus_con; + /// + boost::signals::connection redraw_con; + /// the main form. FL_FORM * form_; }; diff --git a/src/frontends/xforms/XMiniBuffer.C b/src/frontends/xforms/XMiniBuffer.C index 0cdfd349ed..5b72dc0605 100644 --- a/src/frontends/xforms/XMiniBuffer.C +++ b/src/frontends/xforms/XMiniBuffer.C @@ -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 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()); diff --git a/src/frontends/xforms/XMiniBuffer.h b/src/frontends/xforms/XMiniBuffer.h index 0388b6f5f4..2d0bd6b144 100644 --- a/src/frontends/xforms/XMiniBuffer.h +++ b/src/frontends/xforms/XMiniBuffer.h @@ -15,7 +15,8 @@ #include FORMS_H_LOCATION #include - +#include + #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 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