You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(67) |
Apr
(455) |
May
(202) |
Jun
(136) |
Jul
(203) |
Aug
(60) |
Sep
(88) |
Oct
(64) |
Nov
(56) |
Dec
(78) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(271) |
Feb
(207) |
Mar
|
Apr
|
May
(167) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Foster B. <fos...@us...> - 2006-05-22 20:16:53
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/gil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/gil Removed Files: before_after.dox design_guide.dox main.dox tutorial.dox Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- main.dox DELETED --- --- tutorial.dox DELETED --- --- design_guide.dox DELETED --- --- before_after.dox DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:51
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/doxygen_support_files/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/doxygen_support_files/images Removed Files: grant_munsey.jpg Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- grant_munsey.jpg DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:51
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/doxygen_support_files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/doxygen_support_files Removed Files: footer.dox header.dox include_stub.dox permissions.dox stlab.css Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- footer.dox DELETED --- --- permissions.dox DELETED --- --- header.dox DELETED --- --- include_stub.dox DELETED --- --- stlab.css DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/related/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/related/images Removed Files: adam_and_eve.jpg adam_mvc_design.jpg clippingpath.jpg codebase.jpg edit_text_example.jpg parameter_flow.jpg Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- adam_mvc_design.jpg DELETED --- --- codebase.jpg DELETED --- --- clippingpath.jpg DELETED --- --- parameter_flow.jpg DELETED --- --- edit_text_example.jpg DELETED --- --- adam_and_eve.jpg DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:51
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/related/images/originals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/related/images/originals Removed Files: adam_and_eve.graffle adam_mvc_design.graffle codebase.graffle edit_text_example.graffle parameter_flow.graffle Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- adam_mvc_design.graffle DELETED --- --- edit_text_example.graffle DELETED --- --- parameter_flow.graffle DELETED --- --- codebase.graffle DELETED --- --- adam_and_eve.graffle DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:50
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources Removed Files: documentation.doxygen Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- documentation.doxygen DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:50
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/images/originals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/images/originals Removed Files: calculate_data_t.graffle calculate_data_t_slice_t.graffle Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- calculate_data_t.graffle DELETED --- --- calculate_data_t_slice_t.graffle DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/related In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/related Removed Files: adam_language_reference.dox asl_overview.dox eve_language_reference.dox reference_expression_section.dox Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- asl_overview.dox DELETED --- --- eve_language_reference.dox DELETED --- --- adam_language_reference.dox DELETED --- --- reference_expression_section.dox DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/concepts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/concepts Removed Files: backinsertionsequence.dox concept_assignable.dox concept_convertible_to_bool.dox concept_convertible_to_function.dox concept_convertible_to_range.dox concept_defaultconstructible.dox concept_equalitycomparable.dox concept_lessthancomparable.dox concept_regular_type.dox concept_transform_function.dox defgroup_concepts.dox frontinsertionsequence.dox reversiblecontainer.dox Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- concept_transform_function.dox DELETED --- --- concept_equalitycomparable.dox DELETED --- --- concept_lessthancomparable.dox DELETED --- --- concept_assignable.dox DELETED --- --- frontinsertionsequence.dox DELETED --- --- concept_regular_type.dox DELETED --- --- reversiblecontainer.dox DELETED --- --- concept_convertible_to_function.dox DELETED --- --- defgroup_concepts.dox DELETED --- --- concept_convertible_to_range.dox DELETED --- --- concept_convertible_to_bool.dox DELETED --- --- concept_defaultconstructible.dox DELETED --- --- backinsertionsequence.dox DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:16:50
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl/images Removed Files: calculate_data_t.jpg calculate_data_t_slice_t.jpg Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- calculate_data_t.jpg DELETED --- --- calculate_data_t_slice_t.jpg DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation/sources/asl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation/sources/asl Removed Files: adam.dox adam_evaluate.dox adam_parser.dox algorithm.dox array_t.dox circular_queue.dox cmath.dox conversion.dox copy_on_write.dox counter_t.dox dancing_links.dox defgroup_libraries.dox dictionary_t.dox empty_t.dox eve.dox eve_evaluate.dox eve_parser.dox extents_t.dox final.dox forest.dox functional.dox istream.dox iterator.dox md5.dox name_t.dox numeric.dox once.dox regular_object.dox sha.dox static_table.dox string.dox table_index.dox thread_id.dox typeinfo.dox unicode.dox value_t.dox virtual_machine_t.dox xstring.dox zuid.dox Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- final.dox DELETED --- --- functional.dox DELETED --- --- array_t.dox DELETED --- --- value_t.dox DELETED --- --- eve.dox DELETED --- --- name_t.dox DELETED --- --- xstring.dox DELETED --- --- conversion.dox DELETED --- --- dictionary_t.dox DELETED --- --- iterator.dox DELETED --- --- virtual_machine_t.dox DELETED --- --- md5.dox DELETED --- --- algorithm.dox DELETED --- --- table_index.dox DELETED --- --- adam.dox DELETED --- --- zuid.dox DELETED --- --- forest.dox DELETED --- --- typeinfo.dox DELETED --- --- extents_t.dox DELETED --- --- counter_t.dox DELETED --- --- once.dox DELETED --- --- cmath.dox DELETED --- --- empty_t.dox DELETED --- --- eve_parser.dox DELETED --- --- regular_object.dox DELETED --- --- unicode.dox DELETED --- --- adam_parser.dox DELETED --- --- copy_on_write.dox DELETED --- --- sha.dox DELETED --- --- adam_evaluate.dox DELETED --- --- static_table.dox DELETED --- --- string.dox DELETED --- --- defgroup_libraries.dox DELETED --- --- dancing_links.dox DELETED --- --- numeric.dox DELETED --- --- istream.dox DELETED --- --- thread_id.dox DELETED --- --- eve_evaluate.dox DELETED --- --- circular_queue.dox DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/bin Removed Files: asl_net_setup.bat asl_net_setup.sh build.bat build.sh install.sh leconv.exe make-distribution.bat verify.sh Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- make-distribution.bat DELETED --- --- build.bat DELETED --- --- leconv.exe DELETED --- --- install.sh DELETED --- --- verify.sh DELETED --- --- build.sh DELETED --- --- asl_net_setup.bat DELETED --- --- asl_net_setup.sh DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:13:41
|
Update of /cvsroot/adobe-source/adobe-source/adobe/documentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/documentation Removed Files: documentation.html Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- documentation.html DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:13:41
|
Update of /cvsroot/adobe-source/adobe-source/adobe/config/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/config/compiler Removed Files: gcc.hpp visualc.hpp Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- gcc.hpp DELETED --- --- visualc.hpp DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:13:40
|
Update of /cvsroot/adobe-source/adobe-source/adobe/algorithm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe/algorithm Removed Files: assign.hpp reverse.hpp Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- reverse.hpp DELETED --- --- assign.hpp DELETED --- |
Update of /cvsroot/adobe-source/adobe-source/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source/adobe Removed Files: Jamfile.v2 adam.hpp adam_evaluate.hpp adam_parser.hpp algorithm.hpp array.hpp array_fwd.hpp basic_sheet.hpp circular_queue.hpp cmath.hpp config.hpp conversion.hpp copy_on_write.hpp counter.hpp dancing_links.hpp dictionary.hpp dictionary_fwd.hpp empty.hpp eve.hpp eve_evaluate.hpp eve_parser.hpp extents.hpp final.hpp forest.hpp functional.hpp istream.hpp istream_fwd.hpp iterator.hpp md5.hpp mismatch.hpp name.hpp name_fwd.hpp numeric.hpp once.hpp regular_object.hpp sha.hpp static_table.hpp string.hpp table_index.hpp thread_id.hpp typeinfo.hpp unicode.hpp value.hpp value_fwd.hpp virtual_machine.hpp xstring.hpp zuid.hpp Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- copy_on_write.hpp DELETED --- --- thread_id.hpp DELETED --- --- dictionary.hpp DELETED --- --- static_table.hpp DELETED --- --- extents.hpp DELETED --- --- functional.hpp DELETED --- --- md5.hpp DELETED --- --- conversion.hpp DELETED --- --- unicode.hpp DELETED --- --- dictionary_fwd.hpp DELETED --- --- virtual_machine.hpp DELETED --- --- config.hpp DELETED --- --- final.hpp DELETED --- --- value.hpp DELETED --- --- value_fwd.hpp DELETED --- --- sha.hpp DELETED --- --- adam_parser.hpp DELETED --- --- array_fwd.hpp DELETED --- --- name_fwd.hpp DELETED --- --- name.hpp DELETED --- --- regular_object.hpp DELETED --- --- empty.hpp DELETED --- --- mismatch.hpp DELETED --- --- istream.hpp DELETED --- --- Jamfile.v2 DELETED --- --- forest.hpp DELETED --- --- eve.hpp DELETED --- --- numeric.hpp DELETED --- --- typeinfo.hpp DELETED --- --- eve_parser.hpp DELETED --- --- cmath.hpp DELETED --- --- zuid.hpp DELETED --- --- string.hpp DELETED --- --- array.hpp DELETED --- --- dancing_links.hpp DELETED --- --- table_index.hpp DELETED --- --- xstring.hpp DELETED --- --- circular_queue.hpp DELETED --- --- adam_evaluate.hpp DELETED --- --- counter.hpp DELETED --- --- algorithm.hpp DELETED --- --- iterator.hpp DELETED --- --- basic_sheet.hpp DELETED --- --- eve_evaluate.hpp DELETED --- --- once.hpp DELETED --- --- istream_fwd.hpp DELETED --- --- adam.hpp DELETED --- |
From: Foster B. <fos...@us...> - 2006-05-22 20:13:32
|
Update of /cvsroot/adobe-source/adobe-source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14392/adobe-source Removed Files: Jamfile.v2 LICENSE_1_0_0.txt boost-build.jam manifest.jam project-root.jam read_me.txt release_notes.txt Log Message: deleting the CVS repository data; using Perforce now. Download the p4checkout scripts from sf.net/projects/adobe-source and sync to submission for the current state of the depots --- boost-build.jam DELETED --- --- read_me.txt DELETED --- --- manifest.jam DELETED --- --- Jamfile.v2 DELETED --- --- release_notes.txt DELETED --- --- LICENSE_1_0_0.txt DELETED --- --- project-root.jam DELETED --- |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:16
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/future/widgets/sources/win32 Modified Files: label_t_impl.cpp os_utilities.cpp Added Files: image_t_impl.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. --- NEW FILE: image_t_impl.cpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include <windows.h> #include <uxtheme.h> #include <tmschema.h> #define SCHEME_STRINGS 1 #include <tmschema.h> //Yes, we include this twice -- read the top of the file #include "event_dispatcher.hpp" #include "ui_core.hpp" #include "ui_core_common.hpp" #include "ui_core_implementation.hpp" #include "adobe/unicode.hpp" #include "wincast.hpp" #include "metrics.hpp" #include "image_t_impl.hpp" #include "display.hpp" #include <adobe/gil/extension/argb/argb.hpp> #include <string> #include <cassert> /****************************************************************************************************/ #define ADOBE_THROW_LAST_ERROR adobe::implementation::throw_last_error_exception(__FILE__, __LINE__) /****************************************************************************************************/ namespace { /****************************************************************************************************/ void reset_image(HWND window, GIL::rgba8_image& view) { HDC dst_dc(::GetDC(window)); HDC src_dc(::CreateCompatibleDC(dst_dc)); BITMAPINFO bitmap_info = { 0 }; VOID* pv_bits; HBITMAP bitmap_handle; LONG image_width(hackery::cast<LONG>(view.width())); LONG image_height(hackery::cast<LONG>(view.height())); bitmap_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bitmap_info.bmiHeader.biWidth = image_width; bitmap_info.bmiHeader.biHeight = image_height; bitmap_info.bmiHeader.biPlanes = 1; bitmap_info.bmiHeader.biBitCount = 32; // four 8-bit components bitmap_info.bmiHeader.biCompression = BI_RGB; bitmap_info.bmiHeader.biSizeImage = image_width * image_height * 4; bitmap_handle = ::CreateDIBSection(src_dc, &bitmap_info, DIB_RGB_COLORS, &pv_bits, NULL, 0x0); GIL::argb8_pixel* dst_bits(static_cast<GIL::argb8_pixel*>(pv_bits)); GIL::rgba8_view::iterator first(view.begin()); GIL::rgba8_view::iterator last(view.end()); std::transform(first, last, dst_bits, GIL::color_converter<GIL::argb8_pixel>()); ::SendMessage(window, STM_SETIMAGE, IMAGE_BITMAP, hackery::cast<LPARAM>(bitmap_handle)); ::ReleaseDC(window, dst_dc); } /****************************************************************************************************/ } // namespace /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ namespace implementation { /****************************************************************************************************/ extern void throw_last_error_exception(const char* file, long line); /****************************************************************************************************/ } // namespace implementation /****************************************************************************************************/ image_t::implementation_t::implementation_t(GIL::rgba8_image& image) : image_m(image) { initialize(); } /****************************************************************************************************/ image_t::implementation_t::implementation_t(const implementation_t& rhs) { image_m = rhs.image_m; // can't be constructed for some reason; must be assigned initialize(); } /****************************************************************************************************/ image_t::implementation_t& image_t::implementation_t::operator=(const implementation_t& rhs) { image_m = rhs.image_m; initialize(); return *this; } /****************************************************************************************************/ void image_t::implementation_t::place(const point_2d_t& position, const extents_t& extents) { RECT new_bounds = { position.x_m, position.y_m, position.x_m + extents.width(), position.y_m + extents.height() }; implementation::set_control_bounds(window_m.get(), new_bounds); } /****************************************************************************************************/ void image_t::implementation_t::enable(bool make_enabled) { ::EnableWindow(window_m.get(), make_enabled); } /****************************************************************************************************/ void image_t::implementation_t::initialize() { window_m.reset( ::CreateWindowExA( WS_EX_COMPOSITED, "STATIC", NULL, WS_CHILD | WS_VISIBLE | SS_BITMAP, 0, 0, hackery::cast<int>(image_m.width()), hackery::cast<int>(image_m.height()), invisible_parent(), NULL, ::GetModuleHandle(NULL), NULL)); if (window_m.get() == NULL) ADOBE_THROW_LAST_ERROR; // now set up the bitmap reset_image(window_m.get(), image_m); } /****************************************************************************************************/ extents_t image_t::implementation_t::measure() { assert(window_m.get()); extents_t result; result.height() = hackery::cast<LONG>(image_m.height()); result.width() = hackery::cast<LONG>(image_m.width()); return result; } /****************************************************************************************************/ void image_t::implementation_t::set(GIL::rgba8_image& image) { image_m = image; reset_image(window_m.get(), image_m); } /****************************************************************************************************/ template <> HWND view_for_element< HWND, adobe::image_t >(adobe::image_t& widget) { return widget.implementation().window_m.get(); } /****************************************************************************************************/ template <> display_t::position_t insert<adobe::image_t>(display_t& display, display_t::position_t& parent, adobe::image_t& element) { HWND ref(adobe::view_for_element< HWND >(element)); return display.insert<HWND>(parent, ref); } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ Index: label_t_impl.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32/label_t_impl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** label_t_impl.cpp 23 Feb 2006 23:28:56 -0000 1.1 --- label_t_impl.cpp 27 Feb 2006 20:41:59 -0000 1.2 *************** *** 1,2 **** --- 1,10 ---- + /* + Copyright 2005-2006 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) + */ + + /****************************************************************************************************/ + #include <windows.h> #include <uxtheme.h> Index: os_utilities.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32/os_utilities.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** os_utilities.cpp 3 Feb 2006 18:33:37 -0000 1.1 --- os_utilities.cpp 27 Feb 2006 20:41:59 -0000 1.2 *************** *** 7,11 **** /****************************************************************************************************/ ! // This file intentionally left blank /****************************************************************************************************/ --- 7,85 ---- /****************************************************************************************************/ ! #define WIN32_LEAN_AND_MEAN 1 ! ! #include <windows.h> ! #include <Commdlg.h> ! ! #include <adobe/future/widgets/headers/win32/os_utilities.hpp> ! #include <adobe/unicode.hpp> ! ! #include <boost/cstdint.hpp> ! ! #include <vector> ! ! /****************************************************************************************************/ ! ! namespace adobe { ! ! /****************************************************************************************************/ ! ! namespace implementation { ! ! /****************************************************************************************************/ ! ! bool pick_save_path(boost::filesystem::path& path) ! { ! // This upper part sets up the OS-specific save file dialog and ! // invokes it so the user can pick a save file location ! ! std::vector<TCHAR> path_buffer(2048, 0); ! std::vector<char> cpath_buffer; ! OPENFILENAME params = { 0 }; ! ! params.lStructSize = sizeof(params); ! params.lpstrFilter = L"Text File\0*.txt\0All Files\0*.*\0\0"; ! params.lpstrFile = &path_buffer[0]; ! params.nMaxFile = static_cast<DWORD>(path_buffer.size()); ! params.Flags = OFN_DONTADDTORECENT | ! OFN_LONGNAMES | ! OFN_NOCHANGEDIR | ! OFN_NONETWORKBUTTON | ! OFN_NOREADONLYRETURN | ! OFN_PATHMUSTEXIST; ! params.lpstrDefExt = L"txt"; ! ! bool result = GetSaveFileName(¶ms) != 0; ! ! if (result == false) ! return result; ! ! // At this point we have a path to the save file location, but we don't know ! // if the return value is utf16 or utf8. Boost::filesystem at the moment requires ! // utf8 (or ASCII?) so we need to make the conversion at runtime if necessary. ! // That's what this code does. ! ! TCHAR* end = std::find(&path_buffer[0], &path_buffer[0] + path_buffer.size(), TCHAR(0)); ! ! cpath_buffer.reserve(std::distance(&path_buffer[0], end)); ! ! adobe::to_utf8(&path_buffer[0], end, std::back_inserter(cpath_buffer)); ! ! cpath_buffer.push_back(0); ! ! // finally, construct the new path from the converted string buffer and return ! ! path = boost::filesystem::path(&cpath_buffer[0], boost::filesystem::native); ! ! return true; ! } ! ! /****************************************************************************************************/ ! ! } // namespace implementation ! ! /****************************************************************************************************/ ! ! } // namespace adobe /****************************************************************************************************/ |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:15
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/begin/headers Modified Files: file.hpp 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: file.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/headers/file.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** file.hpp 23 Feb 2006 23:28:57 -0000 1.1 --- file.hpp 27 Feb 2006 20:41:59 -0000 1.2 *************** *** 91,94 **** --- 91,96 ---- void set_line_endings_impl(line_ending_t le, bool force = false); + bool ask_for_path(); + bfs::path path_m; ///< Path to the current file std::string contents_m; ///< Contents of the file (not necessarily same as that in file) |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:15
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/begin/examples Added Files: alert.adm alert.eve stop.tga 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. --- NEW FILE: alert.adm --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ sheet alert_dialog { output: result <== { dummy_value: 42 }; } --- NEW FILE: stop.tga --- (This appears to be a binary file; contents omitted.) --- NEW FILE: alert.eve --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ layout alert_dialog { view dialog(name: "Alert", placement: place_row) { image(image: "stop.tga"); column(vertical: align_fill) { static_text(name: "Unfortunately, something drastic has happened. If you would like we can try to continue with the operation, but there is a chance you will blow up your computer. Would you like to try?", characters: 25); row(vertical: align_bottom, horizontal: align_right) { button(name: "Cancel", action: @cancel, cancel: true); button(name: "OK", bind: @result, action: @ok, default: true); } } } } |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:15
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/begin/resources Modified Files: aqua_button.psd editor.eve metrics_glossary.xstr 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: metrics_glossary.xstr =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/metrics_glossary.xstr,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** metrics_glossary.xstr 3 Feb 2006 18:33:38 -0000 1.4 --- metrics_glossary.xstr 27 Feb 2006 20:42:00 -0000 1.5 *************** *** 1,80 **** ! <xstr id='metric:global'>{ gap: 4 }</xstr> ! ! <xstr id='metric:window'>{ spacing: 20 }</xstr> ! ! <xstr id='metric:checkbox' theme='normal'> ! { adjust_size: [ 2, 4 ], adjust_position: [ -2, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr> ! <xstr id='metric:checkbox' theme='small'> ! { adjust_size: [ 1, 4 ], adjust_position: [ -1, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr> ! <xstr id='metric:checkbox' theme='mini'> ! { adjust_size: [ 0, 1 ], adjust_position: [ 0, -1 ], outset: [ 0, 1, 0, 0 ], adjust_baseline: -1 }</xstr> ! ! <xstr id='metric:radio_button' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ -2, -2 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -2 }</xstr> ! <xstr id='metric:radio_button' theme='small'> ! { adjust_size: [ 0, 2 ], adjust_position: [ 0, -1 ], outset: [ 0, 0, 0, 1 ] }</xstr> ! <xstr id='metric:radio_button' theme='mini'> ! { adjust_size: [ 0, 1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 0, 1 ] }</xstr> ! ! <xstr id='metric:button' theme='normal'> ! { adjust_size: [ 0, -1 ], outset: [ 1, 0, 1, 2 ] }</xstr> ! <xstr id='metric:button' theme='small'> ! { adjust_size: [ -2, 2 ], adjust_position: [ 1, -1 ], outset: [ 0, 0, 0, 1 ], adjust_baseline: -2 }</xstr> ! <xstr id='metric:button' theme='mini'> ! { adjust_size: [ 2, 5 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -3 }</xstr> ! ! <xstr id='metric:group' label='true' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr> ! <xstr id='metric:group' label='true' theme='small'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr> ! <xstr id='metric:group' label='true' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 3, 1, 1 ], spacing: 20 }</xstr> ! ! <xstr id='metric:group' label='false' theme='normal'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 4, 1, 1 ] }</xstr> ! <xstr id='metric:group' label='false' theme='small'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr> ! <xstr id='metric:group' label='false' theme='mini'> ! { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr> ! ! <xstr id='metric:tab_group' theme='normal'> ! { adjust_size: [ 0, 8 ], adjust_position: [ 0, -7 ], frame: [ 1, 8, 1, 1 ], spacing: 24 }</xstr> ! <xstr id='metric:tab_group' theme='small'> ! { adjust_size: [ 0, 5 ], adjust_position: [ 0, -4 ], frame: [ 1, 8, 1, 1 ], spacing: 19 }</xstr> ! <xstr id='metric:tab_group' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 6, 1, 1 ], spacing: 16 }</xstr> ! ! <xstr id='metric:static_text' theme='normal'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -3 ], adjust_baseline: -3 }</xstr> ! <xstr id='metric:static_text' theme='small'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> ! <xstr id='metric:static_text' theme='mini'> ! { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr> ! ! <xstr id='metric:edit_text' scroll='false' theme='normal'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> ! <xstr id='metric:edit_text' scroll='false' theme='small'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> ! <xstr id='metric:edit_text' scroll='false' theme='mini'> ! { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr> ! ! <xstr id='metric:edit_text' scroll='true' theme='normal'> ! { }</xstr> ! <xstr id='metric:edit_text' scroll='true' theme='small'> ! { }</xstr> ! <xstr id='metric:edit_text' scroll='true' theme='mini'> ! { }</xstr> ! ! <xstr id='metric:popup' label='false' theme='normal'> ! { adjust_size: [ 1, -1 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ] }</xstr> ! <xstr id='metric:popup' label='false' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: 1 }</xstr> ! <xstr id='metric:popup' label='false' theme='mini'> ! { adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ] }</xstr> ! ! <xstr id='metric:popup' label='true' theme='normal'> ! { adjust_size: [ 0, -1 ], outset: [ 0, 0, 1, 1 ] }</xstr> ! <xstr id='metric:popup' label='true' theme='small'> ! { adjust_size: [ 1, -1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 1, 1 ], adjust_baseline: 1 }</xstr> ! <xstr id='metric:popup' label='true' theme='mini'> ! { adjust_size: [ 1, 0 ] }</xstr> --- 1,2 ---- ! // Contents moved to <adobe/future/widgets/sources/mac/metrics.cpp> ! // by fbrereto on 2006/02/14 Index: editor.eve =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/editor.eve,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editor.eve 3 Feb 2006 18:33:38 -0000 1.6 --- editor.eve 27 Feb 2006 20:42:00 -0000 1.7 *************** *** 22,26 **** panel(bind: @tab_group_visible, value: @adam_stuff) { ! edit_text(bind: @adam_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(vertical: align_bottom) --- 22,26 ---- panel(bind: @tab_group_visible, value: @adam_stuff) { ! edit_text(bind: @adam_expression, characters: 50, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(vertical: align_bottom) *************** *** 33,37 **** panel(bind: @tab_group_visible, value: @eve_stuff) { ! edit_text(bind: @eve_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(vertical: align_bottom) --- 33,37 ---- panel(bind: @tab_group_visible, value: @eve_stuff) { ! edit_text(bind: @eve_expression, characters: 50, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); row(vertical: align_bottom) *************** *** 61,70 **** panel(bind: @tab_group_visible, value: @results_stuff) { ! edit_text(bind: @results_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } panel(bind: @tab_group_visible, value: @errors_stuff) { ! edit_text(bind: @errors_expression, characters: 80, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } } --- 61,70 ---- panel(bind: @tab_group_visible, value: @results_stuff) { ! edit_text(bind: @results_expression, characters: 50, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } panel(bind: @tab_group_visible, value: @errors_stuff) { ! edit_text(bind: @errors_expression, characters: 50, lines: 10, scrollable: true, monospaced: true, horizontal: align_fill, vertical: align_fill); } } Index: aqua_button.psd =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/begin/resources/aqua_button.psd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsUGgVtG and /tmp/cvsDyYwqu differ |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:15
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/vc8 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/ide_projects/vc8 Modified Files: asl_dev.vcproj widgets.vcproj 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: asl_dev.vcproj =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/vc8/asl_dev.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** asl_dev.vcproj 24 Jan 2006 19:38:51 -0000 1.3 --- asl_dev.vcproj 27 Feb 2006 20:42:00 -0000 1.4 *************** *** 222,225 **** --- 222,229 ---- </File> <File + RelativePath="..\..\adobe\future\source\alert.cpp" + > + </File> + <File RelativePath="..\..\adobe\source\name.cpp" > Index: widgets.vcproj =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/ide_projects/vc8/widgets.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** widgets.vcproj 23 Feb 2006 23:28:58 -0000 1.4 --- widgets.vcproj 27 Feb 2006 20:42:00 -0000 1.5 *************** *** 179,182 **** --- 179,190 ---- </File> <File + RelativePath="..\..\adobe\future\widgets\sources\image_t.cpp" + > + </File> + <File + RelativePath="..\..\adobe\future\widgets\sources\win32\image_t_impl.cpp" + > + </File> + <File RelativePath="..\..\adobe\future\widgets\sources\label_t.cpp" > *************** *** 209,212 **** --- 217,224 ---- </File> <File + RelativePath="..\..\adobe\future\widgets\sources\win32\os_utilities.cpp" + > + </File> + <File RelativePath="..\..\adobe\future\widgets\sources\ui_core.cpp" > *************** *** 283,286 **** --- 295,306 ---- </File> <File + RelativePath="..\..\adobe\future\widgets\headers\image_t.hpp" + > + </File> + <File + RelativePath="..\..\adobe\future\widgets\headers\win32\image_t_impl.hpp" + > + </File> + <File RelativePath="..\..\adobe\future\widgets\headers\label_t.hpp" > |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:14
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/future/widgets/sources/mac Modified Files: label_t_impl.cpp metrics.cpp os_utilities.cpp ui_core_implementation.cpp Added Files: image_t_impl.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: metrics.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/metrics.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** metrics.cpp 23 Feb 2006 23:28:55 -0000 1.7 --- metrics.cpp 27 Feb 2006 20:41:59 -0000 1.8 *************** *** 29,32 **** --- 29,117 ---- /****************************************************************************************************/ + const char* mac_metrics_g = + "<xstr id='metric:global'>{ gap: 4 }</xstr>" + "" + "<xstr id='metric:window'>{ spacing: 20 }</xstr>" + "" + "<xstr id='metric:checkbox' theme='normal'>" + " { adjust_size: [ 2, 4 ], adjust_position: [ -2, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr>" + "<xstr id='metric:checkbox' theme='small'>" + " { adjust_size: [ 1, 4 ], adjust_position: [ -1, -2 ], outset: [ 1, 2, 0, 1 ], adjust_baseline: -2 }</xstr>" + "<xstr id='metric:checkbox' theme='mini'>" + " { adjust_size: [ 0, 1 ], adjust_position: [ 0, -1 ], outset: [ 0, 1, 0, 0 ], adjust_baseline: -1 }</xstr>" + "" + "<xstr id='metric:radio_button' theme='normal'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ -2, -2 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -2 }</xstr>" + "<xstr id='metric:radio_button' theme='small'>" + " { adjust_size: [ 0, 2 ], adjust_position: [ 0, -1 ], outset: [ 0, 0, 0, 1 ] }</xstr>" + "<xstr id='metric:radio_button' theme='mini'>" + " { adjust_size: [ 0, 1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 0, 1 ] }</xstr>" + "" + "<xstr id='metric:button' theme='normal'>" + " { adjust_size: [ 0, -1 ], outset: [ 1, 0, 1, 2 ] }</xstr>" + "<xstr id='metric:button' theme='small'>" + " { adjust_size: [ -2, 2 ], adjust_position: [ 1, -1 ], outset: [ 0, 0, 0, 1 ], adjust_baseline: -2 }</xstr>" + "<xstr id='metric:button' theme='mini'>" + " { adjust_size: [ 2, 5 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: -3 }</xstr>" + "" + "<xstr id='metric:group' label='true' theme='normal'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr>" + "<xstr id='metric:group' label='true' theme='small'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 2, 1, 1 ], spacing: 20 }</xstr>" + "<xstr id='metric:group' label='true' theme='mini'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 3, 1, 1 ], spacing: 20 }</xstr>" + "" + "<xstr id='metric:group' label='false' theme='normal'>" + " { adjust_size: [ 0, 1 ], frame: [ 1, 4, 1, 1 ] }</xstr>" + "<xstr id='metric:group' label='false' theme='small'>" + " { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr>" + "<xstr id='metric:group' label='false' theme='mini'>" + " { adjust_size: [ 0, 1 ], frame: [ 1, 2, 1, 1 ] }</xstr>" + "" + "<xstr id='metric:tab_group' theme='normal'>" + " { adjust_size: [ 0, 8 ], adjust_position: [ 0, -7 ], frame: [ 1, 8, 1, 1 ], spacing: 24 }</xstr>" + "<xstr id='metric:tab_group' theme='small'>" + " { adjust_size: [ 0, 5 ], adjust_position: [ 0, -4 ], frame: [ 1, 8, 1, 1 ], spacing: 19 }</xstr>" + "<xstr id='metric:tab_group' theme='mini'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], frame: [ 1, 6, 1, 1 ], spacing: 16 }</xstr>" + "" + "<xstr id='metric:static_text' theme='normal'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -3 ], adjust_baseline: -3 }</xstr>" + "<xstr id='metric:static_text' theme='small'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr>" + "<xstr id='metric:static_text' theme='mini'>" + " { adjust_size: [ 0, 3 ], adjust_position: [ 0, -2 ], adjust_baseline: -2 }</xstr>" + "" + "<xstr id='metric:edit_text' scroll='false' theme='normal'>" + " { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr>" + "<xstr id='metric:edit_text' scroll='false' theme='small'>" + " { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr>" + "<xstr id='metric:edit_text' scroll='false' theme='mini'>" + " { adjust_size: [ -6, -6 ], adjust_position: [ 3, 3 ], outset: [ 3, 3, 3, 3 ], adjust_baseline: 3 }</xstr>" + "" + "<xstr id='metric:edit_text' scroll='true' theme='normal'>" + " { }</xstr>" + "<xstr id='metric:edit_text' scroll='true' theme='small'>" + " { }</xstr>" + "<xstr id='metric:edit_text' scroll='true' theme='mini'>" + " { }</xstr>" + "" + "<xstr id='metric:popup' label='false' theme='normal'>" + " { adjust_size: [ 1, -1 ], adjust_position: [ -1, 0 ], outset: [ 1, 0, 1, 1 ] }</xstr>" + "<xstr id='metric:popup' label='false' theme='small'>" + " { adjust_size: [ 1, -1 ], adjust_position: [ 1, 0 ], outset: [ 1, 0, 1, 1 ], adjust_baseline: 1 }</xstr>" + "<xstr id='metric:popup' label='false' theme='mini'>" + " { adjust_size: [ 2, 0 ], adjust_position: [ -1, 0 ] }</xstr>" + "" + "<xstr id='metric:popup' label='true' theme='normal'>" + " { adjust_size: [ 0, -1 ], outset: [ 0, 0, 1, 1 ] }</xstr>" + "<xstr id='metric:popup' label='true' theme='small'>" + " { adjust_size: [ 1, -1 ], adjust_position: [ 0, 0 ], outset: [ 0, 0, 1, 1 ], adjust_baseline: 1 }</xstr>" + "<xstr id='metric:popup' label='true' theme='mini'>" + " { adjust_size: [ 1, 0 ] }</xstr>" + ; + + /****************************************************************************************************/ + ADOBE_THREAD_LOCAL_STORAGE(adobe::virtual_machine_t, metrics_vm) *************** *** 38,41 **** --- 123,139 ---- ADOBE_THREAD_LOCAL_STORAGE_INITIALIZE(metrics_vm); + + // initialize the mac-specific metrics glossary + // we have to make a copy of the buffer because the parsing context takes ownership of it. + + std::size_t metrics_len(std::strlen(mac_metrics_g)); + char* metrics_data(new char[metrics_len] + 1); + + std::copy(&mac_metrics_g[0], &mac_metrics_g[0] + metrics_len, &metrics_data[0]); + + metrics_data[metrics_len] = 0; + + static adobe::xstring_context_t mac_metrics_context(&metrics_data[0], &metrics_data[metrics_len], + adobe::line_position_t( "mac metrics" ) ); } --- NEW FILE: image_t_impl.cpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /****************************************************************************************************/ #include <adobe/future/widgets/headers/image_t.hpp> #include "image_t_impl.hpp" #include "display.hpp" #include "ui_overlay.hpp" /****************************************************************************************************/ namespace adobe { /****************************************************************************************************/ ADOBE_WIDGET_TAG_BOILERPLATE(adobe::image_t::implementation_t, "<xstr id='metric:label'/>"); /****************************************************************************************************/ struct label_holder_t { GIL::rgba8_view* view_m; GIL::rgba8_view::iterator first_m; GIL::rgba8_view::iterator last_m; std::size_t size_m; }; /****************************************************************************************************/ void provider_skip_bytes ( void *info, std::size_t count ) { label_holder_t& holder(*reinterpret_cast<label_holder_t*>(info)); assert (count % 4 == 0); std::size_t adv_count(count / 4); holder.first_m += adv_count; holder.size_m -= adv_count; } /****************************************************************************************************/ std::size_t provider_get_bytes ( void *info, void *buffer, std::size_t count ) { assert (count % 4 == 0); label_holder_t& holder(*reinterpret_cast<label_holder_t*>(info)); if (holder.first_m == holder.last_m) return 0; std::size_t dst_pixel_count(count / 4); std::size_t to_copy(std::min(holder.size_m, dst_pixel_count)); GIL::rgba8_view::iterator src_end(holder.first_m + to_copy); GIL::rgba8_pixel* buffer_pixel(static_cast<GIL::rgba8_pixel*>(buffer)); std::copy(holder.first_m, src_end, buffer_pixel); provider_skip_bytes(info, count); return to_copy * 4; } /****************************************************************************************************/ void provider_rewind_bytes ( void *info ) { label_holder_t& holder(*reinterpret_cast<label_holder_t*>(info)); holder.first_m = holder.view_m->begin(); holder.size_m = holder.view_m->size(); } /****************************************************************************************************/ pascal void draw_label_image(ControlRef control, SInt16) try { assert(control); adobe::image_t::implementation_t& label(*reinterpret_cast<adobe::image_t::implementation_t*>(::GetControlReference(control))); ::WindowRef our_window(::GetControlOwner(control)); ::CGrafPtr window_port(::GetWindowPort(our_window)); ::CGContextRef context(0); ::Rect window_bounds = { 0 }; ::Rect bounds = { 0 }; ::GetWindowBounds(our_window, kWindowContentRgn, &window_bounds); implementation::get_bounds(control, bounds, true); ADOBE_REQUIRE_STATUS(::QDBeginCGContext(window_port, &context)); ::CGContextTranslateCTM(context, 0.0, static_cast<float>(window_bounds.bottom - window_bounds.top - 1)); ::CGContextScaleCTM(context, 1.0, -1.0); ::CGContextSetLineWidth(context, 1); ::CGContextSetShouldAntialias(context, false); GIL::rgba8_view view(GIL::view(label.image_m)); label_holder_t holder; holder.view_m = &view; holder.first_m = view.begin(); holder.last_m = view.end(); holder.size_m = view.size(); ::CGDataProviderCallbacks cg_callbacks; cg_callbacks.getBytes = &provider_get_bytes; cg_callbacks.skipBytes = &provider_skip_bytes; cg_callbacks.rewind = &provider_rewind_bytes; cg_callbacks.releaseProvider = NULL; // REVISIT (fbrereto) release me ::CGDataProviderRef provider(::CGDataProviderCreate ( &holder, &cg_callbacks )); // REVISIT (fbrereto) release me ::CGColorSpaceRef rgb_colorspace(::CGColorSpaceCreateDeviceRGB()); std::size_t image_width(view.width()); std::size_t image_height(view.height()); std::size_t bits_per_component(8); std::size_t bits_per_pixel(32); std::size_t bytes_per_row(4 * image_width); adobe::auto_resource< ::CGImageRef > auto_image(::CGImageCreate( image_width, image_height, bits_per_component, bits_per_pixel, bytes_per_row, rgb_colorspace, kCGImageAlphaLast/* | kCGBitmapByteOrderDefault*/, provider, 0, false, /* no pixel interpolation */ kCGRenderingIntentDefault /* no gamut correction */ )); // what we're going to want to do here is call CGImageCreate with a CGDataProviderRef // that has been bound to the image data so we can fetch it when the OS asks for it. float x(bounds.left); float y(bounds.top - 1); float width(bounds.right - x); float height(bounds.bottom - y - 1); ::CGContextDrawImage(context, ::CGRectMake(x, y, width, height), auto_image.get()); // Final actions ::CGContextSynchronize(context); ADOBE_REQUIRE_STATUS(::QDEndCGContext(window_port, &context)); } catch (const adobe::stream_error_t& err) { adobe::report_ui_element_error(adobe::format_stream_error(err)); } catch (const std::exception& err) { adobe::report_ui_element_error(std::string("Exception: ") + err.what()); } catch (...) { adobe::report_ui_element_error("Exception: Unknown"); } /****************************************************************************************************/ ControlUserPaneDrawUPP draw_handler_upp() { static adobe::auto_resource< ::ControlUserPaneDrawUPP > draw_handler_s(::NewControlUserPaneDrawUPP(draw_label_image)); return draw_handler_s.get(); } /****************************************************************************************************/ image_t::implementation_t::implementation_t(GIL::rgba8_image& image) : image_m(image) { initialize(); } /****************************************************************************************************/ image_t::implementation_t::implementation_t(const implementation_t& rhs) : image_m(rhs.image_m) { initialize(); } /****************************************************************************************************/ image_t::implementation_t& image_t::implementation_t::operator= (const implementation_t& rhs) { image_m = rhs.image_m; initialize(); return *this; } /****************************************************************************************************/ void image_t::implementation_t::initialize() { ::Rect bounds = { 0, 0, image_m.width(), image_m.height() }; ::ControlRef tmp_control; ::ADOBE_REQUIRE_STATUS(::CreateUserPaneControl(0, &bounds, 0, &tmp_control)); control_m.reset(tmp_control); ::SetControlReference(control_m.get(), reinterpret_cast< ::SInt32 >(this)); implementation::set_widget_data(control_m.get(), kControlEntireControl, kControlUserPaneDrawProcTag, draw_handler_upp()); } /****************************************************************************************************/ extents_t image_t::implementation_t::measure() { extents_t result; ::Rect bounds = { 0 }; implementation::get_bounds(control_m.get(), bounds); result.width() = bounds.right - bounds.left; result.height() = bounds.bottom - bounds.top; return result; } /****************************************************************************************************/ void image_t::implementation_t::place(const point_2d_t& position, const extents_t& extents) { implementation::set_bounds(*this, position, extents); } /****************************************************************************************************/ void image_t::implementation_t::enable(bool /*make_enabled*/) { } /****************************************************************************************************/ void image_t::implementation_t::set(GIL::rgba8_image& image) { image_m = image; implementation::set_refresh(control_m); } /****************************************************************************************************/ template <> ::HIViewRef view_for_element< ::HIViewRef, adobe::image_t >(adobe::image_t& widget) { return widget.implementation().control_m.get(); } /****************************************************************************************************/ template <> \ display_t::position_t insert<adobe::image_t>(display_t& display, display_t::position_t& parent, adobe::image_t& element) { ::HIViewRef ref(adobe::view_for_element< ::HIViewRef >(element)); return display.insert< ::HIViewRef >(parent, ref); } /****************************************************************************************************/ } // namespace adobe /****************************************************************************************************/ Index: os_utilities.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/os_utilities.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** os_utilities.cpp 23 Feb 2006 23:28:55 -0000 1.2 --- os_utilities.cpp 27 Feb 2006 20:41:59 -0000 1.3 *************** *** 75,79 **** template <> ! std::string get_field_text< ::ControlRef >(::ControlRef& control) { if (!control) return std::string(); --- 75,79 ---- template <> ! std::string get_field_text< ::ControlRef >(const ::ControlRef& control) { if (!control) return std::string(); *************** *** 90,94 **** /****************************************************************************************************/ ! std::string get_name(const ::ControlRef& control) { assert (control); --- 90,95 ---- /****************************************************************************************************/ ! template <> ! std::string get_name< ::ControlRef >(const ::ControlRef& control) { assert (control); *************** *** 105,109 **** /****************************************************************************************************/ ! std::string get_name(const ::WindowRef& window) { assert(window); --- 106,111 ---- /****************************************************************************************************/ ! template <> ! std::string get_name< ::WindowRef >(const ::WindowRef& window) { assert(window); *************** *** 206,210 **** /****************************************************************************************************/ ! adobe::extents_t measure(::ControlRef& control) { assert(control); --- 208,213 ---- /****************************************************************************************************/ ! template<> ! adobe::extents_t measure< ::ControlRef >(const ::ControlRef& control) { assert(control); *************** *** 357,361 **** /****************************************************************************************************/ ! void set_bounds(::ControlRef control, const ::Rect& new_bounds) { assert(control); --- 360,365 ---- /****************************************************************************************************/ ! template<> ! void set_bounds< ::ControlRef >(::ControlRef& control, const ::Rect& new_bounds) { assert(control); *************** *** 508,511 **** --- 512,597 ---- /****************************************************************************************************/ + // + /// 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 ); + } + + /****************************************************************************************************/ + + bool pick_save_path(boost::filesystem::path& path) + { + ::NavDialogRef nav_dialog; + ::NavDialogCreationOptions nav_options; + + ::NavGetDefaultDialogCreationOptions(&nav_options); + + ::NavCreatePutFileDialog(&nav_options, + OSType('utf8'), + OSType('R*ch'), // BBEdit + 0, + 0, + &nav_dialog); + + adobe::auto_resource< ::NavDialogRef > auto_nav_dialog(nav_dialog); + + ::NavDialogRun(nav_dialog); + + ::NavUserAction user_action = ::NavDialogGetUserAction(nav_dialog); + + if (user_action != kNavUserActionCancel && user_action != kNavUserActionNone) + { + ::NavReplyRecord reply; + + ::NavDialogGetReply(nav_dialog, &reply); + + adobe::auto_resource< ::NavReplyRecord* > auto_reply(&reply); + + // filter out the answer from the reply + if (reply.validRecord) + { + ::FSRef file; + ::Size actual_size; + ::AEKeyword keyword; + ::DescType type_code; + + ::AEGetNthPtr( &reply.selection, 1, typeFSRef, &keyword, &type_code, + (Ptr) &file, sizeof(file), (actual_size = sizeof(file), &actual_size)); + + path = fsref_to_path(file); + + path /= implementation::cfstring_to_string(reply.saveFileName); + + return true; + } + } + + return false; + } + + /****************************************************************************************************/ + } // namespace implementation Index: ui_core_implementation.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/ui_core_implementation.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ui_core_implementation.cpp 23 Feb 2006 23:28:55 -0000 1.11 --- ui_core_implementation.cpp 27 Feb 2006 20:41:59 -0000 1.12 *************** *** 25,28 **** --- 25,31 ---- #include <adobe/future/memory.hpp> + #include <adobe/gil/core/image_view_factory.hpp> + #include <adobe/gil/core/algorithm.hpp> + #include <boost/type_traits.hpp> #include <boost/cstdint.hpp> *************** *** 944,948 **** template <> ! void shed_fudges<panel_t::implementation_t>(const panel_t::implementation_t& control, adobe::point_2d_t& position, adobe::extents_t& extents) { /* --- 947,951 ---- template <> ! void shed_fudges<panel_t::implementation_t>(panel_t::implementation_t& control, adobe::point_2d_t& position, adobe::extents_t& extents) { /* *************** *** 1890,1894 **** template <> ! std::string get_field_text<adobe::edit_text_t::implementation_t>(adobe::edit_text_t::implementation_t& widget) { if (!widget.control_m) --- 1893,1897 ---- template <> ! std::string get_field_text<adobe::edit_text_t::implementation_t>(const adobe::edit_text_t::implementation_t& widget) { if (!widget.control_m) *************** *** 1914,1918 **** implementation::get_widget_data(widget.control_m, kControlEntireControl, kControlEditTextCFStringTag, cfstring); ! adobe::auto_resource< ::CFStringRef > auto_cfstring(cfstring); return implementation::cfstring_to_string(auto_cfstring); --- 1917,1921 ---- implementation::get_widget_data(widget.control_m, kControlEntireControl, kControlEditTextCFStringTag, cfstring); ! auto_cfstring_t auto_cfstring(cfstring); return implementation::cfstring_to_string(auto_cfstring); *************** *** 2121,2126 **** theme_m(adobe::theme_normal_s), scroll_control_m(0), - name_m("dummy", 0, adobe::theme_normal_s), - static_disabled_text_m("dummy", 0, adobe::theme_normal_s), static_disabled_m(false), using_label_m(false), --- 2124,2127 ---- *************** *** 2138,2144 **** control_m(0), scroll_control_m(rhs.scroll_control_m), - name_m(rhs.name_m), field_text_m(rhs.field_text_m), - static_disabled_text_m(rhs.static_disabled_text_m), static_disabled_m(rhs.static_disabled_m), using_label_m(rhs.using_label_m), --- 2139,2143 ---- *************** *** 2159,2163 **** implementation::get_bounds(rhs.control_m, bounds); ! initialize(bounds, implementation::get_name(name_m.implementation()), scrollable_m, password_m, cols_m, rows_m); set_theme(rhs.theme_m); --- 2158,2171 ---- implementation::get_bounds(rhs.control_m, bounds); ! if (rhs.name_m.get()) ! ! initialize( bounds, ! rhs.name_m.get() ? ! implementation::get_name(rhs.name_m->implementation()) : ! std::string(), ! scrollable_m, ! password_m, ! cols_m, ! rows_m); set_theme(rhs.theme_m); *************** *** 2248,2252 **** if (using_label_m) ! get_label() = label_t(name, 0, theme_m); } --- 2256,2260 ---- if (using_label_m) ! name_m.reset(new label_t(name, 0, theme_m)); } *************** *** 2258,2262 **** extents_t result; ! std::string base_text(cols_m, std::string::value_type('0')); if (rows_m > 1) --- 2266,2270 ---- extents_t result; ! std::string base_text(cols_m * 2, std::string::value_type('0')); if (rows_m > 1) *************** *** 2264,2267 **** --- 2272,2279 ---- result = measure_label_text(base_text, theme_m); + // REVISIT (fbrereto) : There is an issue here where the attributes of an edit_text + // widget don't propagate properly to a static_text widget, so + // measurement is inherently inaccurate. A better solution should + // be found than simply doubling the row count. result.height() *= rows_m; } *************** *** 2372,2377 **** rect.height() = bounds.bottom - bounds.top; rect.width() = bounds.right - bounds.left; - - static_disabled_text_m.place(position, rect); } } --- 2384,2387 ---- *************** *** 2402,2410 **** rect.width() = bounds.right - bounds.left; ! static_disabled_text_m = label_t(implementation::get_field_text(*this), 0, theme_m); ! static_disabled_text_m.place(position, rect); } set_visible(active); //static_disabled_text_m.set_visible(!active); } --- 2412,2429 ---- rect.width() = bounds.right - bounds.left; ! static_disabled_label_m.reset(new label_t(implementation::get_field_text(*this), 0, theme_m)); ! static_disabled_label_m->place(position, rect); ! } ! else ! { ! static_disabled_label_m.reset(0); } set_visible(active); + + // REVISIT : (fbrereto) Should we be disabling the label, or only the edit field? + //if (using_label_m && !static_disabled_m) + // get_label().set_active(active); + //static_disabled_text_m.set_visible(!active); } *************** *** 2553,2557 **** /****************************************************************************************************/ ! std::string get_popup_menu_item_text(adobe::popup_t::implementation_t& widget, ::UInt16 index) { ::MenuRef menu(0); --- 2572,2576 ---- /****************************************************************************************************/ ! std::string get_popup_menu_item_text(const adobe::popup_t::implementation_t& widget, ::UInt16 index) { ::MenuRef menu(0); *************** *** 2562,2566 **** ADOBE_REQUIRE_STATUS(::CopyMenuItemTextAsCFString(menu, index, &menu_item)); ! adobe::auto_resource< ::CFStringRef > auto_string(menu_item); return implementation::cfstring_to_string(menu_item); --- 2581,2585 ---- ADOBE_REQUIRE_STATUS(::CopyMenuItemTextAsCFString(menu, index, &menu_item)); ! auto_cfstring_t auto_string(menu_item); return implementation::cfstring_to_string(menu_item); *************** *** 2602,2606 **** template <> ! std::string get_field_text<adobe::popup_t::implementation_t>(adobe::popup_t::implementation_t& widget) { ::UInt16 value(static_cast< ::UInt16 >(implementation::get_value(widget))); --- 2621,2625 ---- template <> ! std::string get_field_text<adobe::popup_t::implementation_t>(const adobe::popup_t::implementation_t& widget) { ::UInt16 value(static_cast< ::UInt16 >(implementation::get_value(widget))); *************** *** 2698,2702 **** control_m(0), theme_m(adobe::theme_normal_s), - static_disabled_text_m("dummy", 0, adobe::theme_normal_s), static_disabled_m(false), using_label_m(false), --- 2717,2720 ---- *************** *** 2708,2712 **** popup_t::implementation_t::implementation_t(const implementation_t& rhs) : control_m(0), - static_disabled_text_m(rhs.static_disabled_text_m), static_disabled_m(rhs.static_disabled_m), value_handler_m(*this) --- 2726,2729 ---- *************** *** 2783,2787 **** rect.width() = bounds.right - bounds.left; ! static_disabled_text_m.place(position, rect); } } --- 2800,2804 ---- rect.width() = bounds.right - bounds.left; ! //static_disabled_text_m.place(position, rect); } } *************** *** 2811,2816 **** rect.width() = bounds.right - bounds.left; ! static_disabled_text_m = label_t(implementation::get_field_text(*this), 0, theme_m); ! static_disabled_text_m.place(position, rect); } --- 2828,2833 ---- rect.width() = bounds.right - bounds.left; ! //static_disabled_text_m = label_t(implementation::get_field_text(*this), 0, theme_m); ! //static_disabled_text_m.place(position, rect); } *************** *** 2828,2832 **** implementation::set_theme(*this, theme); ! static_disabled_text_m = label_t("dummy", 0, theme_m); } --- 2845,2849 ---- implementation::set_theme(*this, theme); ! //static_disabled_text_m = label_t("dummy", 0, theme_m); } *************** *** 2837,2841 **** implementation::adorn_theme(*this, theme); ! static_disabled_text_m = label_t("dummy", 0, theme_m); } --- 2854,2858 ---- implementation::adorn_theme(*this, theme); ! //static_disabled_text_m = label_t("dummy", 0, theme_m); } *************** *** 2846,2850 **** implementation::unadorn_theme(*this, theme); ! static_disabled_text_m = label_t("dummy", 0, theme_m); } --- 2863,2867 ---- implementation::unadorn_theme(*this, theme); ! //static_disabled_text_m = label_t("dummy", 0, theme_m); } *************** *** 3006,3010 **** implementation::get_name(get_edit_text().implementation()), using_popup_m, ! get_edit_text().implementation().cols_m, get_edit_text().implementation().rows_m); } --- 3023,3027 ---- implementation::get_name(get_edit_text().implementation()), using_popup_m, ! get_edit_text().implementation().cols_m * 2, get_edit_text().implementation().rows_m); } *************** *** 3020,3024 **** using_popup_m = using_popup; ! get_edit_text().initialize(name, false, false, cols, rows); if (using_popup_m) --- 3037,3041 ---- using_popup_m = using_popup; ! get_edit_text().initialize(name, false, false, cols / 2, rows); if (using_popup_m) *************** *** 3411,3417 **** { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().static_disabled_text_m)); HIViewRef scroll_ref(adobe::view_for_element<HIViewRef>(element.implementation().scroll_control_m)); - HIViewRef label_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_label())); display_t::position_t result; --- 3428,3433 ---- { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! // HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().static_disabled_text_m)); HIViewRef scroll_ref(adobe::view_for_element<HIViewRef>(element.implementation().scroll_control_m)); display_t::position_t result; *************** *** 3420,3425 **** else result = display.insert<HIViewRef>(parent, ref); ! if (label_ref) display.insert<HIViewRef>(parent, label_ref); ! if (static_disable_ref) display.insert<HIViewRef>(parent, static_disable_ref); return result; --- 3436,3448 ---- else result = display.insert<HIViewRef>(parent, ref); ! if (element.implementation().using_label_m) ! { ! HIViewRef label_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_label())); ! ! display.insert<HIViewRef>(parent, label_ref); ! } ! ! // if (static_disable_ref) ! // display.insert<HIViewRef>(parent, static_disable_ref); return result; *************** *** 3435,3444 **** { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().static_disabled_text_m)); display_t::position_t result(display.insert<HIViewRef>(parent, ref)); ! if (static_disable_ref) ! display.insert<HIViewRef>(parent, static_disable_ref); return result; --- 3458,3467 ---- { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! // HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().static_disabled_text_m)); display_t::position_t result(display.insert<HIViewRef>(parent, ref)); ! // if (static_disable_ref) ! // display.insert<HIViewRef>(parent, static_disable_ref); return result; *************** *** 3456,3464 **** { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().static_disabled_text_m)); HIViewRef scroll_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().scroll_control_m)); - HIViewRef label_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().get_label())); HIViewRef popup_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_popup())); ! HIViewRef popup_static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_popup().implementation().static_disabled_text_m)); display_t::position_t result; --- 3479,3486 ---- { HIViewRef ref(adobe::view_for_element<HIViewRef>(element)); ! // HIViewRef static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().static_disabled_text_m)); HIViewRef scroll_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().scroll_control_m)); HIViewRef popup_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_popup())); ! // HIViewRef popup_static_disable_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_popup().implementation().static_disabled_text_m)); display_t::position_t result; *************** *** 3469,3478 **** result = display.insert<HIViewRef>(parent, ref); ! if (label_ref) display.insert<HIViewRef>(parent, label_ref); ! if (static_disable_ref) ! display.insert<HIViewRef>(parent, static_disable_ref); ! if (popup_static_disable_ref) ! display.insert<HIViewRef>(parent, popup_static_disable_ref); if (popup_ref) display.insert<HIViewRef>(parent, popup_ref); --- 3491,3505 ---- result = display.insert<HIViewRef>(parent, ref); ! if (element.implementation().get_edit_text().implementation().using_label_m) ! { ! ::HIViewRef label_ref(adobe::view_for_element<HIViewRef>(element.implementation().get_edit_text().implementation().get_label())); ! display.insert<HIViewRef>(parent, label_ref); ! } ! ! // if (static_disable_ref) ! // display.insert<HIViewRef>(parent, static_disable_ref); ! // if (popup_static_disable_ref) ! // display.insert<HIViewRef>(parent, popup_static_disable_ref); if (popup_ref) display.insert<HIViewRef>(parent, popup_ref); Index: label_t_impl.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/mac/label_t_impl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** label_t_impl.cpp 23 Feb 2006 23:28:55 -0000 1.1 --- label_t_impl.cpp 27 Feb 2006 20:41:59 -0000 1.2 *************** *** 27,35 **** std::string get_name<adobe::label_t::implementation_t>(const adobe::label_t::implementation_t& widget) { ! if (!widget.control_m) return std::string(); ::CFStringRef cfstring; ! get_widget_data(widget.control_m, kControlEntireControl, kControlStaticTextCFStringTag, cfstring); adobe::auto_resource< ::CFStringRef > auto_cfstring(cfstring); --- 27,35 ---- std::string get_name<adobe::label_t::implementation_t>(const adobe::label_t::implementation_t& widget) { ! if (!widget.control_m.get()) return std::string(); ::CFStringRef cfstring; ! get_widget_data(widget.control_m.get(), kControlEntireControl, kControlStaticTextCFStringTag, cfstring); adobe::auto_resource< ::CFStringRef > auto_cfstring(cfstring); *************** *** 44,48 **** { set_widget_data( ! control.control_m, kControlEntireControl, kControlStaticTextCFStringTag, --- 44,48 ---- { set_widget_data( ! control.control_m.get(), kControlEntireControl, kControlStaticTextCFStringTag, *************** *** 80,93 **** std::size_t characters, theme_t theme) : ! characters_m(0) #if 0 , hit_handler_m(*this) #endif { ! ::Rect bounds = { 0, 0, 2048, 2048 }; ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::localize_to_cfstring(name).get(), ! NULL, &control_m)); implementation::set_theme(*this, theme); --- 80,96 ---- std::size_t characters, theme_t theme) : ! characters_m(characters) #if 0 , hit_handler_m(*this) #endif { ! ::Rect bounds = { 0, 0, 2048, 2048 }; ! ::ControlRef tmp_control; ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::localize_to_cfstring(name).get(), ! NULL, &tmp_control)); ! ! control_m.reset(tmp_control); implementation::set_theme(*this, theme); *************** *** 102,112 **** #endif { ! ::Rect bounds = { 0 }; ! implementation::get_bounds(rhs.control_m, bounds); ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::string_to_cfstring(implementation::get_name(rhs)).get(), ! NULL, &control_m)); implementation::set_theme(*this, rhs.theme_m); --- 105,118 ---- #endif { ! ::Rect bounds = { 0 }; ! ::ControlRef tmp_control; ! implementation::get_bounds(rhs.control_m.get(), bounds); ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::string_to_cfstring(implementation::get_name(rhs)).get(), ! NULL, &tmp_control)); ! ! control_m.reset(tmp_control); implementation::set_theme(*this, rhs.theme_m); *************** *** 117,130 **** label_t::implementation_t& label_t::implementation_t::operator= (const implementation_t& rhs) { ! if (control_m) ! ::DisposeControl(control_m); ! ! ::Rect bounds = { 0 }; ! implementation::get_bounds(rhs.control_m, bounds); ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::string_to_cfstring(implementation::get_name(rhs)).get(), ! NULL, &control_m)); implementation::set_theme(*this, rhs.theme_m); --- 123,136 ---- label_t::implementation_t& label_t::implementation_t::operator= (const implementation_t& rhs) { ! ::Rect bounds = { 0 }; ! ::ControlRef tmp_control; ! implementation::get_bounds(rhs.control_m.get(), bounds); ADOBE_REQUIRE_STATUS(::CreateStaticTextControl( 0, &bounds, implementation::string_to_cfstring(implementation::get_name(rhs)).get(), ! NULL, &tmp_control)); ! ! control_m.reset(tmp_control); implementation::set_theme(*this, rhs.theme_m); *************** *** 137,155 **** extents_t::slice_t label_t::implementation_t::measure_horizontal() { ! assert(control_m); ! ! adobe::extents_t result; ! ::CFStringRef cfstring; ! ::Point io_bounds = { 0 }; ! ::SInt16 out_baseline(0); ! ! adobe::implementation::set_metric_extractor(*this); ! implementation::get_widget_data(control_m, kControlEntireControl, kControlStaticTextCFStringTag, cfstring); ! adobe::auto_resource< ::CFStringRef > auto_cfstring(cfstring); ::ADOBE_REQUIRE_STATUS(::GetThemeTextDimensions( ! cfstring, implementation::theme_to_ThemeFontID(theme_m), kThemeStateActive, --- 143,159 ---- extents_t::slice_t label_t::implementation_t::measure_horizontal() { ! assert(control_m.get()); ! adobe::extents_t result; ! ::Point io_bounds = { 0 }; ! ::SInt16 out_baseline(0); ! std::string base_text(characters_m != 0 ? ! std::string(characters_m * 2, std::string::value_type('0')) : ! implementation::get_name(*this)); ! adobe::auto_resource< ::CFStringRef > auto_cfstring(implementation::string_to_cfstring(base_text)); ::ADOBE_REQUIRE_STATUS(::GetThemeTextDimensions( ! auto_cfstring.get(), implementation::theme_to_ThemeFontID(theme_m), kThemeStateActive, *************** *** 169,173 **** extents_t::slice_t label_t::implementation_t::measure_vertical(const extents_t::slice_t& horizontal) { ! assert(control_m); ::Rect static_bounds = { 0, 0, 10, static_cast<short>(horizontal.length_m) }; --- 173,177 ---- extents_t::slice_t label_t::implementation_t::measure_vertical(const extents_t::slice_t& horizontal) { ! assert(control_m.get()); ::Rect static_bounds = { 0, 0, 10, static_cast<short>(horizontal.length_m) }; *************** *** 186,193 **** void label_t::implementation_t::signal_hit(const implementation::label_hit_proc_t& proc) { ! assert(control_m); hit_handler_m.set_user_data(proc); ! hit_handler_m.install(control_m); } #endif --- 190,197 ---- void label_t::implementation_t::signal_hit(const implementation::label_hit_proc_t& proc) { ! assert(control_m.get()); hit_handler_m.set_user_data(proc); ! hit_handler_m.install(control_m.get()); } #endif *************** *** 196,200 **** template <> ::HIViewRef view_for_element< ::HIViewRef, adobe::label_t >(adobe::label_t& widget) ! { return widget.implementation().control_m; } /****************************************************************************************************/ --- 200,204 ---- template <> ::HIViewRef view_for_element< ::HIViewRef, adobe::label_t >(adobe::label_t& widget) ! { return widget.implementation().control_m.get(); } /****************************************************************************************************/ |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:13
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/gil/extension/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/gil/extension/io Added Files: io_factory.hpp targa.hpp 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. --- NEW FILE: io_factory.hpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_GIL_EXTENSION_IO_FACTORY_HPP #define ADOBE_GIL_EXTENSION_IO_FACTORY_HPP /*************************************************************************************************/ #include <adobe/gil/extension/conceptspace/any_standard_image.hpp> #include <adobe/gil/core/image_view_factory.hpp> #include <adobe/gil/core/color_convert.hpp> #include <adobe/gil/core/algorithm.hpp> #include <adobe/gil/core/variant.hpp> #include <adobe/regular_object.hpp> #include <adobe/algorithm.hpp> #include <adobe/dictionary.hpp> #include <vector> #include <iostream> #include <cassert> /*************************************************************************************************/ ADOBE_GIL_NAMESPACE_BEGIN /*************************************************************************************************/ /*! image_io_dispatch is a struct that, by default, will call the procs in your class by the same name as they appear in the image_io GIL extension. If your class uses different names for detection, reading and writing, you'll want to write a specialization of this struct for your class that calls the right functions for the operations. */ template <typename T, typename ViewType> struct image_io_dispatch { typedef T value_type; typedef ViewType view_type; typedef GIL::image<view_type> image_type; inline bool detect(const value_type& value, std::streambuf& stream_buffer) const { return value.detect(stream_buffer); } inline void read(const value_type& value, image_type& image, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { value.read(image, stream_buffer, parameters); } inline void write(const value_type& value, const view_type& image_view, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { value.write(image_view, stream_buffer, parameters); } }; /*************************************************************************************************/ template <typename ViewType> class image_factory_t; /*************************************************************************************************/ /*! image_format_t is the regular_object wrapper for the file format io interface to a given format */ template <typename ViewType> class image_format_t { typedef ViewType view_type; typedef GIL::image<view_type> image_type; struct interface { virtual ~interface() { } virtual bool detect(std::streambuf& stream_buffer) const = 0; virtual void read(image_type& image, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const = 0; virtual void write(const view_type& image_view, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const = 0; }; template <typename T> // T models ImageFileIOType struct instance : adobe::regular_interface<interface> { typedef T value_type; instance(const value_type& x) : value(x) { } bool detect(std::streambuf& stream_buffer) const { return image_io_dispatch<value_type, view_type>().detect(value, stream_buffer); } void read(image_type& image, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { image_io_dispatch<value_type, view_type>().read(value, image, stream_buffer, parameters); } void write(const view_type& image_view, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { image_io_dispatch<value_type, view_type>().write(value, image_view, stream_buffer, parameters); } T value; }; public: template <typename T> // T models ImageFileIOType image_format_t(adobe::name_t tag, const T& f) : tag_m(tag), object_m(f) { } bool detect(std::streambuf& stream_buffer) const { return object_m->detect(stream_buffer); } adobe::name_t read(image_type& image, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { object_m->read(image, stream_buffer, parameters); return tag(); } void write(const view_type& image_view, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { object_m->write(image_view, stream_buffer, parameters); } adobe::name_t tag() const { return tag_m; } friend inline bool operator==(const image_format_t& x, const image_format_t& y) { return x.tag_m == y.tag_m; } private: adobe::name_t tag_m; adobe::regular_object<interface, instance> object_m; friend class image_factory_t<view_type>; }; /*************************************************************************************************/ template <typename ViewType> class image_factory_t { public: typedef ViewType view_type; typedef GIL::image<view_type> image_type; typedef image_format_t<view_type> image_format_type; typedef std::vector<image_format_type> format_set_t; typedef typename format_set_t::value_type value_type; typedef typename format_set_t::iterator iterator; typedef typename format_set_t::const_iterator const_iterator; template <typename O> O detect_all_for(std::streambuf& stream_buffer, O output) const { for (const_iterator first(format_set_m.begin()), last(format_set_m.end()); first != last; ++first) { if (first->detect(stream_buffer)) *output++ = first->tag(); } return output; } adobe::name_t read(image_type& image, std::streambuf& stream_buffer, adobe::name_t format_tag = adobe::name_t(), adobe::dictionary_t parameters = adobe::dictionary_t()) { return format_tag == adobe::name_t() ? detect_first_for(stream_buffer).read(image, stream_buffer, parameters) : find(format_tag)->read(image, stream_buffer, parameters); } void write(const view_type& image_view, std::streambuf& stream_buffer, adobe::name_t format_tag = adobe::name_t(), adobe::dictionary_t parameters = adobe::dictionary_t()) { format_tag == adobe::name_t() ? detect_first_for(stream_buffer).write(image_view, stream_buffer, parameters) : find(format_tag)->write(image_view, stream_buffer, parameters); } void register_format(const image_format_type& format) { format_set_m.push_back(format); } bool is_registered(adobe::name_t format_tag) { try { find(format_tag); } catch (...) { return false; } return true; } void unregister_format(adobe::name_t format_tag) { format_set_m.erase(find(format_tag)); } private: inline iterator find(adobe::name_t format_tag) { iterator result(adobe::find_if(format_set_m, boost::bind(adobe::compare_members(&value_type::tag_m, std::equal_to<adobe::name_t>()), format_tag, _1))); if (result == format_set_m.end()) throw std::runtime_error("gil: image_io: format not found"); return result; } value_type& detect_first_for(std::streambuf& stream_buffer) { iterator result(adobe::find_if(format_set_m, boost::bind(&value_type::detect, _1, boost::ref(stream_buffer)))); if (result == format_set_m.end()) throw std::runtime_error("gil: image_io: format not detected"); return *result; } format_set_t format_set_m; }; /*************************************************************************************************/ ADOBE_GIL_NAMESPACE_END /*************************************************************************************************/ #endif /*************************************************************************************************/ --- NEW FILE: targa.hpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #ifndef ADOBE_GIL_EXTENSION_IMAGE_IO_TARGA_HPP #define ADOBE_GIL_EXTENSION_IMAGE_IO_TARGA_HPP /*************************************************************************************************/ #include <adobe/gil/core/image_view_factory.hpp> #include <adobe/gil/core/color_convert.hpp> #include <adobe/gil/core/algorithm.hpp> #include <adobe/gil/core/variant.hpp> #include <adobe/gil/extension/argb/argb.hpp> #include <adobe/dictionary.hpp> #include <adobe/future/endian.hpp> #include <boost/cstdint.hpp> #include <stdexcept> /*************************************************************************************************/ ADOBE_GIL_NAMESPACE_BEGIN /*************************************************************************************************/ namespace detail { /*************************************************************************************************/ template <typename T1, typename T2> struct _color_converter<T1, rgb_tag, T2, rgba_tag> { template <typename P1, typename P2> void operator()(const P1& src, P2& dst) { dst.a=-1; dst.r=src.r; dst.g=src.g; dst.b=src.b; } }; /*************************************************************************************************/ } // namespace detail /*************************************************************************************************/ namespace implementation { /*************************************************************************************************/ struct targa_header_t { boost::uint8_t id_length_m; boost::uint8_t color_map_type_m; boost::uint8_t image_type_m; boost::uint16_t color_map_start_m; boost::uint16_t color_map_length_m; boost::uint8_t color_map_depth_m; boost::uint16_t x_offset_m; boost::uint16_t y_offset_m; boost::uint16_t width_m; boost::uint16_t height_m; boost::uint8_t pixel_depth_m; boost::uint8_t image_descriptor_m; }; /*************************************************************************************************/ enum targa_image_data_type { data_type_none_s = 0, data_type_colormapped_s = 1, data_type_truecolor_s = 2, data_type_monochrome_s = 3, data_type_colormapped_rle_s = 9, data_type_truecolor_rle_s = 10, data_type_monochrome_rle_s = 11 }; /*************************************************************************************************/ template <adobe::endian::type StreamEndian> struct streambuf_swizzler { enum { endian = StreamEndian }; explicit streambuf_swizzler(std::streambuf& buffer) : buf_m(buffer) { } template <typename T> void operator()(T& x) { enum { size = sizeof(T) }; if (buf_m.sgetn(reinterpret_cast<char*>(&x), size) != size) throw std::runtime_error("streambuf_swizzler read error"); adobe::endian_swap<StreamEndian>()(x); } template <typename T> void operator()(T* first, T* last) { enum { size = sizeof(T) }; std::streamsize total_size(static_cast<std::streamsize>(std::distance(first, last) * size)); if (buf_m.sgetn(reinterpret_cast<char*>(first), total_size) != total_size) throw std::runtime_error("streambuf_swizzler read error"); for (; first != last; ++first) adobe::endian_swap<StreamEndian>()(*first); } std::streambuf& buf_m; }; /****************************************************************************************************/ static void targa_read_header(std::streambuf& stream_buffer, targa_header_t& dst) { streambuf_swizzler<adobe::endian::little> reader(stream_buffer); // We read in the header chunks one contiguous type set at // a time to work around padding that may be introduced between // the different types to achieve word alignment. //reader(dst.id_length_m); //reader(dst.color_map_type_m); //reader(dst.image_type_m); reader(&dst.id_length_m, &dst.image_type_m + 1); //reader(dst.color_map_start_m); //reader(dst.color_map_length_m); reader(&dst.color_map_start_m, &dst.color_map_length_m + 1); reader(dst.color_map_depth_m); //reader(dst.x_offset_m); //reader(dst.y_offset_m); //reader(dst.width_m); //reader(dst.height_m); reader(&dst.x_offset_m, &dst.height_m + 1); //reader(dst.pixel_depth_m); //reader(dst.image_descriptor_m); reader(&dst.pixel_depth_m, &dst.image_descriptor_m + 1); } /*************************************************************************************************/ template <typename V, adobe::endian::type SourceEndian> void read_rle_pixels(GIL::image<V>& img, streambuf_swizzler<SourceEndian>& stream) { typedef typename GIL::image<V>::value_type value_type; typedef typename GIL::image<V>::iterator iterator; unsigned char rle_header; value_type rle_color; iterator first(img.begin()); iterator last(img.end()); while (first != last) { std::size_t num_pixels(0); stream(rle_header); if (rle_header & char(0x80)) // rle compressed data flag check { num_pixels = (rle_header & 0x7f) + 1; stream(rle_color); for (std::size_t i(0); i < num_pixels; ++i) { *first = rle_color; ++first; } } else // raw data { num_pixels = (rle_header + 1); std::vector<value_type> slurp(num_pixels); stream(&slurp[0], &slurp[0] + slurp.size()); first = std::transform(&slurp[0], &slurp[0] + slurp.size(), first, GIL::color_converter<value_type>()); } } } /*************************************************************************************************/ template <typename SourcePixelType, typename V, adobe::endian::type SourceEndian> void stuff_image(GIL::image<V>& img, streambuf_swizzler<SourceEndian>& stream, bool rle_compression) { typedef SourcePixelType* src_ptr; typedef GIL::pixel_xy_locator<GIL::pixel_step_iterator<src_ptr> > src_loc; typedef GIL::image_view<src_loc> src_view; typedef GIL::image<src_view, std::allocator<unsigned char> > src_image; typedef typename src_image::iterator src_iterator; typedef typename V::value_type dst_value_type; src_image src; GIL::resize_clobber_image(src, img.width(), img.height()); if (rle_compression) read_rle_pixels(src, stream); else { // REVISIT (fbrereto) : boost::bind me src_iterator src_first(src.begin()); src_iterator src_last(src.end()); for (; src_first != src_last; ++src_first) stream(*src_first); } std::transform(src.begin(), src.end(), img.begin(), GIL::color_converter<dst_value_type>()); } /*************************************************************************************************/ } // namespace implementation /*************************************************************************************************/ template <typename ViewType> class targa_t { private: typedef ViewType view_type; typedef GIL::image<view_type> image_type; public: bool detect(std::streambuf& stream_buffer) const; void read(image_type& img, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const; void write(const view_type& img_view, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const; friend inline bool operator==(const targa_t& x, const targa_t& y) { return true; } }; /*************************************************************************************************/ template <typename ConceptSpace> // REVISIT (fbrereto) : Maybe needs to be a ConceptSpaceView? class targa_variant_t { public: bool detect(std::streambuf& stream_buffer) const { return targa_t<GIL::argb8_view>().detect(stream_buffer); } template <typename C> void read(GIL::variant<C>& img, std::streambuf& stream_buffer, adobe::dictionary_t parameters = adobe::dictionary_t()) const { img = GIL::argb8_image(); targa_t<GIL::argb8_view>().read(img, stream_buffer, parameters); } template <typename CV> void write(const GIL::variant<CV>& /*img_view*/, std::streambuf& /*stream_buffer*/, adobe::dictionary_t /*parameters = adobe::dictionary_t()*/) const { throw std::runtime_error("gil: image_io: targa: specific format not supported"); } }; /*************************************************************************************************/ template <typename ViewType> bool targa_t<ViewType>::detect(std::streambuf& stream_buffer) const try { stream_buffer.pubseekpos(0); implementation::targa_header_t header; implementation::targa_read_header(stream_buffer, header); return (header.image_type_m == implementation::data_type_truecolor_s || header.image_type_m == implementation::data_type_truecolor_rle_s) && (header.pixel_depth_m == 24 || header.pixel_depth_m == 32); } catch (...) { return false; } /*************************************************************************************************/ template <typename ViewType> void targa_t<ViewType>::read(image_type& img, std::streambuf& stream_buffer, adobe::dictionary_t parameters) const { stream_buffer.pubseekpos(0); implementation::targa_header_t header; implementation::targa_read_header(stream_buffer, header); bool rle_compression(header.image_type_m == implementation::data_type_truecolor_rle_s); if (header.id_length_m) stream_buffer.pubseekpos(sizeof(header) + header.id_length_m); implementation::streambuf_swizzler<adobe::endian::little> stream(stream_buffer); GIL::resize_clobber_image(img, header.width_m, header.height_m); if (header.pixel_depth_m == 24) implementation::stuff_image<GIL::rgb8_pixel>(img, stream, rle_compression); else if (header.pixel_depth_m == 32) implementation::stuff_image<GIL::argb8_pixel>(img, stream, rle_compression); else throw std::runtime_error("gil: image_io: targa: specific format not supported"); } /*************************************************************************************************/ template <typename ViewType> void targa_t<ViewType>::write(const view_type& /*img_view*/, std::streambuf& /*stream_buffer*/, adobe::dictionary_t /*parameters*/) const { throw std::runtime_error("gil: image_io: targa: writing not supported"); } /*************************************************************************************************/ ADOBE_GIL_NAMESPACE_END /*************************************************************************************************/ #endif /*************************************************************************************************/ |
From: Foster B. <fos...@us...> - 2006-02-27 20:42:13
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil_io_factory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/gil_io_factory Added Files: Jamfile.v2 main.cpp test.tga 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. --- NEW FILE: Jamfile.v2 --- # Jamfile for building the GIL test app for the targa extension project adobe/targa ; run main.cpp ../../gil/extension/targa/targa.cpp ../../..//asl_dev ../../..//boost_filesystem : #args : ./test.tga : #requirements ; --- NEW FILE: test.tga --- (This appears to be a binary file; contents omitted.) --- NEW FILE: main.cpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/gil/extension/io_factory/io_factory.hpp> #include <adobe/gil/extension/targa/targa.hpp> #include <adobe/gil/core/image.hpp> #include <boost/filesystem/path.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/fstream.hpp> #include <iostream> #include <cassert> /*************************************************************************************************/ int main(int argc, char* argv[]) try { GIL::image_factory_t factory; boost::filesystem::path test_src(argc > 1 ? argv[1] : "", boost::filesystem::native); adobe::static_name_t targa_tag("targa"); GIL::any_image image; assert (boost::filesystem::exists(test_src)); boost::filesystem::filebuf filebuf; filebuf.open(test_src, std::ios_base::in | std::ios_base::binary); factory.register_format(GIL::image_format_t(targa_tag, GIL::targa_t())); assert (factory.is_registered(targa_tag)); assert (factory.read(image, filebuf) == targa_tag); #if 0 // no file format writing at this time GIL::any_view view(GIL::view(image)); factory.write(view, filebuf); #endif factory.unregister_format(targa_tag); assert (!factory.is_registered(targa_tag)); return 0; } catch (const std::exception& doh) { std::cerr << "Exception: " << doh.what() << std::endl; return 1; } catch (...) { std::cerr << "Exception: Unknown" << std::endl; return 1; } |