You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(67) |
Apr
(455) |
May
(202) |
Jun
(136) |
Jul
(203) |
Aug
(60) |
Sep
(88) |
Oct
(64) |
Nov
(56) |
Dec
(78) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(271) |
Feb
(207) |
Mar
|
Apr
|
May
(167) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Foster B. <fos...@us...> - 2006-02-23 23:29:08
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/adobe/test/gil Modified Files: image.cpp Log Message: the state of things. We've been working to isolate static_text_t (now called label_t) but it has been slow going because we're trying to wrestle with perfecting the API and what effect that has on other components that were using label_t in a way that isn't in accordance with the new API we're trying to write. As it stands static_disabled_text_m is broken on both platforms, but everything else should be working better. Index: image.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/image.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** image.cpp 3 Feb 2006 18:33:39 -0000 1.2 --- image.cpp 23 Feb 2006 23:28:57 -0000 1.3 *************** *** 131,135 **** check_image(img_view,prefix+"original.jpg"); ! check_image(subimage_view(img_view, round(img_view.dimensions()/4), round(img_view.dimensions()/2)),prefix+"cropped.jpg"); check_image(color_convert_view<gray8_pixel>(img_view),prefix+"gray8.jpg"); // check_image(transpose_view(img_view),prefix+"transpose.jpg"); --- 131,135 ---- check_image(img_view,prefix+"original.jpg"); ! check_image(subimage_view(img_view, iround(img_view.dimensions()/4), iround(img_view.dimensions()/2)),prefix+"cropped.jpg"); check_image(color_convert_view<gray8_pixel>(img_view),prefix+"gray8.jpg"); // check_image(transpose_view(img_view),prefix+"transpose.jpg"); *************** *** 219,223 **** load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image transf(rgb8_image::point_type(round(view(img).dimensions()/2))); #ifdef NO_ASL --- 219,223 ---- load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image transf(rgb8_image::point_type(iround(view(img).dimensions()/2))); #ifdef NO_ASL |
From: Foster B. <fos...@us...> - 2006-02-23 23:29:05
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/adobe/test/begin/headers Modified Files: express_viewer.hpp Added Files: file.hpp Log Message: the state of things. We've been working to isolate static_text_t (now called label_t) but it has been slow going because we're trying to wrestle with perfecting the API and what effect that has on other components that were using label_t in a way that isn't in accordance with the new API we're trying to write. As it stands static_disabled_text_m is broken on both platforms, but everything else should be working better. --- NEW FILE: file.hpp --- /* Copyright 2005-2006 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_BEGIN_FILE_HPP #define ADOBE_BEGIN_FILE_HPP #include <adobe/config.hpp> #include <adobe/future/file_slurp.hpp> #include <adobe/future/enum_ops.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/path.hpp> #include <boost/function.hpp> #include <string> #include <iostream> /****************************************************************************************************/ namespace bfs = boost::filesystem; /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ class file_buffer_t { public: enum line_ending_t { line_ending_unknown_k = 0, line_ending_platform_k = 1 << 0L, line_ending_unix_k = 1 << 1L, // LF line_ending_windows_k = 1 << 2L, // CR+LF line_ending_mac_os_classic_k = 1 << 3L, // CR line_ending_mac_os_x_k = line_ending_unix_k // LF }; typedef boost::function<void (bool)> dirty_proc_t; file_buffer_t(); void set_path(const bfs::path& path); template <typename I> void set_contents(I first, I last) { contents_m.assign(first, last); set_dirty(true); } inline void set_line_endings(line_ending_t le, bool force = false); void save(); bfs::path directory_path() const { return path_m.branch_path(); } const bfs::path& get_path() const { return path_m; } const char* file_name() const { return path_m.string().c_str(); } bool is_valid() const { return bfs::exists(path_m); } const std::string& as_string() const { return contents_m; } void monitor_dirty(dirty_proc_t proc) { dirty_proc_m = proc; } private: void set_dirty(bool to); void replace_all(const char* src, const char* dst); void set_line_endings_impl(line_ending_t le, bool force = false); bfs::path path_m; ///< Path to the current file std::string contents_m; ///< Contents of the file (not necessarily same as that in file) bool dirty_m; ///< Dirty bit dirty_proc_t dirty_proc_m; ///< Dirty bit modification notifier line_ending_t le_m; ///< Line ending flags }; /****************************************************************************************************/ ADOBE_DEFINE_BITSET_OPS(file_buffer_t::line_ending_t) /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif /****************************************************************************************************/ Index: express_viewer.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers/express_viewer.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** express_viewer.hpp 3 Feb 2006 18:33:38 -0000 1.8 --- express_viewer.hpp 23 Feb 2006 23:28:57 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- #include "client_assembler.hpp" + #include "file.hpp" #include <string> *************** *** 84,268 **** /****************************************************************************************************/ - // REVISIT (fbrereto) : This is all a hack. Get notifiers in here instead of as_string and the like. - - class file_buffer_t - { - public: - enum line_ending_t - { - line_ending_unknown_k = 0, - line_ending_platform_k = 1 << 0L, - line_ending_unix_k = 1 << 1L, // LF - line_ending_windows_k = 1 << 2L, // CR+LF - line_ending_mac_os_classic_k = 1 << 3L, // CR - line_ending_mac_os_x_k = line_ending_unix_k // LF - }; - - typedef boost::function<void (bool)> dirty_proc_t; - - file_buffer_t() : - le_m(line_ending_unknown_k) - { } - - void set_path(const boost::filesystem::path& path) - { - path_m = path; - - adobe::file_slurp<char> slurp(path_m); - - contents_m.assign(slurp.begin(), slurp.end()); - - set_line_endings_impl(le_m, true); - - set_dirty(false); - } - - // NOTE (fbrereto) : Mat Marcus made me do it! - const boost::filesystem::path& get_path() const - { return path_m; } - - template <typename I> - void set_contents(I first, I last) - { - contents_m.assign(first, last); - - set_dirty(true); - } - - inline void set_line_endings(line_ending_t le, bool force = false) - { - set_line_endings_impl(le, force); - - set_dirty(true); - } - - void save() - { - if (!dirty_m) return; - - bfs::ofstream output( path_m, std::ios_base::out | std::ios_base::binary ); - - // - // Verify that we were able to open the file for writing. - // - - if ( output.fail() ) - throw std::runtime_error( "Error opening file for writing: \"" - + path_m.string() + "\"" ); - - if (le_m == line_ending_unknown_k) - set_line_endings(le_m); - - output << contents_m; - - set_dirty(false); - } - - void monitor_dirty(dirty_proc_t proc) - { dirty_proc_m = proc; } - - bfs::path directory_path() const - { return path_m.branch_path(); } - - const char* file_name() const - { - return path_m.string().c_str(); - } - - bool valid() const - { return bfs::exists(path_m); } - - inline const std::string& as_string() const - { return contents_m; } - - private: - - void set_dirty(bool to) - { - if (dirty_m == to) return; - - dirty_m = to; - - if (dirty_proc_m) - dirty_proc_m(dirty_m); - } - - void replace_all(const char* src, const char* dst) - { - // replaces all instances of src with dst - - std::string::size_type result(0); - std::size_t src_n(std::strlen(src)); - std::size_t dst_n(std::strlen(dst)); - - while (true) - { - result = contents_m.find(src, result); - - if (result == std::string::npos) break; - - contents_m.replace(result, src_n, dst, dst_n); - - result += dst_n; - } - } - - void set_line_endings_impl(line_ending_t le, bool force = false) - { - if (le_m == le && !force && - le_m != line_ending_unknown_k) return; - - if (le == line_ending_platform_k || le == line_ending_unknown_k) - { - #if ADOBE_PLATFORM_WIN - le_m = line_ending_windows_k; - #else - le_m = line_ending_unix_k; - #endif - } - else - { - le_m = le; - } - - // REVISIT (fbrereto) : Not as optimal as it could be. - - if (le_m == line_ending_unix_k) - { - replace_all("\r\n", "\n"); - replace_all("\r", "\n"); - } - else if (le_m == line_ending_windows_k) - { - replace_all("\r\n", "\n"); - replace_all("\r", "\n"); - replace_all("\n", "\r\n"); - } - else if (le_m == line_ending_mac_os_classic_k) - { - replace_all("\r\n", "\r"); - replace_all("\n", "\r"); - } - else - throw std::runtime_error("unknown line ending type"); - - // set line endings back to 'unknown' if - // that's what they were originally - if (le == line_ending_unknown_k) le_m = line_ending_unknown_k; - } - - bfs::path path_m; ///< Path to the current file - std::string contents_m; ///< Contents of the file (not necessarily same as that in file) - bool dirty_m; ///< Dirty bit - dirty_proc_t dirty_proc_m; ///< Dirty bit modification notifier - line_ending_t le_m; ///< Line ending flags - }; - - /****************************************************************************************************/ - - ADOBE_DEFINE_BITSET_OPS(file_buffer_t::line_ending_t) - - /****************************************************************************************************/ - // /// The application_t class is implemented in express_viewer.cpp and defines --- 85,88 ---- *************** *** 478,479 **** --- 298,300 ---- #endif + /****************************************************************************************************/ |
From: Foster B. <fos...@us...> - 2006-02-23 23:29:00
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/algorithm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/adobe/algorithm Added Files: copy.hpp Log Message: the state of things. We've been working to isolate static_text_t (now called label_t) but it has been slow going because we're trying to wrestle with perfecting the API and what effect that has on other components that were using label_t in a way that isn't in accordance with the new API we're trying to write. As it stands static_disabled_text_m is broken on both platforms, but everything else should be working better. --- NEW FILE: copy.hpp --- /* Copyright 2005-2006 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_ALGORITHM_COPY_HPP #define ADOBE_ALGORITHM_COPY_HPP #include <adobe/config.hpp> /*************************************************************************************************/ namespace adobe { #if !defined(ADOBE_NO_DOCUMENTATION) namespace fn { } using namespace fn; namespace fn { #endif /*************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////// /// /// \brief copy_n taken from SGI STL. /// //////////////////////////////////////////////////////////////////////////////////////// namespace detail { template <class InputIter, class Size, class OutputIter> std::pair<InputIter, OutputIter> _copy_n(InputIter first, Size count, OutputIter result, std::input_iterator_tag) { for ( ; count > 0; --count) { *result = *first; ++first; ++result; } return std::pair<InputIter, OutputIter>(first, result); } template <class RAIter, class Size, class OutputIter> inline std::pair<RAIter, OutputIter> _copy_n(RAIter first, Size count, OutputIter result, std::random_access_iterator_tag) { RAIter last = first + count; return std::pair<RAIter, OutputIter>(last, std::copy(first, last, result)); } template <class InputIter, class Size, class OutputIter> inline std::pair<InputIter, OutputIter> _copy_n(InputIter first, Size count, OutputIter result) { return _copy_n(first, count, result, typename std::iterator_traits<InputIter>::iterator_category()); } } template <class InputIter, class Size, class OutputIter> inline std::pair<InputIter, OutputIter> copy_n(InputIter first, Size count, OutputIter result) { return detail::_copy_n(first, count, result); } /*************************************************************************************************/ #if !defined(ADOBE_NO_DOCUMENTATION) } // namespace fn #endif } // namespace adobe /*************************************************************************************************/ #endif // ADOBE_ALGORITHM_COPY_HPP |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/documentation/sources/tutorials Modified Files: array_tutorial.dox dictionary_tutorial.dox eve_tutorial.dox forest_tutorial.dox namespaces_tutorial.dox value_tutorial.dox Log Message: asl 1.0.13 Index: value_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/value_tutorial.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** value_tutorial.dox 19 Mar 2005 00:16:42 -0000 1.1 --- value_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 10,14 **** \par adobe::value_t is a pseudo-discriminated union. Before we can go any further we must first understand what a discriminated type is. Kevin Henney best describes discriminated types in his documentation of <a href="http://www.boost.org/doc/html/any.html#id447427">boost::any</a>: ! - <i>Discriminated types ... contain values of different types but do not attempt conversion between them, i.e. <code>5</code> is held strictly as an <code>int</code> and is not implicitly convertible either to <code>"5"</code> or to <code>5.0</code>. Their indifference to interpretation but awareness of type effectively makes them safe, generic containers of single values, with no scope for surprises from ambiguous conversions.</i> \par A discriminated union, then, is a type that can retain any one of a collection of discriminated types, but then only one at a time. In the case of adobe::value_t its storable type range is limited to any type modeling the \ref background_data_type_requirements. --- 10,14 ---- \par adobe::value_t is a pseudo-discriminated union. Before we can go any further we must first understand what a discriminated type is. Kevin Henney best describes discriminated types in his documentation of <a href="http://www.boost.org/doc/html/any.html#id447427">boost::any</a>: ! - <i>Discriminated types ... contain values of different types but do not attempt conversion between them, i.e. <code>5</code> is held strictly as an <code>int</code> and is not implicitly convertible either to <code>"5"</code> or to <code>5.0</code>. Their indifference to interpretation but awareness of type effectively makes them safe, generic containers of single values, with no scope for surprises from ambiguous conversions.</i> \par A discriminated union, then, is a type that can retain any one of a collection of discriminated types, but then only one at a time. In the case of adobe::value_t its storable type range is limited to any type modeling the \ref background_data_type_requirements. *************** *** 19,26 **** \par \code ! adobe::value_t my_int(5); ! adobe::value_t my_string(std::string("Hello, world!")); ! adobe::value_t my_whizzy_class(whizzy_class(/*...*/)); ! adobe::value_t my_some_other_regular_type(/*...*/); \endcode \par --- 19,26 ---- \par \code ! adobe::value_t my_int(5); ! adobe::value_t my_string(std::string("Hello, world!")); ! adobe::value_t my_whizzy_class(whizzy_class(/*...*/)); ! adobe::value_t my_some_other_regular_type(/*...*/); \endcode \par *************** *** 55,59 **** struct promote { ! typedef T type; // promote<T>::type is, by default, T }; \endcode --- 55,59 ---- struct promote { ! typedef T type; // promote<T>::type is, by default, T }; \endcode *************** *** 65,69 **** struct promote<int> { ! typedef double type; // promote<int>::type is now a double }; \endcode --- 65,69 ---- struct promote<int> { ! typedef double type; // promote<int>::type is now a double }; \endcode *************** *** 75,79 **** struct promote<double> { ! typedef int type; // Legal, but bad: possible data loss }; \endcode --- 75,79 ---- struct promote<double> { ! typedef int type; // Legal, but bad: possible data loss }; \endcode *************** *** 102,114 **** \par \code ! typedef std::vector<adobe::value_t> my_vector_value_type; ! my_vector_value_type my_vector_value; ! my_vector_value.push_back(adobe::value_t(5)); ! my_vector_value.push_back(adobe::value_t('A')); ! my_vector_value.push_back(adobe::value_t(std::string("hello, world!")); ! adobe::value_t my_vector_value_value(my_vector_value); \endcode --- 102,114 ---- \par \code ! typedef std::vector<adobe::value_t> my_vector_value_type; ! my_vector_value_type my_vector_value; ! my_vector_value.push_back(adobe::value_t(5)); ! my_vector_value.push_back(adobe::value_t('A')); ! my_vector_value.push_back(adobe::value_t(std::string("hello, world!")); ! adobe::value_t my_vector_value_value(my_vector_value); \endcode *************** *** 124,132 **** if (my_value.type() == typeid(std::string)) { ! // ... } else if (my_value.type() == typeid(double)) { ! // ... } \endcode --- 124,132 ---- if (my_value.type() == typeid(std::string)) { ! // ... } else if (my_value.type() == typeid(double)) { ! // ... } \endcode *************** *** 139,147 **** if (my_int_value.type() == typeid(int)) { ! // not here! } else if (my_int_value.type() == typeid(double)) { ! // you'll end up in here } \endcode --- 139,147 ---- if (my_int_value.type() == typeid(int)) { ! // not here! } else if (my_int_value.type() == typeid(double)) { ! // you'll end up in here } \endcode *************** *** 173,185 **** try { ! int x = my_value.get<int>(); } catch(const std::exception& err) { ! std::cerr << err.what() << std::endl; } catch(...) { ! std::cerr << "don't know what happened!" << std::endl; } \endcode --- 173,185 ---- try { ! int x = my_value.get<int>(); } catch(const std::exception& err) { ! std::cerr << err.what() << std::endl; } catch(...) { ! std::cerr << "don't know what happened!" << std::endl; } \endcode *************** *** 203,211 **** int main(/*...*/) { ! adobe::value_t my_value(std::string("Hello, world!"); ! std::cout << my_value << std::endl; // Prints "Hello, world!" ! return 0; } \endcode --- 203,211 ---- int main(/*...*/) { ! adobe::value_t my_value(std::string("Hello, world!"); ! std::cout << my_value << std::endl; // Prints "Hello, world!" ! return 0; } \endcode Index: forest_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/forest_tutorial.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forest_tutorial.dox 19 Mar 2005 00:16:42 -0000 1.1 --- forest_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 36,53 **** \par There are several types of iterators available to \c adobe::forest. They are: ! - <b><code>forest::iterator</code></b>: (also known as the fullorder iterator.) ! Visits the nodes by \<parent\>\<children\>\<children\>\<parent\>. ! Each node in the forest is visted twice. ! - <b><code>forest::preorder_iterator</code></b>: ! Visits the nodes by \<parent\>\<children\>. ! Each node in the forest is visted once. ! - <b><code>forest::postorder_iterator</code></b>: ! Visits the nodes by \<children\>\<parent\>. ! Each node in the forest is visted once. ! - <b><code>forest::child_iterator</code></b>: From any given node, \c child_iterator is ! a bidirectional iterator that walks a range of <i>siblings</i> (not the node's children) ! by "pivoting" on each node. There is a \c child_begin() and \c child_end() function to ! give you a range for the children of any node. Thus the \c child_iterator only applies ! to the first level of siblings, not to grandchildren or beyond. \par There are also \c reverse_ versions of the \c fullorder and \c child iterators, and \c const_ versions of the \c fullorder and \c child iterators. --- 36,53 ---- \par There are several types of iterators available to \c adobe::forest. They are: ! - <b><code>forest::iterator</code></b>: (also known as the fullorder iterator.) ! Visits the nodes by \<parent\>\<children\>\<children\>\<parent\>. ! Each node in the forest is visted twice. ! - <b><code>forest::preorder_iterator</code></b>: ! Visits the nodes by \<parent\>\<children\>. ! Each node in the forest is visted once. ! - <b><code>forest::postorder_iterator</code></b>: ! Visits the nodes by \<children\>\<parent\>. ! Each node in the forest is visted once. ! - <b><code>forest::child_iterator</code></b>: From any given node, \c child_iterator is ! a bidirectional iterator that walks a range of <i>siblings</i> (not the node's children) ! by "pivoting" on each node. There is a \c child_begin() and \c child_end() function to ! give you a range for the children of any node. Thus the \c child_iterator only applies ! to the first level of siblings, not to grandchildren or beyond. \par There are also \c reverse_ versions of the \c fullorder and \c child iterators, and \c const_ versions of the \c fullorder and \c child iterators. *************** *** 58,65 **** \par Consider the simple forest example above. Now let's say we wanted to insert a new node, <code>D</code>, somewhere around any given node in the tree (in this case we'll use node <code>A</code>). Given node \c A there are four distinct relationships \c D will have to \c A after insertion. The four possible relationships are: ! -# As the previous sibling to \c A. Note the iterator is pointing to \c A. ! -# As the next sibling to \c A. Note the iterator is pointing to \c forest::end(). ! -# As the first child of \c A, or the previous sibling of \c B. Note the iterator is pointing to \c B. ! -# As the last child of \c A, or the next sibling of \c C. Note the iterator is pointing to \c A. \par Observe that the last two relationships are similar to the first two. Consider this visual of the above situation: --- 58,65 ---- \par Consider the simple forest example above. Now let's say we wanted to insert a new node, <code>D</code>, somewhere around any given node in the tree (in this case we'll use node <code>A</code>). Given node \c A there are four distinct relationships \c D will have to \c A after insertion. The four possible relationships are: ! -# As the previous sibling to \c A. Note the iterator is pointing to \c A. ! -# As the next sibling to \c A. Note the iterator is pointing to \c forest::end(). ! -# As the first child of \c A, or the previous sibling of \c B. Note the iterator is pointing to \c B. ! -# As the last child of \c A, or the next sibling of \c C. Note the iterator is pointing to \c A. \par Observe that the last two relationships are similar to the first two. Consider this visual of the above situation: Index: namespaces_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/namespaces_tutorial.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** namespaces_tutorial.dox 28 Apr 2005 05:33:26 -0000 1.1 --- namespaces_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 64,70 **** In specifying these guidelines the following goals were considered: ! - Any set of libraries, even those providing overlapping functionality, with different primary namespaces, should not conflict. ! - Any set of declarations with matching semantics should have matching names, including namespace. ! - The C++ standard should not be violated - rather issues with the standard should be addressed through the standard committee. Unfortunately, the first two of these goals often come into conflict. Part of the problem is the lack of function partial specialization support, however, in cases of general extensions to a library it is difficult to come up with _any_ set of rules which would satisfy the first goal. Here we have tried to provide a reasonable balance which handles most cases. --- 64,70 ---- In specifying these guidelines the following goals were considered: ! - Any set of libraries, even those providing overlapping functionality, with different primary namespaces, should not conflict. ! - Any set of declarations with matching semantics should have matching names, including namespace. ! - The C++ standard should not be violated - rather issues with the standard should be addressed through the standard committee. Unfortunately, the first two of these goals often come into conflict. Part of the problem is the lack of function partial specialization support, however, in cases of general extensions to a library it is difficult to come up with _any_ set of rules which would satisfy the first goal. Here we have tried to provide a reasonable balance which handles most cases. Index: array_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/array_tutorial.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** array_tutorial.dox 19 Mar 2005 00:16:42 -0000 1.1 --- array_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 14,29 **** void foo(adobe::array_t param) // makes a copy of the array_t { ! std::cout << param[0].get<std::string>(); } int main(/*...*/) { ! adobe::array_t my_array; ! /* add elements of type adobe::value_t to my_array */ ! foo(my_array); ! return 0; } \endcode --- 14,29 ---- void foo(adobe::array_t param) // makes a copy of the array_t { ! std::cout << param[0].get<std::string>(); } int main(/*...*/) { ! adobe::array_t my_array; ! /* add elements of type adobe::value_t to my_array */ ! foo(my_array); ! return 0; } \endcode *************** *** 105,120 **** for (; first != last; ++first) { ! if (first->type() == typeid(std::string)) ! { ! std::cout << "Found a string: " << first->get<std::string>() << std::endl; ! } ! else if (first->type() == typeid(double)) ! { ! std::cout << "Found a number: " << first->get<double>() << std::endl; ! } ! else ! { ! std::cout << "I have no idea what we've found!" << std::endl; ! } } \endcode --- 105,120 ---- for (; first != last; ++first) { ! if (first->type() == typeid(std::string)) ! { ! std::cout << "Found a string: " << first->get<std::string>() << std::endl; ! } ! else if (first->type() == typeid(double)) ! { ! std::cout << "Found a number: " << first->get<double>() << std::endl; ! } ! else ! { ! std::cout << "I have no idea what we've found!" << std::endl; ! } } \endcode Index: eve_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/eve_tutorial.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eve_tutorial.dox 19 Mar 2005 00:16:42 -0000 1.1 --- eve_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.2 *************** *** 8,21 **** \par The following list of items is a good recommendation of stuff you should know before you attempt to work through this document: ! - boost::function ! - boost::bind ! - adobe::dictionary_t ! - Cursory reading of the \ref eve_engine (Engine) and \ref eveparser documentation \par For advanced implementations, the following might be of help <i>but are not required</i>: ! - adobe/future/assemblage.hpp ! - adobe/test/visual/headers/optional_connect.hpp \par ! The sample code found in the Adobe Begin implementation (especially <code>client_assembler.cpp</code>) shows a possible implementation using these techniques. Note that Adobe Begin is an experimental work in progress, and should be used loosely as an example only! \section tutorials_eve_overview Overview --- 8,21 ---- \par The following list of items is a good recommendation of stuff you should know before you attempt to work through this document: ! - boost::function ! - boost::bind ! - adobe::dictionary_t ! - Cursory reading of the \ref eve_engine (Engine) and \ref eveparser documentation \par For advanced implementations, the following might be of help <i>but are not required</i>: ! - adobe/future/assemblage.hpp ! - adobe/test/visual/headers/optional_connect.hpp \par ! The sample code found in the Adobe Begin implementation (especially <code>client_assembler.cpp</code>) shows a possible implementation using these techniques. Note that Adobe Begin is an experimental work in progress, and should be used loosely as an example only! \section tutorials_eve_overview Overview *************** *** 28,42 **** \par The easiest way to see what is happening in a design that includes Eve is to enumerate the steps involved in solving a layout: ! -# The client code specifies an Eve file for parsed, solved, and displayed. ! -# The client code creates an <code>eve_t</code> object that is the Eve Engine instance that will manage the widgets at runtime. ! -# The client code calls the Eve Parser with (among other parameters) an input stream and an assemblage callback. ! -# The Eve Parser parses the input stream, notifying the assemblage callback any time a valid widget definition is found. ! -# The assemblage callback, when it receives a hit from the Eve Parser for a valid widget, constructs a signal suite and passes it (among other parameters) to the <code>eve_t</code> instance for layout of this new widget. ! -# The assemblage receives a new marker for the new widget just created in the Eve Engine hierarchy, and passes it back to the Eve Parser for later use. ! -# When the Eve Parser is finished, the client code calls the <code>evaluate</code> with the <code>eve_t</code> instance to solve for the layout. ! -# During the course of solving the layout, the Eve Engine calls back to the client assemblage code via the signal suites passed in for every individual widget created in the Eve Engine heirarchy. ! -# Once a view solution has been computed, the final signal (place) is fired for each widget to notify the client code of the positioning of every widget. ! -# The client code goes out to the OS to create the OS-specific widgets, hierarchy, event handlers, etc. ! -# The rest of the application takes it from there: Eve's work is done. \section tutorials_eve_parser Parser --- 28,42 ---- \par The easiest way to see what is happening in a design that includes Eve is to enumerate the steps involved in solving a layout: ! -# The client code specifies an Eve file for parsed, solved, and displayed. ! -# The client code creates an <code>eve_t</code> object that is the Eve Engine instance that will manage the widgets at runtime. ! -# The client code calls the Eve Parser with (among other parameters) an input stream and an assemblage callback. ! -# The Eve Parser parses the input stream, notifying the assemblage callback any time a valid widget definition is found. ! -# The assemblage callback, when it receives a hit from the Eve Parser for a valid widget, constructs a signal suite and passes it (among other parameters) to the <code>eve_t</code> instance for layout of this new widget. ! -# The assemblage receives a new marker for the new widget just created in the Eve Engine hierarchy, and passes it back to the Eve Parser for later use. ! -# When the Eve Parser is finished, the client code calls the <code>evaluate</code> with the <code>eve_t</code> instance to solve for the layout. ! -# During the course of solving the layout, the Eve Engine calls back to the client assemblage code via the signal suites passed in for every individual widget created in the Eve Engine heirarchy. ! -# Once a view solution has been computed, the final signal (place) is fired for each widget to notify the client code of the positioning of every widget. ! -# The client code goes out to the OS to create the OS-specific widgets, hierarchy, event handlers, etc. ! -# The rest of the application takes it from there: Eve's work is done. \section tutorials_eve_parser Parser *************** *** 47,57 **** void parse_my_eve_file(const std::string& path_to_file) { ! std::ifstream stream(path_to_file.c_str()); ! adobe::line_position_t result_line(adobe::eve::parse( ! stream, ! adobe::line_position_t(path_to_file.c_str()), ! adobe::eve::position_t(), ! boost::bind(&client_assemble, _1, _3, ! boost::bind(adobe::eve::evaluate_arguments(), _4)))); } \endcode --- 47,57 ---- void parse_my_eve_file(const std::string& path_to_file) { ! std::ifstream stream(path_to_file.c_str()); ! adobe::line_position_t result_line(adobe::eve::parse( ! stream, ! adobe::line_position_t(path_to_file.c_str()), ! adobe::eve::position_t(), ! boost::bind(&client_assemble, _1, _3, ! boost::bind(adobe::eve::evaluate_arguments(), _4)))); } \endcode *************** *** 72,93 **** \par \code ! adobe::position_t client_assemble( const adobe::eve_t::position_t& parent, ! adobe::name_t widget_name, ! const adobe::dictionary_t& parameters) { ! adobe::eve_t::signal_suite_t signals; ! signals.eve_container_defaults_proc_m = widget_container_defaults(widget_name); ! signals.eve_calculate_proc_m = widget_calculate_proc(widget_name); ! signals.eve_calculate_vertical_proc_m = widget_calculate_vertical_proc(widget_name); ! signals.eve_place_proc_m = widget_place_proc(widget_name); ! return eve_g.add_view_element(parent.empty() ? ! boost::any_cast<adobe::eve::position_t>(parent) : ! adobe::eve_t::iterator(), ! adobe::eve_t::insert_element_t( ! widget_is_a_container(widget_name), ! parameters, ! signals)); } \endcode --- 72,93 ---- \par \code ! adobe::position_t client_assemble( const adobe::eve_t::position_t& parent, ! adobe::name_t widget_name, ! const adobe::dictionary_t& parameters) { ! adobe::eve_t::signal_suite_t signals; ! signals.eve_container_defaults_proc_m = widget_container_defaults(widget_name); ! signals.eve_calculate_proc_m = widget_calculate_proc(widget_name); ! signals.eve_calculate_vertical_proc_m = widget_calculate_vertical_proc(widget_name); ! signals.eve_place_proc_m = widget_place_proc(widget_name); ! return eve_g.add_view_element(parent.empty() ? ! boost::any_cast<adobe::eve::position_t>(parent) : ! adobe::eve_t::iterator(), ! adobe::eve_t::insert_element_t( ! widget_is_a_container(widget_name), ! parameters, ! signals)); } \endcode *************** *** 130,135 **** void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry) { ! geometry.slice_m[horizontal].length_m = 80; ! geometry.slice_m[vertical].length_m = 20; } \endcode --- 130,135 ---- void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry) { ! geometry.slice_m[horizontal].length_m = 80; ! geometry.slice_m[vertical].length_m = 20; } \endcode *************** *** 140,147 **** void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry, const adobe::dictionary_t& parameters) { ! std::string button_name(parameters[adobe::static_name_t("name")].get<std::string>()); ! geometry.slice_m[horizontal].length_m = measure_string_width(button_name); ! geometry.slice_m[vertical].length_m = 20; } \endcode --- 140,147 ---- void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry, const adobe::dictionary_t& parameters) { ! std::string button_name(parameters[adobe::static_name_t("name")].get<std::string>()); ! geometry.slice_m[horizontal].length_m = measure_string_width(button_name); ! geometry.slice_m[vertical].length_m = 20; } \endcode *************** *** 180,187 **** \par <code>evaluate</code> sets the engine in motion, at which point callbacks will start getting signalled. There are several passes Eve takes when solving the layout, and there are corresponding callbacks that get signalled in each one. It is important to know the order in which the callbacks are signalled for a given widget: ! - eve_container_defaults_proc_m (if the widget was specified as being a container by client_assemble) ! - eve_calculate_proc_m ! - eve_calculate_vertical_proc_m ! - eve_place_proc_m \par Each of these callbacks will return state to the Eve Engine, and will affect the parameters of subsequent callbacks to the same widget. You are guaranteed that each callback, if they are called, will be called in the order listed above for a given widget. You are not guaranteed that a callback will be called. The case in which Eve will call a callback is if it needs to. I know this sounds obvious, but there are cases when Eve will not require calling some of the callbacks. One case is in the process of resizing a dialog: all the views have already had their calculate callbacks signalled in a previous pass when the dialog was first laid out. Thus the calculate_proc will not get signalled when a dialog is resized. Neither will the container_defaults_proc. When the remaining two callbacks are called, however, you can be sure they will be signalled in the order listed above. --- 180,187 ---- \par <code>evaluate</code> sets the engine in motion, at which point callbacks will start getting signalled. There are several passes Eve takes when solving the layout, and there are corresponding callbacks that get signalled in each one. It is important to know the order in which the callbacks are signalled for a given widget: ! - eve_container_defaults_proc_m (if the widget was specified as being a container by client_assemble) ! - eve_calculate_proc_m ! - eve_calculate_vertical_proc_m ! - eve_place_proc_m \par Each of these callbacks will return state to the Eve Engine, and will affect the parameters of subsequent callbacks to the same widget. You are guaranteed that each callback, if they are called, will be called in the order listed above for a given widget. You are not guaranteed that a callback will be called. The case in which Eve will call a callback is if it needs to. I know this sounds obvious, but there are cases when Eve will not require calling some of the callbacks. One case is in the process of resizing a dialog: all the views have already had their calculate callbacks signalled in a previous pass when the dialog was first laid out. Thus the calculate_proc will not get signalled when a dialog is resized. Neither will the container_defaults_proc. When the remaining two callbacks are called, however, you can be sure they will be signalled in the order listed above. Index: dictionary_tutorial.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/tutorials/dictionary_tutorial.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dictionary_tutorial.dox 6 Jan 2006 18:02:56 -0000 1.2 --- dictionary_tutorial.dox 3 Feb 2006 18:33:36 -0000 1.3 *************** *** 14,29 **** void foo(adobe::dictionary_t param) // makes a copy of the dictionary_t { ! std::cout << param[adobe::name_t("my_key")].get<std::string>(); } int main(/*...*/) { ! adobe::dictionary_t my_dictionary; ! /* add key/value pairs to my_dictionary */ ! foo(my_dictionary); ! return 0; } \endcode --- 14,29 ---- void foo(adobe::dictionary_t param) // makes a copy of the dictionary_t { ! std::cout << param[adobe::name_t("my_key")].get<std::string>(); } int main(/*...*/) { ! adobe::dictionary_t my_dictionary; ! /* add key/value pairs to my_dictionary */ ! foo(my_dictionary); ! return 0; } \endcode *************** *** 96,111 **** for (; first != last; ++first) { ! if (first->second.type() == typeid(std::string)) ! { ! std::cout << "Found a string: " << first->second.get<std::string>() << std::endl; ! } ! else if (first->second.type() == typeid(double)) ! { ! std::cout << "Found a number: " << first->second.get<double>() << std::endl; ! } ! else ! { ! std::cout << "I have no idea what we've found!" << std::endl; ! } } \endcode --- 96,111 ---- for (; first != last; ++first) { ! if (first->second.type() == typeid(std::string)) ! { ! std::cout << "Found a string: " << first->second.get<std::string>() << std::endl; ! } ! else if (first->second.type() == typeid(double)) ! { ! std::cout << "Found a number: " << first->second.get<double>() << std::endl; ! } ! else ! { ! std::cout << "I have no idea what we've found!" << std::endl; ! } } \endcode |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/forest_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/forest_smoke Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/forest_smoke/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 6 Jan 2006 18:03:02 -0000 1.1 --- main.cpp 3 Feb 2006 18:33:39 -0000 1.2 *************** *** 11,67 **** void output(const R& f) { ! typedef typename boost::range_iterator<R>::type iterator; ! for (iterator first(boost::begin(f)), last(boost::end(f)); first != last; ++first) ! { ! for (typename iterator::difference_type i(first.depth()); i != 0; --i) ! { ! std::cout << "\t"; ! } ! if (first.edge() == adobe::forest_leading_edge) ! { ! std::cout << "<" << *first << ">" << std::endl; ! } ! else ! { ! std::cout << "</" << *first << ">" << std::endl; ! } ! } } ! int main() { ! typedef adobe::forest<std::string> forest; ! typedef forest::iterator iterator; ! std::cout << "<- default construction and insert ->" << std::endl; ! forest f; ! iterator i (f.begin()); ! i = adobe::trailing_of(f.insert(i, "grandmother")); ! { ! iterator p (adobe::trailing_of(f.insert(i, "mother"))); ! f.insert(p, "me"); ! f.insert(p, "sister"); ! f.insert(p, "brother"); ! } ! { ! iterator p (adobe::trailing_of(f.insert(i, "aunt"))); ! f.insert(p, "cousin"); ! } ! f.insert(i, "uncle"); ! ! output(adobe::depth_range(f)); ! std::cout << "<- copy construction and reverse ->" << std::endl; ! ! forest f2(f); ! iterator f2_grandmother(adobe::find(adobe::preorder_range(f2), "grandmother").base()); ! f2.reverse(adobe::child_begin(f2_grandmother), adobe::child_end(f2_grandmother)); ! ! output(adobe::depth_range(f2)); ! ! std::cout << "<- reverse iterator ->" << std::endl; ! ! output(adobe::depth_range(adobe::reverse_fullorder_range(f))); ! return 0; } --- 11,67 ---- void output(const R& f) { ! typedef typename boost::range_iterator<R>::type iterator; ! for (iterator first(boost::begin(f)), last(boost::end(f)); first != last; ++first) ! { ! for (typename iterator::difference_type i(first.depth()); i != 0; --i) ! { ! std::cout << "\t"; ! } ! if (first.edge() == adobe::forest_leading_edge) ! { ! std::cout << "<" << *first << ">" << std::endl; ! } ! else ! { ! std::cout << "</" << *first << ">" << std::endl; ! } ! } } ! int main() { ! typedef adobe::forest<std::string> forest; ! typedef forest::iterator iterator; ! std::cout << "<- default construction and insert ->" << std::endl; ! forest f; ! iterator i (f.begin()); ! i = adobe::trailing_of(f.insert(i, "grandmother")); ! { ! iterator p (adobe::trailing_of(f.insert(i, "mother"))); ! f.insert(p, "me"); ! f.insert(p, "sister"); ! f.insert(p, "brother"); ! } ! { ! iterator p (adobe::trailing_of(f.insert(i, "aunt"))); ! f.insert(p, "cousin"); ! } ! f.insert(i, "uncle"); ! ! output(adobe::depth_range(f)); ! std::cout << "<- copy construction and reverse ->" << std::endl; ! ! forest f2(f); ! iterator f2_grandmother(adobe::find(adobe::preorder_range(f2), "grandmother").base()); ! f2.reverse(adobe::child_begin(f2_grandmother), adobe::child_end(f2_grandmother)); ! ! output(adobe::depth_range(f2)); ! ! std::cout << "<- reverse iterator ->" << std::endl; ! ! output(adobe::depth_range(adobe::reverse_fullorder_range(f))); ! return 0; } |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/headers Modified Files: client_assembler.hpp display.hpp factory.hpp optional_connect.hpp ui_core.hpp ui_core_common.hpp ui_overlay.hpp Log Message: asl 1.0.13 Index: ui_core_common.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/ui_core_common.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ui_core_common.hpp 24 Jan 2006 19:38:46 -0000 1.5 --- ui_core_common.hpp 3 Feb 2006 18:33:36 -0000 1.6 *************** *** 1,11 **** /* ! Copyright 2005-2006 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_UI_CORE_COMMON_HPP #define ADOBE_UI_CORE_COMMON_HPP --- 1,11 ---- /* ! Copyright 2005-2006 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_UI_CORE_COMMON_HPP #define ADOBE_UI_CORE_COMMON_HPP *************** *** 35,40 **** /// be invalid once the function has returned. /// ! /// \param slice_one the first slice to align, and the one which is modified. ! /// \param slice_two the slice to align with the first slice. // --- 35,40 ---- /// be invalid once the function has returned. /// ! /// \param slice_one the first slice to align, and the one which is modified. ! /// \param slice_two the slice to align with the first slice. // Index: display.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/display.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** display.hpp 24 Jan 2006 19:38:46 -0000 1.4 --- display.hpp 3 Feb 2006 18:33:36 -0000 1.5 *************** *** 1,11 **** /* ! Copyright 2005-2006 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_DISPLAY_HPP #define ADOBE_DISPLAY_HPP --- 1,11 ---- /* ! Copyright 2005-2006 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_DISPLAY_HPP #define ADOBE_DISPLAY_HPP *************** *** 24,49 **** struct display_t { ! struct implementation_t; ! typedef boost::any position_t; ! display_t(); ! ~display_t(); ! template <typename DisplayElement> ! void set_root(DisplayElement& element); ! position_t root(); ! void erase(position_t& position); ! template <typename DisplayElement> ! position_t insert(position_t& parent, DisplayElement& element); private: ! implementation_t* object_m; public: ! implementation_t& implementation(); ! const implementation_t& implementation() const; }; --- 24,49 ---- struct display_t { ! struct implementation_t; ! typedef boost::any position_t; ! display_t(); ! ~display_t(); ! template <typename DisplayElement> ! void set_root(DisplayElement& element); ! position_t root(); ! void erase(position_t& position); ! template <typename DisplayElement> ! position_t insert(position_t& parent, DisplayElement& element); private: ! implementation_t* object_m; public: ! implementation_t& implementation(); ! const implementation_t& implementation() const; }; Index: client_assembler.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/client_assembler.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** client_assembler.hpp 24 Jan 2006 19:38:46 -0000 1.8 --- client_assembler.hpp 3 Feb 2006 18:33:36 -0000 1.9 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 34,50 **** /* ! REVISIT (sparent) : Size is inherited from the parent during initialization - the size ! specified to the client is relative to the parent's size. Does this ever need to ! be specified in absolutes? */ enum size_enum_t { ! size_mini_s = -2, ! size_small_s = -1, ! size_normal_s = 0, ! ! size_minimum_s = size_mini_s, ! size_maximum_s = size_normal_s }; --- 34,50 ---- /* ! REVISIT (sparent) : Size is inherited from the parent during initialization - the size ! specified to the client is relative to the parent's size. Does this ever need to ! be specified in absolutes? */ enum size_enum_t { ! size_mini_s = -2, ! size_small_s = -1, ! size_normal_s = 0, ! ! size_minimum_s = size_mini_s, ! size_maximum_s = size_normal_s }; *************** *** 54,64 **** /*************************************************************************************************/ ! /* ! These are forward definitions for structures which the factory function ! uses. They are defined in factory.hpp. ! */ ! struct factory_token_t; ! struct widget_node_t; ! typedef boost::function<widget_node_t (name_t, const dictionary_t&, const widget_node_t&, const factory_token_t&)> widget_factory_proc_t; /*************************************************************************************************/ --- 54,64 ---- /*************************************************************************************************/ ! /* ! These are forward definitions for structures which the factory function ! uses. They are defined in factory.hpp. ! */ ! struct factory_token_t; ! struct widget_node_t; ! typedef boost::function<widget_node_t (name_t, const dictionary_t&, const widget_node_t&, const factory_token_t&)> widget_factory_proc_t; /*************************************************************************************************/ *************** *** 72,83 **** /*************************************************************************************************/ /* ! This is a basic "Window Server" - it can be called to construct a window by name. The window ! is attached to a sheet as a slave (meaning the Window must be destructed before the sheet). ! REVISIT (sparent) : Here are some thoughts on the direction this design should be going... ! ! We have an assemblage (or package of items with the same lifespace) for the window which ! includes the eve structure and the slave connection (the wire bundle to attach the ! assamblage to a sheet). */ --- 72,83 ---- /*************************************************************************************************/ /* ! This is a basic "Window Server" - it can be called to construct a window by name. The window ! is attached to a sheet as a slave (meaning the Window must be destructed before the sheet). ! REVISIT (sparent) : Here are some thoughts on the direction this design should be going... ! ! We have an assemblage (or package of items with the same lifespace) for the window which ! includes the eve structure and the slave connection (the wire bundle to attach the ! assamblage to a sheet). */ *************** *** 92,212 **** { public: ! typedef boost::function<void (const adobe::name_t&, const adobe::value_t&)> action_fallback_proc_t; ! // ! /// This constructor tells the window_server_t where to find ! /// Eve definitions referenced in @dialog commands, and which ! /// sheet to bind against. ! /// ! /// \param directory_path the directory to look for Eve ! /// files referenced by @dialog in. ! /// \param sheet the sheet to bind against. This ! /// sheet should contain all of the ! /// cells referenced in the Eve file ! /// which is loaded (either via ! /// push_back or @dialog). ! // ! window_server_t(const char* directory_path, adobe::sheet_t& sheet); ! // ! /// Hide and release all Eve dialogs created by this window server. ! // ! ~window_server_t(); ! // ! /// Load the given file out of the directory_path and display the ! /// dialog it contains. If the file cannot be found, or the file ! /// contains errors (e.g.: syntax errors, references non-existant ! /// widgets) then an exception is thrown. ! /// ! /// \param name the name of the Eve file inside ! /// the directory given to the constructor. ! /// \param dialog_size the size of the dialog to create, ! /// note that individual widgets may ! /// override this value in the Eve file. ! // ! void push_back(const char* name, size_enum_t dialog_size); ! // ! /// Load an Eve definition from the given std::istream and display ! /// the dialog it contains. If any errors are found in the data ! /// then an exception is thrown. ! /// ! /// \param data an std::istream open on the Eve ! /// definition to be loaded. ! /// \param ident_pair identification name and callback proc (two parameters) ! /// that represents the data stream ! /// \param dialog_size the size of the dialog to create, ! /// note that individual widgets may ! /// override this value in the Eve ! /// definition. ! // ! void push_back(std::istream& data, adobe::name_t file_path, const adobe::line_position_t::getline_proc_t& getline_proc, size_enum_t dialog_size); ! ! #if 0 ! void set_back(const char* name, size_enum_t dialog_size); ! void pop_back(bool cancel); ! #endif ! // ! /// The window server can use different widget factories if ! /// custom widgets need to be made. By default the window ! /// server will use the "adobe::default_factory" function, ! /// but an alternative function can be specified here. Note ! /// that push_back just uses the current factory, so if a ! /// custom factory is desired then it must be set before ! /// using push_back. ! /// ! /// \param proc the new widget factory function to ! /// use. ! // ! void set_widget_factory(adobe::widget_factory_proc_t proc); ! // ! /// Some widgets, such as buttons and bevel_buttons in UI ! /// core, have an action property. When an action is invoked ! /// (e.g.: a button with an action value) the procedure given ! /// to this function is invoked. This provides an easy way ! /// to get feedback from a GUI. ! /// ! /// Note that some actions are automatically handled, these ! /// are: @cancel, @ok and @reset. ! /// ! /// \param proc the function to call when a widget ! /// with an action is "activated". ! // ! void set_action_fallback(action_fallback_proc_t proc); ! // ! /// This function will serialize all of the visible widgets to ! /// the given std::ostream. ! /// ! /// \param s the std::ostream to serialize widgets ! /// to. ! // ! void serialize_widgets(std::ostream& s); ! ! // REVISIT (sparent) : Hack. These need to go to the correct window. ! // ! /// This function can be used to send an action to the open windows, ! /// however it is only useful in debug mode (where it can be used to ! /// frame and unframe visible widgets). It will probably be changed ! /// soon. ! /// ! /// \param action the action to perform. ! /// \param parameter the parameter associated with the action. ! // ! void dispatch_action(adobe::name_t action, const adobe::value_t& parameter); ! // ! /// Return the number of windows which this window_server has open. ! /// ! /// \return the number of windows which this window_server has open. ! // ! std::size_t size() const { return window_list_m.size(); } private: ! typedef std::list<eve_client_holder*> window_list_t; ! typedef window_list_t::iterator iterator; ! ! void dispatch_window_action(iterator window, adobe::name_t action, const adobe::value_t& parameter); ! void erase(iterator window); ! ! adobe::sheet_t& sheet_m; ! std::string directory_path_m; ! window_list_t window_list_m; ! action_fallback_proc_t fallback_m; ! adobe::widget_factory_proc_t widget_factory_m; }; --- 92,212 ---- { public: ! typedef boost::function<void (const adobe::name_t&, const adobe::value_t&)> action_fallback_proc_t; ! // ! /// This constructor tells the window_server_t where to find ! /// Eve definitions referenced in @dialog commands, and which ! /// sheet to bind against. ! /// ! /// \param directory_path the directory to look for Eve ! /// files referenced by @dialog in. ! /// \param sheet the sheet to bind against. This ! /// sheet should contain all of the ! /// cells referenced in the Eve file ! /// which is loaded (either via ! /// push_back or @dialog). ! // ! window_server_t(const char* directory_path, adobe::sheet_t& sheet); ! // ! /// Hide and release all Eve dialogs created by this window server. ! // ! ~window_server_t(); ! // ! /// Load the given file out of the directory_path and display the ! /// dialog it contains. If the file cannot be found, or the file ! /// contains errors (e.g.: syntax errors, references non-existant ! /// widgets) then an exception is thrown. ! /// ! /// \param name the name of the Eve file inside ! /// the directory given to the constructor. ! /// \param dialog_size the size of the dialog to create, ! /// note that individual widgets may ! /// override this value in the Eve file. ! // ! void push_back(const char* name, size_enum_t dialog_size); ! // ! /// Load an Eve definition from the given std::istream and display ! /// the dialog it contains. If any errors are found in the data ! /// then an exception is thrown. ! /// ! /// \param data an std::istream open on the Eve ! /// definition to be loaded. ! /// \param ident_pair identification name and callback proc (two parameters) ! /// that represents the data stream ! /// \param dialog_size the size of the dialog to create, ! /// note that individual widgets may ! /// override this value in the Eve ! /// definition. ! // ! void push_back(std::istream& data, adobe::name_t file_path, const adobe::line_position_t::getline_proc_t& getline_proc, size_enum_t dialog_size); ! ! #if 0 ! void set_back(const char* name, size_enum_t dialog_size); ! void pop_back(bool cancel); ! #endif ! // ! /// The window server can use different widget factories if ! /// custom widgets need to be made. By default the window ! /// server will use the "adobe::default_factory" function, ! /// but an alternative function can be specified here. Note ! /// that push_back just uses the current factory, so if a ! /// custom factory is desired then it must be set before ! /// using push_back. ! /// ! /// \param proc the new widget factory function to ! /// use. ! // ! void set_widget_factory(adobe::widget_factory_proc_t proc); ! // ! /// Some widgets, such as buttons in UI ! /// core, have an action property. When an action is invoked ! /// (e.g.: a button with an action value) the procedure given ! /// to this function is invoked. This provides an easy way ! /// to get feedback from a GUI. ! /// ! /// Note that some actions are automatically handled, these ! /// are: @cancel, @ok and @reset. ! /// ! /// \param proc the function to call when a widget ! /// with an action is "activated". ! // ! void set_action_fallback(action_fallback_proc_t proc); ! // ! /// This function will serialize all of the visible widgets to ! /// the given std::ostream. ! /// ! /// \param s the std::ostream to serialize widgets ! /// to. ! // ! void serialize_widgets(std::ostream& s); ! ! // REVISIT (sparent) : Hack. These need to go to the correct window. ! // ! /// This function can be used to send an action to the open windows, ! /// however it is only useful in debug mode (where it can be used to ! /// frame and unframe visible widgets). It will probably be changed ! /// soon. ! /// ! /// \param action the action to perform. ! /// \param parameter the parameter associated with the action. ! // ! void dispatch_action(adobe::name_t action, const adobe::value_t& parameter); ! // ! /// Return the number of windows which this window_server has open. ! /// ! /// \return the number of windows which this window_server has open. ! // ! std::size_t size() const { return window_list_m.size(); } private: ! typedef std::list<eve_client_holder*> window_list_t; ! typedef window_list_t::iterator iterator; ! ! void dispatch_window_action(iterator window, adobe::name_t action, const adobe::value_t& parameter); ! void erase(iterator window); ! ! adobe::sheet_t& sheet_m; ! std::string directory_path_m; ! window_list_t window_list_m; ! action_fallback_proc_t fallback_m; ! adobe::widget_factory_proc_t widget_factory_m; }; *************** *** 226,232 **** /* ! REVISIT (sparent) : As a current "hack" for handling the drawing order of widgets when optional ! panels come and go we are going to define a vector of items which need to be shown or hidden ! and the window will handle the logic. Still need to figure out the right place to put this. */ --- 226,232 ---- /* ! REVISIT (sparent) : As a current "hack" for handling the drawing order of widgets when optional ! panels come and go we are going to define a vector of items which need to be shown or hidden ! and the window will handle the logic. Still need to figure out the right place to put this. */ *************** *** 238,304 **** struct eve_client_holder : public boost::noncopyable { ! /* ! NOTE (sparent) : Order is important here - we want to destruct window_m prior to destructing ! eve_m so that any notifications sent by the system are sent to valid object. Slots and ! signals on the window widgets would be a better way to handle this connection but I'm not ! there yet. ! */ ! // ! /// The Eve engine which all of these widgets are being inserted into. This must ! /// be known by top-level windows, and by widgets which manage trees of Eve ! /// widgets (such as splitter widgets). ! // ! adobe::eve_t eve_m; ! // ! /// The layout sheet is a "mini" sheet used to hold the layout state. ! // ! adobe::basic_sheet_t layout_sheet_m; ! ! // ! /// This is the assemblage which widget factories register the created widget ! /// (or wrapping structure) with, such that the widget gets deleted when the ! /// assemblage does. ! // ! adobe::assemblage_t assemblage_m; ! // ! /// A set for the contributing factors to the sheet (not the layout sheet) ! // ! std::pair<adobe::dictionary_t, adobe::array_t> contributing_m; ! // ! /// Top-level widgets (windows, dialogs, etc) need to be told to show themselves ! /// when all of the child widgets have been created and inserted. This signal ! /// is issued when the top-level window needs to be shown -- so any factory function ! /// which creates a window needs to connect to this signal. ! // ! show_window_signal_t show_window_m; ! // ! /// REVISIT (sparent) : We really need a generalized mechanism for defereing an action - ! /// a command queue of sorts - which collapses so things don't get done twince. We hack it here. ! // ! visible_change_queue_t visible_change_queue_m; ! // ! /// Display token for the root item in the view ! // ! adobe::display_t::position_t root_display_m; #ifndef NDEBUG ! // ! /// This is the signal which should trigger widget serialization. All widgets ! /// should bind to this signal. ! // ! serialize_signal_t widget_stream_m; ! // ! /// Top-level widgets (windows, dialogs, etc) can provide debugging functionality ! /// which involves drawing tick marks around the Eve-specified extents of a widget. ! /// This is handled through an overlay class, which is passed here for binding ! // ! adobe::ui_overlay_t overlay_m; #endif }; --- 238,304 ---- struct eve_client_holder : public boost::noncopyable { ! /* ! NOTE (sparent) : Order is important here - we want to destruct window_m prior to destructing ! eve_m so that any notifications sent by the system are sent to valid object. Slots and ! signals on the window widgets would be a better way to handle this connection but I'm not ! there yet. ! */ ! // ! /// The Eve engine which all of these widgets are being inserted into. This must ! /// be known by top-level windows, and by widgets which manage trees of Eve ! /// widgets (such as splitter widgets). ! // ! adobe::eve_t eve_m; ! // ! /// The layout sheet is a "mini" sheet used to hold the layout state. ! // ! adobe::basic_sheet_t layout_sheet_m; ! ! // ! /// This is the assemblage which widget factories register the created widget ! /// (or wrapping structure) with, such that the widget gets deleted when the ! /// assemblage does. ! // ! adobe::assemblage_t assemblage_m; ! // ! /// A set for the contributing factors to the sheet (not the layout sheet) ! // ! std::pair<adobe::dictionary_t, adobe::array_t> contributing_m; ! // ! /// Top-level widgets (windows, dialogs, etc) need to be told to show themselves ! /// when all of the child widgets have been created and inserted. This signal ! /// is issued when the top-level window needs to be shown -- so any factory function ! /// which creates a window needs to connect to this signal. ! // ! show_window_signal_t show_window_m; ! // ! /// REVISIT (sparent) : We really need a generalized mechanism for defereing an action - ! /// a command queue of sorts - which collapses so things don't get done twince. We hack it here. ! // ! visible_change_queue_t visible_change_queue_m; ! // ! /// Display token for the root item in the view ! // ! adobe::display_t::position_t root_display_m; #ifndef NDEBUG ! // ! /// This is the signal which should trigger widget serialization. All widgets ! /// should bind to this signal. ! // ! serialize_signal_t widget_stream_m; ! // ! /// Top-level widgets (windows, dialogs, etc) can provide debugging functionality ! /// which involves drawing tick marks around the Eve-specified extents of a widget. ! /// This is handled through an overlay class, which is passed here for binding ! // ! adobe::ui_overlay_t overlay_m; #endif }; *************** *** 306,316 **** /*************************************************************************************************/ ! adobe::auto_ptr<eve_client_holder> make_view( adobe::name_t file_name, ! const adobe::line_position_t::getline_proc_t& getline_proc, ! std::istream& stream, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size, ! adobe::widget_factory_proc_t factory); /*************************************************************************************************/ --- 306,316 ---- /*************************************************************************************************/ ! adobe::auto_ptr<eve_client_holder> make_view( adobe::name_t file_name, ! const adobe::line_position_t::getline_proc_t& getline_proc, ! std::istream& stream, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size, ! adobe::widget_factory_proc_t factory); /*************************************************************************************************/ *************** *** 320,324 **** // typedef boost::function<void (const adobe::point_2d_t&, const adobe::extents_t&)> ! place_func_t; // /// utility_widget_place is an implementation of the function required for --- 320,324 ---- // typedef boost::function<void (const adobe::point_2d_t&, const adobe::extents_t&)> ! place_func_t; // /// utility_widget_place is an implementation of the function required for *************** *** 330,444 **** /// factory as follows: /// \code ! /// class MyWidget { ! /// public: ! /// ... ! /// void place( const adobe::point_2d_t& position, ! /// const adobe::extents_t& geometry ) { ! /// // ! /// // Place this widget at the given position with the ! /// // give geometry. ! /// // ! /// } ! /// ... ! /// HWND/Widget*/ControlRef getWidget() const { ! /// // ! /// // Return whatever the native basic widget type is. ! /// // On Windows this is an HWND, on Mac a ControlRef ! /// // and on FLTK it's a fltk::Widget*. ! /// // ! /// } ! /// ... ! /// adobe::extents_t best_bounds() { ! /// // ! /// // Fill out what the ideal size (along with any ! /// // extra information like baseline). ! /// // ! /// adobe::extents_t result; ! /// result.width() = result.height() = 100; ! /// return result; ! /// } ! /// }; /// ! /// adobe::widget_node_t MyWidget_factory( ! /// const adobe::dictionary_t& parameters, ! /// const adobe::widget_node_t& parent, ! /// const adobe::factory_token_t& token ) { ! /// // ! /// // Create our widget instance. It should pull out any parameters which ! /// // it needs from the parameters dictionary, and will probably use ! /// // token.sheet_m to bind to anything in the sheet. ! /// // ! /// MyWidget* pMyWidget = new MyWidget( parameters, parent, token ); ! /// if( !pMyWidget ) throw std::runtime_error( "no memory.." ); ! /// // ! /// // We want this widget instance to be deleted when the view containing ! /// // it goes away. ! /// // ! /// token.assemblage_m.delete_on_destruction( pMyWidget ); ! /// // ! /// // Insert this widget into it's parent on the main display. ! /// // ! /// adobe::display_t::position_t display_token( adobe::insert( ! /// adobe::get_main_display(), parent.display_token_m, ! /// pMyWidget->getWidget() ) ); ! /// adobe::display_t::position_t overlay_token( ! /// token.overlay_m.insert( parent.overlay_token_m ) ); ! /// // ! /// // Fill out the signals that Eve needs to place and move our widget ! /// // around. ! /// // ! /// adobe::eve_t::signal_suite_t signals; ! /// // ! /// // First make our placer function. We use boost::bind because we need ! /// // to call a member function (and thus need to bind the instance to the ! /// // member). ! /// // ! /// eve_client::place_func_t placer( boost::bind( &MyWidget::place, pMyWidget, _1, _2 ) ); ! /// // ! /// // The utility_widget_calculate is just a conversion function really, so ! /// // it saves us from writing a new one. ! /// // ! /// signals.eve_calculate_proc_m = boost::bind( &eve_client::utility_widget_calculate, ! /// pMyWidget->best_bounds(), _1 ); ! /// // ! /// // Use utility_widget_place as our placing function for Eve. ! /// // ! /// signals.eve_place_proc_m = boost::bind( &eve_client::utility_widget_place, ! /// placer, _1, _2, boost::ref( token.overlay_m ), overlay_token ); ! /// // ! /// // Register the widget with Eve. ! /// // ! /// adobe::eve_t::iterator eve_token( ! /// token.layout_m.add_view_element( parent.eve_token_m, ! /// adobe::eve_t::insert_element_t( ! /// adobe::eve_t::calculate_data_t(), ! /// false, ! /// parameters, ! /// signals ) ! /// ) ! /// ); ! /// // ! /// // Return our new widget. This should be what the factory function ! /// // returns. ! /// // ! /// return adobe::widget_node_t( parent.size_m, eve_token, display_token, overlay_token ); ///} /// \endcode /// ! /// \param placer a function which sets the position and dimensions of the widget. ! /// \param calc the calculation data from Eve. ! /// \param data the placer data from Eve. ! /// \param overlay the overlay root. ! /// \param node the overlay node for this widget. // void ! utility_widget_place( place_func_t placer, ! const adobe::eve_t::calculate_data_t& calc, ! const adobe::eve_t::place_data_t& data #ifndef NDEBUG ! , adobe::ui_overlay_t& overlay, ! adobe::ui_overlay_t::position_t node #endif ! ); /*************************************************************************************************/ --- 330,444 ---- /// factory as follows: /// \code ! /// class MyWidget { ! /// public: ! /// ... ! /// void place( const adobe::point_2d_t& position, ! /// const adobe::extents_t& geometry ) { ! /// // ! /// // Place this widget at the given position with the ! /// // give geometry. ! /// // ! /// } ! /// ... ! /// HWND/Widget*/ControlRef getWidget() const { ! /// // ! /// // Return whatever the native basic widget type is. ! /// // On Windows this is an HWND, on Mac a ControlRef ! /// // and on FLTK it's a fltk::Widget*. ! /// // ! /// } ! /// ... ! /// adobe::extents_t best_bounds() { ! /// // ! /// // Fill out what the ideal size (along with any ! /// // extra information like baseline). ! /// // ! /// adobe::extents_t result; ! /// result.width() = result.height() = 100; ! /// return result; ! /// } ! /// }; /// ! /// adobe::widget_node_t MyWidget_factory( ! /// const adobe::dictionary_t& parameters, ! /// const adobe::widget_node_t& parent, ! /// const adobe::factory_token_t& token ) { ! /// // ! /// // Create our widget instance. It should pull out any parameters which ! /// // it needs from the parameters dictionary, and will probably use ! /// // token.sheet_m to bind to anything in the sheet. ! /// // ! /// MyWidget* pMyWidget = new MyWidget( parameters, parent, token ); ! /// if( !pMyWidget ) throw std::runtime_error( "no memory.." ); ! /// // ! /// // We want this widget instance to be deleted when the view containing ! /// // it goes away. ! /// // ! /// token.assemblage_m.delete_on_destruction( pMyWidget ); ! /// // ! /// // Insert this widget into it's parent on the main display. ! /// // ! /// adobe::display_t::position_t display_token( adobe::insert( ! /// adobe::get_main_display(), parent.display_token_m, ! /// pMyWidget->getWidget() ) ); ! /// adobe::display_t::position_t overlay_token( ! /// token.overlay_m.insert( parent.overlay_token_m ) ); ! /// // ! /// // Fill out the signals that Eve needs to place and move our widget ! /// // around. ! /// // ! /// adobe::eve_t::signal_suite_t signals; ! /// // ! /// // First make our placer function. We use boost::bind because we need ! /// // to call a member function (and thus need to bind the instance to the ! /// // member). ! /// // ! /// eve_client::place_func_t placer( boost::bind( &MyWidget::place, pMyWidget, _1, _2 ) ); ! /// // ! /// // The utility_widget_calculate is just a conversion function really, so ! /// // it saves us from writing a new one. ! /// // ! /// signals.eve_calculate_proc_m = boost::bind( &eve_client::utility_widget_calculate, ! /// pMyWidget->best_bounds(), _1 ); ! /// // ! /// // Use utility_widget_place as our placing function for Eve. ! /// // ! /// signals.eve_place_proc_m = boost::bind( &eve_client::utility_widget_place, ! /// placer, _1, _2, boost::ref( token.overlay_m ), overlay_token ); ! /// // ! /// // Register the widget with Eve. ! /// // ! /// adobe::eve_t::iterator eve_token( ! /// token.layout_m.add_view_element( parent.eve_token_m, ! /// adobe::eve_t::insert_element_t( ! /// adobe::eve_t::calculate_data_t(), ! /// false, ! /// parameters, ! /// signals ) ! /// ) ! /// ); ! /// // ! /// // Return our new widget. This should be what the factory function ! /// // returns. ! /// // ! /// return adobe::widget_node_t( parent.size_m, eve_token, display_token, overlay_token ); ///} /// \endcode /// ! /// \param placer a function which sets the position and dimensions of the widget. ! /// \param calc the calculation data from Eve. ! /// \param data the placer data from Eve. ! /// \param overlay the overlay root. ! /// \param node the overlay node for this widget. // void ! utility_widget_place( place_func_t placer, ! const adobe::eve_t::calculate_data_t& calc, ! const adobe::eve_t::place_data_t& data #ifndef NDEBUG ! , adobe::ui_overlay_t& overlay, ! adobe::ui_overlay_t::position_t node #endif ! ); /*************************************************************************************************/ *************** *** 446,455 **** /// Convert from extents_t to eve_t::calculate_data_t. /// ! /// \param best_bounds the bounds to convert from. ! /// \param geometry the calculate_data_t to convert to. // void ! utility_widget_calculate( adobe::extents_t& best_bounds, ! adobe::eve_t::calculate_data_t& geometry ); /*************************************************************************************************/ } // namespace eve_client --- 446,455 ---- /// Convert from extents_t to eve_t::calculate_data_t. /// ! /// \param best_bounds the bounds to convert from. ! /// \param geometry the calculate_data_t to convert to. // void ! utility_widget_calculate( adobe::extents_t& best_bounds, ! adobe::eve_t::calculate_data_t& geometry ); /*************************************************************************************************/ } // namespace eve_client Index: factory.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/factory.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** factory.hpp 24 Jan 2006 19:38:46 -0000 1.5 --- factory.hpp 3 Feb 2006 18:33:36 -0000 1.6 *************** *** 1,11 **** /* ! Copyright 2005 Ralph Thomas ! 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_UI_CORE_FACTORY_HPP #define ADOBE_UI_CORE_FACTORY_HPP --- 1,11 ---- /* ! Copyright 2005 Ralph Thomas ! 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_UI_CORE_FACTORY_HPP #define ADOBE_UI_CORE_FACTORY_HPP *************** *** 45,75 **** inline void update_display_queue(eve_client::visible_change_queue_t* queue, eve_t* layout) { ! if (!queue->empty()) ! { ! eve_client::visible_change_queue_t::iterator mid(adobe::partition(*queue, &eve_client::visible_change_request_t::first)); ! adobe::for_each(mid, queue->end(), boost::bind(&adobe::panel_t::set_visible, boost::bind(&eve_client::visible_change_request_t::second, _1), false)); ! layout->evaluate(adobe::eve_t::evaluate_nested); ! adobe::for_each(queue->begin(), mid, boost::bind(&adobe::panel_t::set_visible, boost::bind(&eve_client::visible_change_request_t::second, _1), true)); ! queue->clear(); ! } } inline void sheet_set_update(sheet_t* sheet, eve_client::visible_change_queue_t* queue, ! eve_t* layout, name_t name, const value_t value) { ! sheet->set(name, value); ! sheet->update(); ! ! update_display_queue(queue, layout); } inline void layout_sheet_set_update(basic_sheet_t* sheet, eve_client::visible_change_queue_t* queue, ! eve_t* layout, name_t name, const value_t value) { ! sheet->set(name, value); ! ! update_display_queue(queue, layout); } ! } // namespace implementation --- 45,75 ---- inline void update_display_queue(eve_client::visible_change_queue_t* queue, eve_t* layout) { ! if (!queue->empty()) ! { ! eve_client::visible_change_queue_t::iterator mid(adobe::partition(*queue, &eve_client::visible_change_request_t::first)); ! adobe::for_each(mid, queue->end(), boost::bind(&adobe::panel_t::set_visible, boost::bind(&eve_client::visible_change_request_t::second, _1), false)); ! layout->evaluate(adobe::eve_t::evaluate_nested); ! adobe::for_each(queue->begin(), mid, boost::bind(&adobe::panel_t::set_visible, boost::bind(&eve_client::visible_change_request_t::second, _1), true)); ! queue->clear(); ! } } inline void sheet_set_update(sheet_t* sheet, eve_client::visible_change_queue_t* queue, ! eve_t* layout, name_t name, const value_t value) { ! sheet->set(name, value); ! sheet->update(); ! ! update_display_queue(queue, layout); } inline void layout_sheet_set_update(basic_sheet_t* sheet, eve_client::visible_change_queue_t* queue, ! eve_t* layout, name_t name, const value_t value) { ! sheet->set(name, value); ! ! update_display_queue(queue, layout); } ! } // namespace implementation *************** *** 83,168 **** struct factory_token_t { ! factory_token_t(display_t& display, ! sheet_t& sheet, ! eve_client::eve_client_holder& client_holder, ! eve_client::button_notifier_t notifier ! ) : ! display_m(display), ! sheet_m(sheet), ! client_holder_m(client_holder), ! notifier_m(notifier) ! {} ! ! typedef sheet_t::monitor_active_t monitor_active_t; ! typedef sheet_t::monitor_value_t monitor_value_t; ! ! /* ! REVISIT (sparent) : Token is starting to look like a "binding" abstraction of some sort. ! ! We're going to add a bind function to the factory token to take care of the complexity ! of binding to a layout_sheet or sheet. ! ! REVISIT (sparent) : This code also indicates problems with the current sheet interfaces: ! ! 1. There should be some way to build a single index for both sheets to cover the entire ! scope. ! 2. The set() functions may become functions which return setter objects and don't need to ! do the lookup. ! */ ! monitor_value_t bind(name_t name, const monitor_active_t& monitor_active, const monitor_value_t& monitor_value) const ! { ! if (client_holder_m.layout_sheet_m.count_interface(name)) ! { ! client_holder_m.assemblage_m.hold_connection(client_holder_m.layout_sheet_m.monitor_interface(name, monitor_value)); ! return boost::bind( &implementation::layout_sheet_set_update, ! &client_holder_m.layout_sheet_m, ! &client_holder_m.visible_change_queue_m, ! &client_holder_m.eve_m, name, _1); ! } ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_value(name, monitor_value)); ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_active(name, monitor_active)); ! ! return boost::bind( &implementation::sheet_set_update, ! &sheet_m, ! &client_holder_m.visible_change_queue_m, ! &client_holder_m.eve_m, name, _1); ! } ! void bind_in(name_t name, const monitor_value_t& monitor_value) const ! { ! if (client_holder_m.layout_sheet_m.count_interface(name)) ! client_holder_m.assemblage_m.hold_connection(client_holder_m.layout_sheet_m.monitor_interface(name, monitor_value)); ! else ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_value(name, monitor_value)); ! } ! // ! /// Created widgets should be made with respect to this display, and inserted ! /// into the given parent by this display. ! // ! display_t& display_m; ! // ! /// The current Adam sheet -- this contains all of the cells which widgets might ! /// want to bind against. ! // ! sheet_t& sheet_m; ! // ! /// The current eve_client_holder -- keeps all the relevant parts of a view in ! /// one location. Originally the factory token was duplication nearly every ! /// member of the client_holder as a member itself, so this cleans up factory_token ! /// quite a bit. ! // ! eve_client::eve_client_holder& client_holder_m; ! // ! /// The function to call when a button is pressed. This should be called by ! /// buttons and button-like widgets when they are hit (and have an action, ! /// rather than a state change). ! // ! eve_client::button_notifier_t notifier_m; }; --- 83,168 ---- struct factory_token_t { ! factory_token_t(display_t& display, ! sheet_t& sheet, ! eve_client::eve_client_holder& client_holder, ! eve_client::button_notifier_t notifier ! ) : ! display_m(display), ! sheet_m(sheet), ! client_holder_m(client_holder), ! notifier_m(notifier) ! {} ! ! typedef sheet_t::monitor_active_t monitor_active_t; ! typedef sheet_t::monitor_value_t monitor_value_t; ! ! /* ! REVISIT (sparent) : Token is starting to look like a "binding" abstraction of some sort. ! ! We're going to add a bind function to the factory token to take care of the complexity ! of binding to a layout_sheet or sheet. ! ! REVISIT (sparent) : This code also indicates problems with the current sheet interfaces: ! ! 1. There should be some way to build a single index for both sheets to cover the entire ! scope. ! 2. The set() functions may become functions which return setter objects and don't need to ! do the lookup. ! */ ! monitor_value_t bind(name_t name, const monitor_active_t& monitor_active, const monitor_value_t& monitor_value) const ! { ! if (client_holder_m.layout_sheet_m.count_interface(name)) ! { ! client_holder_m.assemblage_m.hold_connection(client_holder_m.layout_sheet_m.monitor_interface(name, monitor_value)); ! return boost::bind( &implementation::layout_sheet_set_update, ! &client_holder_m.layout_sheet_m, ! &client_holder_m.visible_change_queue_m, ! &client_holder_m.eve_m, name, _1); ! } ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_value(name, monitor_value)); ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_active(name, monitor_active)); ! ! return boost::bind( &implementation::sheet_set_update, ! &sheet_m, ! &client_holder_m.visible_change_queue_m, ! &client_holder_m.eve_m, name, _1); ! } ! void bind_in(name_t name, const monitor_value_t& monitor_value) const ! { ! if (client_holder_m.layout_sheet_m.count_interface(name)) ! client_holder_m.assemblage_m.hold_connection(client_holder_m.layout_sheet_m.monitor_interface(name, monitor_value)); ! else ! client_holder_m.assemblage_m.hold_connection(sheet_m.monitor_value(name, monitor_value)); ! } ! // ! /// Created widgets should be made with respect to this display, and inserted ! /// into the given parent by this display. ! // ! display_t& display_m; ! // ! /// The current Adam sheet -- this contains all of the cells which widgets might ! /// want to bind against. ! // ! sheet_t& sheet_m; ! // ! /// The current eve_client_holder -- keeps all the relevant parts of a view in ! /// one location. Originally the factory token was duplication nearly every ! /// member of the client_holder as a member itself, so this cleans up factory_token ! /// quite a bit. ! // ! eve_client::eve_client_holder& client_holder_m; ! // ! /// The function to call when a button is pressed. This should be called by ! /// buttons and button-like widgets when they are hit (and have an action, ! /// rather than a state change). ! // ! eve_client::button_notifier_t notifier_m; }; *************** *** 175,212 **** struct widget_node_t { ! widget_node_t( size_enum_t size, ! const eve_t::iterator& eve_token, ! const display_t::position_t& display_token #ifndef NDEBUG ! , const ui_overlay_t::position_t& overlay_token #endif ! ) : ! size_m(size), ! eve_token_m(eve_token), ! display_token_m(display_token) #ifndef NDEBUG ! , overlay_token_m(overlay_token) #endif ! { } ! // ! /// This specifies the size of this widget. Children will use this to find the ! /// size they should use (unless they have an explicit size specified). ! // ! size_enum_t size_m; ! // ! /// The parent as known by Eve. ! // ! eve_t::iterator eve_token_m; ! // ! /// The widget as known by the display. ! /// This should *not* be mutable -- for now it's more convenient. ! // ! mutable display_t::position_t display_token_m; #ifndef NDEBUG ! // ! /// The widget as known by the overlay. ! /// This should *not* be mutable -- for now it's more convenient. ! // ! mutable ui_overlay_t::position_t overlay_token_m; #endif }; --- 175,212 ---- struct widget_node_t { ! widget_node_t( size_enum_t size, ! const eve_t::iterator& eve_token, ! const display_t::position_t& display_token #ifndef NDEBUG ! , const ui_overlay_t::position_t& overlay_token #endif ! ) : ! size_m(size), ! eve_token_m(eve_token), ! display_token_m(display_token) #ifndef NDEBUG ! , overlay_token_m(overlay_token) #endif ! { } ! // ! /// This specifies the size of this widget. Children will use this to find the ! /// size they should use (unless they have an explicit size specified). ! // ! size_enum_t size_m; ! // ! /// The parent as known by Eve. ! // ! eve_t::iterator eve_token_m; ! // ! /// The widget as known by the display. ! /// This should *not* be mutable -- for now it's more convenient. ! // ! mutable display_t::position_t display_token_m; #ifndef NDEBUG ! // ! /// The widget as known by the overlay. ! /// This should *not* be mutable -- for now it's more convenient. ! // ! mutable ui_overlay_t::position_t overlay_token_m; #endif }; *************** *** 217,229 **** /// not valid then a std::runtime_error exception is thrown. /// ! /// \param name the name of the widget to create, like "button" or "checkbox". ! /// \param parameters a dictionary of paramters for the new widget. ! /// \param parent the parent widget for this new (child) widget. This parameter ! /// may be zero when creating top-level widgets, such as windows. ! /// \param token a factory token, containing appropriate references. /// ! /// \return the position of the newly created widget in the display. This parameter is used ! /// to insert children into -- leaf widgets (i.e.: those which can never have children) ! /// may return zero here. // widget_node_t default_factory(adobe::name_t name, const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 217,229 ---- /// not valid then a std::runtime_error exception is thrown. /// ! /// \param name the name of the widget to create, like "button" or "checkbox". ! /// \param parameters a dictionary of paramters for the new widget. ! /// \param parent the parent widget for this new (child) widget. This parameter ! /// may be zero when creating top-level widgets, such as windows. ! /// \param token a factory token, containing appropriate references. /// ! /// \return the position of the newly created widget in the display. This parameter is used ! /// to insert children into -- leaf widgets (i.e.: those which can never have children) ! /// may return zero here. // widget_node_t default_factory(adobe::name_t name, const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 233,243 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the row. ! /// \param parent the parent of the row. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created row. There is nothing to modify ! /// once the row has been created, so the general widget_info_t is not ! /// returned. // widget_node_t row_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 233,243 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the row. ! /// \param parent the parent of the row. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created row. There is nothing to modify ! /// once the row has been created, so the general widget_info_t is not ! /// returned. // widget_node_t row_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 247,257 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the column. ! /// \param parent the parent of the column. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created column. There is nothing to modify ! /// once the column has been created, so the general widget_info_t is not ! /// returned. // widget_node_t column_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 247,257 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the column. ! /// \param parent the parent of the column. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created column. There is nothing to modify ! /// once the column has been created, so the general widget_info_t is not ! /// returned. // widget_node_t column_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 261,271 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the overlay. ! /// \param parent the parent of the overlay. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created overlay. There is nothing to modify ! /// once the overlay has been created, so the general widget_info_t is not ! /// returned. // widget_node_t overlay_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 261,271 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the overlay. ! /// \param parent the parent of the overlay. ! /// \param token a factory token, containing approprate references. /// ! /// \return the node information for the created overlay. There is nothing to modify ! /// once the overlay has been created, so the general widget_info_t is not ! /// returned. // widget_node_t overlay_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 275,285 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new window. ! /// \param parent the parent of the new window -- get_main_display().root() is good. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t dialog_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 275,285 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the new window. ! /// \param parent the parent of the new window -- get_main_display().root() is good. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t dialog_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 289,299 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new window. ! /// \param parent the parent of the new window -- get_main_display().root() is good. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t palette_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 289,299 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the new window. ! /// \param parent the parent of the new window -- get_main_display().root() is good. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t palette_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 303,313 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new button. ! /// \param parent the parent position for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t button_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 303,313 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the new button. ! /// \param parent the parent position for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t button_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 317,327 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new check box. ! /// \param parent the parent widget for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t checkbox_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 317,327 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the new check box. ! /// \param parent the parent widget for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t checkbox_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 331,341 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new radio button. ! /// \param parent the parent widget for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t radio_button_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); --- 331,341 ---- /// given parent. /// ! /// \param parameters a dictionary of parameters for the new radio button. ! /// \param parent the parent widget for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t radio_button_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); *************** *** 345,355 **** /// given parent. /// ! /// \param parameters a dictionary of parameters for the new edit text. ! /// \param parent the parent widget for this button, may not be zero. ! /// \param token a factory token, containing approprate references. /// ! /// \return the newly created widget. This pointer will have been added to the ! /// assemblage's (in the token) list of things to delete, so it will ! /// not be valid after the assemblage has been released. // widget_node_t edit_text_f... [truncated message content] |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/related In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/documentation/sources/asl/related Modified Files: adam_language_reference.dox asl_overview.dox eve_language_reference.dox reference_expression_section.dox Log Message: asl 1.0.13 Index: asl_overview.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/related/asl_overview.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** asl_overview.dox 8 Aug 2005 17:01:28 -0000 1.2 --- asl_overview.dox 3 Feb 2006 18:33:35 -0000 1.3 *************** *** 20,54 **** \section asl_overview_toc Table of Contents \par ! - \ref asl_foreword ! -# \ref asl_overview_intro_to_adam_and_eve ! -# \ref asl_overview_terminology ! -# \ref asl_overview_history ! -# \ref asl_overview_goals_for_adam ! -# \ref asl_overview_adam_goal_1 ! -# \ref asl_overview_adam_goal_2 ! -# \ref asl_overview_adam_goal_3 ! -# \ref asl_overview_adam_goal_4 ! -# \ref asl_overview_adam_goal_5 ! -# \ref asl_overview_understanding_adam ! -# \ref asl_overview_understanding_adam_modelling_controller ! -# \ref asl_overview_adam_and_eve_architecture ! -# \ref asl_overview_adam_and_eve_architecture_overview ! -# \ref asl_overview_adam_and_eve_expression_language ! -# \ref asl_overview_adam_and_eve_adam ! -# \ref asl_overview_adam_and_eve_virtual_machine ! -# \ref asl_overview_adam_and_eve_eve2 ! -# \ref asl_overview_adam_and_eve_eve2_parser ! -# \ref asl_overview_adam_and_eve_eve2_types ! -# \ref asl_overview_adam_and_eve_eve2_ves ! -# \ref asl_overview_adam_and_eve_eve2_binding ! -# \ref asl_overview_adam_and_eve_eve2_guides ! -# \ref asl_overview_adam_and_eve_eve2_dynamic_evaluation ! -# \ref asl_overview_adam_and_eve_eve2_outsets_etc ! -# \ref asl_overview_library_integration ! -# \ref asl_overview_open_issues ! -# \ref asl_overview_grammars ! -# \ref asl_overview_future_ideas ! -# \ref asl_overview_future_ideas_expresso2 ! -# \ref asl_overview_future_ideas_eve2 \section asl_overview_intro_to_adam_and_eve Introduction to Adam and Eve --- 20,54 ---- \section asl_overview_toc Table of Contents \par ! - \ref asl_foreword ! -# \ref asl_overview_intro_to_adam_and_eve ! -# \ref asl_overview_terminology ! -# \ref asl_overview_history ! -# \ref asl_overview_goals_for_adam ! -# \ref asl_overview_adam_goal_1 ! -# \ref asl_overview_adam_goal_2 ! -# \ref asl_overview_adam_goal_3 ! -# \ref asl_overview_adam_goal_4 ! -# \ref asl_overview_adam_goal_5 ! -# \ref asl_overview_understanding_adam ! -# \ref asl_overview_understanding_adam_modelling_controller ! -# \ref asl_overview_adam_and_eve_architecture ! -# \ref asl_overview_adam_and_eve_architecture_overview ! -# \ref asl_overview_adam_and_eve_expression_language ! -# \ref asl_overview_adam_and_eve_adam ! -# \ref asl_overview_adam_and_eve_virtual_machine ! -# \ref asl_overview_adam_and_eve_eve2 ! -# \ref asl_overview_adam_and_eve_eve2_parser ! -# \ref asl_overview_adam_and_eve_eve2_types ! -# \ref asl_overview_adam_and_eve_eve2_ves ! -# \ref asl_overview_adam_and_eve_eve2_binding ! -# \ref asl_overview_adam_and_eve_eve2_guides ! -# \ref asl_overview_adam_and_eve_eve2_dynamic_evaluation ! -# \ref asl_overview_adam_and_eve_eve2_outsets_etc ! -# \ref asl_overview_library_integration ! -# \ref asl_overview_open_issues ! -# \ref asl_overview_grammars ! -# \ref asl_overview_future_ideas ! -# \ref asl_overview_future_ideas_expresso2 ! -# \ref asl_overview_future_ideas_eve2 \section asl_overview_intro_to_adam_and_eve Introduction to Adam and Eve *************** *** 81,91 **** \par Goals: ! -# Make it easier to specify and modify the layout of a human interface. ! -# Have a single definition of the interface for all platforms. ! -# Have a single definition of the interface for all languages. \par Requirements: ! -# Must allow piecemeal incorporation into an application, freeing the entire human interface from being converted to Eve in one pass. ! -# Generate layouts as good or better than those generated by hand. \par Meeting this requirement 1 led to architecture for Eve that is easy to incorporate into most any application framework. --- 81,91 ---- \par Goals: ! -# Make it easier to specify and modify the layout of a human interface. ! -# Have a single definition of the interface for all platforms. ! -# Have a single definition of the interface for all languages. \par Requirements: ! -# Must allow piecemeal incorporation into an application, freeing the entire human interface from being converted to Eve in one pass. ! -# Generate layouts as good or better than those generated by hand. \par Meeting this requirement 1 led to architecture for Eve that is easy to incorporate into most any application framework. *************** *** 126,134 **** { output: ! result <== { path: path, flatness: flatness }; interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } \endverbatim --- 126,134 ---- { output: ! result <== { path: path, flatness: flatness }; interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } \endverbatim *************** *** 226,234 **** { output: ! result <== { path: path, flatness: flatness }; interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } \endverbatim --- 226,234 ---- { output: ! result <== { path: path, flatness: flatness }; interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } \endverbatim *************** *** 242,259 **** \par As C++ code, this statement would simply mean: ! - When executed, evaluate \c path's output and assign \c empty or \c flatness' input to \c flatness' output accordingly. \par As an Adam statement the following is implied: ! - Whenever \c path's output is modified, assign either \c flatness' input or \c empty to \c flatness' output. ! - If \c path's output does not equal \c empty, and \c flatness' input is modified, then update \c flatness' output. \par Further, the following queries can be made: ! - Given a current state, which input cells have an effect upon output cells? ! - Given a current state, upon which input values is \c flatness' output dependent? ! - Which of the values upon which \c flatness' output is currently dependent was updated most recently? \par And, finally, actions can be associated with the results of any of the above statements - such as: ! - When \c flatness' output is modified, update the display. ! - Set the enabled state of the edit text field associated with \c flatness' input according to whether \c flatness' input affects any output values, and update it when that state changes. \par The more inter-related statements there are in a sheet, the higher the effective expressive power of Adam is relative to a traditional event model. The single statement above replaces a 57 line (15 statements by semicolon count) function in Photoshop. --- 242,259 ---- \par As C++ code, this statement would simply mean: ! - When executed, evaluate \c path's output and assign \c empty or \c flatness' input to \c flatness' output accordingly. \par As an Adam statement the following is implied: ! - Whenever \c path's output is modified, assign either \c flatness' input or \c empty to \c flatness' output. ! - If \c path's output does not equal \c empty, and \c flatness' input is modified, then update \c flatness' output. \par Further, the following queries can be made: ! - Given a current state, which input cells have an effect upon output cells? ! - Given a current state, upon which input values is \c flatness' output dependent? ! - Which of the values upon which \c flatness' output is currently dependent was updated most recently? \par And, finally, actions can be associated with the results of any of the above statements - such as: ! - When \c flatness' output is modified, update the display. ! - Set the enabled state of the edit text field associated with \c flatness' input according to whether \c flatness' input affects any output values, and update it when that state changes. \par The more inter-related statements there are in a sheet, the higher the effective expressive power of Adam is relative to a traditional event model. The single statement above replaces a 57 line (15 statements by semicolon count) function in Photoshop. *************** *** 335,340 **** \section asl_overview_open_issues Appendix - Other Open Issues \par ! - Currently Adam is loosely typed. It may be desirable to be able to declare a type for a cell and have the type enforced. If this is done, then a qualifier "optional" will be added to denote that the field could also contain "empty". ! - Investigating XForms. Structured sheets and sheet inclusion. \section asl_overview_grammars Appendix - Grammars --- 335,340 ---- \section asl_overview_open_issues Appendix - Other Open Issues \par ! - Currently Adam is loosely typed. It may be desirable to be able to declare a type for a cell and have the type enforced. If this is done, then a qualifier "optional" will be added to denote that the field could also contain "empty". ! - Investigating XForms. Structured sheets and sheet inclusion. \section asl_overview_grammars Appendix - Grammars *************** *** 343,349 **** \par There are currently four grammars. They can be found in the following files: ! - \ref adam_reference ! - \ref eve_reference ! - \ref expression_reference (describes the lexical grammar and the expression grammar) \section asl_overview_future_ideas Appendix - Future Ideas --- 343,349 ---- \par There are currently four grammars. They can be found in the following files: ! - \ref adam_reference ! - \ref eve_reference ! - \ref expression_reference (describes the lexical grammar and the expression grammar) \section asl_overview_future_ideas Appendix - Future Ideas Index: eve_language_reference.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/related/eve_language_reference.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eve_language_reference.dox 19 Mar 2005 00:16:41 -0000 1.1 --- eve_language_reference.dox 3 Feb 2006 18:33:35 -0000 1.2 *************** *** 7,19 **** The language is divided into three parts, \ref expression_lexical_conventions, \ref expression_expressions, and \ref view_declarations. The first two parts are shared by the Adam Language, and describe in the \ref expression_reference. ! \section view_declarations View Declarations ! \subsection eve_grammar Eve Grammar \verbatim view_definition = [lead_comment] view_class_decl ((";" [trail_comment]) ! | ([trail_comment] view_statement_list). view_statment_sequence = { view_definition }. view_class_decl = ident "(" [ named_argument_list ] ")". view_statment_list = "{" view_statement_sequence "}". \endverbatim */ --- 7,87 ---- The language is divided into three parts, \ref expression_lexical_conventions, \ref expression_expressions, and \ref view_declarations. The first two parts are shared by the Adam Language, and describe in the \ref expression_reference. ! \section view_declarations Layout Declarations ! \subsection eve_grammar Layout Grammar \verbatim + layout_specifier = [lead_comment] "layout" identifier "{" { qualified_cell_decl } + "view" view_definition "}" [trail_comment]. + + qualified_cell_decl = interface_set_decl | constant_set_decl. + + interface_set_decl = "interface" ":" { cell_decl }. + constant_set_decl = "constant" ":" { cell_decl }. + + cell_decl = [lead_comment] identifier initializer end_statement. + initializer = ":" expression. + view_definition = [lead_comment] view_class_decl ((";" [trail_comment]) ! | ([trail_comment] view_statement_list)). view_statment_sequence = { view_definition }. view_class_decl = ident "(" [ named_argument_list ] ")". view_statment_list = "{" view_statement_sequence "}". + + end_statement = ";" [trail_comment]. + + keywords += "layout" | "view" | "interface" | "constant". + \endverbatim + + A layout declaration consists of two parts - a block of cell declarations and a view instance. Here is an example of a simple layout declaration: + + \verbatim + layout simple_dialog + { + constant: + dialog_name: "Hello"; + + view dialog(name: dialog_name) + { + button(name: "World!"); + } + } + \endverbatim + + The identifier "simple_dialog" names this layout [NOTE: This identifier is currently unused by the system but intended for future use]. + + The first part, beginning with the qualifier "constant:", declares cells. A layout cell is similar to a sheet cell [include reference here to adam sheets] but currently more limited. A cell is followed by an initializer, the string "Hello" in our example. The initializers can be any valid expression and are evaluated in the order they are declared. A cell name may be used as a variable name in any expression after the declaration. Here the cell dialog_name is used as a variable to set the name of the dialog instance. + + The second part of the layout is the view instance, beginning with the keyword "view". This consists of a nested set of view class declarations. Here "dialog(name: dialog_name)" declares a "dialog" with the property "name" and the value "Hello". A layout does not ascribe meaning to the view class or view class properties, the particular set of view classes and properties is dependent on the API upon which the layout engine and parser are integrated. ASL does provide a common set of view classes for the Mac OS X Carbon and Win32 APIs which should serve as an example for integrating with any API. [include reference to widget library here.] + + The other type of cell supported by layouts are interface cells. An interface cell can be bound against from within the view instance. This is a runtime binding (unlink using a cell as a variable which is evaluated once at parse time). This is useful for maintaining view specific state such as which panel in a tab group is shown: + + \verbatim + layout simple_tab_group + { + interface: + visible_panel: @first_panel; // default to first panel + + view dialog(name: "Simple Tab Group") + { + tab_group( bind: @visible_panel, + items: [ + {name: "Panel 1", value: @first_panel}, + {name: "Panel 2", value: @second_panel} + ]) + { + panel(value: @first_panel, bind: @visible_panel) + { + static_text(name: "Contents of first panel."); + } + + panel(value: @second_panel, bind: @visible_panel) + { + static_text(name: "Contents of second panel."); + } + } + } + } \endverbatim + + This layout will construct a dialog with a tab group with two panels which can be flipped between. Which panel is visible is controlled by the interface cell "visible_panel". [NOTE: In a future release the layout state will be easily persisted including the current window size, if it is grow-able, and position.]. */ Index: adam_language_reference.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/related/adam_language_reference.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** adam_language_reference.dox 31 Mar 2005 18:51:01 -0000 1.2 --- adam_language_reference.dox 3 Feb 2006 18:33:35 -0000 1.3 *************** *** 11,50 **** \subsection adam_grammar Adam Grammar \verbatim ! translation_unit = { sheet_specifier }. ! sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" ! [trail_comment]. ! qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl ! | constant_set_decl | logic_set_decl | invariant_set_decl. ! interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. ! input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. ! output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. ! constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. ! logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. ! invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. ! interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. ! input_cell_decl = identifier [initializer] end_statement. ! output_cell_decl = named_decl. ! constant_cell_decl = identifier initializer end_statement. ! logic_cell_decl = named_decl | relate_decl. ! invariant_cell_decl = named_decl. ! relate_decl = [conditional] "relate" "{" relate_expression relate_expression ! { relate_expression } "}" [trail_comment]. ! relate_expression = [lead_comment] named_decl. ! named_decl = identifier define_expression end_statement. ! initializer = ":" expression. ! conditional = "when" "(" expression ")". ! define_expression = "<==" expression. ! end_statement = ";" [trail_comment]. ! keywords += "sheet" | "interface" | "input" | "output" | "constant" | "logic" ! | "invariant" | "unlink" | "when" | "relate" \endverbatim --- 11,50 ---- \subsection adam_grammar Adam Grammar \verbatim ! translation_unit = { sheet_specifier }. ! sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" ! [trail_comment]. ! qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl ! | constant_set_decl | logic_set_decl | invariant_set_decl. ! interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. ! input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. ! output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. ! constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. ! logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. ! invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. ! interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. ! input_cell_decl = identifier [initializer] end_statement. ! output_cell_decl = named_decl. ! constant_cell_decl = identifier initializer end_statement. ! logic_cell_decl = named_decl | relate_decl. ! invariant_cell_decl = named_decl. ! relate_decl = [conditional] ("relate" | "weak") "{" relate_expression relate_expression ! { relate_expression } "}" [trail_comment]. ! relate_expression = [lead_comment] named_decl. ! named_decl = identifier define_expression end_statement. ! initializer = ":" expression. ! conditional = "when" "(" expression ")". ! define_expression = "<==" expression. ! end_statement = ";" [trail_comment]. ! keywords += "sheet" | "interface" | "input" | "output" | "constant" | "logic" ! | "invariant" | "unlink" | "when" | "relate" | "weak" \endverbatim *************** *** 65,69 **** adobe::value_t get_image(const adobe::array_t& parameters) { ! return adobe::value_t(get_image(parameters[0].get<std::string>().c_str())); } \endcode --- 65,69 ---- adobe::value_t get_image(const adobe::array_t& parameters) { ! return adobe::value_t(get_image(parameters[0].get<std::string>().c_str())); } \endcode *************** *** 76,82 **** adobe::value_t blur_image(const adobe::array_t& parameters) { ! image_type result = parameters[0].get<image_type>(); ! guassian_blur(result); ! return result; } \endcode --- 76,82 ---- adobe::value_t blur_image(const adobe::array_t& parameters) { ! image_type result = parameters[0].get<image_type>(); ! guassian_blur(result); ! return result; } \endcode Index: reference_expression_section.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/related/reference_expression_section.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reference_expression_section.dox 19 Mar 2005 00:16:41 -0000 1.1 --- reference_expression_section.dox 3 Feb 2006 18:33:35 -0000 1.2 *************** *** 18,23 **** number = digits ["e" ["+" | "-"]] digits. ! quoted_string = '"' {character} '"' | "'" {character} "'". ! digits = digit { digit }. \endverbatim --- 18,23 ---- number = digits ["e" ["+" | "-"]] digits. ! quoted_string = '"' {character} '"' | "'" {character} "'". ! digits = digit { digit }. \endverbatim *************** *** 42,75 **** \subsection expression_grammar Expression Grammar \verbatim ! expression = or_expression ["?" expression ":" expression]. ! or_expression = and_expression { "||" and_expression }. ! and_expression = equality_expression { "&&" equality_expression }. ! equality_expression = relational_expression { ("==" | "!=") relational_expression }. ! relational_expression = additive_expression { ("<" | ">" | "<=" | ">=") additive_expression }. ! additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }. ! multiplicative_expression = unary_expression { ("*" | "/" | "%") unary_expression }. ! unary_expression = postfix_expression | (unary_operator unary_expression). ! unary_operator = "+" | "-" | "!". ! postfix_expression = primary_expression { ("[" expression "]") | ("." identifier) }. ! primary_expression = name | number | boolean | string | "empty" | array | dictionary ! | variable_or_fuction | ( "(" expression ")" ). ! variable_or_function = identifier ["(" [argument_expression_list] ")"]. ! array = "[" [argument_list] "]". ! dictionary = "{" named_argument_list "}". ! argument_expression_list = named_argument_list | argument_list. ! argument_list = expression { "," expression }. ! named_argument_list = named_argument { "," named_argument }. ! named_argument = identifier ":" expression. ! name = "@" identifier. ! boolean = "true" | "false". \endverbatim --- 42,75 ---- \subsection expression_grammar Expression Grammar \verbatim ! expression = or_expression ["?" expression ":" expression]. ! or_expression = and_expression { "||" and_expression }. ! and_expression = equality_expression { "&&" equality_expression }. ! equality_expression = relational_expression { ("==" | "!=") relational_expression }. ! relational_expression = additive_expression { ("<" | ">" | "<=" | ">=") additive_expression }. ! additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }. ! multiplicative_expression = unary_expression { ("*" | "/" | "%") unary_expression }. ! unary_expression = postfix_expression | (unary_operator unary_expression). ! unary_operator = "+" | "-" | "!". ! postfix_expression = primary_expression { ("[" expression "]") | ("." identifier) }. ! primary_expression = name | number | boolean | string | "empty" | array | dictionary ! | variable_or_fuction | ( "(" expression ")" ). ! variable_or_function = identifier ["(" [argument_expression_list] ")"]. ! array = "[" [argument_list] "]". ! dictionary = "{" named_argument_list "}". ! argument_expression_list = named_argument_list | argument_list. ! argument_list = expression { "," expression }. ! named_argument_list = named_argument { "," named_argument }. ! named_argument = identifier ":" expression. ! name = "@" identifier. ! boolean = "true" | "false". \endverbatim |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/sources Modified Files: client_assembler.cpp ui_core.cpp ui_core_common.cpp Log Message: asl 1.0.13 Index: ui_core_common.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/ui_core_common.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ui_core_common.cpp 24 Jan 2006 19:38:47 -0000 1.7 --- ui_core_common.cpp 3 Feb 2006 18:33:37 -0000 1.8 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 20,24 **** #ifdef BOOST_MSVC namespace std { ! using ::isspace; } // namespace std #endif --- 20,24 ---- #ifdef BOOST_MSVC namespace std { ! using ::isspace; } // namespace std #endif *************** *** 32,70 **** void align_slices(::adobe::extents_t::slice_t& slice_one, ::adobe::extents_t::slice_t slice_two) { ! // ! // Make sure that we have points of interest to align by. ! // ! // REVISIT (fbrereto) Are we sure we want to assert here? ! // ! assert(!slice_one.poi_m.empty()); ! assert(!slice_two.poi_m.empty()); ! // ! // The eventual point of interest (or baseline) is the maxiumum ! // of the two we have. ! // ! long poi = std::max(slice_one.poi_m[0], slice_two.poi_m[0]); ! // ! // The length of the slice is the maximum amount before the ! // point of interest (ascent above baseline) plus the maximum ! // amount after the point of interest (descent below the ! // baseline). ! // ! // The maximum before the point of interest is obviously the ! // the point of interest. ! // ! long length = poi + std::max( slice_one.length_m - slice_one.poi_m[0], ! slice_two.length_m - slice_two.poi_m[0]); ! // ! // Set our new values into the first slice. ! // ! slice_one.poi_m[0] = poi; ! slice_one.length_m = length; } --- 32,70 ---- void align_slices(::adobe::extents_t::slice_t& slice_one, ::adobe::extents_t::slice_t slice_two) { ! // ! // Make sure that we have points of interest to align by. ! // ! // REVISIT (fbrereto) Are we sure we want to assert here? ! // ! assert(!slice_one.poi_m.empty()); ! assert(!slice_two.poi_m.empty()); ! // ! // The eventual point of interest (or baseline) is the maxiumum ! // of the two we have. ! // ! long poi = std::max(slice_one.poi_m[0], slice_two.poi_m[0]); ! // ! // The length of the slice is the maximum amount before the ! // point of interest (ascent above baseline) plus the maximum ! // amount after the point of interest (descent below the ! // baseline). ! // ! // The maximum before the point of interest is obviously the ! // the point of interest. ! // ! long length = poi + std::max( slice_one.length_m - slice_one.poi_m[0], ! slice_two.length_m - slice_two.poi_m[0]); ! // ! // Set our new values into the first slice. ! // ! slice_one.poi_m[0] = poi; ! slice_one.length_m = length; } *************** *** 73,77 **** std::string localize(const std::string& str) { ! return adobe::xstring(str); } --- 73,77 ---- std::string localize(const std::string& str) { ! return adobe::xstring(str); } *************** *** 80,86 **** ui_core_error_handler_proc_t& ui_core_error_handler() { ! static ui_core_error_handler_proc_t ui_core_error_handler_proc_s; ! return ui_core_error_handler_proc_s; } --- 80,86 ---- ui_core_error_handler_proc_t& ui_core_error_handler() { ! static ui_core_error_handler_proc_t ui_core_error_handler_proc_s; ! return ui_core_error_handler_proc_s; } *************** *** 89,97 **** void report_ui_element_error(const std::string& error) { ! ui_core_error_handler_proc_t& proc(ui_core_error_handler()); ! if (proc.empty()) return; ! proc(error); } --- 89,97 ---- void report_ui_element_error(const std::string& error) { ! ui_core_error_handler_proc_t& proc(ui_core_error_handler()); ! if (proc.empty()) return; ! proc(error); } Index: ui_core.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/ui_core.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ui_core.cpp 24 Jan 2006 19:38:47 -0000 1.6 --- ui_core.cpp 3 Feb 2006 18:33:37 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...1820 lines suppressed...] ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DEFINITION(adobe::unit_edit_text_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DEFINITION(adobe::slider_t); /****************************************************************************************************/ ! #define ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(type) \ ! type::implementation_t& type::implementation() \ ! { assert(object_m); return *object_m; } \ ! const type::implementation_t& type::implementation() const \ ! { assert(object_m); return *object_m; } ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(number_formatter_t); *************** *** 1019,1023 **** ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(unit_edit_text_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(slider_t); - ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(bevel_button_t); /****************************************************************************************************/ --- 938,941 ---- Index: client_assembler.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/client_assembler.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** client_assembler.cpp 24 Jan 2006 19:38:47 -0000 1.8 --- client_assembler.cpp 3 Feb 2006 18:33:37 -0000 1.9 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...6538 lines suppressed...] ! adobe::virtual_machine_t evaluator; ! /* ! We set the initial parent to be the root of the main display, an ! empty eve iterator and the given dialog size. ! */ ! adobe::parse(stream, adobe::line_position_t(file_path, getline_proc), ! adobe::widget_node_t(dialog_size, adobe::eve_t::iterator(), adobe::get_main_display().root() #ifndef NDEBUG ! , adobe::ui_overlay_t::position_t() #endif ! ), ! bind_layout(boost::bind(&client_assembler, boost::ref(token), _1, _2, _3, factory), ! result->layout_sheet_m, evaluator)); ! ! result->contributing_m = sheet.contributing(); ! return result; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/begin/sources/mac Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/mac/main.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.cpp 24 Jan 2006 19:38:50 -0000 1.4 --- main.cpp 3 Feb 2006 18:33:39 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanyinf file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanyinf file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ *************** *** 19,40 **** /****************************************************************************************************/ ! #define kHICommandRefreshView 'Reld' ! #define kHICommandRefreshSheet 'RfsS' ! #define kHICommandNormalDialogSize 'NrSz' ! #define kHICommandSmallDialogSize 'SmSz' ! #define kHICommandMiniDialogSize 'MnSz' ! #define kHICommandFrameWidgets 'TgFm' ! #define kHICommandClearWidgetFrames 'ClFr' ! #define kHICommandSerializeWidgets 'SzWg' ! #define kHICommandRunModal 'dlog' ! #define kHICommandLocalizationENUS 'enus' ! #define kHICommandLocalizationDEDE 'dede' ! #define kHICommandLocalizationJAJP 'jajp' ! #define kHICommandLocalizationKOKR 'kokr' ! #define kHICommandLocalizationPGPG 'pgpg' ! const CFStringRef kMainNibFileName (CFSTR( "begin" )); ! const CFStringRef kMenuBarNibName (CFSTR( "MenuBar" )); /****************************************************************************************************/ --- 19,40 ---- /****************************************************************************************************/ ! #define kHICommandRefreshView 'Reld' ! #define kHICommandRefreshSheet 'RfsS' ! #define kHICommandNormalDialogSize 'NrSz' ! #define kHICommandSmallDialogSize 'SmSz' ! #define kHICommandMiniDialogSize 'MnSz' ! #define kHICommandFrameWidgets 'TgFm' ! #define kHICommandClearWidgetFrames 'ClFr' ! #define kHICommandSerializeWidgets 'SzWg' ! #define kHICommandRunModal 'dlog' ! #define kHICommandLocalizationENUS 'enus' ! #define kHICommandLocalizationDEDE 'dede' ! #define kHICommandLocalizationJAJP 'jajp' ! #define kHICommandLocalizationKOKR 'kokr' ! #define kHICommandLocalizationPGPG 'pgpg' ! const CFStringRef kMainNibFileName (CFSTR( "begin" )); ! const CFStringRef kMenuBarNibName (CFSTR( "MenuBar" )); /****************************************************************************************************/ *************** *** 53,77 **** /// than using the FSRef API. /// ! /// \param location the FSRef to make into a bfs::path ! /// \return a bfs path of the given location. // boost::filesystem::path fsref_to_path( const FSRef& location ) { ! std::size_t max_size (1024); ! std::vector<char> path_buffer(max_size); ! OSStatus error(noErr); ! ! while (true) ! { ! error = ::FSRefMakePath(&location, reinterpret_cast<UInt8*>(&path_buffer[0]), max_size); ! if (error != pathTooLongErr) break; ! ! max_size *= 2; ! path_buffer.resize(max_size); ! } ! ! ADOBE_REQUIRE_STATUS(error); ! ! return boost::filesystem::path( &path_buffer[0], boost::filesystem::native ); } --- 53,77 ---- /// than using the FSRef API. /// ! /// \param location the FSRef to make into a bfs::path ! /// \return a bfs path of the given location. // boost::filesystem::path fsref_to_path( const FSRef& location ) { ! std::size_t max_size (1024); ! std::vector<char> path_buffer(max_size); ! OSStatus error(noErr); ! ! while (true) ! { ! error = ::FSRefMakePath(&location, reinterpret_cast<UInt8*>(&path_buffer[0]), max_size); ! if (error != pathTooLongErr) break; ! ! max_size *= 2; ! path_buffer.resize(max_size); ! } ! ! ADOBE_REQUIRE_STATUS(error); ! ! return boost::filesystem::path( &path_buffer[0], boost::filesystem::native ); } *************** *** 83,131 **** void OpenTheDocuments(AEDescList* documents) { ! adobe::application_t* theApp = adobe::application_t::getInstance(); ! long doc_count; ! FSRef file; ! AEKeyword keyword; ! DescType type_code; ! Size actual_size; ! ADOBE_REQUIRE_STATUS(AECountItems(documents, &doc_count)); ! ! bool is_adam (false); ! bool is_eve (false); ! for (long i = 1 ; i <= doc_count; ++i) ! { ! /* ! get the i'th FSSpec record. NOTE: implicity, we are calling ! a coercion handler because this list actually contains alias records. ! In particular, the coercion handler converts them from alias records ! into FSSpec records. ! */ ! ADOBE_REQUIRE_STATUS(AEGetNthPtr(documents, i, typeFSRef, &keyword, &type_code, ! (Ptr) &file, sizeof(file), (actual_size = sizeof(file), &actual_size))); ! // ! // We need to get the directory name and the file name of the document ! // which we have been asked to open. ! // ! bfs::path file_name( fsref_to_path( file ) ); ! std::string extension( boost::filesystem::extension( file_name ) ); ! if (extension == ".eve") ! { ! theApp->set_eve_file( file_name ); ! is_eve = true; ! } ! else if (extension == ".adm") ! { ! theApp->set_adam_file( file_name ); ! is_adam = true; ! } ! ! } ! if (is_adam) theApp->load_sheet(); // will display window ! else if (is_eve) theApp->display_window(); } --- 83,131 ---- void OpenTheDocuments(AEDescList* documents) { ! adobe::application_t* theApp = adobe::application_t::getInstance(); ! long doc_count; ! FSRef file; ! AEKeyword keyword; ! DescType type_code; ! Size actual_size; ! ADOBE_REQUIRE_STATUS(AECountItems(documents, &doc_count)); ! ! bool is_adam (false); ! bool is_eve (false); ! for (long i = 1 ; i <= doc_count; ++i) ! { ! /* ! get the i'th FSSpec record. NOTE: implicity, we are calling ! a coercion handler because this list actually contains alias records. ! In particular, the coercion handler converts them from alias records ! into FSSpec records. ! */ ! ADOBE_REQUIRE_STATUS(AEGetNthPtr(documents, i, typeFSRef, &keyword, &type_code, ! (Ptr) &file, sizeof(file), (actual_size = sizeof(file), &actual_size))); ! // ! // We need to get the directory name and the file name of the document ! // which we have been asked to open. ! // ! bfs::path file_name( fsref_to_path( file ) ); ! std::string extension( boost::filesystem::extension( file_name ) ); ! if (extension == ".eve") ! { ! theApp->set_eve_file( file_name ); ! is_eve = true; ! } ! else if (extension == ".adm") ! { ! theApp->set_adam_file( file_name ); ! is_adam = true; ! } ! ! } ! if (is_adam) theApp->load_sheet(); // will display window ! else if (is_eve) theApp->display_window(); } *************** *** 135,172 **** /// Handle "open documents" requests coming from AppleEvents. /// ! /// \param appleEvt the apple event to respond to. ! /// \param reply the default reply event ! /// \param ref the AE dispatch table.. // pascal OSErr handle_open( const AppleEvent* appleEvt, AppleEvent* /*reply*/, long /*ref*/ ) try { ! OSErr error; ! AEDescList documents; ! // ! // Allocate AEDescList's internals. ! // ! AECreateDesc( typeNull, 0, 0, &documents ); ! // ! // Try to get the list of documents to open. ! // ! error = AEGetParamDesc( appleEvt, keyDirectObject, typeAEList, &documents ); ! if( error == noErr ) OpenTheDocuments( &documents ); ! // ! // Release the document list and return. ! // ! AEDisposeDesc( &documents ); ! return error; } catch( ... ) { ! adobe::report_exception(); ! return -1; // REVISIT } --- 135,172 ---- /// Handle "open documents" requests coming from AppleEvents. /// ! /// \param appleEvt the apple event to respond to. ! /// \param reply the default reply event ! /// \param ref the AE dispatch table.. // pascal OSErr handle_open( const AppleEvent* appleEvt, AppleEvent* /*reply*/, long /*ref*/ ) try { ! OSErr error; ! AEDescList documents; ! // ! // Allocate AEDescList's internals. ! // ! AECreateDesc( typeNull, 0, 0, &documents ); ! // ! // Try to get the list of documents to open. ! // ! error = AEGetParamDesc( appleEvt, keyDirectObject, typeAEList, &documents ); ! if( error == noErr ) OpenTheDocuments( &documents ); ! // ! // Release the document list and return. ! // ! AEDisposeDesc( &documents ); ! return error; } catch( ... ) { ! adobe::report_exception(); ! return -1; // REVISIT } *************** *** 176,302 **** /// Handle commands coming from the menubar. /// ! /// \param handler the next handler to call. ! /// \param event description of the event. ! /// \param data the application_t we need to communicate with. // static pascal OSStatus menu_command( EventHandlerCallRef /*handler*/, EventRef event, void* data ) try { ! adobe::application_t* theApp( static_cast<adobe::application_t*>( data ) ); ! OSStatus result( noErr ); ! HICommand command; ! // ! // We can't do anything without a pointer to the application ! // object. ! // ! if( !theApp ) return eventNotHandledErr; ! if( GetEventParameter( event, kEventParamDirectObject, ! typeHICommand, 0, sizeof( command ), 0, &command ) ) ! return eventNotHandledErr; ! // ! // Figure out what we're meant to do. ! // ! switch( command.commandID ) ! { #ifndef NDEBUG ! case kHICommandFrameWidgets: ! theApp->frame_window(); ! break; ! case kHICommandClearWidgetFrames: ! theApp->clear_window_frames(); ! break; #else ! case kHICommandFrameWidgets: ! case kHICommandClearWidgetFrames: ! adobe::system_beep(); ! break; #endif ! case kHICommandNormalDialogSize: ! theApp->set_dialog_size( size_normal_s ); ! theApp->display_window(); ! break; ! case kHICommandSmallDialogSize: ! theApp->set_dialog_size( size_small_s ); ! theApp->display_window(); ! break; ! case kHICommandMiniDialogSize: ! theApp->set_dialog_size( size_mini_s ); ! theApp->display_window(); ! break; ! case kHICommandRefreshView: ! theApp->display_window(); ! break; ! case kHICommandRefreshSheet: ! theApp->load_sheet(); ! break; ! case kHICommandSerializeWidgets: ! theApp->serialize_connections(); ! break; ! case kHICommandRunModal: ! theApp->run_current_as_modal(); ! break; ! case kHICommandLocalizationENUS: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("en-us"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationDEDE: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("de-de"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationJAJP: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("ja-jp"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationKOKR: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("ko-kr"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationPGPG: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("pg-pg"))); ! theApp->display_window(); ! break; ! case kHICommandSave: ! case kHICommandSaveAs: ! case kHICommandClose: ! case kHICommandNew: ! case kHICommandOpen: ! case kHICommandPageSetup: ! case kHICommandPrint: ! adobe::system_beep(); ! break; ! default: ! result = eventNotHandledErr; ! break; ! } ! return result; } catch( ... ) { ! adobe::report_exception(); ! return eventNotHandledErr; } --- 176,302 ---- /// Handle commands coming from the menubar. /// ! /// \param handler the next handler to call. ! /// \param event description of the event. ! /// \param data the application_t we need to communicate with. // static pascal OSStatus menu_command( EventHandlerCallRef /*handler*/, EventRef event, void* data ) try { ! adobe::application_t* theApp( static_cast<adobe::application_t*>( data ) ); ! OSStatus result( noErr ); ! HICommand command; ! // ! // We can't do anything without a pointer to the application ! // object. ! // ! if( !theApp ) return eventNotHandledErr; ! if( GetEventParameter( event, kEventParamDirectObject, ! typeHICommand, 0, sizeof( command ), 0, &command ) ) ! return eventNotHandledErr; ! // ! // Figure out what we're meant to do. ! // ! switch( command.commandID ) ! { #ifndef NDEBUG ! case kHICommandFrameWidgets: ! theApp->frame_window(); ! break; ! case kHICommandClearWidgetFrames: ! theApp->clear_window_frames(); ! break; #else ! case kHICommandFrameWidgets: ! case kHICommandClearWidgetFrames: ! adobe::system_beep(); ! break; #endif ! case kHICommandNormalDialogSize: ! theApp->set_dialog_size( size_normal_s ); ! theApp->display_window(); ! break; ! case kHICommandSmallDialogSize: ! theApp->set_dialog_size( size_small_s ); ! theApp->display_window(); ! break; ! case kHICommandMiniDialogSize: ! theApp->set_dialog_size( size_mini_s ); ! theApp->display_window(); ! break; ! case kHICommandRefreshView: ! theApp->display_window(); ! break; ! case kHICommandRefreshSheet: ! theApp->load_sheet(); ! break; ! case kHICommandSerializeWidgets: ! theApp->serialize_connections(); ! break; ! case kHICommandRunModal: ! theApp->run_current_as_modal(); ! break; ! case kHICommandLocalizationENUS: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("en-us"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationDEDE: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("de-de"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationJAJP: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("ja-jp"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationKOKR: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("ko-kr"))); ! theApp->display_window(); ! break; ! case kHICommandLocalizationPGPG: ! adobe::implementation::top_frame().attribute_set_m.insert( ! std::make_pair(adobe::static_token_range("lang"), adobe::static_token_range("pg-pg"))); ! theApp->display_window(); ! break; ! case kHICommandSave: ! case kHICommandSaveAs: ! case kHICommandClose: ! case kHICommandNew: ! case kHICommandOpen: ! case kHICommandPageSetup: ! case kHICommandPrint: ! adobe::system_beep(); ! break; ! default: ! result = eventNotHandledErr; ! break; ! } ! return result; } catch( ... ) { ! adobe::report_exception(); ! return eventNotHandledErr; } *************** *** 318,325 **** struct delete_ptr<AEEventHandlerUPP> { ! void operator()( AEEventHandlerUPP x ) const ! { ! if( x ) DisposeAEEventHandlerUPP( x ); ! } }; --- 318,325 ---- struct delete_ptr<AEEventHandlerUPP> { ! void operator()( AEEventHandlerUPP x ) const ! { ! if( x ) DisposeAEEventHandlerUPP( x ); ! } }; *************** *** 329,336 **** struct delete_ptr<EventHandlerUPP> { ! void operator()( EventHandlerUPP x ) const ! { ! if( x ) DisposeEventHandlerUPP( x ); ! } }; --- 329,336 ---- struct delete_ptr<EventHandlerUPP> { ! void operator()( EventHandlerUPP x ) const ! { ! if( x ) DisposeEventHandlerUPP( x ); ! } }; *************** *** 339,395 **** bool os_initialize( adobe::application_t* theApp ) { ! // ! // On the Mac we need to install the application menus, respond ! // to AppleEvents and set the resource path. We set the resource ! // path first. ! // ! ProcessSerialNumber psn; ! ADOBE_REQUIRE_STATUS( GetCurrentProcess( &psn ) ); ! FSRef location; ! ADOBE_REQUIRE_STATUS( GetProcessBundleLocation( &psn, &location ) ); ! theApp->set_resource_directory( fsref_to_path( location ) / "Contents/Resources" ); ! // ! // Now load our bundle, sign up for AppleEvents and show the menu. ! // ! CFBundleRef bundle = CFBundleGetMainBundle(); ! IBNibRef nibs = 0; ! if( !bundle ) return false; ! ADOBE_REQUIRE_STATUS( CreateNibReferenceWithCFBundle( bundle, kMainNibFileName, &nibs ) ); ! if( !nibs ) ! { ! ::CFRelease( bundle ); ! return false; ! } ! // ! // Sign up to handle the "Open" AppleEvent. ! // ! static adobe::auto_resource<AEEventHandlerUPP> ae_handler( NewAEEventHandlerUPP( handle_open ) ); ! AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments, ae_handler.get(), 0, false ); ! // ! // Install the menu, and it's event handler. ! // ! ADOBE_REQUIRE_STATUS( SetMenuBarFromNib( nibs, kMenuBarNibName ) ); ! static EventTypeSpec hi_event = { kEventClassCommand, kHICommandFromMenu }; ! static adobe::auto_resource<EventHandlerUPP> hi_handler( NewEventHandlerUPP( menu_command ) ); ! InstallApplicationEventHandler( hi_handler.get(), 1, &hi_event, theApp, 0 ); ! // ! // Register this app as an Appearance Client ! // ! RegisterAppearanceClient(); ! return true; } --- 339,395 ---- bool os_initialize( adobe::application_t* theApp ) { ! // ! // On the Mac we need to install the application menus, respond ! // to AppleEvents and set the resource path. We set the resource ! // path first. ! // ! ProcessSerialNumber psn; ! ADOBE_REQUIRE_STATUS( GetCurrentProcess( &psn ) ); ! FSRef location; ! ADOBE_REQUIRE_STATUS( GetProcessBundleLocation( &psn, &location ) ); ! theApp->set_resource_directory( fsref_to_path( location ) / "Contents/Resources" ); ! // ! // Now load our bundle, sign up for AppleEvents and show the menu. ! // ! CFBundleRef bundle = CFBundleGetMainBundle(); ! IBNibRef nibs = 0; ! if( !bundle ) return false; ! ADOBE_REQUIRE_STATUS( CreateNibReferenceWithCFBundle( bundle, kMainNibFileName, &nibs ) ); ! if( !nibs ) ! { ! ::CFRelease( bundle ); ! return false; ! } ! // ! // Sign up to handle the "Open" AppleEvent. ! // ! static adobe::auto_resource<AEEventHandlerUPP> ae_handler( NewAEEventHandlerUPP( handle_open ) ); ! AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments, ae_handler.get(), 0, false ); ! // ! // Install the menu, and it's event handler. ! // ! ADOBE_REQUIRE_STATUS( SetMenuBarFromNib( nibs, kMenuBarNibName ) ); ! static EventTypeSpec hi_event = { kEventClassCommand, kHICommandFromMenu }; ! static adobe::auto_resource<EventHandlerUPP> hi_handler( NewEventHandlerUPP( menu_command ) ); ! InstallApplicationEventHandler( hi_handler.get(), 1, &hi_event, theApp, 0 ); ! // ! // Register this app as an Appearance Client ! // ! RegisterAppearanceClient(); ! return true; } *************** *** 398,402 **** void os_mainloop() { ! RunApplicationEventLoop(); } --- 398,402 ---- void os_mainloop() { ! RunApplicationEventLoop(); } *************** *** 405,409 **** void os_end_mainloop() { ! QuitApplicationEventLoop(); } --- 405,409 ---- void os_end_mainloop() { ! QuitApplicationEventLoop(); } *************** *** 416,431 **** int main() { ! try ! { ! adobe::application_t* theApp = adobe::application_t::getInstance(); ! if( theApp ) theApp->run(); ! } ! catch( ... ) ! { ! adobe::report_exception(); ! } ! return 0; } --- 416,431 ---- int main() { ! try ! { ! adobe::application_t* theApp = adobe::application_t::getInstance(); ! if( theApp ) theApp->run(); ! } ! catch( ... ) ! { ! adobe::report_exception(); ! } ! return 0; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/adam_smoke Modified Files: adam_smoke_test.cpp rtd.adm Log Message: asl 1.0.13 Index: adam_smoke_test.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_smoke/adam_smoke_test.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** adam_smoke_test.cpp 6 Jan 2006 18:03:00 -0000 1.2 --- adam_smoke_test.cpp 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 38,43 **** struct option_result_t { ! std::string directory_m; ! std::string sheet_m; }; --- 38,43 ---- struct option_result_t { ! std::string directory_m; ! std::string sheet_m; }; *************** *** 46,81 **** void usage(const std::string& app_name) { ! std::cout << "\nAdam smoke test app v" << ADOBE_VERSION_MAJOR << "." << ADOBE_VERSION_MINOR << "." << ADOBE_VERSION_SUBMINOR << "\n\n"; ! std::cout << "usage: " << app_name << " [ root_path_name ]\n\n"; ! std::cout << "\troot_path_name specifies the root name of an Adam sheet/Known good file pair. The Adam\n"; ! std::cout << "\tsheet contains the model we would like to test, and the known good file contains\n"; ! std::cout << "\tcontributing and resulting information. When the contributing information is passed\n"; ! std::cout << "\tthrough the model, the known good resultant information should match the result. If the results\n"; ! std::cout << "\tmatch, the app will return 0, 1 otherwise.\n"; ! std::cout << "\n"; } /****************************************************************************************************/ ! adobe::dictionary_t read_dictionary(const bfs::path& filepath) { ! std::ifstream input_file(filepath.native_file_string().c_str()); ! adobe::expression_parser parser(input_file, adobe::line_position_t("input dictionary")); ! adobe::array_t expression; ! if (!input_file.is_open()) ! { ! std::cout << "Could not open \"" << filepath.native_file_string() << "\"!\n"; ! throw std::runtime_error("file error"); ! } ! parser.require_expression(expression); ! adobe::virtual_machine_t machine; ! machine.evaluate(expression); ! return machine.back().value_m.get<adobe::dictionary_t>(); } --- 46,81 ---- void usage(const std::string& app_name) { ! std::cout << "\nAdam smoke test app v" << ADOBE_VERSION_MAJOR << "." << ADOBE_VERSION_MINOR << "." << ADOBE_VERSION_SUBMINOR << "\n\n"; ! std::cout << "usage: " << app_name << " [ root_path_name ]\n\n"; ! std::cout << "\troot_path_name specifies the root name of an Adam sheet/Known good file pair. The Adam\n"; ! std::cout << "\tsheet contains the model we would like to test, and the known good file contains\n"; ! std::cout << "\tcontributing and resulting information. When the contributing information is passed\n"; ! std::cout << "\tthrough the model, the known good resultant information should match the result. If the results\n"; ! std::cout << "\tmatch, the app will return 0, 1 otherwise.\n"; ! std::cout << "\n"; } /****************************************************************************************************/ ! adobe::dictionary_t read_dictionary(const bfs::path& filepath) { ! std::ifstream input_file(filepath.native_file_string().c_str()); ! adobe::expression_parser parser(input_file, adobe::line_position_t("input dictionary")); ! adobe::array_t expression; ! if (!input_file.is_open()) ! { ! std::cout << "Could not open \"" << filepath.native_file_string() << "\"!\n"; ! throw std::runtime_error("file error"); ! } ! parser.require_expression(expression); ! adobe::virtual_machine_t machine; ! machine.evaluate(expression); ! return machine.back().value_m.get<adobe::dictionary_t>(); } *************** *** 85,108 **** void read_sheet(const bfs::path& filepath, adobe::sheet_t& sheet) { ! std::ifstream input_file(filepath.native_file_string().c_str()); ! if (!input_file.is_open()) ! { ! std::cout << "Could not open \"" << filepath.native_file_string() << "\"!\n"; ! throw std::runtime_error("file error"); ! } ! try ! { ! // set up adam sheet ! adobe::parse(input_file, adobe::line_position_t(filepath.native_file_string().c_str()), adobe::bind_to_sheet(sheet)); ! } ! catch (const adobe::stream_error_t& doh) ! { ! std::cerr << "adobe:: " << ": " << format_stream_error(input_file, doh) << "\n"; ! throw; ! } } --- 85,108 ---- void read_sheet(const bfs::path& filepath, adobe::sheet_t& sheet) { ! std::ifstream input_file(filepath.native_file_string().c_str()); ! if (!input_file.is_open()) ! { ! std::cout << "Could not open \"" << filepath.native_file_string() << "\"!\n"; ! throw std::runtime_error("file error"); ! } ! try ! { ! // set up adam sheet ! adobe::parse(input_file, adobe::line_position_t(filepath.native_file_string().c_str()), adobe::bind_to_sheet(sheet)); ! } ! catch (const adobe::stream_error_t& doh) ! { ! std::cerr << "adobe:: " << ": " << format_stream_error(input_file, doh) << "\n"; ! throw; ! } } *************** *** 111,127 **** bool compare_arrays(const adobe::array_t& a, const adobe::array_t& b) { ! /* ! This is in place to handle precision loss due to serialization -- ! serialize both (so the loss is the same, ideally) and see if the ! strings are the same. Consider a more efficient means at some point. ! */ ! std::stringstream a_str; ! std::stringstream b_str; ! a_str << adobe::begin_asl_cel << a << adobe::end_asl_cel; ! b_str << adobe::begin_asl_cel << b << adobe::end_asl_cel; ! return a_str.str() == b_str.str(); } --- 111,127 ---- bool compare_arrays(const adobe::array_t& a, const adobe::array_t& b) { ! /* ! This is in place to handle precision loss due to serialization -- ! serialize both (so the loss is the same, ideally) and see if the ! strings are the same. Consider a more efficient means at some point. ! */ ! std::stringstream a_str; ! std::stringstream b_str; ! a_str << adobe::begin_asl_cel << a << adobe::end_asl_cel; ! b_str << adobe::begin_asl_cel << b << adobe::end_asl_cel; ! return a_str.str() == b_str.str(); } *************** *** 130,187 **** bool test_sheet(const bfs::path& root) { ! bool success(true); ! std::string triple_name(root.leaf()); ! bfs::path sheet_path(root.branch_path() / (triple_name + ".adm")); ! bfs::path input_path(root.branch_path() / (triple_name + ".admi")); ! adobe::sheet_t sheet; ! adobe::dictionary_t input; ! adobe::dictionary_t contributing; ! adobe::value_t sheet_value; ! adobe::value_t input_value; ! read_sheet(sheet_path, sheet); ! input = read_dictionary(input_path); ! // get contributing cells array ! contributing = input[adobe::static_name_t("contributing")].get<adobe::dictionary_t>(); ! // get expected value array ! input_value = input[adobe::static_name_t("value")]; ! sheet.update(); ! for (adobe::dictionary_t::const_iterator first(contributing.begin()), last(contributing.end()); first != last; ++first) ! { ! adobe::name_t cell(first->first); ! adobe::value_t value(first->second); ! std::cout << "Setting Cell '" << cell.get() << "' to " << adobe::begin_asl_cel << value << adobe::end_asl_cel; ! sheet.set(cell, value); ! } ! sheet.update(); ! // get calculated value array ! sheet_value = sheet.inspect(adobe::parse_adam_expression(std::string("result"))); ! // compare and show interesting results ! if (compare_arrays(input_value.get<adobe::array_t>(), sheet_value.get<adobe::array_t>())) ! { ! std::cout << "*** PASS *** Expected value calculated!\n"; ! } ! else ! { ! std::cout << "*** FAIL *** Values are different...\n"; ! std::cout << "Expected Value:\n"; ! std::cout << '\t' << adobe::begin_asl_cel << input_value << adobe::end_asl_cel; ! std::cout << "Calculated Value:\n"; ! std::cout << '\t' << adobe::begin_asl_cel << sheet_value << adobe::end_asl_cel; ! success = false; ! } ! return success; } --- 130,187 ---- bool test_sheet(const bfs::path& root) { ! bool success(true); ! std::string triple_name(root.leaf()); ! bfs::path sheet_path(root.branch_path() / (triple_name + ".adm")); ! bfs::path input_path(root.branch_path() / (triple_name + ".admi")); ! adobe::sheet_t sheet; ! adobe::dictionary_t input; ! adobe::dictionary_t contributing; ! adobe::value_t sheet_value; ! adobe::value_t input_value; ! read_sheet(sheet_path, sheet); ! input = read_dictionary(input_path); ! // get contributing cells array ! contributing = input[adobe::static_name_t("contributing")].get<adobe::dictionary_t>(); ! // get expected value array ! input_value = input[adobe::static_name_t("value")]; ! sheet.update(); ! for (adobe::dictionary_t::const_iterator first(contributing.begin()), last(contributing.end()); first != last; ++first) ! { ! adobe::name_t cell(first->first); ! adobe::value_t value(first->second); ! std::cout << "Setting Cell '" << cell.get() << "' to " << adobe::begin_asl_cel << value << adobe::end_asl_cel; ! sheet.set(cell, value); ! } ! sheet.update(); ! // get calculated value array ! sheet_value = sheet.inspect(adobe::parse_adam_expression(std::string("result"))); ! // compare and show interesting results ! if (compare_arrays(input_value.get<adobe::array_t>(), sheet_value.get<adobe::array_t>())) ! { ! std::cout << "*** PASS *** Expected value calculated!\n"; ! } ! else ! { ! std::cout << "*** FAIL *** Values are different...\n"; ! std::cout << "Expected Value:\n"; ! std::cout << '\t' << adobe::begin_asl_cel << input_value << adobe::end_asl_cel; ! std::cout << "Calculated Value:\n"; ! std::cout << '\t' << adobe::begin_asl_cel << sheet_value << adobe::end_asl_cel; ! success = false; ! } ! return success; } *************** *** 194,230 **** int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! bfs::path sheet(bfs::path("../rtd", bfs::native)); ! if (argc > 1) ! { ! if (!std::strcmp(argv[1], "--help")) ! usage(argv[0]); ! else ! { ! sheet = bfs::path(argv[1], bfs::native); ! result = !test_sheet(sheet); ! } ! } ! else ! { ! std::cout << "No sheet specified-- using test sheet...\n"; ! result = !test_sheet(sheet); ! } ! } ! catch (const std::exception& doh) ! { ! std::cerr << "std::exception: " << typeid(doh).name() << ": " << doh.what() << "\n"; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! } ! return result; } --- 194,230 ---- int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! bfs::path sheet(bfs::path("../rtd", bfs::native)); ! if (argc > 1) ! { ! if (!std::strcmp(argv[1], "--help")) ! usage(argv[0]); ! else ! { ! sheet = bfs::path(argv[1], bfs::native); ! result = !test_sheet(sheet); ! } ! } ! else ! { ! std::cout << "No sheet specified-- using test sheet...\n"; ! result = !test_sheet(sheet); ! } ! } ! catch (const std::exception& doh) ! { ! std::cerr << "std::exception: " << typeid(doh).name() << ": " << doh.what() << "\n"; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! } ! return result; } Index: rtd.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_smoke/rtd.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rtd.adm 20 May 2005 17:59:43 -0000 1.1 --- rtd.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 2,18 **** { interface: ! meters : 1.0; ! seconds : 1.0; ! rate : 1.0; logic: ! relate ! { ! meters <== rate * seconds; ! rate <== meters / seconds; ! seconds <== meters / rate; ! } output: ! result <== [ rate, seconds, meters ]; } --- 2,18 ---- { interface: ! meters : 1.0; ! seconds : 1.0; ! rate : 1.0; logic: ! relate ! { ! meters <== rate * seconds; ! rate <== meters / seconds; ! seconds <== meters / rate; ! } output: ! result <== [ rate, seconds, meters ]; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/iterator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/iterator Modified Files: set_next.hpp Log Message: asl 1.0.13 Index: set_next.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/iterator/set_next.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** set_next.hpp 6 Jan 2006 18:03:00 -0000 1.1 --- set_next.hpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ /*************************************************************************************************/ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ /*************************************************************************************************/ *************** *** 23,30 **** stuct set_next_fn<T> { ! void operator()(T x, T y) const ! { ! //... ! } }; */ --- 23,30 ---- stuct set_next_fn<T> { ! void operator()(T x, T y) const ! { ! //... ! } }; */ *************** *** 44,48 **** inline void set_next(I x, I y) { ! adobe::unsafe::set_next_fn<I>()(x, y); } --- 44,48 ---- inline void set_next(I x, I y) { ! adobe::unsafe::set_next_fn<I>()(x, y); } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:26
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/begin/sources Modified Files: express_viewer.cpp report_exception.cpp Log Message: asl 1.0.13 Index: report_exception.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/report_exception.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** report_exception.cpp 24 Jan 2006 19:38:50 -0000 1.3 --- report_exception.cpp 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ Index: express_viewer.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/express_viewer.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** express_viewer.cpp 24 Jan 2006 19:38:50 -0000 1.9 --- express_viewer.cpp 3 Feb 2006 18:33:38 -0000 1.10 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...1153 lines suppressed...] ! system_beep(); } --- 633,647 ---- void application_t::display_error( const std::string& msg ) { ! if (_editor_sheet_m) ! { ! _editor_sheet_m->set( editor_error_cell_g, adobe::value_t( msg ) ); ! _editor_sheet_m->set( editor_visible_tab_cell_g, adobe::value_t( editor_key_errors_tab_g ) ); ! _editor_sheet_m->update(); ! } #ifndef NDEBUG ! else std::cerr << msg << std::endl; #endif ! system_beep(); } |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/source Modified Files: adam.cpp adam_evaluate.cpp adam_parser.cpp array.cpp basic_sheet.cpp dictionary.cpp eve.cpp eve_evaluate.cpp eve_parser.cpp expression_parser.cpp expression_parser.hpp extents.cpp istream.cpp lex_shared.cpp lex_shared.hpp lex_shared_fwd.hpp lex_stream.cpp lex_stream.hpp lex_stream_fwd.hpp md5.cpp metrowerks_mach_o.hpp name.cpp parser_shared.cpp parser_shared.hpp string_pool.cpp string_pool.hpp swap.hpp test_configuration.cpp thread_id.cpp token.cpp token.hpp toroid.hpp typeinfo.cpp unicode.cpp value.cpp virtual_machine.cpp xml_element_parser.cpp xml_element_parser.hpp xml_lex.cpp xml_lex.hpp xml_lex_fwd.hpp xml_token.cpp xml_token.hpp xstring.cpp zuid.cpp zuid_sys_dep.cpp zuid_sys_dep.hpp zuid_uuid.cpp zuid_uuid.hpp Log Message: asl 1.0.13 Index: toroid.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/toroid.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** toroid.hpp 6 Jan 2006 18:03:00 -0000 1.6 --- toroid.hpp 3 Feb 2006 18:33:38 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 31,40 **** struct toroid_node_t { ! toroid_node_t* left_m; // node to the left ! toroid_node_t* right_m; // node to the right ! toroid_node_t* up_m; // node to the up ! toroid_node_t* down_m; // node to the down ! toroid_header_t* column_m; // header at head of this column ! toroid_header_t* row_m; // header at head of this row }; --- 31,40 ---- struct toroid_node_t { ! toroid_node_t* left_m; // node to the left ! toroid_node_t* right_m; // node to the right ! toroid_node_t* up_m; // node to the up ! toroid_node_t* down_m; // node to the down ! toroid_header_t* column_m; // header at head of this column ! toroid_header_t* row_m; // header at head of this row }; *************** *** 43,47 **** struct toroid_header_t : public toroid_node_t { ! std::size_t size_m; // number of 1s in the row/column }; --- 43,47 ---- struct toroid_header_t : public toroid_node_t { ! std::size_t size_m; // number of 1s in the row/column }; *************** *** 52,267 **** { private: ! enum ! { ! rows_k = Rows, ! cols_k = Cols, ! block_size_k = NodeBlockSize ! }; ! typedef boost::array<adobe::toroid_node_t, block_size_k> node_block_t; ! typedef std::list<node_block_t> data_set_t; ! typedef boost::array<adobe::toroid_header_t, rows_k> row_header_set_t; ! typedef boost::array<adobe::toroid_header_t, cols_k> col_header_set_t; public: ! binary_toroid() : ! node_block_count_m(0) #ifndef NDEBUG ! , finalized_m(false) #endif ! { ! data_set_m.push_back(node_block_t()); ! for ( typename row_header_set_t::iterator first(row_header_set_m.begin()), ! last(row_header_set_m.end()); first != last; ++first) ! { ! toroid_header_t* this_row(&(*first)); ! first->left_m = this_row; ! first->right_m = this_row; ! } ! typename col_header_set_t::iterator front_i(col_header_set_m.begin()); ! typename col_header_set_t::iterator back_i(col_header_set_m.end() - 1); ! for ( typename col_header_set_t::iterator first(col_header_set_m.begin()), ! last(col_header_set_m.end()); first != last; ++first) ! { ! toroid_header_t* this_col(&(*first)); ! first->up_m = this_col; ! first->down_m = this_col; ! if (first != front_i) ! first->left_m = &(*(first - 1)); ! if (first != back_i) ! first->right_m = &(*(first + 1)); ! first->size_m = 0; ! } ! front_i->left_m = &header_m; ! back_i->right_m = &header_m; ! header_m.down_m = &(row_header_set_m.front()); ! header_m.up_m = &(row_header_set_m.back()); ! header_m.right_m = &(col_header_set_m.front()); ! header_m.left_m = &(col_header_set_m.back()); ! } ! void set(std::size_t row, std::size_t col) ! { ! // prerequisite: no other node can be set to the right or below this one. ! // i.e., you must start with the top-left node and work to the right, then ! // down. i.e., this must be the right-bottom-most node you have set. ! assert (row < rows_k && col < cols_k); ! assert (!finalized_m); ! toroid_header_t& row_h(row_header_set_m[row]); ! toroid_header_t& col_h(col_header_set_m[col]); ! if (node_block_count_m == block_size_k) ! { ! data_set_m.push_back(node_block_t()); ! node_block_count_m = 0; ! } ! toroid_node_t& node(data_set_m.back()[node_block_count_m]); ! ++node_block_count_m; ! node.left_m = row_h.left_m; ! node.right_m = &row_h; ! row_h.left_m->right_m = &node; ! row_h.left_m = &node; ! node.up_m = col_h.up_m; ! node.down_m = &col_h; ! col_h.up_m->down_m = &node; ! col_h.up_m = &node; ! node.column_m = &col_h; ! node.row_m = &row_h; ! //++(row_h.size_m); // not used ! ++(col_h.size_m); ! } ! void set_secondary_column(std::size_t col) ! { ! assert (col < cols_k); ! // Secondary columns take dancing links to the next step, ! // in that they allow for a column to be optionally used ! // zero or one times. This esentially allows for a ! // condition that can be met once, but no more than once. ! // ! // According to Knuth, the header for a secondary column ! // should have left and right fields that simply point ! // to itself, so we unlink it from the doubly-linked ! // header column list. ! adobe::toroid_header_t& column(col_header_set_m[col]); ! column.left_m->right_m = column.right_m; ! column.right_m->left_m = column.left_m; ! column.right_m = &column; ! column.left_m = &column; ! } ! void finalize() ! { ! assert (!finalized_m); ! // This "covers" the row headers in the toroid, leaving a data ! // structure as described by Knuth's Dancing Links Algorithm. ! for ( typename row_header_set_t::iterator first(row_header_set_m.begin()), ! last(row_header_set_m.end()); first != last; ++first) ! { ! first->left_m->right_m = first->right_m; ! first->right_m->left_m = first->left_m; ! } #ifndef NDEBUG ! finalized_m = true; #endif ! } ! void cover_column(toroid_header_t* c) ! { ! assert (finalized_m); ! right_of(c)->left_m = left_of(c); ! left_of(c)->right_m = right_of(c); ! for (adobe::toroid_node_t* i(down_of(c)); i != c; i = down_of(i)) ! { ! for (adobe::toroid_node_t* j(right_of(i)); j != i; j = right_of(j)) ! { ! down_of(j)->up_m = up_of(j); ! up_of(j)->down_m = down_of(j); ! --(column_of(j)->size_m); ! } ! } ! } ! void uncover_column(toroid_header_t* c) ! { ! assert (finalized_m); ! for (adobe::toroid_node_t* i(up_of(c)); i != c; i = up_of(i)) ! { ! for (adobe::toroid_node_t* j(left_of(i)); j != i; j = left_of(j)) ! { ! ++(column_of(j)->size_m); ! down_of(j)->up_m = j; ! up_of(j)->down_m = j; ! } ! } ! right_of(c)->left_m = c; ! left_of(c)->right_m = c; ! } ! // This leverages the row headers used to initialize the data structure by ! // taking the distance from the start of the row header list to the row ! // header referenced by this node. ! std::size_t row_index_of(adobe::toroid_node_t* node) ! { return static_cast<std::size_t>(std::distance(&(*(row_header_set_m.begin())), node->row_m)); } ! template <typename ToroidDataPointer> ! static inline ToroidDataPointer left_of(ToroidDataPointer node) ! { assert(node->left_m != 0); return reinterpret_cast<ToroidDataPointer>(node->left_m); } ! template <typename ToroidDataPointer> ! static inline ToroidDataPointer right_of(ToroidDataPointer node) ! { assert(node->right_m != 0); return reinterpret_cast<ToroidDataPointer>(node->right_m); } ! static inline adobe::toroid_node_t* up_of(adobe::toroid_node_t* node) ! { assert(node->up_m != 0); return node->up_m; } ! static inline adobe::toroid_node_t* down_of(adobe::toroid_node_t* node) ! { assert(node->down_m != 0); return node->down_m; } ! static inline adobe::toroid_header_t* column_of(adobe::toroid_node_t* node) ! { assert(node->column_m != 0); return node->column_m; } ! toroid_header_t header_m; private: ! data_set_t data_set_m; ! row_header_set_t row_header_set_m; ! col_header_set_t col_header_set_m; ! std::size_t node_block_count_m; #ifndef NDEBUG ! bool finalized_m; #endif }; --- 52,267 ---- { private: ! enum ! { ! rows_k = Rows, ! cols_k = Cols, ! block_size_k = NodeBlockSize ! }; ! typedef boost::array<adobe::toroid_node_t, block_size_k> node_block_t; ! typedef std::list<node_block_t> data_set_t; ! typedef boost::array<adobe::toroid_header_t, rows_k> row_header_set_t; ! typedef boost::array<adobe::toroid_header_t, cols_k> col_header_set_t; public: ! binary_toroid() : ! node_block_count_m(0) #ifndef NDEBUG ! , finalized_m(false) #endif ! { ! data_set_m.push_back(node_block_t()); ! for ( typename row_header_set_t::iterator first(row_header_set_m.begin()), ! last(row_header_set_m.end()); first != last; ++first) ! { ! toroid_header_t* this_row(&(*first)); ! first->left_m = this_row; ! first->right_m = this_row; ! } ! typename col_header_set_t::iterator front_i(col_header_set_m.begin()); ! typename col_header_set_t::iterator back_i(col_header_set_m.end() - 1); ! for ( typename col_header_set_t::iterator first(col_header_set_m.begin()), ! last(col_header_set_m.end()); first != last; ++first) ! { ! toroid_header_t* this_col(&(*first)); ! first->up_m = this_col; ! first->down_m = this_col; ! if (first != front_i) ! first->left_m = &(*(first - 1)); ! if (first != back_i) ! first->right_m = &(*(first + 1)); ! first->size_m = 0; ! } ! front_i->left_m = &header_m; ! back_i->right_m = &header_m; ! header_m.down_m = &(row_header_set_m.front()); ! header_m.up_m = &(row_header_set_m.back()); ! header_m.right_m = &(col_header_set_m.front()); ! header_m.left_m = &(col_header_set_m.back()); ! } ! void set(std::size_t row, std::size_t col) ! { ! // prerequisite: no other node can be set to the right or below this one. ! // i.e., you must start with the top-left node and work to the right, then ! // down. i.e., this must be the right-bottom-most node you have set. ! assert (row < rows_k && col < cols_k); ! assert (!finalized_m); ! toroid_header_t& row_h(row_header_set_m[row]); ! toroid_header_t& col_h(col_header_set_m[col]); ! if (node_block_count_m == block_size_k) ! { ! data_set_m.push_back(node_block_t()); ! node_block_count_m = 0; ! } ! toroid_node_t& node(data_set_m.back()[node_block_count_m]); ! ++node_block_count_m; ! node.left_m = row_h.left_m; ! node.right_m = &row_h; ! row_h.left_m->right_m = &node; ! row_h.left_m = &node; ! node.up_m = col_h.up_m; ! node.down_m = &col_h; ! col_h.up_m->down_m = &node; ! col_h.up_m = &node; ! node.column_m = &col_h; ! node.row_m = &row_h; ! //++(row_h.size_m); // not used ! ++(col_h.size_m); ! } ! void set_secondary_column(std::size_t col) ! { ! assert (col < cols_k); ! // Secondary columns take dancing links to the next step, ! // in that they allow for a column to be optionally used ! // zero or one times. This esentially allows for a ! // condition that can be met once, but no more than once. ! // ! // According to Knuth, the header for a secondary column ! // should have left and right fields that simply point ! // to itself, so we unlink it from the doubly-linked ! // header column list. ! adobe::toroid_header_t& column(col_header_set_m[col]); ! column.left_m->right_m = column.right_m; ! column.right_m->left_m = column.left_m; ! column.right_m = &column; ! column.left_m = &column; ! } ! void finalize() ! { ! assert (!finalized_m); ! // This "covers" the row headers in the toroid, leaving a data ! // structure as described by Knuth's Dancing Links Algorithm. ! for ( typename row_header_set_t::iterator first(row_header_set_m.begin()), ! last(row_header_set_m.end()); first != last; ++first) ! { ! first->left_m->right_m = first->right_m; ! first->right_m->left_m = first->left_m; ! } #ifndef NDEBUG ! finalized_m = true; #endif ! } ! void cover_column(toroid_header_t* c) ! { ! assert (finalized_m); ! right_of(c)->left_m = left_of(c); ! left_of(c)->right_m = right_of(c); ! for (adobe::toroid_node_t* i(down_of(c)); i != c; i = down_of(i)) ! { ! for (adobe::toroid_node_t* j(right_of(i)); j != i; j = right_of(j)) ! { ! down_of(j)->up_m = up_of(j); ! up_of(j)->down_m = down_of(j); ! --(column_of(j)->size_m); ! } ! } ! } ! void uncover_column(toroid_header_t* c) ! { ! assert (finalized_m); ! for (adobe::toroid_node_t* i(up_of(c)); i != c; i = up_of(i)) ! { ! for (adobe::toroid_node_t* j(left_of(i)); j != i; j = left_of(j)) ! { ! ++(column_of(j)->size_m); ! down_of(j)->up_m = j; ! up_of(j)->down_m = j; ! } ! } ! right_of(c)->left_m = c; ! left_of(c)->right_m = c; ! } ! // This leverages the row headers used to initialize the data structure by ! // taking the distance from the start of the row header list to the row ! // header referenced by this node. ! std::size_t row_index_of(adobe::toroid_node_t* node) ! { return static_cast<std::size_t>(std::distance(&(*(row_header_set_m.begin())), node->row_m)); } ! template <typename ToroidDataPointer> ! static inline ToroidDataPointer left_of(ToroidDataPointer node) ! { assert(node->left_m != 0); return reinterpret_cast<ToroidDataPointer>(node->left_m); } ! template <typename ToroidDataPointer> ! static inline ToroidDataPointer right_of(ToroidDataPointer node) ! { assert(node->right_m != 0); return reinterpret_cast<ToroidDataPointer>(node->right_m); } ! static inline adobe::toroid_node_t* up_of(adobe::toroid_node_t* node) ! { assert(node->up_m != 0); return node->up_m; } ! static inline adobe::toroid_node_t* down_of(adobe::toroid_node_t* node) ! { assert(node->down_m != 0); return node->down_m; } ! static inline adobe::toroid_header_t* column_of(adobe::toroid_node_t* node) ! { assert(node->column_m != 0); return node->column_m; } ! toroid_header_t header_m; private: ! data_set_t data_set_m; ! row_header_set_t row_header_set_m; ! col_header_set_t col_header_set_m; ! std::size_t node_block_count_m; #ifndef NDEBUG ! bool finalized_m; #endif }; Index: xml_lex_fwd.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/xml_lex_fwd.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xml_lex_fwd.hpp 6 Jan 2006 18:03:00 -0000 1.4 --- xml_lex_fwd.hpp 3 Feb 2006 18:33:38 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ Index: xml_token.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/xml_token.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xml_token.hpp 6 Jan 2006 18:03:00 -0000 1.5 --- xml_token.hpp 3 Feb 2006 18:33:38 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 24,37 **** enum xml_lex_token_set_t { ! xml_token_open_tag_k = 0, ! xml_token_open_slash_tag_k, ! xml_token_close_tag_k, ! xml_token_slash_close_tag_k, ! xml_token_name_k, ! xml_token_att_value_k, ! xml_token_char_data_k, ! xml_token_equals_k, ! xml_token_reference_k, ! xml_token_eof_k }; --- 24,37 ---- enum xml_lex_token_set_t { ! xml_token_open_tag_k = 0, ! xml_token_open_slash_tag_k, ! xml_token_close_tag_k, ! xml_token_slash_close_tag_k, ! xml_token_name_k, ! xml_token_att_value_k, ! xml_token_char_data_k, ! xml_token_equals_k, ! xml_token_reference_k, ! xml_token_eof_k }; *************** *** 44,48 **** template <> inline xml_lex_token_set_t eof_token<xml_lex_token_set_t>() ! { return xml_token_eof_k; } /*************************************************************************************************/ --- 44,48 ---- template <> inline xml_lex_token_set_t eof_token<xml_lex_token_set_t>() ! { return xml_token_eof_k; } /*************************************************************************************************/ Index: xml_element_parser.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/xml_element_parser.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xml_element_parser.cpp 6 Jan 2006 18:03:00 -0000 1.7 --- xml_element_parser.cpp 3 Feb 2006 18:33:38 -0000 1.8 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 17,22 **** #ifdef BOOST_MSVC namespace std { ! using ::isxdigit; ! using ::isdigit; } // namespace std #endif --- 17,22 ---- #ifdef BOOST_MSVC namespace std { ! using ::isxdigit; ! using ::isdigit; } // namespace std #endif *************** *** 27,31 **** ADOBE_ONCE_STATIC_INSTANCE(xml_element_parser_once) #if 0 ! { } // REVISIT (fbrereto) : workaround for a bug in the BBEdit function menu parser #endif --- 27,31 ---- ADOBE_ONCE_STATIC_INSTANCE(xml_element_parser_once) #if 0 ! { } // REVISIT (fbrereto) : workaround for a bug in the BBEdit function menu parser #endif *************** *** 48,55 **** struct key_comp_t { ! bool operator () (const adobe::token_range_t& x, const adobe::token_range_t& y) const ! { ! return adobe::token_range_less(x, y); ! } }; --- 48,55 ---- struct key_comp_t { ! bool operator () (const adobe::token_range_t& x, const adobe::token_range_t& y) const ! { ! return adobe::token_range_less(x, y); ! } }; *************** *** 66,82 **** adobe::token_range_t to_token_range(boost::uint32_t code) { ! // REVISIT (fbrereto) : Allocation in this function needs to go ! if (code == 0) return adobe::token_range_t(); ! std::string utf8; ! utf8.reserve(8); ! adobe::to_utf8(code, std::back_inserter(utf8)); ! adobe::name_t utf8_name(utf8.c_str(), utf8.size()); ! return adobe::token_range_t(utf8_name.get(), utf8_name.get() + utf8.size()); } --- 66,82 ---- adobe::token_range_t to_token_range(boost::uint32_t code) { ! // REVISIT (fbrereto) : Allocation in this function needs to go ! if (code == 0) return adobe::token_range_t(); ! std::string utf8; ! utf8.reserve(8); ! adobe::to_utf8(code, std::back_inserter(utf8)); ! adobe::name_t utf8_name(utf8.c_str(), utf8.size()); ! return adobe::token_range_t(utf8_name.get(), utf8_name.get() + utf8.size()); } *************** *** 85,171 **** void init_xml_element_parser_once() { ! // initialize the entity map ! // _E_xplicit _E_ntity _M_ap _V_alue _T_ype _C_onstructor ! #define EEMVTC(x, y) entity_map_t::value_type(adobe::static_token_range(x), to_token_range(y)) ! entity_map_t::value_type default_entries[] = ! { ! EEMVTC("Aacute", ADOBE_CODE_POINT(0x00C1)), EEMVTC("aacute", ADOBE_CODE_POINT(0x00E1)), EEMVTC("Acirc", ADOBE_CODE_POINT(0x00C2)), EEMVTC("acirc", ADOBE_CODE_POINT(0x00E2)), ! EEMVTC("acute", ADOBE_CODE_POINT(0x00B4)), EEMVTC("AElig", ADOBE_CODE_POINT(0x00C6)), EEMVTC("aelig", ADOBE_CODE_POINT(0x00E6)), EEMVTC("Agrave", ADOBE_CODE_POINT(0x00C0)), ! EEMVTC("agrave", ADOBE_CODE_POINT(0x00E0)), EEMVTC("alefsym", ADOBE_CODE_POINT(0x2135)), EEMVTC("Alpha", ADOBE_CODE_POINT(0x0391)), EEMVTC("alpha", ADOBE_CODE_POINT(0x03B1)), ! EEMVTC("amp", ADOBE_CODE_POINT(0x0026)), EEMVTC("and", ADOBE_CODE_POINT(0x2227)), EEMVTC("ang", ADOBE_CODE_POINT(0x2220)), EEMVTC("Aring", ADOBE_CODE_POINT(0x00C5)), ! EEMVTC("aring", ADOBE_CODE_POINT(0x00E5)), EEMVTC("asymp", ADOBE_CODE_POINT(0x2248)), EEMVTC("Atilde", ADOBE_CODE_POINT(0x00C3)), EEMVTC("atilde", ADOBE_CODE_POINT(0x00E3)), ! EEMVTC("Auml", ADOBE_CODE_POINT(0x00C4)), EEMVTC("auml", ADOBE_CODE_POINT(0x00E4)), EEMVTC("bdquo", ADOBE_CODE_POINT(0x201E)), EEMVTC("Beta", ADOBE_CODE_POINT(0x0392)), ! EEMVTC("beta", ADOBE_CODE_POINT(0x03B2)), EEMVTC("brvbar", ADOBE_CODE_POINT(0x00A6)), EEMVTC("bull", ADOBE_CODE_POINT(0x2022)), EEMVTC("cap", ADOBE_CODE_POINT(0x2229)), ! EEMVTC("Ccedil", ADOBE_CODE_POINT(0x00C7)), EEMVTC("ccedil", ADOBE_CODE_POINT(0x00E7)), EEMVTC("cedil", ADOBE_CODE_POINT(0x00B8)), EEMVTC("cent", ADOBE_CODE_POINT(0x00A2)), ! EEMVTC("Chi", ADOBE_CODE_POINT(0x03A7)), EEMVTC("chi", ADOBE_CODE_POINT(0x03C7)), EEMVTC("circ", ADOBE_CODE_POINT(0x02C6)), EEMVTC("clubs", ADOBE_CODE_POINT(0x2663)), ! EEMVTC("cong", ADOBE_CODE_POINT(0x2245)), EEMVTC("copy", ADOBE_CODE_POINT(0x00A9)), EEMVTC("cr", ADOBE_CODE_POINT(0x000D)), EEMVTC("crarr", ADOBE_CODE_POINT(0x21B5)), ! EEMVTC("cup", ADOBE_CODE_POINT(0x222A)), EEMVTC("curren", ADOBE_CODE_POINT(0x00A4)), EEMVTC("dagger", ADOBE_CODE_POINT(0x2020)), EEMVTC("Dagger", ADOBE_CODE_POINT(0x2021)), ! EEMVTC("darr", ADOBE_CODE_POINT(0x2193)), EEMVTC("dArr", ADOBE_CODE_POINT(0x21D3)), EEMVTC("deg", ADOBE_CODE_POINT(0x00B0)), EEMVTC("Delta", ADOBE_CODE_POINT(0x0394)), ! EEMVTC("delta", ADOBE_CODE_POINT(0x03B4)), EEMVTC("diams", ADOBE_CODE_POINT(0x2666)), EEMVTC("divide", ADOBE_CODE_POINT(0x00F7)), EEMVTC("Eacute", ADOBE_CODE_POINT(0x00C9)), ! EEMVTC("eacute", ADOBE_CODE_POINT(0x00E9)), EEMVTC("Ecirc", ADOBE_CODE_POINT(0x00CA)), EEMVTC("ecirc", ADOBE_CODE_POINT(0x00EA)), EEMVTC("Egrave", ADOBE_CODE_POINT(0x00C8)), ! EEMVTC("egrave", ADOBE_CODE_POINT(0x00E8)), EEMVTC("empty", ADOBE_CODE_POINT(0x2205)), EEMVTC("emsp", ADOBE_CODE_POINT(0x2003)), EEMVTC("ensp", ADOBE_CODE_POINT(0x2002)), ! EEMVTC("Epsilon", ADOBE_CODE_POINT(0x0395)), EEMVTC("epsilon", ADOBE_CODE_POINT(0x03B5)), EEMVTC("equiv", ADOBE_CODE_POINT(0x2261)), EEMVTC("Eta", ADOBE_CODE_POINT(0x0397)), ! EEMVTC("eta", ADOBE_CODE_POINT(0x03B7)), EEMVTC("ETH", ADOBE_CODE_POINT(0x00D0)), EEMVTC("eth", ADOBE_CODE_POINT(0x00F0)), EEMVTC("Euml", ADOBE_CODE_POINT(0x00CB)), ! EEMVTC("euml", ADOBE_CODE_POINT(0x00EB)), EEMVTC("euro", ADOBE_CODE_POINT(0x20AC)), EEMVTC("exist", ADOBE_CODE_POINT(0x2203)), EEMVTC("fnof", ADOBE_CODE_POINT(0x0192)), ! EEMVTC("forall", ADOBE_CODE_POINT(0x2200)), EEMVTC("frac12", ADOBE_CODE_POINT(0x00BD)), EEMVTC("frac14", ADOBE_CODE_POINT(0x00BC)), EEMVTC("frac34", ADOBE_CODE_POINT(0x00BE)), ! EEMVTC("frasl", ADOBE_CODE_POINT(0x2044)), EEMVTC("Gamma", ADOBE_CODE_POINT(0x0393)), EEMVTC("gamma", ADOBE_CODE_POINT(0x03B3)), EEMVTC("ge", ADOBE_CODE_POINT(0x2265)), ! EEMVTC("gt", ADOBE_CODE_POINT(0x003E)), EEMVTC("harr", ADOBE_CODE_POINT(0x2194)), EEMVTC("hArr", ADOBE_CODE_POINT(0x21D4)), EEMVTC("hearts", ADOBE_CODE_POINT(0x2665)), ! EEMVTC("hellip", ADOBE_CODE_POINT(0x2026)), EEMVTC("Iacute", ADOBE_CODE_POINT(0x00CD)), EEMVTC("iacute", ADOBE_CODE_POINT(0x00ED)), EEMVTC("Icirc", ADOBE_CODE_POINT(0x00CE)), ! EEMVTC("icirc", ADOBE_CODE_POINT(0x00EE)), EEMVTC("iexcl", ADOBE_CODE_POINT(0x00A1)), EEMVTC("Igrave", ADOBE_CODE_POINT(0x00CC)), EEMVTC("igrave", ADOBE_CODE_POINT(0x00EC)), ! EEMVTC("image", ADOBE_CODE_POINT(0x2111)), EEMVTC("infin", ADOBE_CODE_POINT(0x221E)), EEMVTC("int", ADOBE_CODE_POINT(0x222B)), EEMVTC("Iota", ADOBE_CODE_POINT(0x0399)), ! EEMVTC("iota", ADOBE_CODE_POINT(0x03B9)), EEMVTC("iquest", ADOBE_CODE_POINT(0x00BF)), EEMVTC("isin", ADOBE_CODE_POINT(0x2208)), EEMVTC("Iuml", ADOBE_CODE_POINT(0x00CF)), ! EEMVTC("iuml", ADOBE_CODE_POINT(0x00EF)), EEMVTC("Kappa", ADOBE_CODE_POINT(0x039A)), EEMVTC("kappa", ADOBE_CODE_POINT(0x03BA)), EEMVTC("Lambda", ADOBE_CODE_POINT(0x039B)), ! EEMVTC("lambda", ADOBE_CODE_POINT(0x03BB)), EEMVTC("lang", ADOBE_CODE_POINT(0x2329)), EEMVTC("laquo", ADOBE_CODE_POINT(0x00AB)), EEMVTC("larr", ADOBE_CODE_POINT(0x2190)), ! EEMVTC("lArr", ADOBE_CODE_POINT(0x21D0)), EEMVTC("lceil", ADOBE_CODE_POINT(0x2308)), EEMVTC("ldquo", ADOBE_CODE_POINT(0x201C)), EEMVTC("le", ADOBE_CODE_POINT(0x2264)), ! EEMVTC("lf", ADOBE_CODE_POINT(0x000A)), EEMVTC("lfloor", ADOBE_CODE_POINT(0x230A)), EEMVTC("lowast", ADOBE_CODE_POINT(0x2217)), EEMVTC("loz", ADOBE_CODE_POINT(0x25CA)), ! EEMVTC("lrm", ADOBE_CODE_POINT(0x200E)), EEMVTC("lsaquo", ADOBE_CODE_POINT(0x2039)), EEMVTC("lsquo", ADOBE_CODE_POINT(0x2018)), EEMVTC("lt", ADOBE_CODE_POINT(0x003C)), ! EEMVTC("macr", ADOBE_CODE_POINT(0x00AF)), EEMVTC("mdash", ADOBE_CODE_POINT(0x2014)), EEMVTC("micro", ADOBE_CODE_POINT(0x00B5)), EEMVTC("middot", ADOBE_CODE_POINT(0x00B7)), ! EEMVTC("minus", ADOBE_CODE_POINT(0x2212)), EEMVTC("Mu", ADOBE_CODE_POINT(0x039C)), EEMVTC("mu", ADOBE_CODE_POINT(0x03BC)), EEMVTC("nabla", ADOBE_CODE_POINT(0x2207)), ! EEMVTC("nbsp", ADOBE_CODE_POINT(0x00A0)), EEMVTC("ndash", ADOBE_CODE_POINT(0x2013)), EEMVTC("ne", ADOBE_CODE_POINT(0x2260)), EEMVTC("ni", ADOBE_CODE_POINT(0x220B)), ! EEMVTC("not", ADOBE_CODE_POINT(0x00AC)), EEMVTC("notin", ADOBE_CODE_POINT(0x2209)), EEMVTC("nsub", ADOBE_CODE_POINT(0x2284)), EEMVTC("Ntilde", ADOBE_CODE_POINT(0x00D1)), ! EEMVTC("ntilde", ADOBE_CODE_POINT(0x00F1)), EEMVTC("Nu", ADOBE_CODE_POINT(0x039D)), EEMVTC("nu", ADOBE_CODE_POINT(0x03BD)), EEMVTC("Oacute", ADOBE_CODE_POINT(0x00D3)), ! EEMVTC("oacute", ADOBE_CODE_POINT(0x00F3)), EEMVTC("Ocirc", ADOBE_CODE_POINT(0x00D4)), EEMVTC("ocirc", ADOBE_CODE_POINT(0x00F4)), EEMVTC("OElig", ADOBE_CODE_POINT(0x0152)), ! EEMVTC("oelig", ADOBE_CODE_POINT(0x0153)), EEMVTC("Ograve", ADOBE_CODE_POINT(0x00D2)), EEMVTC("ograve", ADOBE_CODE_POINT(0x00F2)), EEMVTC("oline", ADOBE_CODE_POINT(0x203E)), ! EEMVTC("Omega", ADOBE_CODE_POINT(0x03A9)), EEMVTC("omega", ADOBE_CODE_POINT(0x03C9)), EEMVTC("Omicron", ADOBE_CODE_POINT(0x039F)), EEMVTC("omicron", ADOBE_CODE_POINT(0x03BF)), ! EEMVTC("oplus", ADOBE_CODE_POINT(0x2295)), EEMVTC("or", ADOBE_CODE_POINT(0x2228)), EEMVTC("ordf", ADOBE_CODE_POINT(0x00AA)), EEMVTC("ordm", ADOBE_CODE_POINT(0x00BA)), ! EEMVTC("Oslash", ADOBE_CODE_POINT(0x00D8)), EEMVTC("oslash", ADOBE_CODE_POINT(0x00F8)), EEMVTC("Otilde", ADOBE_CODE_POINT(0x00D5)), EEMVTC("otilde", ADOBE_CODE_POINT(0x00F5)), ! EEMVTC("otimes", ADOBE_CODE_POINT(0x2297)), EEMVTC("Ouml", ADOBE_CODE_POINT(0x00D6)), EEMVTC("ouml", ADOBE_CODE_POINT(0x00F6)), EEMVTC("para", ADOBE_CODE_POINT(0x00B6)), ! EEMVTC("part", ADOBE_CODE_POINT(0x2202)), EEMVTC("permil", ADOBE_CODE_POINT(0x2030)), EEMVTC("perp", ADOBE_CODE_POINT(0x22A5)), EEMVTC("Phi", ADOBE_CODE_POINT(0x03A6)), ! EEMVTC("phi", ADOBE_CODE_POINT(0x03C6)), EEMVTC("Pi", ADOBE_CODE_POINT(0x03A0)), EEMVTC("pi", ADOBE_CODE_POINT(0x03C0)), EEMVTC("piv", ADOBE_CODE_POINT(0x03D6)), ! EEMVTC("plusmn", ADOBE_CODE_POINT(0x00B1)), EEMVTC("pound", ADOBE_CODE_POINT(0x00A3)), EEMVTC("prime", ADOBE_CODE_POINT(0x2032)), EEMVTC("Prime", ADOBE_CODE_POINT(0x2033)), ! EEMVTC("prod", ADOBE_CODE_POINT(0x220F)), EEMVTC("prop", ADOBE_CODE_POINT(0x221D)), EEMVTC("Psi", ADOBE_CODE_POINT(0x03A8)), EEMVTC("psi", ADOBE_CODE_POINT(0x03C8)), ! EEMVTC("quot", ADOBE_CODE_POINT(0x0022)), EEMVTC("radic", ADOBE_CODE_POINT(0x221A)), EEMVTC("rang", ADOBE_CODE_POINT(0x232A)), EEMVTC("raquo", ADOBE_CODE_POINT(0x00BB)), ! EEMVTC("rarr", ADOBE_CODE_POINT(0x2192)), EEMVTC("rArr", ADOBE_CODE_POINT(0x21D2)), EEMVTC("rceil", ADOBE_CODE_POINT(0x2309)), EEMVTC("rdquo", ADOBE_CODE_POINT(0x201D)), ! EEMVTC("real", ADOBE_CODE_POINT(0x211C)), EEMVTC("reg", ADOBE_CODE_POINT(0x00AE)), EEMVTC("rfloor", ADOBE_CODE_POINT(0x230B)), EEMVTC("Rho", ADOBE_CODE_POINT(0x03A1)), ! EEMVTC("rho", ADOBE_CODE_POINT(0x03C1)), EEMVTC("rlm", ADOBE_CODE_POINT(0x200F)), EEMVTC("rsaquo", ADOBE_CODE_POINT(0x203A)), EEMVTC("rsquo", ADOBE_CODE_POINT(0x2019)), ! EEMVTC("sbquo", ADOBE_CODE_POINT(0x201A)), EEMVTC("Scaron", ADOBE_CODE_POINT(0x0160)), EEMVTC("scaron", ADOBE_CODE_POINT(0x0161)), EEMVTC("sdot", ADOBE_CODE_POINT(0x22C5)), ! EEMVTC("sect", ADOBE_CODE_POINT(0x00A7)), EEMVTC("shy", ADOBE_CODE_POINT(0x00AD)), EEMVTC("Sigma", ADOBE_CODE_POINT(0x03A3)), EEMVTC("sigma", ADOBE_CODE_POINT(0x03C3)), ! EEMVTC("sigmaf", ADOBE_CODE_POINT(0x03C2)), EEMVTC("sim", ADOBE_CODE_POINT(0x223C)), EEMVTC("spades", ADOBE_CODE_POINT(0x2660)), EEMVTC("sub", ADOBE_CODE_POINT(0x2282)), ! EEMVTC("sube", ADOBE_CODE_POINT(0x2286)), EEMVTC("sum", ADOBE_CODE_POINT(0x2211)), EEMVTC("sup", ADOBE_CODE_POINT(0x2283)), EEMVTC("sup1", ADOBE_CODE_POINT(0x00B9)), ! EEMVTC("sup2", ADOBE_CODE_POINT(0x00B2)), EEMVTC("sup3", ADOBE_CODE_POINT(0x00B3)), EEMVTC("supe", ADOBE_CODE_POINT(0x2287)), EEMVTC("szlig", ADOBE_CODE_POINT(0x00DF)), ! EEMVTC("tab", ADOBE_CODE_POINT(0x0009)), EEMVTC("Tau", ADOBE_CODE_POINT(0x03A4)), EEMVTC("tau", ADOBE_CODE_POINT(0x03C4)), EEMVTC("there4", ADOBE_CODE_POINT(0x2234)), ! EEMVTC("Theta", ADOBE_CODE_POINT(0x0398)), EEMVTC("theta", ADOBE_CODE_POINT(0x03B8)), EEMVTC("thetasym", ADOBE_CODE_POINT(0x03D1)), EEMVTC("thinsp", ADOBE_CODE_POINT(0x2009)), ! EEMVTC("THORN", ADOBE_CODE_POINT(0x00DE)), EEMVTC("thorn", ADOBE_CODE_POINT(0x00FE)), EEMVTC("tilde", ADOBE_CODE_POINT(0x02DC)), EEMVTC("times", ADOBE_CODE_POINT(0x00D7)), ! EEMVTC("trade", ADOBE_CODE_POINT(0x2122)), EEMVTC("Uacute", ADOBE_CODE_POINT(0x00DA)), EEMVTC("uacute", ADOBE_CODE_POINT(0x00FA)), EEMVTC("uarr", ADOBE_CODE_POINT(0x2191)), ! EEMVTC("uArr", ADOBE_CODE_POINT(0x21D1)), EEMVTC("Ucirc", ADOBE_CODE_POINT(0x00DB)), EEMVTC("ucirc", ADOBE_CODE_POINT(0x00FB)), EEMVTC("Ugrave", ADOBE_CODE_POINT(0x00D9)), ! EEMVTC("ugrave", ADOBE_CODE_POINT(0x00F9)), EEMVTC("uml", ADOBE_CODE_POINT(0x00A8)), EEMVTC("upsih", ADOBE_CODE_POINT(0x03D2)), EEMVTC("Upsilon", ADOBE_CODE_POINT(0x03A5)), ! EEMVTC("upsilon", ADOBE_CODE_POINT(0x03C5)), EEMVTC("Uuml", ADOBE_CODE_POINT(0x00DC)), EEMVTC("uuml", ADOBE_CODE_POINT(0x00FC)), EEMVTC("weierp", ADOBE_CODE_POINT(0x2118)), ! EEMVTC("Xi", ADOBE_CODE_POINT(0x039E)), EEMVTC("xi", ADOBE_CODE_POINT(0x03BE)), EEMVTC("Yacute", ADOBE_CODE_POINT(0x00DD)), EEMVTC("yacute", ADOBE_CODE_POINT(0x00FD)), ! EEMVTC("yen", ADOBE_CODE_POINT(0x00A5)), EEMVTC("yuml", ADOBE_CODE_POINT(0x00FF)), EEMVTC("Yuml", ADOBE_CODE_POINT(0x0178)), EEMVTC("Zeta", ADOBE_CODE_POINT(0x0396)), ! EEMVTC("zeta", ADOBE_CODE_POINT(0x03B6)), EEMVTC("zwj", ADOBE_CODE_POINT(0x200D)), EEMVTC("zwnj", ADOBE_CODE_POINT(0x200C)) #if 1 ! // NOTE (fbrereto) : These are not a part of the HTML default entity list, but are still useful ! , EEMVTC("apos", ADOBE_CODE_POINT(0x0027)) #endif ! }; ! #undef EEMVTC ! #undef ADOBE_CODE_POINT ! static entity_map_t entity_map_s(boost::begin(default_entries), boost::end(default_entries)); ! entity_map_g = &entity_map_s; } --- 85,171 ---- void init_xml_element_parser_once() { ! // initialize the entity map ! // _E_xplicit _E_ntity _M_ap _V_alue _T_ype _C_onstructor ! #define EEMVTC(x, y) entity_map_t::value_type(adobe::static_token_range(x), to_token_range(y)) ! entity_map_t::value_type default_entries[] = ! { ! EEMVTC("Aacute", ADOBE_CODE_POINT(0x00C1)), EEMVTC("aacute", ADOBE_CODE_POINT(0x00E1)), EEMVTC("Acirc", ADOBE_CODE_POINT(0x00C2)), EEMVTC("acirc", ADOBE_CODE_POINT(0x00E2)), ! EEMVTC("acute", ADOBE_CODE_POINT(0x00B4)), EEMVTC("AElig", ADOBE_CODE_POINT(0x00C6)), EEMVTC("aelig", ADOBE_CODE_POINT(0x00E6)), EEMVTC("Agrave", ADOBE_CODE_POINT(0x00C0)), ! EEMVTC("agrave", ADOBE_CODE_POINT(0x00E0)), EEMVTC("alefsym", ADOBE_CODE_POINT(0x2135)), EEMVTC("Alpha", ADOBE_CODE_POINT(0x0391)), EEMVTC("alpha", ADOBE_CODE_POINT(0x03B1)), ! EEMVTC("amp", ADOBE_CODE_POINT(0x0026)), EEMVTC("and", ADOBE_CODE_POINT(0x2227)), EEMVTC("ang", ADOBE_CODE_POINT(0x2220)), EEMVTC("Aring", ADOBE_CODE_POINT(0x00C5)), ! EEMVTC("aring", ADOBE_CODE_POINT(0x00E5)), EEMVTC("asymp", ADOBE_CODE_POINT(0x2248)), EEMVTC("Atilde", ADOBE_CODE_POINT(0x00C3)), EEMVTC("atilde", ADOBE_CODE_POINT(0x00E3)), ! EEMVTC("Auml", ADOBE_CODE_POINT(0x00C4)), EEMVTC("auml", ADOBE_CODE_POINT(0x00E4)), EEMVTC("bdquo", ADOBE_CODE_POINT(0x201E)), EEMVTC("Beta", ADOBE_CODE_POINT(0x0392)), ! EEMVTC("beta", ADOBE_CODE_POINT(0x03B2)), EEMVTC("brvbar", ADOBE_CODE_POINT(0x00A6)), EEMVTC("bull", ADOBE_CODE_POINT(0x2022)), EEMVTC("cap", ADOBE_CODE_POINT(0x2229)), ! EEMVTC("Ccedil", ADOBE_CODE_POINT(0x00C7)), EEMVTC("ccedil", ADOBE_CODE_POINT(0x00E7)), EEMVTC("cedil", ADOBE_CODE_POINT(0x00B8)), EEMVTC("cent", ADOBE_CODE_POINT(0x00A2)), ! EEMVTC("Chi", ADOBE_CODE_POINT(0x03A7)), EEMVTC("chi", ADOBE_CODE_POINT(0x03C7)), EEMVTC("circ", ADOBE_CODE_POINT(0x02C6)), EEMVTC("clubs", ADOBE_CODE_POINT(0x2663)), ! EEMVTC("cong", ADOBE_CODE_POINT(0x2245)), EEMVTC("copy", ADOBE_CODE_POINT(0x00A9)), EEMVTC("cr", ADOBE_CODE_POINT(0x000D)), EEMVTC("crarr", ADOBE_CODE_POINT(0x21B5)), ! EEMVTC("cup", ADOBE_CODE_POINT(0x222A)), EEMVTC("curren", ADOBE_CODE_POINT(0x00A4)), EEMVTC("dagger", ADOBE_CODE_POINT(0x2020)), EEMVTC("Dagger", ADOBE_CODE_POINT(0x2021)), ! EEMVTC("darr", ADOBE_CODE_POINT(0x2193)), EEMVTC("dArr", ADOBE_CODE_POINT(0x21D3)), EEMVTC("deg", ADOBE_CODE_POINT(0x00B0)), EEMVTC("Delta", ADOBE_CODE_POINT(0x0394)), ! EEMVTC("delta", ADOBE_CODE_POINT(0x03B4)), EEMVTC("diams", ADOBE_CODE_POINT(0x2666)), EEMVTC("divide", ADOBE_CODE_POINT(0x00F7)), EEMVTC("Eacute", ADOBE_CODE_POINT(0x00C9)), ! EEMVTC("eacute", ADOBE_CODE_POINT(0x00E9)), EEMVTC("Ecirc", ADOBE_CODE_POINT(0x00CA)), EEMVTC("ecirc", ADOBE_CODE_POINT(0x00EA)), EEMVTC("Egrave", ADOBE_CODE_POINT(0x00C8)), ! EEMVTC("egrave", ADOBE_CODE_POINT(0x00E8)), EEMVTC("empty", ADOBE_CODE_POINT(0x2205)), EEMVTC("emsp", ADOBE_CODE_POINT(0x2003)), EEMVTC("ensp", ADOBE_CODE_POINT(0x2002)), ! EEMVTC("Epsilon", ADOBE_CODE_POINT(0x0395)), EEMVTC("epsilon", ADOBE_CODE_POINT(0x03B5)), EEMVTC("equiv", ADOBE_CODE_POINT(0x2261)), EEMVTC("Eta", ADOBE_CODE_POINT(0x0397)), ! EEMVTC("eta", ADOBE_CODE_POINT(0x03B7)), EEMVTC("ETH", ADOBE_CODE_POINT(0x00D0)), EEMVTC("eth", ADOBE_CODE_POINT(0x00F0)), EEMVTC("Euml", ADOBE_CODE_POINT(0x00CB)), ! EEMVTC("euml", ADOBE_CODE_POINT(0x00EB)), EEMVTC("euro", ADOBE_CODE_POINT(0x20AC)), EEMVTC("exist", ADOBE_CODE_POINT(0x2203)), EEMVTC("fnof", ADOBE_CODE_POINT(0x0192)), ! EEMVTC("forall", ADOBE_CODE_POINT(0x2200)), EEMVTC("frac12", ADOBE_CODE_POINT(0x00BD)), EEMVTC("frac14", ADOBE_CODE_POINT(0x00BC)), EEMVTC("frac34", ADOBE_CODE_POINT(0x00BE)), ! EEMVTC("frasl", ADOBE_CODE_POINT(0x2044)), EEMVTC("Gamma", ADOBE_CODE_POINT(0x0393)), EEMVTC("gamma", ADOBE_CODE_POINT(0x03B3)), EEMVTC("ge", ADOBE_CODE_POINT(0x2265)), ! EEMVTC("gt", ADOBE_CODE_POINT(0x003E)), EEMVTC("harr", ADOBE_CODE_POINT(0x2194)), EEMVTC("hArr", ADOBE_CODE_POINT(0x21D4)), EEMVTC("hearts", ADOBE_CODE_POINT(0x2665)), ! EEMVTC("hellip", ADOBE_CODE_POINT(0x2026)), EEMVTC("Iacute", ADOBE_CODE_POINT(0x00CD)), EEMVTC("iacute", ADOBE_CODE_POINT(0x00ED)), EEMVTC("Icirc", ADOBE_CODE_POINT(0x00CE)), ! EEMVTC("icirc", ADOBE_CODE_POINT(0x00EE)), EEMVTC("iexcl", ADOBE_CODE_POINT(0x00A1)), EEMVTC("Igrave", ADOBE_CODE_POINT(0x00CC)), EEMVTC("igrave", ADOBE_CODE_POINT(0x00EC)), ! EEMVTC("image", ADOBE_CODE_POINT(0x2111)), EEMVTC("infin", ADOBE_CODE_POINT(0x221E)), EEMVTC("int", ADOBE_CODE_POINT(0x222B)), EEMVTC("Iota", ADOBE_CODE_POINT(0x0399)), ! EEMVTC("iota", ADOBE_CODE_POINT(0x03B9)), EEMVTC("iquest", ADOBE_CODE_POINT(0x00BF)), EEMVTC("isin", ADOBE_CODE_POINT(0x2208)), EEMVTC("Iuml", ADOBE_CODE_POINT(0x00CF)), ! EEMVTC("iuml", ADOBE_CODE_POINT(0x00EF)), EEMVTC("Kappa", ADOBE_CODE_POINT(0x039A)), EEMVTC("kappa", ADOBE_CODE_POINT(0x03BA)), EEMVTC("Lambda", ADOBE_CODE_POINT(0x039B)), ! EEMVTC("lambda", ADOBE_CODE_POINT(0x03BB)), EEMVTC("lang", ADOBE_CODE_POINT(0x2329)), EEMVTC("laquo", ADOBE_CODE_POINT(0x00AB)), EEMVTC("larr", ADOBE_CODE_POINT(0x2190)), ! EEMVTC("lArr", ADOBE_CODE_POINT(0x21D0)), EEMVTC("lceil", ADOBE_CODE_POINT(0x2308)), EEMVTC("ldquo", ADOBE_CODE_POINT(0x201C)), EEMVTC("le", ADOBE_CODE_POINT(0x2264)), ! EEMVTC("lf", ADOBE_CODE_POINT(0x000A)), EEMVTC("lfloor", ADOBE_CODE_POINT(0x230A)), EEMVTC("lowast", ADOBE_CODE_POINT(0x2217)), EEMVTC("loz", ADOBE_CODE_POINT(0x25CA)), ! EEMVTC("lrm", ADOBE_CODE_POINT(0x200E)), EEMVTC("lsaquo", ADOBE_CODE_POINT(0x2039)), EEMVTC("lsquo", ADOBE_CODE_POINT(0x2018)), EEMVTC("lt", ADOBE_CODE_POINT(0x003C)), ! EEMVTC("macr", ADOBE_CODE_POINT(0x00AF)), EEMVTC("mdash", ADOBE_CODE_POINT(0x2014)), EEMVTC("micro", ADOBE_CODE_POINT(0x00B5)), EEMVTC("middot", ADOBE_CODE_POINT(0x00B7)), ! EEMVTC("minus", ADOBE_CODE_POINT(0x2212)), EEMVTC("Mu", ADOBE_CODE_POINT(0x039C)), EEMVTC("mu", ADOBE_CODE_POINT(0x03BC)), EEMVTC("nabla", ADOBE_CODE_POINT(0x2207)), ! EEMVTC("nbsp", ADOBE_CODE_POINT(0x00A0)), EEMVTC("ndash", ADOBE_CODE_POINT(0x2013)), EEMVTC("ne", ADOBE_CODE_POINT(0x2260)), EEMVTC("ni", ADOBE_CODE_POINT(0x220B)), ! EEMVTC("not", ADOBE_CODE_POINT(0x00AC)), EEMVTC("notin", ADOBE_CODE_POINT(0x2209)), EEMVTC("nsub", ADOBE_CODE_POINT(0x2284)), EEMVTC("Ntilde", ADOBE_CODE_POINT(0x00D1)), ! EEMVTC("ntilde", ADOBE_CODE_POINT(0x00F1)), EEMVTC("Nu", ADOBE_CODE_POINT(0x039D)), EEMVTC("nu", ADOBE_CODE_POINT(0x03BD)), EEMVTC("Oacute", ADOBE_CODE_POINT(0x00D3)), ! EEMVTC("oacute", ADOBE_CODE_POINT(0x00F3)), EEMVTC("Ocirc", ADOBE_CODE_POINT(0x00D4)), EEMVTC("ocirc", ADOBE_CODE_POINT(0x00F4)), EEMVTC("OElig", ADOBE_CODE_POINT(0x0152)), ! EEMVTC("oelig", ADOBE_CODE_POINT(0x0153)), EEMVTC("Ograve", ADOBE_CODE_POINT(0x00D2)), EEMVTC("ograve", ADOBE_CODE_POINT(0x00F2)), EEMVTC("oline", ADOBE_CODE_POINT(0x203E)), ! EEMVTC("Omega", ADOBE_CODE_POINT(0x03A9)), EEMVTC("omega", ADOBE_CODE_POINT(0x03C9)), EEMVTC("Omicron", ADOBE_CODE_POINT(0x039F)), EEMVTC("omicron", ADOBE_CODE_POINT(0x03BF)), ! EEMVTC("oplus", ADOBE_CODE_POINT(0x2295)), EEMVTC("or", ADOBE_CODE_POINT(0x2228)), EEMVTC("ordf", ADOBE_CODE_POINT(0x00AA)), EEMVTC("ordm", ADOBE_CODE_POINT(0x00BA)), ! EEMVTC("Oslash", ADOBE_CODE_POINT(0x00D8)), EEMVTC("oslash", ADOBE_CODE_POINT(0x00F8)), EEMVTC("Otilde", ADOBE_CODE_POINT(0x00D5)), EEMVTC("otilde", ADOBE_CODE_POINT(0x00F5)), ! EEMVTC("otimes", ADOBE_CODE_POINT(0x2297)), EEMVTC("Ouml", ADOBE_CODE_POINT(0x00D6)), EEMVTC("ouml", ADOBE_CODE_POINT(0x00F6)), EEMVTC("para", ADOBE_CODE_POINT(0x00B6)), ! EEMVTC("part", ADOBE_CODE_POINT(0x2202)), EEMVTC("permil", ADOBE_CODE_POINT(0x2030)), EEMVTC("perp", ADOBE_CODE_POINT(0x22A5)), EEMVTC("Phi", ADOBE_CODE_POINT(0x03A6)), ! EEMVTC("phi", ADOBE_CODE_POINT(0x03C6)), EEMVTC("Pi", ADOBE_CODE_POINT(0x03A0)), EEMVTC("pi", ADOBE_CODE_POINT(0x03C0)), EEMVTC("piv", ADOBE_CODE_POINT(0x03D6)), ! EEMVTC("plusmn", ADOBE_CODE_POINT(0x00B1)), EEMVTC("pound", ADOBE_CODE_POINT(0x00A3)), EEMVTC("prime", ADOBE_CODE_POINT(0x2032)), EEMVTC("Prime", ADOBE_CODE_POINT(0x2033)), ! EEMVTC("prod", ADOBE_CODE_POINT(0x220F)), EEMVTC("prop", ADOBE_CODE_POINT(0x221D)), EEMVTC("Psi", ADOBE_CODE_POINT(0x03A8)), EEMVTC("psi", ADOBE_CODE_POINT(0x03C8)), ! EEMVTC("quot", ADOBE_CODE_POINT(0x0022)), EEMVTC("radic", ADOBE_CODE_POINT(0x221A)), EEMVTC("rang", ADOBE_CODE_POINT(0x232A)), EEMVTC("raquo", ADOBE_CODE_POINT(0x00BB)), ! EEMVTC("rarr", ADOBE_CODE_POINT(0x2192)), EEMVTC("rArr", ADOBE_CODE_POINT(0x21D2)), EEMVTC("rceil", ADOBE_CODE_POINT(0x2309)), EEMVTC("rdquo", ADOBE_CODE_POINT(0x201D)), ! EEMVTC("real", ADOBE_CODE_POINT(0x211C)), EEMVTC("reg", ADOBE_CODE_POINT(0x00AE)), EEMVTC("rfloor", ADOBE_CODE_POINT(0x230B)), EEMVTC("Rho", ADOBE_CODE_POINT(0x03A1)), ! EEMVTC("rho", ADOBE_CODE_POINT(0x03C1)), EEMVTC("rlm", ADOBE_CODE_POINT(0x200F)), EEMVTC("rsaquo", ADOBE_CODE_POINT(0x203A)), EEMVTC("rsquo", ADOBE_CODE_POINT(0x2019)), ! EEMVTC("sbquo", ADOBE_CODE_POINT(0x201A)), EEMVTC("Scaron", ADOBE_CODE_POINT(0x0160)), EEMVTC("scaron", ADOBE_CODE_POINT(0x0161)), EEMVTC("sdot", ADOBE_CODE_POINT(0x22C5)), ! EEMVTC("sect", ADOBE_CODE_POINT(0x00A7)), EEMVTC("shy", ADOBE_CODE_POINT(0x00AD)), EEMVTC("Sigma", ADOBE_CODE_POINT(0x03A3)), EEMVTC("sigma", ADOBE_CODE_POINT(0x03C3)), ! EEMVTC("sigmaf", ADOBE_CODE_POINT(0x03C2)), EEMVTC("sim", ADOBE_CODE_POINT(0x223C)), EEMVTC("spades", ADOBE_CODE_POINT(0x2660)), EEMVTC("sub", ADOBE_CODE_POINT(0x2282)), ! EEMVTC("sube", ADOBE_CODE_POINT(0x2286)), EEMVTC("sum", ADOBE_CODE_POINT(0x2211)), EEMVTC("sup", ADOBE_CODE_POINT(0x2283)), EEMVTC("sup1", ADOBE_CODE_POINT(0x00B9)), ! EEMVTC("sup2", ADOBE_CODE_POINT(0x00B2)), EEMVTC("sup3", ADOBE_CODE_POINT(0x00B3)), EEMVTC("supe", ADOBE_CODE_POINT(0x2287)), EEMVTC("szlig", ADOBE_CODE_POINT(0x00DF)), ! EEMVTC("tab", ADOBE_CODE_POINT(0x0009)), EEMVTC("Tau", ADOBE_CODE_POINT(0x03A4)), EEMVTC("tau", ADOBE_CODE_POINT(0x03C4)), EEMVTC("there4", ADOBE_CODE_POINT(0x2234)), ! EEMVTC("Theta", ADOBE_CODE_POINT(0x0398)), EEMVTC("theta", ADOBE_CODE_POINT(0x03B8)), EEMVTC("thetasym", ADOBE_CODE_POINT(0x03D1)), EEMVTC("thinsp", ADOBE_CODE_POINT(0x2009)), ! EEMVTC("THORN", ADOBE_CODE_POINT(0x00DE)), EEMVTC("thorn", ADOBE_CODE_POINT(0x00FE)), EEMVTC("tilde", ADOBE_CODE_POINT(0x02DC)), EEMVTC("times", ADOBE_CODE_POINT(0x00D7)), ! EEMVTC("trade", ADOBE_CODE_POINT(0x2122)), EEMVTC("Uacute", ADOBE_CODE_POINT(0x00DA)), EEMVTC("uacute", ADOBE_CODE_POINT(0x00FA)), EEMVTC("uarr", ADOBE_CODE_POINT(0x2191)), ! EEMVTC("uArr", ADOBE_CODE_POINT(0x21D1)), EEMVTC("Ucirc", ADOBE_CODE_POINT(0x00DB)), EEMVTC("ucirc", ADOBE_CODE_POINT(0x00FB)), EEMVTC("Ugrave", ADOBE_CODE_POINT(0x00D9)), ! EEMVTC("ugrave", ADOBE_CODE_POINT(0x00F9)), EEMVTC("uml", ADOBE_CODE_POINT(0x00A8)), EEMVTC("upsih", ADOBE_CODE_POINT(0x03D2)), EEMVTC("Upsilon", ADOBE_CODE_POINT(0x03A5)), ! EEMVTC("upsilon", ADOBE_CODE_POINT(0x03C5)), EEMVTC("Uuml", ADOBE_CODE_POINT(0x00DC)), EEMVTC("uuml", ADOBE_CODE_POINT(0x00FC)), EEMVTC("weierp", ADOBE_CODE_POINT(0x2118)), ! EEMVTC("Xi", ADOBE_CODE_POINT(0x039E)), EEMVTC("xi", ADOBE_CODE_POINT(0x03BE)), EEMVTC("Yacute", ADOBE_CODE_POINT(0x00DD)), EEMVTC("yacute", ADOBE_CODE_POINT(0x00FD)), ! EEMVTC("yen", ADOBE_CODE_POINT(0x00A5)), EEMVTC("yuml", ADOBE_CODE_POINT(0x00FF)), EEMVTC("Yuml", ADOBE_CODE_POINT(0x0178)), EEMVTC("Zeta", ADOBE_CODE_POINT(0x0396)), ! EEMVTC("zeta", ADOBE_CODE_POINT(0x03B6)), EEMVTC("zwj", ADOBE_CODE_POINT(0x200D)), EEMVTC("zwnj", ADOBE_CODE_POINT(0x200C)) #if 1 ! // NOTE (fbrereto) : These are not a part of the HTML default entity list, but are still useful ! , EEMVTC("apos", ADOBE_CODE_POINT(0x0027)) #endif ! }; ! #undef EEMVTC ! #undef ADOBE_CODE_POINT ! static entity_map_t entity_map_s(boost::begin(default_entries), boost::end(default_entries)); ! entity_map_g = &entity_map_s; } *************** *** 175,187 **** { #if 0 // disabled until user is allowed to add custom entities ! ADOBE_GLOBAL_MUTEX_INSTANCE(xml_element_parser_entity_set); #endif ! entity_map_t::iterator result(entity_map_g->find(entity)); ! if (result != entity_map_g->end() && adobe::token_range_equal(result->first, entity)) ! return result->second; ! return adobe::token_range_t(); } --- 175,187 ---- { #if 0 // disabled until user is allowed to add custom entities ! ADOBE_GLOBAL_MUTEX_INSTANCE(xml_element_parser_entity_set); #endif ! entity_map_t::iterator result(entity_map_g->find(entity)); ! if (result != entity_map_g->end() && adobe::token_range_equal(result->first, entity)) ! return result->second; ! return adobe::token_range_t(); } *************** *** 191,217 **** InputIterator atox(InputIterator first, InputIterator last, Result& result) { ! result = 0; ! while (first != last && std::isxdigit(*first)) ! { ! typename std::iterator_traits<InputIterator>::value_type c(*first); ! result <<= 4; ! if (std::isdigit(c)) ! { ! result += c - '0'; ! } ! else ! { ! c = std::use_facet<std::ctype<char> >(std::locale()).tolower(c); ! result += c - 'a' + 10; ! } ! ++first; ! } ! return first; } --- 191,217 ---- InputIterator atox(InputIterator first, InputIterator last, Result& result) { ! result = 0; ! while (first != last && std::isxdigit(*first)) ! { ! typename std::iterator_traits<InputIterator>::value_type c(*first); ! result <<= 4; ! if (std::isdigit(c)) ! { ! result += c - '0'; ! } ! else ! { ! c = std::use_facet<std::ctype<char> >(std::locale()).tolower(c); ! result += c - 'a' + 10; ! } ! ++first; ! } ! return first; } *************** *** 221,236 **** InputIterator atoi(InputIterator first, InputIterator last, Result& result) { ! result = 0; ! while (first != last && std::isdigit(*first)) ! { ! result *= 10; ! result += *first - '0'; ! ++first; ! } ! return first; } --- 221,236 ---- InputIterator atoi(InputIterator first, InputIterator last, Result& result) { ! result = 0; ! while (first != last && std::isdigit(*first)) ! { ! result *= 10; ! result += *first - '0'; ! ++first; ! } ! return first; } *************** *** 251,276 **** adobe::token_range_t transform_reference(const adobe::token_range_t& reference) { ! const char* first(reference.first); ! const char* last(reference.second - 1); // omits the ending ';' ! ++first; ! if (*first == '#') ! { ! boost::uint32_t c; ! ++first; ! if (*first == 'x') ! atox(++first, last, c); ! else ! atoi(first, last, c); ! return to_token_range(c); ! } ! else ! { ! return entity_lookup(adobe::token_range_t(first, last)); ! } } --- 251,276 ---- adobe::token_range_t transform_reference(const adobe::token_range_t& reference) { ! const char* first(reference.first); ! const char* last(reference.second - 1); // omits the ending ';' ! ++first; ! if (*first == '#') ! { ! boost::uint32_t c; ! ++first; ! if (*first == 'x') ! atox(++first, last, c); ! else ! atoi(first, last, c); ! return to_token_range(c); ! } ! else ! { ! return entity_lookup(adobe::token_range_t(first, last)); ! } } Index: virtual_machine.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/virtual_machine.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** virtual_machine.cpp 6 Jan 2006 18:03:00 -0000 1.5 --- virtual_machine.cpp 3 Feb 2006 18:33:38 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...1280 lines suppressed...] void virtual_machine_t::pop_back() { ! object_m->pop_back(); } ! /*************************************************************************************************/ *************** *** 799,803 **** bool operator == (const virtual_machine_t::tracked_value_t& x, const virtual_machine_t::tracked_value_t& y) { ! return x.value_m == y.value_m && x.contributing_m == y.contributing_m; } --- 800,804 ---- bool operator == (const virtual_machine_t::tracked_value_t& x, const virtual_machine_t::tracked_value_t& y) { ! return x.value_m == y.value_m && x.contributing_m == y.contributing_m; } Index: eve_evaluate.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/eve_evaluate.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eve_evaluate.cpp 24 Jan 2006 19:38:50 -0000 1.3 --- eve_evaluate.cpp 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 35,60 **** void init_once() { ! static adobe::name_t reflected[] = ! { ! adobe::static_name_t("align_left"), ! adobe::static_name_t("align_right"), ! adobe::static_name_t("align_top"), ! adobe::static_name_t("align_bottom"), ! adobe::static_name_t("align_center"), ! adobe::static_name_t("align_proportional"), ! adobe::static_name_t("align_fill"), ! ! adobe::static_name_t("place_row"), ! adobe::static_name_t("place_column"), ! adobe::static_name_t("place_overlay") ! }; ! static reflected_table_range_t reflected_table_range_s; ! adobe::sort(reflected); ! reflected_table_range_s.first = boost::begin(reflected); ! reflected_table_range_s.second = boost::end(reflected); ! reflected_range_g = &reflected_table_range_s; } --- 35,60 ---- void init_once() { ! static adobe::name_t reflected[] = ! { ! adobe::static_name_t("align_left"), ! adobe::static_name_t("align_right"), ! adobe::static_name_t("align_top"), ! adobe::static_name_t("align_bottom"), ! adobe::static_name_t("align_center"), ! adobe::static_name_t("align_proportional"), ! adobe::static_name_t("align_fill"), ! ! adobe::static_name_t("place_row"), ! adobe::static_name_t("place_column"), ! adobe::static_name_t("place_overlay") ! }; ! static reflected_table_range_t reflected_table_range_s; ! adobe::sort(reflected); ! reflected_table_range_s.first = boost::begin(reflected); ! reflected_table_range_s.second = boost::end(reflected); ! reflected_range_g = &reflected_table_range_s; } *************** *** 63,71 **** adobe::value_t reflected_variables(const adobe::basic_sheet_t& layout_sheet, adobe::name_t name) { ! adobe::name_t* found(std::lower_bound(reflected_range_g->first, reflected_range_g->second, name)); ! if (found != reflected_range_g->second && *found == name) return adobe::value_t(name); ! ! return layout_sheet[name]; } --- 63,71 ---- adobe::value_t reflected_variables(const adobe::basic_sheet_t& layout_sheet, adobe::name_t name) { ! adobe::name_t* found(std::lower_bound(reflected_range_g->first, reflected_range_g->second, name)); ! if (found != reflected_range_g->second && *found == name) return adobe::value_t(name); ! ! return layout_sheet[name]; } *************** *** 73,84 **** adobe::dictionary_t evaluate_named_arguments(adobe::virtual_machine_t& evaluator, ! const adobe::array_t& arguments) { ! evaluator.evaluate(arguments); ! ! adobe::dictionary_t result(evaluator.back().value_m.get<adobe::dictionary_t>()); ! ! evaluator.pop_back(); ! return result; } --- 73,84 ---- adobe::dictionary_t evaluate_named_arguments(adobe::virtual_machine_t& evaluator, ! const adobe::array_t& arguments) { ! evaluator.evaluate(arguments); ! ! adobe::dictionary_t result(evaluator.back().value_m.get<adobe::dictionary_t>()); ! ! evaluator.pop_back(); ! return result; } *************** *** 86,117 **** adobe::value_t evaluate_initializer(adobe::virtual_machine_t& evaluator, ! const adobe::array_t& expression) { ! evaluator.evaluate(expression); ! ! adobe::value_t result(evaluator.back().value_m); ! ! evaluator.pop_back(); ! return result; } /*************************************************************************************************/ ! void add_cell( adobe::basic_sheet_t& sheet, ! adobe::eve_callback_suite_t::cell_type_t type, ! adobe::name_t name, ! const adobe::value_t& value) { ! switch(type) ! { ! case adobe::eve_callback_suite_t::constant_k: ! sheet.add_constant(name, value); ! break; ! case adobe::eve_callback_suite_t::interface_k: ! sheet.add_interface(name, value); ! break; ! default: ! assert(false); // Type not supported ! } } --- 86,117 ---- adobe::value_t evaluate_initializer(adobe::virtual_machine_t& evaluator, ! const adobe::array_t& expression) { ! evaluator.evaluate(expression); ! ! adobe::value_t result(evaluator.back().value_m); ! ! evaluator.pop_back(); ! return result; } /*************************************************************************************************/ ! void add_cell( adobe::basic_sheet_t& sheet, ! adobe::eve_callback_suite_t::cell_type_t type, ! adobe::name_t name, ! const adobe::value_t& value) { ! switch(type) ! { ! case adobe::eve_callback_suite_t::constant_k: ! sheet.add_constant(name, value); ! break; ! case adobe::eve_callback_suite_t::interface_k: ! sheet.add_interface(name, value); ! break; ! default: ! assert(false); // Type not supported ! } } *************** *** 131,149 **** eve_callback_suite_t bind_layout(const bind_layout_proc_t& proc, basic_sheet_t& layout_sheet, ! virtual_machine_t& evaluator) { ! ADOBE_ONCE_INSTANCE(adobe_eve_evaluate); ! ! eve_callback_suite_t suite; ! ! evaluator.set_simple_variable_lookup( ! boost::bind(&reflected_variables, boost::cref(layout_sheet), _1)); ! suite.add_view_proc_m = boost::bind(proc, _1, _3, boost::bind(&evaluate_named_arguments, ! boost::ref(evaluator), _4)); ! suite.add_cell_proc_m = boost::bind(&add_cell, boost::ref(layout_sheet), _1, _2, ! boost::bind(&evaluate_initializer, boost::ref(evaluator), _4)); ! return suite; } --- 131,149 ---- eve_callback_suite_t bind_layout(const bind_layout_proc_t& proc, basic_sheet_t& layout_sheet, ! virtual_machine_t& evaluator) { ! ADOBE_ONCE_INSTANCE(adobe_eve_evaluate); ! ! eve_callback_suite_t suite; ! ! evaluator.set_simple_variable_lookup( ! boost::bind(&reflected_variables, boost::cref(layout_sheet), _1)); ! suite.add_view_proc_m = boost::bind(proc, _1, _3, boost::bind(&evaluate_named_arguments, ! boost::ref(evaluator), _4)); ! suite.add_cell_proc_m = boost::bind(&add_cell, boost::ref(layout_sheet), _1, _2, ! boost::bind(&evaluate_initializer, boost::ref(evaluator), _4)); ! return suite; } Index: lex_stream.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/source/lex_stream.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lex_stream.hpp 6 Jan 2006 18:03:00 -0000 1.5 --- lex_stream.hpp 3 Feb 2006 18:33:38 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 32,60 **** { public: ! lex_stream_t(std::istream& in, const line_position_t& position); #if !defined(ADOBE_NO_DOCUMENTATION) ! lex_stream_t(const lex_stream_t& rhs); ! ~lex_stream_t(); ! lex_stream_t& operator = (const lex_stream_t& rhs); #endif // !defined(ADOBE_NO_DOCUMENTATION) ! const stream_lex_token_t& get(); ! void putback(); ! const line_position_t& next_position(); ! void set_keyword_extension_lookup(const keyword_extension_lookup_proc_t& proc); #if !defined(ADOBE_NO_DOCUMENTATION) private: ! friend void ::swap(adobe::lex_stream_t&, adobe::lex_stream_t&); ! struct implementation_t; ! implementation_t* object_m; #endif // !defined(ADOBE_NO_DOCUMENTATION) }; --- 32,60 ---- { public: ! lex_stream_t(std::istream& in, const line_position_t& position); #if !defined(ADOBE_NO_DOCUMENTATION) ! lex_stream_t(const lex_stream_t& rhs); ! ~lex_stream_t(); ! lex_stream_t& operator = (const lex_stream_t& rhs); #endif // !defined(ADOBE_NO_DOCUMENTATION) ! const stream_lex_token_t& get(); ! void putback(); ! const line_position_t& next_position(); ! void set_keyword_extension_lookup(const keyword_extension_lookup_proc_t& proc); #if !defined(ADOBE_NO_DOCUMENTATION) private: ! friend void ::swap(adobe::lex_stream_t&, adobe::lex_stream_t&); ! struct implementation_t; ! implementation_t* object_m; #endif // !defined(ADOBE_NO_DOCUMENTATION) }; *************** *** 68,72 **** inline void swap(adobe::lex... [truncated message content] |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe Modified Files: Jamfile.v2 adam.hpp adam_evaluate.hpp adam_parser.hpp algorithm.hpp array.hpp array_fwd.hpp basic_sheet.hpp circular_queue.hpp cmath.hpp config.hpp conversion.hpp copy_on_write.hpp counter.hpp dancing_links.hpp dictionary.hpp dictionary_fwd.hpp empty.hpp eve.hpp eve_evaluate.hpp eve_parser.hpp extents.hpp final.hpp forest.hpp functional.hpp istream.hpp istream_fwd.hpp iterator.hpp md5.hpp mismatch.hpp name.hpp name_fwd.hpp numeric.hpp once.hpp regular_object.hpp sha.hpp static_table.hpp string.hpp table_index.hpp thread_id.hpp typeinfo.hpp unicode.hpp value.hpp value_fwd.hpp virtual_machine.hpp xstring.hpp zuid.hpp Log Message: asl 1.0.13 Index: copy_on_write.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/copy_on_write.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** copy_on_write.hpp 6 Jan 2006 18:02:35 -0000 1.6 --- copy_on_write.hpp 3 Feb 2006 18:33:35 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 32,88 **** { public: ! typedef T value_type; ! ! explicit copy_on_write(const value_type& x = value_type()) : ! object_m(new implementation_t(x)) ! { } ! copy_on_write(const copy_on_write& x) : ! object_m(x.object_m) ! { ! object_m->ref_count_m.increment(); ! } ! ~copy_on_write() ! { ! if (object_m->ref_count_m.decrement()) delete object_m; ! } ! copy_on_write& operator = (const copy_on_write& x) ! { ! x.object_m->ref_count_m.increment(); ! if (object_m->ref_count_m.decrement()) delete object_m; ! object_m = x.object_m; ! return *this; ! } ! value_type& write() ! { ! if (!object_m->ref_count_m.is_one()) ! { ! implementation_t* temp = new implementation_t(object_m->value_m); ! object_m->ref_count_m.decrement(); ! object_m = temp; ! } ! return object_m->value_m; ! } ! ! operator const value_type& () const ! { return object_m->value_m; } ! const value_type& operator*() const { return object_m->value_m; } ! const value_type* operator->() const { return &object_m->value_m; } ! bool unique_instance() const { return object_m->ref_count_m.is_one(); } ! bool identity(const copy_on_write<T>& x) const { return object_m == x.object_m; } ! private: ! friend inline void swap(copy_on_write& x, copy_on_write& y) ! { adobe::adl_swap(x.object_m, y.object_m); } #if !defined(ADOBE_NO_DOCUMENTATION) ! struct implementation_t; ! implementation_t* object_m; #endif }; --- 32,88 ---- { public: ! typedef T value_type; ! ! explicit copy_on_write(const value_type& x = value_type()) : ! object_m(new implementation_t(x)) ! { } ! copy_on_write(const copy_on_write& x) : ! object_m(x.object_m) ! { ! object_m->ref_count_m.increment(); ! } ! ~copy_on_write() ! { ! if (object_m->ref_count_m.decrement()) delete object_m; ! } ! copy_on_write& operator = (const copy_on_write& x) ! { ! x.object_m->ref_count_m.increment(); ! if (object_m->ref_count_m.decrement()) delete object_m; ! object_m = x.object_m; ! return *this; ! } ! value_type& write() ! { ! if (!object_m->ref_count_m.is_one()) ! { ! implementation_t* temp = new implementation_t(object_m->value_m); ! object_m->ref_count_m.decrement(); ! object_m = temp; ! } ! return object_m->value_m; ! } ! ! operator const value_type& () const ! { return object_m->value_m; } ! const value_type& operator*() const { return object_m->value_m; } ! const value_type* operator->() const { return &object_m->value_m; } ! bool unique_instance() const { return object_m->ref_count_m.is_one(); } ! bool identity(const copy_on_write<T>& x) const { return object_m == x.object_m; } ! private: ! friend inline void swap(copy_on_write& x, copy_on_write& y) ! { adobe::adl_swap(x.object_m, y.object_m); } #if !defined(ADOBE_NO_DOCUMENTATION) ! struct implementation_t; ! implementation_t* object_m; #endif }; *************** *** 93,101 **** /* ! NOTE (sparent) : We cannot use boost::totaly_ordered to implement these operations portably ! (although it works with most compilers, it doesn't with CW 9.6). The problem is that ! we do not know if T satifies the requirments for totally ordered or not - copy_on_write is ! only totally ordered if T is. By splitting the operations out to seperate template functions ! they are only instantiated if and where they are used. */ --- 93,101 ---- /* ! NOTE (sparent) : We cannot use boost::totaly_ordered to implement these operations portably ! (although it works with most compilers, it doesn't with CW 9.6). The problem is that ! we do not know if T satifies the requirments for totally ordered or not - copy_on_write is ! only totally ordered if T is. By splitting the operations out to seperate template functions ! they are only instantiated if and where they are used. */ *************** *** 129,136 **** struct copy_on_write<T>::implementation_t : private boost::noncopyable { ! implementation_t(const value_type& x) : value_m(x) { } ! value_type value_m; ! adobe::counter_t ref_count_m; }; --- 129,136 ---- struct copy_on_write<T>::implementation_t : private boost::noncopyable { ! implementation_t(const value_type& x) : value_m(x) { } ! value_type value_m; ! adobe::counter_t ref_count_m; }; Index: thread_id.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/thread_id.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** thread_id.hpp 6 Jan 2006 18:02:35 -0000 1.3 --- thread_id.hpp 3 Feb 2006 18:33:35 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 Adobe Systems Incorporated and others ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated and others ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ Index: dictionary.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/dictionary.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dictionary.hpp 6 Jan 2006 18:02:35 -0000 1.4 --- dictionary.hpp 3 Feb 2006 18:33:35 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 32,57 **** namespace adobe { ! /*************************************************************************************************/ class dictionary_t::write_reference ! { ! public: ! value_t& operator[] (name_t key); ! protected: ! friend class dictionary_t; ! ! write_reference(dictionary_t& x) : ! fDictionary(x) ! { } ! private: ! dictionary_t& fDictionary; ! }; /*************************************************************************************************/ ! inline dictionary_t::write_reference dictionary_t::write() ! { return write_reference(*this); } ! /*************************************************************************************************/ --- 32,57 ---- namespace adobe { ! /*************************************************************************************************/ class dictionary_t::write_reference ! { ! public: ! value_t& operator[] (name_t key); ! protected: ! friend class dictionary_t; ! ! write_reference(dictionary_t& x) : ! fDictionary(x) ! { } ! private: ! dictionary_t& fDictionary; ! }; /*************************************************************************************************/ ! inline dictionary_t::write_reference dictionary_t::write() ! { return write_reference(*this); } ! /*************************************************************************************************/ *************** *** 61,66 **** template <class T> dictionary_t& dictionary_set(dictionary_t& object, name_t key, const T& x) ! { return dictionary_set(object, key, value_t(x)); } ! /*************************************************************************************************/ --- 61,66 ---- template <class T> dictionary_t& dictionary_set(dictionary_t& object, name_t key, const T& x) ! { return dictionary_set(object, key, value_t(x)); } ! /*************************************************************************************************/ *************** *** 68,74 **** struct dictionary_get<value_t> { ! const promote<value_t>::type& operator () (const dictionary_t& object, name_t key, select<value_t>); ! void operator () (const dictionary_t& object, name_t key, value_t& value); }; --- 68,74 ---- struct dictionary_get<value_t> { ! const promote<value_t>::type& operator () (const dictionary_t& object, name_t key, select<value_t>); ! void operator () (const dictionary_t& object, name_t key, value_t& value); }; *************** *** 76,91 **** struct dictionary_get { ! const typename promote<T>::type& operator () (const dictionary_t& object, name_t key, select<T>) ! { ! return dictionary_get<value_t>()(object, key, select<value_t>()).template get<T>(); ! } ! void operator () (const dictionary_t& object, name_t key, T& value) ! { ! value_t result; ! dictionary_get<value_t>()(object, key, result); ! result.get(value); ! } }; --- 76,91 ---- struct dictionary_get { ! const typename promote<T>::type& operator () (const dictionary_t& object, name_t key, select<T>) ! { ! return dictionary_get<value_t>()(object, key, select<value_t>()).template get<T>(); ! } ! void operator () (const dictionary_t& object, name_t key, T& value) ! { ! value_t result; ! dictionary_get<value_t>()(object, key, result); ! result.get(value); ! } }; *************** *** 94,188 **** template <typename T> inline const typename promote<T>::type& dictionary_t::get(name_t key) const ! { return dictionary_get<T>()(*this, key, select<T>()); } ! template <typename T> inline void dictionary_t::get(name_t key, T& value) const ! { dictionary_get<T>()(*this, key, value); } ! /*************************************************************************************************/ template <class InputIterator> dictionary_t dictionary_ctor(InputIterator first, InputIterator last) ! { ! dictionary_t result; ! std::copy(first, last, result.inserter()); ! return result; ! } ! /*************************************************************************************************/ template <typename T> dictionary_t dictionary_ctor(const char* k0, const T& v0) ! { ! dictionary_t result; ! result.set(name_t(k0), v0); ! return result; ! } template <typename K0, typename V0, typename K1, typename V1> ! dictionary_t dictionary_ctor( const K0& k0, const V0& v0, ! const K1& k1, const V1& v1 ) ! { ! dictionary_t result; ! result.set(name_t(k0), v0); ! result.set(name_t(k1), v1); ! return result; ! } ! /*************************************************************************************************/ class dictionary_t::const_iterator : ! public std::iterator<std::bidirectional_iterator_tag, dictionary_t::value_type, ! dictionary_t::difference_type, dictionary_t::const_pointer, dictionary_t::const_reference> ! ! { ! public: ! typedef dictionary_t::const_reference const_reference; ! typedef dictionary_t::const_pointer const_pointer; ! ! const_iterator(const const_iterator& x); ! ~const_iterator() throw(); ! ! const_iterator& operator= (const const_iterator& x); ! const_reference operator* () const throw(); ! const_pointer operator -> () const throw(); ! const_iterator& operator++ () throw(); ! const_iterator operator++ (int); ! const_iterator& operator-- () throw(); ! const_iterator operator-- (int); ! bool operator== (const const_iterator& rhs) const throw(); ! bool operator!= (const const_iterator& rhs) const throw(); ! protected: ! friend class dictionary_t; ! ! class begin { }; ! class end { }; ! ! const_iterator(const dictionary_t&, begin); ! const_iterator(const dictionary_t&, end); ! const_iterator(const dictionary_t&, name_t x); // Find form ! private: ! class implementation; ! const_iterator::implementation* object; ! }; ! /*************************************************************************************************/ inline dictionary_t::const_iterator dictionary_t::begin() const ! { return const_iterator(*this, const_iterator::begin()); } ! inline dictionary_t::const_iterator dictionary_t::end() const ! { return const_iterator(*this, const_iterator::end()); } ! inline dictionary_t::const_reverse_iterator dictionary_t::rbegin() const ! { return const_reverse_iterator(end()); } inline dictionary_t::const_reverse_iterator dictionary_t::rend() const ! { return const_reverse_iterator(begin()); } /*************************************************************************************************/ ! } // namespace adobe --- 94,188 ---- template <typename T> inline const typename promote<T>::type& dictionary_t::get(name_t key) const ! { return dictionary_get<T>()(*this, key, select<T>()); } ! template <typename T> inline void dictionary_t::get(name_t key, T& value) const ! { dictionary_get<T>()(*this, key, value); } ! /*************************************************************************************************/ template <class InputIterator> dictionary_t dictionary_ctor(InputIterator first, InputIterator last) ! { ! dictionary_t result; ! std::copy(first, last, result.inserter()); ! return result; ! } ! /*************************************************************************************************/ template <typename T> dictionary_t dictionary_ctor(const char* k0, const T& v0) ! { ! dictionary_t result; ! result.set(name_t(k0), v0); ! return result; ! } template <typename K0, typename V0, typename K1, typename V1> ! dictionary_t dictionary_ctor( const K0& k0, const V0& v0, ! const K1& k1, const V1& v1 ) ! { ! dictionary_t result; ! result.set(name_t(k0), v0); ! result.set(name_t(k1), v1); ! return result; ! } ! /*************************************************************************************************/ class dictionary_t::const_iterator : ! public std::iterator<std::bidirectional_iterator_tag, dictionary_t::value_type, ! dictionary_t::difference_type, dictionary_t::const_pointer, dictionary_t::const_reference> ! ! { ! public: ! typedef dictionary_t::const_reference const_reference; ! typedef dictionary_t::const_pointer const_pointer; ! ! const_iterator(const const_iterator& x); ! ~const_iterator() throw(); ! ! const_iterator& operator= (const const_iterator& x); ! const_reference operator* () const throw(); ! const_pointer operator -> () const throw(); ! const_iterator& operator++ () throw(); ! const_iterator operator++ (int); ! const_iterator& operator-- () throw(); ! const_iterator operator-- (int); ! bool operator== (const const_iterator& rhs) const throw(); ! bool operator!= (const const_iterator& rhs) const throw(); ! protected: ! friend class dictionary_t; ! ! class begin { }; ! class end { }; ! ! const_iterator(const dictionary_t&, begin); ! const_iterator(const dictionary_t&, end); ! const_iterator(const dictionary_t&, name_t x); // Find form ! private: ! class implementation; ! const_iterator::implementation* object; ! }; ! /*************************************************************************************************/ inline dictionary_t::const_iterator dictionary_t::begin() const ! { return const_iterator(*this, const_iterator::begin()); } ! inline dictionary_t::const_iterator dictionary_t::end() const ! { return const_iterator(*this, const_iterator::end()); } ! inline dictionary_t::const_reverse_iterator dictionary_t::rbegin() const ! { return const_reverse_iterator(end()); } inline dictionary_t::const_reverse_iterator dictionary_t::rend() const ! { return const_reverse_iterator(begin()); } /*************************************************************************************************/ ! } // namespace adobe Index: static_table.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/static_table.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** static_table.hpp 6 Jan 2006 18:02:35 -0000 1.4 --- static_table.hpp 3 Feb 2006 18:33:35 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 27,56 **** struct static_table_traits { ! typedef bool result_type; ! typedef KeyType key_type; ! typedef ValueType value_type; ! typedef std::pair<key_type, value_type> entry_type; ! result_type operator()(const entry_type& x, const entry_type& y) const ! { ! return (*this)(x, y.first); ! } ! // revisit: MM. For debugging purposes, VC 8 requires the definition of ! // this (unnecessary overload) in debug versions. ! result_type operator()(const key_type& x, const entry_type& y) const ! { ! return x < y.first; ! } ! result_type operator()(const entry_type& x, const key_type& y) const ! { ! return x.first < y; ! } ! result_type equal(const key_type& x, const key_type& y) const ! { ! return x == y; ! } }; --- 27,56 ---- struct static_table_traits { ! typedef bool result_type; ! typedef KeyType key_type; ! typedef ValueType value_type; ! typedef std::pair<key_type, value_type> entry_type; ! result_type operator()(const entry_type& x, const entry_type& y) const ! { ! return (*this)(x, y.first); ! } ! // revisit: MM. For debugging purposes, VC 8 requires the definition of ! // this (unnecessary overload) in debug versions. ! result_type operator()(const key_type& x, const entry_type& y) const ! { ! return x < y.first; ! } ! result_type operator()(const entry_type& x, const key_type& y) const ! { ! return x.first < y; ! } ! result_type equal(const key_type& x, const key_type& y) const ! { ! return x == y; ! } }; *************** *** 60,97 **** struct static_table { ! typedef Traits traits_type; ! typedef typename traits_type::key_type key_type; ! typedef typename traits_type::value_type value_type; ! typedef typename traits_type::entry_type entry_type; ! const value_type& operator()(const key_type& key) const ! { ! const entry_type* iter(adobe::lower_bound(table_m, key, traits_type())); ! if (iter == boost::end(table_m) || !traits_type().equal(iter->first, key)) ! throw std::logic_error("static_table key not found"); ! return iter->second; ! } ! bool operator()(const key_type& key, value_type& result) const ! { ! const entry_type* iter(adobe::lower_bound(table_m, key, traits_type())); ! if (iter == boost::end(table_m) || !traits_type().equal(iter->first, key)) ! return false; ! result = iter->second; ! return true; ! } ! void sort() ! { ! adobe::sort(table_m, traits_type()); ! } public: ! entry_type table_m[Size]; }; --- 60,97 ---- struct static_table { ! typedef Traits traits_type; ! typedef typename traits_type::key_type key_type; ! typedef typename traits_type::value_type value_type; ! typedef typename traits_type::entry_type entry_type; ! const value_type& operator()(const key_type& key) const ! { ! const entry_type* iter(adobe::lower_bound(table_m, key, traits_type())); ! if (iter == boost::end(table_m) || !traits_type().equal(iter->first, key)) ! throw std::logic_error("static_table key not found"); ! return iter->second; ! } ! bool operator()(const key_type& key, value_type& result) const ! { ! const entry_type* iter(adobe::lower_bound(table_m, key, traits_type())); ! if (iter == boost::end(table_m) || !traits_type().equal(iter->first, key)) ! return false; ! result = iter->second; ! return true; ! } ! void sort() ! { ! adobe::sort(table_m, traits_type()); ! } public: ! entry_type table_m[Size]; }; Index: extents.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/extents.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** extents.hpp 6 Jan 2006 18:02:35 -0000 1.6 --- extents.hpp 3 Feb 2006 18:33:35 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 27,56 **** struct point_2d : boost::equality_comparable<point_2d<T> > { ! point_2d() : ! x_m(T()), y_m(T()) ! { } ! point_2d(const T& x, const T& y) : ! x_m(x), y_m(y) ! { } ! T x_m; ! T y_m; ! ! friend inline void swap(const point_2d& x, const point_2d& y) ! { ! adobe::adl_swap(x.x_m, y.x_m); ! adobe::adl_swap(x.y_m, y.y_m); ! } ! ! friend inline void operator==(const point_2d& x, const point_2d& y) ! { ! return (x.x_m == y.x_m) && (x.y_m == y.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: --- 27,56 ---- struct point_2d : boost::equality_comparable<point_2d<T> > { ! point_2d() : ! x_m(T()), y_m(T()) ! { } ! point_2d(const T& x, const T& y) : ! x_m(x), y_m(y) ! { } ! T x_m; ! T y_m; ! ! friend inline void swap(const point_2d& x, const point_2d& y) ! { ! adobe::adl_swap(x.x_m, y.x_m); ! adobe::adl_swap(x.y_m, y.y_m); ! } ! ! friend inline void operator==(const point_2d& x, const point_2d& y) ! { ! return (x.x_m == y.x_m) && (x.y_m == y.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: *************** *** 59,64 **** struct guide_set_t { ! adobe::name_t name_m; ! long offset_m; }; typedef std::vector<guide_set_t> point_of_interest_set_t; --- 59,64 ---- struct guide_set_t { ! adobe::name_t name_m; ! long offset_m; }; typedef std::vector<guide_set_t> point_of_interest_set_t; *************** *** 69,73 **** struct extents_slices_t { ! enum slice_select_t { horizontal, vertical }; }; --- 69,73 ---- struct extents_slices_t { ! enum slice_select_t { horizontal, vertical }; }; *************** *** 76,110 **** 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; ! ! friend bool operator ==(const slice_t& x, const slice_t& y); ! }; ! 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; } ! ! friend bool operator == (const extents_t& x, const extents_t& y); }; --- 76,110 ---- 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; ! ! friend bool operator ==(const slice_t& x, const slice_t& y); ! }; ! 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; } ! ! friend bool operator == (const extents_t& x, const extents_t& y); }; *************** *** 112,120 **** #if defined(ADOBE_SERIALIZATION) ! std::ostream& operator << (std::ostream& s, const adobe::extents_t& x); #endif #if defined(ADOBE_SERIALIZATION) ! std::ostream& operator << (std::ostream& s, const adobe::extents_t::slice_t& x); #endif --- 112,120 ---- #if defined(ADOBE_SERIALIZATION) ! std::ostream& operator << (std::ostream& s, const adobe::extents_t& x); #endif #if defined(ADOBE_SERIALIZATION) ! std::ostream& operator << (std::ostream& s, const adobe::extents_t::slice_t& x); #endif *************** *** 129,137 **** template <> inline void swap(adobe::extents_t::slice_t& x, adobe::extents_t::slice_t& y) { ! adobe::adl_swap(x.length_m, y.length_m); ! adobe::adl_swap(x.outset_m, y.outset_m); ! adobe::adl_swap(x.frame_m, y.frame_m); ! adobe::adl_swap(x.inset_m, y.inset_m); ! adobe::adl_swap(x.poi_m, y.poi_m); } --- 129,137 ---- template <> inline void swap(adobe::extents_t::slice_t& x, adobe::extents_t::slice_t& y) { ! adobe::adl_swap(x.length_m, y.length_m); ! adobe::adl_swap(x.outset_m, y.outset_m); ! adobe::adl_swap(x.frame_m, y.frame_m); ! adobe::adl_swap(x.inset_m, y.inset_m); ! adobe::adl_swap(x.poi_m, y.poi_m); } Index: functional.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/functional.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functional.hpp 6 Jan 2006 18:02:35 -0000 1.6 --- functional.hpp 3 Feb 2006 18:33:35 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 27,31 **** struct element { ! typedef typename boost::tuples::element<N, T>::type type; }; --- 27,31 ---- struct element { ! typedef typename boost::tuples::element<N, T>::type type; }; *************** *** 33,37 **** struct element<0, std::pair<T1, T2> > { ! typedef typename std::pair<T1, T2>::first_type type; }; --- 33,37 ---- struct element<0, std::pair<T1, T2> > { ! typedef typename std::pair<T1, T2>::first_type type; }; *************** *** 39,43 **** struct element<1, std::pair<T1, T2> > { ! typedef typename std::pair<T1, T2>::second_type type; }; --- 39,43 ---- struct element<1, std::pair<T1, T2> > { ! typedef typename std::pair<T1, T2>::second_type type; }; *************** *** 47,55 **** struct get_element : std::unary_function<T, typename element<N, T>::type> { ! typename element<N, T>::type& operator()(T& x) const ! { return boost::get<N>(x); } ! ! const typename element<N, T>::type& operator()(const T& x) const ! { return boost::get<N>(x); } }; --- 47,55 ---- struct get_element : std::unary_function<T, typename element<N, T>::type> { ! typename element<N, T>::type& operator()(T& x) const ! { return boost::get<N>(x); } ! ! const typename element<N, T>::type& operator()(const T& x) const ! { return boost::get<N>(x); } }; *************** *** 58,71 **** template <typename T1, typename T2> // T is pair or tuple struct get_element<0, std::pair<T1, T2> > : ! std::unary_function<std::pair<T1, T2>, typename std::pair<T1, T2>::first_type> { ! typedef typename std::pair<T1, T2> argument_type; ! typedef typename argument_type::first_type result_type; ! result_type& operator()(argument_type& x) const ! { return x.first; } ! ! const result_type& operator()(const argument_type& x) const ! { return x.first; } }; --- 58,71 ---- template <typename T1, typename T2> // T is pair or tuple struct get_element<0, std::pair<T1, T2> > : ! std::unary_function<std::pair<T1, T2>, typename std::pair<T1, T2>::first_type> { ! typedef typename std::pair<T1, T2> argument_type; ! typedef typename argument_type::first_type result_type; ! result_type& operator()(argument_type& x) const ! { return x.first; } ! ! const result_type& operator()(const argument_type& x) const ! { return x.first; } }; *************** *** 74,87 **** template <typename T1, typename T2> // T is pair or tuple struct get_element<1, std::pair<T1, T2> > : ! std::unary_function<std::pair<T1, T2>, typename std::pair<T1, T2>::second_type> { ! typedef typename std::pair<T1, T2> argument_type; ! typedef typename argument_type::second_type result_type; ! ! result_type& operator()(argument_type& x) const ! { return x.second; } ! ! const result_type& operator()(const argument_type& x) const ! { return x.second; } }; --- 74,87 ---- template <typename T1, typename T2> // T is pair or tuple struct get_element<1, std::pair<T1, T2> > : ! std::unary_function<std::pair<T1, T2>, typename std::pair<T1, T2>::second_type> { ! typedef typename std::pair<T1, T2> argument_type; ! typedef typename argument_type::second_type result_type; ! ! result_type& operator()(argument_type& x) const ! { return x.second; } ! ! const result_type& operator()(const argument_type& x) const ! { return x.second; } }; *************** *** 91,96 **** struct identity : std::unary_function<T, T> { ! T& operator()(T& x) const { return x; } ! const T& operator()(const T& x) const { return x; } }; --- 91,96 ---- struct identity : std::unary_function<T, T> { ! T& operator()(T& x) const { return x; } ! const T& operator()(const T& x) const { return x; } }; *************** *** 100,104 **** struct always_true : std::unary_function<T, bool> { ! bool operator()(const T&) const { return true; } }; --- 100,104 ---- struct always_true : std::unary_function<T, bool> { ! bool operator()(const T&) const { return true; } }; *************** *** 128,133 **** struct delete_ptr<T*> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete x; } }; --- 128,133 ---- struct delete_ptr<T*> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete x; } }; *************** *** 135,140 **** struct delete_ptr<T* const> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete x; } }; --- 135,140 ---- struct delete_ptr<T* const> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete x; } }; *************** *** 154,159 **** struct delete_ptr<T(*)[]> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete [] x; } }; --- 154,159 ---- struct delete_ptr<T(*)[]> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete [] x; } }; *************** *** 161,166 **** struct delete_ptr<T(* const)[]> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete [] x; } }; --- 161,166 ---- struct delete_ptr<T(* const)[]> : std::unary_function<T*, void> { ! void operator () (T* x) const throw() ! { delete [] x; } }; *************** *** 208,212 **** struct generator_t { ! typedef Result result_type; }; --- 208,212 ---- struct generator_t { ! typedef Result result_type; }; *************** *** 220,227 **** #endif { ! explicit sequence_t(const T& x) : data_m(x) { } ! T operator () () { return data_m++; } private: ! T data_m; }; --- 220,227 ---- #endif { ! explicit sequence_t(const T& x) : data_m(x) { } ! T operator () () { return data_m++; } private: ! T data_m; }; *************** *** 231,256 **** struct compare_members_t : std::binary_function<T, T, bool> { ! compare_members_t(R T::* member, Compare compare) : ! compare_m(compare), ! member_m(member) ! { } ! bool operator () (const T& x, const T& y) const ! { return compare_m(x.*member_m, y.*member_m); } ! ! bool operator () (const T& x, const R& y) const ! { return compare_m(x.*member_m, y); } ! ! bool operator () (const R& x, const T& y) const ! { return compare_m(x, y.*member_m); } private: /* ! REVISIT (sparent) : This could probably use an empty member optimization. */ ! Compare compare_m; ! R T::* member_m; }; --- 231,256 ---- struct compare_members_t : std::binary_function<T, T, bool> { ! compare_members_t(R T::* member, Compare compare) : ! compare_m(compare), ! member_m(member) ! { } ! bool operator () (const T& x, const T& y) const ! { return compare_m(x.*member_m, y.*member_m); } ! ! bool operator () (const T& x, const R& y) const ! { return compare_m(x.*member_m, y); } ! ! bool operator () (const R& x, const T& y) const ! { return compare_m(x, y.*member_m); } private: /* ! REVISIT (sparent) : This could probably use an empty member optimization. */ ! Compare compare_m; ! R T::* member_m; }; *************** *** 258,262 **** compare_members_t<T, R, std::less<R> > compare_members(R T::* member) { ! return compare_members_t<T, R, std::less<R> >(member, std::less<R>() ); } --- 258,262 ---- compare_members_t<T, R, std::less<R> > compare_members(R T::* member) { ! return compare_members_t<T, R, std::less<R> >(member, std::less<R>() ); } *************** *** 264,268 **** compare_members_t<T, R, Compare> compare_members(R T::* member, Compare compare) { ! return compare_members_t<T, R, Compare>(member, compare); } --- 264,268 ---- compare_members_t<T, R, Compare> compare_members(R T::* member, Compare compare) { ! return compare_members_t<T, R, Compare>(member, compare); } *************** *** 270,284 **** /* REVISIT (sparent) : ! This work is to be part of table indexes. A table index is a container of pointers to ! objects with a transformation. ! ! Getting to the key in a table is an indirect transformation ! Getting to a row in a table is an indirection ! ! Note indirection is a transformation - so it is two levels of transformation. ! ! To sort a table by the key I want to be able to do: ! ! adobe::sort(index.base(), index.transform_compare()); */ --- 270,284 ---- /* REVISIT (sparent) : ! This work is to be part of table indexes. A table index is a container of pointers to ! objects with a transformation. ! ! Getting to the key in a table is an indirect transformation ! Getting to a row in a table is an indirection ! ! Note indirection is a transformation - so it is two levels of transformation. ! ! To sort a table by the key I want to be able to do: ! ! adobe::sort(index.base(), index.transform_compare()); */ *************** *** 288,303 **** struct transform_member_t : std::unary_function<T, R&> { ! explicit transform_member_t(R T::* member) : ! member_m(member) ! { } ! ! R& operator () (T& x) const ! { return x.*member_m; } ! ! const R& operator () (const T& x) const ! { return x.*member_m; } private: ! R T::* member_m; }; --- 288,303 ---- struct transform_member_t : std::unary_function<T, R&> { ! explicit transform_member_t(R T::* member) : ! member_m(member) ! { } ! ! R& operator () (T& x) const ! { return x.*member_m; } ! ! const R& operator () (const T& x) const ! { return x.*member_m; } private: ! R T::* member_m; }; *************** *** 305,309 **** transform_member_t<T, R> make_transform(R T::* member) { ! return transform_member_t<T, R>(member); } --- 305,309 ---- transform_member_t<T, R> make_transform(R T::* member) { ! return transform_member_t<T, R>(member); } *************** *** 313,321 **** struct indirect_t : std::unary_function<Pointer, Reference> { ! Reference& operator () (Pointer& x) const ! { return *x; } ! const Reference& operator () (const Pointer& x) const ! { return *x; } }; --- 313,321 ---- struct indirect_t : std::unary_function<Pointer, Reference> { ! Reference& operator () (Pointer& x) const ! { return *x; } ! const Reference& operator () (const Pointer& x) const ! { return *x; } }; *************** *** 324,330 **** template <class T> struct bitwise_or ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x | y;} }; --- 324,330 ---- template <class T> struct bitwise_or ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x | y;} }; *************** *** 333,339 **** template <class T> struct bitwise_and ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x & y;} }; --- 333,339 ---- template <class T> struct bitwise_and ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x & y;} }; *************** *** 342,348 **** template <class T> struct bitwise_xor ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x ^ y;} }; --- 342,348 ---- template <class T> struct bitwise_xor ! : std::binary_function<T, T, T> { ! T operator()(const T& x, const T& y) const {return x ^ y;} }; Index: md5.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/md5.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** md5.hpp 6 Jan 2006 18:02:35 -0000 1.5 --- md5.hpp 3 Feb 2006 18:33:35 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 Adobe Systems Incorporated and others ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated and others ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 20,26 **** /* ! Relevant copyright information is provided below and may not be removed from this file. ! Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. */ --- 20,26 ---- /* ! Relevant copyright information is provided below and may not be removed from this file. ! Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. */ *************** *** 28,52 **** /* ! MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm ! Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights ! reserved. ! License to copy and use this software is granted provided that it is ! identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in ! all material mentioning or referencing this software or this function. ! License is also granted to make and use derivative works provided that such ! works are identified as "derived from the RSA Data Security, Inc. MD5 ! Message-Digest Algorithm" in all material mentioning or referencing the ! derived work. ! ! RSA Data Security, Inc. makes no representations concerning either the ! merchantability of this software or the suitability of this software for ! any particular purpose. It is provided "as is" without express or implied ! warranty of any kind. ! ! These notices must be retained in any copies of any part of this ! documentation and/or software. */ --- 28,52 ---- /* ! MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm ! Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights ! reserved. ! License to copy and use this software is granted provided that it is ! identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in ! all material mentioning or referencing this software or this function. ! License is also granted to make and use derivative works provided that such ! works are identified as "derived from the RSA Data Security, Inc. MD5 ! Message-Digest Algorithm" in all material mentioning or referencing the ! derived work. ! ! RSA Data Security, Inc. makes no representations concerning either the ! merchantability of this software or the suitability of this software for ! any particular purpose. It is provided "as is" without express or implied ! warranty of any kind. ! ! These notices must be retained in any copies of any part of this ! documentation and/or software. */ *************** *** 60,77 **** { public: ! typedef boost::array<boost::uint8_t, 16> digest_t; ! md5_t(); ! void update(void* input_block, std::size_t input_length); ! digest_t final(); private: ! void reset(); ! boost::uint32_t state_m[4]; /* state (ABCD) */ ! boost::uint32_t count_m[2]; /* number of bits, modulo 2^64 (lsb first) */ ! boost::uint8_t buffer_m[64]; /* input buffer */ }; --- 60,77 ---- { public: ! typedef boost::array<boost::uint8_t, 16> digest_t; ! md5_t(); ! void update(void* input_block, std::size_t input_length); ! digest_t final(); private: ! void reset(); ! boost::uint32_t state_m[4]; /* state (ABCD) */ ! boost::uint32_t count_m[2]; /* number of bits, modulo 2^64 (lsb first) */ ! boost::uint8_t buffer_m[64]; /* input buffer */ }; *************** *** 80,88 **** inline md5_t::digest_t md5(void* input_block, std::size_t input_length) { ! md5_t m; ! m.update(input_block, input_length); ! return m.final(); } --- 80,88 ---- inline md5_t::digest_t md5(void* input_block, std::size_t input_length) { ! md5_t m; ! m.update(input_block, input_length); ! return m.final(); } Index: conversion.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/conversion.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** conversion.hpp 6 Jan 2006 18:02:35 -0000 1.3 --- conversion.hpp 3 Feb 2006 18:33:35 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 21,34 **** struct promote { ! typedef T type; }; ! template <> struct promote<short> { typedef double type; }; ! template <> struct promote<unsigned short> { typedef double type; }; ! template <> struct promote<int> { typedef double type; }; ! template <> struct promote<unsigned int> { typedef double type; }; ! template <> struct promote<long> { typedef double type; }; ! template <> struct promote<unsigned long> { typedef double type; }; ! template <> struct promote<float> { typedef double type; }; /*************************************************************************************************/ --- 21,34 ---- struct promote { ! typedef T type; }; ! template <> struct promote<short> { typedef double type; }; ! template <> struct promote<unsigned short> { typedef double type; }; ! template <> struct promote<int> { typedef double type; }; ! template <> struct promote<unsigned int> { typedef double type; }; ! template <> struct promote<long> { typedef double type; }; ! template <> struct promote<unsigned long> { typedef double type; }; ! template <> struct promote<float> { typedef double type; }; /*************************************************************************************************/ *************** *** 36,40 **** template <typename lht, typename rht> inline lht explicit_cast(const rht& rhs) ! { return static_cast<lht>(rhs); } /*************************************************************************************************/ --- 36,40 ---- template <typename lht, typename rht> inline lht explicit_cast(const rht& rhs) ! { return static_cast<lht>(rhs); } /*************************************************************************************************/ *************** *** 42,46 **** template <typename T> inline T& remove_const(const T& x) ! { return const_cast<T&>(x); } /*************************************************************************************************/ --- 42,46 ---- template <typename T> inline T& remove_const(const T& x) ! { return const_cast<T&>(x); } /*************************************************************************************************/ Index: unicode.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/unicode.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** unicode.hpp 6 Jan 2006 18:02:35 -0000 1.8 --- unicode.hpp 3 Feb 2006 18:33:35 -0000 1.9 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 75,108 **** // REVISIT (fbrereto) : I don't need to INIT_ONCE these, do I? ! const unsigned char to_utf32_pivot_1_k(128); ! const unsigned char to_utf32_pivot_2_k(192); ! const unsigned char to_utf32_pivot_3_k(224); ! const unsigned char to_utf32_pivot_4_k(240); ! const unsigned char to_utf32_pivot_5_k(248); ! const unsigned char to_utf32_pivot_6_k(252); ! const unsigned char to_utf32_pivot_7_k(254); ! const boost::uint32_t to_utf8_pivot_1_k(1UL << 7); ! const boost::uint32_t to_utf8_pivot_2_k(1UL << 11); ! const boost::uint32_t to_utf8_pivot_3_k(1UL << 16); ! const boost::uint32_t to_utf8_pivot_4_k(1UL << 21); ! const boost::uint32_t to_utf8_pivot_5_k(1UL << 26); ! const boost::uint16_t to_utf16_surrogate_pivot_k(65535); ! const boost::uint16_t utf16_high_surrogate_front_k(0xd800); ! const boost::uint16_t utf16_high_surrogate_back_k(0xdbff); ! const boost::uint16_t utf16_low_surrogate_front_k(0xdc00); ! const boost::uint16_t utf16_low_surrogate_back_k(0xdfff); /*************************************************************************************************/ ! template <std::size_t NumBytes> struct utf8_header_t { }; ! template <> struct utf8_header_t<0> { enum { value = char(0x80) }; }; // nonheader ! //template <> struct utf8_header_t<1> { enum { value = char(0x00) }; }; // illegal ! template <> struct utf8_header_t<2> { enum { value = char(0xC0) }; }; ! template <> struct utf8_header_t<3> { enum { value = char(0xE0) }; }; ! template <> struct utf8_header_t<4> { enum { value = char(0xF0) }; }; ! template <> struct utf8_header_t<5> { enum { value = char(0xF8) }; }; ! template <> struct utf8_header_t<6> { enum { value = char(0xFC) }; }; /*************************************************************************************************/ --- 75,108 ---- // REVISIT (fbrereto) : I don't need to INIT_ONCE these, do I? ! const unsigned char to_utf32_pivot_1_k(128); ! const unsigned char to_utf32_pivot_2_k(192); ! const unsigned char to_utf32_pivot_3_k(224); ! const unsigned char to_utf32_pivot_4_k(240); ! const unsigned char to_utf32_pivot_5_k(248); ! const unsigned char to_utf32_pivot_6_k(252); ! const unsigned char to_utf32_pivot_7_k(254); ! const boost::uint32_t to_utf8_pivot_1_k(1UL << 7); ! const boost::uint32_t to_utf8_pivot_2_k(1UL << 11); ! const boost::uint32_t to_utf8_pivot_3_k(1UL << 16); ! const boost::uint32_t to_utf8_pivot_4_k(1UL << 21); ! const boost::uint32_t to_utf8_pivot_5_k(1UL << 26); ! const boost::uint16_t to_utf16_surrogate_pivot_k(65535); ! const boost::uint16_t utf16_high_surrogate_front_k(0xd800); ! const boost::uint16_t utf16_high_surrogate_back_k(0xdbff); ! const boost::uint16_t utf16_low_surrogate_front_k(0xdc00); ! const boost::uint16_t utf16_low_surrogate_back_k(0xdfff); /*************************************************************************************************/ ! template <std::size_t NumBytes> struct utf8_header_t { }; ! template <> struct utf8_header_t<0> { enum { value = char(0x80) }; }; // nonheader ! //template <> struct utf8_header_t<1> { enum { value = char(0x00) }; }; // illegal ! template <> struct utf8_header_t<2> { enum { value = char(0xC0) }; }; ! template <> struct utf8_header_t<3> { enum { value = char(0xE0) }; }; ! template <> struct utf8_header_t<4> { enum { value = char(0xF0) }; }; ! template <> struct utf8_header_t<5> { enum { value = char(0xF8) }; }; ! template <> struct utf8_header_t<6> { enum { value = char(0xFC) }; }; /*************************************************************************************************/ *************** *** 157,169 **** struct demotion_engine_t { ! template <typename OutputIterator> ! inline OutputIterator operator () (boost::uint32_t code, OutputIterator i) ! { ! *i = utf8_add_mask<ByteCount, Header>(demote_fragment<ByteCount>(code)); ! ++i; ! return demotion_engine_t<ByteCount - 1, false>()(code, i); ! } }; --- 157,169 ---- struct demotion_engine_t { ! template <typename OutputIterator> ! inline OutputIterator operator () (boost::uint32_t code, OutputIterator i) ! { ! *i = utf8_add_mask<ByteCount, Header>(demote_fragment<ByteCount>(code)); ! ++i; ! return demotion_engine_t<ByteCount - 1, false>()(code, i); ! } }; *************** *** 171,181 **** struct demotion_engine_t<1, false> { ! template <typename OutputIterator> ! inline OutputIterator operator () (boost::uint32_t code, OutputIterator i) ! { ! *i = utf8_add_mask<0, false>(demote_fragment<1>(code)); ! return ++i; ! } }; --- 171,181 ---- struct demotion_engine_t<1, false> { ! template <typename OutputIterator> ! inline OutputIterator operator () (boost::uint32_t code, OutputIterator i) ! { ! *i = utf8_add_mask<0, false>(demote_fragment<1>(code)); ! return ++i; ! } }; *************** *** 185,206 **** struct promotion_engine_t { ! template <typename InputIterator> ! inline boost::uint32_t operator () (InputIterator& first, InputIterator last) ! { ! /* ! CodeWarrior 9.4 doesn't like this code composited into one line; ! GCC doesn't seem to have a problem. ! */ ! char n(*first); ! char stripped(utf8_strip_mask<ByteCount, Header>(n)); ! boost::uint32_t shifted(promote_fragment<ByteCount>(stripped)); ! ++first; ! if (first == last) throw std::runtime_error("unicode: utf32 conversion ran out of input"); ! return shifted | promotion_engine_t<ByteCount - 1, false>()(first, last); ! } }; --- 185,206 ---- struct promotion_engine_t { ! template <typename InputIterator> ! inline boost::uint32_t operator () (InputIterator& first, InputIterator last) ! { ! /* ! CodeWarrior 9.4 doesn't like this code composited into one line; ! GCC doesn't seem to have a problem. ! */ ! char n(*first); ! char stripped(utf8_strip_mask<ByteCount, Header>(n)); ! boost::uint32_t shifted(promote_fragment<ByteCount>(stripped)); ! ++first; ! if (first == last) throw std::runtime_error("unicode: utf32 conversion ran out of input"); ! return shifted | promotion_engine_t<ByteCount - 1, false>()(first, last); ! } }; *************** *** 208,220 **** struct promotion_engine_t<1, false> { ! template <typename InputIterator> ! inline boost::uint32_t operator () (InputIterator& first, InputIterator) ! { ! boost::uint32_t result(promote_fragment<1>(utf8_strip_mask<0, false>(*first))); ! ++first; ! return result; ! } }; --- 208,220 ---- struct promotion_engine_t<1, false> { ! template <typename InputIterator> ! inline boost::uint32_t operator () (InputIterator& first, InputIterator) ! { ! boost::uint32_t result(promote_fragment<1>(utf8_strip_mask<0, false>(*first))); ! ++first; ! return result; ! } }; *************** *** 223,257 **** template <typename InputIterator, typename DestInteger> typename boost::enable_if<is_utf16_iterator_type<InputIterator>, InputIterator>::type ! to_utf32 (InputIterator first, InputIterator last, DestInteger& result) { ! boost::uint16_t code(static_cast<boost::uint16_t>(*first)); ! ++first; ! if (code >= implementation::utf16_high_surrogate_front_k && ! code <= implementation::utf16_high_surrogate_back_k) ! { ! result = 0; ! if (first == last) ! throw std::runtime_error("unicode: utf16 high surrogate found without low surrogate"); ! boost::uint16_t low(static_cast<boost::uint16_t>(*first)); ! assert (low >= implementation::utf16_low_surrogate_front_k && ! low <= implementation::utf16_low_surrogate_back_k); ! ++first; ! result = (code - implementation::utf16_high_surrogate_front_k) * 0x400 + ! (low - implementation::utf16_low_surrogate_front_k) + 0x10000; ! } ! else if ( code >= implementation::utf16_low_surrogate_front_k && ! code <= implementation::utf16_low_surrogate_back_k) ! { throw std::runtime_error("unicode: utf16 low surrogate found without high surrogate"); } ! else ! { result = static_cast<DestInteger>(code); } ! return first; } --- 223,257 ---- template <typename InputIterator, typename DestInteger> typename boost::enable_if<is_utf16_iterator_type<InputIterator>, InputIterator>::type ! to_utf32 (InputIterator first, InputIterator last, DestInteger& result) { ! boost::uint16_t code(static_cast<boost::uint16_t>(*first)); ! ++first; ! if (code >= implementation::utf16_high_surrogate_front_k && ! code <= implementation::utf16_high_surrogate_back_k) ! { ! result = 0; ! if (first == last) ! throw std::runtime_error("unicode: utf16 high surrogate found without low surrogate"); ! boost::uint16_t low(static_cast<boost::uint16_t>(*first)); ! assert (low >= implementation::utf16_low_surrogate_front_k && ! low <= implementation::utf16_low_surrogate_back_k); ! ++first; ! result = (code - implementation::utf16_high_surrogate_front_k) * 0x400 + ! (low - implementation::utf16_low_surrogate_front_k) + 0x10000; ! } ! else if ( code >= implementation::utf16_low_surrogate_front_k && ! code <= implementation::utf16_low_surrogate_back_k) ! { throw std::runtime_error("unicode: utf16 low surrogate found without high surrogate"); } ! else ! { result = static_cast<DestInteger>(code); } ! return first; } *************** *** 260,285 **** template <typename InputIterator, typename DestInteger> typename boost::enable_if<is_utf8_iterator_type<InputIterator>, InputIterator>::type ! to_utf32 (InputIterator first, InputIterator last, DestInteger& result) { ! unsigned char n(static_cast<unsigned char>(*first)); ! if (n < implementation::to_utf32_pivot_1_k) ! { r... [truncated message content] |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/begin/examples Modified Files: alignment_test.adm alignment_test.eve big_popup.adm big_popup.eve checkbox_control.adm checkbox_control.eve checkbox_radio_button_suite.adm checkbox_radio_button_suite.eve cycle_test.adm cycle_test.eve e01_clipping_path.adm e01_clipping_path.eve edit_text_suite.adm edit_text_suite.eve find_and_replace.adm find_and_replace.eve find_and_replace_options.eve grow.adm grow.eve image_size.adm image_size.eve image_size_auto.eve inequality.adm inequality.eve list_box_emulator.adm list_box_emulator.eve mini_image_size.adm mini_image_size.eve mini_image_size_2.eve named_function_suite.adm named_function_suite.eve nested_group.adm nested_group.eve optional_panel.adm optional_panel.eve overconstrain.adm overconstrain.eve progress_bar_suite.adm progress_bar_suite.eve slider_suite.adm slider_suite.eve sort_lines.adm sort_lines.eve tabs_and_panels.adm tabs_and_panels.eve video.adm video.eve Added Files: empty_containers.adm empty_containers.eve empty_dialog.adm empty_dialog.eve Log Message: asl 1.0.13 Index: checkbox_radio_button_suite.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/checkbox_radio_button_suite.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** checkbox_radio_button_suite.eve 24 Jan 2006 19:38:50 -0000 1.3 --- checkbox_radio_button_suite.eve 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,57 **** /* ! Copyright 2005-2006 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) */ layout checkbox_radio_button_suite { ! view dialog(name: "Checkbox & Radio Button Suite") ! { ! row(child_horizontal: align_fill) ! { ! column() ! { ! group(placement: place_row, name: "Horizontal Checkboxes", child_horizontal: align_fill) ! { ! checkbox(name: "Checkbox A", bind: @checkbox_1); ! checkbox(name: "Checkbox B", bind: @checkbox_2); ! checkbox(name: "Checkbox C", bind: @checkbox_3); ! checkbox(bind: @checkbox_empty); ! } ! group(placement: place_row, name: "Vertical Checkboxes & Radio Buttons", horizontal: align_fill, child_horizontal: align_fill) ! { ! column(vertical: align_top, guide_mask: []) ! { ! checkbox(name: "Checkbox A", bind: @checkbox_1); ! checkbox(name: "Checkbox B", bind: @checkbox_2); ! checkbox(name: "Checkbox C", bind: @checkbox_3); ! checkbox(bind: @checkbox_empty); ! } ! column(vertical: align_top, guide_mask: []) ! { ! radio_button(name: "Radio Button A", bind: @radio_button_1, value: @a); ! radio_button(name: "Radio Button B", bind: @radio_button_1, value: @b); ! radio_button(name: "Radio Button C", bind: @radio_button_1, value: @c); ! radio_button(bind: @radio_button_1, value: @none); ! } ! } ! group(placement: place_row, name: "Horizontal Radio Buttons", child_horizontal: align_fill) ! { ! radio_button(name: "Radio Button A", bind: @radio_button_1, value: @a); ! radio_button(name: "Radio Button B", bind: @radio_button_1, value: @b); ! radio_button(name: "Radio Button C", bind: @radio_button_1, value: @c); ! radio_button(bind: @radio_button_1, value: @none); ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } ! } } --- 1,57 ---- /* ! Copyright 2005-2006 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) */ layout checkbox_radio_button_suite { ! view dialog(name: "Checkbox & Radio Button Suite") ! { ! row(child_horizontal: align_fill) ! { ! column() ! { ! group(placement: place_row, name: "Horizontal Checkboxes", child_horizontal: align_fill) ! { ! checkbox(name: "Checkbox A", bind: @checkbox_1); ! checkbox(name: "Checkbox B", bind: @checkbox_2); ! checkbox(name: "Checkbox C", bind: @checkbox_3); ! checkbox(bind: @checkbox_empty); ! } ! group(placement: place_row, name: "Vertical Checkboxes & Radio Buttons", horizontal: align_fill, child_horizontal: align_fill) ! { ! column(vertical: align_top, guide_mask: []) ! { ! checkbox(name: "Checkbox A", bind: @checkbox_1); ! checkbox(name: "Checkbox B", bind: @checkbox_2); ! checkbox(name: "Checkbox C", bind: @checkbox_3); ! checkbox(bind: @checkbox_empty); ! } ! column(vertical: align_top, guide_mask: []) ! { ! radio_button(name: "Radio Button A", bind: @radio_button_1, value: @a); ! radio_button(name: "Radio Button B", bind: @radio_button_1, value: @b); ! radio_button(name: "Radio Button C", bind: @radio_button_1, value: @c); ! radio_button(bind: @radio_button_1, value: @none); ! } ! } ! group(placement: place_row, name: "Horizontal Radio Buttons", child_horizontal: align_fill) ! { ! radio_button(name: "Radio Button A", bind: @radio_button_1, value: @a); ! radio_button(name: "Radio Button B", bind: @radio_button_1, value: @b); ! radio_button(name: "Radio Button C", bind: @radio_button_1, value: @c); ! radio_button(bind: @radio_button_1, value: @none); ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } ! } } Index: e01_clipping_path.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/e01_clipping_path.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** e01_clipping_path.eve 24 Jan 2006 19:38:50 -0000 1.3 --- e01_clipping_path.eve 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,23 **** /* ! Copyright 2005-2006 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) */ layout clipping_path { ! view dialog(name: "Clipping Path") ! { ! column(child_horizontal: align_fill) ! { ! popup(name: "Path:", bind: @path, items: ! [ ! { name: "None", value: empty }, ! { name: "Path 1", value: 1 }, ! { name: "Path 2", value: 2 } ! ]); ! edit_number(name: "Flatness:", digits: 9, bind: @flatness); ! } ! button(name: "OK", default: true, bind: @result); ! } } --- 1,23 ---- /* ! Copyright 2005-2006 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) */ layout clipping_path { ! view dialog(name: "Clipping Path") ! { ! column(child_horizontal: align_fill) ! { ! popup(name: "Path:", bind: @path, items: ! [ ! { name: "None", value: empty }, ! { name: "Path 1", value: 1 }, ! { name: "Path 2", value: 2 } ! ]); ! edit_number(name: "Flatness:", digits: 9, bind: @flatness); ! } ! button(name: "OK", default: true, bind: @result); ! } } --- NEW FILE: empty_containers.adm --- /* Copyright 2005-2006 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) */ sheet empty_containers { interface: tab_group_visible: @first; } Index: nested_group.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/nested_group.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nested_group.eve 2 Feb 2006 03:25:10 -0000 1.1 --- nested_group.eve 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,23 **** /* ! Copyright 2006 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ ! dialog(name: "nested group test", placement: place_column) { ! group(name: "group a") ! { ! button(name: "button one"); ! group(name: "group b") ! { ! button(name: "button two"); ! group(name: "group c") ! { ! button(name: "button three"); ! edit_text(name: "text", characters: 10); ! } ! } ! } ! button(name: "Dismiss", action: @cancel, horizontal: align_right); } - --- 1,25 ---- /* ! Copyright 2006 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ ! layout nested_group { ! view dialog(name: "nested group test", placement: place_column) ! { ! group(name: "group a") ! { ! button(name: "button one"); ! group(name: "group b") ! { ! button(name: "button two"); ! group(name: "group c") ! { ! button(name: "button three"); ! edit_text(name: "text", characters: 10); ! } ! } ! } ! button(name: "Dismiss", action: @cancel, horizontal: align_right); ! } } Index: sort_lines.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/sort_lines.eve,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sort_lines.eve 24 Jan 2006 19:38:50 -0000 1.4 --- sort_lines.eve 3 Feb 2006 18:33:38 -0000 1.5 *************** *** 1,80 **** /* ! Copyright 2005-2006 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) ! ANOMALIES WRT ORIGINAL DIALOG: (OD stands for Original Dialog) ! - Popup menu with 0 width for applying values to an Adam field. ! DESIRED BEHAVIORS: ! - We want to be able to disable (i.e., grey-out) static text fields. ! - Disabled edit text fields are still editable and selectable. ! - Disabled edit text fields should have greyed out text. */ layout sort_lines { ! view dialog(name: "Sort Lines", placement: place_column, spacing: 10) ! { ! row(horizontal: align_fill) ! { ! group(name: 'Sorting Options', horizontal: align_fill) ! { ! checkbox(name: 'Numbers Match by Value', bind: @numbers_match_by_value, value: true); ! checkbox(name: 'Ignore Leading White Space', bind: @ignore_leading_white_space, value: true); ! checkbox(name: 'Reverse Sort', bind: @reverse_sort, value: true); ! checkbox(name: 'Use Pattern', bind: @sort_using_pattern, value: true); ! } ! group(name: 'Result Destinations', vertical: align_fill, horizontal: align_fill) ! { ! checkbox(name: 'Clipboard', bind: @lines_to_clipboard, value: true); ! checkbox(name: 'New Document', bind: @lines_to_new_doc, value: true); ! checkbox(name: 'Replace Selection', bind: @lines_replace_selection, value: true); ! } ! } ! group(name: 'Pattern Options', placement: place_column, horizontal: align_fill) ! { ! row(horizontal: align_fill) ! { ! static_text(name: 'Search Pattern:'); ! popup( name: ' ', popup_bind: @search_pattern, popup_placement: @down, ! items: [ ! { name: 'Add...', value: @pattern_add }, ! { name: '-', value: @pattern_separator }, ! { name: 'Pascal Comment to C Comment', value: @pattern_p_to_c }, ! { name: 'C++ Comment to C Comment', value: @pattern_cpp_to_c }, ! { name: 'Run of Spaces to One Tab', value: @pattern_spaces_to_tab }, ! { name: 'C Function Header', value: @pattern_c_header }, ! { name: 'C Comment to Pascal Comment', value: @pattern_pascal_to_c }, ! { name: 'Shift Variables Right', value: @pattern_var_right }, ! { name: 'Lower Case SRC values in IMG tags', value: @pattern_img_tag_process }, ! { name: 'Lower Case HREF values in A tags', value: @pattern_a_tag_process }, ! { name: 'Column #2', value: @pattern_column_2 } ! ]); ! column(horizontal: align_fill) ! { ! edit_text(bind: @search_string, horizontal: align_fill, characters: 40); ! checkbox(name: 'Case Sensitive', bind: @case_sensitive, value: true); ! } ! } ! row(horizontal: align_fill) ! { ! static_text(name: 'Sort Using:'); ! column(horizontal: align_fill) ! { ! radio_button(name: 'Entire Search Pattern', bind: @sort_using, value: @entire_search_pattern); ! radio_button(name: 'All Sub-Patterns (\1\2...\N)', bind: @sort_using, value: @all_subpatterns); ! radio_button(name: 'Specific Sub-Patterns:', bind: @sort_using, value: @subpattern); ! edit_text(bind: @subpattern_expression, horizontal: align_fill); ! } ! } ! } ! row(horizontal: align_fill) ! { ! button(name: "Don't Sort", action: @cancel); ! button(name: "Cancel", cancel: true, action: @cancel, horizontal: align_right); ! button(name: "Sort", default: true, horizontal: align_right); ! } ! } } --- 1,80 ---- /* ! Copyright 2005-2006 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) ! ANOMALIES WRT ORIGINAL DIALOG: (OD stands for Original Dialog) ! - Popup menu with 0 width for applying values to an Adam field. ! DESIRED BEHAVIORS: ! - We want to be able to disable (i.e., grey-out) static text fields. ! - Disabled edit text fields are still editable and selectable. ! - Disabled edit text fields should have greyed out text. */ layout sort_lines { ! view dialog(name: "Sort Lines", placement: place_column, spacing: 10) ! { ! row(horizontal: align_fill) ! { ! group(name: 'Sorting Options', horizontal: align_fill) ! { ! checkbox(name: 'Numbers Match by Value', bind: @numbers_match_by_value, value: true); ! checkbox(name: 'Ignore Leading White Space', bind: @ignore_leading_white_space, value: true); ! checkbox(name: 'Reverse Sort', bind: @reverse_sort, value: true); ! checkbox(name: 'Use Pattern', bind: @sort_using_pattern, value: true); ! } ! group(name: 'Result Destinations', vertical: align_fill, horizontal: align_fill) ! { ! checkbox(name: 'Clipboard', bind: @lines_to_clipboard, value: true); ! checkbox(name: 'New Document', bind: @lines_to_new_doc, value: true); ! checkbox(name: 'Replace Selection', bind: @lines_replace_selection, value: true); ! } ! } ! group(name: 'Pattern Options', placement: place_column, horizontal: align_fill) ! { ! row(horizontal: align_fill) ! { ! static_text(name: 'Search Pattern:'); ! popup( name: ' ', popup_bind: @search_pattern, popup_placement: @down, ! items: [ ! { name: 'Add...', value: @pattern_add }, ! { name: '-', value: @pattern_separator }, ! { name: 'Pascal Comment to C Comment', value: @pattern_p_to_c }, ! { name: 'C++ Comment to C Comment', value: @pattern_cpp_to_c }, ! { name: 'Run of Spaces to One Tab', value: @pattern_spaces_to_tab }, ! { name: 'C Function Header', value: @pattern_c_header }, ! { name: 'C Comment to Pascal Comment', value: @pattern_pascal_to_c }, ! { name: 'Shift Variables Right', value: @pattern_var_right }, ! { name: 'Lower Case SRC values in IMG tags', value: @pattern_img_tag_process }, ! { name: 'Lower Case HREF values in A tags', value: @pattern_a_tag_process }, ! { name: 'Column #2', value: @pattern_column_2 } ! ]); ! column(horizontal: align_fill) ! { ! edit_text(bind: @search_string, horizontal: align_fill, characters: 40); ! checkbox(name: 'Case Sensitive', bind: @case_sensitive, value: true); ! } ! } ! row(horizontal: align_fill) ! { ! static_text(name: 'Sort Using:'); ! column(horizontal: align_fill) ! { ! radio_button(name: 'Entire Search Pattern', bind: @sort_using, value: @entire_search_pattern); ! radio_button(name: 'All Sub-Patterns (\1\2...\N)', bind: @sort_using, value: @all_subpatterns); ! radio_button(name: 'Specific Sub-Patterns:', bind: @sort_using, value: @subpattern); ! edit_text(bind: @subpattern_expression, horizontal: align_fill); ! } ! } ! } ! row(horizontal: align_fill) ! { ! button(name: "Don't Sort", action: @cancel); ! button(name: "Cancel", cancel: true, action: @cancel, horizontal: align_right); ! button(name: "Sort", default: true, horizontal: align_right); ! } ! } } Index: grow.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/grow.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** grow.adm 24 Jan 2006 19:38:50 -0000 1.1 --- grow.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,11 **** { output: ! done <== "Hello World Completed!"; } --- 8,11 ---- { output: ! done <== "Hello World Completed!"; } Index: mini_image_size.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/mini_image_size.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mini_image_size.eve 24 Jan 2006 19:38:50 -0000 1.1 --- mini_image_size.eve 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,41 **** { interface: ! percent: false; ! ! view dialog (name: "Mini Image Size") ! { ! column() ! { ! overlay() ! { ! panel(bind: @percent, value: true) ! { ! edit_number(name: "Height:", bind: @height_percent, digits: 7, format: "#.00"); ! edit_number(name: "Width:", bind: @width_percent, digits: 7, format: "#.00"); ! } ! panel(bind: @percent, value: false) ! { ! edit_number(name: "Height:", bind: @height_pixels, digits: 7, format: "#"); ! edit_number(name: "Width:", bind: @width_pixels, digits: 7, format: "#"); ! } ! } ! checkbox(name: "Constrain Proportions", bind: @constrain); ! checkbox(name: "Percent", bind: @percent); ! } ! column() ! { ! button(name: "OK", bind: @result, action: @ok, default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } } --- 8,41 ---- { interface: ! percent: false; ! ! view dialog (name: "Mini Image Size") ! { ! column() ! { ! overlay() ! { ! panel(bind: @percent, value: true) ! { ! edit_number(name: "Height:", bind: @height_percent, digits: 7, format: "#.00"); ! edit_number(name: "Width:", bind: @width_percent, digits: 7, format: "#.00"); ! } ! panel(bind: @percent, value: false) ! { ! edit_number(name: "Height:", bind: @height_pixels, digits: 7, format: "#"); ! edit_number(name: "Width:", bind: @width_pixels, digits: 7, format: "#"); ! } ! } ! checkbox(name: "Constrain Proportions", bind: @constrain); ! checkbox(name: "Percent", bind: @percent); ! } ! column() ! { ! button(name: "OK", bind: @result, action: @ok, default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } } Index: list_box_emulator.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/list_box_emulator.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** list_box_emulator.eve 24 Jan 2006 19:38:50 -0000 1.3 --- list_box_emulator.eve 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,33 **** /* ! Copyright 2005-2006 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) */ layout list_box_emulator { ! view dialog(name: "List Box Emulator", placement: place_column) ! { ! row() ! { ! group(name: 'Selected Item', spacing: 10, child_horizontal: align_fill, vertical: align_fill) ! { ! radio_button(name: "Item 1", bind: @selection, value: @item_1); ! radio_button(name: "Item 2", bind: @selection, value: @item_2); ! radio_button(name: "Item 3", bind: @selection, value: @item_3); ! radio_button(name: "(no item)", bind: @selection, value: @item_end); ! } ! group(name: 'List commands', spacing: 10, child_horizontal: align_fill, vertical: align_fill) ! { ! button(name: "Add Item", action: @ok, bind: @add_params); ! button(name: "Insert Item", action: @ok, bind: @insert_params); ! button(name: "Delete Item", action: @ok, bind: @delete_params); ! } ! } ! ! row(horizontal: align_right) ! { ! button(name: "Cancel", cancel: true, action: @cancel); ! } ! } } --- 1,33 ---- /* ! Copyright 2005-2006 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) */ layout list_box_emulator { ! view dialog(name: "List Box Emulator", placement: place_column) ! { ! row() ! { ! group(name: 'Selected Item', spacing: 10, child_horizontal: align_fill, vertical: align_fill) ! { ! radio_button(name: "Item 1", bind: @selection, value: @item_1); ! radio_button(name: "Item 2", bind: @selection, value: @item_2); ! radio_button(name: "Item 3", bind: @selection, value: @item_3); ! radio_button(name: "(no item)", bind: @selection, value: @item_end); ! } ! group(name: 'List commands', spacing: 10, child_horizontal: align_fill, vertical: align_fill) ! { ! button(name: "Add Item", action: @ok, bind: @add_params); ! button(name: "Insert Item", action: @ok, bind: @insert_params); ! button(name: "Delete Item", action: @ok, bind: @delete_params); ! } ! } ! ! row(horizontal: align_right) ! { ! button(name: "Cancel", cancel: true, action: @cancel); ! } ! } } Index: mini_image_size_2.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/mini_image_size_2.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mini_image_size_2.eve 24 Jan 2006 19:38:50 -0000 1.1 --- mini_image_size_2.eve 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,32 **** /* ! Copyright 2005-2006 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) */ layout mini_image_size { ! view dialog (name: "Mini Image Size") ! { ! column() ! { ! edit_number(name: "Height:", digits: 7, ! units: [ { name: "pixels", bind: @height_pixels, format: "#" }, ! { name: "percent", bind: @height_percent, format: "#.00" } ]); ! ! edit_number(name: "Width:", digits: 7, ! units: [ { name: "pixels", bind: @width_pixels, format: "#" }, ! { name: "percent", bind: @width_percent, format: "#.00" } ]); ! checkbox(name: "Constrain Proportions", bind: @constrain); ! } ! column() ! { ! button(name: "OK", action: @ok, default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } } --- 1,32 ---- /* ! Copyright 2005-2006 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) */ layout mini_image_size { ! view dialog (name: "Mini Image Size") ! { ! column() ! { ! edit_number(name: "Height:", digits: 7, ! units: [ { name: "pixels", bind: @height_pixels, format: "#" }, ! { name: "percent", bind: @height_percent, format: "#.00" } ]); ! ! edit_number(name: "Width:", digits: 7, ! units: [ { name: "pixels", bind: @width_pixels, format: "#" }, ! { name: "percent", bind: @width_percent, format: "#.00" } ]); ! checkbox(name: "Constrain Proportions", bind: @constrain); ! } ! column() ! { ! button(name: "OK", action: @ok, default: true); ! button( items: [ ! { name: "Cancel", action: @cancel }, ! { name: "Reset", action: @reset, modifiers: @opt } ! ]); ! } ! } } Index: sort_lines.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/sort_lines.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sort_lines.adm 6 Jan 2006 18:03:01 -0000 1.2 --- sort_lines.adm 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,23 **** { interface: ! numbers_match_by_value : false; ! ignore_leading_white_space : false; ! reverse_sort : false; ! lines_to_clipboard : false; ! lines_to_new_doc : false; ! lines_replace_selection : false; ! sort_using_pattern : false; ! unlink search_pattern : empty <== sort_using_pattern ? search_pattern : empty; ! unlink search_string : "Search String" <== sort_using_pattern ? search_string : "Search String"; ! unlink case_sensitive : false <== sort_using_pattern ? case_sensitive : false; ! unlink sort_using : @entire_search_pattern <== sort_using_pattern ? sort_using : empty; ! unlink subpattern_expression : "Matching Expression" <== sort_using == @subpattern ? subpattern_expression : "not applicable"; } --- 8,23 ---- { interface: ! numbers_match_by_value : false; ! ignore_leading_white_space : false; ! reverse_sort : false; ! lines_to_clipboard : false; ! lines_to_new_doc : false; ! lines_replace_selection : false; ! sort_using_pattern : false; ! unlink search_pattern : empty <== sort_using_pattern ? search_pattern : empty; ! unlink search_string : "Search String" <== sort_using_pattern ? search_string : "Search String"; ! unlink case_sensitive : false <== sort_using_pattern ? case_sensitive : false; ! unlink sort_using : @entire_search_pattern <== sort_using_pattern ? sort_using : empty; ! unlink subpattern_expression : "Matching Expression" <== sort_using == @subpattern ? subpattern_expression : "not applicable"; } Index: progress_bar_suite.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/progress_bar_suite.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** progress_bar_suite.eve 24 Jan 2006 19:38:50 -0000 1.3 --- progress_bar_suite.eve 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,46 **** /* ! Copyright 2005-2006 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) */ layout progress_bar_suite { ! view dialog(name: "Progress Bar Suite") ! { ! row(child_horizontal: align_fill) ! { ! column(child_horizontal: align_fill) ! { ! group(placement: place_column, name: "Change me!", child_horizontal: align_fill) ! { ! edit_number(name: "Value:", bind: @progress_value, digits: 3, format: "#"); ! slider(bind: @progress_value, format: {first: 0, last: 100, interval: 1}); ! } ! row() ! { ! group(placement: place_row, name: "Vert.", child_horizontal: align_fill) ! { ! progress_bar(bind: @progress_value, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); ! /*progress_bar(bind: @progress_value, orientation: @vertical, is_relevance: true, format: {first: 0, last: 100, interval: 1});*/ ! progress_bar(bind: @progress_value, orientation: @vertical, is_indeterminate: true); ! } ! group(placement: place_column, name: "Horiz.", vertical: align_fill, child_horizontal: align_fill) ! { ! progress_bar(bind: @progress_value, format: {first: 0, last: 100, interval: 1}); ! /*progress_bar(bind: @progress_value, is_relevance: true, format: {first: 0, last: 100, interval: 1});*/ ! progress_bar(bind: @progress_value, is_indeterminate: true); ! } ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true); ! button( items: [ ! {name: "Cancel", action: @cancel}, ! {name: "Reset", action: @reset, modifiers: @opt} ! ]); ! } ! } ! } } --- 1,46 ---- /* ! Copyright 2005-2006 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) */ layout progress_bar_suite { ! view dialog(name: "Progress Bar Suite") ! { ! row(child_horizontal: align_fill) ! { ! column(child_horizontal: align_fill) ! { ! group(placement: place_column, name: "Change me!", child_horizontal: align_fill) ! { ! edit_number(name: "Value:", bind: @progress_value, digits: 3, format: "#"); ! slider(bind: @progress_value, format: {first: 0, last: 100, interval: 1}); ! } ! row() ! { ! group(placement: place_row, name: "Vert.", child_horizontal: align_fill) ! { ! progress_bar(bind: @progress_value, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); ! /*progress_bar(bind: @progress_value, orientation: @vertical, is_relevance: true, format: {first: 0, last: 100, interval: 1});*/ ! progress_bar(bind: @progress_value, orientation: @vertical, is_indeterminate: true); ! } ! group(placement: place_column, name: "Horiz.", vertical: align_fill, child_horizontal: align_fill) ! { ! progress_bar(bind: @progress_value, format: {first: 0, last: 100, interval: 1}); ! /*progress_bar(bind: @progress_value, is_relevance: true, format: {first: 0, last: 100, interval: 1});*/ ! progress_bar(bind: @progress_value, is_indeterminate: true); ! } ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true); ! button( items: [ ! {name: "Cancel", action: @cancel}, ! {name: "Reset", action: @reset, modifiers: @opt} ! ]); ! } ! } ! } } Index: checkbox_radio_button_suite.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/checkbox_radio_button_suite.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** checkbox_radio_button_suite.adm 6 Jan 2006 18:03:01 -0000 1.2 --- checkbox_radio_button_suite.adm 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,15 **** { interface: ! checkbox_1 : false; ! checkbox_2 : false; ! checkbox_3 : false; ! checkbox_empty : false; ! radio_button_1 : @na; } --- 8,15 ---- { interface: ! checkbox_1 : false; ! checkbox_2 : false; ! checkbox_3 : false; ! checkbox_empty : false; ! radio_button_1 : @na; } Index: edit_text_suite.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/edit_text_suite.eve,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** edit_text_suite.eve 24 Jan 2006 19:38:50 -0000 1.4 --- edit_text_suite.eve 3 Feb 2006 18:33:38 -0000 1.5 *************** *** 1,29 **** /* ! Copyright 2005-2006 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) */ layout edit_text_suite { ! view dialog(name: "<xstr id='edit_text_suite_dialog_title'>Edit Text Suite</xstr>") ! { ! row(child_horizontal: align_fill) ! { ! group(placement: place_column, name: "<xstr id='edit_text_suite_dialog_title'>Edit Text Suite</xstr>", child_horizontal: align_fill) ! { ! edit_text(bind: @edit_text_value, characters: 10, name: "<xstr id='et_suite_label'>Label Name:</xstr>"); ! edit_text(bind: @edit_text_value, scrollable: true, characters: 10, lines: 10, name: "<xstr id='et_suite_label'>Label Name:</xstr>"); ! checkbox(bind: @disabled, name: "<xstr id='et_suite_disabled'>Disabled</xstr>"); ! } ! column(child_horizontal: align_fill) ! { ! button(name: "<xstr id='ok'>OK</xstr>", default: true); ! button( items: [ ! { name: "<xstr id='cancel'>Cancel</xstr>", action: @cancel }, ! { name: "<xstr id='reset'>Reset</xstr>", action: @reset, modifiers: @opt } ! ]); ! } ! } ! } } --- 1,29 ---- /* ! Copyright 2005-2006 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) */ layout edit_text_suite { ! view dialog(name: "<xstr id='edit_text_suite_dialog_title'>Edit Text Suite</xstr>") ! { ! row(child_horizontal: align_fill) ! { ! group(placement: place_column, name: "<xstr id='edit_text_suite_dialog_title'>Edit Text Suite</xstr>", child_horizontal: align_fill) ! { ! edit_text(bind: @edit_text_value, characters: 10, name: "<xstr id='et_suite_label'>Label Name:</xstr>"); ! edit_text(bind: @edit_text_value, scrollable: true, characters: 10, lines: 10, name: "<xstr id='et_suite_label'>Label Name:</xstr>"); ! checkbox(bind: @disabled, name: "<xstr id='et_suite_disabled'>Disabled</xstr>"); ! } ! column(child_horizontal: align_fill) ! { ! button(name: "<xstr id='ok'>OK</xstr>", default: true); ! button( items: [ ! { name: "<xstr id='cancel'>Cancel</xstr>", action: @cancel }, ! { name: "<xstr id='reset'>Reset</xstr>", action: @reset, modifiers: @opt } ! ]); ! } ! } ! } } Index: progress_bar_suite.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/progress_bar_suite.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** progress_bar_suite.adm 6 Jan 2006 18:03:01 -0000 1.2 --- progress_bar_suite.adm 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,11 **** { interface: ! progress_value : 0; } --- 8,11 ---- { interface: ! progress_value : 0; } Index: optional_panel.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/optional_panel.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** optional_panel.adm 24 Jan 2006 19:38:50 -0000 1.1 --- optional_panel.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,18 **** { interface: ! mask : false; ! show : false; ! more : true; ! less : false; output: ! result <== true; } --- 8,18 ---- { interface: ! mask : false; ! show : false; ! more : true; ! less : false; output: ! result <== true; } Index: inequality.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/inequality.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inequality.adm 24 Jan 2006 19:38:50 -0000 1.1 --- inequality.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,23 **** { interface: ! value : 42; ! min_value : 0; ! max_value : 100; logic: ! relate { ! value <== min(value, max_value); ! max_value <== max(value, max_value); ! } ! relate { ! value <== max(value, min_value); ! min_value <== min(value, min_value); ! } } --- 8,23 ---- { interface: ! value : 42; ! min_value : 0; ! max_value : 100; logic: ! relate { ! value <== min(value, max_value); ! max_value <== max(value, max_value); ! } ! relate { ! value <== max(value, min_value); ! min_value <== min(value, min_value); ! } } Index: nested_group.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/nested_group.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nested_group.adm 2 Feb 2006 03:25:10 -0000 1.1 --- nested_group.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,10 **** /* ! Copyright 2006 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ sheet pretend { interface: ! foo : "" ; } --- 1,10 ---- /* ! Copyright 2006 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ sheet pretend { interface: ! foo : "" ; } Index: big_popup.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/big_popup.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** big_popup.eve 24 Jan 2006 03:00:42 -0000 1.1 --- big_popup.eve 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,130 **** /* ! Example that puts a lot of items into a popup. ! Copyright 2006 (C) Ralph Thomas (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ ! dialog(name: "Big popup") { ! row() ! { ! popup( name: "Choose:", bind: @selection, items: [ ! { name: "Item #1", value: @a }, ! { name: "Item #2", value: @b }, ! { name: "Item #3", value: @c }, ! { name: "Item #4", value: @d }, ! { name: "Item #5", value: @e }, ! { name: "Item #6", value: @f }, ! { name: "Item #7", value: @h }, ! { name: "Item #8", value: @i }, ! { name: "Item #9", value: @j }, ! { name: "Item #10", value: @k }, ! { name: "Item #11", value: @l }, ! { name: "Item #12", value: @m }, ! { name: "Item #13", value: @n }, ! { name: "Item #14", value: @o }, ! { name: "Item #15", value: @p }, ! { name: "Item #16", value: @q }, ! { name: "Item #17", value: @r }, ! { name: "Item #18", value: @s }, ! { name: "Item #19", value: @t }, ! { name: "Item #20", value: @u }, ! { name: "Item #21", value: @v }, ! { name: "Item #221", value: @w }, ! { name: "Item #231", value: @x }, ! { name: "Item #241", value: @y }, ! { name: "Item #251", value: @z }, ! { name: "Item #261", value: @aa }, ! { name: "Item #271", value: @ab }, ! { name: "Item #281", value: @ac }, ! { name: "Item #291", value: @ad }, ! { name: "Item #301", value: @ae }, ! { name: "Item #31", value: @af }, ! { name: "Item #321", value: @ag }, ! { name: "Item #331", value: @ah }, ! { name: "Item #341", value: @ai }, ! { name: "Item #351", value: @aj }, ! { name: "Item #361", value: @ak }, ! { name: "Item #371", value: @al }, ! { name: "Item #381", value: @am }, ! { name: "Item #391", value: @an }, ! { name: "Item #40", value: @ao }, ! { name: "Item #41", value: @ap }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan }, ! { name: "Item #24231", value: @aao }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan } ! ] ); ! button(name: "<xstr id='ok'>OK</xstr>", action: @ok, bind: @selection); ! } } --- 1,133 ---- /* ! Example that puts a lot of items into a popup. ! Copyright 2006 (C) Ralph Thomas (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ ! layout big_popup { ! view dialog(name: "Big popup") ! { ! row() ! { ! popup( name: "Choose:", bind: @selection, items: [ ! { name: "Item #1", value: @a }, ! { name: "Item #2", value: @b }, ! { name: "Item #3", value: @c }, ! { name: "Item #4", value: @d }, ! { name: "Item #5", value: @e }, ! { name: "Item #6", value: @f }, ! { name: "Item #7", value: @h }, ! { name: "Item #8", value: @i }, ! { name: "Item #9", value: @j }, ! { name: "Item #10", value: @k }, ! { name: "Item #11", value: @l }, ! { name: "Item #12", value: @m }, ! { name: "Item #13", value: @n }, ! { name: "Item #14", value: @o }, ! { name: "Item #15", value: @p }, ! { name: "Item #16", value: @q }, ! { name: "Item #17", value: @r }, ! { name: "Item #18", value: @s }, ! { name: "Item #19", value: @t }, ! { name: "Item #20", value: @u }, ! { name: "Item #21", value: @v }, ! { name: "Item #221", value: @w }, ! { name: "Item #231", value: @x }, ! { name: "Item #241", value: @y }, ! { name: "Item #251", value: @z }, ! { name: "Item #261", value: @aa }, ! { name: "Item #271", value: @ab }, ! { name: "Item #281", value: @ac }, ! { name: "Item #291", value: @ad }, ! { name: "Item #301", value: @ae }, ! { name: "Item #31", value: @af }, ! { name: "Item #321", value: @ag }, ! { name: "Item #331", value: @ah }, ! { name: "Item #341", value: @ai }, ! { name: "Item #351", value: @aj }, ! { name: "Item #361", value: @ak }, ! { name: "Item #371", value: @al }, ! { name: "Item #381", value: @am }, ! { name: "Item #391", value: @an }, ! { name: "Item #40", value: @ao }, ! { name: "Item #41", value: @ap }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan }, ! { name: "Item #24231", value: @aao }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan }, ! { name: "Item #421", value: @aq }, ! { name: "Item #431", value: @ar }, ! { name: "Item #441", value: @as }, ! { name: "Item #451", value: @at }, ! { name: "Item #461", value: @au }, ! { name: "Item #571", value: @av }, ! { name: "Item #431", value: @aw }, ! { name: "Item #341", value: @ax }, ! { name: "Item #2431", value: @ay }, ! { name: "Item #2341", value: @az }, ! { name: "Item #5441", value: @aaa }, ! { name: "Item #671", value: @aab }, ! { name: "Item #4311", value: @aac }, ! { name: "Item #31251", value: @aad }, ! { name: "Item #6554351", value: @aae }, ! { name: "Item #423521", value: @aaf }, ! { name: "Item #523653351", value: @aag }, ! { name: "Item #541541", value: @aah }, ! { name: "Item #5325321", value: @aai }, ! { name: "Item #5231", value: @aaj }, ! { name: "Item #235231", value: @aak }, ! { name: "Item #235231", value: @aal }, ! { name: "Item #asf1", value: @aam }, ! { name: "Item #541", value: @aan } ! ] ); ! button(name: "<xstr id='ok'>OK</xstr>", action: @ok, bind: @selection); ! } ! } } Index: alignment_test.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/alignment_test.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** alignment_test.adm 6 Jan 2006 18:03:01 -0000 1.2 --- alignment_test.adm 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,11 **** { interface: ! alignment : "1234567890"; } --- 8,11 ---- { interface: ! alignment : "1234567890"; } Index: video.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/video.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** video.adm 24 Jan 2006 19:38:50 -0000 1.1 --- video.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,35 **** { input: ! total_time : 120 * 60; // a two hour movie ! width : 720; ! height : 480; interface: ! video_bitrate : 200; ! audio_bitrate : 96; ! total_size; ! frame_rate : 30; ! frame_height : height; ! frame_width : width; ! frame_depth : 16; ! logic: /* ! relate { ! video_size <== frame_width * frame_height * frame_depth; ! } */ ! relate { ! video_bitrate <== total_size / total_time - audio_bitrate; ! audio_bitrate <== total_size / total_time - video_bitrate; ! total_size <== (video_bitrate + audio_bitrate) * total_time; ! } } --- 8,35 ---- { input: ! total_time : 120 * 60; // a two hour movie ! width : 720; ! height : 480; interface: ! video_bitrate : 200; ! audio_bitrate : 96; ! total_size; ! frame_rate : 30; ! frame_height : height; ! frame_width : width; ! frame_depth : 16; ! logic: /* ! relate { ! video_size <== frame_width * frame_height * frame_depth; ! } */ ! relate { ! video_bitrate <== total_size / total_time - audio_bitrate; ! audio_bitrate <== total_size / total_time - video_bitrate; ! total_size <== (video_bitrate + audio_bitrate) * total_time; ! } } Index: e01_clipping_path.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/e01_clipping_path.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** e01_clipping_path.adm 6 Jan 2006 18:03:01 -0000 1.2 --- e01_clipping_path.adm 3 Feb 2006 18:33:38 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,15 **** { output: ! result <== { path: path, flatness: flatness }; ! interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } --- 8,15 ---- { output: ! result <== { path: path, flatness: flatness }; ! interface: ! unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; ! path : 1; } Index: named_function_suite.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples/named_func... [truncated message content] |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/documentation/sources/asl Modified Files: adam.dox adam_parser.dox algorithm.dox array_t.dox circular_queue.dox conversion.dox copy_on_write.dox dancing_links.dox dictionary_t.dox empty_t.dox eve.dox eve_evaluate.dox eve_parser.dox extents_t.dox forest.dox functional.dox istream.dox iterator.dox md5.dox name_t.dox numeric.dox once.dox regular_object.dox sha.dox static_table.dox string.dox table_index.dox typeinfo.dox unicode.dox value_t.dox virtual_machine_t.dox xstring.dox zuid.dox Added Files: cmath.dox Log Message: asl 1.0.13 Index: functional.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/functional.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functional.dox 2 Jun 2005 23:15:54 -0000 1.2 --- functional.dox 3 Feb 2006 18:33:35 -0000 1.3 *************** *** 5,10 **** /* ! REVISIT (sparent) : Documentation for delete_ptr moved to adobe/functional.hpp because doxygen ! 1.4.3 cannot handle the template specializations. */ --- 5,10 ---- /* ! REVISIT (sparent) : Documentation for delete_ptr moved to adobe/functional.hpp because doxygen ! 1.4.3 cannot handle the template specializations. */ *************** *** 46,50 **** \return ! An adobe::compare_members_t which can be used to make the comparison. */ --- 46,50 ---- \return ! An adobe::compare_members_t which can be used to make the comparison. */ *************** *** 59,63 **** \return ! An adobe::compare_members_t which can be used to make the comparison. */ --- 59,63 ---- \return ! An adobe::compare_members_t which can be used to make the comparison. */ *************** *** 78,82 **** \todo ! (sparent) Propose this addition back to Boost. */ --- 78,82 ---- \todo ! (sparent) Propose this addition back to Boost. */ *************** *** 90,94 **** \return ! An adobe::transform_member_t which can be used to make the transformation. */ --- 90,94 ---- \return ! An adobe::transform_member_t which can be used to make the transformation. */ Index: array_t.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/array_t.dox,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** array_t.dox 6 Oct 2005 20:59:36 -0000 1.4 --- array_t.dox 3 Feb 2006 18:33:35 -0000 1.5 *************** *** 8,21 **** \model_of ! - \ref concept_regular_type \note ! When copy-on-write semantics are not important, it is advised to use <code>std::vector<adobe::value_t></code> or another container type instead of array_t. \note ! \anchor _1 [1] Because an array_t is copy-on-write, modifications through an iterator are not supported except via back_insert_iterator. \tutorial ! A tutorial for \ref asl_tutorials_array_t is available. */ --- 8,21 ---- \model_of ! - \ref concept_regular_type \note ! When copy-on-write semantics are not important, it is advised to use <code>std::vector<adobe::value_t></code> or another container type instead of array_t. \note ! \anchor _1 [1] Because an array_t is copy-on-write, modifications through an iterator are not supported except via back_insert_iterator. \tutorial ! A tutorial for \ref asl_tutorials_array_t is available. */ *************** *** 87,94 **** \note ! Identical semantics to operator[](). \return ! A const_reference to the element specified. */ --- 87,94 ---- \note ! Identical semantics to operator[](). \return ! A const_reference to the element specified. */ *************** *** 99,106 **** \note ! Identical semantics to at(). \return ! A const_reference to the element specified. */ --- 99,106 ---- \note ! Identical semantics to at(). \return ! A const_reference to the element specified. */ *************** *** 112,119 **** \exception ! None. Guaranteed not to throw. ! \return ! true if <code>value</code> was assigned, false otherwise. */ --- 112,119 ---- \exception ! None. Guaranteed not to throw. ! \return ! true if <code>value</code> was assigned, false otherwise. */ *************** *** 122,126 **** \return ! A const_reference to the first element in the array. */ --- 122,126 ---- \return ! A const_reference to the first element in the array. */ *************** *** 129,133 **** \return ! A const_reference to the last element in the array. Note this returns a different element than end(). */ --- 129,133 ---- \return ! A const_reference to the last element in the array. Note this returns a different element than end(). */ *************** *** 136,143 **** \return ! A write_reference to the array. \note ! copy_on_write semantics mandate a copy of the internal implementation if it is being shared. */ --- 136,143 ---- \return ! A write_reference to the array. \note ! copy_on_write semantics mandate a copy of the internal implementation if it is being shared. */ *************** *** 148,152 **** \return ! A new array; a duplicate of this one with this value appended. */ --- 148,152 ---- \return ! A new array; a duplicate of this one with this value appended. */ *************** *** 155,159 **** \return ! <code>true</code> if the array is void of elements, <code>false</code> otherwise. */ --- 155,159 ---- \return ! <code>true</code> if the array is void of elements, <code>false</code> otherwise. */ *************** *** 162,166 **** \return ! A count of the number of elements in the array. */ --- 162,166 ---- \return ! A count of the number of elements in the array. */ *************** *** 169,173 **** \return ! Number of elements allowed to be added to the array before a memory reallocation is required. */ --- 169,173 ---- \return ! Number of elements allowed to be added to the array before a memory reallocation is required. */ *************** *** 205,209 **** \note ! This will not guarantee destruction of the elements formerly contained within the array, as other arrays may also be referring to them. */ --- 205,209 ---- \note ! This will not guarantee destruction of the elements formerly contained within the array, as other arrays may also be referring to them. */ *************** *** 212,216 **** \return ! An iterator to the first element in the array */ --- 212,216 ---- \return ! An iterator to the first element in the array */ *************** *** 219,223 **** \return ! An iterator to one past the last element in the array */ --- 219,223 ---- \return ! An iterator to one past the last element in the array */ *************** *** 226,230 **** \return ! An iterator to one past the last element in the array */ --- 226,230 ---- \return ! An iterator to one past the last element in the array */ *************** *** 233,237 **** \return ! An iterator to the first element in the array */ --- 233,237 ---- \return ! An iterator to the first element in the array */ *************** *** 240,244 **** \return ! An insert iterator into the array allowing for backside appending of new elements. */ --- 240,244 ---- \return ! An insert iterator into the array allowing for backside appending of new elements. */ *************** *** 249,256 **** \return ! <code>true</code> if this array and the argument refer to the same copy_on_write instance; <code>false</code> otherwise. \note ! This is not the same as <code>operator==</code>. This function will return <code>false</code> if the arrays are identical but do not refer to the same implementation instance. */ --- 249,256 ---- \return ! <code>true</code> if this array and the argument refer to the same copy_on_write instance; <code>false</code> otherwise. \note ! This is not the same as <code>operator==</code>. This function will return <code>false</code> if the arrays are identical but do not refer to the same implementation instance. */ *************** *** 259,263 **** \return ! <code>true</code> if this array is the only one referrring to its implementation instance (i.e., the implementation instance is currently not being shared). <code>false</code> otherwise. */ --- 259,263 ---- \return ! <code>true</code> if this array is the only one referrring to its implementation instance (i.e., the implementation instance is currently not being shared). <code>false</code> otherwise. */ *************** *** 271,274 **** \model_of ! - <a href="http://www.sgi.com/tech/stl/OutputIterator.html">OutputIterator</a> */ --- 271,274 ---- \model_of ! - <a href="http://www.sgi.com/tech/stl/OutputIterator.html">OutputIterator</a> */ Index: value_t.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/value_t.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** value_t.dox 19 Mar 2005 00:16:41 -0000 1.1 --- value_t.dox 3 Feb 2006 18:33:35 -0000 1.2 *************** *** 6,29 **** \model_of ! - \ref concept_regular_type \details \par Type Promotion ! \c adobe::value_t leverages <code>adobe::promote</code> while storing instance values. This is an exception to the discriminating union concept to which \c adobe::value_t adheres. \par Getting a Value ! \c adobe::value_t uses <code>get<>()</code> to get its instance value. It behaves like an explicit cast and an assignment: getting a value_t out will always succeed and simply returns the same value_t. \par Setting a Value ! \c adobe::value_t uses <code>set<>()</code> to set its instance value. It behaves like an explicit cast and an assignment: putting a value_t into a value_t simply assigns the values; it does not wrap them. \par How does adobe::value_t differ from boost::any? ! value_t differs from <a href="http://www.boost.org/doc/html/any.html"><code>boost::any</code></a> in several ways: ! - value_t models \ref stldoc_EqualityComparable, fully modeling a \ref concept_regular_type. ! - value_t supports type promotion. See <code>adobe::promote</code> for more details. ! - get<>() results are returned by reference, making value_t generally more efficient. \tutorial ! A tutorial for \ref asl_tutorials_value_t is available. */ --- 6,29 ---- \model_of ! - \ref concept_regular_type \details \par Type Promotion ! \c adobe::value_t leverages <code>adobe::promote</code> while storing instance values. This is an exception to the discriminating union concept to which \c adobe::value_t adheres. \par Getting a Value ! \c adobe::value_t uses <code>get<>()</code> to get its instance value. It behaves like an explicit cast and an assignment: getting a value_t out will always succeed and simply returns the same value_t. \par Setting a Value ! \c adobe::value_t uses <code>set<>()</code> to set its instance value. It behaves like an explicit cast and an assignment: putting a value_t into a value_t simply assigns the values; it does not wrap them. \par How does adobe::value_t differ from boost::any? ! value_t differs from <a href="http://www.boost.org/doc/html/any.html"><code>boost::any</code></a> in several ways: ! - value_t models \ref stldoc_EqualityComparable, fully modeling a \ref concept_regular_type. ! - value_t supports type promotion. See <code>adobe::promote</code> for more details. ! - get<>() results are returned by reference, making value_t generally more efficient. \tutorial ! A tutorial for \ref asl_tutorials_value_t is available. */ *************** *** 34,38 **** \note ! What is stored is a copy of <code>x</code> promoted to <code>promote<T>::type</code>. */ --- 34,38 ---- \note ! What is stored is a copy of <code>x</code> promoted to <code>promote<T>::type</code>. */ *************** *** 41,48 **** \return ! A refernce to a promoted type for <code>T</code> containing the <code>value_t</code>'s instance value. \exception ! adobe::bad_cast Thrown if <code>adobe::promote<T></code> does not match the stored instance type. */ --- 41,48 ---- \return ! A refernce to a promoted type for <code>T</code> containing the <code>value_t</code>'s instance value. \exception ! adobe::bad_cast Thrown if <code>adobe::promote<T></code> does not match the stored instance type. */ *************** *** 51,58 **** \return ! A refernce to a promoted type for <code>T</code> containing the <code>value_t</code>'s instance value. \exception ! adobe::bad_cast Thrown if <code>adobe::promote<T></code> does not match the stored instance type. */ --- 51,58 ---- \return ! A refernce to a promoted type for <code>T</code> containing the <code>value_t</code>'s instance value. \exception ! adobe::bad_cast Thrown if <code>adobe::promote<T></code> does not match the stored instance type. */ *************** *** 61,71 **** \param ! x Value that will be set to the value stored in the value_t. \return ! <code>true</code> if x was set successfully, <code>false</code> otherwise. \exception ! Undefined Will relay anything thrown by <code>x.operator=()</code>. */ --- 61,71 ---- \param ! x Value that will be set to the value stored in the value_t. \return ! <code>true</code> if x was set successfully, <code>false</code> otherwise. \exception ! Undefined Will relay anything thrown by <code>x.operator=()</code>. */ *************** *** 76,80 **** \return ! The value_t with its new value set. */ --- 76,80 ---- \return ! The value_t with its new value set. */ *************** *** 83,87 **** \return ! The information returned by <code>typeid()</code> for the instance value. */ --- 83,87 ---- \return ! The information returned by <code>typeid()</code> for the instance value. */ *************** *** 111,115 **** \return ! A reference to the instance value stored in this value_t. */ --- 111,115 ---- \return ! A reference to the instance value stored in this value_t. */ *************** *** 120,123 **** \return ! A reference to the instance value stored in this value_t. */ --- 120,123 ---- \return ! A reference to the instance value stored in this value_t. */ Index: eve.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/eve.dox,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** eve.dox 6 Oct 2005 20:59:36 -0000 1.6 --- eve.dox 3 Feb 2006 18:33:35 -0000 1.7 *************** *** 21,25 **** \note ! Locale support for direction is not implemented yet. */ --- 21,25 ---- \note ! Locale support for direction is not implemented yet. */ *************** *** 162,166 **** \sa ! \ref adobe::eve_t::evaluate_options_t */ --- 162,166 ---- \sa ! \ref adobe::eve_t::evaluate_options_t */ *************** *** 176,180 **** \sa ! \ref adobe::eve_t::evaluate_options_t */ --- 176,180 ---- \sa ! \ref adobe::eve_t::evaluate_options_t */ *************** *** 210,262 **** \par Available Parameter Keys <table width="100%" border="1"> ! <tr><th>Name</th><th>Possible Values</th><th>Default</th><th>Notes</th></tr> ! <tr> ! <td><code>child_horizontal</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>child_vertical</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>guide_mask</code></td> ! <td>array containing any of [ guide_baseline, guide_label ]</td> ! <td>empty (no suppression)</td> ! <td>Suppression of horizontal and/or vertical guides</td> ! </tr> ! <tr> ! <td><code>horizontal</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>indent</code></td> ! <td>integer</td> ! <td>0</td> ! <td></td> ! </tr> ! <tr> ! <td><code>placement</code></td> ! <td>Any of the adobe::eve_t::placement_t enumeration labels as an adobe::name_t</td> ! <td><code>place_leaf</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>spacing</code></td> ! <td>array of integers</td> ! <td><code>[ 0 ]</code></td> ! <td>A single value here will propagate for all needed spacing values</td> ! </tr> ! <tr> ! <td><code>vertical</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> </table> */ --- 210,262 ---- \par Available Parameter Keys <table width="100%" border="1"> ! <tr><th>Name</th><th>Possible Values</th><th>Default</th><th>Notes</th></tr> ! <tr> ! <td><code>child_horizontal</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>child_vertical</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>guide_mask</code></td> ! <td>array containing any of [ guide_baseline, guide_label ]</td> ! <td>empty (no suppression)</td> ! <td>Suppression of horizontal and/or vertical guides</td> ! </tr> ! <tr> ! <td><code>horizontal</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>indent</code></td> ! <td>integer</td> ! <td>0</td> ! <td></td> ! </tr> ! <tr> ! <td><code>placement</code></td> ! <td>Any of the adobe::eve_t::placement_t enumeration labels as an adobe::name_t</td> ! <td><code>place_leaf</code></td> ! <td></td> ! </tr> ! <tr> ! <td><code>spacing</code></td> ! <td>array of integers</td> ! <td><code>[ 0 ]</code></td> ! <td>A single value here will propagate for all needed spacing values</td> ! </tr> ! <tr> ! <td><code>vertical</code></td> ! <td>Any of the adobe::eve_t::alignment_t enumeration labels as an adobe::name_t</td> ! <td><code>align_default</code></td> ! <td></td> ! </tr> </table> */ *************** *** 268,272 **** \sa ! \ref adobe::eve_t::signal_suite_t */ --- 268,272 ---- \sa ! \ref adobe::eve_t::signal_suite_t */ *************** *** 285,289 **** \todo ! (sparent) : We have a mechanism for defaulting container attributes. This needs to be extended to view attributes such as supressing guides. */ --- 285,289 ---- \todo ! (sparent) : We have a mechanism for defaulting container attributes. This needs to be extended to view attributes such as supressing guides. */ *************** *** 302,306 **** \sa ! \ref adobe::eve_t::placement_t */ --- 302,306 ---- \sa ! \ref adobe::eve_t::placement_t */ *************** *** 312,316 **** \sa ! \ref adobe::eve_t::calculate_data_t::slice_t */ --- 312,316 ---- \sa ! \ref adobe::eve_t::calculate_data_t::slice_t */ *************** *** 329,333 **** \sa ! \ref adobe::eve_t::signal_suite_t */ --- 329,333 ---- \sa ! \ref adobe::eve_t::signal_suite_t */ *************** *** 370,374 **** \note ! inset is not implemented yet. */ --- 370,374 ---- \note ! inset is not implemented yet. */ *************** *** 394,398 **** \sa ! \ref adobe::eve_t::alignment_t */ --- 394,398 ---- \sa ! \ref adobe::eve_t::alignment_t */ *************** *** 404,408 **** \sa ! \ref adobe::eve_t::alignment_t */ --- 404,408 ---- \sa ! \ref adobe::eve_t::alignment_t */ *************** *** 421,425 **** \todo ! (sparent) Currently only implemented cross stream */ --- 421,425 ---- \todo ! (sparent) Currently only implemented cross stream */ *************** *** 436,446 **** \par The place_data_t is the primary communication mechanism Eve uses to get solved layout information to the client. The place_data_t is similar to the calculate_data_t, except for the following: ! - data included is the "solved" result, not the data the client passed in (though the solution is based on the client's data) ! - data included is only pertinent to the laying-out of the widget into it's final resting place. \par This struct is used when calling the place signal inside the widget's related place signal. \sa ! \ref adobe::eve_t::signal_suite_t */ --- 436,446 ---- \par The place_data_t is the primary communication mechanism Eve uses to get solved layout information to the client. The place_data_t is similar to the calculate_data_t, except for the following: ! - data included is the "solved" result, not the data the client passed in (though the solution is based on the client's data) ! - data included is only pertinent to the laying-out of the widget into it's final resting place. \par This struct is used when calling the place signal inside the widget's related place signal. \sa ! \ref adobe::eve_t::signal_suite_t */ *************** *** 470,474 **** \sa ! \ref adobe::eve_t::evaluate_options_t */ --- 470,474 ---- \sa ! \ref adobe::eve_t::evaluate_options_t */ *************** *** 517,524 **** \par Place is the final callback signaled from the Eve engine to a widget. When this callback is made there are several guarantees for the client: ! - All parent views for this widget have already had their place callback signalled ! - All data provided in the place_data_t is the final geometric information for the widget. \par ! Note that this callback can be signalled multiple times- given a view re-layout (i.e. during a window resize event) the other callbacks will not be signalled- the layout will be adjusted internally in the Eve engine and only this callback will be signalled with updated placement information for the widget. */ --- 517,524 ---- \par Place is the final callback signaled from the Eve engine to a widget. When this callback is made there are several guarantees for the client: ! - All parent views for this widget have already had their place callback signalled ! - All data provided in the place_data_t is the final geometric information for the widget. \par ! Note that this callback can be signalled multiple times- given a view re-layout (i.e. during a window resize event) the other callbacks will not be signalled- the layout will be adjusted internally in the Eve engine and only this callback will be signalled with updated placement information for the widget. */ Index: name_t.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/name_t.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** name_t.dox 8 Aug 2005 17:01:28 -0000 1.2 --- name_t.dox 3 Feb 2006 18:33:35 -0000 1.3 *************** *** 8,14 **** \par Model Of: ! - \ref concept_regular_type ! - \ref stldoc_LessThanComparable ! - \ref concept_convertible_to_bool \par Rationale: --- 8,14 ---- \par Model Of: ! - \ref concept_regular_type ! - \ref stldoc_LessThanComparable ! - \ref concept_convertible_to_bool \par Rationale: *************** *** 58,62 **** \promotes_to ! adobe::name_t */ --- 58,62 ---- \promotes_to ! adobe::name_t */ *************** *** 81,88 **** \promotes_to ! adobe::name_t \rationale ! The primary purpose of const_once_name_t is to provide a name_t implementation that can be used in a multithreaded environment as a static variable. Because its construction does nothing to initialize the value of the name_t, such initialization must take place during a threadsafe intialization function (boost::call_once, for instance). */ --- 81,88 ---- \promotes_to ! adobe::name_t \rationale ! The primary purpose of const_once_name_t is to provide a name_t implementation that can be used in a multithreaded environment as a static variable. Because its construction does nothing to initialize the value of the name_t, such initialization must take place during a threadsafe intialization function (boost::call_once, for instance). */ Index: xstring.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/xstring.dox,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xstring.dox 6 Oct 2005 20:59:36 -0000 1.5 --- xstring.dox 3 Feb 2006 18:33:35 -0000 1.6 *************** *** 13,25 **** The xstring grammar is based on the XML 1.1 grammar specification (http://www.w3.org/TR/2004/REC-xml11-20040204/) \verbatim ! S = (#x20 | #x09 | #x0D | #x0A)+ ! Char = [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] ! CharData = [^<&]* ! CharRef = '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' ! NameStartChar = ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | --- 13,25 ---- The xstring grammar is based on the XML 1.1 grammar specification (http://www.w3.org/TR/2004/REC-xml11-20040204/) \verbatim ! S = (#x20 | #x09 | #x0D | #x0A)+ ! Char = [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] ! CharData = [^<&]* ! CharRef = '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' ! NameStartChar = ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | *************** *** 27,57 **** [#x10000-#xEFFFF] ! NameChar = NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] ! Name = NameStartChar (NameChar)* ! EntityRef = '&' Name ';' ! Reference = EntityRef | CharRef ! AttValue = '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" ! Eq = S? '=' S? ! Attribute = Name Eq AttValue ! EmptyElemTag = '<' Name (S Attribute)* S? '/>' ! STag = '<' Name (S Attribute)* S? '>' ! ETag = '</' Name S? '>' ! content = CharData? ((element | Reference | Comment) CharData?)* ! element = EmptyElemTag | STag content ETag ! translation_unit = element* \endverbatim --- 27,57 ---- [#x10000-#xEFFFF] ! NameChar = NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] ! Name = NameStartChar (NameChar)* ! EntityRef = '&' Name ';' ! Reference = EntityRef | CharRef ! AttValue = '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" ! Eq = S? '=' S? ! Attribute = Name Eq AttValue ! EmptyElemTag = '<' Name (S Attribute)* S? '/>' ! STag = '<' Name (S Attribute)* S? '>' ! ETag = '</' Name S? '>' ! content = CharData? ((element | Reference | Comment) CharData?)* ! element = EmptyElemTag | STag content ETag ! translation_unit = element* \endverbatim *************** *** 62,83 **** The context of a string is a runtime evaluated collection of information about the state of the machine and the xstring that we currently care about. This context is gathered from several locations: ! -# the runtime context of the xstring system (which includes some defaults) ! -# the static attributes of the xstring definition The runtime context of the xstring system can be manipulated with the adobe::xstring_context_t class. The runtime context has several pieces of information set by default. These pieces are: ! - lang : defaults to 'en-us' ! - platform : defaults to one of several target platform tags: ! - "linux" ! - "bsd" ! - "solaris" ! - "irix" ! - "hpux" ! - "cygwin" ! - "windows" ! - "beos" ! - "macintosh" ! - "aix" ! - "amiga" ! - "unix" The static attributes of the xstring definition also provide context. Example: --- 62,83 ---- The context of a string is a runtime evaluated collection of information about the state of the machine and the xstring that we currently care about. This context is gathered from several locations: ! -# the runtime context of the xstring system (which includes some defaults) ! -# the static attributes of the xstring definition The runtime context of the xstring system can be manipulated with the adobe::xstring_context_t class. The runtime context has several pieces of information set by default. These pieces are: ! - lang : defaults to 'en-us' ! - platform : defaults to one of several target platform tags: ! - "linux" ! - "bsd" ! - "solaris" ! - "irix" ! - "hpux" ! - "cygwin" ! - "windows" ! - "beos" ! - "macintosh" ! - "aix" ! - "amiga" ! - "unix" The static attributes of the xstring definition also provide context. Example: *************** *** 125,131 **** And given the following code: \code ! std::string good_thing(adobe::xstring("<xstr id='a_good_thing'/>")); ! std::string bad_thing(adobe::xstring("<xstr id='a_bad_thing'/>")); ! std::string neutral_thing(adobe::xstring("<xstr id='a_neutral_thing'/>")); std::cout << "good marker: " << good_thing << std::endl; --- 125,131 ---- And given the following code: \code ! std::string good_thing(adobe::xstring("<xstr id='a_good_thing'/>")); ! std::string bad_thing(adobe::xstring("<xstr id='a_bad_thing'/>")); ! std::string neutral_thing(adobe::xstring("<xstr id='a_neutral_thing'/>")); std::cout << "good marker: " << good_thing << std::endl; *************** *** 176,182 **** Callback for the XML fragment parser. When the fragment parser finds a well formed element, it will signal a function with this signature with the following parameters: ! \param name The name of the element ! \param attribute_set A collection of attributes for the found element (could be empty) ! \param value The character data contained within the element (could be empty) \return A UTF8 buffer that is the value of this element. The value is dependent on the implementation of the callback (for example, see xml_element_echo). --- 176,182 ---- Callback for the XML fragment parser. When the fragment parser finds a well formed element, it will signal a function with this signature with the following parameters: ! \param name The name of the element ! \param attribute_set A collection of attributes for the found element (could be empty) ! \param value The character data contained within the element (could be empty) \return A UTF8 buffer that is the value of this element. The value is dependent on the implementation of the callback (for example, see xml_element_echo). *************** *** 190,194 **** Appends the current xstring glossary. Strings with identical contexts are stored on a first-in basis, and are not replaced by subsequent strings with the same context. ! \param stream Stream containing XML fragment to parse into the xstring glossary */ --- 190,194 ---- Appends the current xstring glossary. Strings with identical contexts are stored on a first-in basis, and are not replaced by subsequent strings with the same context. ! \param stream Stream containing XML fragment to parse into the xstring glossary */ *************** *** 199,205 **** Appends the current xstring glossary. Strings with identical contexts are stored on a first-in basis, and are not replaced by subsequent strings with the same context. ! \param stream Stream containing XML fragment to parse into the xstring glossary ! \param file Name of the file to parse (for better error reporting) ! \param line Starting line number in the file to parse (for better error reporting) */ #endif --- 199,205 ---- Appends the current xstring glossary. Strings with identical contexts are stored on a first-in basis, and are not replaced by subsequent strings with the same context. ! \param stream Stream containing XML fragment to parse into the xstring glossary ! \param file Name of the file to parse (for better error reporting) ! \param line Starting line number in the file to parse (for better error reporting) */ #endif *************** *** 212,216 **** \note ! This is available only for builds where <code>NDEBUG</code> is not defined */ --- 212,216 ---- \note ! This is available only for builds where <code>NDEBUG</code> is not defined */ *************** *** 219,224 **** \ingroup asl_xstring ! \param xstr 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param n size of the input buffer \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment --- 219,224 ---- \ingroup asl_xstring ! \param xstr 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param n size of the input buffer \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment *************** *** 231,235 **** \ingroup asl_xstring ! \param xstr utf-8 buffer of the xstring defintion to parse and look up \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment --- 231,235 ---- \ingroup asl_xstring ! \param xstr utf-8 buffer of the xstring defintion to parse and look up \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment *************** *** 242,248 **** \ingroup asl_xstring ! \param xstring 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param n size of the input buffer ! \param output Type that models OutputIterator; recieves the result of the xstring lookup. \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment --- 242,248 ---- \ingroup asl_xstring ! \param xstring 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param n size of the input buffer ! \param output Type that models OutputIterator; recieves the result of the xstring lookup. \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment *************** *** 255,260 **** \ingroup asl_xstring ! \param xstring Null-terminated 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param output Type that models OutputIterator; recieves the result of the xstring lookup. \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment --- 255,260 ---- \ingroup asl_xstring ! \param xstring Null-terminated 7-bit ASCII encoded xstring definition (an XML element fragment) to parse ! \param output Type that models OutputIterator; recieves the result of the xstring lookup. \return The glossary-obtained xstring value, or the default string if none is found in the glossary. This result will be a valid XML fragment *************** *** 269,275 **** Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment utf-8 encoded fragment of XML to parse ! \param n Number of bytes in the fragment ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment --- 269,275 ---- Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment utf-8 encoded fragment of XML to parse ! \param n Number of bytes in the fragment ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment *************** *** 282,287 **** Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment utf-8 encoded fragment of XML to parse ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment --- 282,287 ---- Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment utf-8 encoded fragment of XML to parse ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment *************** *** 294,299 **** Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment Null-terminated 7-bit ASCII encoded fragment of XML to parse ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment --- 294,299 ---- Parses a fragment of XML, outputting the result to an OutputIterator instance. ! \param fragment Null-terminated 7-bit ASCII encoded fragment of XML to parse ! \param output OutputIterator implementation that receives the result of the parse \return The value of the parsed fragment *************** *** 365,375 **** \code { ! adobe::attribute_set_t attribute_set; ! attribute_set.push_back(std::make_pair(adobe::static_name_t("context"), adobe::static_name_t("some_view"))); ! adobe::xstring_context_t mycontext(attribute_set); ! // anything here is looked up with the context='some_view'; other attributes remain unchanged } // now our context is out scope and we go back to what we had before. --- 365,375 ---- \code { ! adobe::attribute_set_t attribute_set; ! attribute_set.push_back(std::make_pair(adobe::static_name_t("context"), adobe::static_name_t("some_view"))); ! adobe::xstring_context_t mycontext(attribute_set); ! // anything here is looked up with the context='some_view'; other attributes remain unchanged } // now our context is out scope and we go back to what we had before. *************** *** 379,385 **** \code { ! adobe::xstring_context_t mycontext(adobe::static_name_t("context"), adobe::static_name_t("some_view")); ! // anything here is looked up with the context='some_view'; other attributes remain unchanged } // now our context is out scope and we go back to what we had before. --- 379,385 ---- \code { ! adobe::xstring_context_t mycontext(adobe::static_name_t("context"), adobe::static_name_t("some_view")); ! // anything here is looked up with the context='some_view'; other attributes remain unchanged } // now our context is out scope and we go back to what we had before. *************** *** 389,399 **** \code { ! std::vector<std::pair<adobe::name_t, adobe::name_t> > my_set; ! // fill in my_set ... ! adobe::xstring_context_t mycontext(&my_set[0], &my_set[my_set.size()]); ! // anything here is looked up with a context affected by my_set } // now our context is out scope and we go back to what we had before. --- 389,399 ---- \code { ! std::vector<std::pair<adobe::name_t, adobe::name_t> > my_set; ! // fill in my_set ... ! adobe::xstring_context_t mycontext(&my_set[0], &my_set[my_set.size()]); ! // anything here is looked up with a context affected by my_set } // now our context is out scope and we go back to what we had before. Index: conversion.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/conversion.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** conversion.dox 19 Mar 2005 00:16:41 -0000 1.1 --- conversion.dox 3 Feb 2006 18:33:35 -0000 1.2 *************** *** 21,39 **** \note ! <code>char</code> is <i>not</i> specified to promote to <code>wchar_t</code> as standard behavior. Without knowing the source or destination character encodings there is not enough information to do this type promotion correctly. \see_also ! - <code>adobe::static_name_t</code> ! - <code>adobe::value_t</code> \section standard_promotions Standard Promotions ! - The following promote to <code>double</code>: ! - <code>short</code> ! - <code>unsigned short</code> ! - <code>int</code> ! - <code>unsigned int</code> ! - <code>long</code> ! - <code>unsigned long</code> ! - <code>float</code> */ --- 21,39 ---- \note ! <code>char</code> is <i>not</i> specified to promote to <code>wchar_t</code> as standard behavior. Without knowing the source or destination character encodings there is not enough information to do this type promotion correctly. \see_also ! - <code>adobe::static_name_t</code> ! - <code>adobe::value_t</code> \section standard_promotions Standard Promotions ! - The following promote to <code>double</code>: ! - <code>short</code> ! - <code>unsigned short</code> ! - <code>int</code> ! - <code>unsigned int</code> ! - <code>long</code> ! - <code>unsigned long</code> ! - <code>float</code> */ Index: dictionary_t.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/dictionary_t.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dictionary_t.dox 26 Apr 2005 16:22:59 -0000 1.2 --- dictionary_t.dox 3 Feb 2006 18:33:35 -0000 1.3 *************** *** 6,13 **** \model_of ! - \ref concept_regular_type \tutorial ! A tutorial for \ref asl_tutorials_dictionary_t is available. */ --- 6,13 ---- \model_of ! - \ref concept_regular_type \tutorial ! A tutorial for \ref asl_tutorials_dictionary_t is available. */ *************** *** 84,97 **** \note ! Identical semantics as operator[](). \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t. \exception ! std::exception Thrown if the key cannot be found. */ --- 84,97 ---- \note ! Identical semantics as operator[](). \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t. \exception ! std::exception Thrown if the key cannot be found. */ *************** *** 102,115 **** \note ! Identical semantics as at(). \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t. \exception ! std::exception Thrown if the key cannot be found. */ --- 102,115 ---- \note ! Identical semantics as at(). \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t. \exception ! std::exception Thrown if the key cannot be found. */ *************** *** 120,130 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t (if <code>key</code> exists). \exception ! std::exception Thrown if the key cannot be found or the type cannot be coerced to <code>T</code>. */ --- 120,130 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A reference to <code>key</code>'s associated value_t (if <code>key</code> exists). \exception ! std::exception Thrown if the key cannot be found or the type cannot be coerced to <code>T</code>. */ *************** *** 136,143 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \exception ! None. Guaranteed not to throw. */ --- 136,143 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \exception ! None. Guaranteed not to throw. */ *************** *** 146,153 **** \return ! A writeable reference to the dictionary. \note ! copy_on_write semantics mandate a copy of the internal implementation if it is being shared. */ --- 146,153 ---- \return ! A writeable reference to the dictionary. \note ! copy_on_write semantics mandate a copy of the internal implementation if it is being shared. */ *************** *** 156,163 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A new dictionary; a duplicate of this one with this key/value pair appended. */ --- 156,163 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A new dictionary; a duplicate of this one with this key/value pair appended. */ *************** *** 166,170 **** \return ! <code>true</code> if the dictionary is void of elements, <code>false</code> otherwise. */ --- 166,170 ---- \return ! <code>true</code> if the dictionary is void of elements, <code>false</code> otherwise. */ *************** *** 173,180 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A count of the number of elements in the dictionary. */ --- 173,180 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! A count of the number of elements in the dictionary. */ *************** *** 183,187 **** \return ! Number of elements allowed to be added to the dictionary before a memory reallocation is required. */ --- 183,187 ---- \return ! Number of elements allowed to be added to the dictionary before a memory reallocation is required. */ *************** *** 192,202 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! The number of elements erased. \exception ! None. Guaranteed not to throw. */ --- 192,202 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! The number of elements erased. \exception ! None. Guaranteed not to throw. */ *************** *** 207,211 **** \note ! This will not guarantee destruction of the elements formerly contained within the dictionary, as other dictionaries may also be referring to them. */ --- 207,211 ---- \note ! This will not guarantee destruction of the elements formerly contained within the dictionary, as other dictionaries may also be referring to them. */ *************** *** 214,218 **** \return ! A function object for value comparison. */ --- 214,218 ---- \return ! A function object for value comparison. */ *************** *** 221,225 **** \return ! A function object for key comparison. */ --- 221,225 ---- \return ! A function object for key comparison. */ *************** *** 230,237 **** \complexity ! Same complexity as <code>adobe::lower_bound</code>. \return ! An iterator to the key/value pair specified by name_t. <code>end()</code> if not found. */ --- 230,237 ---- \complexity ! Same complexity as <code>adobe::lower_bound</code>. \return ! An iterator to the key/value pair specified by name_t. <code>end()</code> if not found. */ *************** *** 248,252 **** \return ! An iterator to the start of the dictionary's key/value pairs. */ --- 248,252 ---- \return ! An iterator to the start of the dictionary's key/value pairs. */ *************** *** 255,259 **** \return ! An iterator to one past the last of the dictionary's key/value pairs. */ --- 255,259 ---- \return ! An iterator to one past the last of the dictionary's key/value pairs. */ *************** *** 262,266 **** \return ! An iterator to one past the last of the dictionary's key/value pairs. */ --- 262,266 ---- \return ! An iterator to one past the last of the dictionary's key/value pairs. */ *************** *** 269,273 **** \return ! An const_reverse_iterator to the start of the dictionary's key/value pairs. */ --- 269,273 ---- \return ! An const_reverse_iterator to the start of the dictionary's key/value pairs. */ *************** *** 278,285 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! <code>false</code> if the insertion replaced a previous value associated with the key; <code>true</code> otherwise (i.e. the key is new). */ --- 278,285 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. \return ! <code>false</code> if the insertion replaced a previous value associated with the key; <code>true</code> otherwise (i.e. the key is new). */ *************** *** 291,295 **** \complexity ! Same complexity as <code>dictionary_t::find()</code>. */ --- 291,295 ---- \complexity ! Same complexity as <code>dictionary_t::find()</code>. */ *************** *** 298,302 **** \return ! An insert_iterator */ --- 298,302 ---- \return ! An insert_iterator */ *************** *** 307,314 **** \return ! <code>true</code> if this dictionary and the argument refer to the same copy_on_write instance; <code>false</code> otherwise. \note ! This is not the same as <code>operator==</code>. This function will return <code>false</code> if the dictionaries are identical but do not refer to the same implementation instance. */ --- 307,314 ---- \return ! <code>true</code> if this dictionary and the argument refer to the same copy_on_write instance; <code>false</code> otherwise. \note ! This is not the same as <code>operator==</code>. This function will return <code>false</code> if the dictionaries are identical but do not refer to the same implementation instance. */ *************** *** 317,320 **** \return ! <code>true</code> if this dictionary is the only one referrring to its implementation instance (i.e., the implementation instance is currently not being shared). <code>false</code> otherwise. */ --- 317,320 ---- \return ! <code>true</code> if this dictionary is the only one referrring to its implementation instance (i.e., the implementation instance is currently not being shared). <code>false</code> otherwise. */ Index: iterator.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/iterator.dox,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iterator.dox 2 Dec 2005 02:59:15 -0000 1.3 --- iterator.dox 3 Feb 2006 18:33:35 -0000 1.4 *************** *** 11,22 **** \par Model Of: ! - \ref concept_regular_type ! - Iterator concept specified by C \par Types: ! - T: Value type of the sequence's elements; models \ref concept_regular_type ! - C: Iterator category ! - R: Return type of operator*(); models Reference Type of T ! - D: Difference type between iterators; models Signed Integer */ --- 11,22 ---- \par Model Of: ! - \ref concept_regular_type ! - Iterator concept specified by C \par Types: ! - T: Value type of the sequence's elements; models \ref concept_regular_type ! - C: Iterator category ! - R: Return type of operator*(); models Reference Type of T ! - D: Difference type between iterators; models Signed Integer */ *************** *** 35,47 **** \par Model Of: ! - \ref concept_regular_type ! - Random Access Iterator \par Types: ! - F: Models Unary Function ! - T: Value type of the sequence's elements; models \ref concept_regular_type ! - R: Return type of operator*(); models Reference Type of T ! - I: Index type; models Unsigned Integer ! - D: Difference type of I; models Signed Integer */ --- 35,47 ---- \par Model Of: ! - \ref concept_regular_type ! - Random Access Iterator \par Types: ! - F: Models Unary Function ! - T: Value type of the sequence's elements; models \ref concept_regular_type ! - R: Return type of operator*(); models Reference Type of T ! - I: Index type; models Unsigned Integer ! - D: Difference type of I; models Signed Integer */ Index: virtual_machine_t.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/asl/virtual_machine_t.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** virtual_machine_t.dox 19 Mar 2005 00:16:41 -0000 1.1 --- virtual_machine_t.dox 3 Feb 2006 18:33:35 -0000 1.2 *************** *** 15,57 **** \par <table width="100%" cellspacing="1" cellpadding="1" border="1"> ! <tr><th>Unary Operation Name</th><th colspan="4">Parameter</th><th>Result</th></tr> ! <tr><td><code>.not</code></td><td colspan="4">boolean</td><td>logical not</td></tr> ! <tr><td><code>.unary_negate</code></td><td colspan="4">number</td><td>unary negation</td></tr> ! <tr><th>Binary Operation Name</th><th colspan="4">Parameters</th><th>Result</th></tr> ! <tr><td><code>.add</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 + number_1</td></tr> ! <tr><td><code>.subtract</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 - number_1</td></tr> ! <tr><td><code>.multiply</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 * number_1</td></tr> ! <tr><td><code>.modulus</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 \% number_1</td></tr> ! <tr><td><code>.divide</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 / number_1</td></tr> ! <tr><th>Predicate Operation Name</th><th colspan="4">Parameters</th><th>Result</th></tr> ! <tr><td><code>.less</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 < number_1</td></tr> ! <tr><td><code>.greater</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 > number_1</td></tr> ! <tr><td><code>.less_equal</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 <= number_1</td></tr> ! <tr><td><code>.greater_equal</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 >= number_1</td></tr> ! <tr><td><code>.equal</code><td colspan="2">value_0</td><td colspan="2">value_1</td><td>value_0 == value_1</td></tr> ! <tr><td><code>.not_equal</code><td colspan="2">value_0</td><td colspan="2">value_1</td><td>value_0 != value_1</td></tr> ! <tr><td><code>.and_op</code><td colspan="2">boolean</td><td colspan="2">expression</td><td>boolean && expression <a href="#op_1">[1]</a> <a href="#op_3">[3]</a></td></tr> ! <tr><td><code>.or_op</code><td colspan="2">boolean</td><td colspan="2">expression</td><td>boolean || expression <a href="#op_2">[2]</a> <a href="#op_3">[3]</a></td></tr> ! <tr><th>Misc. Operation Name</th><th colspan="4">Parameters</th><th>Result</th></tr> ! <tr><td><code>.array</code><td>number</td><td colspan="3"><code>number</code> unnamed argument(s)</td><td>an array_t containing the top <code>number</code> elements in the evaluation stack</td></tr> ! <tr><td><code>.dictionary</code><td>number</td><td colspan="3"><code>number</code> key/value pair(s) (named argument(s))</td><td>a dictionary_t containing the top <code>number</code> key/value pairs in the evaluation stack</td></tr> ! <tr><td><code>.ifelse</code><td>boolean</td><td colspan="2">expression_0</td><td>expression_1</td><td>evaluated expression_0 if boolean is true; evaluated expression_1 otherwise <a href="#op_4">[4]</a></td></tr> ! <tr><td><code>.index</code><td colspan="2">array</td><td colspan="2">number</td><td>evaluated array[number]</td></tr> ! <tr><td><code>.index</code><td colspan="2">dictionary</td><td colspan="2">name</td><td>evaluated dictionary[name]</td></tr> ! <tr><td><code>.function</code><td colspan="2">name</td><td colspan="2">dictionary of expressions</td><td>result of calling function name with argument dictionary</td></tr> ! <tr><td><code>.function</code><td colspan="2">name</td><td colspan="2">array of expressions</td><td>result of calling function name with argument array</td></tr> ! <tr><td><code>.variable</code><td colspan="4">name</td><td>evaluated value of name</td></tr> </table> \notes ! <a name="op_1">[1]</a> expression is evaluated only if boolean is true. \par ! <a name="op_2">[2]</a> expression is evaluated only if boolean is false. \par ! <a name="op_3">[3]</a> expression must yield a boolean. \par ! <a name="op_4">[4]</a> only the pertinent expression is evaluated. \section named_functions Named Functions --- 15,57 ---- \par <table width="100%" cellspacing="1" cellpadding="1" border="1"> ! <tr><th>Unary Operation Name</th><th colspan="4">Parameter</th><th>Result</th></tr> ! <tr><td><code>.not</code></td><td colspan="4">boolean</td><td>logical not</td></tr> ! <tr><td><code>.unary_negate</code></td><td colspan="4">number</td><td>unary negation</td></tr> ! <tr><th>Binary Operation Name</th><th colspan="4">Parameters</th><th>Result</th></tr> ! <tr><td><code>.add</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 + number_1</td></tr> ! <tr><td><code>.subtract</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 - number_1</td></tr> ! <tr><td><code>.multiply</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 * number_1</td></tr> ! <tr><td><code>.modulus</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 \% number_1</td></tr> ! <tr><td><code>.divide</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 / number_1</td></tr> ! <tr><th>Predicate Operation Name</th><th colspan="4">Parameters</th><th>Result</th></tr> ! <tr><td><code>.less</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 < number_1</td></tr> ! <tr><td><code>.greater</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 > number_1</td></tr> ! <tr><td><code>.less_equal</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number_0 <= number_1</td></tr> ! <tr><td><code>.greater_equal</code><td colspan="2">number_0</td><td colspan="2">number_1</td><td>number... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/begin/resources Modified Files: editor.adm editor.eve metrics_glossary.xstr resources.h resources.rc Added Files: begin.exe.manifesttmpl begin.exe.msvc7.manifest begin.exe.msvc8.debug.manifest begin.exe.msvc8.release.manifest Removed Files: msvc7.begin.exe.manifest msvc8.debug.begin.exe.manifest msvc8.release.begin.exe.manifest Log Message: asl 1.0.13 Index: resources.h =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/resources.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resources.h 7 Jul 2005 22:16:20 -0000 1.1 --- resources.h 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ // --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ // *************** *** 13,17 **** /// The main application icon. // ! #define RES_APP_ICON 2 /****************************************************************************************************/ --- 13,17 ---- /// The main application icon. // ! #define RES_APP_ICON 2 /****************************************************************************************************/ Index: metrics_glossary.xstr =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/metrics_glossary.xstr,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** metrics_glossary.xstr 6 Oct 2005 20:59:38 -0000 1.3 --- metrics_glossary.xstr 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,78 **** <xstr id='metric:global'>{ gap: 4 }</xstr> <xstr id='metric:checkbox' theme='normal'> ! { size: [ 16, 14 ], adjust_size: [ 2, 0 ], spacing: 5, adjust_position: [ -2, 0 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -1 }</xstr> <xstr id='metric:checkbox' theme='small'> ! { size: [ 13, 12 ], adjust_size: [ 1, 0 ], spacing: 7, adjust_position: [ -1, 0 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -1 }</xstr> <xstr id='metric:checkbox' theme='mini'> ! { size: [ 10, 10 ], spacing: 4, outset: [ 0, 1, 0, 0 ], adjust_baseline: -1 }</xstr> <xstr id='metric:radio_button' theme='normal'> ! { size: [ 19, 16 ], adjust_size: [ 5, 1 ], spacing: 4, adjust_position: [ -2, -1 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -1 }</xstr> <xstr id='metric:radio_button' theme='small'> ! { size: [ 14, 13 ], spacing: 4, outset: [ 0, 0, 0, 1 ] }</xstr> <xstr id='metric:radio_button' theme='mini'> ! { size: [ 10, 10 ], spacing: 4, adjust_position: [ 0, 1 ], outset: [ 0, 0, 0, 1 ] }</xstr> <xstr id='metric:button' theme='normal'> ! { size: [ 20, 21 ], adjust_baseline: 2, outset: [ 1, 0, 1, 2 ] }</xstr> <xstr id='metric:button' theme='small'> ! { size: [ 20, 18 ], adjust_size: [ -2, 0 ], adjust_position: [ 1, -1 ], outset: [ 0, 0, 0, 1 ], adjust_baseline: 2 }</xstr> <xstr id='metric:button' theme='mini'> ! { size: [ 20, 15 ], adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: 2 }</xstr> <xstr id='metric:group' label='true' theme='normal'> ! { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 14, 1, 1 ] }</xstr> <xstr id='metric:group' label='true' theme='small'> ! { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 14, 1, 1 ] }</xstr> <xstr id='metric:group' label='true' theme='mini'> ! { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 12, 1, 1 ] }</xstr> <xstr id='metric:group' label='false' theme='normal'> ! { size: [ 0, 0 ], frame: [ 1, 1, 1, 1 ] }</xstr> <xstr id='metric:group' label='false' theme='small'> ! { size: [ 0, 0 ], frame: [ 1, 1, 1, 1 ] }</xstr> <xstr id='metric:group' label='false' theme='mini'> ! { size: [ 0, 0 ], frame: [ 1, 1, 1, 1 ] }</xstr> <xstr id='metric:tab_group' theme='normal'> ! { size: [ 0, 0 ], adjust_size: [ 0 , 8 ], adjust_position: [ 0, -7 ], frame: [ 1, 21, 1, 1 ] }</xstr> <xstr id='metric:tab_group' theme='small'> ! { size: [ 0, 0 ], adjust_size: [ 0 , 5 ], adjust_position: [ 0, -4 ], frame: [ 1, 18, 1, 1 ] }</xstr> <xstr id='metric:tab_group' theme='mini'> ! { size: [ 0, 0 ], adjust_size: [ 0 , 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 15, 1, 1 ] }</xstr> <xstr id='metric:static_text' theme='normal'> ! { size: [ 0, 16 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -3 ], adjust_baseline: -3 }</xstr> <xstr id='metric:static_text' theme='small'> ! { size: [ 0, 15 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> <xstr id='metric:static_text' theme='mini'> ! { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='normal'> ! { size: [ 3, 16 ], adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='small'> ! { size: [ 3, 14 ], adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='mini'> ! { size: [ 3, 12 ], adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='true' theme='normal'> ! { size: [ 16, 16 ] }</xstr> <xstr id='metric:edit_text' scroll='true' theme='small'> ! { size: [ 16, 16 ] }</xstr> <xstr id='metric:edit_text' scroll='true' theme='mini'> ! { size: [ 16, 16 ] }</xstr> <xstr id='metric:popup' label='false' theme='normal'> ! { adjust_size: [ 1, -1 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ] }</xstr> <xstr id='metric:popup' label='false' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:popup' label='false' theme='mini'> ! { adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ] }</xstr> <xstr id='metric:popup' label='true' theme='normal'> ! { adjust_size: [ 0, -1 ], outset: [ 0, 0, 1, 1 ] }</xstr> <xstr id='metric:popup' label='true' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 1, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:popup' label='true' theme='mini'> ! { adjust_size: [ 1, 0 ] }</xstr> --- 1,80 ---- <xstr id='metric:global'>{ gap: 4 }</xstr> + <xstr id='metric:window'>{ spacing: 20 }</xstr> + <xstr id='metric:checkbox' theme='normal'> ! { adjust_size: [ 2, 4 ], adjust_position: [ -2, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr> <xstr id='metric:checkbox' theme='small'> ! { adjust_size: [ 1, 4 ], adjust_position: [ -1, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr> <xstr id='metric:checkbox' theme='mini'> ! { adjust_size: [ 0, 1 ], adjust_position: [ 0, -1 ], outset: [ 0, 1, 0, 0 ], adjust_baseline: -1 }</xstr> <xstr id='metric:radio_button' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ -2, -2 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -2 }</xstr> <xstr id='metric:radio_button' theme='small'> ! { adjust_size: [ 0, 2 ], adjust_position: [ 0, -1 ], outset: [ 0, 0, 0, 1 ] }</xstr> <xstr id='metric:radio_button' theme='mini'> ! { adjust_size: [ 0, 1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 0, 1 ] }</xstr> <xstr id='metric:button' theme='normal'> ! { adjust_size: [ 0, -1 ], outset: [ 1, 0, 1, 2 ] }</xstr> <xstr id='metric:button' theme='small'> ! { adjust_size: [ -2, 2 ], adjust_position: [ 1, -1 ], outset: [ 0, 0, 0, 1 ], adjust_baseline: -2 }</xstr> <xstr id='metric:button' theme='mini'> ! { adjust_size: [ 2, 5 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -3 }</xstr> <xstr id='metric:group' label='true' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr> <xstr id='metric:group' label='true' theme='small'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr> <xstr id='metric:group' label='true' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 3, 1, 1 ], spacing: 20 }</xstr> <xstr id='metric:group' label='false' theme='normal'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 4, 1, 1 ] }</xstr> <xstr id='metric:group' label='false' theme='small'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr> <xstr id='metric:group' label='false' theme='mini'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr> <xstr id='metric:tab_group' theme='normal'> ! { adjust_size: [ 0, 8 ], adjust_position: [ 0, -7 ], frame: [ 1, 8, 1, 1 ], spacing: 24 }</xstr> <xstr id='metric:tab_group' theme='small'> ! { adjust_size: [ 0, 5 ], adjust_position: [ 0, -4 ], frame: [ 1, 8, 1, 1 ], spacing: 19 }</xstr> <xstr id='metric:tab_group' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 6, 1, 1 ], spacing: 16 }</xstr> <xstr id='metric:static_text' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -3 ], adjust_baseline: -3 }</xstr> <xstr id='metric:static_text' theme='small'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> <xstr id='metric:static_text' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='normal'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='small'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='mini'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='true' theme='normal'> ! { }</xstr> <xstr id='metric:edit_text' scroll='true' theme='small'> ! { }</xstr> <xstr id='metric:edit_text' scroll='true' theme='mini'> ! { }</xstr> <xstr id='metric:popup' label='false' theme='normal'> ! { adjust_size: [ 1, -1 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ] }</xstr> <xstr id='metric:popup' label='false' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:popup' label='false' theme='mini'> ! { adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ] }</xstr> <xstr id='metric:popup' label='true' theme='normal'> ! { adjust_size: [ 0, -1 ], outset: [ 0, 0, 1, 1 ] }</xstr> <xstr id='metric:popup' label='true' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 1, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:popup' label='true' theme='mini'> ! { adjust_size: [ 1, 0 ] }</xstr> --- NEW FILE: begin.exe.manifesttmpl --- intentional empty --- NEW FILE: begin.exe.msvc7.manifest --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="*" version="1.0.0.0" type="win32" name="AdobeSystems.AdobeSourceLibraries.Begin" /> <description>Adobe Begin Copyright 2005-2006 Adobe Systems Incorporated</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*" /> </dependentAssembly> </dependency> </assembly> --- msvc7.begin.exe.manifest DELETED --- --- msvc8.release.begin.exe.manifest DELETED --- --- msvc8.debug.begin.exe.manifest DELETED --- Index: editor.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/editor.eve,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor.eve 24 Jan 2006 19:38:50 -0000 1.5 --- editor.eve 3 Feb 2006 18:33:38 -0000 1.6 *************** *** 1,72 **** /* ! Copyright 2005-2006 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) */ layout editor { ! view dialog( name: "<xstr id='editor_dialog_title'>Editor</xstr>", ! size: @size_small, placement: place_column, grow: true, horizontal: align_fill, vertical: align_fill) ! { ! tab_group( bind: @tab_group_visible, vertical: align_fill, horizontal: align_fill, ! items: ! [ ! { name: "<xstr id='editor_tab_adam'>Adam</xstr>", value: @adam_stuff }, ! { name: "<xstr id='editor_tab_eve'>Eve</xstr>", value: @eve_stuff }, ! { name: "<xstr id='editor_tab_inspector'>Inspector</xstr>", value: @inspector_stuff }, ! { name: "<xstr id='editor_tab_results'>Results</xstr>", value: @results_stuff }, ! { name: "<xstr id='editor_tab_errors'>Errors</xstr>", value: @errors_stuff } ! ]) ! { ! panel(bind: @tab_group_visible, value: @adam_stuff) ! { ! edit_text(bind: @adam_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! row(vertical: align_bottom) ! { ! button(name: "<xstr id='editor_button_update'>Update</xstr>", bind: @adam_expression, action: @update_adam); ! button(name: "<xstr id='editor_button_save'>Save</xstr>", bind: @adam_expression, action: @save_adam); ! } ! } ! panel(bind: @tab_group_visible, value: @eve_stuff) ! { ! edit_text(bind: @eve_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! row(vertical: align_bottom) ! { ! button(name: "<xstr id='editor_button_update'>Update</xstr>", bind: @eve_expression, action: @update_eve); ! button(name: "<xstr id='editor_button_save'>Save</xstr>", bind: @eve_expression, action: @save_eve); ! } ! } ! panel(bind: @tab_group_visible, value: @inspector_stuff) ! { ! row(vertical: align_top, horizontal: align_fill) ! { ! edit_text(bind: @inspector_expression, name: "<xstr id='editor_inspector_expression'>Expression:</xstr>", characters: 30, horizontal: align_fill); ! button( horizontal: align_right, ! items: [ ! { name: "<xstr id='editor_inspector_execute'>Execute</xstr>", bind: @inspector_expression, action: @inspector }, ! { name: "<xstr id='editor_inspector_dump'>Dump</xstr>", bind: @inspector_expression, action: @inspector_dump, modifiers: @opt }, ! { name: "<xstr id='editor_inspector_version'>Version</xstr>", bind: @inspector_expression, action: @version_info, modifiers: @cmd } ! ]); ! } ! ! edit_text(name: "<xstr id='editor_inspector_results'>Results:</xstr>", bind: @inspector_results, lines: 10, characters: 30, ! scrollable: true, monospaced: true, vertical: align_fill, horizontal: align_fill); ! } ! panel(bind: @tab_group_visible, value: @results_stuff) ! { ! edit_text(bind: @results_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! } ! panel(bind: @tab_group_visible, value: @errors_stuff) ! { ! edit_text(bind: @errors_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! } ! } ! } ! } \ No newline at end of file --- 1,72 ---- /* ! Copyright 2005-2006 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) */ layout editor { ! view dialog( name: "<xstr id='editor_dialog_title'>Editor</xstr>", ! size: @size_small, placement: place_column, grow: true, horizontal: align_fill, vertical: align_fill) ! { ! tab_group( bind: @tab_group_visible, vertical: align_fill, horizontal: align_fill, ! items: ! [ ! { name: "<xstr id='editor_tab_adam'>Adam</xstr>", value: @adam_stuff }, ! { name: "<xstr id='editor_tab_eve'>Eve</xstr>", value: @eve_stuff }, ! { name: "<xstr id='editor_tab_inspector'>Inspector</xstr>", value: @inspector_stuff }, ! { name: "<xstr id='editor_tab_results'>Results</xstr>", value: @results_stuff }, ! { name: "<xstr id='editor_tab_errors'>Errors</xstr>", value: @errors_stuff } ! ]) ! { ! panel(bind: @tab_group_visible, value: @adam_stuff) ! { ! edit_text(bind: @adam_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! row(vertical: align_bottom) ! { ! button(name: "<xstr id='editor_button_update'>Update</xstr>", bind: @adam_expression, action: @update_adam); ! button(name: "<xstr id='editor_button_save'>Save</xstr>", bind: @adam_expression, action: @save_adam); ! } ! } ! panel(bind: @tab_group_visible, value: @eve_stuff) ! { ! edit_text(bind: @eve_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! row(vertical: align_bottom) ! { ! button(name: "<xstr id='editor_button_update'>Update</xstr>", bind: @eve_expression, action: @update_eve); ! button(name: "<xstr id='editor_button_save'>Save</xstr>", bind: @eve_expression, action: @save_eve); ! } ! } ! panel(bind: @tab_group_visible, value: @inspector_stuff) ! { ! row(vertical: align_top, horizontal: align_fill) ! { ! edit_text(bind: @inspector_expression, name: "<xstr id='editor_inspector_expression'>Expression:</xstr>", characters: 1, horizontal: align_fill); ! button( horizontal: align_right, ! items: [ ! { name: "<xstr id='editor_inspector_execute'>Execute</xstr>", bind: @inspector_expression, action: @inspector }, ! { name: "<xstr id='editor_inspector_dump'>Dump</xstr>", bind: @inspector_expression, action: @inspector_dump, modifiers: @opt }, ! { name: "<xstr id='editor_inspector_version'>Version</xstr>", bind: @inspector_expression, action: @version_info, modifiers: @cmd } ! ]); ! } ! ! edit_text( name: "<xstr id='editor_inspector_results'>Results:</xstr>", bind: @inspector_results, lines: 10, characters: 1, ! scrollable: true, monospaced: true, vertical: align_fill, horizontal: align_fill); ! } ! panel(bind: @tab_group_visible, value: @results_stuff) ! { ! edit_text(bind: @results_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! } ! panel(bind: @tab_group_visible, value: @errors_stuff) ! { ! edit_text(bind: @errors_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); ! } ! } ! } ! } --- NEW FILE: begin.exe.msvc8.release.manifest --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="*" version="1.0.0.0" type="win32" name="AdobeSystems.AdobeSourceLibraries.Begin" /> <description>Adobe Begin Copyright 2005-2006 Adobe Systems Incorporated</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*" /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' language="*" processorArchitecture='*' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly> Index: resources.rc =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/resources.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** resources.rc 2 Dec 2005 02:59:16 -0000 1.3 --- resources.rc 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 7,16 **** #if ADOBE_VER == 8 #ifndef NDEBUG ! MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\msvc8.debug.begin.exe.manifest" #else ! MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\msvc8.release.begin.exe.manifest" #endif #else ! CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\msvc7.begin.exe.manifest" #endif --- 7,16 ---- #if ADOBE_VER == 8 #ifndef NDEBUG ! MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\begin.exe.msvc8.debug.manifest" #else ! MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\begin.exe.msvc8.release.manifest" #endif #else ! CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\begin.exe.msvc7.manifest" #endif --- NEW FILE: begin.exe.msvc8.debug.manifest --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="*" version="1.0.0.0" type="win32" name="AdobeSystems.AdobeSourceLibraries.Begin" /> <description>Adobe Begin Copyright 2005-2006 Adobe Systems Incorporated</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*" /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' language="*" processorArchitecture='*' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly> Index: editor.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/editor.adm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor.adm 6 Jan 2006 18:03:01 -0000 1.4 --- editor.adm 3 Feb 2006 18:33:38 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 8,26 **** { interface: ! tab_group_visible : @adam_stuff; ! adam_expression : ""; ! eve_expression : ""; ! results_expression : ""; ! errors_expression : ""; ! inspector_expression : ""; ! inspector_results : ""; ! adam_dirty : false; ! eve_dirty : false; invariant: ! adam_non_empty <== adam_expression != ""; ! eve_non_empty <== eve_expression != ""; ! expression_non_empty <== inspector_expression != ""; } --- 8,26 ---- { interface: ! tab_group_visible : @adam_stuff; ! adam_expression : ""; ! eve_expression : ""; ! results_expression : ""; ! errors_expression : ""; ! inspector_expression : ""; ! inspector_results : ""; ! adam_dirty : false; ! eve_dirty : false; invariant: ! adam_non_empty <== adam_expression != ""; ! eve_non_empty <== eve_expression != ""; ! expression_non_empty <== inspector_expression != ""; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/conceptspace In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/gil/extension/conceptspace Modified Files: any_standard_image.hpp Log Message: asl 1.0.13 Index: any_standard_image.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/conceptspace/any_standard_image.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** any_standard_image.hpp 6 Jan 2006 18:02:59 -0000 1.1 --- any_standard_image.hpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 11,18 **** //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Non-templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// --- 11,18 ---- //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Non-templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// *************** *** 29,33 **** /// \ingroup DynamicImage ! template <typename T> inline unsigned channel_typeid(); // unknown channel type template<> inline unsigned channel_typeid<bits8> () { return 0; } template<> inline unsigned channel_typeid<bits16>() { return 1; } --- 29,33 ---- /// \ingroup DynamicImage ! template <typename T> inline unsigned channel_typeid(); // unknown channel type template<> inline unsigned channel_typeid<bits8> () { return 0; } template<> inline unsigned channel_typeid<bits16>() { return 1; } *************** *** 40,51 **** /// \ingroup DynamicImage ! template <typename T> struct x_iterator_typeid { static const unsigned value=0; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgb_tag>*> { static const unsigned value=1; }; ! template <typename T> struct x_iterator_typeid<pixel<T,bgr_tag>*> { static const unsigned value=2; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgb_tag> > { static const unsigned value=3; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgba_tag>*> { static const unsigned value=4; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgba_tag> > { static const unsigned value=5; }; ! template <typename T> struct x_iterator_typeid<pixel<T,cmyk_tag>*> { static const unsigned value=6; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,cmyk_tag> > { static const unsigned value=7; }; static const int num_pixel_types=8; template <typename I> struct x_iterator_typeid<pixel_step_iterator<I> > { static const unsigned value=num_pixel_types+x_iterator_typeid<I>::value; }; --- 40,51 ---- /// \ingroup DynamicImage ! template <typename T> struct x_iterator_typeid { static const unsigned value=0; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgb_tag>*> { static const unsigned value=1; }; ! template <typename T> struct x_iterator_typeid<pixel<T,bgr_tag>*> { static const unsigned value=2; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgb_tag> > { static const unsigned value=3; }; ! template <typename T> struct x_iterator_typeid<pixel<T,rgba_tag>*> { static const unsigned value=4; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,rgba_tag> > { static const unsigned value=5; }; ! template <typename T> struct x_iterator_typeid<pixel<T,cmyk_tag>*> { static const unsigned value=6; }; ! template <typename T> struct x_iterator_typeid<planar_ptr<T,cmyk_tag> > { static const unsigned value=7; }; static const int num_pixel_types=8; template <typename I> struct x_iterator_typeid<pixel_step_iterator<I> > { static const unsigned value=num_pixel_types+x_iterator_typeid<I>::value; }; *************** *** 56,76 **** // - must have a copy constructor, assignment and equality ! template <typename DERIVED, size_t MAX_BASE_SIZE> struct AnyImageConceptSpaceBase : public StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> { typedef StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> parent_type; typedef typename parent_type::type_id type_id; ! static type_id get_invalid_id() { return (unsigned)-1; } protected: ! /// \brief maps the template parameters of an image view to the non-negative integers ! template <typename V> static type_id get_view_type_id() { ! return x_iterator_typeid<typename V::x_iterator>::value * num_channel_types + channel_typeid<typename boost::remove_const<typename V::channel_type>::type>(); ! } }; // we need the size of the largest image and view so we know how much space to allocate for their bases ! #define LARGEST_IMAGE GIL::cmyk32_planar_image ! #define LARGEST_VIEW GIL::cmyk32_planar_step_view // Concept space of standard view that disallow modifying their pixels --- 56,76 ---- // - must have a copy constructor, assignment and equality ! template <typename DERIVED, std::size_t MAX_BASE_SIZE> struct AnyImageConceptSpaceBase : public StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> { typedef StackBasedConceptSpacePolicy<DERIVED, unsigned, MAX_BASE_SIZE> parent_type; typedef typename parent_type::type_id type_id; ! static type_id get_invalid_id() { return (unsigned)-1; } protected: ! /// \brief maps the template parameters of an image view to the non-negative integers ! template <typename V> static type_id get_view_type_id() { ! return x_iterator_typeid<typename V::x_iterator>::value * num_channel_types + channel_typeid<typename boost::remove_const<typename V::channel_type>::type>(); ! } }; // we need the size of the largest image and view so we know how much space to allocate for their bases ! #define LARGEST_IMAGE GIL::cmyk32_planar_image ! #define LARGEST_VIEW GIL::cmyk32_planar_step_view // Concept space of standard view that disallow modifying their pixels *************** *** 80,198 **** typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#endif }; --- 80,198 ---- typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8c_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16c_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32c_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8c_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16c_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32c_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8c_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16c_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32c_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8c_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16c_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32c_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8c_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16c_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32c_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8c_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16c_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32c_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8c_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16c_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32c_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8c_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16c_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32c_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8c_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16c_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32c_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8c_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16c_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32c_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8c_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16c_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32c_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8c_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16c_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32c_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8c_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16c_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32c_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8c_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16c_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32c_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8c_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16c_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32c_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8c_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16c_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32c_planar_step_view& >(img)); break; ! default: ! throw std::bad_cast(); ! } ! } //#endif }; *************** *** 204,320 **** typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#endif }; --- 204,320 ---- typedef parent_type::type_id type_id; typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_type; template <typename IMG> static type_id get_type_id() { return get_view_type_id<IMG>(); } ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(const base_type& img, type_id id, const OP& op) { ! switch (id) { ! case 0: return op(reinterpret_cast<const gray8_view& >(img)); break; ! case 1: return op(reinterpret_cast<const gray16_view& >(img)); break; ! case 2: return op(reinterpret_cast<const gray32_view& >(img)); break; ! case 3: return op(reinterpret_cast<const rgb8_view& >(img)); break; ! case 4: return op(reinterpret_cast<const rgb16_view& >(img)); break; ! case 5: return op(reinterpret_cast<const rgb32_view& >(img)); break; ! case 6: return op(reinterpret_cast<const bgr8_view& >(img)); break; ! case 7: return op(reinterpret_cast<const bgr16_view& >(img)); break; ! case 8: return op(reinterpret_cast<const bgr32_view& >(img)); break; ! case 9: return op(reinterpret_cast<const rgb8_planar_view& >(img)); break; ! case 10: return op(reinterpret_cast<const rgb16_planar_view& >(img)); break; ! case 11: return op(reinterpret_cast<const rgb32_planar_view& >(img)); break; ! case 12: return op(reinterpret_cast<const rgba8_view& >(img)); break; ! case 13: return op(reinterpret_cast<const rgba16_view& >(img)); break; ! case 14: return op(reinterpret_cast<const rgba32_view& >(img)); break; ! case 15: return op(reinterpret_cast<const rgba8_planar_view& >(img)); break; ! case 16: return op(reinterpret_cast<const rgba16_planar_view& >(img)); break; ! case 17: return op(reinterpret_cast<const rgba32_planar_view& >(img)); break; ! case 18: return op(reinterpret_cast<const cmyk8_view& >(img)); break; ! case 19: return op(reinterpret_cast<const cmyk16_view& >(img)); break; ! case 20: return op(reinterpret_cast<const cmyk32_view& >(img)); break; ! case 21: return op(reinterpret_cast<const cmyk8_planar_view& >(img)); break; ! case 22: return op(reinterpret_cast<const cmyk16_planar_view& >(img)); break; ! case 23: return op(reinterpret_cast<const cmyk32_planar_view& >(img)); break; ! case 24: return op(reinterpret_cast<const gray8_step_view& >(img)); break; ! case 25: return op(reinterpret_cast<const gray16_step_view& >(img)); break; ! case 26: return op(reinterpret_cast<const gray32_step_view& >(img)); break; ! case 27: return op(reinterpret_cast<const rgb8_step_view& >(img)); break; ! case 28: return op(reinterpret_cast<const rgb16_step_view& >(img)); break; ! case 29: return op(reinterpret_cast<const rgb32_step_view& >(img)); break; ! case 30: return op(reinterpret_cast<const bgr8_step_view& >(img)); break; ! case 31: return op(reinterpret_cast<const bgr16_step_view& >(img)); break; ! case 32: return op(reinterpret_cast<const bgr32_step_view& >(img)); break; ! case 33: return op(reinterpret_cast<const rgb8_planar_step_view& >(img)); break; ! case 34: return op(reinterpret_cast<const rgb16_planar_step_view& >(img)); break; ! case 35: return op(reinterpret_cast<const rgb32_planar_step_view& >(img)); break; ! case 36: return op(reinterpret_cast<const rgba8_step_view& >(img)); break; ! case 37: return op(reinterpret_cast<const rgba16_step_view& >(img)); break; ! case 38: return op(reinterpret_cast<const rgba32_step_view& >(img)); break; ! case 39: return op(reinterpret_cast<const rgba8_planar_step_view& >(img)); break; ! case 40: return op(reinterpret_cast<const rgba16_planar_step_view& >(img)); break; ! case 41: return op(reinterpret_cast<const rgba32_planar_step_view& >(img)); break; ! case 42: return op(reinterpret_cast<const cmyk8_step_view& >(img)); break; ! case 43: return op(reinterpret_cast<const cmyk16_step_view& >(img)); break; ! case 44: return op(reinterpret_cast<const cmyk32_step_view& >(img)); break; ! case 45: return op(reinterpret_cast<const cmyk8_planar_step_view& >(img)); break; ! case 46: return op(reinterpret_cast<const cmyk16_planar_step_view& >(img)); break; ! case 47: return op(reinterpret_cast<const cmyk32_planar_step_view& >(img)); break; ! default: throw std::bad_cast(); ! } ! } //#endif }; *************** *** 326,338 **** typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_view_concept_space; ! typedef AnyImageViewConceptSpace view_concept_space; ! /// \brief maps the template parameters of an image to the non-negative integers ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<typename IMG::view_type>(); } ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; --- 326,338 ---- typedef parent_type::base_type base_type; ! typedef AnyConstImageViewConceptSpace const_view_concept_space; ! typedef AnyImageViewConceptSpace view_concept_space; ! /// \brief maps the template parameters of an image to the non-negative integers ! template <typename IMG> static type_id get_type_id() { return get_view_type_id<typename IMG::view_type>(); } ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; *************** *** 393,399 **** } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, const OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; --- 393,399 ---- } //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP> ! static typename OP::result_type apply(base_type& img, type_id id, const OP& op) { ! switch (id) { case 0: return op(reinterpret_cast<gray8_image& >(img)); break; case 1: return op(reinterpret_cast<gray16_image& >(img)); break; |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/begin/headers Modified Files: express_viewer.hpp latch.hpp report_exception.hpp Log Message: asl 1.0.13 Index: latch.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers/latch.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** latch.hpp 6 Jan 2006 18:03:01 -0000 1.3 --- latch.hpp 3 Feb 2006 18:33:38 -0000 1.4 *************** *** 1,11 **** /* ! Copyright 2005-2006 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_LATCH_HPP #define ADOBE_LATCH_HPP --- 1,11 ---- /* ! Copyright 2005-2006 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_LATCH_HPP #define ADOBE_LATCH_HPP *************** *** 26,81 **** struct latch_t { ! typedef ValueType value_type; ! typedef boost::function<void (const value_type&, bool)> trigger_t; ! typedef boost::function<void (bool)> valid_t; ! template <typename TriggerFunction, typename ValidFunction> ! latch_t(const TriggerFunction& trigger, const ValidFunction& valid) : ! trigger_m(trigger), valid_m(valid), force_m(true) ! { } ! latch_t(const latch_t&) : force_m(true) ! { } ! latch_t& operator = (const latch_t&) ! { ! // Clear connections on copy ! force_m = false; ! trigger_m = trigger_t(); ! valid_m = valid_t(); ! return *this; ! } ! template <typename TriggerFunction, typename ValidFunction> ! void attach(const TriggerFunction& trigger, const ValidFunction& valid) ! { ! trigger_m = trigger; ! valid_m = valid; ! } ! void set_value(const value_t& new_value, bool is_valid) ! { ! if (is_valid != is_valid_m || force_m) valid_m(is_valid); ! value_m = new_value; ! is_valid_m = is_valid; ! force_m = false; ! } ! void trigger() const ! { ! /* REVISIT (sparent) : should this conditional simply be a pre-condition */ ! if (!force_m) trigger_m(value_m, is_valid_m); ! } private: ! value_type value_m; ! bool is_valid_m; ! bool force_m; ! trigger_t trigger_m; ! valid_t valid_m; }; --- 26,81 ---- struct latch_t { ! typedef ValueType value_type; ! typedef boost::function<void (const value_type&, bool)> trigger_t; ! typedef boost::function<void (bool)> valid_t; ! template <typename TriggerFunction, typename ValidFunction> ! latch_t(const TriggerFunction& trigger, const ValidFunction& valid) : ! trigger_m(trigger), valid_m(valid), force_m(true) ! { } ! latch_t(const latch_t&) : force_m(true) ! { } ! latch_t& operator = (const latch_t&) ! { ! // Clear connections on copy ! force_m = false; ! trigger_m = trigger_t(); ! valid_m = valid_t(); ! return *this; ! } ! template <typename TriggerFunction, typename ValidFunction> ! void attach(const TriggerFunction& trigger, const ValidFunction& valid) ! { ! trigger_m = trigger; ! valid_m = valid; ! } ! void set_value(const value_t& new_value, bool is_valid) ! { ! if (is_valid != is_valid_m || force_m) valid_m(is_valid); ! value_m = new_value; ! is_valid_m = is_valid; ! force_m = false; ! } ! void trigger() const ! { ! /* REVISIT (sparent) : should this conditional simply be a pre-condition */ ! if (!force_m) trigger_m(value_m, is_valid_m); ! } private: ! value_type value_m; ! bool is_valid_m; ! bool force_m; ! trigger_t trigger_m; ! valid_t valid_m; }; Index: report_exception.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers/report_exception.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** report_exception.hpp 24 Jan 2006 19:38:50 -0000 1.4 --- report_exception.hpp 3 Feb 2006 18:33:38 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 43,63 **** inline void report_exception() { ! std::string err("Exception: "); ! try { throw; } ! catch (const adobe::stream_error_t& error) ! { ! err += format_stream_error(error); ! } ! catch (const std::exception& error) ! { ! err += error.what(); ! } ! catch (...) ! { ! err += "Unknown."; ! } ! adobe::report_ui_element_error(err); } --- 43,63 ---- inline void report_exception() { ! std::string err("Exception: "); ! try { throw; } ! catch (const adobe::stream_error_t& error) ! { ! err += format_stream_error(error); ! } ! catch (const std::exception& error) ! { ! err += error.what(); ! } ! catch (...) ! { ! err += "Unknown."; ! } ! adobe::report_ui_element_error(err); } Index: express_viewer.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers/express_viewer.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** express_viewer.hpp 24 Jan 2006 19:38:50 -0000 1.7 --- express_viewer.hpp 3 Feb 2006 18:33:38 -0000 1.8 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 40,51 **** /// demo application. /// ! /// \param stream the stream to extract data from. ! /// \return all of the data in the stream. // /* ! REVISIT (sparent) : The lf handling should be moved down into where ever this data is going - ! In this case into a UI widget. The general rule should everything should be agnostic about ! line endings on read. And everything should write Unix style (just '\n') line endings. */ --- 40,51 ---- /// demo application. /// ! /// \param stream the stream to extract data from. ! /// \return all of the data in the stream. // /* ! REVISIT (sparent) : The lf handling should be moved down into where ever this data is going - ! In this case into a UI widget. The general rule should everything should be agnostic about ! line endings on read. And everything should write Unix style (just '\n') line endings. */ *************** *** 54,83 **** { #if ADOBE_PLATFORM_MAC ! const char platform_lf('\r'); #else ! const char platform_lf('\n'); // Windows seems to handle this fine #endif ! std::string result; ! if ( stream.is_open() ) ! { ! stream.unsetf(std::ios_base::skipws); ! ! std::istream_iterator<char> first(stream); ! std::istream_iterator<char> last; ! ! while (first != last) { ! if (is_line_end(first, last)) ! { ! result.append(1, platform_lf); ! continue; ! } ! result.append(1, *first); ! ++first; ! } ! } ! return result; } --- 54,83 ---- { #if ADOBE_PLATFORM_MAC ! const char platform_lf('\r'); #else ! const char platform_lf('\n'); // Windows seems to handle this fine #endif ! std::string result; ! if ( stream.is_open() ) ! { ! stream.unsetf(std::ios_base::skipws); ! ! std::istream_iterator<char> first(stream); ! std::istream_iterator<char> last; ! ! while (first != last) { ! if (is_line_end(first, last)) ! { ! result.append(1, platform_lf); ! continue; ! } ! result.append(1, *first); ! ++first; ! } ! } ! return result; } *************** *** 89,260 **** { public: ! enum line_ending_t ! { ! line_ending_unknown_k = 0, ! line_ending_platform_k = 1 << 0L, ! line_ending_unix_k = 1 << 1L, // LF ! line_ending_windows_k = 1 << 2L, // CR+LF ! line_ending_mac_os_classic_k = 1 << 3L, // CR ! line_ending_mac_os_x_k = line_ending_unix_k // LF ! }; ! typedef boost::function<void (bool)> dirty_proc_t; ! file_buffer_t() : ! le_m(line_ending_unknown_k) ! { } ! void set_path(const boost::filesystem::path& path) ! { ! path_m = path; ! adobe::file_slurp<char> slurp(path_m); ! contents_m.assign(slurp.begin(), slurp.end()); ! set_line_endings_impl(le_m, true); ! set_dirty(false); ! } ! // NOTE (fbrereto) : Mat Marcus made me do it! ! const boost::filesystem::path& get_path() const ! { return path_m; } ! template <typename I> ! void set_contents(I first, I last) ! { ! contents_m.assign(first, last); ! set_dirty(true); ! } ! inline void set_line_endings(line_ending_t le, bool force = false) ! { ! set_line_endings_impl(le, force); ! set_dirty(true); ! } ! void save() ! { ! if (!dirty_m) return; ! bfs::ofstream output( path_m, std::ios_base::out | std::ios_base::binary ); ! // ! // Verify that we were able to open the file for writing. ! // ! if ( output.fail() ) ! throw std::runtime_error( "Error opening file for writing: \"" ! + path_m.string() + "\"" ); ! if (le_m == line_ending_unknown_k) ! set_line_endings(le_m); ! output << contents_m; ! set_dirty(false); ! } ! void monitor_dirty(dirty_proc_t proc) ! { dirty_proc_m = proc; } ! bfs::path directory_path() const ! { return path_m.branch_path(); } ! const char* file_name() const ! { ! return path_m.string().c_str(); ! } ! bool valid() const ! { return bfs::exists(path_m); } ! inline const std::string& as_string() const ! { return contents_m; } private: ! void set_dirty(bool to) ! { ! if (dirty_m == to) return; ! dirty_m = to; ! if (dirty_proc_m) ! dirty_proc_m(dirty_m); ! } ! void replace_all(const char* src, const char* dst) ! { ! // replaces all instances of src with dst ! std::string::size_type result(0); ! std::size_t src_n(std::strlen(src)); ! std::size_t dst_n(std::strlen(dst)); ! while (true) ! { ! result = contents_m.find(src, result); ! if (result == std::string::npos) break; ! contents_m.replace(result, src_n, dst, dst_n); ! result += dst_n; ! } ! } ! void set_line_endings_impl(line_ending_t le, bool force = false) ! { ! if (le_m == le && !force && ! le_m != line_ending_unknown_k) return; ! if (le == line_ending_platform_k || le == line_ending_unknown_k) ! { #if ADOBE_PLATFORM_WIN ! le_m = line_ending_windows_k; #else ! le_m = line_ending_unix_k; #endif ! } ! else ! { ! le_m = le; ! } ! // REVISIT (fbrereto) : Not as optimal as it could be. ! if (le_m == line_ending_unix_k) ! { ! replace_all("\r\n", "\n"); ! replace_all("\r", "\n"); ! } ! else if (le_m == line_ending_windows_k) ! { ! replace_all("\r\n", "\n"); ! replace_all("\r", "\n"); ! replace_all("\n", "\r\n"); ! } ! else if (le_m == line_ending_mac_os_classic_k) ! { ! replace_all("\r\n", "\r"); ! replace_all("\n", "\r"); ! } ! else ! throw std::runtime_error("unknown line ending type"); ! // set line endings back to 'unknown' if ! // that's what they were originally ! if (le == line_ending_unknown_k) le_m = line_ending_unknown_k; ! } ! bfs::path path_m; ///< Path to the current file ! std::string contents_m; ///< Contents of the file (not necessarily same as that in file) ! bool dirty_m; ///< Dirty bit ! dirty_proc_t dirty_proc_m; ///< Dirty bit modification notifier ! line_ending_t le_m; ///< Line ending flags }; --- 89,260 ---- { public: ! enum line_ending_t ! { ! line_ending_unknown_k = 0, ! line_ending_platform_k = 1 << 0L, ! line_ending_unix_k = 1 << 1L, // LF ! line_ending_windows_k = 1 << 2L, // CR+LF ! line_ending_mac_os_classic_k = 1 << 3L, // CR ! line_ending_mac_os_x_k = line_ending_unix_k // LF ! }; ! typedef boost::function<void (bool)> dirty_proc_t; ! file_buffer_t() : ! le_m(line_ending_unknown_k) ! { } ! void set_path(const boost::filesystem::path& path) ! { ! path_m = path; ! adobe::file_slurp<char> slurp(path_m); ! contents_m.assign(slurp.begin(), slurp.end()); ! set_line_endings_impl(le_m, true); ! set_dirty(false); ! } ! // NOTE (fbrereto) : Mat Marcus made me do it! ! const boost::filesystem::path& get_path() const ! { return path_m; } ! template <typename I> ! void set_contents(I first, I last) ! { ! contents_m.assign(first, last); ! set_dirty(true); ! } ! inline void set_line_endings(line_ending_t le, bool force = false) ! { ! set_line_endings_impl(le, force); ! set_dirty(true); ! } ! void save() ! { ! if (!dirty_m) return; ! bfs::ofstream output( path_m, std::ios_base::out | std::ios_base::binary ); ! // ! // Verify that we were able to open the file for writing. ! // ! if ( output.fail() ) ! throw std::runtime_error( "Error opening file for writing: \"" ! + path_m.string() + "\"" ); ! if (le_m == line_ending_unknown_k) ! set_line_endings(le_m); ! output << contents_m; ! set_dirty(false); ! } ! void monitor_dirty(dirty_proc_t proc) ! { dirty_proc_m = proc; } ! bfs::path directory_path() const ! { return path_m.branch_path(); } ! const char* file_name() const ! { ! return path_m.string().c_str(); ! } ! bool valid() const ! { return bfs::exists(path_m); } ! inline const std::string& as_string() const ! { return contents_m; } private: ! void set_dirty(bool to) ! { ! if (dirty_m == to) return; ! dirty_m = to; ! if (dirty_proc_m) ! dirty_proc_m(dirty_m); ! } ! void replace_all(const char* src, const char* dst) ! { ! // replaces all instances of src with dst ! std::string::size_type result(0); ! std::size_t src_n(std::strlen(src)); ! std::size_t dst_n(std::strlen(dst)); ! while (true) ! { ! result = contents_m.find(src, result); ! if (result == std::string::npos) break; ! contents_m.replace(result, src_n, dst, dst_n); ! result += dst_n; ! } ! } ! void set_line_endings_impl(line_ending_t le, bool force = false) ! { ! if (le_m == le && !force && ! le_m != line_ending_unknown_k) return; ! if (le == line_ending_platform_k || le == line_ending_unknown_k) ! { #if ADOBE_PLATFORM_WIN ! le_m = line_ending_windows_k; #else ! le_m = line_ending_unix_k; #endif ! } ! else ! { ! le_m = le; ! } ! // REVISIT (fbrereto) : Not as optimal as it could be. ! if (le_m == line_ending_unix_k) ! { ! replace_all("\r\n", "\n"); ! replace_all("\r", "\n"); ! } ! else if (le_m == line_ending_windows_k) ! { ! replace_all("\r\n", "\n"); ! replace_all("\r", "\n"); ! replace_all("\n", "\r\n"); ! } ! else if (le_m == line_ending_mac_os_classic_k) ! { ! replace_all("\r\n", "\r"); ! replace_all("\n", "\r"); ! } ! else ! throw std::runtime_error("unknown line ending type"); ! // set line endings back to 'unknown' if ! // that's what they were originally ! if (le == line_ending_unknown_k) le_m = line_ending_unknown_k; ! } ! bfs::path path_m; ///< Path to the current file ! std::string contents_m; ///< Contents of the file (not necessarily same as that in file) ! bool dirty_m; ///< Dirty bit ! dirty_proc_t dirty_proc_m; ///< Dirty bit modification notifier ! line_ending_t le_m; ///< Line ending flags }; *************** *** 272,435 **** class application_t { ! bfs::path _resource_dir_m; ///< The directory containing this applications resource files (i.e.: editor.adm, editor.eve). ! file_buffer_t _eve_file_m; ///< The file buffer for manipulating the current Eve definition. ! file_buffer_t _adam_file_m; ///< The file buffer for manipulating the current Adam definition. ! adobe::sheet_t* _sheet_m; ///< The sheet we are viewing. ! eve_client::window_server_t* _holder_m; ///< Contains Eve instance, and all instanciated widgets. ! adobe::sheet_t* _editor_sheet_m; ///< The sheet for this editor program. ! size_enum_t _dialog_size_m; ///< The size of dialog to create. ! bool _initialized; ///< Are we initialized yet? ! // ! /// This constructor is private to ensure that the getInstance ! /// method is used to return a reference to this class. ! // ! application_t(); ! // ! /// This destructor releases any allocated sheets and Eve bits. ! // ! ~application_t(); ! // ! /// Initialize the application_t by attempting to load resources from ! /// disk. This also calls os_initialize, to perform any OS-specific ! /// initialization which may be required. ! /// ! /// \return true if the initialization is successful, false otherwise. ! /// \sa os_initialize ! // ! bool _initialize(); ! // ! /// This function gets invoked whenever an action (e.g.: a button with ! /// "action: @ok" defined) is unhandled by Adam. It is registered with ! /// _holder_m by initialize(). Currently this function simply writes the ! /// given value into the output text area. ! /// ! /// \param name the name of the action (e.g.: "ok", "cancel"). ! /// \param value any parameter associated with the value. ! /// ! /// \sa _holder_m ! // ! void _button_notifier( const adobe::name_t& name, const adobe::value_t& value ); ! // ! /// This function handles most editor operations, as defined in the ! /// editor's Eve file. ! /// ! /// \param name the name of the operation to perform. ! /// \param value a dictionary containing the value specific to the operation. ! // ! void _editor_op( adobe::name_t name, const adobe::value_t& value ); ! // ! /// This function handles file manipulation dirty status by sending ! /// it to the editor window to toggle the "save" button(s). ! /// ! /// \param dirty_cell_name the name of the celll to set ! /// \param dirty whether or not the file is dirty ! // ! void _monitor_file_dirty( adobe::name_t dirty_cell_name, bool dirty ); ! // ! /// Looks up the filebuffer_t for the path specified ! /// ! /// \param file_path the name of the celll to set ! // ! const adobe::file_buffer_t& _file_lookup( adobe::name_t file_path ); public: - // - /// The getInstance method returns a pointer to the single application_t - /// instance. If the application_t cannot be initialized then NULL is - /// returned. Initialization will fail if: - /// <ul> - /// <li>The editor.adm and editor.eve files cannot be found</li> - /// <li>The editor.adm and editor.eve files do not parse</li> - /// <li>OS-specific initialization fails</li> - /// </ul> - /// - /// \return a pointer to the single application_t instance. - /// \sa os_initialize - // - static application_t* getInstance(); - // - /// Load the main editor GUI and enter the main-loop. This function - /// will not return until it's time to quit. - // - void run(); - // - /// Load the dialog from disk, and tell the _holder_m to show it. This - /// function also updates the contents of the Eve text area to match what - /// was loaded from disk. The window loaded is specified by set_eve_file. - /// - /// \sa set_eve_file - // - void display_window(); - // - /// Forget about the existing sheet and load one from disk. This also - /// (re)opens the dialog. The sheet loaded is specified by set_adam_file. - /// - /// \sa set_adam_file - // - void load_sheet(); - // - /// Remove any frames which have been drawn around the widgets. - // - void clear_window_frames(); - // - /// Draw frames around all widgets. - // - void frame_window(); - // - /// Serialize all of the widgets and connections into text and show the - /// text in the Results text area. - // - void serialize_connections(); - // - /// Runs the currently selected Adam/Eve pair as a modal dialog - /// using the modal dialog interface API suite. - // - void run_current_as_modal(); - // - /// Set the file name of the Eve file to load. This does not actually - /// load the file or display the window, call display_window to make - /// that happen. - /// - /// \param file_name the name of the Eve file to load. - /// \sa display_window - // - void set_eve_file( const boost::filesystem::path& file_name ); - // - /// Set the file name of the Adam file to load. This does not actually - /// load the file or update the sheet, call load_sheet to make that - /// happen. - /// - /// \param file_name the name of the Adam file to load. - /// \sa load_sheet - // - void set_adam_file( const boost::filesystem::path& file_name ); - // - /// Set the directory which is used to load application resources - /// (such as the editor.adm and editor.eve files). - /// - /// \param res_path the directory to load application - /// resources from. - // - void set_resource_directory( const boost::filesystem::path& res_path ); - // - /// Set the size of any dialogs which are going to be created after - /// this call. - /// - /// \param s the new size to make dialogs. - // - void set_dialog_size( size_enum_t s ); - // - /// Display an error message in the error tab of the editor palette - /// - /// \param msg the message to post. - // - void display_error( const std::string& msg ); // ! /// Get the line at the given offset on the given file ! /// ! /// \param file_name the file ! /// \param line_start_position the position ! std::string application_t::format_stream_error(adobe::name_t file_name, std::streampos line_start_position); }; --- 272,435 ---- class application_t { ! bfs::path _resource_dir_m; ///< The directory containing this applications resource files (i.e.: editor.adm, editor.eve). ! file_buffer_t _eve_file_m; ///< The file buffer for manipulating the current Eve definition. ! file_buffer_t _adam_file_m; ///< The file buffer for manipulating the current Adam definition. ! adobe::sheet_t* _sheet_m; ///< The sheet we are viewing. ! eve_client::window_server_t* _holder_m; ///< Contains Eve instance, and all instanciated widgets. ! adobe::sheet_t* _editor_sheet_m; ///< The sheet for this editor program. ! size_enum_t _dialog_size_m; ///< The size of dialog to create. ! bool _initialized; ///< Are we initialized yet? ! // ! /// This constructor is private to ensure that the getInstance ! /// method is used to return a reference to this class. ! // ! application_t(); ! // ! /// This destructor releases any allocated sheets and Eve bits. ! // ! ~application_t(); ! // ! /// Initialize the application_t by attempting to load resources from ! /// disk. This also calls os_initialize, to perform any OS-specific ! /// initialization which may be required. ! /// ! /// \return true if the initialization is successful, false otherwise. ! /// \sa os_initialize ! // ! bool _initialize(); ! // ! /// This function gets invoked whenever an action (e.g.: a button with ! /// "action: @ok" defined) is unhandled by Adam. It is registered with ! /// _holder_m by initialize(). Currently this function simply writes the ! /// given value into the output text area. ! /// ! /// \param name the name of the action (e.g.: "ok", "cancel"). ! /// \param value any parameter associated with the value. ! /// ! /// \sa _holder_m ! // ! void _button_notifier( const adobe::name_t& name, const adobe::value_t& value ); ! // ! /// This function handles most editor operations, as defined in the ! /// editor's Eve file. ! /// ! /// \param name the name of the operation to perform. ! /// \param value a dictionary containing the value specific to the operation. ! // ! void _editor_op( adobe::name_t name, const adobe::value_t& value ); ! // ! /// This function handles file manipulation dirty status by sending ! /// it to the editor window to toggle the "save" button(s). ! /// ! /// \param dirty_cell_name the name of the celll to set ! /// \param dirty whether or not the file is dirty ! // ! void _monitor_file_dirty( adobe::name_t dirty_cell_name, bool dirty ); ! // ! /// Looks up the filebuffer_t for the path specified ! /// ! /// \param file_path the name of the celll to set ! // ! const adobe::file_buffer_t& _file_lookup( adobe::name_t file_path ); public: // ! /// The getInstance method returns a pointer to the single application_t ! /// instance. If the application_t cannot be initialized then NULL is ! /// returned. Initialization will fail if: ! /// <ul> ! /// <li>The editor.adm and editor.eve files cannot be found</li> ! /// <li>The editor.adm and editor.eve files do not parse</li> ! /// <li>OS-specific initialization fails</li> ! /// </ul> ! /// ! /// \return a pointer to the single application_t instance. ! /// \sa os_initialize ! // ! static application_t* getInstance(); ! // ! /// Load the main editor GUI and enter the main-loop. This function ! /// will not return until it's time to quit. ! // ! void run(); ! // ! /// Load the dialog from disk, and tell the _holder_m to show it. This ! /// function also updates the contents of the Eve text area to match what ! /// was loaded from disk. The window loaded is specified by set_eve_file. ! /// ! /// \sa set_eve_file ! // ! void display_window(); ! // ! /// Forget about the existing sheet and load one from disk. This also ! /// (re)opens the dialog. The sheet loaded is specified by set_adam_file. ! /// ! /// \sa set_adam_file ! // ! void load_sheet(); ! // ! /// Remove any frames which have been drawn around the widgets. ! // ! void clear_window_frames(); ! // ! /// Draw frames around all widgets. ! // ! void frame_window(); ! // ! /// Serialize all of the widgets and connections into text and show the ! /// text in the Results text area. ! // ! void serialize_connections(); ! // ! /// Runs the currently selected Adam/Eve pair as a modal dialog ! /// using the modal dialog interface API suite. ! // ! void run_current_as_modal(); ! // ! /// Set the file name of the Eve file to load. This does not actually ! /// load the file or display the window, call display_window to make ! /// that happen. ! /// ! /// \param file_name the name of the Eve file to load. ! /// \sa display_window ! // ! void set_eve_file( const boost::filesystem::path& file_name ); ! // ! /// Set the file name of the Adam file to load. This does not actually ! /// load the file or update the sheet, call load_sheet to make that ! /// happen. ! /// ! /// \param file_name the name of the Adam file to load. ! /// \sa load_sheet ! // ! void set_adam_file( const boost::filesystem::path& file_name ); ! // ! /// Set the directory which is used to load application resources ! /// (such as the editor.adm and editor.eve files). ! /// ! /// \param res_path the directory to load application ! /// resources from. ! // ! void set_resource_directory( const boost::filesystem::path& res_path ); ! // ! /// Set the size of any dialogs which are going to be created after ! /// this call. ! /// ! /// \param s the new size to make dialogs. ! // ! void set_dialog_size( size_enum_t s ); ! // ! /// Display an error message in the error tab of the editor palette ! /// ! /// \param msg the message to post. ! // ! void display_error( const std::string& msg ); ! // ! /// Get the line at the given offset on the given file ! /// ! /// \param file_name the file ! /// \param line_start_position the position ! std::string application_t::format_stream_error(adobe::name_t file_name, std::streampos line_start_position); }; *************** *** 448,454 **** /// function should also set the resource directory used by application_t. /// ! /// \param theApp the instance of application_t to call into when a menu item is ! /// selected, or a system event is received. ! /// \return true if initialization was successful, false otherwise. // bool os_initialize( application_t* theApp ); --- 448,454 ---- /// function should also set the resource directory used by application_t. /// ! /// \param theApp the instance of application_t to call into when a menu item is ! /// selected, or a system event is received. ! /// \return true if initialization was successful, false otherwise. // bool os_initialize( application_t* theApp ); |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/sources/mac Modified Files: display.cpp metrics.cpp ui_core_implementation.cpp ui_overlay.cpp Added Files: os_utilities.cpp Log Message: asl 1.0.13 Index: display.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/display.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** display.cpp 24 Jan 2006 19:38:47 -0000 1.4 --- display.cpp 3 Feb 2006 18:33:37 -0000 1.5 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 20,28 **** struct view_wrap { ! explicit view_wrap(HIViewRef ref) : ! ref_m(ref) ! { } ! HIViewRef ref_m; }; --- 20,28 ---- struct view_wrap { ! explicit view_wrap(HIViewRef ref) : ! ref_m(ref) ! { } ! HIViewRef ref_m; }; *************** *** 31,35 **** HIViewRef unwrap(adobe::display_t::position_t& position) { ! return (boost::any_cast<view_wrap>(position)).ref_m; } --- 31,35 ---- HIViewRef unwrap(adobe::display_t::position_t& position) { ! return (boost::any_cast<view_wrap>(position)).ref_m; } *************** *** 38,42 **** adobe::display_t::position_t wrap(HIViewRef view) { ! return adobe::display_t::position_t(view_wrap(view)); } --- 38,42 ---- adobe::display_t::position_t wrap(HIViewRef view) { ! return adobe::display_t::position_t(view_wrap(view)); } *************** *** 48,52 **** #if 0 ! #pragma mark - #endif --- 48,52 ---- #if 0 ! #pragma mark - #endif *************** *** 63,69 **** display_t& get_main_display() { ! static display_t display_s; ! return display_s; } --- 63,69 ---- display_t& get_main_display() { ! static display_t display_s; ! return display_s; } *************** *** 72,78 **** struct display_t::implementation_t { ! void erase(display_t::position_t& position); ! std::vector<HIViewRef> roots_m; }; --- 72,78 ---- struct display_t::implementation_t { ! void erase(display_t::position_t& position); ! std::vector<HIViewRef> roots_m; }; *************** *** 92,96 **** #if 0 ! #pragma mark - #endif --- 92,96 ---- #if 0 ! #pragma mark - #endif *************** *** 98,122 **** display_t::display_t() : ! object_m(new implementation_t()) ! { } display_t::~display_t() ! { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() ! { return *object_m; } const display_t::implementation_t& display_t::implementation() const ! { return *object_m; } display_t::position_t display_t::root() ! { return display_t::position_t(root_token()); } void display_t::erase(position_t& position) ! { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) ! { return insert(parent, adobe::view_for_element<HIViewRef>(element)); } /****************************************************************************************************/ --- 98,122 ---- display_t::display_t() : ! object_m(new implementation_t()) ! { } display_t::~display_t() ! { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() ! { return *object_m; } const display_t::implementation_t& display_t::implementation() const ! { return *object_m; } display_t::position_t display_t::root() ! { return display_t::position_t(root_token()); } void display_t::erase(position_t& position) ! { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) ! { return insert(parent, adobe::view_for_element<HIViewRef>(element)); } /****************************************************************************************************/ *************** *** 125,140 **** display_t::position_t display_t::insert<HIViewRef>(position_t& parent, HIViewRef& element) { ! if (parent.type() == typeid(view_wrap)) ! { ! HIViewRef parent_view(unwrap(parent)); ! ADOBE_REQUIRE_STATUS(::HIViewAddSubview(parent_view, element)); ! } ! else if (parent.type() == typeid(root_token)) ! { ! object_m->roots_m.push_back(element); ! } ! return wrap(element); } --- 125,140 ---- display_t::position_t display_t::insert<HIViewRef>(position_t& parent, HIViewRef& element) { ! if (parent.type() == typeid(view_wrap)) ! { ! HIViewRef parent_view(unwrap(parent)); ! ADOBE_REQUIRE_STATUS(::HIViewAddSubview(parent_view, element)); ! } ! else if (parent.type() == typeid(root_token)) ! { ! object_m->roots_m.push_back(element); ! } ! return wrap(element); } *************** *** 142,146 **** #if 0 ! #pragma mark - #endif --- 142,146 ---- #if 0 ! #pragma mark - #endif *************** *** 149,158 **** void display_t::implementation_t::erase(display_t::position_t&) { ! // REVISIT (fbrereto) : What should we do here? ! // 1) Call DetachSubView on the position? ! // 2) Call erase recursively for all children of the position? ! // 3) Invalidate (wipe) the position data? ! // 4) Invoke some (currently nonexistent) detach() callback for the client? ! // 4a) With what parameters, considering questions 1, 2, & 3? } --- 149,158 ---- void display_t::implementation_t::erase(display_t::position_t&) { ! // REVISIT (fbrereto) : What should we do here? ! // 1) Call DetachSubView on the position? ! // 2) Call erase recursively for all children of the position? ! // 3) Invalidate (wipe) the position data? ! // 4) Invoke some (currently nonexistent) detach() callback for the client? ! // 4a) With what parameters, considering questions 1, 2, & 3? } Index: metrics.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/metrics.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** metrics.cpp 6 Jan 2006 18:02:59 -0000 1.5 --- metrics.cpp 3 Feb 2006 18:33:37 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 26,63 **** adobe::dictionary_t widget_metrics(const std::string& xstr, const adobe::dictionary_t& context) { ! std::vector<adobe::attribute_set_t::value_type> context_attribute_set; ! if (!context.count(adobe::static_name_t("theme"))) ! context_attribute_set.push_back(std::make_pair(adobe::static_token_range("theme"), adobe::static_token_range("normal"))); ! for ( dictionary_t::const_iterator first(context.begin()), last(context.end()); ! first != last; ++first) ! { ! const char* key_c_str(first->first.get()); ! const char* value_c_str(first->second.get<adobe::name_t>().get()); ! adobe::token_range_t key(key_c_str, key_c_str + std::strlen(key_c_str)); ! adobe::token_range_t value(value_c_str, value_c_str + std::strlen(value_c_str)); ! context_attribute_set.push_back(std::make_pair(key, value)); ! } ! adobe::xstring_context_t local_context(context_attribute_set.begin(), context_attribute_set.end()); ! std::string utf8(adobe::xstring(xstr.c_str(), xstr.size())); ! if (utf8.empty()) return adobe::dictionary_t(); ! std::stringstream expression_stream(utf8); ! expression_parser parser(expression_stream, line_position_t("widget_metrics")); ! array_t expression; ! parser.require_expression(expression); ! virtual_machine_t machine; ! machine.evaluate(expression); ! return machine.back().value_m.get<adobe::dictionary_t>(); } --- 26,63 ---- adobe::dictionary_t widget_metrics(const std::string& xstr, const adobe::dictionary_t& context) { ! std::vector<adobe::attribute_set_t::value_type> context_attribute_set; ! if (!context.count(adobe::static_name_t("theme"))) ! context_attribute_set.push_back(std::make_pair(adobe::static_token_range("theme"), adobe::static_token_range("normal"))); ! for ( dictionary_t::const_iterator first(context.begin()), last(context.end()); ! first != last; ++first) ! { ! const char* key_c_str(first->first.get()); ! const char* value_c_str(first->second.get<adobe::name_t>().get()); ! adobe::token_range_t key(key_c_str, key_c_str + std::strlen(key_c_str)); ! adobe::token_range_t value(value_c_str, value_c_str + std::strlen(value_c_str)); ! context_attribute_set.push_back(std::make_pair(key, value)); ! } ! adobe::xstring_context_t local_context(context_attribute_set.begin(), context_attribute_set.end()); ! std::string utf8(adobe::xstring(xstr.c_str(), xstr.size())); ! if (utf8.empty()) return adobe::dictionary_t(); ! std::stringstream expression_stream(utf8); ! expression_parser parser(expression_stream, line_position_t("widget_metrics")); ! array_t expression; ! parser.require_expression(expression); ! virtual_machine_t machine; ! machine.evaluate(expression); ! return machine.back().value_m.get<adobe::dictionary_t>(); } Index: ui_overlay.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/ui_overlay.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ui_overlay.cpp 24 Jan 2006 19:38:47 -0000 1.5 --- ui_overlay.cpp 3 Feb 2006 18:33:37 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 24,34 **** struct overlay_data_t { ! adobe::point_2d_t origin_m; ! adobe::extents_t extents_m; }; /****************************************************************************************************/ ! typedef adobe::forest<overlay_data_t> overlay_forest_t; /****************************************************************************************************/ --- 24,34 ---- struct overlay_data_t { ! adobe::point_2d_t origin_m; ! adobe::extents_t extents_m; }; /****************************************************************************************************/ ! typedef adobe::forest<overlay_data_t> overlay_forest_t; /****************************************************************************************************/ *************** *** 36,40 **** overlay_forest_t::iterator unwrap(adobe::ui_overlay_t::position_t& position) { ! return boost::any_cast<overlay_forest_t::iterator>(position); } --- 36,40 ---- overlay_forest_t::iterator unwrap(adobe::ui_overlay_t::position_t& position) { ! return boost::any_cast<overlay_forest_t::iterator>(position); } *************** *** 43,47 **** adobe::ui_overlay_t::position_t wrap(overlay_forest_t::iterator view) { ! return adobe::ui_overlay_t::position_t(view); } --- 43,47 ---- adobe::ui_overlay_t::position_t wrap(overlay_forest_t::iterator view) { ! return adobe::ui_overlay_t::position_t(view); } *************** *** 58,114 **** struct ui_overlay_t::implementation_t { ! implementation_t(); ! ~implementation_t(); ! struct draw_element_t ! { ! enum element_type ! { ! element_type_top_left, ! element_type_top_right, ! element_type_bottom_left, ! element_type_bottom_right, ! element_type_horizontal_poi, ! element_type_vertical_poi, ! element_type_count // always be last ! }; ! draw_element_t(element_type type, const CGRect& rect, const RGBColor& color) : ! type_m(type), rect_m(rect), color_m(color) ! { } ! draw_element_t(const draw_element_t& rhs) : ! type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) ! { } ! element_type type_m; ! CGRect rect_m; ! RGBColor color_m; ! }; ! typedef std::vector<draw_element_t> draw_element_set_t; ! position_t root(HIViewRef& element); ! position_t insert(position_t parent); ! void place(position_t node, const point_2d_t& origin, const extents_t& extents); ! void framing(bool do_framing); ! overlay_data_t flatten_overlay_data(overlay_forest_t::iterator iter); ! void tick_extents(const overlay_data_t& overlay_data, draw_element_set_t& set); ! void overlay_bounds_update(); ! void draw_tick(CGContextRef context, const draw_element_set_t::value_type& element); ! WindowRef overlay_m; ! WindowRef source_m; ! ControlRef control_m; ! bool framing_m; ! overlay_forest_t tree_m; }; --- 58,114 ---- struct ui_overlay_t::implementation_t { ! implementation_t(); ! ~implementation_t(); ! struct draw_element_t ! { ! enum element_type ! { ! element_type_top_left, ! element_type_top_right, ! element_type_bottom_left, ! element_type_bottom_right, ! element_type_horizontal_poi, ! element_type_vertical_poi, ! element_type_count // always be last ! }; ! draw_element_t(element_type type, const CGRect& rect, const RGBColor& color) : ! type_m(type), rect_m(rect), color_m(color) ! { } ! draw_element_t(const draw_element_t& rhs) : ! type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) ! { } ! element_type type_m; ! CGRect rect_m; ! RGBColor color_m; ! }; ! typedef std::vector<draw_element_t> draw_element_set_t; ! position_t root(HIViewRef& element); ! position_t insert(position_t parent); ! void place(position_t node, const point_2d_t& origin, const extents_t& extents); ! void framing(bool do_framing); ! overlay_data_t flatten_overlay_data(overlay_forest_t::iterator iter); ! void tick_extents(const overlay_data_t& overlay_data, draw_element_set_t& set); ! void overlay_bounds_update(); ! void draw_tick(CGContextRef context, const draw_element_set_t::value_type& element); ! WindowRef overlay_m; ! WindowRef source_m; ! ControlRef control_m; ! bool framing_m; ! overlay_forest_t tree_m; }; *************** *** 125,139 **** pascal void draw_overlay(ControlRef control, SInt16) { ! adobe::ui_overlay_t::implementation_t& overlay ! (*reinterpret_cast<adobe::ui_overlay_t::implementation_t*> ! (::GetControlReference(control))); ! overlay.framing(overlay.framing_m); } /****************************************************************************************************/ ! typedef adobe::point_2d<float> coord_t; ! typedef std::vector<coord_t> coord_set_t; /****************************************************************************************************/ --- 125,139 ---- pascal void draw_overlay(ControlRef control, SInt16) { ! adobe::ui_overlay_t::implementation_t& overlay ! (*reinterpret_cast<adobe::ui_overlay_t::implementation_t*> ! (::GetControlReference(control))); ! overlay.framing(overlay.framing_m); } /****************************************************************************************************/ ! typedef adobe::point_2d<float> coord_t; ! typedef std::vector<coord_t> coord_set_t; /****************************************************************************************************/ *************** *** 141,157 **** void draw_line_path(CGContextRef context, coord_set_t& coord_set) { ! if (coord_set.size() < 2) return; ! coord_set_t::iterator iter(coord_set.begin()); ! coord_set_t::iterator last(coord_set.end()); ! ::CGContextMoveToPoint(context, iter->x_m, iter->y_m); ! while (++iter != last) ::CGContextAddLineToPoint(context, iter->x_m, iter->y_m); ! ::CGContextStrokePath(context); ! ::CGContextClosePath(context); ! coord_set.clear(); } --- 141,157 ---- void draw_line_path(CGContextRef context, coord_set_t& coord_set) { ! if (coord_set.size() < 2) return; ! coord_set_t::iterator iter(coord_set.begin()); ! coord_set_t::iterator last(coord_set.end()); ! ::CGContextMoveToPoint(context, iter->x_m, iter->y_m); ! while (++iter != last) ::CGContextAddLineToPoint(context, iter->x_m, iter->y_m); ! ::CGContextStrokePath(context); ! ::CGContextClosePath(context); ! coord_set.clear(); } *************** *** 167,171 **** ui_overlay_t::ui_overlay_t() : ! object_m(new implementation_t()) { } --- 167,171 ---- ui_overlay_t::ui_overlay_t() : ! object_m(new implementation_t()) { } *************** *** 199,203 **** #if 0 ! #pragma mark - #endif --- 199,203 ---- #if 0 ! #pragma mark - #endif *************** *** 205,212 **** ui_overlay_t::implementation_t::implementation_t() : ! overlay_m(0), ! source_m(0), ! control_m(0), ! framing_m(false) { } --- 205,212 ---- ui_overlay_t::implementation_t::implementation_t() : ! overlay_m(0), ! source_m(0), ! control_m(0), ! framing_m(false) { } *************** *** 215,221 **** ui_overlay_t::implementation_t::~implementation_t() { ! if (overlay_m) ::DisposeWindow(overlay_m); ! overlay_m = 0; } --- 215,221 ---- ui_overlay_t::implementation_t::~implementation_t() { ! if (overlay_m) ::DisposeWindow(overlay_m); ! overlay_m = 0; } *************** *** 224,255 **** ui_overlay_t::position_t ui_overlay_t::implementation_t::root(HIViewRef& element) { ! assert(!control_m); ! assert(element); ! Rect global_bounds; ! WindowGroupRef new_group; ! Rect one_bounds = { 0, 0, 1, 1 }; ! WindowRef owner(::GetControlOwner(element)); ! static ControlUserPaneDrawUPP draw_handler(::NewControlUserPaneDrawUPP(draw_overlay)); ! source_m = owner; ! ADOBE_REQUIRE_STATUS(::GetWindowBounds(source_m, kWindowGlobalPortRgn, &global_bounds)); ! ADOBE_REQUIRE_STATUS(::CreateNewWindow(kOverlayWindowClass, kWindowCompositingAttribute, &global_bounds, &overlay_m)); ! ADOBE_REQUIRE_STATUS(::CreateUserPaneControl(overlay_m, &one_bounds, 0, &control_m)); ! ::ShowWindow(overlay_m); ! ::SetControlReference(control_m, reinterpret_cast<SInt32>(this)); ! ::SetControlData(control_m, kControlEntireControl, kControlUserPaneDrawProcTag, sizeof(ControlUserPaneDrawUPP), &draw_handler); ! ADOBE_REQUIRE_STATUS(::CreateWindowGroup(kWindowGroupAttrMoveTogether | kWindowGroupAttrLayerTogether, &new_group)); ! ADOBE_REQUIRE_STATUS(::SetWindowGroupParent(new_group, ::GetWindowGroup(source_m))); ! ADOBE_REQUIRE_STATUS(::SetWindowGroup(source_m, new_group)); ! ADOBE_REQUIRE_STATUS(::SetWindowGroup(overlay_m, new_group)); ! return wrap(tree_m.insert(tree_m.begin(), overlay_data_t())); } --- 224,255 ---- ui_overlay_t::position_t ui_overlay_t::implementation_t::root(HIViewRef& element) { ! assert(!control_m); ! assert(element); ! Rect global_bounds; ! WindowGroupRef new_group; ! Rect one_bounds = { 0, 0, 1, 1 }; ! WindowRef owner(::GetControlOwner(element)); ! static ControlUserPaneDrawUPP draw_handler(::NewControlUserPaneDrawUPP(draw_overlay)); ! source_m = owner; ! ADOBE_REQUIRE_STATUS(::GetWindowBounds(source_m, kWindowGlobalPortRgn, &global_bounds)); ! ADOBE_REQUIRE_STATUS(::CreateNewWindow(kOverlayWindowClass, kWindowCompositingAttribute, &global_bounds, &overlay_m)); ! ADOBE_REQUIRE_STATUS(::CreateUserPaneControl(overlay_m, &one_bounds, 0, &control_m)); ! ::ShowWindow(overlay_m); ! ::SetControlReference(control_m, reinterpret_cast<SInt32>(this)); ! ::SetControlData(control_m, kControlEntireControl, kControlUserPaneDrawProcTag, sizeof(ControlUserPaneDrawUPP), &draw_handler); ! ADOBE_REQUIRE_STATUS(::CreateWindowGroup(kWindowGroupAttrMoveTogether | kWindowGroupAttrLayerTogether, &new_group)); ! ADOBE_REQUIRE_STATUS(::SetWindowGroupParent(new_group, ::GetWindowGroup(source_m))); ! ADOBE_REQUIRE_STATUS(::SetWindowGroup(source_m, new_group)); ! ADOBE_REQUIRE_STATUS(::SetWindowGroup(overlay_m, new_group)); ! return wrap(tree_m.insert(tree_m.begin(), overlay_data_t())); } *************** *** 258,262 **** ui_overlay_t::position_t ui_overlay_t::implementation_t::insert(position_t parent) { ! return wrap(tree_m.insert(adobe::trailing_of(unwrap(parent)), overlay_data_t())); } --- 258,262 ---- ui_overlay_t::position_t ui_overlay_t::implementation_t::insert(position_t parent) { ! return wrap(tree_m.insert(adobe::trailing_of(unwrap(parent)), overlay_data_t())); } *************** *** 265,277 **** void ui_overlay_t::implementation_t::place(position_t node, const point_2d_t& origin, const extents_t& extents) { ! assert(control_m); ! overlay_forest_t::iterator position(unwrap(node)); ! position->origin_m = origin; ! position->extents_m = extents; ! if (framing_m) ! ADOBE_REQUIRE_STATUS(::HIViewSetNeedsDisplay(control_m, true)); } --- 265,277 ---- void ui_overlay_t::implementation_t::place(position_t node, const point_2d_t& origin, const extents_t& extents) { ! assert(control_m); ! overlay_forest_t::iterator position(unwrap(node)); ! position->origin_m = origin; ! position->extents_m = extents; ! if (framing_m) ! ADOBE_REQUIRE_STATUS(::HIViewSetNeedsDisplay(control_m, true)); } *************** *** 280,330 **** void ui_overlay_t::implementation_t::framing(bool do_framing) { ! assert(control_m); ! framing_m = do_framing; ! if (do_framing) ! { ! ::ShowWindow(overlay_m); ! draw_element_set_t tick_set; ! overlay_forest_t::preorder_iterator first(tree_m.begin()); ! overlay_forest_t::preorder_iterator last(tree_m.end()); ! for (; first != last; ++first) ! tick_extents(flatten_overlay_data(first.base()), tick_set); ! if (!tick_set.empty()) ! { ! CGrafPtr window_port(::GetWindowPort(overlay_m)); ! CGContextRef context(0); ! Rect bounds; ! overlay_bounds_update(); ! ::GetWindowBounds(overlay_m, kWindowContentRgn, &bounds); ! ADOBE_REQUIRE_STATUS(::QDBeginCGContext(window_port, &context)); ! ::CGContextTranslateCTM(context, 0.0, static_cast<float>(bounds.bottom - bounds.top)); ! ::CGContextScaleCTM(context, 1.0, -1.0); ! ::CGContextSetLineWidth(context, 1); ! ::CGContextSetShouldAntialias(context, false); ! ::CGContextSetAlpha(context, .75f); ! ::CGContextBeginPath(context); ! adobe::for_each(tick_set, boost::bind(&implementation_t::draw_tick, boost::ref(*this), context, _1)); ! ::CGContextFlush(context); ! ADOBE_REQUIRE_STATUS(::QDEndCGContext(window_port, &context)); ! } ! } ! else ! { ! ::HideWindow(overlay_m); ! } } --- 280,330 ---- void ui_overlay_t::implementation_t::framing(bool do_framing) { ! assert(control_m); ! framing_m = do_framing; ! if (do_framing) ! { ! ::ShowWindow(overlay_m); ! draw_element_set_t tick_set; ! overlay_forest_t::preorder_iterator first(tree_m.begin()); ! overlay_forest_t::preorder_iterator last(tree_m.end()); ! for (; first != last; ++first) ! tick_extents(flatten_overlay_data(first.base()), tick_set); ! if (!tick_set.empty()) ! { ! CGrafPtr window_port(::GetWindowPort(overlay_m)); ! CGContextRef context(0); ! Rect bounds; ! overlay_bounds_update(); ! ::GetWindowBounds(overlay_m, kWindowContentRgn, &bounds); ! ADOBE_REQUIRE_STATUS(::QDBeginCGContext(window_port, &context)); ! ::CGContextTranslateCTM(context, 0.0, static_cast<float>(bounds.bottom - bounds.top)); ! ::CGContextScaleCTM(context, 1.0, -1.0); ! ::CGContextSetLineWidth(context, 1); ! ::CGContextSetShouldAntialias(context, false); ! ::CGContextSetAlpha(context, .75f); ! ::CGContextBeginPath(context); ! adobe::for_each(tick_set, boost::bind(&implementation_t::draw_tick, boost::ref(*this), context, _1)); ! ::CGContextFlush(context); ! ADOBE_REQUIRE_STATUS(::QDEndCGContext(window_port, &context)); ! } ! } ! else ! { ! ::HideWindow(overlay_m); ! } } *************** *** 333,349 **** overlay_data_t ui_overlay_t::implementation_t::flatten_overlay_data(overlay_forest_t::iterator iter) { ! overlay_data_t result; ! point_2d_t& origin(result.origin_m); ! overlay_forest_t::iterator last(tree_m.end()); ! result.extents_m = iter->extents_m; ! for (; iter != last; iter = find_parent(iter)) ! { ! origin.x_m += iter->origin_m.x_m; ! origin.y_m += iter->origin_m.y_m; ! } ! return result; } --- 333,349 ---- overlay_data_t ui_overlay_t::implementation_t::flatten_overlay_data(overlay_forest_t::iterator iter) { ! overlay_data_t result; ! point_2d_t& origin(result.origin_m); ! overlay_forest_t::iterator last(tree_m.end()); ! result.extents_m = iter->extents_m; ! for (; iter != last; iter = find_parent(iter)) ! { ! origin.x_m += iter->origin_m.x_m; ! origin.y_m += iter->origin_m.y_m; ! } ! return result; } *************** *** 352,376 **** struct frame_rect_t { ! frame_rect_t(float left, float top, float right, float bottom, float tick = 3) : ! tick_width_m(adobe::pin(0.0f, right - left, tick)), ! tick_height_m(adobe::pin(0.0f, bottom - top, tick)), ! tick_start_right_m(std::max(right - tick, left)), ! tick_start_bottom_m(std::max(bottom - tick, top)), ! tl_m(::CGRectMake(left, top, tick_width_m, tick_height_m)), ! tr_m(::CGRectMake(tick_start_right_m, top, tick_width_m, tick_height_m)), ! bl_m(::CGRectMake(left, tick_start_bottom_m, tick_width_m, tick_height_m)), ! br_m(::CGRectMake(tick_start_right_m, tick_start_bottom_m, tick_width_m, tick_height_m)) ! { ! } ! float tick_width_m; ! float tick_height_m; ! float tick_start_right_m; ! float tick_start_bottom_m; ! CGRect tl_m; ! CGRect tr_m; ! CGRect bl_m; ! CGRect br_m; }; --- 352,376 ---- struct frame_rect_t { ! frame_rect_t(float left, float top, float right, float bottom, float tick = 3) : ! tick_width_m(adobe::pin(0.0f, right - left, tick)), ! tick_height_m(adobe::pin(0.0f, bottom - top, tick)), ! tick_start_right_m(std::max(right - tick, left)), ! tick_start_bottom_m(std::max(bottom - tick, top)), ! tl_m(::CGRectMake(left, top, tick_width_m, tick_height_m)), ! tr_m(::CGRectMake(tick_start_right_m, top, tick_width_m, tick_height_m)), ! bl_m(::CGRectMake(left, tick_start_bottom_m, tick_width_m, tick_height_m)), ! br_m(::CGRectMake(tick_start_right_m, tick_start_bottom_m, tick_width_m, tick_height_m)) ! { ! } ! float tick_width_m; ! float tick_height_m; ! float tick_start_right_m; ! float tick_start_bottom_m; ! CGRect tl_m; ! CGRect tr_m; ! CGRect bl_m; ! CGRect br_m; }; *************** *** 379,453 **** void ui_overlay_t::implementation_t::tick_extents(const overlay_data_t& overlay_data, draw_element_set_t& set) { ! typedef draw_element_t de_t; ! static const RGBColor red = { USHRT_MAX, 0, 0 }; ! static const RGBColor green = { 0, USHRT_MAX, 0 }; ! static const RGBColor blue = { 0, 0, USHRT_MAX }; ! const point_2d_t& position(overlay_data.origin_m); ! const extents_t& extents(overlay_data.extents_m); ! float top(static_cast<float>(position.y_m)); ! float left(static_cast<float>(position.x_m)); ! float bottom(top + extents.height()); ! float right(left + extents.width()); ! frame_rect_t bounds(left, top, right, bottom); ! set.push_back(de_t(de_t::element_type_top_left, bounds.tl_m, blue)); ! set.push_back(de_t(de_t::element_type_top_right, bounds.tr_m, blue)); ! set.push_back(de_t(de_t::element_type_bottom_left, bounds.bl_m, blue)); ! set.push_back(de_t(de_t::element_type_bottom_right, bounds.br_m, blue)); ! if (extents.vertical().outset_m.first || extents.vertical().outset_m.second || ! extents.horizontal().outset_m.first || extents.horizontal().outset_m.second) ! { ! float top_outset(top - extents.vertical().outset_m.first); ! float bottom_outset(bottom + extents.vertical().outset_m.second); ! float left_outset(left - extents.horizontal().outset_m.first); ! float right_outset(right + extents.horizontal().outset_m.second); ! frame_rect_t outsets(left_outset, top_outset, right_outset, bottom_outset); ! set.push_back(de_t(de_t::element_type_top_left, outsets.tl_m, green)); ! set.push_back(de_t(de_t::element_type_top_right, outsets.tr_m, green)); ! set.push_back(de_t(de_t::element_type_bottom_left, outsets.bl_m, green)); ! set.push_back(de_t(de_t::element_type_bottom_right, outsets.br_m, green)); ! } ! { ! guide_set_t::const_iterator iter(extents.horizontal().poi_m.begin()); ! guide_set_t::const_iterator last(extents.horizontal().poi_m.end()); ! CGRect top_tick(::CGRectMake(0, top, 1.0, bounds.tick_height_m)); ! CGRect bottom_tick(::CGRectMake(0, bottom - bounds.tick_height_m, 1.0, bounds.tick_height_m)); ! for (; iter != last; ++iter) ! { ! float poi(left + *iter); ! top_tick.origin.x = poi; ! bottom_tick.origin.x = poi; ! set.push_back(de_t(de_t::element_type_horizontal_poi, top_tick, red)); ! set.push_back(de_t(de_t::element_type_horizontal_poi, bottom_tick, red)); ! } ! } ! { ! guide_set_t::const_iterator iter(extents.vertical().poi_m.begin()); ! guide_set_t::const_iterator last(extents.vertical().poi_m.end()); ! CGRect left_tick(::CGRectMake(left, 0, bounds.tick_width_m, 1.0)); ! CGRect right_tick(::CGRectMake(right - bounds.tick_width_m, 0, bounds.tick_width_m, 1.0)); ! for (; iter != last; ++iter) ! { ! float poi(top + *iter); ! left_tick.origin.y = poi; ! right_tick.origin.y = poi; ! set.push_back(de_t(de_t::element_type_vertical_poi, left_tick, red)); ! set.push_back(de_t(de_t::element_type_vertical_poi, right_tick, red)); ! } ! } } --- 379,453 ---- void ui_overlay_t::implementation_t::tick_extents(const overlay_data_t& overlay_data, draw_element_set_t& set) { ! typedef draw_element_t de_t; ! static const RGBColor red = { USHRT_MAX, 0, 0 }; ! static const RGBColor green = { 0, USHRT_MAX, 0 }; ! static const RGBColor blue = { 0, 0, USHRT_MAX }; ! const point_2d_t& position(overlay_data.origin_m); ! const extents_t& extents(overlay_data.extents_m); ! float top(static_cast<float>(position.y_m)); ! float left(static_cast<float>(position.x_m)); ! float bottom(top + extents.height()); ! float right(left + extents.width()); ! frame_rect_t bounds(left, top, right, bottom); ! set.push_back(de_t(de_t::element_type_top_left, bounds.tl_m, blue)); ! set.push_back(de_t(de_t::element_type_top_right, bounds.tr_m, blue)); ! set.push_back(de_t(de_t::element_type_bottom_left, bounds.bl_m, blue)); ! set.push_back(de_t(de_t::element_type_bottom_right, bounds.br_m, blue)); ! if (extents.vertical().outset_m.first || extents.vertical().outset_m.second || ! extents.horizontal().outset_m.first || extents.horizontal().outset_m.second) ! { ! float top_outset(top - extents.vertical().outset_m.first); ! float bottom_outset(bottom + extents.vertical().outset_m.second); ! float left_outset(left - extents.horizontal().outset_m.first); ! float right_outset(right + extents.horizontal().outset_m.second); ! frame_rect_t outsets(left_outset, top_outset, right_outset, bottom_outset); ! set.push_back(de_t(de_t::element_type_top_left, outsets.tl_m, green)); ! set.push_back(de_t(de_t::element_type_top_right, outsets.tr_m, green)); ! set.push_back(de_t(de_t::element_type_bottom_left, outsets.bl_m, green)); ! set.push_back(de_t(de_t::element_type_bottom_right, outsets.br_m, green)); ! } ! { ! guide_set_t::const_iterator iter(extents.horizontal().poi_m.begin()); ! guide_set_t::const_iterator last(extents.horizontal().poi_m.end()); ! CGRect top_tick(::CGRectMake(0, top, 1.0, bounds.tick_height_m)); ! CGRect bottom_tick(::CGRectMake(0, bottom - bounds.tick_height_m, 1.0, bounds.tick_height_m)); ! for (; iter != last; ++iter) ! { ! float poi(left + *iter); ! top_tick.origin.x = poi; ! bottom_tick.origin.x = poi; ! set.push_back(de_t(de_t::element_type_horizontal_poi, top_tick, red)); ! set.push_back(de_t(de_t::element_type_horizontal_poi, bottom_tick, red)); ! } ! } ! { ! guide_set_t::const_iterator iter(extents.vertical().poi_m.begin()); ! guide_set_t::const_iterator last(extents.vertical().poi_m.end()); ! CGRect left_tick(::CGRectMake(left, 0, bounds.tick_width_m, 1.0)); ! CGRect right_tick(::CGRectMake(right - bounds.tick_width_m, 0, bounds.tick_width_m, 1.0)); ! for (; iter != last; ++iter) ! { ! float poi(top + *iter); ! left_tick.origin.y = poi; ! right_tick.origin.y = poi; ! set.push_back(de_t(de_t::element_type_vertical_poi, left_tick, red)); ! set.push_back(de_t(de_t::element_type_vertical_poi, right_tick, red)); ! } ! } } *************** *** 456,513 **** void ui_overlay_t::implementation_t::draw_tick(CGContextRef context, const draw_element_set_t::value_type& element) { ! typedef draw_element_set_t::value_type desvt_t; ! coord_set_t coord_set; ! float top(element.rect_m.origin.y + 1); ! float left(element.rect_m.origin.x); ! float bottom(element.rect_m.origin.y + element.rect_m.size.height); ! float right(element.rect_m.origin.x + element.rect_m.size.width - 1); ! coord_t top_left(left, top); ! coord_t top_right(right, top); ! coord_t bottom_left(left, bottom); ! coord_t bottom_right(right, bottom); ! ::CGContextSetRGBStrokeColor( context, ! element.color_m.red / static_cast<float>(USHRT_MAX), ! element.color_m.green / static_cast<float>(USHRT_MAX), ! element.color_m.blue / static_cast<float>(USHRT_MAX), ! 1.0f); ! if (element.type_m == desvt_t::element_type_top_left) ! { ! coord_set.push_back(top_right); ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_top_right) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(top_right); ! coord_set.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_left) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! coord_set.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_right) ! { ! coord_set.push_back(top_right); ! coord_set.push_back(bottom_right); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_horizontal_poi) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_vertical_poi) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(top_right); ! } ! draw_line_path(context, coord_set); } --- 456,513 ---- void ui_overlay_t::implementation_t::draw_tick(CGContextRef context, const draw_element_set_t::value_type& element) { ! typedef draw_element_set_t::value_type desvt_t; ! coord_set_t coord_set; ! float top(element.rect_m.origin.y + 1); ! float left(element.rect_m.origin.x); ! float bottom(element.rect_m.origin.y + element.rect_m.size.height); ! float right(element.rect_m.origin.x + element.rect_m.size.width - 1); ! coord_t top_left(left, top); ! coord_t top_right(right, top); ! coord_t bottom_left(left, bottom); ! coord_t bottom_right(right, bottom); ! ::CGContextSetRGBStrokeColor( context, ! element.color_m.red / static_cast<float>(USHRT_MAX), ! element.color_m.green / static_cast<float>(USHRT_MAX), ! element.color_m.blue / static_cast<float>(USHRT_MAX), ! 1.0f); ! if (element.type_m == desvt_t::element_type_top_left) ! { ! coord_set.push_back(top_right); ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_top_right) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(top_right); ! coord_set.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_left) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! coord_set.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_right) ! { ! coord_set.push_back(top_right); ! coord_set.push_back(bottom_right); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_horizontal_poi) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_vertical_poi) ! { ! coord_set.push_back(top_left); ! coord_set.push_back(top_right); ! } ! draw_line_path(context, coord_set); } *************** *** 516,535 **** void ui_overlay_t::implementation_t::overlay_bounds_update() { ! Rect overlay_bounds = { 0 }; ! Rect hosting_bounds = { 0 }; ! WindowClass host_window_class(0); ! ADOBE_REQUIRE_STATUS(::GetWindowClass(source_m, &host_window_class)); ! ::GetWindowBounds(overlay_m, kWindowContentRgn, &overlay_bounds); ! ::GetWindowBounds(source_m, kWindowContentRgn, &hosting_bounds); ! if (overlay_bounds.top != hosting_bounds.top || ! overlay_bounds.bottom != hosting_bounds.bottom || ! overlay_bounds.left != hosting_bounds.left || ! overlay_bounds.right != hosting_bounds.right) ! { ! ::SetWindowBounds(overlay_m, kWindowContentRgn, &hosting_bounds); ! } } --- 516,535 ---- void ui_overlay_t::implementation_t::overlay_bounds_update() { ! Rect overlay_bounds = { 0 }; ! Rect hosting_bounds = { 0 }; ! WindowClass host_window_class(0); ! ADOBE_REQUIRE_STATUS(::GetWindowClass(source_m, &host_window_class)); ! ::GetWindowBounds(overlay_m, kWindowContentRgn, &overlay_bounds); ! ::GetWindowBounds(source_m, kWindowContentRgn, &hosting_bounds); ! if (overlay_bounds.top != hosting_bounds.top || ! overlay_bounds.bottom != hosting_bounds.bottom || ! overlay_bounds.left != hosting_bounds.left || ! overlay_bounds.right != hosting_bounds.right) ! { ! ::SetWindowBounds(overlay_m, kWindowContentRgn, &hosting_bounds); ! } } --- NEW FILE: os_utilities.cpp --- /* Copyright 2005-2006 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) */ /****************************************************************************************************/ #include "os_utilities.hpp" /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ namespace implementation { /****************************************************************************************************/ std::string cfstring_to_string(::CFStringRef x) { if (x == 0) return std::string(); const int pad(16); // must be at least one - seems like a good conservative size ::CFIndex max_size(::CFStringGetMaximumSizeForEncoding(::CFStringGetLength(x), kCFStringEncodingUTF8) + pad); std::vector<char> buffer(static_cast<std::size_t>(max_size)); #ifndef NDEBUG ::Boolean result = #endif ::CFStringGetCString(x, &buffer[0], max_size, kCFStringEncodingUTF8); #ifndef NDEBUG assert(result); #endif return std::string(&buffer[0]); } /****************************************************************************************************/ template <> void get_bounds< ::ControlRef >(const ::ControlRef& control, ::Rect& bounds, bool absolute) { assert(control); static const float round(.5); ::HIRect cur_bounds = { { 0, 0 }, { 0, 0 } }; ADOBE_REQUIRE_STATUS(::HIViewGetFrame(control, &cur_bounds)); if (absolute) { // bounds are relative to the parent control; this makes them relative to the window. ::WindowRef window(::GetControlOwner(control)); ::ControlRef root_control(0); if (window) ::ADOBE_REQUIRE_STATUS(::GetRootControl(window, &root_control)); if (root_control) ::ADOBE_REQUIRE_STATUS(::HIViewConvertRect(&cur_bounds, ::HIViewGetSuperview(control), root_control)); } bounds.left = static_cast<short>(cur_bounds.origin.x + round); bounds.top = static_cast<short>(cur_bounds.origin.y + round); bounds.right = static_cast<short>(bounds.left + cur_bounds.size.width + round); bounds.bottom = static_cast<short>(bounds.top + cur_bounds.size.height + round); } /****************************************************************************************************/ template <> std::string get_field_text< ::ControlRef >(::ControlRef& control) { if (!control) return std::string(); ::CFStringRef cfstring(0); ADOBE_REQUIRE_STATUS(::CopyControlTitleAsCFString(control, &cfstring)); adobe::auto_resource< ::CFStringRef > auto_string(cfstring); return cfstring_to_string(cfstring); } /****************************************************************************************************/ std::string get_name(const ::ControlRef& control) { assert (control); ::CFStringRef cfstring(0); ADOBE_REQUIRE_STATUS(::CopyControlTitleAsCFString(control, &cfstring)); adobe::auto_resource< ::CFStringRef > auto_string(cfstring); return cfstring_to_string(cfstring); } /****************************************************************************************************/ std::string get_name(const ::WindowRef& window) { assert(window); ::CFStringRef cfstring(0); ADOBE_REQUIRE_STATUS(::CopyWindowTitleAsCFString(window, &cfstring)); adobe::auto_resource< ::CFStringRef > auto_string(cfstring); return cfstring_to_string(cfstring); } /****************************************************************************************************/ /// REVISIT (fbrereto) : This is tucked into a cpp file because it uses a deprecated MacOS X API ::FMFontFamily get_classic_font_id(const char* font_name, std::size_t name_length) { ::ATSUFontID atsui_font_id(get_atsui_font_id(font_name, name_length)); ::FMFont font(::FMGetFontFromATSFontRef(atsui_font_id)); ::FMFontFamily font_family; ::FMFontStyle font_style; ADOBE_REQUIRE_STATUS(::FMGetFontFamilyInstanceFromFont(font, &font_family, &font_style)); return font_family; } /****************************************************************************************************/ adobe::extents_t get_text_dimensions(const std::string& text, adobe::theme_t theme) { adobe::extents_t result; ::ATSUStyle style_nonauto; ::ATSUTextLayout layout_nonauto; std::vector<boost::uint16_t> unibuffer; ::UniCharCount run_length(kATSUToTextEnd); unibuffer.reserve(text.size()); adobe::to_utf16(text.begin(), text.end(), std::back_inserter(unibuffer)); ADOBE_REQUIRE_STATUS(::ATSUCreateStyle(&style_nonauto)); adobe::auto_resource< ::ATSUStyle > style(style_nonauto); adobe::theme_t masked(theme & adobe::theme_mask_s); if (masked == adobe::theme_mini_s) atsu_set_attribute(style_nonauto, kATSUSizeTag, ::Long2Fix(9)); else if (masked == adobe::theme_small_s) atsu_set_attribute(style_nonauto, kATSUSizeTag, ::Long2Fix(11)); //else if (masked == adobe::theme_normal_s) // atsu_set_attribute(style_nonauto, kATSUSizeTag, ::Long2Fix(13)); if (theme & adobe::theme_adornment_mono_s) atsu_set_attribute(style_nonauto, kATSUFontTag, get_atsui_font_id("Monaco")); ADOBE_REQUIRE_STATUS(::ATSUCreateTextLayoutWithTextPtr( static_cast<UniChar*>(&unibuffer[0]), 0, unibuffer.size(), unibuffer.size(), 1, &run_length, &style_nonauto, &layout_nonauto)); adobe::auto_resource< ::ATSUTextLayout > layout(layout_nonauto); ADOBE_REQUIRE_STATUS(::ATSUSetTransientFontMatching(layout_nonauto, true)); ATSUTextMeasurement before(0); ATSUTextMeasurement after(0); ATSUTextMeasurement ascent(0); ATSUTextMeasurement descent(0); ADOBE_REQUIRE_STATUS(::ATSUGetUnjustifiedBounds( layout_nonauto, 0, unibuffer.size(), &before, &after, &ascent, &descent)); before = ::Fix2Long(before); after = ::Fix2Long(after); ascent = ::Fix2Long(ascent); descent = ::Fix2Long(descent); result.vertical().length_m = ascent; result.horizontal().length_m = after - before; result.vertical().poi_m.push_back(ascent); return result; } /****************************************************************************************************/ adobe::extents_t measure(::ControlRef& control) { assert(control); adobe::extents_t result; ::Rect bounds = { 0 }; ::SInt16 best_baseline(0); ::GetBestControlRect(control, &bounds, &best_baseline); result.height() = bounds.bottom - bounds.top; result.width() = bounds.right - bounds.left; if (best_baseline) result.vertical().poi_m.push_back(result.height() + best_baseline); return result; } /****************************************************************************************************/ void theme_to_rec(const adobe::theme_t& style, ControlFontStyleRec& style_rec) { ControlFontStyleRec result = { 0 }; adobe::theme_t masked(style & adobe::theme_mask_s); if (style & adobe::theme_adornment_mono_s) { result.font = get_classic_font_id("Monaco"); result.flags |= static_cast<int>(kControlUseFontMask) | static_cast<int>(kControlUseSizeMask); switch (masked) { case adobe::theme_large_s: result.size = 14; break; case adobe::theme_small_s: result.size = 10; break; case adobe::theme_mini_s: result.size = 9; break; case adobe::theme_normal_s: default: result.size = 12; break; } } else if (masked) { ThemeFontID font_id(theme_to_ThemeFontID(style)); Str255 font_name; SInt16 font_size; Style font_style; ::GetThemeFont(font_id, smSystemScript, font_name, &font_size, &font_style); result.flags |= static_cast<int>(kControlUseFontMask) | static_cast<int>(kControlUseSizeMask) | static_cast<int>(kControlUseFaceMask); result.font = get_classic_font_id(font_name); result.size = font_size; result.style = font_style; } style_rec = result; } /****************************************************************************************************/ // REVISIT (fbrereto) : This can all get reduced void set_popup_with_text(ControlRef control, const std::string& text, unsigned long cur_time) { static unsigned long last_time(0); static unsigned long double_click_time(::GetDblTime()); static std::string selection_string; std::size_t new_index(1); MenuRef menu(::GetControlPopupMenuHandle(control)); std::size_t menu_item_count(::CountMenuItems(menu)); if (cur_time - last_time > double_click_time) selection_string.erase(selection_string.begin(), selection_string.end()); last_time = cur_time; selection_string.append(text.c_str()); for (; new_index <= menu_item_count; ++new_index) { ::CFStringRef cur_menu_item(0); ADOBE_REQUIRE_STATUS(::CopyMenuItemTextAsCFString(menu, static_cast< ::UInt16 >(new_index), &cur_menu_item)); adobe::auto_resource< ::CFStringRef > auto_string(cur_menu_item); std::string cur_name(cfstring_to_string(cur_menu_item)); for (std::string::iterator i(cur_name.begin()); i != cur_name.end(); ++i) *i = static_cast<std::string::value_type>(std::tolower(*i)); if (cur_name.find(selection_string) == 0) break; } if (new_index > menu_item_count) adobe::system_beep(); else if (new_index != static_cast<std::size_t>(get_value(control))) ::SetControl32BitValue(control, static_cast<long>(new_index)); } /****************************************************************************************************/ /// sets the keyboard focus for a control template <> static void set_focus< ::ControlRef >(::ControlRef& control, bool make_focused) { assert(control); ::ControlRef current_focus(0); ::WindowRef window(::GetControlOwner(control)); ADOBE_REQUIRE_STATUS(::GetKeyboardFocus(window, ¤t_focus)); if (make_focused && current_focus != control) ADOBE_REQUIRE_STATUS(::SetKeyboardFocus(window, control, kControlFocusNextPart)); else if (!make_focused && current_focus == control) ADOBE_REQUIRE_STATUS(::ClearKeyboardFocus(window)); } /****************************************************************************************************/ void set_bounds(::ControlRef control, const ::Rect& new_bounds) { assert(control); ::HIRect bounds = { { static_cast<float>(new_bounds.left), static_cast<float>(new_bounds.top) }, { static_cast<float>(new_bounds.right - new_bounds.left), static_cast<float>(new_bounds.bottom - new_bounds.top) } }; bounds.size.height = std::max(bounds.size.height, 0.0f); bounds.size.width = std::max(bounds.size.width, 0.0f); ADOBE_REQUIRE_STATUS(::HIViewSetFrame(control, &bounds)); } /****************************************************************************************************/ template <> void set_theme< ::ControlRef >(::ControlRef& control, adobe::theme_t theme) { assert(control); ::ControlFontStyleRec new_style = { 0 }; theme_to_rec(theme, new_style); set_widget_data(control, kControlEntireControl, kControlFontStyleTag, new_style, false); ::ControlSize control_size(kControlSizeNormal); switch ( theme & theme_mask_s ) { case theme_large_s: control_size = kControlSizeLarge; break; case theme_small_s: control_size = kControlSizeSmall; break; case theme_mini_s: control_size = kControlSizeMini; break; case theme_normal_s: default: break; } set_widget_data(control, kControlEntireControl, kControlSizeTag, control_size, false); } /****************************************************************************************************/ template <> void set_theme< ::TXNObject >(::TXNObject& hitextview, adobe::theme_t theme) { assert (hitextview); ControlFontStyleRec rec; std::vector<TXNTypeAttributes> attr; TXNTypeAttributes empty_attr = { 0 }; RGBColor black = { 0, 0, 0 }; theme_to_rec(theme, rec); if (rec.flags & kControlUseFontMask) { attr.push_back(empty_attr); attr.back().tag = kTXNQDFontFamilyIDAttribute; attr.back().size = kTXNQDFontFamilyIDAttributeSize; attr.back().data.dataValue = rec.font; } if (rec.flags & kControlUseSizeMask) { attr.push_back(empty_attr); attr.back().tag = kTXNQDFontSizeAttribute; attr.back().size = kTXNFontSizeAttributeSize; attr.back().data.dataValue = static_cast<UInt32>(::Long2Fix(rec.size)); } if (rec.flags & kControlUseFaceMask) { attr.push_back(empty_attr); attr.back().tag = kTXNQDFontStyleAttribute; attr.back().size = kTXNQDFontStyleAttributeSize; attr.back().data.dataValue = rec.style; } attr.push_back(empty_attr); attr.back().tag = kTXNQDFontColorAttribute; attr.back().size = kTXNQDFontColorAttributeSize; attr.back().data.dataPtr = &black; ::ADOBE_REQUIRE_STATUS(::TXNSetTypeAttributes(hitextview, attr.size(), &attr[0], kTXNStartOffset, kTXNEndOffset)); } /****************************************************************************************************/ template <> void set_active< ::ControlRef >(::ControlRef& control, bool make_active) { assert(control); make_active ? ::EnableControl(control) : ::DisableControl(control); } /****************************************************************************************************/ std::string convert_utf(::UniChar* buffer, std::size_t size) { std::string result; result.reserve(size * 2); adobe::to_utf8(buffer, buffer + size, std::back_inserter(result)); return result; } /****************************************************************************************************/ std::string convert_utf(UniChar* buffer) { std::size_t size(0); while (buffer[size] != ::UniChar(0)) ++size; return convert_utf(buffer, size); } /****************************************************************************************************/ adobe::modifiers_t convert_modifiers(::UInt32 os_modifiers) { adobe::modifiers_t result(adobe::modifiers_none_s); if (os_modifiers & cmdKey) result |= adobe::modifiers_any_command_s; if (os_modifiers & shiftKey) result |= adobe::modifiers_left_shift_s; if (os_modifiers & alphaLock) result |= adobe::modifiers_caps_lock_s; if (os_modifiers & optionKey) result |= adobe::modifiers_left_option_s; if (os_modifiers & controlKey) result |= adobe::modifiers_left_control_s; if (os_modifiers & rightShiftKey) result |= adobe::modifiers_right_shift_s; if (os_modifiers & rightOptionKey) result |= adobe::modifiers_right_option_s; if (os_modifiers & rightControlKey) result |= adobe::modifiers_right_control_s; return result; } /****************************************************************************************************/ } // namespace implementation /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ Index: ui_core_implementation.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/ui_core_implementation.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ui_core_implementation.cpp 24 Jan 2006 19:38:47 -0000 1.9 --- ui_core_implementation.cpp 3 Feb 2006 18:33:37 -0000 1.10 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...9039 lines suppressed...] ! if (element.implementation().state_set_m.size() > 1) ! { ! WindowRef window(::GetControlOwner(ref)); ! element.implementation().mod_key_handler_m.set_user_data(&(element.implementation())); ! element.implementation().mod_key_handler_m.uninstall(); ! element.implementation().mod_key_handler_m.install(window); ! } ! ! return result; } *************** *** 5481,5485 **** ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(separator_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(slider_t); - ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(bevel_button_t); /****************************************************************************************************/ --- 3731,3734 ---- |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/fltk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/headers/fltk Modified Files: ui_core_implementation.hpp Log Message: asl 1.0.13 Index: ui_core_implementation.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/headers/fltk/ui_core_implementation.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ui_core_implementation.hpp 24 Jan 2006 08:42:18 -0000 1.6 --- ui_core_implementation.hpp 3 Feb 2006 18:33:36 -0000 1.7 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 33,46 **** struct number_formatter_t::implementation_t { ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(); ! void set_format(const std::string& format); ! std::string get_format() const; ! std::string format(const value_t& x); ! value_t parse(const std::string& str, value_t the_type); ! std::string format_m; }; --- 33,46 ---- struct number_formatter_t::implementation_t { ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(); ! void set_format(const std::string& format); ! std::string get_format() const; ! std::string format(const value_t& x); ! value_t parse(const std::string& str, value_t the_type); ! std::string format_m; }; *************** *** 48,85 **** struct control_t : boost::equality_comparable<control_t> { ! control_t(); ! control_t(theme_t theme); ! control_t(const control_t& rhs); ! virtual ~control_t(); ! virtual extents_t best_bounds(); ! void set_bounds( ! const point_2d_t& position, ! const extents_t& geometry); ! void place( const point_2d_t& position, ! const extents_t& geometry); ! void set_name(const std::string& name); ! virtual void set_theme(theme_t theme); ! void adorn_theme(theme_t theme); ! void unadorn_theme(theme_t theme); ! void set_active(bool make_active); ! void enable(bool make_enabled); ! void set_visible(bool make_visible); ! void set_focused(bool make_focused); ! bool is_focused(); ! void signal_focus(const implementation::control_focus_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! static void callback_s(fltk::Widget* w, void* v); ! // ! // These member variables should only be accessed from ! // inside the ui_core_implementation. ! // ! fltk::Widget* control_m; ! theme_t theme_m; ! implementation::control_focus_proc_t focus_proc_m; ! extents_t geometry_m; ! point_2d_t position_m; ! std::string widget_type_m; }; --- 48,85 ---- struct control_t : boost::equality_comparable<control_t> { ! control_t(); ! control_t(theme_t theme); ! control_t(const control_t& rhs); ! virtual ~control_t(); ! virtual extents_t best_bounds(); ! void set_bounds( ! const point_2d_t& position, ! const extents_t& geometry); ! void place( const point_2d_t& position, ! const extents_t& geometry); ! void set_name(const std::string& name); ! virtual void set_theme(theme_t theme); ! void adorn_theme(theme_t theme); ! void unadorn_theme(theme_t theme); ! void set_active(bool make_active); ! void enable(bool make_enabled); ! void set_visible(bool make_visible); ! void set_focused(bool make_focused); ! bool is_focused(); ! void signal_focus(const implementation::control_focus_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! static void callback_s(fltk::Widget* w, void* v); ! // ! // These member variables should only be accessed from ! // inside the ui_core_implementation. ! // ! fltk::Widget* control_m; ! theme_t theme_m; ! implementation::control_focus_proc_t focus_proc_m; ! extents_t geometry_m; ! point_2d_t position_m; ! std::string widget_type_m; }; *************** *** 88,115 **** struct window_t::implementation_t : boost::equality_comparable<window_t::implementation_t> { ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! virtual ~implementation_t(); ! void initialize(const std::string& name, ! const fltk::Rectangle& bounds, ! window_style_t style, ! window_attributes_t attributes, ! window_modality_t modality); ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_size(const point_2d_t& size); ! void reposition(window_reposition_t position); ! void set_visible(bool make_visible); ! void draw_controls(); ! void signal_resize_complete(const implementation::window_resize_complete_proc_t& proc); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::window_t::implementation_t); ! dictionary_t essentials() const; ! class notify_window* window_m; ! extents_t geometry_m; ! point_2d_t position_m; ! implementation::window_resize_complete_proc_t resize_complete_proc_m; }; --- 88,116 ---- struct window_t::implementation_t : boost::equality_comparable<window_t::implementation_t> { ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! virtual ~implementation_t(); ! void initialize(const std::string& name, ! const fltk::Rectangle& bounds, ! window_style_t style, ! window_attributes_t attributes, ! window_modality_t modality); ! extents_t measure() { return extents_t(); } ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_size(const point_2d_t& size); ! void reposition(window_reposition_t position); ! void set_visible(bool make_visible); ! void draw_controls(); ! void signal_resize_complete(const implementation::window_resize_complete_proc_t& proc); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::window_t::implementation_t); ! dictionary_t essentials() const; ! class notify_window* window_m; ! extents_t geometry_m; ! point_2d_t position_m; ! implementation::window_resize_complete_proc_t resize_complete_proc_m; }; *************** *** 118,130 **** struct group_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t best_bounds(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::group_t::implementation_t); }; --- 119,131 ---- struct group_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t best_bounds(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::group_t::implementation_t); }; *************** *** 133,157 **** struct tab_group_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::vector<tab_group_t::tab_t> tab_set_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const tab_group_t::tab_t* first, ! const tab_group_t::tab_t* last); ! virtual extents_t best_bounds(); ! void set_value(const value_t& new_value); ! void signal_value_change(const implementation::tab_group_value_proc_t& proc); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::tab_group_t::implementation_t); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! int debounce_m; ! implementation::tab_group_value_proc_t value_proc_m; ! tab_set_t items_m; }; --- 134,158 ---- struct tab_group_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::vector<tab_group_t::tab_t> tab_set_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const tab_group_t::tab_t* first, ! const tab_group_t::tab_t* last); ! virtual extents_t best_bounds(); ! void set_value(const value_t& new_value); ! void signal_value_change(const implementation::tab_group_value_proc_t& proc); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::tab_group_t::implementation_t); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! int debounce_m; ! implementation::tab_group_value_proc_t value_proc_m; ! tab_set_t items_m; }; *************** *** 160,171 **** struct panel_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::panel_t::implementation_t); }; --- 161,172 ---- struct panel_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::panel_t::implementation_t); }; *************** *** 174,198 **** struct button_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::vector<state_descriptor_t> state_set_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const button_t::state_descriptor_t* first, ! const button_t::state_descriptor_t* last); ! void set_default(bool is_default); ! void set_cancel(bool is_cancel); ! void set_value(modifiers_t modifiers, const value_t& value); ! void set_contributing(modifiers_t modifiers, ! const std::pair<dictionary_t, array_t>& value); ! virtual void callback(); ! ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::button_t::implementation_t); ! virtual dictionary_t essentials() const; ! state_set_t state_set_m; }; --- 175,199 ---- struct button_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::vector<state_descriptor_t> state_set_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const button_t::state_descriptor_t* first, ! const button_t::state_descriptor_t* last); ! void set_default(bool is_default); ! void set_cancel(bool is_cancel); ! void set_value(modifiers_t modifiers, const value_t& value); ! void set_contributing(modifiers_t modifiers, ! const std::pair<dictionary_t, array_t>& value); ! virtual void callback(); ! ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::button_t::implementation_t); ! virtual dictionary_t essentials() const; ! state_set_t state_set_m; }; *************** *** 201,227 **** struct radio_button_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(const std::string& name, const adobe::value_t& value, ! adobe::theme_t theme); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! extents_t measure(); ! void enable(bool make_enabled); ! void set(const adobe::value_t& value); ! void monitor(const ! implementation::radio_button_hit_proc_t& proc); ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::radio_button_t::implementation_t); ! virtual dictionary_t essentials() const; ! implementation::radio_button_hit_proc_t hit_proc_m; ! adobe::value_t set_value_m; ! adobe::value_t last_m; }; --- 202,228 ---- struct radio_button_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(const std::string& name, const adobe::value_t& value, ! adobe::theme_t theme); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! extents_t measure(); ! void enable(bool make_enabled); ! void set(const adobe::value_t& value); ! void monitor(const ! implementation::radio_button_hit_proc_t& proc); ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::radio_button_t::implementation_t); ! virtual dictionary_t essentials() const; ! implementation::radio_button_hit_proc_t hit_proc_m; ! adobe::value_t set_value_m; ! adobe::value_t last_m; }; *************** *** 231,257 **** struct checkbox_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(const std::string& name, ! const adobe::value_t& true_value, ! const adobe::value_t& false_value, ! theme_t theme); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t measure(); ! virtual void set(adobe::value_t new_value); ! void monitor(const implementation::checkbox_hit_proc_t& ! proc); ! virtual void callback(); ! virtual dictionary_t essentials() const; ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::checkbox_t::implementation_t); ! implementation::checkbox_hit_proc_t hit_proc_m; ! adobe::value_t true_value_m; ! adobe::value_t false_value_m; ! adobe::value_t current_value_m; }; --- 232,258 ---- struct checkbox_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(const std::string& name, ! const adobe::value_t& true_value, ! const adobe::value_t& false_value, ! theme_t theme); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t measure(); ! virtual void set(adobe::value_t new_value); ! void monitor(const implementation::checkbox_hit_proc_t& ! proc); ! virtual void callback(); ! virtual dictionary_t essentials() const; ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::checkbox_t::implementation_t); ! implementation::checkbox_hit_proc_t hit_proc_m; ! adobe::value_t true_value_m; ! adobe::value_t false_value_m; ! adobe::value_t current_value_m; }; *************** *** 260,278 **** struct link_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! void set_value(bool value); ! void signal_hit(const implementation::link_hit_proc_t& proc); ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::link_t::implementation_t); ! implementation::link_hit_proc_t hit_proc_m; ! guide_set_t prongs_m; ! bool value_m; }; --- 261,279 ---- struct link_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! void set_value(bool value); ! void signal_hit(const implementation::link_hit_proc_t& proc); ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::link_t::implementation_t); ! implementation::link_hit_proc_t hit_proc_m; ! guide_set_t prongs_m; ! bool value_m; }; *************** *** 281,301 **** struct progress_bar_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! pb_style_t bar_style, ! bool is_vertical); ! virtual extents_t best_bounds(); ! void set_min_value(long min_value); ! void set_max_value(long max_value); ! void set_value(long value); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::progress_bar_t::implementation_t); ! bool is_vertical_m; ! pb_style_t bar_style_m; }; --- 282,302 ---- struct progress_bar_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! pb_style_t bar_style, ! bool is_vertical); ! virtual extents_t best_bounds(); ! void set_min_value(long min_value); ! void set_max_value(long max_value); ! void set_value(long value); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::progress_bar_t::implementation_t); ! bool is_vertical_m; ! pb_style_t bar_style_m; }; *************** *** 304,315 **** struct separator_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::separator_t::implementation_t); }; --- 305,316 ---- struct separator_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::separator_t::implementation_t); }; *************** *** 318,338 **** struct static_text_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! long best_height_given_width(long width); ! void set_name(const std::string& name); ! void signal_hit( ! const implementation::static_text_hit_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); ! implementation::static_text_hit_proc_t hit_proc_m; }; --- 319,339 ---- struct static_text_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! long best_height_given_width(long width); ! void set_name(const std::string& name); ! void signal_hit( ! const implementation::static_text_hit_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); ! implementation::static_text_hit_proc_t hit_proc_m; }; *************** *** 341,383 **** struct edit_text_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name, ! bool scrollable, ! bool password, ! long rows, ! long cols); ! virtual extents_t best_bounds(); ! virtual void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_field_text(const std::string& text); ! void set_static_disabled(bool is_static_disabled); ! void set_selection(long start_char, long end_char); ! void signal_pre_edit( ! const implementation::edit_text_pre_edit_proc_t& p); ! void signal_post_edit( ! const implementation::edit_text_post_edit_proc_t& p); ! void signal_label_hit( ! const implementation::edit_text_label_hit_proc_t& p); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); ! std::string field_text_m; ! std::string name_m; ! std::string static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! long rows_m; ! long cols_m; ! bool scrollable_m; ! bool password_m; ! implementation::edit_text_post_edit_proc_t post_edit_proc_m; ! implementation::edit_text_label_hit_proc_t label_hit_proc_m; }; --- 342,384 ---- struct edit_text_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name, ! bool scrollable, ! bool password, ! long rows, ! long cols); ! virtual extents_t best_bounds(); ! virtual void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_field_text(const std::string& text); ! void set_static_disabled(bool is_static_disabled); ! void set_selection(long start_char, long end_char); ! void signal_pre_edit( ! const implementation::edit_text_pre_edit_proc_t& p); ! void signal_post_edit( ! const implementation::edit_text_post_edit_proc_t& p); ! void signal_label_hit( ! const implementation::edit_text_label_hit_proc_t& p); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); ! std::string field_text_m; ! std::string name_m; ! std::string static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! long rows_m; ! long cols_m; ! bool scrollable_m; ! bool password_m; ! implementation::edit_text_post_edit_proc_t post_edit_proc_m; ! implementation::edit_text_label_hit_proc_t label_hit_proc_m; }; *************** *** 386,420 **** struct popup_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::pair<std::string, value_t> menu_item_t; ! typedef std::vector<menu_item_t> menu_items_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_static_disabled(bool is_static_disabled); ! void add_menu_item(const std::string& name, ! const value_t& value); ! void clear_menu_items(); ! void set_current_menu_item(const value_t& item); ! void select_with_text(const std::string& text); ! void signal_value_change( ! const implementation::popup_value_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); ! std::string name_m; ! std::string static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! implementation::popup_value_proc_t value_proc_m; ! menu_items_t menu_items_m; }; --- 387,421 ---- struct popup_t::implementation_t : control_t { ! typedef control_t _super; ! typedef std::pair<std::string, value_t> menu_item_t; ! typedef std::vector<menu_item_t> menu_items_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_static_disabled(bool is_static_disabled); ! void add_menu_item(const std::string& name, ! const value_t& value); ! void clear_menu_items(); ! void set_current_menu_item(const value_t& item); ! void select_with_text(const std::string& text); ! void signal_value_change( ! const implementation::popup_value_proc_t& proc); ! virtual dictionary_t essentials() const; ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); ! std::string name_m; ! std::string static_disabled_text_m; ! bool static_disabled_m; ! bool using_label_m; ! implementation::popup_value_proc_t value_proc_m; ! menu_items_t menu_items_m; }; *************** *** 423,461 **** struct unit_edit_text_t::implementation_t : edit_text_t::implementation_t { ! typedef edit_text_t::implementation_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name, ! bool using_popup, ! long cols, ! long rows); ! popup_t& get_popup(); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_active(bool is_active); ! virtual void set_theme(theme_t theme); ! void add_popup_menu_item(const std::string& name, ! const value_t& value); ! void select_popup_with_text(const std::string& text); ! void signal_popup_value_change( ! const implementation::popup_value_proc_t& proc); ! virtual dictionary_t essentials() const; ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::unit_edit_text_t::implementation_t); ! popup_t popup_m; ! bool using_popup_m; ! // ! // REVISIT (ralpht): Currently we just make the popup and ! // edit widgets the same height and hope that we end ! // up with baseline alignment. We clearly won't, so ! // at some point it will become important to store the ! // heights and baselines of the edit and popup widgets ! // so that we can get baseline alignment. ! // }; --- 424,462 ---- struct unit_edit_text_t::implementation_t : edit_text_t::implementation_t { ! typedef edit_text_t::implementation_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name, ! bool using_popup, ! long cols, ! long rows); ! popup_t& get_popup(); ! virtual extents_t best_bounds(); ! void set_bounds(const point_2d_t& position, ! const extents_t& geometry); ! void set_active(bool is_active); ! virtual void set_theme(theme_t theme); ! void add_popup_menu_item(const std::string& name, ! const value_t& value); ! void select_popup_with_text(const std::string& text); ! void signal_popup_value_change( ! const implementation::popup_value_proc_t& proc); ! virtual dictionary_t essentials() const; ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::unit_edit_text_t::implementation_t); ! popup_t popup_m; ! bool using_popup_m; ! // ! // REVISIT (ralpht): Currently we just make the popup and ! // edit widgets the same height and hope that we end ! // up with baseline alignment. We clearly won't, so ! // at some point it will become important to store the ! // heights and baselines of the edit and popup widgets ! // so that we can get baseline alignment. ! // }; *************** *** 464,527 **** struct slider_t::implementation_t : control_t { ! typedef control_t _super; ! ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! ! void initialize(/*const fltk::Rectangle& bounds,*/ ! int zero, ! bool is_vertical, ! slider_style_t style, ! long num_tick_marks); ! virtual extents_t best_bounds(); ! void set_min_value(long min_value); ! void set_max_value(long max_value); ! void set_value(long value); ! void signal_value_change( ! const implementation::slider_value_proc_t& proc); ! virtual void callback(); ! ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::slider_t::implementation_t); ! ! implementation::slider_value_proc_t value_proc_m; ! bool is_vertical_m; ! slider_style_t style_m; ! long num_tick_marks_m; ! }; ! ! /****************************************************************************************************/ ! ! struct bevel_button_t::implementation_t : control_t ! { ! typedef control_t _super; ! typedef std::pair<std::string, value_t> menu_item_t; ! typedef std::vector<menu_item_t> menu_items_t; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(const fltk::Rectangle& bounds, ! const std::string& name, ! bool offset_contents, ! bool menu_points_right); ! void add_menu_item(const std::string& name, ! const value_t& value); ! void clear_menu_items(); ! void set_bevel_amount(bevel_button_bevel_amount_t amount); ! void set_current_menu_item(const value_t& item); ! void set_value(bool value); ! void signal_hit( ! const implementation::bevel_button_hit_proc_t& proc); ! void signal_value_change( ! const implementation::bevel_button_popup_value_proc_t& proc); ! virtual dictionary_t essentials() const; ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::bevel_button_t::implementation_t); ! implementation::bevel_button_hit_proc_t hit_proc_m; ! implementation::bevel_button_popup_value_proc_t value_proc_m; ! menu_items_t menu_items_m; ! bool offset_contents_m; ! bool menu_points_right_m; }; --- 465,492 ---- struct slider_t::implementation_t : control_t { ! typedef control_t _super; ! implementation_t(); ! implementation_t(const implementation_t& rhs); ! void initialize(/*const fltk::Rectangle& bounds,*/ ! int zero, ! bool is_vertical, ! slider_style_t style, ! long num_tick_marks); ! virtual extents_t best_bounds(); ! void set_min_value(long min_value); ! void set_max_value(long max_value); ! void set_value(long value); ! void signal_value_change( ! const implementation::slider_value_proc_t& proc); ! virtual void callback(); ! ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_FRIEND_DECLARATION(adobe::slider_t::implementation_t); ! implementation::slider_value_proc_t value_proc_m; ! bool is_vertical_m; ! slider_style_t style_m; ! long num_tick_marks_m; }; *************** *** 544,548 **** ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::unit_edit_text_t::implementation_t); ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::slider_t::implementation_t); - ADOBE_SERIALIZABLE_EQUALITY_COMPARABLE_BOILERPLATE_DECLARATION(adobe::bevel_button_t::implementation_t); /****************************************************************************************************/ --- 509,512 ---- |
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future Modified Files: Jamfile.v2 assemblage.hpp closed_hash.hpp cmd_system.hpp count_minmax.hpp enum_ops.hpp file_slurp.hpp find_closest.hpp iomanip.hpp iomanip_asl_cel.hpp iomanip_fwd.hpp iomanip_pdf.hpp iomanip_xml.hpp manip.hpp memory.hpp menu_system.hpp modal_dialog_interface.hpp ternary_function.hpp timer.hpp Log Message: asl 1.0.13 Index: assemblage.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/assemblage.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** assemblage.hpp 6 Jan 2006 18:02:57 -0000 1.5 --- assemblage.hpp 3 Feb 2006 18:33:36 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 30,62 **** { public: ! typedef boost::signals::connection connection_t; ! typedef boost::function<void ()> destruct_slot_t; private: ! typedef std::list<connection_t> connections_t; #if 0 ! typedef boost::signal<void ()> destruct_signal_t; #endif ! typedef std::vector<destruct_slot_t> destruct_signal_t; public: ! assemblage_t(); ! ~assemblage_t(); ! connection_t& hold_connection(const connection_t& connection); ! void signal_destruction(const destruct_slot_t& slot); ! template <typename T> ! void delete_on_destruction(T& x) ! { ! adobe::delete_ptr<T> deleter; ! signal_destruction(boost::bind(deleter,x)); ! } private: ! connections_t connections_m; ! destruct_signal_t destruct_signal_m; ! int group_m; }; --- 30,62 ---- { public: ! typedef boost::signals::connection connection_t; ! typedef boost::function<void ()> destruct_slot_t; private: ! typedef std::list<connection_t> connections_t; #if 0 ! typedef boost::signal<void ()> destruct_signal_t; #endif ! typedef std::vector<destruct_slot_t> destruct_signal_t; public: ! assemblage_t(); ! ~assemblage_t(); ! connection_t& hold_connection(const connection_t& connection); ! void signal_destruction(const destruct_slot_t& slot); ! template <typename T> ! void delete_on_destruction(T& x) ! { ! adobe::delete_ptr<T> deleter; ! signal_destruction(boost::bind(deleter,x)); ! } private: ! connections_t connections_m; ! destruct_signal_t destruct_signal_m; ! int group_m; }; *************** *** 71,85 **** struct equal_to_first : std::unary_function<PairType, bool> { ! equal_to_first(const typename PairType::first_type& first) : ! first_m(first) ! { } ! ! bool operator() (const PairType& pair) const ! { return pair.first == first_m; } private: ! typename PairType::first_type first_m; }; ! } // namespace --- 71,85 ---- struct equal_to_first : std::unary_function<PairType, bool> { ! equal_to_first(const typename PairType::first_type& first) : ! first_m(first) ! { } ! ! bool operator() (const PairType& pair) const ! { return pair.first == first_m; } private: ! typename PairType::first_type first_m; }; ! } // namespace Index: find_closest.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/find_closest.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** find_closest.hpp 6 Jan 2006 18:02:57 -0000 1.3 --- find_closest.hpp 3 Feb 2006 18:33:36 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 25,66 **** /* ! find_closest takes a range and a value, and returns the closest value in the sequence to the ! value passed, for some definition of "closest". By default it compares the cardinal difference ! between the values to find the closest, though the client can pass their own TernaryPredicate ! to override this functionality. ! Preconditions: ! - The sequence to be searched must be sorted according to the comparison method used in ! the supplied TernaryPredicate. ! Postconditions: ! - As long as the size of the sequence is greater than 0, the result will always be a valid ! value inside the sequence. (i.e., the only time the end of the sequence is returned is ! when the sequence is empty). ! Additional Concepts: ! - Subtractable : Subtraction yields a difference type; T - T -> D ! - TernaryPredicate : A TernanyPredicate is called with three arguments ! and returns true or false. */ /*************************************************************************************************/ ! template < typename T // T models Subtractable ! > struct closer_predicate : ternary_function<T, T, T, bool> { ! typedef ternary_function<T, T, T, bool> _super; ! typedef typename _super::first_argument_type first_argument_type; ! typedef typename _super::second_argument_type second_argument_type; ! typedef typename _super::third_argument_type third_argument_type; ! typedef typename _super::result_type result_type; ! result_type operator () (const first_argument_type& a, const second_argument_type& b, const third_argument_type& x) const ! { ! // precondition: a <= b ! return x - a < b - x; ! } }; --- 25,66 ---- /* ! find_closest takes a range and a value, and returns the closest value in the sequence to the ! value passed, for some definition of "closest". By default it compares the cardinal difference ! between the values to find the closest, though the client can pass their own TernaryPredicate ! to override this functionality. ! Preconditions: ! - The sequence to be searched must be sorted according to the comparison method used in ! the supplied TernaryPredicate. ! Postconditions: ! - As long as the size of the sequence is greater than 0, the result will always be a valid ! value inside the sequence. (i.e., the only time the end of the sequence is returned is ! when the sequence is empty). ! Additional Concepts: ! - Subtractable : Subtraction yields a difference type; T - T -> D ! - TernaryPredicate : A TernanyPredicate is called with three arguments ! and returns true or false. */ /*************************************************************************************************/ ! template < typename T // T models Subtractable ! > struct closer_predicate : ternary_function<T, T, T, bool> { ! typedef ternary_function<T, T, T, bool> _super; ! typedef typename _super::first_argument_type first_argument_type; ! typedef typename _super::second_argument_type second_argument_type; ! typedef typename _super::third_argument_type third_argument_type; ! typedef typename _super::result_type result_type; ! result_type operator () (const first_argument_type& a, const second_argument_type& b, const third_argument_type& x) const ! { ! // precondition: a <= b ! return x - a < b - x; ! } }; *************** *** 71,131 **** /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > I find_closest(I first, D n, const T& value, C pred, std::forward_iterator_tag) { ! if (n < D(2)) return first; ! while (n != D(2)) ! { ! D third(n / D(3)); ! D new_n(n - third); ! I first_third(first); ! I last_third(first); ! std::advance(first_third, third); ! std::advance(last_third, new_n); ! if (!pred(*first_third, *last_third, value)) ! first = first_third; ! n = new_n; ! } ! I second(first); ! std::advance(second, 1); ! return pred(*first, *second, value) ? first : second; } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > I find_closest(I first, D n, const T& value, C pred, std::random_access_iterator_tag) { ! if (n < D(2)) return first; ! while (n != D(2)) ! { ! D third(n / D(3)); ! D new_n(n - third); ! if (!pred(*(first + third), *(first + new_n), value)) ! first += third; ! n = new_n; ! } ! I second(first + 1); ! return pred(*first, *second, value) ? first : second; } --- 71,131 ---- /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > I find_closest(I first, D n, const T& value, C pred, std::forward_iterator_tag) { ! if (n < D(2)) return first; ! while (n != D(2)) ! { ! D third(n / D(3)); ! D new_n(n - third); ! I first_third(first); ! I last_third(first); ! std::advance(first_third, third); ! std::advance(last_third, new_n); ! if (!pred(*first_third, *last_third, value)) ! first = first_third; ! n = new_n; ! } ! I second(first); ! std::advance(second, 1); ! return pred(*first, *second, value) ? first : second; } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > I find_closest(I first, D n, const T& value, C pred, std::random_access_iterator_tag) { ! if (n < D(2)) return first; ! while (n != D(2)) ! { ! D third(n / D(3)); ! D new_n(n - third); ! if (!pred(*(first + third), *(first + new_n), value)) ! first += third; ! n = new_n; ! } ! I second(first + 1); ! return pred(*first, *second, value) ? first : second; } *************** *** 136,187 **** /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > inline I find_closest(I first, D n, const T& value, C pred) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, n, value, pred, category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T // T models Subtractable ! > inline I find_closest(I first, D n, const T& value) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, n, value, closer_predicate<T>(), category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > inline I find_closest(I first, I last, const T& value, C pred) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, std::distance(first, last), value, pred, category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename T // T models Subtractable ! > inline I find_closest(I first, I last, const T& value) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, std::distance(first, last), value, closer_predicate<T>(), category()); } --- 136,187 ---- /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > inline I find_closest(I first, D n, const T& value, C pred) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, n, value, pred, category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename D, // D models LessThanComparable ! typename T // T models Subtractable ! > inline I find_closest(I first, D n, const T& value) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, n, value, closer_predicate<T>(), category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename T, // T models Subtractable ! typename C // C models TernaryPredicate ! > inline I find_closest(I first, I last, const T& value, C pred) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, std::distance(first, last), value, pred, category()); } /*************************************************************************************************/ ! template < typename I, // I models ForwardIterator ! typename T // T models Subtractable ! > inline I find_closest(I first, I last, const T& value) { ! typedef typename std::iterator_traits<I>::iterator_category category; ! return implementation::find_closest(first, std::distance(first, last), value, closer_predicate<T>(), category()); } Index: timer.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/timer.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** timer.hpp 6 Jan 2006 18:02:57 -0000 1.7 --- timer.hpp 3 Feb 2006 18:33:36 -0000 1.8 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 16,32 **** \ingroup asl_libraries ! \brief A class for measuring periods of elapsed time. Can also ! accrue split times for some basic statistical reporting. Comparisons between two <code>adobe::timer_t</code> considers only the last split time. \model_of ! - \ref concept_regular_type ! - \ref stldoc_LessThanComparable \rationale ! A class that measures elapsed time can be useful when debugging, optimizing, or comparing ! implementations. <code>adobe::timer_t</code> utilizes the most accurate timing API a ! platform has to offer to maximize accuracy, while keeping the public API generic. \example --- 16,32 ---- \ingroup asl_libraries ! \brief A class for measuring periods of elapsed time. Can also ! accrue split times for some basic statistical reporting. Comparisons between two <code>adobe::timer_t</code> considers only the last split time. \model_of ! - \ref concept_regular_type ! - \ref stldoc_LessThanComparable \rationale ! A class that measures elapsed time can be useful when debugging, optimizing, or comparing ! implementations. <code>adobe::timer_t</code> utilizes the most accurate timing API a ! platform has to offer to maximize accuracy, while keeping the public API generic. \example *************** *** 35,52 **** \par \code ! adobe::timer_t timer1; ! do_my_func(); ! timer1.split(); ! adobe::timer_t timer2; ! do_their_func(); ! timer2.split(); ! if (timer1 == timer2) ! std::cout << "Functions are equally fast" << std::endl; ! else if (timer1 < timer2) ! std::cout << "My function is faster" << std::endl; ! else ! std::cout << "Their function is faster" << std::endl; \endcode \par --- 35,52 ---- \par \code ! adobe::timer_t timer1; ! do_my_func(); ! timer1.split(); ! adobe::timer_t timer2; ! do_their_func(); ! timer2.split(); ! if (timer1 == timer2) ! std::cout << "Functions are equally fast" << std::endl; ! else if (timer1 < timer2) ! std::cout << "My function is faster" << std::endl; ! else ! std::cout << "Their function is faster" << std::endl; \endcode \par *************** *** 54,80 **** in order to gain a more accurate understanding of the cost of an implementation: \code ! adobe::timer_t timer1; ! adobe::timer_t timer2; ! for (std::size_t i(0); i < sample_count_k; ++i) ! { ! timer1.reset(); ! do_my_func(); ! timer1.accrue(); ! timer2.reset(); ! do_their_func(); ! timer2.accrue(); ! } ! double my_avg(timer1.accrued_average()); ! double their_avg(timer2.accrued_average()); ! if (my_avg == their_avg) ! std::cout << "Functions are equally fast" << std::endl; ! else if (my_avg < their_avg) ! std::cout << "My function is faster" << std::endl; ! else ! std::cout << "Their function is faster" << std::endl; \endcode \par --- 54,80 ---- in order to gain a more accurate understanding of the cost of an implementation: \code ! adobe::timer_t timer1; ! adobe::timer_t timer2; ! for (std::size_t i(0); i < sample_count_k; ++i) ! { ! timer1.reset(); ! do_my_func(); ! timer1.accrue(); ! timer2.reset(); ! do_their_func(); ! timer2.accrue(); ! } ! double my_avg(timer1.accrued_average()); ! double their_avg(timer2.accrued_average()); ! if (my_avg == their_avg) ! std::cout << "Functions are equally fast" << std::endl; ! else if (my_avg < their_avg) ! std::cout << "My function is faster" << std::endl; ! else ! std::cout << "Their function is faster" << std::endl; \endcode \par *************** *** 98,116 **** #if ADOBE_PLATFORM_MAC ! #include<Carbon/Carbon.h> #elif ADOBE_PLATFORM_WIN ! #ifndef WINDOWS_LEAN_AND_MEAN ! #define WINDOWS_LEAN_AND_MEAN ! #define ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN 1 ! #endif ! #include <windows.h> ! #if ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN ! #undef WINDOWS_LEAN_AND_MEAN ! #undef ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN ! #endif #elif defined(BOOST_HAS_THREADS) ! #include <boost/thread/xtime.hpp> #elif defined(BOOST_HAS_GETTIMEOFDAY) ! #include <sys/time.h> #endif --- 98,116 ---- #if ADOBE_PLATFORM_MAC ! #include<Carbon/Carbon.h> #elif ADOBE_PLATFORM_WIN ! #ifndef WINDOWS_LEAN_AND_MEAN ! #define WINDOWS_LEAN_AND_MEAN ! #define ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN 1 ! #endif ! #include <windows.h> ! #if ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN ! #undef WINDOWS_LEAN_AND_MEAN ! #undef ADOBE_UNDEFINE_WINDOWS_LEAN_AND_MEAN ! #endif #elif defined(BOOST_HAS_THREADS) ! #include <boost/thread/xtime.hpp> #elif defined(BOOST_HAS_GETTIMEOFDAY) ! #include <sys/time.h> #endif *************** *** 128,341 **** { #if ADOBE_PLATFORM_MAC ! typedef UnsignedWide value_type; #elif ADOBE_PLATFORM_WIN ! typedef LARGE_INTEGER value_type; #elif defined(BOOST_HAS_THREADS) ! typedef boost::xtime value_type; #elif defined(BOOST_HAS_GETTIMEOFDAY) ! typedef timeval value_type; #endif ! typedef std::vector<double> accumulator_type; public: ! typedef accumulator_type::size_type size_type; #ifndef ADOBE_NO_DOCUMENTATION ! timer_t() ! { #if ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceFrequency(&frequency_m); #endif ! reset(); ! } ! timer_t(const timer_t& rhs) : ! epoch_m(rhs.epoch_m), ! split_m(rhs.split_m), ! time_set_m(rhs.time_set_m) #if ADOBE_PLATFORM_WIN ! , frequency_m(rhs.frequency_m) #endif ! { } ! timer_t& operator = (const timer_t& rhs) ! { ! epoch_m = rhs.epoch_m; ! split_m = rhs.split_m; ! time_set_m = rhs.time_set_m; #if ADOBE_PLATFORM_WIN ! frequency_m = rhs.frequency_m; #endif ! return *this; ! } #endif ! /*! ! Resets the epoch of the timer to now ! */ ! inline void reset() ! { #if ADOBE_PLATFORM_MAC ! ::Microseconds(&epoch_m); #elif ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceCounter(&epoch_m); #elif defined(BOOST_HAS_THREADS) ! boost::xtime_get(&epoch_m, boost::TIME_UTC); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! gettimeofday(&epoch_m, static_cast<struct timezone*>(0)); #endif ! } ! /*! ! Resets the split time accumulator ! */ ! inline void reset_accumulator() ! { time_set_m.clear(); } ! /*! ! \return ! The difference of time between the epoch and now, in milliseconds ! */ ! inline double split() ! { #if ADOBE_PLATFORM_MAC ! ::Microseconds(&split_m); #elif ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceCounter(&split_m); #elif defined(BOOST_HAS_THREADS) ! boost::xtime_get(&split_m, boost::TIME_UTC); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! gettimeofday(&split_m, static_cast<struct timezone*>(0)); #endif ! return last_split(); ! } ! /*! ! \return ! The difference of time between the epoch and the last split, in milliseconds ! */ ! ! inline double last_split() const ! { #if ADOBE_PLATFORM_MAC ! return (split_m.lo - epoch_m.lo) / double(1e3); #elif ADOBE_PLATFORM_WIN ! return (split_m.QuadPart - epoch_m.QuadPart) / static_cast<double>(frequency_m.QuadPart) * double(1e3); #elif defined(BOOST_HAS_THREADS) ! return ((split_m.sec - epoch_m.sec) * double(1e3) + (split_m.nsec - epoch_m.nsec) / double(1e6)); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! return ((split_m.tv_sec - epoch_m.tv_sec) * double(1e3) + (split_m.tv_usec - epoch_m.tv_usec) / double(1e3)); #else ! return -1; #endif ! } ! /*! ! Grabs a new split time and stores it in the accumulator. ! */ ! inline void accrue() ! { time_set_m.push_back(split()); } ! /*! ! \return ! The smallest of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_min() const ! { return *adobe::min_element(time_set_m); } ! /*! ! \return ! The largest of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_max() const ! { return *adobe::max_element(time_set_m); } ! /*! ! \return ! The average of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_average() const ! { return empty() ? 0 : accrued_total() / size(); } ! /*! ! \return ! The median of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_median() const ! { ! if (empty()) return 0; ! adobe::sort(time_set_m); ! return (size() % 2 == 1) ? ! time_set_m[time_set_m.size() / 2] : ! (time_set_m[time_set_m.size() / 2] + ! time_set_m[time_set_m.size() / 2 - 1]) / 2; ! } ! /*! ! \return ! The summation of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_total() const ! { return adobe::accumulate(time_set_m, double(0)); } ! /*! ! \return ! The number of split times in the accumulator ! */ ! inline size_type size() const ! { return time_set_m.size(); } ! /*! ! \return ! Whether or not there are any split times in the accumulator ! */ ! inline bool empty() const ! { return time_set_m.empty(); } ! /*! ! An archaic utility function that takes a new split time and outputs it to a stream ! \param decoration An identifier to apply to the split time. ! \param s The stream to which output is written. Defaults to <code>std::cout</code> ! */ ! inline void report(const char* decoration, std::ostream& s = std::cout) ! { ! double time(split()); ! s << decoration << " took " << time << " milliseconds (" << time / 1e3 << " sec)" << std::endl; ! } private: #ifndef ADOBE_NO_DOCUMENTATION ! friend bool operator == (const timer_t& x, const timer_t& y); ! friend bool operator < (const timer_t& x, const timer_t& y); #endif ! value_type epoch_m; ! value_type split_m; ! mutable accumulator_type time_set_m; #if ADOBE_PLATFORM_WIN ! value_type frequency_m; #endif }; --- 128,341 ---- { #if ADOBE_PLATFORM_MAC ! typedef UnsignedWide value_type; #elif ADOBE_PLATFORM_WIN ! typedef LARGE_INTEGER value_type; #elif defined(BOOST_HAS_THREADS) ! typedef boost::xtime value_type; #elif defined(BOOST_HAS_GETTIMEOFDAY) ! typedef timeval value_type; #endif ! typedef std::vector<double> accumulator_type; public: ! typedef accumulator_type::size_type size_type; #ifndef ADOBE_NO_DOCUMENTATION ! timer_t() ! { #if ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceFrequency(&frequency_m); #endif ! reset(); ! } ! timer_t(const timer_t& rhs) : ! epoch_m(rhs.epoch_m), ! split_m(rhs.split_m), ! time_set_m(rhs.time_set_m) #if ADOBE_PLATFORM_WIN ! , frequency_m(rhs.frequency_m) #endif ! { } ! timer_t& operator = (const timer_t& rhs) ! { ! epoch_m = rhs.epoch_m; ! split_m = rhs.split_m; ! time_set_m = rhs.time_set_m; #if ADOBE_PLATFORM_WIN ! frequency_m = rhs.frequency_m; #endif ! return *this; ! } #endif ! /*! ! Resets the epoch of the timer to now ! */ ! inline void reset() ! { #if ADOBE_PLATFORM_MAC ! ::Microseconds(&epoch_m); #elif ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceCounter(&epoch_m); #elif defined(BOOST_HAS_THREADS) ! boost::xtime_get(&epoch_m, boost::TIME_UTC); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! gettimeofday(&epoch_m, static_cast<struct timezone*>(0)); #endif ! } ! /*! ! Resets the split time accumulator ! */ ! inline void reset_accumulator() ! { time_set_m.clear(); } ! /*! ! \return ! The difference of time between the epoch and now, in milliseconds ! */ ! inline double split() ! { #if ADOBE_PLATFORM_MAC ! ::Microseconds(&split_m); #elif ADOBE_PLATFORM_WIN ! (void)::QueryPerformanceCounter(&split_m); #elif defined(BOOST_HAS_THREADS) ! boost::xtime_get(&split_m, boost::TIME_UTC); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! gettimeofday(&split_m, static_cast<struct timezone*>(0)); #endif ! return last_split(); ! } ! /*! ! \return ! The difference of time between the epoch and the last split, in milliseconds ! */ ! ! inline double last_split() const ! { #if ADOBE_PLATFORM_MAC ! return (split_m.lo - epoch_m.lo) / double(1e3); #elif ADOBE_PLATFORM_WIN ! return (split_m.QuadPart - epoch_m.QuadPart) / static_cast<double>(frequency_m.QuadPart) * double(1e3); #elif defined(BOOST_HAS_THREADS) ! return ((split_m.sec - epoch_m.sec) * double(1e3) + (split_m.nsec - epoch_m.nsec) / double(1e6)); #elif defined(BOOST_HAS_GETTIMEOFDAY) ! return ((split_m.tv_sec - epoch_m.tv_sec) * double(1e3) + (split_m.tv_usec - epoch_m.tv_usec) / double(1e3)); #else ! return -1; #endif ! } ! /*! ! Grabs a new split time and stores it in the accumulator. ! */ ! inline void accrue() ! { time_set_m.push_back(split()); } ! /*! ! \return ! The smallest of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_min() const ! { return *adobe::min_element(time_set_m); } ! /*! ! \return ! The largest of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_max() const ! { return *adobe::max_element(time_set_m); } ! /*! ! \return ! The average of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_average() const ! { return empty() ? 0 : accrued_total() / size(); } ! /*! ! \return ! The median of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_median() const ! { ! if (empty()) return 0; ! adobe::sort(time_set_m); ! return (size() % 2 == 1) ? ! time_set_m[time_set_m.size() / 2] : ! (time_set_m[time_set_m.size() / 2] + ! time_set_m[time_set_m.size() / 2 - 1]) / 2; ! } ! /*! ! \return ! The summation of the split times in the accumulator, in milliseconds ! */ ! inline double accrued_total() const ! { return adobe::accumulate(time_set_m, double(0)); } ! /*! ! \return ! The number of split times in the accumulator ! */ ! inline size_type size() const ! { return time_set_m.size(); } ! /*! ! \return ! Whether or not there are any split times in the accumulator ! */ ! inline bool empty() const ! { return time_set_m.empty(); } ! /*! ! An archaic utility function that takes a new split time and outputs it to a stream ! \param decoration An identifier to apply to the split time. ! \param s The stream to which output is written. Defaults to <code>std::cout</code> ! */ ! inline void report(const char* decoration, std::ostream& s = std::cout) ! { ! double time(split()); ! s << decoration << " took " << time << " milliseconds (" << time / 1e3 << " sec)" << std::endl; ! } private: #ifndef ADOBE_NO_DOCUMENTATION ! friend bool operator == (const timer_t& x, const timer_t& y); ! friend bool operator < (const timer_t& x, const timer_t& y); #endif ! value_type epoch_m; ! value_type split_m; ! mutable accumulator_type time_set_m; #if ADOBE_PLATFORM_WIN ! value_type frequency_m; #endif }; Index: manip.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/manip.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** manip.hpp 6 Jan 2006 18:02:57 -0000 1.3 --- manip.hpp 3 Feb 2006 18:33:36 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 29,83 **** { public: ! manipulator_base() : ! error_m(std::ios_base::goodbit) ! { } protected: ! template <typename StreamType> ! std::ios_base::iostate handle_error(StreamType& strm) const ! { ! std::ios_base::iostate err(error_m); ! try { throw; } ! catch (std::bad_alloc&) ! { ! set_bad(); ! std::ios_base::iostate exception_mask(strm.exceptions()); ! ! if (exception_mask & std::ios_base::failbit && !(exception_mask & std::ios_base::badbit)) ! strm.setstate(err); ! else if (exception_mask & std::ios_base::badbit) ! { ! try { strm.setstate(err); } ! catch (std::ios_base::failure&) { } ! throw; ! } ! } ! catch (...) ! { ! set_fail(); ! std::ios_base::iostate exception_mask(strm.exceptions()); ! if ((exception_mask & std::ios_base::badbit) && (err & std::ios_base::badbit)) ! strm.setstate(err); ! else if (exception_mask & std::ios_base::failbit) ! { ! try { strm.setstate(err); } ! catch (std::ios_base::failure&) { } ! throw; ! } ! } ! return err; ! } ! void set_fail() const { error_m |= std::ios_base::failbit; } ! void set_bad() const { error_m |= std::ios_base::badbit; } ! mutable std::ios_base::iostate error_m; }; --- 29,83 ---- { public: ! manipulator_base() : ! error_m(std::ios_base::goodbit) ! { } protected: ! template <typename StreamType> ! std::ios_base::iostate handle_error(StreamType& strm) const ! { ! std::ios_base::iostate err(error_m); ! try { throw; } ! catch (std::bad_alloc&) ! { ! set_bad(); ! std::ios_base::iostate exception_mask(strm.exceptions()); ! ! if (exception_mask & std::ios_base::failbit && !(exception_mask & std::ios_base::badbit)) ! strm.setstate(err); ! else if (exception_mask & std::ios_base::badbit) ! { ! try { strm.setstate(err); } ! catch (std::ios_base::failure&) { } ! throw; ! } ! } ! catch (...) ! { ! set_fail(); ! std::ios_base::iostate exception_mask(strm.exceptions()); ! if ((exception_mask & std::ios_base::badbit) && (err & std::ios_base::badbit)) ! strm.setstate(err); ! else if (exception_mask & std::ios_base::failbit) ! { ! try { strm.setstate(err); } ! catch (std::ios_base::failure&) { } ! throw; ! } ! } ! return err; ! } ! void set_fail() const { error_m |= std::ios_base::failbit; } ! void set_bad() const { error_m |= std::ios_base::badbit; } ! mutable std::ios_base::iostate error_m; }; *************** *** 88,124 **** { public: ! typedef ArgumentType argument_type; ! typedef std::basic_ostream<charT, traits> stream_type; ! typedef stream_type& (*manip_func)(stream_type&, const ArgumentType&); ! basic_omanipulator(manip_func pf, const ArgumentType& arg) : ! pf_m(pf), arg_m(arg) ! { } ! void do_manip(stream_type& strm) const ! { ! if (error_m != std::ios_base::goodbit) ! strm.setstate(error_m); ! else ! { ! std::ios_base::iostate err(error_m); ! try ! { ! (*pf_m)(strm, arg_m); ! } ! catch (...) ! { ! err = handle_error(strm); ! } ! if (err) strm.setstate(err); ! } ! } private: ! manip_func pf_m; protected: ! argument_type arg_m; }; --- 88,124 ---- { public: ! typedef ArgumentType argument_type; ! typedef std::basic_ostream<charT, traits> stream_type; ! typedef stream_type& (*manip_func)(stream_type&, const ArgumentType&); ! basic_omanipulator(manip_func pf, const ArgumentType& arg) : ! pf_m(pf), arg_m(arg) ! { } ! void do_manip(stream_type& strm) const ! { ! if (error_m != std::ios_base::goodbit) ! strm.setstate(error_m); ! else ! { ! std::ios_base::iostate err(error_m); ! try ! { ! (*pf_m)(strm, arg_m); ! } ! catch (...) ! { ! err = handle_error(strm); ! } ! if (err) strm.setstate(err); ! } ! } private: ! manip_func pf_m; protected: ! argument_type arg_m; }; *************** *** 129,167 **** { public: ! typedef ArgumentType1 argument_type_1; ! typedef ArgumentType2 argument_type_2; ! typedef std::basic_ostream<charT, traits> stream_type; ! typedef stream_type& (*manip_func)(stream_type&, const ArgumentType1&, const ArgumentType2&); ! basic_omanipulator2(manip_func pf, const ArgumentType1& arg1, const ArgumentType2& arg2) : ! pf_m(pf), arg1_m(arg1) , arg2_m(arg2) ! { } ! void do_manip(stream_type& strm) const ! { ! if (error_m != std::ios_base::goodbit) ! strm.setstate(error_m); ! else ! { ! std::ios_base::iostate err(error_m); ! try ! { ! (*pf_m)(strm, arg1_m, arg2_m); ! } ! catch (...) ! { ! err = handle_error(strm); ! } ! if (err) strm.setstate(err); ! } ! } private: ! manip_func pf_m; protected: ! argument_type_1 arg1_m; ! argument_type_2 arg2_m; }; --- 129,167 ---- { public: ! typedef ArgumentType1 argument_type_1; ! typedef ArgumentType2 argument_type_2; ! typedef std::basic_ostream<charT, traits> stream_type; ! typedef stream_type& (*manip_func)(stream_type&, const ArgumentType1&, const ArgumentType2&); ! basic_omanipulator2(manip_func pf, const ArgumentType1& arg1, const ArgumentType2& arg2) : ! pf_m(pf), arg1_m(arg1) , arg2_m(arg2) ! { } ! void do_manip(stream_type& strm) const ! { ! if (error_m != std::ios_base::goodbit) ! strm.setstate(error_m); ! else ! { ! std::ios_base::iostate err(error_m); ! try ! { ! (*pf_m)(strm, arg1_m, arg2_m); ! } ! catch (...) ! { ! err = handle_error(strm); ! } ! if (err) strm.setstate(err); ! } ! } private: ! manip_func pf_m; protected: ! argument_type_1 arg1_m; ! argument_type_2 arg2_m; }; *************** *** 170,180 **** template <class ArgumentType, class charT, class traits> std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& os, ! const adobe::basic_omanipulator<ArgumentType, charT, traits>& manip) ! { ! if (os.good()) ! manip.do_manip(os); ! return os; ! } /*************************************************************************************************/ --- 170,180 ---- template <class ArgumentType, class charT, class traits> std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& os, ! const adobe::basic_omanipulator<ArgumentType, charT, traits>& manip) ! { ! if (os.good()) ! manip.do_manip(os); ! return os; ! } /*************************************************************************************************/ *************** *** 182,192 **** template <class ArgumentType1, class ArgumentType2, class charT, class traits> std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& os, ! const adobe::basic_omanipulator2<ArgumentType1, ArgumentType2, charT, traits>& manip) ! { ! if (os.good()) ! manip.do_manip(os); ! return os; ! } /*************************************************************************************************/ --- 182,192 ---- template <class ArgumentType1, class ArgumentType2, class charT, class traits> std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& os, ! const adobe::basic_omanipulator2<ArgumentType1, ArgumentType2, charT, traits>& manip) ! { ! if (os.good()) ! manip.do_manip(os); ! return os; ! } /*************************************************************************************************/ *************** *** 195,228 **** class basic_bounded_width : public basic_omanipulator<unsigned int, charT, traits> { ! typedef basic_omanipulator<unsigned int, charT, traits> inherited_t; public: ! typedef typename inherited_t::stream_type stream_type; ! typedef typename inherited_t::argument_type argument_type; ! basic_bounded_width(argument_type min, argument_type max) : ! basic_omanipulator<argument_type, charT, traits>(basic_bounded_width::fct, min), ! min_m(min), max_m(max) ! { } ! inherited_t& operator() (argument_type i) ! { ! inherited_t::arg_m = std::min(max_m, std::max(i, min_m)); ! return *this; ! } private: ! static stream_type& fct(stream_type& strm, const argument_type& i) ! { ! strm.width(i); ! return strm; ! } ! argument_type min_m; ! argument_type max_m; }; ! typedef basic_bounded_width<char, std::char_traits<char> > bounded_width; ! typedef basic_bounded_width<wchar_t, std::char_traits<wchar_t> > wbounded_width; /*************************************************************************************************/ --- 195,228 ---- class basic_bounded_width : public basic_omanipulator<unsigned int, charT, traits> { ! typedef basic_omanipulator<unsigned int, charT, traits> inherited_t; public: ! typedef typename inherited_t::stream_type stream_type; ! typedef typename inherited_t::argument_type argument_type; ! basic_bounded_width(argument_type min, argument_type max) : ! basic_omanipulator<argument_type, charT, traits>(basic_bounded_width::fct, min), ! min_m(min), max_m(max) ! { } ! inherited_t& operator() (argument_type i) ! { ! inherited_t::arg_m = std::min(max_m, std::max(i, min_m)); ! return *this; ! } private: ! static stream_type& fct(stream_type& strm, const argument_type& i) ! { ! strm.width(i); ! return strm; ! } ! argument_type min_m; ! argument_type max_m; }; ! typedef basic_bounded_width<char, std::char_traits<char> > bounded_width; ! typedef basic_bounded_width<wchar_t, std::char_traits<wchar_t> > wbounded_width; /*************************************************************************************************/ Index: enum_ops.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/enum_ops.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** enum_ops.hpp 6 Jan 2006 18:02:57 -0000 1.5 --- enum_ops.hpp 3 Feb 2006 18:33:36 -0000 1.6 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 17,56 **** /*! ! \defgroup enum_ops Enumeration Operations ! \ingroup asl_libraries ! ! \section Description Description ! ! \c enum_ops provides optional typesafe bitset and arithmetic ! operations for enumeration types. Without these typesafe operations, ! the compiler will promote the operand(s) to the appropriate integral ! type, and the result will be an integral type. When the typesafe ! operations have been defined for an enumeration type, \c E, the result ! will be of type \c E exactly when the operand(s) are of type \c E. ! ! \c ADOBE_DEFINE_BITSET_OPS(E) enables the bitset operations <code>~, ! |, &, ^, |=, &=, ^= </code> for enumeration type \c E. ! ! \c ADOBE_DEFINE_ARITHMETIC_OPS(E) enables the typesafe arithmetic ! operations <code>=, -, *, /, %, +=, *=, -=, /=, %=</code> for ! enumeration type \c E. ! ! \section Definition Definition ! ! Defined in \link enum_ops.hpp <code>adobe/enum_ops.hpp</code> \endlink ! ! \section Example Example ! ! The following is an example of code that will compile: ! \dontinclude enum_ops_example.cpp ! \skip start_of_example ! \until end_of_example ! ! The following is contains an example of code that will not compile ! since the typesafe operators have not been defined. ! ! \dontinclude enum_ops_example_fail.cpp ! \skip start_of_example ! \until end_of_example */ --- 17,56 ---- /*! ! \defgroup enum_ops Enumeration Operations ! \ingroup asl_libraries ! ! \section Description Description ! ! \c enum_ops provides optional typesafe bitset and arithmetic ! operations for enumeration types. Without these typesafe operations, ! the compiler will promote the operand(s) to the appropriate integral ! type, and the result will be an integral type. When the typesafe ! operations have been defined for an enumeration type, \c E, the result ! will be of type \c E exactly when the operand(s) are of type \c E. ! ! \c ADOBE_DEFINE_BITSET_OPS(E) enables the bitset operations <code>~, ! |, &, ^, |=, &=, ^= </code> for enumeration type \c E. ! ! \c ADOBE_DEFINE_ARITHMETIC_OPS(E) enables the typesafe arithmetic ! operations <code>=, -, *, /, %, +=, *=, -=, /=, %=</code> for ! enumeration type \c E. ! ! \section Definition Definition ! ! Defined in \link enum_ops.hpp <code>adobe/enum_ops.hpp</code> \endlink ! ! \section Example Example ! ! The following is an example of code that will compile: ! \dontinclude enum_ops_example.cpp ! \skip start_of_example ! \until end_of_example ! ! The following is contains an example of code that will not compile ! since the typesafe operators have not been defined. ! ! \dontinclude enum_ops_example_fail.cpp ! \skip start_of_example ! \until end_of_example */ *************** *** 65,80 **** /*************************************************************************************************/ #if !defined(ADOBE_NO_DOCUMENTATION) ! inline signed char promote_enum (signed char e) { return e; } ! inline unsigned char promote_enum (unsigned char e) { return e; } ! inline signed short promote_enum (signed short e) { return e; } ! inline unsigned short promote_enum (unsigned short e) { return e; } ! inline signed int promote_enum (signed int e) { return e; } ! inline unsigned int promote_enum (unsigned int e) { return e; } ! inline signed long promote_enum (signed long e) { return e; } ! inline unsigned long promote_enum (unsigned long e) { return e; } #ifdef BOOST_HAS_LONG_LONG ! inline signed long long promote_enum (signed long long e) { return e; } ! inline unsigned long long promote_enum (unsigned long long e) { return e; } #endif #endif --- 65,80 ---- /*************************************************************************************************/ #if !defined(ADOBE_NO_DOCUMENTATION) ! inline signed char promote_enum (signed char e) { return e; } ! inline unsigned char promote_enum (unsigned char e) { return e; } ! inline signed short promote_enum (signed short e) { return e; } ! inline unsigned short promote_enum (unsigned short e) { return e; } ! inline signed int promote_enum (signed int e) { return e; } ! inline unsigned int promote_enum (unsigned int e) { return e; } ! inline signed long promote_enum (signed long e) { return e; } ! inline unsigned long promote_enum (unsigned long e) { return e; } #ifdef BOOST_HAS_LONG_LONG ! inline signed long long promote_enum (signed long long e) { return e; } ! inline unsigned long long promote_enum (unsigned long long e) { return e; } #endif #endif *************** *** 89,184 **** /*************************************************************************************************/ ! #define ADOBE_DEFINE_BITSET_OPS(EnumType) \ ! inline EnumType operator~(EnumType a) \ ! { \ ! return EnumType(~adobe::implementation::promote_enum(a)); \ ! } \ ! \ ! inline EnumType operator|(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) | adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator&(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) & adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator^(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) ^ adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType& operator&=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs & rhs; \ ! } \ ! \ ! inline EnumType& operator|=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs | rhs; \ ! } \ ! \ ! inline EnumType& operator^=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs ^ rhs; \ } /*************************************************************************************************/ ! #define ADOBE_DEFINE_ARITHMETIC_OPS(EnumType) \ ! inline EnumType operator-(EnumType a) \ ! { \ ! return EnumType(-a); \ ! } \ ! \ ! inline EnumType operator+(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) + adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator-(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) - adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator*(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) * adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator/(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) / adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator%(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) % adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType& operator+=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs + rhs; \ ! } \ ! \ ! inline EnumType& operator-=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs - rhs; \ ! } \ ! \ ! inline EnumType& operator*=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs * rhs; \ ! } \ ! \ ! inline EnumType& operator/=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs / rhs; \ ! } \ ! \ ! inline EnumType& operator%=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs % rhs; \ } --- 89,184 ---- /*************************************************************************************************/ ! #define ADOBE_DEFINE_BITSET_OPS(EnumType) \ ! inline EnumType operator~(EnumType a) \ ! { \ ! return EnumType(~adobe::implementation::promote_enum(a)); \ ! } \ ! \ ! inline EnumType operator|(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) | adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator&(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) & adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator^(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) ^ adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType& operator&=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs & rhs; \ ! } \ ! \ ! inline EnumType& operator|=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs | rhs; \ ! } \ ! \ ! inline EnumType& operator^=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs ^ rhs; \ } /*************************************************************************************************/ ! #define ADOBE_DEFINE_ARITHMETIC_OPS(EnumType) \ ! inline EnumType operator-(EnumType a) \ ! { \ ! return EnumType(-a); \ ! } \ ! \ ! inline EnumType operator+(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) + adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator-(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) - adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator*(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) * adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator/(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) / adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType operator%(EnumType lhs, EnumType rhs) \ ! { \ ! return EnumType(adobe::implementation::promote_enum(lhs) % adobe::implementation::promote_enum(rhs)); \ ! } \ ! \ ! inline EnumType& operator+=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs + rhs; \ ! } \ ! \ ! inline EnumType& operator-=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs - rhs; \ ! } \ ! \ ! inline EnumType& operator*=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs * rhs; \ ! } \ ! \ ! inline EnumType& operator/=(EnumType& lhs, EnumType rhs) \ ! { \ ! return lhs = lhs / rhs; \ ! } \ ! \ ! inline EnumType& operator%=(EnumType& lhs, EnumType rhs) \ ! { ... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/adam_tutorial Modified Files: default.adm main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_tutorial/main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.cpp 6 Jan 2006 18:03:00 -0000 1.9 --- main.cpp 3 Feb 2006 18:33:38 -0000 1.10 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 42,49 **** void value_changed(cell_set_t::value_type& cell, const adobe::value_t& new_value) { ! cell.second = new_value; ! std::cout << "U \'" << cell.first.get() << "\' ==> " ! << adobe::begin_asl_cel << cell.second << adobe::end_asl_cel << std::endl; } --- 42,49 ---- void value_changed(cell_set_t::value_type& cell, const adobe::value_t& new_value) { ! cell.second = new_value; ! std::cout << "U \'" << cell.first.get() << "\' ==> " ! << adobe::begin_asl_cel << cell.second << adobe::end_asl_cel << std::endl; } *************** *** 52,56 **** void setup_monitor(adobe::sheet_t& sheet, cell_set_t::value_type& cell) { ! sheet.monitor_value(cell.first, boost::bind(value_changed, boost::ref(cell), _1)); } --- 52,56 ---- void setup_monitor(adobe::sheet_t& sheet, cell_set_t::value_type& cell) { ! sheet.monitor_value(cell.first, boost::bind(value_changed, boost::ref(cell), _1)); } *************** *** 59,65 **** void stream_cell_state(const cell_set_t::value_type& cell) { ! std::cout << " '" << cell.first.get() << "': " ! << adobe::begin_asl_cel << cell.second << adobe::end_asl_cel ! << std::endl; } --- 59,65 ---- void stream_cell_state(const cell_set_t::value_type& cell) { ! std::cout << " '" << cell.first.get() << "': " ! << adobe::begin_asl_cel << cell.second << adobe::end_asl_cel ! << std::endl; } *************** *** 68,111 **** struct sheet_tracker { ! explicit sheet_tracker(const bfs::path& sheet_path) : ! sheet_m(), callbacks_m(adobe::bind_to_sheet(sheet_m)) ! { ! std::string file_path(sheet_path.native_file_string()); ! std::ifstream sheet_file(file_path.c_str()); ! callbacks_m.add_cell_proc_m = boost::bind(&sheet_tracker::add_cell_trap, boost::ref(*this), callbacks_m.add_cell_proc_m, _1, _2, _3, _4); ! callbacks_m.add_interface_proc_m = boost::bind(&sheet_tracker::add_interface_trap, boost::ref(*this), callbacks_m.add_interface_proc_m, _1, _2, _3, _4, _5, _6); ! if (!sheet_file.is_open()) ! std::cerr << "Could not open \"" << file_path << "\"!\n"; ! // set up adam sheet ! adobe::parse(sheet_file, adobe::line_position_t(), callbacks_m); ! } ! void loop(); private: ! sheet_tracker(); // unimplemented ! sheet_tracker(const sheet_tracker&); // unimplemented ! sheet_tracker& operator = (const sheet_tracker&); // unimplemented ! void add_cell_trap( adobe::adam_callback_suite_t::add_cell_proc_t original, ! adobe::adam_callback_suite_t::cell_type_t type, ! adobe::name_t cell_name, ! const adobe::line_position_t& position, ! const adobe::array_t& expr_or_init); ! void add_interface_trap(adobe::adam_callback_suite_t::add_interface_proc_t original, ! adobe::name_t cell_name, ! bool linked, ! const adobe::line_position_t& position1, ! const adobe::array_t& initializer, ! const adobe::line_position_t& position2, ! const adobe::array_t& expression); ! adobe::sheet_t sheet_m; ! adobe::adam_callback_suite_t callbacks_m; ! std::map<adobe::name_t, adobe::value_t> cell_set_m; }; --- 68,111 ---- struct sheet_tracker { ! explicit sheet_tracker(const bfs::path& sheet_path) : ! sheet_m(), callbacks_m(adobe::bind_to_sheet(sheet_m)) ! { ! std::string file_path(sheet_path.native_file_string()); ! std::ifstream sheet_file(file_path.c_str()); ! callbacks_m.add_cell_proc_m = boost::bind(&sheet_tracker::add_cell_trap, boost::ref(*this), callbacks_m.add_cell_proc_m, _1, _2, _3, _4); ! callbacks_m.add_interface_proc_m = boost::bind(&sheet_tracker::add_interface_trap, boost::ref(*this), callbacks_m.add_interface_proc_m, _1, _2, _3, _4, _5, _6); ! if (!sheet_file.is_open()) ! std::cerr << "Could not open \"" << file_path << "\"!\n"; ! // set up adam sheet ! adobe::parse(sheet_file, adobe::line_position_t(), callbacks_m); ! } ! void loop(); private: ! sheet_tracker(); // unimplemented ! sheet_tracker(const sheet_tracker&); // unimplemented ! sheet_tracker& operator = (const sheet_tracker&); // unimplemented ! void add_cell_trap( adobe::adam_callback_suite_t::add_cell_proc_t original, ! adobe::adam_callback_suite_t::cell_type_t type, ! adobe::name_t cell_name, ! const adobe::line_position_t& position, ! const adobe::array_t& expr_or_init); ! void add_interface_trap(adobe::adam_callback_suite_t::add_interface_proc_t original, ! adobe::name_t cell_name, ! bool linked, ! const adobe::line_position_t& position1, ! const adobe::array_t& initializer, ! const adobe::line_position_t& position2, ! const adobe::array_t& expression); ! adobe::sheet_t sheet_m; ! adobe::adam_callback_suite_t callbacks_m; ! std::map<adobe::name_t, adobe::value_t> cell_set_m; }; *************** *** 114,158 **** adobe::name_t cell_type_to_name(adobe::adam_callback_suite_t::cell_type_t type) { ! switch (type) ! { ! case adobe::adam_callback_suite_t::input_k: return adobe::static_name_t("input"); break; ! case adobe::adam_callback_suite_t::output_k: return adobe::static_name_t("output"); break; ! case adobe::adam_callback_suite_t::constant_k: return adobe::static_name_t("constant"); break; ! case adobe::adam_callback_suite_t::logic_k: return adobe::static_name_t("logic"); break; ! case adobe::adam_callback_suite_t::invariant_k: return adobe::static_name_t("invariant"); break; ! default: return adobe::static_name_t("unknown"); break; ! } } /****************************************************************************************************/ ! void sheet_tracker::add_cell_trap( adobe::adam_callback_suite_t::add_cell_proc_t original, ! adobe::adam_callback_suite_t::cell_type_t type, ! adobe::name_t cell_name, ! const adobe::line_position_t& position, ! const adobe::array_t& expr_or_init) { ! original(type, cell_name, position, expr_or_init, std::string(), std::string()); ! std::cout << "A \'" << cell_name.get() << "\' (type " << cell_type_to_name(type) << ")" << std::endl; ! cell_set_m[cell_name] = adobe::value_t(); } /****************************************************************************************************/ ! void sheet_tracker::add_interface_trap( adobe::adam_callback_suite_t::add_interface_proc_t original, ! adobe::name_t cell_name, ! bool linked, ! const adobe::line_position_t& position1, ! const adobe::array_t& initializer, ! const adobe::line_position_t& position2, ! const adobe::array_t& expression) { ! original(cell_name, linked, position1, initializer, position2, expression, std::string(), std::string()); ! std::cout << "A \'" << cell_name.get() << "\' (interface)" << std::endl; ! cell_set_m[cell_name] = adobe::value_t(); } --- 114,158 ---- adobe::name_t cell_type_to_name(adobe::adam_callback_suite_t::cell_type_t type) { ! switch (type) ! { ! case adobe::adam_callback_suite_t::input_k: return adobe::static_name_t("input"); break; ! case adobe::adam_callback_suite_t::output_k: return adobe::static_name_t("output"); break; ! case adobe::adam_callback_suite_t::constant_k: return adobe::static_name_t("constant"); break; ! case adobe::adam_callback_suite_t::logic_k: return adobe::static_name_t("logic"); break; ! case adobe::adam_callback_suite_t::invariant_k: return adobe::static_name_t("invariant"); break; ! default: return adobe::static_name_t("unknown"); break; ! } } /****************************************************************************************************/ ! void sheet_tracker::add_cell_trap( adobe::adam_callback_suite_t::add_cell_proc_t original, ! adobe::adam_callback_suite_t::cell_type_t type, ! adobe::name_t cell_name, ! const adobe::line_position_t& position, ! const adobe::array_t& expr_or_init) { ! original(type, cell_name, position, expr_or_init, std::string(), std::string()); ! std::cout << "A \'" << cell_name.get() << "\' (type " << cell_type_to_name(type) << ")" << std::endl; ! cell_set_m[cell_name] = adobe::value_t(); } /****************************************************************************************************/ ! void sheet_tracker::add_interface_trap( adobe::adam_callback_suite_t::add_interface_proc_t original, ! adobe::name_t cell_name, ! bool linked, ! const adobe::line_position_t& position1, ! const adobe::array_t& initializer, ! const adobe::line_position_t& position2, ! const adobe::array_t& expression) { ! original(cell_name, linked, position1, initializer, position2, expression, std::string(), std::string()); ! std::cout << "A \'" << cell_name.get() << "\' (interface)" << std::endl; ! cell_set_m[cell_name] = adobe::value_t(); } *************** *** 161,198 **** void sheet_tracker::loop() { ! std::string cell_name_buffer; ! std::vector<char> new_value_buffer; ! cell_name_buffer.reserve(1024); ! new_value_buffer.reserve(1024); ! new_value_buffer.resize(1); ! adobe::for_each(cell_set_m, boost::bind(setup_monitor, boost::ref(sheet_m), _1)); ! while (true) ! { ! std::cout << "--" << std::endl; ! sheet_m.update(); ! std::cout << "sheet:" << std::endl; ! adobe::for_each(cell_set_m, stream_cell_state); ! std::cout << "Enter in the name of a cell for which you would like to change the value: "; ! std::cin.getline(&cell_name_buffer[0], 1024); ! if (cell_name_buffer[0] == 0) break; ! std::cout << "Enter in the new value for cell \'" << &cell_name_buffer[0] << "\': "; ! std::cin.getline(&new_value_buffer[0], 1024); ! if (new_value_buffer[0] == 0) break; ! adobe::virtual_machine_t machine; ! machine.evaluate(adobe::parse_adam_expression(&new_value_buffer[0])); ! sheet_m.set(adobe::name_t(&cell_name_buffer[0]), machine.back().value_m); ! } } --- 161,198 ---- void sheet_tracker::loop() { ! std::string cell_name_buffer; ! std::vector<char> new_value_buffer; ! cell_name_buffer.reserve(1024); ! new_value_buffer.reserve(1024); ! new_value_buffer.resize(1); ! adobe::for_each(cell_set_m, boost::bind(setup_monitor, boost::ref(sheet_m), _1)); ! while (true) ! { ! std::cout << "--" << std::endl; ! sheet_m.update(); ! std::cout << "sheet:" << std::endl; ! adobe::for_each(cell_set_m, stream_cell_state); ! std::cout << "Enter in the name of a cell for which you would like to change the value: "; ! std::cin.getline(&cell_name_buffer[0], 1024); ! if (cell_name_buffer[0] == 0) break; ! std::cout << "Enter in the new value for cell \'" << &cell_name_buffer[0] << "\': "; ! std::cin.getline(&new_value_buffer[0], 1024); ! if (new_value_buffer[0] == 0) break; ! adobe::virtual_machine_t machine; ! machine.evaluate(adobe::parse_adam_expression(&new_value_buffer[0])); ! sheet_m.set(adobe::name_t(&cell_name_buffer[0]), machine.back().value_m); ! } } *************** *** 205,228 **** int main(int argc, char* argv[]) { ! try ! { ! std::cout << "Adobe Adam Tutorial" << std::endl; ! std::cout << "Compiler: " << BOOST_COMPILER << std::endl; ! std::cout << " ASL: v" << ADOBE_VERSION_MAJOR << "." << ADOBE_VERSION_MINOR << "." << ADOBE_VERSION_SUBMINOR << std::endl; ! std::cout << " Boost: v" << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl; ! std::cout << "--" << std::endl; ! std::string pathname(argc > 1 ? (argv[1]) : ("./default.adm")); ! bfs::path filepath(pathname.c_str()); ! sheet_tracker(filepath).loop(); ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! } } --- 205,228 ---- int main(int argc, char* argv[]) { ! try ! { ! std::cout << "Adobe Adam Tutorial" << std::endl; ! std::cout << "Compiler: " << BOOST_COMPILER << std::endl; ! std::cout << " ASL: v" << ADOBE_VERSION_MAJOR << "." << ADOBE_VERSION_MINOR << "." << ADOBE_VERSION_SUBMINOR << std::endl; ! std::cout << " Boost: v" << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl; ! std::cout << "--" << std::endl; ! std::string pathname(argc > 1 ? (argv[1]) : ("./default.adm")); ! bfs::path filepath(pathname.c_str()); ! sheet_tracker(filepath).loop(); ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! } } Index: default.adm =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/adam_tutorial/default.adm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** default.adm 19 Mar 2005 00:16:43 -0000 1.1 --- default.adm 3 Feb 2006 18:33:38 -0000 1.2 *************** *** 2,14 **** { interface: ! distance : 15; ! rate : 3; ! time : 5; logic: ! relate { ! rate <== distance / time; ! time <== distance / rate; ! distance <== rate * time; ! } } --- 2,14 ---- { interface: ! distance : 15; ! rate : 3; ! time : 5; logic: ! relate { ! rate <== distance / time; ! time <== distance / rate; ! distance <== rate * time; ! } } |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/doxygen_support_files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/documentation/sources/doxygen_support_files Modified Files: header.dox Log Message: asl 1.0.13 Index: header.dox =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/documentation/sources/doxygen_support_files/header.dox,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** header.dox 6 Jan 2006 18:02:55 -0000 1.10 --- header.dox 3 Feb 2006 18:33:36 -0000 1.11 *************** *** 4,10 **** <!-- /* ! Copyright 2005-2006 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) */ Some files are held under additional license. Please see "licenses.html" for more information. --- 4,10 ---- <!-- /* ! Copyright 2005-2006 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) */ Some files are held under additional license. Please see "licenses.html" for more information. *************** *** 12,25 **** <head> ! <TITLE>$title</TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/> <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/basic.css"/> ! <STYLE TYPE="text/css" MEDIA="all"><!-- ! @import url("http://www.adobe.com/ssi/css/modern.css"); ! --></STYLE> ! <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/print.css" MEDIA="print"/> ! <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/mainnav.css"/> ! <LINK TYPE="text/css" REL="stylesheet" HREF="stlab.css"/> ! <LINK REL="alternate" TITLE="opensource.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/> </HEAD> --- 12,25 ---- <head> ! <TITLE>$title</TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/> <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/basic.css"/> ! <STYLE TYPE="text/css" MEDIA="all"><!-- ! @import url("http://www.adobe.com/ssi/css/modern.css"); ! --></STYLE> ! <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/print.css" MEDIA="print"/> ! <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/mainnav.css"/> ! <LINK TYPE="text/css" REL="stylesheet" HREF="stlab.css"/> ! <LINK REL="alternate" TITLE="opensource.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/> </HEAD> *************** *** 38,91 **** <tr><td width="10" nowrap="1"> </td> <td valign="top"> ! <table border="0" cellpadding="5"> ! <tr><td nowrap="1"> ! <h3 class="navbar">Information</h3> ! <ul> ! <li><a href="index.html">Home</a></li> ! <li><a href="group__asl__overview.html">Overview</a></li> ! <li><a href="asl_toc.html">Documentation</a></li> ! <li><a href="asl_readme.html">Getting Started</a></li> ! <li><a href="asl_release_notes.html">Release Notes</a></li> ! <li><a href="http://opensource.adobe.com/twiki/bin/view/AdobeSource">ASL Wiki</a></li> ! <li><a href="licenses.html">License</a></li> ! <li><a href="asl_indices.html">Indices</a></li> ! </ul> ! <h3 class="navbar">Media</h3> ! <ul> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a></li> ! <li><a href="asl_download_cvs.html">ASL CVS Repository</a></li> ! <li><a href="http://cvs.sourceforge.net/viewcvs.py/adobe-source/">View CVS Repository</a></li> ! </ul> ! <h3 class="navbar">Support</h3> ! <ul> ! <li><a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a></li> ! <li><a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a></li> ! <li><a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a></li> ! <li><a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a></li> ! <li><a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a></li> ! <li><a href="asl_contributing.html">Contributing to ASL</a></li> ! </ul> ! <h3 class="navbar">RSS</h3> ! <ul> ! <li><a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a></li> ! <li><a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a></li> ! <li><a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a></li> ! </ul> ! <h3 class="navbar">Other Resources</h3> ! <ul> ! <li><a href="http://boost.org">Boost</a></li> ! <li><a href="http://www.sgi.com/tech/stl">SGI STL</a></li> ! </ul> ! <h3 class="navbar">Other Adobe Projects</h3> ! <ul> ! <li><a href="http://www.adobe.com/products/xmp/">Adobe XMP</a></li> ! </ul> ! </td></tr> ! </table> </td> <td width="10" nowrap="1"> </td> <td width="100%" valign="top"> - <!-- This page generated $datetime --> <!-- End Header --> --- 38,90 ---- <tr><td width="10" nowrap="1"> </td> <td valign="top"> ! <table border="0" cellpadding="5"> ! <tr><td nowrap="1"> ! <h3 class="navbar">Information</h3> ! <ul> ! <li><a href="index.html">Home</a></li> ! <li><a href="group__asl__overview.html">Overview</a></li> ! <li><a href="asl_toc.html">Documentation</a></li> ! <li><a href="asl_readme.html">Getting Started</a></li> ! <li><a href="asl_release_notes.html">Release Notes</a></li> ! <li><a href="http://opensource.adobe.com/twiki/bin/view/AdobeSource">ASL Wiki</a></li> ! <li><a href="licenses.html">License</a></li> ! <li><a href="asl_indices.html">Indices</a></li> ! </ul> ! <h3 class="navbar">Media</h3> ! <ul> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a></li> ! <li><a href="asl_download_cvs.html">ASL CVS Repository</a></li> ! <li><a href="http://cvs.sourceforge.net/viewcvs.py/adobe-source/">View CVS Repository</a></li> ! </ul> ! <h3 class="navbar">Support</h3> ! <ul> ! <li><a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a></li> ! <li><a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a></li> ! <li><a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a></li> ! <li><a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a></li> ! <li><a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a></li> ! <li><a href="asl_contributing.html">Contributing to ASL</a></li> ! </ul> ! <h3 class="navbar">RSS</h3> ! <ul> ! <li><a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a></li> ! <li><a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a></li> ! <li><a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a></li> ! </ul> ! <h3 class="navbar">Other Resources</h3> ! <ul> ! <li><a href="http://boost.org">Boost</a></li> ! <li><a href="http://www.sgi.com/tech/stl">SGI STL</a></li> ! </ul> ! <h3 class="navbar">Other Adobe Projects</h3> ! <ul> ! <li><a href="http://www.adobe.com/products/xmp/">Adobe XMP</a></li> ! </ul> ! </td></tr> ! </table> </td> <td width="10" nowrap="1"> </td> <td width="100%" valign="top"> <!-- End Header --> |
From: Foster B. <fos...@us...> - 2006-02-03 18:34:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/gil/core Modified Files: algorithm.hpp channel.hpp cmyk.hpp color_convert.hpp gil_concept.hpp gil_config.hpp gray.hpp image.hpp image_view_factory.hpp lab.hpp metafunctions.hpp pixel.hpp pixel_iterator.hpp rgb.hpp rgba.hpp typedefs.hpp utilities.hpp variant.hpp Log Message: asl 1.0.13 Index: image.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/core/image.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** image.hpp 24 Jan 2006 19:38:49 -0000 1.2 --- image.hpp 3 Feb 2006 18:33:37 -0000 1.3 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 11,18 **** //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// --- 11,18 ---- //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief Templated image /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// /// *************** *** 29,37 **** #ifdef _MSC_VER #pragma warning(push) ! #pragma warning(disable : 4244) // conversion from 'gil::image<V,ALLOC>::coord_type' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) #endif //////////////////////////////////////////////////////////////////////////////////////// ! /// \class image_view /// \ingroup ImageView /// \brief A lightweight object that interprets memory as a 2D array of pixels. --- 29,37 ---- #ifdef _MSC_VER #pragma warning(push) ! #pragma warning(disable : 4244) // conversion from 'gil::image<V,ALLOC>::coord_type' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) #endif //////////////////////////////////////////////////////////////////////////////////////// ! /// \class image_view /// \ingroup ImageView /// \brief A lightweight object that interprets memory as a 2D array of pixels. *************** *** 60,175 **** template <typename LOC> class pixel_image_iterator; ! template <typename LOC> // Models 2D Pixel Locator class image_view { ! GIL_CLASS_REQUIRE(LOC, GIL, PixelLocatorConcept); public: // typedefs required by ConstRandomAccessNDImageViewConcept ! static const size_t num_dimensions=2; ! typedef typename LOC::value_type value_type; ! typedef typename LOC::reference reference; // result of dereferencing ! typedef typename LOC::coord_type coord_type; // 1D difference type (same for all dimensions) ! typedef coord_type difference_type; // result of operator-(1d_iterator,1d_iterator) ! typedef value_type domain_type; ! typedef typename LOC::point_type point_type; ! typedef LOC locator; ! typedef image_view<typename LOC::const_type> const_type; // same as this type, but over const values ! template <size_t D> struct axis { ! typedef typename LOC::template axis<D>::coord_type coord_type; // difference_type along each dimension ! typedef typename LOC::template axis<D>::iterator iterator; // 1D iterator type along each dimension ! }; ! typedef pixel_image_iterator<LOC> iterator; // 1D iterator type for each pixel left-to-right inside top-to-bottom ! typedef std::reverse_iterator<iterator> reverse_iterator; ! typedef size_t size_type; // typedefs required by ConstRandomAccess2DImageViewConcept ! typedef locator xy_locator; ! typedef typename xy_locator::x_iterator x_iterator; // pixel iterator along a row ! typedef typename xy_locator::y_iterator y_iterator; // pixel iterator along a column ! typedef typename xy_locator::x_coord_type x_coord_type; ! typedef typename xy_locator::y_coord_type y_coord_type; // typedefs required by ConstRandomAccess2DImageViewConcept ! typedef image_view<typename LOC::dynamic_step_type> dynamic_step_type; ! typedef typename LOC::channel_type channel_type; // type of the channel of a pixel ! typedef typename LOC::color_space_type color_space_type;// tag indicating the color space of an image ! image_view() : _dimensions(0,0) {} ! template <typename VIEW> image_view(const VIEW& iv) : _dimensions(iv.dimensions()), _pixels(iv.pixels()) {} ! template <typename L2> image_view(const point_type& sz , const L2& loc) : _dimensions(sz), _pixels(loc) {} ! template <typename L2> image_view(coord_type width, coord_type height, const L2& loc) : _dimensions(x_coord_type(width),y_coord_type(height)), _pixels(loc) {} ! image_view(const point_type& sz , const x_iterator& x_it, coord_type row_bytes) : _dimensions(sz), _pixels(x_it, row_bytes) {} ! image_view(coord_type width, coord_type height, const x_iterator& x_it, coord_type row_bytes) : _dimensions(x_coord_type(width),y_coord_type(height)), _pixels(x_it, row_bytes) {} ! template <typename VIEW> image_view& operator=(const VIEW& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } ! image_view& operator=(const image_view& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } ! template <typename VIEW> bool operator==(const VIEW& v) const { return pixels()==v.pixels() && dimensions()==v.dimensions(); } ! template <typename VIEW> bool operator!=(const VIEW& v) const { return !(*this==v); } ! template <typename L2> friend void swap(image_view<L2>& x, image_view<L2>& y); ! const point_type& dimensions() const { return _dimensions; } ! const locator& pixels() const { return _pixels; } ! x_coord_type width() const { return dimensions().x; } ! y_coord_type height() const { return dimensions().y; } ! difference_type row_bytes() const { return _pixels.row_bytes(); } // number of bytes per row ! difference_type pix_bytestep() const { return _pixels.pix_bytestep(); } // number of bytes between two adjacent pixels on the same row ! //\{@ ! /// \name 1D navigation ! size_type size() const { return width()*height(); } ! iterator begin() const { return iterator(_pixels,_dimensions.x); } ! iterator end() const { return begin()+size(); } // potential performance problem! ! reverse_iterator rbegin() const { return reverse_iterator(end()); } ! reverse_iterator rend() const { return reverse_iterator(begin()); } ! reference operator[](difference_type i) const { return begin()[i]; } // potential performance problem! ! iterator at(const point_type& p)const { return begin()+p.y*width()+p.x; } ! iterator at(x_coord_type x, y_coord_type y)const { return begin()+y*width()+x; } ! //\}@ ! //\{@ ! /// \name 2-D navigation ! reference operator()(const point_type& p) const { return _pixels(p.x,p.y); } ! reference operator()(x_coord_type x, y_coord_type y)const { return _pixels(x,y); } ! template <size_t D> typename axis<D>::iterator axis_iterator(const point_type& p) const { return _pixels.axis_iterator<D>(p); } ! xy_locator xy_at(x_coord_type x, y_coord_type y) const { return _pixels+point_type(x_coord_type(x),y_coord_type(y)); } ! locator xy_at(const point_type& p) const { return _pixels+p; } ! //\}@ ! //\{@ ! /// \name X navigation ! x_iterator x_at(x_coord_type x, y_coord_type y) const { return _pixels.x_at(x,y); } ! x_iterator x_at(const point_type& p) const { return _pixels.x_at(p); } ! x_iterator row_begin(y_coord_type y) const { return x_at(0,y); } ! x_iterator row_end(y_coord_type y) const { return x_at(width(),y); } ! //\}@ ! //\{@ ! /// \name Y navigation ! y_iterator y_at(x_coord_type x, y_coord_type y) const { return xy_at(x,y).y(); } ! y_iterator y_at(const point_type& p) const { return xy_at(p).y(); } ! y_iterator col_begin(x_coord_type x) const { return y_at(x,0); } ! y_iterator col_end(x_coord_type x) const { return y_at(x,height()); } ! //\}@ private: ! template <typename L2> friend class image_view; ! point_type _dimensions; ! xy_locator _pixels; }; template <typename L2> inline void swap(image_view<L2>& x, image_view<L2>& y) { ! std::swap(x._dimensions,y._dimensions); ! std::swap(x._pixels, y._pixels); // TODO: Extend further } //////////////////////////////////////////////////////////////////////////////////////// ! /// \class image /// \ingroup Image /// \brief container interface over image view --- 60,175 ---- template <typename LOC> class pixel_image_iterator; ! template <typename LOC> // Models 2D Pixel Locator class image_view { ! GIL_CLASS_REQUIRE(LOC, GIL, PixelLocatorConcept); public: // typedefs required by ConstRandomAccessNDImageViewConcept ! static const std::size_t num_dimensions=2; ! typedef typename LOC::value_type value_type; ! typedef typename LOC::reference reference; // result of dereferencing ! typedef typename LOC::coord_type coord_type; // 1D difference type (same for all dimensions) ! typedef coord_type difference_type; // result of operator-(1d_iterator,1d_iterator) ! typedef value_type domain_type; ! typedef typename LOC::point_type point_type; ! typedef LOC locator; ! typedef image_view<typename LOC::const_type> const_type; // same as this type, but over const values ! template <std::size_t D> struct axis { ! typedef typename LOC::template axis<D>::coord_type coord_type; // difference_type along each dimension ! typedef typename LOC::template axis<D>::iterator iterator; // 1D iterator type along each dimension ! }; ! typedef pixel_image_iterator<LOC> iterator; // 1D iterator type for each pixel left-to-right inside top-to-bottom ! typedef std::reverse_iterator<iterator> reverse_iterator; ! typedef size_t size_type; // typedefs required by ConstRandomAccess2DImageViewConcept ! typedef locator xy_locator; ! typedef typename xy_locator::x_iterator x_iterator; // pixel iterator along a row ! typedef typename xy_locator::y_iterator y_iterator; // pixel iterator along a column ! typedef typename xy_locator::x_coord_type x_coord_type; ! typedef typename xy_locator::y_coord_type y_coord_type; // typedefs required by ConstRandomAccess2DImageViewConcept ! typedef image_view<typename LOC::dynamic_step_type> dynamic_step_type; ! typedef typename LOC::channel_type channel_type; // type of the channel of a pixel ! typedef typename LOC::color_space_type color_space_type;// tag indicating the color space of an image ! image_view() : _dimensions(0,0) {} ! template <typename VIEW> image_view(const VIEW& iv) : _dimensions(iv.dimensions()), _pixels(iv.pixels()) {} ! template <typename L2> image_view(const point_type& sz , const L2& loc) : _dimensions(sz), _pixels(loc) {} ! template <typename L2> image_view(coord_type width, coord_type height, const L2& loc) : _dimensions(x_coord_type(width),y_coord_type(height)), _pixels(loc) {} ! image_view(const point_type& sz , const x_iterator& x_it, coord_type row_bytes) : _dimensions(sz), _pixels(x_it, row_bytes) {} ! image_view(coord_type width, coord_type height, const x_iterator& x_it, coord_type row_bytes) : _dimensions(x_coord_type(width),y_coord_type(height)), _pixels(x_it, row_bytes) {} ! template <typename VIEW> image_view& operator=(const VIEW& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } ! image_view& operator=(const image_view& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } ! template <typename VIEW> bool operator==(const VIEW& v) const { return pixels()==v.pixels() && dimensions()==v.dimensions(); } ! template <typename VIEW> bool operator!=(const VIEW& v) const { return !(*this==v); } ! template <typename L2> friend void swap(image_view<L2>& x, image_view<L2>& y); ! const point_type& dimensions() const { return _dimensions; } ! const locator& pixels() const { return _pixels; } ! x_coord_type width() const { return dimensions().x; } ! y_coord_type height() const { return dimensions().y; } ! difference_type row_bytes() const { return _pixels.row_bytes(); } // number of bytes per row ! difference_type pix_bytestep() const { return _pixels.pix_bytestep(); } // number of bytes between two adjacent pixels on the same row ! //\{@ ! /// \name 1D navigation ! size_type size() const { return width()*height(); } ! iterator begin() const { return iterator(_pixels,_dimensions.x); } ! iterator end() const { return begin()+size(); } // potential performance problem! ! reverse_iterator rbegin() const { return reverse_iterator(end()); } ! reverse_iterator rend() const { return reverse_iterator(begin()); } ! reference operator[](difference_type i) const { return begin()[i]; } // potential performance problem! ! iterator at(const point_type& p)const { return begin()+p.y*width()+p.x; } ! iterator at(x_coord_type x, y_coord_type y)const { return begin()+y*width()+x; } ! //\}@ ! //\{@ ! /// \name 2-D navigation ! reference operator()(const point_type& p) const { return _pixels(p.x,p.y); } ! reference operator()(x_coord_type x, y_coord_type y)const { return _pixels(x,y); } ! template <std::size_t D> typename axis<D>::iterator axis_iterator(const point_type& p) const { return _pixels.axis_iterator<D>(p); } ! xy_locator xy_at(x_coord_type x, y_coord_type y) const { return _pixels+point_type(x_coord_type(x),y_coord_type(y)); } ! locator xy_at(const point_type& p) const { return _pixels+p; } ! //\}@ ! //\{@ ! /// \name X navigation ! x_iterator x_at(x_coord_type x, y_coord_type y) const { return _pixels.x_at(x,y); } ! x_iterator x_at(const point_type& p) const { return _pixels.x_at(p); } ! x_iterator row_begin(y_coord_type y) const { return x_at(0,y); } ! x_iterator row_end(y_coord_type y) const { return x_at(width(),y); } ! //\}@ ! //\{@ ! /// \name Y navigation ! y_iterator y_at(x_coord_type x, y_coord_type y) const { return xy_at(x,y).y(); } ! y_iterator y_at(const point_type& p) const { return xy_at(p).y(); } ! y_iterator col_begin(x_coord_type x) const { return y_at(x,0); } ! y_iterator col_end(x_coord_type x) const { return y_at(x,height()); } ! //\}@ private: ! template <typename L2> friend class image_view; ! point_type _dimensions; ! xy_locator _pixels; }; template <typename L2> inline void swap(image_view<L2>& x, image_view<L2>& y) { ! std::swap(x._dimensions,y._dimensions); ! std::swap(x._pixels, y._pixels); // TODO: Extend further } //////////////////////////////////////////////////////////////////////////////////////// ! /// \class image /// \ingroup Image /// \brief container interface over image view *************** *** 181,297 **** template <typename V2,typename ALLOC2> void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2); ! template <typename V, typename ALLOC=std::allocator<unsigned char> > class image { public: ! typedef ALLOC allocator_type; ! typedef V view_type; ! typedef typename view_type::const_type const_view_type; ! typedef typename view_type::point_type point_type; ! typedef typename view_type::coord_type coord_type; ! typedef coord_type x_coord_type; ! typedef coord_type y_coord_type; ! typedef typename view_type::iterator iterator; ! typedef iterator pointer; ! typedef typename const_view_type::iterator const_iterator; ! typedef const_iterator const_pointer; ! typedef typename view_type::difference_type difference_type; ! typedef typename view_type::value_type value_type; ! typedef typename view_type::reference reference; ! typedef typename const_view_type::reference const_reference; ! typedef typename view_type::size_type size_type; ! typedef typename view_type::reverse_iterator reverse_iterator; ! typedef typename const_view_type::reverse_iterator const_reverse_iterator; ! ! const_iterator begin() const { return const_view(*this).begin(); } ! const_iterator end() const { return const_view(*this).end(); } ! const_reverse_iterator rbegin() const { return const_view(*this).rbegin(); } ! const_reverse_iterator rend() const { return const_view(*this).rend(); } ! iterator begin() { return _view.begin(); } ! iterator end() { return _view.end(); } ! reverse_iterator rbegin() { return _view.rbegin(); } ! reverse_iterator rend() { return _view.rend(); } ! reference operator[](size_type i) { return _view[i]; } ! const_reference operator[](size_type i) const { return const_view(*this)[i]; } // Warning: Slow!! ! size_type size() const { return _view.size(); } ! size_type max_size() const { return size(); } ! bool empty() const { return size()==0; } ! const point_type& dimensions() const { return _view.dimensions(); } ! x_coord_type width() const { return _view.width(); } ! y_coord_type height() const { return _view.height(); } ! image() {} ! // image that allocates own data. Calls new/delete[] ! image(const point_type& dimensions, unsigned int alignment=1) { create_with_own_data(dimensions,alignment); } ! image(x_coord_type width, y_coord_type height, unsigned int alignment=1) { create_with_own_data(point_type(width,height),alignment); } ! image(const image& img) : _alloc(img._alloc) { ! create_with_own_data(const_view(img).dimensions()); // TODO: Use the same alignment ! copy_pixels(const_view(img),_view); } template <typename V2,typename ALLOC2> image(const image<V2,ALLOC2>& img) :_alloc(img._alloc) { ! create_with_own_data(view(img).dimensions()); ! copy_pixels(view(img),_view); } ! template <typename IMG> image& operator=(const IMG& img) { image tmp(img); swap(tmp); return *this; } ! image& operator=(const image& img) { image tmp(img); swap(tmp); return *this; } ! ~image() { ! size_t size_in_bytes=_view.row_bytes()*_view.height(); if(std::iterator_traits<typename V::x_iterator>::is_planar) ! size_in_bytes*=V::color_space_type::num_channels; _alloc.deallocate((unsigned char*)&(_view(0,0)[0]),size_in_bytes); } ! template <typename V2, typename ALLOC2> friend const V2& view(image<V2,ALLOC2>& img); ! template <typename V2, typename ALLOC2> friend const typename V2::const_type& const_view(const image<V2,ALLOC2>& img); ! ALLOC& allocator() { return _alloc; } ! ALLOC const& allocator() const { return _alloc; } ! template <typename V2,typename ALLOC2> ! friend void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2); ! void swap(image& img) { GIL::swap(*this,img); } // required by boost::MutableContainerConcept private: ! view_type _view; // contains pointer to the pixels, the image size and ways to navigate pixels allocator_type _alloc; template <bool> class is_planar {}; ! void create_with_own_data(const point_type& dimensions, unsigned int alignment=1) { ! BOOST_STATIC_ASSERT(!has_dynamic_step<typename V::x_iterator>::value); ! create_with_own_data_(dimensions,alignment,is_planar<std::iterator_traits<typename V::x_iterator>::is_planar>()); ! } ! void create_with_own_data_(const point_type& dimensions, unsigned int alignment, is_planar<false>) { ! size_t rowsize_in_bytes=get_aligned(dimensions.x*sizeof(typename V::value_type),alignment); unsigned char* tmp=_alloc.allocate(rowsize_in_bytes*dimensions.y); ! try { ! _view=V(dimensions,typename V::x_iterator(tmp),rowsize_in_bytes); ! } catch(...) { ! _alloc.deallocate(tmp, rowsize_in_bytes*dimensions.y); ! throw; ! } ! } void create_with_own_data_(const point_type& dimensions, unsigned int alignment, is_planar<true>) { ! size_t planesize_in_bytes=get_aligned(dimensions.x*dimensions.y*sizeof(typename V::channel_type),alignment); ! size_t image_size_in_bytes=planesize_in_bytes*V::color_space_type::num_channels; ! unsigned char* tmp=_alloc.allocate(image_size_in_bytes); ! try { ! _view=V(dimensions, typename V::x_iterator(tmp,planesize_in_bytes),dimensions.x*sizeof(typename V::channel_type)); ! } catch(...) { ! _alloc.deallocate(tmp, image_size_in_bytes); ! throw; ! } } --- 181,297 ---- template <typename V2,typename ALLOC2> void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2); ! template <typename V, typename ALLOC=std::allocator<unsigned char> > class image { public: ! typedef ALLOC allocator_type; ! typedef V view_type; ! typedef typename view_type::const_type const_view_type; ! typedef typename view_type::point_type point_type; ! typedef typename view_type::coord_type coord_type; ! typedef coord_type x_coord_type; ! typedef coord_type y_coord_type; ! typedef typename view_type::iterator iterator; ! typedef iterator pointer; ! typedef typename const_view_type::iterator const_iterator; ! typedef const_iterator const_pointer; ! typedef typename view_type::difference_type difference_type; ! typedef typename view_type::value_type value_type; ! typedef typename view_type::reference reference; ! typedef typename const_view_type::reference const_reference; ! typedef typename view_type::size_type size_type; ! typedef typename view_type::reverse_iterator reverse_iterator; ! typedef typename const_view_type::reverse_iterator const_reverse_iterator; ! ! const_iterator begin() const { return const_view(*this).begin(); } ! const_iterator end() const { return const_view(*this).end(); } ! const_reverse_iterator rbegin() const { return const_view(*this).rbegin(); } ! const_reverse_iterator rend() const { return const_view(*this).rend(); } ! iterator begin() { return _view.begin(); } ! iterator end() { return _view.end(); } ! reverse_iterator rbegin() { return _view.rbegin(); } ! reverse_iterator rend() { return _view.rend(); } ! reference operator[](size_type i) { return _view[i]; } ! const_reference operator[](size_type i) const { return const_view(*this)[i]; } // Warning: Slow!! ! size_type size() const { return _view.size(); } ! size_type max_size() const { return size(); } ! bool empty() const { return size()==0; } ! const point_type& dimensions() const { return _view.dimensions(); } ! x_coord_type width() const { return _view.width(); } ! y_coord_type height() const { return _view.height(); } ! image() {} ! // image that allocates own data. Calls new/delete[] ! image(const point_type& dimensions, unsigned int alignment=1) { create_with_own_data(dimensions,alignment); } ! image(x_coord_type width, y_coord_type height, unsigned int alignment=1) { create_with_own_data(point_type(width,height),alignment); } ! image(const image& img) : _alloc(img._alloc) { ! create_with_own_data(const_view(img).dimensions()); // TODO: Use the same alignment ! copy_pixels(const_view(img),_view); } template <typename V2,typename ALLOC2> image(const image<V2,ALLOC2>& img) :_alloc(img._alloc) { ! create_with_own_data(view(img).dimensions()); ! copy_pixels(view(img),_view); } ! template <typename IMG> image& operator=(const IMG& img) { image tmp(img); swap(tmp); return *this; } ! image& operator=(const image& img) { image tmp(img); swap(tmp); return *this; } ! ~image() { ! std::size_t size_in_bytes=_view.row_bytes()*_view.height(); if(std::iterator_traits<typename V::x_iterator>::is_planar) ! size_in_bytes*=V::color_space_type::num_channels; _alloc.deallocate((unsigned char*)&(_view(0,0)[0]),size_in_bytes); } ! template <typename V2, typename ALLOC2> friend const V2& view(image<V2,ALLOC2>& img); ! template <typename V2, typename ALLOC2> friend const typename V2::const_type& const_view(const image<V2,ALLOC2>& img); ! ALLOC& allocator() { return _alloc; } ! ALLOC const& allocator() const { return _alloc; } ! template <typename V2,typename ALLOC2> ! friend void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2); ! void swap(image& img) { GIL::swap(*this,img); } // required by boost::MutableContainerConcept private: ! view_type _view; // contains pointer to the pixels, the image size and ways to navigate pixels allocator_type _alloc; template <bool> class is_planar {}; ! void create_with_own_data(const point_type& dimensions, unsigned int alignment=1) { ! BOOST_STATIC_ASSERT(!has_dynamic_step<typename V::x_iterator>::value); ! create_with_own_data_(dimensions,alignment,is_planar<std::iterator_traits<typename V::x_iterator>::is_planar>()); ! } ! void create_with_own_data_(const point_type& dimensions, unsigned int alignment, is_planar<false>) { ! std::size_t rowsize_in_bytes=get_aligned(dimensions.x*sizeof(typename V::value_type),alignment); unsigned char* tmp=_alloc.allocate(rowsize_in_bytes*dimensions.y); ! try { ! _view=V(dimensions,typename V::x_iterator(tmp),rowsize_in_bytes); ! } catch(...) { ! _alloc.deallocate(tmp, rowsize_in_bytes*dimensions.y); ! throw; ! } ! } void create_with_own_data_(const point_type& dimensions, unsigned int alignment, is_planar<true>) { ! std::size_t planesize_in_bytes=get_aligned(dimensions.x*dimensions.y*sizeof(typename V::channel_type),alignment); ! std::size_t image_size_in_bytes=planesize_in_bytes*V::color_space_type::num_channels; ! unsigned char* tmp=_alloc.allocate(image_size_in_bytes); ! try { ! _view=V(dimensions, typename V::x_iterator(tmp,planesize_in_bytes),dimensions.x*sizeof(typename V::channel_type)); ! } catch(...) { ! _alloc.deallocate(tmp, image_size_in_bytes); ! throw; ! } } *************** *** 302,306 **** if (&im1==&im2) return true; if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false; ! return std::equal(const_view(im1).begin(),const_view(im1).end(),const_view(im2).begin()); // TODO: change this to equal_pixels (for performance) } template <typename V1,typename V2> --- 302,306 ---- if (&im1==&im2) return true; if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false; ! return std::equal(const_view(im1).begin(),const_view(im1).end(),const_view(im2).begin()); // TODO: change this to equal_pixels (for performance) } template <typename V1,typename V2> *************** *** 309,340 **** template <typename V2,typename ALLOC2> inline void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2) { ! swap(im1._view, im2._view); ! std::swap(im1.allocator(), im2.allocator()); } template <typename C> class variant; namespace detail { ! template <typename VC> // Models View Concept Space ! struct any_image_get_view { ! typedef variant<VC> result_type; ! template <typename V> result_type operator()( image<V>& img) const { return result_type(view(img)); } ! }; ! template <typename VC> // Models ConstView Concept Space ! struct any_image_get_const_view { ! typedef variant<VC> result_type; ! template <typename V> result_type operator()(const image<V>& img) const { return result_type(const_view(img)); } ! }; ! struct any_image_view_get_num_channels { ! typedef int result_type; ! template <typename VIEW> result_type operator()(const VIEW& v) const { ! return VIEW::color_space_type::num_channels; ! } ! }; ! struct any_image_view_get_dimensions { ! typedef point2<ptrdiff_t> result_type; ! template <typename VIEW> result_type operator()(const VIEW& v) const { ! return v.dimensions(); ! } ! }; } --- 309,340 ---- template <typename V2,typename ALLOC2> inline void swap(image<V2,ALLOC2>& im1,image<V2,ALLOC2>& im2) { ! swap(im1._view, im2._view); ! std::swap(im1.allocator(), im2.allocator()); } template <typename C> class variant; namespace detail { ! template <typename VC> // Models View Concept Space ! struct any_image_get_view { ! typedef variant<VC> result_type; ! template <typename V> result_type operator()( image<V>& img) const { return result_type(view(img)); } ! }; ! template <typename VC> // Models ConstView Concept Space ! struct any_image_get_const_view { ! typedef variant<VC> result_type; ! template <typename V> result_type operator()(const image<V>& img) const { return result_type(const_view(img)); } ! }; ! struct any_image_view_get_num_channels { ! typedef int result_type; ! template <typename VIEW> result_type operator()(const VIEW& v) const { ! return VIEW::color_space_type::num_channels; ! } ! }; ! struct any_image_view_get_dimensions { ! typedef point2<ptrdiff_t> result_type; ! template <typename VIEW> result_type operator()(const VIEW& v) const { ! return v.dimensions(); ! } ! }; } *************** *** 352,364 **** /// \brief Returns the non-constant-pixel view of any image. The returned view is any view. See variant.h for more ! template <typename IC> // Models Image Concept Space inline variant<typename IC::view_concept_space> view(variant<IC>& anyImage) { ! return anyImage.apply_visitor(detail::any_image_get_view<typename IC::view_concept_space>()); } /// \brief Returns the constant-pixel view of any image. The returned view is any view. See variant.h for more ! template <typename IC> // Models Image Concept Space inline variant<typename IC::const_view_concept_space> const_view(const variant<IC>& anyImage) { ! return anyImage.apply_visitor(detail::any_image_get_const_view<typename IC::const_view_concept_space>()); } ///@} --- 352,364 ---- /// \brief Returns the non-constant-pixel view of any image. The returned view is any view. See variant.h for more ! template <typename IC> // Models Image Concept Space inline variant<typename IC::view_concept_space> view(variant<IC>& anyImage) { ! return anyImage.apply_visitor(detail::any_image_get_view<typename IC::view_concept_space>()); } /// \brief Returns the constant-pixel view of any image. The returned view is any view. See variant.h for more ! template <typename IC> // Models Image Concept Space inline variant<typename IC::const_view_concept_space> const_view(const variant<IC>& anyImage) { ! return anyImage.apply_visitor(detail::any_image_get_const_view<typename IC::const_view_concept_space>()); } ///@} *************** *** 373,377 **** template <typename C_S> int get_num_channels(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_num_channels()); } --- 373,377 ---- template <typename C_S> int get_num_channels(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_num_channels()); } *************** *** 379,383 **** template <typename C_S> int get_width(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()).x; } --- 379,383 ---- template <typename C_S> int get_width(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()).x; } *************** *** 385,389 **** template <typename C_S> int get_height(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()).y; } --- 385,389 ---- template <typename C_S> int get_height(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()).y; } *************** *** 391,395 **** template <typename C_S> point2<int> get_dimensions(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()); } ///@} --- 391,395 ---- template <typename C_S> point2<int> get_dimensions(const variant<C_S>& img_view) { ! return img_view.apply_visitor(detail::any_image_view_get_dimensions()); } ///@} *************** *** 402,413 **** template <typename IMG> void resize_clobber_image(IMG& img, const typename IMG::point_type& new_size) { ! gil_function_requires<ImageConcept<IMG> >(); ! IMG tmp(new_size); ! swap(tmp,img); } template <typename IMG> void resize_clobber_image(IMG& img, const typename IMG::x_coord_type& width, const typename IMG::y_coord_type& height) { ! resize_clobber_image(img, typename IMG::point_type(width,height)); } ///@} --- 402,413 ---- template <typename IMG> void resize_clobber_image(IMG& img, const typename IMG::point_type& new_size) { ! gil_function_requires<ImageConcept<IMG> >(); ! IMG tmp(new_size); ! swap(tmp,img); } template <typename IMG> void resize_clobber_image(IMG& img, const typename IMG::x_coord_type& width, const typename IMG::y_coord_type& height) { ! resize_clobber_image(img, typename IMG::point_type(width,height)); } ///@} Index: cmyk.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/core/cmyk.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cmyk.hpp 9 Jan 2006 19:37:55 -0000 1.1 --- cmyk.hpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 14,18 **** /// \brief Support for CMYK color space and variants /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated //////////////////////////////////////////////////////////////////////////////////////// --- 14,18 ---- /// \brief Support for CMYK color space and variants /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated //////////////////////////////////////////////////////////////////////////////////////// *************** *** 35,67 **** /// \ingroup CMYK struct cmyk_tag { ! typedef cmyk_tag base; ! BOOST_STATIC_CONSTANT(int, num_channels=4); }; namespace detail { ! /// \ingroup ColorBase ! /// \ingroup CMYK ! /// \brief cyan, magenta, yellow and black channel values/references/pointers ! /// ! /// Represents a CMYK unit of channel values (when used to construct a pixel), channel references (when used in a planar CMYK reference) ! /// or channel pointers (when used in a CMYK planar pointer) defined in this specific ordering in memory. Also provides channel accessors ! /// v0(), v1(), v2(), v3() agnostic of color space, which allow uniform operations on channels of different color spaces. The accessors also have ! /// consistent mapping between color bases representing order variations of the same color space. For example, v0() returns the red ! /// channel value/reference/pointer in both an rgb color base and in a bgr color base. ! template <typename T> ! struct color_base<T,cmyk_tag> { ! typedef cmyk_tag color_space_type; ! typedef T channel_type; ! typedef typename boost::add_const<channel_type>::type channel_const_type; ! typedef typename boost::add_reference<channel_type>::type channel_reference; ! typedef typename boost::add_reference<channel_const_type>::type channel_const_reference; ! T c,m,y,k; ! color_base() {} ! color_base(channel_type v0, channel_type v1, channel_type v2, channel_type v3) : c(v0), m(v1), y(v2), k(v3) {} ! template <typename T1, typename C1> color_base(const color_base<T1,C1>& cb) : c(cb.c), m(cb.m), y(cb.y), k(cb.k) {} ! template <typename T1, typename C1> color_base( color_base<T1,C1>& cb) : c(cb.c), m(cb.m), y(cb.y), k(cb.k) {} ! }; } --- 35,67 ---- /// \ingroup CMYK struct cmyk_tag { ! typedef cmyk_tag base; ! BOOST_STATIC_CONSTANT(int, num_channels=4); }; namespace detail { ! /// \ingroup ColorBase ! /// \ingroup CMYK ! /// \brief cyan, magenta, yellow and black channel values/references/pointers ! /// ! /// Represents a CMYK unit of channel values (when used to construct a pixel), channel references (when used in a planar CMYK reference) ! /// or channel pointers (when used in a CMYK planar pointer) defined in this specific ordering in memory. Also provides channel accessors ! /// v0(), v1(), v2(), v3() agnostic of color space, which allow uniform operations on channels of different color spaces. The accessors also have ! /// consistent mapping between color bases representing order variations of the same color space. For example, v0() returns the red ! /// channel value/reference/pointer in both an rgb color base and in a bgr color base. ! template <typename T> ! struct color_base<T,cmyk_tag> { ! typedef cmyk_tag color_space_type; ! typedef T channel_type; ! typedef typename boost::add_const<channel_type>::type channel_const_type; ! typedef typename boost::add_reference<channel_type>::type channel_reference; ! typedef typename boost::add_reference<channel_const_type>::type channel_const_reference; ! T c,m,y,k; ! color_base() {} ! color_base(channel_type v0, channel_type v1, channel_type v2, channel_type v3) : c(v0), m(v1), y(v2), k(v3) {} ! template <typename T1, typename C1> color_base(const color_base<T1,C1>& cb) : c(cb.c), m(cb.m), y(cb.y), k(cb.k) {} ! template <typename T1, typename C1> color_base( color_base<T1,C1>& cb) : c(cb.c), m(cb.m), y(cb.y), k(cb.k) {} ! }; } *************** *** 74,78 **** //////////////////////////////////////////////////////////////////////////////////////// ! /// PLANAR CMYK //////////////////////////////////////////////////////////////////////////////////////// --- 74,78 ---- //////////////////////////////////////////////////////////////////////////////////////// ! /// PLANAR CMYK //////////////////////////////////////////////////////////////////////////////////////// *************** *** 86,110 **** template <typename T> struct planar_ptr<T,cmyk_tag> : public planar_ptr_base<T,cmyk_tag> { ! typedef planar_ptr_base<T,cmyk_tag> parent_type; typedef typename parent_type::reference reference; typedef typename parent_type::color_space_type color_space_type; ! planar_ptr() : parent_type(0,0,0,0) {} ! planar_ptr(T* ic, T* im, T* iy, T* ik) : parent_type(ic,im,iy,ik) {} ! // from raw data ! planar_ptr(unsigned char* data, ptrdiff_t step=1) : parent_type((T*)data, (T*)(data+step), (T*)(data+step+step), (T*)(data+step*3)) {} ! planar_ptr(const planar_ptr& ptr) : parent_type(ptr) {} ! planar_ptr& operator=(const planar_ptr& ptr) { this->p=ptr.p; return *this; } ! /// Copy constructor and operator= from pointers to compatible planar pixels or planar pixel references. ! /// That allow constructs like pointer = &value or pointer = &reference ! /// Since we should not override operator& that's the best we can do. ! template <typename T1, typename C1> planar_ptr(pixel<T1,C1>* pix) : parent_type(&pix->template v<0>(),&pix->template v<1>(), &pix->template v<2>(), &pix->template v<3>()) { STATIC_ASSERT_COMPATIBLE(T1,C1,T,color_space_type); } ! template <typename T1, typename C1> planar_ptr& operator=(pixel<T1,C1>* pix) { STATIC_ASSERT_COMPATIBLE(T1,C1,T,color_space_type); this->p.template v<0>()=&pix->template v<0>(); --- 86,110 ---- template <typename T> struct planar_ptr<T,cmyk_tag> : public planar_ptr_base<T,cmyk_tag> { ! typedef planar_ptr_base<T,cmyk_tag> parent_type; typedef typename parent_type::reference reference; typedef typename parent_type::color_space_type color_space_type; ! planar_ptr() : parent_type(0,0,0,0) {} ! planar_ptr(T* ic, T* im, T* iy, T* ik) : parent_type(ic,im,iy,ik) {} ! // from raw data ! planar_ptr(unsigned char* data, ptrdiff_t step=1) : parent_type((T*)data, (T*)(data+step), (T*)(data+step+step), (T*)(data+step*3)) {} ! planar_ptr(const planar_ptr& ptr) : parent_type(ptr) {} ! planar_ptr& operator=(const planar_ptr& ptr) { this->p=ptr.p; return *this; } ! /// Copy constructor and operator= from pointers to compatible planar pixels or planar pixel references. ! /// That allow constructs like pointer = &value or pointer = &reference ! /// Since we should not override operator& that's the best we can do. ! template <typename T1, typename C1> planar_ptr(pixel<T1,C1>* pix) : parent_type(&pix->template v<0>(),&pix->template v<1>(), &pix->template v<2>(), &pix->template v<3>()) { STATIC_ASSERT_COMPATIBLE(T1,C1,T,color_space_type); } ! template <typename T1, typename C1> planar_ptr& operator=(pixel<T1,C1>* pix) { STATIC_ASSERT_COMPATIBLE(T1,C1,T,color_space_type); this->p.template v<0>()=&pix->template v<0>(); *************** *** 115,119 **** } ! reference dereference() const { return reference(*(this->p.c),*(this->p.m),*(this->p.y),*(this->p.k)); } }; --- 115,119 ---- } ! reference dereference() const { return reference(*(this->p.c),*(this->p.m),*(this->p.y),*(this->p.k)); } }; *************** *** 122,155 **** template <typename T> inline pixel<T&,cmyk_tag> byte_advanced_ref(const planar_ptr<T,cmyk_tag>& p, ptrdiff_t byteDiff) { ! return pixel<T&,cmyk_tag>(*byte_advanced(p.p.c, byteDiff), *byte_advanced(p.p.m, byteDiff), ! *byte_advanced(p.p.y, byteDiff), *byte_advanced(p.p.k, byteDiff)); } namespace detail { ! template <typename CS,int N> struct logical_channel_accessor; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,0> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.c;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.c;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,1> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.m;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.m;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,2> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.y;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.y;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,3> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.k;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.k;} ! }; } --- 122,155 ---- template <typename T> inline pixel<T&,cmyk_tag> byte_advanced_ref(const planar_ptr<T,cmyk_tag>& p, ptrdiff_t byteDiff) { ! return pixel<T&,cmyk_tag>(*byte_advanced(p.p.c, byteDiff), *byte_advanced(p.p.m, byteDiff), ! *byte_advanced(p.p.y, byteDiff), *byte_advanced(p.p.k, byteDiff)); } namespace detail { ! template <typename CS,int N> struct logical_channel_accessor; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,0> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.c;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.c;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,1> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.m;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.m;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,2> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.y;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.y;} ! }; ! /// \ingroup ChannelAccessor ! template <> ! struct logical_channel_accessor<cmyk_tag,3> { ! template <typename T> typename boost::add_reference<T>::type operator()(pixel<T,cmyk_tag>& p) const {return p.k;} ! template <typename T> typename boost::add_reference<typename boost::add_const<T>::type>::type operator()(const pixel<T,cmyk_tag>& p) const {return p.k;} ! }; } Index: pixel.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/core/pixel.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pixel.hpp 9 Jan 2006 19:37:55 -0000 1.1 --- pixel.hpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! Copyright 2005-2006 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 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) */ *************** *** 11,18 **** //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief generic pixel definitions and utilities /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// Last updated on 11-06-2005 /// --- 11,18 ---- //////////////////////////////////////////////////////////////////////////////////////// ! /// \file /// \brief generic pixel definitions and utilities /// \author Lubomir Bourdev and Hailin Jin \n ! /// Adobe Systems Incorporated /// Last updated on 11-06-2005 /// *************** *** 31,217 **** namespace detail { ! /// \addtogroup ColorBase ! /// \brief Represents a bundle of channel values/references/pointers for a specific color space. ! /// ! /// The class is used in three different cases: ! /// - As a base for pixel values, in which case it instantiates into a set of channel values whose relative ordering is specified by C ! /// - As a base for the proxy class representing a reference to a planar pixel, in which case it instantiates into a set of channel references ! /// - In the construction of planar_ptr, the proxy class representing a pointer to a planar pixel, in which case in instantiates into a set of channel pointers ! /// ! /// Color bases also provide color-space independent accessors to the channel values/references/pointers, which allows us to perform color-space-independent ! /// channel operations (see pixel_base for more). ! /// ! /// color_base specializations are provided for each color space. See concrete specializations for more. ! template <typename T, typename C> struct color_base {}; ! /// \ingroup ColorConvert ! /// \brief Color Convertion function object. To be specialized for every src/dst color space ! template <typename T1, typename C1, typename T2, typename C2> ! struct _color_converter { ! template <typename P1, typename P2> void operator()(const P1& src, P2& dst); ! }; ! /// \addtogroup ChannelAccessor ! /// ! /// Returns the N-th logical channel of a pixel. Logical channel indices are the same across related color spaces. For example, the red channel has index 0 in both rgb and bgr ! /// Specialized for each index and each color space. Instead of this class, it would be easier to provide in each color base specialization a ! /// member function templated over the channel index. Unfortunately many compilers don't support fully specialized member functions inside partially specialized classes. ! template <typename CS,int N> struct logical_channel_accessor {}; ! /// \brief Returns the N-th channel of a pixel as laid down in memory ! /// \ingroup ChannelAccessor ! template <typename CS> ! struct physical_channel_accessor { ! // pixel has the structure of an array of T. Getting a reference to the i-th value ! template <typename T> T& operator()(pixel<T,CS>& p,size_t i) const { return ((T*)(&p))[i]; } ! template <typename T> const T& operator()(const pixel<T,CS>& p,size_t i) const {return ((const T*)(&p))[i]; } ! // pixel is an array of _references_ to T. Getting the i-th reference ! template <typename T> T& operator()(pixel<T&,CS>& p,size_t i) const { return *(((T**)((T*)&p))[i]); } ! template <typename T> const T& operator()(pixel<const T&,CS>& p,size_t i) const { return *(((const T**)((const T*)&p))[i]); } ! }; ! /// \brief compile-time recursion for per-channel operations of pixels ! /// \ingroup Pixel ! template <int N> struct recur { ! template <typename P,typename F> static void multiplies_eq(P& p, F x) { ! recur<N-1>::multiplies_eq(p,x); ! p.template v<N>()*=x; ! } ! template <typename P,typename F> static void divides_eq(P& p, F x) { ! recur<N-1>::divides_eq(p,x); ! p.template v<N>()/=x; ! } ! template <typename P1,typename P2> static void set_val(P1& p1, const P2& p2) { ! recur<N-1>::set_val(p1,p2); ! p1.template v<N>()=p2.template v<N>(); ! } ! template <typename P1,typename P2> static void plus_eq(P1& p1, const P2& p2) { ! recur<N-1>::plus_eq(p1,p2); ! p1.template v<N>()+=p2.template v<N>(); ! } ! template <typename P1,typename P2> static void minus_eq(P1& p1, const P2& p2) { ! recur<N-1>::minus_eq(p1,p2); ! p1.template v<N>()-=p2.template v<N>(); ! } ! template <typename P,typename T2> static void set_channels(P& p, T2 v) { ! recur<N-1>::set_channels(p,v); ! p.template v<N>()=v; ! } ! template <typename P1,typename P2> static bool equal_to(const P1& p1, const P2& p2) { ! return recur<N-1>::equal_to(p1,p2) && p1.template v<N>()==p2.template v<N>(); ! } ! template <typename OP,typename P1> ! static void per_channel_op(const P1& p1, OP& op) { ! recur<N-1>::per_channel_op(p1,op); ! op(p1.template v<N>()); ! } ! template <typename OP, typename P1,typename P2> ! static void per_channel_op(const P1& p1, const P2& p2, OP& op) { ! recur<N-1>::per_channel_op(p1,p2,op); ! op(p1.template v<N>(), p2.template v<N>()); ! } ! template <typename OP, typename P1,typename P2, typename P3> ! static void per_channel_op(const P1& p1, const P2& p2, const P3& p3, OP& op) { ! recur<N-1>::per_channel_op(p1,p2,p3,op); ! op(p1.template v<N>(), p2.template v<N>(), p3.template v<N>()); ! } ! template <typename OP,typename P> ! static void per_channel_set_op(P& dst, OP& op) { ! recur<N-1>::per_channel_set_op(dst,op); ! dst.template v<N>()=op(); ! } ! template <typename OP,typename P, typename P1> ! static void per_channel_set_op(P& dst, const P1& src, OP& op) { ! recur<N-1>::per_channel_set_op(dst,src,op); ! dst.template v<N>()=op(src.template v<N>()); ! } ! template <typename OP,typename P,typename P1, typename P2> ! static void per_channel_set_op(P& dst, const P1& src1, const P2& src2, OP& op) { ! recur<N-1>::per_channel_set_op(dst,src1,src2,op); ! dst.template v<N>()=op(src1.template v<N>(), src2.template v<N>()); ! } ! //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP,typename P1> ! static void per_channel_op(const P1& p1, const OP& op) { ! recur<N-1>::per_channel_op(p1,op); ! op(p1.template v<N>()); ! } ! template <typename OP, typename P1,typename P2> ! static void per_channel_op(const P1& p1, const P2& p2, const OP& op) { ! recur<N-1>::per_channel_op(p1,p2,op); ! op(p1.template v<N>(), p2.template v<N>()); ! } ! template <typename OP, typename P1, typename P2, typename P3> ! static void per_channel_op(const P1& p1, const P2& p2, const P3& p3, const OP& op) { ! recur<N-1>::per_channel_op(p1,p2,p3,op); ! op(p1.template v<N>(), p2.template v<N>(), p3.template v<N>()); ! } ! template <typename OP,typename P> ! static void per_channel_set_op(P& dst, const OP& op) { ! recur<N-1>::per_channel_set_op(dst,op); ! dst.template v<N>()=op(); ! } ! template <typename OP,typename P,typename P1> ! static void per_channel_set_op(P& dst, const P1& src, const OP& op) { ! recur<N-1>::per_channel_set_op(dst,src,op); ! dst.template v<N>()=op(src.template v<N>()); ! } ! template <typename OP,typename P,typename P1,typename P2> ! static void per_channel_set_op(P& dst, const P1& src1, const P2& src2, const OP& op) { ! recur<N-1>::per_channel_set_op(dst,src1,src2,op); ! dst.template v<N>()=op(src1.template v<N>(), src2.template v<N>()); ! } ! //#endif ! }; ! /// \brief termination condition of the compile-time recursion for channel operations on a pixel ! /// \ingroup Pixel ! template<> struct recur<-1> { ! template <typename P, typename F> static void multiplies_eq(P& p, F x) {} ! template <typename P, typename F> static void divides_eq(P& p, F x) {} ! template <typename P1,typename P2> static void set_val(P1& p1, const P2& p2) {} ! template <typename P1,typename P2> static void plus_eq(P1& p1, const P2& p2) {} ! template <typename P1,typename P2> static void minus_eq(P1& p1, const P2& p2) {} ! template <typename P, typename T2> static void set_channels(P& p, T2 v) {} ! template <typename P1,typename P2> static bool equal_to(const P1& p1, const P2& p2) { return true; } ! template <typename OP,typename P1> static void per_channel_op(const P1&,OP&){} ! template <typename OP,typename P1,typename P2> static void per_channel_op(const P1&,const P2&,OP&){} ! template <typename OP,typename P1,typename P2,typename P3> static void per_channel_op(const P1&,const P2&,const P3&,OP&){} ! template <typename OP,typename P> static void per_channel_set_op(P&,OP&){} ! template <typename OP,typename P, typename P1> static void per_channel_set_op(P&,const P1&,OP&){} ! template <typename OP,typename P, typename P1, typename P2> static void per_channel_set_op(P&,const P1&,const P2&,OP&){} ! //#ifdef PROVIDE_CONST_VERSIONS ! template <typename OP,typename P1> static void per_channel_op(const P1&,const OP&){} ! template <typename OP,typename P1,typename P2> static void per_channel_op(const P1&,const P2&,const OP&){} ! template <typename OP,typename P1,typename P2,typename P3> static void per_channel_op(const P1&,const P2&,const P3&,const OP&){} ! template <typename OP,typename P> static void per_channel_set_op(P&,const OP&){} ! template <typename OP,typename P, typename P1> static void per_channel_set_op(P&,const P1&,const OP&){} ! template <typename OP,typename P, typename P1, typename P2> static void per_channel_set_op(P&,const P1&,const P2&,const OP&){} ! //#endif ! }; ! /// \brief compile-time recursion for min/max channel ! /// \ingroup Pixel ! template <int N> ! struct min_max_recur { ! template <typename P> static typename P::channel_value_type max_(const P& p) { ! return std::max(min_max_recur<N-1>::max_(p),p.template v<N>()); ! } ! template <typename P> static typename P::channel_value_type min_(const P& p) { ! return std::min(min_max_recur<N-1>::min_(p),p.template v<N>()); ! } ! }; ! /// \brief termination condition of the compile-time recursion for min/max channel ! /// \ingroup Pixel ! template <> ! struct min_max_recur<0> { ! template <typename P> static typename P::channel_value_type max_(const P& p) { return p.template v<0>(); } ! template <typename P> static typename P::channel_value_type min_(const P& p) { return p.template v<0>(); } ! }; ! } // namespace detail //@{ --- 31,217 ---- namespace detail { ! /// \addtogroup ColorBase ! /// \brief Represents a bundle of channel values/references/pointers for a specific color space. ! /// ! /// The class is used in three different cases: ! /// - As a base for pixel values, in which case it instantiates into a set of channel values whose relative ordering is specified by C ! /// - As a base for the proxy class representing a reference to a planar pixel, in which case it instantiates into a set of channel references ! /// - In the construction of planar_ptr, the proxy class representing a pointer to a planar pixel, in which case in instantiates into a set of channel pointers ! /// ! /// Color bases also provide color-space i... [truncated message content] |