+2000-09-26 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * src/buffer.C (readFile): block-if statement rearranged to minimise
+ bloat. Patch does not reverse Jean-Marc's change ;-)
+
+ * src/frontends/xforms/FormBase.[Ch]: Renamed some of the callbacks.
+ Class rewritten to store pointers to hide/update signals directly,
+ rather than Dialogs *. Also defined an enum to ease use. All xforms
+ forms can now be derived from this class.
+
+ * src/frontends/xforms/FormCommand.[Ch]
+ * src/frontends/xforms/FormCopyright.[Ch]: now derived from FormBase.
+
+ * src/frontends/xforms/FormError.[Ch]: moved inclusion of inseterror.h
+ out of header file.
+
+ * src/frontends/xforms/forms/form_citation.fd
+ * src/frontends/xforms/forms/form_copyright.fd
+ * src/frontends/xforms/forms/form_error.fd
+ * src/frontends/xforms/forms/form_index.fd
+ * src/frontends/xforms/forms/form_ref.fd
+ * src/frontends/xforms/forms/form_toc.fd
+ * src/frontends/xforms/forms/form_url.fd: remamed callbacks
+
+ * src/frontends/xforms/forms/makefile: small change to work with DEC sh.
+
+ * src/insets/insetfoot.C: removed redundent using directive.
+
2000-09-26 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lib/layouts/siamltex.layout: new textclass for SIAM journals,
<< endl;
}
+ Inset * inset = 0;
+
lex.next();
string const tmptok = lex.GetString();
last_inset_read = tmptok;
+
// test the different insets
- if (tmptok == "Quotes") {
- Inset * inset = new InsetQuotes;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "External") {
- Inset * inset = new InsetExternal;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "FormulaMacro") {
- Inset * inset = new InsetFormulaMacro;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Formula") {
- Inset * inset = new InsetFormula;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Figure") {
- Inset * inset = new InsetFig(100, 100, this);
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Info") {
- Inset * inset = new InsetInfo;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Include") {
- InsetCommandParams p( "Include" );
- Inset * inset = new InsetInclude(p, this);
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "ERT") {
- Inset * inset = new InsetERT;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Tabular") {
- Inset * inset = new InsetTabular(this);
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Text") {
- Inset * inset = new InsetText;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Foot") {
- Inset * inset = new InsetFoot;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Marginal") {
- Inset * inset = new InsetMarginal;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Minipage") {
- Inset * inset = new InsetMinipage;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Float") {
- lex.next();
- string const tmptok = lex.GetString();
- Inset * inset = new InsetFloat(tmptok);
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "List") {
- Inset * inset = new InsetList;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Theorem") {
- Inset * inset = new InsetList;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "Caption") {
- Inset * inset = new InsetCaption;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "GRAPHICS") {
- Inset * inset = new InsetGraphics;
- inset->Read(this, lex);
- par->InsertInset(pos, inset, font);
- ++pos;
- } else if (tmptok == "LatexCommand") {
+ if (tmptok == "LatexCommand") {
InsetCommandParams inscmd;
inscmd.Read(lex);
- Inset * inset = 0;
+
if (inscmd.getCmdName() == "cite") {
inset = new InsetCitation(inscmd);
} else if (inscmd.getCmdName() == "bibitem") {
} else if (inscmd.getCmdName() == "lyxparent") {
inset = new InsetParent(inscmd, this);
}
-
- if (inset) {
- par->InsertInset(pos, inset, font);
- ++pos;
+ } else {
+ if (tmptok == "Quotes") {
+ inset = new InsetQuotes;
+ } else if (tmptok == "External") {
+ inset = new InsetExternal;
+ } else if (tmptok == "FormulaMacro") {
+ inset = new InsetFormulaMacro;
+ } else if (tmptok == "Formula") {
+ inset = new InsetFormula;
+ } else if (tmptok == "Figure") {
+ inset = new InsetFig(100, 100, this);
+ } else if (tmptok == "Info") {
+ inset = new InsetInfo;
+ } else if (tmptok == "Include") {
+ InsetCommandParams p( "Include" );
+ inset = new InsetInclude(p, this);
+ } else if (tmptok == "ERT") {
+ inset = new InsetERT;
+ } else if (tmptok == "Tabular") {
+ inset = new InsetTabular(this);
+ } else if (tmptok == "Text") {
+ inset = new InsetText;
+ } else if (tmptok == "Foot") {
+ inset = new InsetFoot;
+ } else if (tmptok == "Marginal") {
+ inset = new InsetMarginal;
+ } else if (tmptok == "Minipage") {
+ inset = new InsetMinipage;
+ } else if (tmptok == "Float") {
+ lex.next();
+ string tmptok = lex.GetString();
+ inset = new InsetFloat(tmptok);
+ } else if (tmptok == "List") {
+ inset = new InsetList;
+ } else if (tmptok == "Theorem") {
+ inset = new InsetList;
+ } else if (tmptok == "Caption") {
+ inset = new InsetCaption;
+ } else if (tmptok == "GRAPHICS") {
+ inset = new InsetGraphics;
}
+
+ if (inset) inset->Read(this, lex);
+ }
+
+ if (inset) {
+ par->InsertInset(pos, inset, font);
+ ++pos;
}
}
#include "FormBase.h"
#include "xform_macros.h"
-C_RETURNCB(FormBase, WMHideCB)
+C_RETURNCB (FormBase, WMHideCB)
C_GENERICCB(FormBase, ApplyCB)
-C_GENERICCB(FormBase, CancelCB)
+C_GENERICCB(FormBase, ApplyHideCB)
+C_GENERICCB(FormBase, HideCB)
C_GENERICCB(FormBase, InputCB)
-C_GENERICCB(FormBase, OKCB)
-FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t)
- : lv_(lv), d_(d), u_(0), h_(0), title(t), dialogIsOpen(false)
-{}
+FormBase::FormBase(LyXView * lv, Dialogs * d, BufferDependency bd, string const & t)
+ : dialogIsOpen(false), lv_(lv), u_(0), h_(0), title(t)
+{
+ switch( bd ) {
+ case BUFFER_DEPENDENT:
+ hSignal_ = &d->hideBufferDependent;
+ uSignal_ = &d->updateBufferDependent;
+ break;
+ case BUFFER_INDEPENDENT:
+ hSignal_ = &d->hideAll;
+ uSignal_ = 0;
+ break;
+ }
+}
+
void FormBase::show()
{
if (!form()) {
FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_TRANSIENT,
title.c_str());
- u_ = d_->updateBufferDependent.
- connect(slot(this, &FormBase::update));
- h_ = d_->hideBufferDependent.
- connect(slot(this, &FormBase::hide));
+ if( uSignal_ )
+ u_ = uSignal_->connect(slot(this, &FormBase::update));
+ h_ = hSignal_->connect(slot(this, &FormBase::hide));
}
}
}
-void FormBase::CancelCB(FL_OBJECT * ob, long)
+void FormBase::ApplyHideCB(FL_OBJECT * ob, long)
{
FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+ pre->apply();
pre->hide();
}
-void FormBase::InputCB(FL_OBJECT * ob, long data )
+void FormBase::HideCB(FL_OBJECT * ob, long)
{
FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
- pre->input( data );
+ pre->hide();
}
-void FormBase::OKCB(FL_OBJECT * ob, long)
+void FormBase::InputCB(FL_OBJECT * ob, long data )
{
FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
- pre->apply();
- pre->hide();
+ pre->input( data );
}
#pragma interface
#endif
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+#endif
+
/** This class is an XForms GUI base class
*/
class FormBase : public DialogBase, public noncopyable {
public:
+ ///
+ enum BufferDependency {
+ ///
+ BUFFER_DEPENDENT,
+ ///
+ BUFFER_INDEPENDENT
+ };
+
/// Constructor
- FormBase(LyXView *, Dialogs *, string const &);
+ FormBase(LyXView *, Dialogs *, BufferDependency, string const &);
/// Callback functions
static int WMHideCB(FL_FORM *, void *);
///
static void ApplyCB(FL_OBJECT *, long);
///
- static void CancelCB(FL_OBJECT *, long);
+ static void ApplyHideCB(FL_OBJECT *, long);
///
- static void InputCB(FL_OBJECT *, long);
+ static void HideCB(FL_OBJECT *, long);
///
- static void OKCB(FL_OBJECT *, long);
+ static void InputCB(FL_OBJECT *, long);
protected:
/// Create the dialog if necessary, update it and display it.
void show();
/// Hide the dialog.
void hide();
-
/// Build the dialog
virtual void build() = 0;
/// Filter the inputs on callback from xforms
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * const form() const = 0;
+ /// block opening of form twice at the same time
+ bool dialogIsOpen;
/** Which LyXFunc do we use?
We could modify Dialogs to have a visible LyXFunc* instead and
save a couple of bytes per dialog.
*/
LyXView * lv_;
- /** Which Dialogs do we belong to?
- Used so we can get at the signals we have to connect to.
- */
- Dialogs * d_;
+
private:
+ /// Hide signal
+ Signal0<void> * hSignal_;
+ /// Update signal
+ Signal0<void> * uSignal_;
/// Update connection.
Connection u_;
/// Hide connection.
Connection h_;
/// dialog title, displayed by WM.
string title;
-
-protected:
- /// block opening of form twice at the same time
- bool dialogIsOpen;
};
#endif
#include "Dialogs.h"
#include "FormCommand.h"
-#include "xform_macros.h"
-C_RETURNCB(FormCommand, WMHideCB)
-C_GENERICCB(FormCommand, ApplyCB)
-C_GENERICCB(FormCommand, CancelCB)
-C_GENERICCB(FormCommand, InputCB)
-C_GENERICCB(FormCommand, OKCB)
-
-FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
- : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0),
- dialogIsOpen(false), title(t)
+FormCommand::FormCommand( LyXView * lv, Dialogs * d, string const & t )
+ : FormBase( lv, d, BUFFER_DEPENDENT, t ),
+ inset_(0), ih_(0)
{}
params.setFromString( arg );
show();
}
-
-
-void FormCommand::show()
-{
- if (!form()) {
- build();
- fl_set_form_atclose(form(),
- C_FormCommandWMHideCB, 0);
- }
-
- fl_freeze_form( form() );
- update(); // make sure its up-to-date
- fl_unfreeze_form( form() );
-
- dialogIsOpen = true;
- if (form()->visible) {
- fl_raise_form(form());
- } else {
- fl_show_form(form(),
- FL_PLACE_MOUSE | FL_FREE_SIZE,
- FL_TRANSIENT,
- title.c_str());
- u_ = d_->updateBufferDependent.
- connect(slot(this, &FormCommand::update));
- h_ = d_->hideBufferDependent.
- connect(slot(this, &FormCommand::hide));
- }
-}
-
-
-void FormCommand::hide()
-{
- if (form() && form()->visible) {
- fl_hide_form(form());
- u_.disconnect();
- h_.disconnect();
- }
-
- // free up the dialog for another inset
- inset_ = 0;
- ih_.disconnect();
- dialogIsOpen = false;
- clearStore();
-}
-
-
-int FormCommand::WMHideCB(FL_FORM * form, void *)
-{
- // Ensure that the signals (u and h) are disconnected even if the
- // window manager is used to close the dialog.
- FormCommand * pre = static_cast<FormCommand*>(form->u_vdata);
- pre->hide();
- return FL_CANCEL;
-}
-
-
-void FormCommand::ApplyCB(FL_OBJECT * ob, long)
-{
- FormCommand * pre = static_cast<FormCommand*>(ob->form->u_vdata);
- pre->apply();
-}
-
-
-void FormCommand::CancelCB(FL_OBJECT * ob, long)
-{
- FormCommand * pre = static_cast<FormCommand*>(ob->form->u_vdata);
- pre->hide();
-}
-
-
-void FormCommand::InputCB(FL_OBJECT * ob, long data )
-{
- FormCommand * pre = static_cast<FormCommand*>(ob->form->u_vdata);
- pre->input( data );
-}
-
-
-void FormCommand::OKCB(FL_OBJECT * ob, long)
-{
- FormCommand * pre = static_cast<FormCommand*>(ob->form->u_vdata);
- pre->apply();
- pre->hide();
-}
#ifndef FORMCOMMAND_H
#define FORMCOMMAND_H
-#include "DialogBase.h"
-#include "LString.h"
-#include "support/utility.hpp"
+#include "FormBase.h"
#include "insets/insetcommand.h"
-class Dialogs;
-class LyXView;
-
#ifdef __GNUG__
#pragma interface
#endif
/** This class is an XForms GUI base class to insets derived from
InsetCommand
*/
-class FormCommand : public DialogBase, public noncopyable {
+class FormCommand : public FormBase {
public:
/// Constructor
- FormCommand(LyXView *, Dialogs *, string const & );
- ///
- static int WMHideCB(FL_FORM *, void *);
- ///
- static void ApplyCB(FL_OBJECT *, long);
- ///
- static void CancelCB(FL_OBJECT *, long);
- ///
- static void InputCB(FL_OBJECT *, long);
- ///
- static void OKCB(FL_OBJECT *, long);
+ FormCommand( LyXView *, Dialogs *, string const & );
protected:
/// Slot launching dialog to (possibly) create a new inset
/// Slot launching dialog to an existing inset
void showInset( InsetCommand * const );
- /// Build the dialog
- virtual void build() = 0;
- /// Filter the inputs on callback from xforms
- virtual void input( long ) = 0;
- /// Update dialog before showing it
- virtual void update() = 0;
- /// Apply from dialog (modify or create inset)
- virtual void apply() = 0;
- /// delete derived class variables from hide()
- virtual void clearStore() {}
- /// Pointer to the actual instantiation of the xform's form
- virtual FL_FORM * const form() const = 0;
-
- /** Which LyXFunc do we use?
- We could modify Dialogs to have a visible LyXFunc* instead and
- save a couple of bytes per dialog.
- */
- LyXView * lv_;
- /** Which Dialogs do we belong to?
- Used so we can get at the signals we have to connect to.
- */
- Dialogs * d_;
/// pointer to the inset passed through showInset (if any)
InsetCommand * inset_;
/// the nitty-griity. What is modified and passed back
InsetCommandParams params;
-private:
- /// Create the dialog if necessary, update it and display it.
- void show();
- /// Hide the dialog.
- void hide();
-
- /// Update connection.
- Connection u_;
- /// Hide connection.
- Connection h_;
/// inset::hide connection.
Connection ih_;
- /// block opening of form from more than one inset
- bool dialogIsOpen;
- /// dialog title, displayed by WM.
- string title;
};
#endif
#pragma implementation
#endif
-#include "xform_macros.h"
-#include "form_copyright.h"
-#include "FormCopyright.h"
#include "Dialogs.h"
#include "LyXView.h"
-#include "lyx_gui_misc.h"
#include "gettext.h"
+#include "form_copyright.h"
+#include "FormCopyright.h"
-C_RETURNCB(FormCopyright, WMHideCB)
-C_GENERICCB(FormCopyright, OKCB)
-
-FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
- : dialog_(0), lv_(lv), d_(d), h_(0)
+FormCopyright::FormCopyright( LyXView * lv, Dialogs * d )
+ : FormBase( lv, d, BUFFER_INDEPENDENT, _("Copyright and Warranty") ),
+ dialog_(0)
{
// let the dialog be shown
// This is a permanent connection so we won't bother
void FormCopyright::build()
{
dialog_ = build_copyright();
- fl_set_form_atclose(dialog_->form,
- C_FormCopyrightWMHideCB, 0);
-}
-
-
-void FormCopyright::show()
-{
- if (!dialog_) {
- build();
- }
-
- if (dialog_->form->visible) {
- fl_raise_form(dialog_->form);
- } else {
- fl_show_form(dialog_->form,
- FL_PLACE_MOUSE,
- FL_FULLBORDER,
- _("Copyright and Warranty"));
- h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
- }
-}
-
-
-void FormCopyright::hide()
-{
- if (dialog_
- && dialog_->form
- && dialog_->form->visible) {
- fl_hide_form(dialog_->form);
- h_.disconnect();
- }
-}
-
-
-int FormCopyright::WMHideCB(FL_FORM * form, void *)
-{
- // Ensure that the signal h is disconnected even if the
- // window manager is used to close the dialog.
- FormCopyright * pre = static_cast<FormCopyright*>(form->u_vdata);
- pre->hide();
- return FL_CANCEL;
}
-void FormCopyright::OKCB(FL_OBJECT * ob, long)
+FL_FORM * const FormCopyright::form() const
{
- FormCopyright * pre = static_cast<FormCopyright*>(ob->form->u_vdata);
- pre->hide();
+ if( dialog_ ) // no need to test for dialog_->form
+ return dialog_->form;
+ else
+ return 0;
}
#ifndef FORMCOPYRIGHT_H
#define FORMCOPYRIGHT_H
-#include "DialogBase.h"
+#include "FormBase.h"
#include "form_copyright.h"
-#include "support/utility.hpp"
#ifdef __GNUG__
#pragma interface
#endif
-class Dialogs;
-class LyXView;
struct FD_form_copyright;
/** This class provides an XForms implementation of the FormCopyright Dialog.
*/
-class FormCopyright : public DialogBase, public noncopyable {
+class FormCopyright : public FormBase {
public:
/// #FormCopyright x(LyXFunc ..., Dialogs ...);#
FormCopyright(LyXView *, Dialogs *);
///
~FormCopyright();
- ///
- static int WMHideCB(FL_FORM *, void *);
- ///
- static void OKCB(FL_OBJECT *, long);
private:
- /// Create the dialog if necessary, update it and display it.
- void show();
- /// Hide the dialog.
- void hide();
- /// Not used but we've got to implement it.
- void update() {}
-
/// Build the dialog
void build();
- ///
+ /// Pointer to the actual instantiation of the xform's form
+ FL_FORM * const form() const;
+ /// Fdesign generated method
FD_form_copyright * build_copyright();
/// Real GUI implementation.
FD_form_copyright * dialog_;
- /** Which LyXFunc do we use?
- We could modify Dialogs to have a visible LyXFunc* instead and
- save a couple of bytes per dialog.
- */
- LyXView * lv_;
- /** Which Dialogs do we belong to?
- Used so we can get at the signals we have to connect to.
- */
- Dialogs * d_;
- /// Hide connection.
- Connection h_;
};
#endif
#include "Dialogs.h"
#include "FormError.h"
#include "form_error.h"
+#include "insets/inseterror.h"
static int minh, minw;
-FormError::FormError(LyXView * lv, Dialogs * d)
- : FormBase(lv, d, _("LaTeX Error")),
+FormError::FormError( LyXView * lv, Dialogs * d )
+ : FormBase( lv, d, BUFFER_DEPENDENT, _("LaTeX Error") ),
dialog_(0), ih_(0), message_("")
{
// let the dialog be shown
#endif
#include "FormBase.h"
-#include "insets/inseterror.h"
+class InsetError;
struct FD_form_error;
/** This class provides an XForms implementation of the FormError Dialog.
fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 300, _("Inset keys"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormCommandInputCB, CITEBRSR);
+ fl_set_object_callback(obj, C_FormBaseInputCB, CITEBRSR);
fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 240, 30, 180, 300, _("Bibliography keys"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormCommandInputCB, BIBBRSR);
+ fl_set_object_callback(obj, C_FormBaseInputCB, BIBBRSR);
fdui->addBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 30, 30, 30, _("@4->"));
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, ADD);
+ fl_set_object_callback(obj, C_FormBaseInputCB, ADD);
fdui->delBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 65, 30, 30, _("@9+"));
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, DELETE);
+ fl_set_object_callback(obj, C_FormBaseInputCB, DELETE);
fdui->upBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 100, 30, 30, _("@8->"));
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, UP);
+ fl_set_object_callback(obj, C_FormBaseInputCB, UP);
fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 135, 30, 30, _("@2->"));
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, DOWN);
+ fl_set_object_callback(obj, C_FormBaseInputCB, DOWN);
fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 360, 410, 80, _("Info"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 630, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, _("Cancel"));
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_citation_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCommandInputCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_South, FL_South);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCopyrightOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 10, 190, 430, 190, _("LyX is distributed in the hope that it will\nbe useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of\nthe GNU General Public License\nalong with this program; if not, write to\nthe Free Software Foundation, Inc., \n675 Mass Ave, Cambridge, MA 02139, USA."));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
#define FD_form_copyright_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCopyrightOKCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
obj = fl_add_button(FL_RETURN_BUTTON, 135, 200, 130, 30, _("Close"));
fl_set_object_gravity(obj, FL_South, FL_South);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_error_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 60, 100, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_index_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 280, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormCommandInputCB, 2);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 2);
fdui->update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 300, 90, 30, _("Update"));
fl_set_button_shortcut(obj, scex(_("Update|#U#u")), 1);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, 3);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 3);
fdui->sort = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 170, 300, 30, 30, _("Sort"));
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, C_FormCommandInputCB, 3);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 3);
fdui->name = obj = fl_add_input(FL_NORMAL_INPUT, 370, 10, 150, 40, _("Name:"));
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
fdui->ref = obj = fl_add_input(FL_NORMAL_INPUT, 370, 60, 150, 40, _("Reference:"));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandInputCB, 4);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 4);
fdui->go = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 140, 40, _("Goto reference"));
fl_set_button_shortcut(obj, scex(_("Goto reference|#G")), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandInputCB, 1);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 1);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 330, 300, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, _("Cancel"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_ref_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCommandInputCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 340, "");
fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 400, 280, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandApplyCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
obj = fl_add_button(FL_RETURN_BUTTON, 310, 300, 100, 30, _("Close"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
obj = fl_add_button(FL_NORMAL_BUTTON, 200, 300, 100, 30, _("Update"));
fl_set_button_shortcut(obj, scex(_("Update|#U#u")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandApplyCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
fdui->type = obj = fl_add_choice(FL_NORMAL_CHOICE, 60, 300, 130, 30, _("Type"));
fl_set_object_shortcut(obj, scex(_("Type|#T#t")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandApplyCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_toc_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCommandApplyCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseHideCB, 0);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 100, 100, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormCommandOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_url_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
-extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
resize: FL_RESIZE_X
gravity: FL_NoGravity FL_NoGravity
name: citeBrsr
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: CITEBRSR
--------------------
resize: FL_RESIZE_X
gravity: FL_NoGravity FL_NoGravity
name: bibBrsr
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: BIBBRSR
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: addBtn
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: ADD
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: delBtn
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: DELETE
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: upBtn
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: UP
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: downBtn
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: DOWN
--------------------
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: ok
-callback: C_FormCommandOKCB
+callback: C_FormBaseApplyHideCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: cancel
-callback: C_FormCommandCancelCB
+callback: C_FormBaseHideCB
argument: 0
==============================
resize: FL_RESIZE_NONE
gravity: FL_South FL_South
name: button_ok
-callback: C_FormCopyrightOKCB
+callback: C_FormBaseHideCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_South FL_South
name:
-callback: C_FormBaseCancelCB
+callback: C_FormBaseHideCB
argument: 0
==============================
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
-callback: C_FormCommandCancelCB
+callback: C_FormBaseHideCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: ok
-callback: C_FormCommandOKCB
+callback: C_FormBaseApplyHideCB
argument: 0
==============================
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: browser
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: 2
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: update
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: 3
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: sort
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: 3
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: type
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: 4
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: go
-callback: C_FormCommandInputCB
+callback: C_FormBaseInputCB
argument: 1
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: ok
-callback: C_FormCommandOKCB
+callback: C_FormBaseApplyHideCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
-callback: C_FormCommandCancelCB
+callback: C_FormBaseHideCB
argument: 0
==============================
resize: FL_RESIZE_ALL
gravity: FL_NorthWest FL_SouthEast
name: browser
-callback: C_FormCommandApplyCB
+callback: C_FormBaseApplyCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name:
-callback: C_FormCommandCancelCB
+callback: C_FormBaseHideCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name:
-callback: C_FormCommandApplyCB
+callback: C_FormBaseApplyCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: type
-callback: C_FormCommandApplyCB
+callback: C_FormBaseApplyCB
argument: 0
==============================
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
-callback: C_FormCommandCancelCB
+callback: C_FormBaseHideCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: ok
-callback: C_FormCommandOKCB
+callback: C_FormBaseApplyHideCB
argument: 0
==============================
test: clean $(OBJS)
updatesrc: test
- for fil in *.C *.h ; do \
- cmp -s $$fil ../$$fil || mv $$fil .. \
+ for fil in *.C *.h; \
+ do cmp -s $$fil ../$$fil || mv $$fil ..; \
done
.fd.C:
${SHELL} ./fdfix.sh $<
clean:
- rm -f *.[hcC] *.bak
+ rm -f *.[hHcC] *.bak
distclean: clean
rm -f *.orig *.rej *~
#include "debug.h"
using std::ostream;
-using std::endl;
InsetFoot::InsetFoot()