]> git.lyx.org Git - features.git/commitdiff
noncopyable + read ChangeLog
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 27 Jul 2000 10:26:38 +0000 (10:26 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 27 Jul 2000 10:26:38 +0000 (10:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@931 a592a061-630c-0410-9148-cb99ea01b6c8

19 files changed:
ChangeLog
po/POTFILES.in
src/frontends/Dialogs.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormCopyright.h
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h
src/frontends/xforms/Makefile.am
src/insets/form_url.C [deleted file]
src/insets/form_url.h [deleted file]
src/insets/insetbib.h
src/support/Makefile.am
src/support/utility.hpp [new file with mode: 0644]

index a93449706d83ca54ecd58a56c3386a0e3e9b6047..5e4db5cf58f5c2713c83651c3d7942cc82ebed6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index db7f810105bc157c97643b29ec8f393aae593910..e9d20613e486eddf540739507d1199212ce5277f 100644 (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
index 51885577004ac291c2b6c1aabbe1fbfd176d438f..60e60b10fc5c20f4d1b8a3fff9173def71906412 100644 (file)
 #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_;
 };
index bd77914b85dbbfb2c10be9bcf3a58b6011e24740..0443068dc71ce262215266cdff08040b5b8b841d 100644 (file)
  */
 
 #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"
 #include "insets/insetcite.h"
 #include "support/filetools.h"
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 using std::vector;
 using std::pair;
 using std::max;
index 3047dca4d31386356b9850b2945283966760c230..d362bc6be74e99c6dd475d01a54211bfcb275cd2 100644 (file)
 #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.
index 4a0093fdcfd0c8165c40479f567649befbe5a6a6..6406d8483bd9430bbce9dd4540606aec793fcd19 100644 (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)
index ee99a2c619a52c766036a369f9d184d2856ab76d..5647a40494ce4042437e710f2eb2204c21b05b7b 100644 (file)
 
 #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.
index f16d0244ddbc1ae1b3cb02125fd8c27b09b9e83b..92fa4acdbaee9eff14f3435ea63c5d10bbb69d34 100644 (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;
index 6014914cb0f2e2e32b99bae17b4fc5bf7338a5d8..b53dddd99f13993078bf1e46fd8e0276969f2def 100644 (file)
 #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.
index 70894485c563fcd82a75a754493870e27a7a2303..617e31d1509b8eacf51d35eac43a70aa033dfc6e 100644 (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
index f9e2d7b27c70344fda8732fd5b523e8cdbc69e1d..5d96a9330419cbc0e90128cd32092976884df823 100644 (file)
 #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.
index bceee127ed473be9738f7cfde3d11de7040cd141..5085e68ceffd2bcac225fe9e1e10a8a4641744e8 100644 (file)
  */
 
 #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"
 #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)
index b4a804da2ffce1997c73752e749cf79a6f97564b..c82f4f90254e78979b4e5ba2b5955aabdd7012c3 100644 (file)
 #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.
index 8d3cd47456cc165127d04611c2e27bba455fd82d..594dfd35b1fe8fba4804df10c336c548a935f740 100644 (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 \
diff --git a/src/insets/form_url.C b/src/insets/form_url.C
deleted file mode 100644 (file)
index cffbd71..0000000
+++ /dev/null
@@ -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;
-}
-/*---------------------------------------*/
-
diff --git a/src/insets/form_url.h b/src/insets/form_url.h
deleted file mode 100644 (file)
index b212c08..0000000
+++ /dev/null
@@ -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_ */
index f0b302ab778e6178e7c9219f9e9e0de581dbca60..52893fb97fbc3de82912f3e257766216c1ddd6c5 100644 (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
index 96d51d37867161dd30cb474154e3201069c99c2a..a7a038facc86209d1fb45921755096271434d9c7 100644 (file)
@@ -55,4 +55,5 @@ libsupport_la_SOURCES = \
        syscontr.C \
        syscontr.h \
        syssingleton.C \
-       textutils.h
+       textutils.h \
+       utility.hpp
diff --git a/src/support/utility.hpp b/src/support/utility.hpp
new file mode 100644 (file)
index 0000000..cdbcb35
--- /dev/null
@@ -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