* Throw out DialogBase.h

* Only #include what's needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4979 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-14 19:19:47 +00:00
parent a443001d5a
commit ca26056e2a
41 changed files with 209 additions and 198 deletions

View File

@ -1,3 +1,13 @@
2002-08-13 Angus Leeming <leeming@lyx.org>
* DialogBase.h: removed.
* Dialogs.h: rearrange #includes, forward declarations and some
functions. Remove commented out, historical code.
* Dialogs.[Ch] (showInfo): removed.
* guiapi.h (gui_ShowInfo): removed.
2002-08-13 André Pönitz <poenitz@gmx.net>

View File

@ -1,50 +0,0 @@
// -*- C++ -*-
/* DialogBase.h
* Abstract base class of all dialogs.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
* ======================================================
*/
#ifndef DIALOGBASE_H
#define DIALOGBASE_H
#include <boost/utility.hpp>
/** Abstract base class of all dialogs.
The outside world only needs some way to tell a dialog when to show, hide
or update itself. A dialog then takes whatever steps are necessary to
satisfy that request. Thus a dialog will have to "pull" the necessary
details from the core of the program.
*/
class DialogBase : boost::noncopyable
{
public:
/**@name Constructors and Deconstructors */
//@{
/// Virtual base destructor
virtual ~DialogBase() {}
//@}
/**@name Signal Targets */
//@{
///
//virtual void show() = 0;
///
virtual void hide() = 0;
///
virtual void update() {};
///
virtual void close() {};
//@}
};
#endif // DIALOGBASE_H

View File

@ -150,14 +150,6 @@ void Dialogs::createIndex()
}
void Dialogs::showInfo(InsetInfo * /*ii*/)
{
#if 0
gui_ShowInfo(ii, *dialogs_lyxview, *this);
#endif
}
void Dialogs::showLogFile()
{
gui_ShowLogFile(*dialogs_lyxview, *this);

View File

@ -1,53 +1,41 @@
// -*- C++ -*-
/* Dialogs.h
* Container of all dialogs and signals a LyXView needs or uses to access them.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
* ======================================================
/**
* \file Dialogs.h
* Copyright 1995-2002 The LyX Team.
* See the file COPYING.
* \author Allan Rae, rae@lyx.org
*/
#ifndef DIALOGS_H
#define DIALOGS_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals/signal0.hpp>
#include <boost/signals/signal1.hpp>
#include <vector>
#ifdef __GNUG__
#pragma interface
#endif
#include "DialogBase.h"
// Maybe this should be a UIFunc modelled on LyXFunc
class LyXView;
class InsetGraphics;
class InsetBibKey;
class InsetBibtex;
class InsetCommand;
class InsetError;
class InsetERT;
class InsetExternal;
class InsetFloat;
class InsetGraphics;
class InsetInclude;
class InsetInfo;
class InsetTabular;
class InsetCommand;
class InsetMinipage;
class InsetFloat;
class InsetERT;
class Paragraph;
class InsetTabular;
/** 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
@ -57,12 +45,9 @@ class Dialogs : boost::noncopyable
{
public:
///
typedef boost::shared_ptr<DialogBase> db_ptr;
/**@name Constructor */
//@{
typedef boost::shared_ptr<boost::noncopyable> db_ptr;
///
Dialogs(LyXView *);
//@}
/** Redraw all visible dialogs because, for example, the GUI colours
have been re-mapped. */
@ -110,10 +95,16 @@ public:
void showDocument();
///
void showError(InsetError *);
///
void showERT(InsetERT *);
///
void updateERT(InsetERT *);
/// show the external inset dialog
void showExternal(InsetExternal *);
/// show the contents of a file.
void showFile(string const &);
///
void showFloat(InsetFloat *);
/// show all forked child processes
void showForks();
///
@ -124,8 +115,6 @@ public:
void showIndex(InsetCommand *);
///
void createIndex();
///
void showInfo(InsetInfo *);
/// show the LaTeX log or build file
void showLogFile();
/// display the top-level maths panel
@ -135,12 +124,6 @@ public:
///
void updateMinipage(InsetMinipage *);
///
void showERT(InsetERT *);
///
void updateERT(InsetERT *);
///
void showFloat(InsetFloat *);
///
void showParagraph();
///
boost::signal0<void> updateParagraph;
@ -181,11 +164,6 @@ public:
/// show the version control log
void showVCLogFile();
//@}
private:
/// Add a dialog to the vector of dialogs.
//void add(DialogBase *);
/// the dialogs being managed
//std::vector<db_ptr> dialogs_;
};
#endif

View File

@ -1,3 +1,34 @@
2002-08-14 Angus Leeming <leeming@lyx.org>
* GUI.h: class GUI deries from boost::noncopyable
* ControlButtons.h: no longer derives from DialogBase, but instead
derives directly from boost::noncopyable.
* ViewBase.h: derives from boost::noncopyable.
* ControlCharacter.C:
* ControlCommand.C:
* ControlConnections.C:
* ControlGraphics.C:
* ControlInclude.C:
* ControlParagraph.C:
* ControlPreamble.C:
* ControlPrint.C:
* ControlSearch.C:
* ControlSpellchecker.C:
* ControlTexinfo.C:
* ControlThesaurus.C:
rearrange #includes. Remove unnecessary ones.
* ControlError.h: add "insets/inseterror.h".
* helper_funcs.h: add necessary #includes.
* tex_helpers.[Ch]: add #pragma directives for g++.
* Makefile.am: remove src/frontends from -I list to compiler.
2002-08-13 Angus Leeming <leeming@lyx.org>
* ControlConnections.C:

View File

@ -33,14 +33,14 @@
#pragma interface
#endif
#include "DialogBase.h" // This can go eventually
#include <boost/utility.hpp>
class ViewBase;
class ButtonControllerBase;
/** Abstract base class for Controllers with a ButtonController.
*/
class ControlButtons : public DialogBase
class ControlButtons : boost::noncopyable
{
public:
///

View File

@ -13,14 +13,16 @@
#endif
#include "ControlCharacter.h"
#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "buffer.h"
#include "Liason.h"
#include "bufferview_funcs.h" // ToggleAndShow
#include "gettext.h"
#include "language.h"
#include "frontends/Liason.h"
#include "frontends/LyXView.h"
using Liason::setMinibuffer;

View File

@ -17,14 +17,11 @@
#pragma implementation
#endif
#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "ControlCommand.h"
#include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "BufferView.h"
#include "funcrequest.h"
#include "lyxfunc.h"
ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)

View File

@ -18,11 +18,13 @@
#endif
#include "ControlConnections.h"
#include "ViewBase.h"
#include "Dialogs.h"
#include "buffer.h"
#include "BufferView.h"
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
#include <boost/bind.hpp>

View File

@ -21,6 +21,7 @@
#endif
#include "ControlInset.h"
#include "insets/inseterror.h" // needed for proper instantiation of GUI<>.
class InsetError;

View File

@ -22,10 +22,9 @@
#include "helper_funcs.h"
#include "converter.h"
#include "buffer.h"
#include "BufferView.h"
#include "Dialogs.h"
#include "converter.h"
#include "gettext.h"
#include "lyxrc.h"

View File

@ -5,7 +5,7 @@
*
* \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
#include <config.h>
@ -15,13 +15,16 @@
#endif
#include "ControlInclude.h"
#include "Alert.h"
#include "BufferView.h"
#include "lyxfunc.h"
#include "gettext.h"
#include "helper_funcs.h"
#include "lyxrc.h"
#include "BufferView.h"
#include "funcrequest.h"
#include "gettext.h"
#include "lyxfunc.h"
#include "lyxrc.h"
#include "frontends/Alert.h"
#include "support/filetools.h"

View File

@ -14,16 +14,21 @@
#endif
#include "ControlParagraph.h"
#include "ButtonControllerBase.h"
#include "ViewBase.h"
#include "ParagraphParameters.h"
#include "Liason.h"
#include "buffer.h"
#include "BufferView.h"
#include "gettext.h"
#include "buffer.h"
#include "lyxtext.h"
#include "ParagraphParameters.h"
#include "frontends/Dialogs.h"
#include "frontends/Liason.h"
#include "support/LAssert.h"
#include "Dialogs.h"
#include <boost/bind.hpp>
using Liason::setMinibuffer;
@ -34,7 +39,6 @@ ControlParagraph::ControlParagraph(LyXView & lv, Dialogs & d)
{
d_.updateParagraph.connect(
boost::bind(&ControlParagraph::changedParagraph, this));
}

View File

@ -13,11 +13,14 @@
#endif
#include "ControlPreamble.h"
#include "ViewBase.h"
#include "buffer.h"
#include "Liason.h"
#include "gettext.h"
#include "frontends/Liason.h"
ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),

View File

@ -18,14 +18,18 @@
#endif
#include "ControlPrint.h"
#include "ViewBase.h"
#include "ButtonControllerBase.h"
#include "buffer.h"
#include "PrinterParams.h"
#include "Liason.h"
#include "helper_funcs.h"
#include "frontends/Alert.h"
#include "gettext.h"
#include "helper_funcs.h"
#include "PrinterParams.h"
#include "frontends/Alert.h"
#include "frontends/Liason.h"
#include "support/LAssert.h"
using Liason::printBuffer;

View File

@ -18,10 +18,11 @@
#endif
#include "ControlSearch.h"
#include "Liason.h"
#include "lyxfind.h"
#include "gettext.h"
#include "gettext.h"
#include "lyxfind.h"
#include "frontends/Liason.h"
#include "support/lstrings.h"

View File

@ -13,16 +13,15 @@
#endif
#include "ControlSpellchecker.h"
#include "buffer.h"
#include "lyxrc.h"
#include "BufferView.h"
#include "lyxtext.h"
#include "gettext.h"
#include "language.h"
#include "ViewBase.h"
#include "Dialogs.h"
#include "Liason.h"
#include "buffer.h"
#include "BufferView.h"
#include "gettext.h"
#include "language.h"
#include "lyxrc.h"
#include "lyxtext.h"
#include "frontends/Alert.h"

View File

@ -18,11 +18,11 @@
#endif
#include "ControlTexinfo.h"
#include "Dialogs.h"
#include "gettext.h"
#include "helper_funcs.h"
#include "tex_helpers.h"
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
#include "support/filetools.h" // FileSearch

View File

@ -13,9 +13,11 @@
#endif
#include "ControlThesaurus.h"
#include "Liason.h"
#include "lyxfind.h"
#include "gettext.h"
#include "lyxfind.h"
#include "frontends/Liason.h"
using Liason::setMinibuffer;

View File

@ -12,12 +12,13 @@
#include "ButtonController.h"
#include <boost/utility.hpp>
/** This class makes a whole out of the disparate parts of a dialog.
*/
template <typename Controller, typename GUIview,
typename Policy, typename GUIbc>
class GUI {
class GUI : boost::noncopyable {
public:
///
GUI(LyXView & lv, Dialogs & d);

View File

@ -3,7 +3,6 @@ include $(top_srcdir)/config/common.am
noinst_LTLIBRARIES = libcontrollers.la
INCLUDES = -I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/frontends/ \
$(SIGC_CFLAGS) $(BOOST_INCLUDES)
EXTRA_DIST = ButtonController.tmpl ControlDialog.tmpl ControlInset.tmpl

View File

@ -16,10 +16,12 @@
#include "support/LAssert.h"
#include <boost/utility.hpp>
class ControlButtons;
class ViewBase {
class ViewBase : boost::noncopyable {
public:
///
ViewBase() : controller_ptr_(0) {}

View File

@ -15,12 +15,15 @@
#ifndef HELPERFUNCS_H
#define HELPERFUNCS_H
#include <utility> // pair
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include <utility> // pair
#include <vector> // pair
class LyXView;
/** Launch a file dialog and return the chosen file.

View File

@ -8,6 +8,10 @@
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "tex_helpers.h"
#include "debug.h"

View File

@ -9,6 +9,10 @@
#ifndef TEX_HELPERS_H
#define TEX_HELPERS_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
// build filelists of all availabe bst/cls/sty-files. done through

View File

@ -11,7 +11,6 @@ class InsetExternal;
class InsetFloat;
class InsetGraphics;
class InsetInclude;
class InsetInfo;
class InsetMinipage;
class InsetTabular;
@ -36,7 +35,6 @@ extern "C" {
void gui_ShowInclude(InsetInclude *, LyXView & lv, Dialogs & d);
void gui_ShowIndex(InsetCommand *, LyXView & lv, Dialogs & d);
void gui_CreateIndex(LyXView & lv, Dialogs & d);
void gui_ShowInfo(InsetInfo *, LyXView & lv, Dialogs & d);
void gui_ShowLogFile(LyXView & lv, Dialogs & d);
void gui_ShowMathPanel(LyXView & lv, Dialogs & d);
void gui_ShowMinipage(InsetMinipage *, LyXView & lv, Dialogs & d);

View File

@ -1,9 +1,32 @@
2002-08-14 Angus Leeming <leeming@lyx.org>
* FormBaseDeprecated.h: no longer derives from DialogBase, but instead
derives directly from boost::noncopyable.
(show): made public.
* FeedbackController.h: rearrange #includes.
* FormDocument.C:
* FormMathsDeco.C:
* FormMathsDelim.C:
* FormMathsMatrix.C:
* FormMathsPanel.C:
* FormTabular.C: remove #include "Dialogs.h"
* FormMathsBitmap.C: remove #include "Dialogs.h", "LyXView.h".
* FormPreferences.C: rearrange #includes.
* FormTabular.h (showInset, updateInset): make public.
* FormDocument.C (build): enable the bmtable to find the right file!
* guiapi.C (gui_ShowInfo): removed.
2002-08-13 André Poenitz <poenitz@gmx.net>
* Toolbar_pimpl.C: small cleanup
2002-08-13 Angus Leeming <leeming@lyx.org>
* FileDialog.C:

View File

@ -16,13 +16,13 @@
#ifndef FEEDBACKCONTROLLER_H
#define FEEDBACKCONTROLLER_H
#include "forms_fwd.h"
#include "LString.h"
#ifdef __GNUG__
#pragma interface
#endif
#include "forms_fwd.h"
#include "LString.h"
class FeedbackController
{
public:

View File

@ -20,13 +20,13 @@
#pragma interface
#endif
#include "DialogBase.h"
#include "LString.h"
#include "xformsBC.h"
#include "FeedbackController.h"
#include "forms_fwd.h"
#include <boost/utility.hpp>
#include <boost/signals/connection.hpp>
class Buffer;
@ -34,7 +34,7 @@ class Dialogs;
class LyXView;
class Tooltips;
class FormBaseDeprecated : public DialogBase, public FeedbackController
class FormBaseDeprecated : boost::noncopyable, public FeedbackController
{
public:
///
@ -57,7 +57,8 @@ public:
Tooltips & tooltips();
friend void gui_ShowDocument(LyXView &, Dialogs &);
/// Create the dialog if necessary, update it and display it.
virtual void show();
protected: // methods
@ -71,8 +72,6 @@ protected: // methods
*/
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.

View File

@ -18,7 +18,6 @@
#include "FormDocument.h"
#include "forms/form_document.h"
#include "Alert.h"
#include "Dialogs.h"
#include "lyxtextclasslist.h"
#include "combox.h"
#include "tex-strings.h"
@ -301,6 +300,10 @@ void FormDocument::build()
setPrehandler(bullets_->input_bullet_latex);
fl_set_input_maxchars(bullets_->input_bullet_latex, 80);
string const bmtablefile = LibFileSearch("images", "standard", "xpm");
fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6,
bmtablefile.c_str());
bc_.addReadOnly(bullets_->radio_bullet_depth_1);
bc_.addReadOnly(bullets_->radio_bullet_depth_2);
bc_.addReadOnly(bullets_->radio_bullet_depth_3);

View File

@ -15,8 +15,6 @@
#endif
#include "FormMathsBitmap.h"
#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "bmtable.h"
#include "debug.h"
#include "forms_gettext.h"

View File

@ -17,7 +17,6 @@
#include "FormMathsDeco.h"
#include "forms/form_maths_deco.h"
#include "Dialogs.h"
#include "bmtable.h"
#include FORMS_H_LOCATION

View File

@ -17,12 +17,19 @@
#include "FormMathsDelim.h"
#include "forms/form_maths_delim.h"
#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "bmtable.h"
#include "debug.h"
#include "funcrequest.h"
#include "lyxfunc.h"
#include "frontends/LyXView.h"
#include "support/lstrings.h"
#include "Lsstream.h"
#include FORMS_H_LOCATION
#include "delim.xbm"

View File

@ -15,18 +15,23 @@
#pragma implementation
#endif
#include <algorithm>
#include "FormMathsMatrix.h"
#include "forms/form_maths_matrix.h"
#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "Lsstream.h"
#include "funcrequest.h"
#include "lyxfunc.h"
#include "frontends/LyXView.h"
#include "support/LAssert.h"
#include "support/lyxalgo.h" // lyx::count
#include "Lsstream.h"
#include FORMS_H_LOCATION
#include <algorithm>
#ifndef CXX_GLOBAL_CSTD
using std::strlen;
#endif

View File

@ -15,7 +15,6 @@
#pragma implementation
#endif
#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "FormMathsPanel.h"
#include "forms/form_maths_panel.h"

View File

@ -37,7 +37,6 @@ struct FD_maths_panel;
*/
class FormMathsPanel : public FormBaseBD {
public:
friend void gui_ShowMathPanel(LyXView &, Dialogs &);
///
FormMathsPanel(LyXView *, Dialogs *);
///

View File

@ -14,12 +14,17 @@
#include "FormPreferences.h"
#include "forms/form_preferences.h"
#include "Dialogs.h"
#include "combox.h"
#include "Color.h"
#include "input_validators.h"
#include "forms_gettext.h"
#include "xforms_helpers.h"
#include "helper_funcs.h"
#include "buffer.h"
#include "converter.h"
#include "debug.h"
#include "frontends/LyXView.h"
#include "language.h"
#include "frnt_lang.h"
#include "lyxlex.h"
@ -28,12 +33,8 @@
#include "Lsstream.h"
#include "funcrequest.h"
#include "combox.h"
#include "Color.h"
#include "input_validators.h"
#include "forms_gettext.h"
#include "xforms_helpers.h"
#include "helper_funcs.h"
#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
#include "support/lyxfunctional.h"
#include "support/lyxmanip.h"

View File

@ -50,7 +50,6 @@ struct FD_preferences_spelloptions;
*/
class FormPreferences : public FormBaseBI {
public:
friend void gui_ShowPreferences(LyXView &, Dialogs &);
///
FormPreferences(LyXView &, Dialogs &);

View File

@ -17,7 +17,6 @@
#include "FormTabular.h"
#include "forms/form_tabular.h"
#include "frontends/LyXView.h"
#include "Dialogs.h"
#include "buffer.h"
#include "xforms_helpers.h"
#include "lyxrc.h" // to set the default length values

View File

@ -31,12 +31,14 @@ struct FD_tabular_longtable;
*/
class FormTabular : public FormInset {
public:
friend void gui_ShowTabular(InsetTabular *, LyXView &, Dialogs &);
friend void gui_UpdateTabular(InsetTabular *, LyXView &, Dialogs &);
/// #FormTabular x(LyXFunc ..., Dialogs ...);#
FormTabular(LyXView &, Dialogs &);
/// Slot launching dialog to an existing inset
void showInset(InsetTabular *);
/// Slot launching dialog to an existing inset
void updateInset(InsetTabular *);
private:
/// Pointer to the actual instantiation of the ButtonController.
virtual xformsBC & bc();
@ -46,10 +48,6 @@ private:
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
/// Slot launching dialog to an existing inset
void showInset(InsetTabular *);
/// Slot launching dialog to an existing inset
void updateInset(InsetTabular *);
/// Update dialog before showing it
virtual void update();
/// Build the dialog

View File

@ -347,13 +347,6 @@ extern "C" {
}
#if 0
void gui_ShowInfo(InsetInfo *, LyXView & lv, Dialogs & d)
{
}
#endif
void gui_ShowLogFile(LyXView & lv, Dialogs & d)
{
static GUI<ControlLog, FormLog,