|
From: Foster B. <fos...@us...> - 2005-04-02 05:48:06
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/visual/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17172/adobe/test/visual/headers Modified Files: client_assembler.hpp latch.hpp report_exception.hpp ui_core.hpp Added Files: express_viewer.hpp Log Message: asl 1.0.2 Index: client_assembler.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/visual/headers/client_assembler.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** client_assembler.hpp 3 Mar 2005 06:58:38 -0000 1.2 --- client_assembler.hpp 2 Apr 2005 05:47:39 -0000 1.3 *************** *** 79,82 **** --- 79,84 ---- void dispatch_action(adobe::name_t action, const adobe::value_t& parameter); + std::size_t size() const { return window_list_m.size(); } + private: typedef std::list<eve_client_holder*> window_list_t; --- NEW FILE: express_viewer.hpp --- /* 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_EXPRESS_VIEWER_HPP #define ADOBE_EXPRESS_VIEWER_HPP #include <boost/filesystem/path.hpp> #include "client_assembler.hpp" #include <adobe/adam.hpp> #include <string> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// The simpleApplication class is implemented in express_viewer.cpp and defines /// the basic application operation. The simpleApplication class is a singleton, /// so you must use simpleApplication::getInstance() to get an instance. // class simpleApplication { boost::filesystem::path _resource_dir_m; ///< The directory containing this applications resource files (i.e.: editor.adm, editor.eve). boost::filesystem::path _eve_path_m; ///< The name of the Eve file we are viewing. boost::filesystem::path _adam_path_m; ///< The name of the Adam file we are viewing. 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. // simpleApplication(); // /// This destructor releases any allocated sheets and Eve bits. // ~simpleApplication(); // /// Initialize the simpleApplication 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 will write the given string to the given path name. It /// is usually called by _editor_op when it needs to write a modified adam /// or eve file to disk before reloading them. /// /// \param file_name the file to write to. /// \param contents the file contents to write out. // void _update_file( const boost::filesystem::path& file_name, std::string contents ); // /// 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 ); public: // /// The getInstance method returns a pointer to the single simpleApplication /// instance. If the simpleApplication 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 simpleApplication instance. /// \sa os_initialize // static simpleApplication* 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( 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( 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( 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 ); }; /****************************************************************************************************/ // /// Emit the system beep sound. // void system_beep(); /****************************************************************************************************/ // /// Perform OS-specific initialization tasks, such as registering menus. This /// function should also set the resource directory used by simpleApplication. /// /// \param theApp the instance of simpleApplication 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( simpleApplication* theApp ); /****************************************************************************************************/ // /// Enter the OS/toolkit main-loop. This function should return when it's time /// to quit. // void os_mainloop(); /****************************************************************************************************/ // /// Exit the OS/toolkit main-loop. This function should only be called after /// os_mainloop has been called. // void os_end_mainloop(); /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif Index: ui_core.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/visual/headers/ui_core.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ui_core.hpp 17 Mar 2005 18:03:16 -0000 1.3 --- ui_core.hpp 2 Apr 2005 05:47:39 -0000 1.4 *************** *** 250,254 **** return format<adobe::value_t>(adobe::value_t(x)); #elif defined(BOOST_MSVC) ! return std::string(); // Stub for now because the above produces and internal compiler error in MSVC. #endif } --- 250,257 ---- return format<adobe::value_t>(adobe::value_t(x)); #elif defined(BOOST_MSVC) ! // Stub for now because the above produces and internal compiler error in MSVC. ! std::stringstream stream; ! stream << x; ! return stream.str(); #endif } *************** *** 260,264 **** return parse<adobe::value_t>(str, adobe::value_t(Numeric())).template get<Numeric>(); #elif defined(BOOST_MSVC) ! return Numeric(); // Stub for now because the above produces and internal compiler error in MSVC. #endif } --- 263,267 ---- return parse<adobe::value_t>(str, adobe::value_t(Numeric())).template get<Numeric>(); #elif defined(BOOST_MSVC) ! return Numeric(std::atof(str.c_str())); // Stub for now because the above produces and internal compiler error in MSVC. #endif } *************** *** 312,316 **** ADOBE_UI_CORE_IMPLEMENTATION_SWAP_FRIEND_DECLARATION(window_t); ! #ifdef BOOST_MSVC public: #endif --- 315,319 ---- ADOBE_UI_CORE_IMPLEMENTATION_SWAP_FRIEND_DECLARATION(window_t); ! #if defined(BOOST_MSVC) || defined(__GNUC__) public: #endif *************** *** 318,322 **** struct implementation_t; ! #ifdef BOOST_MSVC private: #endif --- 321,325 ---- struct implementation_t; ! #if defined(BOOST_MSVC) || defined(__GNUC__) private: #endif Index: report_exception.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/visual/headers/report_exception.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** report_exception.hpp 17 Mar 2005 18:03:16 -0000 1.3 --- report_exception.hpp 2 Apr 2005 05:47:39 -0000 1.4 *************** *** 20,29 **** /****************************************************************************************************/ ! extern adobe::sheet_t* editor_sheet_g; extern const adobe::static_name_t editor_error_cell_g; extern const adobe::static_name_t editor_visible_tab_cell_g; extern const adobe::static_name_t editor_key_errors_tab_g; ! /****************************************************************************************************/ --- 20,33 ---- /****************************************************************************************************/ ! /* ! // ! // REVISIT (ralpht): Get the editor sheet from the simpleApplication singleton ! // instead of this global. ! // extern adobe::sheet_t* editor_sheet_g; extern const adobe::static_name_t editor_error_cell_g; extern const adobe::static_name_t editor_visible_tab_cell_g; extern const adobe::static_name_t editor_key_errors_tab_g; ! */ /****************************************************************************************************/ *************** *** 65,68 **** --- 69,74 ---- } + ~os_exception() throw() {} + const char* what () const throw() { return what_m.c_str(); } *************** *** 122,126 **** err += "Unknown."; } ! if (editor_sheet_g) { --- 128,135 ---- err += "Unknown."; } ! /* ! // ! // REVISIT (ralpht): Get editor_sheet_g from the simpleApplication singleton. ! // if (editor_sheet_g) { *************** *** 129,133 **** editor_sheet_g->update(); } ! else { std::ofstream errorfile("adobe_begin_errors.txt"); --- 138,142 ---- editor_sheet_g->update(); } ! else*/ { std::ofstream errorfile("adobe_begin_errors.txt"); Index: latch.hpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/visual/headers/latch.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** latch.hpp 3 Mar 2005 06:58:38 -0000 1.2 --- latch.hpp 2 Apr 2005 05:47:39 -0000 1.3 *************** *** 30,34 **** template <typename TriggerFunction, typename ValidFunction> latch_t(const TriggerFunction& trigger, const ValidFunction& valid) : ! trigger_func_m(trigger), validity_func_m(valid), force_m(true) { } --- 30,34 ---- template <typename TriggerFunction, typename ValidFunction> latch_t(const TriggerFunction& trigger, const ValidFunction& valid) : ! trigger_m(trigger), valid_m(valid), force_m(true) { } |