|
From: Foster B. <fos...@us...> - 2005-04-25 20:08:43
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22375/adobe-source/adobe Modified Files: eve.hpp xstr.hpp Added Files: extents.hpp Removed Files: rectangle.hpp Log Message: removed visual_refactor branch. Updated sandbox with visual_refactor changes. Index: eve.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/eve.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** eve.hpp 10 Apr 2005 08:15:14 -0000 1.2 --- eve.hpp 25 Apr 2005 20:07:33 -0000 1.3 *************** *** 21,25 **** #include <adobe/name_fwd.hpp> #include <adobe/virtual_machine.hpp> ! #include <adobe/rectangle.hpp> #include <adobe/source/expression_parser.hpp> --- 21,25 ---- #include <adobe/name_fwd.hpp> #include <adobe/virtual_machine.hpp> ! #include <adobe/extents.hpp> #include <adobe/source/expression_parser.hpp> *************** *** 33,37 **** class eve_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : boost::noncopyable, public rectangle_slices_t #endif { --- 33,37 ---- class eve_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : boost::noncopyable, public extents_slices_t #endif { *************** *** 118,126 **** /*************************************************************************************************/ - typedef points_of_interest_t guides_t; - struct eve_t::calculate_data_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : rectangle_slices_t #endif { --- 118,124 ---- /*************************************************************************************************/ struct eve_t::calculate_data_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : extents_slices_t #endif { *************** *** 136,140 **** pair_long_t outset_m; eve_t::alignment_t alignment_m; ! guides_t guides_m; bool suppress_m; bool balance_m; --- 134,138 ---- pair_long_t outset_m; eve_t::alignment_t alignment_m; ! guide_set_t guide_set_m; bool suppress_m; bool balance_m; *************** *** 160,164 **** struct eve_t::place_data_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : rectangle_slices_t #endif { --- 158,162 ---- struct eve_t::place_data_t #if !defined(ADOBE_NO_DOCUMENTATION) ! : extents_slices_t #endif { *************** *** 177,181 **** long position_m; pair_long_t outset_m; ! guides_t guides_m; }; --- 175,179 ---- long position_m; pair_long_t outset_m; ! guide_set_t guide_set_m; }; Index: xstr.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/xstr.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xstr.hpp 7 Apr 2005 00:53:24 -0000 1.1 --- xstr.hpp 25 Apr 2005 20:07:34 -0000 1.2 *************** *** 12,100 **** /*************************************************************************************************/ - #include <adobe/name_fwd.hpp> #include <adobe/dictionary_fwd.hpp> ! #include <adobe/algorithm.hpp> ! ! /*************************************************************************************************/ ! ! namespace adobe { ! /*************************************************************************************************/ ! class xstr_t; /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ ! #if !defined(ADOBE_NO_DOCUMENTATION) ! ! void swap(adobe::xstr_t& x, adobe::xstr_t& y); ! #endif /*************************************************************************************************/ ! namespace adobe { ! /*************************************************************************************************/ ! class xstr_t ! { ! public: ! typedef std::pair<const char*, const char*> parse_range_t; ! explicit xstr_t(const char* xstr); ! xstr_t(const char* xstr, std::size_t n); ! xstr_t(const char* xstr, std::size_t n, const adobe::dictionary_t& context); ! #if !defined(ADOBE_NO_DOCUMENTATION) ! xstr_t(const xstr_t& rhs); ! ~xstr_t(); ! xstr_t& operator = (const xstr_t& rhs); ! #endif ! const char* get() const; ! static void assign_glossary(const parse_range_t& parse_range); ! static void append_glossary(const parse_range_t& parse_range); ! static void set_default_context(const adobe::dictionary_t& context); ! static adobe::dictionary_t get_default_context(); private: - - #if !defined(ADOBE_NO_DOCUMENTATION) - - friend void ::swap(adobe::xstr_t& x, adobe::xstr_t& y); - struct implementation_t; implementation_t* object_m; - - #endif - }; /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ ! #if !defined(ADOBE_NO_DOCUMENTATION) ! ! inline void swap(adobe::xstr_t& x, adobe::xstr_t& y) ! { adobe::swap(x.object_m, y.object_m); } ! ! #endif /*************************************************************************************************/ --- 12,91 ---- /*************************************************************************************************/ #include <adobe/dictionary_fwd.hpp> ! #include <adobe/name.hpp> ! #include <boost/function.hpp> ! #include <string> ! #include <istream> ! #include <vector> /*************************************************************************************************/ ! namespace adobe { /*************************************************************************************************/ ! typedef std::pair<adobe::name_t, adobe::name_t> attribute_t; ! typedef std::vector<attribute_t> attribute_set_t; ! typedef boost::function<std::string ( const adobe::name_t& name, ! const attribute_set_t& attribute_set, ! const std::string& value)> xml_element_proc_t; /*************************************************************************************************/ ! void xstring_glossary(std::istream& stream); ! void xstring_glossary(std::istream& stream, const char* file, int line); ! void xstring_glossary(std::istream& stream, const adobe::dictionary_t& context); ! void xstring_glossary(std::istream& stream, const adobe::dictionary_t& context, const char* file, int line); ! void xstring_clear_glossary(); ! // Parses an XML fragment ! std::string parse_xml_fragment(const std::string& fragment, const xml_element_proc_t proc); ! // All of these functions return a valid XML fragment ! std::string xstring(const char* xstr); ! std::string xstring(const char* xstr, std::size_t n); ! std::string xstring(const std::string& xstr); ! std::string xstring(const char* xstr, const adobe::dictionary_t& context); ! std::string xstring(const char* xstr, std::size_t n, const adobe::dictionary_t& context); ! std::string xstring(const std::string& xstr, const adobe::dictionary_t& context); ! // Converts an xml fragment to utf-8, any unknown markup is stripped. ! std::string finalize_xml_fragment(const std::string& fragment); ! /*************************************************************************************************/ ! // sets the default context (default context is thread local storage) with a global base context that picks up platform and locale ! struct xstring_context_t ! { ! explicit xstring_context_t(const attribute_set_t&); ! xstring_context_t(const adobe::name_t& name, const adobe::name_t& value); ! ~xstring_context_t(); private: struct implementation_t; implementation_t* object_m; }; /*************************************************************************************************/ ! std::string xml_element_echo( const adobe::name_t& name, ! const adobe::attribute_set_t& attribute_set, ! const std::string& value); /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ --- rectangle.hpp DELETED --- --- NEW FILE: extents.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_EXTENTS_HPP #define ADOBE_EXTENTS_HPP #include <boost/array.hpp> #include <boost/operators.hpp> #include <vector> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ template <typename T> struct point_2d; struct extents_t; /****************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ void swap(adobe::extents_t&, adobe::extents_t&); template <typename T> bool operator == (const adobe::point_2d<T>&, const adobe::point_2d<T>&); /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ template <typename T = long> struct point_2d { point_2d() : x_m(T()), y_m(T()) { } point_2d(const T& x, const T& y) : x_m(x), y_m(y) { } point_2d(const point_2d& rhs) : x_m(rhs.x_m), y_m(rhs.y_m) { } point_2d& operator = (const point_2d& rhs) { x_m = rhs.x_m; y_m = rhs.y_m; return *this; } T x_m; T y_m; }; typedef std::pair<long, long> pair_long_t; typedef point_2d<long> point_2d_t; typedef std::vector<long> guide_set_t; // REVISIT (sparent) : points of interest need to be named entities. This will become: #if 0 struct guide_set_t { adobe::name_t name_m; long offset_m; }; typedef std::vector<guide_set_t> point_of_interest_set_t; #endif // REVISIT (sparent) : Open issue - are there "alignment" attributes on POIs? struct extents_slices_t { enum slice_select_t { horizontal, vertical }; }; /****************************************************************************************************/ struct extents_t : #if !defined(ADOBE_NO_DOCUMENTATION) private extents_slices_t, boost::equality_comparable<extents_t> #endif { struct slice_t : boost::equality_comparable<slice_t> { slice_t() : length_m(0) { }; long length_m; pair_long_t outset_m; pair_long_t frame_m; pair_long_t inset_m; guide_set_t poi_m; #if !defined(ADOBE_NO_DOCUMENTATION) friend bool operator == (const adobe::extents_t::slice_t& x, const adobe::extents_t::slice_t& y); #if defined(ADOBE_SERIALIZATION) friend std::ostream& operator << (std::ostream& s, const adobe::extents_t::slice_t& x); #endif #endif }; boost::array<slice_t, 2> slice_m; slice_t& vertical() { return slice_m[extents_slices_t::vertical]; } slice_t& horizontal() { return slice_m[extents_slices_t::horizontal]; } const slice_t& vertical() const { return slice_m[extents_slices_t::vertical]; } const slice_t& horizontal() const { return slice_m[extents_slices_t::horizontal]; } long& height() { return vertical().length_m; } long& width() { return horizontal().length_m; } const long& height() const { return vertical().length_m; } const long& width() const { return horizontal().length_m; } #if !defined(ADOBE_NO_DOCUMENTATION) friend void ::swap(adobe::extents_t&, adobe::extents_t&); friend bool operator == (const adobe::extents_t& x, const adobe::extents_t& y); #if defined(ADOBE_SERIALIZATION) friend std::ostream& operator << (std::ostream& s, const adobe::extents_t& x); #endif #endif }; /****************************************************************************************************/ bool operator == (const adobe::extents_t& x, const adobe::extents_t& y); #if defined(ADOBE_SERIALIZATION) std::ostream& operator << (std::ostream& s, const adobe::extents_t& x); #endif bool operator == (const adobe::extents_t::slice_t& x, const adobe::extents_t::slice_t& y); #if defined(ADOBE_SERIALIZATION) std::ostream& operator << (std::ostream& s, const adobe::extents_t::slice_t& x); #endif /****************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ inline void swap(adobe::extents_t& x, adobe::extents_t& y) { std::swap(x.slice_m, y.slice_m); } /****************************************************************************************************/ template <typename T> bool operator == (const adobe::point_2d<T>& a, const adobe::point_2d<T>& b) { return a.x_m == b.x_m && a.y_m == b.y_m; } /****************************************************************************************************/ #endif /****************************************************************************************************/ |