From: Foster B. <fos...@us...> - 2006-02-27 20:42:12
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/begin/sources/mac Modified Files: main.cpp Log Message: image_t (icons and pictures) support for Mac and Win32, along with a GIL image factory and a (sample) Targa file format importing module for that factory. Also added alert.adm/eve as a sample for the icon support. Added the notion of a working directory to the modal dialog interface to reference external resources. Also added an alert API that leverages modal_dialog_interface. Other misc. bug fixes and changes. Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/sources/mac/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 3 Feb 2006 18:33:39 -0000 1.5 --- main.cpp 27 Feb 2006 20:42:00 -0000 1.6 *************** *** 8,12 **** #include "express_viewer.hpp" #include "report_exception.hpp" - #include "carbon_safe.hpp" #include <boost/filesystem/convenience.hpp> --- 8,11 ---- *************** *** 14,17 **** --- 13,18 ---- #include <adobe/xstring.hpp> + #include <adobe/future/widgets/headers/mac/os_utilities.hpp> + #include <sstream> #include <string> *************** *** 49,82 **** // - /// 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); - OSStatus error(noErr); - - while (true) - { - error = ::FSRefMakePath(&location, reinterpret_cast<UInt8*>(&path_buffer[0]), max_size); - if (error != pathTooLongErr) break; - - max_size *= 2; - path_buffer.resize(max_size); - } - - ADOBE_REQUIRE_STATUS(error); - - return boost::filesystem::path( &path_buffer[0], boost::filesystem::native ); - } - - /****************************************************************************************************/ - - // /// Attempt to open the documents in the given AEDescList. // --- 50,53 ---- *************** *** 110,114 **** // which we have been asked to open. // ! bfs::path file_name( fsref_to_path( file ) ); std::string extension( boost::filesystem::extension( file_name ) ); --- 81,85 ---- // which we have been asked to open. // ! bfs::path file_name( adobe::implementation::fsref_to_path( file ) ); std::string extension( boost::filesystem::extension( file_name ) ); *************** *** 311,340 **** /****************************************************************************************************/ - // - /// These template ensures that the static auto_ptr event handlers get - /// released when the app closes. - // - template<> - struct delete_ptr<AEEventHandlerUPP> - { - void operator()( AEEventHandlerUPP x ) const - { - if( x ) DisposeAEEventHandlerUPP( x ); - } - }; - - /****************************************************************************************************/ - - template<> - struct delete_ptr<EventHandlerUPP> - { - void operator()( EventHandlerUPP x ) const - { - if( x ) DisposeEventHandlerUPP( x ); - } - }; - - /****************************************************************************************************/ - bool os_initialize( adobe::application_t* theApp ) { --- 282,285 ---- *************** *** 350,354 **** ADOBE_REQUIRE_STATUS( GetProcessBundleLocation( &psn, &location ) ); ! theApp->set_resource_directory( fsref_to_path( location ) / "Contents/Resources" ); // --- 295,299 ---- ADOBE_REQUIRE_STATUS( GetProcessBundleLocation( &psn, &location ) ); ! theApp->set_resource_directory( implementation::fsref_to_path( location ) / "Contents/Resources" ); // |