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-03 18:34:00
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/unicode Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/unicode/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 6 Jan 2006 18:03:04 -0000 1.2 --- main.cpp 3 Feb 2006 18:33:40 -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) */ *************** *** 21,86 **** void roundtrip_test(boost::uint32_t code_point, bool print = true) { ! /* ! We need to flex all parts of the unicode API given the code point that is passed in. ! This includes: ! - utf32 -> utf8 -> utf32 ! - utf32 -> utf16 -> utf32 ! - utf16 -> utf8 -> utf16 ! */ ! typedef std::vector<boost::uint32_t> utf32_buffer_t; ! typedef std::vector<boost::uint16_t> utf16_buffer_t; ! typedef std::vector<boost::uint8_t> utf8_buffer_t; ! utf16_buffer_t utf16; ! utf8_buffer_t utf8; ! adobe::to_utf16(code_point, std::back_inserter(utf16)); ! adobe::to_utf8(code_point, std::back_inserter(utf8)); ! utf32_buffer_t utf16_roundtrip; ! utf32_buffer_t utf8_roundtrip; ! if (print) ! { ! std::cout << "Flexing API for code point 0x" << std::hex << code_point << "..." << std::endl; ! std::cout << " utf16 encoding is"; ! for (utf16_buffer_t::iterator first(utf16.begin()), last(utf16.end()); first != last; ++first) ! std::cout << " 0x" << static_cast<boost::uint32_t>(*first); ! std::cout << std::endl; ! std::cout << " utf8 encoding is"; ! for (utf8_buffer_t::iterator first(utf8.begin()), last(utf8.end()); first != last; ++first) ! std::cout << " 0x" << static_cast<boost::uint32_t>(*first); ! std::cout << std::endl; ! std::cout << std::dec; ! } ! adobe::to_utf32(utf16.begin(), utf16.end(), std::back_inserter(utf16_roundtrip)); ! adobe::to_utf32(utf8.begin(), utf8.end(), std::back_inserter(utf8_roundtrip)); ! if (utf16_roundtrip[0] != code_point) ! throw std::runtime_error("In utf32 -> utf16 -> utf32: code point mismatch"); ! else if (utf8_roundtrip[0] != code_point) ! throw std::runtime_error("In utf32 -> utf8 -> utf32: code point mismatch"); ! utf8_buffer_t utf8_2; ! utf16_buffer_t utf16_2; ! adobe::to_utf8(utf16.begin(), utf16.end(), std::back_inserter(utf8_2)); ! adobe::to_utf16(utf8.begin(), utf8.end(), std::back_inserter(utf16_2)); ! utf32_buffer_t utf16_roundtrip_2; ! adobe::to_utf32(utf16_2.begin(), utf16_2.end(), std::back_inserter(utf16_roundtrip_2)); ! ! if (utf16_roundtrip_2[0] != code_point) ! throw std::runtime_error("In utf16 -> utf8 -> utf16: code point mismatch"); ! if (print) ! { ! std::cout << " code point 0x" << std::hex << code_point << std::dec << " ("; ! adobe::copy(utf8, std::ostream_iterator<char>(std::cout)); ! std::cout << ") roundtripped successfully." << std::endl; ! } } --- 21,86 ---- void roundtrip_test(boost::uint32_t code_point, bool print = true) { ! /* ! We need to flex all parts of the unicode API given the code point that is passed in. ! This includes: ! - utf32 -> utf8 -> utf32 ! - utf32 -> utf16 -> utf32 ! - utf16 -> utf8 -> utf16 ! */ ! typedef std::vector<boost::uint32_t> utf32_buffer_t; ! typedef std::vector<boost::uint16_t> utf16_buffer_t; ! typedef std::vector<boost::uint8_t> utf8_buffer_t; ! utf16_buffer_t utf16; ! utf8_buffer_t utf8; ! adobe::to_utf16(code_point, std::back_inserter(utf16)); ! adobe::to_utf8(code_point, std::back_inserter(utf8)); ! utf32_buffer_t utf16_roundtrip; ! utf32_buffer_t utf8_roundtrip; ! if (print) ! { ! std::cout << "Flexing API for code point 0x" << std::hex << code_point << "..." << std::endl; ! std::cout << " utf16 encoding is"; ! for (utf16_buffer_t::iterator first(utf16.begin()), last(utf16.end()); first != last; ++first) ! std::cout << " 0x" << static_cast<boost::uint32_t>(*first); ! std::cout << std::endl; ! std::cout << " utf8 encoding is"; ! for (utf8_buffer_t::iterator first(utf8.begin()), last(utf8.end()); first != last; ++first) ! std::cout << " 0x" << static_cast<boost::uint32_t>(*first); ! std::cout << std::endl; ! std::cout << std::dec; ! } ! adobe::to_utf32(utf16.begin(), utf16.end(), std::back_inserter(utf16_roundtrip)); ! adobe::to_utf32(utf8.begin(), utf8.end(), std::back_inserter(utf8_roundtrip)); ! if (utf16_roundtrip[0] != code_point) ! throw std::runtime_error("In utf32 -> utf16 -> utf32: code point mismatch"); ! else if (utf8_roundtrip[0] != code_point) ! throw std::runtime_error("In utf32 -> utf8 -> utf32: code point mismatch"); ! utf8_buffer_t utf8_2; ! utf16_buffer_t utf16_2; ! adobe::to_utf8(utf16.begin(), utf16.end(), std::back_inserter(utf8_2)); ! adobe::to_utf16(utf8.begin(), utf8.end(), std::back_inserter(utf16_2)); ! utf32_buffer_t utf16_roundtrip_2; ! adobe::to_utf32(utf16_2.begin(), utf16_2.end(), std::back_inserter(utf16_roundtrip_2)); ! ! if (utf16_roundtrip_2[0] != code_point) ! throw std::runtime_error("In utf16 -> utf8 -> utf16: code point mismatch"); ! if (print) ! { ! std::cout << " code point 0x" << std::hex << code_point << std::dec << " ("; ! adobe::copy(utf8, std::ostream_iterator<char>(std::cout)); ! std::cout << ") roundtripped successfully." << std::endl; ! } } *************** *** 89,94 **** bool valid_code_point(boost::uint32_t cp) { ! return !(cp >= 0xd800 && cp <= 0xdbff) && ! !(cp >= 0xdc00 && cp <= 0xdfff); } --- 89,94 ---- bool valid_code_point(boost::uint32_t cp) { ! return !(cp >= 0xd800 && cp <= 0xdbff) && ! !(cp >= 0xdc00 && cp <= 0xdfff); } *************** *** 108,164 **** int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! std::cout << "Singleton Roundtrip Tests" << std::endl; ! roundtrip_test(0x03B4); // GREEK SMALL LETTER DELTA ! roundtrip_test(0x10137); // AEGEAN WEIGHT BASE UNIT ! roundtrip_test(0xc5); // LATIN CAPITAL LETTER A WITH RING ABOVE ! roundtrip_test(0x212b); // ANGSTROM SIGN ! roundtrip_test(0xF0000); // Hypothetical private-use glyph ! if (argc > 1 && argv[1] == std::string("--full")) ! { ! std::cout << "Performing complete range roundtrip test..." << std::ends; ! boost::uint32_t first(0x0); ! boost::uint32_t last(0x10ffff); ! try ! { ! for (; first != last; ++first) ! if (valid_code_point(first)) ! roundtrip_test(first, false); ! } ! catch (...) ! { ! std::cerr << std::endl << "While processing value " << std::hex ! << first << std::dec << "..." << std::endl; ! throw; ! } ! std::cout << "passed!" << std::endl; ! } ! else ! { ! std::cout << "Complete roundtrip range test was skipped." << std::endl; ! std::cout << "Run this binary with argument --full to test conversion of all Unicode code points." << std::endl; ! } ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } --- 108,164 ---- int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! std::cout << "Singleton Roundtrip Tests" << std::endl; ! roundtrip_test(0x03B4); // GREEK SMALL LETTER DELTA ! roundtrip_test(0x10137); // AEGEAN WEIGHT BASE UNIT ! roundtrip_test(0xc5); // LATIN CAPITAL LETTER A WITH RING ABOVE ! roundtrip_test(0x212b); // ANGSTROM SIGN ! roundtrip_test(0xF0000); // Hypothetical private-use glyph ! if (argc > 1 && argv[1] == std::string("--full")) ! { ! std::cout << "Performing complete range roundtrip test..." << std::ends; ! boost::uint32_t first(0x0); ! boost::uint32_t last(0x10ffff); ! try ! { ! for (; first != last; ++first) ! if (valid_code_point(first)) ! roundtrip_test(first, false); ! } ! catch (...) ! { ! std::cerr << std::endl << "While processing value " << std::hex ! << first << std::dec << "..." << std::endl; ! throw; ! } ! std::cout << "passed!" << std::endl; ! } ! else ! { ! std::cout << "Complete roundtrip range test was skipped." << std::endl; ! std::cout << "Run this binary with argument --full to test conversion of all Unicode code points." << std::endl; ! } ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:59
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/modal_dialog_interface/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/modal_dialog_interface/resources Modified Files: Info.plist Log Message: asl 1.0.13 Index: Info.plist =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/modal_dialog_interface/resources/Info.plist,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Info.plist 24 Jan 2006 19:38:51 -0000 1.1 --- Info.plist 3 Feb 2006 18:33:39 -0000 1.2 *************** *** 3,26 **** <plist version="1.0"> <dict> ! <key>CFBundleDevelopmentRegion</key> ! <string>English</string> ! <key>CFBundleExecutable</key> ! <string>modal_dialog_interface</string> ! <key>CFBundleIconFile</key> ! <string>app_icon.icns</string> ! <key>CFBundleIdentifier</key> ! <string>com.adobe.modal_dialog_interface</string> ! <key>CFBundleInfoDictionaryVersion</key> ! <string>6.0</string> ! <key>CFBundleName</key> ! <string>modal_dialog_interface.app</string> ! <key>CFBundlePackageType</key> ! <string>APPL</string> ! <key>CFBundleSignature</key> ! <string>????</string> ! <key>CFBundleVersion</key> ! <string>1.0</string> ! <key>CSResourcesFileMapped</key> ! <true/> </dict> </plist> --- 3,26 ---- <plist version="1.0"> <dict> ! <key>CFBundleDevelopmentRegion</key> ! <string>English</string> ! <key>CFBundleExecutable</key> ! <string>modal_dialog_interface</string> ! <key>CFBundleIconFile</key> ! <string>app_icon.icns</string> ! <key>CFBundleIdentifier</key> ! <string>com.adobe.modal_dialog_interface</string> ! <key>CFBundleInfoDictionaryVersion</key> ! <string>6.0</string> ! <key>CFBundleName</key> ! <string>modal_dialog_interface.app</string> ! <key>CFBundlePackageType</key> ! <string>APPL</string> ! <key>CFBundleSignature</key> ! <string>????</string> ! <key>CFBundleVersion</key> ! <string>1.0</string> ! <key>CSResourcesFileMapped</key> ! <true/> </dict> </plist> |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:59
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/third_party/boost_tp/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/third_party/boost_tp/adobe Modified Files: boost_1_33_1_patch_01.txt patch_boost.sh Log Message: asl 1.0.13 Index: boost_1_33_1_patch_01.txt =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/third_party/boost_tp/adobe/boost_1_33_1_patch_01.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** boost_1_33_1_patch_01.txt 24 Jan 2006 19:38:52 -0000 1.3 --- boost_1_33_1_patch_01.txt 3 Feb 2006 18:33:41 -0000 1.4 *************** *** 152,183 **** flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ; } - diff -ruN boost_1_33_1/tools/build/v2/tools/msvc.jam boost/tools/build/v2/tools/msvc.jam - --- boost_1_33_1/tools/build/v2/tools/msvc.jam 2005-07-15 06:35:58.000000000 -0700 - +++ boost/tools/build/v2/tools/msvc.jam 2006-01-05 16:10:50.000000000 -0800 - @@ -164,7 +164,25 @@ - { - flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ogity /O2 /Gs ; - flags msvc.compile CFLAGS $(condition)/<optimization>space : /Ogisy /O1 /Gs ; - - } - + } - + - + # - + # ADOBE : This change allows for a version to be set inside the RC - + # compiler so we can include version-dependent manifest files - + # - + - + if ! [ MATCH ^([67].*) : $(version) ] - + { - + flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ; - + } - + else - + { - + flags msvc.compile.rc DEFINES : "ADOBE_VER=7 " ; - + } - + - + # - + # ADOBE : End changes - + # - } - - rule default-paths ( version ? ) --- 152,153 ---- Index: patch_boost.sh =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/third_party/boost_tp/adobe/patch_boost.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** patch_boost.sh 6 Jan 2006 18:03:07 -0000 1.5 --- patch_boost.sh 3 Feb 2006 18:33:41 -0000 1.6 *************** *** 8,18 **** if [ ! -d boost_1_33_1 ]; then ! echo "You must have a source directory (boost_1_33_1) in order to patch!" ! exit 1; fi if [ ! -d boost ]; then ! echo "You must have a destination directory (boost) in order to patch!" ! exit 1; fi --- 8,18 ---- if [ ! -d boost_1_33_1 ]; then ! echo "You must have a source directory (boost_1_33_1) in order to patch!" ! exit 1; fi if [ ! -d boost ]; then ! echo "You must have a destination directory (boost) in order to patch!" ! exit 1; fi |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:59
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/xstr_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/xstr_test Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/xstr_test/main.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** main.cpp 6 Jan 2006 18:03:04 -0000 1.13 --- main.cpp 3 Feb 2006 18:33:40 -0000 1.14 *************** *** 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) */ *************** *** 48,64 **** /****************************************************************************************************/ ! adobe::token_range_t sample_handler(const adobe::token_range_t& entire_element_range, ! const adobe::token_range_t& name, ! const adobe::attribute_set_t& attribute_set, ! const adobe::token_range_t& value) { ! if (name == adobe::static_token_range("br")) ! return adobe::xml_element_linefeed(entire_element_range, name, attribute_set, value); ! else if (name == adobe::static_token_range("b")) ! // just for kicks: keep all bold tags found in the output ! return adobe::xml_element_echo(entire_element_range, name, attribute_set, value); ! else ! // if the tags aren't what we want, strip the tag ! return adobe::xml_element_strip(entire_element_range, name, attribute_set, value); } --- 48,64 ---- /****************************************************************************************************/ ! adobe::token_range_t sample_handler(const adobe::token_range_t& entire_element_range, ! const adobe::token_range_t& name, ! const adobe::attribute_set_t& attribute_set, ! const adobe::token_range_t& value) { ! if (name == adobe::static_token_range("br")) ! return adobe::xml_element_linefeed(entire_element_range, name, attribute_set, value); ! else if (name == adobe::static_token_range("b")) ! // just for kicks: keep all bold tags found in the output ! return adobe::xml_element_echo(entire_element_range, name, attribute_set, value); ! else ! // if the tags aren't what we want, strip the tag ! return adobe::xml_element_strip(entire_element_range, name, attribute_set, value); } *************** *** 67,158 **** int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! std::string glossary_name("../default.xstr"); ! if (argc > 1) glossary_name.assign(argv[1]); ! bfs::path glossary(glossary_name.c_str(), argc > 1 ? bfs::native : bfs::portable_name); ! adobe::file_slurp<char> glossary_slurp(glossary); ! adobe::xstring_context_t context(glossary_slurp.begin(), glossary_slurp.end(), ! adobe::line_position_t(glossary_name.c_str())); ! glossary_slurp.release(); ! context.set_preorder_predicate(adobe::always_true<adobe::token_range_t>()); ! context.set_element_handler(sample_handler); #if 1 ! adobe::implementation::context_frame_t& context_frame(adobe::implementation::top_frame()); ! std::cout << "Parsed " ! << static_cast<unsigned int>(context_frame.glossary_m.size()) ! << " elements:" << std::endl; ! typedef adobe::implementation::context_frame_t::store_t::iterator iterator; ! for ( iterator first(context_frame.glossary_m.begin()), last(context_frame.glossary_m.end()); ! first != last; ++first) ! std::cout << " " << to_string(first->second.second) << std::endl; #endif ! std::string xstr(adobe::xstring("<xstr id='mixed_test'/>")); ! std::cout << xstr << std::endl; ! std::string xstr2; ! adobe::xstring("<xstr id='entity_ref_test'/>", std::back_inserter(xstr2)); ! std::cout << xstr2 << std::endl; ! std::cout << adobe::xstring("<xstr id='markup_test_2'/>") << std::endl; ! std::cout << adobe::xstring("<xstr id='meganested_example'/>") << std::endl; ! std::cout << adobe::xstring("<xstr id='ok' lang='fr' platform='macintosh'/>") << std::endl; ! std::cout << "Inline xstring test:" << std::endl; ! std::cout << adobe::xstring("This is a test of the <xstr id='emergency'>emergency</xstr> broadcast <xstr id='system'>system</xstr>.") << std::endl; ! std::cout << "Nested xstring test:" << std::endl; ! std::cout << adobe::xstring("Nesting <xstr id='nesting_inside_0'>is a fun <xstr id='nesting_inside_1'>thing</xstr> to do</xstr>, don'chaknow") << std::endl; ! std::cout << "eacute test:" << std::endl; ! std::cout << adobe::xstring("<xstr id='eacute'>é</xstr>") << std::endl; ! std::cout << "Marker Replacement Tests:" << std::endl; ! 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; ! std::cout << "bad marker: " << bad_thing << std::endl; ! std::cout << "neutral marker: " << neutral_thing << std::endl; ! std::cout << "Good: " << xstring_replace(adobe::static_name_t("replacement_test_1"), good_thing) << std::endl; ! std::cout << "Bad: " << xstring_replace(adobe::static_name_t("replacement_test_1"), bad_thing) << std::endl; ! std::cout << "Neutral: " << xstring_replace(adobe::static_name_t("replacement_test_1"), neutral_thing) << std::endl; ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } --- 67,158 ---- int main(int argc, char* argv[]) { ! int result(0); ! try ! { ! std::string glossary_name("../default.xstr"); ! if (argc > 1) glossary_name.assign(argv[1]); ! bfs::path glossary(glossary_name.c_str(), argc > 1 ? bfs::native : bfs::portable_name); ! adobe::file_slurp<char> glossary_slurp(glossary); ! adobe::xstring_context_t context(glossary_slurp.begin(), glossary_slurp.end(), ! adobe::line_position_t(glossary_name.c_str())); ! glossary_slurp.release(); ! context.set_preorder_predicate(adobe::always_true<adobe::token_range_t>()); ! context.set_element_handler(sample_handler); #if 1 ! adobe::implementation::context_frame_t& context_frame(adobe::implementation::top_frame()); ! std::cout << "Parsed " ! << static_cast<unsigned int>(context_frame.glossary_m.size()) ! << " elements:" << std::endl; ! typedef adobe::implementation::context_frame_t::store_t::iterator iterator; ! for ( iterator first(context_frame.glossary_m.begin()), last(context_frame.glossary_m.end()); ! first != last; ++first) ! std::cout << " " << to_string(first->second.second) << std::endl; #endif ! std::string xstr(adobe::xstring("<xstr id='mixed_test'/>")); ! std::cout << xstr << std::endl; ! std::string xstr2; ! adobe::xstring("<xstr id='entity_ref_test'/>", std::back_inserter(xstr2)); ! std::cout << xstr2 << std::endl; ! std::cout << adobe::xstring("<xstr id='markup_test_2'/>") << std::endl; ! std::cout << adobe::xstring("<xstr id='meganested_example'/>") << std::endl; ! std::cout << adobe::xstring("<xstr id='ok' lang='fr' platform='macintosh'/>") << std::endl; ! std::cout << "Inline xstring test:" << std::endl; ! std::cout << adobe::xstring("This is a test of the <xstr id='emergency'>emergency</xstr> broadcast <xstr id='system'>system</xstr>.") << std::endl; ! std::cout << "Nested xstring test:" << std::endl; ! std::cout << adobe::xstring("Nesting <xstr id='nesting_inside_0'>is a fun <xstr id='nesting_inside_1'>thing</xstr> to do</xstr>, don'chaknow") << std::endl; ! std::cout << "eacute test:" << std::endl; ! std::cout << adobe::xstring("<xstr id='eacute'>é</xstr>") << std::endl; ! std::cout << "Marker Replacement Tests:" << std::endl; ! 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; ! std::cout << "bad marker: " << bad_thing << std::endl; ! std::cout << "neutral marker: " << neutral_thing << std::endl; ! std::cout << "Good: " << xstring_replace(adobe::static_name_t("replacement_test_1"), good_thing) << std::endl; ! std::cout << "Bad: " << xstring_replace(adobe::static_name_t("replacement_test_1"), bad_thing) << std::endl; ! std::cout << "Neutral: " << xstring_replace(adobe::static_name_t("replacement_test_1"), neutral_thing) << std::endl; ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/vc8 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/ide_projects/vc8 Added Files: beginWPF.vcproj widgetsWPF.vcproj Log Message: asl 1.0.13 --- NEW FILE: beginWPF.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="beginWPF" ProjectGUID="{49ED2497-6E54-4A31-85BE-9E166FEC714E}" RootNamespace="begin" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" ConfigurationType="1" InheritedPropertySheets=".\adobe_widgets.vsprops;.\adobe_debug.vsprops" CharacterSet="1" ManagedExtensions="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ASLDir)adobe\test\begin\headers";"$(ASLDir)adobe\test\begin\resources";"$(ASLDir)adobe\test\begin"" MinimalRebuild="false" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" DisableSpecificWarnings="4561;4793" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories=""$(ASLDir)adobe\test\begin"" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib" LinkIncremental="2" GenerateManifest="false" GenerateDebugInformation="true" AssemblyDebug="1" SubSystem="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|Win32" ConfigurationType="1" InheritedPropertySheets=".\adobe_widgets.vsprops;.\adobe_release.vsprops" CharacterSet="1" ManagedExtensions="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories=""$(ASLDir)adobe\test\begin\headers";"$(ASLDir)adobe\test\begin\resources";"$(ASLDir)adobe\test\begin"" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" DisableSpecificWarnings="4561;4793" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories=""$(ASLDir)adobe\test\begin"" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib" LinkIncremental="1" GenerateManifest="false" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> <ProjectReference ReferencedProjectIdentifier="{DEBACEBD-0145-4A06-AD7B-AF9C1E7674BD}" RelativePathToProject=".\asl_dev.vcproj" /> <ProjectReference ReferencedProjectIdentifier="{12683712-9847-45C9-8791-EF45D2961F3A}" RelativePathToProject=".\boost_filesystem.vcproj" /> <ProjectReference ReferencedProjectIdentifier="{269321D0-2FD9-45AA-B4E7-BD185FEBBF0A}" RelativePathToProject=".\boost_signals.vcproj" /> <ProjectReference ReferencedProjectIdentifier="{889CB0B0-4D44-456A-A18C-FE1255A03A99}" RelativePathToProject=".\boost_thread.vcproj" /> <AssemblyReference RelativePath="PresentationCore.dll" AssemblyName="PresentationCore, Version=6.0.5070.0, PublicKeyToken=31bf3856ad364e35, processorArchitecture=IA64" /> <AssemblyReference RelativePath="PresentationFramework.dll" AssemblyName="PresentationFramework, Version=6.0.5070.0, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <AssemblyReference RelativePath="WindowsBase.dll" AssemblyName="WindowsBase, Version=6.0.5070.0, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath="..\..\adobe\test\begin\sources\express_viewer.cpp" > </File> <File RelativePath="..\..\adobe\test\begin\sources\win32\main.cpp" > </File> <File RelativePath="..\..\adobe\test\begin\sources\report_exception.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath="..\..\adobe\test\begin\headers\express_viewer.hpp" > </File> <File RelativePath="..\..\adobe\test\begin\headers\latch.hpp" > </File> <File RelativePath="..\..\adobe\test\begin\headers\report_exception.hpp" > </File> <File RelativePath="..\..\..\adobe\test\begin\resources\resources.h" > </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > <File RelativePath="..\..\adobe\test\begin\resources\resources.rc" > </File> </Filter> <File RelativePath="..\..\adobe\test\begin\resources\editor.adm" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> </File> <File RelativePath="..\..\adobe\test\begin\resources\editor.eve" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> </File> <File RelativePath="..\..\adobe\test\begin\resources\glossary.xstr" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCustomBuildTool" Description="copying $(InputFileName)" CommandLine="copy $(InputPath) $(OutDir)
" Outputs="$(OutDir)\$(InputFileName)" /> </FileConfiguration> </File> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: widgetsWPF.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="widgetsWPF" ProjectGUID="{92EAADEA-B654-4DB1-9472-ECFF6E64C120}" RootNamespace="widgets" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" ConfigurationType="4" InheritedPropertySheets=".\adobe_widgets.vsprops;.\adobe_debug.vsprops" CharacterSet="1" ManagedExtensions="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" MinimalRebuild="false" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" DisableSpecificWarnings="4561;4793" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|Win32" ConfigurationType="4" InheritedPropertySheets=".\adobe_widgets.vsprops;.\adobe_release.vsprops" CharacterSet="1" ManagedExtensions="1" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="" PreprocessorDefinitions="$(Inherit)" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" DisableSpecificWarnings="4561;4793" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath="..\..\adobe\future\widgets\sources\client_assembler.cpp" > </File> <File RelativePath="..\..\adobe\future\widgets\sources\win32\display.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> </File> <File RelativePath="..\..\adobe\future\widgets\sources\win32\event_dispatcher.cpp" > </File> <File RelativePath="..\..\adobe\future\widgets\sources\win32\metrics.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> </File> <File RelativePath="..\..\adobe\future\widgets\sources\ui_core.cpp" > </File> <File RelativePath="..\..\adobe\future\widgets\sources\ui_core_common.cpp" > </File> <File RelativePath="..\..\adobe\future\widgets\sources\win32\ui_core_implementation.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> </File> <File RelativePath="..\..\adobe\future\widgets\sources\win32\ui_overlay.cpp" > <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" ObjectFile="$(IntDir)\$(InputName)1.obj" XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" /> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath="..\..\adobe\future\widgets\headers\client_assembler.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\display.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\win\event_dispatcher.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\factory.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\win\metrics.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\optional_connect.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\resources\resources.h" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\ui_core.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\ui_core_common.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\win\ui_core_implementation.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\ui_overlay.hpp" > </File> <File RelativePath="..\..\adobe\future\widgets\headers\win\wincast.hpp" > </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/n_queens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/n_queens Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/n_queens/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 6 Jan 2006 18:03:03 -0000 1.2 --- main.cpp 3 Feb 2006 18:33:39 -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) */ *************** *** 23,73 **** std::size_t dancing_queens() { ! enum ! { ! diag_count = N * 2 - 1, ! max_d_index = 2 * N - 2, ! cols_k = N * 2 + diag_count * 2, ! rows_k = N * N, ! file_base = N, ! diagonals_base = file_base + N, ! rdiagonals_base = diagonals_base + diag_count ! }; ! adobe::dancing_links<rows_k, cols_k> links; ! std::size_t row_index(0); ! // std::cerr << "total rows: " << rows_k << ", cols: " << cols_k << std::endl; ! for (std::size_t i(0); i < N; ++i) ! { ! for (std::size_t j(0); j < N; ++j) ! { ! std::size_t R(i); ! std::size_t F(j); ! std::size_t A(i + j); ! std::size_t B(N - 1 - i + j); #if 0 ! std::cerr << row_index << ") " ! << " R" << R << "(" << R << ")" ! << " F" << F << "(" << F + file_base << ")" ! << " A" << A << "(" << A + diagonals_base << ")" ! << " B" << B << "(" << B + rdiagonals_base << ")" ! << std::endl; #endif ! links.set(row_index, R); ! links.set(row_index, F + file_base); ! links.set(row_index, A + diagonals_base); ! links.set(row_index, B + rdiagonals_base); ! links.set_secondary_column(A + diagonals_base); ! links.set_secondary_column(B + rdiagonals_base); ! ++row_index; ! } ! } ! return links.search(std::numeric_limits<std::size_t>::max()); } --- 23,73 ---- std::size_t dancing_queens() { ! enum ! { ! diag_count = N * 2 - 1, ! max_d_index = 2 * N - 2, ! cols_k = N * 2 + diag_count * 2, ! rows_k = N * N, ! file_base = N, ! diagonals_base = file_base + N, ! rdiagonals_base = diagonals_base + diag_count ! }; ! adobe::dancing_links<rows_k, cols_k> links; ! std::size_t row_index(0); ! // std::cerr << "total rows: " << rows_k << ", cols: " << cols_k << std::endl; ! for (std::size_t i(0); i < N; ++i) ! { ! for (std::size_t j(0); j < N; ++j) ! { ! std::size_t R(i); ! std::size_t F(j); ! std::size_t A(i + j); ! std::size_t B(N - 1 - i + j); #if 0 ! std::cerr << row_index << ") " ! << " R" << R << "(" << R << ")" ! << " F" << F << "(" << F + file_base << ")" ! << " A" << A << "(" << A + diagonals_base << ")" ! << " B" << B << "(" << B + rdiagonals_base << ")" ! << std::endl; #endif ! links.set(row_index, R); ! links.set(row_index, F + file_base); ! links.set(row_index, A + diagonals_base); ! links.set(row_index, B + rdiagonals_base); ! links.set_secondary_column(A + diagonals_base); ! links.set_secondary_column(B + rdiagonals_base); ! ++row_index; ! } ! } ! return links.search(std::numeric_limits<std::size_t>::max()); } *************** *** 77,89 **** void dancing_queen_iteration() { ! adobe::timer_t timer; ! std::size_t solutions(dancing_queens<N>()); ! double time(timer.split()); ! std::cout << "Found " << solutions << " solutions to the " ! << N << "-queens problem in " << time << " miliseconds (" ! << (time / 1e3) << " seconds )" << std::endl; ! dancing_queen_iteration<N+1>(); } --- 77,89 ---- void dancing_queen_iteration() { ! adobe::timer_t timer; ! std::size_t solutions(dancing_queens<N>()); ! double time(timer.split()); ! std::cout << "Found " << solutions << " solutions to the " ! << N << "-queens problem in " << time << " miliseconds (" ! << (time / 1e3) << " seconds )" << std::endl; ! dancing_queen_iteration<N+1>(); } *************** *** 93,103 **** void dancing_queen_iteration<18>() { ! adobe::timer_t timer; ! std::size_t solutions(dancing_queens<18>()); ! double time(timer.split()); ! std::cout << "Found " << solutions << " solutions to the " ! << 18 << "-queens problem in " << time << " miliseconds (" ! << (time / 1e3) << " seconds )" << std::endl; } --- 93,103 ---- void dancing_queen_iteration<18>() { ! adobe::timer_t timer; ! std::size_t solutions(dancing_queens<18>()); ! double time(timer.split()); ! std::cout << "Found " << solutions << " solutions to the " ! << 18 << "-queens problem in " << time << " miliseconds (" ! << (time / 1e3) << " seconds )" << std::endl; } *************** *** 110,115 **** int main(int argc, char** argv) { ! dancing_queen_iteration<1>(); ! return 0; } --- 110,115 ---- int main(int argc, char** argv) { ! dancing_queen_iteration<1>(); ! return 0; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/darwin/asl_widgets.xcodeproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/ide_projects/darwin/asl_widgets.xcodeproj Modified Files: project.pbxproj Log Message: asl 1.0.13 Index: project.pbxproj =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/darwin/asl_widgets.xcodeproj/project.pbxproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** project.pbxproj 24 Jan 2006 19:38:51 -0000 1.2 --- project.pbxproj 3 Feb 2006 18:33:40 -0000 1.3 *************** *** 13,19 **** CE5C20A3094799FA00EB4BB6 /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C209F094799FA00EB4BB6 /* display.cpp */; }; CE5C20A4094799FA00EB4BB6 /* metrics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A0094799FA00EB4BB6 /* metrics.cpp */; }; ! CE5C20A5094799FA00EB4BB6 /* ui_core_implementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A1094799FA00EB4BB6 /* ui_core_implementation.cpp */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; CE5C20A6094799FA00EB4BB6 /* ui_overlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A2094799FA00EB4BB6 /* ui_overlay.cpp */; }; CE5C22AF0947ADD700EB4BB6 /* assemblage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C22AB0947ADD700EB4BB6 /* assemblage.cpp */; }; CEC06A0B0948A55300AFC610 /* libasl_dev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC06A080948A54600AFC610 /* libasl_dev.a */; }; /* End PBXBuildFile section */ --- 13,20 ---- CE5C20A3094799FA00EB4BB6 /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C209F094799FA00EB4BB6 /* display.cpp */; }; CE5C20A4094799FA00EB4BB6 /* metrics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A0094799FA00EB4BB6 /* metrics.cpp */; }; ! CE5C20A5094799FA00EB4BB6 /* ui_core_implementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A1094799FA00EB4BB6 /* ui_core_implementation.cpp */; }; CE5C20A6094799FA00EB4BB6 /* ui_overlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C20A2094799FA00EB4BB6 /* ui_overlay.cpp */; }; CE5C22AF0947ADD700EB4BB6 /* assemblage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE5C22AB0947ADD700EB4BB6 /* assemblage.cpp */; }; + CE65D142098AC94E00AA59D0 /* os_utilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE65D141098AC94E00AA59D0 /* os_utilities.cpp */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; CEC06A0B0948A55300AFC610 /* libasl_dev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC06A080948A54600AFC610 /* libasl_dev.a */; }; /* End PBXBuildFile section */ *************** *** 63,66 **** --- 64,68 ---- CE5C20A2094799FA00EB4BB6 /* ui_overlay.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ui_overlay.cpp; path = ../../adobe/future/widgets/sources/mac/ui_overlay.cpp; sourceTree = SOURCE_ROOT; }; CE5C22AB0947ADD700EB4BB6 /* assemblage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = assemblage.cpp; path = ../../adobe/future/source/assemblage.cpp; sourceTree = SOURCE_ROOT; }; + CE65D141098AC94E00AA59D0 /* os_utilities.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = os_utilities.cpp; path = ../../adobe/future/widgets/sources/mac/os_utilities.cpp; sourceTree = SOURCE_ROOT; }; CEC069FC0948A54600AFC610 /* asl_dev.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = asl_dev.xcodeproj; sourceTree = "<group>"; }; D2AAC046055464E500DB518D /* libasl_widgets.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libasl_widgets.a; sourceTree = BUILT_PRODUCTS_DIR; }; *************** *** 102,105 **** --- 104,108 ---- CE5C2098094799D100EB4BB6 /* ui_core_common.cpp */, CE5C2099094799D100EB4BB6 /* ui_core.cpp */, + CE65D141098AC94E00AA59D0 /* os_utilities.cpp */, ); name = Source; *************** *** 230,233 **** --- 233,237 ---- CE5C20A6094799FA00EB4BB6 /* ui_overlay.cpp in Sources */, CE5C22AF0947ADD700EB4BB6 /* assemblage.cpp in Sources */, + CE65D142098AC94E00AA59D0 /* os_utilities.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/xstr_bench In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/xstr_bench Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/xstr_bench/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 6 Jan 2006 18:03:04 -0000 1.2 --- main.cpp 3 Feb 2006 18:33:40 -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) */ *************** *** 78,97 **** std::string generate_lorem(int min, int max, bool nopunct = false) { ! std::string result; ! std::size_t this_count(std::rand() % (max - min + 1) + min); ! for (std::size_t i(0); i < this_count; ++i) ! { ! if (i != 0) result << " "; ! result << lorem_g[std::rand() % lorem_size_g]; ! } ! if (nopunct) ! for (std::string::iterator first(result.begin()), last(result.end()); first != last; ++first) ! if (!std::isalpha(*first)) ! *first = '_'; ! return result; } --- 78,97 ---- std::string generate_lorem(int min, int max, bool nopunct = false) { ! std::string result; ! std::size_t this_count(std::rand() % (max - min + 1) + min); ! for (std::size_t i(0); i < this_count; ++i) ! { ! if (i != 0) result << " "; ! result << lorem_g[std::rand() % lorem_size_g]; ! } ! if (nopunct) ! for (std::string::iterator first(result.begin()), last(result.end()); first != last; ++first) ! if (!std::isalpha(*first)) ! *first = '_'; ! return result; } *************** *** 100,122 **** void generate_file(int argc, char** argv) { ! std::size_t test_string_count(15000); ! if (argc > 1) ! test_string_count = std::atoi(argv[1]); ! boost::filesystem::path boost_path(glossary_name_g, boost::filesystem::native); ! std::cout << "Generating xstring file with " << test_string_count << " strings..." << std::endl; ! boost::filesystem::ofstream out(boost_path); ! adobe::timer_t gen_timer; ! for (std::size_t i(0); i < test_string_count; ++i) ! out << "<xstr id='" << generate_lorem(2, 5, true) << "-" << i << "'>" << generate_lorem(1, 30) << "</xstr>" << std::endl; ! gen_timer.report("Generation"); ! out.close(); } --- 100,122 ---- void generate_file(int argc, char** argv) { ! std::size_t test_string_count(15000); ! if (argc > 1) ! test_string_count = std::atoi(argv[1]); ! boost::filesystem::path boost_path(glossary_name_g, boost::filesystem::native); ! std::cout << "Generating xstring file with " << test_string_count << " strings..." << std::endl; ! boost::filesystem::ofstream out(boost_path); ! adobe::timer_t gen_timer; ! for (std::size_t i(0); i < test_string_count; ++i) ! out << "<xstr id='" << generate_lorem(2, 5, true) << "-" << i << "'>" << generate_lorem(1, 30) << "</xstr>" << std::endl; ! gen_timer.report("Generation"); ! out.close(); } *************** *** 125,140 **** std::size_t do_test(adobe::file_slurp<char>& slurp, adobe::timer_t& timer) { ! slurp.reslurp(); ! timer.reset(); ! adobe::xstring_context_t context( slurp.begin(), slurp.end(), ! adobe::line_position_t(glossary_name_g)); ! timer.accrue(); ! slurp.release(); ! return adobe::implementation::top_frame().glossary_m.size(); } --- 125,140 ---- std::size_t do_test(adobe::file_slurp<char>& slurp, adobe::timer_t& timer) { ! slurp.reslurp(); ! timer.reset(); ! adobe::xstring_context_t context( slurp.begin(), slurp.end(), ! adobe::line_position_t(glossary_name_g)); ! timer.accrue(); ! slurp.release(); ! return adobe::implementation::top_frame().glossary_m.size(); } *************** *** 147,196 **** int main(int argc, char** argv) { ! int result(0); ! std::srand(std::time(NULL)); ! try ! { ! boost::filesystem::path boost_path(glossary_name_g, boost::filesystem::native); ! if (!boost::filesystem::exists(boost_path)) ! generate_file(argc, argv); ! adobe::file_slurp<char> slurp(boost_path); ! adobe::timer_t timer; ! std::size_t repeat_count(20); ! std::size_t count(0); ! std::cout << "Repeating test " << repeat_count << " times..." << std::endl; ! for (std::size_t i(0); i < repeat_count;) ! { ! count = std::max(count, do_test(slurp, timer)); ! std::cerr << ++i << " "; ! } ! std::cout << std::endl; ! double avg(timer.accrued_average()); ! std::cout << "Average time taken: " << avg << " milliseconds (" << avg / 1e3 << " sec)" << std::endl; ! std::cout << "Found " << count << " parsed elements in glossary." << std::endl; ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } --- 147,196 ---- int main(int argc, char** argv) { ! int result(0); ! std::srand(std::time(NULL)); ! try ! { ! boost::filesystem::path boost_path(glossary_name_g, boost::filesystem::native); ! if (!boost::filesystem::exists(boost_path)) ! generate_file(argc, argv); ! adobe::file_slurp<char> slurp(boost_path); ! adobe::timer_t timer; ! std::size_t repeat_count(20); ! std::size_t count(0); ! std::cout << "Repeating test " << repeat_count << " times..." << std::endl; ! for (std::size_t i(0); i < repeat_count;) ! { ! count = std::max(count, do_test(slurp, timer)); ! std::cerr << ++i << " "; ! } ! std::cout << std::endl; ! double avg(timer.accrued_average()); ! std::cout << "Average time taken: " << avg << " milliseconds (" << avg / 1e3 << " sec)" << std::endl; ! std::cout << "Found " << count << " parsed elements in glossary." << std::endl; ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << "\n"; ! result = 1; ! } ! catch (...) ! { ! std::cerr << "Unknown Exception\n"; ! result = 1; ! } ! return result; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/cmath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/cmath Added Files: Jamfile.v2 main.cpp Log Message: asl 1.0.13 --- NEW FILE: main.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 <cassert> #include <iostream> #include <adobe/cmath.hpp> #include <adobe/algorithm.hpp> /*************************************************************************************************/ int main() { bool result(true); // test that the types are visible: std::cout << "adobe::float_t(10.5f) ==" << adobe::float_t(10.5f) << std::endl; std::cout << "adobe::double_t(10.5) ==" << adobe::double_t(10.5) << std::endl; // round will round halfway point towards zero. const std::size_t test_cases(8); const double table[] = { 1.0, 1.2, 1.5, 1.8, -1.0, -1.2, -1.5, -1.8 }; const float tablef[] = { 1.0f, 1.2f, 1.5f, 1.8f, -1.0f, -1.2f, -1.5f, -1.8f }; assert(sizeof(table)/sizeof(double) == test_cases); assert(sizeof(tablef)/sizeof(float) == test_cases); double result_table[test_cases]; float result_tablef[test_cases]; long result_tablel[test_cases]; { const double round_result[] = { 1.0, 1.0, 2.0, 2.0, -1.0, -1.0, -2.0, -2.0 }; adobe::transform(table, &result_table[0], (double(*)(double))(&adobe::round)); result &= adobe::equal(result_table, round_result); } { const long round_result[] = { 1L, 1L, 2L, 2L, -1L, -1L, -2L, -2L }; adobe::transform(table, &result_tablel[0], (long(*)(double))(&adobe::lround)); result &= adobe::equal(result_tablel, round_result); } { const double round_result[] = { 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0 }; adobe::transform(table, &result_table[0], (double(*)(double))(&adobe::trunc)); result &= adobe::equal(result_table, round_result); } { const double round_result[] = { 1.0, 1.0, 2.0, 2.0, -1.0, -1.0, -1.0, -2.0 }; adobe::transform(table, &result_table[0], (double(*)(double))(&adobe::round_half_up)); result &= adobe::equal(result_table, round_result); } { const long round_result[] = { 1L, 1L, 2L, 2L, -1L, -1L, -1L, -2L }; adobe::transform(table, &result_tablel[0], (long(*)(double))(&adobe::lround_half_up)); result &= adobe::equal(result_tablel, round_result); } { const float round_result[] = { 1.0f, 1.0f, 2.0f, 2.0f, -1.0f, -1.0f, -2.0f, -2.0f }; adobe::transform(tablef, &result_tablef[0], (float(*)(float))(&adobe::round)); result &= adobe::equal(result_tablef, round_result); } { const long round_result[] = { 1L, 1L, 2L, 2L, -1L, -1L, -2L, -2L }; adobe::transform(tablef, &result_tablel[0], (long(*)(float))(&adobe::lround)); result &= adobe::equal(result_tablel, round_result); } { const float round_result[] = { 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f }; adobe::transform(tablef, &result_tablef[0], (float(*)(float))(&adobe::trunc)); result &= adobe::equal(result_tablef, round_result); } { const float round_result[] = { 1.0f, 1.0f, 2.0f, 2.0f, -1.0f, -1.0f, -1.0f, -2.0f }; adobe::transform(tablef, &result_tablef[0], (float(*)(float))(&adobe::round_half_up)); result &= adobe::equal(result_tablef, round_result); } { const long round_result[] = { 1L, 1L, 2L, 2L, -1L, -1L, -1L, -2L }; adobe::transform(tablef, &result_tablel[0], (long(*)(float))(&adobe::lround_half_up)); result &= adobe::equal(result_tablel, round_result); } return result ? 0 : 1; } --- NEW FILE: Jamfile.v2 --- # Jamfile for building the cmath smoke test app project adobe/cmath ; run main.cpp ; |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:58
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sudoku In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/sudoku Modified Files: main.cpp sudoku.hpp sudoku_utilities.hpp sudokus.txt Log Message: asl 1.0.13 Index: sudoku_utilities.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sudoku/sudoku_utilities.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sudoku_utilities.hpp 6 Jan 2006 18:03:03 -0000 1.5 --- sudoku_utilities.hpp 3 Feb 2006 18:33:40 -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 [...2703 lines suppressed...] ! timer.accrue(); #if 1 ! double last_split(timer.last_split()); ! std::cout << "Solved a puzzle with " << num_solutions << " solution(s) in " ! << last_split << " miliseconds (" << (last_split / 1e3) << " seconds)" ! << std::endl; #endif ! } ! double total_time(timer.accrued_total()); ! double avg_time(timer.accrued_average()); ! std::cout << "Solved all puzzles in " << total_time << " miliseconds (" ! << (total_time / 1e3) << " seconds)" << std::endl ! << "Average puzzle solve time " << avg_time << " miliseconds (" ! << (avg_time / 1e3) << " seconds)" << std::endl; } Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sudoku/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 6 Jan 2006 18:03:03 -0000 1.3 --- main.cpp 3 Feb 2006 18:33:40 -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) */ *************** *** 37,83 **** class application_t { ! typedef std::vector<sudoku::sudoku_t> sudoku_set_t; ! typedef std::size_t (*solver_proc_t)(sudoku::sudoku_t&); public: ! enum ! { ! setting_detailed_printout_k = 0, ! setting_use_lone_candidate_k, ! setting_use_unique_candidate_k, ! setting_use_disjoint_subset_k, ! setting_use_unique_subset_k, ! setting_use_intersection_k, ! setting_set_size ! }; ! explicit application_t(bfs::path prefs_path) : ! prefs_path_m(prefs_path) ! { ! for (std::size_t i(0); i < setting_set_size; ++i) ! solver_usage_m[i] = true; ! solver_usage_m[setting_detailed_printout_k] = false; ! } ! void run(); private: ! void import_preferences(); ! void menu(); ! void solve_puzzle(); ! std::size_t deductive_step(solver_proc_t proc); ! void modify_settings(); ! void pick_new_puzzle(); ! bfs::path prefs_path_m; ! sudoku_set_t sudoku_set_m; ! sudoku::sudoku_t puzzle_m; ! boost::array<bool, setting_set_size> solver_usage_m; }; --- 37,83 ---- class application_t { ! typedef std::vector<sudoku::sudoku_t> sudoku_set_t; ! typedef std::size_t (*solver_proc_t)(sudoku::sudoku_t&); public: ! enum ! { ! setting_detailed_printout_k = 0, ! setting_use_lone_candidate_k, ! setting_use_unique_candidate_k, ! setting_use_disjoint_subset_k, ! setting_use_unique_subset_k, ! setting_use_intersection_k, ! setting_set_size ! }; ! explicit application_t(bfs::path prefs_path) : ! prefs_path_m(prefs_path) ! { ! for (std::size_t i(0); i < setting_set_size; ++i) ! solver_usage_m[i] = true; ! solver_usage_m[setting_detailed_printout_k] = false; ! } ! void run(); private: ! void import_preferences(); ! void menu(); ! void solve_puzzle(); ! std::size_t deductive_step(solver_proc_t proc); ! void modify_settings(); ! void pick_new_puzzle(); ! bfs::path prefs_path_m; ! sudoku_set_t sudoku_set_m; ! sudoku::sudoku_t puzzle_m; ! boost::array<bool, setting_set_size> solver_usage_m; }; *************** *** 86,137 **** void application_t::import_preferences() { ! char buffer[1024]; ! bfs::ifstream input(prefs_path_m, std::ios_base::in | std::ios_base::binary); ! if (input.fail()) ! { ! std::cerr << "Could not open preferences file." << std::endl; ! puzzle_m = sudoku::generate_puzzle(); ! return; ! } ! input.unsetf(std::ios_base::skipws); ! while (!input.eof()) ! { ! sudoku::sudoku_t cur; ! int count(0); ! input.getline(&buffer[0], 1024); ! std::size_t readsize(static_cast<std::size_t>(input.gcount())); ! if (readsize < 81) continue; ! while (true) ! { ! char c(buffer[count]); ! if (c == '\t') break; ! if (c == '.' || c >= '1' && c <= '9') ! { ! if (c != '.') ! cur.square(count / 9, count % 9).value_m = c - '0'; ! ++count; ! } ! } ! if (readsize <= 81) break; ! ++count; // to get past the tab between the name and the ! cur.name_m = std::string(&buffer[count], &buffer[readsize]); ! sudoku_set_m.push_back(cur); ! } } --- 86,137 ---- void application_t::import_preferences() { ! char buffer[1024]; ! bfs::ifstream input(prefs_path_m, std::ios_base::in | std::ios_base::binary); ! if (input.fail()) ! { ! std::cerr << "Could not open preferences file." << std::endl; ! puzzle_m = sudoku::generate_puzzle(); ! return; ! } ! input.unsetf(std::ios_base::skipws); ! while (!input.eof()) ! { ! sudoku::sudoku_t cur; ! int count(0); ! input.getline(&buffer[0], 1024); ! std::size_t readsize(static_cast<std::size_t>(input.gcount())); ! if (readsize < 81) continue; ! while (true) ! { ! char c(buffer[count]); ! if (c == '\t') break; ! if (c == '.' || c >= '1' && c <= '9') ! { ! if (c != '.') ! cur.square(count / 9, count % 9).value_m = c - '0'; ! ++count; ! } ! } ! if (readsize <= 81) break; ! ++count; // to get past the tab between the name and the ! cur.name_m = std::string(&buffer[count], &buffer[readsize]); ! sudoku_set_m.push_back(cur); ! } } *************** *** 140,153 **** const char* solver_enum_to_string(int solver_enum) { ! switch (solver_enum) ! { ! case application_t::setting_detailed_printout_k: return "Iterative Puzzle Printout"; ! case application_t::setting_use_lone_candidate_k: return "Lone Candidate Selection"; ! case application_t::setting_use_unique_candidate_k: return "Unique Candidate Selection"; ! case application_t::setting_use_disjoint_subset_k: return "Disjoint Subset Reduction"; ! case application_t::setting_use_unique_subset_k: return "Unique Subset Reduction"; ! case application_t::setting_use_intersection_k: return "Box/Row/Col Intersection Reduction"; ! default: return "Unknown Setting"; ! }; } --- 140,153 ---- const char* solver_enum_to_string(int solver_enum) { ! switch (solver_enum) ! { ! case application_t::setting_detailed_printout_k: return "Iterative Puzzle Printout"; ! case application_t::setting_use_lone_candidate_k: return "Lone Candidate Selection"; ! case application_t::setting_use_unique_candidate_k: return "Unique Candidate Selection"; ! case application_t::setting_use_disjoint_subset_k: return "Disjoint Subset Reduction"; ! case application_t::setting_use_unique_subset_k: return "Unique Subset Reduction"; ! case application_t::setting_use_intersection_k: return "Box/Row/Col Intersection Reduction"; ! default: return "Unknown Setting"; ! }; } *************** *** 156,180 **** void application_t::modify_settings() { ! while (true) ! { ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Please toggle settings" << std::endl; ! for (int count(0); count < setting_set_size; ++count) ! std::cout << count+1 << ". Use " << solver_enum_to_string(count) << ": " ! << (solver_usage_m[count] ? "On" : "Off") << std::endl; ! std::cout << std::endl; ! std::cout << "(0 to exit) ?> "; ! std::size_t choice; ! std::cin >> choice; ! if (choice <= 0 || choice > setting_set_size) ! break; ! else ! solver_usage_m[choice - 1] = !solver_usage_m[choice - 1]; ! } } --- 156,180 ---- void application_t::modify_settings() { ! while (true) ! { ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Please toggle settings" << std::endl; ! for (int count(0); count < setting_set_size; ++count) ! std::cout << count+1 << ". Use " << solver_enum_to_string(count) << ": " ! << (solver_usage_m[count] ? "On" : "Off") << std::endl; ! std::cout << std::endl; ! std::cout << "(0 to exit) ?> "; ! std::size_t choice; ! std::cin >> choice; ! if (choice <= 0 || choice > setting_set_size) ! break; ! else ! solver_usage_m[choice - 1] = !solver_usage_m[choice - 1]; ! } } *************** *** 183,207 **** void application_t::pick_new_puzzle() { ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Please pick a new puzzle" << std::endl; ! std::size_t count(0); ! for (sudoku_set_t::iterator first(sudoku_set_m.begin()), ! last(sudoku_set_m.end()); first != last; ++first) ! { ! std::cout << " " << ++count << ". " << first->name_m << std::endl; ! } ! std::cout << std::endl; ! std::cout << "?> "; ! std::size_t choice; ! std::cin >> choice; ! if (choice <= 0 || choice > sudoku_set_m.size()) ! std::cerr << "Choice is not viable. Aborting." << std::endl; ! else ! puzzle_m = sudoku_set_m[choice - 1]; } --- 183,207 ---- void application_t::pick_new_puzzle() { ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Please pick a new puzzle" << std::endl; ! std::size_t count(0); ! for (sudoku_set_t::iterator first(sudoku_set_m.begin()), ! last(sudoku_set_m.end()); first != last; ++first) ! { ! std::cout << " " << ++count << ". " << first->name_m << std::endl; ! } ! std::cout << std::endl; ! std::cout << "?> "; ! std::size_t choice; ! std::cin >> choice; ! if (choice <= 0 || choice > sudoku_set_m.size()) ! std::cerr << "Choice is not viable. Aborting." << std::endl; ! else ! puzzle_m = sudoku_set_m[choice - 1]; } *************** *** 210,224 **** std::size_t application_t::deductive_step(solver_proc_t proc) { ! std::size_t usages(proc(puzzle_m)); ! if (usages != 0) ! { ! sudoku::pinned_reduction(puzzle_m); ! if (!verify_integrity(puzzle_m)) ! throw std::runtime_error("Puzzle integrity check failed"); ! } ! return usages; } --- 210,224 ---- std::size_t application_t::deductive_step(solver_proc_t proc) { ! std::size_t usages(proc(puzzle_m)); ! if (usages != 0) ! { ! sudoku::pinned_reduction(puzzle_m); ! if (!verify_integrity(puzzle_m)) ! throw std::runtime_error("Puzzle integrity check failed"); ! } ! return usages; } *************** *** 227,276 **** void application_t::solve_puzzle() { ! // do a pinned reduction first before we start on the puzzle ! // to make sure the possibility sets are legit to begin with ! sudoku::pinned_reduction(puzzle_m); ! while (true) ! { ! std::size_t usages(0); ! try ! { ! if (solver_usage_m[setting_use_lone_candidate_k]) ! usages += deductive_step(sudoku::lone_candidate_reduction); ! if (solver_usage_m[setting_use_unique_candidate_k]) ! usages += deductive_step(sudoku::unique_candidate_reduction); ! if (solver_usage_m[setting_use_disjoint_subset_k]) ! usages += deductive_step(sudoku::disjoint_subset_reduction); ! if (solver_usage_m[setting_use_unique_subset_k]) ! usages += deductive_step(sudoku::unique_subset_reduction); ! if (solver_usage_m[setting_use_intersection_k]) ! usages += deductive_step(sudoku::intersection_reduction); ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << std::endl; ! break; ! } ! catch (...) ! { ! std::cerr << "Exception: Unknown" << std::endl; ! break; ! } ! if (usages == 0) ! break; ! else if (solver_usage_m[setting_detailed_printout_k]) ! detailed_status(puzzle_m); ! } ! std::cout << "No more squares can be solved" << std::endl; ! std::cout << puzzle_m; } --- 227,276 ---- void application_t::solve_puzzle() { ! // do a pinned reduction first before we start on the puzzle ! // to make sure the possibility sets are legit to begin with ! sudoku::pinned_reduction(puzzle_m); ! while (true) ! { ! std::size_t usages(0); ! try ! { ! if (solver_usage_m[setting_use_lone_candidate_k]) ! usages += deductive_step(sudoku::lone_candidate_reduction); ! if (solver_usage_m[setting_use_unique_candidate_k]) ! usages += deductive_step(sudoku::unique_candidate_reduction); ! if (solver_usage_m[setting_use_disjoint_subset_k]) ! usages += deductive_step(sudoku::disjoint_subset_reduction); ! if (solver_usage_m[setting_use_unique_subset_k]) ! usages += deductive_step(sudoku::unique_subset_reduction); ! if (solver_usage_m[setting_use_intersection_k]) ! usages += deductive_step(sudoku::intersection_reduction); ! } ! catch (const std::exception& doh) ! { ! std::cerr << "Exception: " << doh.what() << std::endl; ! break; ! } ! catch (...) ! { ! std::cerr << "Exception: Unknown" << std::endl; ! break; ! } ! if (usages == 0) ! break; ! else if (solver_usage_m[setting_detailed_printout_k]) ! detailed_status(puzzle_m); ! } ! std::cout << "No more squares can be solved" << std::endl; ! std::cout << puzzle_m; } *************** *** 279,381 **** void application_t::menu() { ! while (true) ! { ! std::cout << std::endl; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Adobe Sudoku Test App " << ADOBE_VERSION_MAJOR << '.' << ADOBE_VERSION_MINOR ! << '.' << ADOBE_VERSION_SUBMINOR << std::endl; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << sudoku_set_m.size() << " puzzles loaded. \""; ! std::cout << puzzle_m.name_m << "\" is the current puzzle" << std::endl; ! std::cout << " 1. Solve current puzzle" << std::endl; ! std::cout << " 2. Change solver techniques used" << std::endl; ! std::cout << " 3. Print current puzzle (simple)" << std::endl; ! std::cout << " 4. Print current puzzle (detailed)" << std::endl; ! std::cout << " 5. Switch to another puzzle" << std::endl; ! std::cout << " 6. Import a new puzzle (unimp.)" << std::endl; ! std::cout << " 7. Save puzzle database (unimp.)" << std::endl; ! std::cout << " 8. Generate random puzzle" << std::endl; ! std::cout << " 9. Brute-force solve current puzzle" << std::endl; ! std::cout << " R. Rate current puzzle" << std::endl; ! std::cout << " M. Mass puzzle generation" << std::endl; ! std::cout << " C. Count number of solutions to current puzzle" << std::endl; ! std::cout << " P. Dancing links performance benchmarking" << std::endl; ! std::cout << std::endl; ! std::cout << " Q. Quit" << std::endl; ! std::cout << std::endl; ! std::cout << "?> "; ! char choice(0); ! std::cin >> choice; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << std::endl; ! switch (choice) ! { ! case '1': ! solve_puzzle(); ! break; ! case '2': ! modify_settings(); ! break; ! case '3': ! std::cout << puzzle_m; ! break; ! case '4': ! sudoku::pinned_reduction(puzzle_m); ! sudoku::detailed_status(puzzle_m); ! break; ! case '5': ! pick_new_puzzle(); ! break; ! case '6': ! case '7': ! std::cout << "not implemented yet, sorry." << std::endl; ! break; ! case '8': ! puzzle_m = sudoku::generate_puzzle(); ! break; ! case '9': ! sudoku::timed_solve(puzzle_m); ! break; ! case 'R': ! case 'r': ! sudoku::rate_puzzle(puzzle_m); ! break; ! case 'M': ! case 'm': ! sudoku::mass_puzzle_generation(); ! break; ! case 'C': ! case 'c': ! sudoku::count_solutions(puzzle_m); ! break; ! case 'P': ! case 'p': ! sudoku::performance_benchmark(); ! break; ! case 'Q': ! case 'q': ! return; ! default: ! std::cerr << "Invalid choice. Please choose again." << std::endl; ! break; ! } ! } } --- 279,381 ---- void application_t::menu() { ! while (true) ! { ! std::cout << std::endl; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << "Adobe Sudoku Test App " << ADOBE_VERSION_MAJOR << '.' << ADOBE_VERSION_MINOR ! << '.' << ADOBE_VERSION_SUBMINOR << std::endl; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << sudoku_set_m.size() << " puzzles loaded. \""; ! std::cout << puzzle_m.name_m << "\" is the current puzzle" << std::endl; ! std::cout << " 1. Solve current puzzle" << std::endl; ! std::cout << " 2. Change solver techniques used" << std::endl; ! std::cout << " 3. Print current puzzle (simple)" << std::endl; ! std::cout << " 4. Print current puzzle (detailed)" << std::endl; ! std::cout << " 5. Switch to another puzzle" << std::endl; ! std::cout << " 6. Import a new puzzle (unimp.)" << std::endl; ! std::cout << " 7. Save puzzle database (unimp.)" << std::endl; ! std::cout << " 8. Generate random puzzle" << std::endl; ! std::cout << " 9. Brute-force solve current puzzle" << std::endl; ! std::cout << " R. Rate current puzzle" << std::endl; ! std::cout << " M. Mass puzzle generation" << std::endl; ! std::cout << " C. Count number of solutions to current puzzle" << std::endl; ! std::cout << " P. Dancing links performance benchmarking" << std::endl; ! std::cout << std::endl; ! std::cout << " Q. Quit" << std::endl; ! std::cout << std::endl; ! std::cout << "?> "; ! char choice(0); ! std::cin >> choice; ! std::cout << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" << std::endl; ! std::cout << std::endl; ! switch (choice) ! { ! case '1': ! solve_puzzle(); ! break; ! case '2': ! modify_settings(); ! break; ! case '3': ! std::cout << puzzle_m; ! break; ! case '4': ! sudoku::pinned_reduction(puzzle_m); ! sudoku::detailed_status(puzzle_m); ! break; ! case '5': ! pick_new_puzzle(); ! break; ! case '6': ! case '7': ! std::cout << "not implemented yet, sorry." << std::endl; ! break; ! case '8': ! puzzle_m = sudoku::generate_puzzle(); ! break; ! case '9': ! sudoku::timed_solve(puzzle_m); ! break; ! case 'R': ! case 'r': ! sudoku::rate_puzzle(puzzle_m); ! break; ! case 'M': ! case 'm': ! sudoku::mass_puzzle_generation(); ! break; ! case 'C': ! case 'c': ! sudoku::count_solutions(puzzle_m); ! break; ! case 'P': ! case 'p': ! sudoku::performance_benchmark(); ! break; ! case 'Q': ! case 'q': ! return; ! default: ! std::cerr << "Invalid choice. Please choose again." << std::endl; ! break; ! } ! } } *************** *** 384,392 **** void application_t::run() { ! import_preferences(); ! if (!sudoku_set_m.empty()) puzzle_m = sudoku_set_m[0]; ! menu(); } --- 384,392 ---- void application_t::run() { ! import_preferences(); ! if (!sudoku_set_m.empty()) puzzle_m = sudoku_set_m[0]; ! menu(); } *************** *** 399,414 **** int main(int argc, char** argv) { ! std::srand(std::time(0)); ! std::string db_name("sudokus.txt"); ! if (argc > 1) db_name.assign(argv[1]); ! bfs::path filepath(db_name.c_str(), argc > 1 ? bfs::native : bfs::portable_name); ! { ! application_t(filepath).run(); ! } ! return 0; } --- 399,414 ---- int main(int argc, char** argv) { ! std::srand(std::time(0)); ! std::string db_name("sudokus.txt"); ! if (argc > 1) db_name.assign(argv[1]); ! bfs::path filepath(db_name.c_str(), argc > 1 ? bfs::native : bfs::portable_name); ! { ! application_t(filepath).run(); ! } ! return 0; } Index: sudoku.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sudoku/sudoku.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sudoku.hpp 6 Jan 2006 18:03:03 -0000 1.4 --- sudoku.hpp 3 Feb 2006 18:33:40 -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) */ #include <adobe/config.hpp> --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...1003 lines suppressed...] ! ++col_count; ! if (col_count % 9 == 0) ! { ! ++row_count; ! if (row_count == 3 || row_count == 6) ! s << std::endl << hr; ! s << std::endl; ! } ! else if (col_count % 3 == 0) ! s << " | "; ! else ! s << ' '; ! } ! return s; } Index: sudokus.txt =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sudoku/sudokus.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sudokus.txt 16 Sep 2005 21:50:22 -0000 1.3 --- sudokus.txt 3 Feb 2006 18:33:40 -0000 1.4 *************** *** 1,54 **** ! .2.6..9.7..1...5.....3..68...7.9...8.4.....5.9...7.1...56..1.....2...3..1.8..7.9. beyond wicked puzzle (652) ! ...91....7..5...1..8...4...5...4.18....7.8....46.5...3...8...7..3...6..4....32... hard puzzle (372) ! .3..1.6.......549..4.2....5213....7.57.....36.6....5413....8.6..287.......7.5..8. unbelievably wicked puzzle (971) ! .9.741.35...356.21....92..6....3..1...9...5...8..1....3..46....67.529...95.183.6. unbelievably wicked puzzle (931) ! ..5.1......7..961.3..6..2.71......82.........85......15.2..7..8.314..5......9.4.. unbelievably wicked puzzle (878) ! ...6.1.5....4..8.131.....62.7..6.....25...78.....1..9.63.....459.4..2....8.5.6... nearly diabolical puzzle (401) ! .5...8.72..4...6...1.9....57....381.4.......7.864....99....7.8...1...9..54.6...2. nearly difficult puzzle (258) ! .....6..5...9...879....3..6.3..425.845.3.8.618.976..2.3..6....227...9...1..4..... unbelievably wicked puzzle (931) ! .4.6.9.738...5.......1..2..6......4.2.8...9.5.7......2..9..6.......7...871.2.5.3. unbelievably wicked puzzle (758) ! ....3..5...69.2...3....46....7..5..9.61...34.8..2..7....35....1...6.82...8..9.... beyond diabolical puzzle (462) ! ..267845.4.5231..981.5.4...1.4..6..73.......67..4..9.5...3.9.786..8451.2.837126.. unbelievably wicked puzzle (976) ! ...5...9.7...4.1...5.3.926..71...524.8.2.3.7.692...38..471.5.3...3.9...5.1...7... unbelievably wicked puzzle (916) ! ..3...8.4....8.......7..291..7.3864..2.....5..8564.9..162..7.......9....5.9...1.. tricky puzzle (204) ! .51.3.6.48..6.42.5......397.6..2.8.1.........5.3.1..2.692......3.58.9..21.4.6.73. tricky puzzle (224) ! .....2.4..........48.61.9..34.....7296.....5881.....69..4.58.17..........3.9..... nearly wicked puzzle (485) ! ..6.42...7.36.9..2.4.5.3...3....8.69.........62.7....3...2.4.7.2..3.15.4...89.6.. unbelievably wicked puzzle (893) ! .2.......9.7....8..3.2.6.918.4.5..73.........17..6.2.835.8.9.1..1....8.5.......2. beyond tricky puzzle (240) ! ..9..6...1.58....386.93.4..6...1..7....2.4....3..9...1..3.25.465....91.2...6..9.. nearly difficult puzzle (269) ! ...1.2.....9.5.....2...4618.72...8..4986.5273..3...19.7518...3.....7.5.....5.1... unbelievably wicked puzzle (973) ! ...6....4...78..2.21..5.....45..7.8...6...3...2.1..75.....6..37.9..34...5....1... nearly hard puzzle (336) ! ........28..2..4...3..68..1218.9..3434.....7567..3.2989..14..2...1..9..67........ unbelievably wicked puzzle (972) ! ......96.9....34.15..1...7..9..2.8.78.......56.4.3..2..1...8..62.97....3.56...... unbelievably wicked puzzle (883) ! ......426...4....36...139.8.35.4.6.19.......58.2.5.34.2.369...44....7...187...... beyond tricky puzzle (229) ! .1.823......6..1..5....73....8.4..6..5.3.8.9..4..5.8....75....2..6..1......986.4. nearly diabolical puzzle (403) ! ..6.3.21...9..17...3.2.........62.8..4.....6..9.18.........7.3...34..5...71.5.8.. unbelievably wicked puzzle (888) ! .759.4.2.1..7...4.86..2...39......3.6.2...8.4.1......94...7..96.8...9..7.9.4.628. beyond tricky puzzle (236) ! .25.3.......1....747..98.3..8......1.........2......4..1.58..236....2.......4.98. nearly wicked puzzle (496) ! ......3.......6.15...2154.987..91.....6...1.....68..272.7458...31.7.......4...... beyond diabolical puzzle (452) ! .4.8...6.9..7..2...1.3.....1.6...78.48.....26.52...1.4.....6.3...9..7..8.2...1.5. diabolical puzzle (425) ! ....6...7..5..9..83..5..2......9..8.74.3.5.19.9..4......3..1..66..2..8..2...5.... nearly wicked puzzle (493) ! .5..9.2..8.45.3.6.9..............1...819.472...3..............7.3.4.78.9..9.6..3. diabolical puzzle (435) ! ..5..83.24.3..1..6.....4...9.4....3.86.....75.5....4.9...2.....5..4..8.32.75..9.. nearly diabolical puzzle (411) ! ..1..9.62..6.1397......84..237.....4.........6.....721..39......9463.2..56.1..3.. diabolical puzzle (448) ! ..7.9.2.......56.8...2...7..7....4....58.79....2....3..3...4...8.43.......1.2.7.. beyond wicked puzzle (545) ! ........9...4..37.1....8.5.....45.1.3..8.6..2.4.13.....3.2....4.65..1...8........ beyond wicked puzzle (573) ! ..4........85.9.346..18....9......5.37.....21.8......9....32..742.7.85........8.. nearly wicked puzzle (499) ! .....89..5.4.3...781..9.3.5....261...7.....9...294....1.9.5..723...6.5.9..58..... nearly wicked puzzle (496) ! .4..18..97..2...1....6.5....56.2..98.........89..7.13....3.2....1...7..56..49..2. diabolical puzzle (447) ! ..78....6...29.75.....6..8.......49....7.1....12.......4..3.....38.74...9....28.. nearly wicked puzzle (482) ! .5..27.4....5.....9...6...7.21..6.7.78.....93.4.8..16.1...5...4.....8....9.71..5. unbelievably wicked puzzle (542) ! .....2.1....49...5...8...29.7..6.2...18...65...3.2..7.63...1...5...74....2.3..... unbelievably wicked puzzle (628) ! .2....7..9.6..1...7..8....1.....86..45.1.6.28..79.....5....9..3...4..9.2..2....8. unbelievably wicked puzzle (735) ! .8..42.36....1..285.....14965..9.................5..73865.....434..2....19.68..5. unbelievably wicked puzzle (549) ! .3...2........93...2..5.7.6..8.4..2...1...9...6..7.5..7.2.1..5...68........5...8. unbelievably wicked puzzle (740) ! .......3...534...2...17...6.1..683..3..9.1..5..653..7.9...52...2...176...6....... unbelievably wicked puzzle (707) ! .6..5.38.....7........319.25.9....2...........2....6.78.241........2.....73.8..5. beyond wicked puzzle (624) ! .6...3.92.....81.....91.3..2.4....78.........89....2.5..8.34.....56.....91.8...6. wicked puzzle (518) ! ....61.5....97.......3..186....2.3...7.5.6.2...1.9....456..7.......35....3.14.... beyond wicked puzzle (528) ! .4.382.7.9.............1..38......9.4.69.73.8.1......26..4.............1.2.876.5. beyond wicked puzzle (712) ! .6......17..9..3.........2..74.2...69513.62473...4.18..3.........8..5..92......1. beyond wicked puzzle (723) ! ..9....5....5...6..3...2..93...8.....481.937.....2...64..7...1..5...3....8....7.. beyond wicked puzzle (610) ! 5.6.2.9.3..8...5...........6..285..9...9.3...8..761..4...........4...3..2.1.5.6.7 1,905 solutions ! 536.2.9....8...............6..285..9...9.3...8..761..4...........4......2.1.....7 957,263 solutions ! .94...13..............76..2.8..1.....32.........2.........5.4.......8..7..63.4..8 r1s7 has size 1 but all rc have size > 1 --- 1,54 ---- ! .2.6..9.7..1...5.....3..68...7.9...8.4.....5.9...7.1...56..1.....2...3..1.8..7.9. beyond wicked puzzle (652) ! ...91....7..5...1..8...4...5...4.18....7.8....46.5...3...8...7..3...6..4....32... hard puzzle (372) ! .3..1.6.......549..4.2....5213....7.57.....36.6....5413....8.6..287.......7.5..8. unbelievably wicked puzzle (971) ! .9.741.35...356.21....92..6....3..1...9...5...8..1....3..46....67.529...95.183.6. unbelievably wicked puzzle (931) ! ..5.1......7..961.3..6..2.71......82.........85......15.2..7..8.314..5......9.4.. unbelievably wicked puzzle (878) ! ...6.1.5....4..8.131.....62.7..6.....25...78.....1..9.63.....459.4..2....8.5.6... nearly diabolical puzzle (401) ! .5...8.72..4...6...1.9....57....381.4.......7.864....99....7.8...1...9..54.6...2. nearly difficult puzzle (258) ! .....6..5...9...879....3..6.3..425.845.3.8.618.976..2.3..6....227...9...1..4..... unbelievably wicked puzzle (931) ! .4.6.9.738...5.......1..2..6......4.2.8...9.5.7......2..9..6.......7...871.2.5.3. unbelievably wicked puzzle (758) ! ....3..5...69.2...3....46....7..5..9.61...34.8..2..7....35....1...6.82...8..9.... beyond diabolical puzzle (462) ! ..267845.4.5231..981.5.4...1.4..6..73.......67..4..9.5...3.9.786..8451.2.837126.. unbelievably wicked puzzle (976) ! ...5...9.7...4.1...5.3.926..71...524.8.2.3.7.692...38..471.5.3...3.9...5.1...7... unbelievably wicked puzzle (916) ! ..3...8.4....8.......7..291..7.3864..2.....5..8564.9..162..7.......9....5.9...1.. tricky puzzle (204) ! .51.3.6.48..6.42.5......397.6..2.8.1.........5.3.1..2.692......3.58.9..21.4.6.73. tricky puzzle (224) ! .....2.4..........48.61.9..34.....7296.....5881.....69..4.58.17..........3.9..... nearly wicked puzzle (485) ! ..6.42...7.36.9..2.4.5.3...3....8.69.........62.7....3...2.4.7.2..3.15.4...89.6.. unbelievably wicked puzzle (893) ! .2.......9.7....8..3.2.6.918.4.5..73.........17..6.2.835.8.9.1..1....8.5.......2. beyond tricky puzzle (240) ! ..9..6...1.58....386.93.4..6...1..7....2.4....3..9...1..3.25.465....91.2...6..9.. nearly difficult puzzle (269) ! ...1.2.....9.5.....2...4618.72...8..4986.5273..3...19.7518...3.....7.5.....5.1... unbelievably wicked puzzle (973) ! ...6....4...78..2.21..5.....45..7.8...6...3...2.1..75.....6..37.9..34...5....1... nearly hard puzzle (336) ! ........28..2..4...3..68..1218.9..3434.....7567..3.2989..14..2...1..9..67........ unbelievably wicked puzzle (972) ! ......96.9....34.15..1...7..9..2.8.78.......56.4.3..2..1...8..62.97....3.56...... unbelievably wicked puzzle (883) ! ......426...4....36...139.8.35.4.6.19.......58.2.5.34.2.369...44....7...187...... beyond tricky puzzle (229) ! .1.823......6..1..5....73....8.4..6..5.3.8.9..4..5.8....75....2..6..1......986.4. nearly diabolical puzzle (403) ! ..6.3.21...9..17...3.2.........62.8..4.....6..9.18.........7.3...34..5...71.5.8.. unbelievably wicked puzzle (888) ! .759.4.2.1..7...4.86..2...39......3.6.2...8.4.1......94...7..96.8...9..7.9.4.628. beyond tricky puzzle (236) ! .25.3.......1....747..98.3..8......1.........2......4..1.58..236....2.......4.98. nearly wicked puzzle (496) ! ......3.......6.15...2154.987..91.....6...1.....68..272.7458...31.7.......4...... beyond diabolical puzzle (452) ! .4.8...6.9..7..2...1.3.....1.6...78.48.....26.52...1.4.....6.3...9..7..8.2...1.5. diabolical puzzle (425) ! ....6...7..5..9..83..5..2......9..8.74.3.5.19.9..4......3..1..66..2..8..2...5.... nearly wicked puzzle (493) ! .5..9.2..8.45.3.6.9..............1...819.472...3..............7.3.4.78.9..9.6..3. diabolical puzzle (435) ! ..5..83.24.3..1..6.....4...9.4....3.86.....75.5....4.9...2.....5..4..8.32.75..9.. nearly diabolical puzzle (411) ! ..1..9.62..6.1397......84..237.....4.........6.....721..39......9463.2..56.1..3.. diabolical puzzle (448) ! ..7.9.2.......56.8...2...7..7....4....58.79....2....3..3...4...8.43.......1.2.7.. beyond wicked puzzle (545) ! ........9...4..37.1....8.5.....45.1.3..8.6..2.4.13.....3.2....4.65..1...8........ beyond wicked puzzle (573) ! ..4........85.9.346..18....9......5.37.....21.8......9....32..742.7.85........8.. nearly wicked puzzle (499) ! .....89..5.4.3...781..9.3.5....261...7.....9...294....1.9.5..723...6.5.9..58..... nearly wicked puzzle (496) ! .4..18..97..2...1....6.5....56.2..98.........89..7.13....3.2....1...7..56..49..2. diabolical puzzle (447) ! ..78....6...29.75.....6..8.......49....7.1....12.......4..3.....38.74...9....28.. nearly wicked puzzle (482) ! .5..27.4....5.....9...6...7.21..6.7.78.....93.4.8..16.1...5...4.....8....9.71..5. unbelievably wicked puzzle (542) ! .....2.1....49...5...8...29.7..6.2...18...65...3.2..7.63...1...5...74....2.3..... unbelievably wicked puzzle (628) ! .2....7..9.6..1...7..8....1.....86..45.1.6.28..79.....5....9..3...4..9.2..2....8. unbelievably wicked puzzle (735) ! .8..42.36....1..285.....14965..9.................5..73865.....434..2....19.68..5. unbelievably wicked puzzle (549) ! .3...2........93...2..5.7.6..8.4..2...1...9...6..7.5..7.2.1..5...68........5...8. unbelievably wicked puzzle (740) ! .......3...534...2...17...6.1..683..3..9.1..5..653..7.9...52...2...176...6....... unbelievably wicked puzzle (707) ! .6..5.38.....7........319.25.9....2...........2....6.78.241........2.....73.8..5. beyond wicked puzzle (624) ! .6...3.92.....81.....91.3..2.4....78.........89....2.5..8.34.....56.....91.8...6. wicked puzzle (518) ! ....61.5....97.......3..186....2.3...7.5.6.2...1.9....456..7.......35....3.14.... beyond wicked puzzle (528) ! .4.382.7.9.............1..38......9.4.69.73.8.1......26..4.............1.2.876.5. beyond wicked puzzle (712) ! .6......17..9..3.........2..74.2...69513.62473...4.18..3.........8..5..92......1. beyond wicked puzzle (723) ! ..9....5....5...6..3...2..93...8.....481.937.....2...64..7...1..5...3....8....7.. beyond wicked puzzle (610) ! 5.6.2.9.3..8...5...........6..285..9...9.3...8..761..4...........4...3..2.1.5.6.7 1,905 solutions ! 536.2.9....8...............6..285..9...9.3...8..761..4...........4......2.1.....7 957,263 solutions ! .94...13..............76..2.8..1.....32.........2.........5.4.......8..7..63.4..8 r1s7 has size 1 but all rc have size > 1 |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:57
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/modal_dialog_interface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/modal_dialog_interface Modified Files: Jamfile.v2 main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/modal_dialog_interface/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 24 Jan 2006 19:38:51 -0000 1.1 --- main.cpp 3 Feb 2006 18:33:39 -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,19 **** #if ADOBE_PLATFORM_MAC ! #include <adobe/future/widgets/headers/mac/carbon_safe.hpp> #elif ADOBE_PLATFORM_WIN ! #define WINDOWS_LEAN_AND_MEAN 1 ! #include <windows.h> #endif --- 11,19 ---- #if ADOBE_PLATFORM_MAC ! #include <adobe/future/widgets/headers/mac/carbon_safe.hpp> #elif ADOBE_PLATFORM_WIN ! #define WINDOWS_LEAN_AND_MEAN 1 ! #include <windows.h> #endif *************** *** 40,46 **** const char* eve_view_definition_g = "/*" ! " 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)" "*/" "" --- 40,46 ---- const char* eve_view_definition_g = "/*" ! " 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)" "*/" "" *************** *** 48,79 **** "{" " 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);" ! " edit_number(name: 'Width:', bind: @width_percent, digits: 7);" ! " }" ! " panel(bind: @percent, value: false)" ! " {" ! " edit_number(name: 'Height:', bind: @height_pixels, digits: 7);" ! " edit_number(name: 'Width:', bind: @width_pixels, digits: 7);" ! " }" ! " }" ! " checkbox(name: 'Constrain Proportions', bind: @constrain);" ! " checkbox(name: 'Percent', bind: @percent);" ! " }" ! " column()" ! " {" ! " button(name: 'OK', action: @ok, default: true);" ! " button(name: 'Cancel', action: @cancel, cancel: true);" ! " }" ! " }" "}"; --- 48,79 ---- "{" " 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);" ! " edit_number(name: 'Width:', bind: @width_percent, digits: 7);" ! " }" ! " panel(bind: @percent, value: false)" ! " {" ! " edit_number(name: 'Height:', bind: @height_pixels, digits: 7);" ! " edit_number(name: 'Width:', bind: @width_pixels, digits: 7);" ! " }" ! " }" ! " checkbox(name: 'Constrain Proportions', bind: @constrain);" ! " checkbox(name: 'Percent', bind: @percent);" ! " }" ! " column()" ! " {" ! " button(name: 'OK', action: @ok, default: true);" ! " button(name: 'Cancel', action: @cancel, cancel: true);" ! " }" ! " }" "}"; *************** *** 82,88 **** const char* adam_model_definition_g = "/*" ! " 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)" "*/" "" --- 82,88 ---- const char* adam_model_definition_g = "/*" ! " 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)" "*/" "" *************** *** 90,122 **** "{" "input:" ! " original_width : 5 * 300;" ! " original_height : 7 * 300;" "" "interface:" ! " constrain : true;" "" ! " width_pixels : original_width <== round(width_pixels);" ! " height_pixels : original_height <== round(height_pixels);" ! " width_percent;" ! " height_percent;" "" "logic:" ! " relate {" ! " width_pixels <== round(width_percent * original_width / 100);" ! " width_percent <== width_pixels * 100 / original_width;" ! " }" ! " " ! " relate {" ! " height_pixels <== round(height_percent * original_height / 100);" ! " height_percent <== height_pixels * 100 / original_height;" ! " }" "" ! " when (constrain) relate {" ! " width_percent <== height_percent;" ! " height_percent <== width_percent;" ! " }" "" "output:" ! " result <== { height: height_pixels, width: width_pixels };" "}"; --- 90,122 ---- "{" "input:" ! " original_width : 5 * 300;" ! " original_height : 7 * 300;" "" "interface:" ! " constrain : true;" "" ! " width_pixels : original_width <== round(width_pixels);" ! " height_pixels : original_height <== round(height_pixels);" ! " width_percent;" ! " height_percent;" "" "logic:" ! " relate {" ! " width_pixels <== round(width_percent * original_width / 100);" ! " width_percent <== width_pixels * 100 / original_width;" ! " }" ! " " ! " relate {" ! " height_pixels <== round(height_percent * original_height / 100);" ! " height_percent <== height_pixels * 100 / original_height;" ! " }" "" ! " when (constrain) relate {" ! " width_percent <== height_percent;" ! " height_percent <== width_percent;" ! " }" "" "output:" ! " result <== { height: height_pixels, width: width_pixels };" "}"; *************** *** 128,225 **** "" "<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>"; #endif /****************************************************************************************************/ ! adobe::dialog_result_t do_test( std::istream& eve_stream, ! std::istream& adam_stream) { ! adobe::dictionary_t input; ! adobe::record_info_t record; ! adobe::dictionary_t display_state; ! adobe::dialog_result_t result = ! handle_dialog( input, ! record, ! display_state, ! adobe::dialog_display_s, ! eve_stream, ! adam_stream); ! return result; } --- 128,225 ---- "" "<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>"; #endif /****************************************************************************************************/ ! adobe::dialog_result_t do_test( std::istream& eve_stream, ! std::istream& adam_stream) { ! adobe::dictionary_t input; ! adobe::record_info_t record; ! adobe::dictionary_t display_state; ! adobe::dialog_result_t result = ! handle_dialog( input, ! record, ! display_state, ! adobe::dialog_display_s, ! eve_stream, ! adam_stream); ! return result; } *************** *** 231,257 **** bool os_init() { ! static IBNibRef sNibRef; ! static const EventTypeSpec kAppEvents[] = { { kEventClassCommand, kEventCommandProcess } }; ! OSStatus err(noErr); ! err = ::CreateNibReference( CFSTR("modal_dialog_interface"), &sNibRef ); ! if (err != noErr) return false; ! err = ::SetMenuBarFromNib( sNibRef, CFSTR("MenuBar") ); ! if (err != noErr) return false; ! ::InstallApplicationEventHandler( NewEventHandlerUPP( AppEventHandler ), GetEventTypeCount( kAppEvents ), kAppEvents, 0, NULL ); ! // ! // Register this app as an Appearance Client ! // ! ::RegisterAppearanceClient(); ! return true; } --- 231,257 ---- bool os_init() { ! static IBNibRef sNibRef; ! static const EventTypeSpec kAppEvents[] = { { kEventClassCommand, kEventCommandProcess } }; ! OSStatus err(noErr); ! err = ::CreateNibReference( CFSTR("modal_dialog_interface"), &sNibRef ); ! if (err != noErr) return false; ! err = ::SetMenuBarFromNib( sNibRef, CFSTR("MenuBar") ); ! if (err != noErr) return false; ! ::InstallApplicationEventHandler( NewEventHandlerUPP( AppEventHandler ), GetEventTypeCount( kAppEvents ), kAppEvents, 0, NULL ); ! // ! // Register this app as an Appearance Client ! // ! ::RegisterAppearanceClient(); ! return true; } *************** *** 260,265 **** static OSStatus AppEventHandler(EventHandlerCallRef /*inCaller*/, EventRef /*inEvent*/, void* /*inRefcon*/) { ! //system_beep(); ! return eventNotHandledErr; } --- 260,265 ---- static OSStatus AppEventHandler(EventHandlerCallRef /*inCaller*/, EventRef /*inEvent*/, void* /*inRefcon*/) { ! //system_beep(); ! return eventNotHandledErr; } *************** *** 271,275 **** bool os_init() { ! return true; } #endif --- 271,275 ---- bool os_init() { ! return true; } #endif *************** *** 289,341 **** { #if ADOBE_PLATFORM_MAC ! std::size_t metrics_len(std::strlen(mac_metrics_g)); ! char* metrics_data(new char[metrics_len] + 1); ! std::copy(&mac_metrics_g[0], &mac_metrics_g[0] + metrics_len, &metrics_data[0]); ! adobe::xstring_context_t mac_metrics_context( &metrics_data[0], &metrics_data[metrics_len], ! adobe::line_position_t( "mac metrics" ) ); #endif ! if (!os_init()) throw std::runtime_error("OS initialization failed"); #if ADOBE_PLATFORM_MAC ! if (argc > 2) ! { ! std::string db_name(argv[2]); ! boost::filesystem::path eve_path((db_name + ".eve").c_str(), boost::filesystem::native); ! boost::filesystem::path adam_path((db_name + ".adm").c_str(), boost::filesystem::native); ! boost::filesystem::ifstream eve_stream(eve_path); ! boost::filesystem::ifstream adam_stream(adam_path); ! //std::cerr << "using file set \"" << db_name << '"' << std::endl; ! do_test(eve_stream, adam_stream); ! } ! else #endif ! { ! std::stringstream eve_stream; ! std::stringstream adam_stream; ! eve_stream << eve_view_definition_g; ! adam_stream << adam_model_definition_g; ! //std::cerr << "using builtin file set" << std::endl; ! do_test(eve_stream, adam_stream); ! } ! return 0; } catch(const std::exception& doh) { ! std::cerr << "Exception: " << doh.what() << std::endl; ! return 1; } catch(...) { ! std::cerr << "Exception: Unknown"<< std::endl; ! return 1; } --- 289,341 ---- { #if ADOBE_PLATFORM_MAC ! std::size_t metrics_len(std::strlen(mac_metrics_g)); ! char* metrics_data(new char[metrics_len] + 1); ! std::copy(&mac_metrics_g[0], &mac_metrics_g[0] + metrics_len, &metrics_data[0]); ! adobe::xstring_context_t mac_metrics_context( &metrics_data[0], &metrics_data[metrics_len], ! adobe::line_position_t( "mac metrics" ) ); #endif ! if (!os_init()) throw std::runtime_error("OS initialization failed"); #if ADOBE_PLATFORM_MAC ! if (argc > 2) ! { ! std::string db_name(argv[2]); ! boost::filesystem::path eve_path((db_name + ".eve").c_str(), boost::filesystem::native); ! boost::filesystem::path adam_path((db_name + ".adm").c_str(), boost::filesystem::native); ! boost::filesystem::ifstream eve_stream(eve_path); ! boost::filesystem::ifstream adam_stream(adam_path); ! //std::cerr << "using file set \"" << db_name << '"' << std::endl; ! do_test(eve_stream, adam_stream); ! } ! else #endif ! { ! std::stringstream eve_stream; ! std::stringstream adam_stream; ! eve_stream << eve_view_definition_g; ! adam_stream << adam_model_definition_g; ! //std::cerr << "using builtin file set" << std::endl; ! do_test(eve_stream, adam_stream); ! } ! return 0; } catch(const std::exception& doh) { ! std::cerr << "Exception: " << doh.what() << std::endl; ! return 1; } catch(...) { ! std::cerr << "Exception: Unknown"<< std::endl; ! return 1; } Index: Jamfile.v2 =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/modal_dialog_interface/Jamfile.v2,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jamfile.v2 24 Jan 2006 19:38:51 -0000 1.1 --- Jamfile.v2 3 Feb 2006 18:33:39 -0000 1.2 *************** *** 2,60 **** import os ; ! SOURCE_DIRECTORY = sources ; ! HEADER_DIRECTORY = headers ; switch [ os.name ] { case NT : # --- Windows --------------------------------------------------------------------------- ! { ! PLATFORM_DIRECTORIES_NAME = ! win32 ! ; ! PLATFORM_SETTINGS = ! <include>resources ! <include>. ! <define>WINVER=0x501 <define>_WIN32_WINNT=0x501 <define>_WIN32_IE=0x501 ! <toolset>msvc:<linkflags>"gdi32.lib user32.lib comctl32.lib shell32.lib" ! <toolset>gcc:<cxxflags>"-mno-cygwin" ! <toolset>gcc:<linkflags>"-lgdi32 -lshell32 -luser32 -lcomctl32 -mno-cygwin" ! ; ! } case FREEBSD : ! { ! PLATFORM_DIRECTORIES_NAME = fltk ; ! # ! # Details of *your* local FLTK2 installation must be added here. ! # ! PLATFORM_SETTINGS = <linkflags>"-L/usr/X11R6/lib -lXft -L/usr/local/lib -lfreetype -lz -lfontconfig -lXrender -lXext -lXi -lX11" ; ! } case MACOSX : # --- Mac OS (assumed) ------------------------------------------------------------------ ! { ! PLATFORM_DIRECTORIES_NAME = ! mac ! ; ! PLATFORM_SETTINGS = ! <toolset>darwin:<linkflags>"-framework Carbon" ! ; ! PLATFORM_EXTRAS = ! ; ! } } project adobe/modal_dialog_interface ! : requirements ! <user-interface>gui ! ; ! exe modal_dialog_interface ! : main.cpp ! ../../future/source/modal_dialog_interface.cpp ! /adobe/adobe_widgets//adobe_widgets ! : $(PLATFORM_SETTINGS) ! ; OS = [ os.name ] ; --- 2,60 ---- import os ; ! SOURCE_DIRECTORY = sources ; ! HEADER_DIRECTORY = headers ; switch [ os.name ] { case NT : # --- Windows --------------------------------------------------------------------------- ! { ! PLATFORM_DIRECTORIES_NAME = ! win32 ! ; ! PLATFORM_SETTINGS = ! <include>resources ! <include>. ! <define>WINVER=0x501 <define>_WIN32_WINNT=0x501 <define>_WIN32_IE=0x501 ! <toolset>msvc:<linkflags>"gdi32.lib user32.lib comctl32.lib shell32.lib" ! <toolset>gcc:<cxxflags>"-mno-cygwin" ! <toolset>gcc:<linkflags>"-lgdi32 -lshell32 -luser32 -lcomctl32 -mno-cygwin" ! ; ! } case FREEBSD : ! { ! PLATFORM_DIRECTORIES_NAME = fltk ; ! # ! # Details of *your* local FLTK2 installation must be added here. ! # ! PLATFORM_SETTINGS = <linkflags>"-L/usr/X11R6/lib -lXft -L/usr/local/lib -lfreetype -lz -lfontconfig -lXrender -lXext -lXi -lX11" ; ! } case MACOSX : # --- Mac OS (assumed) ------------------------------------------------------------------ ! { ! PLATFORM_DIRECTORIES_NAME = ! mac ! ; ! PLATFORM_SETTINGS = ! <toolset>darwin:<linkflags>"-framework Carbon" ! ; ! PLATFORM_EXTRAS = ! ; ! } } project adobe/modal_dialog_interface ! : requirements ! <user-interface>gui ! ; ! exe modal_dialog_interface ! : main.cpp ! ../../future/source/modal_dialog_interface.cpp ! /adobe/adobe_widgets//adobe_widgets ! : $(PLATFORM_SETTINGS) ! ; OS = [ os.name ] ; *************** *** 63,94 **** switch [ os.name ] { ! case MACOSX : ! { ! # set up the bundle of the app ! install "modal_dialog_interface.app/Contents" ! : resources/Info.plist ! resources/PkgInfo ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents" ! ; ! install "modal_dialog_interface.app/Contents/MacOS" ! : modal_dialog_interface ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/MacOS" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/MacOS" ! ; ! install "modal_dialog_interface.app/Contents/Resources/begin.nib" ! : [ glob resources/modal_dialog_interface.nib/*.* ] ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/Resources/modal_dialog_interface.nib" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/Resources/modal_dialog_interface.nib" ! ; ! install "modal_dialog_interface.app/Contents/Resources" ! : resources/app_icon.icns ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/Resources" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/Resources" ! ; ! } } --- 63,94 ---- switch [ os.name ] { ! case MACOSX : ! { ! # set up the bundle of the app ! install "modal_dialog_interface.app/Contents" ! : resources/Info.plist ! resources/PkgInfo ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents" ! ; ! install "modal_dialog_interface.app/Contents/MacOS" ! : modal_dialog_interface ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/MacOS" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/MacOS" ! ; ! install "modal_dialog_interface.app/Contents/Resources/begin.nib" ! : [ glob resources/modal_dialog_interface.nib/*.* ] ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/Resources/modal_dialog_interface.nib" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/Resources/modal_dialog_interface.nib" ! ; ! install "modal_dialog_interface.app/Contents/Resources" ! : resources/app_icon.icns ! : <variant>release:<location>$(DEST_PATH)"release/modal_dialog_interface.app/Contents/Resources" ! <variant>debug:<location>$(DEST_PATH)"debug/modal_dialog_interface.app/Contents/Resources" ! ; ! } } |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:56
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sha In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/sha Modified Files: Jamfile.v2 main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sha/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 6 Jan 2006 18:03:03 -0000 1.3 --- main.cpp 3 Feb 2006 18:33:40 -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,39 **** /* ! A note about this testing ! ! A lot of this testing comes from documents on the National Institute of Standards and Technology ! (NIST) website ! - http://csrc.nist.gov/cryptval/ ! Most of the sample tests come from one of the following documents: ! - SHA Standards document: ! - http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf ! - SHA Verification Standard: ! - http://csrc.nist.gov/cryptval/shs/SHAVS.pdf ! - Wikipedia entry on SHA ! - http://en.wikipedia.org/wiki/SHA-1 ! The Pseudorandomly Generated Messages Test is described in the SHAVS document. */ --- 21,39 ---- /* ! A note about this testing ! ! A lot of this testing comes from documents on the National Institute of Standards and Technology ! (NIST) website ! - http://csrc.nist.gov/cryptval/ ! Most of the sample tests come from one of the following documents: ! - SHA Standards document: ! - http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf ! - SHA Verification Standard: ! - http://csrc.nist.gov/cryptval/shs/SHAVS.pdf ! - Wikipedia entry on SHA ! - http://en.wikipedia.org/wiki/SHA-1 ! The Pseudorandomly Generated Messages Test is described in the SHAVS document. */ *************** *** 46,76 **** struct unit_test_t { ! unit_test_t(const char* message, ! boost::uint64_t bitsize, ! const char* digest) : ! message_m(message, static_cast<std::size_t>(bitsize / 8 + ((bitsize % 8 == 0) ? 0 : 1))), bitsize_m(bitsize), digest_m(digest) ! { } ! unit_test_t(const std::string& message, ! const char* digest) : ! message_m(message), bitsize_m(std::numeric_limits<boost::uint64_t>::max()), digest_m(digest) ! { } ! unit_test_t(const unit_test_t& rhs) : ! message_m(rhs.message_m), bitsize_m(rhs.bitsize_m), digest_m(rhs.digest_m) ! { } ! unit_test_t& operator = (const unit_test_t& rhs) ! { ! message_m = rhs.message_m; ! bitsize_m = rhs.bitsize_m; ! digest_m = rhs.digest_m; ! return *this; ! } ! std::string message_m; ! boost::uint64_t bitsize_m; ! const char* digest_m; }; --- 46,76 ---- struct unit_test_t { ! unit_test_t(const char* message, ! boost::uint64_t bitsize, ! const char* digest) : ! message_m(message, static_cast<std::size_t>(bitsize / 8 + ((bitsize % 8 == 0) ? 0 : 1))), bitsize_m(bitsize), digest_m(digest) ! { } ! unit_test_t(const std::string& message, ! const char* digest) : ! message_m(message), bitsize_m(std::numeric_limits<boost::uint64_t>::max()), digest_m(digest) ! { } ! unit_test_t(const unit_test_t& rhs) : ! message_m(rhs.message_m), bitsize_m(rhs.bitsize_m), digest_m(rhs.digest_m) ! { } ! unit_test_t& operator = (const unit_test_t& rhs) ! { ! message_m = rhs.message_m; ! bitsize_m = rhs.bitsize_m; ! digest_m = rhs.digest_m; ! return *this; ! } ! std::string message_m; ! boost::uint64_t bitsize_m; ! const char* digest_m; }; *************** *** 80,100 **** std::string digest_string(const DigestType& digest, bool spaces = true) { ! std::stringstream digest_str; ! digest_str << std::hex; ! for ( typename DigestType::const_iterator first(digest.begin()), ! last(digest.end()); first != last; ++first) ! { ! digest_str.width(sizeof(typename DigestType::value_type) * 2); ! digest_str.fill('0'); ! digest_str << *first; ! if (first + 1 != last && spaces) ! digest_str << ' '; ! } ! return digest_str.str(); } --- 80,100 ---- std::string digest_string(const DigestType& digest, bool spaces = true) { ! std::stringstream digest_str; ! digest_str << std::hex; ! for ( typename DigestType::const_iterator first(digest.begin()), ! last(digest.end()); first != last; ++first) ! { ! digest_str.width(sizeof(typename DigestType::value_type) * 2); ! digest_str.fill('0'); ! digest_str << *first; ! if (first + 1 != last && spaces) ! digest_str << ' '; ! } ! return digest_str.str(); } *************** *** 104,127 **** std::string digest_binary(const DigestType& digest) { ! enum { num_bytes = sizeof(typename DigestType::value_type) }; ! std::string digest_str; ! digest_str.reserve(digest.size() * num_bytes + 1); ! for ( typename DigestType::const_iterator first(digest.begin()), ! last(digest.end()); first != last; ++first) ! { ! typename DigestType::value_type cur(*first); ! for (int i(num_bytes - 1); i >= 0; --i) ! { ! std::size_t shift_amt(8 * i); ! digest_str += char((cur >> shift_amt) & 0xff); ! } ! } ! return digest_str; } --- 104,127 ---- std::string digest_binary(const DigestType& digest) { ! enum { num_bytes = sizeof(typename DigestType::value_type) }; ! std::string digest_str; ! digest_str.reserve(digest.size() * num_bytes + 1); ! for ( typename DigestType::const_iterator first(digest.begin()), ! last(digest.end()); first != last; ++first) ! { ! typename DigestType::value_type cur(*first); ! for (int i(num_bytes - 1); i >= 0; --i) ! { ! std::size_t shift_amt(8 * i); ! digest_str += char((cur >> shift_amt) & 0xff); ! } ! } ! return digest_str; } *************** *** 130,155 **** void print_binary_message(const std::string& str, std::size_t unit_size) { ! std::cout << std::hex; ! std::size_t count(0); ! for ( std::string::const_iterator first(str.begin()), ! last(str.end()); first != last; ++first) ! { ! int value(int(*first) & 0xff); ! std::cout.width(2); ! std::cout.fill('0'); ! std::cout << value; ! if (++count == unit_size) ! { ! std::cout << ' '; ! count = 0; ! } ! } ! std::cout << std::dec; } --- 130,155 ---- void print_binary_message(const std::string& str, std::size_t unit_size) { ! std::cout << std::hex; ! std::size_t count(0); ! for ( std::string::const_iterator first(str.begin()), ! last(str.end()); first != last; ++first) ! { ! int value(int(*first) & 0xff); ! std::cout.width(2); ! std::cout.fill('0'); ! std::cout << value; ! if (++count == unit_size) ! { ! std::cout << ' '; ! count = 0; ! } ! } ! std::cout << std::dec; } *************** *** 184,221 **** void pgmt(std::string seed) { ! // Pseudorandomly Generated Messages Test ! // REVISIT (fbrereto) : Automate verification of output ! typedef HashT hash_type; ! typedef typename hash_type::digest_type digest_type; ! std::cout << "*** pseudorandomly generated messages test for " << typeid(hash_type).name() << std::endl; ! std::string md[1003]; ! hash_type hash; ! for (std::size_t j(0); j < 4; ++j) ! { ! md[0] = seed; ! md[1] = seed; ! md[2] = seed; ! std::string m[1003]; ! for (std::size_t i(3); i < 1003; ++i) ! { ! m[i] = md[i - 3] + md[i - 2] + md[i - 1]; ! md[i] = digest_binary(hash.digest(m[i].begin(), m[i].end())); ! } ! seed = md[1002]; ! md[j] = seed; ! std::cout << "\tMD[" << static_cast<unsigned int>(j) << "]: "; ! print_binary_message(md[j], sizeof(typename digest_type::value_type)); ! std::cout << std::endl; ! } } --- 184,221 ---- void pgmt(std::string seed) { ! // Pseudorandomly Generated Messages Test ! // REVISIT (fbrereto) : Automate verification of output ! typedef HashT hash_type; ! typedef typename hash_type::digest_type digest_type; ! std::cout << "*** pseudorandomly generated messages test for " << typeid(hash_type).name() << std::endl; ! std::string md[1003]; ! hash_type hash; ! for (std::size_t j(0); j < 4; ++j) ! { ! md[0] = seed; ! md[1] = seed; ! md[2] = seed; ! std::string m[1003]; ! for (std::size_t i(3); i < 1003; ++i) ! { ! m[i] = md[i - 3] + md[i - 2] + md[i - 1]; ! md[i] = digest_binary(hash.digest(m[i].begin(), m[i].end())); ! } ! seed = md[1002]; ! md[j] = seed; ! std::cout << "\tMD[" << static_cast<unsigned int>(j) << "]: "; ! print_binary_message(md[j], sizeof(typename digest_type::value_type)); ! std::cout << std::endl; ! } } *************** *** 225,280 **** bool test_hash(I first, I last) { ! typedef HashT hash_type; ! typedef typename hash_type::digest_type digest_type; ! hash_type hash; ! std::size_t test_count(0); ! std::cout << "*** " << typeid(hash).name() << " unit testing" << std::endl; ! while (first != last) ! { ! const unit_test_t& cur_test(*first); ! const std::string& test_string(cur_test.message_m); ! std::string::const_iterator test_string_first(test_string.begin()); ! std::string::const_iterator test_string_last(test_string.end()); ! bool modified_bitsize(cur_test.bitsize_m != std::numeric_limits<boost::uint64_t>::max()); ! adobe::timer_t timer; ! digest_type hash_digest((modified_bitsize) ? ! hash.digest(test_string_first, cur_test.bitsize_m) : ! hash.digest(test_string_first, test_string_last)); ! double time(timer.split()); ! std::string digest(digest_string(hash_digest)); ! bool test_passed(digest == cur_test.digest_m); ! if (test_passed) ! { ! std::cout << "\ttest " << static_cast<unsigned int>(++test_count) << " passed in " ! << time << " miliseconds (" << (time / 1e3) ! << " seconds)" << std::endl; ! } ! else ! { ! std::cout << "test " << static_cast<unsigned int>(++test_count) << ":" << std::endl ! << "\tmessage length: " << static_cast<unsigned int>(test_string.size()) << " bytes (" ! << static_cast<unsigned int>(modified_bitsize ? cur_test.bitsize_m : test_string.size() * 8) ! << " bits)" << std::endl ! << "\tdigest: " << digest << std::endl ! << "\tknown good: " << cur_test.digest_m << std::endl ! << "\tsame?: " << (test_passed ? "Yes" : "NO") << std::endl ! << "\ttime to digest: " << time << " miliseconds (" << (time / 1e3) << " seconds)" ! << std::endl; ! return false; ! } ! ++first; ! } ! // Perform the Pseudorandomly Generated Messages Test ! pgmt<HashT>(pgmt_seed<HashT>()); ! return true; } --- 225,280 ---- bool test_hash(I first, I last) { ! typedef HashT hash_type; ! typedef typename hash_type::digest_type digest_type; ! hash_type hash; ! std::size_t test_count(0); ! std::cout << "*** " << typeid(hash).name() << " unit testing" << std::endl; ! while (first != last) ! { ! const unit_test_t& cur_test(*first); ! const std::string& test_string(cur_test.message_m); ! std::string::const_iterator test_string_first(test_string.begin()); ! std::string::const_iterator test_string_last(test_string.end()); ! bool modified_bitsize(cur_test.bitsize_m != std::numeric_limits<boost::uint64_t>::max()); ! adobe::timer_t timer; ! digest_type hash_digest((modified_bitsize) ? ! hash.digest(test_string_first, cur_test.bitsize_m) : ! hash.digest(test_string_first, test_string_last)); ! double time(timer.split()); ! std::string digest(digest_string(hash_digest)); ! bool test_passed(digest == cur_test.digest_m); ! if (test_passed) ! { ! std::cout << "\ttest " << static_cast<unsigned int>(++test_count) << " passed in " ! << time << " miliseconds (" << (time / 1e3) ! << " seconds)" << std::endl; ! } ! else ! { ! std::cout << "test " << static_cast<unsigned int>(++test_count) << ":" << std::endl ! << "\tmessage length: " << static_cast<unsigned int>(test_string.size()) << " bytes (" ! << static_cast<unsigned int>(modified_bitsize ? cur_test.bitsize_m : test_string.size() * 8) ! << " bits)" << std::endl ! << "\tdigest: " << digest << std::endl ! << "\tknown good: " << cur_test.digest_m << std::endl ! << "\tsame?: " << (test_passed ? "Yes" : "NO") << std::endl ! << "\ttime to digest: " << time << " miliseconds (" << (time / 1e3) << " seconds)" ! << std::endl; ! return false; ! } ! ++first; ! } ! // Perform the Pseudorandomly Generated Messages Test ! pgmt<HashT>(pgmt_seed<HashT>()); ! return true; } *************** *** 287,419 **** int main(int argc, char** argv) { ! std::cout << "Compiled " << __DATE__ << " " << __TIME__ << std::endl; ! /************************** SHA-1 Unit Tests **************************/ ! std::vector<unit_test_t> sha1_test_set; ! sha1_test_set.push_back(unit_test_t("abc", ! "a9993e36 4706816a ba3e2571 7850c26c 9cd0d89d")); ! sha1_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha1_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "34aa973c d4c4daa4 f61eeb2b dbad2731 6534016f")); #endif ! sha1_test_set.push_back(unit_test_t("The quick brown fox jumps over the lazy dog", ! "2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12")); ! sha1_test_set.push_back(unit_test_t("The quick brown fox jumps over the lazy cog", ! "de9f2c7f d25e1b3a fad3e85a 0bd17d9b 100db4b3")); ! sha1_test_set.push_back(unit_test_t("", ! "da39a3ee 5e6b4b0d 3255bfef 95601890 afd80709")); ! sha1_test_set.push_back(unit_test_t("\x98", 5, ! "29826b00 3b906e66 0eff4027 ce98af35 31ac75ba")); ! sha1_test_set.push_back(unit_test_t("\x49\xb2\xae\xc2\x59\x4b\xbe\x3a\x3b\x11\x75\x42\xd9\x4a\xc8\x80", 123, ! "6239781e 03729919 c01955b3 ffa8acb6 0b988340")); ! sha1_test_set.push_back(unit_test_t("\x65\xf9\x32\x99\x5b\xa4\xce\x2c\xb1\xb4\xa2\xe7\x1a\xe7\x02\x20\xaa\xce\xc8\x96\x2d\xd4\x49\x9c\xbd\x7c\x88\x7a\x94\xea\xaa\x10\x1e\xa5\xaa\xbc\x52\x9b\x4e\x7e\x43\x66\x5a\x5a\xf2\xcd\x03\xfe\x67\x8e\xa6\xa5\x00\x5b\xba\x3b\x08\x22\x04\xc2\x8b\x91\x09\xf4\x69\xda\xc9\x2a\xaa\xb3\xaa\x7c\x11\xa1\xb3\x2a\xe0", 611, ! "8c5b2a5d dae5a97f c7f9d856 61c672ad bf7933d4")); ! if (!test_hash<adobe::sha1_t>(sha1_test_set.begin(), sha1_test_set.end())) ! return 1; ! /************************** SHA-224 Unit Tests **************************/ ! std::vector<unit_test_t> sha224_test_set; ! sha224_test_set.push_back(unit_test_t("abc", ! "23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7")); ! sha224_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "75388b16 512776cc 5dba5da1 fd890150 b0c6455c b4f58b19 52522525")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha224_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "20794655 980c91d8 bbb4c1ea 97618a4b f03f4258 1948b2ee 4ee7ad67")); #endif ! sha224_test_set.push_back(unit_test_t("\x68", 5, ! "e3b04855 2c3c387b cab37f6e b06bb79b 96a4aee5 ff27f515 31a9551c")); ! sha224_test_set.push_back(unit_test_t("\xf0\x70\x06\xf2\x5a\x0b\xea\x68\xcd\x76\xa2\x95\x87\xc2\x8d\xa0", 123, ! "1b01db6c b4a9e43d ed1516be b3db0b87 b6d1ea43 187462c6 08137150")); ! sha224_test_set.push_back(unit_test_t("\xa2\xbe\x6e\x46\x32\x81\x09\x02\x94\xd9\xce\x94\x82\x65\x69\x42\x3a\x3a\x30\x5e\xd5\xe2\x11\x6c\xd4\xa4\xc9\x87\xfc\x06\x57\x00\x64\x91\xb1\x49\xcc\xd4\xb5\x11\x30\xac\x62\xb1\x9d\xc2\x48\xc7\x44\x54\x3d\x20\xcd\x39\x52\xdc\xed\x1f\x06\xcc\x3b\x18\xb9\x1f\x3f\x55\x63\x3e\xcc\x30\x85\xf4\x90\x70\x60\xd2\xe0", 611, ! "54bea6ea b8195a2e b0a7906a 4b4a8766 66300eef bd1f3b84 74f9cd57")); ! if (!test_hash<adobe::sha224_t>(sha224_test_set.begin(), sha224_test_set.end())) ! return 1; ! /************************** SHA-256 Unit Tests **************************/ ! std::vector<unit_test_t> sha256_test_set; ! sha256_test_set.push_back(unit_test_t("abc", ! "ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad")); ! sha256_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha256_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0")); #endif ! sha256_test_set.push_back(unit_test_t("\x68", 5, ! "d6d3e02a 31a84a8c aa9718ed 6c2057be 09db45e7 823eb507 9ce7a573 a3760f95")); ! sha256_test_set.push_back(unit_test_t("\xbe\x27\x46\xc6\xdb\x52\x76\x5f\xdb\x2f\x88\x70\x0f\x9a\x73\x60", 123, ! "77ec1dc8 9c821ff2 a1279089 fa091b35 b8cd960b caf7de01 c6a76807 56beb972")); ! sha256_test_set.push_back(unit_test_t("\x3e\x74\x03\x71\xc8\x10\xc2\xb9\x9f\xc0\x4e\x80\x49\x07\xef\x7c\xf2\x6b\xe2\x8b\x57\xcb\x58\xa3\xe2\xf3\xc0\x07\x16\x6e\x49\xc1\x2e\x9b\xa3\x4c\x01\x04\x06\x91\x29\xea\x76\x15\x64\x25\x45\x70\x3a\x2b\xd9\x01\xe1\x6e\xb0\xe0\x5d\xeb\xa0\x14\xeb\xff\x64\x06\xa0\x7d\x54\x36\x4e\xff\x74\x2d\xa7\x79\xb0\xb3\xa0", 611, ! "3e9ad646 8bbbad2a c3c2cdc2 92e018ba 5fd70b96 0cf16797 77fce708 fdb066e9")); ! if (!test_hash<adobe::sha256_t>(sha256_test_set.begin(), sha256_test_set.end())) ! return 1; ! /************************** SHA-384 Unit Tests **************************/ ! std::vector<unit_test_t> sha384_test_set; ! sha384_test_set.push_back(unit_test_t("abc", ! "cb00753f45a35e8b b5a03d699ac65007 272c32ab0eded163 1a8b605a43ff5bed 8086072ba1e7cc23 58baeca134c825a7")); ! sha384_test_set.push_back(unit_test_t("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", ! "09330c33f71147e8 3d192fc782cd1b47 53111b173b3b05d2 2fa08086e3b0f712 fcc7c71a557e2db9 66c3e9fa91746039")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha384_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "9d0e1809716474cb 086e834e310a4a1c ed149e9c00f24852 7972cec5704c2a5b 07b8b3dc38ecc4eb ae97ddd87f3d8985")); #endif ! sha384_test_set.push_back(unit_test_t("\x10", 5, ! "8d17be79e32b6718 e07d8a603eb84ba0 478f7fcfd1bb9399 5f7d1149e09143ac 1ffcfc56820e469f 3878d957a15a3fe4")); ! sha384_test_set.push_back(unit_test_t("\x8b\xc5\x00\xc7\x7c\xee\xd9\x87\x9d\xa9\x89\x10\x7c\xe0\xaa\xa0", 123, ! "d8c43b38e12e7c42 a7c9b810299fd6a7 70bef30920f17532 a898de62c7a07e42 93449c0b5fa70109 f0783211cfc4bce3")); ! sha384_test_set.push_back(unit_test_t("\x68\xf5\x01\x79\x2d\xea\x97\x96\x76\x70\x22\xd9\x3d\xa7\x16\x79\x30\x99\x20\xfa\x10\x12\xae\xa3\x57\xb2\xb1\x33\x1d\x40\xa1\xd0\x3c\x41\xc2\x40\xb3\xc9\xa7\x5b\x48\x92\xf4\xc0\x72\x4b\x68\xc8\x75\x32\x1a\xb8\xcf\xe5\x02\x3b\xd3\x75\xbc\x0f\x94\xbd\x89\xfe\x04\xf2\x97\x10\x5d\x7b\x82\xff\xc0\x02\x1a\xeb\x1c\xcb\x67\x4f\x52\x44\xea\x34\x97\xde\x26\xa4\x19\x1c\x5f\x62\xe5\xe9\xa2\xd8\x08\x2f\x05\x51\xf4\xa5\x30\x68\x26\xe9\x1c\xc0\x06\xce\x1b\xf6\x0f\xf7\x19\xd4\x2f\xa5\x21\xc8\x71\xcd\x23\x94\xd9\x6e\xf4\x46\x8f\x21\x96\x6b\x41\xf2\xba\x80\xc2\x6e\x83\xa9\xe0", 1123, ! "5860e8de91c21578 bb4174d227898a98 e0b45c4c760f0095 49495614daedc077 5d92d11d9f8ce9b0 64eeac8dafc3a297")); ! if (!test_hash<adobe::sha384_t>(sha384_test_set.begin(), sha384_test_set.end())) ! return 1; ! /************************** SHA-512 Unit Tests **************************/ ! std::vector<unit_test_t> sha512_test_set; ! sha512_test_set.push_back(unit_test_t("abc", ! "ddaf35a193617aba cc417349ae204131 12e6fa4e89a97ea2 0a9eeee64b55d39a 2192992a274fc1a8 36ba3c23a3feebbd 454d4423643ce80e 2a9ac94fa54ca49f")); ! sha512_test_set.push_back(unit_test_t("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", ! "8e959b75dae313da 8cf4f72814fc143f 8f7779c6eb9f7fa1 7299aeadb6889018 501d289e4900f7e4 331b99dec4b5433a c7d329eeb6dd2654 5e96e55b874be909")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha512_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "e718483d0ce76964 4e2e42c7bc15b463 8e1f98b13b204428 5632a803afa973eb de0ff244877ea60a 4cb0432ce577c31b eb009c5c2c49aa2e 4eadb217ad8cc09b")); #endif ! sha512_test_set.push_back(unit_test_t("\xb0", 5, ! "d4ee29a9e9098544 6b913cf1d1376c83 6f4be2c1cf3cada0 720a6bf4857d886a 7ecb3c4e4c0fa8c7 f95214e41dc1b0d2 1b22a84cc03bf8ce 4845f34dd5bdbad4")); ! sha512_test_set.push_back(unit_test_t("\x08\xec\xb5\x2e\xba\xe1\xf7\x42\x2d\xb6\x2b\xcd\x54\x26\x70\x80", 123, ! "ed8dc78e8b01b697 50053dbb7a0a9eda 0fb9e9d292b1ed71 5e80a7fe290a4e16 664fd913e8585440 0c5af05e6dad316b 7359b43e64f8bec3 c1f237119986bbb6")); ! sha512_test_set.push_back(unit_test_t("\x3a\xdd\xec\x85\x59\x32\x16\xd1\x61\x9a\xa0\x2d\x97\x56\x97\x0b\xfc\x70\xac\xe2\x74\x4f\x7c\x6b\x27\x88\x15\x10\x28\xf7\xb6\xa2\x55\x0f\xd7\x4a\x7e\x6e\x69\xc2\xc9\xb4\x5f\xc4\x54\x96\x6d\xc3\x1d\x2e\x10\xda\x1f\x95\xce\x02\xbe\xb4\xbf\x87\x65\x57\x4c\xbd\x6e\x83\x37\xef\x42\x0a\xdc\x98\xc1\x5c\xb6\xd5\xe4\xa0\x24\x1b\xa0\x04\x6d\x25\x0e\x51\x02\x31\xca\xc2\x04\x6c\x99\x16\x06\xab\x4e\xe4\x14\x5b\xee\x2f\xf4\xbb\x12\x3a\xab\x49\x8d\x9d\x44\x79\x4f\x99\xcc\xad\x89\xa9\xa1\x62\x12\x59\xed\xa7\x0a\x5b\x6d\xd4\xbd\xd8\x77\x78\xc9\x04\x3b\x93\x84\xf5\x49\x06\x80", 1123, ! "32ba76fc30eaa020 8aeb50ffb5af1864 fdbf17902a4dc0a6 82c61fcea6d92b78 3267b21080301837 f59de79c6b337db2 526f8a0a510e5e53 cafed4355fe7c2f1")); ! if (!test_hash<adobe::sha512_t>(sha512_test_set.begin(), sha512_test_set.end())) ! return 1; ! return 0; } --- 287,419 ---- int main(int argc, char** argv) { ! std::cout << "Compiled " << __DATE__ << " " << __TIME__ << std::endl; ! /************************** SHA-1 Unit Tests **************************/ ! std::vector<unit_test_t> sha1_test_set; ! sha1_test_set.push_back(unit_test_t("abc", ! "a9993e36 4706816a ba3e2571 7850c26c 9cd0d89d")); ! sha1_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha1_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "34aa973c d4c4daa4 f61eeb2b dbad2731 6534016f")); #endif ! sha1_test_set.push_back(unit_test_t("The quick brown fox jumps over the lazy dog", ! "2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12")); ! sha1_test_set.push_back(unit_test_t("The quick brown fox jumps over the lazy cog", ! "de9f2c7f d25e1b3a fad3e85a 0bd17d9b 100db4b3")); ! sha1_test_set.push_back(unit_test_t("", ! "da39a3ee 5e6b4b0d 3255bfef 95601890 afd80709")); ! sha1_test_set.push_back(unit_test_t("\x98", 5, ! "29826b00 3b906e66 0eff4027 ce98af35 31ac75ba")); ! sha1_test_set.push_back(unit_test_t("\x49\xb2\xae\xc2\x59\x4b\xbe\x3a\x3b\x11\x75\x42\xd9\x4a\xc8\x80", 123, ! "6239781e 03729919 c01955b3 ffa8acb6 0b988340")); ! sha1_test_set.push_back(unit_test_t("\x65\xf9\x32\x99\x5b\xa4\xce\x2c\xb1\xb4\xa2\xe7\x1a\xe7\x02\x20\xaa\xce\xc8\x96\x2d\xd4\x49\x9c\xbd\x7c\x88\x7a\x94\xea\xaa\x10\x1e\xa5\xaa\xbc\x52\x9b\x4e\x7e\x43\x66\x5a\x5a\xf2\xcd\x03\xfe\x67\x8e\xa6\xa5\x00\x5b\xba\x3b\x08\x22\x04\xc2\x8b\x91\x09\xf4\x69\xda\xc9\x2a\xaa\xb3\xaa\x7c\x11\xa1\xb3\x2a\xe0", 611, ! "8c5b2a5d dae5a97f c7f9d856 61c672ad bf7933d4")); ! if (!test_hash<adobe::sha1_t>(sha1_test_set.begin(), sha1_test_set.end())) ! return 1; ! /************************** SHA-224 Unit Tests **************************/ ! std::vector<unit_test_t> sha224_test_set; ! sha224_test_set.push_back(unit_test_t("abc", ! "23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7")); ! sha224_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "75388b16 512776cc 5dba5da1 fd890150 b0c6455c b4f58b19 52522525")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha224_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "20794655 980c91d8 bbb4c1ea 97618a4b f03f4258 1948b2ee 4ee7ad67")); #endif ! sha224_test_set.push_back(unit_test_t("\x68", 5, ! "e3b04855 2c3c387b cab37f6e b06bb79b 96a4aee5 ff27f515 31a9551c")); ! sha224_test_set.push_back(unit_test_t("\xf0\x70\x06\xf2\x5a\x0b\xea\x68\xcd\x76\xa2\x95\x87\xc2\x8d\xa0", 123, ! "1b01db6c b4a9e43d ed1516be b3db0b87 b6d1ea43 187462c6 08137150")); ! sha224_test_set.push_back(unit_test_t("\xa2\xbe\x6e\x46\x32\x81\x09\x02\x94\xd9\xce\x94\x82\x65\x69\x42\x3a\x3a\x30\x5e\xd5\xe2\x11\x6c\xd4\xa4\xc9\x87\xfc\x06\x57\x00\x64\x91\xb1\x49\xcc\xd4\xb5\x11\x30\xac\x62\xb1\x9d\xc2\x48\xc7\x44\x54\x3d\x20\xcd\x39\x52\xdc\xed\x1f\x06\xcc\x3b\x18\xb9\x1f\x3f\x55\x63\x3e\xcc\x30\x85\xf4\x90\x70\x60\xd2\xe0", 611, ! "54bea6ea b8195a2e b0a7906a 4b4a8766 66300eef bd1f3b84 74f9cd57")); ! if (!test_hash<adobe::sha224_t>(sha224_test_set.begin(), sha224_test_set.end())) ! return 1; ! /************************** SHA-256 Unit Tests **************************/ ! std::vector<unit_test_t> sha256_test_set; ! sha256_test_set.push_back(unit_test_t("abc", ! "ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad")); ! sha256_test_set.push_back(unit_test_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", ! "248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha256_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0")); #endif ! sha256_test_set.push_back(unit_test_t("\x68", 5, ! "d6d3e02a 31a84a8c aa9718ed 6c2057be 09db45e7 823eb507 9ce7a573 a3760f95")); ! sha256_test_set.push_back(unit_test_t("\xbe\x27\x46\xc6\xdb\x52\x76\x5f\xdb\x2f\x88\x70\x0f\x9a\x73\x60", 123, ! "77ec1dc8 9c821ff2 a1279089 fa091b35 b8cd960b caf7de01 c6a76807 56beb972")); ! sha256_test_set.push_back(unit_test_t("\x3e\x74\x03\x71\xc8\x10\xc2\xb9\x9f\xc0\x4e\x80\x49\x07\xef\x7c\xf2\x6b\xe2\x8b\x57\xcb\x58\xa3\xe2\xf3\xc0\x07\x16\x6e\x49\xc1\x2e\x9b\xa3\x4c\x01\x04\x06\x91\x29\xea\x76\x15\x64\x25\x45\x70\x3a\x2b\xd9\x01\xe1\x6e\xb0\xe0\x5d\xeb\xa0\x14\xeb\xff\x64\x06\xa0\x7d\x54\x36\x4e\xff\x74\x2d\xa7\x79\xb0\xb3\xa0", 611, ! "3e9ad646 8bbbad2a c3c2cdc2 92e018ba 5fd70b96 0cf16797 77fce708 fdb066e9")); ! if (!test_hash<adobe::sha256_t>(sha256_test_set.begin(), sha256_test_set.end())) ! return 1; ! /************************** SHA-384 Unit Tests **************************/ ! std::vector<unit_test_t> sha384_test_set; ! sha384_test_set.push_back(unit_test_t("abc", ! "cb00753f45a35e8b b5a03d699ac65007 272c32ab0eded163 1a8b605a43ff5bed 8086072ba1e7cc23 58baeca134c825a7")); ! sha384_test_set.push_back(unit_test_t("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", ! "09330c33f71147e8 3d192fc782cd1b47 53111b173b3b05d2 2fa08086e3b0f712 fcc7c71a557e2db9 66c3e9fa91746039")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha384_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "9d0e1809716474cb 086e834e310a4a1c ed149e9c00f24852 7972cec5704c2a5b 07b8b3dc38ecc4eb ae97ddd87f3d8985")); #endif ! sha384_test_set.push_back(unit_test_t("\x10", 5, ! "8d17be79e32b6718 e07d8a603eb84ba0 478f7fcfd1bb9399 5f7d1149e09143ac 1ffcfc56820e469f 3878d957a15a3fe4")); ! sha384_test_set.push_back(unit_test_t("\x8b\xc5\x00\xc7\x7c\xee\xd9\x87\x9d\xa9\x89\x10\x7c\xe0\xaa\xa0", 123, ! "d8c43b38e12e7c42 a7c9b810299fd6a7 70bef30920f17532 a898de62c7a07e42 93449c0b5fa70109 f0783211cfc4bce3")); ! sha384_test_set.push_back(unit_test_t("\x68\xf5\x01\x79\x2d\xea\x97\x96\x76\x70\x22\xd9\x3d\xa7\x16\x79\x30\x99\x20\xfa\x10\x12\xae\xa3\x57\xb2\xb1\x33\x1d\x40\xa1\xd0\x3c\x41\xc2\x40\xb3\xc9\xa7\x5b\x48\x92\xf4\xc0\x72\x4b\x68\xc8\x75\x32\x1a\xb8\xcf\xe5\x02\x3b\xd3\x75\xbc\x0f\x94\xbd\x89\xfe\x04\xf2\x97\x10\x5d\x7b\x82\xff\xc0\x02\x1a\xeb\x1c\xcb\x67\x4f\x52\x44\xea\x34\x97\xde\x26\xa4\x19\x1c\x5f\x62\xe5\xe9\xa2\xd8\x08\x2f\x05\x51\xf4\xa5\x30\x68\x26\xe9\x1c\xc0\x06\xce\x1b\xf6\x0f\xf7\x19\xd4\x2f\xa5\x21\xc8\x71\xcd\x23\x94\xd9\x6e\xf4\x46\x8f\x21\x96\x6b\x41\xf2\xba\x80\xc2\x6e\x83\xa9\xe0", 1123, ! "5860e8de91c21578 bb4174d227898a98 e0b45c4c760f0095 49495614daedc077 5d92d11d9f8ce9b0 64eeac8dafc3a297")); ! if (!test_hash<adobe::sha384_t>(sha384_test_set.begin(), sha384_test_set.end())) ! return 1; ! /************************** SHA-512 Unit Tests **************************/ ! std::vector<unit_test_t> sha512_test_set; ! sha512_test_set.push_back(unit_test_t("abc", ! "ddaf35a193617aba cc417349ae204131 12e6fa4e89a97ea2 0a9eeee64b55d39a 2192992a274fc1a8 36ba3c23a3feebbd 454d4423643ce80e 2a9ac94fa54ca49f")); ! sha512_test_set.push_back(unit_test_t("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", ! "8e959b75dae313da 8cf4f72814fc143f 8f7779c6eb9f7fa1 7299aeadb6889018 501d289e4900f7e4 331b99dec4b5433a c7d329eeb6dd2654 5e96e55b874be909")); #if ADOBE_TEST_SHA_MILLION_A_STRING ! sha512_test_set.push_back(unit_test_t(std::string(1000000, 'a'), ! "e718483d0ce76964 4e2e42c7bc15b463 8e1f98b13b204428 5632a803afa973eb de0ff244877ea60a 4cb0432ce577c31b eb009c5c2c49aa2e 4eadb217ad8cc09b")); #endif ! sha512_test_set.push_back(unit_test_t("\xb0", 5, ! "d4ee29a9e9098544 6b913cf1d1376c83 6f4be2c1cf3cada0 720a6bf4857d886a 7ecb3c4e4c0fa8c7 f95214e41dc1b0d2 1b22a84cc03bf8ce 4845f34dd5bdbad4")); ! sha512_test_set.push_back(unit_test_t("\x08\xec\xb5\x2e\xba\xe1\xf7\x42\x2d\xb6\x2b\xcd\x54\x26\x70\x80", 123, ! "ed8dc78e8b01b697 50053dbb7a0a9eda 0fb9e9d292b1ed71 5e80a7fe290a4e16 664fd913e8585440 0c5af05e6dad316b 7359b43e64f8bec3 c1f237119986bbb6")); ! sha512_test_set.push_back(unit_test_t("\x3a\xdd\xec\x85\x59\x32\x16\xd1\x61\x9a\xa0\x2d\x97\x56\x97\x0b\xfc\x70\xac\xe2\x74\x4f\x7c\x6b\x27\x88\x15\x10\x28\xf7\xb6\xa2\x55\x0f\xd7\x4a\x7e\x6e\x69\xc2\xc9\xb4\x5f\xc4\x54\x96\x6d\xc3\x1d\x2e\x10\xda\x1f\x95\xce\x02\xbe\xb4\xbf\x87\x65\x57\x4c\xbd\x6e\x83\x37\xef\x42\x0a\xdc\x98\xc1\x5c\xb6\xd5\xe4\xa0\x24\x1b\xa0\x04\x6d\x25\x0e\x51\x02\x31\xca\xc2\x04\x6c\x99\x16\x06\xab\x4e\xe4\x14\x5b\xee\x2f\xf4\xbb\x12\x3a\xab\x49\x8d\x9d\x44\x79\x4f\x99\xcc\xad\x89\xa9\xa1\x62\x12\x59\xed\xa7\x0a\x5b\x6d\xd4\xbd\xd8\x77\x78\xc9\x04\x3b\x93\x84\xf5\x49\x06\x80", 1123, ! "32ba76fc30eaa020 8aeb50ffb5af1864 fdbf17902a4dc0a6 82c61fcea6d92b78 3267b21080301837 f59de79c6b337db2 526f8a0a510e5e53 cafed4355fe7c2f1")); ! if (!test_hash<adobe::sha512_t>(sha512_test_set.begin(), sha512_test_set.end())) ! return 1; ! return 0; } Index: Jamfile.v2 =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/sha/Jamfile.v2,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jamfile.v2 6 Jan 2006 18:03:03 -0000 1.2 --- Jamfile.v2 3 Feb 2006 18:33:40 -0000 1.3 *************** *** 2,6 **** project adobe/sha ! ; run main.cpp --- 2,6 ---- project adobe/sha ! ; run main.cpp *************** *** 8,10 **** : #files : <toolset>darwin:<linkflags>"-framework Carbon" ! ; --- 8,10 ---- : #files : <toolset>darwin:<linkflags>"-framework Carbon" ! ; |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:54
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/test/gil Modified Files: dynamic_image.cpp gil_test_config.hpp image.cpp main.cpp pixel.cpp pixel_iterator.cpp stdafx.h Log Message: asl 1.0.13 Index: dynamic_image.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/dynamic_image.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dynamic_image.cpp 6 Jan 2006 18:03:03 -0000 1.1 --- dynamic_image.cpp 3 Feb 2006 18:33:39 -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) */ // image_test.cpp : Defines the entry point for the console application. --- 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) */ // image_test.cpp : Defines the entry point for the console application. *************** *** 33,49 **** template <typename V> const point2<int>& get_size(const image<V>& img) { ! return view(img).dimensions(); } // BEGIN GLUE CODE struct size2_fn { ! typedef const point2<int>& result_type; ! template <typename V> ! result_type operator()(const image<V>& img) const { return get_size(img); } }; template <typename C> const point2<int>& get_size(const variant<C>& img) { ! return img.apply_visitor(size2_fn()); } // END GLUE CODE --- 33,49 ---- template <typename V> const point2<int>& get_size(const image<V>& img) { ! return view(img).dimensions(); } // BEGIN GLUE CODE struct size2_fn { ! typedef const point2<int>& result_type; ! template <typename V> ! result_type operator()(const image<V>& img) const { return get_size(img); } }; template <typename C> const point2<int>& get_size(const variant<C>& img) { ! return img.apply_visitor(size2_fn()); } // END GLUE CODE *************** *** 52,91 **** // non-const operation struct set_firstp_fn { ! typedef void result_type; ! template <typename I> ! result_type operator()(image<I>& img) const { img(0,0)=img(1,0); } }; void test_dynamic_views(const std::string& fileName) { ! const std::string in_dir="C:\\test\\imgtest\\"; ! const std::string out_dir=in_dir+"newimg_output\\generic\\"; ! /* rgb8_image rgb8; ! load_image(rgb8, in_dir+fileName); ! gray8_image gray8(view(rgb8).dimensions()); ! copy_and_convert_pixels(view(rgb8),view(gray8)); ! save_view(view(gray8), out_dir+"gray8_converted.jpg"); */ ! any_image anyImg; ! load_image(anyImg, in_dir+fileName); ! std::cerr <<"File: "<<in_dir+fileName<<" height:"<<get_height(view(anyImg))<<" numChannels:"<<get_num_channels(view(anyImg))<<std::endl; /* This overflows the VC compiler ! any_image anyImg2; ! anyImg2.move_in(gray8_image(get_dimensions(view(anyImg)))); ! copy_and_convert_pixels(view(anyImg),view(anyImg2)); ! save_view(view(anyImg2), out_dir+"gray8_converted.jpg"); */ ! gray8_image gray8(get_dimensions(view(anyImg))); ! //copy_and_convert_pixels(view(anyImg),view(gray8)); copy_pixels(view(anyImg),view(gray8)); ! save_view(view(gray8), out_dir+"gray8_converted.jpg"); ! save_view(fliplr_view(view(anyImg)), out_dir+"fliplr.jpg"); ! save_view(flipud_view(view(anyImg)), out_dir+"flipud.jpg"); ! any_view subimageView=subimage_view(view(anyImg),point2<ptrdiff_t>(0,0),point2<ptrdiff_t>(100,100)); ! save_view(subimageView, out_dir+"subimage.jpg"); ! save_view(subsampled_view(rotated180_view(view(anyImg)), point2<ptrdiff_t>(2,1)),out_dir+"subsampled180rot.jpg"); } --- 52,91 ---- // non-const operation struct set_firstp_fn { ! typedef void result_type; ! template <typename I> ! result_type operator()(image<I>& img) const { img(0,0)=img(1,0); } }; void test_dynamic_views(const std::string& fileName) { ! const std::string in_dir="C:\\test\\imgtest\\"; ! const std::string out_dir=in_dir+"newimg_output\\generic\\"; ! /* rgb8_image rgb8; ! load_image(rgb8, in_dir+fileName); ! gray8_image gray8(view(rgb8).dimensions()); ! copy_and_convert_pixels(view(rgb8),view(gray8)); ! save_view(view(gray8), out_dir+"gray8_converted.jpg"); */ ! any_image anyImg; ! load_image(anyImg, in_dir+fileName); ! std::cerr <<"File: "<<in_dir+fileName<<" height:"<<get_height(view(anyImg))<<" numChannels:"<<get_num_channels(view(anyImg))<<std::endl; /* This overflows the VC compiler ! any_image anyImg2; ! anyImg2.move_in(gray8_image(get_dimensions(view(anyImg)))); ! copy_and_convert_pixels(view(anyImg),view(anyImg2)); ! save_view(view(anyImg2), out_dir+"gray8_converted.jpg"); */ ! gray8_image gray8(get_dimensions(view(anyImg))); ! //copy_and_convert_pixels(view(anyImg),view(gray8)); copy_pixels(view(anyImg),view(gray8)); ! save_view(view(gray8), out_dir+"gray8_converted.jpg"); ! save_view(fliplr_view(view(anyImg)), out_dir+"fliplr.jpg"); ! save_view(flipud_view(view(anyImg)), out_dir+"flipud.jpg"); ! any_view subimageView=subimage_view(view(anyImg),point2<ptrdiff_t>(0,0),point2<ptrdiff_t>(100,100)); ! save_view(subimageView, out_dir+"subimage.jpg"); ! save_view(subsampled_view(rotated180_view(view(anyImg)), point2<ptrdiff_t>(2,1)),out_dir+"subsampled180rot.jpg"); } *************** *** 97,147 **** void test_gimage() { ! test_dynamic_views("RGB.tif"); ! test_dynamic_views("gray.jpg"); } /* void test_gimage2() { ! typedef variant<AnyImageConceptSpace> AnyImage; ! typedef variant<AnyImageViewConceptSpace> AnyImageView; ! // static bool c1=PIXELS_COMPATIBLE(rgb8_pixel, rgb8_pixel); ! BOOST_STATIC_ASSERT(PIXELS_COMPATIBLE(rgb8_pixel, rgb8_pixel)); ! BOOST_STATIC_ASSERT(PIXELS_COMPATIBLE(bgr8_pixel, rgb8c_pixel)); ! BOOST_STATIC_ASSERT(!PIXELS_COMPATIBLE(bgr8_pixel, rgba8_pixel)); ! rgb8_image img1(10,10); ! fill_pixels(view(img1),rgb8_pixel(100,50,25)); ! AnyImageView imv1=view(img1); ! bgr8_image img2(10,10); ! AnyImageView imv2=view(img2); ! copy_pixels(imv1, imv2); ! copy_pixels(imv2, view(img1)); ! copy_pixels(view(img1), imv2); ! point2<int> sz=get_size(img1); ! // const cmyk8_image img2(point_type(10,10)); ! // cmyk16_image img2(point_type(10,10)); ! rgb8_view v=view(img1); ! AnyImageView av(view(img1)); ! AnyImage defaultConstructed; ! { ! rgb8_image r8(point2<int>(8,8)); ! AnyImage anyImg(rgb8_image(point2<int>(8,8)), true); ! rgb8_image r88(point2<int>(8,8)); ! anyImg.move_in(r88); ! int stop=0; ! // sz=get_size(anyImg); ! } } */ --- 97,147 ---- void test_gimage() { ! test_dynamic_views("RGB.tif"); ! test_dynamic_views("gray.jpg"); } /* void test_gimage2() { ! typedef variant<AnyImageConceptSpace> AnyImage; ! typedef variant<AnyImageViewConceptSpace> AnyImageView; ! // static bool c1=PIXELS_COMPATIBLE(rgb8_pixel, rgb8_pixel); ! BOOST_STATIC_ASSERT(PIXELS_COMPATIBLE(rgb8_pixel, rgb8_pixel)); ! BOOST_STATIC_ASSERT(PIXELS_COMPATIBLE(bgr8_pixel, rgb8c_pixel)); ! BOOST_STATIC_ASSERT(!PIXELS_COMPATIBLE(bgr8_pixel, rgba8_pixel)); ! rgb8_image img1(10,10); ! fill_pixels(view(img1),rgb8_pixel(100,50,25)); ! AnyImageView imv1=view(img1); ! bgr8_image img2(10,10); ! AnyImageView imv2=view(img2); ! copy_pixels(imv1, imv2); ! copy_pixels(imv2, view(img1)); ! copy_pixels(view(img1), imv2); ! point2<int> sz=get_size(img1); ! // const cmyk8_image img2(point_type(10,10)); ! // cmyk16_image img2(point_type(10,10)); ! rgb8_view v=view(img1); ! AnyImageView av(view(img1)); ! AnyImage defaultConstructed; ! { ! rgb8_image r8(point2<int>(8,8)); ! AnyImage anyImg(rgb8_image(point2<int>(8,8)), true); ! rgb8_image r88(point2<int>(8,8)); ! anyImg.move_in(r88); ! int stop=0; ! // sz=get_size(anyImg); ! } } */ Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/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:03 -0000 1.1 --- main.cpp 3 Feb 2006 18:33:39 -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) */ // image_test.cpp : Defines the entry point for the console application. --- 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) */ // image_test.cpp : Defines the entry point for the console application. *************** *** 14,26 **** { #ifdef NO_ASL ! test_integral_image(); ! performance_test(); #endif ! test_pixel(); ! test_pixel_iterator(); ! // test_image_io(); ! test_image(); ! // test_image_tiler(); } --- 14,26 ---- { #ifdef NO_ASL ! test_integral_image(); ! performance_test(); #endif ! test_pixel(); ! test_pixel_iterator(); ! // test_image_io(); ! test_image(); ! // test_image_tiler(); } Index: pixel.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/pixel.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pixel.cpp 24 Jan 2006 19:38:51 -0000 1.2 --- pixel.cpp 3 Feb 2006 18:33:39 -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) */ // image_test.cpp : Defines the entry point for the console application. --- 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) */ // image_test.cpp : Defines the entry point for the console application. *************** *** 37,289 **** template <typename T> struct clear_fn { ! void operator()(T& v) { v=0; } }; template <typename T> inline void ignore_unused_variable_warning(const T&){} void test_pixel() { ! gil_function_requires<MutableChannelConcept<bits8> >(); ! gil_function_requires<MutableChannelConcept<bits8&> >(); ! gil_function_requires<ChannelConcept<const bits8&> >(); ! gil_function_requires<MutableChannelConcept<bits16> >(); ! gil_function_requires<MutableChannelConcept<bits32> >(); ! gil_function_requires<MutablePixelConcept<bgr32_pixel> >(); ! gil_function_requires<MutablePixelConcept<rgb16_planar_ref> >(); ! gil_function_requires<PixelConcept<rgb8c_pixel> >(); ! gil_function_requires<PixelConvertibleConcept<rgb8_pixel,cmyk16_pixel> >(); ! gil_function_requires<PixelConvertibleConcept<rgb8_pixel,cmyk16_planar_ref> >(); ! gil_function_requires<PixelConvertibleConcept<gray8c_pixel,cmyk16_planar_ref> >(); ! BOOST_STATIC_ASSERT(rgb_tag::num_channels==3); ! BOOST_STATIC_ASSERT(bgr_tag::num_channels==3); ! // dimensions to explore ! // ! // values, references, pointers ! // color spaces (rgb,cmyk,gray) ! // channel ordering (bgr vs rgb) ! // planar vs interleaved // PIXEL VALUES // Default constructors and construct with values ! rgb8_pixel rgb8(10,100,200); ! bgr8_pixel bgr8(10,100,200); ! rgb32_pixel rgb32(0.1f, 0.5f, 0.7f); ! per_channel_set_op(std::bind2nd(std::plus<bits8>(),3),rgb8,rgb8); ! cmyk8_pixel cmyk8; ! rgba8_pixel rgba8; ! gray8_pixel gray8(11); ! rgb16_pixel rgb16; ! cmyk16_pixel cmyk16; ! rgba16_pixel rgba16; ! bits8 mv=max_channel(rgb8); ! mv=min_channel(rgb8); // Copy construct from compatible pixel ! rgb8_pixel rgb8_1(rgb8); ! cmyk16_pixel cmyk16_1(cmyk16); ! bgr8_pixel bgr8_1(rgb8); // with different channel ordering ! assert(bgr8_1==rgb8); ! // RGB8 fail1(cmyk8); // error: different color space ! // RGB8 fail2(rgb16); // error: different channel depth // Assignment to compatible pixel ! rgb8_1=rgb8; ! bgr8_1=rgb8_pixel(1,2,3); ! rgb8_1=bgr8_1; ! assert(rgb8_1.r==1); ! ! // rgb8=rgba8; // error different color space ! // rgb8=rgb16; // error different channel depth ! // rgb8_pixel result=bgr8_1+rgb8; // PIXEL REFERENCES ! // rgb8ref rgb8ref_err; // error: references have no default constructors // Assign/copy-construct reference from value ! rgb8_ref rgb8ref(rgb8); ! rgb8_planar_ref rgb8planarref(rgb8); ! rgb8planarref=rgb8_pixel(11,22,32); ! unsigned char rr=rgb8planarref[2]; ignore_unused_variable_warning(rr); ! assert(rgb8planarref[2]==32); ! assert(rgb8[2]==32); ! rgb32_pixel r32=rgb32_pixel(1,2,3); ! rgb32_planar_ref rgb32pr(r32); ! bits32 xty=rgb32pr[2]; ignore_unused_variable_warning(xty); ! assert(xty==3); ! assert(r32[2]==3); ! const rgb8_pixel& CR(rgb8); ! rgb8ref=CR; ! rgb8c_pixel rgb8c(1,2,3); ! //BOOST_STATIC_ASSERT((boost::is_same<bits8,REMOVE_CONST_AND_REFERENCE(const bits8&)>::value)); ! rgb8c_planar_ref rgb8c_ref=rgb8c; ! // rgb8=rgb8c_pixel(1,2,3); ! assert(rgb8ref.b==rgb8.b); ! assert(rgb8==rgb8ref); ! assert(rgb8planarref==rgb8ref); ! boost::add_const<iterator_traits<rgb8_ptr>::reference>::type rgb8_const_ref(rgb8); ! // rgb8_const_ref=rgb8_pixel(3,5,7); // error: setting value of const reference ! rgb8planarref.b=33; ! assert(rgb8_const_ref.b==33); ! bgr8_ref bgr8_ref(bgr8); ! gray8_ref gray8_ref(gray8); // copy-construct reference from reference ! rgb8_ref rgb8ref_1(rgb8ref); ! rgb8_planar_ref rgb8planarref_1(rgb8ref); // planar from non-planar reference is ok ! // rgb8_ref rgb8ref_1_err(rgb8planarref); // error: non-planar from planar reference ! cmyk8_planar_ref cpr(cmyk8); ! int a=5, b=6; ! const int& cr=a; ! const rgb8_planar_ref cr_(rgb8); ! int& nr=b; ! rgb8_planar_ref nr_(rgb8); ! const int& cr2(cr); ignore_unused_variable_warning(cr2); ! const rgb8_planar_ref cr2_(cr_); ! const int& cr3(nr); ignore_unused_variable_warning(cr3); ! const rgb8_planar_ref cr3_(nr_); ! // SHOULD NOT COMPILE BUT IT DOES!! Bizzare because reference class' copy constructor takes argument by non-const reference, so it should not match "const rgb8_planar_ref" ! // int& nr2(cr); ! rgb8_planar_ref _nr2(cr_); // ERROR: reference from const reference ! int& nr3(nr); ignore_unused_variable_warning(nr3); ! rgb8_planar_ref _nr3(nr_); ! // cr=nr; ! // cr_=nr_; // ERROR: assigning to const reference ! nr=cr; ! nr_=cr_; ! // cr=cr; ! // cr_=cr_; ! nr=nr; ! nr_=nr_; // Assign value or reference to reference ! rgb8ref=rgb8_pixel(3,5,7); ! rgb8ref=rgb8ref_1; ! // rgb8_const_ref=rgb8ref; // error: const from non-const ! rgb8ref=rgb8_const_ref; // non-const from const // PIXEL POINTERS ! // typedef const iterator_traits<rgb8_ptr>::pointer RGB8ConstPtr; ! typedef const rgb8_ptr RGB8ConstPtr; ! typedef const rgb8_planar_ptr RGB8ConstPlanarPtr; ! // typedef const iterator_traits<rgb8_planar_ptr>::pointer RGB8ConstPlanarPtr; // constructing from values, references and other pointers ! RGB8ConstPtr rgb8_const_ptr=NULL; ignore_unused_variable_warning(rgb8_const_ptr); ! rgb8_ptr rgb8ptr=&rgb8; ! rgb8=bgr8_pixel(30,20,10); ! rgb8_planar_ptr rgb8_pptr=&rgb8; ! ++rgb8_pptr; ! rgb8_pptr--; ! rgb8_pptr[0]=rgb8; ! RGB8ConstPlanarPtr rgb8_const_planar_ptr=&rgb8; ! // rgb8_const_planar_ptr=&rgb16p; // error: incompatible bit depth ! // iterator_traits<CMYK8>::pointer cmyk8_ptr=&rgb8; // error: incompatible pointer type ! RGB8ConstPtr rgb8_const_ptr_err=rgb8ptr; // const pointer from non-regular pointer ignore_unused_variable_warning(rgb8_const_ptr_err); // dereferencing pointers to obtain references ! rgb8_ref rgb8ref_2=*rgb8ptr; ignore_unused_variable_warning(rgb8ref_2); ! assert(rgb8ref_2==rgb8); ! // RGB8Ref rgb8ref_2_err=*rgb8_const_planar_ptr; // error: non-const reference from const pointer ! ! rgb8_planar_ref rgb8planarref_3=*rgb8_pptr; // planar reference from planar pointer ! assert(rgb8planarref_3==rgb8); ! // RGB8Ref rgb8ref_3=*rgb8_planar_ptr; // error: non-planar reference from planar pointer ! const rgb8_pixel crgb8=rgb8; ! *rgb8_pptr=rgb8; ! *rgb8_pptr=crgb8; ! byte_advance(rgb8_pptr,3); ! byte_advance(rgb8_pptr,-3); // CHANNEL OPERATIONS ! ! // on values ! bgr8.b=3; ! rgb8.g=bgr8.b; rgb8.v<0>(); bgr8.v<0>(); ! assert(rgb8.g==3); ! // on references ! rgb8ref_1.g=bgr8_ref.r; ! bgr8_ref.b=3; ! // rgb8_const_ref.b=3; // error: modifying channel of const reference // OPERATOR== ! // rgb8==cmyk8; // error: incompatible color spaces ! rgb8==bgr8; // classes with different channel ordering are OK to compare ! rgb8_planar_ref rf=*rgb8_pptr; // COLOR CONVERSION ! color_convert(rgb16, gray8); ! // typedef iterator_traits<iterator_traits<rgb8_planar_ptr>::reference*>::color_space_type cst; ! // BOOST_STATIC_ASSERT((boost::is_same<rgb_tag,cst>::value)); ! color_convert(rgb16, rf); ! color_convert(rgb16, rf=*rgb8_pptr); ! color_convert(*rgb8_const_planar_ptr, gray8_ref); ! color_convert(rgb8ref, gray8_ref); ! // color_convert(rgb8ref, *rgb8_const_ptr); // error: Destination is const // CHANNEL-LEVEL OPERATIONS ! bgr8*=2; ! bgr8=rf*2; ! rgb8_pixel rgb8_2=bgr8/3; ! rf=bgr8*2; // MATH OPERATIONS ! rgba8*=3; ! rgba8=rgba8+rgba8_pixel(1,2,3,4); ! rgb8+=bgr8_pixel(1,2,3); ! rgb8=bgr8+rgb8; ! unsigned char* xxx=0; ! xxx+=2; ! rgb8_pptr.p.v<0>()=xxx; ! set_channels(rgb8_pptr.p,xxx); } --- 37,289 ---- template <typename T> struct clear_fn { ! void operator()(T& v) { v=0; } }; template <typename T> inline void ignore_unused_variable_warning(const T&){} void test_pixel() { ! gil_function_requires<MutableChannelConcept<bits8> >(); ! gil_function_requires<MutableChannelConcept<bits8&> >(); ! gil_function_requires<ChannelConcept<const bits8&> >(); ! gil_function_requires<MutableChannelConcept<bits16> >(); ! gil_function_requires<MutableChannelConcept<bits32> >(); ! gil_function_requires<MutablePixelConcept<bgr32_pixel> >(); ! gil_function_requires<MutablePixelConcept<rgb16_planar_ref> >(); ! gil_function_requires<PixelConcept<rgb8c_pixel> >(); ! gil_function_requires<PixelConvertibleConcept<rgb8_pixel,cmyk16_pixel> >(); ! gil_function_requires<PixelConvertibleConcept<rgb8_pixel,cmyk16_planar_ref> >(); ! gil_function_requires<PixelConvertibleConcept<gray8c_pixel,cmyk16_planar_ref> >(); ! BOOST_STATIC_ASSERT(rgb_tag::num_channels==3); ! BOOST_STATIC_ASSERT(bgr_tag::num_channels==3); ! // dimensions to explore ! // ! // values, references, pointers ! // color spaces (rgb,cmyk,gray) ! // channel ordering (bgr vs rgb) ! // planar vs interleaved // PIXEL VALUES // Default constructors and construct with values ! rgb8_pixel rgb8(10,100,200); ! bgr8_pixel bgr8(10,100,200); ! rgb32_pixel rgb32(0.1f, 0.5f, 0.7f); ! per_channel_set_op(std::bind2nd(std::plus<bits8>(),3),rgb8,rgb8); ! cmyk8_pixel cmyk8; ! rgba8_pixel rgba8; ! gray8_pixel gray8(11); ! rgb16_pixel rgb16; ! cmyk16_pixel cmyk16; ! rgba16_pixel rgba16; ! bits8 mv=max_channel(rgb8); ! mv=min_channel(rgb8); // Copy construct from compatible pixel ! rgb8_pixel rgb8_1(rgb8); ! cmyk16_pixel cmyk16_1(cmyk16); ! bgr8_pixel bgr8_1(rgb8); // with different channel ordering ! assert(bgr8_1==rgb8); ! // RGB8 fail1(cmyk8); // error: different color space ! // RGB8 fail2(rgb16); // error: different channel depth // Assignment to compatible pixel ! rgb8_1=rgb8; ! bgr8_1=rgb8_pixel(1,2,3); ! rgb8_1=bgr8_1; ! assert(rgb8_1.r==1); ! ! // rgb8=rgba8; // error different color space ! // rgb8=rgb16; // error different channel depth ! // rgb8_pixel result=bgr8_1+rgb8; // PIXEL REFERENCES ! // rgb8ref rgb8ref_err; // error: references have no default constructors // Assign/copy-construct reference from value ! rgb8_ref rgb8ref(rgb8); ! rgb8_planar_ref rgb8planarref(rgb8); ! rgb8planarref=rgb8_pixel(11,22,32); ! unsigned char rr=rgb8planarref[2]; ignore_unused_variable_warning(rr); ! assert(rgb8planarref[2]==32); ! assert(rgb8[2]==32); ! rgb32_pixel r32=rgb32_pixel(1,2,3); ! rgb32_planar_ref rgb32pr(r32); ! bits32 xty=rgb32pr[2]; ignore_unused_variable_warning(xty); ! assert(xty==3); ! assert(r32[2]==3); ! const rgb8_pixel& CR(rgb8); ! rgb8ref=CR; ! rgb8c_pixel rgb8c(1,2,3); ! //BOOST_STATIC_ASSERT((boost::is_same<bits8,REMOVE_CONST_AND_REFERENCE(const bits8&)>::value)); ! rgb8c_planar_ref rgb8c_ref=rgb8c; ! // rgb8=rgb8c_pixel(1,2,3); ! assert(rgb8ref.b==rgb8.b); ! assert(rgb8==rgb8ref); ! assert(rgb8planarref==rgb8ref); ! boost::add_const<iterator_traits<rgb8_ptr>::reference>::type rgb8_const_ref(rgb8); ! // rgb8_const_ref=rgb8_pixel(3,5,7); // error: setting value of const reference ! rgb8planarref.b=33; ! assert(rgb8_const_ref.b==33); ! bgr8_ref bgr8_ref(bgr8); ! gray8_ref gray8_ref(gray8); // copy-construct reference from reference ! rgb8_ref rgb8ref_1(rgb8ref); ! rgb8_planar_ref rgb8planarref_1(rgb8ref); // planar from non-planar reference is ok ! // rgb8_ref rgb8ref_1_err(rgb8planarref); // error: non-planar from planar reference ! cmyk8_planar_ref cpr(cmyk8); ! int a=5, b=6; ! const int& cr=a; ! const rgb8_planar_ref cr_(rgb8); ! int& nr=b; ! rgb8_planar_ref nr_(rgb8); ! const int& cr2(cr); ignore_unused_variable_warning(cr2); ! const rgb8_planar_ref cr2_(cr_); ! const int& cr3(nr); ignore_unused_variable_warning(cr3); ! const rgb8_planar_ref cr3_(nr_); ! // SHOULD NOT COMPILE BUT IT DOES!! Bizzare because reference class' copy constructor takes argument by non-const reference, so it should not match "const rgb8_planar_ref" ! // int& nr2(cr); ! rgb8_planar_ref _nr2(cr_); // ERROR: reference from const reference ! int& nr3(nr); ignore_unused_variable_warning(nr3); ! rgb8_planar_ref _nr3(nr_); ! // cr=nr; ! // cr_=nr_; // ERROR: assigning to const reference ! nr=cr; ! nr_=cr_; ! // cr=cr; ! // cr_=cr_; ! nr=nr; ! nr_=nr_; // Assign value or reference to reference ! rgb8ref=rgb8_pixel(3,5,7); ! rgb8ref=rgb8ref_1; ! // rgb8_const_ref=rgb8ref; // error: const from non-const ! rgb8ref=rgb8_const_ref; // non-const from const // PIXEL POINTERS ! // typedef const iterator_traits<rgb8_ptr>::pointer RGB8ConstPtr; ! typedef const rgb8_ptr RGB8ConstPtr; ! typedef const rgb8_planar_ptr RGB8ConstPlanarPtr; ! // typedef const iterator_traits<rgb8_planar_ptr>::pointer RGB8ConstPlanarPtr; // constructing from values, references and other pointers ! RGB8ConstPtr rgb8_const_ptr=NULL; ignore_unused_variable_warning(rgb8_const_ptr); ! rgb8_ptr rgb8ptr=&rgb8; ! rgb8=bgr8_pixel(30,20,10); ! rgb8_planar_ptr rgb8_pptr=&rgb8; ! ++rgb8_pptr; ! rgb8_pptr--; ! rgb8_pptr[0]=rgb8; ! RGB8ConstPlanarPtr rgb8_const_planar_ptr=&rgb8; ! // rgb8_const_planar_ptr=&rgb16p; // error: incompatible bit depth ! // iterator_traits<CMYK8>::pointer cmyk8_ptr=&rgb8; // error: incompatible pointer type ! RGB8ConstPtr rgb8_const_ptr_err=rgb8ptr; // const pointer from non-regular pointer ignore_unused_variable_warning(rgb8_const_ptr_err); // dereferencing pointers to obtain references ! rgb8_ref rgb8ref_2=*rgb8ptr; ignore_unused_variable_warning(rgb8ref_2); ! assert(rgb8ref_2==rgb8); ! // RGB8Ref rgb8ref_2_err=*rgb8_const_planar_ptr; // error: non-const reference from const pointer ! ! rgb8_planar_ref rgb8planarref_3=*rgb8_pptr; // planar reference from planar pointer ! assert(rgb8planarref_3==rgb8); ! // RGB8Ref rgb8ref_3=*rgb8_planar_ptr; // error: non-planar reference from planar pointer ! const rgb8_pixel crgb8=rgb8; ! *rgb8_pptr=rgb8; ! *rgb8_pptr=crgb8; ! byte_advance(rgb8_pptr,3); ! byte_advance(rgb8_pptr,-3); // CHANNEL OPERATIONS ! ! // on values ! bgr8.b=3; ! rgb8.g=bgr8.b; rgb8.v<0>(); bgr8.v<0>(); ! assert(rgb8.g==3); ! // on references ! rgb8ref_1.g=bgr8_ref.r; ! bgr8_ref.b=3; ! // rgb8_const_ref.b=3; // error: modifying channel of const reference // OPERATOR== ! // rgb8==cmyk8; // error: incompatible color spaces ! rgb8==bgr8; // classes with different channel ordering are OK to compare ! rgb8_planar_ref rf=*rgb8_pptr; // COLOR CONVERSION ! color_convert(rgb16, gray8); ! // typedef iterator_traits<iterator_traits<rgb8_planar_ptr>::reference*>::color_space_type cst; ! // BOOST_STATIC_ASSERT((boost::is_same<rgb_tag,cst>::value)); ! color_convert(rgb16, rf); ! color_convert(rgb16, rf=*rgb8_pptr); ! color_convert(*rgb8_const_planar_ptr, gray8_ref); ! color_convert(rgb8ref, gray8_ref); ! // color_convert(rgb8ref, *rgb8_const_ptr); // error: Destination is const // CHANNEL-LEVEL OPERATIONS ! bgr8*=2; ! bgr8=rf*2; ! rgb8_pixel rgb8_2=bgr8/3; ! rf=bgr8*2; // MATH OPERATIONS ! rgba8*=3; ! rgba8=rgba8+rgba8_pixel(1,2,3,4); ! rgb8+=bgr8_pixel(1,2,3); ! rgb8=bgr8+rgb8; ! unsigned char* xxx=0; ! xxx+=2; ! rgb8_pptr.p.v<0>()=xxx; ! set_channels(rgb8_pptr.p,xxx); } Index: pixel_iterator.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/pixel_iterator.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pixel_iterator.cpp 24 Jan 2006 19:38:51 -0000 1.2 --- pixel_iterator.cpp 3 Feb 2006 18:33:39 -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) */ // image_test.cpp : Defines the entry point for the console application. --- 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) */ // image_test.cpp : Defines the entry point for the console application. *************** *** 29,160 **** template <typename T> inline void ignore_unused_variable_warning(const T&){} void test_pixel_iterator() { ! boost::function_requires<Point2DConcept<point2<int> > >(); ! boost::function_requires<MutablePixelIteratorConcept<bgr8_ptr> >(); ! boost::function_requires<MutablePixelIteratorConcept<cmyk8_planar_ptr> >(); ! boost::function_requires<PixelIteratorConcept<rgb8c_planar_step_ptr> >(); ! boost::function_requires<MutablePixelStepIteratorConcept<rgb8_step_ptr> >(); ! boost::function_requires<MutablePixelLocatorConcept<rgb8_step_loc> >(); ! boost::function_requires<PixelLocatorConcept<rgb8c_planar_step_loc> >(); ! boost::function_requires<MutablePixelStepIteratorConcept<cmyk8_planar_step_ptr> >(); ! boost::function_requires<PixelStepIteratorConcept<gray8c_step_ptr> >(); ! rgb8_pixel rgb8(1,2,3); ! rgb8_ptr ptr1=&rgb8; ! byte_advance(ptr1, 3); ! const rgb8_ptr ptr2=byte_advanced(ptr1,10); ! byte_distance(ptr1,ptr2); ! const rgb8_pixel& ref=byte_advanced_ref(ptr1,10); ignore_unused_variable_warning(ref); ! rgb8_planar_ptr planarPtr1(&rgb8); ! rgb8_planar_ptr planarPtr2(&rgb8); ! byte_advance(planarPtr1,10); ! byte_distance(planarPtr1,planarPtr2); ! rgb8_planar_ptr planarPtr3=byte_advanced(planarPtr1,10); ! pixel<bits8&,rgb_tag> pxl=*(planarPtr1+5); ! // rgb8_pixel pv=pxl; ! // rgb8_pixel pv=*(planarPtr1+5); ! rgb8_pixel pv=planarPtr1[5]; ! assert(*(planarPtr1+5)==planarPtr1[5]); ! rgb8_planar_ref planarRef=byte_advanced_ref(planarPtr1,10); ! rgb8_step_ptr stepIt(&rgb8,5); ! stepIt++; ! rgb8_step_ptr stepIt2=stepIt+10; ! stepIt2=stepIt; ! ! rgb8_step_ptr stepIt3(&rgb8,5); ! rgb8_pixel& ref1=stepIt3[5]; ! // bool v=boost::is_POD<iterator_traits<pixel_step_iterator<rgb8_ptr> >::value_type>::value; ! // v=boost::is_POD<rgb8_pixel>::value; ! // v=boost::is_POD<int>::value; ! rgb8_step_ptr rgb8StepIt(ptr1, 10); ! rgb8_step_ptr rgb8StepIt2=rgb8StepIt; ! rgb8StepIt=rgb8StepIt2; ! ++rgb8StepIt; ! rgb8_ref reff=*rgb8StepIt; ignore_unused_variable_warning(reff); ! rgb8StepIt+=10; ! ptrdiff_t dst=rgb8StepIt2-rgb8StepIt; ignore_unused_variable_warning(dst); ! rgb8_pixel val1=ref1; ! rgb8_ptr ptr=&ref1; ! rgb8_pixel& val21=stepIt3[5]; ! rgb8_pixel val22=val21; ! rgb8_pixel val2=stepIt3[5]; ! rgb8_ptr ptr11=&(stepIt3[5]); ignore_unused_variable_warning(ptr11); ! rgb8_ptr ptr3=&*(stepIt3+5); ignore_unused_variable_warning(ptr3); ! rgb8_step_ptr stepIt4(ptr,5); ! ++stepIt4; ! rgb8_step_ptr stepIt5; ! if (stepIt4==stepIt5) { ! int st=0;ignore_unused_variable_warning(st); } ! pixel_image_iterator<rgb8_loc> pix_img_it(rgb8_loc(ptr, 20), 5); ! ++pix_img_it; ! pix_img_it+=10; ! rgb8_pixel& refr=*pix_img_it; ! refr=rgb8_pixel(1,2,3); ! *pix_img_it=rgb8_pixel(1,2,3); ! pix_img_it[3]=rgb8_pixel(1,2,3); ! *(pix_img_it+3)=rgb8_pixel(1,2,3); ! pixel_image_iterator<rgb8c_loc> pix_img_it_c(rgb8c_loc(rgb8c_ptr(ptr),20), 5); ! ++pix_img_it_c; ! pix_img_it_c+=10; ! // *pix_img_it_c=rgb8_pixel(1,2,3); // error: assigning though const iterator ! typedef pixel_image_iterator<rgb8_loc>::difference_type dif_t; ! dif_t dt=0; ! ptrdiff_t tdt=dt; ignore_unused_variable_warning(tdt); ! // pixel_step_iterator<rgb8_pixel> stepIt3Err=stepIt+10; // error: non-const from const iterator ! pixel_xy_locator<rgb8_step_ptr> xy_locator(ptr,27); ! xy_locator.x()++; ! // pixel_step_iterator<rgb8_pixel>& yit=xy_locator.y(); ! xy_locator.y()++; ! xy_locator+=point2<int>(3,4); ! //*xy_locator=(xy_locator(-1,0)+xy_locator(0,1))/2; ! rgb8_pixel& rf=*xy_locator; ignore_unused_variable_warning(rf); ! typedef COLOR_CONVERT_ITERATOR(rgb8_ptr, rgb8_pixel) CCV; ! CCV ccv_it; ! make_step_iterator(ccv_it, 3); ! make_step_iterator(rgb8_ptr(),3); ! make_step_iterator(rgb8_planar_ptr(),3); ! make_step_iterator(rgb8_planar_step_ptr(),3); ! // xy_locator.y()++; // TEST dynamic_step_type ! BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_step_ptr,std::iterator_traits<cmyk16_step_ptr>::dynamic_step_type>::value )); ! BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_planar_step_ptr,std::iterator_traits<cmyk16_planar_ptr>::dynamic_step_type>::value )); ! BOOST_STATIC_ASSERT(( boost::is_same<dereference_iterator_adaptor< rgb8_step_ptr ,color_convert_deref_fn< rgb8_pixel > > ,std::iterator_traits< CCV >::dynamic_step_type>::value )); // TEST has_dynamic_step ! BOOST_STATIC_ASSERT(has_dynamic_step< cmyk16_step_ptr >::value); ! BOOST_STATIC_ASSERT(has_dynamic_step< cmyk16_planar_step_ptr >::value); ! BOOST_STATIC_ASSERT(!has_dynamic_step< cmyk16_planar_ptr >::value); ! BOOST_STATIC_ASSERT(!has_dynamic_step< COLOR_CONVERT_ITERATOR(rgb8_ptr, rgb8_pixel) >::value); ! BOOST_STATIC_ASSERT( has_dynamic_step< COLOR_CONVERT_ITERATOR(rgb8_step_ptr, rgb8_pixel) >::value); } --- 29,160 ---- template <typename T> inline void ignore_unused_variable_warning(const T&){} void test_pixel_iterator() { ! boost::function_requires<Point2DConcept<point2<int> > >(); ! boost::function_requires<MutablePixelIteratorConcept<bgr8_ptr> >(); ! boost::function_requires<MutablePixelIteratorConcept<cmyk8_planar_ptr> >(); ! boost::function_requires<PixelIteratorConcept<rgb8c_planar_step_ptr> >(); ! boost::function_requires<MutablePixelStepIteratorConcept<rgb8_step_ptr> >(); ! boost::function_requires<MutablePixelLocatorConcept<rgb8_step_loc> >(); ! boost::function_requires<PixelLocatorConcept<rgb8c_planar_step_loc> >(); ! boost::function_requires<MutablePixelStepIteratorConcept<cmyk8_planar_step_ptr> >(); ! boost::function_requires<PixelStepIteratorConcept<gray8c_step_ptr> >(); ! rgb8_pixel rgb8(1,2,3); ! rgb8_ptr ptr1=&rgb8; ! byte_advance(ptr1, 3); ! const rgb8_ptr ptr2=byte_advanced(ptr1,10); ! byte_distance(ptr1,ptr2); ! const rgb8_pixel& ref=byte_advanced_ref(ptr1,10); ignore_unused_variable_warning(ref); ! rgb8_planar_ptr planarPtr1(&rgb8); ! rgb8_planar_ptr planarPtr2(&rgb8); ! byte_advance(planarPtr1,10); ! byte_distance(planarPtr1,planarPtr2); ! rgb8_planar_ptr planarPtr3=byte_advanced(planarPtr1,10); ! pixel<bits8&,rgb_tag> pxl=*(planarPtr1+5); ! // rgb8_pixel pv=pxl; ! // rgb8_pixel pv=*(planarPtr1+5); ! rgb8_pixel pv=planarPtr1[5]; ! assert(*(planarPtr1+5)==planarPtr1[5]); ! rgb8_planar_ref planarRef=byte_advanced_ref(planarPtr1,10); ! rgb8_step_ptr stepIt(&rgb8,5); ! stepIt++; ! rgb8_step_ptr stepIt2=stepIt+10; ! stepIt2=stepIt; ! ! rgb8_step_ptr stepIt3(&rgb8,5); ! rgb8_pixel& ref1=stepIt3[5]; ! // bool v=boost::is_POD<iterator_traits<pixel_step_iterator<rgb8_ptr> >::value_type>::value; ! // v=boost::is_POD<rgb8_pixel>::value; ! // v=boost::is_POD<int>::value; ! rgb8_step_ptr rgb8StepIt(ptr1, 10); ! rgb8_step_ptr rgb8StepIt2=rgb8StepIt; ! rgb8StepIt=rgb8StepIt2; ! ++rgb8StepIt; ! rgb8_ref reff=*rgb8StepIt; ignore_unused_variable_warning(reff); ! rgb8StepIt+=10; ! ptrdiff_t dst=rgb8StepIt2-rgb8StepIt; ignore_unused_variable_warning(dst); ! rgb8_pixel val1=ref1; ! rgb8_ptr ptr=&ref1; ! rgb8_pixel& val21=stepIt3[5]; ! rgb8_pixel val22=val21; ! rgb8_pixel val2=stepIt3[5]; ! rgb8_ptr ptr11=&(stepIt3[5]); ignore_unused_variable_warning(ptr11); ! rgb8_ptr ptr3=&*(stepIt3+5); ignore_unused_variable_warning(ptr3); ! rgb8_step_ptr stepIt4(ptr,5); ! ++stepIt4; ! rgb8_step_ptr stepIt5; ! if (stepIt4==stepIt5) { ! int st=0;ignore_unused_variable_warning(st); } ! pixel_image_iterator<rgb8_loc> pix_img_it(rgb8_loc(ptr, 20), 5); ! ++pix_img_it; ! pix_img_it+=10; ! rgb8_pixel& refr=*pix_img_it; ! refr=rgb8_pixel(1,2,3); ! *pix_img_it=rgb8_pixel(1,2,3); ! pix_img_it[3]=rgb8_pixel(1,2,3); ! *(pix_img_it+3)=rgb8_pixel(1,2,3); ! pixel_image_iterator<rgb8c_loc> pix_img_it_c(rgb8c_loc(rgb8c_ptr(ptr),20), 5); ! ++pix_img_it_c; ! pix_img_it_c+=10; ! // *pix_img_it_c=rgb8_pixel(1,2,3); // error: assigning though const iterator ! typedef pixel_image_iterator<rgb8_loc>::difference_type dif_t; ! dif_t dt=0; ! ptrdiff_t tdt=dt; ignore_unused_variable_warning(tdt); ! // pixel_step_iterator<rgb8_pixel> stepIt3Err=stepIt+10; // error: non-const from const iterator ! pixel_xy_locator<rgb8_step_ptr> xy_locator(ptr,27); ! xy_locator.x()++; ! // pixel_step_iterator<rgb8_pixel>& yit=xy_locator.y(); ! xy_locator.y()++; ! xy_locator+=point2<int>(3,4); ! //*xy_locator=(xy_locator(-1,0)+xy_locator(0,1))/2; ! rgb8_pixel& rf=*xy_locator; ignore_unused_variable_warning(rf); ! typedef COLOR_CONVERT_ITERATOR(rgb8_ptr, rgb8_pixel) CCV; ! CCV ccv_it; ! make_step_iterator(ccv_it, 3); ! make_step_iterator(rgb8_ptr(),3); ! make_step_iterator(rgb8_planar_ptr(),3); ! make_step_iterator(rgb8_planar_step_ptr(),3); ! // xy_locator.y()++; // TEST dynamic_step_type ! BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_step_ptr,std::iterator_traits<cmyk16_step_ptr>::dynamic_step_type>::value )); ! BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_planar_step_ptr,std::iterator_traits<cmyk16_planar_ptr>::dynamic_step_type>::value )); ! BOOST_STATIC_ASSERT(( boost::is_same<dereference_iterator_adaptor< rgb8_step_ptr ,color_convert_deref_fn< rgb8_pixel > > ,std::iterator_traits< CCV >::dynamic_step_type>::value )); // TEST has_dynamic_step ! BOOST_STATIC_ASSERT(has_dynamic_step< cmyk16_step_ptr >::value); ! BOOST_STATIC_ASSERT(has_dynamic_step< cmyk16_planar_step_ptr >::value); ! BOOST_STATIC_ASSERT(!has_dynamic_step< cmyk16_planar_ptr >::value); ! BOOST_STATIC_ASSERT(!has_dynamic_step< COLOR_CONVERT_ITERATOR(rgb8_ptr, rgb8_pixel) >::value); ! BOOST_STATIC_ASSERT( has_dynamic_step< COLOR_CONVERT_ITERATOR(rgb8_step_ptr, rgb8_pixel) >::value); } Index: image.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil/image.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** image.cpp 6 Jan 2006 18:03:03 -0000 1.1 --- image.cpp 3 Feb 2006 18:33:39 -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) */ // image_test.cpp : Defines the entry point for the console application. --- 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) */ // image_test.cpp : Defines the entry point for the console application. *************** *** 39,45 **** using namespace boost; ! const string in_dir="C:\\test\\imgtest\\"; // directory of source images ! const string out_dir=in_dir+"scratch\\"; // directory where to write output ! const string ref_dir=in_dir+"reference\\"; // reference directory to compare written with actual output // Enable checking. --- 39,45 ---- using namespace boost; ! const string in_dir="C:\\test\\imgtest\\"; // directory of source images ! const string out_dir=in_dir+"scratch\\"; // directory where to write output ! const string ref_dir=in_dir+"reference\\"; // reference directory to compare written with actual output // Enable checking. *************** *** 48,57 **** template <typename IMG_VIEW> void check_image(const IMG_VIEW& img_view, const string& imgName) { ! save_view(img_view,out_dir+imgName); ! rgb8_image img1, img2; ! load_image(img1, out_dir+imgName); #ifdef PERFORM_CHECK ! load_image(img2, ref_dir+imgName); ! io_error_if(img1!=img2,"image mismatch"); #endif } --- 48,57 ---- template <typename IMG_VIEW> void check_image(const IMG_VIEW& img_view, const string& imgName) { ! save_view(img_view,out_dir+imgName); ! rgb8_image img1, img2; ! load_image(img1, out_dir+imgName); #ifdef PERFORM_CHECK ! load_image(img2, ref_dir+imgName); ! io_error_if(img1!=img2,"image mismatch"); #endif } *************** *** 60,112 **** template <typename IMG> void test_image_basic(const std::string& prefix) { ! typedef typename IMG::view_type VIEW; ! // make a 20x20 image ! IMG img(typename VIEW::point_type(20,20)); ! const VIEW& img_view=view(img); ! // fill it with red ! rgb8_pixel red8(255,0,0), green8(0,255,0), blue8(0,0,255), white8(255,255,255); ! typename VIEW::value_type red,green,blue,white; ! color_convert(red8,red); ! red=color_converter<typename IMG::view_type::value_type>()(red8); ! color_convert(green8,green); ! color_convert(blue8,blue); ! color_convert(white8,white); ! fill(img_view.begin(),img_view.end(),red); ! // pointer to first pixel of second row typename VIEW::reference rt=img_view.at(0,0)[img_view.width()]; ! typename VIEW::x_iterator ptr=&rt; ignore_unused_variable_warning(ptr); typename VIEW::reference rt2=*(img_view.at(0,0)+img_view.width()); ! typename VIEW::x_iterator ptr2=&rt2; ignore_unused_variable_warning(ptr2); ! assert(ptr==ptr2); ! assert(img_view.x_at(0,0)+10==10+img_view.x_at(0,0)); ! // draw a blue line along the diagonal ! typename VIEW::xy_locator loc=img_view.xy_at(0,img_view.height()-1); ! for (int y=0; y<img_view.height(); ++y) { ! *loc=blue; ! ++loc.x(); ! loc.y()--; ! } ! // draw a green dotted line along the main diagonal with step of 3 ! loc=img_view.xy_at(img_view.width()-1,img_view.height()-1); ! while (loc.x()>=img_view.x_at(0,0)) { ! *loc=green; ! loc-=typename VIEW::point_type(3,3); ! } ! // Clone and make every red pixel white ! IMG imgWhite(img); ! for (typename VIEW::iterator it=view(imgWhite).end(); (it-1)!=view(imgWhite).begin(); --it) { ! if (*(it-1)==red) ! *(it-1)=white; ! } ! check_image(img_view,prefix+"red_x.jpg"); ! check_image(view(imgWhite),prefix+"white_x.jpg"); } --- 60,112 ---- template <typename IMG> void test_image_basic(const std::string& prefix) { ! typedef typename IMG::view_type VIEW; ! // make a 20x20 image ! IMG img(typename VIEW::point_type(20,20)); ! const VIEW& img_view=view(img); ! // fill it with red ! rgb8_pixel red8(255,0,0), green8(0,255,0), blue8(0,0,255), white8(255,255,255); ! typename VIEW::value_type red,green,blue,white; ! color_convert(red8,red); ! red=color_converter<typename IMG::view_type::value_type>()(red8); ! color_convert(green8,green); ! color_convert(blue8,blue); ! color_convert(white8,white); ! fill(img_view.begin(),img_view.end(),red); ! // pointer to first pixel of second row typename VIEW::reference rt=img_view.at(0,0)[img_view.width()]; ! typename VIEW::x_iterator ptr=&rt; ignore_unused_variable_warning(ptr); typename VIEW::reference rt2=*(img_view.at(0,0)+img_view.width()); ! typename VIEW::x_iterator ptr2=&rt2; ignore_unused_variable_warning(ptr2); ! assert(ptr==ptr2); ! assert(img_view.x_at(0,0)+10==10+img_view.x_at(0,0)); ! // draw a blue line along the diagonal ! typename VIEW::xy_locator loc=img_view.xy_at(0,img_view.height()-1); ! for (int y=0; y<img_view.height(); ++y) { ! *loc=blue; ! ++loc.x(); ! loc.y()--; ! } ! // draw a green dotted line along the main diagonal with step of 3 ! loc=img_view.xy_at(img_view.width()-1,img_view.height()-1); ! while (loc.x()>=img_view.x_at(0,0)) { ! *loc=green; ! loc-=typename VIEW::point_type(3,3); ! } ! // Clone and make every red pixel white ! IMG imgWhite(img); ! for (typename VIEW::iterator it=view(imgWhite).end(); (it-1)!=view(imgWhite).begin(); --it) { ! if (*(it-1)==red) ! *(it-1)=white; ! } ! check_image(img_view,prefix+"red_x.jpg"); ! check_image(view(imgWhite),prefix+"white_x.jpg"); } *************** *** 116,127 **** template <bool ON_REAL_DATA> struct test_nth_channel_view { ! template <typename VIEW> static void apply(const VIEW& img_view, const string& prefix) { ! check_image(nth_channel_view(img_view,0),prefix+"0th_channel.jpg"); ! } }; template <> struct test_nth_channel_view<false> { ! template <typename VIEW> static void apply(const VIEW& img_view, const string& prefix) {} }; --- 116,127 ---- template <bool ON_REAL_DATA> struct test_nth_channel_view { ! template <typename VIEW> static void apply(const VIEW& img_view, const string& prefix) { ! check_image(nth_channel_view(img_view,0),prefix+"0th_channel.jpg"); ! } }; template <> struct test_nth_channel_view<false> { ! template <typename VIEW> static void apply(const VIEW& img_view, const string& prefix) {} }; *************** *** 129,187 **** template <typename VIEW> void test_image_views(const VIEW& img_view, const string& prefix) { ! 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"); ! check_image(rotated180_view(img_view),prefix+"rot180.jpg"); ! check_image(rotated90cw_view(img_view),prefix+"90cw.jpg"); ! check_image(rotated90ccw_view(img_view),prefix+"90ccw.jpg"); ! check_image(flipud_view(img_view),prefix+"flipped_ud.jpg"); ! check_image(fliplr_view(img_view),prefix+"flipped_lr.jpg"); ! check_image(subsampled_view(img_view,typename VIEW::point_type(2,1)),prefix+"subsampled.jpg"); ! test_nth_channel_view<std::iterator_traits<typename VIEW::x_iterator>::pixel_data_is_real>::apply(img_view,prefix+"0th_channel.jpg"); ! // some iterator math ! ptrdiff_t dst=(img_view.end()-(img_view.begin()+4500))+4500; ignore_unused_variable_warning(dst); ! ptrdiff_t dst2=img_view.end()-img_view.begin(); ignore_unused_variable_warning(dst2); ! ptrdiff_t sz=img_view.size(); ignore_unused_variable_warning(sz); ! //assert(dst==dst2);//does not work for empty images ! assert(sz==dst2); ! // histogram ! test_histogram(img_view); } template <typename GRAY_VIEW, typename R> void gray_image_hist(const GRAY_VIEW& img_view, R& hist) { ! //for_each_pixel(img_view,++lambda::var(hist)[lambda::_1]); ! for (typename GRAY_VIEW::iterator it=img_view.begin(); it!=img_view.end(); ++it) ! ++hist[*it]; } template <typename V, typename R> void get_hist(const V& img_view, R& hist) { ! gray_image_hist(color_convert_view<gray8_pixel>(img_view), hist); } template <typename VIEW> void test_histogram(const VIEW& img_view) { ! // std::vector<int> histogram(255,0); ! // get_hist(cropped,histogram.begin()); ! int histogram[255]; ! fill(histogram,histogram+255,0); ! get_hist(img_view,histogram); ! std::cout<<endl; ! std::for_each(histogram, histogram+255, std::cout << lambda::_1 << ' '); } template <typename IMG> void test_image_all(const string& prefix) { ! test_image_basic<IMG>(prefix+"basic_"); ! IMG img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! test_image_views(view(img), prefix+"views_"); } --- 129,187 ---- template <typename VIEW> void test_image_views(const VIEW& img_view, const string& prefix) { ! 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"); ! check_image(rotated180_view(img_view),prefix+"rot180.jpg"); ! check_image(rotated90cw_view(img_view),prefix+"90cw.jpg"); ! check_image(rotated90ccw_view(img_view),prefix+"90ccw.jpg"); ! check_image(flipud_view(img_view),prefix+"flipped_ud.jpg"); ! check_image(fliplr_view(img_view),prefix+"flipped_lr.jpg"); ! check_image(subsampled_view(img_view,typename VIEW::point_type(2,1)),prefix+"subsampled.jpg"); ! test_nth_channel_view<std::iterator_traits<typename VIEW::x_iterator>::pixel_data_is_real>::apply(img_view,prefix+"0th_channel.jpg"); ! // some iterator math ! ptrdiff_t dst=(img_view.end()-(img_view.begin()+4500))+4500; ignore_unused_variable_warning(dst); ! ptrdiff_t dst2=img_view.end()-img_view.begin(); ignore_unused_variable_warning(dst2); ! ptrdiff_t sz=img_view.size(); ignore_unused_variable_warning(sz); ! //assert(dst==dst2);//does not work for empty images ! assert(sz==dst2); ! // histogram ! test_histogram(img_view); } template <typename GRAY_VIEW, typename R> void gray_image_hist(const GRAY_VIEW& img_view, R& hist) { ! //for_each_pixel(img_view,++lambda::var(hist)[lambda::_1]); ! for (typename GRAY_VIEW::iterator it=img_view.begin(); it!=img_view.end(); ++it) ! ++hist[*it]; } template <typename V, typename R> void get_hist(const V& img_view, R& hist) { ! gray_image_hist(color_convert_view<gray8_pixel>(img_view), hist); } template <typename VIEW> void test_histogram(const VIEW& img_view) { ! // std::vector<int> histogram(255,0); ! // get_hist(cropped,histogram.begin()); ! int histogram[255]; ! fill(histogram,histogram+255,0); ! get_hist(img_view,histogram); ! std::cout<<endl; ! std::for_each(histogram, histogram+255, std::cout << lambda::_1 << ' '); } template <typename IMG> void test_image_all(const string& prefix) { ! test_image_basic<IMG>(prefix+"basic_"); ! IMG img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! test_image_views(view(img), prefix+"views_"); } *************** *** 190,202 **** template <typename IMG> void my_const_test(const IMG& img) { ! typename IMG::const_view_type v=const_view(img); ! // v(0,0)=pixel<T,CS>(); } template <typename T, typename CS> void my_test() { ! typename image_type<T,CS,true>::type imgs(100,100); ! typename view_type<T,CS,true>::type v=view(imgs); ! my_const_test(imgs); } --- 190,202 ---- template <typename IMG> void my_const_test(const IMG& img) { ! typename IMG::const_view_type v=const_view(img); ! // v(0,0)=pixel<T,CS>(); } template <typename T, typename CS> void my_test() { ! typename image_type<T,CS,true>::type imgs(100,100); ! typename view_type<T,CS,true>::type v=view(imgs); ! my_const_test(imgs); } *************** *** 211,273 **** void test_resample() { ! gil_function_requires<MutableImageViewConcept<rgb8_view> >(); ! gil_function_requires<ImageViewConcept<cmyk8c_planar_step_view> >(); ! gil_function_requires<MutableImageConcept<rgb8_image> >(); ! rgb8_image img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image transf(rgb8_image::point_type(round(view(img).dimensions()/2))); #ifdef NO_ASL real_matrix ctm=real_matrix::get_rotate(15*3.14/180.0f); ! ctm*=real_matrix::get_translate(real_point(100,50)); ! resample_view(view(transf),const_view(img), ctm); ! save_view(view(transf), out_dir+"transformedBC.jpg"); ! resample_view(view(transf),const_view(img), ctm, kBilinear); ! save_view(view(transf), out_dir+"transformedBL.jpg"); ! resample_view(view(transf),const_view(img), ctm, kNearestNeighbor); ! save_view(view(transf), out_dir+"transformedNN.jpg"); #endif } void test_image() { ! gil_function_requires<ImageConcept<rgb8_image> >(); ! test_resample(); #ifdef NO_ASL ! CreateDirectory(in_dir.c_str(), NULL); ! CreateDirectory(out_dir.c_str(), NULL); ! CreateDirectory(ref_dir.c_str(), NULL); #endif ! // my_test<bits8,rgb_tag>(); ! // rgb8_planar_image im(point_type(10,10)); ! // for_each_pixel(view(im), planarOp()); ! test_image_all<bgr8_image>("bgr8_"); ! test_image_all<rgb8_image>("rgb8_"); ! test_image_all<rgb8_planar_image>("planarrgb8_"); ! test_image_all<gray8_image>("gray8_"); ! rgb8_image img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image img2(view(img).dimensions()); ! copy(img.rbegin(),img.rend(), img2.begin()); ! save_view(view(img2),out_dir+"reversedMonkey.jpg"); ! // rgb8_image imgWithMargin; ! // create_with_margin(view(img), 100, imgWithMargin); ! // save_view(view(imgWithMargin),in_dir+"monkeyWithMargin.jpg"); ! test_image_views(subsampled_view(view(img),point_type(1,2)),"subsampled_"); ! BOOST_STATIC_ASSERT((!std::iterator_traits<COLOR_CONVERT_ITERATOR(rgb8_view::x_iterator,gray8_pixel) >::pixel_data_is_real)); ! test_image_views(color_convert_view<gray8_pixel>(view(img)),"color_converted_"); } --- 211,273 ---- void test_resample() { ! gil_function_requires<MutableImageViewConcept<rgb8_view> >(); ! gil_function_requires<ImageViewConcept<cmyk8c_planar_step_view> >(); ! gil_function_requires<MutableImageConcept<rgb8_image> >(); ! rgb8_image img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image transf(rgb8_image::point_type(round(view(img).dimensions()/2))); #ifdef NO_ASL real_matrix ctm=real_matrix::get_rotate(15*3.14/180.0f); ! ctm*=real_matrix::get_translate(real_point(100,50)); ! resample_view(view(transf),const_view(img), ctm); ! save_view(view(transf), out_dir+"transformedBC.jpg"); ! resample_view(view(transf),const_view(img), ctm, kBilinear); ! save_view(view(transf), out_dir+"transformedBL.jpg"); ! resample_view(view(transf),const_view(img), ctm, kNearestNeighbor); ! save_view(view(transf), out_dir+"transformedNN.jpg"); #endif } void test_image() { ! gil_function_requires<ImageConcept<rgb8_image> >(); ! test_resample(); #ifdef NO_ASL ! CreateDirectory(in_dir.c_str(), NULL); ! CreateDirectory(out_dir.c_str(), NULL); ! CreateDirectory(ref_dir.c_str(), NULL); #endif ! // my_test<bits8,rgb_tag>(); ! // rgb8_planar_image im(point_type(10,10)); ! // for_each_pixel(view(im), planarOp()); ! test_image_all<bgr8_image>("bgr8_"); ! test_image_all<rgb8_image>("rgb8_"); ! test_image_all<rgb8_planar_image>("planarrgb8_"); ! test_image_all<gray8_image>("gray8_"); ! rgb8_image img; ! load_jpeg_image(img,in_dir+"monkey.jpg"); ! rgb8_image img2(view(img).dimensions()); ! copy(img.rbegin(),img.rend(), img2.begin()); ! save_view(view(img2),out_dir+"reversedMonkey.jpg"); ! // rgb8_image imgWithMargin; ! // create_with_margin(view(img), 100, imgWithMargin); ! // save_view(view(imgWithMargin),in_dir+"monkeyWithMargin.jpg"); ! test_image_views(subsampled_view(view(img),point_type(1,2)),"subsampled_"); ! BOOST_STATIC_ASSERT((!std::iterator_traits<COLOR_CONVERT_ITERATOR(rgb8_view::x_iterator,gray8_pixel) >::pixel_data_is_real)); ! test_image_views(color_convert_view<gray8_pixel>(view(img)),"color_converted_"); } *************** *** 281,313 **** typedef typename parent_type::reference reference; typedef typename parent_type::difference_type difference_type; ! typedef C color_space_type; ! myIterator() : _x(0),_y(0){} ! myIterator(int x, int y) : _x(x), _y(y) {} ! template <typename T1,typename C1> myIterator(const myIterator<T1,C1>& ptr) : _x(ptr._x), _y(ptr._y) {} ! /// For some reason operator[] provided by boost::iterator_facade returns a custom class that is convertible to reference ! /// We require our own reference because it is registered in iterator_traits ! reference operator[](difference_type d) const { return dereference(d);} ! ! myIterator(const myIterator& ptr) : parent_type(ptr) {} ! myIterator& operator=(const myIterator& ptr) { this->_x=ptr._x; this->_y=ptr._y; return *this; } ! reference dereference(int dx=0) const { ! return reference(_x+dx+_y); ! } private: ! friend class boost::iterator_core_access; ! int _x,_y; ! void increment() { ++_x; } ! void decrement() { --_x; } ! void advance(ptrdiff_t d) { _x+=d; } ! ptrdiff_t distance_to(const myIterator& it) const { return it._x-_x; } // THIS IS WRONG! ! bool equal(const myIterator& it) const { return _x==p._x && _y==p._y; } }; --- 281,313 ---- typedef typename parent_type::reference reference; typedef typename parent_type::difference_type difference_type; ! typedef C color_space_type; ! myIterator() : _x(0),_y(0){} ! myIterator(int x, int y) : _x(x), _y(y) {} ! template <typename T1,typename C1> myIterator(const myIterator<T1,C1>& ptr) : _x(ptr._x), _y(ptr._y) {} ! /// For some reason operator[] provided by boost::iterator_facade returns a custom class that is convertible to reference ! /// We require our own reference because it is registered in iterator_traits ! reference operator[](difference_type d) const { return dereference(d);} ! ! myIterator(const myIterator& ptr) : parent_type(ptr) {} ! myIterator& operator=(const myIterator& ptr) { this->_x=ptr._x; this->_y=ptr._y; return *this; } ! reference dereference(int dx=0) const { ! return reference(_x+dx+_y); ! } private: ! friend class boost::iterator_core_access; ! int _x,_y; ! void increment() { ++_x; } ! void decrement() { --_x; } ! void advance(ptrdiff_t d) { _x+=d; } ! ptrdiff_t distance_to(const myIterator& it) const { return it._x-_x; } // THIS IS WRONG! ! bool equal(const myIterator& it) const { return _x==p._x && _y==p._y; } }; *************** *** 316,373 **** class myXYLocator { public: ! typedef X_IT x_iterator; ! typedef pixel_step_iterator<X_IT> y_iterator; ! typedef typename std::iterator_traits<X_IT>::value_type value_type; ! typedef typename std::iterator_traits<X_IT>::reference reference; ! typedef typename std::iterator_traits<X_IT>::pointer pointer; ! typedef point2<typename std::iterator_traits<X_IT>::difference_type> difference_type; ! typedef ptrdiff_t cached_location; ! typedef myXYLocator<typename std::iterator_traits<X_IT>::dynamic_step_type> dynamic_step_type; ! typedef myXYLocator<typename std::iterator_traits<X_IT>::const_type> const_type; ! typedef typename std::iterator_traits<x_iterator>::channel_type channel_type; ! typedef typename std::iterator_traits<x_iterator>::color_space_type color_space_type; ! myXYLocator(){} ! myXYLocator(x_iterator x_it, ptrdiff_t row_bytes) : _p(x_it,row_bytes) {} ! template <typename X> myXYLocator(const myXYLocator<X>& pl) : _p(pl._p) {} ! x_iterator& x() { return _p.base(); } ! x_iterator const& x() const { return _p.base(); } ! y_iterator& y() { return _p; } ! y_iterator const& y() const { return _p; } ! ptrdiff_t row_bytes() const { return byte_step(y()); } // row bytes ! ptrdiff_t pix_bytestep() const { return byte_step(x()); } // distance in bytes between adjacent pixels on the same row ! reference operator()(ptrdiff_t dx, ptrdiff_t dy) const { return byte_advanced_ref(x(),byte_offset(dx,dy)); } ! reference operator[](const difference_type& d) const { return byte_advanced_ref(x(),byte_offset(d.x,d.y)); } ! reference operator*() const { return *_p; } ! cached_location cache_location(const difference_type& d) const { return byte_offset(d.x,d.y); } ! cached_location cache_location(ptrdiff_t dx, ptrdiff_t dy) const { return byte_offset(dx,dy); } ! ! reference operator[](const cached_location& loc) const { return byte_advanced_ref(x(),loc); } ! x_iterator x_at(ptrdiff_t dx, ptrdiff_t dy) const { return byte_advanced(x(), byte_offset(dx,dy)); } ! x_iterator x_at(const difference_type& d) const { return byte_advanced(x(), byte_offset(d.x,d.y)); } ! x_iterator row_begin(ptrdiff_t y) const { return byte_advanced(x(), y*row_bytes()); } ! myXYLocator& operator+=(const difference_type& d) { byte_advance(x(),byte_offset(d.x,d.y)); return *this; } ! myXYLocator& operator-=(const difference_type& d) { byte_advance(x(),byte_offset(-d.x,-d.y)); return *this; } ! // add is faster than += because there is no need to construct a point ! myXYLocator& add(ptrdiff_t dx, ptrdiff_t dy) { byte_advance(x(),byte_offset(dx,dy)); return *this; } ! ! myXYLocator operator+(const difference_type& d) const { return myXYLocator(x_at( d.x, d.y), row_bytes()); } ! myXYLocator operator-(const difference_type& d) const { return myXYLocator(x_at(-d.x,-d.y), row_bytes()); } ! bool operator==(const myXYLocator& p) const { return _p==p._p; } ! bool operator!=(const myXYLocator& p) const { return _p!=p._p; } private: ! template <typename X> friend class myXYLocator; ! ptrdiff_t byte_offset(ptrdiff_t x, ptrdiff_t y) const { return y*row_bytes() + x*pix_bytestep(); } ! pixel_step_iterator<X_IT> _p; }; */ --- 316,373 ---- class myXYLocator { public: ! type... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:33:47
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/sources/win Removed Files: ui_core_implementation.cpp Log Message: asl 1.0.13 --- ui_core_implementation.cpp DELETED --- |
From: Foster B. <fos...@us...> - 2006-02-03 18:29:24
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/cmath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5175/adobe/test/cmath Log Message: Directory /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/cmath added to the repository |
Update of /cvsroot/adobe-source/adobe-source/adobe/test/begin/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/test/begin/examples Modified Files: alignment_test.adm alignment_test.eve checkbox_control.adm checkbox_control.eve checkbox_radio_button_suite.adm checkbox_radio_button_suite.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 image_size.adm image_size.eve image_size_auto.eve list_box_emulator.adm list_box_emulator.eve named_function_suite.adm named_function_suite.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 Added Files: big_popup.adm big_popup.eve cycle_test.adm cycle_test.eve empty_containers.adm empty_containers.eve empty_dialog.adm empty_dialog.eve grow.adm grow.eve inequality.adm inequality.eve mini_image_size.adm mini_image_size.eve mini_image_size_2.eve nested_group.adm nested_group.eve optional_panel.adm optional_panel.eve overconstrain.adm overconstrain.eve video.adm video.eve Log Message: asl 1.0.13 Index: checkbox_radio_button_suite.eve =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/begin/examples/checkbox_radio_button_suite.eve,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** checkbox_radio_button_suite.eve 6 Jan 2006 18:35:23 -0000 1.2 --- checkbox_radio_button_suite.eve 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 1,54 **** /* ! 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) */ ! 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/adobe-source/adobe/test/begin/examples/e01_clipping_path.eve,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** e01_clipping_path.eve 6 Jan 2006 18:35:23 -0000 1.2 --- e01_clipping_path.eve 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 1,20 **** /* ! 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) */ ! 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; } --- NEW FILE: nested_group.eve --- /* 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/adobe-source/adobe/test/begin/examples/sort_lines.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sort_lines.eve 6 Jan 2006 18:35:23 -0000 1.3 --- sort_lines.eve 3 Feb 2006 18:20:47 -0000 1.4 *************** *** 1,76 **** /* ! 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. */ ! 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); ! } ! } } --- NEW FILE: grow.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 hello_world { output: done <== "Hello World Completed!"; } --- NEW FILE: mini_image_size.eve --- /* 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 { 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/adobe-source/adobe/test/begin/examples/list_box_emulator.eve,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list_box_emulator.eve 6 Jan 2006 18:35:23 -0000 1.2 --- list_box_emulator.eve 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 1,30 **** /* ! 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) */ ! 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); ! } ! } } --- NEW FILE: mini_image_size_2.eve --- /* 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/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:35:23 -0000 1.2 --- sort_lines.adm 3 Feb 2006 18:20:47 -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/adobe-source/adobe/test/begin/examples/progress_bar_suite.eve,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** progress_bar_suite.eve 6 Jan 2006 18:35:23 -0000 1.2 --- progress_bar_suite.eve 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 1,43 **** /* ! 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) */ ! 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/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:35:23 -0000 1.2 --- checkbox_radio_button_suite.adm 3 Feb 2006 18:20:47 -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/adobe-source/adobe/test/begin/examples/edit_text_suite.eve,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_text_suite.eve 6 Jan 2006 18:35:23 -0000 1.3 --- edit_text_suite.eve 3 Feb 2006 18:20:47 -0000 1.4 *************** *** 1,26 **** /* ! 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) */ ! 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/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:35:23 -0000 1.2 --- progress_bar_suite.adm 3 Feb 2006 18:20:47 -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; } --- NEW FILE: optional_panel.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 image_size { interface: mask : false; show : false; more : true; less : false; output: result <== true; } --- NEW FILE: inequality.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 slider_suite { 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); } } --- NEW FILE: nested_group.adm --- /* 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 : "" ; } --- NEW FILE: big_popup.eve --- /* 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/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:35:23 -0000 1.2 --- alignment_test.adm 3 Feb 2006 18:20:47 -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"; } --- NEW FILE: video.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 slider_suite { 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/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:35:23 -0000 1.2 --- e01_clipping_path.adm 3 Feb 2006 18:20:47 -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/adobe-source/adobe/test/begin/examples/named_function_suite.eve,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** named_function_suite.eve 6 Jan 2006 18:35:23 -0000 1.2 --- named_function_suite.eve 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 1,35 **** /* ! 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) */ ! dialog(name: "Named Function Suite") { ! row(child_horizontal: align_fill) ! { ! column(child_horizontal: align_fill) ! { ! static_text(name: "This dialog is useful for testing the functionality of the named functions. Hit the OK button to see a result set containing values processed by the built-in functions.", wrap: true); ! ! group(name: "Contributing Test") ! { ! edit_number(name: "Value:", bind: @contributing_test, digits: 10); ! } ! ! group(name: "Scale Test") ! { ! edit_number(name: "Celsius:", bind: @celsius, digits: 10); ! edit_number(name: "Fahrenheit:", bind: @fahrenheit, digits: 10); ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true, bind: @result); ! button( items: [ ! {name: "Cancel", action: @cancel}, ! {name: "Reset", action: @reset, modifiers: @opt} ! ]); ! } ! } } --- 1,38 ---- /* ! 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 named_function_suite { ! view dialog(name: "Named Function Suite") ! { ! row(child_horizontal: align_fill) ! { ! column(child_horizontal: align_fill) ! { ! static_text(name: "This dialog is useful for testing the functionality of the named functions. Hit the OK button to see a result set containing values processed by the built-in functions.", wrap: true); ! ! group(name: "Contributing Test") ! { ! edit_number(name: "Value:", bind: @contributing_test, digits: 10); ! } ! ! group(name: "Scale Test") ! { ! edit_number(name: "Celsius:", bind: @celsius, digits: 10); ! edit_number(name: "Fahrenheit:", bind: @fahrenheit, digits: 10); ! } ! } ! column(child_horizontal: align_fill) ! { ! button(name: "OK", default: true, bind: @result); ! button( items: [ ! {name: "Cancel", action: @cancel}, ! {name: "Reset", action: @reset, modifiers: @opt} ! ]); ! } ! } ! } } --- NEW FILE: overconstrain.eve --- /* 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 overconstrain { view dialog(name: "Cycle Test", grow: true) { edit_number(name: "x:", bind: @x); edit_number(name: "y:", bind: @y); } } --- NEW FILE: mini_image_size.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 mini_image_size { input: original_width : 5 * 300; original_height : 7 * 300; interface: constrain : true; width_pixels : original_width <== round(width_pixels); height_pixels : original_height <== round(height_pixels); width_percent; height_percent; logic: relate { width_pixels <== round(width_percent * original_width / 100); width_percent <== width_pixels * 100 / original_width; } relate { height_pixels <== round(height_percent * original_height / 100); height_percent <== height_pixels * 100 / original_height; } when (constrain) relate { width_percent <== height_percent; height_percent <== width_percent; } output: result <== { height: height_pixels, width: width_pixels }; } --- NEW FILE: empty_dialog.eve --- /* 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 empty_containers { view dialog(name: "Empty Dialog") { } } Index: list_box_emulator.adm =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/begin/examples/list_box_emulator.adm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list_box_emulator.adm 6 Jan 2006 18:35:23 -0000 1.2 --- list_box_emulator.adm 3 Feb 2006 18:20:47 -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,19 **** { interface: ! selection : @item_1; output: ! add_params <== { command: @command_add }; ! insert_params <== { command: @command_insert, selection: selection }; ! delete_params <== { command: @command_delete, selection: selection }; invariant: ! can_do_element_operation <== selection != @item_end; } --- 8,19 ---- { interface: ! selection : @item_1; output: ! add_params <== { command: @command_add }; ! insert_params <== { command: @command_insert, selection: selection }; ! delete_params <== { command: @command_delete, selection: selection }; invariant: ! can_do_element_operation <== selection != @item_end; } Index: image_size.eve =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/begin/examples/image_size.eve,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** image_size.eve 6 Jan 2006 18:35:23 -0000 1.4 --- image_size.eve 3 Feb 2006 18:20:47 -0000 1.5 *************** *** 1,112 **** /* ! 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) */ ! dialog(name: "<xstr id='image_size_dialog_title'>Image Size</xstr>", placement: place_column) { ! row() ! { ! column() ! { ! group(name: "<xstr id='image_size_dimensions_group'>Pixel Dimensions</xstr>", horizontal: align_fill) ! { ! row(horizontal: align_fill) ! { ! column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) ! { ! edit_number(name: "<xstr id='image_size_width'>Width:</xstr>", digits: 9, display_disable: true, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_pixels'>pixels</xstr>", bind: @dim_width_pixels, format: "#" }, ! { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @dim_width_percent, format: "#.00" } ]); ! ! edit_number(name: "<xstr id='image_size_height'>Height:</xstr>", digits: 9, display_disable: true, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_pixels'>pixels</xstr>", bind: @dim_height_pixels, format: "#" }, ! { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @dim_height_percent, format: "#.00" } ]); ! } ! ! link(bind: @constrain, count: 2, value_on: true, value_off: false); ! } ! } ! ! group(name: "<xstr id='image_size_size_group'>Document Size:</xstr>", horizontal: align_fill) ! { ! row(horizontal: align_fill) ! { ! column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) ! { ! edit_number(name: "<xstr id='image_size_width'>Width:</xstr>", digits: 9, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @doc_width_percent, format: "#.00" }, ! { name: "<xstr id='image_size_inches'>inches</xstr>", bind: @doc_width_inches, format: "#.000" }, ! { name: "<xstr id='image_size_cm'>cm</xstr>", bind: @doc_width_inches, scale: [2.54, 0.0 ], format: "#.00" }, ! { name: "<xstr id='image_size_mm'>mm</xstr>", bind: @doc_width_inches, scale: [ 25.4, 0.0 ], format: "#.0" }, ! { name: "<xstr id='image_size_points'>points</xstr>", bind: @doc_width_inches, scale: [ 72, 0 ], format: "#.0" }, ! { name: "<xstr id='image_size_picas'>picas</xstr>", bind: @doc_width_inches, scale: [ 6, 0.0 ], format: "#.00" }, ! { name: "<xstr id='image_size_columns'>columns</xstr>", bind: @doc_width_inches, scale: [ 1, 0.0 ], format: "#.000" } ! ]); ! ! edit_number(name: "<xstr id='image_size_height'>Height:</xstr>", digits: 9, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @doc_height_percent, format: "#.00" }, ! { name: "<xstr id='image_size_inches'>inches</xstr>", bind: @doc_height_inches, format: "#.000" }, ! { name: "<xstr id='image_size_cm'>cm</xstr>", bind: @doc_height_inches, scale: [2.54, 0.0 ], format: "#.00" }, ! { name: "<xstr id='image_size_mm'>mm</xstr>", bind: @doc_height_inches, scale: [ 25.4, 0.0 ], format: "#.0" }, ! { name: "<xstr id='image_size_points'>points</xstr>", bind: @doc_height_inches, scale: [ 72, 0 ], format: "#.0" }, ! { name: "<xstr id='image_size_picas'>picas</xstr>", bind: @doc_height_inches, scale: [ 6, 0.0 ], format: "#.00" }, ! { name: "<xstr id='image_size_columns'>columns</xstr>", bind: @doc_height_inches, scale: [ 1, 0.0 ], format: "#.000" } ! ]); ! ! edit_number(name: "<xstr id='image_size_resolution'>Resolution:</xstr>", digits: 9, ! format: "#.000", ! touch: [ @dim_width_pixels, @dim_height_pixels ], ! units: [ { name: "<xstr id='image_size_pixels_per_inch'>pixels/inch</xstr>", bind: @doc_resolution }, ! { name: "<xstr id='image_size_pixels_per_cm'>pixels/cm</xstr>", bind: @doc_resolution, scale: [0.393700787, 0.0 ] } ! ]); ! } ! ! overlay(vertical: align_fill) ! { ! link(bind: @resample, count: 3, value_on: false, value_off: true); ! link(bind: @constrain, count: 2, value_on: true, value_off: false); ! } ! } ! } ! ! column(guide_balance: [@guide_baseline]) ! { ! checkbox(bind: @scale_styles, name: "<xstr id='image_size_scale_styles'>Scale Styles</xstr>"); ! checkbox(bind: @constrain, name: "<xstr id='image_size_constrain'>Constrain Proportions</xstr>"); ! row(spacing: 5) ! { ! checkbox(bind: @resample, name: "<xstr id='image_size_resample'>Resample Image:</xstr>"); ! popup( bind: @resample_method, ! items: [ { name: "<xstr id='image_size_nearest'>Nearest Neighbor</xstr>", value: @nearest }, ! { name: "<xstr id='image_size_bilinear'>Bilinear</xstr>", value: @bilinear }, ! { name: "<xstr id='image_size_bicubic'>Bicubic</xstr>", value: @bicubic }, ! { name: "<xstr id='image_size_bicubic_smoother'>Bicubic Smoother</xstr>", value: @bicubic_smoother }, ! { name: "<xstr id='image_size_bicubic_sharper'>Bicubic Sharper</xstr>", value: @bicubic_sharper } ]); ! } ! } ! } ! ! /* ! ! REVISIT (sparent) : Need to add variables to Eve2 for space_normal, space_small, space_large. ! ! */ ! ! column(child_horizontal: align_fill) ! { ! button(name: "<xstr id='ok'>OK</xstr>", action: @ok, bind: @result, default: true); ! button( items: [ ! { name: "<xstr id='cancel'>Cancel</xstr>", action: @cancel }, ! { name: "<xstr id='reset'>Reset</xstr>", action: @reset, modifiers: @opt } ! ]); ! ! button(name: "<xstr id='image_size_auto'>Auto...</xstr>", action: @dialog, value: "image_size_auto.eve"); ! } ! } } --- 1,106 ---- /* ! 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 image_size { ! view dialog(name: "<xstr id='image_size_dialog_title'>Image Size</xstr>", placement: place_row) ! { ! column() ! { ! group(name: "<xstr id='image_size_dimensions_group'>Pixel Dimensions</xstr>", horizontal: align_fill, placement: place_row) ! { ! column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) ! { ! edit_number(name: "<xstr id='image_size_width'>Width:</xstr>", digits: 9, display_disable: true, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_pixels'>pixels</xstr>", bind: @dim_width_pixels, format: "#" }, ! { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @dim_width_percent, format: "#.00" } ]); ! ! edit_number(name: "<xstr id='image_size_height'>Height:</xstr>", digits: 9, display_disable: true, ! touch: [ @doc_resolution ], ! units: [ { name: "<xstr id='image_size_pixels'>pixels</xstr>", bind: @dim_height_pixels, format: "#" }, ! { name: "<xstr id='image_size_percent'>percent</xstr>", bind: @dim_height_percent, format: "#.00" } ]); ! } ! ! link(bind: @constrain, count: 2, value_on: true, value_off: false); ! } ! ! group(name: "<xstr id='image_size_size_group'>Document Size:</xstr>", horizontal: align_fill, placement: place_row) ! { ! column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) ! { ! ... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:21:33
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/begin/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/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/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:35:23 -0000 1.3 --- latch.hpp 3 Feb 2006 18:20:47 -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/adobe-source/adobe/test/begin/headers/report_exception.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** report_exception.hpp 6 Jan 2006 18:35:23 -0000 1.3 --- report_exception.hpp 3 Feb 2006 18:20:47 -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) */ *************** *** 13,16 **** --- 13,17 ---- #include <adobe/config.hpp> + #include <adobe/future/widgets/headers/ui_core_common.hpp> #include <iostream> *************** *** 28,43 **** /****************************************************************************************************/ - namespace implementation { - - /*************************************************************************************************/ - - void report_exception(const std::string& error_message); - - /****************************************************************************************************/ - - } // namespace implementation - - /****************************************************************************************************/ - void system_beep(); --- 29,32 ---- *************** *** 48,58 **** /****************************************************************************************************/ // - /// Specifies the callback report_exception will notify in the case of an error - // - - void set_report_exception_callback(report_exception_proc_t proc); - - /****************************************************************************************************/ - // /// Formats the exception currently being thrown and sends it off to /// the callback previously specified by set_report_exception_callback --- 37,40 ---- *************** *** 61,81 **** 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."; ! } ! implementation::report_exception(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/adobe-source/adobe/test/begin/headers/express_viewer.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** express_viewer.hpp 6 Jan 2006 18:35:23 -0000 1.6 --- express_viewer.hpp 3 Feb 2006 18:20:47 -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) */ *************** *** 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,259 **** { 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); ! } ! 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 ! { ! if (dirty_m) ! return "(temporary file buffer)"; ! else ! 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 }; *************** *** 271,417 **** 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 ); 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(); ! // ! /// 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 ); }; --- 272,436 ---- 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); ! }; *************** *** 429,435 **** /// 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:21:33
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/test/eve_smoke Modified Files: default.eve main.cpp Log Message: asl 1.0.13 Index: default.eve =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke/default.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** default.eve 2 Apr 2005 05:47:37 -0000 1.1 --- default.eve 3 Feb 2006 18:20:48 -0000 1.2 *************** *** 1,11 **** dialog() { ! row() ! { ! button (name: "Hello"); ! } ! column() ! { ! button (name: "world!"); ! } } --- 1,11 ---- dialog() { ! row() ! { ! button (name: "Hello"); ! } ! column() ! { ! button (name: "world!"); ! } } Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 2 Jun 2005 23:14:19 -0000 1.3 --- main.cpp 3 Feb 2006 18:20:48 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas and 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 Ralph Thomas and 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,26 **** --- 23,30 ---- /*************************************************************************************************/ + + namespace { + + /*************************************************************************************************/ // // position_t assemble( ... ) *************** *** 30,59 **** /// doing that for now. /// - /// \param parent the parent node. A position_t is an any. - /// \param parse_location the file name and line number for this data. /// \param name the name of the thing to make. /// \param parameters the parameters for the thing to make. - /// \param brief Nearby comments? - /// \param detailed Nearby comments /// /// \return an any containing the created widget. // ! adobe::eve::position_t assemble( const adobe::eve::position_t& /*parent*/, ! const adobe::line_position_t& /*parse_location*/, ! adobe::name_t name, ! const adobe::array_t& parameters, ! const std::string& /*brief*/, ! const std::string& /*detailed*/ ) { ! std::cout << "Create: " << name.get() << std::endl; ! ! adobe::dictionary_t dict(adobe::eve::evaluate_arguments()( parameters )); ! adobe::dictionary_t::const_iterator first(dict.begin()); ! adobe::dictionary_t::const_iterator last(dict.end()); ! ! for (; first != last; ++first) ! std::cout << "\t" << first->first << " = \"" << first->second << "\"" << std::endl; ! return adobe::eve::position_t(); } --- 34,49 ---- /// doing that for now. /// /// \param name the name of the thing to make. /// \param parameters the parameters for the thing to make. /// /// \return an any containing the created widget. // ! adobe::eve_callback_suite_t::position_t assemble( adobe::name_t name, ! const adobe::dictionary_t& parameters) { ! std::cout << "Create: " << name.get() << std::endl; ! std::cout << parameters << std::endl; ! return adobe::eve_callback_suite_t::position_t(); } *************** *** 69,95 **** void testParse( boost::filesystem::path& fileName ) { ! // ! // Open our input stream. ! // ! boost::filesystem::ifstream stream( fileName ); ! if (!stream.is_open()) ! { ! std::stringstream err; ! err << "Could not open file: " << fileName.native_file_string(); ! throw std::runtime_error(err.str()); ! } ! // ! // Call the Eve parser. ! // ! adobe::eve::parse( stream, adobe::line_position_t( fileName.native_file_string().c_str() ), ! adobe::eve::position_t(), &assemble ); } /*************************************************************************************************/ // // int main() --- 59,94 ---- void testParse( boost::filesystem::path& fileName ) { ! // ! // Open our input stream. ! // ! boost::filesystem::ifstream stream( fileName ); ! if (!stream.is_open()) ! { ! std::stringstream err; ! err << "Could not open file: " << fileName.native_file_string(); ! throw std::runtime_error(err.str()); ! } ! // ! // Call the Eve parser. ! // ! ! adobe::basic_sheet_t layout_sheet; ! adobe::virtual_machine_t evaluator; ! ! adobe::parse(stream, adobe::line_position_t(fileName.native_file_string().c_str()), ! adobe::eve_callback_suite_t::position_t(), adobe::bind_layout(boost::bind(&assemble, _2, _3), ! layout_sheet, evaluator)); } /*************************************************************************************************/ + } // namespace + + /*************************************************************************************************/ + // // int main() *************** *** 104,139 **** int main( int argc, char* argv[] ) { ! bool success(true); ! // ! // Try to open the filename given on the command line, otherwise ! // try to open "default.eve". ! // ! try ! { ! boost::filesystem::path file_path("default.eve"); ! if( argc > 1 ) file_path = boost::filesystem::path(argv[1], boost::filesystem::native); ! // ! // Call our testParse function with the selected filename. ! // ! testParse( file_path ); ! } ! catch( const std::exception& error ) ! { ! // ! // Oops, something didn't work out. ! // ! std::cerr << "Exception: " << error.what() << std::endl; ! } ! catch( ... ) ! { ! std::cerr << "Unknown exception" << std::endl; ! } ! return success ? 0 : 1; } --- 103,138 ---- int main( int argc, char* argv[] ) { ! bool success(true); ! // ! // Try to open the filename given on the command line, otherwise ! // try to open "default.eve". ! // ! try ! { ! boost::filesystem::path file_path("default.eve"); ! if( argc > 1 ) file_path = boost::filesystem::path(argv[1], boost::filesystem::native); ! // ! // Call our testParse function with the selected filename. ! // ! testParse( file_path ); ! } ! catch( const std::exception& error ) ! { ! // ! // Oops, something didn't work out. ! // ! std::cerr << "Exception: " << error.what() << std::endl; ! } ! catch( ... ) ! { ! std::cerr << "Unknown exception" << std::endl; ! } ! return success ? 0 : 1; } |
From: Foster B. <fos...@us...> - 2006-02-03 18:21:33
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/begin/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/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/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:00:29 -0000 1.1 --- resources.h 3 Feb 2006 18:20:47 -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/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:43:18 -0000 1.3 --- metrics_glossary.xstr 3 Feb 2006 18:20:47 -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/adobe-source/adobe/test/begin/resources/editor.eve,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor.eve 6 Jan 2006 18:35:23 -0000 1.4 --- editor.eve 3 Feb 2006 18:20:47 -0000 1.5 *************** *** 1,68 **** /* ! 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) */ ! 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); ! } ! } } --- 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/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:52:56 -0000 1.3 --- resources.rc 3 Feb 2006 18:20:47 -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/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:35:23 -0000 1.4 --- editor.adm 3 Feb 2006 18:20:47 -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 != ""; } |
Update of /cvsroot/adobe-source/adobe-source/adobe/future/widgets/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/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/adobe-source/adobe/future/widgets/headers/ui_core_common.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ui_core_common.hpp 6 Jan 2006 18:35:21 -0000 1.4 --- ui_core_common.hpp 3 Feb 2006 18:20:44 -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_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 *************** *** 16,19 **** --- 16,21 ---- #include <adobe/extents.hpp> + #include <adobe/future/widgets/headers/ui_core.hpp> + /****************************************************************************************************/ *************** *** 33,38 **** /// 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. // *************** *** 50,53 **** --- 52,72 ---- std::string localize(const std::string& str); + // + /// \ingroup widget_lib + /// + /// Use this to specify the callback used in the case when a UI element + /// returns an error of some kind. + // + + ui_core_error_handler_proc_t& ui_core_error_handler(); + + // + /// \ingroup widget_lib + /// + /// Used to report an error through the ui_core_error_handler proc + // + + void report_ui_element_error(const std::string& error); + /****************************************************************************************************/ Index: display.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/future/widgets/headers/display.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** display.hpp 6 Jan 2006 18:35:21 -0000 1.3 --- display.hpp 3 Feb 2006 18:20:44 -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_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; }; *************** *** 54,57 **** --- 54,59 ---- /****************************************************************************************************/ + // intended to be overridden on a per-widget basis + template <typename ReturnType, typename DisplayElement> ReturnType view_for_element(DisplayElement& element); *************** *** 59,62 **** --- 61,71 ---- /****************************************************************************************************/ + // used to fetch the platform-specific UI token directly + + template <typename ReturnType, typename DisplayElement> + ReturnType unwrap_display_token(DisplayElement& element); + + /****************************************************************************************************/ + template <typename DisplayElement> display_t::position_t insert(display_t& display, display_t::position_t& parent, DisplayElement& element); Index: client_assembler.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/future/widgets/headers/client_assembler.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** client_assembler.hpp 6 Jan 2006 18:35:21 -0000 1.6 --- client_assembler.hpp 3 Feb 2006 18:20:44 -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) */ *************** *** 17,24 **** --- 17,27 ---- #include <adobe/future/assemblage.hpp> #include <adobe/adam.hpp> + #include <adobe/basic_sheet.hpp> #include <adobe/dictionary.hpp> #include <adobe/eve.hpp> #include <adobe/istream.hpp> + #include <adobe/future/widgets/headers/display.hpp> + #include <adobe/future/memory.hpp> *************** *** 26,46 **** #include <list> /****************************************************************************************************/ /* ! 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 }; --- 29,50 ---- #include <list> + #include <vector> /****************************************************************************************************/ /* ! 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 }; *************** *** 50,60 **** /*************************************************************************************************/ ! /* ! 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; /*************************************************************************************************/ *************** *** 68,82 **** /*************************************************************************************************/ /* ! 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). */ ! class eve_client_holder; // /// The window_server_t class can open Eve definitions from file and --- 72,87 ---- /*************************************************************************************************/ /* ! 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). */ ! struct eve_client_holder; ! // /// The window_server_t class can open Eve definitions from file and *************** *** 87,207 **** { 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 token ! /// 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, const adobe::line_position_t::ident_pair_t& ident_pair, 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; }; *************** *** 220,257 **** /*************************************************************************************************/ ! class eve_client_holder : public boost::noncopyable { ! public: ! /* ! 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. ! */ ! adobe::eve_t* eve_m; ! serialize_signal_t widget_stream_m; ! adobe::assemblage_t assemblage_m; ! std::pair<adobe::dictionary_t, adobe::array_t> contributing_m; ! show_window_signal_t show_window_m; ! adobe::ui_overlay_t overlay_m; ! bool window_dirty_m; ! private: ! friend adobe::auto_ptr<eve_client_holder> make_view(const adobe::line_position_t::ident_pair_t& stream_ident, ! std::istream& stream, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size, ! adobe::widget_factory_proc_t factory); }; /*************************************************************************************************/ ! adobe::auto_ptr<eve_client_holder> make_view( const adobe::line_position_t::ident_pair_t& stream_ident, ! std::istream& stream, ! adobe::sheet_t& sheet, ! const button_notifier_t& notifier, ! size_enum_t dialog_size, ! adobe::widget_factory_proc_t factory); /*************************************************************************************************/ --- 225,316 ---- /*************************************************************************************************/ ! /* ! 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. ! */ ! ! typedef std::pair<bool, adobe::panel_t*> visible_change_request_t; ! typedef std::vector<visible_change_request_t> visible_change_queue_t; ! ! /*************************************************************************************************/ ! ! 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 }; /*************************************************************************************************/ ! 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); /*************************************************************************************************/ *************** *** 261,265 **** // 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 *************** *** 271,382 **** /// 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, ! adobe::ui_overlay_t& overlay, ! adobe::ui_overlay_t::position_t node); /*************************************************************************************************/ --- 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 ! ); /*************************************************************************************************/ *************** *** 384,393 **** /// 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/adobe-source/adobe/future/widgets/headers/factory.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** factory.hpp 6 Jan 2006 18:35:21 -0000 1.4 --- factory.hpp 3 Feb 2006 18:20:44 -0000 1.5 *************** *** 1,14 **** /* ! 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 ! /****************************************************************************************************/ #include <adobe/config.hpp> --- 1,14 ---- /* ! 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 ! /*************************************************************************************************/ #include <adobe/config.hpp> *************** *** 22,26 **** #include <adobe/eve_parser.hpp> ! /****************************************************************************************************/ // /// This file defines the factory functions which are used to create widgets specified by --- 22,26 ---- #include <adobe/eve_parser.hpp> ! /*************************************************************************************************/ // /// This file defines the factory functions which are used to create widgets specified by *************** *** 37,45 **** /// in the factory token to be destroyed when the assemblage is destroyed. // ! /****************************************************************************************************/ namespace adobe { ! /****************************************************************************************************/ // /// This structure is given to all factory functions, so that they can correctly create --- 37,79 ---- /// in the factory token to be destroyed when the assemblage is destroyed. // ! /*************************************************************************************************/ namespace adobe { ! namespace implementation { ! ! 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 ! ! /*************************************************************************************************/ ! // /// This structure is given to all factory functions, so that they can correctly create *************** *** 49,125 **** struct factory_token_t { ! factory_token_t(display_t& display, ! assemblage_t& assemblage, ! eve_t& layout, ! sheet_t& sheet, ! eve_client::button_notifier_t notifier, ! eve_client::serialize_signal_t& serialize_signal, ! eve_client::show_window_signal_t& show_signal, ! ui_overlay_t& overlay, ! bool& window_dirty ! ) : ! display_m(display), ! assemblage_m(assemblage), ! sheet_m(sheet), ! layout_m(layout), ! notifier_m(notifier), ! widget_stream_m(serialize_signal), ! show_window_signal_m(show_signal), ! overlay_m(overlay), ! window_dirty_m(window_dirty) ! {} ! // ! /// Created widgets should be made with respect to this display, and inserted ! /// into the given parent by this display. ! // ! display_t& display_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. ! // ! assemblage_t& assemblage_m; ! // ! /// The current Adam sheet -- this contains all of the cells which widgets might ! /// want to bind against. ! // ! sheet_t& sheet_m; ! // ! /// 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). ! // ! eve_t& layout_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; ! // ! /// This is the signal which should trigger widget serialization. All widgets ! /// should bind to this signal. ! // ! eve_client::serialize_signal_t& widget_stream_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. ! // ! eve_client::show_window_signal_t& show_window_signal_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 ! // ! ui_overlay_t& overlay_m; ! /* ! REVISIT (sparent) : We really need a generalized mechanism for defereing an action - ! a command queue of sorts - which colapses so things don't get done twince. We hack it here. ! */ ! bool& window_dirty_m; }; ! /****************************************************************************************************/ // /// This structure represents a widget registered into Eve and the display. If a widget is --- 83,171 ---- 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; }; ! ! /*************************************************************************************************/ // /// This structure represents a widget registered into Eve and the display. If a widget is *************** *** 129,162 **** struct widget_node_t { ! widget_node_t( size_enum_t size, ! const eve_t::iterator& eve_token, ! const display_t::position_t& display_token, ! const ui_overlay_t::position_t& overlay_token) : ! size_m(size), ! eve_token_m(eve_token), ! display_token_m(display_token), ! overlay_token_m(overlay_token) ! { } ! // ! /// 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; ! // ! /// 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; }; ! /****************************************************************************************************/ // /// This is the main factory function. It will create the named widget (if possible) --- 175,215 ---- 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 }; ! /*************************************************************************************************/ // /// This is the main factory function. It will create the named widget (if possible) *************** *** 164,444 **** /// 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); ! /****************************************************************************************************/ // /// Create a row container with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a column container with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create an overlay container with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a dialog widget with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a palette widget with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a button widget with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a check box widget with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a radio button widget with the given parameters, and insert it into the /// 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); ! /****************************************************************************************************/ // /// Create a edit text widget with the given parameters, and insert it into the /// 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_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); ! /****************************************************************************************************/ // /// Create a edit number widget with the given parameters, and insert it into the /// given parent. /// ! /// \param parameters a dictionary of parameters for the new edit number. ! /// \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_number_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); ! /****************************************************************************************************/ // /// Create a static text widget with the given parameters, and insert it into the /// given parent. /// ! /// \param parameters a dictionary of parameters for the new static 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 static_text_factory(const dictionary_t& parameters, const widget_node_t& parent, const factory_token_t& token); ! /****************************************************************************************************/ // /// Create a popup widget with the given parameters, and insert it into the /// given parent. /// ! /// \param parameters a dictionary of parameters for the new popup. ! /// \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 popup_factory(const dictionary_t& parameters, cons... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:21:30
|
Update of /cvsroot/adobe-source/adobe-source/adobe/gil/extension/conceptspace In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/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/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:35:21 -0000 1.1 --- any_standard_image.hpp 3 Feb 2006 18:20:46 -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:21:30
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/begin/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/test/begin/sources/mac Modified Files: main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/begin/sources/mac/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 7 Nov 2005 18:00:45 -0000 1.2 --- main.cpp 3 Feb 2006 18:20:47 -0000 1.3 *************** *** 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,39 **** /****************************************************************************************************/ ! #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 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" )); /****************************************************************************************************/ *************** *** 52,76 **** /// 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 ); } *************** *** 82,130 **** 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(); } *************** *** 134,171 **** /// 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 } *************** *** 175,297 **** /// 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 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; } *************** *** 313,320 **** 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 ); ! } }; *************** *** 324,331 **** 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 ); ! } }; *************** *** 334,390 **** 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; } *************** *** 393,397 **** void os_mainloop() { ! RunApplicationEventLoop(); } --- 398,402 ---- void os_mainloop() { ! RunApplicationEventLoop(); } *************** *** 400,404 **** void os_end_mainloop() { ! QuitApplicationEventLoop(); } --- 405,409 ---- void os_end_mainloop() { ! QuitApplicationEventLoop(); } *************** *** 411,426 **** 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:21:29
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/adam_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/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/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:35:22 -0000 1.2 --- adam_smoke_test.cpp 3 Feb 2006 18:20:46 -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/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 2 Jun 2005 23:14:18 -0000 1.1 --- rtd.adm 3 Feb 2006 18:20:46 -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 ]; } |
Update of /cvsroot/adobe-source/adobe-source/adobe/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/source Modified Files: adam.cpp adam_evaluate.cpp adam_parser.cpp array.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 Added Files: basic_sheet.cpp Log Message: asl 1.0.13 Index: toroid.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/source/toroid.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** toroid.hpp 6 Jan 2006 18:35:22 -0000 1.3 --- toroid.hpp 3 Feb 2006 18:20:46 -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) */ *************** *** 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/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:35:22 -0000 1.4 --- xml_lex_fwd.hpp 3 Feb 2006 18:20:46 -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/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:35:22 -0000 1.5 --- xml_token.hpp 3 Feb 2006 18:20:46 -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/adobe-source/adobe/source/xml_element_parser.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xml_element_parser.cpp 6 Jan 2006 18:35:22 -0000 1.6 --- xml_element_parser.cpp 3 Feb 2006 18:20:46 -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) */ *************** *** 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/adobe-source/adobe/source/virtual_machine.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** virtual_machine.cpp 6 Jan 2006 18:35:22 -0000 1.7 --- virtual_machine.cpp 3 Feb 2006 18:20:46 -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 [...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/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 6 Jan 2006 18:35:22 -0000 1.3 --- eve_evaluate.cpp 3 Feb 2006 18:20:46 -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,106 **** 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; } /*************************************************************************************************/ ! adobe::value_t reflected_variables(adobe::name_t name) { ! ADOBE_ONCE_INSTANCE(adobe_eve_evaluate); ! ! adobe::name_t* found(std::lower_bound(reflected_range_g->first, reflected_range_g->second, name)); ! ! if (found == reflected_range_g->second || *found != name) ! { ! std::string error("Variable not found: "); ! error << name.get(); ! throw std::logic_error(error); ! } ! return adobe::value_t(*found); } /*************************************************************************************************/ ! class evaluate_named_arguments_t { ! public: ! typedef adobe::dictionary_t result_type; ! ! evaluate_named_arguments_t() ! { ! evaluator_m.set_simple_variable_lookup(&reflected_variables); ! } ! adobe::dictionary_t operator () (const adobe::array_t& arguments) ! { ! evaluator_m.evaluate(arguments); ! adobe::dictionary_t result(evaluator_m.back().value_m.get<adobe::dictionary_t>()); ! evaluator_m.pop_back(); ! return result; ! } ! ! private: ! adobe::virtual_machine_t evaluator_m; ! }; /*************************************************************************************************/ --- 35,118 ---- 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; } /*************************************************************************************************/ ! 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]; } /*************************************************************************************************/ ! 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; ! } ! /*************************************************************************************************/ ! 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 ! } ! } /*************************************************************************************************/ *************** *** 114,121 **** /*************************************************************************************************/ ! boost::function<adobe::dictionary_t (const adobe::array_t&)> adobe::eve::evaluate_arguments() { ! return evaluate_named_arguments_t(); } /*************************************************************************************************/ --- 126,154 ---- /*************************************************************************************************/ ! namespace adobe { ! ! /*************************************************************************************************/ ! ! 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; } /*************************************************************************************************/ + + } // namespace adobe + + /*************************************************************************************************/ Index: lex_stream.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/source/lex_stream.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** lex_stream.hpp 6 Jan 2006 18:35:22 -0000 1.6 --- lex_stream.hpp 3 Feb 2006 18:20:46 -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,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&, a... [truncated message content] |
From: Foster B. <fos...@us...> - 2006-02-03 18:21:28
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/adam_tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/test/adam_tutorial Modified Files: default.adm main.cpp Log Message: asl 1.0.13 Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/adam_tutorial/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 6 Jan 2006 18:35:22 -0000 1.5 --- main.cpp 3 Feb 2006 18:20:46 -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) */ *************** *** 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/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 7 Mar 2005 07:28:36 -0000 1.1 --- default.adm 3 Feb 2006 18:20:46 -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; ! } } |