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: Ralph T. <ra...@us...> - 2005-04-19 06:30:01
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31520/visual_refactor/adobe/test/visual/resources Modified Files: aqua_button.ico Log Message: Somehow this icon got corrupted in the branch. Doh. Index: aqua_button.ico =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/resources/aqua_button.ico,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsyLl5lK and /tmp/cvs0HmOFd differ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:17
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/headers Added Files: client_assembler.hpp display.hpp express_viewer.hpp latch.hpp optional_connect.hpp report_exception.hpp ui_core.hpp ui_core_common.hpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: ui_core_common.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_UI_CORE_COMMON_HPP #define ADOBE_UI_CORE_COMMON_HPP /****************************************************************************************************/ #include <adobe/rectangle.hpp> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// \ingroup widget_lib /// /// This function takes two rectangle slices and "aligns" them by the first /// point of interest (for a vertical slice, the baseline). It takes the /// first slice as a reference, and modifies it such that it's height can /// accommodate the aligned slices. /// /// This function does NOT touch frame, inset and outset values! They might /// 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. // void align_slices(::adobe::rectangle_t::slice_t& slice_one, ::adobe::rectangle_t::slice_t slice_two); /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif /****************************************************************************************************/ --- NEW FILE: display.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_DISPLAY_HPP #define ADOBE_DISPLAY_HPP /****************************************************************************************************/ #include <boost/any.hpp> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ struct display_t { struct implementation_t; typedef boost::any position_t; display_t(); ~display_t(); 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; }; /****************************************************************************************************/ display_t& get_main_display(); /****************************************************************************************************/ template <typename ReturnType, typename DisplayElement> ReturnType view_for_element(DisplayElement& element); /****************************************************************************************************/ template <typename DisplayElement> display_t::position_t insert(display_t& display, display_t::position_t& parent, DisplayElement& element); /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif // ADOBE_DISPLAY_HPP /****************************************************************************************************/ --- NEW FILE: client_assembler.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef EVE_CLIENT_EXAMPLE_HPP #define EVE_CLIENT_EXAMPLE_HPP #include "ui_core.hpp" #include <list> #include <boost/function.hpp> #include <adobe/future/assemblage.hpp> #include <adobe/adam.hpp> #include <adobe/dictionary.hpp> #include <adobe/eve.hpp> #include <adobe/future/memory.hpp> /****************************************************************************************************/ /* 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 }; /*************************************************************************************************/ namespace eve_client { /*************************************************************************************************/ /* 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; class window_server_t { public: typedef boost::function<void (const adobe::name_t&, const adobe::value_t&)> action_fallback_proc_t; window_server_t(const char* directory_path, adobe::sheet_t& sheet); ~window_server_t(); void push_back(const char* name, size_enum_t dialog_size); #if 0 void set_back(const char* name, size_enum_t dialog_size); void pop_back(bool cancel); #endif void set_action_fallback(action_fallback_proc_t proc); void serialize_widgets(std::ostream& s); // REVISIT (sparent) : Hack. These need to go to the correct window. 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; 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; }; /*************************************************************************************************/ typedef boost::function<void (adobe::name_t action, const adobe::value_t&)> button_notifier_t; /*************************************************************************************************/ 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; adobe::window_t* window_m; boost::signal<void (std::ostream& s)> widget_stream_m; adobe::assemblage_t assemblage_m; adobe::dictionary_t contributing_m; #ifndef NDEBUG void clear_frames() { if (window_m) adobe::clear_geometry_frames(*window_m); } #endif private: friend adobe::auto_ptr<eve_client_holder> make_view(const char* file_name, adobe::sheet_t& sheet, const button_notifier_t& notifier, size_enum_t dialog_size); }; /*************************************************************************************************/ adobe::auto_ptr<eve_client_holder> make_view( const char* file_name, adobe::sheet_t& sheet, const button_notifier_t& notifier, size_enum_t dialog_size); /*************************************************************************************************/ } // namespace eve_client /*************************************************************************************************/ #endif /*************************************************************************************************/ --- NEW FILE: ui_core.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_UI_CORE_HPP #define ADOBE_UI_CORE_HPP /****************************************************************************************************/ #if ADOBE_PLATFORM_WIN # include <string> # include <sstream> #endif #include <boost/function.hpp> [...995 lines suppressed...] ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::checkbox_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::link_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::progress_bar_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::separator_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::static_text_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::edit_text_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::popup_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::unit_edit_text_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::slider_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::bevel_button_t); /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif // ADOBE_UI_CORE_HPP /****************************************************************************************************/ --- NEW FILE: optional_connect.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_OPTIONAL_CONNECTION_HPP #define ADOBE_OPTIONAL_CONNECTION_HPP /*************************************************************************************************/ #include <boost/utility/enable_if.hpp> /*************************************************************************************************/ #ifdef BOOST_MSVC #define ADOBE_OPTIONAL_CONNECT_TEST(p) &p != 0 #else #define ADOBE_OPTIONAL_CONNECT_TEST(p) sizeof(p) != 0 #endif /*************************************************************************************************/ #define ADOBE_OPTIONAL_CONNECT1(ns, func) \ namespace adobe { \ namespace ns { \ namespace implementation { \ template <class R, class T> \ R func(T& t, \ typename boost::enable_if_c<ADOBE_OPTIONAL_CONNECT_TEST(T::##func)>::type* = 0) \ { return t.##func(); } \ template <class R, class T> \ R func(volatile T&, ...) \ { return R(); } \ } \ template <class R, class T> \ R func(T& t) \ { return implementation::##func##<R>(t); } \ } } /*************************************************************************************************/ #define ADOBE_OPTIONAL_CONNECT2(ns, func) \ namespace adobe { \ namespace ns { \ namespace implementation { \ template <class R, class T, class U> \ R func(T& t, U& u, \ typename boost::enable_if_c<ADOBE_OPTIONAL_CONNECT_TEST(T::##func)>::type* = 0) \ { return t.##func##(u); } \ template <class R, class T, class U> \ R func(volatile T&, volatile U&, ...) \ { return R(); } \ } \ template <class R, class T, class U> \ R func(T& t, U& u) \ { return implementation::##func##<R>(t, u); } \ } } /*************************************************************************************************/ #define ADOBE_OPTIONAL_CONNECT3(ns, func) \ namespace adobe { \ namespace ns { \ namespace implementation { \ template <class R, class T, class U, class V> \ R func(T& t, U& u, V& v, \ typename boost::enable_if_c<ADOBE_OPTIONAL_CONNECT_TEST(T::##func)>::type* = 0) \ { return t.##func(u, v); } \ template <class R, class T, class U, class V> \ R func(volatile T&, volatile U&, volatile V&, ...) \ { return R(); } \ } \ template <class R, class T, class U, class V> \ R func(T& t, U& u, V& v) \ { return implementation::##func##<R>(t, u, v); } \ } } /*************************************************************************************************/ #endif // ADOBE_OPTIONAL_CONNECTION_HPP /*************************************************************************************************/ --- NEW FILE: latch.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_LATCH_HPP #define ADOBE_LATCH_HPP /****************************************************************************************************/ #include <adobe/dictionary.hpp> #include <adobe/value.hpp> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ template <typename ValueType> 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; }; /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif // ADOBE_LATCH_HPP /****************************************************************************************************/ --- NEW FILE: report_exception.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_REPORT_EXCEPTION_HPP #define ADOBE_REPORT_EXCEPTION_HPP /****************************************************************************************************/ #include <iostream> #include <fstream> #include <sstream> #include <adobe/istream.hpp> #include <adobe/adam.hpp> #include <adobe/name.hpp> /****************************************************************************************************/ /* // // 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; */ /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ void system_beep(); /****************************************************************************************************/ namespace implementation { /*************************************************************************************************/ class os_exception : public std::exception { public: os_exception(long status, const char* file, long line) throw() { try { std::stringstream t; t << status; format(t.str().c_str(), file, line); } catch (...) { } } os_exception(const char* status, const char* file, long line) throw() { format(status, file, line); } os_exception(const std::string& status, const char* file, long line) throw() { format(status.c_str(), file, line); } ~os_exception() throw() {} const char* what () const throw() { return what_m.c_str(); } private: void format(const char* status, const char* file, long line) { try { std::stringstream t; t << "Error: " << status << " (" << file << ", line " << line << ")"; what_m.assign(t.str()); } catch (...) { } } std::string what_m; }; /*************************************************************************************************/ static void ADOBE_REQUIRE_STATUS_impl(long status, char* file, long line) { if (status != 0) throw os_exception(status, file, line); } /*************************************************************************************************/ #define ADOBE_REQUIRE_STATUS(x) adobe::implementation::ADOBE_REQUIRE_STATUS_impl((x), __FILE__, __LINE__) /****************************************************************************************************/ } // namespace implementation /****************************************************************************************************/ inline void report_exception() { std::string err("Exception: "); try { throw; } catch (const adobe::stream_error_t& error) { // REVISIT (sparent) : This can't handle a set of files. std::ifstream file(error.line_position_set().front().stream_name()); err += format_stream_error(file, error); } catch (const std::exception& error) { err += error.what(); } catch (...) { err += "Unknown."; } /* // // REVISIT (ralpht): Get editor_sheet_g from the simpleApplication singleton. // if (editor_sheet_g) { editor_sheet_g->set(editor_error_cell_g, adobe::value_t(err)); editor_sheet_g->set(editor_visible_tab_cell_g, adobe::value_t(editor_key_errors_tab_g)); editor_sheet_g->update(); } else*/ { std::ofstream errorfile("adobe_begin_errors.txt"); errorfile << err; } system_beep(); } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ #endif // ADOBE_REPORT_EXCEPTION_HPP /****************************************************************************************************/ --- 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 <adobe/config.hpp> #include <string> #include <iostream> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// The stream_sucker is used to extract the data available from a stream and /// deposit it into a string. This is not very efficient but works for a /// demo application. /// /// \param stream the stream to extract data from. /// \return all of the data in the stream. // template<typename InputStream> std::string stream_sucker( InputStream& stream ) { std::string result; if ( stream.is_open() ) { std::istream::char_type c( 0 ); // // Read from the stream character by character until we // reach the end. // while( !stream.eof() ) { stream.get( c ); if ( c == '\n' ) c = '\r'; if ( !stream.eof() ) result += c; } } return result; } /****************************************************************************************************/ // /// 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 ); #if ADOBE_PLATFORM_MAC // /// The Mac has inherently bad metric information provided to us from the OS /// So here we load up an xstr glossary that contains for us metric information /// on the various platform widgets. // void _load_metrics_glossary(); #endif 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 |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:17
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/sources/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/sources/win Added Files: display.cpp event_dispatcher.cpp main.cpp metrics.cpp ui_core_implementation.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: display.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #define WINDOWS_LEAN_AND_MEAN 1 #include <windows.h> #include "display.hpp" #include "report_exception.hpp" /****************************************************************************************************/ namespace { /****************************************************************************************************/ struct view_wrap { explicit view_wrap(HWND ref) : ref_m(ref) { } HWND ref_m; }; /****************************************************************************************************/ HWND unwrap(adobe::display_t::position_t& position) { return (boost::any_cast<view_wrap>(position)).ref_m; } /****************************************************************************************************/ adobe::display_t::position_t wrap(HWND view) { return adobe::display_t::position_t(view_wrap(view)); } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ struct root_token { }; /****************************************************************************************************/ display_t& get_main_display() { static display_t display_s; return display_s; } /****************************************************************************************************/ struct display_t::implementation_t { void erase(display_t::position_t& position); std::vector<HWND> roots_m; }; /****************************************************************************************************/ template <typename DisplayElement> display_t::position_t insert(display_t& display, display_t::position_t& position, DisplayElement& element) { return display.insert(position, element); } /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ display_t::display_t() : object_m(new implementation_t()) { } display_t::~display_t() { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() { return *object_m; } const display_t::implementation_t& display_t::implementation() const { return *object_m; } display_t::position_t display_t::root() { return display_t::position_t(root_token()); } void display_t::erase(position_t& position) { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) { return insert(parent, adobe::view_for_element<HWND>(element)); } /****************************************************************************************************/ template <> display_t::position_t display_t::insert<HWND>(position_t& parent, HWND& element) { if (parent.type() == typeid(view_wrap)) { HWND parent_view(unwrap(parent)); if (::SetParent(element, parent_view) == 0) ADOBE_REQUIRE_STATUS(::GetLastError()); assert(::GetParent(element) == parent_view); } else if (parent.type() == typeid(root_token)) { object_m->roots_m.push_back(element); } return wrap(element); } /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ void display_t::implementation_t::erase(display_t::position_t&) { // REVISIT (fbrereto) : What should we do here? // 1) Call DetachSubView on the position? // 2) Call erase recursively for all children of the position? // 3) Invalidate (wipe) the position data? // 4) Invoke some (currently nonexistent) detach() callback for the client? // 4a) With what parameters, considering questions 1, 2, & 3? } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: metrics.cpp --- /* 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) */ /****************************************************************************************************/ // // This is the implementation of the class which looks up widget metrics on // Windows systems. It has two implementations, one uses UxTheme to look up // widget metrics, and the other uses constant values (and is used on systems // where UxTheme is unavailable or Visual Styles are disabled). // /****************************************************************************************************/ #include "metrics.hpp" #include <sstream> #include <stdexcept> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// This implementation of metrics_t uses the Win32 library to lookup font attributes. /// It returns constant values for other metrics. // class metrics_win32_t : public metrics_t { // /// Store the class name of the window which we're currently examining. // std::wstring class_name_m; protected: // /// Return the window class which we are currently returing metrics for. /// /// \return the current window class. // std::wstring get_window_class() const { return class_name_m; } public: // // from metrics_t // bool set_window(HWND window) { WCHAR class_name_buf[50]; if (!GetClassNameW(window, class_name_buf, 50)) return false; class_name_m = class_name_buf; return true; } bool get_font(int widget_type, LOGFONTW& out_font) const { // // On plain windows everything uses DEFAULT_GUI_FONT. // HGDIOBJ font = GetStockObject(DEFAULT_GUI_FONT); if (!font) return false; // // Extract a LOGFONTW from the HFONT. // int rv = GetObject(font, sizeof(out_font), reinterpret_cast<LPVOID>(&out_font)); DeleteObject(font); return (rv != 0); } bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const { // // Try to use the font from get_font before we fall back to DEFAULT_GUI_FONT. // LOGFONTW logical_font = { 0 }; HGDIOBJ font = 0; HDC tmp_dc = GetDC(0); if (get_font(widget_type, logical_font)) { font = (HGDIOBJ)CreateFontIndirectW(&logical_font); } if (!font) font = GetStockObject(DEFAULT_GUI_FONT); // // Get the metrics. // HGDIOBJ oldFont = SelectObject(tmp_dc, font); BOOL have_metrics = GetTextMetrics(tmp_dc, &out_metrics); // // Clean up. // DeleteObject(SelectObject(tmp_dc, oldFont)); ReleaseDC(0, tmp_dc); return have_metrics; } bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents) const { // // Create the font and select it into a temporary device context. // HDC tmp_dc = GetDC(0); LOGFONTW logical_font = {0}; HGDIOBJ font = 0; // // Try to use get_font, in case there is another font we're meant // to use. Then fallback on DEFAULT_GUI_FONT. // if (get_font(widget_type, logical_font)) { font = (HGDIOBJ)CreateFontIndirectW(&logical_font); } if (!font) font = GetStockObject(DEFAULT_GUI_FONT); // // Extract the extents. // HGDIOBJ original_font = SelectObject(tmp_dc, font); SIZE out_size = {0, 0}; bool have_extents = GetTextExtentPoint32W(tmp_dc, text.c_str(), text.size(), &out_size); // // Clean up, and convert the size to a rect. // DeleteObject(SelectObject(tmp_dc, original_font)); ReleaseDC(0, tmp_dc); out_extents.left = 0; out_extents.top = 0; out_extents.right = out_size.cx; out_extents.bottom = out_size.cy; return have_extents; } bool get_integer(int widget_type, int measurement, int& out_val) const { if ((widget_type == CP_DROPDOWNBUTTON) && (measurement == TMT_BORDERSIZE) && (class_name_m == L"ComboBox")) { out_val = 1; return true; } if ((widget_type == EP_EDITTEXT) && (measurement == TMT_BORDERSIZE)) { out_val = 1; return true; } out_val = 0; return false; } bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size) const { if (class_name_m == L"Button") { if ((widget_type == BP_CHECKBOX) || (widget_type == BP_RADIOBUTTON)) { // // Strictly the width of the checkbox widget is 13 pixels. // This adds some padding so that letters don't get clipped. // out_size.cx = 23; out_size.cy = 13; return true; } if (widget_type == BP_GROUPBOX) { out_size.cx = 8; out_size.cy = 8; return true; } out_size.cx = 0; out_size.cy = 0; return true; } out_size.cx = 0; out_size.cy = 0; return false; } bool get_margins(int widget_type, MARGINS& out_margins) const { if ((class_name_m == L"Button") && (widget_type == BP_PUSHBUTTON)) { out_margins.cxLeftWidth = 3; out_margins.cxRightWidth = 3; out_margins.cyTopHeight = 3; out_margins.cyBottomHeight = 3; return true; } return false; } bool using_styles() const { return false; } void draw_parent_background(HWND window, HDC dc) { // // REVISIT (ralpht): This function doesn't actually get called when visual // styles aren't available, so there's no implementation here. That // may not always be the case, however... // throw std::runtime_error("metrics::draw_parent_background not implemented without visual styles enabled"); } }; /****************************************************************************************************/ const int kState = 1; // /// This implementation of metrics_t uses the UxTheme library to obtain widget metrics. /// It inherits from the plain Win32 implementation because it occasionally falls back /// on the font functions. // class metrics_uxtheme_t : public metrics_win32_t { typedef metrics_win32_t _super; // // Handle to the UxTheme.DLL. // HMODULE theme_dll_m; // // Handle to the theme which we are currently using. // HTHEME theme_m; // // Technically all of these calls are supposed to use a state parameter. We are // only obtaining metrics, rather than drawing, so we don't actually need to // specify any particular state (as metrics should be invariant over all states). // // According to the tmschema.h (in the Platform SDK) a state of 1 should always // work. // // const int kState; // // Because we open UxTheme.DLL dynamically we need to keep function pointers into // the library. These are those. // typedef HTHEME (__stdcall *OpenThemeData_t)(HWND hwnd, LPCWSTR pszClassList); typedef HRESULT (__stdcall *CloseThemeData_t)(HTHEME hTheme); typedef HRESULT (__stdcall *GetThemeMargins_t)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT* prc, MARGINS* pMargins); typedef HRESULT (__stdcall *GetThemePartSize_t)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pRect, enum THEMESIZE eSize, SIZE* psz); typedef HRESULT (__stdcall *GetThemeInt_t)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int* piVal); typedef HRESULT (__stdcall *GetThemeTextExtent_t)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, const RECT* pBoundingRect, RECT* pExtentRect); typedef HRESULT (__stdcall *GetThemeTextMetrics_t)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, TEXTMETRIC* ptm); typedef HRESULT (__stdcall *GetThemeFont_t)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW* pFont); typedef HRESULT (__stdcall *GetThemeSysFont_t)(HTHEME hTheme, int iFontId, LOGFONTW* pFont); typedef HRESULT (__stdcall *DrawThemeParentBackground_t)(HWND window, HDC dc, LPRECT prc); typedef BOOL (__stdcall *IsThemeActive_t)(void); OpenThemeData_t OpenThemeDataPtr; CloseThemeData_t CloseThemeDataPtr; GetThemeMargins_t GetThemeMarginsPtr; GetThemePartSize_t GetThemePartSizePtr; GetThemeInt_t GetThemeIntPtr; GetThemeTextExtent_t GetThemeTextExtentPtr; GetThemeTextMetrics_t GetThemeTextMetricsPtr; GetThemeFont_t GetThemeFontPtr; GetThemeSysFont_t GetThemeSysFontPtr; IsThemeActive_t IsThemeActivePtr; DrawThemeParentBackground_t DrawThemeParentBackgroundPtr; // // We only ever try to load UxTheme.DLL once, this boolean tells us if we were // successful. // bool loaded_m; public: metrics_uxtheme_t() : theme_dll_m(0), theme_m(0), OpenThemeDataPtr(0), CloseThemeDataPtr(0), GetThemeMarginsPtr(0), GetThemePartSizePtr(0), GetThemeIntPtr(0), GetThemeTextExtentPtr(0), GetThemeTextMetricsPtr(0), GetThemeFontPtr(0), GetThemeSysFontPtr(0), IsThemeActivePtr(0), DrawThemeParentBackgroundPtr(0), loaded_m(false) { // // Try to load the UxTheme library, if we can. // theme_dll_m = LoadLibrary("UxTheme.dll"); if (!theme_dll_m) return; // // Load the addresses of the UxTheme functions. // if (!(OpenThemeDataPtr = (OpenThemeData_t)GetProcAddress(theme_dll_m, "OpenThemeData"))) return; if (!(CloseThemeDataPtr = (CloseThemeData_t)GetProcAddress(theme_dll_m, "CloseThemeData"))) return; if (!(GetThemeMarginsPtr = (GetThemeMargins_t)GetProcAddress(theme_dll_m, "GetThemeMargins"))) return; if (!(GetThemePartSizePtr = (GetThemePartSize_t)GetProcAddress(theme_dll_m, "GetThemePartSize"))) return; if (!(GetThemeIntPtr = (GetThemeInt_t)GetProcAddress(theme_dll_m, "GetThemeInt"))) return; if (!(GetThemeTextExtentPtr = (GetThemeTextExtent_t)GetProcAddress(theme_dll_m, "GetThemeTextExtent"))) return; if (!(GetThemeTextMetricsPtr = (GetThemeTextMetrics_t)GetProcAddress(theme_dll_m, "GetThemeTextMetrics"))) return; if (!(GetThemeFontPtr = (GetThemeFont_t)GetProcAddress(theme_dll_m, "GetThemeFont"))) return; if (!(GetThemeSysFontPtr = (GetThemeSysFont_t)GetProcAddress(theme_dll_m, "GetThemeSysFont"))) return; if (!(IsThemeActivePtr = (IsThemeActive_t)GetProcAddress(theme_dll_m, "IsThemeActive"))) return; if (!(DrawThemeParentBackgroundPtr = (DrawThemeParentBackground_t)GetProcAddress(theme_dll_m, "DrawThemeParentBackground"))) return; // // All loaded! // loaded_m = true; } virtual ~metrics_uxtheme_t() { if (theme_dll_m) FreeLibrary(theme_dll_m); } // /// This function returns true if the theme is active. If the theme /// is not active then the plain win32 metrics object should be used. // bool theme_active() const { if (!loaded_m) return false; return (*IsThemeActivePtr)(); } // // from metrics_t // bool set_window(HWND win) { if (!_super::set_window(win)) return false; // // Close any already open theme data, and load up the new // data. // if (theme_m) (*CloseThemeDataPtr)(theme_m); theme_m = (*OpenThemeDataPtr)(win, get_window_class().c_str()); return (theme_m != 0); } bool get_font(int widget_type, LOGFONTW& out_font) const { // // We need ensure that we have a handle to the theme before // continuing. // if (!theme_m) return false; if (widget_type != -1) { HRESULT hr = (*GetThemeFontPtr)(theme_m, 0, widget_type, kState, TMT_FONT, &out_font); if (hr == S_OK) return true; } // // This widget is a text label, most likely. Give it the // standard message box font. // if (S_OK == (*GetThemeSysFontPtr)(theme_m, TMT_MSGBOXFONT, &out_font)) return true; return false; } bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const { // // Use GetThemeMetrics for anything which isn't a text label. // if ((widget_type != -1) && theme_m) { HRESULT hr = (*GetThemeTextMetricsPtr)(theme_m, 0, widget_type, kState, &out_metrics); if (hr == S_OK) return true; } // // Let the Win32 code handle it. When the Win32 code tries to // call get_font it will call the UxTheme implementation, so // we will always use the correct font here. // return _super::get_font_metrics(widget_type, out_metrics); } bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents) const { // // We can only work if we have a non-label widget type and // valid theme handle. // if ((widget_type != -1) && theme_m) { HDC tmp_dc = GetDC(0); HRESULT hr = (*GetThemeTextExtentPtr)(theme_m, tmp_dc, widget_type, kState, text.c_str(), text.size(), 0, 0, &out_extents); ReleaseDC(0, tmp_dc); if (hr == S_OK) return true; } // // That seemed to go wrong. // return _super::get_text_extents(widget_type, text, out_extents); } bool get_integer(int widget_type, int measurement, int& out_val) const { // // We don't fallback from this function. // if ((!theme_m) || (widget_type == -1)) return false; return (S_OK == (*GetThemeIntPtr)(theme_m, widget_type, kState, measurement, &out_val)); } bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size) const { // // We don't fallback from this function. // if ((!theme_m) || (widget_type == -1)) return false; // // Create a temporary device context and call GetThemePartSize. // HDC tmp_dc = GetDC(0); HRESULT hr = (*GetThemePartSizePtr)(theme_m, tmp_dc, widget_type, kState, 0, measurement, &out_size); ReleaseDC(0, tmp_dc); return (hr == S_OK); } bool get_margins(int widget_type, MARGINS& out_margins) const { // // We don't fall back from this function. // if ((!theme_m) || (widget_type == -1)) return false; // // Use GetThemeMargins call to get the margins for this widget. // return (S_OK == (*GetThemeMarginsPtr)(theme_m, 0, widget_type, kState, TMT_CONTENTMARGINS, 0, &out_margins)); } bool using_styles() const { return theme_active(); } void draw_parent_background(HWND window, HDC dc) { if (!loaded_m) return; (*DrawThemeParentBackgroundPtr)(window, dc, 0); } }; /****************************************************************************************************/ metrics_t& metrics_t::get_instance() { static metrics_win32_t win32_instance; static metrics_uxtheme_t uxtheme_instance; if (uxtheme_instance.theme_active()) return uxtheme_instance; return win32_instance; } /****************************************************************************************************/ } /****************************************************************************************************/ --- NEW FILE: main.cpp --- /* 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) */ /****************************************************************************************************/ #include "express_viewer.hpp" #include "event_dispatcher.hpp" #include "report_exception.hpp" #include <boost/filesystem/convenience.hpp> #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <sstream> #include <ostream> #include <string> /****************************************************************************************************/ namespace { /****************************************************************************************************/ void clip_quotes(std::string& str) { // // Sometimes GetCommandLine puts double quotes at the beginning and // end of the command line (this doesn't always happen, not if the // program was started from the prompt instead of the GUI). // if( str[0] == '"' ) str = str.substr( 1, str.size() - 2 ); } /****************************************************************************************************/ void open_document(adobe::simpleApplication* app, const std::string& filename) { boost::filesystem::path file( filename, boost::filesystem::native ); std::string extension( boost::filesystem::extension( file ) ); if ( extension == ".eve") app->set_eve_file( file ); else if ( extension == ".adm") app->set_adam_file( file ); } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ bool os_initialize( simpleApplication* app ) { // // We only need to set the resource path on Windows. There are no // system events to install handlers for, etc. We say that the // resource path is the folder with the executable inside. // std::stringstream temp; std::string directory_string; std::string file1; std::string file2; temp << GetCommandLine(); temp >> directory_string; clip_quotes(directory_string); // // Now we need to get a directory from the command line name. // boost::filesystem::path directory( directory_string, boost::filesystem::native ); // // Tell the application... // app->set_resource_directory( directory.branch_path() ); temp >> file1; temp >> file2; if (file1 == std::string() || file2 == std::string()) throw std::runtime_error("You must drag and drop an Adam/Eve pair onto the app"); clip_quotes(file1); clip_quotes(file2); open_document(app, file1); open_document(app, file2); return true; } /****************************************************************************************************/ void os_mainloop() { // // This is just the standard Win32 message pump. // MSG msg; while ( GetMessage( &msg, 0, 0, 0 ) ) { // // Push every message through the event_dispatcher, in case it is a keyboard // modifier. // event_dispatcher::keyboard(msg.message, msg.wParam); // // We always pass every message though to the application anyway. // TranslateMessage( &msg ); DispatchMessage( &msg ); } } /****************************************************************************************************/ void os_end_mainloop() { // // This is just the standard Win32 quit message. // ::PostQuitMessage(0); } /****************************************************************************************************/ } /****************************************************************************************************/ int WinMain( HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR lpCmdLine, int nCmdShow ) { try { adobe::simpleApplication* theApp = adobe::simpleApplication::getInstance(); if( theApp ) theApp->run(); } catch( ... ) { adobe::report_exception(); } return 0; } --- NEW FILE: event_dispatcher.cpp --- /* 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) */ /****************************************************************************************************/ #include "event_dispatcher.hpp" #include "ui_core_implementation.hpp" #include <adobe/future/enum_ops.hpp> #include <sstream> /****************************************************************************************************/ adobe::modifiers_t convert_modifiers(ULONG os_modifiers) { adobe::modifiers_t result(adobe::modifiers_none_s); #define MAPMOD(osmod, adobemod) if (os_modifiers == (osmod)) result = result | (adobemod) // // Note that VK_MENU is the ALT key. // MAPMOD(VK_CAPITAL, adobe::modifiers_caps_lock_s); MAPMOD(VK_CONTROL, adobe::modifiers_any_control_s); MAPMOD(VK_SHIFT, adobe::modifiers_any_shift_s); MAPMOD(VK_MENU, adobe::modifiers_any_option_s); return result; } /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// This is the global single instance of the event_dispatcher, and it's /// reference count. // static event_dispatcher* event_singleton_g = 0; static unsigned int event_refcount_g = 0; /****************************************************************************************************/ event_dispatcher::event_dispatcher() : current_id_m(1000) { } /****************************************************************************************************/ LRESULT event_dispatcher::event(UINT message, WPARAM wParam, LPARAM lParam, bool& handled) { handled = false; // // Let's first ensure that we actually have an event_dispatcher to work // on. // if (!event_refcount_g) return 0; // // The child id is usually the low word of the wParam. // control_map_t& cmap(event_singleton_g->control_map_m); control_map_t::iterator control = cmap.find(LOWORD(wParam)); if (control == cmap.end()) return 0; // // We found something to invoke, so we claim that we handled the message // and return the value of the control's event method. // handled = true; return control->second->event(message, wParam, lParam); } /****************************************************************************************************/ void event_dispatcher::keyboard(UINT message, WPARAM wParam) { // // Verify that this is a keyboard message which could contain // modifiers. // if ((message != WM_KEYDOWN) && (message != WM_KEYUP) && (message != WM_SYSKEYDOWN) && (message != WM_SYSKEYUP)) return; // // Ensure that we have an event_dispatcher to work on. // if (!event_refcount_g) return; // // Look up the modifiers which this event translates to. If they // have changed since the last time then we can tell the controls // about it. // static modifiers_t previous_modifiers(modifiers_none_s); // // This is the modifier which corresponds to the key which was // just pressed or released. // modifiers_t the_modifier(convert_modifiers(wParam)); modifiers_t current_modifiers(previous_modifiers); // // Now we need to either add or remove the current modifier // from the previous modifiers. // if ((message == WM_KEYDOWN) || (message == WM_SYSKEYDOWN)) current_modifiers |= the_modifier; else current_modifiers &= ~the_modifier; // // Only dispatch to all of the children if the currently // pressed modifiers has changed. // if (previous_modifiers != current_modifiers) { // // Iterate through all of the controls and tell them of // the new modifier state. // control_map_t::iterator first = event_singleton_g->control_map_m.begin(); control_map_t::iterator last = event_singleton_g->control_map_m.end(); while (first != last) { first->second->modify(current_modifiers); first++; } } previous_modifiers = current_modifiers; } /****************************************************************************************************/ event_dispatcher::reference::reference() : child_id_m(-1) { // // If the reference count is zero then we have to allocate a new // event dispatcher. // if (!event_refcount_g) event_singleton_g = new event_dispatcher(); event_refcount_g++; } /****************************************************************************************************/ event_dispatcher::reference::~reference() { // // If we subscribed a control then it will be in the map, we // must remove that mapping so that events don't get sent there // any more. // event_dispatcher::control_map_t::iterator us = event_singleton_g->control_map_m.find(child_id_m); if (us != event_singleton_g->control_map_m.end()) event_singleton_g->control_map_m.erase(us); // // Decrease the reference count and delete the event_dispatcher // if there are no remaining references. // event_refcount_g--; if (!event_refcount_g) { delete event_singleton_g; event_singleton_g = 0; } } /****************************************************************************************************/ HMENU event_dispatcher::reference::subscribe(control_t* control) { // // If we're not given a control then we have nothing to subscribe. // if (!control) return 0; // // Store the child ID we're going to use, so that child_id can return it. // child_id_m = event_singleton_g->current_id_m++; event_singleton_g->control_map_m[child_id_m] = control; return (HMENU)child_id_m; } /****************************************************************************************************/ HMENU event_dispatcher::reference::child_id() const { return (HMENU)child_id_m; } /****************************************************************************************************/ } /****************************************************************************************************/ --- NEW FILE: ui_core_implementation.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "ui_core_implementation.hpp" #include "ui_core_common.hpp" #include "report_exception.hpp" #include "display.hpp" #include "metrics.hpp" #include "resources.h" #include <adobe/value.hpp> #include <adobe/future/memory.hpp> #include <adobe/future/enum_ops.hpp> [...4722 lines suppressed...] { #if 0 if (element.implementation().handler_ref_m) ADOBE_REQUIRE_STATUS(::RemoveEventHandler(element.implementation().handler_ref_m)); element.implementation().handler_ref_m = handle_event( ::GetControlOwner(ref), kEventClassKeyboard, kEventRawKeyModifiersChanged, handle_button_modifier_key<button_t::implementation_t>, element.implementation()); #endif } return result; } */ /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:16
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/third_party/boost_tp/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/third_party/boost_tp/adobe Added Files: boost_1_32_0_patch_01.txt Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: boost_1_32_0_patch_01.txt --- diff -ruN boost_1_32_0/boost/optional/optional.hpp boost/boost/optional/optional.hpp --- boost_1_32_0/boost/optional/optional.hpp Tue Dec 21 16:38:04 2004 +++ boost/boost/optional/optional.hpp Tue Dec 21 16:37:43 2004 @@ -635,14 +635,16 @@ bool operator >= ( optional<T> const& x, detail::none_t const& y ) { return !( x < y ) ; } +// ADOBE (sparent) : Removed unused paramter to avoid warnings. template<class T> inline -bool operator == ( detail::none_t const& x, optional<T> const& y ) +bool operator == ( detail::none_t const& /* x */, optional<T> const& y ) { return equal_pointees(optional<T>() ,y); } +// ADOBE (sparent) : Removed unused paramter to avoid warnings. template<class T> inline -bool operator < ( detail::none_t const& x, optional<T> const& y ) +bool operator < ( detail::none_t const& /* x */, optional<T> const& y ) { return less_pointees(optional<T>() ,y); } template<class T> diff -ruN boost_1_32_0/boost/range/iterator.hpp boost/boost/range/iterator.hpp --- boost_1_32_0/boost/range/iterator.hpp Tue Dec 21 16:38:21 2004 +++ boost/boost/range/iterator.hpp Tue Dec 21 16:38:34 2004 @@ -37,6 +37,17 @@ typedef BOOST_DEDUCED_TYPENAME C::iterator type; }; +/* + ADOBE (sparent) : Codewarrior 9.3 incorrectly tries to instantiate + range_iterator for constant container (though it never actually uses it) + when instantiating begin() and end(). This generates an error if C::iterator + is not defined. This stubs the struct so we can continue gracefully. +*/ + + #if BOOST_WORKAROUND(__MWERKS__, <= 0x3204) + template< typename C > struct range_iterator<const C> { }; + #endif + ////////////////////////////////////////////////////////////////////////// // pair ////////////////////////////////////////////////////////////////////////// diff -ruN boost_1_32_0/boost/signals/connection.hpp boost/boost/signals/connection.hpp --- boost_1_32_0/boost/signals/connection.hpp Tue Dec 21 16:38:50 2004 +++ boost/boost/signals/connection.hpp Tue Dec 21 16:39:09 2004 @@ -184,6 +184,11 @@ bool auto_disconnect; }; } // end namespace detail + + // ADOBE (sparent) : prototypes were missing. + void swap(scoped_connection& c1, scoped_connection& c2); + void swap(connection& c1, connection& c2); + } // end namespace BOOST_SIGNALS_NAMESPACE } // end namespace boost |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:16
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/sources Added Files: client_assembler.cpp express_viewer.cpp ui_core.cpp ui_core_common.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: ui_core_common.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "ui_core_common.hpp" #include <cassert> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ void align_slices(::adobe::rectangle_t::slice_t& slice_one, ::adobe::rectangle_t::slice_t slice_two) { // // Make sure that we have points of interest to align by. // // REVISIT (fbrereto) Are we sure we want to assert here? // assert(!slice_one.poi_m.empty()); assert(!slice_two.poi_m.empty()); // // The eventual point of interest (or baseline) is the maxiumum // of the two we have. // long poi = std::max(slice_one.poi_m[0], slice_two.poi_m[0]); // // The length of the slice is the maximum amount before the // point of interest (ascent above baseline) plus the maximum // amount after the point of interest (descent below the // baseline). // // The maximum before the point of interest is obviously the // the point of interest. // long length = poi + std::max( slice_one.length_m - slice_one.poi_m[0], slice_two.length_m - slice_two.poi_m[0]); // // Set our new values into the first slice. // slice_one.poi_m[0] = poi; slice_one.length_m = length; } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: express_viewer.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include <boost/config.hpp> #ifdef ADOBE_SERIALIZATION #include <adobe/future/iomanip_pdf.hpp> #endif #include <adobe/adam_evaluate.hpp> #include <adobe/xstr.hpp> #ifndef NDEBUG #include <iostream> #include <adobe/adam_parser.hpp> #include <adobe/istream.hpp> #endif /****************************************************************************************************/ #include <fstream> #include <sstream> #include "express_viewer.hpp" #include "client_assembler.hpp" #include "report_exception.hpp" #include <adobe/adam_parser.hpp> #include <adobe/algorithm.hpp> #include <adobe/string.hpp> #include <adobe/name.hpp> #include <adobe/dictionary.hpp> #include <adobe/config.hpp> #include <boost/version.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/filesystem/operations.hpp> #include <boost/bind.hpp> /****************************************************************************************************/ namespace bfs = boost::filesystem; /****************************************************************************************************/ const adobe::static_name_t value_key_g( "value" ); const adobe::static_name_t inspector_name_g( "inspector" ); const adobe::static_name_t inspector_dump_name_g( "inspector_dump" ); const adobe::static_name_t version_info_name_g( "version_info" ); const adobe::static_name_t update_adam_name_g( "update_adam" ); const adobe::static_name_t update_eve_name_g( "update_eve" ); const adobe::static_name_t clear_window_action_g( "clear_frames" ); const adobe::static_name_t frame_widgets_action_g( "frame_widgets" ); const adobe::static_name_t editor_adam_cell_g("adam_expression"); const adobe::static_name_t editor_eve_cell_g("eve_expression"); const adobe::static_name_t editor_error_cell_g("errors_expression"); const adobe::static_name_t editor_results_cell_g("results_expression"); const adobe::static_name_t editor_visible_tab_cell_g("tab_group_visible"); const adobe::static_name_t editor_inspector_cell_g("inspector_expression"); const adobe::static_name_t editor_inspector_result_cell_g("inspector_results"); const adobe::static_name_t editor_key_errors_tab_g("errors_stuff"); const adobe::static_name_t editor_key_results_tab_g("results_stuff"); /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ simpleApplication::simpleApplication() : _sheet_m( 0 ), _holder_m( 0 ), _editor_sheet_m( 0 ), _dialog_size_m( size_normal_s ), _initialized( false ) { } /****************************************************************************************************/ simpleApplication::~simpleApplication() { // // We have to delete _holder_m before _sheet_m. // if ( _holder_m ) delete _holder_m; if ( _sheet_m ) delete _sheet_m; } /****************************************************************************************************/ bool simpleApplication::_initialize() { if ( _initialized ) return true; // // The os_initialize function is implemented in win/main.cpp or // mac/main.cpp. // if ( !os_initialize( this ) ) return false; #if ADOBE_PLATFORM_MAC _load_metrics_glossary(); // // We need to load the editor.adm and editor.eve files. // static adobe::sheet_t editor_sheet_s; std::string editor_adm( ( _resource_dir_m / "editor.adm" ).string() ); std::string editor_eve( ( _resource_dir_m / "editor.eve" ).string() ); std::ifstream stream( editor_adm.c_str() ); // // Verify that we can open the editor.adm resource file. If we can then // parse the file into editor_sheet_s. // if ( !stream.is_open() ) throw std::runtime_error( "Can't open file: \"" + editor_adm + "\"" ); adobe::parse( stream, adobe::line_position_t( editor_adm.c_str() ), bind_to_sheet( editor_sheet_s ) ); // // The Eve view lives in this static auto pointer. This is also where // we bind the _editor_op function to the loaded widgets. // static adobe::auto_ptr<eve_client::eve_client_holder> editor_view_s( eve_client::make_view( editor_eve.c_str(), editor_sheet_s, boost::bind( &simpleApplication::_editor_op, this, _1, _2 ), size_small_s ).release() ); // // Store a pointer to the static editor sheet, so that other functions // can update it. // _editor_sheet_m = &editor_sheet_s; // // Update the sheet and show the GUI. // editor_sheet_s.update(); editor_view_s->window_m->set_visible( true ); editor_view_s->window_m->draw_controls(); #elif ADOBE_PLATFORM_WIN // REVISIT (fbrereto) Until we have the main window up and running on Win32, // we will treat Begin like a simple viewer application, // where the user drops two files (one adm, one eve) on // on the app to launch it, and the app will show the // corresponding dialog. This case is here in light of // that to pop the dialog we've been given. load_sheet(); #endif _initialized = true; return true; } /****************************************************************************************************/ void simpleApplication::_button_notifier( const adobe::name_t& name, const adobe::value_t& value ) { #ifdef ADOBE_PLATFORM_WIN // Until we have a "main window" in Win32, we quit the app when the last window is OK'd or cancelled. if (name == adobe::static_name_t("ok") || name == adobe::static_name_t("cancel")) { if (_holder_m && _holder_m->size() == 0) os_end_mainloop(); return; } #endif #ifdef ADOBE_SERIALIZATION if (name != adobe::static_name_t("ok") && name != adobe::static_name_t("cancel")) { std::stringstream result; result << adobe::begin_pdf << value << adobe::end_pdf; // // Update the adam sheet with this new output. // if ( _editor_sheet_m ) { _editor_sheet_m->set( editor_results_cell_g, adobe::value_t( result.str() ) ); _editor_sheet_m->set( editor_visible_tab_cell_g, adobe::value_t( editor_key_results_tab_g ) ); _editor_sheet_m->update(); } } #else #pragma unused( name ) #pragma unused( value ) #endif } /****************************************************************************************************/ void simpleApplication::_update_file( const bfs::path& file_name, std::string contents ) { std::ofstream output( file_name.string().c_str() ); // // Verify that we were able to open the file for writing. // if ( output.fail() ) throw std::runtime_error( "Error opening file for writing: \"" + file_name.string() + "\"" ); std::string filtered( contents ); // // REVISIT (ralpht): It might be better to have \r\n on Windows. // adobe::replace( filtered, '\r', '\n' ); output << filtered; output.close(); } /****************************************************************************************************/ void simpleApplication::_editor_op( adobe::name_t name, const adobe::value_t& value ) { try { std::string result( value.get<adobe::dictionary_t>().get<std::string>( value_key_g ) ); if ( name == inspector_name_g || name == inspector_dump_name_g || name == version_info_name_g ) { std::stringstream stream; adobe::array_t expression( adobe::parse_adam_expression( result ) ); if ( name == inspector_name_g ) { #if !defined(NDEBUG) && defined(ADOBE_SERIALIZATION) if ( !_sheet_m ) system_beep(); else stream << adobe::begin_pdf << _sheet_m->inspect( expression ) << adobe::end_pdf; #else system_beep(); #endif } else if ( name == inspector_dump_name_g ) { #if defined(ADOBE_SERIALIZATION) stream << adobe::begin_pdf << expression << adobe::end_pdf; #else system_beep(); #endif } else if ( name == version_info_name_g ) { stream << "Adobe Begin 1.0\n"; stream << "by Sean Parent, Foster Brereton and Ralph Thomas\n"; stream << "Using Adobe Source Library v. " << ADOBE_VERSION_MAJOR << "." << ADOBE_VERSION_MINOR << "." << ADOBE_VERSION_SUBMINOR << "\n"; stream << "Using Boost v. " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << "\n"; } // // Now set whatever we just streamed into the // inspector cell. // if ( _editor_sheet_m ) { _editor_sheet_m->set( editor_inspector_result_cell_g, adobe::value_t( stream.str() ) ); _editor_sheet_m->update(); } } else if ( name == update_adam_name_g ) { _update_file( _adam_path_m, result ); load_sheet(); } else if ( name == update_eve_name_g ) { _update_file( _eve_path_m, result ); display_window(); } else system_beep(); // unknown request. } catch ( ... ) { adobe::report_exception(); } } /****************************************************************************************************/ #if ADOBE_PLATFORM_MAC void simpleApplication::_load_metrics_glossary() { adobe::dictionary_t default_context(adobe::xstr_t::get_default_context()); default_context.write()[adobe::static_name_t("theme")] = adobe::value_t(adobe::static_name_t("normal")); adobe::xstr_t::set_default_context(default_context); std::ifstream metrics_glossary( ( _resource_dir_m / "metrics_glossary.xstr" ).native_file_string().c_str() ); std::string glossary(stream_sucker(metrics_glossary)); adobe::xstr_t::assign_glossary(std::make_pair(&glossary[0], &glossary[0] + glossary.size())); } #endif /****************************************************************************************************/ simpleApplication* simpleApplication::getInstance() { static simpleApplication theApp; if ( theApp._initialize() ) return &theApp; return 0; } /****************************************************************************************************/ void simpleApplication::run() { os_mainloop(); } /****************************************************************************************************/ void simpleApplication::display_window() { // // We can't display the window without a loaded sheet, or without // an Eve file to load. // if ( !bfs::exists( _eve_path_m ) || !_sheet_m ) return; if ( _editor_sheet_m ) { // // Load the Eve file into the editor window. // std::ifstream stream( _eve_path_m.string().c_str() ); std::string contents( stream_sucker( stream ) ); _editor_sheet_m->set( editor_eve_cell_g, adobe::value_t( contents ) ); _editor_sheet_m->set( editor_error_cell_g, adobe::value_t( std::string() ) ); _editor_sheet_m->update(); } // // Create a new window server if we don't already have one. // if ( !_holder_m ) { #if ADOBE_PLATFORM_MAC // We do this every time we load a window because we want to be able to see // changes reflected in the glossary without needing to relaunch the // application every time we make a change. _load_metrics_glossary(); #endif // // Note that the sheet is passed straight to the window_server // here. This is why the window server always has to be // destroyed before the sheet. // _holder_m = new eve_client::window_server_t( _eve_path_m.branch_path().string().c_str(), *_sheet_m ); _holder_m->set_action_fallback( boost::bind( &simpleApplication::_button_notifier, this, _1, _2 ) ); } // // This causes the holder to load the Eve file we pass it. We tell the // holder the directory (above) so that when it encounters an @dialog // command it knows the directory to look for the dialog in. // _holder_m->push_back( _eve_path_m.leaf().c_str(), _dialog_size_m ); } /****************************************************************************************************/ void simpleApplication::load_sheet() { std::string adam_path = _adam_path_m.string(); // // We can't make any changes to the sheet without changing the window, // so we delete the current window and then reload it once we've loaded // the new sheet. // if ( _holder_m ) { delete _holder_m; _holder_m = 0; } if ( _editor_sheet_m ) { // // Show the adam file in the editor window. // std::ifstream stream( adam_path.c_str() ); std::string contents( stream_sucker( stream ) ); _editor_sheet_m->set( editor_adam_cell_g, adobe::value_t( contents ) ); _editor_sheet_m->set( editor_error_cell_g, adobe::value_t( std::string() ) ); _editor_sheet_m->update(); } // // Destroy any existing sheet and create a new one. // if ( _sheet_m ) { delete _sheet_m; } _sheet_m = new adobe::sheet_t(); // // Open the Adam file and load it into our sheet. // std::ifstream stream( adam_path.c_str() ); adobe::parse( stream, adobe::line_position_t( adam_path.c_str() ), bind_to_sheet( *_sheet_m ) ); // // As we destroyed the window we need to recreate it, if we can. // display_window(); } /****************************************************************************************************/ void simpleApplication::clear_window_frames() { if ( _holder_m ) _holder_m->dispatch_action( clear_window_action_g, adobe::value_t() ); else system_beep(); } /****************************************************************************************************/ void simpleApplication::frame_window() { if ( _holder_m ) _holder_m->dispatch_action( frame_widgets_action_g, adobe::value_t() ); else system_beep(); } /****************************************************************************************************/ void simpleApplication::serialize_connections() { #ifdef ADOBE_SERIALIZATION if ( !_holder_m || !_editor_sheet_m ) return; std::stringstream result; // // Generate the serialized output. // result << adobe::begin_pdf; _holder_m->serialize_widgets( result ); result << adobe::end_pdf; // // Put the resulting text into the editor. // _editor_sheet_m->set( editor_results_cell_g, adobe::value_t( result.str() ) ); _editor_sheet_m->set( editor_visible_tab_cell_g, adobe::value_t( editor_key_results_tab_g ) ); _editor_sheet_m->update(); #endif } /****************************************************************************************************/ void simpleApplication::set_eve_file( bfs::path file_name ) { _eve_path_m = file_name; } /****************************************************************************************************/ void simpleApplication::set_adam_file( bfs::path file_name ) { _adam_path_m = file_name; } /****************************************************************************************************/ void simpleApplication::set_resource_directory( bfs::path res_path ) { _resource_dir_m = res_path; } /****************************************************************************************************/ void simpleApplication::set_dialog_size( size_enum_t s ) { _dialog_size_m = s; } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: ui_core.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "ui_core.hpp" #include "ui_core_implementation.hpp" #include "report_exception.hpp" #include <adobe/value.hpp> #include <adobe/future/memory.hpp> #include <adobe/future/enum_ops.hpp> #include <adobe/algorithm.hpp> /****************************************************************************************************/ [...1057 lines suppressed...] ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(radio_button_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(checkbox_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(link_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(progress_bar_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(separator_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(static_text_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(edit_text_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(popup_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(unit_edit_text_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(slider_t); ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(bevel_button_t); #ifndef NDEBUG ADOBE_IMPLEMENTATION_ACCESSOR_FUNCTIONALITY(hitless_t); #endif // NDEBUG /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: client_assembler.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "client_assembler.hpp" #include <iostream> #include <cassert> #include <fstream> #include <string> #include <boost/config.hpp> #include <boost/optional.hpp> #include <adobe/cmath.hpp> [...3306 lines suppressed...] result_eve->set_debug_frame_proc(my_framer(*token.root_m)); #endif result->eve_m = result_eve; result->window_m = token.root_m; result->assemblage_m.delete_on_destruction(result->eve_m); result->contributing_m = sheet.contributing(); #if 0 result->assemblage_m.delete_on_destruction(result->window_m); #endif return result; } /****************************************************************************************************/ } // namespace eve_client /****************************************************************************************************/ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:16
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/visual.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/visual.xcode Added Files: project.pbxproj Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: project.pbxproj --- // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 39; objects = { 0249A66BFF388E3F11CA2CEA = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libstdc++.a"; path = "/usr/lib/libstdc++.a"; refType = 0; sourceTree = "<absolute>"; }; //020 //021 //022 //023 //024 //080 //081 //082 //083 //084 0867D6AAFE840B52C02AAC07 = { children = ( 0867D6ABFE840B52C02AAC07, ); isa = PBXVariantGroup; name = InfoPlist.strings; refType = 4; sourceTree = "<group>"; }; 0867D6ABFE840B52C02AAC07 = { fileEncoding = 10; isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; refType = 4; sourceTree = "<group>"; }; //080 //081 //082 //083 //084 //190 //191 //192 //193 //194 195DF8CFFE9D517E11CA2CBB = { children = ( 8D0C4E970486CD37000505A6, ); isa = PBXGroup; name = Products; refType = 4; sourceTree = "<group>"; }; //190 //191 //192 //193 //194 //200 //201 //202 //203 //204 20286C28FDCF999611CA2CEA = { buildSettings = { }; buildStyles = ( 4A9504C5FFE6A39111CA0CBA, 4A9504C6FFE6A39111CA0CBA, ); hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 20286C29FDCF999611CA2CEA; projectDirPath = ""; targets = ( 8D0C4E890486CD37000505A6, ); }; 20286C29FDCF999611CA2CEA = { children = ( 32DBCF6D0370B57F00C91783, 894E67BC07F8593B00C05327, 20286C2AFDCF999611CA2CEA, 894E675D07F5C0BC00C05327, 20286C2CFDCF999611CA2CEA, 20286C32FDCF999611CA2CEA, 195DF8CFFE9D517E11CA2CBB, ); isa = PBXGroup; name = visual; path = ""; refType = 4; sourceTree = "<group>"; }; 20286C2AFDCF999611CA2CEA = { children = ( 89C483CF07F10216007FD3D0, 89C4838E07F06DB5007FD3D0, 89C4838F07F06DB5007FD3D0, 89C4839007F06DB5007FD3D0, ); isa = PBXGroup; path = sources; refType = 2; sourceTree = SOURCE_ROOT; }; 20286C2CFDCF999611CA2CEA = { children = ( 89C483A907F072F6007FD3D0, 89C483AA07F072F6007FD3D0, 89C483AB07F072F6007FD3D0, 89C483AC07F072F6007FD3D0, 89C483AD07F072F6007FD3D0, 89C483AE07F072F6007FD3D0, 8D0C4E960486CD37000505A6, 0867D6AAFE840B52C02AAC07, ); isa = PBXGroup; name = Resources; path = ""; refType = 4; sourceTree = "<group>"; }; 20286C32FDCF999611CA2CEA = { children = ( 20286C33FDCF999611CA2CEA, 4A9504CAFFE6A41611CA0CBA, 4A9504C8FFE6A3BC11CA0CBA, 0249A66BFF388E3F11CA2CEA, 89323C5D07FA2E4200AB4B9B, 89323CD007FA34E600AB4B9B, ); isa = PBXGroup; name = "External Frameworks and Libraries"; path = ""; refType = 4; sourceTree = "<group>"; }; 20286C33FDCF999611CA2CEA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; refType = 0; sourceTree = "<absolute>"; }; //200 //201 //202 //203 //204 //320 //321 //322 //323 //324 32DBCF6D0370B57F00C91783 = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = visual_Prefix.pch; refType = 2; sourceTree = SOURCE_ROOT; }; //320 //321 //322 //323 //324 //4A0 //4A1 //4A2 //4A3 //4A4 4A9504C5FFE6A39111CA0CBA = { buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; ZERO_LINK = YES; }; isa = PBXBuildStyle; name = Development; }; 4A9504C6FFE6A39111CA0CBA = { buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Deployment; }; 4A9504C8FFE6A3BC11CA0CBA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; refType = 0; sourceTree = "<absolute>"; }; 4A9504CAFFE6A41611CA0CBA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; refType = 0; sourceTree = "<absolute>"; }; //4A0 //4A1 //4A2 //4A3 //4A4 //890 //891 //892 //893 //894 89323BAC07FA26C800AB4B9B = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = express_viewer.hpp; refType = 4; sourceTree = "<group>"; }; 89323C5D07FA2E4200AB4B9B = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = libasl_dev.a; path = ../../build/asl_lib/build/libasl_dev.a; refType = 2; sourceTree = SOURCE_ROOT; }; 89323C5E07FA2E4200AB4B9B = { fileRef = 89323C5D07FA2E4200AB4B9B; isa = PBXBuildFile; settings = { }; }; 89323CD007FA34E600AB4B9B = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost.a; path = ../../build/boost_lib/build/libboost.a; refType = 2; sourceTree = SOURCE_ROOT; }; 89323CD107FA34E600AB4B9B = { fileRef = 89323CD007FA34E600AB4B9B; isa = PBXBuildFile; settings = { }; }; 89323CF407FA39F300AB4B9B = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; refType = 4; sourceTree = "<group>"; }; 89323CF507FA39F300AB4B9B = { fileRef = 89323CF407FA39F300AB4B9B; isa = PBXBuildFile; settings = { }; }; 894E675D07F5C0BC00C05327 = { children = ( 894E676F07F5C13400C05327, 894E676007F5C0EF00C05327, 894E678D07F5C33000C05327, 89323BAC07FA26C800AB4B9B, 894E678407F5C31C00C05327, 894E676107F5C0EF00C05327, ); isa = PBXGroup; path = headers; refType = 2; sourceTree = SOURCE_ROOT; }; 894E676007F5C0EF00C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = client_assembler.hpp; refType = 4; sourceTree = "<group>"; }; 894E676107F5C0EF00C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ui_core.hpp; refType = 4; sourceTree = "<group>"; }; 894E676F07F5C13400C05327 = { children = ( 894E677007F5C13400C05327, 89E1C14A080C56F1002A2B83, 894E677107F5C13400C05327, ); isa = PBXGroup; path = mac; refType = 4; sourceTree = "<group>"; }; 894E677007F5C13400C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = carbon_safe.hpp; refType = 4; sourceTree = "<group>"; }; 894E677107F5C13400C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ui_core_implementation.hpp; refType = 4; sourceTree = "<group>"; }; 894E678407F5C31C00C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = report_exception.hpp; refType = 4; sourceTree = "<group>"; }; 894E678D07F5C33000C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = display.hpp; refType = 4; sourceTree = "<group>"; }; 894E67B007F5C7B000C05327 = { fileRef = 89C4838E07F06DB5007FD3D0; isa = PBXBuildFile; settings = { }; }; 894E67BC07F8593B00C05327 = { children = ( 894E67BF07F8596500C05327, ); isa = PBXGroup; name = adobe; path = ../..; refType = 2; sourceTree = SOURCE_ROOT; }; 894E67BF07F8596500C05327 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = functional.hpp; refType = 4; sourceTree = "<group>"; }; 894E67CC07F85CEC00C05327 = { fileRef = 89C483D007F10216007FD3D0; isa = PBXBuildFile; settings = { }; }; 894E67CD07F85CF500C05327 = { fileRef = 89C4838F07F06DB5007FD3D0; isa = PBXBuildFile; settings = { }; }; 894E67CF07F85CFB00C05327 = { fileRef = 89C4839007F06DB5007FD3D0; isa = PBXBuildFile; settings = { }; }; 894E67D007F85CFD00C05327 = { fileRef = 89C483D107F10216007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C4838E07F06DB5007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = client_assembler.cpp; refType = 4; sourceTree = "<group>"; }; 89C4838F07F06DB5007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = express_viewer.cpp; refType = 4; sourceTree = "<group>"; }; 89C4839007F06DB5007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ui_core.cpp; refType = 4; sourceTree = "<group>"; }; 89C483A907F072F6007FD3D0 = { isa = PBXFileReference; lastKnownFileType = image.icns; name = AppIcon.icns; path = resources/AppIcon.icns; refType = 4; sourceTree = "<group>"; }; 89C483AA07F072F6007FD3D0 = { isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Begin.nib; path = resources/Begin.nib; refType = 4; sourceTree = "<group>"; }; 89C483AB07F072F6007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = text; name = editor.adm; path = resources/editor.adm; refType = 4; sourceTree = "<group>"; }; 89C483AC07F072F6007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = text; name = editor.eve; path = resources/editor.eve; refType = 4; sourceTree = "<group>"; }; 89C483AD07F072F6007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = text; name = eve_globals.scp; path = resources/eve_globals.scp; refType = 4; sourceTree = "<group>"; }; 89C483AE07F072F6007FD3D0 = { isa = PBXFileReference; lastKnownFileType = image.png; name = link_icon.png; path = resources/link_icon.png; refType = 4; sourceTree = "<group>"; }; 89C483AF07F072F6007FD3D0 = { fileRef = 89C483A907F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483B007F072F6007FD3D0 = { fileRef = 89C483AA07F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483B107F072F6007FD3D0 = { fileRef = 89C483AB07F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483B207F072F6007FD3D0 = { fileRef = 89C483AC07F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483B307F072F6007FD3D0 = { fileRef = 89C483AD07F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483B407F072F6007FD3D0 = { fileRef = 89C483AE07F072F6007FD3D0; isa = PBXBuildFile; settings = { }; }; 89C483CF07F10216007FD3D0 = { children = ( 89C483D007F10216007FD3D0, 89323CF407FA39F300AB4B9B, 89C483D107F10216007FD3D0, ); isa = PBXGroup; path = mac; refType = 4; sourceTree = "<group>"; }; 89C483D007F10216007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = display.cpp; refType = 4; sourceTree = "<group>"; }; 89C483D107F10216007FD3D0 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ui_core_implementation.cpp; refType = 4; sourceTree = "<group>"; }; 89E1C14A080C56F1002A2B83 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = metrics.hpp; refType = 4; sourceTree = "<group>"; }; //890 //891 //892 //893 //894 //8D0 //8D1 //8D2 //8D3 //8D4 8D0C4E890486CD37000505A6 = { buildPhases = ( 8D0C4E8C0486CD37000505A6, 8D0C4E8F0486CD37000505A6, 8D0C4E910486CD37000505A6, ); buildRules = ( ); buildSettings = { GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = visual_Prefix.pch; HEADER_SEARCH_PATHS = "../../../ ../../../third_party/boost_tp/boost/"; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "/Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/build/asl_lib/build /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/build/boost_lib/build"; PRODUCT_NAME = "Adobe Begin"; WARNING_CFLAGS = "-Wno-long-double"; WRAPPER_EXTENSION = app; }; dependencies = ( ); isa = PBXNativeTarget; name = visual; productInstallPath = "$(HOME)/Applications"; productName = visual; productReference = 8D0C4E970486CD37000505A6; productType = "com.apple.product-type.application"; }; 8D0C4E8C0486CD37000505A6 = { buildActionMask = 2147483647; files = ( 8D0C4E8D0486CD37000505A6, 89C483AF07F072F6007FD3D0, 89C483B007F072F6007FD3D0, 89C483B107F072F6007FD3D0, 89C483B207F072F6007FD3D0, 89C483B307F072F6007FD3D0, 89C483B407F072F6007FD3D0, ); isa = PBXResourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D0C4E8D0486CD37000505A6 = { fileRef = 0867D6AAFE840B52C02AAC07; isa = PBXBuildFile; settings = { }; }; 8D0C4E8F0486CD37000505A6 = { buildActionMask = 2147483647; files = ( 894E67B007F5C7B000C05327, 894E67CC07F85CEC00C05327, 894E67CD07F85CF500C05327, 894E67CF07F85CFB00C05327, 894E67D007F85CFD00C05327, 89323CF507FA39F300AB4B9B, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D0C4E910486CD37000505A6 = { buildActionMask = 2147483647; files = ( 8D0C4E920486CD37000505A6, 8D0C4E930486CD37000505A6, 89323C5E07FA2E4200AB4B9B, 89323CD107FA34E600AB4B9B, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D0C4E920486CD37000505A6 = { fileRef = 20286C33FDCF999611CA2CEA; isa = PBXBuildFile; settings = { }; }; 8D0C4E930486CD37000505A6 = { fileRef = 0249A66BFF388E3F11CA2CEA; isa = PBXBuildFile; settings = { }; }; 8D0C4E960486CD37000505A6 = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; refType = 4; sourceTree = "<group>"; }; 8D0C4E970486CD37000505A6 = { explicitFileType = wrapper.application; includeInIndex = 0; isa = PBXFileReference; path = "Adobe Begin.app"; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; }; }; rootObject = 20286C28FDCF999611CA2CEA; } |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:16
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/resources Added Files: AppIcon.icns Begin.plc aqua_button.ico aqua_button.psd editor.adm editor.eve eve_globals.scp link_icon.png metrics_glossary.xstr resources.h resources.rc visual.exe.manifest Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: eve_globals.scp --- margin = 10; space = 10; gap = 8; // measured as space from popup to label. large_space = 20; place_row = @place_row; dialog = {margin: margin, spacing: large_space, placement: place_row}; --- NEW FILE: resources.h --- /* 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) */ // /// This file defines the integer IDs for all of the resources /// which are built into visual.exe. // /****************************************************************************************************/ // /// The main application icon. // #define RES_APP_ICON 2 /****************************************************************************************************/ --- NEW FILE: metrics_glossary.xstr --- <xstr id='metric:global'>{ gap: 4 }</xstr> <xstr id='metric:checkbox'> { size: [ 18, 16 ], adjust_size: [ 4, 2 ], spacing: 4, adjust_position: [ -2, 1 ], outset: [ 0, 2, 0, 0 ], adjust_baseline: -1 }</xstr> <xstr id='metric:checkbox' theme='small'> { size: [ 15, 14 ], adjust_size: [ 3, 2 ], spacing: 6, adjust_position: [ -1, 1 ], outset: [ 0, 2, 0, 0 ], adjust_baseline: -1 }</xstr> <xstr id='metric:checkbox' theme='mini'> { size: [ 10, 10 ], spacing: 4, outset: [ 0, 1, 0, 0 ] }</xstr> <xstr id='metric:radio_button'> { size: [ 19, 16 ], adjust_size: [ 5, 1 ], spacing: 4, adjust_position: [ -1, 1 ], outset: [ 1, 0, 1, 1 ] }</xstr> <xstr id='metric:radio_button' theme='small'> { size: [ 14, 13 ], spacing: 4, adjust_position: [ 0, 1 ], outset: [ 0, 0, 0, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:radio_button' theme='mini'> { size: [ 10, 10 ], spacing: 4, outset: [ 0, 0, 0, 1 ], adjust_baseline: 1 }</xstr> <xstr id='metric:button'> { size: [ 20, 21 ], adjust_baseline: 2 }</xstr> <xstr id='metric:button' theme='small'> { size: [ 20, 18 ], adjust_size: [ -2, 0 ], adjust_position: [ 1, -1 ], adjust_baseline: 2 }</xstr> <xstr id='metric:button' theme='mini'> { size: [ 20, 15 ], adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ], adjust_baseline: 2 }</xstr> <xstr id='metric:group'> { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 14, 1, 1 ] }</xstr> <xstr id='metric:group' theme='small'> { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 14, 1, 1 ] }</xstr> <xstr id='metric:group' theme='mini'> { size: [ 0, 12 ], adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 12, 1, 1 ] }</xstr> <xstr id='metric:tab_group'> { 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'> { 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'> { size: [ 3, 19 ], adjust_size: [ -2, -2 ], adjust_position: [ 7, 7 ], outset: [ 4, 4, 4, 4 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='small'> { size: [ 4, 16 ], adjust_size: [ -2, -2 ], adjust_position: [ 7, 7 ], outset: [ 4, 4, 4, 4 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='false' theme='mini'> { size: [ 4, 13 ], adjust_size: [ -2, -2 ], adjust_position: [ 7, 7 ], outset: [ 4, 4, 4, 4 ], adjust_baseline: 3 }</xstr> <xstr id='metric:edit_text' scroll='true'> { 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'> { adjust_size: [ 2, -1 ], 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'> { adjust_size: [ 1, -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.plc --- // Change this to your bundle identifier string #define kBundleIdentifier "com.adobe.begin" // Change this to your short version string #define kBundleShortVersion __OUTPUT_FILENAME__ " version 1.0" // Change this to the string to display in the Finder's Get Info window #define kBundleGetInfo kBundleShortVersion ", Copyright © 2004 by Adobe Systems, Inc. All rights reserved." plist { dictionary { key "CFBundleIdentifier" value string kBundleIdentifier key "CFBundleName" value string __OUTPUT_FILENAME__ key "CFBundleGetInfoString" value string kBundleGetInfo key "CFBundleShortVersionString" value string kBundleShortVersion key "CFBundlePackageType" value string __OUTPUT_TYPE__ key "CFBundleSignature" value string __OUTPUT_CREATOR__ key "CFBundleExecutable" value string __OUTPUT_FILENAME__ key "CFBundleVersion" value string "1.0" key "CFBundleDevelopmentRegion" value string "English" key "CFBundleInfoDictionaryVersion" value string "6.0" key "LSRequiresCarbon" value boolean true key "CFBundleIconFile" value string "AppIcon.icns" key "CFBundleDocumentTypes" value array [ dictionary { key "CFBundleTypeExtensions" value array [ string "eve" string "adm" ] } ] } } // Change this to be localized for English localize "English" { comment "Localized versions of Info.plist keys" key "CFBundleName" value string __OUTPUT_FILENAME__ key "CFBundleGetInfoString" value string kBundleGetInfo key "CFBundleShortVersionString" value string kBundleShortVersion key "CFBundleIconFile" value string "AppIcon.icns" } --- NEW FILE: link_icon.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: editor.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Editor", 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: "Adam", value: @adam_stuff }, { name: "Eve", value: @eve_stuff }, { name: "Inspector", value: @inspector_stuff }, { name: "Results", value: @results_stuff }, { name: "Errors", value: @errors_stuff } ]) { panel() { edit_text(bind: @adam_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); button(name: "Update", bind: @adam_expression, action: @update_adam, vertical: align_bottom); } panel() { edit_text(bind: @eve_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); button(name: "Update", bind: @eve_expression, action: @update_eve, vertical: align_bottom); } panel() { row(vertical: align_top, horizontal: align_fill) { edit_text(bind: @inspector_expression, name: "Expression:", characters: 30, horizontal: align_fill); button( horizontal: align_right, items: [ { name: "Execute", bind: @inspector_expression, action: @inspector }, { name: "Dump", bind: @inspector_expression, action: @inspector_dump, modifiers: @opt }, { name: "Version", bind: @inspector_expression, action: @version_info, modifiers: @cmd } ]); } edit_text(name: "Results:", bind: @inspector_results, lines: 10, characters: 30, scrollable: true, monospaced: true, vertical: align_fill, horizontal: align_fill); } panel() { edit_text(bind: @results_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } panel() { edit_text(bind: @errors_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } } } --- NEW FILE: AppIcon.icns --- (This appears to be a binary file; contents omitted.) --- NEW FILE: resources.rc --- #include "windows.h" // // Include the visual styles manifest. // CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "resources\\visual.exe.manifest" // // Include some icons. The icon with the lowest number seems to be // the one which the Windows shell shows. // 2 ICON "resources\\aqua_button.ico" --- NEW FILE: aqua_button.psd --- (This appears to be a binary file; contents omitted.) --- NEW FILE: visual.exe.manifest --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="*" version="5.1.0.0" type="win32" name="Microsoft.Windows.Shell.shell32" /> <description>Windows Shell</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*" /> </dependentAssembly> </dependency> </assembly> --- NEW FILE: aqua_button.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: editor.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet editor { interface: tab_group_visible : @adam_stuff; adam_expression : ""; eve_expression : ""; results_expression : ""; errors_expression : ""; inspector_expression : ""; inspector_results : ""; invariant: adam_non_empty <== adam_expression != ""; eve_non_empty <== eve_expression != ""; expression_non_empty <== inspector_expression != ""; } |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:15
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/sources/mac Added Files: display.cpp main.cpp metrics.cpp ui_core_implementation.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: display.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "display.hpp" #include "carbon_safe.hpp" #include "report_exception.hpp" /****************************************************************************************************/ namespace { /****************************************************************************************************/ struct view_wrap { explicit view_wrap(HIViewRef ref) : ref_m(ref) { } HIViewRef ref_m; }; /****************************************************************************************************/ HIViewRef unwrap(adobe::display_t::position_t& position) { return (boost::any_cast<view_wrap>(position)).ref_m; } /****************************************************************************************************/ adobe::display_t::position_t wrap(HIViewRef view) { return adobe::display_t::position_t(view_wrap(view)); } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ struct root_token { }; /****************************************************************************************************/ display_t& get_main_display() { static display_t display_s; return display_s; } /****************************************************************************************************/ struct display_t::implementation_t { void erase(display_t::position_t& position); std::vector<HIViewRef> roots_m; }; /****************************************************************************************************/ template <typename DisplayElement> display_t::position_t insert(display_t& display, display_t::position_t& position, DisplayElement& element) { return display.insert(position, element); } /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ display_t::display_t() : object_m(new implementation_t()) { } display_t::~display_t() { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() { return *object_m; } const display_t::implementation_t& display_t::implementation() const { return *object_m; } display_t::position_t display_t::root() { return display_t::position_t(root_token()); } void display_t::erase(position_t& position) { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) { return insert(parent, adobe::view_for_element<HIViewRef>(element)); } /****************************************************************************************************/ template <> display_t::position_t display_t::insert<HIViewRef>(position_t& parent, HIViewRef& element) { if (parent.type() == typeid(view_wrap)) { HIViewRef parent_view(unwrap(parent)); ADOBE_REQUIRE_STATUS(::HIViewAddSubview(parent_view, element)); } else if (parent.type() == typeid(root_token)) { object_m->roots_m.push_back(element); } return wrap(element); } /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ void display_t::implementation_t::erase(display_t::position_t&) { // REVISIT (fbrereto) : What should we do here? // 1) Call DetachSubView on the position? // 2) Call erase recursively for all children of the position? // 3) Invalidate (wipe) the position data? // 4) Invoke some (currently nonexistent) detach() callback for the client? // 4a) With what parameters, considering questions 1, 2, & 3? } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: metrics.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "metrics.hpp" #include "report_exception.hpp" #include <adobe/xstr.hpp> #include <adobe/virtual_machine.hpp> #include <adobe/source/expression_parser.hpp> #include <adobe/name.hpp> #include <adobe/dictionary.hpp> #include <adobe/array.hpp> #include <sstream> /****************************************************************************************************/ namespace { /****************************************************************************************************/ /****************************************************************************************************/ } // namespace /****************************************************************************************************/ #if 0 #pragma mark - #endif /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ dictionary_t widget_metrics(const std::string& xstr, const dictionary_t& context) { dictionary_t result; try { const char* cxstr(xstr.c_str()); std::size_t n(xstr.size()); std::stringstream expression_stream(std::string(xstr_t(cxstr, n, context).get())); expression_parser parser(expression_stream, line_position_t("widget_metrics")); array_t expression; parser.require_expression(expression); virtual_machine_t machine; machine.evaluate(expression); result = machine.back().value_m.template get<adobe::dictionary_t>(); } catch(...) { report_exception(); } return result; } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: main.cpp --- /* 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) */ /****************************************************************************************************/ #include "express_viewer.hpp" #include "report_exception.hpp" #include "carbon_safe.hpp" #include <boost/filesystem/convenience.hpp> #include <adobe/xstr.hpp> #include <sstream> #include <string> /****************************************************************************************************/ #define kHICommandRefreshView 'Reld' #define kHICommandRefreshSheet 'RfsS' #define kHICommandNormalDialogSize 'NrSz' #define kHICommandSmallDialogSize 'SmSz' #define kHICommandMiniDialogSize 'MnSz' #define kHICommandFrameWidgets 'TgFm' #define kHICommandClearWidgetFrames 'ClFr' #define kHICommandSerializeWidgets 'SzWg' const CFStringRef kMainNibFileName (CFSTR( "Begin" )); const CFStringRef kMenuBarNibName (CFSTR( "MenuBar" )); /****************************************************************************************************/ namespace bfs = boost::filesystem; /****************************************************************************************************/ namespace { /****************************************************************************************************/ // /// Convert a MacOS FSRef into a Boost path. This allows us to use the /// boost::filesystem library to perform operations on the path, rather /// 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); OSErr 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 ); } /****************************************************************************************************/ // /// Attempt to open the documents in the given AEDescList. // void OpenTheDocuments(AEDescList* documents) { adobe::simpleApplication* theApp = adobe::simpleApplication::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(); } /****************************************************************************************************/ // /// 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 } /****************************************************************************************************/ // /// Handle commands coming from the menubar. /// /// \param handler the next handler to call. /// \param event description of the event. /// \param data the simpleApplication we need to communicate with. // static pascal OSStatus menu_command( EventHandlerCallRef /*handler*/, EventRef event, void* data ) try { adobe::simpleApplication* theApp( static_cast<adobe::simpleApplication*>( 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 kHICommandSerializeWidgets: theApp->serialize_connections(); 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; } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// These template ensures that the static auto_ptr event handlers get /// released when the app closes. // template<> struct adobe::delete_ptr<AEEventHandlerUPP> { void operator()( AEEventHandlerUPP x ) const { if( x ) DisposeAEEventHandlerUPP( x ); } }; /****************************************************************************************************/ template<> struct adobe::delete_ptr<EventHandlerUPP> { void operator()( EventHandlerUPP x ) const { if( x ) DisposeEventHandlerUPP( x ); } }; /****************************************************************************************************/ bool os_initialize( adobe::simpleApplication* 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 ); // // Now that we've finished initializing we can set the cursor to // a pointy arrow (instead of the hourglass). // InitCursor(); // // Register this app as an Appearance Client // RegisterAppearanceClient(); return true; } /****************************************************************************************************/ void os_mainloop() { RunApplicationEventLoop(); } /****************************************************************************************************/ void os_end_mainloop() { QuitApplicationEventLoop(); } /****************************************************************************************************/ } /****************************************************************************************************/ int main() { try { adobe::simpleApplication* theApp = adobe::simpleApplication::getInstance(); if( theApp ) theApp->run(); } catch( ... ) { adobe::report_exception(); } return 0; } /****************************************************************************************************/ --- NEW FILE: ui_core_implementation.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include "ui_core_implementation.hpp" #include "ui_core_common.hpp" #include "carbon_safe.hpp" #include "report_exception.hpp" #include "display.hpp" #include "metrics.hpp" #include <adobe/algorithm.hpp> #include <adobe/array.hpp> #include <adobe/dictionary.hpp> [...5130 lines suppressed...] ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(group_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(tab_group_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(panel_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(radio_button_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(checkbox_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(link_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(progress_bar_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(separator_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(slider_t); ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(bevel_button_t); #ifndef NDEBUG ADOBE_VIEW_FOR_ELEMENT_AND_INSERT_BOILERPLATE_SPECIALIZATION(hitless_t); #endif // NDEBUG /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:15
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/headers/win Added Files: event_dispatcher.hpp metrics.hpp ui_core_implementation.hpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: metrics.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) */ /****************************************************************************************************/ // // This header defines a class which can return various widget metrics // on Windows systems. When available the UXTHEME library is used to // discover metrics. When UXTHEME is not available some reasonable // defaults (precalculated on a system with UXTHEME) are returned. // /****************************************************************************************************/ #ifndef ADOBE_METRICS_HPP #define ADOBE_METRICS_HPP /****************************************************************************************************/ #include <windows.h> #include <uxtheme.h> #include <tmschema.h> #include <string> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ // /// The metrics_t class is a singleton which can fetch information /// on ideal widget sizes. There are two possible designs here: /// <ol> /// <li>Provide simple metric and text information.</li> /// <li>Provide ideal sizes for specific widgets.</li> /// </ol> /// It has been chosen to take design (1), the calculation of /// individual widget ideal sizes belongs in the ui_core_implementation /// code. This class is a singleton, a reference to it has to be /// obtained using metrics_t::getInstance . /// /// All of the functions which return metrics require the widget type /// and state of the widget. A table of all the part and state names /// is available here: /// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp // class metrics_t { public: // /// Return a reference to the single instance of metrics_t. /// /// \return a reference to the single instance of metrics_t. // static metrics_t& get_instance(); // /// Get the correct font to use for the given widget. This font must /// be used for the font metrics to be correct. /// /// \param widget_type the type of the widget. /// \param out_font a reference filled with the requested font. /// /// \return true if the font was returned successfully, false if /// the font could not be returned. // virtual bool get_font(int widget_type, LOGFONTW& out_font) const = 0; // /// Get the metrics for the font which should be used in the given widget. /// /// \param widget_type the type of the widget. /// \param out_metrics a reference filled with the text metrics. /// /// \return true if the font metrics were returned successfully, false /// if the metrics could not be returned. // virtual bool get_font_metrics(int widget_type, TEXTMETRIC& out_metrics) const = 0; // /// Get the extents for the given text string, to be contained in the /// specified widget. /// /// \param widget_type the type of the widget. /// \param text the string to return the extents for. /// \param out_extents a reference filled with the text extents. /// /// \return true if the text extents were returned successfully, false /// if the metrics could not be returned. // virtual bool get_text_extents(int widget_type, std::wstring text, RECT& out_extents) const = 0; // /// Get the specified measurement for the given widget when in the /// given state. /// /// \param widget_type the type of the widget. /// \param measurement the required measurement. /// \param out_val a reference filled with the requested value. /// /// \return true if the value was returned successfully, false /// if the value could not be found. // virtual bool get_integer(int widget_type, int measurement, int& out_val) const = 0; // /// Get the size of the specified widget. /// /// \param widget_type the type of the widget. /// \param measurement the size to get: TS_MIN, TS_TRUE, or TS_DRAW. /// \param out_size a reference filled with the requested rectangle. /// /// \return true if the rectangle was returned successfully, false /// if the rectangle could not be found. // virtual bool get_size(int widget_type, THEMESIZE measurement, SIZE& out_size) const = 0; // /// Get the margins for the specified widget. Typically the margins /// describe space which must be added around the text rectangle for /// controls with a caption. /// /// \param widget_type the type of the widget. /// \param out_margins a reference filled with the margins of the widget. /// /// \return true if the margins were returned successfully, false /// if the margins could not be found. // virtual bool get_margins(int widget_type, MARGINS& out_margins) const = 0; // /// Return true if visual styles are currently in use, false if they /// are not being used. /// /// \return true if visual styles are in use, false otherwise. // virtual bool using_styles() const = 0; // /// Use the current style to draw the background of the parent control /// of the given window using the given DC. This function is useful for /// drawing the background of controls which appear on top of tab controls, /// or other places where the color isn't regulation. /// /// \param window the window to draw the parent background of. /// \param dc the DC to draw with. This DC does not have to be /// drawing onto the given window. // virtual void draw_parent_background(HWND window, HDC dc) = 0; // /// Before any of the other functions can be called, the theme data must be /// loaded from the window. This function should also be called any time the /// window recieves a WM_THEMECHANGED message. /// /// \param window the window to get the theme from. Note that it is not /// important which window is used, it does not have to /// be the same window every time. /// /// \return true if the theme was obtained from the window, false if the /// theme could not be obtained from the window. // virtual bool set_window(HWND window) = 0; virtual ~metrics_t() { } }; /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif --- NEW FILE: ui_core_implementation.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_UI_CORE_IMPLEMENTATION_HPP #define ADOBE_UI_CORE_IMPLEMENTATION_HPP /****************************************************************************************************/ #include <windows.h> #include <Commctrl.h> #include "ui_core.hpp" #include "event_dispatcher.hpp" #include <adobe/future/memory.hpp> #include <adobe/rectangle.hpp> #include <adobe/dictionary_fwd.hpp> /****************************************************************************************************/ #define ADOBE_DELETE_PTR_SPECIALIZATION(type, func) \ template <> \ struct adobe::delete_ptr<##type> \ { \ void operator()(##type x) const \ { if (x) func(x); } \ } /****************************************************************************************************/ extern const RECT initial_bounds_g; /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ #ifndef NDEBUG struct hitless_t : boost::totally_ordered<hitless_t> { struct implementation_t; hitless_t(); hitless_t(const hitless_t& rhs); ~hitless_t(); void initialize(window_t& window); void set_bounds(const point_t& position, const rectangle_t& geometry); private: ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::hitless_t); friend void frame_geometry(window_t& window, const point_t& position, const rectangle_t& geometry); friend bool clear_geometry_frames(window_t& window); implementation_t* object_m; public: implementation_t& implementation(); const implementation_t& implementation() const; }; #endif // NDEBUG /****************************************************************************************************/ struct control_t : boost::totally_ordered<control_t> { control_t(); control_t(const control_t& rhs); virtual ~control_t(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_name(const std::string& name); virtual void set_theme(theme_t theme); void adorn_theme(theme_t theme); void unadorn_theme(theme_t theme); void set_active(bool make_active); void set_visible(bool make_visible); void set_focused(bool make_focused); bool is_focused(); void signal_focus(const implementation::control_focus_proc_t& proc); void trap_window_proc(WNDPROC new_window_proc); // /// This function is invoked when the parent window of this control recieves a message /// generated by the control's window. /// /// \param message Windows message code. /// \param wParam pointer parameter. /// \param lParam long parameter. // virtual LRESULT event(UINT message, WPARAM wParam, LPARAM lParam); // /// This function is invoked when one of the modifier keys is pressed or released. /// /// \param modifiers the modifier keys currently pressed. // virtual void modify(modifiers_t modifiers); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::control_t); virtual dictionary_t essentials() const; virtual void user_hit(); HWND control_m; WNDPROC default_window_proc_m; theme_t theme_m; implementation::control_focus_proc_t focus_proc_m; rectangle_t geometry_m; // saving set_bounds param for essentials point_t position_m; // saving set_bounds param for widget framing int uxtheme_type_m; static HWND invisible_parent_m; // an invisible window used as the initial parent for all controls. event_dispatcher::reference event_dispatcher_m; // ref. to singleton event dispatcher. HMENU child_id_m; // this control_m's child id. #ifndef NDEBUG bool placed_m; // used in the framing rect code to make sure the widget is placed first #endif }; /****************************************************************************************************/ struct window_t::implementation_t : boost::totally_ordered<window_t::implementation_t> { implementation_t(); implementation_t(const implementation_t& rhs); virtual ~implementation_t(); void initialize( const std::string& name, const RECT& bounds, window_style_t style, window_attributes_t attributes, window_modality_t modality); void initialize( const std::string& name, const RECT& bounds, DWORD style); void set_bounds(const point_t& position, const rectangle_t& geometry); void reposition(window_reposition_t position); void set_visible(bool make_visible); void draw_controls(); void signal_resize_complete(const implementation::window_resize_complete_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::window_t::implementation_t); dictionary_t essentials() const; HWND window_m; rectangle_t geometry_m; // saving set_bounds param for essentials implementation::window_resize_complete_proc_t resize_complete_proc_m; #ifndef NDEBUG hitless_t framing_control_m; #endif }; /****************************************************************************************************/ struct number_formatter_t::implementation_t { implementation_t(); implementation_t(const implementation_t& rhs); void initialize(); void set_format(const std::string& format); std::string get_format() const; std::string format(const value_t& x); value_t parse(const std::string& str, value_t the_type); std::string format_m; }; /****************************************************************************************************/ struct group_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT& bounds, const std::string& name); virtual rectangle_t best_bounds(); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::group_t::implementation_t); virtual dictionary_t essentials() const; }; /****************************************************************************************************/ struct tab_group_t::implementation_t : control_t { typedef control_t _super; typedef std::vector<tab_group_t::tab_t> tab_set_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT& bounds, const tab_group_t::tab_t* first, const tab_group_t::tab_t* last); virtual void set_theme(theme_t theme); virtual rectangle_t best_bounds(); void set_value(const value_t& new_value); void signal_value_change(const implementation::tab_group_value_proc_t& proc); virtual LRESULT event(UINT msg, WPARAM wParam, LPARAM lParam); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::tab_group_t::implementation_t); virtual dictionary_t essentials() const; implementation::tab_group_value_proc_t value_proc_m; tab_set_t items_m; }; /****************************************************************************************************/ struct panel_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::panel_t::implementation_t); virtual dictionary_t essentials() const; void initialize(const RECT& bounds); }; /****************************************************************************************************/ struct button_t::implementation_t : control_t { typedef control_t _super; typedef std::vector<state_descriptor_t> state_set_t; implementation_t(); implementation_t(const implementation_t& rhs); ~implementation_t(); void initialize( const RECT& bounds, const button_t::state_descriptor_t* first, const button_t::state_descriptor_t* last); void set_default(bool is_default); void set_cancel(bool is_cancel); void set_value(modifiers_t modifiers, const value_t& value); void set_contributing(modifiers_t modifiers, const dictionary_t& value); virtual void modify(modifiers_t modifiers); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::button_t::implementation_t); virtual dictionary_t essentials() const; virtual void user_hit(); state_set_t state_set_m; modifiers_t modifiers_m; //EventHandlerRef handler_ref_m; }; /****************************************************************************************************/ struct radio_button_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const RECT& bounds, const std::string& name); virtual void set_value(std::size_t is_checked); void signal_hit(const implementation::radio_button_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::radio_button_t::implementation_t); virtual dictionary_t essentials() const; virtual void user_hit(); implementation::radio_button_hit_proc_t hit_proc_m; bool is_checked_m; }; /****************************************************************************************************/ struct checkbox_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const RECT& bounds, const std::string& name); virtual void set_value(std::size_t is_checked); void signal_hit(const implementation::checkbox_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::checkbox_t::implementation_t); virtual dictionary_t essentials() const; virtual void user_hit(); implementation::checkbox_hit_proc_t hit_proc_m; bool is_checked_m; }; /****************************************************************************************************/ struct link_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const RECT& bounds); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_value(bool value); void set_visible(bool make_visible); void set_active(bool make_active); void signal_hit(const implementation::link_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::link_t::implementation_t); virtual dictionary_t essentials() const; implementation::link_hit_proc_t hit_proc_m; points_of_interest_t prongs_m; bool value_m; bool visible_m; bool active_m; }; /****************************************************************************************************/ struct progress_bar_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT& bounds, pb_style_t bar_style, bool is_vertical); virtual rectangle_t best_bounds(); void set_min_value(long min_value); void set_max_value(long max_value); void set_value(long value); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::progress_bar_t::implementation_t); virtual dictionary_t essentials() const; bool is_vertical_m; pb_style_t bar_style_m; }; /****************************************************************************************************/ struct separator_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::separator_t::implementation_t); virtual dictionary_t essentials() const; void initialize(const RECT& bounds); }; /****************************************************************************************************/ struct static_text_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const RECT& bounds, const std::string& name); long best_height_given_width(long width); void set_name(const std::string& name); void signal_hit(const implementation::static_text_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); virtual dictionary_t essentials() const; implementation::static_text_hit_proc_t hit_proc_m; }; /****************************************************************************************************/ struct edit_text_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); virtual ~implementation_t(); void initialize( const RECT& bounds, const std::string& name, bool scrollable, long cols, long rows); static_text_t& get_label(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_active(bool active); virtual void set_theme(theme_t theme); void set_name(const std::string& text); void set_field_text(const std::string& text); void set_static_disabled(bool is_static_disabled); void set_selection(long start_char, long end_char); void signal_pre_edit(const implementation::edit_text_pre_edit_proc_t& proc); void signal_post_edit(const implementation::edit_text_post_edit_proc_t& proc); void signal_label_hit(const implementation::edit_text_label_hit_proc_t& proc); // /// Recalculate the style which should be given as the Window style /// of the edit control. /// /// \return the window style which should be applied to control_m. // long get_window_style() const; virtual LRESULT event(UINT msg, WPARAM wParam, LPARAM lParam); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); virtual dictionary_t essentials() const; static_text_t name_m; std::wstring field_text_m; static_text_t static_disabled_text_m; //HWND scroll_control_m; bool static_disabled_m; bool using_label_m; bool scrollable_m; long rows_m; long cols_m; long edit_baseline_m; long edit_height_m; long static_baseline_m; long static_height_m; implementation::edit_text_pre_edit_proc_t pre_edit_proc_m; implementation::edit_text_post_edit_proc_t post_edit_proc_m; implementation::edit_text_label_hit_proc_t label_hit_proc_m; }; /****************************************************************************************************/ struct popup_t::implementation_t : control_t { typedef control_t _super; typedef std::pair<std::string, value_t> menu_item_t; typedef std::vector<menu_item_t> menu_items_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const RECT& bounds, const std::string& name); static_text_t& get_label(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_active(bool active); virtual void set_theme(theme_t theme); void set_name(const std::string& name); void set_static_disabled(bool is_static_disabled); void add_menu_item(const std::string& name, const value_t& value); void clear_menu_items(); void set_current_menu_item(const value_t& item); void select_with_text(const std::string& text); void signal_value_change(const implementation::popup_value_proc_t& proc); virtual LRESULT event(UINT message, WPARAM wParam, LPARAM lParam); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); virtual dictionary_t essentials() const; static_text_t name_m; static_text_t static_disabled_text_m; bool static_disabled_m; long static_baseline_m; long static_height_m; long popup_baseline_m; long popup_height_m; bool using_label_m; implementation::popup_value_proc_t value_proc_m; menu_items_t menu_items_m; }; /****************************************************************************************************/ struct unit_edit_text_t::implementation_t : edit_text_t::implementation_t { typedef edit_text_t::implementation_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT& bounds, const std::string& name, bool using_popup, long cols, long rows); popup_t& get_popup(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_active(bool active); virtual void set_theme(theme_t theme); void set_static_disabled(bool is_static_disabled); void add_popup_menu_item(const std::string& name, const adobe::value_t& value); void select_popup_with_text(const std::string& text); void signal_popup_value_change(implementation::popup_value_proc_t proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::unit_edit_text_t::implementation_t); virtual dictionary_t essentials() const; popup_t popup_m; bool using_popup_m; long popup_height_m; long popup_baseline_m; long edit_height_m; long edit_baseline_m; }; /****************************************************************************************************/ struct slider_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT* bounds, bool is_vertical, slider_style_t style, long num_tick_marks); virtual rectangle_t best_bounds(); void set_min_value(long min_value); void set_max_value(long max_value); void set_value(long value); void signal_value_change(const implementation::slider_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::slider_t::implementation_t); virtual dictionary_t essentials() const; implementation::slider_value_proc_t value_proc_m; bool is_vertical_m; slider_style_t style_m; long num_tick_marks_m; }; /****************************************************************************************************/ struct bevel_button_t::implementation_t : control_t { typedef control_t _super; typedef std::pair<std::string, value_t> menu_item_t; typedef std::vector<menu_item_t> menu_items_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const RECT& bounds, const std::string& name, bool offset_contents, bool menu_points_right); void add_menu_item(const std::string& name, const value_t& value); void clear_menu_items(); void set_bevel_amount(bevel_button_bevel_amount_t amount); void set_current_menu_item(const value_t& item); void set_value(bool) { /* stubbed out */ } void signal_hit(const implementation::bevel_button_hit_proc_t& proc); void signal_value_change(const implementation::bevel_button_popup_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::bevel_button_t::implementation_t); virtual dictionary_t essentials() const; implementation::bevel_button_hit_proc_t hit_proc_m; implementation::bevel_button_popup_value_proc_t value_proc_m; menu_items_t menu_items_m; bool offset_contents_m; bool menu_points_right_m; }; /****************************************************************************************************/ #ifndef NDEBUG struct hitless_t::implementation_t : control_t { typedef control_t _super; struct draw_element_t { enum element_type { element_type_top_left, element_type_top_right, element_type_bottom_left, element_type_bottom_right, element_type_horizontal_poi, element_type_vertical_poi, element_type_count // always be last }; draw_element_t(element_type type, const RECT& rect, const COLORREF& color) : type_m(type), rect_m(rect), color_m(color) { } draw_element_t(const draw_element_t& rhs) : type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) { } element_type type_m; RECT rect_m; COLORREF color_m; }; typedef std::vector<draw_element_t> draw_element_set_t; implementation_t(); implementation_t(const implementation_t& rhs); ~implementation_t(); void initialize(const RECT& bounds, HWND window); void set_bounds(const point_t& position, const rectangle_t& geometry); void overlay_bounds_update(); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::hitless_t::implementation_t); virtual dictionary_t essentials() const; draw_element_set_t draw_elements_m; HWND overlay_window_m; // The window we're actually in HWND host_window_m; // The window we're hovering over }; #endif // NDEBUG /****************************************************************************************************/ ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::window_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::control_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::group_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::tab_group_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::button_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::panel_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::radio_button_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::checkbox_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::link_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::progress_bar_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::separator_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::static_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::edit_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::popup_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::unit_edit_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::slider_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::bevel_button_t::implementation_t); #ifndef NDEBUG ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::hitless_t::implementation_t); #endif // NDEBUG /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif // ADOBE_UI_CORE_IMPLEMENTATION_HPP /****************************************************************************************************/ --- NEW FILE: event_dispatcher.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) */ /****************************************************************************************************/ // /// This header defines the event_dispatcher, a class which is used to send events /// to the correct control_t. It works by knowing about all control_t's and the /// child IDs of thier windows. When an event comes in, it finds out which child ID /// generated it and forwards the event to the owning control_t. /// /// It is also able to handle keyboard modifier events, before they get translated /// and dispatched by the message pump. When the currently pressed combination of /// modifiers changes all of the controls are informed, in case they need to change /// their titles. // /****************************************************************************************************/ #ifndef ADOBE_EVENT_DISPATCHER_HPP #define ADOBE_EVENT_DISPATCHER_HPP /****************************************************************************************************/ #include <map> #include <string> #include <windows.h> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ class control_t; /****************************************************************************************************/ // /// The event_dispatcher keeps track of all control_t's and the child ids which /// they use. All control_t objects should contain a event_dispatcher::reference /// inside them. // class event_dispatcher { typedef std::map<int, control_t*> control_map_t; control_map_t control_map_m; ///< Mapping Child ID -> control_t* int current_id_m; ///< Child ID to next issue // /// This private constructor maintains the singleton nature of /// this class. // event_dispatcher(); friend class reference; public: // /// This reference class contains a reference to the event_dispatcher, /// and should be used by controls to subscribe and unsubscribe -- all /// controls should have one of these as a member variable. // class reference { int child_id_m; ///< The child ID for the owning control_t. public: // /// This constructor initializes all values to zero, and acquires a /// reference to the event_dispatcher. // reference(); // /// Unsubscribe any control which subscribed to the event_dispatcher /// and release the reference to the event_dispatcher. // ~reference(); // /// Subscribe the given control_t to the event_dispatcher. The returned /// value should be used as the child Id for the window which the given /// control will create. /// /// \param control the control to subscribe to events. /// \return the child id for the control to use. // HMENU subscribe(control_t* control); // /// Return the child ID. /// /// \return the child id to use for windows belonging to the subscribed /// control, or NULL if no control has subscribed through this /// reference. // HMENU child_id() const; }; // /// Dispatch an event through to the control which needs to process it. /// /// \param message The Windows message type. /// \param wParam The pointer parameter of the message. /// \param lParam the long parameter of the message. /// \param handled this reference bool is set to true if the message /// was dispatched to a child, or to false if no child /// could be found. /// \return the result of the event. // static LRESULT event(UINT message, WPARAM wParam, LPARAM lParam, bool& handled); // /// Examine the given keyboard message and send any required modifier events /// to controls. /// /// \param message The Windows message type. /// \param wParam The WPARAM value from the Windows message. // static void keyboard(UINT message, WPARAM wParam); }; /****************************************************************************************************/ } /****************************************************************************************************/ #endif /****************************************************************************************************/ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:15
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/resources/Begin.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/resources/Begin.nib Added Files: classes.nib info.nib objects.xib Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: objects.xib --- <?xml version="1.0" standalone="yes"?> <object class="NSIBObjectData"> <string name="targetFramework">IBCarbonFramework</string> <object name="rootObject" class="NSCustomObject" id="1"> <string name="customClass">NSApplication</string> </object> <array count="46" name="allObjects"> <object class="IBCarbonMenu" id="29"> <string name="title">SimpleHello</string> <array count="5" name="items"> <object class="IBCarbonMenuItem" id="185"> <string name="title">Adobe® Begin</string> <object name="submenu" class="IBCarbonMenu" id="184"> <string name="title">Adobe® Begin</string> <array count="2" name="items"> <object class="IBCarbonMenuItem" id="187"> <string name="title">About Adobe® Beginâ¦</string> <int name="keyEquivalentModifier">0</int> <ostype name="command">abou</ostype> </object> <object class="IBCarbonMenuItem" id="186"> <boolean name="separator">TRUE</boolean> </object> </array> <string name="name">_NSAppleMenu</string> </object> </object> <object class="IBCarbonMenuItem" id="127"> <string name="title">File</string> <object name="submenu" class="IBCarbonMenu" id="131"> <string name="title">File</string> <array count="9" name="items"> <object class="IBCarbonMenuItem" id="139"> <string name="title">New</string> <string name="keyEquivalent">n</string> <ostype name="command">new </ostype> </object> <object class="IBCarbonMenuItem" id="134"> <string name="title">Open...</string> <string name="keyEquivalent">o</string> <ostype name="command">open</ostype> </object> <object class="IBCarbonMenuItem" id="133"> <boolean name="separator">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="130"> <string name="title">Close</string> <string name="keyEquivalent">w</string> <ostype name="command">clos</ostype> </object> <object class="IBCarbonMenuItem" id="138"> <string name="title">Save</string> <string name="keyEquivalent">s</string> <ostype name="command">save</ostype> </object> <object class="IBCarbonMenuItem" id="137"> <string name="title">Save As...</string> <string name="keyEquivalent">S</string> <ostype name="command">svas</ostype> </object> <object class="IBCarbonMenuItem" id="128"> <boolean name="separator">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="135"> <string name="title">Page Setup...</string> <string name="keyEquivalent">P</string> <ostype name="command">page</ostype> </object> <object class="IBCarbonMenuItem" id="136"> <string name="title">Print...</string> <string name="keyEquivalent">p</string> <ostype name="command">prnt</ostype> </object> </array> </object> </object> <object class="IBCarbonMenuItem" id="152"> <string name="title">Edit</string> <object name="submenu" class="IBCarbonMenu" id="147"> <string name="title">Edit</string> <array count="8" name="items"> <object class="IBCarbonMenuItem" id="141"> <string name="title">Undo</string> <string name="keyEquivalent">z</string> <ostype name="command">undo</ostype> </object> <object class="IBCarbonMenuItem" id="146"> <string name="title">Redo</string> <string name="keyEquivalent">Z</string> <ostype name="command">redo</ostype> </object> <object class="IBCarbonMenuItem" id="142"> <boolean name="separator">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="143"> <string name="title">Cut</string> <string name="keyEquivalent">x</string> <ostype name="command">cut </ostype> </object> <object class="IBCarbonMenuItem" id="149"> <string name="title">Copy</string> <string name="keyEquivalent">c</string> <ostype name="command">copy</ostype> </object> <object class="IBCarbonMenuItem" id="144"> <string name="title">Paste</string> <string name="keyEquivalent">v</string> <ostype name="command">past</ostype> </object> <object class="IBCarbonMenuItem" id="151"> <string name="title">Clear</string> <ostype name="command">clea</ostype> </object> <object class="IBCarbonMenuItem" id="148"> <string name="title">Select All</string> <string name="keyEquivalent">a</string> <ostype name="command">sall</ostype> </object> </array> </object> </object> <object class="IBCarbonMenuItem" id="232"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">View Options</string> <object name="submenu" class="IBCarbonMenu" id="233"> <string name="title">View Options</string> <array count="11" name="items"> <object class="IBCarbonMenuItem" id="234"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Refresh View</string> <string name="keyEquivalent">r</string> <ostype name="command">Reld</ostype> </object> <object class="IBCarbonMenuItem" id="235"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Refresh Sheet</string> <string name="keyEquivalent">r</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">RfsS</ostype> </object> <object class="IBCarbonMenuItem" id="236"> <boolean name="separator">TRUE</boolean> <boolean name="updateSingleItem">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="231"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Normal Dialog Size</string> <string name="keyEquivalent">n</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">NrSz</ostype> </object> <object class="IBCarbonMenuItem" id="241"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Small Dialog Size</string> <string name="keyEquivalent">s</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">SmSz</ostype> </object> <object class="IBCarbonMenuItem" id="242"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Mini Dialog Size</string> <string name="keyEquivalent">m</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">MnSz</ostype> </object> <object class="IBCarbonMenuItem" id="239"> <boolean name="separator">TRUE</boolean> <boolean name="updateSingleItem">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="238"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Show Widget Frames</string> <string name="keyEquivalent">f</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">TgFm</ostype> </object> <object class="IBCarbonMenuItem" id="240"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Clear Widget Frames</string> <string name="keyEquivalent">c</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">ClFr</ostype> </object> <object class="IBCarbonMenuItem" id="244"> <boolean name="separator">TRUE</boolean> <boolean name="updateSingleItem">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="243"> <boolean name="updateSingleItem">TRUE</boolean> <string name="title">Serialize Widgets</string> <string name="keyEquivalent">z</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">SzWg</ostype> </object> </array> </object> </object> <object class="IBCarbonMenuItem" id="153"> <string name="title">Window</string> <object name="submenu" class="IBCarbonMenu" id="154"> <string name="title">Window</string> <array count="5" name="items"> <object class="IBCarbonMenuItem" id="155"> <boolean name="dynamic">TRUE</boolean> <string name="title">Minimize Window</string> <string name="keyEquivalent">m</string> <ostype name="command">mini</ostype> </object> <object class="IBCarbonMenuItem" id="188"> <boolean name="dynamic">TRUE</boolean> <string name="title">Minimize All Windows</string> <string name="keyEquivalent">m</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">mina</ostype> </object> <object class="IBCarbonMenuItem" id="156"> <boolean name="separator">TRUE</boolean> </object> <object class="IBCarbonMenuItem" id="157"> <boolean name="dynamic">TRUE</boolean> <string name="title">Bring All to Front</string> <ostype name="command">bfrt</ostype> </object> <object class="IBCarbonMenuItem" id="189"> <boolean name="dynamic">TRUE</boolean> <string name="title">Arrange in Front</string> <int name="keyEquivalentModifier">1572864</int> <ostype name="command">frnt</ostype> </object> </array> <string name="name">_NSWindowsMenu</string> </object> </object> </array> <string name="name">_NSMainMenu</string> </object> <reference idRef="127"/> <reference idRef="128"/> <reference idRef="130"/> <reference idRef="131"/> <reference idRef="133"/> <reference idRef="134"/> <reference idRef="135"/> <reference idRef="136"/> <reference idRef="137"/> <reference idRef="138"/> <reference idRef="139"/> <reference idRef="141"/> <reference idRef="142"/> <reference idRef="143"/> <reference idRef="144"/> <reference idRef="146"/> <reference idRef="147"/> <reference idRef="148"/> <reference idRef="149"/> <reference idRef="151"/> <reference idRef="152"/> <reference idRef="153"/> <reference idRef="154"/> <reference idRef="155"/> <reference idRef="156"/> <reference idRef="157"/> <reference idRef="184"/> <reference idRef="185"/> <reference idRef="186"/> <reference idRef="187"/> <reference idRef="188"/> <reference idRef="189"/> <reference idRef="231"/> <reference idRef="232"/> <reference idRef="233"/> <reference idRef="234"/> <reference idRef="235"/> <reference idRef="236"/> <reference idRef="238"/> <reference idRef="239"/> <reference idRef="240"/> <reference idRef="241"/> <reference idRef="242"/> <reference idRef="243"/> <reference idRef="244"/> </array> <array count="46" name="allParents"> <reference idRef="1"/> <reference idRef="29"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="127"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="131"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="152"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="147"/> <reference idRef="29"/> <reference idRef="29"/> <reference idRef="153"/> <reference idRef="154"/> <reference idRef="154"/> <reference idRef="154"/> <reference idRef="185"/> <reference idRef="29"/> <reference idRef="184"/> <reference idRef="184"/> <reference idRef="154"/> <reference idRef="154"/> <reference idRef="233"/> <reference idRef="29"/> <reference idRef="232"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> <reference idRef="233"/> </array> <dictionary count="2" name="nameTable"> <string>Files Owner</string> <reference idRef="1"/> <string>MenuBar</string> <reference idRef="29"/> </dictionary> <unsigned_int name="nextObjectID">245</unsigned_int> </object> --- NEW FILE: info.nib --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IBDocumentLocation</key> <string>80 106 356 240 0 0 1280 832 </string> <key>IBEditorPositions</key> <dict> <key>29</key> <string>76 496 364 44 0 0 1280 832 </string> </dict> <key>IBFramework Version</key> <string>364.0</string> <key>IBOpenObjects</key> <array> <integer>29</integer> </array> <key>IBSystem Version</key> <string>7M34</string> <key>targetFramework</key> <string>IBCarbonFramework</string> </dict> </plist> --- NEW FILE: classes.nib --- { IBClasses = (); IBVersion = 1; } |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:14
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/headers/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/headers/mac Added Files: carbon_safe.hpp metrics.hpp ui_core_implementation.hpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: carbon_safe.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_CARBON_SAFE_INCLUDE_HPP #define ADOBE_CARBON_SAFE_INCLUDE_HPP /****************************************************************************************************/ #include <Carbon/Carbon.h> /* REVISIT (sparent) : Apple insists that you include the entire Carbon/Carbon.h framework to use any of Carbon. This header file #defines check which conflicts with boost. The work- around is to undef check here. (In an unbelieveable set of circumstances, I wrote the check macro!) */ #ifdef check #undef check #endif /****************************************************************************************************/ #endif // ADOBE_CARBON_SAFE_INCLUDE_HPP /****************************************************************************************************/ --- NEW FILE: metrics.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_METRICS_MAC_HPP #define ADOBE_METRICS_MAC_HPP /****************************************************************************************************/ #include <adobe/dictionary_fwd.hpp> #include <adobe/name_fwd.hpp> #include <string> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ dictionary_t widget_metrics(const std::string& xstr, const dictionary_t& context); /****************************************************************************************************/ } /****************************************************************************************************/ #endif /****************************************************************************************************/ --- NEW FILE: ui_core_implementation.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #ifndef ADOBE_UI_CORE_IMPLEMENTATION_HPP #define ADOBE_UI_CORE_IMPLEMENTATION_HPP /****************************************************************************************************/ #include "ui_core.hpp" #include "carbon_safe.hpp" #include <adobe/future/memory.hpp> #include <adobe/rectangle.hpp> #include <adobe/dictionary.hpp> #include <adobe/array.hpp> /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ #define ADOBE_DELETE_PTR_SPECIALIZATION(type, func) \ template <> \ struct adobe::delete_ptr<type> \ { \ void operator()(type x) const \ { if (x) func(x); } \ } /****************************************************************************************************/ ADOBE_DELETE_PTR_SPECIALIZATION(CFStringRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(CFNumberFormatterRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(CFLocaleRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(RgnHandle, ::DisposeRgn); ADOBE_DELETE_PTR_SPECIALIZATION(MouseTrackingRef, ::ReleaseMouseTrackingRegion); ADOBE_DELETE_PTR_SPECIALIZATION(WindowRef, ::ReleaseWindow); ADOBE_DELETE_PTR_SPECIALIZATION(CFBundleRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(CFURLRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(CGDataProviderRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(CGImageRef, ::CFRelease); ADOBE_DELETE_PTR_SPECIALIZATION(ATSUStyle, ::ATSUDisposeStyle); ADOBE_DELETE_PTR_SPECIALIZATION(CGrafPtr, ::DisposePort); ADOBE_DELETE_PTR_SPECIALIZATION(Handle, ::DisposeHandle); ADOBE_DELETE_PTR_SPECIALIZATION(CFMutableDictionaryRef, ::CFRelease); /****************************************************************************************************/ /*! \defgroup widget_metrics_mac Mac Widget Metrics \ingroup widget_lib \section widget_metrics_mac_parameters Parameters The following is a list of metrics one can supply for a widget on the Mac. All values are in unit pixels. All values default to 0. <table width="100%" border="1"> <tr><th width="10%">Name</th><th width="30%">Structure</th><th>Notes</th></tr> <tr> <td><code>size</code></td> <td><code>[ width, height ]</code></td> <td>Base size of the widget</td> </tr> <tr> <td><code>adjust_position</code></td> <td><code>[ left, top ]</code></td> <td>Number of pixels to push the widget. Positive values move the widget away from the origin of the window.</td> </tr> <tr> <td><code>adjust_size</code></td> <td><code>[ width, height ]</code></td> <td>Adjustments made to the base size of the widget. The adjusted size is passed to the OS so the resulting widget is the base size originally intended.</td> </tr> <tr> <td><code>adjust_baseline</code></td> <td><code>value</code></td> <td>Adjustment of the baseline. Positive values move the baseline away from the origin of the window.</td> </tr> <tr> <td><code>outset</code></td> <td><code>[ left, top, right, bottom ]</code></td> <td>Amount of outset for a given edge of the widget. These amounts affect the base size and position of the widget when the bounds of the widget are set. See \ref widget_metrics_mac_pipeline_placement.</td> </tr> <tr> <td><code>frame</code></td> <td><code>[ left, top, right, bottom ]</code></td> <td>Amount of frame for a given edge of the widget.</td> </tr> <tr> <td><code>inset</code></td> <td><code>[ left, top, right, bottom ]</code></td> <td>Amount of inset for a given edge of the widget.</td> </tr> <tr> <td><code>spacing</code></td> <td><code>value</code></td> <td>If there is text in the widget, this is the spacing needed between the widget's visual element and the text for the widget. Example: <code>check_box</code> has a nonzero spacing, but <code>button</code> has a spacing of 0 (because the text overlays the visual element).</td> </tr> </table> \section widget_metrics_mac_pipelines Metrics Pipelines \subsection widget_metrics_mac_pipeline_measurement Measurement Pipeline -# All the possible text strings for the widget are measured. The largest width, height and baseline are preserved on a per-element basis (i.e., it is possible for one piece of text to contribute the max width and another to contribute the max height) -# The base height of the widget is set to <code>size.height - adjust_size.height</code> -# The base width of the widget is set to <code>size.width - adjust_size.width</code> -# If text width is nonzero then <code>text_width + spacing</code> is added to the base width of the widget -# If there is a valid text baseline value the baseline of the result is set to <code>text_baseline + adjust_baseline</code> -# The <code>outset.left</code> is added to the resultant left outset -# The <code>outset.left + outset.right</code> is <i>subtracted</i> from the resultant right outset -# The <code>outset.top</code> is added to the resultant top outset -# The <code>outset.top + outset.bottom</code> is <i>subtracted</i> from the resultant bottom outset -# Resultant frame is set from <code>frame</code> -# Resultant inset is set from <code>inset</code> -# The resultant geometry is returned \subsection widget_metrics_mac_pipeline_placement Placement Pipeline -# <code>adjust_position.left - geometry.outset.left</code> is added to the left position of the widget -# <code>adjust_position.top - geometry.outset.top</code> is added to the top position of the widget -# The height of the widget is increased by <code>adjust_size.height + geometry.outset.top + geometry.outset.bottom</code> -# The width of the widget is increased by <code>adjust_size.width + geometry.outset.left + geometry.outset.right</code> -# The bounds of the widget are set */ /*! \ingroup widget_lib \brief Utility class to access widget metrics for the Macintosh. metric_extractor_t is a struct that allows for easy access to the metrics found in a parsed and evaluated xstr definition from the mac metrics library. See \ref widget_metrics_mac for more information on the dictionary format describing the metrics for a given widget. */ struct metric_extractor_t { /// indices used to access elements for a compound (array-based) metric enum array_index_t { /// first element index_left = 0, /// second element index_top = 1, /// third element index_right = 2, /// fourth element index_bottom = 3, /// same as index_left index_width = index_left, /// same as index_top index_height = index_top }; /// \param dictionary the dictionary containing the widget metrics. /// Internally the dictionary is stored by value. explicit metric_extractor_t(const dictionary_t& dictionary) : dictionary_m(dictionary) { } /// Obtains a singleton metric /// \param tag the name of the metric we are interested in getting /// \return the value of the metric; 0 if the metric does not exist long operator () (const name_t& tag) const { long result(0); dictionary_m.get(tag, result); return result; } /// Obtains a singleton metric from a compound (array-based) metric /// \param tag the name of the metric we are interested in getting /// \param index the index inside the compound metric to fetch /// \return the value of the metric; 0 if the metric does not exist long operator () (const name_t& tag, array_index_t index) const { adobe::array_t array_result; long result(0); dictionary_m.get(tag, array_result); array_result.get(std::size_t(index), result); return result; } #if !defined(ADOBE_NO_DOCUMENTATION) private: dictionary_t dictionary_m; #endif }; /****************************************************************************************************/ extern const Rect initial_bounds_g; extern const CGRect cg_initial_bounds_g; /****************************************************************************************************/ #ifndef NDEBUG struct hitless_t : boost::totally_ordered<hitless_t> { struct implementation_t; hitless_t(); hitless_t(const hitless_t& rhs); ~hitless_t(); void initialize(window_t& window); void set_bounds(const point_t& position, const rectangle_t& geometry); private: ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::hitless_t); friend void frame_geometry(window_t& window, const point_t& position, const rectangle_t& geometry); friend bool clear_geometry_frames(window_t& window); implementation_t* object_m; public: implementation_t& implementation(); const implementation_t& implementation() const; }; #endif // NDEBUG /****************************************************************************************************/ struct control_t : boost::totally_ordered<control_t> { control_t(); control_t(const control_t& rhs); virtual ~control_t(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_name(const std::string& name); virtual void set_theme(theme_t theme); void adorn_theme(theme_t theme); void unadorn_theme(theme_t theme); void set_active(bool make_active); void set_visible(bool make_visible); void set_focused(bool make_focused); bool is_focused(); void signal_focus(const implementation::control_focus_proc_t& proc); void set_min_value(long value); void set_max_value(long value); void set_value(long value); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::control_t); virtual dictionary_t essentials() const; // REVISIT (fbrereto) : We need to have EventHandlerRefs for every callback in every // control. Each ref must disconnect the handler before the object // is destroyed to prevent callbacks to nonexistent objects. There // should be a wrapper struct to handle the relationship between // any implementation::*_proc_t and its corresponding EventHandlerRef. // Through the same mechanism we should permit the client to reset // a signal handler at any time (currently they can only set it once.) ControlRef control_m; theme_t theme_m; implementation::control_focus_proc_t focus_proc_m; EventHandlerRef focus_callback_ref_m; rectangle_t geometry_m; // saving set_bounds param for essentials metric_extractor_t metrics_m; }; /****************************************************************************************************/ struct window_t::implementation_t : boost::totally_ordered<window_t::implementation_t> { implementation_t(); implementation_t(const implementation_t& rhs); virtual ~implementation_t(); void initialize( const std::string& name, const Rect& bounds, window_style_t style, window_attributes_t attributes, window_modality_t modality); void initialize( const std::string& name, const Rect& bounds, WindowClass style, WindowAttributes attributes, WindowModality modality); void set_bounds(const point_t& position, const rectangle_t& geometry); void reposition(window_reposition_t position); void set_visible(bool make_visible); void draw_controls(); void signal_resize_complete(const implementation::window_resize_complete_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::window_t::implementation_t); dictionary_t essentials() const; WindowRef window_m; control_t root_control_m; rectangle_t geometry_m; // saving set_bounds param for essentials implementation::window_resize_complete_proc_t resize_complete_proc_m; #ifndef NDEBUG hitless_t framing_control_m; #endif }; /****************************************************************************************************/ struct number_formatter_t::implementation_t { implementation_t(); implementation_t(const implementation_t& rhs); void initialize(); void set_format(const std::string& format); std::string get_format() const; std::string format(const value_t& x); value_t parse(const std::string& str, value_t the_type); auto_resource<CFNumberFormatterRef> formatter_m; }; /****************************************************************************************************/ struct group_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect& bounds, const std::string& name); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::group_t::implementation_t); virtual dictionary_t essentials() const; virtual rectangle_t best_bounds(); }; /****************************************************************************************************/ struct tab_group_t::implementation_t : control_t { typedef control_t _super; typedef std::vector<tab_group_t::tab_t> tab_set_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect& bounds, const tab_group_t::tab_t* first, const tab_group_t::tab_t* last); virtual void set_theme(theme_t theme); virtual rectangle_t best_bounds(); void set_value(const value_t& new_value); void signal_value_change(const implementation::tab_group_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::tab_group_t::implementation_t); virtual dictionary_t essentials() const; implementation::tab_group_value_proc_t value_proc_m; tab_set_t items_m; }; /****************************************************************************************************/ struct panel_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::panel_t::implementation_t); virtual dictionary_t essentials() const; void initialize(const Rect& bounds); }; /****************************************************************************************************/ struct button_t::implementation_t : control_t { typedef control_t _super; typedef std::vector<state_descriptor_t> state_set_t; implementation_t(); implementation_t(const implementation_t& rhs); ~implementation_t(); void initialize( const Rect& bounds, const button_t::state_descriptor_t* first, const button_t::state_descriptor_t* last); virtual rectangle_t best_bounds(); void set_default(bool is_default); void set_cancel(bool is_cancel); void set_value(modifiers_t modifiers, const value_t& value); void set_contributing(modifiers_t modifiers, const dictionary_t& value); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::button_t::implementation_t); virtual dictionary_t essentials() const; state_set_t state_set_m; EventHandlerRef handler_ref_m; }; /****************************************************************************************************/ struct radio_button_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const Rect& bounds, const std::string& name); virtual rectangle_t best_bounds(); void signal_hit(const implementation::radio_button_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::radio_button_t::implementation_t); virtual dictionary_t essentials() const; implementation::radio_button_hit_proc_t hit_proc_m; }; /****************************************************************************************************/ struct checkbox_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const Rect& bounds, const std::string& name); virtual rectangle_t best_bounds(); void signal_hit(const implementation::radio_button_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::checkbox_t::implementation_t); virtual dictionary_t essentials() const; implementation::checkbox_hit_proc_t hit_proc_m; }; /****************************************************************************************************/ struct link_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const Rect& bounds); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_value(bool value); void set_visible(bool make_visible); void set_active(bool make_active); void signal_hit(const implementation::link_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::link_t::implementation_t); virtual dictionary_t essentials() const; implementation::link_hit_proc_t hit_proc_m; points_of_interest_t prongs_m; bool value_m; bool visible_m; bool active_m; }; /****************************************************************************************************/ struct progress_bar_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect& bounds, pb_style_t bar_style, bool is_vertical); virtual rectangle_t best_bounds(); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::progress_bar_t::implementation_t); virtual dictionary_t essentials() const; bool is_vertical_m; pb_style_t bar_style_m; }; /****************************************************************************************************/ struct separator_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::separator_t::implementation_t); virtual dictionary_t essentials() const; void initialize(const Rect& bounds); }; /****************************************************************************************************/ struct static_text_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const Rect& bounds, const std::string& name); virtual rectangle_t best_bounds(); long best_height_given_width(long width); void set_name(const std::string& name); void signal_hit(const implementation::static_text_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::static_text_t::implementation_t); virtual dictionary_t essentials() const; implementation::static_text_hit_proc_t hit_proc_m; }; /****************************************************************************************************/ struct edit_text_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); virtual ~implementation_t(); void initialize( const Rect& bounds, const std::string& name, bool scrollable, long cols, long rows); static_text_t& get_label(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_active(bool active); virtual void set_theme(theme_t theme); void set_name(const std::string& name); void set_field_text(const std::string& text); void set_static_disabled(bool is_static_disabled); void set_selection(long start_char, long end_char); void signal_pre_edit(const implementation::edit_text_pre_edit_proc_t& proc); void signal_post_edit(const implementation::edit_text_post_edit_proc_t& proc); void signal_label_hit(const implementation::edit_text_label_hit_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::edit_text_t::implementation_t); virtual dictionary_t essentials() const; static_text_t name_m; std::string field_text_m; static_text_t static_disabled_text_m; HIViewRef scroll_control_m; bool static_disabled_m; bool using_label_m; bool scrollable_m; long rows_m; long cols_m; long static_width_m; long static_height_m; long static_baseline_m; long edit_height_m; long edit_baseline_m; implementation::edit_text_pre_edit_proc_t pre_edit_proc_m; implementation::edit_text_post_edit_proc_t post_edit_proc_m; implementation::edit_text_label_hit_proc_t label_hit_proc_m; }; /****************************************************************************************************/ struct popup_t::implementation_t : control_t { typedef control_t _super; typedef std::pair<std::string, value_t> menu_item_t; typedef std::vector<menu_item_t> menu_items_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize(const Rect& bounds, const std::string& name); virtual rectangle_t best_bounds(); void set_active(bool active); virtual void set_theme(theme_t theme); void set_name(const std::string& name); void set_static_disabled(bool is_static_disabled); void add_menu_item(const std::string& name, const value_t& value); void clear_menu_items(); void set_current_menu_item(const value_t& item); void select_with_text(const std::string& text); void signal_value_change(const implementation::popup_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::popup_t::implementation_t); virtual dictionary_t essentials() const; std::string name_m; static_text_t static_disabled_text_m; bool static_disabled_m; bool using_label_m; implementation::popup_value_proc_t value_proc_m; menu_items_t menu_items_m; }; /****************************************************************************************************/ struct unit_edit_text_t::implementation_t { implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect& bounds, const std::string& name, bool using_popup, long cols, long rows); popup_t& get_popup(); edit_text_t& get_edit_text(); virtual rectangle_t best_bounds(); void set_bounds(const point_t& position, const rectangle_t& geometry); void set_active(bool active); virtual void set_theme(theme_t theme); void adorn_theme(theme_t theme); void unadorn_theme(theme_t theme); void set_visible(bool make_visible); void set_focused(bool make_focused); void set_static_disabled(bool is_static_disabled); void set_name(const std::string& name) { get_edit_text().set_name(name); } void set_field_text(const std::string& text) { get_edit_text().set_field_text(text); } void set_selection(long start_char, long end_char) { get_edit_text().set_selection(start_char, end_char); } void signal_pre_edit(const implementation::edit_text_pre_edit_proc_t& proc) { get_edit_text().signal_pre_edit(proc); } void signal_post_edit(const implementation::edit_text_post_edit_proc_t& proc) { get_edit_text().signal_post_edit(proc); } void signal_label_hit(const implementation::edit_text_label_hit_proc_t& proc) { get_edit_text().signal_label_hit(proc); } void add_popup_menu_item(const std::string& name, const adobe::value_t& value) { get_popup().add_menu_item(name, value); } void select_popup_with_text(const std::string& text) { get_popup().select_with_text(text); } void signal_popup_value_change(implementation::popup_value_proc_t proc) { get_popup().signal_value_change(proc); } void signal_focus(const implementation::control_focus_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::unit_edit_text_t::implementation_t); virtual dictionary_t essentials() const; edit_text_t edit_text_m; popup_t popup_m; bool using_popup_m; long popup_width_m; long popup_height_m; long popup_baseline_m; long edit_height_m; long edit_width_m; long edit_baseline_m; }; /****************************************************************************************************/ struct slider_t::implementation_t : control_t { typedef control_t _super; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect* bounds, bool is_vertical, slider_style_t style, long num_tick_marks); void signal_value_change(const implementation::slider_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::slider_t::implementation_t); virtual dictionary_t essentials() const; implementation::slider_value_proc_t value_proc_m; bool is_vertical_m; slider_style_t style_m; long num_tick_marks_m; }; /****************************************************************************************************/ struct bevel_button_t::implementation_t : control_t { typedef control_t _super; typedef std::pair<std::string, value_t> menu_item_t; typedef std::vector<menu_item_t> menu_items_t; implementation_t(); implementation_t(const implementation_t& rhs); void initialize( const Rect& bounds, const std::string& name, bool offset_contents, bool menu_points_right); void add_menu_item(const std::string& name, const value_t& value); void clear_menu_items(); void set_bevel_amount(bevel_button_bevel_amount_t amount); void set_current_menu_item(const value_t& item); void signal_hit(const implementation::bevel_button_hit_proc_t& proc); void signal_value_change(const implementation::bevel_button_popup_value_proc_t& proc); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::bevel_button_t::implementation_t); virtual dictionary_t essentials() const; implementation::bevel_button_hit_proc_t hit_proc_m; implementation::bevel_button_popup_value_proc_t value_proc_m; menu_items_t menu_items_m; bool offset_contents_m; bool menu_points_right_m; }; /****************************************************************************************************/ #ifndef NDEBUG struct hitless_t::implementation_t : control_t { typedef control_t _super; struct draw_element_t { enum element_type { element_type_top_left, element_type_top_right, element_type_bottom_left, element_type_bottom_right, element_type_horizontal_poi, element_type_vertical_poi, element_type_count // always be last }; draw_element_t(element_type type, const CGRect& rect, const RGBColor& color) : type_m(type), rect_m(rect), color_m(color) { } draw_element_t(const draw_element_t& rhs) : type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) { } element_type type_m; CGRect rect_m; RGBColor color_m; }; typedef std::vector<draw_element_t> draw_element_set_t; implementation_t(); implementation_t(const implementation_t& rhs); ~implementation_t(); void initialize(const Rect& bounds, WindowRef window); void overlay_bounds_update(); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_FRIEND_DECLARATION(adobe::hitless_t::implementation_t); virtual dictionary_t essentials() const; draw_element_set_t draw_elements_m; WindowRef overlay_window_m; // The window we're actually in WindowRef host_window_m; // The window we're hovering over }; #endif // NDEBUG /****************************************************************************************************/ ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::window_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::control_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::group_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::tab_group_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::button_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::panel_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::radio_button_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::checkbox_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::link_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::progress_bar_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::separator_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::static_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::edit_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::popup_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::unit_edit_text_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::slider_t::implementation_t); ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::bevel_button_t::implementation_t); #ifndef NDEBUG ADOBE_SERIALIZABLE_TOTAL_ORDERING_BOILERPLATE_DECLARATION(adobe::hitless_t::implementation_t); #endif // NDEBUG /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ #endif // ADOBE_UI_CORE_IMPLEMENTATION_HPP /****************************************************************************************************/ |
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/examples Added Files: alignment_test.adm alignment_test.eve bevel_button_suite.adm bevel_button_suite.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 Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: e01_clipping_path.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ 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: checkbox_radio_button_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ 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 } ]); } } } --- NEW FILE: list_box_emulator.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet control_example { 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; } --- NEW FILE: bevel_button_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet bevel_button_suite { interface: toggle_suite : @toggle_value_off; me_toggle_suite : @na; radio_suite : @radio_value_one; popup_value_1 : @smelt; popup_value_2 : @captain_underpants; } --- NEW FILE: sort_lines.eve --- /* Copyright 2005 Adobe Systems Incorporated; All Rights Reserved. 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_beveled( 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: image_size.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet image_size { input: /* REVISIT (sparent) : These should be input - but name lookup for input only is broken. */ original_width : 1600; original_height : 1200; original_resolution : 300; constant: original_doc_width : original_width / original_resolution; original_doc_height : original_height / original_resolution; interface: resample : true; unlink constrain : true <== resample ? constrain : true; unlink scale_styles : true <== resample && constrain ? scale_styles : false; unlink resample_method : @bicubic <== resample ? resample_method : empty; dim_width_pixels : original_width <== resample ? dim_width_pixels : original_width; dim_width_percent : 100 <== resample ? dim_width_percent : 100; dim_height_pixels : original_height <== resample ? dim_height_pixels : original_height; dim_height_percent : 100 <== resample ? dim_height_percent : 100; doc_width_inches : original_doc_width; doc_width_percent : 100; doc_height_inches : original_doc_height; doc_height_percent : 100; doc_resolution : original_resolution; auto_quality : @draft; screen_lpi; // initialized from doc_resolution logic: relate { doc_width_inches <== doc_width_percent * original_doc_width / 100; doc_width_percent <== doc_width_inches * 100 / original_doc_width; } relate { doc_height_inches <== doc_height_percent * original_doc_height / 100; doc_height_percent <== doc_height_inches * 100 / original_doc_height; } relate { screen_lpi <== doc_resolution / (auto_quality == @draft ? 1 : (auto_quality == @good ? 1.5 : 2.0)); doc_resolution <== screen_lpi * (auto_quality == @draft ? 1 : (auto_quality == @good ? 1.5 : 2.0)); } when (resample) relate { dim_width_pixels <== round(dim_width_percent * original_width / 100); dim_width_percent <== dim_width_pixels * 100 / original_width; } when (resample) relate { dim_height_pixels <== round(dim_height_percent * original_height / 100); dim_height_percent <== dim_height_pixels * 100 / original_height; } when (resample) relate { doc_width_inches <== dim_width_pixels / doc_resolution; dim_width_pixels <== round(doc_width_inches * doc_resolution); doc_resolution <== dim_width_pixels / doc_width_inches; } when (resample) relate { doc_height_inches <== dim_height_pixels / doc_resolution; dim_height_pixels <== round(doc_height_inches * doc_resolution); doc_resolution <== dim_height_pixels / doc_height_inches; } when (!resample) relate { doc_resolution <== original_width / doc_width_inches; doc_width_inches <== original_width / doc_resolution; } when (constrain) relate { doc_width_percent <== doc_height_percent; doc_height_percent <== doc_width_percent; } output: byte_count <== dim_width_pixels * dim_height_pixels * 32; result <== resample ? { command: @resize_image, width: dim_width_pixels, height: dim_height_pixels, resolution: doc_resolution, scale_styles: scale_styles, resample_method: resample_method } : { command: @set_resolution, resolution: doc_resolution }; invariant: width_max <== dim_width_pixels <= 300000; height_max <== dim_height_pixels <= 300000; } --- NEW FILE: find_and_replace.eve --- /* Copyright 2005 Adobe Systems Incorporated; All Rights Reserved. ANOMALIES WRT ORIGINAL DIALOG: (OD stands for Original Dialog) - OD has popup button of width 0 to display MRU search/replace/patterns strings - OD has "section" double-S in a button next to MRU popups - OD "section" button is only wide enough as need be (not minimum button width of 80) - When document open, default button in OD toggles between "Find" and "Find All" depending on state of "Multi-File Search" button - When no document open, default button in OD toggles between "Find All" and "Don't find" depending on state of "Multi-File Search" button - OD has a drawer containing MRU directories searched for multi-file search. This can be toggled with an icon button to the left of the multi-file search target field. - Need to be able to specify icon push buttons - OD "Other..." button links to a OS-level directory selection dialog - Need to be able to specify menu items with a cell in the Adam sheet (for MRU popups) - "Use Grep" checkbox is aligned with second column of checkboxes below search field, an alignment currently not possible - Clicking in the multi-file search display field in OD shows a tool tip with the directory in it - Need to be able to specify just horizontal or vertical scroller for an edit_text - Holding down the Command key in OD reveals command-key shortcuts for dialog widgets DESIRED BEHAVIORS: - Want to diable "Options..." button, "Other..." button, "Saved Search Sources" string, "Saved Search Sources" popup, and Drawer icon based on value of Multi-file search checkbox. */ dialog(name: "Find & Replace", placement: place_row) { column(child_horizontal: align_fill) { row(child_horizontal: align_proportional) { row() { static_text(name: 'Search For:'); popup_beveled( name: ' ', popup_bind: @recent_search_strings, popup_placement: @down, items: [ { name: '(recent search strings)', value: empty }, { name: '-', value: @pattern_separator } ]); button_beveled(name: 'S', bevel_thickness: @rounded); } checkbox(name: 'Use Grep'); row() { static_text(name: 'Patterns:'); popup_beveled( name: ' ', popup_bind: @patterns, 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 } ]); } } edit_text(indent: 10, size: @size_small, characters: 60, lines: 3, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(horizontal: align_fill, indent: 10) { column() { checkbox(name: 'Start at Top', bind: @start_at_top, value: true); checkbox(name: 'Wrap Around', bind: @wrap_around, value: true); checkbox(name: 'Search Backwards', bind: @search_backwards, value: true); checkbox(name: 'Case Sensitive', bind: @case_sensitive, value: true); } column(horizontal: align_center, vertical: align_fill) { checkbox(name: 'Search Selection Only', bind: @search_selection_only, value: true); checkbox(name: 'Extend Selection', bind: @extend_selection, value: true); checkbox(name: 'Match Entire Words', bind: @match_entire_words, value: true, vertical: align_bottom); } } row() { static_text(name: 'Replace With:'); popup_beveled( name: ' ', popup_bind: @recent_search_strings, popup_placement: @down, items: [ { name: '(recent replace strings)', value: empty }, { name: '-', value: @pattern_separator } ]); button_beveled(name: 'S', bevel_thickness: @rounded); } edit_text(indent: 10, size: @size_small, characters: 60, lines: 3, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(child_horizontal: align_proportional) { checkbox(name: 'Multi-File Search', bind: @multi_file_search, value: true); row() { static_text(name: 'Saved Search Sources:'); popup_beveled( name: ' ', popup_bind: @saved_search_sources, popup_placement: @down, items: [ { name: 'Remember This Set...', value: empty }, { name: '-', value: @pattern_separator } ]); } } row() { popup_beveled(name: 'Icon', width: 32, height: 32); edit_text(bind: @multi_file_search_folder, size: @size_small, characters: 60, lines: 3, monospaced: true, horizontal: align_fill, vertical: align_fill); } } column(child_horizontal: align_fill, vertical: align_fill, spacing: 20) { column(child_horizontal: align_fill) { button(name: 'Find', default: true); button(name: 'Find All'); } column(child_horizontal: align_fill) { button(name: 'Replace'); button(name: 'Replace All'); } column(child_horizontal: align_fill) { button(name: "Don't Find"); } column(child_horizontal: align_fill) { button(name: 'Cancel', cancel: true, action: @cancel); } column(child_horizontal: align_fill, vertical: align_bottom, spacing: 20) { button(name: 'Other...'); button(name: 'Options...', action: @dialog, value: "find_and_replace_options.eve"); } } } --- NEW FILE: slider_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Slider Suite", grow: true, horizontal: align_fill) { row(child_horizontal: align_fill, horizontal: align_fill) { column() { edit_number(name: "Value:", bind: @slider_value_1, digits: 3, format: "#"); group(placement: place_row, name: "Vertical Sliders", child_horizontal: align_fill) { slider(bind: @slider_value_1, slider_point: @left, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_2, slider_point: @right, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_1, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_2, slider_point: @right, slider_ticks: 11, orientation: @vertical, format: {first: 0, last: 100, interval: 1}); } group(placement: place_column, name: "Horizontal Sliders", horizontal: align_fill, child_horizontal: align_fill) { slider(bind: @slider_value_2, slider_point: @up, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_1, slider_point: @down, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_2, format: {first: 0, last: 100, interval: 1}); slider(bind: @slider_value_1, slider_point: @down, slider_ticks: 11, format: {first: 0, last: 100, interval: 1}); } } column(child_horizontal: align_fill, horizontal: align_right) { button(name: "OK", default: true, bind: @slider_value_1); button( items: [ {name: "Cancel", action: @cancel}, {name: "Reset", action: @reset, modifiers: @opt} ]); } } } --- NEW FILE: slider_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet slider_suite { interface: slider_value_1 : 42; slider_value_2 : 100 - slider_value_1; logic: relate { slider_value_1 <== 100 - slider_value_2; slider_value_2 <== 100 - slider_value_1; } } --- NEW FILE: list_box_emulator.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ 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: named_function_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ 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: find_and_replace.adm --- /* Copyright 2005 Adobe Systems Incorporated; All Rights Reserved. */ sheet find_and_replace { interface: document_open : true; multi_file_search : true; recent_search_strings; use_grep : false; patterns : @add; unlink start_at_top : false <== multi_file_search ? true : start_at_top; unlink wrap_around : false <== multi_file_search ? false : wrap_around; unlink search_backwards : false <== multi_file_search ? false : search_backwards; case_sensitive : false; unlink search_selection_only : false <== multi_file_search || !document_open ? false : search_selection_only; unlink extend_selection : false <== multi_file_search ? true : extend_selection; match_entire_words : false; saved_search_sources; search_file_type : @file_type_text; unlink multi_file_search_folder : "One Folder: /blah/blah/blah" <== multi_file_search ? multi_file_search_folder : "(nothing to search)"; /* Options -> Search Nested Folders */ search_nested_folders : false; unlink skip_paren_folders : false <== search_nested_folders ? skip_paren_folders : false; unlink search_invisible_folders : false <== search_nested_folders ? search_invisible_folders : false; /* Options -> Use File Filter */ use_file_filter : false; unlink file_filter : @file_filter_none_specified <== use_file_filter ? file_filter : @file_filter_none_specified; invariant: editable_file_filter <== use_file_filter == true; pick_multi_file_search <== multi_file_search == true; } --- NEW FILE: sort_lines.adm --- /* Copyright 2005 Adobe Systems Incorporated; All Rights Reserved. */ sheet sort_lines { 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"; } --- NEW FILE: image_size_auto.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Auto Resolution") { column() { edit_number(name: "Screen:", digits: 9, touch: [ @dim_width_pixels, @dim_height_pixels ], units: [ { name: "lines/inch", bind: @screen_lpi, format: "#.000" }, { name: "lines/cm", bind: @screen_lpi, scale: [2.54, 0.0], format: "#.00" } ]); group(name: "Quality", horizontal: align_fill, placement: place_row, child_horizontal: align_proportional) { radio_button(touch: [ @screen_lpi, @dim_width_pixels, @dim_height_pixels ], bind: @auto_quality, name: "Draft", value: @draft); radio_button(touch: [ @screen_lpi, @dim_width_pixels, @dim_height_pixels ], bind: @auto_quality, name: "Good", value: @good); radio_button(touch: [ @screen_lpi, @dim_width_pixels, @dim_height_pixels ], bind: @auto_quality, name: "Best", value: @best); } } column(child_horizontal: align_fill) { button(name: "OK", bind: @result, action: @ok, default: true); button( items: [ { name: "Cancel", action: @cancel }, { name: "Reset", action: @reset, modifiers: @opt } ]); } } --- NEW FILE: progress_bar_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ 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} ]); } } } --- NEW FILE: checkbox_radio_button_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet checkbox_suite { interface: checkbox_1 : false; checkbox_2 : false; checkbox_3 : false; checkbox_empty : false; radio_button_1 : @na; } --- NEW FILE: edit_text_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Edit Text Suite") { row(child_horizontal: align_fill) { row() { group(placement: place_column, name: "Big Edit Texts", child_horizontal: align_fill) { edit_text(bind: @edit_text_value, characters: 10, name: "System Justified:"); edit_text(bind: @edit_text_value, characters: 10, justification: @left, name: "Left:"); edit_text(bind: @edit_text_value, characters: 10, justification: @center, name: "Center:"); edit_text(bind: @edit_text_value, characters: 10, justification: @right, name: "Right:"); } } column(child_horizontal: align_fill) { button(name: "OK", default: true); button( items: [ { name: "Cancel", action: @cancel }, { name: "Reset", action: @reset, modifiers: @opt } ]); } } } --- NEW FILE: progress_bar_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet progress_bar_suite { interface: progress_value : 0; } --- NEW FILE: find_and_replace_options.eve --- /* Copyright 2005 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Find & Replace Options", placement: place_column, spacing: 20) { row(spacing: 20) { column(guide_mask: []) { checkbox(name: "Search Nested Folders", bind: @search_nested_folders); checkbox(name: "Skip (...) Folders", bind: @skip_paren_folders, indent: 20); checkbox(name: "Search Invisible Folders", bind: @search_invisible_folders, indent: 20); } column(guide_mask: []) { static_text(name: "File Type:"); radio_button(name: "Text Files Only", bind: @search_file_type, value: @file_type_text); radio_button(name: "All File Types", bind: @search_file_type, value: @file_type_all); } } checkbox(name: "Exclude Matches"); column() { checkbox(name: "Use File Filter:", bind: @use_file_filter); row(indent: 20) { popup(bind: @file_filter, items: [ { name: "New Filter...", value: @file_filter_new }, { name: "-", value: empty }, { name: "(current criteria)", value: @file_filter_current_criteria }, { name: "-", value: empty }, { name: "C++ files", value: @file_filter_cpp_files }, { name: "Doxygen files", value: @file_filter_dox_files } ]); button(name: "Edit Filter...", bind: @use_file_filter, action: @dialog, value: "edit_file_filter.eve"); } } row(horizontal: align_right) { button(name: "Cancel", cancel: true, action: @cancel); button(name: "OK", default: true); } } --- NEW FILE: bevel_button_suite.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Bevel Button Test Suite", metal: true) { row() { group(placement: place_column, name: "Functionality Examples", child_horizontal: align_fill) { group(name: "Checkbox-like", child_horizontal: align_fill) { checkbox_beveled(bind: @toggle_suite, name: "Use death-ray upon close", value_on: @toggle_value_on, value_off: @toggle_value_off); } group(name: "ME Checkbox-like", child_horizontal: align_fill) { checkbox_beveled(bind: @me_toggle_suite, name: "Voting Republican", value_on: @me_toggle_value_one, value_off: @na); checkbox_beveled(bind: @me_toggle_suite, name: "Voting Democratic", value_on: @me_toggle_value_two, value_off: @na); } group(name: "Radio Button-like", child_horizontal: align_fill) { radio_button_beveled(bind: @radio_suite, name: "Phaser on stun", value_on: @radio_value_one); radio_button_beveled(bind: @radio_suite, name: "Phaser on kill", value_on: @radio_value_two); } group(name: "Popup-like", child_horizontal: align_fill) { popup_beveled(name: "Menu On Bottom", popup_bind: @popup_value_1, items: [ { name: "Smelt", value: @smelt }, { name: "Halibut", value: @halibut }, { name: "Trout", value: @trout }, { name: "Bass", value: @bass }, { name: "Marlin", value: @marlin } ]); popup_beveled(name: "Menu On Right", popup_bind: @popup_value_2, popup_placement: @right, items: [ { name: "Superman", value: @superman }, { name: "Batman", value: @batman }, { name: "Spider Man", value: @spider_man }, { name: "Wonder Woman", value: @wonder_woman }, { name: "Captain Underpants", value: @captain_underpants } ]); } } group(placement: place_column, name: "Visual Examples", child_horizontal: align_fill) { group(name: "Various Bevel Thicknesses", child_horizontal: align_fill) { button_beveled(name: "Small Bevel Thickness", bevel_thickness: @small); button_beveled(name: "Normal Bevel Thickness", bevel_thickness: @normal); button_beveled(name: "Large Bevel Thickness", bevel_thickness: @large); button_beveled(name: "Rounded Bevel Thickness", bevel_thickness: @rounded); } group(name: "Whizzy Misc Features", child_horizontal: align_fill) { button_beveled(name: "Offsetting Contents", offset_contents: true); } } column(child_horizontal: align_fill) { button(name: "OK", default: true); button( items: [ { name: "Cancel", action: @cancel }, { name: "Reset", action: @reset, modifiers: @opt } ]); } } } --- NEW FILE: named_function_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet named_function_test_suite { interface: sample_array : [3.14, 5, 6.28]; sample_dictionary : {pi: @pi_name, two_pi: 6.28, pi_str: "three point one four"}; min_element_test : min(sample_array[0], sample_array[1], sample_array[2]); max_element_test : max(sample_array[0], sample_array[1], sample_array[2]); round_test : round(sample_array[0]); typeof_test_1 : typeof(sample_array); typeof_test_2 : typeof(sample_dictionary); contributing_test : 10; fahrenheit : 0; celsius : 0; logic: relate { fahrenheit <== scale(x: celsius, m: 9/5, b: 32); celsius <== scale(x: fahrenheit, m: 5/9, b: -32*5/9); } output: result <== { typeof_test_1_result: typeof_test_1, typeof_test_2_result: typeof_test_2, min_element_test_result: min_element_test, max_element_test_result: max_element_test, round_test_result: round_test, contributing_test_result: contributing(contributing_test), sample_array_result: sample_array, sample_dictionary_result: sample_dictionary }; } --- NEW FILE: checkbox_control.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Control Example", placement: place_column) { column(spacing: 10) { checkbox(name: "Control", bind: @control, value: true); checkbox(name: "Enable me", bind: @enable_me, value: true); checkbox(name: "Enable me too", bind: @enable_me_too, value: true); checkbox(name: "Remember me", bind: @remember_me, value: true); } button(name: "Close", default: true, action: @cancel, horizontal: align_right); } --- NEW FILE: alignment_test.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet alignment_test { interface: alignment : "1234567890"; } --- NEW FILE: edit_text_suite.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet edit_text_suite { interface: edit_text_value : "Hello!"; } --- NEW FILE: alignment_test.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Alignment Test", spacing: 6) { group(placement: place_column, name: "Colon Alignment 1") { edit_text(bind: @alignment, characters: 10, name: "Apple:"); edit_text(bind: @alignment, characters: 10, name: "Orange:"); edit_text(bind: @alignment, characters: 10, name: "Orangutan:"); popup(name: "Foo:", items: [{name: "Item One", value: @one}, {name: "Item Two", value: @two}]); popup(name: "Alignment:", items: [{name: "Item One", value: @one}, {name: "Item Two", value: @two}]); } column() { group(placement: place_column, name: "Colon Alignment 2") { edit_text(bind: @alignment, characters: 10, name: "Alignment:"); row(spacing: 4) { static_text(name: "Alignment:"); edit_text(bind: @alignment, characters: 10); } popup(name: "Alignment:", items: [{name: "Item One", value: @one}, {name: "Item Two", value: @two}]); row(spacing: 4) { static_text(name: "Alignment:"); popup(items: [{name: "Item One", value: @one}, {name: "Item Two", value: @two}]); } } } column() { group(placement: place_column, name: "No lables") { edit_text(bind: @alignment, characters: 10); popup(items: [{name: "Item One", value: @one}, {name: "Item Two", value: @two}]); } group(placement: place_column, name: "Other Texts") { row() { static_text(name: "A great yellow | OL"); button(name: "Alignment"); } } } column(child_horizontal: align_fill) { button(name: "OK", default: true); button( items: [ { name: "Cancel", action: @cancel }, { name: "Reset", action: @reset, modifiers: @opt } ]); } } --- NEW FILE: e01_clipping_path.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet image_size { output: result <== { path: path, flatness: flatness }; interface: unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness; path : 1; } --- NEW FILE: tabs_and_panels.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Tabs and Panels Sampler", 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: "Sample", value: @first}, {name: "Tab", value: @second}, {name: "Example", value: @third} ]) { panel() { static_text(name: "I am the first panel", vertical: align_center, horizontal: align_center); } panel() { static_text(name: "I am the second panel", vertical: align_center, horizontal: align_center); } panel() { static_text(name: "I am the last panel. Save the best for last!", horizontal: align_center); radio_button(name: "Don't click me!", bind: @tab_group_visible, value: @na); } panel(value: @na) { radio_button(name: "Told you not to click that...", bind: @tab_group_visible, value: @second); } } row() { column() { radio_button(name: "Another", bind: @panel_list_visible, value: @plv_first); radio_button(name: "Panel", bind: @panel_list_visible, value: @plv_second); radio_button(name: "Example", bind: @panel_list_visible, value: @plv_third); } overlay(vertical: align_center, horizontal: align_center) { panel(bind: @panel_list_visible, value: @plv_first) { static_text(name: "I am the first panel", vertical: align_center, horizontal: align_center); } panel(bind: @panel_list_visible, value: @plv_second) { static_text(name: "I am the second panel", vertical: align_center, horizontal: align_center); } panel(bind: @panel_list_visible, value: @plv_third) { static_text(name: "I am the last panel. Save the best for last!", vertical: align_center, horizontal: align_center); } } } } --- NEW FILE: checkbox_control.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet control_example { interface: control : true; enable_me : false <== control ? true : enable_me; enable_me_too : false <== control ? enable_me_too : false; unlink remember_me : false <== control ? true : remember_me; } --- NEW FILE: tabs_and_panels.adm --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ sheet tabs_and_panels { interface: tab_group_visible : @first; panel_list_visible : @plv_second; } --- NEW FILE: image_size.eve --- /* Copyright 2004 Adobe Systems Incorporated; All Rights Reserved. */ dialog(name: "Image Size", placement: place_column) { row() { column() { size_group(bind: @byte_count, name: "Pixel Dimensions: ^", horizontal: align_fill) { row(horizontal: align_fill) { column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) { edit_number(name: "Width:", digits: 9, display_disable: true, touch: [ @doc_resolution ], units: [ { name: "pixels", bind: @dim_width_pixels, format: "#" }, { name: "percent", bind: @dim_width_percent, format: "#.00" } ]); edit_number(name: "Height:", digits: 9, display_disable: true, touch: [ @doc_resolution ], units: [ { name: "pixels", bind: @dim_height_pixels, format: "#" }, { name: "percent", bind: @dim_height_percent, format: "#.00" } ]); } link(bind: @constrain, count: 2, value_on: true, value_off: false); } } group(name: "Document Size:", horizontal: align_fill) { row(horizontal: align_fill) { column(guide_mask: [ ], horizontal: align_fill, child_horizontal: align_fill) { edit_number(name: "Width:", digits: 9, touch: [ @doc_resolution ], units: [ { name: "percent", bind: @doc_width_percent, format: "#.00" }, { name: "inches", bind: @doc_width_inches, format: "#.000" }, { name: "cm", bind: @doc_width_inches, scale: [2.54, 0.0 ], format: "#.00" }, { name: "mm", bind: @doc_width_inches, scale: [ 25.4, 0.0 ], format: "#.0" }, { name: "points", bind: @doc_width_inches, scale: [ 72, 0 ], format: "#.0" }, { name: "picas", bind: @doc_width_inches, scale: [ 6, 0.0 ], format: "#.00" }, { name: "columns", bind: @doc_width_inches, scale: [ 1, 0.0 ], format: "#.000" } ]); edit_number(name: "Height:", digits: 9, touch: [ @doc_resolution ], units: [ { name: "percent", bind: @doc_height_percent, format: "#.00" }, { name: "inches", bind: @doc_height_inches, format: "#.000" }, { name: "cm", bind: @doc_height_inches, scale: [2.54, 0.0 ], format: "#.00" }, { name: "mm", bind: @doc_height_inches, scale: [ 25.4, 0.0 ], format: "#.0" }, { name: "points", bind: @doc_height_inches, scale: [ 72, 0 ], format: "#.0" }, { name: "picas", bind: @doc_height_inches, scale: [ 6, 0.0 ], format: "#.00" }, { name: "columns", bind: @doc_height_inches, scale: [ 1, 0.0 ], format: "#.000" } ]); edit_number(name: "Resolution:", digits: 9, format: "#.000", touch: [ @dim_width_pixels, @dim_height_pixels ], units: [ { name: "pixels/inch", bind: @doc_resolution }, { name: "pixels/cm", 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: "Scale Styles"); checkbox(bind: @constrain, name: "Constrain Proportions"); row(spacing: 5) { checkbox(bind: @resample, name: "Resample Image:"); popup( bind: @resample_method, items: [ { name: "Nearest Neighbor", value: @nearest }, { name: "Bilinear", value: @bilinear }, { name: "Bicubic", value: @bicubic }, { name: "Bicubic Smoother", value: @bicubic_smoother }, { name: "Bicubic Sharper", 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: "OK", action: @ok, bind: @result, default: true); button( items: [ { name: "Cancel", action: @cancel }, { name: "Reset", action: @reset, modifiers: @opt } ]); button(name: "Auto...", action: @dialog, value: "image_size_auto.eve"); } } } |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:00
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual/English.lproj Added Files: InfoPlist.strings Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: InfoPlist.strings --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/visual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/visual Added Files: Info.plist Jamfile version.plist visual.mcp visual.sln visual.vcproj visual_Prefix.pch Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: Info.plist --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>adm</string> </array> <key>CFBundleTypeName</key> <string>Adam file</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSTypeIsPackage</key> <false/> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>eve</string> </array> <key>CFBundleTypeName</key> <string>Eve file</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSTypeIsPackage</key> <false/> </dict> </array> <key>CFBundleExecutable</key> <string>Adobe Begin</string> <key>CFBundleName</key> <string>Adobe Begin</string> <key>CFBundleIconFile</key> <string>AppIcon.icns</string> <key>CFBundleIdentifier</key> <string>com.adobe.begin</string> <key>CFBundleGetInfoString</key> <string>Adobe Begin version 1.0, Copyright © 2004 by Adobe Systems, Inc. All rights reserved.</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</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> --- NEW FILE: visual_Prefix.pch --- #include <Carbon/Carbon.h> #define ADOBE_SERIALIZATION --- NEW FILE: Jamfile --- # Jamfile for building the VISUAL demo import testing ; import os ; # # We need to include different directories for Windows vs. Mac. # if [ os.name ] = NT { PLATFORM_HEADERS = headers/win resources ; PLATFORM_SOURCE_DIR = sources/win ; # # Note that the resource script is also included in an MSVC build # by the project requirements section. # PLATFORM_SOURCES = sources/win/metrics.cpp sources/win/event_dispatcher.cpp ; # # These two definitions say that we're targetting Windows XP. That # means that we get various preprocessor definitions which we need, # such as the WS_EX_COMPOSITED window style. # PLATFORM_DEFINITIONS = <define>WINVER=0x501 <define>_WIN32_WINNT=0x501 <define>_WIN32_IE=0x0501 ; } else { PLATFORM_HEADERS = headers/mac ; PLATFORM_SOURCE_DIR = sources/mac ; PLATFORM_SOURCES = ; PLATFORM_DEFINITIONS = ; } project adobe/visual : requirements <toolset>msvc:<linkflags>"gdi32.lib user32.lib comctl32.lib /subsystem:windows" # # REVISIT (t_schwinger): # # Masking darwin by requesting the GNU linker is odd. This has to be straightened out # as soon as there are more GCC platforms... # : requirements <toolset>gcc:<linker>gnu:<linkflags>"-lgdi32 -luser32 -lcomctl32" : requirements <toolset>darwin:<linkflags>"-framework Carbon" # # Currently MSVC is the only windows compiler which Boost knows how # to make generate resource files, hence the predicate for including # resources.rc in the build. The correct fix for this Jammery is to # tell Boost.Build about MinGW's resource compiler (obviously this # will have to be added to Boost, not ASL). # : requirements <toolset>msvc:<source>resources/resources.rc : requirements <include>headers <link>static ; exe "visual" : sources/express_viewer.cpp sources/client_assembler.cpp sources/ui_core.cpp sources/ui_core_common.cpp $(PLATFORM_SOURCES) $(PLATFORM_SOURCE_DIR)/main.cpp $(PLATFORM_SOURCE_DIR)/display.cpp $(PLATFORM_SOURCE_DIR)/ui_core_implementation.cpp /adobe//asl_lib_dev /boost/filesystem//boost_filesystem : <include>$(PLATFORM_HEADERS) $(PLATFORM_DEFINITIONS) <link>static ; --- NEW FILE: version.plist --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildVersion</key> <string>92</string> <key>CFBundleVersion</key> <string>1.0</string> <key>ProductBuildVersion</key> <string>7K571</string> <key>ProjectName</key> <string>NibPBTemplates</string> <key>SourceVersion</key> <string>1200000</string> </dict> </plist> --- NEW FILE: visual.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="visual" ProjectGUID="{CC0782FD-B771-418B-A328-83ECA89726D6}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="bindebug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".\headers\win;.\resources;..\..\..\;..\..\..\third_party\boost_tp\boost;.\headers" PreprocessorDefinitions="WIN32;_LIB;NOMINMAX;ADOBE_SERIALIZATION=1;BOOST_ALL_NO_LIB=1;BOOST_THREAD_USE_LIB=1;WINVER=0x501;_WIN32_WINNT=0x501" GeneratePreprocessedFile="0" MinimalRebuild="FALSE" BasicRuntimeChecks="3" RuntimeLibrary="5" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="boost_lib.lib asl_lib_dev.lib comctl32.lib" OutputFile="$(OutDir)/visual.exe" LinkIncremental="2" AdditionalLibraryDirectories="..\..\build\boost_lib\bindebug;..\..\build\asl_lib_dev\bindebug" IgnoreDefaultLibraryNames="LIBCMTD" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/visual.pdb" SubSystem="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories=".\resources"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="bin" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories=".\headers\win;..\..\..\;..\..\..\third_party\boost_tp\boost;.\headers" PreprocessorDefinitions="WIN32;_LIB;NOMINMAX;NDEBUG;ADOBE_SERIALIZATION=1;BOOST_ALL_NO_LIB=1" GeneratePreprocessedFile="0" MinimalRebuild="FALSE" RuntimeLibrary="4" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="boost_lib.lib asl_lib_dev.lib comctl32.lib" OutputFile="$(OutDir)/visual.exe" LinkIncremental="1" AdditionalLibraryDirectories="..\..\build\boost_lib\bin;..\..\build\asl_lib_dev\bin" IgnoreDefaultLibraryNames="LIBCMT" GenerateDebugInformation="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" AdditionalIncludeDirectories=".\resources"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File RelativePath="..\..\future\source\assemblage.cpp"> </File> <File RelativePath=".\sources\client_assembler.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" GeneratePreprocessedFile="0"/> </FileConfiguration> </File> <File RelativePath=".\sources\win\display.cpp"> </File> <File RelativePath=".\sources\win\event_dispatcher.cpp"> </File> <File RelativePath=".\sources\express_viewer.cpp"> </File> <File RelativePath="..\..\future\source\iomanip.cpp"> </File> <File RelativePath="..\..\future\source\iomanip_pdf.cpp"> </File> <File RelativePath=".\sources\win\main.cpp"> </File> <File RelativePath=".\sources\win\metrics.cpp"> </File> <File RelativePath=".\sources\ui_core.cpp"> </File> <File RelativePath=".\sources\ui_core_common.cpp"> </File> <File RelativePath=".\sources\win\ui_core_implementation.cpp"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> <File RelativePath=".\resources\resources.rc"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: visual.mcp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: visual.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "visual", "visual.vcproj", "{CC0782FD-B771-418B-A328-83ECA89726D6}" ProjectSection(ProjectDependencies) = postProject {95184C7D-CE28-4D94-9A94-C9CC53562DB5} = {95184C7D-CE28-4D94-9A94-C9CC53562DB5} {190F47CE-E201-4ACC-8B49-E52180EE16EB} = {190F47CE-E201-4ACC-8B49-E52180EE16EB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asl_lib_dev", "..\..\build\asl_lib_dev\asl_lib_dev.vcproj", "{95184C7D-CE28-4D94-9A94-C9CC53562DB5}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_lib", "..\..\build\boost_lib\boost_lib.vcproj", "{190F47CE-E201-4ACC-8B49-E52180EE16EB}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {CC0782FD-B771-418B-A328-83ECA89726D6}.Debug.ActiveCfg = Debug|Win32 {CC0782FD-B771-418B-A328-83ECA89726D6}.Debug.Build.0 = Debug|Win32 {CC0782FD-B771-418B-A328-83ECA89726D6}.Release.ActiveCfg = Release|Win32 {CC0782FD-B771-418B-A328-83ECA89726D6}.Release.Build.0 = Release|Win32 {95184C7D-CE28-4D94-9A94-C9CC53562DB5}.Debug.ActiveCfg = Debug|Win32 {95184C7D-CE28-4D94-9A94-C9CC53562DB5}.Debug.Build.0 = Debug|Win32 {95184C7D-CE28-4D94-9A94-C9CC53562DB5}.Release.ActiveCfg = Release|Win32 {95184C7D-CE28-4D94-9A94-C9CC53562DB5}.Release.Build.0 = Release|Win32 {190F47CE-E201-4ACC-8B49-E52180EE16EB}.Debug.ActiveCfg = Debug|Win32 {190F47CE-E201-4ACC-8B49-E52180EE16EB}.Debug.Build.0 = Debug|Win32 {190F47CE-E201-4ACC-8B49-E52180EE16EB}.Release.ActiveCfg = Release|Win32 {190F47CE-E201-4ACC-8B49-E52180EE16EB}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:16:00
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/eve_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/eve_smoke Added Files: Jamfile default.eve eve_smoke.mcp main.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: default.eve --- dialog() { row() { button (name: "Hello"); } column() { button (name: "world!"); } } --- NEW FILE: main.cpp --- /* 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) */ /*************************************************************************************************/ #include <iostream> #include <sstream> #include <fstream> #include <string> #include <adobe/name.hpp> #include <adobe/value.hpp> #include <adobe/dictionary.hpp> #include <adobe/array.hpp> #include <adobe/eve.hpp> #include <adobe/eve_evaluate.hpp> #include <adobe/eve_parser.hpp> #include <boost/filesystem/path.hpp> /*************************************************************************************************/ // // position_t assemble( ... ) // /// This function dumps the output of the eve parser to std::cout. It probably /// should create all of the widgets demanded by the Eve file, but we're not /// 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(); } /*************************************************************************************************/ // // void testParse( std::string fileName ) // /// Try to parse the given filename and see what the parser throws up. /// /// \param fileName the name of the file to parse. // void testParse( boost::filesystem::path& fileName ) { // // Open our input stream. // std::ifstream stream( fileName.native_file_string().c_str() ); 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() // /// Main driver, choose which file to parse and call testParse. /// /// \param argc the count of arguments. /// \param argv the vector containing the arguments. /// /// \return always zero. // 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; } --- NEW FILE: Jamfile --- import testing ; project adobe/eve_smoke : requirements <link>static ; exe "eve_smoke" : main.cpp /adobe//asl_lib_dev /boost/filesystem//boost_filesystem ; --- NEW FILE: eve_smoke.mcp --- (This appears to be a binary file; contents omitted.) |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:59
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/adam_tutorial/bindebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/adam_tutorial/bindebug Added Files: placeholder Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: placeholder --- |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:59
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/eve_smoke/eve_smoke.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/eve_smoke/eve_smoke.xcode Added Files: project.pbxproj Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: project.pbxproj --- // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 39; objects = { 014CEA460018CE2711CA2923 = { buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Development; }; 014CEA470018CE2711CA2923 = { buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Deployment; }; //010 //011 //012 //013 //014 //020 //021 //022 //023 //024 0249A662FF388D9811CA2CEA = { children = ( 0249A663FF388D9811CA2CEA, 89B8AB2107FD0EED00E27588, 89B8AB2507FD0F0900E27588, ); isa = PBXGroup; name = "External Frameworks and Libraries"; refType = 4; sourceTree = "<group>"; }; 0249A663FF388D9811CA2CEA = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libstdc++.a"; path = "/usr/lib/libstdc++.a"; refType = 0; sourceTree = "<absolute>"; }; //020 //021 //022 //023 //024 //080 //081 //082 //083 //084 08FB7793FE84155DC02AAC07 = { buildSettings = { }; buildStyles = ( 014CEA460018CE2711CA2923, 014CEA470018CE2711CA2923, ); hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 08FB7794FE84155DC02AAC07; projectDirPath = ""; targets = ( 8DD76F620486A84900D96B5E, ); }; 08FB7794FE84155DC02AAC07 = { children = ( 08FB7795FE84155DC02AAC07, C6859E8C029090F304C91782, 0249A662FF388D9811CA2CEA, 1AB674ADFE9D54B511CA2CBB, ); isa = PBXGroup; name = eve_smoke; refType = 4; sourceTree = "<group>"; }; 08FB7795FE84155DC02AAC07 = { children = ( 08FB7796FE84155DC02AAC07, ); isa = PBXGroup; name = Source; refType = 4; sourceTree = "<group>"; }; 08FB7796FE84155DC02AAC07 = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; refType = 4; sourceTree = "<group>"; }; //080 //081 //082 //083 //084 //1A0 //1A1 //1A2 //1A3 //1A4 1AB674ADFE9D54B511CA2CBB = { children = ( 8DD76F6C0486A84900D96B5E, ); isa = PBXGroup; name = Products; refType = 4; sourceTree = "<group>"; }; //1A0 //1A1 //1A2 //1A3 //1A4 //890 //891 //892 //893 //894 89B8AB2107FD0EED00E27588 = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = libasl_dev.a; path = ../../build/asl_lib/build/libasl_dev.a; refType = 2; sourceTree = SOURCE_ROOT; }; 89B8AB2207FD0EED00E27588 = { fileRef = 89B8AB2107FD0EED00E27588; isa = PBXBuildFile; settings = { }; }; 89B8AB2507FD0F0900E27588 = { isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost.a; path = ../../build/boost_lib/build/libboost.a; refType = 2; sourceTree = SOURCE_ROOT; }; 89B8AB2607FD0F0900E27588 = { fileRef = 89B8AB2507FD0F0900E27588; isa = PBXBuildFile; settings = { }; }; //890 //891 //892 //893 //894 //8D0 //8D1 //8D2 //8D3 //8D4 8DD76F620486A84900D96B5E = { buildPhases = ( 8DD76F640486A84900D96B5E, 8DD76F660486A84900D96B5E, 8DD76F690486A84900D96B5E, ); buildRules = ( ); buildSettings = { GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ADOBE_SERIALIZATION; HEADER_SEARCH_PATHS = "../../../ ../../../third_party/boost_tp/boost/"; INSTALL_PATH = "$(HOME)/bin"; LIBRARY_SEARCH_PATHS = "/Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/build/asl_lib/build /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/build/boost_lib/build"; PRODUCT_NAME = eve_smoke; WARNING_CFLAGS = "-Wno-long-double"; }; dependencies = ( ); isa = PBXNativeTarget; name = eve_smoke; productInstallPath = "$(HOME)/bin"; productName = eve_smoke; productReference = 8DD76F6C0486A84900D96B5E; productType = "com.apple.product-type.tool"; }; 8DD76F640486A84900D96B5E = { buildActionMask = 2147483647; files = ( 8DD76F650486A84900D96B5E, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DD76F650486A84900D96B5E = { fileRef = 08FB7796FE84155DC02AAC07; isa = PBXBuildFile; settings = { ATTRIBUTES = ( ); }; }; 8DD76F660486A84900D96B5E = { buildActionMask = 2147483647; files = ( 8DD76F670486A84900D96B5E, 89B8AB2207FD0EED00E27588, 89B8AB2607FD0F0900E27588, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DD76F670486A84900D96B5E = { fileRef = 0249A663FF388D9811CA2CEA; isa = PBXBuildFile; settings = { }; }; 8DD76F690486A84900D96B5E = { buildActionMask = 8; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( 8DD76F6A0486A84900D96B5E, ); isa = PBXCopyFilesBuildPhase; runOnlyForDeploymentPostprocessing = 1; }; 8DD76F6A0486A84900D96B5E = { fileRef = C6859E8B029090EE04C91782; isa = PBXBuildFile; settings = { }; }; 8DD76F6C0486A84900D96B5E = { explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; isa = PBXFileReference; path = eve_smoke; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; }; //8D0 //8D1 //8D2 //8D3 //8D4 //C60 //C61 //C62 //C63 //C64 C6859E8B029090EE04C91782 = { isa = PBXFileReference; lastKnownFileType = text.man; path = eve_smoke.1; refType = 4; sourceTree = "<group>"; }; C6859E8C029090F304C91782 = { children = ( C6859E8B029090EE04C91782, ); isa = PBXGroup; name = Documentation; refType = 4; sourceTree = "<group>"; }; }; rootObject = 08FB7793FE84155DC02AAC07; } |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:59
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/eve_smoke/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/eve_smoke/bin Added Files: placeholder Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: placeholder --- |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:59
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/eve_smoke/bindebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/eve_smoke/bindebug Added Files: placeholder Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: placeholder --- |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:58
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/adam_tutorial/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/adam_tutorial/bin Added Files: placeholder Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: placeholder --- |
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/source Added Files: adam.cpp adam_evaluate.cpp adam_parser.cpp array.cpp dictionary.cpp eve.cpp eve_engine.cpp eve_evaluate.cpp eve_parser.cpp expression_parser.cpp expression_parser.hpp istream.cpp lex_stream.cpp lex_stream.hpp lex_stream_fwd.hpp metrowerks_mach_o.hpp name.cpp parse.cpp parse_pdf.cpp parser_shared.cpp parser_shared.hpp rectangle.cpp string_pool.cpp string_pool.hpp test_configuration.cpp token.cpp token.hpp typeinfo.cpp value.cpp virtual_machine.cpp xstr.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: xstr.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/xstr.hpp> #include <adobe/config.hpp> #include <adobe/name.hpp> #include <adobe/dictionary.hpp> #include <adobe/once.hpp> #include <adobe/algorithm.hpp> #include <adobe/functional.hpp> #include <vector> #include <map> [...1015 lines suppressed...] node_t::attribute_set_t::const_iterator first(default_context_g->begin()); node_t::attribute_set_t::const_iterator last(default_context_g->end()); for (; first != last; ++first) dict[first->first] = adobe::value_t(first->second); } return result; } /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ ADOBE_ONCE_DEFINITION(xstr_once, init_xstr_once) /*************************************************************************************************/ --- NEW FILE: adam_parser.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <utility> #include <istream> #include <sstream> #include <iomanip> #include <cassert> #include <boost/bind.hpp> #include <boost/array.hpp> #include <adobe/once.hpp> #include <adobe/array.hpp> #include <adobe/name.hpp> #include <adobe/value.hpp> #include <adobe/dictionary.hpp> #include <adobe/algorithm.hpp> #include <adobe/source/token.hpp> #include <adobe/adam_parser.hpp> #include <adobe/source/expression_parser.hpp> #include <adobe/adam.hpp> /*************************************************************************************************/ /* TODO (sparent) : Changes to grammar - * 1. input/output qualifiers go away - auto-detect qualification. * 2. State cells go away. * 3. non_reversible goes away (need to add some kind of idempotent check). 4. Add relate clause * 5. Question: Does "relation_set" go away? What are they for? 6. The current relation sets should be renamed if they stay - what is in relate is a relation set. 7. Need to add some way to declare validity predicate. * 8. Question: Do "when" and "after" conditionals only apply to relate clauses? For optional items ensure that if present - the following items are required. after is currently not connected. */ /*************************************************************************************************/ namespace { void init_keyword_table(); } ADOBE_ONCE_DECLARATION(adobe_adam_parser) ADOBE_ONCE_DEFINITION(adobe_adam_parser, init_keyword_table) /*************************************************************************************************/ namespace { /*************************************************************************************************/ typedef boost::array<adobe::name_t, 10> keyword_table_t; /*************************************************************************************************/ /* WARNING (sparent) : Initialization of these once_name_t items is defered until adam_parser::adam_parser(). */ keyword_table_t* keyword_table_g; const adobe::once_name_t input_k; const adobe::once_name_t output_k; const adobe::once_name_t interface_k; const adobe::once_name_t logic_k; const adobe::once_name_t constant_k; const adobe::once_name_t invariant_k; const adobe::once_name_t sheet_k; const adobe::once_name_t unlink_k; const adobe::once_name_t when_k; const adobe::once_name_t relate_k; /*************************************************************************************************/ void init_keyword_table() { adobe::remove_const(input_k) = adobe::static_name_t("input"); adobe::remove_const(output_k) = adobe::static_name_t("output"); adobe::remove_const(interface_k) = adobe::static_name_t("interface"); adobe::remove_const(logic_k) = adobe::static_name_t("logic"); adobe::remove_const(constant_k) = adobe::static_name_t("constant"); adobe::remove_const(invariant_k) = adobe::static_name_t("invariant"); adobe::remove_const(sheet_k) = adobe::static_name_t("sheet"); adobe::remove_const(unlink_k) = adobe::static_name_t("unlink"); adobe::remove_const(when_k) = adobe::static_name_t("when"); adobe::remove_const(relate_k) = adobe::static_name_t("relate"); static keyword_table_t keyword_table_s = {{ input_k, output_k, interface_k, logic_k, constant_k, invariant_k, sheet_k, unlink_k, when_k, relate_k }}; adobe::sort(keyword_table_s); keyword_table_g = &keyword_table_s; } /*************************************************************************************************/ bool keyword_lookup(const adobe::name_t& name) { keyword_table_t::const_iterator iter(adobe::lower_bound(*keyword_table_g, name)); return (iter != keyword_table_g->end() && *iter == name); } void once_instance() { ADOBE_ONCE_INSTANCE(adobe_adam_parser); } /*************************************************************************************************/ } // namespace /*************************************************************************************************/ /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ /*! \page adam_grammar Adam Grammar \code translation_unit = { sheet_specifier }. sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" [trail_comment]. qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl | constant_set_decl | logic_set_decl | invariant_set_decl. interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. input_cell_decl = identifier [initializer] end_statement. output_cell_decl = named_decl. constant_cell_decl = identifier initializer end_statement. logic_cell_decl = named_decl | relate_decl. invariant_cell_decl = named_decl. relate_decl = [conditional] "relate" "{" relate_expression relate_expression { relate_expression } "}" [trail_comment]. relate_expression = [lead_comment] named_decl. named_decl = identifier define_expression end_statement. initializer = ":" expression. conditional = "when" "(" expression ")". define_expression = "<==" expression. end_statement = ";" [trail_comment]. \endcode */ /*************************************************************************************************/ class adam_parser : private expression_parser { public: adam_parser(std::istream& in, const line_position_t& position, const adam_callback_suite_t& callbacks); using expression_parser::require_expression; // Export is_expression for client // translation_unit = { sheet_specifier }. void parse(); private: typedef adam_callback_suite_t::relation_t relation_t; typedef std::vector<relation_t> relation_set_t; adam_callback_suite_t adam_callback_suite_m; // sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" [trail_comment]. bool is_sheet_specifier(); // qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl // | constant_set_decl | logic_set_decl | invariant_set_decl. bool is_qualified_cell_decl(); // interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. bool is_interface_set_decl(); // input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. bool is_input_set_decl(); // output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. bool is_output_set_decl(); // constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. bool is_constant_set_decl(); // logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. bool is_logic_set_decl(); // invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. bool is_invariant_set_decl(); // interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. bool is_interface_cell_decl(const std::string& detailed); // input_cell_decl = identifier [initializer] end_statement. bool is_input_cell_decl(const std::string& detailed); // output_cell_decl = named_decl. bool is_output_cell_decl(const std::string& detailed); // constant_cell_decl = identifier initializer end_statement. bool is_constant_cell_decl(const std::string& detailed); // logic_cell_decl = named_decl | relate_decl. bool is_logic_cell_decl(const std::string& detailed); // invariant_cell_decl = named_decl. bool is_invariant_cell_decl(const std::string& detailed); // relate_decl = [conditional] "relate" "{" relate_expression relate_expression { relate_expression } "}" [trail_comment]. bool is_relate_decl(line_position_t& position, array_t& expression, relation_set_t&, std::string&); // relate_expression = [lead_comment] named_decl. bool is_relate_expression_decl(relation_t&); // named_decl = identifier define_expression end_statement. bool is_named_decl(name_t& cell_name, line_position_t& position, array_t& expression, std::string&); // initializer = ":" expression. bool is_initializer(line_position_t&, array_t& initializer); // conditional = "when" "(" expression ")". bool is_conditional(line_position_t& position, array_t& expression); // define_expression = "<==" expression. bool is_define_expression(line_position_t&, array_t&); // end_statement = ";" [trail_comment]. void require_end_statement(std::string& brief); typedef void (sheet_t::*sheet_add_t)(name_t, const relation_t&); typedef bool (adam_parser::*set_decl_t)(const std::string& detailed); bool is_logic_or_invariant_cell_decl(sheet_add_t); bool is_set_decl(name_t, set_decl_t); }; /*************************************************************************************************/ adam_parser::adam_parser(std::istream& in, const line_position_t& position, const adam_callback_suite_t& callbacks) : expression_parser(in, position), adam_callback_suite_m(callbacks) { once_instance(); set_keyword_extension_lookup(boost::bind(&keyword_lookup, _1)); assert(adam_callback_suite_m.add_cell_proc_m); // all callbacks are required. assert(adam_callback_suite_m.add_relation_proc_m); assert(adam_callback_suite_m.add_interface_proc_m); } /*************************************************************************************************/ void parse(std::istream& stream, const line_position_t& position, const adam_callback_suite_t& callbacks) { adam_parser(stream, position, callbacks).parse(); } /*************************************************************************************************/ array_t parse_adam_expression(const std::string& str_expression) { once_instance(); std::stringstream expression_stream(str_expression); adobe::expression_parser parser(expression_stream, line_position_t("expression")); parser.set_keyword_extension_lookup(boost::bind(&keyword_lookup, _1)); adobe::array_t expression; parser.require_expression(expression); return expression; } /*************************************************************************************************/ /* REVISIT (sparent) : sheets need to become copy-on-write and then this should return a list of sheets. */ void adam_parser::parse() { while (is_sheet_specifier()) ; require_token(eof_k); } /*************************************************************************************************/ // sheet_specifier = [lead_comment] "sheet" identifier "{" { qualified_cell_decl } "}" [trail_comment]. bool adam_parser::is_sheet_specifier() { is_token(lead_comment_k); if (!is_token(sheet_k)) return false; require_token(identifier_k); require_token(open_brace_k); while (is_qualified_cell_decl()) { } require_token(close_brace_k); is_token(trail_comment_k); return true; } /*************************************************************************************************/ // qualified_cell_decl = interface_set_decl | input_set_decl | output_set_decl // | constant_set_decl | logic_set_decl | invariant_set_decl. bool adam_parser::is_qualified_cell_decl() { if ( is_interface_set_decl() || is_input_set_decl() || is_output_set_decl() || is_constant_set_decl() || is_logic_set_decl() || is_invariant_set_decl()) { return true; } return false; } /*************************************************************************************************/ // interface_set_decl = "interface" ":" { [lead_comment] interface_cell_decl }. bool adam_parser::is_interface_set_decl() { return is_set_decl(interface_k, &adam_parser::is_interface_cell_decl); } /*************************************************************************************************/ // input_set_decl = "input" ":" { [lead_comment] input_cell_decl }. bool adam_parser::is_input_set_decl() { return is_set_decl(input_k, &adam_parser::is_input_cell_decl); } /*************************************************************************************************/ // output_set_decl = "output" ":" { [lead_comment] output_cell_decl }. bool adam_parser::is_output_set_decl() { return is_set_decl(output_k, &adam_parser::is_output_cell_decl); } /*************************************************************************************************/ // constant_set_decl = "constant" ":" { [lead_comment] constant_cell_decl }. bool adam_parser::is_constant_set_decl() { return is_set_decl(constant_k, &adam_parser::is_constant_cell_decl); } /*************************************************************************************************/ // logic_set_decl = "logic" ":" { [lead_comment] logic_cell_decl }. bool adam_parser::is_logic_set_decl() { return is_set_decl(logic_k, &adam_parser::is_logic_cell_decl); } /*************************************************************************************************/ // invariant_set_decl = "invariant" ":" { [lead_comment] invariant_cell_decl }. bool adam_parser::is_invariant_set_decl() { return is_set_decl(invariant_k, &adam_parser::is_invariant_cell_decl); } /*************************************************************************************************/ // interface_cell_decl = ["unlink"] identifier [initializer] [define_expression] end_statement. bool adam_parser::is_interface_cell_decl(const std::string& detailed) { name_t cell_name; array_t initializer, expression; line_position_t initializer_position, expression_position; std::string brief; bool linked (!is_token(unlink_k)); if (!is_identifier(cell_name)) return false; (void)is_initializer(initializer_position, initializer); (void)is_define_expression(expression_position, expression); require_end_statement(brief); adam_callback_suite_m.add_interface_proc_m (cell_name, linked, initializer_position, initializer, expression_position, expression, brief, detailed); return true; } /*************************************************************************************************/ // input_cell_decl = identifier [initializer] end_statement. bool adam_parser::is_input_cell_decl(const std::string& detailed) { name_t cell_name; array_t initializer; line_position_t position; std::string brief; if (!is_identifier(cell_name)) return false; (void)is_initializer(position, initializer); require_end_statement(brief); adam_callback_suite_m.add_cell_proc_m(adam_callback_suite_t::input_k, cell_name, position, initializer, brief, detailed); return true; } /*************************************************************************************************/ // output_cell_decl = named_decl. bool adam_parser::is_output_cell_decl(const std::string& detailed) { name_t cell_name; line_position_t position; array_t expression; std::string brief; // REVISIT (fbreret) do something with me if (!is_named_decl(cell_name, position, expression, brief)) return false; adam_callback_suite_m.add_cell_proc_m(adam_callback_suite_t::output_k, cell_name, position, expression, brief, detailed); return true; } /*************************************************************************************************/ // constant_cell_decl = identifier initializer end_statement. bool adam_parser::is_constant_cell_decl(const std::string& detailed) { name_t cell_name; line_position_t position; array_t initializer; std::string brief; if (!is_identifier(cell_name)) return false; if (!is_initializer(position, initializer)) throw_exception("initializer required"); require_end_statement(brief); adam_callback_suite_m.add_cell_proc_m(adam_callback_suite_t::constant_k, cell_name, position, initializer, brief, detailed); return true; } /*************************************************************************************************/ // logic_cell_decl = named_decl | relate_decl. bool adam_parser::is_logic_cell_decl(const std::string& detailed) { name_t cell_name; line_position_t position; array_t expression; std::string brief; relation_set_t relations; if (is_named_decl(cell_name, position, expression, brief)) { adam_callback_suite_m.add_cell_proc_m(adam_callback_suite_t::logic_k, cell_name, position, expression, brief, detailed); return true; } else if (is_relate_decl(position, expression, relations, brief)) { adam_callback_suite_m.add_relation_proc_m( position, expression, &relations.front(), &relations.front() + relations.size(), brief, detailed); return true; } return false; } /*************************************************************************************************/ // invariant_cell_decl = named_decl. bool adam_parser::is_invariant_cell_decl(const std::string& detailed) { name_t cell_name; line_position_t position; array_t expression; std::string brief; if (!is_named_decl(cell_name, position, expression, brief)) return false; adam_callback_suite_m.add_cell_proc_m(adam_callback_suite_t::invariant_k, cell_name, position, expression, brief, detailed); return true; } /*************************************************************************************************/ // relate_decl = [conditional] "relate" "{" relate_expression relate_expression { relate_expression } "}" [trail_comment] bool adam_parser::is_relate_decl(line_position_t& position, array_t& expression, relation_set_t& relation_set, std::string& brief) { if (is_conditional(position, expression)) require_token(relate_k); else if (!is_token(relate_k)) return false; require_token(open_brace_k); relation_t relation_1; relation_t relation_2; if (!is_relate_expression_decl(relation_1) || !is_relate_expression_decl(relation_2)) { throw_exception("minimum two relate_expression required"); } relation_set.push_back(relation_1); relation_set.push_back(relation_2); relation_1.expression_m.clear(); while (is_relate_expression_decl(relation_1)) { relation_set.push_back(relation_1); relation_1.expression_m.clear(); } require_token(close_brace_k); (void)is_trail_comment(brief); return true; } /*************************************************************************************************/ // relate_expression = [lead_comment] named_decl. bool adam_parser::is_relate_expression_decl(relation_t& relation) { (void)is_lead_comment(relation.detailed_m); return is_named_decl(relation.name_m, relation.position_m, relation.expression_m, relation.brief_m); } /*************************************************************************************************/ // named_decl = identifier define_expression end_statement. bool adam_parser::is_named_decl(name_t& cell_name, line_position_t& position, array_t& expression, std::string& brief) { if (!is_identifier(cell_name)) return false; if (!is_define_expression(position, expression)) throw_exception("define_expression required"); require_end_statement(brief); return true; } /*************************************************************************************************/ // initializer = ":" expression. bool adam_parser::is_initializer(line_position_t& position, array_t& expression) { if (!is_token(colon_k)) return false; position = next_position(); require_expression(expression); return true; } /*************************************************************************************************/ // define_expression = "<==" expression. bool adam_parser::is_define_expression(line_position_t& position, array_t& expression) { if (!is_token(is_k)) return false; position = next_position(); require_expression(expression); return true; } /*************************************************************************************************/ // conditional = "when" "(" expression ")". bool adam_parser::is_conditional(line_position_t& position, array_t& expression) { if (!is_token(when_k)) return false; require_token(open_parenthesis_k); position = next_position(); require_expression(expression); require_token(close_parenthesis_k); return true; } /*************************************************************************************************/ // end_statement = ";" [trail_comment]. void adam_parser::require_end_statement(std::string& brief) { require_token(semicolon_k); (void)is_trail_comment(brief); } /*************************************************************************************************/ bool adam_parser::is_set_decl(name_t token, set_decl_t set_decl) { if (!is_token(token)) return false; require_token(colon_k); while (true) { std::string detailed; (void)is_lead_comment(detailed); if (!(this->*set_decl)(detailed)) break; } return true; } /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ --- NEW FILE: name.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/name.hpp> #include <set> #include <adobe/once.hpp> #include <adobe/source/string_pool.hpp> #if defined(ADOBE_SERIALIZATION) #include <ostream> #endif /*************************************************************************************************/ ADOBE_GLOBAL_MUTEX_DEFINITION(name_t) /*************************************************************************************************/ namespace { /*************************************************************************************************/ struct str_less { bool operator () (const char* x, const char* y) const { return std::strcmp(x, y) < 0; } }; /*************************************************************************************************/ // Precondition: length only need be non-zero if not copying // Precondition: if string_name is null - length must be zero const char* unique_string(const char* string_name, std::size_t length, bool copy) { typedef std::set<const char*, str_less> name_store_t; static const char* empty_string_s = ""; if (length == 0) return empty_string_s; ADOBE_GLOBAL_MUTEX_INSTANCE(name_t); static name_store_t name_store_s; static adobe::string_pool string_pool_s; name_store_t::iterator iter = name_store_s.find(string_name); if (iter == name_store_s.end()) { if (copy) string_name = string_pool_s.add(string_name, length); iter = name_store_s.insert(string_name).first; } return *iter; } /*************************************************************************************************/ } // namespace /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ name_t::name_t (const char* string_name) { std::size_t length = (string_name && *string_name) ? std::strlen(string_name) : 0; name_m = unique_string(string_name, length, true); } /*************************************************************************************************/ name_t::name_t (const char* string_name, std::size_t length) { name_m = unique_string(string_name, length, true); } /*************************************************************************************************/ name_t::name_t (const char* string_name, dont_copy_t) { // length only needs to be non-zero since we aren't copying std::size_t length = (string_name && *string_name) ? std::size_t(1) : 0; name_m = unique_string(string_name, length, false); } /*************************************************************************************************/ #if defined(ADOBE_SERIALIZATION) std::ostream& operator << (std::ostream& os, const adobe::name_t& t) { os << t.get(); return os; } #endif /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ --- NEW FILE: eve_engine.cpp --- --- NEW FILE: parser_shared.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_PARSER_SHARED_HPP #define ADOBE_PARSER_SHARED_HPP /*************************************************************************************************/ #include <adobe/istream_fwd.hpp> #include <adobe/name_fwd.hpp> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ void throw_parser_exception(const char* errorString, const adobe::line_position_t& position); void throw_parser_exception(adobe::name_t expected, adobe::name_t found, const adobe::line_position_t& position); /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ #endif // ADOBE_PARSER_SHARED_HPP /*************************************************************************************************/ --- NEW FILE: token.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/name_fwd.hpp> #include <adobe/once.hpp> /*************************************************************************************************/ ADOBE_ONCE_DECLARATION(adobe_token) ADOBE_ONCE_STATIC_INSTANCE(adobe_token) /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ extern const once_name_t ifelse_k; extern const once_name_t number_k; extern const once_name_t identifier_k; extern const once_name_t string_k; extern const once_name_t lead_comment_k; extern const once_name_t trail_comment_k; extern const once_name_t semicolon_k; extern const once_name_t comma_k; extern const once_name_t assign_k; extern const once_name_t question_k; extern const once_name_t colon_k; extern const once_name_t open_brace_k; extern const once_name_t close_brace_k; extern const once_name_t open_parenthesis_k; extern const once_name_t close_parenthesis_k; extern const once_name_t dot_k; extern const once_name_t open_bracket_k; extern const once_name_t close_bracket_k; extern const once_name_t at_k; extern const once_name_t is_k; extern const once_name_t add_k; extern const once_name_t subtract_k; extern const once_name_t multiply_k; extern const once_name_t divide_k; extern const once_name_t modulus_k; extern const once_name_t not_k; extern const once_name_t unary_negate_k; extern const once_name_t less_k; extern const once_name_t greater_k; extern const once_name_t and_k; extern const once_name_t or_k; extern const once_name_t less_equal_k; extern const once_name_t greater_equal_k; extern const once_name_t not_equal_k; extern const once_name_t equal_k; extern const once_name_t empty_k; extern const once_name_t true_k; extern const once_name_t false_k; extern const once_name_t function_k; extern const once_name_t variable_k; extern const once_name_t index_k; extern const once_name_t array_k; extern const once_name_t dictionary_k; extern const once_name_t eof_k; /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ --- NEW FILE: lex_stream.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_LEX_STREAM_HPP #define ADOBE_LEX_STREAM_HPP /*************************************************************************************************/ #include <adobe/source/lex_stream_fwd.hpp> #include <adobe/istream.hpp> #include <boost/array.hpp> #include <iosfwd> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ class lex_stream_t; /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ void swap(adobe::lex_stream_t&, adobe::lex_stream_t&); /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ class lex_stream_t { 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 token_value_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) }; /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ inline void swap(adobe::lex_stream_t& x, adobe::lex_stream_t& y) { std::swap(x.object_m, y.object_m); } /*************************************************************************************************/ #endif // ADOBE_LEX_STREAM_HPP /*************************************************************************************************/ --- NEW FILE: parse_pdf.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/parse_pdf.hpp> #include <adobe/array.hpp> #include <adobe/iomanip.hpp> #include <adobe/dictionary.hpp> #include <iostream> #include <cstdlib> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ parser_pdf::parser_pdf() { doc = *( seq[&parser_pdf::s_handle_seq] | bag[&parser_pdf::s_handle_bag] | comment[&parser_pdf::s_handle_comment] | str[&parser_pdf::s_handle_str] | boost::spirit::space_p ); comment = '%' >> *(boost::spirit::print_p - boost::spirit::eol_p) >> boost::spirit::eol_p; key = "/" >> *(boost::spirit::alnum_p | '_'); num = boost::spirit::real_p | boost::spirit::int_p; element = str[&parser_pdf::s_handle_str] | seq[&parser_pdf::s_handle_seq] | bag[&parser_pdf::s_handle_bag] | num[&parser_pdf::s_handle_num] | key[&parser_pdf::s_handle_key]; array_elements = element % *boost::spirit::space_p; bag_elements = ( key[&parser_pdf::s_handle_key] >> +boost::spirit::space_p >> element ) % *boost::spirit::space_p; str = '(' >> *(boost::spirit::print_p - ')') >> ')' >> *boost::spirit::eol_p; seq = '[' >> *boost::spirit::space_p >> !array_elements >> *boost::spirit::space_p >> ']' >> *boost::spirit::space_p; bag = "<<" >> *boost::spirit::space_p >> !bag_elements >> *boost::spirit::space_p >> ">>" >> *boost::spirit::space_p; BOOST_SPIRIT_DEBUG_RULE(doc); BOOST_SPIRIT_DEBUG_RULE(comment); BOOST_SPIRIT_DEBUG_RULE(seq); BOOST_SPIRIT_DEBUG_RULE(bag); BOOST_SPIRIT_DEBUG_RULE(array_elements); BOOST_SPIRIT_DEBUG_RULE(bag_elements); BOOST_SPIRIT_DEBUG_RULE(element); BOOST_SPIRIT_DEBUG_RULE(key); BOOST_SPIRIT_DEBUG_RULE(str); BOOST_SPIRIT_DEBUG_RULE(num); } /*************************************************************************************************/ bool parser_pdf::do_parse(const char* in_string) { boost::spirit::parse_info<> result(boost::spirit::parse(in_string, doc[&parser_pdf::s_handle_doc])); //std::cout << "hit:\t" << std::boolalpha << result.hit << "\n"; //std::cout << "full:\t" << std::boolalpha << result.full << "\n"; //std::cout << "length:\t" << result.length << "\n"; //std::cout << "stop:\t" << result.stop << "\n"; //std::cout << "eval stack height: " << height() << "\n"; return result.full; } /*************************************************************************************************/ void parser_pdf::handle_str(const char* first, const char* last) { push(parse_stack::node_t(first, last, adobe::value(std::string(first + 1, last - 1)))); //std::cout << "String: " << stack_top_value() << "\n"; } void parser_pdf::handle_seq(const char* first, const char* last) { parse_stack::node_t temp_node(first, last); std::list<value> temp_arr; std::size_t count(0); while (stack_top().contained_by(temp_node)) { temp_arr.push_front(stack_top_value()); pop(); ++count; } array new_arr(temp_arr.begin(), temp_arr.end()); push(parse_stack::node_t(first, last, adobe::value(new_arr))); //std::cout << "Sequence of " << count << " items pushed.\n"; } void parser_pdf::handle_comment(const char* /*first*/, const char* /*last*/) { //std::cout << "Comment: " << std::string(first, last) << "\n"; } void parser_pdf::handle_bag(const char* first, const char* last) { parse_stack::node_t temp_node(first, last); dictionary new_dict; std::size_t count(0); while (stack_top().contained_by(temp_node)) { value temp_value(stack_top_value()); pop(); name temp_name(stack_top_value().get<name>()); pop(); new_dict.write()[temp_name] = temp_value; ++count; } push(parse_stack::node_t(first, last, adobe::value(new_dict))); //std::cout << "Bag of " << count << " items pushed.\n"; } void parser_pdf::handle_num(const char* first, const char* last) { double temp(std::atof(std::string(first, last).c_str())); push(parse_stack::node_t(first, last, adobe::value(temp))); //std::cout << "Num: " << stack_top_value() << "\n"; } void parser_pdf::handle_key(const char* first, const char* last) { name temp(std::string(first + 1, last).c_str()); push(parse_stack::node_t(first, last, adobe::value(temp))); //std::cout << "Key: " << stack_top_value() << "\n"; } void parser_pdf::handle_doc(const char* first, const char* last) { handle_seq(first, last); //std::cout << "Doc Pushed!\n"; } /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ --- NEW FILE: value.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/value.hpp> #include <adobe/empty.hpp> #include <adobe/once.hpp> #if defined(ADOBE_SERIALIZATION) #include <ostream> #endif /*************************************************************************************************/ namespace { /*************************************************************************************************/ adobe::value_t* value_g; /*************************************************************************************************/ void init_once() { static adobe::value_t sValue; value_g = &sValue; } /*************************************************************************************************/ } // namespace /*************************************************************************************************/ ADOBE_ONCE_DECLARATION(adobe_value) ADOBE_ONCE_DEFINITION(adobe_value, init_once) /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ value_t::implementation_t::~implementation_t() { } /************************************************************************************************/ #ifdef __MWERKS__ #pragma mark - #endif /*************************************************************************************************/ const value_t& value_empty() { ADOBE_ONCE_INSTANCE(adobe_value); return *value_g; } /*************************************************************************************************/ #if !defined(ADOBE_NO_DOCUMENTATION) value_t::value_t() : object_m (make_instance(empty_t())) { } value_t::value_t(const value_t& x) : object_m(x.object_m->copy()) { } value_t& value_t::operator = (const value_t& x) { if (object_m == x.object_m) return *this; if (x.type() == type()) object_m->assign(*x.object_m); else { implementation_t* temp = x.object_m->copy(); delete object_m; object_m = temp; } return *this; } value_t::~value_t() { delete object_m; } #endif // !defined(ADOBE_NO_DOCUMENTATION) /*************************************************************************************************/ const std::type_info& value_t::type() const { return object_m->type(); } bool value_t::equal(const value_t& x) const { return object_m->equal(*x.object_m); } /*************************************************************************************************/ bool operator == (const value_t& x, const value_t& y) { return (x.type() == y.type()) && x.equal(y); } #if defined(ADOBE_SERIALIZATION) void value_t::stream_out(std::ostream& stream) const { object_m->stream_out(stream); } std::ostream& operator << (std::ostream& stream, const value_t& x) { x.stream_out(stream); return stream; } #endif /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ --- NEW FILE: metrowerks_mach_o.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ /* These are the switches required to build using the MSL C header for a Mach-O target. */ #pragma c99 on #define _MSL_USING_MW_C_HEADERS 1 /* These defines allow <Carbon/Carbon.h> to build */ #ifndef __NOEXTENSIONS__ #define __NOEXTENSIONS__ #endif #ifndef __CF_USE_FRAMEWORK_INCLUDES__ #define __CF_USE_FRAMEWORK_INCLUDES__ #endif /*************************************************************************************************/ --- NEW FILE: token.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/name.hpp> #include <adobe/source/token.hpp> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ const once_name_t ifelse_k; const once_name_t number_k; const once_name_t identifier_k; const once_name_t string_k; const once_name_t lead_comment_k; const once_name_t trail_comment_k; const once_name_t semicolon_k; const once_name_t comma_k; const once_name_t assign_k; const once_name_t question_k; const once_name_t colon_k; const once_name_t open_brace_k; const once_name_t close_brace_k; const once_name_t open_parenthesis_k; const once_name_t close_parenthesis_k; const once_name_t dot_k; const once_name_t open_bracket_k; const once_name_t close_bracket_k; const once_name_t at_k; const once_name_t is_k; const once_name_t add_k; const once_name_t subtract_k; const once_name_t multiply_k; const once_name_t divide_k; const once_name_t modulus_k; const once_name_t not_k; const once_name_t unary_negate_k; const once_name_t less_k; const once_name_t greater_k; const once_name_t and_k; const once_name_t or_k; const once_name_t less_equal_k; const once_name_t greater_equal_k; const once_name_t not_equal_k; const once_name_t equal_k; const once_name_t empty_k; const once_name_t true_k; const once_name_t false_k; const once_name_t function_k; const once_name_t variable_k; const once_name_t index_k; const once_name_t array_k; const once_name_t dictionary_k; const once_name_t eof_k; /*************************************************************************************************/ } // namespace adobe /*************************************************************************************************/ namespace { /*************************************************************************************************/ void init_once() { using namespace adobe; remove_const(ifelse_k) = static_name_t(".ifelse"); remove_const(number_k) = static_name_t("number"); remove_const(identifier_k) = static_name_t("identifier"); remove_const(string_k) = static_name_t("string"); remove_const(lead_comment_k) = static_name_t("lead_comment"); remove_const(trail_comment_k) = static_name_t("trail_comment"); remove_const(semicolon_k) = static_name_t("semicolon"); remove_const(comma_k) = static_name_t("comma"); remove_const(assign_k) = static_name_t("assign"); remove_const(question_k) = static_name_t("question"); remove_const(colon_k) = static_name_t("colon"); remove_const(open_brace_k) = static_name_t("open_brace"); remove_const(close_brace_k) = static_name_t("close_brace"); remove_const(open_parenthesis_k) = static_name_t("open_parenthesis"); remove_const(close_parenthesis_k) = static_name_t("close_parenthesis"); remove_const(dot_k) = static_name_t("dot"); remove_const(open_bracket_k) = static_name_t("open_bracket"); remove_const(close_bracket_k) = static_name_t("close_bracket"); remove_const(at_k) = static_name_t(".at"); remove_const(is_k) = static_name_t(".is"); remove_const(add_k) = static_name_t(".add"); remove_const(subtract_k) = static_name_t(".subtract"); remove_const(multiply_k) = static_name_t(".multiply"); remove_const(divide_k) = static_name_t(".divide"); remove_const(modulus_k) = static_name_t(".modulus"); remove_const(not_k) = static_name_t(".not"); remove_const(unary_negate_k) = static_name_t(".unary_negate"); remove_const(less_k) = static_name_t(".less"); remove_const(greater_k) = static_name_t(".greater"); remove_const(and_k) = static_name_t(".and"); remove_const(or_k) = static_name_t(".or"); remove_const(less_equal_k) = static_name_t(".less_equal"); remove_const(greater_equal_k) = static_name_t(".greater_equal"); remove_const(not_equal_k) = static_name_t(".not_equal"); remove_const(equal_k) = static_name_t(".equal"); remove_const(empty_k) = static_name_t("empty"); remove_const(true_k) = static_name_t("true"); remove_const(false_k) = static_name_t("false"); remove_const(function_k) = static_name_t(".function"); remove_const(variable_k) = static_name_t(".variable"); remove_const(index_k) = static_name_t(".index"); remove_const(array_k) = static_name_t(".array"); remove_const(dictionary_k) = static_name_t(".dictionary"); remove_const(eof_k) = static_name_t("eof"); } /*************************************************************************************************/ } // namespace /*************************************************************************************************/ ADOBE_ONCE_DEFINITION(adobe_token, init_once) /*************************************************************************************************/ --- NEW FILE: adam.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/adam.hpp> #include <deque> #include <boost/bind.hpp> #include <boost/function.hpp> #include <adobe/array.hpp> #include <adobe/dictionary.hpp> #include <adobe/name.hpp> #include <adobe/value.hpp> [...1344 lines suppressed...] cell_t& cell(*cell_ptr); if (cell.specifier_m == access_output) get_stack_m.push_back(variable_name); // REVISIT (sparent) : paired call should be ctor/dtor try { cell.calculate(); } catch (...) { if (cell.specifier_m == access_output) get_stack_m.pop_back(); throw; } if (cell.specifier_m == access_output) get_stack_m.pop_back(); return cell.state_m; } /*************************************************************************************************/ --- NEW FILE: string_pool.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <cstddef> #include <list> /*************************************************************************************************/ namespace adobe { /**************************************************************************************************/ class string_pool { public: explicit string_pool(std::size_t pool_size = 1024 * 4) : fPoolSize(pool_size), fNext(NULL), fEnd(NULL) { } ~string_pool(); const char* add(const char* ident); // Precondition: ident || !length const char* add(const char* ident, std::size_t length); private: string_pool (const string_pool&); string_pool& operator = (const string_pool&); std::size_t fPoolSize; std::list<char*> fPool; char* fNext; char* fEnd; }; /**************************************************************************************************/ } // namespace adobe /**************************************************************************************************/ --- NEW FILE: rectangle.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include <adobe/rectangle.hpp> #include <adobe/algorithm.hpp> #if defined(ADOBE_SERIALIZATION) #include <adobe/future/iomanip.hpp> #include <adobe/name.hpp> #include <iostream> #endif /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ bool operator == (const adobe::rectangle_t& x, const adobe::rectangle_t& y) { return x.slice_m[adobe::rectangle_slices_t::vertical] == y.slice_m[adobe::rectangle_slices_t::vertical] && x.slice_m[adobe::rectangle_slices_t::horizontal] == y.slice_m[adobe::rectangle_slices_t::horizontal]; } /****************************************************************************************************/ #if defined(ADOBE_SERIALIZATION) std::ostream& operator << (std::ostream& s, const adobe::rectangle_t& x) { static adobe::value_t key_vertical (adobe::static_name_t("vertical")); static adobe::value_t key_horizontal (adobe::static_name_t("horizontal")); s << adobe::begin_bag("[0]"); s << adobe::begin_sequence; s << adobe::format(key_vertical); s << adobe::format(x.slice_m[adobe::rectangle_slices_t::vertical]); s << adobe::end_sequence; s << adobe::begin_sequence; s << adobe::format(key_horizontal); s << adobe::format(x.slice_m[adobe::rectangle_slices_t::horizontal]); s << adobe::end_sequence; s << adobe::end_bag; return s; } #endif /****************************************************************************************************/ bool operator == (const adobe::rectangle_t::slice_t& x, const adobe::rectangle_t::slice_t& y) { return x.length_m == y.length_m && x.outset_m == y.outset_m && x.frame_m == y.frame_m && x.inset_m == y.inset_m && x.poi_m.size() == y.poi_m.size() && adobe::equal(x.poi_m, y.poi_m.begin()); } /****************************************************************************************************/ #if defined(ADOBE_SERIALIZATION) std::ostream& operator << (std::ostream& s, const adobe::rectangle_t::slice_t& x) { static adobe::value_t key_length (adobe::static_name_t("length")); static adobe::value_t key_outset (adobe::static_name_t("outset")); static adobe::value_t key_frame (adobe::static_name_t("frame")); static adobe::value_t key_inset (adobe::static_name_t("inset")); static adobe::value_t key_poi_set (adobe::static_name_t("poi_set")); adobe::points_of_interest_t::const_iterator first(x.poi_m.begin()); adobe::points_of_interest_t::const_iterator last(x.poi_m.end()); adobe::points_of_interest_t::const_iterator back(last - 1); s << adobe::begin_bag("[0]") << adobe::begin_sequence << adobe::format(key_length) << adobe::format(x.length_m) << adobe::end_sequence << adobe::begin_sequence << adobe::format(key_outset) << adobe::begin_sequence << adobe::format(x.outset_m.first) << adobe::format(x.outset_m.second) << adobe::end_sequence << adobe::end_sequence << adobe::begin_sequence << adobe::format(key_frame) << adobe::begin_sequence << adobe::format(x.frame_m.first) << adobe::format(x.frame_m.second) << adobe::end_sequence << adobe::end_sequence << adobe::begin_sequence << adobe::format(key_inset) << adobe::begin_sequence << adobe::format(x.inset_m.first) << adobe::format(x.inset_m.second) << adobe::end_sequence << adobe::end_sequence << adobe::begin_sequence << adobe::format(key_poi_set) << adobe::begin_sequence; for (; first != last; ++first) s << adobe::format(*first); s << adobe::end_sequence << adobe::end_sequence << adobe::end_bag; return s; } #endif /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ --- NEW FILE: expression_parser.hpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #pragma once #include <adobe/istream.hpp> #include <adobe/dictionary_fwd.hpp> #include <adobe/source/lex_stream_fwd.hpp> #include <boost/noncopyable.hpp> /*************************************************************************************************/ namespace adobe { /*************************************************************************************************/ /*! \page expression_language Expression Language Underlying the language for Adam and Eve is a common, simple, expression language. The language supports \code expression = or_expression ["?" expression ":" expression]. or_expression = and_expression { "||" and_expression }. and_expression = equality_expression { "&&" equality_expression }. equality_expression = relational_expression { ("==" | "!=") relational_expression }. relational_expression = additive_expression { ("<" | ">" | "<=" | ">=") additive_expression }. additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }. multiplicative_expression = unary_expression { ("*" | "/" | "%") unary_expression }. unary_expression = postfix_expression | (unary_operator unary_expression). unary_operator = "+" | "-" | "!". postfix_expression = primary_expression { ("[" expression "]") | ("." identifier) }. primary_expression = name | number | boolean | string | "empty" | array | dictionary | variable_or_fuction | ( "(" expression ")" ). variable_or_function = identifier ["(" [argument_expression_list] ")"]. array = "[" [argument_list] "]". dictionary = "{" named_argument_list "}". argument_expression_list = named_argument_list | argument_list. argument_list = expression { "," expression }. named_argument_list = named_argument { "," named_argument }. named_argument = identifier ":" expression. name = "@" identifier. boolean = "true" | "false". \endcode */ /*************************************************************************************************/ class expression_parser : public boost::noncopyable { public: expression_parser(std::istream& in, const line_position_t& position); ~expression_parser(); const line_position_t& next_position(); void set_keyword_extension_lookup(const keyword_extension_lookup_proc_t& proc); // expression = or_expression ["?" expression ":" expression]. bool is_expression(array_t&); void require_expression(array_t&); // or_expression = and_expression { "||" and_expression }. bool is_or_expression(array_t&); // and_expression = equality_expression { "&&" equality_expression }. bool is_and_expression(array_t&); // equality_expression = relational_expression { ("==" | "!=") relational_expression }. bool is_equality_expression(array_t&); // relational_expression = additive_expression { relational_operator additive_expression }. bool is_relational_expression(array_t&); // additive_expression = multiplicative_expression { ("+" | "-") multiplicative_expression }. bool is_additive_expression(array_t&); bool is_additive_operator(name_t&); // multiplicative_expression = unary_expression { ("*" | "/" | "%" | "div") unary_expression }. bool is_multiplicative_expression(array_t&); bool is_multiplicative_operator(name_t&); // unary_expression = postfix_expression | (unary_operator unary_expression). bool is_unary_expression(array_t&); // unary_operator = "+" | "-" | "!". bool is_unary_operator(name_t&); // postfix_expression = primary_expression { ("[" expression "]") | ("." identifier) }. bool is_postfix_expression(array_t&); // primary_expression = name | number | boolean | string | "empty" | array | dictionary // | variable_or_fuction | ( "(" expression ")" ). bool is_primary_expression(array_t&); // variable_or_fuctiontion = identifier ["(" [argument_expression_list] ")"]. bool is_variable_or_function(array_t&); // argument_expression_list = named_argument_list | argument_list. bool is_argument_expression_list(array_t&); // array = "[" [argument_list] "]". bool is_array(array_t&); // dictionary = "{" named_argument_list "}". bool is_dictionary(array_t&); // argument_list = expression { "," expression }. bool is_argument_list(array_t&); // named_argument_list = named_argument { "," named_argument }. bool is_named_argument_list(array_t&); // named_argument = ident ":" expression. bool is_named_argument(array_t&); // name = "@" identifier. bool is_name(value_t&); // boolean = "true" | "false". bool is_boolean(value_t&); // relational_operator = "<" | ">" | "<=" | ">=". bool is_relational_operator(name_t&); // lexical tokens: bool is_identifier(name_t&); bool is_lead_comment(std::string&); bool is_trail_comment(std::string&); /* REVISIT (sparent) : We should provide a protected call to get the token stream and allow subclasses to access it directly - but for now we'll stick with the law of Demiter. */ protected: const token_value_t& get_token(); void putback(); bool is_token (name_t tokenName, value_t& tokenValue); bool is_token (name_t tokenName); void require_token (name_t tokenName, value_t& tokenValue); void require_token (name_t tokenName); void throw_exception (const char* errorString); void throw_exception (const name_t& found, const name_t& expected); private: class implementation; implementation* object; }; } // namespace adobe /*************************************************************************************************/ --- NEW FILE: eve.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef NDEBUG #include <iostream> #ifdef ADOBE_SERIALIZATION #include <adobe/future/iomanip_pdf.hpp> #endif #endif // NDEBUG #include <iterator> #include <boost/iterator/indirect_iterator.hpp> [...1583 lines suppre... [truncated message content] |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:57
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/documentation/sources/doxygen_support_files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/documentation/sources/doxygen_support_files Added Files: footer.dox header.dox permissions.dox stlab.css Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: footer.dox --- <!-- Begin Footer --> </td> <td width="10"> </td></tr> </table> <div id="footerrow"><!--give footer 25px of white above--></div><div id="footer" title="footer: links to copyright and other legal information"><p><a href="licenses.html">Copyright © 2005 Adobe Systems Incorporated</a></p><ul id="list1"><!-- due to a rendering error in IE, these links should all be on one line without returns --><li id="terms"><a title="Terms of Use" href="http://www.adobe.com/misc/copyright.html">Terms of Use</a></li><li><a title="Privacy Policy" href="http://www.adobe.com/misc/privacy.html">Privacy Policy</a></li><li><a href="http://access.adobe.com">Accessibility</a></li><li><a title="Avoid software piracy" href="http://www.adobe.com/aboutadobe/antipiracy/main.html">Avoid software piracy</a></li></ul><!--two lists because of quirks mode--><ul id="list2"><li id="tms"><a title="Permissions and trademarks" href="http://www.adobe.com/misc/agreement.html">Permissions and trademarks</a></li><li><a title="Product License Agreements" href="http://www.adobe.com/products/eulas/main.html">Product License Agreements</a></li></ul><a title="Reviewed by TRUSTe: site privacy statement" href="http://www.adobe.com/misc/privacy.html"><img id="privacyicon" src="http://www.adobe.com/images/finalmark.gif" alt="Reviewed by TRUSTe: site privacy statement" height="31" width="116" border="0"></a></div> </body> </html> --- NEW FILE: permissions.dox --- /*! \page licenses License Information \section license_aos MIT License The <a href="http://www.opensource.org/licenses/mit-license.php" target="_new">MIT License</a> specifies the terms and conditions of use for those Adobe Open Source libraries that it covers: \verbatim Copyright (c) 2005 Adobe Systems Incorporated Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \endverbatim \section license_faq Frequently Asked Questions \par Why use the MIT License? The MIT License is an existing Open Source Initiative (OSI) approved license, and it covers the needs of the Adobe Source Libraries. We feel OSI approval is important and that there was not a need to introduce yet another license; the MIT License is sufficient. \par Does this license cover all Adobe Open Source efforts? No. This license only applies to the Adobe Open Source Libraries. Other Open Source efforts (such as XMP) are covered by their own licenses (such as the <a href="http://partners.adobe.com/public/developer/en/xmp/sdk/license.txt" target="_new">Adobe Open Source License</a>). \par What are the requirements for the reproduction of the copyrights and license? Adobe requires reproduction of the license in machine-executable object code generated by a source language processor. Examples of this are object libraries, shared libraries, and final program executables. The license can be provided in any readible form within the object code or accompanying documentation. \par Adobe requires reproduction of the license in cases where the code is reproduced in its source language. Examples of this are distribution of self-extracting archives of source code or precompiled header files. \section license_other Other Licenses Some of the pages in the documentation of the Adobe Open Source Libraries are derived from the <a href="http://www.sgi.com/tech/stl/" target="_new">SGI STL documentation</a>. Those pages are held under the following copyrights as well as copyrights held by Adobe Systems Incorporated: \verbatim Copyright (c) 1996-1999 Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Copyright (c) 1994 Hewlett-Packard Company Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. \endverbatim */ --- NEW FILE: header.dox --- <html> <!-- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ Some files are held under additional license. Please see "licenses.html" for more information. --> <head> <TITLE>Adobe Software Technology Lab</TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"> <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/basic.css"> <STYLE TYPE="text/css" MEDIA="all"><!-- @import url("http://www.adobe.com/ssi/css/modern.css"); --></STYLE> <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/print.css" MEDIA="print"> <LINK TYPE="text/css" REL="stylesheet" HREF="http://www.adobe.com/ssi/css/mainnav.css"> <LINK TYPE="text/css" REL="stylesheet" HREF="stlab.css"> </HEAD> <body bgcolor="white"> <div id="mainnav" width="100%"> <table width="100%" border="0"><tr><td width="50%"> <a title="Adobe Systems home page" href="http://www.adobe.com/" tabindex="2"><img src="http://www.adobe.com/images/logo.gif" alt="Adobe Systems, Inc." height="80" width="150"></a> </td><td align="right" valign="top"> <font size="+2">Adobe Open Source</font><br> <font size="-2">opensource.adobe.com</font> </td></tr></table> </div> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td width="10"> </td> <td> <!-- This page generated $datetime --> <!-- End Header --> --- NEW FILE: stlab.css --- html, body, table, td, th, h1, h2, h3, h4, h5, h6, p, a, span, div, em, b, i { font-family: Verdana, Arial, Helvetica, Geneva, sans-serif } html, body, table, td, th, p, pre, span, div, dl, dt, dd, code, em, b, i { font-size: small } .bgImg { background: #f1f1f1 url("/grad_grey.jpg") 0 0 no-repeat } img { border: 0 } .directory { font-size: x-small; font-weight: normal } .directory a { font-size: x-small } .directory h3 { margin: 0px; margin-top: 3px; font-size: x-small } .directory p { margin: 0px; white-space: nowrap; font-size: x-small; font-weight: normal } .directory div { display: none; margin: 0px; font-size: x-small } .directory img { vertical-align: middle; font-size: x-small } .fragment { font-family: Monaco, "Courier New", Courier, monospace } .large { font-size: large } .mdescLeft { font-size: smaller; background-color: #FAFAFA; padding-left: 8px; border-top: 1px none #E0E0E0; border-right: 1 px none #E0E0E0; border-bottom: 1 px none #E0E0E0; border-left: 1 px none #E0E0E0; margin: 0px } .mdescRight { font-size: smaller; font-style: italic; background-color: #FAFAFA; padding-left: 4px; border-top: 1px none #E0E0E0; border-right: 1 px none #E0E0E0; border-bottom: 1 px none #E0E0E0; border-left: 1 px none #E0E0E0; margin: 0px; padding-bottom: 0px; padding-right: 8px } .mdRow { padding: 8px 10px } .mdTable { border: 1px solid #868686; background-color: #F4F4FB } .medium { font-size: medium } .memItemLeft { font-family: Monaco, "Courier New", Courier, monospace; width: 50%; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #fafafa } .memItemRight { font-family: Monaco, "Courier New", Courier, monospace; width: 50%; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #fafafa } .memTemplItemLeft { font-family: Monaco, "Courier New", Courier, monospace; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA } .memTemplItemRight { font-family: Monaco, "Courier New", Courier, monospace; padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA } .memTemplParams { font-family: Monaco, "Courier New", Courier, monospace; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA } .memItemLeft a { font-family: Monaco, "Courier New", Courier, monospace } .memItemRight a { font-family: Monaco, "Courier New", Courier, monospace } .memTemplItemLeft a { font-family: Monaco, "Courier New", Courier, monospace } .memTemplItemRight a { font-family: Monaco, "Courier New", Courier, monospace } .memTemplParams a { font-family: Monaco, "Courier New", Courier, monospace } .mitemLeft { } .mitemRight { } .search { color: #003399; font-weight: bold } .small { font-size: small } .strikeout { text-decoration: line-through } .highlight { background-color: yellow } .teeny { font-size: x-small } A, A:link, A:visited { background-color: transparent; color: red } A:link:hover, A:hover, A:visited:hover { text-decoration: underline; background-color: transparent; color: maroon } A.anchor { text-decoration: none; color: black } A.code, A.code:link, A.code:visited { font-family: Monaco, "Courier New", Courier, monospace; text-decoration: underline; font-weight: normal; color: #1A419D } A.codeRef, A.codeRef:link, A.codeRef:visited { font-family: Monaco, "Courier New", Courier, monospace; font-weight: normal; color: #1A419D } A.el, A.el:visited { text-decoration: none; font-weight: normal; color: red } A.el:hover, A.el:visited:hover { text-decoration: underline; color: maroon } A.elRef { font-weight: normal } A.qindex, A.qindex:visited { text-decoration: none; font-weight: normal; color: red; padding: 2px } A.qindex:hover, A.qindex:visited:hover { text-decoration: underline; background-color: transparent; padding: 2px; color: maroon } A.qindexHL, A.qindexHL:visited { text-decoration: none; font-weight: normal; background-color: transparent; color: black; padding: 2 6px } A.qindexHL:hover, A.qindexHL:visited:hover { text-decoration: underline; background-color: transparent; color: black; padding: 2px 6px } A.red, A.red:visited { text-decoration: underline; background-color: transparent; color: red } A.red:hover, A.red:visited:hover { text-decoration: underline; background-color: transparent; color: maroon } A.white, A.white:visited { text-decoration: underline; background-color: transparent; color: white } A.white:hover, A.white:visited:hover { text-decoration: underline; background-color: transparent; color: red } BODY { background: white; color: black; margin: 0; padding: 0 } CAPTION { font-weight: normal } CODE { font-family: Monaco, "Courier New", Courier, monospace; font-size: small } CODE A { font-family: Monaco, "Courier New", Courier, monospace } DD CODE { font-family: Monaco, "Courier New", Courier, monospace } DT B EM { margin-left: 5px } DIV.ah { background-color: #000000; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } DIV.fragment { font-family: Monaco, "Courier New", Courier, monospace } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } DIV.groupText { margin-left: 16px; font-style: italic } DIV.nav { width: 100%; background-color: transparent; text-align: center; margin: 2px; padding: 2px; line-height: 140% } DIV.qindex { width: 100%; background-color: transparent; text-align: center; margin-bottom: 2px; padding: 2px } DL.el { margin-left: -1cm } FORM.search { margin-bottom: 0px; margin-top: 0px } H1 { color: black; font-size: x-large; text-align: center } H2 A.anchor { color: black; font-size: large; padding-left: 4px; border-top: 1px dashed grey; border-left: 1px dashed grey } H3 A.anchor { color: black; font-size: medium; font-variant: small-caps } H4 { color: black; font-style: oblique } HR { border: 0; color: red; background-color: red; height: 2px; margin-right: 0px; margin-left: 0px; margin-top: 10px; margin-bottom: 10px } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle } INPUT.search { font-size: medium; color: #000080; font-weight: normal; background-color: #eeeeff } ol, ul, li, p ol, p ul, p li { margin: 5px 0 0 10px } P.formulaDsp { text-align: center } PRE.fragment { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } SPAN.charliteral { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #222222 } SPAN.comment { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #dd0000 } SPAN.keyword { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #0000dd } SPAN.keywordflow { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #0000dd } SPAN.keywordtype { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #0000dd } SPAN.preprocessor { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #0000dd } SPAN.stringliteral { font-family: Monaco, "Courier New", Courier, monospace; font-size: 100%; color: #222222 } TD.col_label { background-color: white; font-weight: bold; text-align: center; padding-bottom: 2px; border-style: solid; border-bottom-width: 1px; border-bottom-color: red } TD.indexkey { background-color: #eeeeff; font-weight: bold; padding-right: 10px; padding-top: 2px; padding-left: 10px; padding-bottom: 2px; margin-left: 0px; margin-right: 0px; margin-top: 2px; margin-bottom: 2px; border: 1px solid #CCCCCC } TD.indexvalue { background-color: #eeeeff; font-style: italic; padding-right: 10px; padding-top: 2px; padding-left: 10px; padding-bottom: 2px; margin-left: 0px; margin-right: 0px; margin-top: 2px; margin-bottom: 2px; border: 1px solid #CCCCCC } TD.md { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; white-space: normal } TD.mdname { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; color: maroon; white-space: normal } TD.mdname1 { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; color: maroon; white-space: normal } TD.md a { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; white-space: normal } TD.mdname a { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; white-space: normal } TD.mdname1 a { font-family: Monaco, "Courier New", Courier, monospace; background-color: transparent; white-space: normal } TD.row_item { background-color: white; font-weight: normal; text-align: left; vertical-align: top; font-size: medium; padding-right: 10px; padding-top: 2px; padding-left: 10px; padding-bottom: 2px; } TD.tiny { font-size: small } TR.memlist { background-color: #f0f0f0 } |
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/documentation/sources/tutorials/images/originals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/documentation/sources/tutorials/images/originals Added Files: forest_deletion.graffle forest_empty.graffle forest_insertion.graffle forest_simple.graffle Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: forest_deletion.graffle --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CanvasColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>1</string> </dict> <key>ColumnAlign</key> <integer>0</integer> <key>ColumnSpacing</key> <real>36</real> <key>GraphDocumentVersion</key> <integer>2</integer> <key>GraphicsList</key> <array> [...2184 lines suppressed...] koShm6KXgn////+GkoSZmQtOU0ZpcnN0UGFnZYaShKGbopcBhpKEmZkNTlNPcmllbnRh dGlvboaShKGbopcAhoaG </data> <key>RowAlign</key> <integer>0</integer> <key>RowSpacing</key> <real>36</real> <key>VPages</key> <integer>1</integer> <key>WindowInfo</key> <dict> <key>Frame</key> <string>{{52, 196}, {911, 602}}</string> <key>VisibleRegion</key> <string>{{-178, 0}, {896, 509}}</string> <key>Zoom</key> <string>1</string> </dict> </dict> </plist> --- NEW FILE: forest_insertion.graffle --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CanvasColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>1</string> </dict> <key>ColumnAlign</key> <integer>0</integer> <key>ColumnSpacing</key> <real>36</real> <key>GraphDocumentVersion</key> <integer>2</integer> <key>GraphicsList</key> <array> [...1939 lines suppressed...] koShm6KXgn////+GkoSZmQtOU0ZpcnN0UGFnZYaShKGbopcBhpKEmZkNTlNPcmllbnRh dGlvboaShKGbopcAhoaG </data> <key>RowAlign</key> <integer>0</integer> <key>RowSpacing</key> <real>36</real> <key>VPages</key> <integer>1</integer> <key>WindowInfo</key> <dict> <key>Frame</key> <string>{{31, 71}, {716, 750}}</string> <key>VisibleRegion</key> <string>{{-80, 0}, {701, 657}}</string> <key>Zoom</key> <string>1</string> </dict> </dict> </plist> --- NEW FILE: forest_empty.graffle --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CanvasColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>1</string> </dict> <key>ColumnAlign</key> <integer>0</integer> <key>ColumnSpacing</key> <real>3.600000e+01</real> <key>GraphDocumentVersion</key> <integer>2</integer> <key>GraphicsList</key> <array> <dict> <key>Bounds</key> <string>{{225, 45}, {54, 27}}</string> <key>Class</key> <string>ShapedGraphic</string> <key>ID</key> <integer>1</integer> <key>Shape</key> <string>Rectangle</string> <key>Text</key> <dict> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 "forest"}</string> </dict> </dict> </array> <key>GridInfo</key> <dict/> <key>HPages</key> <integer>1</integer> <key>ImageCounter</key> <integer>1</integer> <key>IsPalette</key> <string>NO</string> <key>Layers</key> <array> <dict> <key>Lock</key> <string>NO</string> <key>Name</key> <string>Layer 1</string> <key>Print</key> <string>YES</string> <key>View</key> <string>YES</string> </dict> </array> <key>LayoutInfo</key> <dict> <key>AutoAdjust</key> <string>YES</string> <key>ChildOrdering</key> <integer>1</integer> <key>MagneticFieldCenter</key> <string>{0, 0}</string> </dict> <key>MagnetsEnabled</key> <string>YES</string> <key>PageBreakColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>0.666667</string> </dict> <key>PageBreaks</key> <string>YES</string> <key>PageSetup</key> <data> BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpFJKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkLTlNQYXBlclNpemWGkoSEhAdOU1ZhbHVlAJSEASqEhAx7X05TU2l6ZT1mZn2cgQJk gQMYhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRhdGlvboaShISECE5TTnVtYmVyAJ2b hIQBc54AhpKEmZkUTlNWZXJ0aWNhbFBhZ2luYXRpb26GkoShm6KeAIaShJmZFE5TVmVy dGljYWxseUNlbnRlcmVkhpKEoZuingGGkoSZmQ5OU1BNUGFnZUZvcm1hdIaShISEBk5T RGF0YQCUl4EjGoQHWzg5ODZjXTw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVU Ri04Ij8+CjwhRE9DVFlQRSBwbGlzdCBQVUJMSUMgIi0vL0FwcGxlIENvbXB1dGVyLy9E VEQgUExJU1QgMS4wLy9FTiIgImh0dHA6Ly93d3cuYXBwbGUuY29tL0RURHMvUHJvcGVy dHlMaXN0LTEuMC5kdGQiPgo8cGxpc3QgdmVyc2lvbj0iMS4wIj4KPGRpY3Q+Cgk8a2V5 PmNvbS5hcHBsZS5wcmludC5QYWdlRm9ybWF0LkZvcm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8L3N0cmluZz4KPC9kaWN0Pgo8L3BsaXN0PgqGkoSZmQ9OU1ByaW50QWxsUGFnZXOG kqCShJmZC05TUGFwZXJOYW1lhpKEmZkGTGV0dGVyhpKEmZkVTlNIb3Jpem9uYWxQYWdp bmF0aW9uhpKEoZuingCGkoSZmRZOU0hvcml6b250YWxseUNlbnRlcmVkhpKmkoSZmQlO U1ByaW50ZXKGkoSEhAlOU1ByaW50ZXIAlJKEmZkJQWRvYmUgUERGhoaShJmZCE5TQ29w aWVzhpKEoZuEhAFTogGGkoSZmQ9OU1NjYWxpbmdGYWN0b3KGkoShm4SEAWajAYaShJmZ DU5TUmlnaHRNYXJnaW6GkoShm7mjJIaShJmZDk5TQm90dG9tTWFyZ2luhpKEoZu5oySG koSZmQxOU0xlZnRNYXJnaW6GkoShm7mjJIaShJmZC05TVG9wTWFyZ2luhpKEoZu5oySG koSZmQpOU0xhc3RQYWdlhpKEoZuEl5eCf////4aShJmZC05TRmlyc3RQYWdlhpKEoZu2 ogGGkoSZmQ1OU09yaWVudGF0aW9uhpKEoZuingCGhoY= </data> <key>RowAlign</key> <integer>0</integer> <key>RowSpacing</key> <real>3.600000e+01</real> <key>VPages</key> <integer>1</integer> <key>WindowInfo</key> <dict> <key>Frame</key> <string>{{122, -11}, {555, 770}}</string> <key>VisibleRegion</key> <string>{{0, 0}, {540, 677}}</string> <key>Zoom</key> <string>1</string> </dict> </dict> </plist> --- NEW FILE: forest_simple.graffle --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CanvasColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>1</string> </dict> <key>ColumnAlign</key> <integer>0</integer> <key>ColumnSpacing</key> <real>36</real> <key>GraphDocumentVersion</key> <integer>2</integer> <key>GraphicsList</key> <array> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>40</integer> <key>Info</key> <integer>3</integer> </dict> <key>ID</key> <integer>43</integer> <key>Points</key> <array> <string>{225, 153}</string> <string>{189, 180}</string> <string>{169.908, 223.908}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>8</integer> </dict> </dict> <dict> <key>Bounds</key> <string>{{225, 45}, {54, 27}}</string> <key>Class</key> <string>ShapedGraphic</string> <key>ID</key> <integer>42</integer> <key>Magnets</key> <array> <string>{1, 0.5}</string> <string>{1, -0.5}</string> <string>{-1, 0.5}</string> <string>{-1, -0.5}</string> <string>{0.5, 1}</string> <string>{-0.5, 1}</string> <string>{0.5, -1}</string> <string>{-0.5, -1}</string> <string>{0.0116687, 0.571868}</string> </array> <key>Shape</key> <string>Rectangle</string> <key>Text</key> <dict> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 "forest"}</string> </dict> </dict> <dict> <key>Bounds</key> <string>{{288, 216}, {54, 54}}</string> <key>Class</key> <string>ShapedGraphic</string> <key>ID</key> <integer>41</integer> <key>Magnets</key> <array> <string>{1, 1}</string> <string>{1, -1}</string> <string>{-1, -1}</string> <string>{-1, 1}</string> <string>{0, 1}</string> <string>{0, -1}</string> <string>{1, 0}</string> <string>{-1, 0}</string> </array> <key>Shape</key> <string>Circle</string> <key>Text</key> <dict> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 Node\ C}</string> </dict> </dict> <dict> <key>Bounds</key> <string>{{162, 216}, {54, 54}}</string> <key>Class</key> <string>ShapedGraphic</string> <key>ID</key> <integer>40</integer> <key>Magnets</key> <array> <string>{1, 1}</string> <string>{1, -1}</string> <string>{-1, -1}</string> <string>{-1, 1}</string> <string>{0, 1}</string> <string>{0, -1}</string> <string>{1, 0}</string> <string>{-1, 0}</string> </array> <key>Shape</key> <string>Circle</string> <key>Text</key> <dict> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 Node\ B}</string> </dict> </dict> <dict> <key>Bounds</key> <string>{{225, 126}, {54, 54}}</string> <key>Class</key> <string>ShapedGraphic</string> <key>ID</key> <integer>39</integer> <key>Magnets</key> <array> <string>{1, 1}</string> <string>{1, -1}</string> <string>{-1, -1}</string> <string>{-1, 1}</string> <string>{0, 1}</string> <string>{0, -1}</string> <string>{1, 0}</string> <string>{-1, 0}</string> </array> <key>Shape</key> <string>Circle</string> <key>Text</key> <dict> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc \f0\fs24 \cf0 Node\ A}</string> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>6</integer> </dict> <key>ID</key> <integer>38</integer> <key>Points</key> <array> <string>{252, 72}</string> <string>{252, 126}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0</string> <key>g</key> <string>0</string> <key>r</key> <string>1</string> </dict> <key>HeadArrow</key> <string>0</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> <key>Width</key> <real>2</real> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>42</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>42</integer> <key>Info</key> <integer>5</integer> </dict> <key>ID</key> <integer>37</integer> <key>Labels</key> <array> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fmodern\fcharset77 Courier;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\fs22 \cf0 end}</string> </dict> <key>LabelVisible</key> <string>YES</string> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.5373615026473999</real> </dict> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> </dict> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.10000000149011612</real> </dict> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> </dict> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.89999997615814209</real> </dict> </array> <key>Points</key> <array> <string>{271.092, 133.908}</string> <string>{288, 117}</string> <string>{288, 90}</string> <string>{265.755, 72}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>2</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>41</integer> </dict> <key>ID</key> <integer>36</integer> <key>Points</key> <array> <string>{271.092, 172.092}</string> <string>{295.908, 223.908}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0</string> <key>g</key> <string>0</string> <key>r</key> <string>1</string> </dict> <key>HeadArrow</key> <string>0</string> <key>LineType</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> <key>TailScale</key> <real>0.88194441795349121</real> <key>Width</key> <real>2</real> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>1</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>40</integer> </dict> <key>ID</key> <integer>35</integer> <key>Points</key> <array> <string>{232.908, 172.092}</string> <string>{208.092, 223.908}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0</string> <key>g</key> <string>0</string> <key>r</key> <string>1</string> </dict> <key>HeadArrow</key> <string>0</string> <key>LineType</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> <key>TailScale</key> <real>0.88194441795349121</real> <key>Width</key> <real>2</real> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>4</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>41</integer> <key>Info</key> <integer>8</integer> </dict> <key>ID</key> <integer>34</integer> <key>Points</key> <array> <string>{216, 243}</string> <string>{234, 216}</string> <string>{270, 216}</string> <string>{288, 243}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>40</integer> <key>Info</key> <integer>7</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>7</integer> </dict> <key>ID</key> <integer>33</integer> <key>Points</key> <array> <string>{334.092, 223.908}</string> <string>{315, 180}</string> <string>{279, 153}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>41</integer> <key>Info</key> <integer>2</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>40</integer> <key>Info</key> <integer>1</integer> </dict> <key>ID</key> <integer>32</integer> <key>Points</key> <array> <string>{169.908, 262.092}</string> <string>{180, 288}</string> <string>{198, 288}</string> <string>{208.092, 262.092}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>40</integer> <key>Info</key> <integer>4</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>41</integer> <key>Info</key> <integer>1</integer> </dict> <key>ID</key> <integer>31</integer> <key>Points</key> <array> <string>{295.908, 262.092}</string> <string>{306, 288}</string> <string>{324, 288}</string> <string>{334.092, 262.092}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>41</integer> <key>Info</key> <integer>4</integer> </dict> </dict> <dict> <key>Class</key> <string>LineGraphic</string> <key>Head</key> <dict> <key>ID</key> <integer>39</integer> <key>Info</key> <integer>3</integer> </dict> <key>ID</key> <integer>30</integer> <key>Labels</key> <array> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> <key>Text</key> <string>{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fmodern\fcharset77 Courier;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\fs20 \cf0 begin}</string> </dict> <key>LabelVisible</key> <string>YES</string> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.42045021057128906</real> </dict> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> </dict> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.10000000149011612</real> </dict> <dict> <key>Label</key> <dict> <key>Align</key> <integer>0</integer> </dict> <key>Offset</key> <real>0.0</real> <key>Position</key> <real>0.89999997615814209</real> </dict> </array> <key>Points</key> <array> <string>{238.245, 72}</string> <string>{216, 90}</string> <string>{216, 117}</string> <string>{232.908, 133.908}</string> </array> <key>Style</key> <dict> <key>stroke</key> <dict> <key>Color</key> <dict> <key>a</key> <string>1</string> <key>b</key> <string>0.501961</string> <key>g</key> <string>0</string> <key>r</key> <string>0</string> </dict> <key>HeadArrow</key> <string>FilledArrow</string> <key>LineType</key> <integer>1</integer> <key>Pattern</key> <integer>1</integer> <key>TailArrow</key> <string>0</string> </dict> </dict> <key>Tail</key> <dict> <key>ID</key> <integer>42</integer> </dict> </dict> </array> <key>GridInfo</key> <dict/> <key>HPages</key> <integer>1</integer> <key>ImageCounter</key> <integer>1</integer> <key>IsPalette</key> <string>NO</string> <key>Layers</key> <array> <dict> <key>Lock</key> <string>NO</string> <key>Name</key> <string>Layer 1</string> <key>Print</key> <string>YES</string> <key>View</key> <string>YES</string> </dict> </array> <key>LayoutInfo</key> <dict> <key>AutoAdjust</key> <string>YES</string> <key>ChildOrdering</key> <integer>1</integer> <key>MagneticFieldCenter</key> <string>{0, 0}</string> </dict> <key>MagnetsEnabled</key> <string>YES</string> <key>PageBreakColor</key> <dict> <key>a</key> <string>1</string> <key>w</key> <string>0.666667</string> </dict> <key>PageBreaks</key> <string>YES</string> <key>PageSetup</key> <data> BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpFJKEhIQITlNT dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE mZkLTlNQYXBlclNpemWGkoSEhAdOU1ZhbHVlAJSEASqEhAx7X05TU2l6ZT1mZn2cgQJk gQMYhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRhdGlvboaShISECE5TTnVtYmVyAJ2b hJeXAIaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEoZuilwCGkoSZmRROU1ZlcnRp Y2FsbHlDZW50ZXJlZIaShKGbopcBhpKEmZkOTlNQTVBhZ2VGb3JtYXSG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oaShISE CU5TUHJpbnRlcgCUkoSZmQlBZG9iZSBQREaGhpKEmZkITlNDb3BpZXOGkoShm6KXAYaS hJmZD05TU2NhbGluZ0ZhY3RvcoaShKGbhIQBZqEBhpKEmZkNTlNSaWdodE1hcmdpboaS hKGbuKEkhpKEmZkOTlNCb3R0b21NYXJnaW6GkoShm7ihJIaShJmZDE5TTGVmdE1hcmdp boaShKGbuKEkhpKEmZkLTlNUb3BNYXJnaW6GkoShm7ihJIaShJmZCk5TTGFzdFBhZ2WG koShm6KXgn////+GkoSZmQtOU0ZpcnN0UGFnZYaShKGbopcBhpKEmZkNTlNPcmllbnRh dGlvboaShKGbopcAhoaG </data> <key>RowAlign</key> <integer>0</integer> <key>RowSpacing</key> <real>36</real> <key>VPages</key> <integer>1</integer> <key>WindowInfo</key> <dict> <key>Frame</key> <string>{{21, 62}, {555, 770}}</string> <key>VisibleRegion</key> <string>{{0, 0}, {540, 677}}</string> <key>Zoom</key> <string>1</string> </dict> </dict> </plist> |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:57
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/documentation/sources/tutorials In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/documentation/sources/tutorials Added Files: array_tutorial.dox defgroup_tutorials.dox dictionary_tutorial.dox eve_tutorial.dox forest_tutorial.dox value_tutorial.dox Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: value_tutorial.dox --- /*! \defgroup asl_tutorials_value_t value_t \ingroup asl_tutorials <i>Last updated January 21, 2005</i> \section value_t_background Background \subsection background_discriminated_types Discriminated Types and Unions \par adobe::value_t is a pseudo-discriminated union. Before we can go any further we must first understand what a discriminated type is. Kevin Henney best describes discriminated types in his documentation of <a href="http://www.boost.org/doc/html/any.html#id447427">boost::any</a>: - <i>Discriminated types ... contain values of different types but do not attempt conversion between them, i.e. <code>5</code> is held strictly as an <code>int</code> and is not implicitly convertible either to <code>"5"</code> or to <code>5.0</code>. Their indifference to interpretation but awareness of type effectively makes them safe, generic containers of single values, with no scope for surprises from ambiguous conversions.</i> \par A discriminated union, then, is a type that can retain any one of a collection of discriminated types, but then only one at a time. In the case of adobe::value_t its storable type range is limited to any type modeling the \ref background_data_type_requirements. \subsubsection discriminated_types_similarities Similarities \par adobe::value_t being a discriminated union means it is capable of holding any of: \par \code adobe::value_t my_int(5); adobe::value_t my_string(std::string("Hello, world!")); adobe::value_t my_whizzy_class(whizzy_class(/*...*/)); adobe::value_t my_some_other_regular_type(/*...*/); \endcode \par An adobe::value_t may also store a different type of data at different points in time: for example it can start out storing \ref adobe::empty_t "'nothing'": \par \code adobe::value_t my_value; // my_value now holds adobe::empty_t \endcode \par ... then store a std::string at a later time: \par \code my_value = std::string("Hello, world!"); // my_value now holds a std::string \endcode \par ... then store another arbitrary data type even later: \par \code my_value = my_whizzy_class; // adobe::value_t to adobe::value_t assignments are OK \endcode \par Note that in the last case the type stored within <code>my_value</code> is not adobe::value_t, but the type stored within the adobe::value_t from which it was set. In the case above, <code>my_value</code> now retains data of type <code>whizzy_class</code> because <code>my_whizzy_class</code> stored data of that type. \subsubsection discriminated_types_differences Differences \par Type Promotion Unless otherwise specified, adobe::value_t makes no attempt to store data in any other than its original type. (This follows the behavior of a discriminated union). However it is possible to specify an explicit coersion from one data type to another. In order to ensure preservation of data the coersion should always be from a type of smaller resolution to one of greater resolution. That is to say there should be no data loss during the type coersion. This restricted type conversion is thus called <i>type promotion</i>. \par adobe::value_t takes advantage of type promotion to allow for an explicit, well-defined means of converting values between different types. adobe::value_t uses adobe::promote to accomplish type promotion. For a data type passed, adobe::promote specifies its promoted data type. By default this is merely the original type itself (i.e., no coersion takes place): \par \code template <typename T> struct promote { typedef T type; // promote<T>::type is, by default, T }; \endcode \par It is possible to specialize adobe::promote for any type, specifying an alternate type for coersion: \par \code template <> struct promote<int> { typedef double type; // promote<int>::type is now a double }; \endcode \par Note the restriction specified above (that one should only coerce from a "smaller" to a "bigger" type) is not enforced at either compile time or runtime: \par \code template <> struct promote<double> { typedef int type; // Legal, but bad: possible data loss }; \endcode \par Therefore you should be very carfeul when specifying your own type promotions. In general it is not necessary to do so. By default there are several type promotions already defined: see the documentation for adobe::promote for more information. \par Whenever data is stored in a adobe::value_t, it is always type-promoted before storage. Similarly, when a data is retrieved from a adobe::value_t the data is "type-demoted" to the requested type at the time of the retrieval. If the requested type is not specified to be promoted to the stored type, an exception is thrown (more on this later.) \subsection background_data_type_requirements Data Type Concept Requirements \par In order for adobe::value_t to be set to a given type and value, the type must model the concept of a \ref concept_regular_type. All built-in data types model this concept, as do many of the classes found in both the STL and the ASL. adobe::value_t may store any user-defined data type as well, as long as that data type is a model of \ref concept_regular_type. \section value_t_usage Usage \subsection usage_initialization_and_storage Initialization and Storage \par As we have seen in some of the previous examples, using adobe::value_t is pretty straightforward. adobe::value_t can be constructed with anything that is a \ref concept_regular_type, including default construction: \par \code adobe::value_t my_empty_value; adobe::value_t my_int_value(5); adobe::value_t my_other_int_value(my_int_value); \endcode \par As mentioned above, the last adobe::value_t in this code snippet inherits the data type from the adobe::value_t from which it was set; adobe::value_t's cannot be directly nested. They can, however, be indirectly nested: \par \code typedef std::vector<adobe::value_t> my_vector_value_type; my_vector_value_type my_vector_value; my_vector_value.push_back(adobe::value_t(5)); my_vector_value.push_back(adobe::value_t('A')); my_vector_value.push_back(adobe::value_t(std::string("hello, world!")); adobe::value_t my_vector_value_value(my_vector_value); \endcode \subsection usage_query Data Type Querying \par It is possible to check the type of data stored within an adobe::value_t with <code>type()</code>: \par \code adobe::value_t my_value(std::string("hello, world!")); // ... if (my_value.type() == typeid(std::string)) { // ... } else if (my_value.type() == typeid(double)) { // ... } \endcode \par Note that when checking for the type contained within the adobe::value_t, you want to check it against the promoted data type, not the data type from which the adobe::value_t was set: \par \code adobe::value_t my_int_value(5); if (my_int_value.type() == typeid(int)) { // not here! } else if (my_int_value.type() == typeid(double)) { // you'll end up in here } \endcode \subsection usage_retrieval Retrieval \par Data is extracted from the adobe::value_t by means of adobe::value_t::get<>: \par \code adobe::value_t my_value(5); // ... double my_double(my_value.get<double>()); // my_double now contains 5.0 \endcode \par Note in the above example the type conversion is legal because adobe::promote explicitly allows it. Value retrieval can be serialized in the case when one has indirectly nested adobe::value_t instances. Here is an example using <code>my_vector_value</code> from above: \par \code char my_char = my_vector_value_value.get<my_vector_value_type>()[1].template get<char>(); // my_char now contains 'A' \endcode \par If the requested data type does not match the stored data type, and if the stored data type is not the promoted type of the requested data type, adobe::value_t::get<> will throw an exception: \par \code adobe::value_t my_value(std::string("hello, world!")); try { int x = my_value.get<int>(); } catch(const std::exception& err) { std::cerr << err.what() << std::endl; } catch(...) { std::cerr << "don't know what happened!" << std::endl; } \endcode \section value_t_experimental_features Experimental Features \subsection experimental_features_serialization Serialization \par It is possible to extend adobe::value_t's functionality in such a way that the contained data can be serialized from within adobe::value_t. This is activated by defining a macro: \par \code #define ADOBE_SERIALIZATION \endcode When this code is enabled, the data type requirements of adobe::value_t are extended: now the elements must not only be a model of the \ref concept_regular_type concept, but they must also have <code>operator <<</code> defined for them to allow for the serialization of their value to a stream. Note this is true whether or not you ever serialize an adobe::value_t with a particular type. Note too that this is only for output streams, not input streams. With the macro defined one now has the ability to serialize adobe::value_t: \par \code #define ADOBE_SERIALIZATION // include adobe/value.hpp at some point int main(/*...*/) { adobe::value_t my_value(std::string("Hello, world!"); std::cout << my_value << std::endl; // Prints "Hello, world!" return 0; } \endcode */ --- NEW FILE: defgroup_tutorials.dox --- /*! \defgroup asl_tutorials Tutorials \ingroup asl_home */ --- NEW FILE: array_tutorial.dox --- /*! \defgroup asl_tutorials_array_t array_t \ingroup asl_tutorials <i>Last updated January 25, 2005</i> \section array_t_background Background \subsection background_regular_type Regular Type \par adobe::array_t is a model of the \ref concept_regular_type concept. Value semantics allow for it to be used like a built-in type: \par \code void foo(adobe::array_t param) // makes a copy of the array_t { std::cout << param[0].get<std::string>(); } int main(/*...*/) { adobe::array_t my_array; /* add elements of type adobe::value_t to my_array */ foo(my_array); return 0; } \endcode \subsection background_copy_on_write Copy On Write \par adobe::array_t is a copy-on-write container, which means that the container (and all its contents) are duplicated only when the array is modified. This makes for very fast copies of adobe::array_t, but can make writing to one a slow process. Therefore adobe::array_t is to be used when there is a lot of copying but little writing into the container. The copy-on-write semantics are governed by a reference counter, so if there is only one adobe::array_t referring to a given internal instance, then the copy is not made when the write is performed. Writing to these containers is very explicit; see the below section on \ref usage_storage for more information. \subsection background_random_access Random Access \par Every element in an adobe::array_t can be accessed in constant time. There are also const_iterator classes that allow for random-access iteration of the class. There is no iterator class that allows for writing, however, due to the nature of the copy-on-write semantics. Writing to an adobe::array_t is further explained in the \ref array_t_usage section. \subsection background_value_t_value_type adobe::value_t Elements \par adobe::array_t stores elements of type adobe::value_t. Because of the features of adobe::value_t, this means that an adobe::array_t can store any data type that models the \ref concept_regular_type concept. These types are allowed to differ between elements in the adobe::array_t. \section array_t_usage Usage \par A key point to remember is an adobe::array_t is essentially a specialized vector. Consequently just about anything you can do with a vector you can do with an adobe::array_t. The reasons you would want to use an adobe::array_t over a std::vector<adobe::value_t> is primarily because of the copy-on-write semantics, which allow for optimized copying and passing of adobe::array_t as a function parameter. \subsection usage_initialization Initialization \par One initializes an adobe::array_t in one of several ways: \par \code // Method 1: Default Construction adobe::array_t my_first_array; // Method 2: Copy Construction adobe::array_t my_second_array(my_first_array); // Method 3: Initialization with elements std::vector<int> vec; // ... fill in vec with elements adobe::array_t my_third_array(vec.begin(), vec.end()); // Method 4: Initialization with a default element my_regular_type my_regular_type_value(/*...*/); int number_of_elements(5); adobe::array_t my_third_array(number_of_elements, adobe::value_t(my_regular_type_value)); \endcode \subsection usage_storage Storage \par Setting a value in an array can only be done with an adobe::array_t::write_reference. The write_reference gives the adobe::array_t the ability to manage its copy on write semantics. There are a number of member functions inside adobe::array_t that manage the write_reference automatically for you. The only instance where you need to explicitly obtain a write_reference is when using <code>operator []</code>. Here are examples of setting values where the write_references is automatically handled for you: \par \code adobe::array_t my_array; my_array.push_back(adobe::value_t(5)); my_array.push_back(adobe::value_t("Hello, world!")); my_array.push_back(adobe::value_t(my_regular_type(/*...*/))); my_array.set(2, adobe::value_t(3.141526)); // sets my_array[2] \endcode \par Once an element exists in the array, it can be directly modified with a write_reference, obtained with adobe::array_t::write(): \par \code my_array.write()[0] = adobe::value_t(std::string("This is a new value!")); \endcode \par In any case, when an adobe::array_t is modified the possibility of a copy arising from the assignment is likely. See the above \ref background_copy_on_write description for more information on these semantics. \subsection usage_retrieval Retrieval \par Getting values out of an adobe::array_t is easier than putting them in, because there is no "read_reference": you merely index into the adobe::array_t to access the values. The only thing to remember is that the data stored is wrapped in an adobe::value_t, so first must be extracted out of there before it can be used: \par \code // Singleton element retrieval adobe::array_t my_array; // ... fill my_array with elements std::string my_string_value(my_array[2].get<std::string>()); // Iterative retrieval of elements adobe::array_t::const_iterator first(my_array.begin()); adobe::array_t::const_iterator last(my_array.end()); for (; first != last; ++first) { if (first->type() == typeid(std::string)) { std::cout << "Found a string: " << first->get<std::string>() << std::endl; } else if (first->type() == typeid(double)) { std::cout << "Found a number: " << first->get<double>() << std::endl; } else { std::cout << "I have no idea what we've found!" << std::endl; } } \endcode */ --- NEW FILE: forest_tutorial.dox --- /*! \defgroup asl_tutorials_forest forest \ingroup asl_tutorials <i>Last updated January 25, 2005</i> \section tutorials_forest_background Background \par A forest is a node-based (bidirectional) data structure for the representation of a heirarchy. The parent/child relationship between the nodes is maintained in the container class, so any regular type can be stored within without affecting it. It is equipped with a host of powerful iterators for varied methods of traversing the heirarchy, each of which is described below. \section tutorials_forest_usage Usage \subsection forest_usage_empty An Empty Forest \par The best way to describe the forest class and its iterators is visually. Here is what a forest with no nodes added to it looks like (an "empty" forest): \par \image html forest_empty.jpg \par The "forest" is simply the item you "hang on to" when you're creating forest nodes. Note that subtrees themselves, then, are not forests. \subsection forest_usage_iteration Forest Iteration \par Here's a simple forest with some nodes added: \par \image html forest_simple.jpg \par In this figure we have a forest with three nodes. The red lines are the tree structure of the forest- node \c A connects to both nodes \c B and \c C as children. The blue dashed lines are the possible "positions" the \c forest::iterator will be over this forest. The best way to think of the \c forest::iterators is not so much the node that they point to but rather the nodes they "sit" in between. For instance, \c forest::begin() "sits" in between the forest head and node \c A in the above example. \subsubsection usage_iteration_sample A Sample Iteration \par To follow a forward fullorder iterator over the above example, we start between forest head and \c A. The iterator will then move onto node \c B, where something interesting happens. You'll see a "pivot" take place where the iterator doesn't actually move on from node \c B to \c C. Instead, it "changes edges", notably from the <i>leading</i> edge of node \c B to the <i>trailing</i> edge of \c B. The next step takes us to the leading edge of \c C, then another pivot to the trailing edge of \c C. The iterator will then move back up to <code>A</code>'s trailing edge, then to the top, \c forest::end(). \par Visiting a node twice in every iteration of a forest is <i>very</i> useful in the case of serialization of the forest data, especially to XML-based formats. Upon leading-edge arrival to the node you output the opening (<>) tag and upon trailing-edge arrival you output the closing (</>) tag. Since the (sub)children are visited in between these two arrivals the output will be well-formed XML that perfectly describes the state and relationships of the forest nodes. \subsubsection usage_iteration_types forest::iterator Types \par There are several types of iterators available to \c adobe::forest. They are: - <b><code>forest::iterator</code></b>: (also known as the fullorder iterator.) Visits the nodes by \<parent\>\<children\>\<children\>\<parent\>. Each node in the forest is visted twice. - <b><code>forest::preorder_iterator</code></b>: Visits the nodes by \<parent\>\<children\>. Each node in the forest is visted once. - <b><code>forest::postorder_iterator</code></b>: Visits the nodes by \<children\>\<parent\>. Each node in the forest is visted once. - <b><code>forest::child_iterator</code></b>: From any given node, \c child_iterator is a bidirectional iterator that walks a range of <i>siblings</i> (not the node's children) by "pivoting" on each node. There is a \c child_begin() and \c child_end() function to give you a range for the children of any node. Thus the \c child_iterator only applies to the first level of siblings, not to grandchildren or beyond. \par There are also \c reverse_ versions of the \c fullorder and \c child iterators, and \c const_ versions of the \c fullorder and \c child iterators. \par Note that only the fullorder iterator and child iterator are guaranteed constant time for increment and decrement. Pre- and post-order are amortorized constant time for a full traversal, but any single increment could take up to \c O(N) where \c N is the number of nodes in the forest. \subsection forest_usage_insertion Node Insertion \par Consider the simple forest example above. Now let's say we wanted to insert a new node, <code>D</code>, somewhere around any given node in the tree (in this case we'll use node <code>A</code>). Given node \c A there are four distinct relationships \c D will have to \c A after insertion. The four possible relationships are: -# As the previous sibling to \c A. Note the iterator is pointing to \c A. -# As the next sibling to \c A. Note the iterator is pointing to \c forest::end(). -# As the first child of \c A, or the previous sibling of \c B. Note the iterator is pointing to \c B. -# As the last child of \c A, or the next sibling of \c C. Note the iterator is pointing to \c A. \par Observe that the last two relationships are similar to the first two. Consider this visual of the above situation: \par \image html forest_insertion.jpg \par Note that for each of the four possibilities, the new node will be inserted along one of the dashed lines leading into or out of \c A. Don't forget that the dashed lines represent the position of any given iterator at any given time in the forest. In the case of a leaf node, the leading out and trailing in lines (iterator positions) are the same line (the loop), so the principle still applies. Insertion of nodes will always take place on top of one of these dashed lines, and never anywhere else. \par There is aninsert which takes a <code>[first, last)</code> sequence, allowing you to insert more than one node essentially at the same location. Doing so makes the inserted sequence all "siblinging" on the same arc. It is the same as if you inserted each item, \c first to <code>last - 1</code>, at the same location. So let's say I have a fullorder iterator to the leading edge of node \c A and I want to add a vector of items as children of \c A. One can write: \par \code // move my iterator to exit the leading edge ++iter; // add all of the vector as children of A. my_forest.insert(iter, my_vec.begin(), my_vec.end()); \endcode \par Observe that if you did not do the initial \c ++iter the vector's elements would be added before \c A, as siblings of \c A. \subsection forest_usage_deletion Node Deletion \par Deletion of nodes happens by the passing of two iterators. Nodes can only be deleted if they are leaf nodes. If the iterators encompass a range of nodes, the nodes will be deleted bottom-up, so they are always leaf nodes when they are deleted. The rule for the deletion of nodes is this: a node will be deleted if and only if the deletion iteration passes through the node <i>twice</i>. As an example consider the following diagrams: \par \image html forest_deletion.jpg \par In the first stage we have the iterators sitting between \c A and \c B and at \c forest::end(). The nodes \c B and \c C will be deleted because the iterator will go through both of those nodes twice while traversing from the start to the end of the deletion range. Note that even though the deletion iterator will pass through \c A it is not deleted because it only passes through once. Another way to think about it is if you were to "pinch" the forest with you fingers at the start and end of the range, and any node that isn't held back by the pinching at those two locations "drops" off the forest and is deleted. In the above case \c A would be dropped by one of the pinches but not the other, so it remains. */ --- NEW FILE: eve_tutorial.dox --- /*! \defgroup asl_tutorials_eve Eve \ingroup asl_tutorials <i>Last updated March 03, 2005</i> \section tutorials_eve_prerequsites Prerequisites To This Tutorial \par The following list of items is a good recommendation of stuff you should know before you attempt to work through this document: - boost::function - boost::bind - adobe::dictionary_t - Cursory reading of the \ref eve_engine (Engine) and \ref eveparser documentation \par For advanced implementations, the following might be of help <i>but are not required</i>: - adobe/future/assemblage.hpp - adobe/test/visual/headers/optional_connect.hpp \par The sample code found in the Adobe Begin implementation (especially <code>client_assembler.cpp</code>) shows a possible implementation using these techniques. Note that Adobe Begin is an experimental work in progress, and should be used loosely as an example only! \section tutorials_eve_overview Overview \par Eve is broken up into two distinct pieces: the parser and the engine. Note that both components exist completely independently of each other, though they are built in a way that they bind together easily. We will discuss both components in turn. There is also a third component, referred to herein as the <i>assemblage code</i>, which is the client-specified code that binds the parser to the engine. \par The general code design for the Adobe Source Libraries is one that tries to maintain true modularity between components. Each major module within the Libraries is written with only the most basic of common, shared code (adobe::array_t, adobe::dictionary_t, etc.) so they are able to communicate by means common data types. Other than that, we try to maintain a strict standard whereby no component is aware of or dependent upon any other component. This allows for the swapping in and out of a component with minimal invasiveness into other parts of your code base. In order to make this possible, there is a client-side piece of code called the <i>assemblage</i> that handles the connectivity between components. When a given component is added or removed, only the assemblage need be modified. Essentially the assemblage code is the only part of the program that knows context- that is, it alone knows what components are available across the application and how they should link together. \subsection tutorials_eve_overview_flow Program Flow \par The easiest way to see what is happening in a design that includes Eve is to enumerate the steps involved in solving a layout: -# The client code specifies an Eve file for parsed, solved, and displayed. -# The client code creates an <code>eve_t</code> object that is the Eve Engine instance that will manage the widgets at runtime. -# The client code calls the Eve Parser with (among other parameters) an input stream and an assemblage callback. -# The Eve Parser parses the input stream, notifying the assemblage callback any time a valid widget definition is found. -# The assemblage callback, when it receives a hit from the Eve Parser for a valid widget, constructs a signal suite and passes it (among other parameters) to the <code>eve_t</code> instance for layout of this new widget. -# The assemblage receives a new marker for the new widget just created in the Eve Engine hierarchy, and passes it back to the Eve Parser for later use. -# When the Eve Parser is finished, the client code calls the <code>evaluate</code> with the <code>eve_t</code> instance to solve for the layout. -# During the course of solving the layout, the Eve Engine calls back to the client assemblage code via the signal suites passed in for every individual widget created in the Eve Engine heirarchy. -# Once a view solution has been computed, the final signal (place) is fired for each widget to notify the client code of the positioning of every widget. -# The client code goes out to the OS to create the OS-specific widgets, hierarchy, event handlers, etc. -# The rest of the application takes it from there: Eve's work is done. \section tutorials_eve_parser Parser \par The interface for the parser is pretty simple. It takes a standard input file stream and a couple other parameters, including a callback by which the parser speaks to your assemblage code. Here is a sample of what it might look like: \par \code void parse_my_eve_file(const std::string& path_to_file) { std::ifstream stream(path_to_file.c_str()); adobe::line_position_t result_line(adobe::eve::parse( stream, adobe::line_position_t(path_to_file.c_str()), adobe::eve::position_t(), boost::bind(&client_assemble, _1, _3, boost::bind(adobe::eve::evaluate_arguments(), _4)))); } \endcode \par Note that we have yet to define what client_assemble will be- we will get to that later. Also, the result_line is used to indicate where the parsing of the definition ceased inside the input stream. \par So what is happening here, and what does this code do? All we are doing here is asking the Eve Parser to parse the input stream, and every time it successfully parses a widget in the view definition, it will call back to the client code by means of client_assemble. \par What is going on with adobe::eve::evaluate_arguments? When the parser traverses the view definition, each element in the view can contain a parameter list. Inside the parameter list are key/value pairs, or named arguments, that assist in the definition and layout of the view being defined. However when the parser sends the information to the client assemblage code, the named argument expressions are "raw", in their unevaluated states as an adobe::array_t per expression. adobe::eve::evaluate_arguments simply takes these raw expressions and converts them to their evaluated values, packing them into an adobe::dictionary_t. As an example, if in the Eve definition the parser finds a parameter: "my_value: 5 + 2 * 3", the resulting dictionary will have the named argument "my_value: 11" stored within. \par When client_assemble is called, it should work to communicate with the Eve Engine, the details of which we will look at in a bit. For now let us take a look at the guts of client_assemble. \section tutorials_eve_assembler Assemblage Code \par In our simplified case we have a single function, client_assemble, that knows about both the Eve Parser and the Eve Engine. Note that the Eve Parser is only aware of client_assemble-- it does not know what it does, nor does it care; it merely sends the results of the parse to this callback, and expects the rest of the body of code to know what to do about it. This gives the client the ability to substitute the Eve Parser with any other parser (XML, Boost Spirit, etc). As long as the assemblage code knows how to deal with the new parser, your app can utilize the Eve Engine just as effectively. \par So the client_assemble code might look something like this: \par \code adobe::position_t client_assemble( const adobe::eve_t::position_t& parent, adobe::name_t widget_name, const adobe::dictionary_t& parameters) { adobe::eve_t::signal_suite_t signals; signals.eve_container_defaults_proc_m = widget_container_defaults(widget_name); signals.eve_calculate_proc_m = widget_calculate_proc(widget_name); signals.eve_calculate_vertical_proc_m = widget_calculate_vertical_proc(widget_name); signals.eve_place_proc_m = widget_place_proc(widget_name); return eve_g.add_view_element(parent.empty() ? boost::any_cast<adobe::eve::position_t>(parent) : adobe::eve_t::iterator(), adobe::eve_t::insert_element_t( widget_is_a_container(widget_name), parameters, signals)); } \endcode \par There's a lot of new code being introduced here, so let us go through each part. \subsection tutorials_eve_assembler_signals signal_suite_t \par Earlier we stated that the assemblage code is the only code that knows "context"- what components are available and how they should communicate with one another. This does not mean that the components cannot communicate with one another directly, however- just that the assemblage must dictate <i>how</i> this communication is going to happen. \par Note that the callbacks are written on a per-widget-type basis: they need not be different for every instance of every widget, because the semantics of a widget should not change within the same widget type. (For instance, a push button is a push button irrespective of its dimensions or how it is labeled. Another widget, like a radio button, will have different layout parameters and different means of being measured.) \par A signal suite is a collection of boost::functions, each of which for a particular purpose. The collection is a generic interface for the Eve engine to communicate with a given widget's backend. The Eve Engine specifies the signal interface, and the client code (through the assemblage) is free to flesh out the implementation any way it sees fit. In essence the Eve Engine doesn't care how a callback arrives at the values it does, all it cares about is that it arrives at something meaningful. The assemblage linking method provides for the flexibility for an implementation to use any means of arriving at meaningful values for any widget. For instance in some cases it would make sense to wrap an OS measurement routine, whereas in other cases it would make better sense to hand-code the measurements. In either case the function can be made to fit a callback proc signature, and thus can be used by the Eve Engine. \subsection tutorials_eve_assembler_position_t adobe::eve_t::position_t \par adobe::eve_t::position_t is a means by which the Eve Engine communicates with <i>itself</i>. Internally it maintains a heirarchy of all the view widgets so it knows the parent-child relationship of each. The client assemblage code modifies this tree by means of the adobe::eve_t::add_view_element call. In each call, the client code must pass in a marker signifying the parent under which this new widget is to be placed. Upon return of the function, the Eve Engine will hand back a marker that is the position of the new view in the internal heirarchy. \par You really do not need to know what the marker is, just that it <i>is</i>. You should pass it back to the Eve Parser by means of the client assemblage. Note that the Eve Parser just retains the value, it doesn't do anything with it. If a subview for this widget is found the callback to client_assemble happens all over again, except this time the call uses the new marker as the parent adobe::eve_t::position_t. Again, this is an example of the parser and the engine communicating through the assemblage code, though neither knows or cares about the other. \par In the case of the root node, notice that the 3rd parameter of the call to adobe::eve_t::parse is an empty position_t; a test is performed in the assembler that converts that value to an empty Eve Engine marker, which will place the element being added at the root of the heirarchy. Note that it is technically possible to put more than one root in the heirarchy (thereby creating a forest) but to do so is undefined for Eve. \subsection tutorials_eve_assembler_signals widget_* functions \par There is a lot of code above that mentions functions beginning with <code>widget_</code> and taking a single argument that is the name of the widget type found by the parser. Essentially, they are selector functions based on the type of widget, that return other functions that handle the specifics semantics of that function for that widget type. For instace, if the widget type is "push_button", widget_calculate_proc might return some my_push_button_calc_proc that matches the desired function signature for this signal. \par <i>Note that the widget_* glue functions and the signal handlers are all considered part of the assemblage code.</i> \subsection tutorials_eve_assembler_signal_handlers Signal Handlers \par Above we mentioned specific functions for specific widgets that handle specific needs of the Eve Engine. As an example, let's look at what might happen inside a "push_button" widget's calculate proc. The Eve Engine signal suite definition provides specifies the signature for the calculate proc as: \par \code boost::function<void (eve_t::calculate_data_t&)> eve_calculate_proc_t; \endcode \par (If you do not know about Boost functions or what it means for something to meet the \ref concept_convertible_to_function concept requirements, you might want to read up on that before you proceed.) OK, so we know what the function signature must look like, so let's flesh out what the callback might look like: \par \code void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry) { geometry.slice_m[horizontal].length_m = 80; geometry.slice_m[vertical].length_m = 20; } \endcode \par The above code, for every push_button that is created, will tell the Eve Engine that the button's dimensions are width 80 and height 20. That all sounds well and good, but it's not very flexible. What would be really cool would be, given some sort of measure_string_width(...) proc, that the width of the button would be variable based on the width of the button name. Let's change up the function to fit what we're trying to do: \par \code void my_push_button_calc_proc(adobe::eve_t::calculate_data_t& geometry, const adobe::dictionary_t& parameters) { std::string button_name(parameters[adobe::static_name_t("name")].get<std::string>()); geometry.slice_m[horizontal].length_m = measure_string_width(button_name); geometry.slice_m[vertical].length_m = 20; } \endcode \par (Note that it is within measure_string_width(...) that one would fold in internationalization and localization efforts to produce well-formed dialogs for any language.) \par Peeling away the layers of C++ reveals this: using the dictionary_t we obtained from adobe::eve::evaluate_arguments (remember that from earlier?) we can now figure out what, according to the parse, the "name" variable of the widget is, and we can use that value to measure some sort of pixel width. Then we can pass that to the Eve Engine, and now we have what we want: a button that is as wide as it needs to be. \par The observant reader will note at this point something is wrong: our callback function signature no longer matches the required signature for the calculate proc signal. How do we reconcile this? Let's go back to the client_assemble function a second, and see what we have to play with: \par \code signals.eve_calculate_proc_m = widget_calculate_proc(widget_name); \endcode \par The code here passes to the signal suite the exact result of widget_calculate_proc... but now we have changed the signature of the function returned by that proc, and we need it to match the signature for the signal suite again. How do we do that? The solution: boost::bind. If you've never played with boost::bind, it is one of the most flexible and powerful constructs in modern C++. You should know learn it, love it, and use it when it is appropriate. In this case, we can modify the function signature with a call to boost::bind: \par \code signals.eve_calculate_proc_m = boost::bind(widget_calculate_proc(widget_name), _1, parameters); \endcode \par The details are a little grotesque, so let me sum up what is happening: boost::bind takes any \ref concept_convertible_to_function <i>thing</i> and converts it to a function object. (In this case, it's the callback returned by <code>widget_calculate_proc(...)</code>). Not only that, it also allows the client to pre-specify values for arguments to the <i>thing</i> being passed, and thereby can <i>change the signature of the resultant function object</i>. This is a big deal. What we're doing in the above code is filling in the function argument we don't want (parameters in the new my_push_button_calc_proc) in the signal signature with a value (parameters from client_assemble), which eliminates that argument from the resulting function object, giving us the signature we want to match the Eve Engine signal. \par A set of readers will here note that, if we're passing the <code>parameters</code> argument from client_assemble to the boost::bind operation by reference, it could come back to bite us because we're not guaranteed the adobe::dictionary_t will exist once client_assemble falls out of scope. This is true. However, boost::bind will not store values by reference implicitly- it will store them by value. Therefore, because of value semantics in the adobe::dictionary_t implementation, a <i>copy</i> of the argument will be stored in the function object, freeing <code>parameter</code> in client_assemble to be deleted when the client_assemble falls out of scope. The <code>_1</code> in the line is a powerful "placeholder argument" mechanism used by boost::bind to specify parameters that should still be in the function object signature. Please read up on boost::bind for more information on how to use it. \par At this point a general objection could be raised: Why all this trouble for an extra parameter? Why not just have another parameter in the signal_suite, namely an adobe::dictionary_t, that the Engine can merely propagate but never use? Better yet, why not just some <code>void*</code> that the client can pack with whatever they like? The answer is this: <i>To do so is to require the Eve Engine to carry more of a burden than it absolutely needs in order to do its job</i>. In this case, the mere propagation of parameters is not the job of the Eve Engine. The job of the Eve Engine is to solve for the layout. In order to do that, we distill what is <i>actually needed</i> to accomplish that task, and use that to specify the Eve Engine API. Anything beyond the absolute minimum requirements for Eve to do its job would be "API sugar", and so should be eliminated from the API as unnecessary. (As an historical aside, this was the way the original Eve was implemented, as having a user-specified "tag" that could be anything. In every use of Eve1 the "tag" quickly became a spaghetti tunnel.) Thanks to boost::bind, we are able to pass extra parameters to other parts of the assemblage without requiring components that don't care about this extra information to have to shoulder it. \section tutorials_eve_engine Eve Engine \par Finally, we arrive at the Eve Engine. This tutorial will not explain the details of the engine, or the parameters one can pass in order to manipulate its execution. Rather, one should check out the \ref eve_engine documentation and the \ref widget_reference for that information. What it will explain is the general interaction between the Eve Engine and the client assemblage code. \par Recall that there were a collection of callback functions that we provided for every widget we added to the Eve Engine hierarchy. Once all the widgets have been added, we call the following: \par \code eve_g->evaluate(adobe::eve_t::evaluate_flat); \endcode \par <code>evaluate</code> sets the engine in motion, at which point callbacks will start getting signalled. There are several passes Eve takes when solving the layout, and there are corresponding callbacks that get signalled in each one. It is important to know the order in which the callbacks are signalled for a given widget: - eve_container_defaults_proc_m (if the widget was specified as being a container by client_assemble) - eve_calculate_proc_m - eve_calculate_vertical_proc_m - eve_place_proc_m \par Each of these callbacks will return state to the Eve Engine, and will affect the parameters of subsequent callbacks to the same widget. You are guaranteed that each callback, if they are called, will be called in the order listed above for a given widget. You are not guaranteed that a callback will be called. The case in which Eve will call a callback is if it needs to. I know this sounds obvious, but there are cases when Eve will not require calling some of the callbacks. One case is in the process of resizing a dialog: all the views have already had their calculate callbacks signalled in a previous pass when the dialog was first laid out. Thus the calculate_proc will not get signalled when a dialog is resized. Neither will the container_defaults_proc. When the remaining two callbacks are called, however, you can be sure they will be signalled in the order listed above. */ --- NEW FILE: dictionary_tutorial.dox --- /*! \defgroup asl_tutorials_dictionary_t dictionary_t \ingroup asl_tutorials <i>Last updated January 25, 2005</i> \section dictionary_t_background Background \subsection background_regular_type Regular Type \par adobe::dictionary_t is a model of the \ref concept_regular_type concept. Value semantics allow for it to be used like a built-in type: \par \code void foo(adobe::dictionary_t param) // makes a copy of the dictionary_t { std::cout << param[adobe::name_t("my_key")].get<std::string>(); } int main(/*...*/) { adobe::dictionary_t my_dictionary; /* add key/value pairs to my_dictionary */ foo(my_dictionary); return 0; } \endcode \subsection background_copy_on_write Copy On Write \par adobe::dictionary_t is a copy-on-write container, which means that the container (and all its contents) are duplicated only when the dictionary is modified. This makes for very fast copies of adobe::dictionary_t, but can make writing to one a slow process. Therefore adobe::dictionary_t is to be used when there is a lot of copying but little writing into the container. The copy-on-write semantics are governed by a reference counter, so if there is only one adobe::dictionary_t referring to a given internal instance, then the copy is not made when the write is performed. Writing to these containers is very explicit; see the below section on \ref usage_storage for more information. \subsection background_random_access Random Access \par Every element in an adobe::dictionary_t can be accessed in <code>log n</code> time. There are also const_iterator classes that allow for bidirectional iteration of the class. There is no iterator class that allows for writing, however, due to the nature of the copy-on-write semantics. Writing to an adobe::dictionary_t is further explained in the \ref dictionary_t_usage section. \subsection background_value_t_value_type adobe::value_t Elements \par adobe::dictionary_t stores key/pair elements of types <adobe::name_t, adobe::value_t>. Because of the features of adobe::value_t, this means that an adobe::dictionary_t can store any data type that models the \ref concept_regular_type concept at a given key. \section dictionary_t_usage Usage \par A key point to remember is an adobe::dictionary_t is essentially a specialized map. Consequently just about anything you can do with a map you can do with an adobe::dictionary_t. The reasons you would want to use an adobe::dictionary_t over a std::map<adobe::name_t, adobe::value_t> is primarily because of the copy-on-write semantics, which allow for optimized copying and passing of adobe::dictionary_t as a function parameter. It is also much more lightweight than a std::map, though it does not scale well for dictionaries of large size (more than 128 elements). \subsection usage_initialization Initialization \par One initializes an adobe::dictionary_t in one of several ways: \par \code // Method 1: Default Construction adobe::dictionary_t my_first_dictionary; // Method 2: Copy Construction adobe::dictionary_t my_second_dictionary(my_first_dictionary); \endcode \par Constructing an empty dictionary will never throw an exception - no allocations are required until something is stored into it. Likewise, copying with assignment or copy constructor will not throw. \subsection usage_storage Storage \par Setting a value in an dictionary can only be done with an adobe::dictionary_t::write_reference. The write_reference gives the adobe::dictionary_t the ability to manage its copy on write semantics. There are a number of member functions inside adobe::dictionary_t that manage the write_reference automatically for you. The only instance where you need to explicitly obtain a write_reference is when using <code>operator []</code>. Here are examples of setting values where the write_references is automatically handled for you: \par \code adobe::dictionary_t my_dictionary; my_dictionary.set(adobe::name_t("pi"), adobe::value_t(3.141526)); my_dictionary.set(adobe::name_t("greeting"), adobe::value_t("Hello, world!")); my_dictionary.set(adobe::name_t("my_rt"), adobe::value_t(my_regular_type(/*...*/))); \endcode \par Once an element exists in the dictionary, it can be directly modified with a write_reference, obtained with adobe::dictionary_t::write(): \par \code my_dictionary.write()[adobe::name_t("greeting")] = adobe::value_t(std::string("This is a new value!")); \endcode \par In any case, when an adobe::dictionary_t is modified the possibility of a copy arising from the assignment is likely. See the above \ref background_copy_on_write description for more information on these semantics. \subsection usage_retrieval Retrieval \par Getting values out of an adobe::dictionary_t is easier than putting them in, because there is no "read_reference": you merely index into the adobe::dictionary_t to access the values. The only thing to remember is that the data stored is wrapped in an adobe::value_t, so first must be extracted out of there before it can be used: \par \code // Singleton element retrieval adobe::dictionary_t my_dictionary; // ... fill my_dictionary with elements std::string my_string_value(my_dictionary[adobe::name_t("key_string")].get<std::string>()); // Iterative retrieval of elements adobe::dictionary_t::const_iterator first(my_dictionary.begin()); adobe::dictionary_t::const_iterator last(my_dictionary.end()); for (; first != last; ++first) { if (first->second.type() == typeid(std::string)) { std::cout << "Found a string: " << first->second.get<std::string>() << std::endl; } else if (first->second.type() == typeid(double)) { std::cout << "Found a number: " << first->second.get<double>() << std::endl; } else { std::cout << "I have no idea what we've found!" << std::endl; } } \endcode Note that iterative retrieval of elements will take place in key-sorted order. */ |
|
From: Foster B. <fos...@us...> - 2005-04-18 21:15:57
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/test/adam_tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/adobe/test/adam_tutorial Added Files: Jamfile adam_tutorial.mcp adam_tutorial.vcproj default.adm main.cpp Log Message: SO SORRY for the large qty of emails -- creating a branch for Adobe Begin refactoring. --- NEW FILE: main.cpp --- /* Copyright 2005 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <iostream> #include <boost/config.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/fstream.hpp> #include <adobe/name.hpp> #include <adobe/value.hpp> #include <adobe/dictionary.hpp> #include <adobe/array.hpp> #include <adobe/adam.hpp> #include <adobe/adam_evaluate.hpp> #include <adobe/adam_parser.hpp> #include <map> /****************************************************************************************************/ namespace bfs = boost::filesystem; /****************************************************************************************************/ namespace { /****************************************************************************************************/ typedef std::map<adobe::name_t, adobe::value_t> cell_set_t; /****************************************************************************************************/ void value_changed(cell_set_t::value_type& cell, const adobe::value_t& new_value) { cell.second = new_value; std::cout << " Adam says: cell \'" << cell.first.get() << "\' updated to value " << cell.second << std::endl; } /****************************************************************************************************/ 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)); } /****************************************************************************************************/ void stream_cell_state(const cell_set_t::value_type& cell) { std::cout << " \'" << cell.first.get() << "\': " << cell.second << std::endl; } /****************************************************************************************************/ 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; }; /****************************************************************************************************/ 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 << " Adding cell \'" << cell_name.get() << "\' (type " << 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 << " Adding interface cell \'" << cell_name.get() << "\'" << std::endl; cell_set_m[cell_name] = adobe::value_t(); } /****************************************************************************************************/ 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) { sheet_m.update(); std::cout << "Current Cell States:" << 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); std::cout << "Enter in the new value for cell \'" << &cell_name_buffer[0] << "\': "; std::cin.getline(&new_value_buffer[0], 1024); sheet_m.set(adobe::name_t(&cell_name_buffer[0]), sheet_m.inspect(adobe::parse_adam_expression(&new_value_buffer[0]))); } } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ int main(int argc, char* argv[]) { try { std::cerr << "Compiler: " << BOOST_COMPILER << std::endl; std::cerr << "WARNING: This Adam tutorial only supports numerical cell values!" << 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"; } } --- NEW FILE: adam_tutorial.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="adam_tutorial" ProjectGUID="{F19941BD-A4B3-4940-A24E-D6340F962F54}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="bindebug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\adobe\future;..\..\..\third_party\boost_tp\boost;..\..\..\" PreprocessorDefinitions="WIN32;ADOBE_SERIALIZATION=1;BOOST_ALL_NO_LIB=1" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="asl_lib_dev.lib boost_lib.lib" OutputFile="$(OutDir)/adam_tutorial.exe" LinkIncremental="2" AdditionalLibraryDirectories="..\..\..\adobe\build\boost_lib\bindebug;..\..\..\adobe\build\asl_lib_dev\bindebug" IgnoreAllDefaultLibraries="FALSE" IgnoreDefaultLibraryNames="LIBCMTD" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/adam_tutorial.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="bin" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\..\adobe\future;..\..\..\third_party\boost_tp\boost;..\..\..\" PreprocessorDefinitions="WIN32;ADOBE_SERIALIZATION=1;BOOST_ALL_NO_LIB=1;NDEBUG" RuntimeLibrary="4" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="asl_lib_dev.lib boost_lib.lib" OutputFile="$(OutDir)/adam_tutorial.exe" LinkIncremental="1" AdditionalLibraryDirectories="..\..\..\adobe\build\boost_lib\bin;..\..\..\adobe\build\asl_lib_dev\bin" IgnoreDefaultLibraryNames="LIBCMTD" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File RelativePath="..\..\..\third_party\boost_tp\boost\libs\filesystem\src\convenience.cpp"> </File> <File RelativePath="..\..\..\third_party\boost_tp\boost\libs\filesystem\src\exception.cpp"> </File> <File RelativePath="..\..\future\source\iomanip.cpp"> </File> <File RelativePath="..\..\future\source\iomanip_pdf.cpp"> </File> <File RelativePath=".\main.cpp"> </File> <File RelativePath="..\..\..\third_party\boost_tp\boost\libs\filesystem\src\operations_posix_windows.cpp"> </File> <File RelativePath="..\..\..\third_party\boost_tp\boost\libs\filesystem\src\path_posix_windows.cpp"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: default.adm --- sheet distance_calculator { interface: distance : 15; rate : 3; time : 5; logic: relate { rate <== distance / time; time <== distance / rate; distance <== rate * time; } } --- NEW FILE: Jamfile --- import testing ; project adobe/adam_tutorial : requirements <link>static ; exe "adam_tutorial" : main.cpp /adobe//asl_lib_dev /boost/filesystem//boost_filesystem ; --- NEW FILE: adam_tutorial.mcp --- (This appears to be a binary file; contents omitted.) |