small patch from Dekel, begin introducing the real boost framework, get rid of the parts of boost that were located in support (block and utility)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1063 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-10-02 00:55:02 +00:00
parent 20b05ef8c1
commit da003742d9
48 changed files with 681 additions and 126 deletions

View File

@ -1,3 +1,73 @@
2000-10-02 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/utility.hpp: removed file
* src/support/block.h: removed file
* src/support/Makefile.am (libsupport_la_SOURCES): remove block.h
and utility.hpp
* src/mathed/formula.C: add support/lyxlib.h
* src/mathed/formulamacro.C: ditto
* src/bufferparams.h: use boost/array.hpp instead of support/block.h
* src/lyxparagraph.h: ditto
* src/Makefile.am (BOOST_INCLUDES): the boost include dir
* src/frontends/Makefile.am (INCLUDES): ditto
* src/frontends/gnome/Makefile.am (BOOST_INCLUDES): ditto
* src/frontends/kde/Makefile.am (BOOST_INCLUDES): ditto
* src/frontends/xforms/Makefile.am (BOOST_INCLUDES): ditto
* src/graphics/Makefile.am (BOOST_INCLUDES): ditto
* src/insets/Makefile.am (BOOST_INCLUDES): ditto
* src/mathed/Makefile.am (BOOST_INCLUDES): ditto
* src/BufferView.h: use boost/utility.hpp
* src/LColor.h: ditto
* src/LaTeX.h: ditto
* src/LyXAction.h: ditto
* src/LyXView.h: ditto
* src/bufferlist.h: ditto
* src/lastfiles.h: ditto
* src/layout.h: ditto
* src/lyx_gui.h: ditto
* src/lyx_main.h: ditto
* src/lyxlex.h: ditto
* src/lyxrc.h: ditto
* src/frontends/ButtonPolicies.h: ditto
* src/frontends/Dialogs.h: ditto
* src/frontends/xforms/FormBase.h: ditto
* src/frontends/xforms/FormGraphics.h: ditto
* src/frontends/xforms/FormParagraph.h: ditto
* src/frontends/xforms/FormTabular.h: ditto
* src/graphics/GraphicsCache.h: ditto
* src/graphics/Renderer.h: ditto
* src/insets/ExternalTemplate.h: ditto
* src/insets/insetcommand.h: ditto
* src/support/path.h: ditto
* config/lyxinclude.m4 (LYX_PROG_CXX): change clause for 2.96
and introduce clause for 2.97.
* boost/libs/README: new file
* boost/boost/utility.hpp: new file
* boost/boost/config.hpp: new file
* boost/boost/array.hpp: new file
* boost/Makefile.am: new file
* boost/.cvsignore: new file
* configure.in (AC_OUTPUT): add boost/Makefile
* Makefile.am (SUBDIRS): add boost
2000-10-01 Dekel Tsur <dekelts@tau.ac.il>
* src/support/lstrings.C (suffixIs): Fixed.
2000-10-01 Allan Rae <rae@lyx.org>
* src/PrinterParams.h: moved things around to avoid the "can't

View File

@ -3,7 +3,7 @@ DISTCLEANFILES= *.orig *.rej *~ *.bak lyx.1 core
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/aclocal.m4 \
$(srcdir)/configure $(srcdir)/development/lyx.spec \
$(srcdir)/acinclude.m4
SUBDIRS = intl po sigc++ src lib
SUBDIRS = intl po sigc++ boost src lib
EXTRA_DIST = ANNOUNCE OLD-CHANGES INSTALL.OS2 INSTALL.autoconf README.OS2 \
UPGRADING lyx.man acconfig.h \

1
boost/.cvsignore Normal file
View File

@ -0,0 +1 @@
Makefile.in

3
boost/Makefile.am Normal file
View File

@ -0,0 +1,3 @@
DISTCLEANFILES= *.orig *.rej *~ *.bak core
MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
ETAGS_ARGS = --lang=c++

159
boost/boost/array.hpp Normal file
View File

@ -0,0 +1,159 @@
/* The following code declares class array,
* an STL container (as wrapper) for arrays of constant size.
*
* See
* http://www.josuttis.com/cppcode
* for details and the latest version.
*
* (C) Copyright Nicolai M. Josuttis 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.
*
* Jul 31, 2000
*/
#ifndef BOOST_ARRAY_HPP
#define BOOST_ARRAY_HPP
#include <cstddef>
#include <stdexcept>
#include <iterator>
#include <algorithm>
// BUG-FIX for compilers that don't support
// std::size_t and std::ptrdiff_t yet
// (such as gcc)
#include <boost/config.hpp>
// LGB
// namespace boost {
template<class T, std::size_t N>
class array {
public:
T elems[N]; // fixed-size array of elements of type T
public:
// type definitions
typedef T value_type;
typedef T* iterator;
typedef const T* const_iterator;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// iterator support
iterator begin() { return elems; }
const_iterator begin() const { return elems; }
iterator end() { return elems+N; }
const_iterator end() const { return elems+N; }
// reverse iterator support
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
# else
// workaround for broken reverse_iterator implementations due to no partial specialization
typedef std::reverse_iterator<iterator,T> reverse_iterator;
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
# endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
// operator[]
reference operator[](size_type i) { return elems[i]; }
const_reference operator[](size_type i) const { return elems[i]; }
// at() with range check
reference at(size_type i) { rangecheck(i); return elems[i]; }
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
// front() and back()
reference front() { return elems[0]; }
const_reference front() const { return elems[0]; }
reference back() { return elems[N-1]; }
const_reference back() const { return elems[N-1]; }
// size is constant
static size_type size() { return N; }
static bool empty() { return false; }
static size_type max_size() { return N; }
enum { static_size = N };
public:
// swap (note: linear complexity)
void swap (array<T,N>& y) {
std::swap_ranges(begin(),end(),y.begin());
}
// direct access to data
const T* data() const { return elems; }
// assignment with type conversion
template <typename T2>
array<T,N>& operator= (const array<T2,N>& rhs) {
std::copy(rhs.begin(),rhs.end(), begin());
return *this;
}
// assign one value to all elements
void assign (const T& value)
{
std::fill_n(begin(),size(),value);
}
# ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
private:
# endif
// private member functions are allowed in aggregates [ISO 8.5.1]
static void rangecheck (size_type i) {
if (i >= size()) { throw std::range_error("array"); }
}
};
// comparisons
template<class T, std::size_t N>
bool operator== (const array<T,N>& x, const array<T,N>& y) {
return std::equal(x.begin(), x.end(), y.begin());
}
template<class T, std::size_t N>
bool operator< (const array<T,N>& x, const array<T,N>& y) {
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
}
template<class T, std::size_t N>
bool operator!= (const array<T,N>& x, const array<T,N>& y) {
return !(x==y);
}
template<class T, std::size_t N>
bool operator> (const array<T,N>& x, const array<T,N>& y) {
return y<x;
}
template<class T, std::size_t N>
bool operator<= (const array<T,N>& x, const array<T,N>& y) {
return !(y<x);
}
template<class T, std::size_t N>
bool operator>= (const array<T,N>& x, const array<T,N>& y) {
return !(x<y);
}
// global swap()
template<class T, std::size_t N>
inline void swap (array<T,N>& x, array<T,N>& y) {
x.swap(y);
}
// LGB
// } /* namespace boost */
#endif /*BOOST_ARRAY_HPP*/

346
boost/boost/config.hpp Normal file
View File

@ -0,0 +1,346 @@
// Boost config.hpp configuration 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.
// Boost config.hpp policy and rationale documentation has been moved to
// http://www.boost.org/libs/config
// Revision History (excluding minor changes for specific compilers)
// 25 Sep 00 BOOST_NO_STD_ALLOCATOR (Jeremy Siek)
// 18 SEP 00 BOOST_NO_SLIST, BOOST_NO_HASH,
// BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
// BOOST_NO_LIMITS (Jeremy Siek)
// 1 Sep 00 BOOST_NO_PRIVATE_IN_AGGREGATE added. (Mark Rodgers)
// 23 Jul 00 Fixed spelling of BOOST_NO_INCLASS_MEMBER_INITIALIZATION in
// comment (Dave Abrahams).
// 10 Jul 00 BOOST_NO_POINTER_TO_MEMBER_CONST added (Mark Rodgers)
// 26 Jun 00 BOOST_NO_STD_ITERATOR, BOOST_MSVC_STD_ITERATOR,
// BOOST_NO_STD_ITERATOR_TRAITS, BOOST_NO_USING_TEMPLATE,
// added (Jeremy Siek)
// 20 Jun 00 BOOST_MSVC added (Aleksey Gurtovoy)
// 14 Jun 00 BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS (Jens M.)
// 22 Mar 00 BOOST_MSVC6_MEMBER_TEMPLATES added (Dave Abrahams)
// 18 Feb 00 BOOST_NO_INCLASS_MEMBER_INITIALIZATION added (Jens Maurer)
// 26 Jan 00 Borland compiler support added (John Maddock)
// 26 Jan 00 Sun compiler support added (Jörg Schaible)
// 30 Dec 99 BOOST_NMEMBER_TEMPLATES compatibility moved here from
// smart_ptr.hpp. (Dave Abrahams)
// 15 Nov 99 BOOST_NO_OPERATORS_IN_NAMESPACE,
// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION added (Beman Dawes)
// 11 Oct 99 BOOST_NO_STDC_NAMESPACE refined; <cstddef> supplied
// 29 Sep 99 BOOST_NO_STDC_NAMESPACE added (Ed Brey)
// 24 Sep 99 BOOST_DECL added (Ed Brey)
// 10 Aug 99 Endedness flags added, GNU CC support added
// 22 Jul 99 Initial version
#ifndef BOOST_CONFIG_HPP
#define BOOST_CONFIG_HPP
// Conformance Flag Macros -------------------------------------------------//
//
// Conformance flag macros should identify the absence of C++ Standard
// conformance rather than its presence. This ensures that standard conforming
// compilers do not require a lot of configuration flag macros. It places the
// burden where it should be, on non-conforming compilers. In the future,
// hopefully, less rather than more conformance flags will have to be defined.
// BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS: Template value
// parameters cannot have a dependent type, for example
// "template<class T, typename T::type value> class X { ... };"
// BOOST_NO_INCLASS_MEMBER_INITIALIZATION: Compiler violates std::9.4.2/4.
// BOOST_NO_MEMBER_TEMPLATES: Member template functions not fully supported.
// Also see BOOST_MSVC6_MEMBER_TEMPLATES in the Compiler Control section below.
// BOOST_NO_MEMBER_TEMPLATE_FRIENDS: Member template friend syntax
// ("template<class P> friend class frd;") described in the C++ Standard,
// 14.5.3, not supported.
// BOOST_NO_OPERATORS_IN_NAMESPACE: Compiler requires inherited operator
// friend functions to be defined at namespace scope, then using'ed to boost.
// Probably GCC specific. See boost/operators.hpp for example.
// BOOST_NO_POINTER_TO_MEMBER_CONST: The compiler does not correctly handle
// pointers to const member functions, preventing use of these in overloaded
// function templates. See boost/functional.hpp for example.
// BOOST_NO_PRIVATE_IN_AGGREGATE: The compiler misreads 8.5.1, treating classes
// as non-aggregate if they contain private or protected member functions.
// BOOST_NO_STD_ITERATOR: The C++ implementation fails to provide the
// std::iterator class.
// BOOST_NO_STD_ITERATOR_TRAITS: The compiler does not provide a standard
// compliant implementation of std::iterator_traits. Note that
// the compiler may still have a non-standard implementation.
// BOOST_NO_STDC_NAMESPACE: The contents of C++ standard headers for C library
// functions (the <c...> headers) have not been placed in namespace std.
// Because the use of std::size_t is so common, a specific workaround for
// <cstddef> (and thus std::size_t) is provided in this header (see below).
// For other <c...> headers, a workaround must be provided in the boost header:
//
// #include <cstdlib> // for abs
// #ifdef BOOST_NO_STDC_NAMESPACE
// namespace std { using ::abs; }
// #endif
// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. Class template partial
// specialization (14.5.4 [temp.class.spec]) not supported.
// BOOST_NO_USING_TEMPLATE: The compiler will not accept a using declaration
// that imports a template from the global namespace into a named namespace.
// Probably Borland specific.
// Compiler Control or Information Macros ----------------------------------//
//
// Compilers often supply features outside of the C++ Standard which need to be
// controlled or detected. As usual, reasonable default behavior should occur
// if any of these macros are not defined.
// BOOST_DECL: Certain compilers for Microsoft operating systems require
// non-standard class and function decoration if dynamic load library linking
// is desired. BOOST_DECL supplies that decoration, defaulting to a nul string
// so that it is harmless when not required. Boost does not encourage the use
// of BOOST_DECL - it is non-standard and to be avoided if practical to do so.
// BOOST_DECL_EXPORTS: User defined, BOOST_DECL_EXPORTS causes BOOST_DECL to
// be defined as __declspec(dllexport) rather than __declspec(dllimport).
// BOOST_MSVC6_MEMBER_TEMPLATES: Microsoft Visual C++ 6.0 has enough member
// template idiosyncrasies (being polite) that BOOST_NO_MEMBER_TEMPLATES is
// defined for this compiler. BOOST_MSVC6_MEMBER_TEMPLATES is defined to allow
// compiler specific workarounds.
// BOOST_MSVC: defined as _MSC_VER for the Microsoft compiler only. In general,
// boost headers should test for a specific conformance flag macro (for
// example, BOOST_NO_MEMBER_TEMPLATE_FRIENDS) rather than a specific compiler.
// VC++ is a special case, however, since many libraries try to support it yet
// it has so many conformance issues that sometimes it is just easier to test
// for it directly. On the other hand, the obvious way to do this doesn't work,
// as many non-Microsoft compilers define _MSC_VER. Thus BOOST_MSVC.
// BOOST_MSVC_STD_ITERATOR: Microsoft's broken version of std::iterator
// is being used.
// BOOST_SYSTEM_HAS_STDINT_H: There are no 1998 C++ Standard headers <stdint.h>
// or <cstdint>, although the 1999 C Standard does include <stdint.h>.
// If <stdint.h> is present, <boost/stdint.h> can make good use of it,
// so a flag is supplied (signalling presence; thus the default is not
// present, conforming to the current C++ standard).
// BOOST_NO_SLIST: The C++ implementation does not provide the slist class.
// BOOST_NO_HASH: The C++ implementation does not provide the hash_set
// or hash_map classes.
// BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS: The standard library does not provide
// templated iterator constructors for its containers.
// BOOST_NO_LIMITS: The C++ implementation does not provide the <limits> header.
// BOOST_NO_INTRINSIC_WCHAR_T: The C++ implementation does not provide wchar_t,
// or it is really a synonym for another integral type. Use this symbol to
// decide whether it is appropriate to explicitly specialize a template on
// wchar_t if there is already a specialization for other integer types.
// BOOST_NO_STD_ALLOCATOR: The C++ standard library does not provide
// a standards conforming std::allocator.
// Compilers are listed in alphabetic order (except VC++ last - see below)---//
// GNU CC (also known as GCC and G++) --------------------------------------//
# if defined __GNUC__
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
# include <iterator> // not sure this is the right way to do this -JGS
# if !defined(_CXXRT_STD) && !defined(__SGI_STL) // need to ask Dietmar about this -JGS
# define BOOST_NO_STD_ITERATOR
# define BOOST_NO_LIMITS
# endif
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 8
# define BOOST_NO_MEMBER_TEMPLATES
# endif
// Kai C++ ------------------------------------------------------------------//
#elif defined __KCC
# define BOOST_NO_SLIST
# define BOOST_NO_HASH
// Greenhills C++ -----------------------------------------------------------//
#elif defined __ghs
# define BOOST_NO_SLIST
# define BOOST_NO_HASH
// Borland ------------------------------------------------------------------//
#elif defined __BORLANDC__
# if __BORLANDC__ <= 0x0551
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# endif
# if __BORLANDC__ <= 0x0550
// Borland C++ Builder 4 and 5:
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_USING_TEMPLATE
# if __BORLANDC__ == 0x0550
// Borland C++ Builder 5, command-line compiler 5.5:
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
# endif
# if defined BOOST_DECL_EXPORTS
# define BOOST_DECL __declspec(dllexport)
# else
# define BOOST_DECL __declspec(dllimport)
# endif
// Intel -------------------------------------------------------------------//
# elif defined __ICL
# include <iterator> // not sure this is the right way to do this -JGS
# if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
// a perfectly good implementation of std::iterator is supplied
# elif defined(__SGI_STL_ITERATOR)
# define BOOST_NO_STD_ITERATOR // No std::iterator in this case
# else // assume using dinkumware's STL that comes with VC++ 6.0
# define BOOST_MSVC_STD_ITERATOR
# define BOOST_NO_STD_ITERATOR_TRAITS
# define BOOST_NO_STDC_NAMESPACE
# define BOOST_NO_SLIST
# define BOOST_NO_HASH
# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
# define BOOST_NO_STD_ALLOCATOR
# endif
// Metrowerks CodeWarrior --------------------------------------------------//
# elif defined __MWERKS__
# if __MWERKS__ <= 0x4000
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# endif
# if __MWERKS__ <= 0x2301
# define BOOST_NO_POINTER_TO_MEMBER_CONST
# endif
# if __MWERKS__ >= 0x2300
# define BOOST_SYSTEM_HAS_STDINT_H
# endif
# if defined BOOST_DECL_EXPORTS
# define BOOST_DECL __declspec(dllexport)
# else
# define BOOST_DECL __declspec(dllimport)
# endif
// Sun Workshop Compiler C++ ------------------------------------------------//
# elif defined __SUNPRO_CC
# if __SUNPRO_CC <= 0x500
# define BOOST_NO_MEMBER_TEMPLATES
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# endif
// Microsoft Visual C++ (excluding Intel/EDG front end) --------------------//
//
// Must remain the last #elif since some other vendors (Metrowerks, for
// example) also #define _MSC_VER
# elif defined _MSC_VER
# define BOOST_MSVC _MSC_VER
// turn off the warnings before we #include anything
# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
# pragma warning( disable : 4503 ) // warning: decorated name length exceeded
# if _MSC_VER <= 1200 // 1200 == VC++ 6.0
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_INTRINSIC_WCHAR_T
// VC++ 6.0 has member templates but they have numerous problems including
// cases of silent failure, so for safety we define:
# define BOOST_NO_MEMBER_TEMPLATES
// For VC++ experts wishing to attempt workarounds, we define:
# define BOOST_MSVC6_MEMBER_TEMPLATES
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# include <iterator> // not sure this is the right way to do this -JGS
# if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
// a perfectly good implementation of std::iterator is supplied
# elif defined(__SGI_STL_ITERATOR)
# define BOOST_NO_STD_ITERATOR // No std::iterator in this case
# else
# define BOOST_MSVC_STD_ITERATOR 1
# define BOOST_NO_SLIST
# define BOOST_NO_HASH
# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
# define BOOST_NO_STD_ALLOCATOR
# endif
# define BOOST_NO_STD_ITERATOR_TRAITS
// Make sure at least one standard library header is included so that library
// implementation detection will work, even if no standard headers have been
// included in front of a boost header. (Ed Brey 5 Jun 00)
# include <cstddef>
// Determine if the standard library implementation is already pulling names
// into std. STLport defines the following if so. (Ed Brey 5 Jun 00)
# ifndef __STL_IMPORT_VENDOR_CSTD
# define BOOST_NO_STDC_NAMESPACE
# endif
# endif
# if defined BOOST_DECL_EXPORTS
# define BOOST_DECL __declspec(dllexport)
# else
# define BOOST_DECL __declspec(dllimport)
# endif
# endif // Microsoft (excluding Intel/EDG frontend)
# ifndef BOOST_DECL
# define BOOST_DECL // default for compilers not needing this decoration.
# endif
// end of compiler specific portion ----------------------------------------//
// Check for old name "BOOST_NMEMBER_TEMPLATES" for compatibility -----------//
// Don't use BOOST_NMEMBER_TEMPLATES. It is deprecated and will be removed soon.
#if defined( BOOST_NMEMBER_TEMPLATES ) && !defined( BOOST_NO_MEMBER_TEMPLATES )
#define BOOST_NO_MEMBER_TEMPLATES
#endif
// BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
//
// Because std::size_t usage is so common, even in boost headers which do not
// otherwise use the C library, the <cstddef> workaround is included here so
// that ugly workaround code need not appear in many other boost headers.
// NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
// must still be #included in the usual places so that <cstddef> inclusion
// works as expected with standard conforming compilers. The resulting
// double inclusion of <cstddef> is harmless.
# ifdef BOOST_NO_STDC_NAMESPACE
# include <cstddef>
namespace std { using ::ptrdiff_t; using ::size_t; }
// using ::wchar_t; removed since wchar_t is a C++ built-in type (Ed Brey)
# endif
#endif // BOOST_CONFIG_HPP

View File

@ -1,4 +1,4 @@
// boost utility.hpp header file ----------------------------------------//
// 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
@ -11,19 +11,22 @@
// Classes appear in alphabetical order
// Revision History
// 10 Dec 99 next() and prior() templates added.
// 30 Aug 99 moved cast templates to cast.hpp
// 26 Jan 00 protected noncopyable destructor added (Miki Jovanovic)
// 10 Dec 99 next() and prior() templates added (Dave Abrahams)
// 30 Aug 99 moved cast templates to cast.hpp (Beman Dawes)
// 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.
// 2 Jun 99 Initial Version. Class noncopyable only contents (Dave Abrahams)
#ifndef BOOST_UTILITY_HPP
#define BOOST_UTILITY_HPP
//#include <boost/config.hpp>
//#include <cstddef> // for size_t
#include <boost/config.hpp>
#include <cstddef> // for size_t
#include <utility> // for std::pair
// LGB
//namespace boost
//{
@ -52,15 +55,47 @@
// Contributed by Dave Abrahams
class noncopyable
{
protected:
class noncopyable
{
protected:
noncopyable(){}
private: // emphasize the following members are private
~noncopyable(){}
private: // emphasize the following members are private
noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& );
}; // noncopyable
}; // noncopyable
// class tied -------------------------------------------------------//
// A helper for conveniently assigning the two values from a pair
// into separate variables. The idea for this comes from Jaakko J„rvi's
// Binder/Lambda Library.
// Constributed by Jeremy Siek
template <class A, class B>
class tied {
public:
inline tied(A& a, B& b) : _a(a), _b(b) { }
template <class U, class V>
inline tied& operator=(const std::pair<U,V>& p) {
_a = p.first;
_b = p.second;
return *this;
}
protected:
A& _a;
B& _b;
};
template <class A, class B>
inline tied<A,B> tie(A& a, B& b) { return tied<A,B>(a, b); }
// LGB
//} // namespace boost
#endif // BOOST_UTILITY_HPP

1
boost/libs/README Normal file
View File

@ -0,0 +1 @@
This is just a placeholder. We will put boost cpp files here when we need them.

View File

@ -186,7 +186,8 @@ dnl Check the version of g++
case $gxx_version in
2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti -fno-exceptions";;
2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
2.96*) CXXFLAGS="-g $lyx_opt -fhonor-std -fvtable-thunks -ffunction-sections -fdata-sections";;
2.96*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
2.97*) CXXFLAGS="-g $lyx_opt -fhonor-std -fvtable-thunks -ffunction-sections -fdata-sections";;
*2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
esac
@ -197,6 +198,7 @@ dnl Check the version of g++
case $gxx_version in
2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";;
2.96*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";;
2.97*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";;
*) CXXFLAGS="$CXXFLAGS -W -Wall -Wno-return-type";;
esac
if test $lyx_devel_version = yes ; then

View File

@ -283,6 +283,7 @@ AC_OUTPUT([Makefile \
lib/Makefile \
intl/Makefile \
po/Makefile.in \
boost/Makefile \
src/Makefile \
src/mathed/Makefile \
src/graphics/Makefile \

View File

@ -18,7 +18,7 @@
#include FORMS_H_LOCATION
#include "undo.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
class LyXView;
class LyXText;

View File

@ -18,7 +18,7 @@
#include <map>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/**
This is a stateless class.

View File

@ -23,7 +23,7 @@
#include "DepTable.h"
#include <vector>
#include "support/utility.hpp"
#include <boost/utility.hpp>
class MiniBuffer;

View File

@ -10,7 +10,7 @@
#include "commandtags.h"
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** This class encapsulates LyX action and user command operations.
*/

View File

@ -20,7 +20,7 @@
#include "LString.h"
#include "Timeout.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
#include "layout.h"
class LyXFunc;

View File

@ -16,7 +16,8 @@ lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \
#lyx_LDFLAGS=-Wl,-O1
EXTRA_DIST = config.h.in stamp-h.in cheaders
ETAGS_ARGS = --lang=c++
INCLUDES = $(SIGC_CFLAGS) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = $(SIGC_CFLAGS) $(BOOST_INCLUDES) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@
localedir = $(datadir)/locale
lyx_SOURCES = \
BackStack.h \

View File

@ -20,7 +20,7 @@
#include "buffer.h"
#include "debug.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** A class to hold all the buffers in a structure
The point of this class is to hide from bufferlist what kind

View File

@ -23,7 +23,7 @@
#include "Bullet.h"
#include "insets/insetquotes.h"
#include "layout.h"
#include "support/block.h"
#include <boost/array.hpp>
struct Language;
@ -192,9 +192,9 @@ public:
///
string pagestyle;
///
block<Bullet, 4> temp_bullets;
array<Bullet, 4> temp_bullets;
///
block<Bullet, 4> user_defined_bullets;
array<Bullet, 4> user_defined_bullets;
///
void readPreamble(LyXLex &);
///

View File

@ -21,7 +21,7 @@
#include <vector>
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** An abstract base class for button policies.

View File

@ -22,7 +22,7 @@
#include <sigc++/signal_system.h>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
class DialogBase;

View File

@ -6,7 +6,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
# here.
SUBDIRS = xforms @FRONTEND@
ETAGS_ARGS = --lang=c++
INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/xforms ${SIGC_CFLAGS}
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=\

View File

@ -2,9 +2,10 @@ AUTOMAKE_OPTIONS = foreign 1.4
DISTCLEANFILES= *.orig *.rej *~ *.bak core
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libgnome.la
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = ${FRONTEND_INCLUDES} -I${top_srcdir}/src/ \
-I${top_srcdir}/src/frontends/ -I${top_srcdir}/src/frontends/xforms \
${SIGC_CFLAGS}
${SIGC_CFLAGS} $(BOOST_INCLUDES)
libgnome_la_OBJADD = \
../xforms/FormBase.lo \
../xforms/FormCitation.lo \

View File

@ -1,8 +1,9 @@
AUTOMAKE_OPTIONS = foreign 1.4
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libkde.la
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \
${SIGC_CFLAGS} ${FRONTEND_INCLUDES} \
${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \
-I${top_srcdir}/src/frontends/xforms
# just to make sure, automake makes them

View File

@ -14,7 +14,7 @@
#include "DialogBase.h"
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
#include FORMS_H_LOCATION
#include "ButtonController.h"
#include "gettext.h"

View File

@ -21,7 +21,7 @@
#include "LString.h"
#include "frontends/DialogBase.h"
#include "RadioButtonGroup.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
#ifdef __GNUG__
#pragma interface

View File

@ -14,7 +14,7 @@
#define FORM_PARAGRAPH_H
#include "DialogBase.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
#include <vector>
#ifdef __GNUG_

View File

@ -18,7 +18,7 @@
#define FORMTABULAR_H
#include "DialogBase.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;

View File

@ -2,9 +2,10 @@ AUTOMAKE_OPTIONS = foreign 1.4
DISTCLEANFILES= *.orig *.rej *~ *.bak core
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libxforms.la
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${top_srcdir}/src/ \
-I${top_srcdir}/src/frontends/ \
${SIGC_CFLAGS}
${SIGC_CFLAGS} $(BOOST_INCLUDES)
LIBS=
LDFLAGS=
LYXDATADIRS = forms

View File

@ -20,7 +20,7 @@
#include "LString.h"
#include "GraphicsCacheItem.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** GraphicsCache is the manager of the image cache.
It is responsible of create the GraphicsCacheItem's and maintain them.

View File

@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libgraphics.la
LIBS =
ETAGS_ARGS = --lang=c++
INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS)
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES)
libgraphics_la_SOURCES = \
Renderer.h \

View File

@ -20,7 +20,7 @@
#include "LString.h"
#include "X11/Xlib.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** Renderer is a base class that is used to take an image format, and
render it into a Pixmap in order to be able to display it later on

View File

@ -19,7 +19,7 @@
#include <iosfwd>
#include <map>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
class LyXLex;

View File

@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libinsets.la
LIBS =
ETAGS_ARGS = --lang=c++
INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS)
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES)
libinsets_la_SOURCES = \
BoundingBox.h \

View File

@ -18,7 +18,7 @@
#include "insetbutton.h"
#include <sigc++/signal_system.h>
#include "support/utility.hpp"
#include <boost/utility.hpp>
#ifdef SIGC_CXX_NAMESPACES
using SigC::Signal0;

View File

@ -19,7 +19,7 @@
#include <deque>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/** The latest documents loaded.
This class takes care of the last .lyx files used by the LyX user. It

View File

@ -21,7 +21,7 @@
#include "lyxlex.h"
#include "lyxfont.h"
#include "Spacing.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/// Reads the style files
extern void LyXSetStyle();

View File

@ -12,7 +12,7 @@
#ifndef LYX_GUI_H
#define LYX_GUI_H
#include "support/utility.hpp"
#include <boost/utility.hpp>
#ifdef __GNUG__
#pragma interface

View File

@ -22,7 +22,7 @@
#include <csignal>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
class LyXGUI;
class LyXRC;

View File

@ -14,7 +14,7 @@
#include <iosfwd>
#include "LString.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
///
struct keyword_item {

View File

@ -22,7 +22,7 @@
#include "insets/lyxinset.h"
#include "vspace.h"
#include "layout.h"
#include "support/block.h"
#include <boost/array.hpp>
#include "language.h"
class BufferParams;
@ -286,7 +286,7 @@ public:
private:
///
block<int, 10> counter_;
array<int, 10> counter_;
public:
///
void setCounter(int i, int v) { counter_[i] = v; }

View File

@ -17,7 +17,7 @@
#endif
#include "bufferparams.h"
#include "support/utility.hpp"
#include <boost/utility.hpp>
/// This contains the runtime configuration of LyX
class LyXRC : public noncopyable {

View File

@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libmathed.la
LIBS=
ETAGS_ARGS = --lang=c++
INCLUDES = -I${top_srcdir}/images -I${srcdir}/../ $(SIGC_CFLAGS)
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${top_srcdir}/images -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES)
libmathed_la_SOURCES = array.h \
formula.C \

View File

@ -37,6 +37,7 @@
#include "LyXView.h"
#include "Painter.h"
#include "font.h"
#include "support/lyxlib.h"
using std::ostream;
using std::istream;

View File

@ -30,6 +30,7 @@
#include "gettext.h"
#include "Painter.h"
#include "font.h"
#include "support/lyxlib.h"
using std::ostream;
using std::istream;

View File

@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libsupport.la
LIBS =
ETAGS_ARGS = --lang=c++
INCLUDES = -I${srcdir}/../
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = -I${srcdir}/../ $(BOOST_INCLUDES)
EXTRA_DIST = lyxstring.C lyxstring.h regex.c lyxregex.h
@ -32,7 +33,6 @@ libsupport_la_SOURCES = \
StrPool.h \
abort.C \
atoi.C \
block.h \
chdir.C \
copy.C \
date.C \
@ -62,5 +62,4 @@ libsupport_la_SOURCES = \
syssingleton.C \
translator.h \
textutils.h \
unlink.C \
utility.hpp
unlink.C

View File

@ -1,72 +0,0 @@
// -*- C++ -*-
#ifndef BLOCK_H
#define BLOCK_H
#include "LAssert.h"
///
template <class T, size_t s>
class block {
public:
///
typedef T value_type;
///
typedef size_t size_type;
///
typedef T * pointer;
///
typedef T const * const_pointer;
///
typedef T & reference;
///
typedef T const & const_reference;
///
typedef T * iterator;
///
typedef T const * const_iterator;
///
size_type size() const { return s; }
///
reference at(int i) {
Assert(i >= 0 && i < s);
return arr[i];
}
///
const_reference at(int i) const {
Assert(i >= 0 && i < s);
return arr[i];
}
///
reference operator[](int i) { return arr[i]; }
///
const_reference operator[](int i) const { return arr[i]; }
///
void operator=(block const & b) {
Assert(b.size() == size());
for (size_t i = 0; i < size(); ++i) {
arr[i] == b[i];
}
}
///
bool operator==(block const & b) const {
Assert(b.size() == size());
for (size_t i = 0; i < size(); ++i) {
if (arr[i] != b[i]) return false;
}
return true;
}
///
iterator begin() { return arr[0]; }
///
iterator end() { return arr[s]; }
///
const_iterator begin() const { return arr[0]; }
///
const_iterator end() const { return arr[s]; }
private:
///
T arr[s];
};
#endif // BLOCK_H_

View File

@ -283,7 +283,7 @@ bool suffixIs(string const & a, string const & suf)
string tmp(a, alen - suflen);
return ::strncmp(tmp.c_str(), suf.c_str(), suflen) == 0;
#else
return a.compare(alen - suflen, suflen, suf);
return a.compare(alen - suflen, suflen, suf) == 0;
#endif
}
}

View File

@ -5,7 +5,7 @@
#include "LString.h"
#include "filetools.h"
#include "lyxlib.h"
#include "utility.hpp"
#include <boost/utility.hpp>
#ifdef __GNUG__
#pragma interface