noncopyable + read ChangeLog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@931 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-07-27 10:26:38 +00:00
parent 338bca184c
commit 0d2e80687d
19 changed files with 186 additions and 126 deletions

View File

@ -1,3 +1,29 @@
2000-07-27 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/frontends/xforms/FormUrl.h: ditto
* src/frontends/xforms/FormPrint.h: ditto
* src/frontends/xforms/FormPreferences.h: ditto
* src/frontends/xforms/FormCopyright.h: ditto
* src/frontends/xforms/FormCitation.C: ditto
* src/frontends/Dialogs.h (class Dialogs): use noncopyable, remove
private copyconstructor and private default contructor
* src/support/Makefile.am: add utility.hpp
* src/support/utility.hpp: new file from boost
* src/insets/insetbib.h: set owner in clone
* src/frontends/xforms/FormCitation.C: added missing include
algorithm
* src/insets/form_url.[Ch]: removed
2000-07-26 Kayvan A. Sylvan <kayvan@sylvan.com>
* development/lyx.spec.in

View File

@ -41,7 +41,6 @@ src/frontends/xforms/Menubar_pimpl.C
src/gettext.h
src/insets/figinset.C
src/insets/form_graphics.C
src/insets/form_url.C
src/insets/insetbib.C
src/insets/inset.C
src/insets/inseterror.C

View File

@ -21,14 +21,8 @@
#include <vector>
#include <sigc++/signal_system.h>
using std::vector;
#ifdef SIGC_CXX_NAMESPACES
using SigC::Signal0;
using SigC::Signal1;
#endif
#include "LString.h"
#include "support/utility.hpp"
class DialogBase;
@ -44,11 +38,18 @@ class InsetInfo;
class InsetTabular;
class InsetUrl;
using std::vector;
#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.
*/
class Dialogs
class Dialogs : public noncopyable
{
public:
/**@name Constructors and Deconstructors */
@ -123,10 +124,6 @@ public:
Signal1<void, InsetInfo *> showInfo;
//@}
private:
/// Disallow default constructor
Dialogs() {}
/// Disallow copy constructor
Dialogs(Dialogs &) {}
///
vector<DialogBase *> dialogs_;
};

View File

@ -10,8 +10,17 @@
*/
#include <config.h>
#include "gettext.h"
#include <algorithm>
#include FORMS_H_LOCATION
#ifdef __GNUG__
#pragma implementation
#endif
#include "gettext.h"
#include "BufferView.h"
#include "Dialogs.h"
#include "FormCitation.h"
@ -23,10 +32,6 @@
#include "insets/insetcite.h"
#include "support/filetools.h"
#ifdef __GNUG__
#pragma implementation
#endif
using std::vector;
using std::pair;
using std::max;

View File

@ -12,9 +12,15 @@
#ifndef FORMCITATION_H
#define FORMCITATION_H
#include <vector>
#include "DialogBase.h"
#include "LString.h"
#include <vector>
#include "support/utility.hpp"
#ifndef __GNUG__
#pragma interface
#endif
class Dialogs;
// same arguement as in Dialogs.h s/LyX/UI/
@ -24,7 +30,7 @@ struct FD_form_citation;
/** This class provides an XForms implementation of the FormCitation Dialog.
*/
class FormCitation : public DialogBase {
class FormCitation : public DialogBase, public noncopyable {
public:
///
enum State {
@ -54,9 +60,6 @@ public:
//@}
private:
FormCitation() {}
FormCitation(FormCitation &) : DialogBase() {}
/**@name Slot Methods */
//@{
/// Create the dialog if necessary, update it and display it.

View File

@ -3,18 +3,19 @@
*/
#include <config.h>
#include "lyx_gui_misc.h"
#include "gettext.h"
#include FORMS_H_LOCATION
#ifdef __GNUG__
#pragma implementation
#endif
#include "xform_macros.h"
#include "FormCopyright.h"
#include "Dialogs.h"
#include "LyXView.h"
#ifdef __GNUG__
#pragma implementation
#endif
#include "lyx_gui_misc.h"
#include "gettext.h"
C_RETURNCB(FormCopyright, WMHideCB)
C_GENERICCB(FormCopyright, OKCB)

View File

@ -19,6 +19,11 @@
#include "DialogBase.h"
#include "form_copyright.h"
#include "support/utility.hpp"
#ifdef __GNUG__
#pragma interface
#endif
class Dialogs;
// same arguement as in Dialogs.h s/LyX/UI/
@ -26,7 +31,7 @@ class LyXView;
/** This class provides an XForms implementation of the FormCopyright Dialog.
*/
class FormCopyright : public DialogBase {
class FormCopyright : public DialogBase, public noncopyable {
public:
/**@name Constructors and Destructors */
//@{
@ -43,9 +48,6 @@ public:
//@}
private:
FormCopyright() {}
FormCopyright(FormCopyright &) : DialogBase() {}
/**@name Slot Methods */
//@{
/// Create the dialog if necessary, update it and display it.

View File

@ -3,10 +3,13 @@
*/
#include <config.h>
#include "lyx_gui_misc.h"
#include "gettext.h"
#include FORMS_H_LOCATION
#ifdef __GNUG_
#pragma implementation
#endif
#include "FormPreferences.h"
#include "form_preferences.h"
#include "xform_macros.h"
@ -16,7 +19,8 @@
#include "Dialogs.h"
#include "lyxrc.h"
#include "debug.h"
#include "lyx_gui_misc.h"
#include "gettext.h"
#ifdef SIGC_CXX_NAMESPACES
using SigC::slot;

View File

@ -18,8 +18,10 @@
#define FORMPREFERENCES_H
#include "DialogBase.h"
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;
#include "support/utility.hpp"
#ifdef __GNUG_
#pragma interface
#endif
class LyXView;
@ -32,10 +34,14 @@ struct FD_form_interface_fonts;
struct FD_form_printer;
struct FD_form_paths;
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;
#endif
/** This class provides an XForms implementation of the FormPreferences Dialog.
The preferences dialog allows users to set/save their preferences.
*/
class FormPreferences : public DialogBase {
class FormPreferences : public DialogBase, public noncopyable {
public:
/**@name Constructors and Destructors */
//@{
@ -55,9 +61,6 @@ public:
//@}
private:
FormPreferences() {}
FormPreferences(FormPreferences &) : DialogBase() {}
/**@name Slot Methods */
//@{
/// Create the dialog if necessary, update it and display it.

View File

@ -3,10 +3,13 @@
*/
#include <config.h>
#include "lyx_gui_misc.h"
#include "gettext.h"
#include FORMS_H_LOCATION
#ifdef __GNUG__
#pragma implementation
#endif
#include "FormPrint.h"
#include "form_print.h"
#include "xform_macros.h"
@ -19,6 +22,8 @@
#include "Liason.h"
#include "debug.h"
#include "BufferView.h"
#include "lyx_gui_misc.h"
#include "gettext.h"
#ifdef SIGC_CXX_NAMESPACES

View File

@ -18,18 +18,24 @@
#define FORMPRINT_H
#include "DialogBase.h"
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;
#include "support/utility.hpp"
#ifdef __GNUG__
#pragma interface
#endif
class LyXView;
class Dialogs;
struct FD_form_print;
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;
#endif
/** This class provides an XForms implementation of the FormPrint Dialog.
The print dialog allows users to print their documents.
*/
class FormPrint : public DialogBase {
class FormPrint : public DialogBase, public noncopyable {
public:
/**@name Constructors and Destructors */
//@{
@ -49,9 +55,6 @@ public:
//@}
private:
FormPrint() {}
FormPrint(FormPrint &) : DialogBase() {}
/**@name Slot Methods */
//@{
/// Create the dialog if necessary, update it and display it.

View File

@ -10,8 +10,15 @@
*/
#include <config.h>
#include "gettext.h"
#include FORMS_H_LOCATION
#ifdef __GNUG__
#pragma implementation
#endif
#include "gettext.h"
#include "BufferView.h"
#include "Dialogs.h"
#include "FormUrl.h"
@ -24,10 +31,6 @@
#include "insets/inseturl.h"
#include "support/filetools.h"
#ifdef __GNUG__
#pragma implementation
#endif
C_RETURNCB(FormUrl, WMHideCB)
C_GENERICCB(FormUrl, OKCB)
C_GENERICCB(FormUrl, CancelCB)

View File

@ -15,15 +15,21 @@
#include "DialogBase.h"
#include "LString.h"
#include "support/utility.hpp"
class Dialogs;
class LyXView;
class InsetCommandParams;
class InsetUrl;
struct FD_form_url;
#ifdef __GNUG__
#pragma interface
#endif
/** This class provides an XForms implementation of the FormUrl Dialog.
*/
class FormUrl : public DialogBase {
class FormUrl : public DialogBase, public noncopyable {
public:
/**@name Constructors and Destructors */
//@{
@ -41,9 +47,6 @@ public:
//@}
private:
FormUrl() {}
FormUrl(FormUrl &) : DialogBase() {}
/**@name Slot Methods */
//@{
/// Create the dialog if necessary, update it and display it.

View File

@ -31,6 +31,10 @@ libxforms_la_SOURCES = \
FormTabular.h \
form_tabular.C \
form_tabular.h \
FormUrl.C \
FormUrl.h \
form_url.C \
form_url.h \
Toolbar_pimpl.C \
Toolbar_pimpl.h \
Menubar_pimpl.C \

View File

@ -1,41 +0,0 @@
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
#include <config.h>
#include "lyx_gui_misc.h"
#include "gettext.h"
/* Form definition file generated with fdesign. */
#include FORMS_H_LOCATION
#include <cstdlib>
#include "form_url.h"
FD_form_url *create_form_form_url(void)
{
FL_OBJECT *obj;
FD_form_url *fdui = (FD_form_url *) fl_calloc(1, sizeof(FD_form_url));
fdui->form_url = fl_bgn_form(FL_NO_BOX, 530, 150);
obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 150, "");
fdui->url_name = obj = fl_add_input(FL_NORMAL_INPUT, 50, 20, 460, 30, _("Url"));
fl_set_input_shortcut(obj, scex(_("Url|#U")), 1);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->name_name = obj = fl_add_input(FL_NORMAL_INPUT, 50, 60, 460, 30, _("Name"));
fl_set_input_shortcut(obj, scex(_("Name|#N")), 1);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->radio_html = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 50, 110, 250, 30, _("HTML type"));
fl_set_button_shortcut(obj, scex(_("HTML type|#H")), 1);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 410, 110, 100, 30, _("Close"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_InsetUrl_CloseUrlCB, 0);
fl_end_form();
//fdui->form_url->fdui = fdui;
return fdui;
}
/*---------------------------------------*/

View File

@ -1,24 +0,0 @@
/** Header file generated with fdesign on Mon Oct 25 15:21:02 1999.**/
#ifndef FD_form_url_h_
#define FD_form_url_h_
/** Callbacks, globals and object handlers **/
extern "C" void C_InsetUrl_CloseUrlCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
typedef struct {
FL_FORM *form_url;
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *url_name;
FL_OBJECT *name_name;
FL_OBJECT *radio_html;
FL_OBJECT *button_close;
} FD_form_url;
extern FD_form_url * create_form_form_url(void);
#endif /* FD_form_url_h_ */

View File

@ -93,7 +93,7 @@ public:
///
Inset * Clone() const {
return new InsetBibtex(getCmdName(), getOptions(), 0);
return new InsetBibtex(getCmdName(), getOptions(), owner);
}
///
Inset::Code LyxCode() const

View File

@ -55,4 +55,5 @@ libsupport_la_SOURCES = \
syscontr.C \
syscontr.h \
syssingleton.C \
textutils.h
textutils.h \
utility.hpp

66
src/support/utility.hpp Normal file
View File

@ -0,0 +1,66 @@
// boost utility.hpp header file ----------------------------------------//
// (C) Copyright boost.org 1999. Permission to copy, use, modify, sell
// and distribute this software is granted provided this copyright
// notice appears in all copies. This software is provided "as is" without
// express or implied warranty, and with no claim as to its suitability for
// any purpose.
// See http://www.boost.org for most recent version including documentation.
// Classes appear in alphabetical order
// Revision History
// 10 Dec 99 next() and prior() templates added.
// 30 Aug 99 moved cast templates to cast.hpp
// 3 Aug 99 cast templates added
// 20 Jul 99 name changed to utility.hpp
// 9 Jun 99 protected noncopyable default ctor
// 2 Jun 99 Initial Version. Class noncopyable only contents.
#ifndef BOOST_UTILITY_HPP
#define BOOST_UTILITY_HPP
//#include <boost/config.hpp>
//#include <cstddef> // for size_t
//namespace boost
//{
// next() and prior() template functions -----------------------------------//
// Helper functions for classes like bidirectional iterators not supporting
// operator+ and operator-.
//
// Usage:
// const std::list<T>::iterator p = get_some_iterator();
// const std::list<T>::iterator prev = boost::prior(p);
// Contributed by Dave Abrahams
template <class T>
T next(T x) { return ++x; }
template <class T>
T prior(T x) { return --x; }
// class noncopyable -------------------------------------------------------//
// Private copy constructor and copy assignment ensure classes derived from
// class noncopyable cannot be copied.
// Contributed by Dave Abrahams
class noncopyable
{
protected:
noncopyable(){}
private: // emphasize the following members are private
noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& );
}; // noncopyable
//} // namespace boost
#endif // BOOST_UTILITY_HPP