|
From: Foster B. <fos...@us...> - 2006-01-24 19:39:29
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12473/adobe-source/adobe Modified Files: Jamfile.v2 adam.hpp adam_parser.hpp eve_evaluate.hpp eve_parser.hpp istream.hpp Added Files: basic_sheet.hpp Log Message: moved win/ directories to win32/ to anticipate a possible widgets port for WPF; added a 'mini-sheet' to Eve so you can save UI state information (what tab is currently selected) without mucking up your Adam model; started the modal_dialog_interface, an API that'll be used to direct a modal dialog interaction between the user and the application (it's still in its infancy); other misc bug fixes --- NEW FILE: basic_sheet.hpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_BASIC_SHEET_HPP #define ADOBE_BASIC_SHEET_HPP #include <adobe/config.hpp> #include <deque> #include <map> #include <boost/function.hpp> #include <boost/signal.hpp> #include <adobe/name.hpp> #include <adobe/value.hpp> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ class basic_sheet_t : boost::noncopyable { public: typedef boost::signals::connection connection_t; typedef boost::function<void (const value_t&)> monitor_value_t; void add_constant(name_t, const value_t&); void add_interface(name_t, const value_t&); std::size_t count_interface(name_t) const; connection_t monitor_interface(name_t, const monitor_value_t&); void set(name_t, const value_t&); // interface cell const value_t& operator[](name_t) const; // variable lookup private: typedef boost::signal<void (const value_t&)> monitor_value_signal_t; struct cell_t { cell_t(const value_t& value) : value_m(value) { } value_t value_m; }; struct interface_cell_t : cell_t { interface_cell_t(const value_t& value) : cell_t(value) { } interface_cell_t(const interface_cell_t& x) : cell_t(x.value_m) { } interface_cell_t& operator=(const interface_cell_t& x) { value_m = x.value_m; // copying a value could throw so it goes first // monitor_m is not copied - nor can it be return *this; } monitor_value_signal_t monitor_m; }; typedef std::map<const char*, interface_cell_t*> interface_index_t; typedef std::map<const char*, const cell_t*> variable_index_t; interface_cell_t* lookup_interface(name_t); variable_index_t variable_index_m; interface_index_t interface_index_m; std::deque<cell_t> constant_cell_set_m; std::deque<interface_cell_t> interface_cell_set_m; }; /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ #endif /*************************************************************************************************/ Index: adam_parser.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/adam_parser.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** adam_parser.hpp 6 Jan 2006 18:02:35 -0000 1.3 --- adam_parser.hpp 24 Jan 2006 19:38:43 -0000 1.4 *************** *** 53,57 **** const std::string& detailed)> add_cell_proc_t; ! typedef boost::function<void ( const line_position_t& position, const array_t& conditional, const relation_t* first, --- 53,58 ---- const std::string& detailed)> add_cell_proc_t; ! typedef boost::function<void ( bool weak, ! const line_position_t& position, const array_t& conditional, const relation_t* first, Index: eve_parser.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/eve_parser.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eve_parser.hpp 6 Jan 2006 18:02:35 -0000 1.3 --- eve_parser.hpp 24 Jan 2006 19:38:43 -0000 1.4 *************** *** 24,35 **** /* ! Eve Grammer: ! ---------------------------------------- ! view_definition = [lead_comment] view_class_decl ((";" [trail_comment]) ! | ([trail_comment] view_statement_list). ! view_statment_sequence = { view_definition }. ! view_class_decl = ident "(" [ named_argument_list ] ")". ! view_statment_list = "{" view_statement_sequence "}". */ --- 24,48 ---- /* ! Eve Grammer: ! ---------------------------------------- ! ! layout_specifier = [lead_comment] "layout" identifier "{" { qualified_cell_decl } ! "view" view_definition "}" [trail_comment]. ! ! qualified_cell_decl = interface_set_decl | constant_set_decl. ! ! interface_set_decl = "interface" ":" { cell_decl }. ! constant_set_decl = "constant" ":" { cell_decl }. ! ! cell_decl = [lead_comment] identifier initializer end_statement. ! initializer = ":" expression. ! view_definition = [lead_comment] view_class_decl ((";" [trail_comment]) ! | ([trail_comment] view_statement_list)). ! view_statment_sequence = { view_definition }. ! view_class_decl = ident "(" [ named_argument_list ] ")". ! view_statment_list = "{" view_statement_sequence "}". ! ! end_statement = ";" [trail_comment]. */ *************** *** 37,59 **** namespace adobe { - namespace eve { /*************************************************************************************************/ ! typedef boost::any position_t; ! typedef boost::function<position_t ( const position_t& parent, ! const line_position_t& parse_location, ! adobe::name_t name, ! const adobe::array_t& parameters, ! const std::string& brief, ! const std::string& detailed)> assemble_t; ! line_position_t parse(std::istream& in, const line_position_t&, const position_t&, ! const assemble_t&); /*************************************************************************************************/ - } // namespace eve } // namespace adobe --- 50,90 ---- namespace adobe { /*************************************************************************************************/ ! struct eve_callback_suite_t ! { ! enum cell_type_t ! { ! constant_k, ! interface_k ! }; ! ! typedef boost::any position_t; ! typedef boost::function<position_t ( const position_t& parent, ! const line_position_t& parse_location, ! name_t name, ! const array_t& parameters, ! const std::string& brief, ! const std::string& detailed)> add_view_proc_t; ! ! typedef boost::function<void ( cell_type_t type, ! name_t name, ! const line_position_t& position, ! const array_t& initializer, ! const std::string& brief, ! const std::string& detailed)> add_cell_proc_t; ! ! ! add_view_proc_t add_view_proc_m; ! add_cell_proc_t add_cell_proc_m; ! }; ! line_position_t parse(std::istream& in, const line_position_t&, ! const eve_callback_suite_t::position_t&, const eve_callback_suite_t&); /*************************************************************************************************/ } // namespace adobe Index: Jamfile.v2 =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/Jamfile.v2,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Jamfile.v2 6 Jan 2006 18:02:35 -0000 1.8 --- Jamfile.v2 24 Jan 2006 19:38:43 -0000 1.9 *************** *** 39,42 **** --- 39,43 ---- iomanip iomanip_pdf + modal_dialog_interface ; Index: eve_evaluate.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/eve_evaluate.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eve_evaluate.hpp 6 Jan 2006 18:02:35 -0000 1.3 --- eve_evaluate.hpp 24 Jan 2006 19:38:43 -0000 1.4 *************** *** 13,31 **** #include <boost/function.hpp> ! #include <adobe/array_fwd.hpp> ! #include <adobe/dictionary.hpp> /*************************************************************************************************/ namespace adobe { - namespace eve { /*************************************************************************************************/ ! boost::function<dictionary_t (const array_t&)> evaluate_arguments(); /*************************************************************************************************/ - } // namespace eve } // namespace adobe --- 13,40 ---- #include <boost/function.hpp> ! ! #include <adobe/dictionary_fwd.hpp> ! #include <adobe/name_fwd.hpp> ! ! #include <adobe/basic_sheet.hpp> ! #include <adobe/eve_parser.hpp> ! #include <adobe/virtual_machine.hpp> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ ! typedef boost::function< ! eve_callback_suite_t::position_t ( const eve_callback_suite_t::position_t& parent, ! name_t name, ! dictionary_t arguments)> bind_layout_proc_t; ! ! eve_callback_suite_t bind_layout(const bind_layout_proc_t& proc, basic_sheet_t& layout_sheet, ! virtual_machine_t& evaluator); /*************************************************************************************************/ } // namespace adobe Index: istream.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/istream.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** istream.hpp 6 Jan 2006 18:02:35 -0000 1.10 --- istream.hpp 24 Jan 2006 19:38:43 -0000 1.11 *************** *** 22,25 **** --- 22,27 ---- #include <boost/any.hpp> + #include <boost/shared_ptr.hpp> + #include <boost/function.hpp> /*************************************************************************************************/ *************** *** 39,49 **** struct line_position_t { ! typedef std::pair<adobe::name_t, boost::any> ident_pair_t; // line_number starts at 1. ! explicit line_position_t( const ident_pair_t& stream_name, ! int line_number = 1, ! std::streampos line_start = 0, ! std::streampos position = -1); // This constructor is used with __FILE__ and __LINE__, line_index starts at 0 --- 41,54 ---- struct line_position_t { ! public: ! typedef boost::function<std::string (adobe::name_t, std::streampos)> getline_proc_impl_t; ! typedef boost::shared_ptr<getline_proc_impl_t> getline_proc_t; // line_number starts at 1. ! explicit line_position_t( adobe::name_t file_path, ! getline_proc_t getline_proc, ! int line_number = 1, ! std::streampos line_start = 0, ! std::streampos position = -1); // This constructor is used with __FILE__ and __LINE__, line_index starts at 0 *************** *** 54,59 **** #endif // !defined(ADOBE_NO_DOCUMENTATION) ! const char* stream_name() const; ! boost::any stream_token() const; int line_number_m; // type int to match __LINE__ token --- 59,71 ---- #endif // !defined(ADOBE_NO_DOCUMENTATION) ! const char* line_position_t::stream_name() const ! { return file_name_m.get(); } ! ! std::string file_snippet() const ! { ! return getline_proc_m->empty() ? ! std::string() : ! (*getline_proc_m)(file_name_m, line_start_m); ! } int line_number_m; // type int to match __LINE__ token *************** *** 63,67 **** #if !defined(ADOBE_NO_DOCUMENTATION) private: ! ident_pair_t ident_pair_m; #endif // !defined(ADOBE_NO_DOCUMENTATION) }; --- 75,80 ---- #if !defined(ADOBE_NO_DOCUMENTATION) private: ! adobe::name_t file_name_m; ! getline_proc_t getline_proc_m; #endif // !defined(ADOBE_NO_DOCUMENTATION) }; *************** *** 69,72 **** --- 82,89 ---- /*************************************************************************************************/ + std::ostream& operator<<(std::ostream&, const line_position_t&); + + /*************************************************************************************************/ + class stream_error_t : public std::logic_error { *************** *** 142,159 **** template <typename I> // I models InputIterator ! bool is_line_end(I& first, I last, char c) { // Handle any type of line ending. ! if (c == '\n') return true; if (c == '\r') { ! if (first != last && *first == '\n') ++first; ! return true; } ! return false; } --- 159,181 ---- template <typename I> // I models InputIterator ! std::size_t is_line_end(I& first, I last, char c) { // Handle any type of line ending. ! if (c == '\n') return 1; if (c == '\r') { ! if (first != last && *first == '\n') ! { ! ++first; ! return 2; ! } ! ! return 1; } ! return 0; } Index: adam.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/adam.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** adam.hpp 6 Jan 2006 18:02:35 -0000 1.5 --- adam.hpp 24 Jan 2006 19:38:43 -0000 1.6 *************** *** 84,88 **** const line_position_t&, const array_t& expression); ! void add_relation ( const line_position_t&, const array_t& conditional, const relation_t* first, const relation_t* last); --- 84,88 ---- const line_position_t&, const array_t& expression); ! void add_relation ( bool weak, const line_position_t&, const array_t& conditional, const relation_t* first, const relation_t* last); |