From: Angus Leeming Date: Thu, 15 Mar 2001 13:37:04 +0000 (+0000) Subject: Merging BRANCH_MVC back into HEAD. X-Git-Tag: 1.6.10~21456 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9c36dd0f40f2e2e90fce8b2f33519a5d99d9be8b;p=features.git Merging BRANCH_MVC back into HEAD. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1770 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 40968d173e..b95ed7dd10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + + * configure.in: added controllers directory to frontends. + 2001-03-08 Jean-Marc Lasgouttes * INSTALL: remove mention of problem with gettext. diff --git a/configure.in b/configure.in index 8817f0aef8..1511aaf7ee 100644 --- a/configure.in +++ b/configure.in @@ -304,6 +304,7 @@ AC_OUTPUT([Makefile \ src/support/Makefile \ src/frontends/Makefile \ src/frontends/support/Makefile \ + src/frontends/controllers/Makefile \ src/frontends/xforms/Makefile \ src/frontends/qt2/Makefile \ src/frontends/kde/Makefile \ diff --git a/src/ChangeLog b/src/ChangeLog index 09449fa300..5aa46f5da9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + + * Makefile.am: added controllers/libcontrollers.la to lyx_DEPENDENCIES + 2001-03-14 Angus Leeming * lyxfunc.C (Dispatch): removed redundant break statement. diff --git a/src/Makefile.am b/src/Makefile.am index e7bc09e807..3d7b84911d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la \ graphics/libgraphics.la \ frontends/libfrontends.la @FRONTEND_GUILIB@ \ frontends/libfrontends.la \ + frontends/controllers/libcontrollers.la \ frontends/support/libfrontendsupport.la support/libsupport.la \ @INCLUDED_SIGC@ lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \ diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 80fcdadf5c..438eebe666 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,21 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + + * Makefile.am: added controllers to SUBDIRS. + removed ButtonPolicies.[Ch]. Now in controllers. + + * DialogBase.h: commented out abstract method show(). + + * Dialogs.h: The dialogs are now stored as a + std::vector >. + Removed using directives. + (d-tor) removed. + (add): new helper method. Makes code in c-tor a little tidier. + (destroySplash): Moved out of xforms implementation. + + * ButtonPolicies.[Ch]: moved to controllers/ButtonPolicies.[Ch] + 2001-03-09 John Levon * Dialogs.h: add showExternal signal diff --git a/src/frontends/DialogBase.h b/src/frontends/DialogBase.h index dec7d884f1..c30da3a0c3 100644 --- a/src/frontends/DialogBase.h +++ b/src/frontends/DialogBase.h @@ -40,14 +40,14 @@ class DialogBase : public Object, public noncopyable public: /**@name Constructors and Deconstructors */ //@{ - /// + /// Virtual base destructor virtual ~DialogBase() {} //@} /**@name Signal Targets */ //@{ /// - virtual void show() = 0; + //virtual void show() = 0; /// virtual void hide() = 0; /// diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 4b26d52e6a..3007748b63 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -23,14 +23,18 @@ #include "LString.h" #include +#include -class DialogBase; +#ifdef __GNUG__ +#pragma interface +#endif + +#include "DialogBase.h" +#include "support/LAssert.h" // Maybe this should be a UIFunc modelled on LyXFunc class LyXView; -class FormSplash; - class InsetGraphics; class InsetBibKey; class InsetBibtex; @@ -41,11 +45,6 @@ class InsetInfo; class InsetTabular; class InsetCommand; -#ifdef SIGC_CXX_NAMESPACES -using SigC::Signal0; -using SigC::Signal1; -#endif - /** Container of all dialogs and signals a LyXView needs or uses to access them The list of dialog signals isn't comprehensive but should be a good guide for any future additions. Remember don't go overboard -- think minimal. @@ -53,116 +52,129 @@ using SigC::Signal1; class Dialogs : public noncopyable { public: - /**@name Constructors and Deconstructors */ + /// + typedef boost::shared_ptr db_ptr; + /**@name Constructor */ //@{ /// Dialogs(LyXView *); - /// - ~Dialogs(); //@} - + /** Redraw all visible popups because, for example, the GUI colours have been re-mapped. */ - static Signal0 redrawGUI; + static SigC::Signal0 redrawGUI; /**@name Global Hide and Update Signals */ //@{ /// Hide all visible popups - Signal0 hideAll; + SigC::Signal0 hideAll; /// Hide any dialogs that require a buffer for them to operate - Signal0 hideBufferDependent; + SigC::Signal0 hideBufferDependent; /** Update visible, buffer-dependent dialogs If the bool is true then a buffer change has occurred else its still the same buffer. */ - Signal1 updateBufferDependent; + SigC::Signal1 updateBufferDependent; //@} /**@name Dialog Access Signals. Put into some sort of alphabetical order */ //@{ /// Do we really have to push this? - Signal1 const &> SetDocumentClassChoice; + SigC::Signal1 const &> SetDocumentClassChoice; /// show the key and label of a bibliography entry - Signal1 showBibitem; + SigC::Signal1 showBibitem; /// show the bibtex dialog - Signal1 showBibtex; + SigC::Signal1 showBibtex; /// - Signal0 showCharacter; + SigC::Signal0 showCharacter; /// - Signal1 showCitation; + SigC::Signal1 showCitation; /// - Signal1 createCitation; + SigC::Signal1 createCitation; /// - Signal0 showCopyright; + SigC::Signal0 showCopyright; /// - Signal0 showCredits; + SigC::Signal0 showCredits; /// - Signal1 showError; + SigC::Signal1 showError; /// show the external inset dialog - Signal1 showExternal; + SigC::Signal1 showExternal; /// - Signal1 showGraphics; + SigC::Signal1 showGraphics; /// show the details of a LyX file include inset - Signal1 showInclude; + SigC::Signal1 showInclude; /// - Signal1 showIndex; + SigC::Signal1 showIndex; /// - Signal1 createIndex; + SigC::Signal1 createIndex; /// - Signal1 showInfo; + SigC::Signal1 showInfo; /// - Signal0 showLayoutDocument; + SigC::Signal0 showLayoutDocument; /// - Signal0 showLayoutParagraph; + SigC::Signal0 showLayoutParagraph; /// - Signal0 showLayoutCharacter; + SigC::Signal0 showLayoutCharacter; /// - Signal0 setUserFreeFont; + SigC::Signal0 setUserFreeFont; /// show the version control log - Signal0 showVCLogFile; + SigC::Signal0 showVCLogFile; /// show the LaTeX log or build file - Signal0 showLogFile; + SigC::Signal0 showLogFile; /// - Signal0 showPreamble; + SigC::Signal0 showPreamble; /// - Signal0 showPreferences; + SigC::Signal0 showPreferences; /// - Signal0 showPrint; + SigC::Signal0 showPrint; /// - Signal1 showRef; + SigC::Signal1 showRef; /// - Signal1 createRef; + SigC::Signal1 createRef; /// - Signal0 showSearch; + SigC::Signal0 showSearch; /// pop up the splash - Signal0 showSplash; + SigC::Signal0 showSplash; /// destroy the splash dialog void destroySplash(); /// - Signal1 showTabular; + SigC::Signal1 showTabular; /// - Signal1 updateTabular; + SigC::Signal1 updateTabular; /// - Signal0 showTabularCreate; + SigC::Signal0 showTabularCreate; /// - Signal1 showTOC; + SigC::Signal1 showTOC; /// - Signal1 createTOC; + SigC::Signal1 createTOC; /// - Signal1 showUrl; + SigC::Signal1 showUrl; /// - Signal1 createUrl; + SigC::Signal1 createUrl; /// - Signal0 updateCharacter; // allow update as cursor moves + SigC::Signal0 updateCharacter; // allow update as cursor moves //@} private: + /// Add a dialog to the vector of dialogs. + void add(DialogBase *); /// the dialogs being managed - std::vector dialogs_; + std::vector dialogs_; /// the splash dialog - FormSplash * splash_; + boost::scoped_ptr splash_; }; +inline void Dialogs::add(DialogBase * ptr) +{ + Assert(ptr); + dialogs_.push_back(db_ptr(ptr)); +} + +inline void Dialogs::destroySplash() +{ + splash_.reset(); +} + #endif diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index 7dc63a1892..99bcd621d9 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -4,15 +4,13 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in # xforms has to be fixed here as we still need object files in this directory # for the compilation of other frontends, so until that we have to let this # here. -SUBDIRS = support xforms @FRONTEND@ +SUBDIRS = support xforms controllers @FRONTEND@ ETAGS_ARGS = --lang=c++ BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/xforms ${SIGC_CFLAGS} $(BOOST_INCLUDES) LIBS = noinst_LTLIBRARIES = libfrontends.la libfrontends_la_SOURCES=\ - ButtonPolicies.C \ - ButtonPolicies.h \ Dialogs.h \ DialogBase.h \ FileDialog.h \ diff --git a/src/frontends/controllers/.cvsignore b/src/frontends/controllers/.cvsignore new file mode 100644 index 0000000000..2bf9eaa2a8 --- /dev/null +++ b/src/frontends/controllers/.cvsignore @@ -0,0 +1,6 @@ +Makefile.in +Makefile +*.deps +*.lo +.libs +libcontrollers.la diff --git a/src/frontends/controllers/ButtonController.C b/src/frontends/controllers/ButtonController.C new file mode 100644 index 0000000000..762255ca1c --- /dev/null +++ b/src/frontends/controllers/ButtonController.C @@ -0,0 +1,98 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ButtonController.C + * \author Allan Rae + */ + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include +#include "ButtonController.h" +#include "support/LAssert.h" + + +ButtonControllerBase::ButtonControllerBase(string const & cancel, + string const & close) + : cancel_label(cancel), close_label(close) +{} + + +void ButtonControllerBase::ok() +{ + input(ButtonPolicy::SMI_OKAY); +} + + +void ButtonControllerBase::input(ButtonPolicy::SMInput in) +{ + if (ButtonPolicy::SMI_NOOP == in) return; + bp().input(in); + refresh(); +} + + +void ButtonControllerBase::apply() +{ + input(ButtonPolicy::SMI_APPLY); +} + + +void ButtonControllerBase::cancel() +{ + input(ButtonPolicy::SMI_CANCEL); +} + + +void ButtonControllerBase::undoAll() +{ + input(ButtonPolicy::SMI_UNDO_ALL); +} + + +void ButtonControllerBase::hide() +{ + input(ButtonPolicy::SMI_HIDE); +} + + +void ButtonControllerBase::valid(bool v) +{ + if (v) { + input(ButtonPolicy::SMI_VALID); + } else { + input(ButtonPolicy::SMI_INVALID); + } +} + + +void ButtonControllerBase::invalid() +{ + input(ButtonPolicy::SMI_INVALID); +} + + +bool ButtonControllerBase::readOnly(bool ro) +{ + if (ro) { + input(ButtonPolicy::SMI_READ_ONLY); + } else { + input(ButtonPolicy::SMI_READ_WRITE); + } + return ro; +} + + +void ButtonControllerBase::readWrite() +{ + readOnly(false); +} diff --git a/src/frontends/controllers/ButtonController.h b/src/frontends/controllers/ButtonController.h new file mode 100644 index 0000000000..73dae9f694 --- /dev/null +++ b/src/frontends/controllers/ButtonController.h @@ -0,0 +1,105 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ButtonController.h + * \author Allan Rae + */ + +#ifndef BUTTONCONTROLLER_H +#define BUTTONCONTROLLER_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ButtonPolicies.h" +#include "LString.h" +#include "gettext.h" + +/** Abstract base class for a ButtonController + + * Controls the activation of the OK, Apply and Cancel buttons. + * Actually supports 4 buttons in all and it's up to the user to decide on + * the activation policy and which buttons correspond to which output of the + * state machine. + * Author: Allan Rae . + * This abstract base class stripped of xforms-specific code by + * Angus Leeming + */ +class ButtonControllerBase : public noncopyable +{ +public: + /** Constructor. + The cancel/close label entries are _not_ managed within the class + thereby allowing you to reassign at will and to use static labels. + It also means if you really don't want to have the Cancel button + label be different when there is nothing changed in the dialog then + you can just assign "Cancel" to both labels. Or even reuse this + class for something completely different. + */ + ButtonControllerBase(string const & cancel, string const & close); + /// + virtual ~ButtonControllerBase() {} + /// + virtual void refresh() = 0; + /// + virtual ButtonPolicy & bp() = 0; + /// + virtual void input(ButtonPolicy::SMInput); + /// + void ok(); + /// + void apply(); + /// + void cancel(); + /// + void undoAll(); + /// + void hide(); + /// Passthrough function -- returns its input value + bool readOnly(bool = true); + /// + void readWrite(); + /// + void valid(bool = true); + /// + void invalid(); + +protected: + /// + string cancel_label; + /// + string close_label; +}; + + +template +class ButtonController: public GUIBC +{ +public: + /// + ButtonController(string const & = _("Cancel"), + string const & = _("Close")); + /// + virtual ButtonPolicy & bp() { return bp_; } + +protected: + /// + BP bp_; +}; + + +template +ButtonController::ButtonController(string const & cancel, + string const & close) + : GUIBC(cancel, close) +{} + +#endif // BUTTONCONTROLLER_H diff --git a/src/frontends/controllers/ButtonPolicies.C b/src/frontends/controllers/ButtonPolicies.C new file mode 100644 index 0000000000..52dfa837f1 --- /dev/null +++ b/src/frontends/controllers/ButtonPolicies.C @@ -0,0 +1,546 @@ +// -*- C++ -*- +/* ButtonPolicies.C + * Provides a state machine implementation of the various button policies + * used by the dialogs. + * Author: Allan Rae + * This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. + * + * This file Copyright 2000 + * Allan Rae + * ====================================================== + */ + +#include + +#include "ButtonPolicies.h" +#include "debug.h" + +using std::endl; + +/// Helper function +static inline +void nextState(ButtonPolicy::State & state, + ButtonPolicy::SMInput in, + ButtonPolicy::StateMachine const & s_m, + char const * function_name = "nextState") +{ + if (ButtonPolicy::SMI_NOOP == in) return; + + ButtonPolicy::State tmp = s_m[state][in]; + if (ButtonPolicy::BOGUS != tmp) { + state = tmp; + } else { + lyxerr << function_name + << ": No transition for input " + << in + << " from state " + << state + << endl; + } +} + + +/*-----------------------------PreferencesPolicy-----------------------------*/ + + +PreferencesPolicy::PreferencesPolicy() + : state_(INITIAL), + outputs_(APPLIED + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(APPLIED + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + outputs_[APPLIED] = OKAY | CLOSE; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input(). This won't necessarily be true for all + // policies though so I'll leave those two as distinct + // inputs rather than merge them. For example, a dialog + // that doesn't update it's input fields when reshown + // after being hidden needs a policy where CANCEL and + // HIDE are treated differently. + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL; + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_ONLY] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_APPLY] = APPLIED; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + // State::INVALID + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_ONLY] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; + // State::APPLIED + state_machine_[APPLIED][SMI_VALID] = VALID; + state_machine_[APPLIED][SMI_INVALID] = INVALID; + state_machine_[APPLIED][SMI_OKAY] = INITIAL; + state_machine_[APPLIED][SMI_READ_ONLY] = APPLIED; + state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED; +} + + +void PreferencesPolicy::input(SMInput input) +{ + //lyxerr << "PreferencesPolicy::input" << endl; + // CANCEL and HIDE always take us to INITIAL for all cases. + // Note that I didn't put that special case in the helper function + // because it doesn't belong there. Some other + // This is probably optimising for the wrong case since it occurs as the + // dialog will be hidden. It would have saved a little memory in the + // state machine if I could have gotten map working. ARRae 20000813 + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "PreferencesPolicy"); + } +} + + +/*-------------------------------OkCancelPolicy------------------------------*/ + + +OkCancelPolicy::OkCancelPolicy() + : state_(INITIAL), + outputs_(INVALID + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(INVALID + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL; + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_ONLY] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + // State::INVALID + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_ONLY] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; +} + + + +void OkCancelPolicy::input(SMInput input) +{ + //lyxerr << "OkCancelPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, input, state_machine_, "OkCancelPolicy"); + } +} + + +/*---------------------------OkCancelReadOnlyPolicy-------------------------*/ + + +OkCancelReadOnlyPolicy::OkCancelReadOnlyPolicy() + : state_(INITIAL), + outputs_(RO_INVALID + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(RO_INVALID + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + outputs_[RO_INITIAL] = CLOSE; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; + // State::INVALID + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; + // State::RO_INITIAL + state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL; + state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID; + state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL; + // State::RO_VALID + state_machine_[RO_VALID][SMI_VALID] = RO_VALID; + state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; + state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; + // State::RO_INVALID + state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; + state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; + state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; +} + + +void OkCancelReadOnlyPolicy::input(SMInput input) +{ + //lyxerr << "OkCancelReadOnlyPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "OkCancelReadOnlyPolicy"); + } +} + + +/*--------------------------NoRepeatedApplyReadOnlyPolicy----------------------*/ + + +NoRepeatedApplyReadOnlyPolicy::NoRepeatedApplyReadOnlyPolicy() + : state_(INITIAL), + outputs_(RO_INVALID + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(RO_INVALID + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + outputs_[RO_INITIAL] = CLOSE; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_APPLY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; + // State::INVALID + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; + // State::RO_INITIAL + state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL; + state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID; + state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL; + // State::RO_VALID + state_machine_[RO_VALID][SMI_VALID] = RO_VALID; + state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; + state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; + // State::RO_INVALID + state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; + state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; + state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; +} + + +void NoRepeatedApplyReadOnlyPolicy::input(SMInput input) +{ + //lyxerr << "NoReapeatedApplyReadOnlyPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "NoRepeatedApplyReadOnlyPolicy"); + } +} + + +/*--------------------------OkApplyCancelReadOnlyPolicy----------------------*/ + + +OkApplyCancelReadOnlyPolicy::OkApplyCancelReadOnlyPolicy() + : state_(INITIAL), + outputs_(RO_APPLIED + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(RO_APPLIED + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + outputs_[APPLIED] = OKAY | APPLY | CLOSE; + outputs_[RO_INITIAL] = CLOSE; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; + outputs_[RO_APPLIED] = CLOSE; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[VALID][SMI_APPLY] = APPLIED; + state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; + // State::INVALID + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; + // State::APPLIED + state_machine_[APPLIED][SMI_APPLY] = APPLIED; + state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED; + state_machine_[APPLIED][SMI_VALID] = VALID; + state_machine_[APPLIED][SMI_INVALID] = INVALID; + state_machine_[APPLIED][SMI_OKAY] = INITIAL; + state_machine_[APPLIED][SMI_READ_ONLY] = RO_APPLIED; + // State::RO_INITIAL + state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL; + state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID; + state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL; + // State::RO_VALID + state_machine_[RO_VALID][SMI_VALID] = RO_VALID; + state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; + state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; + // State::RO_INVALID + state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; + state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; + state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; + state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; + // State::RO_APPLIED + state_machine_[RO_APPLIED][SMI_READ_ONLY] = RO_APPLIED; + state_machine_[RO_APPLIED][SMI_INVALID] = RO_INVALID; + state_machine_[RO_APPLIED][SMI_VALID] = RO_VALID; + state_machine_[RO_APPLIED][SMI_READ_WRITE] = APPLIED; +} + + +void OkApplyCancelReadOnlyPolicy::input(SMInput input) +{ + //lyxerr << "OkApplyCancelReadOnlyPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "OkApplyCancelReadOnlyPolicy"); + } +} + + +/*--------------------------OkApplyCancelPolicy----------------------*/ + + +OkApplyCancelPolicy::OkApplyCancelPolicy() + : state_(INITIAL), + outputs_(APPLIED + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(APPLIED + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + outputs_[APPLIED] = OKAY | APPLY | CLOSE; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL; + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_ONLY] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + state_machine_[VALID][SMI_APPLY] = APPLIED; + // State::INVALID + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_ONLY] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; + // State::APPLIED + state_machine_[APPLIED][SMI_APPLY] = APPLIED; + state_machine_[APPLIED][SMI_READ_ONLY] = APPLIED; + state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED; + state_machine_[APPLIED][SMI_VALID] = VALID; + state_machine_[APPLIED][SMI_INVALID] = INVALID; + state_machine_[APPLIED][SMI_OKAY] = INITIAL; +} + + +void OkApplyCancelPolicy::input(SMInput input) +{ + //lyxerr << "OkApplyCancelPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "OkApplyCancelPolicy"); + } +} + + +/*--------------------------NoRepeatedApplyPolicy----------------------*/ + + +NoRepeatedApplyPolicy::NoRepeatedApplyPolicy() + : state_(INITIAL), + outputs_(INVALID + 1, ButtonPolicy::ALL_BUTTONS), + state_machine_(INVALID + 1, + StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS)) +{ + // Build the state output map + outputs_[INITIAL] = CLOSE; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; + + // Build the state machine one state at a time + // NOTE: Since CANCEL and HIDE always go to INITIAL they are + // left out of the state machine and handled explicitly + // in input() + // + // State::INITIAL + state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL; + state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL; + state_machine_[INITIAL][SMI_VALID] = VALID; + state_machine_[INITIAL][SMI_INVALID] = INVALID; + // State::VALID + state_machine_[VALID][SMI_VALID] = VALID; + state_machine_[VALID][SMI_READ_ONLY] = VALID; + state_machine_[VALID][SMI_READ_WRITE] = VALID; + state_machine_[VALID][SMI_INVALID] = INVALID; + state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_APPLY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; + // State::INVALID + state_machine_[INVALID][SMI_INVALID] = INVALID; + state_machine_[INVALID][SMI_READ_ONLY] = INVALID; + state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; +} + + +void NoRepeatedApplyPolicy::input(SMInput input) +{ + //lyxerr << "NoRepeatedApplyPolicy::input" << endl; + + // CANCEL and HIDE always take us to INITIAL for all cases + if (SMI_CANCEL == input + || SMI_HIDE == input) { + state_ = INITIAL; + } else { + nextState(state_, + input, + state_machine_, + "NoRepeatedApplyPolicy"); + } +} diff --git a/src/frontends/controllers/ButtonPolicies.h b/src/frontends/controllers/ButtonPolicies.h new file mode 100644 index 0000000000..e8bf22b93a --- /dev/null +++ b/src/frontends/controllers/ButtonPolicies.h @@ -0,0 +1,473 @@ +// -*- C++ -*- +/* ButtonPolicies.h + * Provides a state machine implementation of the various button policies + * used by the dialogs. + * Author: Allan Rae + * This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. + * + * This file Copyright 2000 + * Allan Rae + * ====================================================== + */ + +#ifndef BUTTONPOLICIES_H +#define BUTTONPOLICIES_H + + +#include +#include + +#include "support/LOstream.h" + +/** An abstract base class for button policies. + A state machine implementation of the various button policies used by the + dialogs. Only the policy is implemented here. Separate ButtonController + classes are needed for each GUI implementation. + + Policy | ReadOnly | Apply Button | Repeated Apply + ======================================================================== + OkCancel | N | N | - + OkCancelReadOnly | Y | N | - + OkApplyCancel | N | Y | Y + OkApplyCancelReadOnly | Y | Y | Y + NoRepeatedApply | N | Y | N + NoRepeatedApplyReadOnly | Y | Y | N + Preferences | N | Y | No (Ok-Close) + Ignorant | N/A | N/A | N/A + ======================================================================== + + Policy + The name of the policy + ReadOnly + Does the policy treat read-only docs differently to read-write docs? + This usually means that when an SMI_READ_ONLY input arrives then + all the buttons are disabled except Cancel/Close. The state + machine tracks the inputs (valid/invalid) and has states for all + combinations. When an SMI_READ_WRITE input arrives the appropriate + machine state is entered (just as if the document had always been + read-write). + NOTE: If a dialog doesn't care about the read-only status of a document + (and uses an appropriate policy) it can never get into a read-only state + so isReadOnly() can only ever return false even though the document may + be read-only. + Repeated Apply + Simply means that it is alright to use the Apply button multiple times + without requiring a change of the dialog contents. If no repeating is + allowed the Ok+Apply buttons are deactivated. The Preferences dialog + has its own special version of repeated apply handling because its Ok + button is actually a Save button -- its always reasonable to Save the + preferences if the dialog has changed since the last save. + + The IgnorantPolicy is a special case that allows anything. + */ +class ButtonPolicy : public noncopyable { +public: + /// + virtual ~ButtonPolicy() {} + + /** The various possible state names. + Not all state-machines have this many states. However, we need + to define them all here so we can share the code. + */ + enum State { + /// + INITIAL = 0, + /// + VALID, + /// + INVALID, + /// + APPLIED, + /// + RO_INITIAL, + /// + RO_VALID, + /// + RO_INVALID, + /// + RO_APPLIED, + /// + BOGUS = 55 + }; + + /// The various button types. + enum Button { + /// + CLOSE = 0, // Not a real button, but effectively !CANCEL + /// + OKAY = 1, + /// + APPLY = 2, + /// + CANCEL = 4, + /// + UNDO_ALL = 8 + }; + /// + static const Button ALL_BUTTONS = + Button(OKAY | APPLY | CANCEL | UNDO_ALL); + + /** State machine inputs. + All the policies so far have both CANCEL and HIDE always going to + INITIAL. This won't necessarily be true for all [future] policies + though so I'll leave those two as distinct inputs rather than merge + them. For example, a dialog that doesn't update it's input fields + when reshown after being hidden needs a policy where CANCEL and + HIDE are treated differently. + */ + enum SMInput { + /// + SMI_VALID = 0, + /// + SMI_INVALID, + /// + SMI_OKAY, + /// + SMI_APPLY, + /// + SMI_CANCEL, + /// + SMI_UNDO_ALL, + /// + SMI_HIDE, + /// + SMI_READ_ONLY, + /// + SMI_READ_WRITE, + /// + SMI_NOOP, + /// + SMI_TOTAL // not a real input + }; + + /// Trigger a transition with this input. + virtual void input(SMInput) = 0; + /// Activation status of a button + virtual bool buttonStatus(Button) const = 0; + /// Are we in a read-only state? + virtual bool isReadOnly() const = 0; + + /// Transition map of the state machine. + typedef std::vector StateArray; + /// + typedef std::vector StateMachine; + /// The state outputs are the status of the buttons. + typedef std::vector StateOutputs; +}; + + +inline +std::ostream & operator<<(std::ostream & os, ButtonPolicy::State st) +{ + os << int(st); + return os; +} + + +inline +std::ostream & operator<<(std::ostream & os, ButtonPolicy::SMInput smi) +{ + os << int(smi); + return os; +} + + +//--------------------- Actual Policy Classes ----------------------------- + +/** Ok and Cancel buttons for dialogs with read-only operation. + Note: This scheme supports the relabelling of Cancel to Close and + vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class OkCancelPolicy : public ButtonPolicy { +public: + /// + OkCancelPolicy(); + /// + //virtual ~OkCancelPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /** Activation status of a button. + We assume that we haven't gotten into an undefined state. + This is reasonable since we can only reach states defined + in the state machine and they should all have been defined in + the outputs_ variable. Perhaps we can do something at compile + time to check that all the states have corresponding outputs. + */ + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return false; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + +/** Ok and Cancel buttons for dialogs where read-only operation is blocked. + The state machine design for this policy allows changes to occur within + the dialog while a file is read-only -- the okay button is disabled until + a read-write input is given. When the file is made read-write the dialog + will then be in the correct state (as if the file had always been + read-write). + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class OkCancelReadOnlyPolicy : public ButtonPolicy { +public: + /// + OkCancelReadOnlyPolicy(); + /// + //virtual ~OkCancelReadOnlyPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return RO_INITIAL == state_ + || RO_VALID == state_ + || RO_INVALID == state_ + || RO_APPLIED == state_; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Ok, Apply and Cancel buttons for dialogs where read-only operation + is blocked. + Repeated Apply are not allowed. Likewise, Ok cannot follow Apply without + some valid input. That is, the dialog contents must change between + each Apply or Apply and Ok. + The state machine design for this policy allows changes to occur within + the dialog while a file is read-only -- the Ok+Apply buttons are disabled + until a read-write input is given. When the file is made read-write the + dialog will then be in the correct state (as if the file had always been + read-write). + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class NoRepeatedApplyReadOnlyPolicy : public ButtonPolicy +{ +public: + /// + NoRepeatedApplyReadOnlyPolicy(); + /// + //virtual ~NoRepeatedApplyReadOnlyPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return RO_INITIAL == state_ + || RO_VALID == state_ + || RO_INVALID == state_ + || RO_APPLIED == state_; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Ok, Apply and Cancel buttons for dialogs where read-only + operation is blocked. + Repeated Apply is allowed. Likewise, Ok can follow Apply. + The state machine design for this policy allows changes to occur within + the dialog while a file is read-only -- the Ok+Apply buttons are disabled + until a read-write input is given. When the file is made read-write the + dialog will then be in the correct state (as if the file had always been + read-write). + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class OkApplyCancelReadOnlyPolicy : public ButtonPolicy { +public: + /// + OkApplyCancelReadOnlyPolicy(); + /// + //virtual ~OkApplyCancelReadOnlyPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return RO_INITIAL == state_ + || RO_VALID == state_ + || RO_INVALID == state_ + || RO_APPLIED == state_; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Ok, Apply and Cancel buttons for dialogs where repeated Apply is allowed. + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class OkApplyCancelPolicy : public ButtonPolicy { +public: + /// + OkApplyCancelPolicy(); + /// + //virtual ~OkApplyCancelPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return false; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Ok, Apply and Cancel buttons for dialogs with no repeated Apply. + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class NoRepeatedApplyPolicy : public ButtonPolicy { +public: + /// + NoRepeatedApplyPolicy(); + /// + //virtual ~NoRepeatedApplyPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return false; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Defines the policy used by the Preferences dialog. + Four buttons: Ok (Save), Apply, Cancel/Close, Restore. + Note: This scheme supports the relabelling of Cancel to Close + and vice versa. + This is based on the value of the bool state of the Button::CANCEL. + true == Cancel, false == Close + */ +class PreferencesPolicy : public ButtonPolicy { +public: + /// + PreferencesPolicy(); + /// + //virtual ~PreferencesPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput); + /// Activation status of a button. + virtual bool buttonStatus(Button button) const { + return button & outputs_[state_]; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return false; + } +private: + /// Current state. + State state_; + /// Which buttons are active for a given state. + StateOutputs outputs_; + /// + StateMachine state_machine_; +}; + + +/** Defines the policy used by dialogs that are forced to support a button + controller when they either don't have a use for one or are not ready to + use one. This may be useful when testing a new button policy but wishing + to minimise problems to users by supplying an anything-goes policy via a + preprocessor directive. + */ +class IgnorantPolicy : public ButtonPolicy { +public: + //virtual ~IgnorantPolicy() {} + + /// Trigger a transition with this input. + virtual void input(SMInput) {} + /// Activation status of a button. + virtual bool buttonStatus(Button) const { + return true; + } + /// Are we in a read-only state? + virtual bool isReadOnly() const { + return false; + } +}; + +#endif diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog new file mode 100644 index 0000000000..cbce26aaab --- /dev/null +++ b/src/frontends/controllers/ChangeLog @@ -0,0 +1,112 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + +2001-03-12 Angus Leeming + + * Makefile.am: add ControlBibitem.[Ch]. + + * ControlBibitem.[Ch]: new files that together define the Controller + for a Bibitem popup. + + * ControlCommand.h (c-tor): give kb_action a default value of + LFUN_NOACTION. + + * ControlCommand.C (apply): do nothing if kb_action is LFUN_NOACTION. + + * ControlCitation.[Ch]: moved search functions out of class. + (bibkeysInfo): new method. Returns const reference to private data. + (searchKeys): added case-sensitive switch. Used only by simpleSearch + for now. + +2001-03-09 Angus Leeming + + * ControlCitation.[Ch]: added Search functions to the class, + (shamelessly lifted from Marco's gnome code). I think that these would + be better as helper functions outside the class, but this is a first + stab at it. + +2001-03-07 Angus Leeming + + * ControlCitation.[Ch]: (getBibkeyList): removed from class + ControlCitation. + (getBibkeys, getBibkeyInfo): added to class ControlCitation. + (getStringFromVector, getVectorFromString, parseBibTeX): new helper + funcs. parseBibTeX() is lifted staraight out of Marco's gnome + implementation of FormCitation. + +2001-03-05 Angus Leeming + + * ButtonPolicies.h: add SMI_NOOP to enum. + + * ButtonPolicies.C (nextState): add if-statement for SMI_NOOP. + + * ButtonController.C (input): add "optimising" if-statement. Actually, + things don't work correctly without it... + +2001-03-02 John Levon + + * ViewBase.h: remove #pragma directive + + * ControlConnection.[Ch] (ControlConnectBI c-tor): add explicit c-tor + to make g++ happy. + +2001-03-02 Angus Leeming + + * ButtonPolicies.[Ch]: moved from ../ButtonPolicies.[Ch] + + * Makefile.am: added ButtonPolicies.[Ch] + + * ButtonController.[Ch]: ButtonController is split into + ButtonControllerBase and a template ButtonController class. The base + class no longer stores a pointer to a ButtonPolicy, but instead + accesses the actual instantiation of the policy through a pure virtual + method bp(). This method and the ButtonPolicy itself are instantiated + in the templatised ButtonController class. This class is derived from + the GUI-specific GUIBC class, meaning that the frontends know + nothing about the actual policy decided upon by the controllers. + + * ControlBase.[Ch]: No longer store the View or the ButtonController. + Instead the actual instantiations are accessed through pure virtual + methods view() and bc(). The daughter classes are responsible for the + actual View and ButtonController. + + * ControlCitation.h: the templatised class GUICitation instantiates + the methods view() and bc(). It also stores the instances of the + View and ButtonController. + +2001-02-23 Angus Leeming + + * ButtonControllerBase.[Ch]: renamed as ButtonController.[Ch]. Class + also changed to ButtonController. + + * ControlBase.[Ch]: + * ControlConnections.[Ch]: + * ControlCommand.[Ch]: + * ControlCitation.[Ch]: + * ViewBase.h: Changes associated with this. + +2001-01-15 Angus Leeming + + * ButtonControllerBase.[Ch]: new files. Split Allan's original + xforms/ButtonController class into a GUI-I class (here) and an + xforms-specific derived class, to be found in xforms/xformsBC.[Ch]. + + * ControlBase.[Ch]: new files. ControlBase is an abstract base class + from which all Dialog Controllers should be derived. the Controllers + are GUI-independent, but are designed to control the behaviour of + GUI-specific implementaions of each dialog. + + * ControlConnections.[Ch]: new files. Classes controlling the + connections of buffer-independent, buffer-dependent and Inset dialogs + with the LyX kernel. + + * ControlCommand.[Ch]: new files. A controller for all dialogs for the + InsetCommand subset of insets. + + * ControlCitation.[Ch]: new files. The test specialisation! A + controller for the Citation dialog. + + * ViewBase.h: new file. ViewBase is an abstract base class from which + GUI-specific dialogs should be derived. The functionality that the GUIs + must now implement is much reduced. diff --git a/src/frontends/controllers/ControlBase.C b/src/frontends/controllers/ControlBase.C new file mode 100644 index 0000000000..6b18056c3f --- /dev/null +++ b/src/frontends/controllers/ControlBase.C @@ -0,0 +1,59 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlBase.C + * \author Angus Leeming + */ + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include + +#include "buffer.h" +#include "ButtonController.h" +#include "ControlBase.h" +#include "LyXView.h" +#include "support/LAssert.h" + +void ControlBase::ApplyButton() +{ + apply(); + bc().apply(); +} + + +void ControlBase::OKButton() +{ + apply(); + hide(); + bc().ok(); +} + + +void ControlBase::CancelButton() +{ + hide(); + bc().cancel(); +} + + +void ControlBase::RestoreButton() +{ + update(); + bc().undoAll(); +} + + +bool ControlBase::isReadonly() const +{ + return lv_.buffer()->isReadonly(); +} diff --git a/src/frontends/controllers/ControlBase.h b/src/frontends/controllers/ControlBase.h new file mode 100644 index 0000000000..7593ec3f15 --- /dev/null +++ b/src/frontends/controllers/ControlBase.h @@ -0,0 +1,83 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlBase.h + * \author Angus Leeming + * + * The Controller connects the GUI-dependent popup to any appropriate + * signals and dispatches any changes to the kernel. + * It has no knowledge of the actual instantiation of the + * GUI-dependent View and ButtonController, which should therefore + * be created elsewhere. + * Once created, the Controller will take care of their initialisation, + * management and, ultimately, destruction. + */ + +#ifndef CONTROLBASE_H +#define CONTROLBASE_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "DialogBase.h" // This can go eventually + +class ButtonControllerBase; +class Dialogs; +class LyXView; +class ViewBase; + +/** Abstract base class for Controllers with a ButtonController. + */ +class ControlBase : public DialogBase +{ +public: // methods + /// + ControlBase(LyXView & lv) : lv_(lv) {} + /// + virtual ~ControlBase() {}; + + /// These functions are called when the controlling buttons are pressed. + /// + void ApplyButton(); + /// + void OKButton(); + /// + void CancelButton(); + /// + void RestoreButton(); + + /// The View may need to know if the buffer is read-only. + bool isReadonly() const; + + /** Allow the view to access the ButtonController. This method must be + instantiated in a daughter class that creates the actual instance + of the ButtonController. */ + virtual ButtonControllerBase & bc() = 0; + +protected: + /// Get changed parameters and Dispatch them to the kernel. + virtual void apply() = 0; + /// Disconnect signals and hide View. + virtual void hide() = 0; + /// Update dialog before showing it. + virtual void update() = 0; + + /** Allow the Controller to access the View. This method must be + instantiated in a daughter class that creates the actual instance + of the View. */ + virtual ViewBase & view() = 0; + + /// Get at the kernel Dispatch methods we need to apply() parameters. + LyXView & lv_; +}; + + +#endif // CONTROLBASE_H diff --git a/src/frontends/controllers/ControlBibitem.C b/src/frontends/controllers/ControlBibitem.C new file mode 100644 index 0000000000..e92661d205 --- /dev/null +++ b/src/frontends/controllers/ControlBibitem.C @@ -0,0 +1,53 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlBibitem.C + * \author Angus Leeming + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include +#include "ControlBibitem.h" +#include "Dialogs.h" +#include "LyXView.h" +#include "BufferView.h" + +ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d) + : ControlCommand(lv, d) +{ + d_.showBibitem.connect(slot(this, &ControlBibitem::showInset)); +} + +void ControlBibitem::apply() +{ + view().apply(); + + if (inset_ && params() != inset_->params()) { + // FIXME: + // confirm, is this only necessary for FormBibTeX ??? + if (params().getContents() != inset_->params().getContents()) + lv_.view()->ChangeCitationsIfUnique( + inset_->params().getContents(), + params().getContents()); + + inset_->setParams(params()); + lv_.view()->updateInset(inset_, true); + + // We need to do a redraw because the maximum + // InsetBibKey width could have changed + lv_.view()->redraw(); + lv_.view()->fitCursor(lv_.view()->getLyXText()); + } +} diff --git a/src/frontends/controllers/ControlBibitem.h b/src/frontends/controllers/ControlBibitem.h new file mode 100644 index 0000000000..98b7bb5308 --- /dev/null +++ b/src/frontends/controllers/ControlBibitem.h @@ -0,0 +1,65 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlBibitem.h + * \author Angus Leeming + */ + +#ifndef CONTROLBIBITEM_H +#define CONTROLBIBITEM_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlCommand.h" +#include "ButtonController.h" +#include "ViewBase.h" + +/** A controller for Bibitem dialogs. + */ +class ControlBibitem : public ControlCommand +{ +public: + /// + ControlBibitem(LyXView &, Dialogs &); + +protected: + /// Get changed parameters and Dispatch them to the kernel. + virtual void apply(); +}; + +/** This class instantiates and makes available the GUI-specific + ButtonController and View. + */ +template +class GUIBibitem : public ControlBibitem { +public: + /// + GUIBibitem(LyXView &, Dialogs &); + /// + virtual ButtonControllerBase & bc() { return bc_; } + /// + virtual ViewBase & view() { return view_; } + +private: + /// + ButtonController bc_; + /// + GUIview view_; +}; + +template +GUIBibitem::GUIBibitem(LyXView & lv, Dialogs & d) + : ControlBibitem(lv, d), + view_(*this) +{} + +#endif // CONTROLBIBITEM_H diff --git a/src/frontends/controllers/ControlCitation.C b/src/frontends/controllers/ControlCitation.C new file mode 100644 index 0000000000..55b6ba21b2 --- /dev/null +++ b/src/frontends/controllers/ControlCitation.C @@ -0,0 +1,362 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlCitation.C + * \author Angus Leeming + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include + +#include "ControlCitation.h" +#include "buffer.h" +#include "ButtonController.h" +#include "Dialogs.h" +#include "LyXView.h" +#include "ViewBase.h" +#include "support/lstrings.h" +#include "support/LRegex.h" + +using std::find; +using std::min; +using std::pair; +using std::vector; +using std::sort; + +ControlCitation::ControlCitation(LyXView & lv, Dialogs & d) + : ControlCommand(lv, d, LFUN_CITATION_INSERT) +{ + // These are permanent connections so we won't bother + // storing a copy because we won't be disconnecting. + d_.showCitation.connect(slot(this, &ControlCitation::showInset)); + d_.createCitation.connect(slot(this, &ControlCitation::createInset)); +} + + +void ControlCitation::hide() +{ + bibkeysInfo_.clear(); + ControlCommand::hide(); +} + + +// A functor for use with std::sort, leading to case insensitive sorting +struct compareNoCase: public std::binary_function +{ + bool operator()(string const & s1, string const & s2) const { + return compare_no_case(s1, s2) < 0; + } +}; + + +vector const ControlCitation::getBibkeys() +{ + vector bibkeys; + bibkeysInfo_.clear(); + + vector > blist = lv_.buffer()->getBibkeyList(); + + for (vector >::size_type i=0; i::const_iterator +searchKeys(ControlCitation const & controller, + vector const & keys, + string const & expr, + vector::const_iterator start, + ControlCitation::Search type, + ControlCitation::Direction dir, + bool caseSensitive) +{ + // Preliminary checks + if(start < keys.begin() || start >= keys.end()) + return keys.end(); + + string search_expr = frontStrip(strip(expr)); + if (search_expr.empty()) + return start; + + if (type == ControlCitation::SIMPLE) + return simpleSearch(controller, keys, search_expr, start, dir, + caseSensitive); + + return regexSearch(controller, keys, search_expr, start, dir); +} + + +vector::const_iterator +simpleSearch(ControlCitation const & controller, + vector const & keys, + string const & expr, + vector::const_iterator start, + ControlCitation::Direction dir, + bool caseSensitive) +{ + vector searchwords = getVectorFromString(expr, ' '); + + // Loop over all keys from start... + for (vector::const_iterator it = start; + // End condition is direction-dependent. + (dir == ControlCitation::FORWARD) ? + (it=keys.begin()); + // increment is direction-dependent. + (dir == ControlCitation::FORWARD) ? + (++it) : (--it)) { + + string data = (*it); + ControlCitation::InfoMap::const_iterator info = + controller.bibkeysInfo().find(*it); + if (info != controller.bibkeysInfo().end()) + data += " " + info->second; + if (!caseSensitive) + data = lowercase(data); + + bool found = true; + + // Loop over all search words... + if (caseSensitive) { + for (vector::const_iterator sit= + searchwords.begin(); + sit::const_iterator sit= + searchwords.begin(); + sit::const_iterator +regexSearch(ControlCitation const & controller, + vector const & keys, + string const & expr, + vector::const_iterator start, + ControlCitation::Direction dir) +{ + LRegex reg(expr); + + for (vector::const_iterator it = start; + // End condition is direction-dependent. + (dir == ControlCitation::FORWARD) ? + (it=keys.begin()); + // increment is direction-dependent. + (dir == ControlCitation::FORWARD) ? + (++it) : (--it)) { + + string data = (*it); + ControlCitation::InfoMap::const_iterator info = + controller.bibkeysInfo().find(*it); + if (info != controller.bibkeysInfo().end()) + data += " " + info->second; + + if (reg.exec(data).size() > 0) + return it; + } + + return keys.end(); +} + +string const getStringFromVector(vector const & vec, char delim) +{ + string str; + for (vector::size_type i=0; i 0) str += tostr(delim) + " "; + str += vec[i]; + } + return str; +} + +vector const getVectorFromString(string const & str, char delim) +{ + vector vec; + string keys(str); + string tmp; + keys = frontStrip(split(keys, tmp, delim)); + while (!tmp.empty()) { + vec.push_back(tmp); + keys = frontStrip(split(keys, tmp, delim)); + } + return vec; +} + +string const parseBibTeX(string data, string const & findkey) +{ + string keyvalue; + + for (string::iterator it=data.begin(); it1) { + string tmp = data.substr(keypos, + data.length()-1); + while (tmp.find('{') != string::npos && + tmp.find('}') != string::npos && + tmp.find('{') < tmp.find('}') && + tmp.find('{') < tmp.find(enclosing)) { + + keypos += tmp.find('{')+1; + tmp = data.substr(keypos, + data.length()-1); + keypos += tmp.find('}')+1; + tmp = data.substr(keypos, + data.length()-1); + } + + if (tmp.find(enclosing)==string::npos) + return keyvalue; + else { + keypos += tmp.find(enclosing); + tmp = data.substr(keypos, + data.length()-1); + } + + value = data.substr(1, keypos-1); + + if (keypos+1 data.find(',')) + keypos = data.find(','); + + value = data.substr(0, keypos); + + if (keypos+1 + */ + +#ifndef CONTROLCITATION_H +#define CONTROLCITATION_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlCommand.h" +#include "ButtonController.h" +#include "ViewBase.h" + +/** A controller for Citation dialogs. All citation-specific functionality + should go in here. + */ +class ControlCitation : public ControlCommand +{ +public: + /// + typedef std::map InfoMap; + /// + typedef std::map::value_type InfoMapValue; + /// + enum Search { + /// + SIMPLE, + /// + REGEX + }; + /// + enum Direction { + /// + FORWARD, + /// + BACKWARD + }; + /// + ControlCitation(LyXView &, Dialogs &); + /// A vector of bibliography keys + std::vector const getBibkeys(); + /// Returns a reference to the map of stored keys + InfoMap const & bibkeysInfo() const { return bibkeysInfo_; } + /** Returns the BibTeX data associated with a given key. + Empty if no info exists. */ + string const getBibkeyInfo(string const &); +private: + /// Clean up, then hide dialog. + virtual void hide(); + /// The info associated with each key + InfoMap bibkeysInfo_; +}; + + +/** This class instantiates and makes available the GUI-specific + ButtonController and View. + */ +template +class GUICitation : public ControlCitation { +public: + /// + GUICitation(LyXView &, Dialogs &); + /// + virtual ButtonControllerBase & bc() { return bc_; } + /// + virtual ViewBase & view() { return view_; } + +private: + /// + ButtonController bc_; + /// + GUIview view_; +}; + +template +GUICitation::GUICitation(LyXView & lv, Dialogs & d) + : ControlCitation(lv, d), + view_(*this) +{} + +/** Helper functions, of possible use to all frontends + */ + +/** Multiple citation keys are stored in InsetCommandParams::contents as a + comma-separated string. These two functions convert to/from a vector. */ +string const getStringFromVector(std::vector const &, char delim=','); +/// +std::vector const getVectorFromString(string const &, char delim=','); + +/** Search a BibTeX info field for the given key and return the + associated field. */ +string const parseBibTeX(string data, string const & findkey); + +/** Returns an iterator to the first key that meets the search criterion, + or end() if unsuccessful. + + User supplies : + the controller with the map of bibkeys info, + the vector of keys to be searched, + the search criterion, + an iterator defining the starting point of the search, + an enum defining a Simple or Regex search, + an enum defining the search direction. +*/ + +std::vector::const_iterator +searchKeys(ControlCitation const & controller, + std::vector const & keys_to_search, + string const & search_expression, + std::vector::const_iterator start, + ControlCitation::Search, + ControlCitation::Direction, + bool caseSensitive=false); + +/// Do the dirty work for the search. Should use through the function above +std::vector::const_iterator +simpleSearch(ControlCitation const & controller, + std::vector const & keys_to_search, + string const & search_expression, + std::vector::const_iterator start, + ControlCitation::Direction, + bool caseSensitive=false); + +/// Should use through the function above +std::vector::const_iterator +regexSearch(ControlCitation const & controller, + std::vector const & keys_to_search, + string const & search_expression, + std::vector::const_iterator start, + ControlCitation::Direction); +#endif // CONTROLCITATION_H + + + diff --git a/src/frontends/controllers/ControlCommand.C b/src/frontends/controllers/ControlCommand.C new file mode 100644 index 0000000000..b19c7c7219 --- /dev/null +++ b/src/frontends/controllers/ControlCommand.C @@ -0,0 +1,113 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlCommand.C + * \author Angus Leeming + */ + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include + +#include "ControlCommand.h" +#include "BufferView.h" +#include "ButtonController.h" +#include "Dialogs.h" +#include "lyxfunc.h" +#include "LyXView.h" +#include "support/LAssert.h" +#include "ViewBase.h" + +ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac) + : ControlConnectInset(lv, d), + params_(0), action_(ac) +{} + + +void ControlCommand::showInset(InsetCommand * inset) +{ + if (inset == 0) return; // maybe we should Assert this? + + connectInset(inset); + show(inset->params()); +} + + +void ControlCommand::createInset(string const & arg) +{ + connectInset(); + + if ( !arg.empty() ) + bc().valid(); // so that the user can press Ok + + InsetCommandParams params; + params.setFromString(arg); + show(params); +} + + +void ControlCommand::update() +{ + if (params_) delete params_; + + if (inset_) + params_ = new InsetCommandParams(inset_->params()); + else + params_ = new InsetCommandParams; + + bc().readOnly(isReadonly()); + view().update(); +} + + +void ControlCommand::show(InsetCommandParams const & params) +{ + if (params_) delete params_; + params_ = new InsetCommandParams(params); + + bc().readOnly(isReadonly()); + view().show(); +} + + +void ControlCommand::hide() +{ + if (params_) { + delete params_; + params_ = 0; + } + + disconnect(); + view().hide(); +} + +InsetCommandParams & ControlCommand::params() const +{ + Assert(params_); + return *params_; +} + + +void ControlCommand::apply() +{ + view().apply(); + + if (inset_) { + // Only update if contents have changed + if (params() != inset_->params()) { + inset_->setParams(params()); + lv_.view()->updateInset(inset_, true); + } + } else if (action_ != LFUN_NOACTION){ + lv_.getLyXFunc()->Dispatch(action_, params().getAsString()); + } +} diff --git a/src/frontends/controllers/ControlCommand.h b/src/frontends/controllers/ControlCommand.h new file mode 100644 index 0000000000..802c422c3e --- /dev/null +++ b/src/frontends/controllers/ControlCommand.h @@ -0,0 +1,74 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlCommand.h + * \author Angus Leeming + * + * Defines a Controller class for dialogs that create or modify + * an inset derived from InsetCommand. + * Also defines the abstract base class from which the GUI-dependent Views + * of this dialog should be derived. + */ + +#ifndef CONTROLCOMMAND_H +#define CONTROLCOMMAND_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlConnections.h" +#include "insets/insetcommand.h" +#include "commandtags.h" // kb_action + +class Dialogs; +class LyXView; + +/** The Inset dialog controller. Connects/disconnects signals, launches + GUI-dependent View and returns the output from this View to the kernel. + */ +class ControlCommand : public ControlConnectInset +{ +public: + /// + ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION); + + /// Allow the View access to the local copy. + InsetCommandParams & params() const; + +protected: + /// Slots connected in the daughter classes c-tor. + /// Slot launching dialog to (possibly) create a new inset. + void createInset(string const &); + /// Slot launching dialog to an existing inset. + void showInset(InsetCommand *); + + /// Connect signals and launch View. + void show(InsetCommandParams const &); + + /// Instantiation of private ControlBase virtual methods. + /// Get changed parameters and Dispatch them to the kernel. + virtual void apply(); + /// Disconnect signals and hide View. + virtual void hide(); + /// Update dialog before showing it. + virtual void update(); + +private: + /** A local copy of the inset's params. + Memory is allocated only whilst the dialog is visible. + */ + InsetCommandParams * params_; + /// Controls what is done in LyXFunc::Dispatch() + kb_action const action_; +}; + + +#endif // CONTROLCOMMAND_H diff --git a/src/frontends/controllers/ControlConnections.C b/src/frontends/controllers/ControlConnections.C new file mode 100644 index 0000000000..b9511cdf6c --- /dev/null +++ b/src/frontends/controllers/ControlConnections.C @@ -0,0 +1,86 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlConnections.C + * \author Angus Leeming + */ + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include + +#include "ControlConnections.h" +#include "Dialogs.h" +#include "ViewBase.h" +#include "insets/lyxinset.h" + +#ifdef SIGC_CXX_NAMESPACES +using SigC::slot; +#endif + +ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d) + : ControlBase(lv), + d_(d), h_(0), r_(0) +{} + + +void ControlConnectBase::connect() +{ + r_ = Dialogs::redrawGUI. + connect(slot(this, &ControlConnectBase::redraw)); +} + +void ControlConnectBase::disconnect() +{ + h_.disconnect(); + r_.disconnect(); +} + + +void ControlConnectBase::redraw() +{ + view().redraw(); +} + + +ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d) + : ControlConnectBase(lv, d) +{} + + +void ControlConnectBI::connect() +{ + h_ = d_.hideAll.connect(slot(this, &ControlConnectBI::hide)); + ControlConnectBase::connect(); +} + +ControlConnectBD::ControlConnectBD(LyXView & lv, Dialogs & d) + : ControlConnectBase(lv, d), + u_(0) +{} + + +void ControlConnectBD::connect() +{ + u_ = d_.updateBufferDependent. + connect(slot(this, &ControlConnectBD::updateSlot)); + h_ = d_.hideBufferDependent. + connect(slot(this, &ControlConnectBD::hide)); + ControlConnectBase::connect(); +} + +void ControlConnectBD::disconnect() +{ + u_.disconnect(); + ControlConnectBase::disconnect(); +} + diff --git a/src/frontends/controllers/ControlConnections.h b/src/frontends/controllers/ControlConnections.h new file mode 100644 index 0000000000..ad68dc117c --- /dev/null +++ b/src/frontends/controllers/ControlConnections.h @@ -0,0 +1,180 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \file ControlConnections.h + * \author Angus Leeming + */ + +#ifndef CONTROLCONNECTIONS_H +#define CONTROLCONNECTIONS_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlBase.h" + +/** Base class to control connection/disconnection of signals with the LyX + kernel. It is meant to be used solely as the parent class to + ControlConnectBI and ControlConnectBD. +*/ +class ControlConnectBase : public ControlBase +{ +public: + /// + ControlConnectBase(LyXView &, Dialogs &); + +protected: + /// Connect signals + virtual void connect(); + /// Disconnect signals + virtual void disconnect(); + + /** Redraw the dialog (on receipt of a Signal indicating, for example, + its colors have been re-mapped). + */ + void redraw(); + + /// Contains the signals we have to connect to. + Dialogs & d_; + /// Hide connection. + Connection h_; + /// Redraw connection. + Connection r_; +}; + + +/** Base class to control connection/disconnection of signals with the LyX + kernel for Buffer Independent dialogs. + Such dialogs do not require an update Connection although they may use + an update() function which is also supported by the Restore button. + */ + +class ControlConnectBI : public ControlConnectBase +{ +public: + /// + ControlConnectBI(LyXView &, Dialogs &); + +protected: + /// Connect signals + virtual void connect(); +}; + + +/** Base class to control connection/disconnection of signals with the LyX + kernel for Buffer Dependent dialogs. + */ +class ControlConnectBD : public ControlConnectBase +{ +public: + /// + ControlConnectBD(LyXView &, Dialogs &); + +protected: + /** Slot connected to update signal. + Bool indicates if a buffer switch took place. + Default behaviour is to ignore this and simply update(). + */ + virtual void updateSlot(bool) { update(); } + /// Connect signals + virtual void connect(); + /// Disconnect signals + virtual void disconnect(); + +private: + /// Update connection. + Connection u_; +}; + +/** Base class to control connection/disconnection of signals with the LyX + kernel for Inset dialogs. + */ +class Inset; + +template +class ControlConnectInset : public ControlConnectBD +{ +public: + /// + ControlConnectInset(LyXView &, Dialogs &); + +protected: + /// Slot connected to update signal. + virtual void updateSlot(bool); + /// Connect signals + void connectInset(Inset * = 0); + /// Disconnect signals + virtual void disconnect(); + /// + void disconnectInset(); + +protected: + /// pointer to the inset passed through connectInset + Inset * inset_; + +private: + /// inset::hide connection. + Connection ih_; +}; + + +template +ControlConnectInset::ControlConnectInset(LyXView & lv, Dialogs & d) + : ControlConnectBD(lv, d), + ih_(0), inset_(0) +{} + + +template +void ControlConnectInset::updateSlot(bool switched) +{ + if (switched) + hide(); + else + update(); +} + + +template +void ControlConnectInset::disconnect() +{ + inset_ = 0; + ih_.disconnect(); + ControlConnectBD::disconnect(); +} + + +template +void ControlConnectInset::connectInset(Inset * inset) +{ + // If connected to another inset, disconnect from it. + if (inset_) { + ih_.disconnect(); + inset_ = 0; + } + + if (inset) { + inset_ = inset; + ih_ = inset->hideDialog.connect( + slot(this, &ControlConnectInset::hide)); + } + connect(); +} + + +template +void ControlConnectInset::disconnectInset() +{ + ih_.disconnect(); +} + + +#endif // CONTROLCONNECTIONS_H diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am new file mode 100644 index 0000000000..50d0e811e1 --- /dev/null +++ b/src/frontends/controllers/Makefile.am @@ -0,0 +1,41 @@ +AUTOMAKE_OPTIONS = foreign 1.4 +DISTCLEANFILES= *.orig *.rej *~ *.bak core +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +noinst_LTLIBRARIES = libcontrollers.la +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${top_srcdir}/src/ \ + -I${top_srcdir}/src/frontends/ \ + ${SIGC_CFLAGS} $(BOOST_INCLUDES) +LIBS = +SUBDIRS = +ETAGS_ARGS = --lang=c++ +libcontrollers_la_SOURCES=\ + ButtonController.C \ + ButtonController.h \ + ButtonPolicies.C \ + ButtonPolicies.h \ + ControlBase.C \ + ControlBase.h \ + ControlBibitem.C \ + ControlBibitem.h \ + ControlCitation.C \ + ControlCitation.h \ + ControlCommand.C \ + ControlCommand.h \ + ControlConnections.C \ + ControlConnections.h \ + ViewBase.h + +# just copied from old lyx repository +dist-hook: + for subdir in $(LYXDATADIRS) ; do \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + list=`(cd $(srcdir)/$$subdir && ls -1 | grep -v CVS)`; \ + echo $$list ; \ + for fil in $$list ; do \ + cp -p $(srcdir)/$$subdir/$$fil $(distdir)/$$subdir ; \ + done ; \ + done diff --git a/src/frontends/controllers/README b/src/frontends/controllers/README new file mode 100644 index 0000000000..06f2c05c5f --- /dev/null +++ b/src/frontends/controllers/README @@ -0,0 +1,17 @@ +This directory provides the controllers that act as an interface between the +LyX kernel and the GUI-specific implementations of each popup. It also +provides abstract base classes from which GUI-specific implemetations of the +ButtonController and each separate popup should be derived (see +ButtonControlBase.[Ch] and ViewBase.h respectively). + +The Controller connects the GUI-specific popup to any appropriate signals and +dispatches any changes in the data to the kernel. It has no knowledge of the +actual instantiation of the GUI-dependent View and ButtonController, which +should therefore be created elsewhere. Once created, the Controller will take +care of their initialisation, management and, ultimately, destruction. + +This leaves the GUI-specific popup (and its author!) to worry only about the +data that it has been created to input/modify. + +This concept has been instatiated for the Citation dialog only at the moment. +See xforms-new/FormCitation.[Ch] for an xforms-specific View of the dialog. diff --git a/src/frontends/controllers/ViewBase.h b/src/frontends/controllers/ViewBase.h new file mode 100644 index 0000000000..bbd6a52cd1 --- /dev/null +++ b/src/frontends/controllers/ViewBase.h @@ -0,0 +1,71 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * Author: Angus Leeming + */ + +#ifndef VIEWBASE_H +#define VIEWBASE_H + +#include +#include "ControlBase.h" + +class ViewBase { +public: + /// + ViewBase(ControlBase & c) : controller_(c) {} + /// + virtual ~ViewBase() {} + + /// Apply changes to LyX data from dialog. + virtual void apply() = 0; + /// Hide the dialog. + virtual void hide() = 0; + /// Redraw the dialog (e.g. if the colors have been remapped). + virtual void redraw() {} + /// Create the dialog if necessary, update it and display it. + virtual void show() = 0; + /// Update dialog before/whilst showing it. + virtual void update() = 0; + + /** These shortcuts allow (e.g. xform's) global callback functions + access to the buttons without making the whole controller_ public. + */ + /// + void ApplyButton() { controller_.ApplyButton(); } + /// + void OKButton() { controller_.OKButton(); } + /// + void CancelButton() { controller_.CancelButton(); } + /// + void RestoreButton() { controller_.RestoreButton(); } + +protected: + /// The view is, after all, controlled! + ControlBase & controller_; +}; + + +/** A generic class to cast the ButtonController controller_.bc_ to it's + daughter class. */ +template +class ViewBC : public ViewBase { +public: + /// + ViewBC(ControlBase & c) : ViewBase(c) {} + /// + GUIbc & bc() const + { + return static_cast(controller_.bc()); + // return dynamic_cast(controller_.bc()); + } +}; + +#endif // VIEWBASE_H diff --git a/src/frontends/kde/ChangeLog b/src/frontends/kde/ChangeLog index 600d865075..84b887bd93 100644 --- a/src/frontends/kde/ChangeLog +++ b/src/frontends/kde/ChangeLog @@ -1,3 +1,48 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + +2001-03-12 Angus Leeming + + * Dialogs.C (c-tor): Changes associated with storing a vector of + boost::shared_ptrs. + +2001-03-08 Angus Leeming + + * Makefile.am: added ../xforms/FormCredits.lo and + ../xforms/form_credits.lo + + * Dialogs.C: added FormCredits and removed ShowCredits. + +2001-03-07 Angus Leeming + + * FormCitation.[Ch]: cull large chunks of code, making more use of + ControlCitation and associated helper funcs. Also use boost::scoped_ptr + for dialog_. + +2001-03-05 Angus Leeming + + * FormCitation.[Ch]: use ButtonController::input() rather than + ButtonController::valid() to check state of input. The buttons are + now controlled correctly. + +2001-03-02 Angus Leeming + + * kdeBC.[Ch]: Changes associated with the changes to + controllers/ButtonController.[Ch]. Ie, the class is now derived from + ButtonControllerBase and the ButtonPolicy is accessed through a method + bp() rather than the instance bp_. + +2001-02-23 Angus Leeming + + * kdeBC.[Ch]: new files. A ButtonController for KDE. + + * FormCitation.[Ch]: + * citationdlg.[Ch]: A KDE-specific implementation of the + Citation dialog, controlled by the GUI-I ControlCitation. + + * Dialogs.C: Use the controlled Citation dialog. + 2001-03-15 Angus Leeming * FormParagraph.C: changes associated with Lars' creation of a diff --git a/src/frontends/kde/Dialogs.C b/src/frontends/kde/Dialogs.C index 90c6d83dd7..606720a218 100644 --- a/src/frontends/kde/Dialogs.C +++ b/src/frontends/kde/Dialogs.C @@ -11,10 +11,17 @@ #include FORMS_H_LOCATION #include "Dialogs.h" + +#include "ControlBibitem.h" +#include "ControlCitation.h" +#include "kdeBC.h" + #include "FormBibitem.h" #include "FormBibtex.h" #include "FormCitation.h" +#include "citationdlg.h" #include "FormCopyright.h" +#include "FormCredits.h" #include "FormDocument.h" #include "FormError.h" #include "FormGraphics.h" @@ -22,6 +29,7 @@ #include "FormIndex.h" #include "FormLog.h" #include "FormParagraph.h" +#include "FormPreamble.h" #include "FormPreferences.h" #include "FormPrint.h" #include "FormRef.h" @@ -36,9 +44,6 @@ #pragma implementation #endif -// temporary till ported -extern void ShowCredits(); - /* We don't implement this, but it's needed whilst we * still rely on xforms */ @@ -46,42 +51,34 @@ Signal0 Dialogs::redrawGUI; Dialogs::Dialogs(LyXView * lv) { -/* - dialogs_.push_back(new FormBibitem(lv, this)); - dialogs_.push_back(new FormBibtex(lv, this)); - dialogs_.push_back(new FormCitation(lv, this)); - dialogs_.push_back(new FormCopyright(lv, this)); - dialogs_.push_back(new FormDocument(lv, this)); - dialogs_.push_back(new FormError(lv, this)); - dialogs_.push_back(new FormGraphics(lv, this)); - dialogs_.push_back(new FormInclude(lv, this)); - dialogs_.push_back(new FormIndex(lv, this)); - dialogs_.push_back(new FormLog(lv, this)); - dialogs_.push_back(new FormParagraph(lv, this)); - dialogs_.push_back(new FormPreferences(lv, this)); - dialogs_.push_back(new FormPrint(lv, this)); - dialogs_.push_back(new FormRef(lv, this)); - dialogs_.push_back(new FormSplash(lv, this)); - dialogs_.push_back(new FormTabular(lv, this)); - dialogs_.push_back(new FormTabularCreate(lv, this)); - dialogs_.push_back(new FormToc(lv, this)); - dialogs_.push_back(new FormUrl(lv, this)); - dialogs_.push_back(new FormVCLog(lv, this)); + splash_.reset(new FormSplash(lv, this)); + + add(new GUIBibitem(*lv, *this)); + add(new GUICitation(*lv, *this)); - showCredits.connect(slot(ShowCredits)); + add(new FormBibtex(lv, this)); + add(new FormCharacter(lv, this)); + add(new FormCopyright(lv, this)); + add(new FormCredits(lv, this)); + add(new FormDocument(lv, this)); + add(new FormError(lv, this)); + add(new FormGraphics(lv, this)); + add(new FormInclude(lv, this)); + add(new FormIndex(lv, this)); + add(new FormLog(lv, this)); + add(new FormParagraph(lv, this)); + add(new FormPreamble(lv, this)); + add(new FormPreferences(lv, this)); + add(new FormPrint(lv, this)); + add(new FormRef(lv, this)); + add(new FormSearch(lv, this)); + add(new FormTabular(lv, this)); + add(new FormTabularCreate(lv, this)); + add(new FormToc(lv, this)); + add(new FormUrl(lv, this)); + add(new FormVCLog(lv, this)); // reduce the number of connections needed in // dialogs by a simple connection here. hideAll.connect(hideBufferDependent.slot()); -*/ -} - - -Dialogs::~Dialogs() -{ - for (vector::iterator iter = dialogs_.begin(); - iter != dialogs_.end(); - ++iter) { - delete *iter; - } } diff --git a/src/frontends/kde/FormCitation.C b/src/frontends/kde/FormCitation.C index 98e7a1c70f..02d14f2b1b 100644 --- a/src/frontends/kde/FormCitation.C +++ b/src/frontends/kde/FormCitation.C @@ -10,216 +10,159 @@ #include -#include "Dialogs.h" +#include "ControlCitation.h" #include "FormCitation.h" -#include "gettext.h" -#include "buffer.h" -#include "LyXView.h" -#include "lyxfunc.h" #include "citationdlg.h" +#include "gettext.h" +#include "kdeBC.h" +#include "support/lstrings.h" using std::vector; using std::pair; using std::find; -FormCitation::FormCitation(LyXView *v, Dialogs *d) - : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0), - keys(0), chosenkeys(0) -{ - d->showCitation.connect(slot(this, &FormCitation::showCitation)); - d->createCitation.connect(slot(this, &FormCitation::createCitation)); -} +FormCitation::FormCitation(ControlCitation & c) + : ViewBC(c), + keys(0), chosenkeys(0) +{} -FormCitation::~FormCitation() +ControlCitation & FormCitation::controller() const { - delete dialog_; + return static_cast(controller_); + //return dynamic_cast(controller_); } - -void FormCitation::showCitation(InsetCommand * const inset) -{ - // FIXME: when could inset be 0 here ? - if (inset==0) - return; - inset_ = inset; - readonly = lv_->buffer()->isReadonly(); - ih_ = inset_->hideDialog.connect(slot(this,&FormCitation::hide)); - params = inset->params(); - - show(); -} - - -void FormCitation::createCitation(string const & arg) +void FormCitation::show() { - // we could already be showing stuff, clear it out - if (inset_) - close(); + if (!dialog_.get()) + build(); - readonly = lv_->buffer()->isReadonly(); - params.setFromString(arg); - show(); + update(); + + dialog_->raise(); + dialog_->setActiveWindow(); + dialog_->show(); } -void FormCitation::updateButtons() +void FormCitation::apply() { - if (readonly) { - dialog_->add->setEnabled(false); - dialog_->remove->setEnabled(false); - dialog_->up->setEnabled(false); - dialog_->down->setEnabled(false); - return; - } - - bool ischosenkey = !selectedChosenKey.empty(); - - vector::const_iterator iter = - find(chosenkeys.begin(), chosenkeys.end(), selectedKey); - - dialog_->add->setEnabled(!selectedKey.empty() && iter == chosenkeys.end()); - dialog_->remove->setEnabled(ischosenkey); - dialog_->up->setEnabled(ischosenkey); - dialog_->down->setEnabled(ischosenkey); + controller().params().setCmdName("cite"); + controller().params().setContents(getStringFromVector(chosenkeys)); + controller().params().setOptions(dialog_->after->text()); } -void FormCitation::updateChosenList() +void FormCitation::hide() { - dialog_->chosen->setAutoUpdate(false); - dialog_->chosen->clear(); + chosenkeys.clear(); + selectedKey.erase(); + selectedChosenKey.erase(); - for (vector< string >::const_iterator iter = chosenkeys.begin(); - iter != chosenkeys.end(); ++iter) { - dialog_->chosen->insertItem(iter->c_str()); - } - dialog_->chosen->setAutoUpdate(true); - dialog_->chosen->update(); + if (dialog_.get() && dialog_->isVisible()) + dialog_->hide(); } -void FormCitation::updateAvailableList() +void FormCitation::build() { - dialog_->keys->setAutoUpdate(false); - dialog_->keys->clear(); - - for (vector< pair >::const_iterator iter = keys.begin(); - iter != keys.end(); ++iter) { - dialog_->keys->insertItem(iter->first.c_str()); - } - dialog_->keys->setAutoUpdate(true); - dialog_->keys->update(); + dialog_.reset(new CitationDialog(this, 0, "Citation", false)); + + // Manage the ok, apply, restore and cancel/close buttons + bc().setOK(dialog_->buttonOk); + //bc().setApply(dialog_->buttonApply); + bc().setCancel(dialog_->buttonCancel); + //bc().setUndoAll(dialog_->buttonRestore); + bc().refresh(); + + bc().addReadOnly(dialog_->add); + bc().addReadOnly(dialog_->remove); + bc().addReadOnly(dialog_->up); + bc().addReadOnly(dialog_->down); + //bc().addReadOnly(dialog_->style); + //bc().addReadOnly(dialog_->labelbefore); + bc().addReadOnly(dialog_->labelafter); } -// we can safely ignore the parameter because we can always update -void FormCitation::update(bool) +void FormCitation::update() { - keys.clear(); - - vector < pair > const ckeys = lv_->buffer()->getBibkeyList(); - - for (vector< pair >::const_iterator iter = ckeys.begin(); - iter != ckeys.end(); ++iter) { - keys.push_back(*iter); - } - + keys = controller().getBibkeys(); updateAvailableList(); selectedKey.erase(); - chosenkeys.clear(); - - string tmp, paramkeys(params.getContents()); - paramkeys = frontStrip(split(paramkeys, tmp, ',')); - - while (!tmp.empty()) { - chosenkeys.push_back(tmp); - paramkeys = frontStrip(split(paramkeys, tmp, ',')); - } - + chosenkeys = getVectorFromString(controller().params().getContents()); updateChosenList(); selectedChosenKey.erase(); dialog_->entry->setText(""); - - dialog_->after->setText(params.getOptions().c_str()); + dialog_->after->setText(controller().params().getOptions().c_str()); updateButtons(); - if (readonly) { + if (controller().isReadonly()) { dialog_->keys->setFocusPolicy(QWidget::NoFocus); dialog_->chosen->setFocusPolicy(QWidget::NoFocus); dialog_->after->setFocusPolicy(QWidget::NoFocus); - dialog_->buttonOk->setEnabled(false); - dialog_->buttonCancel->setText(_("&Close")); } else { dialog_->keys->setFocusPolicy(QWidget::StrongFocus); dialog_->chosen->setFocusPolicy(QWidget::StrongFocus); dialog_->after->setFocusPolicy(QWidget::StrongFocus); - dialog_->buttonOk->setEnabled(true); - dialog_->buttonCancel->setText(_("&Cancel")); } } -void FormCitation::apply() + +void FormCitation::updateButtons() { - if (readonly) + // Can go once ButtonController is working? + if (controller().isReadonly()) { + dialog_->add->setEnabled(false); + dialog_->remove->setEnabled(false); + dialog_->up->setEnabled(false); + dialog_->down->setEnabled(false); return; - - string contents; - - for (vector< string >::const_iterator iter = chosenkeys.begin(); - iter != chosenkeys.end(); ++iter) { - if (iter != chosenkeys.begin()) - contents += ", "; - contents += *iter; } - - params.setContents(contents); - params.setOptions(dialog_->after->text()); - - if (inset_ != 0) { - if (params != inset_->params()) { - inset_->setParams(params); - lv_->view()->updateInset(inset_, true); - } - } else - lv_->getLyXFunc()->Dispatch(LFUN_CITATION_INSERT, params.getAsString().c_str()); -} -void FormCitation::show() -{ - if (!dialog_) - dialog_ = new CitationDialog(this, 0, _("LyX: Citation Reference"), false); + bool ischosenkey = !selectedChosenKey.empty(); - if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormCitation::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormCitation::update)); - } + vector::const_iterator iter = + find(chosenkeys.begin(), chosenkeys.end(), selectedKey); - dialog_->raise(); - dialog_->setActiveWindow(); + dialog_->add->setEnabled(!selectedKey.empty() && iter == chosenkeys.end()); + dialog_->remove->setEnabled(ischosenkey); + dialog_->up->setEnabled(ischosenkey); + dialog_->down->setEnabled(ischosenkey); +} - update(); - dialog_->show(); + +void FormCitation::updateChosenList() +{ + updateList(dialog_->chosen, chosenkeys); } -void FormCitation::close() + +void FormCitation::updateAvailableList() { - h_.disconnect(); - u_.disconnect(); - ih_.disconnect(); - inset_ = 0; + updateList(dialog_->keys, keys); } -void FormCitation::hide() + +void FormCitation::updateList(QListBox * lb, vector const & keys) { - dialog_->hide(); - close(); + lb->setAutoUpdate(false); + lb->clear(); + + for (vector::const_iterator iter = keys.begin(); + iter != keys.end(); ++iter) { + lb->insertItem(iter->c_str()); + } + lb->setAutoUpdate(true); + lb->update(); } + void FormCitation::selectChosen() { for (unsigned int i=0; i < dialog_->chosen->count(); ++i) { @@ -231,15 +174,15 @@ void FormCitation::selectChosen() } } -void FormCitation::add() +ButtonPolicy::SMInput FormCitation::add() { if (selectedKey.empty()) - return; + return ButtonPolicy::SMI_NOOP; - for (vector< pair >::const_iterator iter = keys.begin(); + for (vector::const_iterator iter = keys.begin(); iter != keys.end(); ++iter) { - if (iter->first == selectedKey) { - chosenkeys.push_back(iter->first); + if (*iter == selectedKey) { + chosenkeys.push_back(*iter); break; } } @@ -247,12 +190,13 @@ void FormCitation::add() selectedChosenKey.erase(); updateChosenList(); updateButtons(); + return ButtonPolicy::SMI_VALID; } -void FormCitation::remove() +ButtonPolicy::SMInput FormCitation::remove() { if (selectedChosenKey.empty()) - return; + return ButtonPolicy::SMI_NOOP; for (vector< string >::iterator iter = chosenkeys.begin(); iter != chosenkeys.end(); ++iter) { @@ -264,12 +208,13 @@ void FormCitation::remove() selectedChosenKey.erase(); updateChosenList(); updateButtons(); + return ButtonPolicy::SMI_VALID; } -void FormCitation::up() +ButtonPolicy::SMInput FormCitation::up() { if (selectedChosenKey.empty()) - return; + return ButtonPolicy::SMI_NOOP; // Qt will select the first one on redo, so we need this string tmp = selectedChosenKey; @@ -285,18 +230,19 @@ void FormCitation::up() } } if (iter==chosenkeys.end()) - return; + return ButtonPolicy::SMI_NOOP; updateChosenList(); selectedChosenKey=tmp; selectChosen(); + return ButtonPolicy::SMI_VALID; } -void FormCitation::down() +ButtonPolicy::SMInput FormCitation::down() { if (selectedChosenKey.empty()) - return; + return ButtonPolicy::SMI_NOOP; // Qt will select the first one on redo, so we need this string tmp = selectedChosenKey; @@ -312,74 +258,67 @@ void FormCitation::down() } } if (iter == chosenkeys.end()) - return; + return ButtonPolicy::SMI_NOOP; updateChosenList(); selectedChosenKey=tmp; selectChosen(); + return ButtonPolicy::SMI_VALID; } -void FormCitation::select_key(char const * key) +ButtonPolicy::SMInput FormCitation::select_key(char const * key) { - if (readonly) - return; + if (controller().isReadonly()) + return ButtonPolicy::SMI_INVALID; vector::const_iterator iter = find(chosenkeys.begin(), chosenkeys.end(), key); if (iter != chosenkeys.end()) - return; + return ButtonPolicy::SMI_NOOP; selectedKey.erase(); selectedKey = key; add(); + return ButtonPolicy::SMI_VALID; } void FormCitation::highlight_key(char const * key) { - if (readonly) - return; - - selectedKey.erase(); - selectedKey = key; - - for (unsigned int i=0; i < keys.size(); i++) { - if (keys[i].first == key) { - dialog_->entry->setText(keys[i].second.c_str()); - dialog_->chosen->clearFocus(); - dialog_->chosen->clearSelection(); - selectedChosenKey.erase(); - break; - } - } - - updateButtons(); + highlight(key, dialog_->chosen, selectedKey, selectedChosenKey); } void FormCitation::highlight_chosen(char const * key) { - selectedChosenKey.erase(); - selectedChosenKey = key; + highlight(key, dialog_->keys, selectedChosenKey, selectedKey); +} + + +void FormCitation::highlight(char const * key, QListBox * lb, + string & selected1, string & selected2) +{ + selected1.erase(); + selected1 = key; unsigned int i; - for (i=0; i < keys.size(); i++) { - if (keys[i].first == key) { - if (keys[i].second.compare(dialog_->entry->text())) - dialog_->entry->setText(keys[i].second.c_str()); - dialog_->keys->clearFocus(); - dialog_->keys->clearSelection(); - selectedKey.erase(); + for (i=0; i < keys.size(); ++i) { + if (keys[i] == key) { + string const tmp = controller().getBibkeyInfo(key); + dialog_->entry->setText(tmp.c_str()); + lb->clearFocus(); + lb->clearSelection(); + selected2.erase(); break; } } if (i == keys.size()) - dialog_->entry->setText(_("Key not found in references.")); + dialog_->entry->setText(_("Key not found.")); updateButtons(); } diff --git a/src/frontends/kde/FormCitation.h b/src/frontends/kde/FormCitation.h index 8c8c11c071..99aff1c506 100644 --- a/src/frontends/kde/FormCitation.h +++ b/src/frontends/kde/FormCitation.h @@ -9,55 +9,56 @@ #ifndef FORMCITATION_H #define FORMCITATION_H -#include "DialogBase.h" -#include "support/lstrings.h" -#include "boost/utility.hpp" -#include "insets/insetcommand.h" - #include +#include + +#ifdef __GNUG__ +#pragma interface +#endif -class Dialogs; -class LyXView; +#include "ViewBase.h" +#include "ButtonPolicies.h" + +class kdeBC; +class QListBox; +class ControlCitation; class CitationDialog; -class FormCitation : public DialogBase { +class FormCitation : public ViewBC { public: - FormCitation(LyXView *, Dialogs *); + FormCitation(ControlCitation &); + + /// Functions accessible to the Controller. - ~FormCitation(); + /// Set the Params variable for the Controller. + virtual void apply(); + /// Set the Params variable for the Controller. + virtual void build(); + /// Hide the dialog. + virtual void hide(); + /// Update dialog before/whilst showing it. + virtual void update(); + /// Create the dialog if necessary, update it and display it. + void show(); - /// Apply changes - void apply(); - /// close the connections - void close(); /// add a key - void add(); + ButtonPolicy::SMInput add(); /// remove a key - void remove(); + ButtonPolicy::SMInput remove(); /// move a key up - void up(); + ButtonPolicy::SMInput up(); /// move a key down - void down(); + ButtonPolicy::SMInput down(); /// a key has been highlighted void highlight_key(char const * key); /// a chosen key has been highlighted void highlight_chosen(char const * key); /// a key has been double-clicked - void select_key(char const * key); + ButtonPolicy::SMInput select_key(char const * key); private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - /// Update the dialog. - void update(bool switched = false); - - /// create a Citation inset - void createCitation(string const &); - /// edit a Citation inset - void showCitation(InsetCommand * const); - + /// The parent controller + ControlCitation & controller() const; /// update add,remove,up,down void updateButtons(); /// update the available keys list @@ -66,33 +67,16 @@ private: void updateChosenList(); /// select the currently chosen key void selectChosen(); + /// does the dirty work for highlight_key(), highlight_chosen() + void highlight(char const *, QListBox *, string &, string &); + /// does the dirty work for updateAvailableList(), updateChosenList() + void updateList(QListBox *, std::vector const &); /// Real GUI implementation. - CitationDialog * dialog_; - - /// the LyXView we belong to - 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 if any - InsetCommand * inset_; - /// insets params - InsetCommandParams params; - /// is the inset we are reading from a readonly buffer ? - bool readonly; - - /// Hide connection. - Connection h_; - /// Update connection. - Connection u_; - /// Inset hide connection. - Connection ih_; + boost::scoped_ptr dialog_; /// available citation keys - std::vector > keys; + std::vector keys; /// chosen citation keys std::vector chosenkeys; diff --git a/src/frontends/kde/Makefile.am b/src/frontends/kde/Makefile.am index 804c6222aa..28f1bfc30d 100644 --- a/src/frontends/kde/Makefile.am +++ b/src/frontends/kde/Makefile.am @@ -3,7 +3,9 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libkde.la BOOST_INCLUDES = -I$(top_srcdir)/boost SUBDIRS = dlg moc -INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ +INCLUDES = -I${top_srcdir}/src/ \ + -I${top_srcdir}/src/frontends/ \ + -I${top_srcdir}/src/frontends/controllers \ ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \ -I${top_srcdir}/src/frontends/xforms @@ -15,11 +17,13 @@ libkde_la_OBJADD = \ moc/libkdemoc.la \ dlg/libkdedlg.la \ dlg/moc/libkdedlgmoc.la \ - ../xforms/FormBase.lo \ + ../xforms/FormBaseDeprecated.lo \ ../xforms/FormBibitem.lo \ ../xforms/form_bibitem.lo \ ../xforms/FormBibtex.lo \ ../xforms/form_bibtex.lo \ + ../xforms/FormCredits.lo \ + ../xforms/form_credits.lo \ ../xforms/FormError.lo \ ../xforms/form_error.lo \ ../xforms/FormGraphics.lo \ @@ -35,9 +39,9 @@ libkde_la_OBJADD = \ ../xforms/form_splash.lo \ ../xforms/FormTabular.lo \ ../xforms/form_tabular.lo \ - ../xforms/ButtonController.lo \ + ../xforms/xformsBC.lo \ ../xforms/Color.lo \ - ../xforms/xform_helpers.lo \ + ../xforms/xforms_helpers.lo \ ../xforms/input_validators.lo \ ../xforms/RadioButtonGroup.lo \ ../xforms/Toolbar_pimpl.lo \ @@ -55,6 +59,8 @@ libkde_la_SOURCES = \ QtLyXView.h \ Timeout_pimpl.C \ Timeout_pimpl.h \ + kdeBC.C \ + kdeBC.h \ FormCitation.C \ FormCitation.h \ FormCopyright.C \ diff --git a/src/frontends/kde/citationdlg.C b/src/frontends/kde/citationdlg.C index 69716446ab..bd24363d62 100644 --- a/src/frontends/kde/citationdlg.C +++ b/src/frontends/kde/citationdlg.C @@ -171,6 +171,6 @@ CitationDialog::~CitationDialog() void CitationDialog::closeEvent(QCloseEvent * e) { - form_->close(); + form_->CancelButton(); e->accept(); } diff --git a/src/frontends/kde/citationdlg.h b/src/frontends/kde/citationdlg.h index e076b4c8b6..8c4cf2a3a6 100644 --- a/src/frontends/kde/citationdlg.h +++ b/src/frontends/kde/citationdlg.h @@ -14,6 +14,7 @@ // to connect apply() and hide() #include "FormCitation.h" +#include "kdeBC.h" #include #include @@ -68,34 +69,31 @@ private: private slots: void apply_adaptor(void) { - form_->apply(); - form_->close(); - hide(); + form_->OKButton(); } void close_adaptor(void) { - form_->close(); - hide(); + form_->CancelButton(); } void add_adaptor(void) { - form_->add(); + form_->bc().valid(form_->add()); } void up_adaptor(void) { - form_->up(); + form_->bc().valid(form_->up()); } void down_adaptor(void) { - form_->down(); + form_->bc().valid(form_->down()); } void remove_adaptor(void) { - form_->remove(); + form_->bc().valid(form_->remove()); } void select_key_adaptor(const char * key) { - form_->select_key(key); + form_->bc().valid(form_->select_key(key)); } void highlight_key_adaptor(const char * key) { diff --git a/src/frontends/kde/docdlg.C b/src/frontends/kde/docdlg.C index db47b2a4cc..21e7169b8a 100644 --- a/src/frontends/kde/docdlg.C +++ b/src/frontends/kde/docdlg.C @@ -442,7 +442,7 @@ bool DocDialog::updateParams(BufferParams & params) tmpskip = VSpace(length); break; } - + if (!(tmpskip == params.getDefSkip())) { redo = true; params.setDefSkip(tmpskip); diff --git a/src/frontends/kde/kdeBC.C b/src/frontends/kde/kdeBC.C new file mode 100644 index 0000000000..87ec207db5 --- /dev/null +++ b/src/frontends/kde/kdeBC.C @@ -0,0 +1,55 @@ +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "kdeBC.h" +#include + +kdeBC::kdeBC(string const & cancel, string const & close) + : ButtonControllerBase(cancel, close), + okay_(0), apply_(0), cancel_(0), undo_all_(0), read_only_() +{} + + +void kdeBC::refresh() +{ + if (okay_) { + if (bp().buttonStatus(ButtonPolicy::OKAY)) { + okay_->setEnabled(true); + } else { + okay_->setEnabled(false); + } + } + if (apply_) { + if (bp().buttonStatus(ButtonPolicy::APPLY)) { + apply_->setEnabled(true); + } else { + apply_->setEnabled(false); + } + } + if (undo_all_) { + if (bp().buttonStatus(ButtonPolicy::UNDO_ALL)) { + undo_all_->setEnabled(true); + } else { + undo_all_->setEnabled(false); + } + } + if (cancel_) { + if (bp().buttonStatus(ButtonPolicy::CANCEL)) { + cancel_->setText(cancel_label.c_str()); + } else { + cancel_->setText(close_label.c_str()); + } + } + if (!read_only_.empty()) { + bool enable = true; + if (bp().isReadOnly()) enable = false; + + for (std::list::iterator iter = read_only_.begin(); + iter != read_only_.end(); ++iter) { + (*iter)->setEnabled(enable); + } + } +} diff --git a/src/frontends/kde/kdeBC.h b/src/frontends/kde/kdeBC.h new file mode 100644 index 0000000000..03d1631b70 --- /dev/null +++ b/src/frontends/kde/kdeBC.h @@ -0,0 +1,77 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. + * + * ====================================================== + * + * Author: Angus Leeming + */ + +#ifndef KDEBC_H +#define KDEBC_H + +#include "ButtonController.h" +#include + +#ifdef __GNUG__ +#pragma interface +#endif + +class QWidget; +class QPushButton; + +class kdeBC : public ButtonControllerBase +{ +public: + /// + kdeBC(string const & cancel, string const & close); + + /* Initialise Button Functions */ + /// Call refresh() when finished setting the buttons. + void setOK(QPushButton * obj) { + okay_ = obj; + } + /// + void setApply(QPushButton * obj) { + apply_ = obj; + } + /// + void setCancel(QPushButton * obj) { + cancel_ = obj; + } + /// + void setUndoAll(QPushButton * obj) { + undo_all_ = obj; + } + /// + void addReadOnly(QWidget * obj) { + read_only_.push_front(obj); + } + /// + void eraseReadOnly() { + read_only_.erase(read_only_.begin(), read_only_.end()); + } + + /* Action Functions */ + /// force a refresh of the buttons + virtual void refresh(); + +private: + /// + QPushButton * okay_; + /// + QPushButton * apply_; + /// + QPushButton * cancel_; + /// + QPushButton * undo_all_; + /// List of items to be deactivated when in one of the read-only states + std::list read_only_; +}; + +#endif // KDEBC_H diff --git a/src/frontends/kde/moc/Makefile.am b/src/frontends/kde/moc/Makefile.am index 57b76e12e2..2ab36ad063 100644 --- a/src/frontends/kde/moc/Makefile.am +++ b/src/frontends/kde/moc/Makefile.am @@ -2,8 +2,12 @@ AUTOMAKE_OPTIONS = foreign 1.4 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libkdemoc.la BOOST_INCLUDES = -I$(top_srcdir)/boost -INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ - ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} ${BOOST_INCLUDES} +INCLUDES = -I${top_srcdir}/src/ \ + -I${top_srcdir}/src/frontends/ \ + -I${top_srcdir}/src/frontends/controllers \ + ${SIGC_CFLAGS} \ + ${FRONTEND_INCLUDES} \ + $(BOOST_INCLUDES) libkdemoc_la_SOURCES = FileDialog_private_moc.C \ citationdlg_moc.C \ diff --git a/src/frontends/xforms/ButtonController.C b/src/frontends/xforms/ButtonController.C deleted file mode 100644 index 9e497995c6..0000000000 --- a/src/frontends/xforms/ButtonController.C +++ /dev/null @@ -1,182 +0,0 @@ -#include - -#include - -#include FORMS_H_LOCATION - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "ButtonController.h" -#include "support/LAssert.h" -#include "gettext.h" // _() -//#include "debug.h" - -using std::find; -using std::vector; - -ButtonController::ButtonController(ButtonPolicy * bp, - char const * cancel, char const * close) - : bp_(bp), okay_(0), apply_(0), cancel_(0), undo_all_(0), - read_only_(), dont_trigger_change_(), - cancel_label(cancel), close_label(close) -{ - Assert(bp); -} - - -void ButtonController::refresh() -{ - if (okay_) { - if (bp_->buttonStatus(ButtonPolicy::OKAY)) { - fl_activate_object(okay_); - fl_set_object_lcol(okay_, FL_BLACK); - } else { - fl_deactivate_object(okay_); - fl_set_object_lcol(okay_, FL_INACTIVE); - } - } - if (apply_) { - if (bp_->buttonStatus(ButtonPolicy::APPLY)) { - fl_activate_object(apply_); - fl_set_object_lcol(apply_, FL_BLACK); - } else { - fl_deactivate_object(apply_); - fl_set_object_lcol(apply_, FL_INACTIVE); - } - } - if (undo_all_) { - if (bp_->buttonStatus(ButtonPolicy::UNDO_ALL)) { - fl_activate_object(undo_all_); - fl_set_object_lcol(undo_all_, FL_BLACK); - } else { - fl_deactivate_object(undo_all_); - fl_set_object_lcol(undo_all_, - FL_INACTIVE); - } - } - if (cancel_) { - if (bp_->buttonStatus(ButtonPolicy::CANCEL)) { - fl_set_object_label(cancel_, - _(cancel_label)); - } else { - fl_set_object_label(cancel_, - _(close_label)); - } - } - if (!read_only_.empty()) { - if (bp_->isReadOnly()) { - std::list::iterator - end = read_only_.end(); - for (std::list::iterator - iter = read_only_.begin(); - iter != end; - ++iter) { - fl_deactivate_object(*iter); - fl_set_object_lcol(*iter, - FL_INACTIVE); - } - } else { - std::list::iterator - end = read_only_.end(); - for (std::list::iterator - iter = read_only_.begin(); - iter != end; - ++iter) { - fl_activate_object(*iter); - fl_set_object_lcol(*iter, - FL_BLACK); - } - } - } -} - - -void ButtonController::input(ButtonPolicy::SMInput in) -{ - //lyxerr << "ButtonController::input: bp_[" << bp_ << "]" << endl; - bp_->input(in); - refresh(); -} - - -void ButtonController::ok() -{ - input(ButtonPolicy::SMI_OKAY); -} - - -void ButtonController::apply() -{ - input(ButtonPolicy::SMI_APPLY); -} - - -void ButtonController::cancel() -{ - input(ButtonPolicy::SMI_CANCEL); -} - - -void ButtonController::undoAll() -{ - input(ButtonPolicy::SMI_UNDO_ALL); -} - - -void ButtonController::hide() -{ - input(ButtonPolicy::SMI_HIDE); -} - - -bool ButtonController::readOnly(bool ro) -{ - if (ro) { - input(ButtonPolicy::SMI_READ_ONLY); - } else { - input(ButtonPolicy::SMI_READ_WRITE); - } - return ro; -} - - -void ButtonController::readWrite() -{ - readOnly(false); -} - - -bool ButtonController::valid(bool v, FL_OBJECT * obj) -{ - if (obj && !dont_trigger_change_.empty()) { - vector::const_iterator cit = - find(dont_trigger_change_.begin(), - dont_trigger_change_.end(), - obj); - - // Only trigger a change if the obj is not in the list - if (cit == dont_trigger_change_.end()) { - if (v) { - input(ButtonPolicy::SMI_VALID); - } else { - input(ButtonPolicy::SMI_INVALID); - } - } - } else { - if (v) { - input(ButtonPolicy::SMI_VALID); - } else { - input(ButtonPolicy::SMI_INVALID); - } - } - - return v; -} - - -void ButtonController::invalid() -{ - valid(false); -} diff --git a/src/frontends/xforms/ButtonController.h b/src/frontends/xforms/ButtonController.h deleted file mode 100644 index 3b22b692cc..0000000000 --- a/src/frontends/xforms/ButtonController.h +++ /dev/null @@ -1,146 +0,0 @@ -// -*- C++ -*- -/* ButtonController.h - * Controls the activation of the OK, Apply and Cancel buttons. - * Actually supports 4 buttons in all and it's up to the user to decide on - * the activation policy and which buttons correspond to which output of the - * state machine. - * Author: Allan Rae - * This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. - * - * This file Copyright 2000 - * Allan Rae - * ====================================================== - */ - -#ifndef BUTTONCONTROLLER_H -#define BUTTONCONTROLLER_H - -#include "ButtonPolicies.h" -#include - -#ifdef __GNUG__ -#pragma interface -#endif - -/** General purpose button controller for up to four buttons. - Controls the activation of the OK, Apply and Cancel buttons. - Actually supports 4 buttons in all and it's up to the user to decide on - the activation policy and which buttons correspond to which output of the - state machine. - @author Allan Rae - 20001001 Switch from template implementation to taking Policy parameter. - Allows FormBase to provide a ButtonController for any dialog. -*/ -class ButtonController : public noncopyable -{ -public: - /** Constructor. - The cancel/close label entries are _not_ managed within the class - thereby allowing you to reassign at will and to use static labels. - It also means if you really don't want to have the Cancel button - label be different when there is nothing changed in the dialog then - you can just assign "Cancel" to both labels. Or even reuse this - class for something completely different. - */ - ButtonController(ButtonPolicy * bp, - char const * cancel, char const * close); - - // Somebody else owns the FL_OBJECTs we just manipulate them. - // so? (Lgb) - //~ButtonController() {} - - /* Initialise Button Functions */ - /// Call refresh() when finished setting the buttons. - void setOK(FL_OBJECT * obj) { - okay_ = obj; - } - /// - void setApply(FL_OBJECT * obj) { - apply_ = obj; - } - /// - void setCancel(FL_OBJECT * obj) { - cancel_ = obj; - } - /// - void setUndoAll(FL_OBJECT * obj) { - undo_all_ = obj; - } - /// - void setCancelTrueLabel(char const * c) { - cancel_label = c; - } - /// - void setCancelFalseLabel(char const * c) { - close_label = c; - } - /// - void addReadOnly(FL_OBJECT * obj) { - read_only_.push_front(obj); - } - /// - void eraseReadOnly() { - read_only_.erase(read_only_.begin(), read_only_.end()); - } - - /// - void addDontTriggerChange(FL_OBJECT * obj) { - dont_trigger_change_.push_back(obj); - } - /// - void eraseDontTriggerChange() { - dont_trigger_change_.clear(); - } - - /* Action Functions */ - /// force a refresh of the buttons - void refresh(); - - /// - void input(ButtonPolicy::SMInput in); - /// - void ok(); - /// - void apply(); - /// - void cancel(); - /// - void undoAll(); - /// - void hide(); - /// Passthrough function -- returns its input value - bool readOnly(bool ro = true); - /// - void readWrite(); - /// Passthrough function -- returns its input value - bool valid(bool v = true, FL_OBJECT * obj = 0); - /// - void invalid(); -private: - /// - ButtonPolicy * bp_; - /// - FL_OBJECT * okay_; - /// - FL_OBJECT * apply_; - /// - FL_OBJECT * cancel_; - /// - FL_OBJECT * undo_all_; - /// List of items to be deactivated when in one of the read-only states - std::list read_only_; - /// container of items that do not trigger a change in activation status - std::vector dont_trigger_change_; - /// - char const * cancel_label; - /// - char const * close_label; -}; - -#endif diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 99b4ea4e42..eb7a1b504c 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,10 +1,121 @@ +2001-03-14 Angus Leeming + + * Merging changes from BRANCH_MVC back into HEAD. + +2001-03-12 Angus Leeming + + * Dialogs.C (c-tor): Changes associated with storing a vector of + boost::shared_ptrs. + Use MVC Bibitem popup. + + * FormBase.h: add a new template class FormBase2, derived from FormBase + to make life creating MVC popups even easier ;-) + + * FormBibitem.[Ch]: + * forms/form_bibitem.fd: moved over to the MVC way of doing things. + Proof that a simple popup should be easy to implement! + + * FormCitation.[Ch]: now derived from FormBase2. + + * FormToc.C: added using std::vector directive. + +2001-03-09 Dekel Tsur + + * FormSearch.C: Add missing #pragma + +2001-03-09 Angus Leeming + + * FormCitation.C: + * forms/form_citation.fd: added the ability to Search, both Simply and + for Regular Expressions. Use the Search code in the controller() to do + the actual searching. + +2001-03-08 Angus Leeming + + * Makefile.am: added FormCredits.[Ch] and form_credits.[Ch] + * forms/makefile: added form_credits.fd + + * Dialogs.C: added FormCredits and removed ShowCredits. + + * FormCredits.[Ch]: + * forms/form_credits.fd: + * forms/form_search.fd: ported to the MVC way. + +2001-03-07 Angus Leeming + + * xforms_helpers.h (formatted): now has default arguments for size and + style. + + * FormCitation.[Ch]: moved code out of this class and into + ControlCitation and associated helper funcs. + +2001-03-05 Angus Leeming + + * FormBase.[Ch]: (InputCB): use ButtonController::input() rather than + ButtonController::valid() to check state of input. The buttons are + now controlled correctly. + + * Form*.[Ch]: use boost::scoped_ptr for the remaining few classes. + +2001-03-05 Lars Gullik Bjønnes + + * Form*.[Ch]: use boost::scoped_ptr for dialog_ et al. + + * FormBase.[Ch]: rename title as title_. + +2001-03-02 John Levon + + * FormBase.C (c-tor): initialise variables in correct order. + + * FormCitation.C: add #include + +2001-03-02 Angus Leeming + + * xformsBC.[Ch]: Changes associated with the changes to + controllers/ButtonController.[Ch]. Ie, the class is now derived from + ButtonControllerBase and the ButtonPolicy is accessed through a method + bp() rather than the instance bp_. + + * FormBaseDeprecated.[Ch]: no longer store a ButtonController, but + rather use a pure virtual method bc() to access the controller + instantiated by the daughter classes. + + * F*.[Ch]: changes associated with the above. + +2001-02-27 Angus Leeming + + * FormBase.[Ch]: renamed as FormBaseDeprecated.[Ch] + + * ViewXforms.[Ch]: renamed as FormBase.[Ch] + +2001-02-23 Angus Leeming + + * ButtonController.[Ch]: deleted. The class is split into two + (with identical functionality), the code being found in + ../controllers/ButtonController.[Ch] and xformsBC.[Ch] + + * xformsBC.[Ch]: new files. Xforms specific part of Allan's original + ButtonController class. + + * FormBase.[Ch]: changes associated with the above split. + + * ViewXforms.[Ch]: Base class for xforms dialogs derived from ViewBase + (../controllers/ViewBase.h). Ie, for Dialogs with GUI-I controllers + controlling all interaction to/from the LyX kernel. + + * FormCitation.[Ch]: + * forms/form_citation.fd: An xforms-specific implementation of the + Citation dialog, controlled by the GUI-I ControlCitation. + + * Dialogs.C: Use the controlled Citation dialog. + 2001-03-09 Angus Leeming * forms/fdfix.sh: * forms/form_filedialog.C.patch: I hate having to make these patches, but on reflection I think it's probably better than hacking fdfix.sh. -22001-03-13 John Levon +2001-03-13 John Levon * FormGraphics.C: remove unnecessary hack diff --git a/src/frontends/xforms/Color.C b/src/frontends/xforms/Color.C index ec269bb95f..05806d7b24 100644 --- a/src/frontends/xforms/Color.C +++ b/src/frontends/xforms/Color.C @@ -10,14 +10,16 @@ *======================================================*/ #include + +#include // max +#include // floor + #include FORMS_H_LOCATION #ifdef __GNUG_ #pragma implementation #endif -#include // max -#include // floor #include "Color.h" using std::max; diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 604c032129..4e218d7792 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -10,8 +10,18 @@ */ #include +#include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma implementation +#endif #include "Dialogs.h" + +#include "ControlBibitem.h" +#include "ControlCitation.h" +#include "xformsBC.h" + #include "FormBibitem.h" #include "FormBibtex.h" #include "FormCitation.h" @@ -38,70 +48,46 @@ #include "FormUrl.h" #include "FormVCLog.h" -#ifdef __GNUG__ -#pragma implementation -#endif - -using std::endl; - // Signal enabling all visible popups to be redrawn if so desired. // E.g., when the GUI colours have been remapped. Signal0 Dialogs::redrawGUI; - Dialogs::Dialogs(LyXView * lv) { - splash_ = new FormSplash(lv, this); - - dialogs_.push_back(new FormBibitem(lv, this)); - dialogs_.push_back(new FormBibtex(lv, this)); - dialogs_.push_back(new FormCharacter(lv, this)); - dialogs_.push_back(new FormCitation(lv, this)); - dialogs_.push_back(new FormCopyright(lv, this)); - dialogs_.push_back(new FormCredits(lv, this)); - dialogs_.push_back(new FormDocument(lv, this)); - dialogs_.push_back(new FormError(lv, this)); - dialogs_.push_back(new FormExternal(lv, this)); - dialogs_.push_back(new FormGraphics(lv, this)); - dialogs_.push_back(new FormInclude(lv, this)); - dialogs_.push_back(new FormIndex(lv, this)); - dialogs_.push_back(new FormLog(lv, this)); - dialogs_.push_back(new FormParagraph(lv, this)); - dialogs_.push_back(new FormPreamble(lv, this)); - dialogs_.push_back(new FormPreferences(lv, this)); - dialogs_.push_back(new FormPrint(lv, this)); - dialogs_.push_back(new FormRef(lv, this)); - dialogs_.push_back(new FormSearch(lv, this)); - dialogs_.push_back(new FormTabular(lv, this)); - dialogs_.push_back(new FormTabularCreate(lv, this)); - dialogs_.push_back(new FormToc(lv, this)); - dialogs_.push_back(new FormUrl(lv, this)); - dialogs_.push_back(new FormVCLog(lv, this)); - + splash_.reset(new FormSplash(lv, this)); + + add(new GUICitation(*lv, *this)); + add(new GUIBibitem(*lv, *this)); + + add(new FormBibtex(lv, this)); + add(new FormCharacter(lv, this)); + add(new FormCopyright(lv, this)); + add(new FormCredits(lv, this)); + add(new FormDocument(lv, this)); + add(new FormError(lv, this)); + add(new FormExternal(lv, this)); + add(new FormGraphics(lv, this)); + add(new FormInclude(lv, this)); + add(new FormIndex(lv, this)); + add(new FormLog(lv, this)); + add(new FormParagraph(lv, this)); + add(new FormPreamble(lv, this)); + add(new FormPreferences(lv, this)); + add(new FormPrint(lv, this)); + add(new FormRef(lv, this)); + add(new FormSearch(lv, this)); + add(new FormSplash(lv, this)); + add(new FormTabular(lv, this)); + add(new FormTabularCreate(lv, this)); + add(new FormToc(lv, this)); + add(new FormUrl(lv, this)); + add(new FormVCLog(lv, this)); + // reduce the number of connections needed in // dialogs by a simple connection here. hideAll.connect(hideBufferDependent.slot()); } - -Dialogs::~Dialogs() -{ - for (vector::iterator iter = dialogs_.begin(); - iter != dialogs_.end(); - ++iter) { - delete *iter; - } - delete splash_; -} - - -void Dialogs::destroySplash() -{ - delete splash_; - splash_ = 0; -} - - /***************************************************************************** Q. WHY does Dialogs::Dialogs pass `this' to dialog constructors? diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 37a9c5db08..228e6fb955 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -11,57 +11,21 @@ #include -#include FORMS_H_LOCATION - #ifdef __GNUG__ #pragma implementation #endif #include "Dialogs.h" #include "FormBase.h" -#include "LyXView.h" +#include "xformsBC.h" #include "support/LAssert.h" -//#include "debug.h" -extern "C" int C_FormBaseWMHideCB(FL_FORM * ob, void * d) -{ - return FormBase::WMHideCB(ob, d); -} -extern "C" void C_FormBaseApplyCB(FL_OBJECT * ob, long d) -{ - FormBase::ApplyCB(ob, d); -} -extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long d) -{ - FormBase::OKCB(ob, d); -} -extern "C" void C_FormBaseCancelCB(FL_OBJECT * ob, long d) -{ - FormBase::CancelCB(ob, d); -} -extern "C" void C_FormBaseInputCB(FL_OBJECT * ob, long d) -{ - FormBase::InputCB(ob, d); -} -extern "C" void C_FormBaseRestoreCB(FL_OBJECT * ob, long d) -{ - FormBase::RestoreCB(ob, d); -} - - -FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t, - ButtonPolicy * bp, char const * close, char const * cancel) - : lv_(lv), bc_(bp, cancel, close), d_(d), h_(0), r_(0), title(t), - bp_(bp), minw_(0), minh_(0) -{ - Assert(lv && d && bp); -} +extern "C" int C_FormBaseWMHideCB(FL_FORM * form, void *); -FormBase::~FormBase() -{ - delete bp_; -} +FormBase::FormBase(ControlBase & c, string const & t) + : ViewBC(c), minw_(0), minh_(0), title_(t) +{} void FormBase::redraw() @@ -71,20 +35,6 @@ void FormBase::redraw() } -void FormBase::connect() -{ - fl_set_form_minsize(form(), minw_, minh_); - r_ = Dialogs::redrawGUI.connect(slot(this, &FormBase::redraw)); -} - - -void FormBase::disconnect() -{ - h_.disconnect(); - r_.disconnect(); -} - - void FormBase::show() { if (!form()) { @@ -110,122 +60,72 @@ void FormBase::show() XMapWindow(fl_get_display(), form()->window); } else { // calls to fl_set_form_minsize/maxsize apply only to the next - // fl_show_form(), so connect() comes first. - connect(); + // fl_show_form(), so this comes first. + fl_set_form_minsize(form(), minw_, minh_); fl_show_form(form(), FL_PLACE_MOUSE | FL_FREE_SIZE, 0, - title.c_str()); + title_.c_str()); } } void FormBase::hide() { - if (form() && form()->visible) { - // some dialogs might do things to the form first - // such as the nested tabfolder problem in Preferences - disconnect(); + if (form() && form()->visible) fl_hide_form(form()); - } } -int FormBase::WMHideCB(FL_FORM * form, void *) -{ - Assert(form); - // Ensure that the signals (u and h) are disconnected even if the - // window manager is used to close the dialog. - FormBase * pre = static_cast(form->u_vdata); - Assert(pre); - pre->hide(); - pre->bc_.hide(); - return FL_CANCEL; -} - - -void FormBase::ApplyCB(FL_OBJECT * ob, long) +void FormBase::InputCB(FL_OBJECT * ob, long data) { - Assert(ob && ob->form); - FormBase * pre = static_cast(ob->form->u_vdata); - Assert(pre); - pre->apply(); - pre->bc_.apply(); + bc().input(input(ob, data)); } -void FormBase::OKCB(FL_OBJECT * ob, long) +static FormBase * GetForm(FL_OBJECT * ob) { - Assert(ob && ob->form); - FormBase * pre = static_cast(ob->form->u_vdata); - Assert(pre); - pre->ok(); - pre->bc_.ok(); + Assert(ob && ob->form && ob->form->u_vdata); + FormBase * pre = static_cast(ob->form->u_vdata); + return pre; } -void FormBase::CancelCB(FL_OBJECT * ob, long) +extern "C" int C_FormBaseWMHideCB(FL_FORM * form, void *) { - Assert(ob && ob->form); - FormBase * pre = static_cast(ob->form->u_vdata); - Assert(pre); - pre->cancel(); - pre->bc_.cancel(); + // Close the dialog cleanly, even if the WM is used to do so. + Assert(form && form->u_vdata); + FormBase * pre = static_cast(form->u_vdata); + pre->CancelButton(); + return FL_CANCEL; } -void FormBase::InputCB(FL_OBJECT * ob, long data) +extern "C" void C_FormBaseApplyCB(FL_OBJECT * ob, long) { - Assert(ob && ob->form); - FormBase * pre = static_cast(ob->form->u_vdata); - Assert(ob); - pre->bc_.valid(pre->input(ob, data), ob); + GetForm(ob)->ApplyButton(); } -void FormBase::RestoreCB(FL_OBJECT * ob, long) +extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long) { - Assert(ob && ob->form); - FormBase * pre = static_cast(ob->form->u_vdata); - Assert(ob); - pre->bc_.undoAll(); - pre->restore(); + GetForm(ob)->OKButton(); } -FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t, - ButtonPolicy * bp, - char const * close, char const * cancel) - : FormBase(lv, d, t, bp, close, cancel) -{} - - -void FormBaseBI::connect() +extern "C" void C_FormBaseCancelCB(FL_OBJECT * ob, long) { - h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide)); - FormBase::connect(); + FormBase * form = GetForm(ob); + form->CancelButton(); } -FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t, - ButtonPolicy * bp, - char const * close, char const * cancel) - : FormBase(lv, d, t, bp, close, cancel), - u_(0) -{} - - -void FormBaseBD::connect() +extern "C" void C_FormBaseRestoreCB(FL_OBJECT * ob, long) { - u_ = d_->updateBufferDependent. - connect(slot(this, &FormBaseBD::updateSlot)); - h_ = d_->hideBufferDependent. - connect(slot(this, &FormBaseBD::hide)); - FormBase::connect(); + GetForm(ob)->RestoreButton(); } -void FormBaseBD::disconnect() +extern "C" void C_FormBaseInputCB(FL_OBJECT * ob, long d) { - u_.disconnect(); - FormBase::disconnect(); + GetForm(ob)->InputCB(ob, d); } diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index a9dff0d80d..6138f4a586 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -7,160 +7,105 @@ * Copyright 2000 The LyX Team. * * ====================================================== + * + * Author: Angus Leeming */ #ifndef FORMBASE_H #define FORMBASE_H -#include "DialogBase.h" -#include "LString.h" -#include FORMS_H_LOCATION -#include "ButtonController.h" -#include "gettext.h" -#include - -class Buffer; -class Dialogs; -class LyXView; +#include #ifdef __GNUG__ #pragma interface #endif +#include FORMS_H_LOCATION // Can't forward-declare FL_FORM +#include "ViewBase.h" +#include "LString.h" +#include "ButtonPolicies.h" + +class xformsBC; + /** This class is an XForms GUI base class. - It is meant to be used solely as the parent class to FormBaseBI - and FormBaseBD. - @author Angus Leeming */ - -class FormBase : public DialogBase { +class FormBase : public ViewBC +{ public: - /// Callback functions - static int WMHideCB(FL_FORM *, void *); - /// - static void ApplyCB(FL_OBJECT *, long); - /// - static void OKCB(FL_OBJECT *, long); /// - static void CancelCB(FL_OBJECT *, long); + FormBase(ControlBase &, string const &); /// - static void InputCB(FL_OBJECT *, long); - /// - static void RestoreCB(FL_OBJECT *, long); + virtual ~FormBase() {} -protected: // methods - /// - FormBase(LyXView *, Dialogs *, string const &, - ButtonPolicy *, char const *, char const *); - /// - virtual ~FormBase(); + /// input callback function + void InputCB(FL_OBJECT *, long); - /** Redraw the form (on receipt of a Signal indicating, for example, - that the xforms colors have been re-mapped). - Must be virtual because dialogs with tabbed folders will need to - redraw the form for each tab. - */ - virtual void redraw(); - - /// Create the dialog if necessary, update it and display it. - virtual void show(); - /// Hide the dialog. - virtual void hide(); - /// Update the dialog. - virtual void update() {} - /// Connect signals. Also perform any necessary initialisation. - virtual void connect(); - /// Disconnect signals. Also perform any necessary housekeeping. - virtual void disconnect(); +protected: /// Build the dialog virtual void build() = 0; - /** Filter the inputs on callback from xforms - Return true if inputs are valid. - */ - virtual bool input( FL_OBJECT *, long) { - return true; - } - /// Apply from dialog (modify or create inset) - virtual void apply() {} - /// OK from dialog - virtual void ok() { - apply(); - hide(); - } - /// Cancel from dialog - virtual void cancel() { - hide(); - } - /// Restore from dialog - virtual void restore() { - update(); - } - /// Pointer to the actual instantiation of the xforms form - virtual FL_FORM * form() const = 0; + /// Hide the dialog. + void hide(); + /// Create the dialog if necessary, update it and display it. + void show(); - /** 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_; - /// Useable even in derived-class's const functions. - mutable ButtonController bc_; - /// Used so we can get at the signals we have to connect to. - Dialogs * d_; - /// Hide connection. - Connection h_; - /// Redraw connection. - Connection r_; - /// dialog title, displayed by WM. - string title; private: - /// - ButtonPolicy * bp_; -public: + /// Pointer to the actual instantiation of xform's form + virtual FL_FORM * form() const = 0; + /** Filter the inputs on callback from xforms + Return true if inputs are valid. */ + virtual ButtonPolicy::SMInput input(FL_OBJECT *, long) = 0; + + /** Redraw the form (on receipt of a Signal indicating, for example, + that the xform colors have been re-mapped). */ + virtual void redraw(); + +protected: /// Overcome a dumb xforms sizing bug mutable int minw_; /// mutable int minh_; + +private: + /// dialog title, displayed by WM. + string title_; }; -/** This class is an XForms GUI base class for Buffer Independent dialogs. - Such dialogs do not require an update Connection although they may use - an update() function which is also supported by restore(). - */ -class FormBaseBI : public FormBase { +template +class FormBase2: public FormBase +{ protected: - /// Constructor - FormBaseBI(LyXView *, Dialogs *, string const &, - ButtonPolicy * bp, - char const * close = N_("Close"), - char const * cancel = N_("Cancel")); - - /// Connect signals - virtual void connect(); + /// + FormBase2(ControlBase &, string const &); + /// The parent controller + Controller & controller() const; + /// Pointer to the actual instantiation of xform's form + virtual FL_FORM * form() const; + /// Real GUI implementation. + boost::scoped_ptr dialog_; }; -/** This class is an XForms GUI base class for Buffer Dependent dialogs - */ -class FormBaseBD : public FormBase { -protected: - /// Constructor - FormBaseBD(LyXView *, Dialogs *, string const &, - ButtonPolicy * bp, - char const * close = N_("Close"), - char const * cancel = N_("Cancel")); - - /// Connect signals - virtual void connect(); - /// Disconnect signals - virtual void disconnect(); - /// bool indicates if a buffer switch took place - virtual void updateSlot(bool) { update(); } - - /// Update connection. - Connection u_; -}; +template +FormBase2::FormBase2(ControlBase & c, string const & t) + : FormBase(c, t) +{} -#endif +template +Controller & FormBase2::controller() const +{ + return static_cast(controller_); + //return dynamic_cast(controller_); +} + + +template +FL_FORM * FormBase2::form() const +{ + if (dialog_.get()) return dialog_->form; + return 0; +} + + +#endif // FORMBASE_H diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C new file mode 100644 index 0000000000..7e7653e45e --- /dev/null +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -0,0 +1,219 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + */ + +#include + +#include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "Dialogs.h" +#include "FormBaseDeprecated.h" +#include "LyXView.h" +#include "support/LAssert.h" +#include "xformsBC.h" +//#include "debug.h" + +extern "C" int C_FormBaseDeprecatedWMHideCB(FL_FORM * ob, void * d) +{ + return FormBaseDeprecated::WMHideCB(ob, d); +} +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long d) +{ + FormBaseDeprecated::ApplyCB(ob, d); +} +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long d) +{ + FormBaseDeprecated::OKCB(ob, d); +} +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long d) +{ + FormBaseDeprecated::CancelCB(ob, d); +} +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT * ob, long d) +{ + FormBaseDeprecated::InputCB(ob, d); +} +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long d) +{ + FormBaseDeprecated::RestoreCB(ob, d); +} + + +FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d, + string const & t) + : lv_(lv), d_(d), h_(0), r_(0), title(t), minw_(0), minh_(0) +{ + Assert(lv && d); +} + + +void FormBaseDeprecated::redraw() +{ + if (form() && form()->visible) + fl_redraw_form(form()); +} + + +void FormBaseDeprecated::connect() +{ + fl_set_form_minsize(form(), minw_, minh_); + r_ = Dialogs::redrawGUI.connect(slot(this,&FormBaseDeprecated::redraw)); +} + + +void FormBaseDeprecated::disconnect() +{ + h_.disconnect(); + r_.disconnect(); +} + + +void FormBaseDeprecated::show() +{ + if (!form()) { + build(); + fl_set_form_atclose(form(), + C_FormBaseDeprecatedWMHideCB, 0); + } + + fl_freeze_form(form()); + update(); // make sure its up-to-date + fl_unfreeze_form(form()); + + if (form()->visible) { + fl_raise_form(form()); + } else { + // calls to fl_set_form_minsize/maxsize apply only to the next + // fl_show_form(), so connect() comes first. + connect(); + fl_show_form(form(), + FL_PLACE_MOUSE | FL_FREE_SIZE, + FL_TRANSIENT, + title.c_str()); + } +} + + +void FormBaseDeprecated::hide() +{ + if (form() && form()->visible) { + // some dialogs might do things to the form first + // such as the nested tabfolder problem in Preferences + disconnect(); + fl_hide_form(form()); + } +} + + +int FormBaseDeprecated::WMHideCB(FL_FORM * form, void *) +{ + Assert(form); + // Ensure that the signals (u and h) are disconnected even if the + // window manager is used to close the dialog. + FormBaseDeprecated * pre = + static_cast(form->u_vdata); + Assert(pre); + pre->hide(); + pre->bc().hide(); + return FL_CANCEL; +} + + +void FormBaseDeprecated::ApplyCB(FL_OBJECT * ob, long) +{ + Assert(ob && ob->form); + FormBaseDeprecated * pre = + static_cast(ob->form->u_vdata); + Assert(pre); + pre->apply(); + pre->bc().apply(); +} + + +void FormBaseDeprecated::OKCB(FL_OBJECT * ob, long) +{ + Assert(ob && ob->form); + FormBaseDeprecated * pre = + static_cast(ob->form->u_vdata); + Assert(pre); + pre->ok(); + pre->bc().ok(); +} + + +void FormBaseDeprecated::CancelCB(FL_OBJECT * ob, long) +{ + Assert(ob && ob->form); + FormBaseDeprecated * pre = + static_cast(ob->form->u_vdata); + Assert(pre); + pre->cancel(); + pre->bc().cancel(); +} + + +void FormBaseDeprecated::InputCB(FL_OBJECT * ob, long data) +{ + Assert(ob && ob->form); + FormBaseDeprecated * pre = + static_cast(ob->form->u_vdata); + Assert(ob); + pre->bc().valid(pre->input(ob, data)); +} + + +void FormBaseDeprecated::RestoreCB(FL_OBJECT * ob, long) +{ + Assert(ob && ob->form); + FormBaseDeprecated * pre = + static_cast(ob->form->u_vdata); + Assert(ob); + pre->bc().undoAll(); + pre->restore(); +} + + +FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t) + : FormBaseDeprecated(lv, d, t) +{} + + +void FormBaseBI::connect() +{ + h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide)); + FormBaseDeprecated::connect(); +} + + +FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t) + : FormBaseDeprecated(lv, d, t), + u_(0) +{} + + +void FormBaseBD::connect() +{ + u_ = d_->updateBufferDependent. + connect(slot(this, &FormBaseBD::updateSlot)); + h_ = d_->hideBufferDependent. + connect(slot(this, &FormBaseBD::hide)); + FormBaseDeprecated::connect(); +} + + +void FormBaseBD::disconnect() +{ + u_.disconnect(); + FormBaseDeprecated::disconnect(); +} diff --git a/src/frontends/xforms/FormBaseDeprecated.h b/src/frontends/xforms/FormBaseDeprecated.h new file mode 100644 index 0000000000..6372a7683a --- /dev/null +++ b/src/frontends/xforms/FormBaseDeprecated.h @@ -0,0 +1,158 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + */ + +#ifndef FORMBASEDEPRECATED_H +#define FORMBASEDEPRECATED_H + +#include "DialogBase.h" +#include "LString.h" +#include FORMS_H_LOCATION +#include + +class Buffer; +class Dialogs; +class LyXView; +class xformsBC; + +#ifdef __GNUG__ +#pragma interface +#endif + +/** This class is an XForms GUI base class. + It is meant to be used solely as the parent class to FormBaseBI + and FormBaseBD. + It has now been superceeded by the Controller/View split. + See FormBase.[Ch] for the way to go! + @author Angus Leeming + */ + +class FormBaseDeprecated : public DialogBase { +public: + /// Callback functions + static int WMHideCB(FL_FORM *, void *); + /// + static void ApplyCB(FL_OBJECT *, long); + /// + static void OKCB(FL_OBJECT *, long); + /// + static void CancelCB(FL_OBJECT *, long); + /// + static void InputCB(FL_OBJECT *, long); + /// + static void RestoreCB(FL_OBJECT *, long); + +protected: // methods + /// + FormBaseDeprecated(LyXView *, Dialogs *, string const &); + /// + virtual ~FormBaseDeprecated() {} + + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc() = 0; + + /** Redraw the form (on receipt of a Signal indicating, for example, + that the xform colors have been re-mapped). + Must be virtual because dialogs with tabbed folders will need to + redraw the form for each tab. + */ + virtual void redraw(); + + /// Create the dialog if necessary, update it and display it. + virtual void show(); + /// Hide the dialog. + virtual void hide(); + /// Update the dialog. + virtual void update() {} + /// Connect signals. Also perform any necessary initialisation. + virtual void connect(); + /// Disconnect signals. Also perform any necessary housekeeping. + virtual void disconnect(); + /// Build the dialog + virtual void build() = 0; + /** Filter the inputs on callback from xforms + Return true if inputs are valid. + */ + virtual bool input( FL_OBJECT *, long) { + return true; + } + /// Apply from dialog (modify or create inset) + virtual void apply() {} + /// OK from dialog + virtual void ok() { + apply(); + hide(); + } + /// Cancel from dialog + virtual void cancel() { + hide(); + } + /// Restore from dialog + virtual void restore() { + update(); + } + /// Pointer to the actual instantiation of xform's form + virtual FL_FORM * 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_; + /// Used so we can get at the signals we have to connect to. + Dialogs * d_; + /// Hide connection. + Connection h_; + /// Redraw connection. + Connection r_; + /// dialog title, displayed by WM. + string title; +public: + /// Overcome a dumb xforms sizing bug + mutable int minw_; + /// + mutable int minh_; +}; + + +/** This class is an XForms GUI base class for Buffer Independent dialogs. + Such dialogs do not require an update Connection although they may use + an update() function which is also supported by restore(). + */ +class FormBaseBI : public FormBaseDeprecated { +protected: + /// Constructor + FormBaseBI(LyXView *, Dialogs *, string const &); + + /// Connect signals + virtual void connect(); +}; + + +/** This class is an XForms GUI base class for Buffer Dependent dialogs + */ +class FormBaseBD : public FormBaseDeprecated { +protected: + /// Constructor + FormBaseBD(LyXView *, Dialogs *, string const &); + + /// Connect signals + virtual void connect(); + /// Disconnect signals + virtual void disconnect(); + /// bool indicates if a buffer switch took place + virtual void updateSlot(bool) { update(); } + + /// Update connection. + Connection u_; +}; + + +#endif // FORMBASEDEPRECATED_H diff --git a/src/frontends/xforms/FormBibitem.C b/src/frontends/xforms/FormBibitem.C index 887c28f7a6..dd01a43609 100644 --- a/src/frontends/xforms/FormBibitem.C +++ b/src/frontends/xforms/FormBibitem.C @@ -7,120 +7,65 @@ * \author John Levon */ -#include - -#include FORMS_H_LOCATION - #ifdef __GNUG__ #pragma implementation #endif - -#include "Dialogs.h" +#include +#include "ControlBibitem.h" #include "FormBibitem.h" -#include "LyXView.h" -#include "buffer.h" #include "form_bibitem.h" -#include "lyxfunc.h" -#include "debug.h" +#include "gettext.h" +#include "xformsBC.h" +#include "support/lstrings.h" // compare -using std::endl; +FormBibitem::FormBibitem(ControlBibitem & c) + : FormBase2(c, _("Bibliography Entry")) +{} -FormBibitem::FormBibitem(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Bibliography Entry"), new OkCancelReadOnlyPolicy), - dialog_(0) -{ - d->showBibitem.connect(slot(this, &FormBibitem::showInset)); -} - - -FormBibitem::~FormBibitem() -{ - delete dialog_; -} - - -FL_FORM * FormBibitem::form() const -{ - if (dialog_) - return dialog_->form; - return 0; -} - - -void FormBibitem::connect() -{ - fl_set_form_maxsize(form(), 2 * minw_, minh_); - FormCommand::connect(); -} - void FormBibitem::build() { - dialog_ = build_bibitem(); + dialog_.reset(build_bibitem()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; - fl_set_input_return(dialog_->key, FL_RETURN_CHANGED); + fl_set_input_return(dialog_->key, FL_RETURN_CHANGED); fl_set_input_return(dialog_->label, FL_RETURN_CHANGED); // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); - bc_.addReadOnly(dialog_->key); - bc_.addReadOnly(dialog_->label); + bc().addReadOnly(dialog_->key); + bc().addReadOnly(dialog_->label); } -bool FormBibitem::input(FL_OBJECT *, long) +ButtonPolicy::SMInput FormBibitem::input(FL_OBJECT *, long) { // minimal validation if (!compare(fl_get_input(dialog_->key), "")) - return false; + return ButtonPolicy::SMI_NOOP; - return true; + return ButtonPolicy::SMI_VALID; } void FormBibitem::update() { - fl_set_input(dialog_->key, params.getContents().c_str()); - fl_set_input(dialog_->label, params.getOptions().c_str()); - // Surely, this should reset the buttons to their original state? - // It doesn't. Instead "Restore" becomes a "Close" - //bc_.refresh(); - bc_.readOnly(lv_->buffer()->isReadonly()); + fl_set_input(dialog_->key, + controller().params().getContents().c_str()); + fl_set_input(dialog_->label, + controller().params().getOptions().c_str()); } void FormBibitem::apply() { - if (lv_->buffer()->isReadonly()) - return; - - params.setContents(fl_get_input(dialog_->key)); - params.setOptions(fl_get_input(dialog_->label)); - - if (inset_ != 0) { - // Only update if contents have changed - if (params != inset_->params()) { - // FIXME: confirm, is this only necessary for FormBibTeX ??? - if (params.getContents() != inset_->params().getContents()) - lv_->view()->ChangeCitationsIfUnique( - inset_->params().getContents(), params.getContents()); - - inset_->setParams(params); - lv_->view()->updateInset(inset_, true); - - // We need to do a redraw because the maximum - // InsetBibKey width could have changed - lv_->view()->redraw(); - lv_->view()->fitCursor(lv_->view()->getLyXText()); - } - } else - lyxerr[Debug::GUI] << "Editing non-existent bibitem !" << endl; + controller().params().setContents(fl_get_input(dialog_->key)); + controller().params().setOptions(fl_get_input(dialog_->label)); } diff --git a/src/frontends/xforms/FormBibitem.h b/src/frontends/xforms/FormBibitem.h index 2627beeeb9..75be7c5464 100644 --- a/src/frontends/xforms/FormBibitem.h +++ b/src/frontends/xforms/FormBibitem.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormBibitem.h * Copyright 2001 the LyX Team @@ -14,35 +15,35 @@ #pragma interface #endif -#include "FormInset.h" -struct FD_form_bibitem; +#include "FormBase.h" /** * For bibliography entry editing */ -class FormBibitem : public FormCommand { + +#include "form_bibitem.h" +class ControlBibitem; + +class FormBibitem : public FormBase2 { public: /// - FormBibitem(LyXView *, Dialogs *); - /// - ~FormBibitem(); -private: - /// Connect signals etc. Set form's max size. - virtual void connect(); - /// Build the dialog + FormBibitem(ControlBibitem &); + + // Functions accessible to the Controller. + + /// Set the Params variable for the Controller. + virtual void apply(); + /// Build the dialog. virtual void build(); - /// Update dialog before showing it + /// Update dialog before/whilst showing it. virtual void update(); - /// input handler - virtual bool input(FL_OBJECT *,long); - /// Apply from dialog (modify or create inset) - virtual void apply(); - /// Pointer to the actual instantiation of the xforms form - virtual FL_FORM * form() const; - /// + +private: + /// Filter the inputs on callback from xforms + virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); + + /// Type definition from the fdesign produced header file. FD_form_bibitem * build_bibitem(); - /// Real GUI implementation. - FD_form_bibitem * dialog_; }; #endif // FORMBIBITEM_H diff --git a/src/frontends/xforms/FormBibtex.C b/src/frontends/xforms/FormBibtex.C index 3beba5bb7e..d877eddf4c 100644 --- a/src/frontends/xforms/FormBibtex.C +++ b/src/frontends/xforms/FormBibtex.C @@ -27,22 +27,15 @@ using std::endl; FormBibtex::FormBibtex(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("BibTeX Database"), new OkCancelReadOnlyPolicy), - dialog_(0) + : FormCommand(lv, d, _("BibTeX Database")) { d->showBibtex.connect(slot(this, &FormBibtex::showInset)); } -FormBibtex::~FormBibtex() -{ - delete dialog_; -} - - FL_FORM * FormBibtex::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -57,7 +50,7 @@ void FormBibtex::connect() void FormBibtex::build() { - dialog_ = build_bibtex(); + dialog_.reset(build_bibtex()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -67,12 +60,12 @@ void FormBibtex::build() fl_set_input_return(dialog_->style, FL_RETURN_CHANGED); // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); - bc_.addReadOnly(dialog_->database); - bc_.addReadOnly(dialog_->style); + bc().addReadOnly(dialog_->database); + bc().addReadOnly(dialog_->style); } @@ -92,8 +85,8 @@ void FormBibtex::update() fl_set_input(dialog_->style, params.getOptions().c_str()); // Surely, this should reset the buttons to their original state? // It doesn't. Instead "Restore" becomes a "Close" - //bc_.refresh(); - bc_.readOnly(lv_->buffer()->isReadonly()); + //bc().refresh(); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormBibtex.h b/src/frontends/xforms/FormBibtex.h index c3402992f5..7ba90f284e 100644 --- a/src/frontends/xforms/FormBibtex.h +++ b/src/frontends/xforms/FormBibtex.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormBibtex.h * Copyright 2001 the LyX Team @@ -10,11 +11,15 @@ #ifndef FORMBIBTEX_H #define FORMBIBTEX_H +#include + +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" struct FD_form_bibtex; /** @@ -24,9 +29,9 @@ class FormBibtex : public FormCommand { public: /// FormBibtex(LyXView *, Dialogs *); - /// - ~FormBibtex(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -42,7 +47,15 @@ private: /// FD_form_bibtex * build_bibtex(); /// Real GUI implementation. - FD_form_bibtex * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormBibtex::bc() +{ + return bc_; +} #endif // FORMBIBTEX_H diff --git a/src/frontends/xforms/FormBrowser.C b/src/frontends/xforms/FormBrowser.C index c5d87b3bc8..693c53f1be 100644 --- a/src/frontends/xforms/FormBrowser.C +++ b/src/frontends/xforms/FormBrowser.C @@ -24,39 +24,34 @@ using SigC::slot; #endif FormBrowser::FormBrowser(LyXView * lv, Dialogs * d, const string & name) - : FormBaseBD(lv, d, name, new OkCancelPolicy), - dialog_(0) -{ -} + : FormBaseBD(lv, d, name) +{} -FormBrowser::~FormBrowser() -{ - delete dialog_; -} void FormBrowser::build() { - dialog_ = build_browser(); + dialog_.reset(build_browser()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // Manage the close button - bc_.setCancel(dialog_->button_close); - bc_.refresh(); + bc().setCancel(dialog_->button_close); + bc().refresh(); } + FL_FORM * FormBrowser::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } void FormBrowser::update() -{ -} +{} + bool FormBrowser::input(FL_OBJECT *, long) { diff --git a/src/frontends/xforms/FormBrowser.h b/src/frontends/xforms/FormBrowser.h index 7749ce822d..556fc5edfb 100644 --- a/src/frontends/xforms/FormBrowser.h +++ b/src/frontends/xforms/FormBrowser.h @@ -9,7 +9,10 @@ #ifndef FORMBROWSER_H #define FORMBROWSER_H -#include "FormBase.h" +#include + +#include "FormBaseDeprecated.h" +#include "xformsBC.h" #ifdef __GNUG__ #pragma interface @@ -25,16 +28,16 @@ struct FD_form_browser; */ class FormBrowser : public FormBaseBD { public: + /// FormBrowser(LyXView *, Dialogs *, const string &); - ~FormBrowser(); - protected: /// Update the dialog. virtual void update(); /// Real GUI implementation. - FD_form_browser * dialog_; - + boost::scoped_ptr dialog_; + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); private: /// Pointer to the actual instantiation of the xforms form virtual FL_FORM * form() const; @@ -45,6 +48,14 @@ private: /// generated build function FD_form_browser * build_browser(); + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormBrowser::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index 11ac59c9d1..234ed12f11 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -8,12 +8,12 @@ #include +#include FORMS_H_LOCATION + #ifdef __GNUG_ #pragma implementation #endif -#include FORMS_H_LOCATION - #include "FormCharacter.h" #include "form_character.h" #include "bufferview_funcs.h" @@ -31,9 +31,7 @@ using Liason::setMinibuffer; FormCharacter::FormCharacter(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Character Layout"), - new NoRepeatedApplyReadOnlyPolicy), - dialog_(0), combo_language2_(0) + : FormBaseBD(lv, d, _("Character Layout")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -44,17 +42,9 @@ FormCharacter::FormCharacter(LyXView * lv, Dialogs * d) } -FormCharacter::~FormCharacter() -{ - // This must be done before the deletion of the dialog. - delete combo_language2_; - delete dialog_; -} - - FL_FORM * FormCharacter::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -62,15 +52,15 @@ FL_FORM * FormCharacter::form() const void FormCharacter::build() { - dialog_ = build_character(); + dialog_.reset(build_character()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // Manage the ok, apply and cancel/close buttons - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_close); - bc_.refresh(); - bc_.addReadOnly (dialog_->check_toggle_all); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_close); + bc().refresh(); + bc().addReadOnly (dialog_->check_toggle_all); fl_addto_choice(dialog_->choice_family, _(" No change %l| Roman | Sans Serif | Typewriter %l| Reset ")); @@ -94,7 +84,7 @@ void FormCharacter::build() // insert default language box manually fl_addto_form(dialog_->form); FL_OBJECT * ob = dialog_->choice_language; - combo_language2_ = new Combox(FL_COMBOX_DROPLIST); + combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST)); combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250); combo_language2_->shortcut("#L", 1); fl_end_form(); @@ -111,7 +101,7 @@ void FormCharacter::build() void FormCharacter::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; LyXFont font(LyXFont::ALL_IGNORE); @@ -213,8 +203,8 @@ void FormCharacter::apply() void FormCharacter::update() { - if (!dialog_) + if (!dialog_.get()) return; - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h index 17ee3ad3aa..f19aa77c1f 100644 --- a/src/frontends/xforms/FormCharacter.h +++ b/src/frontends/xforms/FormCharacter.h @@ -10,13 +10,15 @@ #ifndef FORM_CHARACTER_H #define FORM_CHARACTER_H -#include "FormBase.h" +#include + +#include "FormBaseDeprecated.h" +#include "xformsBC.h" #ifdef __GNUG_ #pragma interface #endif - class LyXView; class Dialogs; class Combox; @@ -29,31 +31,42 @@ struct FD_form_character; */ class FormCharacter : public FormBaseBD { public: - /// - FormCharacter(LyXView *, Dialogs *); - /// - ~FormCharacter(); - + /// + FormCharacter(LyXView *, Dialogs *); private: - /// Build the popup - virtual void build(); + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); + + /// Build the popup + virtual void build(); - /// Apply from popup - virtual void apply(); + /// Apply from popup + virtual void apply(); - /// Update the popup. - virtual void update(); + /// Update the popup. + virtual void update(); - /// Pointer to the actual instantiation of the xforms form - virtual FL_FORM * form() const; + /// Pointer to the actual instantiation of the xform's form + virtual FL_FORM * form() const; - FD_form_character * build_character(); + /// + FD_form_character * build_character(); - /// Real GUI implementation. - FD_form_character * dialog_; - - Combox * combo_language2_; + /// Real GUI implementation. + boost::scoped_ptr dialog_; + + /// + boost::scoped_ptr combo_language2_; + + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormCharacter::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index bb01bd7a19..3b91a86033 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -9,22 +9,20 @@ * ====================================================== */ -#include #include #ifdef __GNUG__ #pragma implementation #endif - -#include "Dialogs.h" +#include +#include "ControlCitation.h" #include "FormCitation.h" -#include "LyXView.h" -#include "buffer.h" #include "form_citation.h" -#include "lyxfunc.h" -#include "support/filetools.h" +#include "gettext.h" +#include "support/lstrings.h" #include "xforms_helpers.h" +#include "xformsBC.h" using std::find; using std::max; @@ -33,52 +31,33 @@ using std::pair; using std::sort; using std::vector; - -FormCitation::FormCitation(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Citation"), new NoRepeatedApplyReadOnlyPolicy), - dialog_(0) -{ - // let the dialog be shown - // These are permanent connections so we won't bother - // storing a copy because we won't be disconnecting. - d->showCitation.connect(slot(this, &FormCitation::showInset)); - d->createCitation.connect(slot(this, &FormCitation::createInset)); -} +FormCitation::FormCitation(ControlCitation & c) + : FormBase2(c, _("Citation")) +{} -FormCitation::~FormCitation() -{ - delete dialog_; -} - - -FL_FORM * FormCitation::form() const +void FormCitation::apply() { - if (dialog_) return dialog_->form; - return 0; -} + controller().params().setCmdName("cite"); + controller().params().setContents(getStringFromVector(citekeys)); - -void FormCitation::connect() -{ - //fl_set_form_maxsize(dialog_->form, 3*minw_, minh_); - FormCommand::connect(); + string const after = fl_get_input(dialog_->input_after); + controller().params().setOptions(after); } -void FormCitation::disconnect() +void FormCitation::hide() { citekeys.clear(); bibkeys.clear(); - bibkeysInfo.clear(); - FormCommand::disconnect(); + FormBase::hide(); } void FormCitation::build() { - dialog_ = build_citation(); + dialog_.reset(build_citation()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -87,51 +66,229 @@ void FormCitation::build() fl_set_input_return(dialog_->input_after, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_before, FL_RETURN_CHANGED); + fl_set_button(dialog_->button_search_type, 0); + fl_set_object_label(dialog_->button_search_type, _("Simple")); + // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); - - bc_.addReadOnly(dialog_->button_add); - bc_.addReadOnly(dialog_->button_del); - bc_.addReadOnly(dialog_->button_up); - bc_.addReadOnly(dialog_->button_down); - bc_.addReadOnly(dialog_->input_before); - bc_.addReadOnly(dialog_->input_after); - - bc_.addDontTriggerChange(dialog_->browser_cite); - bc_.addDontTriggerChange(dialog_->browser_bib); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); + + bc().addReadOnly(dialog_->button_add); + bc().addReadOnly(dialog_->button_del); + bc().addReadOnly(dialog_->button_up); + bc().addReadOnly(dialog_->button_down); + bc().addReadOnly(dialog_->choice_style); + bc().addReadOnly(dialog_->input_before); + bc().addReadOnly(dialog_->input_after); } -void FormCitation::update() +ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long) { - bc_.readOnly(lv_->buffer()->isReadonly()); + ButtonPolicy::SMInput activate = ButtonPolicy::SMI_NOOP; - bibkeys.clear(); - bibkeysInfo.clear(); + if (ob == dialog_->browser_bib) { + fl_deselect_browser(dialog_->browser_cite); + + unsigned int const sel = fl_get_browser(dialog_->browser_bib); + if (sel < 1 || sel > bibkeys.size()) + return ButtonPolicy::SMI_NOOP; + + // Put into browser_info the additional info associated with + // the selected browser_bib key + fl_clear_browser(dialog_->browser_info); + string const tmp = formatted( controller(). + getBibkeyInfo(bibkeys[sel-1]), + dialog_->browser_info->w-10 ); + fl_add_browser_line(dialog_->browser_info, tmp.c_str()); + + // Highlight the selected browser_bib key in browser_cite if + // present + vector::const_iterator cit = + find(citekeys.begin(), citekeys.end(), bibkeys[sel-1]); + + if (cit != citekeys.end()) { + int const n = int(cit - citekeys.begin()); + fl_select_browser_line(dialog_->browser_cite, n+1); + fl_set_browser_topline(dialog_->browser_cite, n+1); + } + + if (!controller().isReadonly()) { + if (cit != citekeys.end()) { + setBibButtons(OFF); + setCiteButtons(ON); + } else { + setBibButtons(ON); + setCiteButtons(OFF); + } + } + + } else if (ob == dialog_->browser_cite) { + unsigned int const sel = fl_get_browser(dialog_->browser_cite); + if (sel < 1 || sel > citekeys.size()) + return ButtonPolicy::SMI_NOOP; + + if (!controller().isReadonly()) { + setBibButtons(OFF); + setCiteButtons(ON); + } + + // Highlight the selected browser_cite key in browser_bib + vector::const_iterator cit = + find(bibkeys.begin(), bibkeys.end(), citekeys[sel-1]); + + if (cit != bibkeys.end()) { + int const n = int(cit - bibkeys.begin()); + fl_select_browser_line(dialog_->browser_bib, n+1); + fl_set_browser_topline(dialog_->browser_bib, n+1); + + // Put into browser_info the additional info associated + // with the selected browser_cite key + fl_clear_browser(dialog_->browser_info); + string const tmp = + formatted( controller(). + getBibkeyInfo(bibkeys[n]), + dialog_->browser_info->w-10 ); + fl_add_browser_line(dialog_->browser_info, tmp.c_str()); + } + + } else if (ob == dialog_->button_add) { + unsigned int const sel = fl_get_browser(dialog_->browser_bib); + if (sel < 1 || sel > bibkeys.size()) + return ButtonPolicy::SMI_NOOP; + + // Add the selected browser_bib key to browser_cite + fl_addto_browser(dialog_->browser_cite, + bibkeys[sel-1].c_str()); + citekeys.push_back(bibkeys[sel-1]); + + int const n = int(citekeys.size()); + fl_select_browser_line(dialog_->browser_cite, n); + + setBibButtons(OFF); + setCiteButtons(ON); + activate = ButtonPolicy::SMI_VALID; + + } else if (ob == dialog_->button_del) { + unsigned int const sel = fl_get_browser(dialog_->browser_cite); + if (sel < 1 || sel > citekeys.size()) + return ButtonPolicy::SMI_NOOP; + + // Remove the selected key from browser_cite + fl_delete_browser_line(dialog_->browser_cite, sel) ; + citekeys.erase(citekeys.begin() + sel-1); + + setBibButtons(ON); + setCiteButtons(OFF); + activate = ButtonPolicy::SMI_VALID; + + } else if (ob == dialog_->button_up) { + unsigned int const sel = fl_get_browser(dialog_->browser_cite); + if (sel < 2 || sel > citekeys.size()) + return ButtonPolicy::SMI_NOOP; + + // Move the selected key up one line + vector::iterator it = citekeys.begin() + sel-1; + string const tmp = *it; + + fl_delete_browser_line(dialog_->browser_cite, sel); + citekeys.erase(it); + + fl_insert_browser_line(dialog_->browser_cite, sel-1, tmp.c_str()); + fl_select_browser_line(dialog_->browser_cite, sel-1); + citekeys.insert(it-1, tmp); + setCiteButtons(ON); + activate = ButtonPolicy::SMI_VALID; + + } else if (ob == dialog_->button_down) { + unsigned int const sel = fl_get_browser(dialog_->browser_cite); + if (sel < 1 || sel > citekeys.size()-1) + return ButtonPolicy::SMI_NOOP; + + // Move the selected key down one line + vector::iterator it = citekeys.begin() + sel-1; + string const tmp = *it; + + fl_delete_browser_line(dialog_->browser_cite, sel); + citekeys.erase(it); + + fl_insert_browser_line(dialog_->browser_cite, sel+1, tmp.c_str()); + fl_select_browser_line(dialog_->browser_cite, sel+1); + citekeys.insert(it+1, tmp); + setCiteButtons(ON); + activate = ButtonPolicy::SMI_VALID; + + } else if (ob == dialog_->button_search_type) { + if (fl_get_button(dialog_->button_search_type)) + fl_set_object_label(dialog_->button_search_type, + _("Regex")); + else + fl_set_object_label(dialog_->button_search_type, + _("Simple")); + return ButtonPolicy::SMI_NOOP; + + } else if (ob == dialog_->button_previous || + ob == dialog_->button_next) { + + string const str = fl_get_input(dialog_->input_search); + + ControlCitation::Direction const dir = + (ob == dialog_->button_previous) ? + ControlCitation::BACKWARD : ControlCitation::FORWARD; - vector > blist = - lv_->buffer()->getBibkeyList(); - sort(blist.begin(), blist.end()); + ControlCitation::Search const type = + fl_get_button(dialog_->button_search_type) ? + ControlCitation::REGEX : ControlCitation::SIMPLE; - for (unsigned int i = 0; i < blist.size(); ++i) { - bibkeys.push_back(blist[i].first); - bibkeysInfo.push_back(blist[i].second); + vector::const_iterator start = bibkeys.begin(); + unsigned int const sel = fl_get_browser(dialog_->browser_bib); + if (sel >= 1 && sel <= bibkeys.size()) + start += sel-1; + + // Find the NEXT instance... + if (dir == ControlCitation::FORWARD) + start += 1; + else + start -= 1; + + vector::const_iterator const cit = + searchKeys(controller(), bibkeys, str, start, + type, dir); + + if (cit == bibkeys.end()) + return ButtonPolicy::SMI_NOOP; + + int const found = int(cit - bibkeys.begin()) + 1; + if (found == sel) + return ButtonPolicy::SMI_NOOP; + + // Update the display + int const top = max(found-5, 1); + fl_set_browser_topline(dialog_->browser_bib, top); + fl_select_browser_line(dialog_->browser_bib, found); + input(dialog_->browser_bib, 0); + + } else if (ob == dialog_->choice_style || + ob == dialog_->input_before || + ob == dialog_->input_after) { + activate = ButtonPolicy::SMI_VALID; } - blist.clear(); + + return activate; +} + + +void FormCitation::update() +{ + // Make the list of all available bibliography keys + bibkeys = controller().getBibkeys(); updateBrowser(dialog_->browser_bib, bibkeys); // Ditto for the keys cited in this inset - citekeys.clear(); - string tmp, keys(params.getContents()); - keys = frontStrip(split(keys, tmp, ',')); - while (!tmp.empty()) { - citekeys.push_back(tmp); - keys = frontStrip(split(keys, tmp, ',')); - } + citekeys = getVectorFromString(controller().params().getContents()); updateBrowser(dialog_->browser_cite, citekeys); // No keys have been selected yet, so... @@ -139,26 +296,27 @@ void FormCitation::update() setBibButtons(OFF); setCiteButtons(OFF); - int noKeys = static_cast(max(bibkeys.size(), citekeys.size())); + int noKeys = int(max(bibkeys.size(), citekeys.size())); // Place bounds, so that 4 <= noKeys <= 10 noKeys = max(4, min(10, noKeys)); // Re-size the form to accommodate the new browser size - int size = 20 * noKeys; - bool bibPresent = (bibkeys.size() > 0); + int const size = 20 * noKeys; + bool const bibPresent = (bibkeys.size() > 0); setSize(size, bibPresent); - fl_set_input(dialog_->input_after, params.getOptions().c_str()); + fl_set_input(dialog_->input_after, + controller().params().getOptions().c_str()); } void FormCitation::updateBrowser(FL_OBJECT * browser, - vector const & keys) const + vector const & keys) const { fl_clear_browser(browser); - for (unsigned int i = 0; i < keys.size(); ++i) + for (vector::size_type i = 0; i < keys.size(); ++i) fl_add_browser_line(browser, keys[i].c_str()); } @@ -173,7 +331,6 @@ void FormCitation::setCiteButtons(State status) const { int const sel = fl_get_browser(dialog_->browser_cite); int const maxline = fl_get_browser_maxline(dialog_->browser_cite); - bool const activate = (status == ON); bool const activate_up = (activate && sel != 1); bool const activate_down = (activate && sel != maxline); @@ -194,7 +351,8 @@ void FormCitation::setSize(int hbrsr, bool bibPresent) const // so they are not changed by dynamic resizing static int const dh1 = 30; // top of form to top of cite/bib brsrs; // bottom of cite/bib brsrs to top of info; - // bottom of info to top next element; + // bottom of info to top search frame; + // bottom of search frame to top next elemnt; // bottom of style to top input_before; // bottom of text to top ok/cancel buttons. static int const dh2 = 10; // bottom of input_before to top input_after; @@ -203,11 +361,12 @@ void FormCitation::setSize(int hbrsr, bool bibPresent) const int const wbrsr = dialog_->browser_cite->w; static int const hinfo = dialog_->browser_info->h; + static int const hframe = dialog_->frame_search->h; static int const hstyle = dialog_->choice_style->h; static int const htext = dialog_->input_after->h; static int const hok = dialog_->button_ok->h; - int hform = dh1 + hbrsr + dh1; + int hform = dh1 + hbrsr + dh1 + hframe + dh1; if (bibPresent) hform += hinfo + dh1; if (natbib) hform += hstyle + dh1 + htext + dh2; hform += htext + dh1 + hok + dh2; @@ -247,6 +406,30 @@ void FormCitation::setSize(int hbrsr, bool bibPresent) const } else fl_hide_object(dialog_->browser_info); + x = dialog_->frame_search->x; + // ??? The frame height seems to be reduced. Use geometry to enforce it. + fl_set_object_geometry(dialog_->frame_search, x, y, + dialog_->frame_search->w, hframe); + //fl_set_object_position(dialog_->frame_search, x, y); + + x = dialog_->input_search->x; + y += 15; + fl_set_object_position(dialog_->input_search, x, y); + + x = dialog_->button_previous->x; + y += dialog_->input_search->h + 5; + fl_set_object_position(dialog_->button_previous, x, y); + + x = dialog_->button_next->x; + y += dialog_->button_previous->h + 5; + fl_set_object_position(dialog_->button_next, x, y); + + x = dialog_->button_search_type->x; + y = dialog_->button_previous->y; + fl_set_object_position(dialog_->button_search_type, x, y); + + y = dialog_->frame_search->y + hframe + dh1; + if (natbib) { x = dialog_->choice_style->x; fl_set_object_position(dialog_->choice_style, x, y); @@ -266,168 +449,11 @@ void FormCitation::setSize(int hbrsr, bool bibPresent) const y += htext + dh1; x = dialog_->button_restore->x; - fl_set_object_position(dialog_->button_restore, x, y); + fl_set_object_position(dialog_->button_restore, x, y); x = dialog_->button_ok->x; - fl_set_object_position(dialog_->button_ok, x, y); + fl_set_object_position(dialog_->button_ok, x, y); x = dialog_->button_apply->x; - fl_set_object_position(dialog_->button_apply, x, y); + fl_set_object_position(dialog_->button_apply, x, y); x = dialog_->button_cancel->x; fl_set_object_position(dialog_->button_cancel, x, y); } - - -bool FormCitation::input(FL_OBJECT * ob, long) -{ - bool activate = false; - - if (ob == dialog_->browser_bib) { - fl_deselect_browser(dialog_->browser_cite); - - unsigned int sel = fl_get_browser(dialog_->browser_bib); - if (sel < 1 || sel > bibkeys.size()) return false; - - // Put into browser_info the additional info associated with - // the selected browser_bib key - fl_clear_browser(dialog_->browser_info); - fl_add_browser_line(dialog_->browser_info, - bibkeysInfo[sel - 1].c_str()); - - // Highlight the selected browser_bib key in browser_cite if present - vector::iterator it = - find(citekeys.begin(), citekeys.end(), bibkeys[sel-1]); - - if (it != citekeys.end()) { - int n = static_cast(it - citekeys.begin()); - fl_select_browser_line(dialog_->browser_cite, n+1); - fl_set_browser_topline(dialog_->browser_cite, n+1); - } - - if (!lv_->buffer()->isReadonly()) { - if (it != citekeys.end()) { - setBibButtons(OFF); - setCiteButtons(ON); - } else { - setBibButtons(ON); - setCiteButtons(OFF); - } - } - - } else if (ob == dialog_->browser_cite) { - unsigned int sel = fl_get_browser(dialog_->browser_cite); - if (sel < 1 || sel > citekeys.size()) return false; - - if (!lv_->buffer()->isReadonly()) { - setBibButtons(OFF); - setCiteButtons(ON); - } - - // Highlight the selected browser_cite key in browser_bib - vector::iterator it = - find(bibkeys.begin(), bibkeys.end(), citekeys[sel-1]); - - if (it != bibkeys.end()) { - int n = static_cast(it - bibkeys.begin()); - fl_select_browser_line(dialog_->browser_bib, n+1); - fl_set_browser_topline(dialog_->browser_bib, n+1); - - // Put into browser_info the additional info associated with - // the selected browser_cite key - fl_clear_browser(dialog_->browser_info); - fl_add_browser_line(dialog_->browser_info, - bibkeysInfo[n].c_str()); - } - - } else if (ob == dialog_->button_add) { - unsigned int sel = fl_get_browser(dialog_->browser_bib); - if (sel < 1 || sel > bibkeys.size()) return false; - - // Add the selected browser_bib key to browser_cite - fl_addto_browser(dialog_->browser_cite, - bibkeys[sel-1].c_str()); - citekeys.push_back(bibkeys[sel-1]); - - int n = static_cast(citekeys.size()); - fl_select_browser_line(dialog_->browser_cite, n); - - setBibButtons(OFF); - setCiteButtons(ON); - activate = true; - - } else if (ob == dialog_->button_del) { - unsigned int sel = fl_get_browser(dialog_->browser_cite); - if (sel < 1 || sel > citekeys.size()) return false; - - // Remove the selected key from browser_cite - fl_delete_browser_line(dialog_->browser_cite, sel) ; - citekeys.erase(citekeys.begin() + sel-1); - - setBibButtons(ON); - setCiteButtons(OFF); - activate = true; - - } else if (ob == dialog_->button_up) { - unsigned int sel = fl_get_browser(dialog_->browser_cite); - if (sel < 2 || sel > citekeys.size()) return false; - - // Move the selected key up one line - vector::iterator it = citekeys.begin() + sel-1; - string tmp = *it; - - fl_delete_browser_line(dialog_->browser_cite, sel); - citekeys.erase(it); - - fl_insert_browser_line(dialog_->browser_cite, sel-1, tmp.c_str()); - fl_select_browser_line(dialog_->browser_cite, sel-1); - citekeys.insert(it-1, tmp); - setCiteButtons(ON); - activate = true; - - } else if (ob == dialog_->button_down) { - unsigned int sel = fl_get_browser(dialog_->browser_cite); - if (sel < 1 || sel > citekeys.size()-1) return false; - - // Move the selected key down one line - vector::iterator it = citekeys.begin() + sel-1; - string tmp = *it; - - fl_delete_browser_line(dialog_->browser_cite, sel); - citekeys.erase(it); - - fl_insert_browser_line(dialog_->browser_cite, sel+1, tmp.c_str()); - fl_select_browser_line(dialog_->browser_cite, sel+1); - citekeys.insert(it+1, tmp); - setCiteButtons(ON); - activate = true; - } else if (ob == dialog_->choice_style || - ob == dialog_->input_before || - ob == dialog_->input_after) { - activate = true; - } - return activate; -} - - -void FormCitation::apply() -{ - if (lv_->buffer()->isReadonly()) return; - - string contents; - for (unsigned int i = 0; i < citekeys.size(); ++i) { - if (i > 0) contents += ","; - contents += citekeys[i]; - } - - params.setContents(contents); - params.setOptions(fl_get_input(dialog_->input_after)); - - if (inset_ != 0) { - // Only update if contents have changed - if (params != inset_->params()) { - inset_->setParams(params); - lv_->view()->updateInset(inset_, true); - } - } else { - lv_->getLyXFunc()->Dispatch(LFUN_CITATION_INSERT, - params.getAsString()); - } -} diff --git a/src/frontends/xforms/FormCitation.h b/src/frontends/xforms/FormCitation.h index 48e176eca0..59d2e69186 100644 --- a/src/frontends/xforms/FormCitation.h +++ b/src/frontends/xforms/FormCitation.h @@ -7,6 +7,8 @@ * Copyright 2000 The LyX Team. * * ====================================================== + * + * Author: Angus Leeming */ #ifndef FORMCITATION_H @@ -16,39 +18,43 @@ #pragma interface #endif -#include "FormInset.h" -struct FD_form_citation; +#include "FormBase.h" -/** This class provides an XForms implementation of the FormCitation Dialog. +/** This class provides an XForms implementation of the Citation Dialog. */ -class FormCitation : public FormCommand { +#include "form_citation.h" +class ControlCitation; + +class FormCitation : public FormBase2 { public: /// - FormCitation(LyXView *, Dialogs *); - /// - ~FormCitation(); + FormCitation(ControlCitation &); + + // Functions accessible to the Controller. + + /// Set the Params variable for the Controller. + virtual void apply(); + /// Build the dialog. + virtual void build(); + /// Hide the dialog. + virtual void hide(); + /// Update dialog before/whilst showing it. + virtual void update(); + private: /// enum State { + /// ON, /// OFF }; - /// Connect signals etc. Set form's max size. - virtual void connect(); - /// Disconnect signals. Also perform any necessary housekeeping. - virtual void disconnect(); - /// Build the dialog - virtual void build(); - /// Filter the inputs - virtual bool input(FL_OBJECT *, long); - /// Update dialog before showing it - virtual void update(); - /// Apply from dialog (modify or create inset) - virtual void apply(); - /// Pointer to the actual instantiation of the xforms form - virtual FL_FORM * form() const; + /// Filter the inputs on callback from xforms + virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); + + /// Type definition from the fdesign produced header file. + FD_form_citation * build_citation(); /// void updateBrowser(FL_OBJECT *, std::vector const &) const; @@ -58,17 +64,11 @@ private: void setCiteButtons(State) const; /// void setSize(int, bool) const; - /// Type definition from the fdesign produced header file. - FD_form_citation * build_citation(); - /// Real GUI implementation. - FD_form_citation * dialog_; /// std::vector citekeys; /// std::vector bibkeys; - /// - std::vector bibkeysInfo; }; -#endif +#endif // FORMCITATION_H diff --git a/src/frontends/xforms/FormCopyright.C b/src/frontends/xforms/FormCopyright.C index 1018c9a80d..071cca1eec 100644 --- a/src/frontends/xforms/FormCopyright.C +++ b/src/frontends/xforms/FormCopyright.C @@ -17,8 +17,7 @@ #include "xforms_helpers.h" FormCopyright::FormCopyright( LyXView * lv, Dialogs * d ) - : FormBaseBI(lv, d, _("Copyright and Warranty"), new OkCancelPolicy), - dialog_(0) + : FormBaseBI(lv, d, _("Copyright and Warranty")) { // let the dialog be shown // This is a permanent connection so we won't bother @@ -27,22 +26,16 @@ FormCopyright::FormCopyright( LyXView * lv, Dialogs * d ) } -FormCopyright::~FormCopyright() -{ - delete dialog_; -} - - FL_FORM * FormCopyright::form() const { - if (dialog_ ) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } void FormCopyright::build() { - dialog_ = build_copyright(); + dialog_.reset(build_copyright()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -64,6 +57,6 @@ void FormCopyright::build() fl_set_object_label(dialog_->text_disclaimer, str.c_str()); // Manage the cancel/close button - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); } diff --git a/src/frontends/xforms/FormCopyright.h b/src/frontends/xforms/FormCopyright.h index 652e7798d2..9236bc8f82 100644 --- a/src/frontends/xforms/FormCopyright.h +++ b/src/frontends/xforms/FormCopyright.h @@ -17,12 +17,15 @@ #ifndef FORMCOPYRIGHT_H #define FORMCOPYRIGHT_H -#include "FormBase.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + struct FD_form_copyright; /** This class provides an XForms implementation of the FormCopyright Dialog. @@ -31,10 +34,9 @@ class FormCopyright : public FormBaseBI { public: /// #FormCopyright x(LyXFunc ..., Dialogs ...);# FormCopyright(LyXView *, Dialogs *); - /// - ~FormCopyright(); - private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Pointer to the actual instantiation of the xforms form @@ -43,8 +45,16 @@ private: FD_form_copyright * build_copyright(); /// Real GUI implementation. - FD_form_copyright * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormCopyright::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormCredits.C b/src/frontends/xforms/FormCredits.C index d4ab71d7d8..cd1201861f 100644 --- a/src/frontends/xforms/FormCredits.C +++ b/src/frontends/xforms/FormCredits.C @@ -22,7 +22,7 @@ #include "support/filetools.h" FormCredits::FormCredits( LyXView * lv, Dialogs * d ) - : FormBaseBI(lv, d, _("Credits"), new OkCancelPolicy), dialog_(0) + : FormBaseBI(lv, d, _("Credits")) { // let the dialog be shown // This is a permanent connection so we won't bother @@ -31,16 +31,10 @@ FormCredits::FormCredits( LyXView * lv, Dialogs * d ) } -FormCredits::~FormCredits() -{ - delete dialog_; -} - - FL_FORM * FormCredits::form() const { - if (dialog_ ) - return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -49,7 +43,7 @@ extern string system_lyxdir; void FormCredits::build() { - dialog_ = build_credits(); + dialog_.reset(build_credits()); // Workaround dumb xforms sizing bug minw_ = form()->w; diff --git a/src/frontends/xforms/FormCredits.h b/src/frontends/xforms/FormCredits.h index feced9e318..a497d064d4 100644 --- a/src/frontends/xforms/FormCredits.h +++ b/src/frontends/xforms/FormCredits.h @@ -9,12 +9,15 @@ #ifndef FORMCREDITS_H #define FORMCREDITS_H -#include "FormBase.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + struct FD_form_credits; /** This class provides an XForms implementation of the FormCredits Dialog. @@ -23,10 +26,10 @@ class FormCredits : public FormBaseBI { public: /// #FormCopyright x(LyXFunc ..., Dialogs ...);# FormCredits(LyXView *, Dialogs *); - /// - ~FormCredits(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Pointer to the actual instantiation of the xforms form @@ -35,8 +38,16 @@ private: FD_form_credits * build_credits(); /// Real GUI implementation. - FD_form_credits * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormCredits::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 7461145e69..b0eab6e6bd 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -11,13 +11,14 @@ #include +#include FORMS_H_LOCATION +#include XPM_H_LOCATION + #ifdef __GNUG_ #pragma implementation #endif #include "lyx_gui_misc.h" -#include FORMS_H_LOCATION -#include XPM_H_LOCATION #include "FormDocument.h" #include "form_document.h" @@ -46,11 +47,7 @@ using Liason::setMinibuffer; #define USE_CLASS_COMBO 1 FormDocument::FormDocument(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Document Layout"), - new NoRepeatedApplyReadOnlyPolicy), - dialog_(0), paper_(0), class_(0), language_(0), options_(0), - bullets_(0), current_bullet_panel(0), current_bullet_depth(0), - fbullet(0), combo_language(0), combo_doc_class(0) + : FormBaseBD(lv, d, _("Document Layout")), fbullet(0) { // let the popup be shown // This is a permanent connection so we won't bother @@ -59,21 +56,6 @@ FormDocument::FormDocument(LyXView * lv, Dialogs * d) } -FormDocument::~FormDocument() -{ -#ifdef USE_CLASS_COMBO - delete combo_doc_class; -#endif - delete class_; - delete paper_; - delete combo_language; - delete language_; - delete options_; - delete bullets_; - delete dialog_; -} - - void FormDocument::redraw() { if( form() && form()->visible ) @@ -89,7 +71,7 @@ void FormDocument::redraw() FL_FORM * FormDocument::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -99,21 +81,21 @@ void FormDocument::build() int n; // the tabbed folder - dialog_ = build_tabbed_document(); + dialog_.reset(build_tabbed_document()); // Manage the restore, ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // the document paper form - paper_ = build_doc_paper(); + paper_.reset(build_doc_paper()); fl_addto_choice(paper_->choice_papersize2, _(" Default | Custom | USletter | USlegal " "| USexecutive | A3 | A4 | A5 | B3 | B4 | B5 ")); @@ -132,24 +114,24 @@ void FormDocument::build() fl_set_input_return(paper_->input_head_sep, FL_RETURN_CHANGED); fl_set_input_return(paper_->input_foot_skip, FL_RETURN_CHANGED); - bc_.addReadOnly (paper_->choice_paperpackage); - bc_.addReadOnly (paper_->greoup_radio_orientation); - bc_.addReadOnly (paper_->radio_portrait); - bc_.addReadOnly (paper_->radio_landscape); - bc_.addReadOnly (paper_->choice_papersize2); - bc_.addReadOnly (paper_->push_use_geometry); - bc_.addReadOnly (paper_->input_custom_width); - bc_.addReadOnly (paper_->input_custom_height); - bc_.addReadOnly (paper_->input_top_margin); - bc_.addReadOnly (paper_->input_bottom_margin); - bc_.addReadOnly (paper_->input_left_margin); - bc_.addReadOnly (paper_->input_right_margin); - bc_.addReadOnly (paper_->input_head_height); - bc_.addReadOnly (paper_->input_head_sep); - bc_.addReadOnly (paper_->input_foot_skip); + bc().addReadOnly (paper_->choice_paperpackage); + bc().addReadOnly (paper_->greoup_radio_orientation); + bc().addReadOnly (paper_->radio_portrait); + bc().addReadOnly (paper_->radio_landscape); + bc().addReadOnly (paper_->choice_papersize2); + bc().addReadOnly (paper_->push_use_geometry); + bc().addReadOnly (paper_->input_custom_width); + bc().addReadOnly (paper_->input_custom_height); + bc().addReadOnly (paper_->input_top_margin); + bc().addReadOnly (paper_->input_bottom_margin); + bc().addReadOnly (paper_->input_left_margin); + bc().addReadOnly (paper_->input_right_margin); + bc().addReadOnly (paper_->input_head_height); + bc().addReadOnly (paper_->input_head_sep); + bc().addReadOnly (paper_->input_foot_skip); // the document class form - class_ = build_doc_class(); + class_.reset(build_doc_class()); FL_OBJECT * obj; #ifdef USE_CLASS_COMBO @@ -157,7 +139,7 @@ void FormDocument::build() obj = class_->choice_doc_class; fl_deactivate_object(obj); fl_addto_form(class_->form); - combo_doc_class = new Combox(FL_COMBOX_DROPLIST); + combo_doc_class.reset(new Combox(FL_COMBOX_DROPLIST)); combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400, dialog_->tabbed_folder); combo_doc_class->shortcut("#C",1); @@ -190,26 +172,26 @@ void FormDocument::build() fl_set_input_return(class_->input_doc_skip, FL_RETURN_CHANGED); fl_set_input_return(class_->input_doc_spacing, FL_RETURN_CHANGED); - bc_.addReadOnly (class_->radio_doc_indent); - bc_.addReadOnly (class_->radio_doc_skip); + bc().addReadOnly (class_->radio_doc_indent); + bc().addReadOnly (class_->radio_doc_skip); #ifndef USE_CLASS_COMBO - bc_.addReadOnly (class_->choice_doc_class); + bc().addReadOnly (class_->choice_doc_class); #endif - bc_.addReadOnly (class_->choice_doc_pagestyle); - bc_.addReadOnly (class_->choice_doc_fonts); - bc_.addReadOnly (class_->choice_doc_fontsize); - bc_.addReadOnly (class_->radio_doc_sides_one); - bc_.addReadOnly (class_->radio_doc_sides_two); - bc_.addReadOnly (class_->radio_doc_columns_one); - bc_.addReadOnly (class_->radio_doc_columns_two); - bc_.addReadOnly (class_->input_doc_extra); - bc_.addReadOnly (class_->input_doc_skip); - bc_.addReadOnly (class_->choice_doc_skip); - bc_.addReadOnly (class_->choice_doc_spacing); - bc_.addReadOnly (class_->input_doc_spacing); + bc().addReadOnly (class_->choice_doc_pagestyle); + bc().addReadOnly (class_->choice_doc_fonts); + bc().addReadOnly (class_->choice_doc_fontsize); + bc().addReadOnly (class_->radio_doc_sides_one); + bc().addReadOnly (class_->radio_doc_sides_two); + bc().addReadOnly (class_->radio_doc_columns_one); + bc().addReadOnly (class_->radio_doc_columns_two); + bc().addReadOnly (class_->input_doc_extra); + bc().addReadOnly (class_->input_doc_skip); + bc().addReadOnly (class_->choice_doc_skip); + bc().addReadOnly (class_->choice_doc_spacing); + bc().addReadOnly (class_->input_doc_spacing); // the document language form - language_ = build_doc_language(); + language_.reset(build_doc_language()); fl_addto_choice(language_->choice_inputenc, "default|auto|latin1|latin2|latin5" "|koi8-r|koi8-u|cp866|cp1251|iso88595"); @@ -218,7 +200,7 @@ void FormDocument::build() obj = language_->choice_language; fl_deactivate_object(obj); fl_addto_form(language_->form); - combo_language = new Combox(FL_COMBOX_DROPLIST); + combo_language.reset(new Combox(FL_COMBOX_DROPLIST)); combo_language->add(obj->x, obj->y, obj->w, obj->h, 400, dialog_->tabbed_folder); combo_language->shortcut("#L",1); @@ -234,10 +216,10 @@ void FormDocument::build() _(" ``text'' | ''text'' | ,,text`` | ,,text'' |" " «text» | »text« ")); - bc_.addReadOnly (language_->choice_inputenc); + bc().addReadOnly (language_->choice_inputenc); // the document options form - options_ = build_doc_options(); + options_.reset(build_doc_options()); fl_set_input_return(options_->input_float_placement, FL_RETURN_CHANGED); fl_set_counter_bounds(options_->slider_secnumdepth,-2,5); fl_set_counter_bounds(options_->slider_tocdepth,-1,5); @@ -249,14 +231,14 @@ void FormDocument::build() fl_addto_choice(options_->choice_postscript_driver, tex_graphics[n]); } - bc_.addReadOnly (options_->slider_secnumdepth); - bc_.addReadOnly (options_->slider_tocdepth); - bc_.addReadOnly (options_->check_use_amsmath); - bc_.addReadOnly (options_->input_float_placement); - bc_.addReadOnly (options_->choice_postscript_driver); + bc().addReadOnly (options_->slider_secnumdepth); + bc().addReadOnly (options_->slider_tocdepth); + bc().addReadOnly (options_->check_use_amsmath); + bc().addReadOnly (options_->input_float_placement); + bc().addReadOnly (options_->choice_postscript_driver); // the document bullets form - bullets_ = build_doc_bullet(); + bullets_.reset(build_doc_bullet()); fl_addto_choice(bullets_->choice_bullet_size, _(" default | tiny | script | footnote | small |" " normal | large | Large | LARGE | huge | Huge")); @@ -264,9 +246,9 @@ void FormDocument::build() fl_set_input_return(bullets_->input_bullet_latex, FL_RETURN_CHANGED); fl_set_input_maxchars(bullets_->input_bullet_latex, 80); - bc_.addReadOnly (bullets_->bmtable_bullet_panel); - bc_.addReadOnly (bullets_->choice_bullet_size); - bc_.addReadOnly (bullets_->input_bullet_latex); + bc().addReadOnly (bullets_->bmtable_bullet_panel); + bc().addReadOnly (bullets_->choice_bullet_size); + bc().addReadOnly (bullets_->input_bullet_latex); fl_addto_tabfolder(dialog_->tabbed_folder,_("Document"), class_->form); @@ -290,7 +272,7 @@ void FormDocument::build() void FormDocument::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; bool redo = class_apply(); @@ -321,7 +303,7 @@ void FormDocument::cancel() void FormDocument::update() { - if (!dialog_) + if (!dialog_.get()) return; checkReadOnly(); @@ -389,9 +371,9 @@ bool FormDocument::input( FL_OBJECT * ob, long data ) void FormDocument::ComboInputCB(int, void * v, Combox * combox) { FormDocument * pre = static_cast(v); - if (combox == pre->combo_doc_class) + if (combox == pre->combo_doc_class.get()) pre->CheckChoiceClass(0, 0); - pre->bc_.valid(pre->CheckDocumentInput(0,0)); + pre->bc().valid(pre->CheckDocumentInput(0,0)); } @@ -637,7 +619,7 @@ void FormDocument::bullets_apply() void FormDocument::class_update(BufferParams const & params) { - if (!class_) + if (!class_.get()) return; LyXTextClass const & tclass = textclasslist.TextClass(params.textclass); @@ -732,7 +714,7 @@ void FormDocument::class_update(BufferParams const & params) void FormDocument::language_update(BufferParams const & params) { - if (!language_) + if (!language_.get()) return; combo_language->select_text(params.language->lang()); @@ -749,7 +731,7 @@ void FormDocument::language_update(BufferParams const & params) void FormDocument::options_update(BufferParams const & params) { - if (!options_) + if (!options_.get()) return; fl_set_choice_text(options_->choice_postscript_driver, @@ -767,7 +749,7 @@ void FormDocument::options_update(BufferParams const & params) void FormDocument::paper_update(BufferParams const & params) { - if (!paper_) + if (!paper_.get()) return; fl_set_choice(paper_->choice_papersize2, params.papersize2 + 1); @@ -794,7 +776,7 @@ void FormDocument::paper_update(BufferParams const & params) void FormDocument::bullets_update(BufferParams const & params) { - if (!bullets_ || ((XpmVersion<4) || (XpmVersion==4 && XpmRevision<7))) + if (!bullets_.get() || ((XpmVersion<4) || (XpmVersion==4 && XpmRevision<7))) return; bool const isLinuxDoc = lv_->buffer()->isLinuxDoc(); @@ -812,7 +794,7 @@ void FormDocument::bullets_update(BufferParams const & params) void FormDocument::checkReadOnly() { - if (bc_.readOnly(lv_->buffer()->isReadonly())) { + if (bc().readOnly(lv_->buffer()->isReadonly())) { combo_doc_class->deactivate(); combo_language->deactivate(); fl_set_object_label(dialog_->text_warning, @@ -1114,7 +1096,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) void FormDocument::UpdateLayoutDocument(BufferParams const & params) { - if (!dialog_) + if (!dialog_.get()) return; checkReadOnly(); diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index 2ac54e80da..20e5e43fdd 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -13,8 +13,10 @@ #ifndef FORM_DOCUMENT_H #define FORM_DOCUMENT_H -#include "FormBase.h" #include +#include +#include "FormBaseDeprecated.h" +#include "xformsBC.h" #ifdef __GNUG_ #pragma interface @@ -41,10 +43,7 @@ public: /// #FormDocument x(Communicator ..., Popups ...);# FormDocument(LyXView *, Dialogs *); /// - ~FormDocument(); - /// static void ComboInputCB(int, void *, Combox *); - private: /// enum State { @@ -79,6 +78,8 @@ private: /// BULLETBMTABLE }; + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xforms colours have been re-mapped). */ virtual void redraw(); @@ -153,17 +154,17 @@ private: FD_form_doc_bullet * build_doc_bullet(); /// Real GUI implementation. - FD_form_tabbed_document * dialog_; + boost::scoped_ptr dialog_; /// - FD_form_doc_paper * paper_; + boost::scoped_ptr paper_; /// - FD_form_doc_class * class_; + boost::scoped_ptr class_; /// - FD_form_doc_language * language_; + boost::scoped_ptr language_; /// - FD_form_doc_options * options_; + boost::scoped_ptr options_; /// - FD_form_doc_bullet * bullets_; + boost::scoped_ptr bullets_; /// int ActCell; /// @@ -175,9 +176,18 @@ private: /// FL_OBJECT * fbullet; /// - Combox * combo_language; + boost::scoped_ptr combo_language; /// - Combox * combo_doc_class; + boost::scoped_ptr combo_doc_class; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormDocument::bc() +{ + return bc_; +} + #endif diff --git a/src/frontends/xforms/FormError.C b/src/frontends/xforms/FormError.C index 46345e92f4..84f036a090 100644 --- a/src/frontends/xforms/FormError.C +++ b/src/frontends/xforms/FormError.C @@ -23,8 +23,8 @@ FormError::FormError(LyXView * lv, Dialogs * d) - : FormInset( lv, d, _("LaTeX Error"), new OkCancelPolicy), - dialog_(0), inset_(0) + : FormInset( lv, d, _("LaTeX Error")), + inset_(0) { Assert(lv && d); // let the dialog be shown @@ -34,15 +34,9 @@ FormError::FormError(LyXView * lv, Dialogs * d) } -FormError::~FormError() -{ - delete dialog_; -} - - FL_FORM * FormError::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -78,13 +72,13 @@ void FormError::update() void FormError::build() { - dialog_ = build_error(); + dialog_.reset(build_error()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // Manage the cancel/close button - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); } diff --git a/src/frontends/xforms/FormError.h b/src/frontends/xforms/FormError.h index 748d71a0e5..5386cd3bc3 100644 --- a/src/frontends/xforms/FormError.h +++ b/src/frontends/xforms/FormError.h @@ -12,12 +12,14 @@ #ifndef FORMERROR_H #define FORMERROR_H +#include +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" - class InsetError; struct FD_form_error; @@ -27,9 +29,9 @@ class FormError : public FormInset { public: /// Constructor FormError(LyXView *, Dialogs *); - /// - ~FormError(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Disconnect signals. Also perform any necessary housekeeping. virtual void disconnect(); @@ -45,11 +47,19 @@ private: FD_form_error * build_error(); /// Real GUI implementation. - FD_form_error * dialog_; + boost::scoped_ptr dialog_; /// pointer to the inset passed through showInset InsetError * inset_; /// the error message string message_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormError::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index 81b513f785..6c581b4db6 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -24,6 +24,7 @@ #include "LyXView.h" #include "buffer.h" #include "FormExternal.h" +#include "form_external.h" #include "frontends/FileDialog.h" #include "LString.h" #include "support/filetools.h" @@ -33,19 +34,13 @@ using std::make_pair; using std::endl; FormExternal::FormExternal(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Edit external file"), new OkCancelReadOnlyPolicy), - inset_(0), ih_(0), dialog_(0) + : FormBaseBD(lv, d, _("Edit external file")), + inset_(0), ih_(0) { d->showExternal.connect(slot(this, &FormExternal::showInset)); } -FormExternal::~FormExternal() -{ - delete dialog_; -} - - extern "C" void ExternalTemplateCB(FL_OBJECT * ob, long data) { FormExternal::templateCB(ob, data); @@ -78,7 +73,7 @@ extern "C" void ExternalUpdateCB(FL_OBJECT * ob, long data) FL_FORM * FormExternal::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -90,7 +85,7 @@ void FormExternal::connect() connect(slot(this, &FormExternal::updateSlot)); h_ = d_->hideBufferDependent. connect(slot(this, &FormExternal::hide)); - FormBase::connect(); + FormBaseDeprecated::connect(); } @@ -129,7 +124,7 @@ void FormExternal::showInset(InsetExternal * inset) void FormExternal::build() { - dialog_ = build_external(); + dialog_.reset(build_external()); fl_addto_choice(dialog_->choice_template, getTemplatesComboString().c_str()); diff --git a/src/frontends/xforms/FormExternal.h b/src/frontends/xforms/FormExternal.h index b6f95f7103..8e3e776253 100644 --- a/src/frontends/xforms/FormExternal.h +++ b/src/frontends/xforms/FormExternal.h @@ -10,22 +10,24 @@ #ifndef FORMEXTERNAL_H #define FORMEXTERNAL_H -#include "FormBase.h" -#include "insets/insetexternal.h" - -#include "form_external.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "insets/insetexternal.h" +#include "xformsBC.h" + +struct FD_form_external; + /// The class for editing External insets via a dialog class FormExternal : public FormBaseBD { public: + /// FormExternal(LyXView *, Dialogs *); - ~FormExternal(); - /// Connect signals. Also perform any necessary initialisation. virtual void connect(); @@ -92,8 +94,21 @@ private: /// build the dialog FD_form_external * build_external(); + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); + /// the dialog implementation - FD_form_external * dialog_; + boost::scoped_ptr dialog_; + + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormExternal::bc() +{ + return bc_; +} + #endif // FORMEXTERNAL_H diff --git a/src/frontends/xforms/FormFiledialog.h b/src/frontends/xforms/FormFiledialog.h index cae5ab4727..5d87dd0594 100644 --- a/src/frontends/xforms/FormFiledialog.h +++ b/src/frontends/xforms/FormFiledialog.h @@ -10,15 +10,15 @@ #ifndef FORMFILEDIALOG_H #define FORMFILEDIALOG_H +#include +#include + #ifdef __GNUG__ #pragma interface #endif #include -#include -#include - #include "LString.h" #include FORMS_H_LOCATION #include "form_filedialog.h" diff --git a/src/frontends/xforms/FormGraphics.C b/src/frontends/xforms/FormGraphics.C index 5068694bc5..9323d4287c 100644 --- a/src/frontends/xforms/FormGraphics.C +++ b/src/frontends/xforms/FormGraphics.C @@ -33,8 +33,8 @@ using std::endl; using std::make_pair; FormGraphics::FormGraphics(LyXView * lv, Dialogs * d) - : FormInset(lv, d, _("Graphics"), new NoRepeatedApplyReadOnlyPolicy), - dialog_(0), inset_(0), + : FormInset(lv, d, _("Graphics")), + inset_(0), // The buttons c-tor values are the number of buttons we use // This is only to reduce memory waste. widthButtons(5), heightButtons(4), displayButtons(4), @@ -53,20 +53,12 @@ FormGraphics::~FormGraphics() widthButtons.reset(); heightButtons.reset(); displayButtons.reset(); - - // Free the form. - // delete dialog_; } void FormGraphics::build() { - dialog_ = build_graphics(); - Assert(dialog_ != 0); - if (!dialog_) { - lyxerr << "ERROR: Failed to create the Graphics Inset dialog." << endl; - return ; - } + dialog_.reset(build_graphics()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -136,29 +128,30 @@ void FormGraphics::build() InsetGraphicsParams::NONE); // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); - - bc_.addReadOnly(dialog_->input_filename); - bc_.addReadOnly(dialog_->button_browse); - bc_.addReadOnly(dialog_->input_width); - bc_.addReadOnly(dialog_->input_height); - bc_.addReadOnly(dialog_->radio_button_group_width); - bc_.addReadOnly(dialog_->radio_button_group_height); - bc_.addReadOnly(dialog_->radio_button_group_display); - bc_.addReadOnly(dialog_->input_rotate_angle); - bc_.addReadOnly(dialog_->check_inline); - bc_.addReadOnly(dialog_->input_subcaption); - bc_.addReadOnly(dialog_->check_subcaption); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); + + bc().addReadOnly(dialog_->input_filename); + bc().addReadOnly(dialog_->button_browse); + bc().addReadOnly(dialog_->input_width); + bc().addReadOnly(dialog_->input_height); + bc().addReadOnly(dialog_->radio_button_group_width); + bc().addReadOnly(dialog_->radio_button_group_height); + bc().addReadOnly(dialog_->radio_button_group_display); + bc().addReadOnly(dialog_->input_rotate_angle); + bc().addReadOnly(dialog_->check_inline); + bc().addReadOnly(dialog_->input_subcaption); + bc().addReadOnly(dialog_->check_subcaption); } FL_FORM * FormGraphics::form() const { - if (dialog_ ) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -266,7 +259,7 @@ void FormGraphics::update() igp.inlineFigure); // update the dialog's read only / read-write status - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); // Now make sure that the buttons are set correctly. input(0, 0); diff --git a/src/frontends/xforms/FormGraphics.h b/src/frontends/xforms/FormGraphics.h index f0946bc187..4c82174b24 100644 --- a/src/frontends/xforms/FormGraphics.h +++ b/src/frontends/xforms/FormGraphics.h @@ -16,15 +16,18 @@ #ifndef FORMGRAPHICS_H #define FORMGRAPHICS_H -#include "LString.h" -#include "RadioButtonGroup.h" -#include "ButtonPolicies.h" -#include "FormInset.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "LString.h" +#include "RadioButtonGroup.h" +#include "ButtonPolicies.h" +#include "FormInset.h" +#include "xformsBC.h" + // Forward declarations for classes we use only as pointers. class InsetGraphics; @@ -72,6 +75,8 @@ private: ADVANCEDINPUT }; + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Filter the inputs @@ -97,7 +102,7 @@ private: FD_form_graphics * build_graphics(); /// Real GUI implementation. - FD_form_graphics * dialog_; + boost::scoped_ptr dialog_; /** Which Inset do we belong to? Used to set and update data to/from the inset. */ @@ -110,6 +115,14 @@ private: RadioButtonGroup displayButtons; /// Last used figure path string last_image_path; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormGraphics::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index db3b5fc572..1d33dd9557 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -32,22 +32,16 @@ using std::make_pair; using std::pair; FormInclude::FormInclude(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Include file"), new OkCancelPolicy), - dialog_(0), ih_(0), inset_(0) + : FormBaseBD(lv, d, _("Include file")), + ih_(0), inset_(0) { d->showInclude.connect(slot(this, &FormInclude::showInclude)); } -FormInclude::~FormInclude() -{ - delete dialog_; -} - - FL_FORM * FormInclude::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -59,7 +53,7 @@ void FormInclude::connect() connect(slot(this, &FormInclude::updateSlot)); h_ = d_->hideBufferDependent. connect(slot(this, &FormInclude::hide)); - FormBase::connect(); + FormBaseDeprecated::connect(); } @@ -82,7 +76,7 @@ void FormInclude::updateSlot(bool switched) void FormInclude::build() { - dialog_ = build_include(); + dialog_.reset(build_include()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -116,7 +110,7 @@ void FormInclude::showInclude(InsetInclude * inset) void FormInclude::update() { - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); if (!inset_) { fl_set_input(dialog_->input_filename, ""); diff --git a/src/frontends/xforms/FormInclude.h b/src/frontends/xforms/FormInclude.h index 655324e290..cb046173b9 100644 --- a/src/frontends/xforms/FormInclude.h +++ b/src/frontends/xforms/FormInclude.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormInclude.h * Copyright 2001 the LyX Team @@ -9,15 +10,16 @@ #ifndef FORMINCLUDE_H #define FORMINCLUDE_H +#include + #ifdef __GNUG__ #pragma interface #endif -#include "FormBase.h" +#include "FormBaseDeprecated.h" +#include "xformsBC.h" #include "insets/insetinclude.h" -class InsetInclude; - struct FD_form_include; /** This class provides an XForms implementation of the FormInclude Dialog. @@ -26,21 +28,21 @@ class FormInclude : public FormBaseBD { public: /// FormInclude(LyXView *, Dialogs *); - /// - ~FormInclude(); private: /// enum State { /// the browse button - BROWSE=0, + BROWSE = 0, /// the load file button - LOAD=5, + LOAD = 5, /// the verbatim radio choice - VERBATIM=10, + VERBATIM = 10, /// the input and include radio choices - INPUTINCLUDE=11 + INPUTINCLUDE = 11 }; + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Slot launching dialog to an existing inset void showInclude(InsetInclude *); @@ -67,8 +69,10 @@ private: FD_form_include * build_include(); /// Real GUI implementation. - FD_form_include * dialog_; - + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; + /// inset::hide connection. Connection ih_; @@ -78,4 +82,10 @@ private: InsetInclude::InsetIncludeParams params; }; + +inline +xformsBC & FormInclude::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormIndex.C b/src/frontends/xforms/FormIndex.C index c817ddb169..a0a6e3f025 100644 --- a/src/frontends/xforms/FormIndex.C +++ b/src/frontends/xforms/FormIndex.C @@ -26,8 +26,7 @@ #include "lyxfunc.h" FormIndex::FormIndex(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Index"), new NoRepeatedApplyPolicy), - dialog_(0) + : FormCommand(lv, d, _("Index")) { // let the dialog be shown // These are permanent connections so we won't bother @@ -37,15 +36,9 @@ FormIndex::FormIndex(LyXView * lv, Dialogs * d) } -FormIndex::~FormIndex() -{ - delete dialog_; -} - - FL_FORM * FormIndex::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -59,7 +52,7 @@ void FormIndex::connect() void FormIndex::build() { - dialog_ = build_index(); + dialog_.reset(build_index()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -68,13 +61,13 @@ void FormIndex::build() fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED); // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); - bc_.addReadOnly(dialog_->input_key); + bc().addReadOnly(dialog_->input_key); } @@ -83,8 +76,8 @@ void FormIndex::update() fl_set_input(dialog_->input_key, params.getContents().c_str()); // Surely, this should reset the buttons to their original state? // It doesn't. Instead "Restore" becomes a "Close" - //bc_.refresh(); - bc_.readOnly(lv_->buffer()->isReadonly()); + //bc().refresh(); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormIndex.h b/src/frontends/xforms/FormIndex.h index 698802d729..10094679aa 100644 --- a/src/frontends/xforms/FormIndex.h +++ b/src/frontends/xforms/FormIndex.h @@ -12,11 +12,14 @@ #ifndef FORMINDEX_H #define FORMINDEX_H +#include +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" struct FD_form_index; /** This class provides an XForms implementation of the FormIndex Dialog. @@ -25,9 +28,9 @@ class FormIndex : public FormCommand { public: /// FormIndex(LyXView *, Dialogs *); - /// - ~FormIndex(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -41,7 +44,15 @@ private: /// FD_form_index * build_index(); /// Real GUI implementation. - FD_form_index * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormIndex::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormInset.C b/src/frontends/xforms/FormInset.C index 7f81476aaf..6abee8e87f 100644 --- a/src/frontends/xforms/FormInset.C +++ b/src/frontends/xforms/FormInset.C @@ -21,11 +21,10 @@ #include "Dialogs.h" #include "LyXView.h" #include "FormInset.h" +#include "xformsBC.h" -FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t, - ButtonPolicy * bp, - char const * close, char const * cancel) - : FormBaseBD(lv, d, t, bp, close, cancel), ih_(0) +FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t) + : FormBaseBD(lv, d, t), ih_(0) {} @@ -35,7 +34,7 @@ void FormInset::connect() connect(slot(this, &FormInset::updateSlot)); h_ = d_->hideBufferDependent. connect(slot(this, &FormInset::hide)); - FormBase::connect(); + FormBaseDeprecated::connect(); } @@ -55,10 +54,8 @@ void FormInset::updateSlot(bool switched) } -FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t, - ButtonPolicy * bp, - char const * close, char const * cancel) - : FormInset(lv, d, t, bp, close, cancel), +FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t) + : FormInset(lv, d, t), inset_(0) {} @@ -95,6 +92,6 @@ void FormCommand::createInset(string const & arg) params.setFromString(arg); if ( !arg.empty() ) - bc_.valid(); // so that the user can press Ok + bc().valid(); // so that the user can press Ok show(); } diff --git a/src/frontends/xforms/FormInset.h b/src/frontends/xforms/FormInset.h index 31d705ac55..53946c6f49 100644 --- a/src/frontends/xforms/FormInset.h +++ b/src/frontends/xforms/FormInset.h @@ -12,7 +12,7 @@ #ifndef FORMCOMMAND_H #define FORMCOMMAND_H -#include "FormBase.h" +#include "FormBaseDeprecated.h" #include "insets/insetcommand.h" #ifdef __GNUG__ @@ -25,10 +25,7 @@ class FormInset : public FormBaseBD { protected: /// Constructor - FormInset(LyXView *, Dialogs *, string const &, - ButtonPolicy * bp, - char const * close = N_("Close"), - char const * cancel = N_("Cancel")); + FormInset(LyXView *, Dialogs *, string const &); /// Connect signals. Also perform any necessary initialisation. virtual void connect(); @@ -49,10 +46,7 @@ protected: class FormCommand : public FormInset { protected: /// Constructor - FormCommand(LyXView *, Dialogs *, string const &, - ButtonPolicy *, - char const * close = N_("Close"), - char const * cancel = N_("Cancel")); + FormCommand(LyXView *, Dialogs *, string const &); /// Disconnect signals. Also perform any necessary housekeeping. virtual void disconnect(); diff --git a/src/frontends/xforms/FormLog.C b/src/frontends/xforms/FormLog.C index d8accd95ff..dc74a12b0b 100644 --- a/src/frontends/xforms/FormLog.C +++ b/src/frontends/xforms/FormLog.C @@ -32,13 +32,10 @@ FormLog::FormLog(LyXView * lv, Dialogs * d) d->showLogFile.connect(slot(this, &FormLog::show)); } -FormLog::~FormLog() -{ -} void FormLog::update() { - if (!dialog_ || !lv_->view()->available()) + if (!dialog_.get() || !lv_->view()->available()) return; std::pair const logfile diff --git a/src/frontends/xforms/FormLog.h b/src/frontends/xforms/FormLog.h index 9cb9ded05d..ed82c8e062 100644 --- a/src/frontends/xforms/FormLog.h +++ b/src/frontends/xforms/FormLog.h @@ -9,7 +9,7 @@ #ifndef FORMLOG_H #define FORMLOG_H -#include "FormBase.h" +#include "FormBaseDeprecated.h" #include "FormBrowser.h" #ifdef __GNUG__ @@ -25,9 +25,8 @@ class Dialogs; */ class FormLog : public FormBrowser { public: + /// FormLog(LyXView *, Dialogs *); - ~FormLog(); - private: /// Update the dialog. virtual void update(); diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index bae9fa87f8..0c28102a8a 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -31,9 +31,7 @@ using Liason::setMinibuffer; #endif FormParagraph::FormParagraph(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Paragraph Layout"), - new NoRepeatedApplyReadOnlyPolicy), - dialog_(0), general_(0), extra_(0) + : FormBaseBD(lv, d, _("Paragraph Layout")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -42,14 +40,6 @@ FormParagraph::FormParagraph(LyXView * lv, Dialogs * d) } -FormParagraph::~FormParagraph() -{ - delete general_; - delete extra_; - delete dialog_; -} - - void FormParagraph::redraw() { if( form() && form()->visible ) @@ -65,7 +55,7 @@ void FormParagraph::redraw() FL_FORM * FormParagraph::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -73,7 +63,7 @@ FL_FORM * FormParagraph::form() const void FormParagraph::build() { // the tabbed folder - dialog_ = build_tabbed_paragraph(); + dialog_.reset(build_tabbed_paragraph()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -87,7 +77,7 @@ void FormParagraph::build() bc_.refresh(); // the general paragraph data form - general_ = build_paragraph_general(); + general_.reset(build_paragraph_general()); fl_addto_choice(general_->choice_space_above, _(" None | Defskip | Smallskip " @@ -118,7 +108,7 @@ void FormParagraph::build() bc_.addReadOnly (general_->input_labelwidth); // the document class form - extra_ = build_paragraph_extra(); + extra_.reset(build_paragraph_extra()); fl_set_input_return(extra_->input_pextra_width, FL_RETURN_CHANGED); fl_set_input_return(extra_->input_pextra_widthp, FL_RETURN_CHANGED); @@ -137,7 +127,7 @@ void FormParagraph::build() void FormParagraph::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; general_apply(); @@ -152,7 +142,7 @@ void FormParagraph::apply() void FormParagraph::update() { - if (!dialog_) + if (!dialog_.get()) return; general_update(); @@ -296,7 +286,7 @@ void FormParagraph::extra_apply() void FormParagraph::general_update() { - if (!general_) + if (!general_.get()) return; Buffer * buf = lv_->view()->buffer(); @@ -468,7 +458,7 @@ void FormParagraph::general_update() void FormParagraph::extra_update() { - if (!lv_->view()->available() || !extra_) + if (!lv_->view()->available() || !extra_.get()) return; LyXParagraph * par = lv_->view()->text->cursor.par(); diff --git a/src/frontends/xforms/FormParagraph.h b/src/frontends/xforms/FormParagraph.h index 7104131d6b..1a632672c3 100644 --- a/src/frontends/xforms/FormParagraph.h +++ b/src/frontends/xforms/FormParagraph.h @@ -13,13 +13,14 @@ #ifndef FORM_PARAGRAPH_H #define FORM_PARAGRAPH_H -#include "FormBase.h" +#include +#include "FormBaseDeprecated.h" +#include "xformsBC.h" #ifdef __GNUG_ #pragma interface #endif - struct FD_form_tabbed_paragraph; struct FD_form_paragraph_general; struct FD_form_paragraph_extra; @@ -31,10 +32,9 @@ class FormParagraph : public FormBaseBD { public: /// FormParagraph(LyXView *, Dialogs *); - /// - ~FormParagraph(); - private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xforms colours have been re-mapped). */ virtual void redraw(); @@ -67,11 +67,19 @@ private: FD_form_paragraph_extra * build_paragraph_extra(); /// Real GUI implementation. - FD_form_tabbed_paragraph * dialog_; + boost::scoped_ptr dialog_; /// - FD_form_paragraph_general * general_; + boost::scoped_ptr general_; /// - FD_form_paragraph_extra * extra_; + boost::scoped_ptr extra_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormParagraph::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormPreamble.C b/src/frontends/xforms/FormPreamble.C index 79897e4769..af3746d99d 100644 --- a/src/frontends/xforms/FormPreamble.C +++ b/src/frontends/xforms/FormPreamble.C @@ -10,6 +10,10 @@ #include FORMS_H_LOCATION +#ifdef __GNUG__ +#pragma implementation +#endif + #include "form_preamble.h" #include "FormPreamble.h" #include "Dialogs.h" @@ -24,8 +28,7 @@ using Liason::setMinibuffer; #endif FormPreamble::FormPreamble(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("LaTeX preamble"), new NoRepeatedApplyReadOnlyPolicy), - dialog_(0) + : FormBaseBD(lv, d, _("LaTeX preamble")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -34,37 +37,33 @@ FormPreamble::FormPreamble(LyXView * lv, Dialogs * d) } -FormPreamble::~FormPreamble() -{ - delete dialog_; -} - - FL_FORM * FormPreamble::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } + void FormPreamble::build() { - dialog_ = build_preamble(); + dialog_.reset(build_preamble()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED); // Manage the ok, apply and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.addReadOnly(dialog_->input_preamble); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().addReadOnly(dialog_->input_preamble); + bc().refresh(); } + void FormPreamble::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; // is this needed?: @@ -78,7 +77,7 @@ void FormPreamble::apply() void FormPreamble::update() { - if (!dialog_) + if (!dialog_.get()) return; fl_set_input(dialog_->input_preamble,lv_->buffer()->params.preamble.c_str()); @@ -89,7 +88,7 @@ void FormPreamble::update() setEnabled(dialog_->button_apply, enable); // need this? - // bc_.readOnly(lv_->buffer()->isReadonly()); + // bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormPreamble.h b/src/frontends/xforms/FormPreamble.h index 55ca68fe7e..7f54cffd24 100644 --- a/src/frontends/xforms/FormPreamble.h +++ b/src/frontends/xforms/FormPreamble.h @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormPreamble.h * Copyright 2001 The LyX Team. @@ -9,7 +10,13 @@ #ifndef FORMPREAMBLE_H #define FORMPREAMBLE_H -#include "FormBase.h" +#include +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + +#ifdef __GNUG__ +#pragma interface +#endif struct FD_form_preamble; @@ -17,33 +24,37 @@ struct FD_form_preamble; */ class FormPreamble : public FormBaseBD { public: - /// - FormPreamble(LyXView *, Dialogs *); - /// - ~FormPreamble(); - + /// + FormPreamble(LyXView *, Dialogs *); private: - /** Redraw the form (on receipt of a Signal indicating, for example, - * that the xforms colours have been re-mapped). - */ + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); - /// Filter the inputs - // virtual bool input(FL_OBJECT *, long); + /// Filter the inputs + // virtual bool input(FL_OBJECT *, long); - /// Build the popup - virtual void build(); - /// Apply from popup - virtual void apply(); - /// Update the popup. - virtual void update(); - /// - virtual FL_FORM * form() const; + /// Build the popup + virtual void build(); + /// Apply from popup + virtual void apply(); + /// Update the popup. + virtual void update(); + /// + virtual FL_FORM * form() const; - /// Typedefinitions from the fdesign produced Header file - FD_form_preamble * build_preamble(); + /// Typedefinitions from the fdesign produced Header file + FD_form_preamble * build_preamble(); - /// Real GUI implementation. - FD_form_preamble * dialog_; + /// Real GUI implementation. + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormPreamble::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index dbeaae8e33..b39740522a 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -62,10 +62,7 @@ static Formats local_formats; static Converters local_converters; FormPreferences::FormPreferences(LyXView * lv, Dialogs * d) - : FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy), - dialog_(0), - converters_tab_(0), inputs_tab_(0), look_n_feel_tab_(0), - outputs_tab_(0), lang_opts_tab_(0), + : FormBaseBI(lv, d, _("Preferences")), warningPosted(false), colors_(*this), converters_(*this), inputs_misc_(*this), formats_(*this), interface_(*this), language_(*this), @@ -79,18 +76,6 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d) } -FormPreferences::~FormPreferences() -{ - delete converters_tab_; - delete inputs_tab_; - delete look_n_feel_tab_; - delete outputs_tab_; - delete lang_opts_tab_; - - delete dialog_; -} - - void FormPreferences::connect() { fl_set_form_maxsize( dialog_->form, minw_, minh_ ); @@ -143,14 +128,14 @@ void FormPreferences::redraw() FL_FORM * FormPreferences::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } void FormPreferences::ok() { - FormBase::ok(); + FormBaseDeprecated::ok(); if (colors_.modifiedXformsPrefs) { string const filename = @@ -171,31 +156,31 @@ void FormPreferences::hide() && outer_form->visible) { fl_hide_form(outer_form); } - FormBase::hide(); + FormBaseDeprecated::hide(); } void FormPreferences::build() { - dialog_ = build_preferences(); + dialog_.reset(build_preferences()); // Manage the restore, save, apply and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // build the tab folders - converters_tab_ = build_outer_tab(); - look_n_feel_tab_ = build_outer_tab(); - inputs_tab_ = build_outer_tab(); - outputs_tab_ = build_outer_tab(); - lang_opts_tab_ = build_outer_tab(); + converters_tab_.reset(build_outer_tab()); + look_n_feel_tab_.reset(build_outer_tab()); + inputs_tab_.reset(build_outer_tab()); + outputs_tab_.reset(build_outer_tab()); + lang_opts_tab_.reset(build_outer_tab()); // build actual tabfolder contents // these will become nested tabfolders @@ -339,8 +324,7 @@ void FormPreferences::feedback(FL_OBJECT * ob) str = spellchecker_.feedback(ob); } - str = formatted(_(str), dialog_->text_warning->w-10, - FL_SMALL_SIZE, FL_NORMAL_STYLE); + str = formatted(_(str), dialog_->text_warning->w-10, FL_SMALL_SIZE); fl_set_object_label(dialog_->text_warning, str.c_str()); fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE); @@ -379,7 +363,7 @@ bool FormPreferences::input(FL_OBJECT * ob, long) void FormPreferences::update() { - if (!dialog_) return; + if (!dialog_.get()) return; // read lyxrc entries colors_.update(); @@ -397,9 +381,14 @@ void FormPreferences::update() } -FormPreferences::Colors::~Colors() +FormPreferences::Colors::Colors(FormPreferences & p) + : parent_(p) +{} + + +FD_form_colors const * FormPreferences::Colors::dialog() { - delete dialog_; + return dialog_.get(); } @@ -478,7 +467,7 @@ void FormPreferences::Colors::apply() void FormPreferences::Colors::build() { - dialog_ = parent_.build_colors(); + dialog_.reset(parent_.build_colors()); fl_set_object_color(dialog_->button_color, GUI_COLOR_CHOICE, GUI_COLOR_CHOICE); @@ -944,9 +933,14 @@ string const FormPreferences::Colors::X11hexname(RGBColor const & col) const } -FormPreferences::Converters::~Converters() +FormPreferences::Converters::Converters(FormPreferences & p) + : parent_(p) +{} + + +FD_form_converters const * FormPreferences::Converters::dialog() { - delete dialog_; + return dialog_.get(); } @@ -960,7 +954,7 @@ void FormPreferences::Converters::apply() const void FormPreferences::Converters::build() { - dialog_ = parent_.build_converters(); + dialog_.reset(parent_.build_converters()); fl_set_input_return(dialog_->input_converter, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_flags, FL_RETURN_CHANGED); @@ -1201,9 +1195,14 @@ void FormPreferences::Converters::UpdateChoices() const } -FormPreferences::Formats::~Formats() +FormPreferences::Formats::Formats( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_formats const * FormPreferences::Formats::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1215,7 +1214,7 @@ void FormPreferences::Formats::apply() const void FormPreferences::Formats::build() { - dialog_ = parent_.build_formats(); + dialog_.reset(parent_.build_formats()); fl_set_input_return(dialog_->input_format, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_viewer, FL_RETURN_CHANGED); @@ -1421,9 +1420,14 @@ bool FormPreferences::Formats::Input() } -FormPreferences::InputsMisc::~InputsMisc() +FormPreferences::InputsMisc::InputsMisc( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_inputs_misc const * FormPreferences::InputsMisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1436,7 +1440,7 @@ void FormPreferences::InputsMisc::apply() const void FormPreferences::InputsMisc::build() { - dialog_ = parent_.build_inputs_misc(); + dialog_.reset(parent_.build_inputs_misc()); fl_set_input_return(dialog_->input_date_format, FL_RETURN_CHANGED); @@ -1464,9 +1468,14 @@ void FormPreferences::InputsMisc::update() } -FormPreferences::Interface::~Interface() +FormPreferences::Interface::Interface( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_interface const * FormPreferences::Interface::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1486,7 +1495,7 @@ void FormPreferences::Interface::apply() const void FormPreferences::Interface::build() { - dialog_ = parent_.build_interface(); + dialog_.reset(parent_.build_interface()); fl_set_input_return(dialog_->input_popup_font, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_menu_font, FL_RETURN_CHANGED); @@ -1576,10 +1585,14 @@ void FormPreferences::Interface::update() } -FormPreferences::Language::~Language() +FormPreferences::Language::Language( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_language const * FormPreferences::Language::dialog() { - delete combo_default_lang; - delete dialog_; + return dialog_.get(); } @@ -1628,7 +1641,7 @@ void FormPreferences::Language::apply() void FormPreferences::Language::build() { - dialog_ = parent_.build_language(); + dialog_.reset(parent_.build_language()); fl_set_input_return(dialog_->input_package, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_command_begin, FL_RETURN_CHANGED); @@ -1640,7 +1653,7 @@ void FormPreferences::Language::build() FL_OBJECT * obj = dialog_->choice_default_lang; fl_deactivate_object(dialog_->choice_default_lang); - combo_default_lang = new Combox(FL_COMBOX_DROPLIST); + combo_default_lang.reset(new Combox(FL_COMBOX_DROPLIST)); combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400, parent_.lang_opts_tab_->tabfolder_outer, parent_.dialog_->tabfolder_prefs); @@ -1688,7 +1701,7 @@ FormPreferences::Language::feedback(FL_OBJECT const * const ob) const { string str; - if (reinterpret_cast(ob) == combo_default_lang) + if (reinterpret_cast(ob) == combo_default_lang.get()) str = lyxrc.getDescription(LyXRC::RC_DEFAULT_LANGUAGE); else if (ob == dialog_->check_use_kbmap) str = lyxrc.getDescription(LyXRC::RC_KBMAP); @@ -1800,13 +1813,18 @@ void FormPreferences::Language::ComboCB(int, void * v, Combox * combox) FormPreferences * pre = static_cast(v); // This is safe, as nothing is done to the pointer, other than // to use its address in a block-if statement. - pre->bc_.valid(pre->input(reinterpret_cast(combox), 0)); + pre->bc().valid(pre->input(reinterpret_cast(combox), 0)); } -FormPreferences::LnFmisc::~LnFmisc() +FormPreferences::LnFmisc::LnFmisc( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_lnf_misc const * FormPreferences::LnFmisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1830,7 +1848,7 @@ void FormPreferences::LnFmisc::apply() const void FormPreferences::LnFmisc::build() { - dialog_ = parent_.build_lnf_misc(); + dialog_.reset(parent_.build_lnf_misc()); fl_set_counter_step(dialog_->counter_autosave, 1, 10); fl_set_counter_step(dialog_->counter_wm_jump, 1, 10); @@ -1891,9 +1909,14 @@ void FormPreferences::LnFmisc::update() } -FormPreferences::OutputsMisc::~OutputsMisc() +FormPreferences::OutputsMisc::OutputsMisc( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_outputs_misc const * FormPreferences::OutputsMisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1914,7 +1937,7 @@ void FormPreferences::OutputsMisc::apply() const void FormPreferences::OutputsMisc::build() { - dialog_ = parent_.build_outputs_misc(); + dialog_.reset(parent_.build_outputs_misc()); fl_set_counter_step(dialog_->counter_line_len, 1, 10); @@ -1970,9 +1993,14 @@ void FormPreferences::OutputsMisc::update() } -FormPreferences::Paths::~Paths() +FormPreferences::Paths::Paths( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_paths const * FormPreferences::Paths::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2013,7 +2041,7 @@ void FormPreferences::Paths::apply() void FormPreferences::Paths::build() { - dialog_ = parent_.build_paths(); + dialog_.reset(parent_.build_paths()); fl_set_input_return(dialog_->input_default_path, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_template_path, FL_RETURN_CHANGED); @@ -2228,9 +2256,14 @@ void FormPreferences::Paths::update() } -FormPreferences::Printer::~Printer() +FormPreferences::Printer::Printer(FormPreferences & p) + : parent_(p) +{} + + +FD_form_printer const * FormPreferences::Printer::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2310,7 +2343,7 @@ FormPreferences::Printer::feedback(FL_OBJECT const * const ob) const void FormPreferences::Printer::build() { - dialog_ = parent_.build_printer(); + dialog_.reset(parent_.build_printer()); fl_set_input_return(dialog_->input_command, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_page_range, FL_RETURN_CHANGED); @@ -2393,9 +2426,14 @@ void FormPreferences::Printer::update() } -FormPreferences::ScreenFonts::~ScreenFonts() +FormPreferences::ScreenFonts::ScreenFonts( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_screen_fonts const * FormPreferences::ScreenFonts::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2517,7 +2555,7 @@ void FormPreferences::ScreenFonts::apply() const void FormPreferences::ScreenFonts::build() { - dialog_ = parent_.build_screen_fonts(); + dialog_.reset(parent_.build_screen_fonts()); fl_set_counter_step(dialog_->counter_zoom, 1, 10); fl_set_counter_step(dialog_->counter_dpi, 1, 10); @@ -2695,9 +2733,15 @@ void FormPreferences::ScreenFonts::update() } -FormPreferences::SpellChecker::~SpellChecker() + +FormPreferences::SpellChecker::SpellChecker( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_spellchecker const * FormPreferences::SpellChecker::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2761,7 +2805,7 @@ void FormPreferences::SpellChecker::apply() void FormPreferences::SpellChecker::build() { - dialog_ = parent_.build_spellchecker(); + dialog_.reset(parent_.build_spellchecker()); fl_addto_choice(dialog_->choice_spell_command, _(" none | ispell | aspell ")); @@ -2912,8 +2956,7 @@ void FormPreferences::printWarning(string const & warning) warningPosted = true; string str = _("WARNING!") + string(" ") + warning; - str = formatted(str, dialog_->text_warning->w-10, - FL_SMALL_SIZE, FL_NORMAL_STYLE); + str = formatted(str, dialog_->text_warning->w-10, FL_SMALL_SIZE); fl_set_object_label(dialog_->text_warning, str.c_str()); fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE); diff --git a/src/frontends/xforms/FormPreferences.h b/src/frontends/xforms/FormPreferences.h index da1ea04e0f..c6d6ab4514 100644 --- a/src/frontends/xforms/FormPreferences.h +++ b/src/frontends/xforms/FormPreferences.h @@ -17,14 +17,17 @@ #ifndef FORMPREFERENCES_H #define FORMPREFERENCES_H +#include // pair +#include + #ifdef __GNUG_ #pragma interface #endif -#include // pair -#include "FormBase.h" +#include "FormBaseDeprecated.h" #include "Color.h" // NamedColor -#include "xforms_helpers.h" // XformsColor +#include "xforms_helpers.h" // XformColor +#include "xformsBC.h" class Combox; class Dialogs; @@ -54,12 +57,12 @@ public: /// #FormPreferences x(LyXFunc ..., Dialogs ...);# FormPreferences(LyXView *, Dialogs *); /// - ~FormPreferences(); - /// static int FeedbackCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Disconnect signals. Also perform any necessary housekeeping. @@ -128,17 +131,17 @@ private: FD_form_spellchecker * build_spellchecker(); /// Real GUI implementation. - FD_form_preferences * dialog_; + boost::scoped_ptr dialog_; /// Converters tabfolder - FD_form_outer_tab * converters_tab_; + boost::scoped_ptr converters_tab_; /// reLyX and other import/input stuff - FD_form_outer_tab * inputs_tab_; + boost::scoped_ptr inputs_tab_; /// HCI configuration - FD_form_outer_tab * look_n_feel_tab_; + boost::scoped_ptr look_n_feel_tab_; /// Outputs tabfolder - FD_form_outer_tab * outputs_tab_; + boost::scoped_ptr outputs_tab_; /// Spellchecker, language stuff, etc - FD_form_outer_tab * lang_opts_tab_; + boost::scoped_ptr lang_opts_tab_; /** Flag whether a warning has been posted to the text window. If so, don't redraw the window when the mouse leaves an object. */ @@ -156,11 +159,9 @@ private: GUI_COLOR_CURSOR = FL_FREE_COL3 }; /// - Colors( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~Colors(); + Colors( FormPreferences & p ); /// - FD_form_colors const * dialog() { return dialog_; } + FD_form_colors const * dialog(); /// void apply(); // not const as modifies modifiedXformsPrefs. /// @@ -196,7 +197,7 @@ private: /// FormPreferences & parent_; /// - FD_form_colors * dialog_; + boost::scoped_ptr dialog_; /// A vector of LyX LColor GUI name and associated RGB color. std::vector lyxColorDB; @@ -210,11 +211,9 @@ private: class Converters { public: /// - Converters( FormPreferences & p ) : parent_(p), dialog_(0) {} + Converters( FormPreferences & p ); /// - ~Converters(); - /// - FD_form_converters const * dialog() { return dialog_; } + FD_form_converters const * dialog(); /// void apply() const; /// @@ -247,7 +246,7 @@ private: /// FormPreferences & parent_; /// - FD_form_converters * dialog_; + boost::scoped_ptr dialog_; }; /// friend class Converters; @@ -256,11 +255,9 @@ private: class Formats { public: /// - Formats( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~Formats(); + Formats( FormPreferences & p ); /// - FD_form_formats const * dialog() { return dialog_; } + FD_form_formats const * dialog(); /// void apply() const; /// @@ -287,7 +284,7 @@ private: /// FormPreferences & parent_; /// - FD_form_formats * dialog_; + boost::scoped_ptr dialog_; }; /// friend class Formats; @@ -296,11 +293,9 @@ private: class InputsMisc { public: /// - InputsMisc( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~InputsMisc(); + InputsMisc( FormPreferences & p ); /// - FD_form_inputs_misc const * dialog() { return dialog_; } + FD_form_inputs_misc const * dialog(); /// void apply() const; /// @@ -314,7 +309,7 @@ private: /// FormPreferences & parent_; /// - FD_form_inputs_misc * dialog_; + boost::scoped_ptr dialog_; }; /// friend class InputsMisc; @@ -323,11 +318,9 @@ private: class Interface { public: /// - Interface( FormPreferences & p ) : parent_(p), dialog_(0) {} + Interface( FormPreferences & p ); /// - ~Interface(); - /// - FD_form_interface const * dialog() { return dialog_; } + FD_form_interface const * dialog(); /// void apply() const; /// @@ -343,7 +336,7 @@ private: /// FormPreferences & parent_; /// - FD_form_interface * dialog_; + boost::scoped_ptr dialog_; }; /// friend class Interface; @@ -352,12 +345,9 @@ private: class Language { public: /// - Language( FormPreferences & p ) - : parent_(p), dialog_(0), combo_default_lang(0) {} - /// - ~Language(); + Language( FormPreferences & p ); /// - FD_form_language const * dialog() { return dialog_; } + FD_form_language const * dialog(); /// void apply(); // not const because calls update() /// @@ -375,9 +365,9 @@ private: /// FormPreferences & parent_; /// - FD_form_language * dialog_; + boost::scoped_ptr dialog_; /// - Combox * combo_default_lang; + boost::scoped_ptr combo_default_lang; }; /// friend class Language; @@ -386,11 +376,9 @@ private: class LnFmisc { public: /// - LnFmisc( FormPreferences & p ) : parent_(p), dialog_(0) {} + LnFmisc( FormPreferences & p ); /// - ~LnFmisc(); - /// - FD_form_lnf_misc const * dialog() { return dialog_; } + FD_form_lnf_misc const * dialog(); /// void apply() const; /// @@ -404,7 +392,7 @@ private: /// FormPreferences & parent_; /// - FD_form_lnf_misc * dialog_; + boost::scoped_ptr dialog_; }; /// friend class LnFmisc; @@ -413,11 +401,9 @@ private: class OutputsMisc { public: /// - OutputsMisc( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~OutputsMisc(); + OutputsMisc( FormPreferences & p ); /// - FD_form_outputs_misc const * dialog() { return dialog_; } + FD_form_outputs_misc const * dialog(); /// void apply() const; /// @@ -431,7 +417,7 @@ private: /// FormPreferences & parent_; /// - FD_form_outputs_misc * dialog_; + boost::scoped_ptr dialog_; }; /// friend class OutputsMisc; @@ -440,11 +426,9 @@ private: class Paths { public: /// - Paths( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~Paths(); + Paths( FormPreferences & p ); /// - FD_form_paths const * dialog() { return dialog_; } + FD_form_paths const * dialog(); /// void apply(); /// @@ -460,7 +444,7 @@ private: /// FormPreferences & parent_; /// - FD_form_paths * dialog_; + boost::scoped_ptr dialog_; }; /// friend class Paths; @@ -469,11 +453,9 @@ private: class Printer { public: /// - Printer( FormPreferences & p ) : parent_(p), dialog_(0) {} + Printer( FormPreferences & p ); /// - ~Printer(); - /// - FD_form_printer const * dialog() { return dialog_; } + FD_form_printer const * dialog(); /// void apply() const; /// @@ -487,7 +469,7 @@ private: /// FormPreferences & parent_; /// - FD_form_printer * dialog_; + boost::scoped_ptr dialog_; }; /// friend class Printer; @@ -496,11 +478,9 @@ private: class ScreenFonts { public: /// - ScreenFonts( FormPreferences & p ) : parent_(p), dialog_(0) {} - /// - ~ScreenFonts(); + ScreenFonts( FormPreferences & p ); /// - FD_form_screen_fonts const * dialog() { return dialog_; } + FD_form_screen_fonts const * dialog(); /// void apply() const; /// @@ -516,7 +496,7 @@ private: /// FormPreferences & parent_; /// - FD_form_screen_fonts * dialog_; + boost::scoped_ptr dialog_; }; /// friend class ScreenFonts; @@ -525,11 +505,9 @@ private: class SpellChecker { public: /// - SpellChecker( FormPreferences & p ) : parent_(p), dialog_(0) {} + SpellChecker( FormPreferences & p ); /// - ~SpellChecker(); - /// - FD_form_spellchecker const * dialog() { return dialog_; } + FD_form_spellchecker const * dialog(); /// void apply(); // not const because calls update()! /// @@ -545,7 +523,7 @@ private: /// FormPreferences & parent_; /// - FD_form_spellchecker * dialog_; + boost::scoped_ptr dialog_; }; /// friend class SpellChecker; @@ -595,7 +573,15 @@ private: /// RGBColor col; }; - + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormPreferences::bc() +{ + return bc_; +} + #endif diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index b9d9542b24..d9ad659b49 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -36,8 +36,8 @@ using Liason::getPrinterParams; using std::make_pair; FormPrint::FormPrint(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Print"), new OkApplyCancelPolicy), - dialog_(0), target_(2), order_(2), which_(3) + : FormBaseBD(lv, d, _("Print")), + target_(2), order_(2), which_(3) { // let the dialog be shown // This is a permanent connection so we won't bother @@ -46,25 +46,19 @@ FormPrint::FormPrint(LyXView * lv, Dialogs * d) } -FormPrint::~FormPrint() -{ - delete dialog_; -} - - void FormPrint::build() { - dialog_ = build_print(); + dialog_.reset(build_print()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; // Manage the ok, apply and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); // allow controlling of input and ok/apply (de)activation fl_set_input_return(dialog_->input_printer, @@ -115,7 +109,8 @@ void FormPrint::build() FL_FORM * FormPrint::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -162,7 +157,7 @@ void FormPrint::apply() void FormPrint::update() { - if (dialog_ + if (dialog_.get() && lv_->view()->available()) { PrinterParams pp(getPrinterParams(lv_->buffer())); @@ -196,7 +191,7 @@ void FormPrint::update() fl_set_input(dialog_->input_count, tostr(pp.count_copies).c_str()); - bc_.valid(true); + bc().valid(true); } } diff --git a/src/frontends/xforms/FormPrint.h b/src/frontends/xforms/FormPrint.h index aee8d8c6bd..45aeca3cc6 100644 --- a/src/frontends/xforms/FormPrint.h +++ b/src/frontends/xforms/FormPrint.h @@ -17,13 +17,16 @@ #ifndef FORMPRINT_H #define FORMPRINT_H -#include "FormBase.h" -#include "RadioButtonGroup.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "RadioButtonGroup.h" +#include "xformsBC.h" + class LyXView; class Dialogs; struct FD_form_print; @@ -35,10 +38,10 @@ class FormPrint : public FormBaseBD { public: /// #FormPrint x(LyXView ..., Dialogs ...);# FormPrint(LyXView *, Dialogs *); - /// - ~FormPrint(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Update the dialog. virtual void update(); /// Apply from dialog @@ -56,13 +59,21 @@ private: FD_form_print * build_print(); /// Real GUI implementation. - FD_form_print * dialog_; + boost::scoped_ptr dialog_; /// print target RadioButtonGroup target_; /// page order RadioButtonGroup order_; /// which pages RadioButtonGroup which_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormPrint::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormRef.C b/src/frontends/xforms/FormRef.C index bf8fd574c0..f649b06054 100644 --- a/src/frontends/xforms/FormRef.C +++ b/src/frontends/xforms/FormRef.C @@ -35,8 +35,8 @@ using std::vector; bool saved_position; FormRef::FormRef(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Reference"), new NoRepeatedApplyPolicy), - at_ref(false), dialog_(0) + : FormCommand(lv, d, _("Reference")), + at_ref(false) { // let the dialog be shown // These are permanent connections so we won't bother @@ -46,15 +46,10 @@ FormRef::FormRef(LyXView * lv, Dialogs * d) } -FormRef::~FormRef() -{ - delete dialog_; -} - - FL_FORM * FormRef::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -68,7 +63,7 @@ void FormRef::disconnect() void FormRef::build() { - dialog_ = build_ref(); + dialog_.reset(build_ref()); for (int i = 0; !InsetRef::types[i].latex_name.empty(); ++i) fl_addto_choice(dialog_->type, @@ -82,15 +77,15 @@ void FormRef::build() fl_deactivate_object(dialog_->ref); // Manage the ok and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); #warning I had to uncomment this so the buttons could be disabled in update() (dekel) - //bc_.addReadOnly(dialog_->type); - //bc_.addReadOnly(dialog_->name); + //bc().addReadOnly(dialog_->type); + //bc().addReadOnly(dialog_->name); } @@ -121,7 +116,7 @@ void FormRef::update() refs = lv_->buffer()->getLabelList(); updateBrowser(refs); - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormRef.h b/src/frontends/xforms/FormRef.h index e899ee92dc..c455414cf4 100644 --- a/src/frontends/xforms/FormRef.h +++ b/src/frontends/xforms/FormRef.h @@ -12,11 +12,15 @@ #ifndef FORMREF_H #define FORMREF_H +#include + #ifdef __GNUG__ #pragma interface #endif #include "FormInset.h" +#include "xformsBC.h" + struct FD_form_ref; /** This class provides an XForms implementation of the FormRef Dialog. @@ -25,10 +29,9 @@ class FormRef : public FormCommand { public: /// FormRef(LyXView *, Dialogs *); - /// - ~FormRef(); - /// private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Disconnect signals. Also perform any necessary housekeeping. virtual void disconnect(); @@ -54,7 +57,15 @@ private: std::vector refs; /// Real GUI implementation. - FD_form_ref * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormRef::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormSearch.C b/src/frontends/xforms/FormSearch.C index 8cca31c2e9..5f87c1c7d5 100644 --- a/src/frontends/xforms/FormSearch.C +++ b/src/frontends/xforms/FormSearch.C @@ -8,6 +8,10 @@ #include +#ifdef __GNUG__ +#pragma implementation +#endif + #include "FormSearch.h" #include "form_search.h" #include "gettext.h" @@ -25,8 +29,7 @@ using Liason::setMinibuffer; FormSearch::FormSearch(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("LyX: Find and Replace"), new NoRepeatedApplyReadOnlyPolicy), - dialog_(0) + : FormBaseBD(lv, d, _("LyX: Find and Replace")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -38,22 +41,16 @@ FormSearch::FormSearch(LyXView * lv, Dialogs * d) } -FormSearch::~FormSearch() -{ - delete dialog_; -} - - FL_FORM * FormSearch::form() const { - if (dialog_) - return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } void FormSearch::build() { - dialog_ = build_search(); + dialog_.reset(build_search()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; @@ -68,7 +65,7 @@ void FormSearch::build() void FormSearch::update() { - if (!dialog_) + if (!dialog_.get()) return; bc_.readOnly(lv_->buffer()->isReadonly()); diff --git a/src/frontends/xforms/FormSearch.h b/src/frontends/xforms/FormSearch.h index 66ad7acf46..7167f2fa26 100644 --- a/src/frontends/xforms/FormSearch.h +++ b/src/frontends/xforms/FormSearch.h @@ -9,7 +9,14 @@ #ifndef FORMSEARCH_H #define FORMSEARCH_H -#include "FormBase.h" +#include + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "FormBaseDeprecated.h" +#include "xformsBC.h" struct FD_form_search; class LyXView; @@ -19,40 +26,45 @@ class Dialogs; */ class FormSearch : public FormBaseBD { public: - /// - FormSearch(LyXView *, Dialogs *); - /// - ~FormSearch(); + /// + FormSearch(LyXView *, Dialogs *); private: - /** Redraw the form (on receipt of a Signal indicating, for example, - * that the xform colours have been re-mapped). - */ + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); - /// Filter the inputs - virtual bool input(FL_OBJECT *, long); + /// Filter the inputs + virtual bool input(FL_OBJECT *, long); - /// Build the popup - virtual void build(); - - /// Update the popup - virtual void update(); - - /// Searches occurance of string - /// if argument=true forward search otherwise backward search - void Find(bool const = true); - /// if argument=false replace once otherwise replace all - /// Replaces occurance of string - void Replace(bool const = false); + /// Build the popup + virtual void build(); + + /// Update the popup + virtual void update(); + + /// Searches occurance of string + /// if argument=true forward search otherwise backward search + void Find(bool const = true); + /// if argument=false replace once otherwise replace all + /// Replaces occurance of string + void Replace(bool const = false); - /// - virtual FL_FORM * form() const; + /// + virtual FL_FORM * form() const; - /// Typedefinitions from the fdesign produced Header file - FD_form_search * build_search(); + /// Typedefinitions from the fdesign produced Header file + FD_form_search * build_search(); - /// Real GUI implementation. - FD_form_search * dialog_; + /// Real GUI implementation. + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormSearch::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormSplash.C b/src/frontends/xforms/FormSplash.C index 2316751d00..18b4a90bc7 100644 --- a/src/frontends/xforms/FormSplash.C +++ b/src/frontends/xforms/FormSplash.C @@ -38,25 +38,21 @@ extern "C" void C_FormSplashCB(FL_OBJECT * ob, long) FormSplash * form = static_cast(ob->form->u_vdata); form->hide(); } - + FormSplash::FormSplash(LyXView *, Dialogs * d) - : dialog_(0), d_(d) + : d_(d) { c_ = d->showSplash.connect(slot(this, &FormSplash::show)); } -FormSplash::~FormSplash() -{ - c_.disconnect(); - delete dialog_; -} - - void FormSplash::show() { - if (!dialog_) { + if (!lyxrc.show_banner) + return; + + if (!dialog_.get()) { build(); fl_set_form_atclose(dialog_->form, C_FormSplashCloseCB, 0); } @@ -78,21 +74,20 @@ void FormSplash::show() void FormSplash::hide() { + c_.disconnect(); + if (dialog_->form && dialog_->form->visible) + fl_hide_form(dialog_->form); d_->destroySplash(); } void FormSplash::build() { - if (!lyxrc.show_banner) - return; - string banner_file = LibFileSearch("images", "banner", "xpm"); - if (banner_file.empty()) return; - dialog_ = build_splash(); + dialog_.reset(build_splash()); // Workaround dumb xforms sizing bug fl_set_form_minsize(dialog_->form, dialog_->form->w, dialog_->form->h); diff --git a/src/frontends/xforms/FormSplash.h b/src/frontends/xforms/FormSplash.h index ab868f90f1..2579de3bf4 100644 --- a/src/frontends/xforms/FormSplash.h +++ b/src/frontends/xforms/FormSplash.h @@ -10,10 +10,15 @@ #ifndef FORMSPLASH_H #define FORMSPLASH_H +#include + #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + #include "DialogBase.h" struct FD_form_splash; @@ -24,10 +29,9 @@ class LyXView; */ class FormSplash : public DialogBase { public: + /// FormSplash(LyXView *, Dialogs *); - ~FormSplash(); - /// hide (and destroy) the dialog void hide(); @@ -40,7 +44,7 @@ private: FD_form_splash * build_splash(); /// Real GUI implementation. - FD_form_splash * dialog_; + boost::scoped_ptr dialog_; /// our container Dialogs * d_; /// the show connection diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index ba3dba5113..810efead1d 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -14,6 +14,10 @@ #include +#ifdef __GNUG__ +#pragma implementation +#endif + #include "FormTabular.h" #include "form_tabular.h" #include "LyXView.h" @@ -24,9 +28,7 @@ FormTabular::FormTabular(LyXView * lv, Dialogs * d) - : FormInset(lv, d, _("Tabular Layout"), new OkCancelReadOnlyPolicy), - dialog_(0), tabular_options_(0), column_options_(0), - cell_options_(0), longtable_options_(0), + : FormInset(lv, d, _("Tabular Layout")), inset_(0), actCell_(-1) { // let the dialog be shown @@ -37,16 +39,6 @@ FormTabular::FormTabular(LyXView * lv, Dialogs * d) } -FormTabular::~FormTabular() -{ - delete dialog_; - delete tabular_options_; - delete column_options_; - delete cell_options_; - delete longtable_options_; -} - - void FormTabular::redraw() { if(form() && form()->visible) @@ -62,7 +54,8 @@ void FormTabular::redraw() FL_FORM * FormTabular::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -106,11 +99,11 @@ void FormTabular::updateInset(InsetTabular * inset) void FormTabular::build() { - dialog_ = build_tabular(); - tabular_options_ = build_tabular_options(); - column_options_ = build_column_options(); - cell_options_ = build_cell_options(); - longtable_options_ = build_longtable_options(); + dialog_.reset(build_tabular()); + tabular_options_.reset(build_tabular_options()); + column_options_.reset(build_column_options()); + cell_options_.reset(build_cell_options()); + longtable_options_.reset(build_longtable_options()); // Workaround dumb xforms sizing bug minw_ = form()->w; diff --git a/src/frontends/xforms/FormTabular.h b/src/frontends/xforms/FormTabular.h index bd890000d7..15051e752c 100644 --- a/src/frontends/xforms/FormTabular.h +++ b/src/frontends/xforms/FormTabular.h @@ -15,7 +15,14 @@ #ifndef FORMTABULAR_H #define FORMTABULAR_H +#include + +#ifdef __GNUG__ +#pragma interface +#endif + #include "FormInset.h" +#include "xformsBC.h" class InsetTabular; struct FD_form_tabular; @@ -31,10 +38,10 @@ class FormTabular : public FormInset { public: /// #FormTabular x(LyXFunc ..., Dialogs ...);# FormTabular(LyXView *, Dialogs *); - /// - ~FormTabular(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xforms colours have been re-mapped). */ virtual void redraw(); @@ -66,20 +73,28 @@ private: FD_form_longtable_options * build_longtable_options(); /// Real GUI implementation. - FD_form_tabular * dialog_; + boost::scoped_ptr dialog_; /// - FD_form_tabular_options * tabular_options_; + boost::scoped_ptr tabular_options_; /// - FD_form_column_options * column_options_; + boost::scoped_ptr column_options_; /// - FD_form_cell_options * cell_options_; + boost::scoped_ptr cell_options_; /// - FD_form_longtable_options * longtable_options_; + boost::scoped_ptr longtable_options_; /// pointer to the inset passed through showInset InsetTabular * inset_; /// int actCell_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormTabular::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormTabularCreate.C b/src/frontends/xforms/FormTabularCreate.C index 78f93114c5..b04a5d80ab 100644 --- a/src/frontends/xforms/FormTabularCreate.C +++ b/src/frontends/xforms/FormTabularCreate.C @@ -28,9 +28,7 @@ #include "support/lstrings.h" FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Insert Tabular"), - new OkApplyCancelReadOnlyPolicy), - dialog_(0) + : FormBaseBD(lv, d, _("Insert Tabular")) { // let the dialog be shown // This is a permanent connection so we won't bother @@ -39,29 +37,24 @@ FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d) } -FormTabularCreate::~FormTabularCreate() -{ - delete dialog_; -} - - FL_FORM * FormTabularCreate::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } void FormTabularCreate::connect() { - bc_.valid(true); + bc().valid(true); FormBaseBD::connect(); } void FormTabularCreate::build() { - dialog_ = build_tabular_create(); + dialog_.reset(build_tabular_create()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -75,10 +68,10 @@ void FormTabularCreate::build() fl_set_slider_precision(dialog_->slider_columns, 0); // Manage the ok, apply and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); } @@ -94,5 +87,5 @@ void FormTabularCreate::apply() void FormTabularCreate::update() { - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormTabularCreate.h b/src/frontends/xforms/FormTabularCreate.h index 61d08f1c93..7e71ce3665 100644 --- a/src/frontends/xforms/FormTabularCreate.h +++ b/src/frontends/xforms/FormTabularCreate.h @@ -15,12 +15,15 @@ #ifndef FORMTABULARCREATE_H #define FORMTABULARCREATE_H -#include "FormBase.h" +#include #ifdef __GNUG__ #pragma interface #endif +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + class LyXView; class Dialogs; struct FD_form_tabular_create; @@ -32,10 +35,10 @@ class FormTabularCreate : public FormBaseBD { public: /// #FormTabularCreate x(LyXView ..., Dialogs ...);# FormTabularCreate(LyXView *, Dialogs *); - /// - ~FormTabularCreate(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Connect signals etc. virtual void connect(); @@ -52,7 +55,15 @@ private: FD_form_tabular_create * build_tabular_create(); /// Real GUI implementation. - FD_form_tabular_create * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormTabularCreate::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormToc.C b/src/frontends/xforms/FormToc.C index d4a59fc023..0e99e1d037 100644 --- a/src/frontends/xforms/FormToc.C +++ b/src/frontends/xforms/FormToc.C @@ -27,12 +27,14 @@ #include "lyxfunc.h" #include "support/lstrings.h" +using std::vector; + // The current code uses the apply() for handling the Update button and the // type-of-table selection and cancel() for the close button. This is a little // confusing to the button controller so I've made an IgnorantPolicy to cover // this situation since the dialog doesn't care about buttons. ARRae 20001013 FormToc::FormToc(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Table of Contents"), new OkCancelPolicy), + : FormCommand(lv, d, _("Table of Contents")), dialog_(0) { // let the dialog be shown @@ -43,15 +45,10 @@ FormToc::FormToc(LyXView * lv, Dialogs * d) } -FormToc::~FormToc() -{ - delete dialog_; -} - - FL_FORM * FormToc::form() const { - if (dialog_ ) return dialog_->form; + if (dialog_.get()) + return dialog_->form; return 0; } @@ -65,7 +62,7 @@ void FormToc::disconnect() void FormToc::build() { - dialog_ = build_toc(); + dialog_.reset(build_toc()); #if 0 fl_addto_choice(dialog_->choice_toc_type, @@ -85,8 +82,8 @@ void FormToc::build() minh_ = form()->h; // Manage the cancel/close button - bc_.setCancel(dialog_->button_cancel); - bc_.refresh(); + bc().setCancel(dialog_->button_cancel); + bc().refresh(); } diff --git a/src/frontends/xforms/FormToc.h b/src/frontends/xforms/FormToc.h index 68f8161a65..9716c074f6 100644 --- a/src/frontends/xforms/FormToc.h +++ b/src/frontends/xforms/FormToc.h @@ -12,12 +12,16 @@ #ifndef FORMTOC_H #define FORMTOC_H +#include + #ifdef __GNUG__ #pragma interface #endif #include "FormInset.h" #include "buffer.h" +#include "xformsBC.h" + struct FD_form_toc; /** This class provides an XForms implementation of the FormToc Dialog. @@ -26,9 +30,9 @@ class FormToc : public FormCommand { public: /// FormToc(LyXView *, Dialogs *); - /// - ~FormToc(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Disconnect signals. Also perform any necessary housekeeping. virtual void disconnect(); @@ -47,10 +51,18 @@ private: /// FD_form_toc * build_toc(); - /// Real GUI implementation. - FD_form_toc * dialog_; /// Buffer::SingleList toclist; + /// Real GUI implementation. + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormToc::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormUrl.C b/src/frontends/xforms/FormUrl.C index f14e326339..cbcf1046d4 100644 --- a/src/frontends/xforms/FormUrl.C +++ b/src/frontends/xforms/FormUrl.C @@ -17,7 +17,6 @@ #pragma implementation #endif - #include "Dialogs.h" #include "FormUrl.h" #include "LyXView.h" @@ -26,8 +25,7 @@ #include "lyxfunc.h" FormUrl::FormUrl(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Url"), new NoRepeatedApplyReadOnlyPolicy), - dialog_(0) + : FormCommand(lv, d, _("Url")) { // let the dialog be shown // These are permanent connections so we won't bother @@ -37,15 +35,9 @@ FormUrl::FormUrl(LyXView * lv, Dialogs * d) } -FormUrl::~FormUrl() -{ - delete dialog_; -} - - FL_FORM * FormUrl::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -59,7 +51,7 @@ void FormUrl::connect() void FormUrl::build() { - dialog_ = build_url(); + dialog_.reset(build_url()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -69,15 +61,15 @@ void FormUrl::build() fl_set_input_return(dialog_->url, FL_RETURN_CHANGED); // Manage the ok, apply, restore and cancel/close buttons - bc_.setOK(dialog_->button_ok); - bc_.setApply(dialog_->button_apply); - bc_.setCancel(dialog_->button_cancel); - bc_.setUndoAll(dialog_->button_restore); - bc_.refresh(); - - bc_.addReadOnly(dialog_->name); - bc_.addReadOnly(dialog_->url); - bc_.addReadOnly(dialog_->radio_html); + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + bc().setUndoAll(dialog_->button_restore); + bc().refresh(); + + bc().addReadOnly(dialog_->name); + bc().addReadOnly(dialog_->url); + bc().addReadOnly(dialog_->radio_html); } @@ -91,7 +83,7 @@ void FormUrl::update() else fl_set_button(dialog_->radio_html, 1); - bc_.readOnly(lv_->buffer()->isReadonly()); + bc().readOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/xforms/FormUrl.h b/src/frontends/xforms/FormUrl.h index d39c8812e6..3c9fad4f05 100644 --- a/src/frontends/xforms/FormUrl.h +++ b/src/frontends/xforms/FormUrl.h @@ -12,11 +12,15 @@ #ifndef FORMURL_H #define FORMURL_H +#include + #ifdef __GNUG__ #pragma interface #endif #include "FormInset.h" +#include "xformsBC.h" + struct FD_form_url; /** This class provides an XForms implementation of the FormUrl Dialog. @@ -25,9 +29,9 @@ class FormUrl : public FormCommand { public: /// FormUrl(LyXView *, Dialogs *); - /// - ~FormUrl(); private: + /// Pointer to the actual instantiation of the ButtonController. + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -41,7 +45,15 @@ private: /// FD_form_url * build_url(); /// Real GUI implementation. - FD_form_url * dialog_; + boost::scoped_ptr dialog_; + /// The ButtonController + ButtonController bc_; }; + +inline +xformsBC & FormUrl::bc() +{ + return bc_; +} #endif diff --git a/src/frontends/xforms/FormVCLog.C b/src/frontends/xforms/FormVCLog.C index 997cdcf792..188cbeb76c 100644 --- a/src/frontends/xforms/FormVCLog.C +++ b/src/frontends/xforms/FormVCLog.C @@ -32,13 +32,10 @@ FormVCLog::FormVCLog(LyXView * lv, Dialogs * d) d->showVCLogFile.connect(slot(this, &FormVCLog::show)); } -FormVCLog::~FormVCLog() -{ -} void FormVCLog::update() { - if (!dialog_ || !lv_->view()->available()) + if (!dialog_.get() || !lv_->view()->available()) return; const string logfile = lv_->view()->buffer()->lyxvc.getLogFile(); diff --git a/src/frontends/xforms/FormVCLog.h b/src/frontends/xforms/FormVCLog.h index 345c8569ec..56df0b2ee5 100644 --- a/src/frontends/xforms/FormVCLog.h +++ b/src/frontends/xforms/FormVCLog.h @@ -9,7 +9,7 @@ #ifndef FORMVCLOG_H #define FORMVCLOG_H -#include "FormBase.h" +#include "FormBaseDeprecated.h" #include "FormBrowser.h" #ifdef __GNUG__ @@ -25,9 +25,8 @@ class Dialogs; */ class FormVCLog : public FormBrowser { public: + /// FormVCLog(LyXView *, Dialogs *); - ~FormVCLog(); - private: /// Update the dialog. virtual void update(); diff --git a/src/frontends/xforms/GUIRunTime.C b/src/frontends/xforms/GUIRunTime.C index cc867e24fb..419654b400 100644 --- a/src/frontends/xforms/GUIRunTime.C +++ b/src/frontends/xforms/GUIRunTime.C @@ -9,11 +9,12 @@ #include +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma implementation #endif -#include FORMS_H_LOCATION #include "GUIRunTime.h" #include "debug.h" diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index a5a2e9bdff..2e005510df 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -5,6 +5,7 @@ noinst_LTLIBRARIES = libxforms.la BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = -I${top_srcdir}/src/ \ -I${top_srcdir}/src/frontends/ \ + -I${top_srcdir}/src/frontends/controllers \ ${SIGC_CFLAGS} $(BOOST_INCLUDES) LIBS= LDFLAGS= @@ -12,8 +13,6 @@ LYXDATADIRS = forms ETAGS_ARGS = --lang=c++ # Alphabetical order please. It makes it easier to figure out what's missing. libxforms_la_SOURCES = \ - ButtonController.C \ - ButtonController.h \ Color.C \ Color.h \ Dialogs.C \ @@ -25,6 +24,8 @@ libxforms_la_SOURCES = \ GUIRunTime.C \ FormBase.C \ FormBase.h \ + FormBaseDeprecated.C \ + FormBaseDeprecated.h \ FormBibitem.C \ FormBibitem.h \ form_bibitem.C \ @@ -138,7 +139,9 @@ libxforms_la_SOURCES = \ Toolbar_pimpl.C \ Toolbar_pimpl.h \ xforms_helpers.C \ - xforms_helpers.h + xforms_helpers.h \ + xformsBC.C \ + xformsBC.h # These still have to be added. Sooner or later. ARRae-20000411 # GUI_defaults.C \ diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index bea1b71ca1..9ca79d8bda 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -7,13 +7,14 @@ * *======================================================*/ +#include + +#include + #ifdef __GNUG__ #pragma implementation #endif -#include - -#include #include "support/lstrings.h" #include "support/LAssert.h" #include "debug.h" diff --git a/src/frontends/xforms/Menubar_pimpl.h b/src/frontends/xforms/Menubar_pimpl.h index 611532d101..f284f43778 100644 --- a/src/frontends/xforms/Menubar_pimpl.h +++ b/src/frontends/xforms/Menubar_pimpl.h @@ -14,17 +14,19 @@ #ifndef MENUBAR_PIMPL_H #define MENUBAR_PIMPL_H +#include +#include +#include +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma interface #endif -#include -#include -#include #include "LString.h" #include "frontends/Menubar.h" #include "commandtags.h" -#include FORMS_H_LOCATION + class LyXView; class MenuBackend; class MenuItem; diff --git a/src/frontends/xforms/RadioButtonGroup.C b/src/frontends/xforms/RadioButtonGroup.C index 863aafff1f..7d20b97a2a 100644 --- a/src/frontends/xforms/RadioButtonGroup.C +++ b/src/frontends/xforms/RadioButtonGroup.C @@ -11,6 +11,10 @@ #include +#include +#include +#include + #ifdef __GNUG__ #pragma implementation #endif @@ -19,9 +23,6 @@ #include "debug.h" // for lyxerr -#include -#include -#include using std::find_if; using std::bind2nd; using std::endl; diff --git a/src/frontends/xforms/RadioButtonGroup.h b/src/frontends/xforms/RadioButtonGroup.h index 658f8c3091..bf96b6aca6 100644 --- a/src/frontends/xforms/RadioButtonGroup.h +++ b/src/frontends/xforms/RadioButtonGroup.h @@ -13,17 +13,18 @@ #ifndef RADIOBUTTONGROUP_H #define RADIOBUTTONGROUP_H +#include +#include + +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma interface #endif -#include -#include - using std::vector; using std::pair; -#include FORMS_H_LOCATION /** This class simplifies the work with a group of radio buttons, * the idea is that you register a bunch of radio buttons with the accompanying diff --git a/src/frontends/xforms/Timeout_pimpl.C b/src/frontends/xforms/Timeout_pimpl.C index 3232c982ac..81a2eab2ca 100644 --- a/src/frontends/xforms/Timeout_pimpl.C +++ b/src/frontends/xforms/Timeout_pimpl.C @@ -7,14 +7,14 @@ * \author John Levon */ -#ifdef __GNUG__ -#pragma implementation -#endif - #include #include FORMS_H_LOCATION +#ifdef __GNUG__ +#pragma implementation +#endif + #include "Timeout_pimpl.h" #include "debug.h" diff --git a/src/frontends/xforms/Timeout_pimpl.h b/src/frontends/xforms/Timeout_pimpl.h index a6efbab180..9ee24325a2 100644 --- a/src/frontends/xforms/Timeout_pimpl.h +++ b/src/frontends/xforms/Timeout_pimpl.h @@ -11,14 +11,14 @@ #include -#ifdef __GNUG__ -#pragma interface -#endif - #include "frontends/Timeout.h" #include +#ifdef __GNUG__ +#pragma interface +#endif + /** * This class executes the callback when the timeout expires * using XForms mechanisms diff --git a/src/frontends/xforms/Toolbar_pimpl.h b/src/frontends/xforms/Toolbar_pimpl.h index bbafe2373c..0ded184531 100644 --- a/src/frontends/xforms/Toolbar_pimpl.h +++ b/src/frontends/xforms/Toolbar_pimpl.h @@ -14,18 +14,19 @@ #ifndef TOOLBAR_PIMPL_H #define TOOLBAR_PIMPL_H -#include "frontends/Toolbar.h" - -#ifdef __GNUG__ -#pragma interface -#endif - #include #include FORMS_H_LOCATION + +#include "frontends/Toolbar.h" + #include "commandtags.h" #include "combox.h" #include "ToolbarDefaults.h" +#ifdef __GNUG__ +#pragma interface +#endif + /** The LyX xforms toolbar class */ struct Toolbar::Pimpl { diff --git a/src/frontends/xforms/form_bibtex.C b/src/frontends/xforms/form_bibtex.C index 68c1f44ba3..f650a8098c 100644 --- a/src/frontends/xforms/form_bibtex.C +++ b/src/frontends/xforms/form_bibtex.C @@ -31,24 +31,24 @@ FD_form_bibtex * FormBibtex::build_bibtex() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 20, 90, 90, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 3); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 3); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 2); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 2); { char const * const dummy = N_("Style:|#S"); fdui->style = obj = fl_add_input(FL_NORMAL_INPUT, 80, 50, 130, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_bibtex.h b/src/frontends/xforms/form_bibtex.h index 8189af6e7a..3ea6ce3357 100644 --- a/src/frontends/xforms/form_bibtex.h +++ b/src/frontends/xforms/form_bibtex.h @@ -5,9 +5,9 @@ #define FD_form_bibtex_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_browser.C b/src/frontends/xforms/form_browser.C index 7e707d001f..c623cea6b5 100644 --- a/src/frontends/xforms/form_browser.C +++ b/src/frontends/xforms/form_browser.C @@ -34,7 +34,7 @@ FD_form_browser * FormBrowser::build_browser() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); { char const * const dummy = N_("Update|#Uu"); fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 340, 90, 30, idex(_(dummy))); @@ -42,7 +42,7 @@ FD_form_browser * FormBrowser::build_browser() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_browser.h b/src/frontends/xforms/form_browser.h index 2a780f7948..e2c80a3e19 100644 --- a/src/frontends/xforms/form_browser.h +++ b/src/frontends/xforms/form_browser.h @@ -5,8 +5,8 @@ #define FD_form_browser_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_character.C b/src/frontends/xforms/form_character.C index 079f35e2c5..16d9c95aea 100644 --- a/src/frontends/xforms/form_character.C +++ b/src/frontends/xforms/form_character.C @@ -38,7 +38,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Series:|#S"); fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_(dummy))); @@ -48,7 +48,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Shape:|#H"); fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_(dummy))); @@ -58,7 +58,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Size:|#Z"); fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_(dummy))); @@ -68,7 +68,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Misc:|#M"); fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_(dummy))); @@ -78,7 +78,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 30, idex(_(dummy))); @@ -86,7 +86,7 @@ FD_form_character * FormCharacter::build_character() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|#N"); fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, idex(_(dummy))); @@ -94,7 +94,7 @@ FD_form_character * FormCharacter::build_character() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); { char const * const dummy = N_("Color:|#C"); fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_(dummy))); @@ -104,7 +104,7 @@ FD_form_character * FormCharacter::build_character() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Toggle on all these|#T"); fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_(dummy))); @@ -112,13 +112,13 @@ FD_form_character * FormCharacter::build_character() } fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:")); fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled")); fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); diff --git a/src/frontends/xforms/form_character.h b/src/frontends/xforms/form_character.h index 6b5144415c..74168bfd94 100644 --- a/src/frontends/xforms/form_character.h +++ b/src/frontends/xforms/form_character.h @@ -5,9 +5,9 @@ #define FD_form_character_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_citation.C b/src/frontends/xforms/form_citation.C index c8e4cdf127..d41283bc9b 100644 --- a/src/frontends/xforms/form_citation.C +++ b/src/frontends/xforms/form_citation.C @@ -22,9 +22,9 @@ FD_form_citation * FormCitation::build_citation() FL_OBJECT *obj; FD_form_citation *fdui = new FD_form_citation; - fdui->form = fl_bgn_form(FL_NO_BOX, 435, 665); + fdui->form = fl_bgn_form(FL_NO_BOX, 430, 830); fdui->form->u_vdata = this; - fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 435, 665, ""); + fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 430, 830, ""); { char const * const dummy = N_("Inset keys|#I"); fdui->browser_cite = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 300, idex(_(dummy))); @@ -63,13 +63,36 @@ FD_form_citation * FormCitation::build_citation() fl_set_object_gravity(obj, FL_North, FL_North); fl_set_object_resize(obj, FL_RESIZE_NONE); fl_set_object_callback(obj, C_FormBaseInputCB, 0); - fdui->browser_info = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 360, 410, 80, _("Info")); + fdui->browser_info = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 360, 410, 95, _("Info")); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); fl_set_object_resize(obj, FL_RESIZE_NONE); + fdui->frame_search = obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 475, 410, 125, _("Search")); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); + fdui->input_search = obj = fl_add_input(FL_NORMAL_INPUT, 25, 490, 380, 30, ""); + fl_set_object_lalign(obj, FL_ALIGN_TOP); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); + fl_set_object_resize(obj, FL_RESIZE_NONE); + fdui->button_search_type = obj = fl_add_button(FL_PUSH_BUTTON, 25, 525, 90, 30, _("Simple")); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + { + char const * const dummy = N_("Previous|#P"); + fdui->button_previous = obj = fl_add_button(FL_NORMAL_BUTTON, 315, 525, 90, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + { + char const * const dummy = N_("Next|#N"); + fdui->button_next = obj = fl_add_button(FL_NORMAL_BUTTON, 315, 560, 90, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); { char const * const dummy = N_("Citation style|#s"); - fdui->choice_style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 470, 130, 30, idex(_(dummy))); + fdui->choice_style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 630, 130, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_boxtype(obj, FL_FRAME_BOX); @@ -78,7 +101,7 @@ FD_form_citation * FormCitation::build_citation() fl_set_object_callback(obj, C_FormBaseInputCB, 0); { char const * const dummy = N_("Text before|#T"); - fdui->input_before = obj = fl_add_input(FL_NORMAL_INPUT, 100, 520, 250, 30, idex(_(dummy))); + fdui->input_before = obj = fl_add_input(FL_NORMAL_INPUT, 100, 680, 250, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); @@ -86,7 +109,7 @@ FD_form_citation * FormCitation::build_citation() fl_set_object_callback(obj, C_FormBaseInputCB, 0); { char const * const dummy = N_("Text after|#e"); - fdui->input_after = obj = fl_add_input(FL_NORMAL_INPUT, 100, 570, 250, 30, idex(_(dummy))); + fdui->input_after = obj = fl_add_input(FL_NORMAL_INPUT, 100, 730, 250, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); @@ -94,24 +117,24 @@ FD_form_citation * FormCitation::build_citation() fl_set_object_callback(obj, C_FormBaseInputCB, 0); { char const * const dummy = N_("Restore|#R"); - fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 630, 90, 30, idex(_(dummy))); + fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 790, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 630, 90, 30, _("OK")); + fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 790, 90, 30, _("OK")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_callback(obj, C_FormBaseOKCB, 0); { char const * const dummy = N_("Apply|#A"); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 630, 90, 30, idex(_(dummy))); + fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 790, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_callback(obj, C_FormBaseApplyCB, 0); { char const * const dummy = N_("Cancel|^["); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, idex(_(dummy))); + fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 790, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); diff --git a/src/frontends/xforms/form_citation.h b/src/frontends/xforms/form_citation.h index f2b94e7f63..931fa26dc5 100644 --- a/src/frontends/xforms/form_citation.h +++ b/src/frontends/xforms/form_citation.h @@ -25,6 +25,11 @@ struct FD_form_citation { FL_OBJECT *button_up; FL_OBJECT *button_down; FL_OBJECT *browser_info; + FL_OBJECT *frame_search; + FL_OBJECT *input_search; + FL_OBJECT *button_search_type; + FL_OBJECT *button_previous; + FL_OBJECT *button_next; FL_OBJECT *choice_style; FL_OBJECT *input_before; FL_OBJECT *input_after; diff --git a/src/frontends/xforms/form_copyright.C b/src/frontends/xforms/form_copyright.C index 3d9425c06e..371744a8ec 100644 --- a/src/frontends/xforms/form_copyright.C +++ b/src/frontends/xforms/form_copyright.C @@ -45,7 +45,7 @@ FD_form_copyright * FormCopyright::build_copyright() 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_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_copyright.h b/src/frontends/xforms/form_copyright.h index ee94cb3cd6..f98680d5f9 100644 --- a/src/frontends/xforms/form_copyright.h +++ b/src/frontends/xforms/form_copyright.h @@ -5,7 +5,7 @@ #define FD_form_copyright_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_credits.C b/src/frontends/xforms/form_credits.C index 7a36aad285..d6e86320a1 100644 --- a/src/frontends/xforms/form_credits.C +++ b/src/frontends/xforms/form_credits.C @@ -29,7 +29,7 @@ FD_form_credits * FormCredits::build_credits() 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_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); obj = fl_add_text(FL_NORMAL_TEXT, 10, 40, 480, 30, _("Matthias")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); diff --git a/src/frontends/xforms/form_credits.h b/src/frontends/xforms/form_credits.h index ef9791d423..a77b214469 100644 --- a/src/frontends/xforms/form_credits.h +++ b/src/frontends/xforms/form_credits.h @@ -5,7 +5,7 @@ #define FD_form_credits_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_document.C b/src/frontends/xforms/form_document.C index 574eba255a..4ad059db71 100644 --- a/src/frontends/xforms/form_document.C +++ b/src/frontends/xforms/form_document.C @@ -35,17 +35,17 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, INPUT); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 410, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseApplyCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, INPUT); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 410, 100, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, INPUT); fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 380, 435, 30, ""); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); { @@ -54,7 +54,7 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseRestoreCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, INPUT); fl_end_form(); fdui->form->fdui = fdui; @@ -88,7 +88,7 @@ FD_form_doc_paper * FormDocument::build_doc_paper() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 205, 200, 130, ""); fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); @@ -122,14 +122,14 @@ FD_form_doc_paper * FormDocument::build_doc_paper() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Landscape|#L"); fdui->radio_landscape = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 120, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_group(); { @@ -139,7 +139,7 @@ FD_form_doc_paper * FormDocument::build_doc_paper() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); obj = fl_add_text(FL_NORMAL_TEXT, 240, 75, 150, 20, _("Custom Papersize")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -150,70 +150,70 @@ FD_form_doc_paper * FormDocument::build_doc_paper() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Width:|#W"); fdui->input_custom_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 100, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Height:|#H"); fdui->input_custom_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 140, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Top:|#T"); fdui->input_top_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 175, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Bottom:|#B"); fdui->input_bottom_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 215, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Left:|#e"); fdui->input_left_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 255, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Right:|#R"); fdui->input_right_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 295, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Headheight:|#i"); fdui->input_head_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 215, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Headsep:|#d"); fdui->input_head_sep = obj = fl_add_input(FL_NORMAL_INPUT, 330, 255, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Footskip:|#F"); fdui->input_foot_skip = obj = fl_add_input(FL_NORMAL_INPUT, 330, 295, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 360, 420, 20, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -257,7 +257,7 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Font Size:|#O"); fdui->choice_doc_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 140, 160, 30, idex(_(dummy))); @@ -265,7 +265,7 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Class:|#C"); fdui->choice_doc_class = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 20, 160, 30, idex(_(dummy))); @@ -273,7 +273,7 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKCHOICECLASS); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKCHOICECLASS); { char const * const dummy = N_("Pagestyle:|#P"); fdui->choice_doc_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_(dummy))); @@ -281,7 +281,7 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Spacing|#g"); fdui->choice_doc_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 290, 160, 30, idex(_(dummy))); @@ -289,17 +289,17 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Extra Options:|#X"); fdui->input_doc_extra = obj = fl_add_input(FL_NORMAL_INPUT, 120, 185, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fdui->input_doc_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 225, 60, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Default Skip:|#u"); fdui->choice_doc_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 225, 90, 30, idex(_(dummy))); @@ -307,7 +307,7 @@ FD_form_doc_class * FormDocument::build_doc_class() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fdui->group_doc_sides = fl_bgn_group(); { @@ -316,14 +316,14 @@ FD_form_doc_class * FormDocument::build_doc_class() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Two|#T"); fdui->radio_doc_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 60, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_group(); @@ -334,14 +334,14 @@ FD_form_doc_class * FormDocument::build_doc_class() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Two|#w"); fdui->radio_doc_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 150, 110, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_group(); @@ -352,20 +352,20 @@ FD_form_doc_class * FormDocument::build_doc_class() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Skip|#K"); fdui->radio_doc_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 240, 110, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_set_button(obj, 1); fl_end_group(); fdui->input_doc_spacing = obj = fl_add_input(FL_NORMAL_INPUT, 300, 290, 120, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_form(); fdui->form->fdui = fdui; @@ -397,7 +397,7 @@ FD_form_doc_language * FormDocument::build_doc_language() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Type:|#T"); fdui->choice_quotes_language = obj = fl_add_choice(FL_NORMAL_CHOICE, 110, 140, 190, 30, idex(_(dummy))); @@ -405,7 +405,7 @@ FD_form_doc_language * FormDocument::build_doc_language() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_bgn_group(); { char const * const dummy = N_("Single|#S"); @@ -413,14 +413,14 @@ FD_form_doc_language * FormDocument::build_doc_language() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Double|#D"); fdui->radio_double = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 210, 180, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_group(); { @@ -430,7 +430,7 @@ FD_form_doc_language * FormDocument::build_doc_language() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_form(); fdui->form->fdui = fdui; @@ -460,15 +460,15 @@ FD_form_doc_options * FormDocument::build_doc_options() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 155, 110, 80, 30, _("Section number depth")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 155, 150, 80, 30, _("Table of contents depth")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("PS Driver:|#S"); fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 155, 205, 190, 30, idex(_(dummy))); @@ -476,14 +476,14 @@ FD_form_doc_options * FormDocument::build_doc_options() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); { char const * const dummy = N_("Use AMS Math|#M"); fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 140, 250, 200, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_form(); fdui->form->fdui = fdui; @@ -510,7 +510,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); fl_set_border_width(-3); fdui->bmtable_bullet_panel = obj = fl_add_bmtable(1, 90, 105, 265, 180, ""); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETBMTABLE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETBMTABLE); fl_set_object_lcol(obj, FL_BLUE); fl_set_object_boxtype(obj, FL_UP_BOX); fl_set_bmtable_pixmap_file(obj, 6, 6, @@ -527,7 +527,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, CHOICEBULLETSIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHOICEBULLETSIZE); { char const * const dummy = N_("LaTeX|#L"); fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT, 80, 300, 275, 30, idex(_(dummy))); @@ -535,7 +535,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_FIXED_STYLE); - fl_set_object_callback(obj, C_FormBaseInputCB, INPUTBULLETLATEX); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUTBULLETLATEX); fdui->radio_bullet_depth = fl_bgn_group(); { @@ -544,7 +544,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_LARGE_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETDEPTH1); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETDEPTH1); fl_set_button(obj, 1); { char const * const dummy = N_("2|#2"); @@ -552,21 +552,21 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_LARGE_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETDEPTH2); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETDEPTH2); { char const * const dummy = N_("3|#3"); fdui->radio_bullet_depth_3 = obj = fl_add_button(FL_RADIO_BUTTON, 225, 35, 55, 40, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_LARGE_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETDEPTH3); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETDEPTH3); { char const * const dummy = N_("4|#4"); fdui->radio_bullet_depth_4 = obj = fl_add_button(FL_RADIO_BUTTON, 285, 35, 55, 40, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_LARGE_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETDEPTH4); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETDEPTH4); fl_end_group(); obj = fl_add_text(FL_NORMAL_TEXT, 105, 10, 85, 20, _("Bullet Depth")); @@ -581,7 +581,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL1); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL1); fl_set_button(obj, 1); { char const * const dummy = N_("Maths|#M"); @@ -590,7 +590,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL2); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL2); { char const * const dummy = N_("Ding 2|#i"); fdui->radio_bullet_panel_ding2 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 195, 65, 30, idex(_(dummy))); @@ -598,7 +598,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL3); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL3); { char const * const dummy = N_("Ding 3|#n"); fdui->radio_bullet_panel_ding3 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 225, 65, 30, idex(_(dummy))); @@ -606,7 +606,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL4); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL4); { char const * const dummy = N_("Ding 4|#g"); fdui->radio_bullet_panel_ding4 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 255, 65, 30, idex(_(dummy))); @@ -614,7 +614,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL5); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL5); { char const * const dummy = N_("Ding 1|#D"); fdui->radio_bullet_panel_ding1 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 165, 65, 30, idex(_(dummy))); @@ -622,7 +622,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, C_FormBaseInputCB, BULLETPANEL6); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETPANEL6); fl_end_group(); fl_end_form(); diff --git a/src/frontends/xforms/form_document.h b/src/frontends/xforms/form_document.h index fd85e779ad..96dcfead40 100644 --- a/src/frontends/xforms/form_document.h +++ b/src/frontends/xforms/form_document.h @@ -5,20 +5,20 @@ #define FD_form_tabbed_document_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_error.C b/src/frontends/xforms/form_error.C index 591fa980fd..c29073aa34 100644 --- a/src/frontends/xforms/form_error.C +++ b/src/frontends/xforms/form_error.C @@ -34,7 +34,7 @@ FD_form_error * FormError::build_error() } 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_FormBaseDeprecatedCancelCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_error.h b/src/frontends/xforms/form_error.h index c87a7e2dd5..63521193ef 100644 --- a/src/frontends/xforms/form_error.h +++ b/src/frontends/xforms/form_error.h @@ -5,7 +5,7 @@ #define FD_form_error_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_graphics.C b/src/frontends/xforms/form_graphics.C index f37e4496cf..54d6b8f719 100644 --- a/src/frontends/xforms/form_graphics.C +++ b/src/frontends/xforms/form_graphics.C @@ -34,53 +34,53 @@ FD_form_graphics * FormGraphics::build_graphics() fdui->input_filename = obj = fl_add_input(FL_NORMAL_INPUT, 150, 20, 210, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); { char const * const dummy = N_("Browse|#B"); fdui->button_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 370, 20, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, BROWSE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BROWSE); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 70, 240, 160, _("Width")); fl_set_object_lalign(obj, FL_ALIGN_CENTER); obj = fl_add_text(FL_NORMAL_TEXT, 164, 60, 60, 20, _("Height")); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); fdui->input_width = obj = fl_add_input(FL_NORMAL_INPUT, 32, 190, 108, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->input_height = obj = fl_add_input(FL_NORMAL_INPUT, 152, 190, 96, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 270, 70, 210, 160, _("Display")); fl_set_object_lalign(obj, FL_ALIGN_CENTER); fdui->radio_button_group_width = fl_bgn_group(); // xgettext:no-c-format fdui->radio_width_percent_page = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 140, 80, 30, _("% of Page")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->radio_width_default = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 80, 80, 30, _("Default")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fl_set_button(obj, 1); fdui->radio_width_cm = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 100, 80, 30, _("cm")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->radio_width_inch = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 120, 80, 30, _("Inch")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); // xgettext:no-c-format fdui->radio_width_percent_column = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 160, 96, 30, _("% of Column")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fl_end_group(); fdui->radio_button_group_height = fl_bgn_group(); // xgettext:no-c-format fdui->radio_height_percent_page = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 140, 140, 96, 30, _("% of Page")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->radio_height_inch = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 140, 120, 96, 30, _("Inch")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->radio_height_cm = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 140, 100, 80, 30, _("cm")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->radio_height_default = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 140, 80, 96, 30, _("Default")); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fl_set_button(obj, 1); fl_end_group(); @@ -115,43 +115,43 @@ FD_form_graphics * FormGraphics::build_graphics() fdui->input_rotate_angle = obj = fl_add_input(FL_INT_INPUT, 91, 260, 94, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); { char const * const dummy = N_("Inline Figure|#I"); fdui->check_inline = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 279, 260, 201, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); fdui->input_subcaption = obj = fl_add_input(FL_NORMAL_INPUT, 158, 310, 322, 30, ""); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); { char const * const dummy = N_("Subcaption|#S"); fdui->check_subcaption = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 120, 310, 30, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKINPUT); { char const * const dummy = N_("Update|#U"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 20, 350, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 190, 350, 90, 30, _("Ok")); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 290, 350, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 390, 350, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_graphics.h b/src/frontends/xforms/form_graphics.h index 0b33ef9e0d..1e4701b8ca 100644 --- a/src/frontends/xforms/form_graphics.h +++ b/src/frontends/xforms/form_graphics.h @@ -5,11 +5,11 @@ #define FD_form_graphics_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_include.C b/src/frontends/xforms/form_include.C index 77dffb5684..de4d092878 100644 --- a/src/frontends/xforms/form_include.C +++ b/src/frontends/xforms/form_include.C @@ -32,7 +32,7 @@ FD_form_include * FormInclude::build_include() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Don't typeset|#D"); fdui->check_typeset = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 70, 150, 30, idex(_(dummy))); @@ -41,21 +41,21 @@ FD_form_include * FormInclude::build_include() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 120, 170, 100, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 1); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 1); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 170, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 2); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 2); { char const * const dummy = N_("Load|#L"); fdui->button_load = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 130, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 5); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 5); { char const * const dummy = N_("File name:|#F"); fdui->input_filename = obj = fl_add_input(FL_NORMAL_INPUT, 10, 30, 210, 30, idex(_(dummy))); @@ -77,21 +77,21 @@ FD_form_include * FormInclude::build_include() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 10); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 10); { char const * const dummy = N_("Use input|#i"); fdui->check_useinput = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 100, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 11); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 11); { char const * const dummy = N_("Use include|#U"); fdui->check_useinclude = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 70, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 11); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 11); fl_end_group(); fl_end_form(); diff --git a/src/frontends/xforms/form_include.h b/src/frontends/xforms/form_include.h index f7585b4adf..f72e5b2fbe 100644 --- a/src/frontends/xforms/form_include.h +++ b/src/frontends/xforms/form_include.h @@ -5,9 +5,9 @@ #define FD_form_include_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_index.C b/src/frontends/xforms/form_index.C index a1ff9c7b37..d36be3bcd8 100644 --- a/src/frontends/xforms/form_index.C +++ b/src/frontends/xforms/form_index.C @@ -32,7 +32,7 @@ FD_form_index * FormIndex::build_index() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Restore|#R"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 60, 100, 30, idex(_(dummy))); @@ -40,10 +40,10 @@ FD_form_index * FormIndex::build_index() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 190, 60, 100, 30, _("OK")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 300, 60, 100, 30, idex(_(dummy))); @@ -51,7 +51,7 @@ FD_form_index * FormIndex::build_index() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 60, 100, 30, idex(_(dummy))); @@ -59,7 +59,7 @@ FD_form_index * FormIndex::build_index() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_index.h b/src/frontends/xforms/form_index.h index ef097e092f..09ce209796 100644 --- a/src/frontends/xforms/form_index.h +++ b/src/frontends/xforms/form_index.h @@ -5,11 +5,11 @@ #define FD_form_index_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_paragraph.C b/src/frontends/xforms/form_paragraph.C index 08fb5791a8..4a12307fdb 100644 --- a/src/frontends/xforms/form_paragraph.C +++ b/src/frontends/xforms/form_paragraph.C @@ -44,7 +44,7 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_West, FL_East); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_text(FL_NORMAL_TEXT, 370, 100, 60, 20, _("Indent")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -55,35 +55,35 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Below|#E"); fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 60, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Above|#o"); fdui->check_pagebreaks_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 30, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Below|#l"); fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 60, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("No Indent|#I"); fdui->check_noindent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 120, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->group_radio_alignment = fl_bgn_group(); { @@ -92,36 +92,36 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Left|#f"); fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Block|#c"); fdui->radio_align_block = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 30, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Center|#n"); fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 60, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT, 180, 120, 90, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT, 180, 160, 90, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Above:|#v"); fdui->choice_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 120, 100, 30, idex(_(dummy))); @@ -129,7 +129,7 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Below:|#w"); fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 160, 100, 30, idex(_(dummy))); @@ -137,7 +137,7 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_text(FL_NORMAL_TEXT, 370, 10, 100, 20, _("Pagebreaks")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -160,14 +160,14 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Keep|#p"); fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 160, 40, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -207,7 +207,7 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { // xgettext:no-c-format char const * const dummy = N_("or %|#o"); @@ -215,7 +215,7 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_text(FL_NORMAL_TEXT, 200, 10, 60, 20, _("Width")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -232,21 +232,21 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Middle|#d"); fdui->radio_pextra_middle = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 60, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bottom|#B"); fdui->radio_pextra_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 90, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); { @@ -255,14 +255,14 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Start new Minipage|#S"); fdui->radio_pextra_startmp = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 160, 260, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->group_extraopt = fl_bgn_group(); { @@ -271,21 +271,21 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Minipage|#M"); fdui->radio_pextra_minipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 60, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Floatflt|#F"); fdui->radio_pextra_floatflt = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 90, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); fl_end_form(); @@ -319,24 +319,24 @@ FD_form_tabbed_paragraph * FormParagraph::build_tabbed_paragraph() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 290, 310, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 180, 310, 100, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Restore|#R"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 310, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 280, 490, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); diff --git a/src/frontends/xforms/form_paragraph.h b/src/frontends/xforms/form_paragraph.h index 37b7830c0d..d6f0e31679 100644 --- a/src/frontends/xforms/form_paragraph.h +++ b/src/frontends/xforms/form_paragraph.h @@ -5,14 +5,14 @@ #define FD_form_paragraph_general_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_preamble.C b/src/frontends/xforms/form_preamble.C index 85e301e14b..b8ac189cb3 100644 --- a/src/frontends/xforms/form_preamble.C +++ b/src/frontends/xforms/form_preamble.C @@ -32,7 +32,7 @@ FD_form_preamble * FormPreamble::build_preamble() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 160, 380, 100, 30, idex(_(dummy))); @@ -40,7 +40,7 @@ FD_form_preamble * FormPreamble::build_preamble() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 380, 100, 30, idex(_(dummy))); @@ -48,11 +48,11 @@ FD_form_preamble * FormPreamble::build_preamble() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->input_preamble = obj = fl_add_input(FL_MULTILINE_INPUT, 10, 10, 360, 360, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_preamble.h b/src/frontends/xforms/form_preamble.h index 6e826d0ddb..51607f04a6 100644 --- a/src/frontends/xforms/form_preamble.h +++ b/src/frontends/xforms/form_preamble.h @@ -5,10 +5,10 @@ #define FD_form_preamble_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_preferences.C b/src/frontends/xforms/form_preferences.C index b936d78e07..f78dc671db 100644 --- a/src/frontends/xforms/form_preferences.C +++ b/src/frontends/xforms/form_preferences.C @@ -35,24 +35,24 @@ FD_form_preferences * FormPreferences::build_preferences() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 370, 390, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 170, 390, 90, 30, _("Save")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Restore|#R"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 5, 390, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); obj = fl_add_frame(FL_ENGRAVED_FRAME, 0, 425, 470, 1, ""); fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 5, 430, 460, 70, ""); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -106,13 +106,13 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts() obj = fl_add_box(FL_FLAT_BOX, 0, 0, 455, 375, ""); fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 210, 5, 200, 30, _("Roman")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT, 210, 35, 200, 30, _("Sans Serif")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 210, 65, 200, 30, _("Typewriter")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { // xgettext:no-c-format char const * const dummy = N_("Zoom %|#Z"); @@ -121,7 +121,7 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 999); fl_set_counter_value(obj, 150); @@ -129,29 +129,29 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts() fdui->check_scalable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 60, 143, 33, 31, _("Use scalable fonts")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_RIGHT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->input_screen_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_script = obj = fl_add_input(FL_FLOAT_INPUT, 200, 199, 70, 30, _("script")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_footnote = obj = fl_add_input(FL_FLOAT_INPUT, 340, 198, 70, 30, _("footnote")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_large = obj = fl_add_input(FL_FLOAT_INPUT, 340, 228, 70, 30, _("large")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_largest = obj = fl_add_input(FL_FLOAT_INPUT, 200, 259, 70, 30, _("largest")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_huge = obj = fl_add_input(FL_FLOAT_INPUT, 340, 258, 70, 30, _("huge")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_normal = obj = fl_add_input(FL_FLOAT_INPUT, 200, 229, 70, 30, _("normal")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Screen DPI|#D"); fdui->counter_dpi = obj = fl_add_counter(FL_NORMAL_COUNTER, 310, 160, 100, 30, idex(_(dummy))); @@ -159,23 +159,23 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 999); fl_set_counter_value(obj, 150); fl_set_counter_step(obj, 1, 1); fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 60, 198, 70, 30, _("tiny")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_larger = obj = fl_add_input(FL_FLOAT_INPUT, 60, 258, 70, 30, _("larger")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_small = obj = fl_add_input(FL_FLOAT_INPUT, 60, 228, 70, 30, _("small")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_huger = obj = fl_add_input(FL_FLOAT_INPUT, 60, 288, 70, 30, _("huger")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -207,7 +207,7 @@ FD_form_outputs_misc * FormPreferences::build_outputs_misc() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 120); fl_set_counter_value(obj, 75); @@ -218,7 +218,7 @@ FD_form_outputs_misc * FormPreferences::build_outputs_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Default paper size|#p"); fdui->choice_default_papersize = obj = fl_add_choice(FL_NORMAL_CHOICE, 219, 142, 199, 29, idex(_(dummy))); @@ -226,21 +226,21 @@ FD_form_outputs_misc * FormPreferences::build_outputs_misc() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("ascii roff|#r"); fdui->input_ascii_roff = obj = fl_add_input(FL_NORMAL_INPUT, 121, 209, 285, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("checktex|#c"); fdui->input_checktex = obj = fl_add_input(FL_NORMAL_INPUT, 121, 250, 285, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 12, 186, 406, 120, _("Outside code interaction")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -275,7 +275,7 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use alternative language|#a"); fdui->check_alt_lang = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 100, 30, 30, idex(_(dummy))); @@ -283,9 +283,9 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_alt_lang = obj = fl_add_input(FL_NORMAL_INPUT, 239, 100, 170, 30, ""); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use escape characters|#e"); fdui->check_escape_chars = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 130, 30, 30, idex(_(dummy))); @@ -293,9 +293,9 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_escape_chars = obj = fl_add_input(FL_NORMAL_INPUT, 239, 130, 170, 30, ""); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use personal dictionary|#d"); fdui->check_personal_dict = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 208, 160, 30, 30, idex(_(dummy))); @@ -303,16 +303,16 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_personal_dict = obj = fl_add_input(FL_NORMAL_INPUT, 239, 160, 170, 30, ""); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Browse...|#B"); fdui->button_personal_dict = obj = fl_add_button(FL_NORMAL_BUTTON, 239, 190, 89, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Accept compound words|#w"); fdui->check_compound_words = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 230, 30, 30, idex(_(dummy))); @@ -320,7 +320,7 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_RIGHT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use input encoding|#i"); fdui->check_input_enc = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 130, 260, 30, 30, idex(_(dummy))); @@ -328,7 +328,7 @@ FD_form_spellchecker * FormPreferences::build_spellchecker() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_RIGHT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -358,7 +358,7 @@ FD_form_inputs_misc * FormPreferences::build_inputs_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -388,14 +388,14 @@ FD_form_language * FormPreferences::build_language() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Default language|#l"); fdui->choice_default_lang = obj = fl_add_choice(FL_NORMAL_CHOICE, 231, 56, 200, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Keyboard\nmap|#K"); fdui->check_use_kbmap = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 78, 113, 30, 30, idex(_(dummy))); @@ -403,7 +403,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("RtL support|#R"); fdui->check_rtl_support = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 140, 161, 30, 30, idex(_(dummy))); @@ -411,7 +411,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Mark foreign|#M"); fdui->check_mark_foreign = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 140, 187, 30, 30, idex(_(dummy))); @@ -419,7 +419,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Auto begin|#b"); fdui->check_auto_begin = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 265, 161, 30, 30, idex(_(dummy))); @@ -427,7 +427,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Auto finish|#f"); fdui->check_auto_end = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 265, 187, 30, 30, idex(_(dummy))); @@ -435,39 +435,39 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Command start|#s"); fdui->input_command_begin = obj = fl_add_input(FL_NORMAL_INPUT, 131, 224, 300, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Command end|#e"); fdui->input_command_end = obj = fl_add_input(FL_NORMAL_INPUT, 131, 257, 300, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("1st|#1"); fdui->input_kbmap1 = obj = fl_add_input(FL_NORMAL_INPUT, 144, 97, 195, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("2nd|#2"); fdui->input_kbmap2 = obj = fl_add_input(FL_NORMAL_INPUT, 144, 129, 195, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_kbmap1_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 341, 99, 90, 30, _("Browse")); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_kbmap2_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 341, 128, 90, 30, _("Browse")); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use babel|#U"); fdui->check_use_babel = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 390, 161, 30, 30, idex(_(dummy))); @@ -475,7 +475,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Global|#G"); fdui->check_global_options = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 390, 187, 30, 30, idex(_(dummy))); @@ -483,7 +483,7 @@ FD_form_language * FormPreferences::build_language() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -517,14 +517,14 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Modify|#M"); fdui->button_modify = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 285, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("S|#S"); fdui->slider_saturation = obj = fl_add_slider(FL_HOR_NICE_SLIDER, 251, 135, 150, 30, idex(_(dummy))); @@ -532,7 +532,7 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_slider_size(obj, 0.15); { char const * const dummy = N_("V|#V"); @@ -541,7 +541,7 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_slider_size(obj, 0.15); { char const * const dummy = N_("H|#H"); @@ -549,7 +549,7 @@ FD_form_colors * FormPreferences::build_colors() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lalign(obj, FL_ALIGN_CENTER); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("R|#R"); fdui->slider_red = obj = fl_add_slider(FL_VERT_FILL_SLIDER, 250, 25, 40, 180, idex(_(dummy))); @@ -557,7 +557,7 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_color(obj, FL_COL1, FL_RED); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_slider_size(obj, 0.15); { char const * const dummy = N_("B|#B"); @@ -566,7 +566,7 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_color(obj, FL_COL1, FL_BLUE); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_slider_size(obj, 0.15); { char const * const dummy = N_("G|#G"); @@ -575,11 +575,11 @@ FD_form_colors * FormPreferences::build_colors() } fl_set_object_color(obj, FL_COL1, FL_GREEN); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_slider_size(obj, 0.15); fdui->button_colorspace = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 310, 219, 30, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->text_color_values = obj = fl_add_text(FL_NORMAL_TEXT, 250, 250, 150, 30, ""); fl_set_object_boxtype(obj, FL_DOWN_BOX); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); @@ -613,49 +613,49 @@ FD_form_converters * FormPreferences::build_converters() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Delete|#D"); fdui->button_delete = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 270, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Add|#A"); fdui->button_add = obj = fl_add_button(FL_NORMAL_BUTTON, 240, 270, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Converter|#C"); fdui->input_converter = obj = fl_add_input(FL_NORMAL_INPUT, 280, 110, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("From|#F"); fdui->choice_from = obj = fl_add_choice(FL_NORMAL_CHOICE, 280, 30, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("To|#T"); fdui->choice_to = obj = fl_add_choice(FL_NORMAL_CHOICE, 280, 70, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Flags|#F"); fdui->input_flags = obj = fl_add_input(FL_NORMAL_INPUT, 280, 150, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -686,56 +686,56 @@ FD_form_formats * FormPreferences::build_formats() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Format|#F"); fdui->input_format = obj = fl_add_input(FL_NORMAL_INPUT, 280, 30, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("GUI name|#G"); fdui->input_gui_name = obj = fl_add_input(FL_NORMAL_INPUT, 280, 70, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Delete|#D"); fdui->button_delete = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 270, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Add|#A"); fdui->button_add = obj = fl_add_button(FL_NORMAL_BUTTON, 240, 270, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Extension|#E"); fdui->input_extension = obj = fl_add_input(FL_NORMAL_INPUT, 280, 150, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Viewer|#V"); fdui->input_viewer = obj = fl_add_input(FL_NORMAL_INPUT, 280, 190, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Shortcut|#S"); fdui->input_shrtcut = obj = fl_add_input(FL_NORMAL_INPUT, 280, 110, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; @@ -765,7 +765,7 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); { char const * const dummy = N_("Auto region delete|#A"); @@ -773,7 +773,7 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); { char const * const dummy = N_("Exit confirmation|#E"); @@ -781,16 +781,16 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->check_display_shrtcuts = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 105, 30, 30, _("Display keyboard shortcuts")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->counter_autosave = obj = fl_add_counter(FL_NORMAL_COUNTER, 320, 255, 115, 30, _("Autosave interval")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 1200); fl_set_counter_value(obj, 300); @@ -801,7 +801,7 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); { char const * const dummy = N_("Cursor follows scrollbar|#C"); @@ -809,12 +809,12 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->counter_wm_jump = obj = fl_add_counter(FL_NORMAL_COUNTER, 320, 225, 115, 30, _("Wheel mouse jump")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 250); fl_set_counter_value(obj, 100); @@ -844,40 +844,40 @@ FD_form_interface * FormPreferences::build_interface() obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 350, ""); fdui->input_popup_font = obj = fl_add_input(FL_NORMAL_INPUT, 230, 30, 200, 30, _("Popup Font")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_menu_font = obj = fl_add_input(FL_NORMAL_INPUT, 230, 60, 200, 30, _("Menu Font")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_popup_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 230, 90, 200, 30, _("Popup Encoding")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bind file|#B"); fdui->input_bind_file = obj = fl_add_input(FL_NORMAL_INPUT, 160, 178, 190, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_bind_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 178, 80, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("User Interface file|#U"); fdui->input_ui_file = obj = fl_add_input(FL_NORMAL_INPUT, 160, 148, 190, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_ui_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 148, 80, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Override X-Windows dead-keys|#O"); fdui->check_override_x_dead_keys = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 24, 230, 30, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fl_end_form(); @@ -904,58 +904,58 @@ FD_form_printer * FormPreferences::build_printer() obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 350, ""); fdui->input_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 75, 80, 30, _("command")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_page_range = obj = fl_add_input(FL_NORMAL_INPUT, 130, 105, 80, 30, _("page range")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_copies = obj = fl_add_input(FL_NORMAL_INPUT, 130, 135, 80, 30, _("copies")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_reverse = obj = fl_add_input(FL_NORMAL_INPUT, 130, 165, 80, 30, _("reverse")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_to_printer = obj = fl_add_input(FL_NORMAL_INPUT, 130, 195, 80, 30, _("to printer")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_file_extension = obj = fl_add_input(FL_NORMAL_INPUT, 130, 225, 80, 30, _("file extension")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_spool_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 255, 80, 30, _("spool command")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_paper_type = obj = fl_add_input(FL_NORMAL_INPUT, 130, 285, 80, 30, _("paper type")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_even_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 75, 80, 30, _("even pages")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_odd_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 105, 80, 30, _("odd pages")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_collated = obj = fl_add_input(FL_NORMAL_INPUT, 360, 135, 80, 30, _("collated")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_landscape = obj = fl_add_input(FL_NORMAL_INPUT, 360, 165, 80, 30, _("landscape")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_to_file = obj = fl_add_input(FL_NORMAL_INPUT, 360, 195, 80, 30, _("to file")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_extra_options = obj = fl_add_input(FL_NORMAL_INPUT, 360, 225, 80, 30, _("extra options")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_spool_prefix = obj = fl_add_input(FL_NORMAL_INPUT, 360, 255, 80, 30, _("spool printer prefix")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_paper_size = obj = fl_add_input(FL_NORMAL_INPUT, 360, 285, 80, 30, _("paper size")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_name = obj = fl_add_input(FL_NORMAL_INPUT, 130, 10, 80, 30, _("name")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->check_adapt_output = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 240, 10, 30, 30, _("adapt output")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 0, 60, 452, 260, _("Printer Command and Flags")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_end_form(); @@ -987,10 +987,10 @@ FD_form_paths * FormPreferences::build_paths() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_default_path_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 10, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Last file count|#L"); fdui->counter_lastfiles = obj = fl_add_counter(FL_SIMPLE_COUNTER, 170, 130, 90, 30, idex(_(dummy))); @@ -998,7 +998,7 @@ FD_form_paths * FormPreferences::build_paths() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_counter_precision(obj, 0); fl_set_counter_bounds(obj, 0, 9); fl_set_counter_value(obj, 4); @@ -1009,10 +1009,10 @@ FD_form_paths * FormPreferences::build_paths() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_template_path_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 40, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Check last files|#C"); fdui->check_last_files = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 100, 30, 30, idex(_(dummy))); @@ -1020,17 +1020,17 @@ FD_form_paths * FormPreferences::build_paths() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->button_temp_dir_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 70, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_lastfiles = obj = fl_add_input(FL_NORMAL_INPUT, 170, 100, 170, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_lastfiles_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 100, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Backup path|#B"); fdui->check_make_backups = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 170, 30, 30, idex(_(dummy))); @@ -1038,27 +1038,27 @@ FD_form_paths * FormPreferences::build_paths() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fdui->input_backup_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 170, 170, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_backup_path_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 170, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("LyXServer pipe|#S"); fdui->input_serverpipe = obj = fl_add_input(FL_NORMAL_INPUT, 169, 217, 170, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->button_serverpipe_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 339, 217, 90, 30, _("Browse...")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_temp_dir = obj = fl_add_input(FL_NORMAL_INPUT, 170, 70, 170, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Temp dir|#d"); fdui->check_use_temp_dir = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 134, 70, 30, 30, idex(_(dummy))); @@ -1066,7 +1066,7 @@ FD_form_paths * FormPreferences::build_paths() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_set_button(obj, 1); fl_end_form(); diff --git a/src/frontends/xforms/form_preferences.h b/src/frontends/xforms/form_preferences.h index 6bab3f4c18..54da663ac9 100644 --- a/src/frontends/xforms/form_preferences.h +++ b/src/frontends/xforms/form_preferences.h @@ -5,35 +5,35 @@ #define FD_form_preferences_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_print.C b/src/frontends/xforms/form_print.C index b09ddd223d..be29a6d22b 100644 --- a/src/frontends/xforms/form_print.C +++ b/src/frontends/xforms/form_print.C @@ -27,10 +27,10 @@ FD_form_print * FormPrint::build_print() obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 390, ""); fdui->input_printer = obj = fl_add_input(FL_NORMAL_INPUT, 90, 225, 230, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_file = obj = fl_add_input(FL_NORMAL_INPUT, 90, 265, 230, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->group_radio_printto = fl_bgn_group(); { @@ -39,33 +39,33 @@ FD_form_print * FormPrint::build_print() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("File|#F"); fdui->radio_file = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 265, 80, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 350, 100, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 120, 350, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 350, 100, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->group_radio_pages = fl_bgn_group(); { @@ -74,21 +74,21 @@ FD_form_print * FormPrint::build_print() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Only Odd Pages|#O"); fdui->radio_odd_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Only Even Pages|#E"); fdui->radio_even_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 90, 160, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); @@ -99,33 +99,33 @@ FD_form_print * FormPrint::build_print() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Reverse Order|#R"); fdui->radio_order_reverse = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 180, 60, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_group(); fdui->input_from_page = obj = fl_add_input(FL_INT_INPUT, 20, 160, 50, 30, _("Pages:")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_count = obj = fl_add_input(FL_INT_INPUT, 190, 160, 130, 30, _("Count:")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Collated|#C"); fdui->radio_collated = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 115, 140, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fdui->input_to_page = obj = fl_add_input(FL_INT_INPUT, 110, 160, 50, 30, _("to")); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 20, 160, 180, _("Print")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -144,7 +144,7 @@ FD_form_print * FormPrint::build_print() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_print.h b/src/frontends/xforms/form_print.h index eda70ba0d4..fc38503e0e 100644 --- a/src/frontends/xforms/form_print.h +++ b/src/frontends/xforms/form_print.h @@ -5,10 +5,10 @@ #define FD_form_print_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_ref.C b/src/frontends/xforms/form_ref.C index 6c950cd066..651284a1c4 100644 --- a/src/frontends/xforms/form_ref.C +++ b/src/frontends/xforms/form_ref.C @@ -28,14 +28,14 @@ FD_form_ref * FormRef::build_ref() fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 240, ""); fl_set_object_lalign(obj, FL_ALIGN_TOP); fl_set_object_gravity(obj, FL_NorthWest, FL_South); - fl_set_object_callback(obj, C_FormBaseInputCB, 2); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 2); { char const * const dummy = N_("Update|#U"); fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 260, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); - fl_set_object_callback(obj, C_FormBaseInputCB, 3); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 3); { char const * const dummy = N_("Sort|#S"); fdui->sort = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 170, 260, 30, 30, idex(_(dummy))); @@ -43,7 +43,7 @@ FD_form_ref * FormRef::build_ref() } fl_set_object_lalign(obj, FL_ALIGN_RIGHT); fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); - fl_set_object_callback(obj, C_FormBaseInputCB, 4); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 4); { char const * const dummy = N_("Name:|#N"); fdui->name = obj = fl_add_input(FL_NORMAL_INPUT, 370, 10, 150, 40, idex(_(dummy))); @@ -60,38 +60,38 @@ FD_form_ref * FormRef::build_ref() 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_FormBaseInputCB, 5); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 5); { char const * const dummy = N_("Goto reference|#G"); fdui->button_go = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 140, 40, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 1); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 1); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 300, 90, 30, _("OK")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 300, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Restore|#R"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 300, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_ref.h b/src/frontends/xforms/form_ref.h index e37f57ff18..2ebce3212d 100644 --- a/src/frontends/xforms/form_ref.h +++ b/src/frontends/xforms/form_ref.h @@ -5,11 +5,11 @@ #define FD_form_ref_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_search.C b/src/frontends/xforms/form_search.C index 00bd8ba0ab..fa28b3bc9d 100644 --- a/src/frontends/xforms/form_search.C +++ b/src/frontends/xforms/form_search.C @@ -35,7 +35,7 @@ FD_form_search * FormSearch::build_search() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Replace with|#W"); fdui->input_replace = obj = fl_add_input(FL_NORMAL_INPUT, 110, 40, 180, 30, idex(_(dummy))); @@ -44,7 +44,7 @@ FD_form_search * FormSearch::build_search() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_(" >|#F^s"); fdui->findnext = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 80, 90, 30, idex(_(dummy))); @@ -52,7 +52,7 @@ FD_form_search * FormSearch::build_search() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_(" <|#B^r"); fdui->findprev = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 80, 90, 30, idex(_(dummy))); @@ -60,7 +60,7 @@ FD_form_search * FormSearch::build_search() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Replace|#R#r"); fdui->replace = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 120, 90, 30, idex(_(dummy))); @@ -68,7 +68,7 @@ FD_form_search * FormSearch::build_search() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Close|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 120, 80, 30, idex(_(dummy))); @@ -76,21 +76,21 @@ FD_form_search * FormSearch::build_search() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); { char const * const dummy = N_("Case sensitive|#s#S"); fdui->casesensitive = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 20, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Match word|#M#m"); fdui->matchword = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 50, 150, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Replace All|#A#a"); fdui->replaceall = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 120, 90, 30, idex(_(dummy))); @@ -98,7 +98,7 @@ FD_form_search * FormSearch::build_search() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_search.h b/src/frontends/xforms/form_search.h index 4147005583..c9ac9ecf8b 100644 --- a/src/frontends/xforms/form_search.h +++ b/src/frontends/xforms/form_search.h @@ -5,8 +5,8 @@ #define FD_form_search_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_tabular.C b/src/frontends/xforms/form_tabular.C index d6b674ecd7..7111cbb6a9 100644 --- a/src/frontends/xforms/form_tabular.C +++ b/src/frontends/xforms/form_tabular.C @@ -33,7 +33,7 @@ FD_form_tabular * FormTabular::build_tabular() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->input_tabular_column = obj = fl_add_input(FL_NORMAL_INPUT, 65, 260, 60, 30, ""); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); @@ -73,54 +73,54 @@ FD_form_tabular_options * FormTabular::build_tabular_options() fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Delete Column|#O"); fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 40, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Append Row|#p"); fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 70, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Delete Row|#w"); fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 70, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Set Borders|#S"); fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 10, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Unset Borders|#U"); fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 10, 120, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Longtable|#L"); fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 30, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Rotate 90°|#9"); fdui->radio_rotate_tabular = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 55, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 280, 20, 120, 75, _("Spec. Table")); fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_end_form(); @@ -153,7 +153,7 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bottom|#b"); fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 75, 25, 25, idex(_(dummy))); @@ -161,7 +161,7 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Left|#l"); fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 65, 60, 25, 25, idex(_(dummy))); @@ -169,7 +169,7 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Right|#r"); fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 105, 60, 25, 25, idex(_(dummy))); @@ -177,49 +177,49 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_RIGHT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Left|#e"); fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 30, 110, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Right|#i"); fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 80, 115, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Center|#c"); fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 55, 115, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Top|#p"); fdui->radio_valign_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 30, 125, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Center|#n"); fdui->radio_valign_center = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 55, 125, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bottom|#o"); fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 80, 120, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 20, 170, 105, _("Borders")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -236,7 +236,7 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Alignment|#A"); fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 85, 170, 215, 30, idex(_(dummy))); @@ -244,7 +244,7 @@ FD_form_column_options * FormTabular::build_column_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 135, 450, 80, _("Special column")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP); @@ -279,7 +279,7 @@ FD_form_cell_options * FormTabular::build_cell_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bottom|#b"); fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 75, 25, 25, idex(_(dummy))); @@ -287,7 +287,7 @@ FD_form_cell_options * FormTabular::build_cell_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Left|#l"); fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 65, 60, 25, 25, idex(_(dummy))); @@ -295,7 +295,7 @@ FD_form_cell_options * FormTabular::build_cell_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Right|#r"); fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 105, 60, 25, 25, idex(_(dummy))); @@ -303,49 +303,49 @@ FD_form_cell_options * FormTabular::build_cell_options() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_RIGHT); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Left|#e"); fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 30, 110, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Right|#i"); fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 80, 115, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Center|#c"); fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 55, 115, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Top|#p"); fdui->radio_valign_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 30, 125, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Center|#n"); fdui->radio_valign_center = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 55, 125, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Bottom|#o"); fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 80, 120, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 20, 170, 105, _("Borders")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -360,31 +360,31 @@ FD_form_cell_options * FormTabular::build_cell_options() fdui->input_mcolumn_width = obj = fl_add_input(FL_NORMAL_INPUT, 280, 180, 175, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Alignment|#A"); fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 280, 145, 175, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Multicolumn|#M"); fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 140, 130, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Use Minipage|#s"); fdui->radio_useminipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 165, 130, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Rotate 90°|#9"); fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 190, 130, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 135, 150, 80, _("Special Cell")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -419,31 +419,31 @@ FD_form_longtable_options * FormTabular::build_longtable_options() fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 55, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Head|#H"); fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 30, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Foot|#F"); fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 195, 30, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Last Foot|#L"); fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 195, 55, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("New Page|#N"); fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 355, 25, 90, 25, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 20, 150, 75, _("Header")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); diff --git a/src/frontends/xforms/form_tabular.h b/src/frontends/xforms/form_tabular.h index d8e25ee9a5..24be20b707 100644 --- a/src/frontends/xforms/form_tabular.h +++ b/src/frontends/xforms/form_tabular.h @@ -5,15 +5,15 @@ #define FD_form_tabular_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_tabular_create.C b/src/frontends/xforms/form_tabular_create.C index 80d46292c0..1579272f6c 100644 --- a/src/frontends/xforms/form_tabular_create.C +++ b/src/frontends/xforms/form_tabular_create.C @@ -27,21 +27,21 @@ FD_form_tabular_create * FormTabularCreate::build_tabular_create() obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, ""); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_(dummy))); fl_set_button_shortcut(obj, scex(_(dummy)), 1); } fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_LEFT); diff --git a/src/frontends/xforms/form_tabular_create.h b/src/frontends/xforms/form_tabular_create.h index 677c9ac1f2..ae2f48faef 100644 --- a/src/frontends/xforms/form_tabular_create.h +++ b/src/frontends/xforms/form_tabular_create.h @@ -5,9 +5,9 @@ #define FD_form_tabular_create_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_toc.C b/src/frontends/xforms/form_toc.C index 46538a0e38..61869625b5 100644 --- a/src/frontends/xforms/form_toc.C +++ b/src/frontends/xforms/form_toc.C @@ -27,7 +27,7 @@ FD_form_toc * FormToc::build_toc() obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 340, ""); fdui->browser_toc = 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_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Update|#U"); fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 300, 100, 30, idex(_(dummy))); @@ -35,7 +35,7 @@ FD_form_toc * FormToc::build_toc() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Type|#T"); fdui->choice_toc_type = obj = fl_add_choice(FL_NORMAL_CHOICE, 60, 300, 130, 30, idex(_(dummy))); @@ -43,7 +43,7 @@ FD_form_toc * FormToc::build_toc() } fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Close|^[^M"); fdui->button_cancel = obj = fl_add_button(FL_RETURN_BUTTON, 310, 300, 100, 30, idex(_(dummy))); @@ -51,7 +51,7 @@ FD_form_toc * FormToc::build_toc() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_toc.h b/src/frontends/xforms/form_toc.h index 38556cf0b2..0e0780902a 100644 --- a/src/frontends/xforms/form_toc.h +++ b/src/frontends/xforms/form_toc.h @@ -5,8 +5,8 @@ #define FD_form_toc_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/form_url.C b/src/frontends/xforms/form_url.C index 4d5e4b002e..c91a362d24 100644 --- a/src/frontends/xforms/form_url.C +++ b/src/frontends/xforms/form_url.C @@ -33,7 +33,7 @@ FD_form_url * FormUrl::build_url() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Name|#N"); fdui->name = obj = fl_add_input(FL_NORMAL_INPUT, 70, 90, 440, 30, idex(_(dummy))); @@ -42,7 +42,7 @@ FD_form_url * FormUrl::build_url() fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("HTML type|#H"); fdui->radio_html = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 480, 10, 30, 30, idex(_(dummy))); @@ -52,7 +52,7 @@ FD_form_url * FormUrl::build_url() fl_set_object_lalign(obj, FL_ALIGN_LEFT); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); { char const * const dummy = N_("Cancel|^["); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 130, 100, 30, idex(_(dummy))); @@ -60,10 +60,10 @@ FD_form_url * FormUrl::build_url() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 190, 130, 100, 30, _("OK")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseOKCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); { char const * const dummy = N_("Apply|#A"); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 300, 130, 100, 30, idex(_(dummy))); @@ -71,7 +71,7 @@ FD_form_url * FormUrl::build_url() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseApplyCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); { char const * const dummy = N_("Restore|#R"); fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 130, 100, 30, idex(_(dummy))); @@ -79,7 +79,7 @@ FD_form_url * FormUrl::build_url() } fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, C_FormBaseRestoreCB, 0); + fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_url.h b/src/frontends/xforms/form_url.h index 79bb426856..b6221726eb 100644 --- a/src/frontends/xforms/form_url.h +++ b/src/frontends/xforms/form_url.h @@ -5,11 +5,11 @@ #define FD_form_url_h_ /** Callbacks, globals and object handlers **/ -extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); -extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); -extern "C" void C_FormBaseOKCB(FL_OBJECT *, long); -extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long); -extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); /**** Forms and Objects ****/ diff --git a/src/frontends/xforms/forms/form_bibtex.fd b/src/frontends/xforms/forms/form_bibtex.fd index 65693be144..ad0a54b41d 100644 --- a/src/frontends/xforms/forms/form_bibtex.fd +++ b/src/frontends/xforms/forms/form_bibtex.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: database -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -63,7 +63,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 3 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 2 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: style -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_browser.fd b/src/frontends/xforms/forms/form_browser.fd index 2a7071f89a..9a565286a6 100644 --- a/src/frontends/xforms/forms/form_browser.fd +++ b/src/frontends/xforms/forms/form_browser.fd @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_close -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_update -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_character.fd b/src/frontends/xforms/forms/form_character.fd index fbc4bc394c..25ce74c285 100644 --- a/src/frontends/xforms/forms/form_character.fd +++ b/src/frontends/xforms/forms/form_character.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_family -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_series -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -100,7 +100,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_shape -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -118,7 +118,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_size -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -136,7 +136,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_bar -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -154,7 +154,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -172,7 +172,7 @@ shortcut: ^M resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_close -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -190,7 +190,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_color -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -208,7 +208,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: check_toggle_all -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -226,7 +226,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: choice_language -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- diff --git a/src/frontends/xforms/forms/form_citation.fd b/src/frontends/xforms/forms/form_citation.fd index e322032589..a373942bf0 100644 --- a/src/frontends/xforms/forms/form_citation.fd +++ b/src/frontends/xforms/forms/form_citation.fd @@ -8,14 +8,14 @@ Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: form_citation -Width: 435 -Height: 665 -Number of Objects: 15 +Width: 430 +Height: 830 +Number of Objects: 20 -------------------- class: FL_BOX type: UP_BOX -box: 0 0 435 665 +box: 0 0 430 830 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -141,7 +141,7 @@ argument: 0 -------------------- class: FL_BROWSER type: NORMAL_BROWSER -box: 10 360 410 80 +box: 10 360 410 95 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_TOP_LEFT @@ -156,10 +156,100 @@ name: browser_info callback: argument: +-------------------- +class: FL_LABELFRAME +type: ENGRAVED_FRAME +box: 10 475 410 125 +boxtype: FL_NO_BOX +colors: FL_BLACK FL_COL1 +alignment: FL_ALIGN_TOP_LEFT +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Search +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthWest FL_SouthEast +name: frame_search +callback: +argument: + +-------------------- +class: FL_INPUT +type: NORMAL_INPUT +box: 25 490 380 30 +boxtype: FL_DOWN_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_TOP +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthWest FL_SouthEast +name: input_search +callback: +argument: + +-------------------- +class: FL_BUTTON +type: PUSH_BUTTON +box: 25 525 90 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Simple +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthWest FL_SouthWest +name: button_search_type +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 315 525 90 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Previous|#P +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthEast FL_SouthEast +name: button_previous +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 315 560 90 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Next|#N +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthEast FL_SouthEast +name: button_next +callback: C_FormBaseInputCB +argument: 0 + -------------------- class: FL_CHOICE type: NORMAL_CHOICE -box: 160 470 130 30 +box: 160 630 130 30 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT @@ -177,7 +267,7 @@ argument: 0 -------------------- class: FL_INPUT type: NORMAL_INPUT -box: 100 520 250 30 +box: 100 680 250 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT @@ -195,7 +285,7 @@ argument: 0 -------------------- class: FL_INPUT type: NORMAL_INPUT -box: 100 570 250 30 +box: 100 730 250 30 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT @@ -213,7 +303,7 @@ argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 10 630 90 30 +box: 10 790 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -231,7 +321,7 @@ argument: 0 -------------------- class: FL_BUTTON type: RETURN_BUTTON -box: 130 630 90 30 +box: 130 790 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -249,7 +339,7 @@ argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 230 630 90 30 +box: 230 790 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -267,7 +357,7 @@ argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 330 630 90 30 +box: 330 790 90 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER diff --git a/src/frontends/xforms/forms/form_copyright.fd b/src/frontends/xforms/forms/form_copyright.fd index cc16d01bd3..1c4297503c 100644 --- a/src/frontends/xforms/forms/form_copyright.fd +++ b/src/frontends/xforms/forms/form_copyright.fd @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_South FL_South name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_credits.fd b/src/frontends/xforms/forms/form_credits.fd index 56bce85c7d..6f489eecc3 100644 --- a/src/frontends/xforms/forms/form_credits.fd +++ b/src/frontends/xforms/forms/form_credits.fd @@ -45,7 +45,7 @@ shortcut: ^M resize: FL_RESIZE_NONE gravity: FL_South FL_South name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- diff --git a/src/frontends/xforms/forms/form_document.C.patch b/src/frontends/xforms/forms/form_document.C.patch index 6f94594c23..e94e73bbab 100644 --- a/src/frontends/xforms/forms/form_document.C.patch +++ b/src/frontends/xforms/forms/form_document.C.patch @@ -20,7 +20,7 @@ - fl_set_pixmapbutton_file(obj, _("/nfs/sinco/source/lyx/lyx-devel/lib/images/psnfss2.xpm")); + fl_set_border_width(-3); + fdui->bmtable_bullet_panel = obj = fl_add_bmtable(1, 90, 105, 265, 180, ""); -+ fl_set_object_callback(obj, C_FormBaseInputCB, BULLETBMTABLE); ++ fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, BULLETBMTABLE); + fl_set_object_lcol(obj, FL_BLUE); + fl_set_object_boxtype(obj, FL_UP_BOX); + fl_set_bmtable_pixmap_file(obj, 6, 6, diff --git a/src/frontends/xforms/forms/form_document.fd b/src/frontends/xforms/forms/form_document.fd index b8bb057c0c..36671eab72 100644 --- a/src/frontends/xforms/forms/form_document.fd +++ b/src/frontends/xforms/forms/form_document.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: INPUT -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: INPUT -------------------- @@ -100,7 +100,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: INPUT -------------------- @@ -136,7 +136,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: INPUT =============== FORM =============== @@ -196,7 +196,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_paperpackage -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -376,7 +376,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_portrait -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -394,7 +394,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_landscape -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -430,7 +430,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_papersize2 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -466,7 +466,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: push_use_geometry -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -484,7 +484,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_custom_width -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -502,7 +502,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_custom_height -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -520,7 +520,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_top_margin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -538,7 +538,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_bottom_margin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -556,7 +556,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_left_margin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -574,7 +574,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_right_margin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -592,7 +592,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_head_height -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -610,7 +610,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_head_sep -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -628,7 +628,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_foot_skip -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -742,7 +742,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fonts -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -760,7 +760,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fontsize -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -778,7 +778,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_class -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKCHOICECLASS -------------------- @@ -796,7 +796,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_pagestyle -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -814,7 +814,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_spacing -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -832,7 +832,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_extra -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -850,7 +850,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_skip -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -868,7 +868,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_skip -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -904,7 +904,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_one -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -922,7 +922,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_two -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -976,7 +976,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_one -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -994,7 +994,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_two -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1048,7 +1048,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_indent -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1066,7 +1066,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_skip -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT value: 1 @@ -1103,7 +1103,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_spacing -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT =============== FORM =============== @@ -1163,7 +1163,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_inputenc -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1181,7 +1181,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_quotes_language -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1217,7 +1217,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_single -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1235,7 +1235,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_double -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1271,7 +1271,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_language -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT =============== FORM =============== @@ -1313,7 +1313,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_float_placement -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1331,7 +1331,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_secnumdepth -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1349,7 +1349,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_tocdepth -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1367,7 +1367,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_postscript_driver -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT -------------------- @@ -1385,7 +1385,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_amsmath -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUT =============== FORM =============== @@ -1465,7 +1465,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_bullet_size -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHOICEBULLETSIZE -------------------- @@ -1483,7 +1483,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_bullet_latex -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: INPUTBULLETLATEX -------------------- @@ -1519,7 +1519,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_1 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETDEPTH1 value: 1 @@ -1538,7 +1538,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_2 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETDEPTH2 -------------------- @@ -1556,7 +1556,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_3 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETDEPTH3 -------------------- @@ -1574,7 +1574,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_4 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETDEPTH4 -------------------- @@ -1646,7 +1646,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_standard -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL1 value: 1 @@ -1665,7 +1665,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_maths -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL2 -------------------- @@ -1683,7 +1683,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding2 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL3 -------------------- @@ -1701,7 +1701,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding3 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL4 -------------------- @@ -1719,7 +1719,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding4 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL5 -------------------- @@ -1737,7 +1737,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding1 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BULLETPANEL6 -------------------- diff --git a/src/frontends/xforms/forms/form_error.fd b/src/frontends/xforms/forms/form_error.fd index e60d43106e..b0af973d9e 100644 --- a/src/frontends/xforms/forms/form_error.fd +++ b/src/frontends/xforms/forms/form_error.fd @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_South FL_South name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_graphics.fd b/src/frontends/xforms/forms/form_graphics.fd index aa6609a3be..68e22412c1 100644 --- a/src/frontends/xforms/forms/form_graphics.fd +++ b/src/frontends/xforms/forms/form_graphics.fd @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_filename -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: BROWSE -------------------- @@ -153,7 +153,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_width -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -171,7 +171,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_height -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -225,7 +225,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_width_percent_page -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -243,7 +243,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_width_default -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT value: 1 @@ -262,7 +262,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_width_cm -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -280,7 +280,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_width_inch -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -298,7 +298,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_width_percent_column -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -352,7 +352,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_height_percent_page -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -370,7 +370,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_height_inch -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -388,7 +388,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_height_cm -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -406,7 +406,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_height_default -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT value: 1 @@ -570,7 +570,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_rotate_angle -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -588,7 +588,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_inline -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -606,7 +606,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_subcaption -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -624,7 +624,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_subcaption -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: CHECKINPUT -------------------- @@ -642,7 +642,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_SouthWest name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 -------------------- @@ -660,7 +660,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -678,7 +678,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -696,7 +696,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_include.fd b/src/frontends/xforms/forms/form_include.fd index 540fb9a1b6..2d2f7ddff4 100644 --- a/src/frontends/xforms/forms/form_include.fd +++ b/src/frontends/xforms/forms/form_include.fd @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 1 -------------------- @@ -117,7 +117,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 2 -------------------- @@ -135,7 +135,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_load -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 5 -------------------- @@ -207,7 +207,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_verbatim -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 10 -------------------- @@ -225,7 +225,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_useinput -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 11 -------------------- @@ -243,7 +243,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_useinclude -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 11 -------------------- diff --git a/src/frontends/xforms/forms/form_index.fd b/src/frontends/xforms/forms/form_index.fd index 4b32d17eac..82489344a9 100644 --- a/src/frontends/xforms/forms/form_index.fd +++ b/src/frontends/xforms/forms/form_index.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NoGravity FL_NoGravity name: input_key -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_SouthWest name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 -------------------- @@ -81,7 +81,7 @@ shortcut: ^M resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -117,7 +117,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_paragraph.fd b/src/frontends/xforms/forms/form_paragraph.fd index 6e692984c1..96f882e31b 100644 --- a/src/frontends/xforms/forms/form_paragraph.fd +++ b/src/frontends/xforms/forms/form_paragraph.fd @@ -135,7 +135,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_West FL_East name: input_labelwidth -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -171,7 +171,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_lines_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -189,7 +189,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_lines_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -207,7 +207,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_pagebreaks_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -225,7 +225,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_pagebreaks_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -243,7 +243,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_noindent -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -279,7 +279,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_right -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -297,7 +297,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_left -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -315,7 +315,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_block -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -333,7 +333,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_center -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -369,7 +369,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_space_above -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -387,7 +387,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_space_below -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -405,7 +405,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_space_above -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -423,7 +423,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_space_below -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -513,7 +513,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_space_above -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -531,7 +531,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_space_below -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -645,7 +645,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_pextra_width -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -663,7 +663,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_pextra_widthp -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -735,7 +735,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -753,7 +753,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_middle -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -771,7 +771,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -807,7 +807,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_hfill -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -825,7 +825,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_startmp -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -861,7 +861,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_indent -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -879,7 +879,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_minipage -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -897,7 +897,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_pextra_floatflt -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -975,7 +975,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -993,7 +993,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -1011,7 +1011,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -1029,7 +1029,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 -------------------- diff --git a/src/frontends/xforms/forms/form_preamble.fd b/src/frontends/xforms/forms/form_preamble.fd index 65b17ed7ed..e464e35fe1 100644 --- a/src/frontends/xforms/forms/form_preamble.fd +++ b/src/frontends/xforms/forms/form_preamble.fd @@ -46,7 +46,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -100,7 +100,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: input_preamble -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: ============================== diff --git a/src/frontends/xforms/forms/form_preferences.fd b/src/frontends/xforms/forms/form_preferences.fd index 3e84690f7b..06df621d42 100644 --- a/src/frontends/xforms/forms/form_preferences.fd +++ b/src/frontends/xforms/forms/form_preferences.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -100,7 +100,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -118,7 +118,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 -------------------- @@ -238,7 +238,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_roman -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -256,7 +256,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_sans -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -274,7 +274,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_typewriter -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -292,7 +292,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_zoom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 999 precision: 0 @@ -314,7 +314,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_scalable -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -333,7 +333,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_screen_encoding -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -351,7 +351,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_script -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -369,7 +369,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_footnote -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -387,7 +387,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_large -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -405,7 +405,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_largest -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -423,7 +423,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_huge -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -441,7 +441,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_normal -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -459,7 +459,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_dpi -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 999 precision: 0 @@ -481,7 +481,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_tiny -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -499,7 +499,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_larger -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -517,7 +517,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_small -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -535,7 +535,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_huger -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -577,7 +577,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_line_len -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 120 precision: 0 @@ -599,7 +599,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_tex_encoding -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -617,7 +617,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_default_papersize -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -635,7 +635,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_ascii_roff -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -653,7 +653,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_checktex -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -713,7 +713,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_spell_command -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -731,7 +731,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_alt_lang -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -749,7 +749,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_alt_lang -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -767,7 +767,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_escape_chars -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -785,7 +785,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_escape_chars -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -803,7 +803,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_personal_dict -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -821,7 +821,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_personal_dict -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -839,7 +839,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_personal_dict -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -857,7 +857,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_compound_words -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -875,7 +875,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_input_enc -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -917,7 +917,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_date_format -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -959,7 +959,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_package -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -977,7 +977,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_default_lang -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -995,7 +995,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_kbmap -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1013,7 +1013,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_rtl_support -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1031,7 +1031,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_mark_foreign -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1049,7 +1049,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_auto_begin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1067,7 +1067,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_auto_end -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1085,7 +1085,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_command_begin -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1103,7 +1103,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_command_end -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1121,7 +1121,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_kbmap1 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1139,7 +1139,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_kbmap2 -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1157,7 +1157,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_kbmap1_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1175,7 +1175,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_kbmap2_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1193,7 +1193,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_babel -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1211,7 +1211,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_global_options -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -1271,7 +1271,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser_lyx_objs -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1289,7 +1289,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_modify -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1307,7 +1307,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_saturation -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 slsize: 0.15 @@ -1326,7 +1326,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_value -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 slsize: 0.15 @@ -1345,7 +1345,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: dial_hue -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1363,7 +1363,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_red -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 slsize: 0.15 @@ -1382,7 +1382,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_blue -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 slsize: 0.15 @@ -1401,7 +1401,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_green -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 slsize: 0.15 @@ -1420,7 +1420,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_colorspace -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1480,7 +1480,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser_all -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1498,7 +1498,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1516,7 +1516,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_add -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1534,7 +1534,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_converter -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1552,7 +1552,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_from -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1570,7 +1570,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_to -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1588,7 +1588,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_flags -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -1630,7 +1630,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: browser_all -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1648,7 +1648,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_format -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1666,7 +1666,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_gui_name -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1684,7 +1684,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1702,7 +1702,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_add -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1720,7 +1720,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_extension -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1738,7 +1738,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_viewer -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1756,7 +1756,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_shrtcut -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 =============== FORM =============== @@ -1798,7 +1798,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_banner -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1817,7 +1817,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_auto_region_delete -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1836,7 +1836,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_exit_confirm -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1855,7 +1855,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_display_shrtcuts -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1874,7 +1874,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_autosave -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 1200 precision: 0 @@ -1896,7 +1896,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_ask_new_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1915,7 +1915,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_cursor_follows_scrollbar -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -1934,7 +1934,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_wm_jump -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 250 precision: 0 @@ -1980,7 +1980,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_popup_font -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1998,7 +1998,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_menu_font -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2016,7 +2016,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_popup_encoding -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2034,7 +2034,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_bind_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2052,7 +2052,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_bind_file_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2070,7 +2070,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_ui_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2088,7 +2088,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ui_file_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2106,7 +2106,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_override_x_dead_keys -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -2149,7 +2149,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_command -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2167,7 +2167,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_page_range -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2185,7 +2185,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_copies -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2203,7 +2203,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_reverse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2221,7 +2221,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_to_printer -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2239,7 +2239,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_file_extension -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2257,7 +2257,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_spool_command -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2275,7 +2275,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_paper_type -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2293,7 +2293,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_even_pages -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2311,7 +2311,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_odd_pages -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2329,7 +2329,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_collated -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2347,7 +2347,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_landscape -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2365,7 +2365,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_to_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2383,7 +2383,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_extra_options -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2401,7 +2401,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_spool_prefix -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2419,7 +2419,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_paper_size -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2437,7 +2437,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_name -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2455,7 +2455,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_adapt_output -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2515,7 +2515,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_default_path -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2533,7 +2533,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_default_path_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2551,7 +2551,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_lastfiles -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 bounds: 0 9 precision: 0 @@ -2573,7 +2573,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_template_path -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2591,7 +2591,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_template_path_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2609,7 +2609,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_last_files -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -2628,7 +2628,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_temp_dir_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2646,7 +2646,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_lastfiles -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2664,7 +2664,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_lastfiles_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2682,7 +2682,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_make_backups -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 @@ -2701,7 +2701,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_backup_path -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2719,7 +2719,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_backup_path_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2737,7 +2737,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_serverpipe -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2755,7 +2755,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_serverpipe_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2773,7 +2773,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_temp_dir -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -2791,7 +2791,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_temp_dir -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 value: 1 diff --git a/src/frontends/xforms/forms/form_print.fd b/src/frontends/xforms/forms/form_print.fd index 548bb50da8..1da4f1e48f 100644 --- a/src/frontends/xforms/forms/form_print.fd +++ b/src/frontends/xforms/forms/form_print.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_printer -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_printer -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -117,7 +117,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_file -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -153,7 +153,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -171,7 +171,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -189,7 +189,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -225,7 +225,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_all_pages -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -243,7 +243,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_odd_pages -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -261,7 +261,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_even_pages -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -315,7 +315,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_order_normal -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -333,7 +333,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_order_reverse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -369,7 +369,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_from_page -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -387,7 +387,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_count -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -405,7 +405,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_collated -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -423,7 +423,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_to_page -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -513,7 +513,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_browse -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_ref.fd b/src/frontends/xforms/forms/form_ref.fd index 5a974f4860..be0b7dcc5c 100644 --- a/src/frontends/xforms/forms/form_ref.fd +++ b/src/frontends/xforms/forms/form_ref.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_South name: browser -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 2 -------------------- @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_SouthWest name: button_update -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 3 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_SouthWest name: sort -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 4 -------------------- @@ -135,7 +135,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: type -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 5 -------------------- @@ -153,7 +153,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_go -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 1 -------------------- @@ -171,7 +171,7 @@ shortcut: ^M resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -189,7 +189,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -207,7 +207,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -225,7 +225,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_search.fd b/src/frontends/xforms/forms/form_search.fd index bd9196ce63..bfec4e870d 100644 --- a/src/frontends/xforms/forms/form_search.fd +++ b/src/frontends/xforms/forms/form_search.fd @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: input_search -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: input_replace -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: findnext -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -117,7 +117,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: findprev -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -135,7 +135,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: replace -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -153,7 +153,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -171,7 +171,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NorthEast FL_NorthEast name: casesensitive -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -189,7 +189,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NorthEast FL_NorthEast name: matchword -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -207,7 +207,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: replaceall -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_tabular.fd b/src/frontends/xforms/forms/form_tabular.fd index 906504f6d0..d5cbc0bfb0 100644 --- a/src/frontends/xforms/forms/form_tabular.fd +++ b/src/frontends/xforms/forms/form_tabular.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_close -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -160,7 +160,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_append_column -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -178,7 +178,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete_column -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -196,7 +196,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_append_row -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -214,7 +214,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete_row -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -232,7 +232,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_set_borders -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -250,7 +250,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_unset_borders -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -268,7 +268,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_longtable -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -286,7 +286,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_rotate_tabular -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -346,7 +346,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -364,7 +364,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -382,7 +382,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_left -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -400,7 +400,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_right -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -418,7 +418,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_left -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -436,7 +436,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_right -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -454,7 +454,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_center -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -472,7 +472,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -490,7 +490,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_center -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -508,7 +508,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -580,7 +580,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_column_width -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -598,7 +598,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_special_alignment -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -658,7 +658,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -676,7 +676,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -694,7 +694,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_left -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -712,7 +712,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_right -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -730,7 +730,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_left -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -748,7 +748,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_right -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -766,7 +766,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_center -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -784,7 +784,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_top -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -802,7 +802,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_center -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -820,7 +820,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_bottom -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -892,7 +892,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_mcolumn_width -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -910,7 +910,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_special_multialign -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -928,7 +928,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_multicolumn -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -946,7 +946,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_useminipage -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -964,7 +964,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_rotate_cell -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1042,7 +1042,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_firsthead -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1060,7 +1060,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_head -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1078,7 +1078,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_foot -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1096,7 +1096,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_lastfoot -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -1114,7 +1114,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_newpage -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- diff --git a/src/frontends/xforms/forms/form_tabular_create.fd b/src/frontends/xforms/forms/form_tabular_create.fd index 838c000b14..63e2740a50 100644 --- a/src/frontends/xforms/forms/form_tabular_create.fd +++ b/src/frontends/xforms/forms/form_tabular_create.fd @@ -46,7 +46,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- diff --git a/src/frontends/xforms/forms/form_toc.fd b/src/frontends/xforms/forms/form_toc.fd index 75624447cd..8b38ad414e 100644 --- a/src/frontends/xforms/forms/form_toc.fd +++ b/src/frontends/xforms/forms/form_toc.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser_toc -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_update -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: choice_toc_type -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 ============================== diff --git a/src/frontends/xforms/forms/form_url.fd b/src/frontends/xforms/forms/form_url.fd index 7fa732da88..84730de145 100644 --- a/src/frontends/xforms/forms/form_url.fd +++ b/src/frontends/xforms/forms/form_url.fd @@ -45,7 +45,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: url -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -63,7 +63,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: name -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -81,7 +81,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_NorthEast name: radio_html -callback: C_FormBaseInputCB +callback: C_FormBaseDeprecatedInputCB argument: 0 -------------------- @@ -99,7 +99,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_cancel -callback: C_FormBaseCancelCB +callback: C_FormBaseDeprecatedCancelCB argument: 0 -------------------- @@ -117,7 +117,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_SouthEast FL_SouthEast name: button_ok -callback: C_FormBaseOKCB +callback: C_FormBaseDeprecatedOKCB argument: 0 -------------------- @@ -135,7 +135,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: C_FormBaseApplyCB +callback: C_FormBaseDeprecatedApplyCB argument: 0 -------------------- @@ -153,7 +153,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_restore -callback: C_FormBaseRestoreCB +callback: C_FormBaseDeprecatedRestoreCB argument: 0 ============================== diff --git a/src/frontends/xforms/input_validators.C b/src/frontends/xforms/input_validators.C index 5555d516d5..ecde4ae6e9 100644 --- a/src/frontends/xforms/input_validators.C +++ b/src/frontends/xforms/input_validators.C @@ -4,7 +4,7 @@ * be extended to include other generally useful xforms-specific tools. */ -#include "config.h" +#include #include FORMS_H_LOCATION #include "support/lstrings.h" #include "input_validators.h" diff --git a/src/frontends/xforms/xformsBC.C b/src/frontends/xforms/xformsBC.C new file mode 100644 index 0000000000..216667fe26 --- /dev/null +++ b/src/frontends/xforms/xformsBC.C @@ -0,0 +1,58 @@ +#include + +#include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "xformsBC.h" +#include "xforms_helpers.h" + + +xformsBC::xformsBC(string const & cancel, string const & close) + : ButtonControllerBase(cancel, close), + okay_(0), apply_(0), cancel_(0), undo_all_(0), read_only_() +{} + + +void xformsBC::refresh() +{ + if (okay_) { + if (bp().buttonStatus(ButtonPolicy::OKAY)) { + setEnabled(okay_, true); + } else { + setEnabled(okay_, false); + } + } + if (apply_) { + if (bp().buttonStatus(ButtonPolicy::APPLY)) { + setEnabled(apply_, true); + } else { + setEnabled(apply_, false); + } + } + if (undo_all_) { + if (bp().buttonStatus(ButtonPolicy::UNDO_ALL)) { + setEnabled(undo_all_, true); + } else { + setEnabled(undo_all_, false); + } + } + if (cancel_) { + if (bp().buttonStatus(ButtonPolicy::CANCEL)) { + fl_set_object_label(cancel_, cancel_label.c_str()); + } else { + fl_set_object_label(cancel_, close_label.c_str()); + } + } + if (!read_only_.empty()) { + bool enable = true; + if (bp().isReadOnly()) enable = false; + + for (std::list::iterator iter = read_only_.begin(); + iter != read_only_.end(); ++iter) { + setEnabled(*iter, enable); + } + } +} diff --git a/src/frontends/xforms/xformsBC.h b/src/frontends/xforms/xformsBC.h new file mode 100644 index 0000000000..d65ac7d714 --- /dev/null +++ b/src/frontends/xforms/xformsBC.h @@ -0,0 +1,84 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. + * + * This file Copyright 2000 + * Allan Rae + * ====================================================== + * + * Author: Allan Rae + * Non-xforms-specific code stripped-out and placed in a base class by + * Angus Leeming + */ + +#ifndef XFORMSBC_H +#define XFORMSBC_H + +#include "ButtonController.h" +#include + +#ifdef __GNUG__ +#pragma interface +#endif + +/** General purpose button controller for up to four buttons. + Controls the activation of the OK, Apply and Cancel buttons. + Actually supports 4 buttons in all and it's up to the user to decide on + the activation policy and which buttons correspond to which output of the + state machine. +*/ +class xformsBC : public ButtonControllerBase +{ +public: + /// + xformsBC(string const &, string const &); + + /* Initialise Button Functions */ + /// Call refresh() when finished setting the buttons. + void setOK(FL_OBJECT * obj) { + okay_ = obj; + } + /// + void setApply(FL_OBJECT * obj) { + apply_ = obj; + } + /// + void setCancel(FL_OBJECT * obj) { + cancel_ = obj; + } + /// + void setUndoAll(FL_OBJECT * obj) { + undo_all_ = obj; + } + /// + void addReadOnly(FL_OBJECT * obj) { + read_only_.push_front(obj); + } + /// + void eraseReadOnly() { + read_only_.erase(read_only_.begin(), read_only_.end()); + } + + /* Action Functions */ + /// force a refresh of the buttons + virtual void refresh(); + +private: + /// + FL_OBJECT * okay_; + /// + FL_OBJECT * apply_; + /// + FL_OBJECT * cancel_; + /// + FL_OBJECT * undo_all_; + /// List of items to be deactivated when in one of the read-only states + std::list read_only_; +}; + +#endif // XFORMSBC_H diff --git a/src/frontends/xforms/xforms_helpers.h b/src/frontends/xforms/xforms_helpers.h index 0781cd1c9e..d7d2bd2240 100644 --- a/src/frontends/xforms/xforms_helpers.h +++ b/src/frontends/xforms/xforms_helpers.h @@ -14,7 +14,8 @@ void setEnabled(FL_OBJECT *, bool enable); // Take a string and add breaks so that it fits into a desired label width, w -string formatted(string const &label, int w, int size, int style); +string formatted(string const &label, int w, + int=FL_NORMAL_SIZE, int=FL_NORMAL_STYLE); class LyXView;